From 2f3d7bf698d8ddb46d87422e4e1d6a326745cdcb Mon Sep 17 00:00:00 2001 From: mschill Date: Tue, 25 Aug 2026 07:00:54 -0400 Subject: [PATCH] Moved to Old Repo Unused Solutions .bak files Old Referenced Objects Code / Correct ROEditor Code in PROMS\ReferencedObjects\Exe\RefObj\ROEditor LBWordLibrary - LBBozoComObject.cs, LBComObject.old.cs not part of solution PROMS folder (correct versions in VEPROMS) - dlgApproveProcedure.cs,dlgExportImport.cs,frmVEPROMS.cs,StepRTB.cs,VlnFlexGrid.cs,Grid2Pdf.cs,Rtf2iTextSharp.cs VEPROMS User Interface - Correct dlgChgId, FindReplace in Volian.Controls.Library VEPROMS.CSLA.Library - Remove cs files that are not part of project/solution Volian.Controls.Library - Remove cs files that are not part of project/solution --- .../AdjustBuildRevision.sln | 36 - PROMS/Formats/Formats.sln | 22 - PROMS/Formats/Production Formats.sln | 26 - PROMS/LBWordLibrary/LBBozoComObject.cs | 1751 ----- PROMS/LBWordLibrary/LBComObject.old.cs | 1617 ----- .../dlgApproveProcedure.cs | 1309 ---- .../VEPROMS User Interface/dlgExportImport.cs | 4287 ----------- .../VEPROMS User Interface/frmVEPROMS.cs | 3967 ----------- .../PROMS/Volian.Controls.Library/StepRTB.cs | 3705 ---------- .../Volian.Controls.Library/VlnFlexGrid.cs | 5035 ------------- PROMS/PROMS/Volian.Print.Library/Grid2Pdf.cs | 1536 ---- .../Volian.Print.Library/Rtf2iTextSharp.cs | 415 -- PROMS/PROMS/proms.sln | 111 - .../Exe/RefObj/ROEditor/AssemblyInfo.cs | 6 +- .../Exe/RefObj/ROEditor/ROEditor.sln | 212 - .../Exe/RefObj/ROEditor/ROEditor.vsscc | Bin 48 -> 0 bytes .../Exe/RefObj/ROEditor/ROEditor.csproj | 242 - .../Exe/RefObj/ROEditor/ROEditor.sln | 31 - .../LibSource/RODBInterface/RODBInterface.sln | 31 - .../Exe/RefObj/CmpRpt/App.ico | Bin 1078 -> 0 bytes .../Exe/RefObj/CmpRpt/AssemblyInfo.cs | 55 - .../Exe/RefObj/CmpRpt/AssemblyInfo.cs.bak | 58 - .../Exe/RefObj/CmpRpt/CmpRpt.cs | 206 - .../Exe/RefObj/CmpRpt/CmpRpt.csproj | 147 - .../Exe/RefObj/CmpRpt/CmpRpt.resx | 102 - .../Exe/RefObj/CmpRpt/CmpRpt.sln | 39 - .../Exe/RefObj/CmpRpt/app.config | 7 - .../Exe/RefObj/ParadoxConversion/App.ico | Bin 1078 -> 0 bytes .../RefObj/ParadoxConversion/AssemblyInfo.cs | 55 - .../ParadoxConversion/AssemblyInfo.cs.bak | 58 - .../ParadoxConversion/ConvertParadoxROs.cs | 1535 ---- .../Exe/RefObj/ParadoxConversion/Form1.cs | 351 - .../Exe/RefObj/ParadoxConversion/Form1.resx | 124 - .../ParadoxConversion.csproj | 129 - .../ParadoxConversion/ParadoxConversion.sln | 29 - .../Exe/RefObj/ParadoxConversion/ROConvrt.ico | Bin 1078 -> 0 bytes .../ParadoxConversion/RODBRecordInterface.cs | 352 - .../Exe/RefObj/ParadoxConversion/V.ico | Bin 1078 -> 0 bytes .../Exe/RefObj/ParadoxConversion/app.config | 6 - .../Exe/RefObj/ROEditor/About.cs | 184 - .../Exe/RefObj/ROEditor/About.resx | 4062 ----------- .../RefObj/ROEditor/AboutBckgnd_370x209.bmp | Bin 232464 -> 0 bytes .../Exe/RefObj/ROEditor/AboutBckgnd_80.bmp | Bin 166884 -> 0 bytes .../RefObj/ROEditor/AboutROEditor.Designer.cs | 499 -- .../Exe/RefObj/ROEditor/AboutROEditor.cs | 166 - .../Exe/RefObj/ROEditor/AboutROEditor.resx | 120 - .../Exe/RefObj/ROEditor/App.ico | Bin 1078 -> 0 bytes .../Exe/RefObj/ROEditor/AssemblyInfo.cs | 69 - .../Exe/RefObj/ROEditor/AssemblyInfo.cs.bak | 58 - .../Exe/RefObj/ROEditor/Cancel.ico | Bin 318 -> 0 bytes .../RefObj/ROEditor/Cert_prt_rgb_70x32.gif | Bin 1430 -> 0 bytes .../Exe/RefObj/ROEditor/Copy.ico | Bin 318 -> 0 bytes .../Exe/RefObj/ROEditor/FieldCombFrm.cs | 588 -- .../Exe/RefObj/ROEditor/FieldCombFrm.resx | 102 - .../Exe/RefObj/ROEditor/FieldTextFrm.cs | 425 -- .../Exe/RefObj/ROEditor/FieldTextFrm.resx | 102 - .../Exe/RefObj/ROEditor/FieldTypeDefFrm.cs | 435 -- .../Exe/RefObj/ROEditor/FieldTypeDefFrm.resx | 102 - .../Exe/RefObj/ROEditor/FixRev.Bat | 4 - .../Exe/RefObj/ROEditor/GroupDefFrm.cs | 667 -- .../Exe/RefObj/ROEditor/GroupDefFrm.resx | 102 - .../Exe/RefObj/ROEditor/GroupNewFrm.cs | 425 -- .../Exe/RefObj/ROEditor/GroupNewFrm.resx | 102 - .../ROEditor/Properties/Resources.Designer.cs | 70 - .../RefObj/ROEditor/Properties/Resources.resx | 124 - .../Exe/RefObj/ROEditor/RODefFrm.cs | 1219 ---- .../Exe/RefObj/ROEditor/RODefFrm.resx | 102 - .../Exe/RefObj/ROEditor/ROEditor.cs | 2577 ------- .../Exe/RefObj/ROEditor/ROEditor.csproj | 198 - .../Exe/RefObj/ROEditor/ROEditor.ico | Bin 766 -> 0 bytes .../Exe/RefObj/ROEditor/ROEditor.resx | 249 - .../Exe/RefObj/ROEditor/ROEditor.sln | 146 - .../Exe/RefObj/ROEditor/ROGROUPYellow.ICO | Bin 766 -> 0 bytes .../Exe/RefObj/ROEditor/RO_FST.cs | 876 --- .../RefObj/ROEditor/Red_V_txt_NB_bur_1984.png | Bin 37254 -> 0 bytes .../Exe/RefObj/ROEditor/Restore.ico | Bin 318 -> 0 bytes .../Exe/RefObj/ROEditor/Save.ico | Bin 318 -> 0 bytes .../Exe/RefObj/ROEditor/Zoom.ico | Bin 318 -> 0 bytes .../Exe/RefObj/ROEditor/app.config | 12 - .../LibSource/DBEncapsulation/AssemblyInfo.cs | 55 - .../DBEncapsulation/AssemblyInfo.cs.bak | 58 - .../LibSource/DBEncapsulation/DBEncap.cs | 205 - .../DBEncapsulation/DBEncapsulation.csproj | 106 - .../DBEncapsulation/DBEncapsulation.sln | 21 - .../LibSource/IniFileIO/AssemblyInfo.cpp | 58 - .../LibSource/IniFileIO/IniFileIO.cpp | 67 - .../LibSource/IniFileIO/IniFileIO.h | 35 - .../LibSource/IniFileIO/IniFileIO.sln | 21 - .../LibSource/IniFileIO/IniFileIO.vcproj | 238 - .../LibSource/IniFileIO/ReadMe.txt | 31 - .../LibSource/IniFileIO/Stdafx.cpp | 5 - .../LibSource/IniFileIO/Stdafx.h | 8 - .../LibSource/Org.Mentalis.Files/IniReader.cs | 428 -- .../Org.Mentalis.Files.csproj | 47 - .../Properties/AssemblyInfo.cs | 35 - .../Properties/AssemblyInfo.cs.bak | 36 - .../LibSource/RODBInterface/AssemblyInfo.cs | 55 - .../RODBInterface/AssemblyInfo.cs.bak | 58 - .../LibSource/RODBInterface/RODBInterface.cs | 3047 -------- .../RODBInterface/RODBInterface.csproj | 136 - .../LibSource/RODBInterface/RODBInterface.sln | 21 - .../LibSource/RODBInterface/VlnXml.cs | 1213 ---- .../LibSource/RODBInterface/userpass.cs | 188 - .../LibSource/RODBInterface/userpass.resx | 184 - .../LibSource/ROFST/AssemblyInfo.cs | 55 - .../LibSource/ROFST/AssemblyInfo.cs.bak | 58 - .../LibSource/ROFST/ROFST.cs | 3073 -------- .../LibSource/ROFST/ROFST.csproj | 115 - .../LibSource/ROFST/ROFST.sln | 19 - .../LibSource/ROField/AssemblyInfo.cs | 55 - .../LibSource/ROField/AssemblyInfo.cs.bak | 58 - .../LibSource/ROField/ROField.cs | 301 - .../LibSource/ROField/ROFields.csproj | 102 - .../LibSource/ROField/ROFields.sln | 21 - .../LibSource/Utils/About.cs | 268 - .../LibSource/Utils/About.resx | 4144 ----------- .../LibSource/Utils/AboutBckgnd_370x209.bmp | Bin 232464 -> 0 bytes .../LibSource/Utils/AssemblyInfo.cs | 55 - .../LibSource/Utils/AssemblyInfo.cs.bak | 57 - .../LibSource/Utils/CurSet.cs | 185 - .../LibSource/Utils/DTI.cs | 139 - .../LibSource/Utils/DirSpace.cs | 73 - .../LibSource/Utils/FmtFiles.cs | 75 - .../LibSource/Utils/MenuXML.cs | 58 - .../LibSource/Utils/PrivateProfile.cs | 256 - .../LibSource/Utils/Security.cs | 622 -- .../LibSource/Utils/SerialNo.cs | 295 - .../LibSource/Utils/ShrtNm.cs | 51 - .../LibSource/Utils/SymbDlg.cs | 214 - .../LibSource/Utils/SymbDlg.resx | 192 - .../LibSource/Utils/SymbLst.cs | 142 - .../LibSource/Utils/UsrRunTime.cs | 624 -- .../LibSource/Utils/Utils.csproj | 207 - .../LibSource/Utils/Utils.sln | 19 - .../LibSource/Utils/VEdt.cs | 98 - .../LibSource/Utils/ZipFuncs.cs | 647 -- .../LibSource/Utils/ZipFuncsDlg.cs | 164 - .../LibSource/Utils/ZipFuncsDlg.resx | 175 - .../LibSource/VlnProfiler/AssemblyInfo.cs | 55 - .../LibSource/VlnProfiler/AssemblyInfo.cs.bak | 58 - .../LibSource/VlnProfiler/VlnProfiler.cs | 71 - .../LibSource/VlnProfiler/VlnProfiler.csproj | 102 - .../LibSource/VlnProfiler/VlnProfiler.sln | 21 - .../LibSource/VlnStatus/AssemblyInfo.cs | 55 - .../LibSource/VlnStatus/AssemblyInfo.cs.bak | 58 - .../LibSource/VlnStatus/SpinnerFrm.cs | 164 - .../LibSource/VlnStatus/SpinnerFrm.resx | 157 - .../LibSource/VlnStatus/StatusBarFrm.cs | 232 - .../LibSource/VlnStatus/StatusBarFrm.resx | 157 - .../LibSource/VlnStatus/StatusMessageFrm.cs | 140 - .../LibSource/VlnStatus/StatusMessageFrm.resx | 139 - .../LibSource/VlnStatus/Test/App.ico | Bin 1078 -> 0 bytes .../LibSource/VlnStatus/Test/AssemblyInfo.cs | 55 - .../VlnStatus/Test/AssemblyInfo.cs.bak | 58 - .../LibSource/VlnStatus/Test/Form1.cs | 191 - .../LibSource/VlnStatus/Test/Form1.resx | 157 - .../LibSource/VlnStatus/Test/Test.csproj | 124 - .../LibSource/VlnStatus/VlnSpinner.cs | 167 - .../LibSource/VlnStatus/VlnStatus.csproj | 125 - .../LibSource/VlnStatus/VlnStatus.sln | 28 - .../LibSource/VlnStatus/VlnStatusBar.cs | 148 - .../LibSource/VlnStatus/VlnStatusMessage.cs | 79 - .../LibSource/ZZZNotUsed/CvtFont/CvtFont.cs | 175 - .../ZZZNotUsed/CvtFont/CvtFont.csproj | 47 - .../CvtFont/Properties/AssemblyInfo.cs | 35 - .../DirectoryAndFileAPI/AssemblyInfo.cpp | 58 - .../DirectoryAndFileAPI.cpp | 69 - .../DirectoryAndFileAPI/DirectoryAndFileAPI.h | 24 - .../DirectoryAndFileAPI.sln | 21 - .../DirectoryAndFileAPI.vcproj | 136 - .../ZZZNotUsed/DirectoryAndFileAPI/ReadMe.txt | 31 - .../ZZZNotUsed/DirectoryAndFileAPI/Stdafx.cpp | 5 - .../ZZZNotUsed/DirectoryAndFileAPI/Stdafx.h | 8 - .../ZZZNotUsed/FMTformat/AssemblyInfo.cs | 55 - .../ZZZNotUsed/FMTformat/AssemblyInfo.cs.bak | 58 - .../ZZZNotUsed/FMTformat/FMTformat.csproj | 105 - .../ZZZNotUsed/FMTformat/FMTformat.sln | 21 - .../ZZZNotUsed/FMTformat/FmtFileVars.cs | 2169 ------ .../LibSource/ZZZNotUsed/GUI_Utils/ArcData.cs | 143 - .../ZZZNotUsed/GUI_Utils/ArcData.resx | 174 - .../ZZZNotUsed/GUI_Utils/AssemblyInfo.cs | 55 - .../ZZZNotUsed/GUI_Utils/AssemblyInfo.cs.bak | 58 - .../ZZZNotUsed/GUI_Utils/GUI_Utils.csproj | 135 - .../ZZZNotUsed/GUI_Utils/GUI_Utils.sln | 21 - .../ZZZNotUsed/GUI_Utils/ReadWord.cs | 161 - .../ZZZNotUsed/GUI_Utils/ReadWord.resx | 183 - .../GUI_Utils/TreeViewMultiSelect.cs | 439 -- .../GUI_Utils/TreeViewMultiSelect.resx | 42 - .../LibSource/ZZZNotUsed/VDB/AssemblyInfo.cs | 55 - .../ZZZNotUsed/VDB/AssemblyInfo.cs.bak | 58 - .../ZZZNotUsed/VDB/EopToErgRelations.cs | 249 - .../ZZZNotUsed/VDB/ProcedureSelectionList.cs | 193 - .../VDB/ProcedureSelectionList.resx | 157 - .../LibSource/ZZZNotUsed/VDB/VDB.cs | 868 --- .../LibSource/ZZZNotUsed/VDB/VDB.csproj | 155 - .../LibSource/ZZZNotUsed/VDB/VDB.sln | 21 - .../LibSource/ZZZNotUsed/VDB/vdbConnType.cs | 66 - .../LibSource/ZZZNotUsed/VDB/vdb_Proc.cs | 553 -- .../LibSource/ZZZNotUsed/VDB/vdb_ROUsage.cs | 478 -- .../LibSource/ZZZNotUsed/VDB/vdb_Set.cs | 283 - .../LibSource/ZZZNotUsed/VDB/vdb_SetExt.cs | 255 - .../ZZZNotUsed/VDB/vdb_TransUsage.cs | 495 -- .../ZZZNotUsed/VEMessage/AssemblyInfo.cs | 55 - .../ZZZNotUsed/VEMessage/AssemblyInfo.cs.bak | 58 - .../ZZZNotUsed/VEMessage/VEMessage.cs | 113 - .../ZZZNotUsed/VEMessage/VEMessage.csproj | 105 - .../ZZZNotUsed/VEMessage/VEMessage.sln | 21 - .../ZZZNotUsed/VENetwork/AssemblyInfo.cs | 56 - .../ZZZNotUsed/VENetwork/AssemblyInfo.cs.bak | 59 - .../LibSource/ZZZNotUsed/VENetwork/LockDlg.cs | 147 - .../ZZZNotUsed/VENetwork/LockDlg.resx | 183 - .../ZZZNotUsed/VENetwork/LockInfoDlg.cs | 231 - .../ZZZNotUsed/VENetwork/LockInfoDlg.resx | 255 - .../ZZZNotUsed/VENetwork/LockRlsDlg.cs | 202 - .../ZZZNotUsed/VENetwork/LockRlsDlg.resx | 201 - .../ZZZNotUsed/VENetwork/MonUsrDlg.cs | 122 - .../ZZZNotUsed/VENetwork/MonUsrDlg.resx | 165 - .../LibSource/ZZZNotUsed/VENetwork/VEConn.cs | 576 -- .../LibSource/ZZZNotUsed/VENetwork/VELock.cs | 361 - .../ZZZNotUsed/VENetwork/VENetwork.csproj | 172 - .../ZZZNotUsed/VENetwork/VENetwork.sln | 21 - .../ZZZNotUsed/VENetwork/VETempFile.cs | 199 - .../ZZZNotUsed/VEObject/ARProperties.cs | 549 -- .../ZZZNotUsed/VEObject/ARProperties.resx | 201 - .../ZZZNotUsed/VEObject/AppConflict.cs | 293 - .../ZZZNotUsed/VEObject/AppIndItm.cs | 76 - .../ZZZNotUsed/VEObject/ApproveDlg.cs | 235 - .../ZZZNotUsed/VEObject/ApproveDlg.resx | 237 - .../ZZZNotUsed/VEObject/ApproveSelDlg.cs | 615 -- .../ZZZNotUsed/VEObject/ApproveSelDlg.resx | 255 - .../LibSource/ZZZNotUsed/VEObject/Archive.cs | 406 -- .../ZZZNotUsed/VEObject/AssemblyInfo.cs | 55 - .../ZZZNotUsed/VEObject/AssemblyInfo.cs.bak | 58 - .../LibSource/ZZZNotUsed/VEObject/DataPath.cs | 421 -- .../LibSource/ZZZNotUsed/VEObject/DataRoot.cs | 325 - .../ZZZNotUsed/VEObject/LDProperties.cs | 315 - .../ZZZNotUsed/VEObject/LDProperties.resx | 255 - .../LibSource/ZZZNotUsed/VEObject/LibDoc.cs | 403 -- .../ZZZNotUsed/VEObject/PSProperties.cs | 1281 ---- .../ZZZNotUsed/VEObject/PSProperties.resx | 435 -- .../LibSource/ZZZNotUsed/VEObject/Plant.cs | 701 -- .../ZZZNotUsed/VEObject/PrcProperties.cs | 415 -- .../ZZZNotUsed/VEObject/PrcProperties.resx | 264 - .../LibSource/ZZZNotUsed/VEObject/Proc.cs | 1587 ----- .../LibSource/ZZZNotUsed/VEObject/ProcExt.cs | 218 - .../LibSource/ZZZNotUsed/VEObject/ProcSet.cs | 4582 ------------ .../ZZZNotUsed/VEObject/Properties.cs | 237 - .../ZZZNotUsed/VEObject/Properties.resx | 201 - .../LibSource/ZZZNotUsed/VEObject/RO.cs | 436 -- .../LibSource/ZZZNotUsed/VEObject/RefList.cs | 121 - .../LibSource/ZZZNotUsed/VEObject/VEObject.cs | 810 --- .../ZZZNotUsed/VEObject/VEObject.csproj | 298 - .../ZZZNotUsed/VEObject/VEObject.sln | 21 - .../LibSource/ZZZNotUsed/VG/AssemblyInfo.cs | 55 - .../ZZZNotUsed/VG/AssemblyInfo.cs.bak | 58 - .../LibSource/ZZZNotUsed/VG/Test/App.ico | Bin 1078 -> 0 bytes .../ZZZNotUsed/VG/Test/AssemblyInfo.cs | 55 - .../ZZZNotUsed/VG/Test/AssemblyInfo.cs.bak | 56 - .../LibSource/ZZZNotUsed/VG/Test/Form1.cs | 227 - .../LibSource/ZZZNotUsed/VG/Test/Form1.resx | 157 - .../LibSource/ZZZNotUsed/VG/Test/Test.csproj | 133 - .../ZZZNotUsed/VG/Test/Test.csproj.bak | 137 - .../ZZZNotUsed/VG/Test/licenses.licx | 1 - .../LibSource/ZZZNotUsed/VG/VG.cs | 365 - .../LibSource/ZZZNotUsed/VG/VG.csproj | 111 - .../LibSource/ZZZNotUsed/VG/VG.sln | 29 - .../ZZZNotUsed/VerRelCpyrght/AssemblyInfo.cs | 55 - .../VerRelCpyrght/AssemblyInfo.cs.bak | 57 - .../ZZZNotUsed/VerRelCpyrght/VerRelCpy.cs | 249 - .../VerRelCpyrght/VerRelCpyrght.csproj | 100 - .../VerRelCpyrght/VerRelCpyrght.sln | 21 - .../ZZZNotUsed/VlnXml/AssemblyInfo.cs | 55 - .../ZZZNotUsed/VlnXml/AssemblyInfo.cs.bak | 58 - .../LibSource/ZZZNotUsed/VlnXml/VlnXml.cs | 211 - .../LibSource/ZZZNotUsed/VlnXml/VlnXml.csproj | 100 - .../ZZZNotUsed/WinExeClass/AssemblyInfo.cpp | 58 - .../ZZZNotUsed/WinExeClass/ReadMe.txt | 31 - .../ZZZNotUsed/WinExeClass/Stdafx.cpp | 5 - .../LibSource/ZZZNotUsed/WinExeClass/Stdafx.h | 8 - .../ZZZNotUsed/WinExeClass/WinExeClass.cpp | 142 - .../ZZZNotUsed/WinExeClass/WinExeClass.h | 44 - .../ZZZNotUsed/WinExeClass/WinExeClass.sln | 21 - .../ZZZNotUsed/WinExeClass/WinExeClass.vcproj | 156 - .../ZZZNotUsed/XYPlots/AssemblyInfo.cs | 55 - .../ZZZNotUsed/XYPlots/AssemblyInfo.cs.bak | 58 - .../ZZZNotUsed/XYPlots/Test XYPlots/App.ico | Bin 1078 -> 0 bytes .../XYPlots/Test XYPlots/AssemblyInfo.cs | 55 - .../XYPlots/Test XYPlots/AssemblyInfo.cs.bak | 58 - .../ZZZNotUsed/XYPlots/Test XYPlots/Form1.cs | 154 - .../XYPlots/Test XYPlots/Form1.resx | 184 - .../XYPlots/Test XYPlots/Test XYPlots.csproj | 140 - .../XYPlots/Test XYPlots/licenses.licx | 1 - .../LibSource/ZZZNotUsed/XYPlots/XYPlots.cs | 2226 ------ .../ZZZNotUsed/XYPlots/XYPlots.csproj | 122 - .../LibSource/ZZZNotUsed/XYPlots/XYPlots.sln | 29 - .../LibSource/ctlXMLEditLib/AssemblyInfo.cs | 55 - .../ctlXMLEditLib/AssemblyInfo.cs.bak | 57 - .../LibSource/ctlXMLEditLib/ImageDialog.cs | 119 - .../LibSource/ctlXMLEditLib/ImageDialog.resx | 102 - .../LibSource/ctlXMLEditLib/ZoomDialog.cs | 151 - .../LibSource/ctlXMLEditLib/ZoomDialog.resx | 120 - .../LibSource/ctlXMLEditLib/ctlXMLEdit.cs | 1670 ----- .../LibSource/ctlXMLEditLib/ctlXMLEdit.resx | 102 - .../ctlXMLEditLib/ctlXMLEditLib.csproj | 136 - .../LibSource/ctlXMLEditLib/ctlXMLEditLib.sln | 21 - PROMS/RoAccessToSql/RoAccessToSql.sln | 25 - .../VEPROMS User Interface/App - Copy.config | 158 - PROMS/VEPROMS User Interface/App.config.bak | 166 - .../DlgPrintProcedure.Designer.cs.bak | 1294 ---- .../DlgPrintProcedure.cs.bak | 878 --- .../FindReplace.Designer.cs | 381 - PROMS/VEPROMS User Interface/FindReplace.cs | 61 - PROMS/VEPROMS User Interface/FindReplace.resx | 143 - PROMS/VEPROMS User Interface/UCFDetails.xsl | 190 - PROMS/VEPROMS User Interface/UCFSummary.xsl | 16 - .../VEPROMS_UI.csproj.bak | 617 -- PROMS/VEPROMS User Interface/VEPROMS_UI.sln | 31 - .../dlgChgId.Designer.cs | 113 - PROMS/VEPROMS User Interface/dlgChgId.cs | 32 - PROMS/VEPROMS User Interface/dlgChgId.resx | 120 - .../dlgExportImport.cs.bak | 3988 ----------- .../frmBatchRefresh - Copy.cs | 1026 --- .../frmBatchRefresh - Copy.designer.cs | 472 -- .../frmBatchRefresh - Copy.resx | 123 - .../frmVEPROMS.Designer.cs.bak | 1582 ----- .../VEPROMS User Interface/frmVEPROMS.cs.bak | 2578 ------- .../frmVersionsProperties.Designer.cs.bak | 2136 ------ .../frmVersionsProperties.cs.bak | 1752 ----- .../Config/AssocConfig - Copy (2).cs | 120 - .../Config/AssocConfig - Copy.cs | 104 - .../Config/ProcConfig.cs.bak | 798 --- .../Config/ROFSTLookup MultiValRO.csx | 1115 --- .../Config/ROFSTLookup.cs.bak | 1156 --- .../Config/SectionConfig.cs.bak | 777 -- .../Config/SectionConfig.cs.org | 753 -- .../Config/StepConfig.cs.bak | 240 - .../Extension/AnnotationExt.cs.bak | 326 - .../Extension/AuditExt.cs.bak | 1790 ----- .../Extension/ContentExt.cs.bak | 509 -- .../Extension/ContentExt.cs.org | 343 - .../Extension/DisplayTextANSI.cs | 824 --- .../Extension/DocVersionExt.cs.bak | 512 -- .../Extension/DocumentExt.cs.bak | 1387 ---- .../Extension/GroupMembershipExt.cs | 15 - .../Extension/ItemExt.cs.bak | 3721 ---------- .../Extension/ItemInsertExt.cs.bak | 1081 --- .../Extension/ItemInsertExt.org | 401 -- .../Extension/LinkText.cs | 115 - .../Extension/MultiUserExt.cs.bak | 890 --- .../Extension/MultiUserExt.cs.org | 1286 ---- .../Extension/PermissionExt.cs | 91 - .../Extension/ROFSTExt.cs.bak | 808 --- .../Extension/ROFSTValue.cs | 195 - .../Extension/RevisionInfoExt.cs.bak | 1596 ----- .../Extension/RolePermissionExt.cs | 54 - .../Extension/Security/PermissionExt.cs | 91 - .../Extension/Security/RolePermissionExt.cs | 54 - .../Extension/Security/vlnValueKey.cs | 30 - .../Extension/TransitionExt.cs.bak | 1153 --- .../Extension/UserInfoListExt.cs | 17 - .../Extension/transtypes.TXT | 40 - .../Extension/transtypes.TXT.bak | 39 - .../Extension/vlnValueKey.cs | 30 - .../Format/DocStyles.cs.org | 974 --- .../Format/PlantFormat.cs.bak | 5480 -------------- .../Format/PlantFormat.org | 4530 ------------ .../Generated/Copy of AnnotationAudit.cs | 1071 --- .../Generated/Copy of AnnotationAuditInfo.cs | 384 - .../Copy of AnnotationAuditInfoList.cs | 205 - .../Generated/Copy of ContentAudit.cs | 1016 --- .../Generated/Copy of ContentAuditInfo.cs | 384 - .../Generated/Copy of ContentAuditInfoList.cs | 205 - .../Generated/Copy of DocumentAudit.cs | 1049 --- .../Generated/Copy of DocumentAuditInfo.cs | 395 -- .../Copy of DocumentAuditInfoList.cs | 205 - .../Generated/Copy of EntryAudit.cs | 891 --- .../Generated/Database.cs.bak | 210 - .../Generated/Database.cs.org | 575 -- .../Generated/FigureInfoList.cs.bak | 312 - .../Generated/ItemInfo.cs.bak | 692 -- .../Generated/RevisionROCheck.cs.bak | 956 --- .../Generated/RevisionROCheckInfo.cs.bak | 334 - .../NewGenerated/CommonRules.cs | 40 - .../NewGenerated/Database.cs | 144 - .../NewGenerated/Owner.cs | 986 --- .../NewGenerated/OwnerInfo.cs | 349 - .../NewGenerated/OwnerInfoList.cs | 225 - .../NewGenerated/PropertyDescriptor.cs | 67 - .../NewGenerated/Session.cs | 1072 --- .../NewGenerated/SessionInfo.cs | 371 - .../NewGenerated/SessionInfoList.cs | 225 - .../NewGenerated/addSession.SQL | 55 - .../NewGenerated/deleteSession.SQL | 29 - .../NewGenerated/existsSession.SQL | 21 - .../NewGenerated/getSession.SQL | 30 - .../NewGenerated/getSessions.SQL | 26 - .../NewGenerated/purgeData.SQL | 26 - .../NewGenerated/updateSession.SQL | 55 - .../OldGenerated/Annotation.cs | 1123 --- .../OldGenerated/AnnotationInfo.cs | 477 -- .../OldGenerated/AnnotationInfoList.cs | 312 - .../OldGenerated/AnnotationType.cs | 1144 --- .../OldGenerated/AnnotationTypeAnnotation.cs | 550 -- .../OldGenerated/AnnotationTypeAnnotations.cs | 290 - .../OldGenerated/AnnotationTypeInfo.cs | 364 - .../OldGenerated/AnnotationTypeInfoList.cs | 198 - .../OldGenerated/Assignment.cs | 1195 ---- .../OldGenerated/AssignmentInfo.cs | 567 -- .../OldGenerated/AssignmentInfoList.cs | 369 - .../OldGenerated/ChildFolders.cs | 309 - .../OldGenerated/ChildFormats.cs | 309 - .../OldGenerated/CommonRules.cs | 40 - .../OldGenerated/Connection.cs | 1236 ---- .../OldGenerated/ConnectionFolder.cs | 614 -- .../OldGenerated/ConnectionFolders.cs | 290 - .../OldGenerated/ConnectionInfo.cs | 400 -- .../OldGenerated/ConnectionInfoList.cs | 198 - .../OldGenerated/Content.cs | 1422 ---- .../OldGenerated/ContentDetail.cs | 458 -- .../OldGenerated/ContentDetails.cs | 290 - .../OldGenerated/ContentInfo.cs | 662 -- .../OldGenerated/ContentInfoList.cs | 255 - .../OldGenerated/ContentItem.cs | 409 -- .../OldGenerated/ContentItems.cs | 290 - .../OldGenerated/ContentPart.cs | 464 -- .../OldGenerated/ContentParts.cs | 295 - .../OldGenerated/ContentRoUsage.cs | 555 -- .../OldGenerated/ContentRoUsages.cs | 290 - .../OldGenerated/ContentTransition.cs | 618 -- .../OldGenerated/ContentTransitions.cs | 290 - .../OldGenerated/Database.cs | 138 - .../OldGenerated/Detail.cs | 1070 --- .../OldGenerated/DetailInfo.cs | 397 -- .../OldGenerated/DetailInfoList.cs | 255 - .../OldGenerated/DocVersion.cs | 1260 ---- .../OldGenerated/DocVersionDocVersionROFst.cs | 423 -- .../DocVersionDocVersionROFsts.cs | 295 - .../OldGenerated/DocVersionInfo.cs | 632 -- .../OldGenerated/DocVersionInfoList.cs | 369 - .../OldGenerated/DocVersionROFst.cs | 968 --- .../OldGenerated/DocVersionROFstInfo.cs | 408 -- .../OldGenerated/DocVersionROFstInfoList.cs | 312 - .../OldGenerated/Document.cs | 1108 --- .../OldGenerated/DocumentEntries.cs | 290 - .../OldGenerated/DocumentEntry.cs | 457 -- .../OldGenerated/DocumentInfo.cs | 392 -- .../OldGenerated/DocumentInfoList.cs | 198 - .../OldGenerated/Entry.cs | 982 --- .../OldGenerated/EntryInfo.cs | 383 - .../OldGenerated/EntryInfoList.cs | 312 - .../OldGenerated/Folder.cs | 1506 ---- .../OldGenerated/FolderAssignment.cs | 671 -- .../OldGenerated/FolderAssignments.cs | 290 - .../OldGenerated/FolderDocVersion.cs | 563 -- .../OldGenerated/FolderDocVersions.cs | 290 - .../OldGenerated/FolderInfo.cs | 662 -- .../OldGenerated/FolderInfoList.cs | 369 - .../OldGenerated/Format.cs | 1426 ---- .../OldGenerated/FormatContent.cs | 474 -- .../OldGenerated/FormatContents.cs | 290 - .../OldGenerated/FormatDocVersion.cs | 681 -- .../OldGenerated/FormatDocVersions.cs | 290 - .../OldGenerated/FormatFolder.cs | 698 -- .../OldGenerated/FormatFolders.cs | 290 - .../OldGenerated/FormatInfo.cs | 521 -- .../OldGenerated/FormatInfoList.cs | 255 - .../OldGenerated/Generated.zip | Bin 55665 -> 0 bytes .../OldGenerated/Group.cs | 1222 ---- .../OldGenerated/GroupAssignment.cs | 721 -- .../OldGenerated/GroupAssignments.cs | 290 - .../OldGenerated/GroupInfo.cs | 409 -- .../OldGenerated/GroupInfoList.cs | 198 - .../OldGenerated/GroupMembership.cs | 692 -- .../OldGenerated/GroupMemberships.cs | 290 - .../VEPROMS.CSLA.Library/OldGenerated/Item.cs | 1345 ---- .../OldGenerated/ItemAnnotation.cs | 550 -- .../OldGenerated/ItemAnnotations.cs | 290 - .../OldGenerated/ItemDocVersion.cs | 681 -- .../OldGenerated/ItemDocVersions.cs | 290 - .../OldGenerated/ItemInfo.cs | 610 -- .../OldGenerated/ItemInfoList.cs | 312 - .../OldGenerated/ItemPart.cs | 470 -- .../OldGenerated/ItemParts.cs | 290 - .../OldGenerated/ItemTransition_RangeID.cs | 600 -- .../OldGenerated/ItemTransition_ToID.cs | 597 -- .../OldGenerated/ItemTransitions_RangeID.cs | 290 - .../OldGenerated/ItemTransitions_ToID.cs | 290 - .../OldGenerated/Membership.cs | 1173 --- .../OldGenerated/MembershipInfo.cs | 477 -- .../OldGenerated/MembershipInfoList.cs | 312 - .../OldGenerated/NextItems.cs | 290 - .../VEPROMS.CSLA.Library/OldGenerated/Part.cs | 1005 --- .../OldGenerated/PartInfo.cs | 431 -- .../OldGenerated/PartInfoList.cs | 312 - .../OldGenerated/Permission.cs | 1251 ---- .../OldGenerated/PermissionInfo.cs | 457 -- .../OldGenerated/PermissionInfoList.cs | 255 - .../OldGenerated/PropertyDescriptor.cs | 231 - .../VEPROMS.CSLA.Library/OldGenerated/RODb.cs | 1192 ---- .../OldGenerated/RODbInfo.cs | 452 -- .../OldGenerated/RODbInfoList.cs | 198 - .../OldGenerated/RODbROFst.cs | 405 -- .../OldGenerated/RODbROFsts.cs | 290 - .../OldGenerated/RODbROImage.cs | 433 -- .../OldGenerated/RODbROImages.cs | 290 - .../OldGenerated/RODbRoUsage.cs | 570 -- .../OldGenerated/RODbRoUsages.cs | 290 - .../OldGenerated/ROFst.cs | 1114 --- .../OldGenerated/ROFstDocVersionROFst.cs | 477 -- .../OldGenerated/ROFstDocVersionROFsts.cs | 295 - .../OldGenerated/ROFstImage.cs | 968 --- .../OldGenerated/ROFstImageInfo.cs | 408 -- .../OldGenerated/ROFstImageInfoList.cs | 312 - .../OldGenerated/ROFstInfo.cs | 441 -- .../OldGenerated/ROFstInfoList.cs | 255 - .../OldGenerated/ROFstROFstImage.cs | 434 -- .../OldGenerated/ROFstROFstImages.cs | 295 - .../OldGenerated/ROImage.cs | 1094 --- .../OldGenerated/ROImageInfo.cs | 419 -- .../OldGenerated/ROImageInfoList.cs | 259 - .../OldGenerated/ROImageROFstImage.cs | 424 -- .../OldGenerated/ROImageROFstImages.cs | 295 - .../OldGenerated/RoUsage.cs | 1103 --- .../OldGenerated/RoUsageInfo.cs | 464 -- .../OldGenerated/RoUsageInfoList.cs | 312 - .../VEPROMS.CSLA.Library/OldGenerated/Role.cs | 1191 ---- .../OldGenerated/RoleAssignment.cs | 731 -- .../OldGenerated/RoleAssignments.cs | 290 - .../OldGenerated/RoleInfo.cs | 398 -- .../OldGenerated/RoleInfoList.cs | 198 - .../OldGenerated/RolePermission.cs | 619 -- .../OldGenerated/RolePermissions.cs | 290 - .../OldGenerated/Transition.cs | 1199 ---- .../OldGenerated/TransitionInfo.cs | 622 -- .../OldGenerated/TransitionInfoList.cs | 369 - .../VEPROMS.CSLA.Library/OldGenerated/User.cs | 1333 ---- .../OldGenerated/UserInfo.cs | 463 -- .../OldGenerated/UserInfoList.cs | 198 - .../OldGenerated/UserMembership.cs | 612 -- .../OldGenerated/UserMemberships.cs | 290 - .../OldGenerated/ZContent.cs | 857 --- .../OldGenerated/ZContentInfo.cs | 310 - .../OldGenerated/ZTransition.cs | 857 --- .../OldGenerated/ZTransitionInfo.cs | 310 - PROMS/VG/VG.csproj.bak | 174 - .../DSOTabPanel - Copy.cs | 665 -- .../DSOTabPanel.Designer - Copy.cs | 36 - .../DSOTabPanel.cs.bak | 695 -- .../DisplayHistory.cs.bak | 1031 --- .../Volian.Controls.Library/DisplayRO.cs.bak | 885 --- .../DisplayRTBSimple.cs | 293 - .../DisplayRTBSimple.designer.cs | 36 - .../DisplayReports.cs.bak | 987 --- .../DisplaySearch.cs.bak | 1738 ----- .../DisplaySecurity.Designer.cs | 45 - .../DisplaySecurity.cs | 18 - .../DisplaySecurity.resx | 120 - .../DisplayTabItem.cs.bak | 341 - .../DisplayTags.cs.bak | 295 - PROMS/Volian.Controls.Library/DisplayText.cs | 2238 ------ .../DisplayText.cs.bak | 1912 ----- .../Volian.Controls.Library/DisplayTextRO.cs | 1778 ----- PROMS/Volian.Controls.Library/EditItem.cs.bak | 2394 ------- PROMS/Volian.Controls.Library/EditItem.cs.org | 3813 ---------- PROMS/Volian.Controls.Library/GridItem.cs.bak | 1248 ---- PROMS/Volian.Controls.Library/GridItem.cs.org | 1312 ---- PROMS/Volian.Controls.Library/IEditItem.cs | 44 - .../OutlineRTFTable.cs | 306 - .../RTBAPI - WithSaveHandlesCode.cs | 1191 ---- .../Volian.Controls.Library/RTBItem - Copy.cs | 908 --- .../RTBItem - Copy.resx | 135 - .../RTBItem.designer - Copy.cs | Bin 16162 -> 0 bytes .../Volian.Controls.Library/StepPanel.cs.bak | 1045 --- PROMS/Volian.Controls.Library/StepRTB.cs.bak | 3238 --------- .../StepTabRibbon.cs.bak | 2732 ------- .../TemporaryFormat.cs | 86 - .../VlnFlexGrid.cs.bak | 4926 ------------- .../VlnSpellCheckDlg - ForDebugAutoIgnor.cs | 316 - .../Volian.Controls.Library.csproj.bak | 623 -- .../Volian.Controls.Library/mytransitionquery | 9 - .../Volian.Controls.Library/vlnStackTrace.cs | 195 - .../vlnTreeView - Copy.cs | 1771 ----- .../vlnTreeView.cs.bak | 2735 ------- .../Volian.Pipe.Library.sln | 34 - .../ContActionSum - Copy.cs | 452 -- PROMS/Volian.Print.Library/Grid2Pdf.cs.bak | 1536 ---- PROMS/Volian.Print.Library/Pagination.cs.bak | 443 -- .../Volian.Print.Library/PromsPrinter.cs.bak | 2024 ------ .../VlnSvgPageHelper.cs.bak | 1899 ----- .../Volian.Print.Library.csproj.bak | 165 - PROMS/Volian.Print.Library/app.config | 15 - PROMS/Volian.Print.Library/vlnBox - Copy.cs | 221 - PROMS/Volian.Print.Library/vlnBox.cs.bak | 233 - .../Volian.Print.Library/vlnParagraph.cs.bak | 6266 ----------------- .../Volian.Print.Library/vlnParagraph.cs1.bak | 1995 ------ .../Volian.Print.Library/vlnParagraph.cs2.bak | 2009 ------ .../vlnPrintObject.cs.org | 404 -- PROMS/Volian.Print.Library/vlnTab.cs.bak | 282 - PROMS/Volian.Print.Library/vlnTab.cs.org | 323 - PROMS/Volian.Print.Library/vlnTabMcG.cs | 323 - PROMS/Volian.Svg.Library/DisplayText.cs | 644 -- PROMS/Volian.Svg.Library/SvgRtf.cs | 12 - .../Volian.Svg.Library/Volian.Svg.Library.sln | 26 - PROMS/Volian.Svg.Library/iTextSharp.cs.bak | 1168 --- PROMS/Volian.Utils.Library/CvtFont/CvtFont.cs | 346 - .../CvtFont/CvtFont.csproj | 52 - .../CvtFont/Properties/AssemblyInfo.cs | 35 - .../Volian.Utils.Library.sln | 20 - PROMS/Volian.Utils.Library/vlnControl.xml | 244 - PROMS/Volian.Utils.Library/vlnControl.xml.org | 244 - PROMS/XYPlots/XYPlots.sln | 34 - 611 files changed, 4 insertions(+), 304339 deletions(-) delete mode 100644 PROMS/AdjustBuildRevision/AdjustBuildRevision.sln delete mode 100644 PROMS/Formats/Formats.sln delete mode 100644 PROMS/Formats/Production Formats.sln delete mode 100644 PROMS/LBWordLibrary/LBBozoComObject.cs delete mode 100644 PROMS/LBWordLibrary/LBComObject.old.cs delete mode 100644 PROMS/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs delete mode 100644 PROMS/PROMS/VEPROMS User Interface/dlgExportImport.cs delete mode 100644 PROMS/PROMS/VEPROMS User Interface/frmVEPROMS.cs delete mode 100644 PROMS/PROMS/Volian.Controls.Library/StepRTB.cs delete mode 100644 PROMS/PROMS/Volian.Controls.Library/VlnFlexGrid.cs delete mode 100644 PROMS/PROMS/Volian.Print.Library/Grid2Pdf.cs delete mode 100644 PROMS/PROMS/Volian.Print.Library/Rtf2iTextSharp.cs delete mode 100644 PROMS/PROMS/proms.sln delete mode 100644 PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.sln delete mode 100644 PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.vsscc delete mode 100644 PROMS/ReferencedObjects/Exe/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.csproj delete mode 100644 PROMS/ReferencedObjects/Exe/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.sln delete mode 100644 PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.sln delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/App.ico delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/CmpRpt.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/CmpRpt.csproj delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/CmpRpt.resx delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/CmpRpt.sln delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/app.config delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/App.ico delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/ConvertParadoxROs.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/Form1.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/Form1.resx delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/ParadoxConversion.csproj delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/ParadoxConversion.sln delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/ROConvrt.ico delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/RODBRecordInterface.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/V.ico delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/app.config delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/About.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/About.resx delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AboutBckgnd_370x209.bmp delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AboutBckgnd_80.bmp delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AboutROEditor.Designer.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AboutROEditor.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AboutROEditor.resx delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/App.ico delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Cancel.ico delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Cert_prt_rgb_70x32.gif delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Copy.ico delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldCombFrm.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldCombFrm.resx delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldTextFrm.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldTextFrm.resx delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldTypeDefFrm.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldTypeDefFrm.resx delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FixRev.Bat delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/GroupDefFrm.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/GroupDefFrm.resx delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/GroupNewFrm.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/GroupNewFrm.resx delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Properties/Resources.Designer.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Properties/Resources.resx delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/RODefFrm.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/RODefFrm.resx delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.csproj delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.ico delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.resx delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.sln delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROGROUPYellow.ICO delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/RO_FST.cs delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Red_V_txt_NB_bur_1984.png delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Restore.ico delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Save.ico delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Zoom.ico delete mode 100644 PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/app.config delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/DBEncap.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/DBEncapsulation.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/DBEncapsulation.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/IniFileIO/AssemblyInfo.cpp delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/IniFileIO/IniFileIO.cpp delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/IniFileIO/IniFileIO.h delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/IniFileIO/IniFileIO.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/IniFileIO/IniFileIO.vcproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/IniFileIO/ReadMe.txt delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/IniFileIO/Stdafx.cpp delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/IniFileIO/Stdafx.h delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Org.Mentalis.Files/IniReader.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Org.Mentalis.Files/Org.Mentalis.Files.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Org.Mentalis.Files/Properties/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Org.Mentalis.Files/Properties/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/RODBInterface/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/RODBInterface/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/RODBInterface/RODBInterface.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/RODBInterface/RODBInterface.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/RODBInterface/RODBInterface.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/RODBInterface/VlnXml.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/RODBInterface/userpass.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/RODBInterface/userpass.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ROFST/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ROFST/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ROFST/ROFST.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ROFST/ROFST.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ROFST/ROFST.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ROField/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ROField/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ROField/ROField.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ROField/ROFields.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ROField/ROFields.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/About.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/About.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/AboutBckgnd_370x209.bmp delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/CurSet.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/DTI.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/DirSpace.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/FmtFiles.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/MenuXML.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/PrivateProfile.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/Security.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/SerialNo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/ShrtNm.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/SymbDlg.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/SymbDlg.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/SymbLst.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/UsrRunTime.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/Utils.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/Utils.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/VEdt.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/ZipFuncs.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/ZipFuncsDlg.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/Utils/ZipFuncsDlg.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/VlnProfiler.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/VlnProfiler.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/VlnProfiler.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/SpinnerFrm.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/SpinnerFrm.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/StatusBarFrm.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/StatusBarFrm.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/StatusMessageFrm.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/StatusMessageFrm.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/App.ico delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/Form1.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/Form1.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/Test.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnSpinner.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnStatus.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnStatus.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnStatusBar.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnStatusMessage.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/CvtFont/CvtFont.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/CvtFont/CvtFont.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/CvtFont/Properties/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/AssemblyInfo.cpp delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/DirectoryAndFileAPI.cpp delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/DirectoryAndFileAPI.h delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/DirectoryAndFileAPI.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/DirectoryAndFileAPI.vcproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/ReadMe.txt delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/Stdafx.cpp delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/Stdafx.h delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/FMTformat.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/FMTformat.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/FmtFileVars.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/ArcData.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/ArcData.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/GUI_Utils.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/GUI_Utils.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/ReadWord.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/ReadWord.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/TreeViewMultiSelect.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/TreeViewMultiSelect.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/EopToErgRelations.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/ProcedureSelectionList.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/ProcedureSelectionList.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/VDB.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/VDB.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/VDB.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdbConnType.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_Proc.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_ROUsage.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_Set.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_SetExt.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_TransUsage.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/VEMessage.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/VEMessage.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/VEMessage.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockDlg.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockDlg.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockInfoDlg.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockInfoDlg.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockRlsDlg.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockRlsDlg.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/MonUsrDlg.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/MonUsrDlg.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/VEConn.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/VELock.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/VENetwork.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/VENetwork.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/VETempFile.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ARProperties.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ARProperties.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/AppConflict.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/AppIndItm.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ApproveDlg.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ApproveDlg.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ApproveSelDlg.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ApproveSelDlg.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Archive.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/DataPath.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/DataRoot.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/LDProperties.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/LDProperties.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/LibDoc.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/PSProperties.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/PSProperties.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Plant.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/PrcProperties.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/PrcProperties.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Proc.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ProcExt.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ProcSet.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Properties.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Properties.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/RO.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/RefList.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/VEObject.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/VEObject.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/VEObject.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/App.ico delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/Form1.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/Form1.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/Test.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/Test.csproj.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/licenses.licx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/VG.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/VG.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/VG.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/VerRelCpy.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/VerRelCpyrght.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/VerRelCpyrght.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VlnXml/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VlnXml/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VlnXml/VlnXml.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VlnXml/VlnXml.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/AssemblyInfo.cpp delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/ReadMe.txt delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/Stdafx.cpp delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/Stdafx.h delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/WinExeClass.cpp delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/WinExeClass.h delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/WinExeClass.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/WinExeClass.vcproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/App.ico delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/Form1.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/Form1.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/Test XYPlots.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/licenses.licx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/XYPlots.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/XYPlots.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/XYPlots.sln delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/AssemblyInfo.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/AssemblyInfo.cs.bak delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ImageDialog.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ImageDialog.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ZoomDialog.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ZoomDialog.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ctlXMLEdit.cs delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ctlXMLEdit.resx delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ctlXMLEditLib.csproj delete mode 100644 PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ctlXMLEditLib.sln delete mode 100644 PROMS/RoAccessToSql/RoAccessToSql.sln delete mode 100644 PROMS/VEPROMS User Interface/App - Copy.config delete mode 100644 PROMS/VEPROMS User Interface/App.config.bak delete mode 100644 PROMS/VEPROMS User Interface/DlgPrintProcedure.Designer.cs.bak delete mode 100644 PROMS/VEPROMS User Interface/DlgPrintProcedure.cs.bak delete mode 100644 PROMS/VEPROMS User Interface/FindReplace.Designer.cs delete mode 100644 PROMS/VEPROMS User Interface/FindReplace.cs delete mode 100644 PROMS/VEPROMS User Interface/FindReplace.resx delete mode 100644 PROMS/VEPROMS User Interface/UCFDetails.xsl delete mode 100644 PROMS/VEPROMS User Interface/UCFSummary.xsl delete mode 100644 PROMS/VEPROMS User Interface/VEPROMS_UI.csproj.bak delete mode 100644 PROMS/VEPROMS User Interface/VEPROMS_UI.sln delete mode 100644 PROMS/VEPROMS User Interface/dlgChgId.Designer.cs delete mode 100644 PROMS/VEPROMS User Interface/dlgChgId.cs delete mode 100644 PROMS/VEPROMS User Interface/dlgChgId.resx delete mode 100644 PROMS/VEPROMS User Interface/dlgExportImport.cs.bak delete mode 100644 PROMS/VEPROMS User Interface/frmBatchRefresh - Copy.cs delete mode 100644 PROMS/VEPROMS User Interface/frmBatchRefresh - Copy.designer.cs delete mode 100644 PROMS/VEPROMS User Interface/frmBatchRefresh - Copy.resx delete mode 100644 PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs.bak delete mode 100644 PROMS/VEPROMS User Interface/frmVEPROMS.cs.bak delete mode 100644 PROMS/VEPROMS User Interface/frmVersionsProperties.Designer.cs.bak delete mode 100644 PROMS/VEPROMS User Interface/frmVersionsProperties.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Config/AssocConfig - Copy (2).cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Config/AssocConfig - Copy.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup MultiValRO.csx delete mode 100644 PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs.org delete mode 100644 PROMS/VEPROMS.CSLA.Library/Config/StepConfig.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/AnnotationExt.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/ContentExt.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/ContentExt.cs.org delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/DisplayTextANSI.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/DocVersionExt.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/GroupMembershipExt.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.org delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/LinkText.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs.org delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/PermissionExt.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/ROFSTValue.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/RevisionInfoExt.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/RolePermissionExt.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/Security/PermissionExt.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/Security/RolePermissionExt.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/Security/vlnValueKey.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/UserInfoListExt.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/transtypes.TXT delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/transtypes.TXT.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Extension/vlnValueKey.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs.org delete mode 100644 PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.org delete mode 100644 PROMS/VEPROMS.CSLA.Library/Generated/Copy of AnnotationAudit.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Generated/Copy of AnnotationAuditInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Generated/Copy of AnnotationAuditInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Generated/Copy of ContentAudit.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Generated/Copy of ContentAuditInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Generated/Copy of ContentAuditInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Generated/Copy of DocumentAudit.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Generated/Copy of DocumentAuditInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Generated/Copy of DocumentAuditInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Generated/Copy of EntryAudit.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/Generated/Database.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Generated/Database.cs.org delete mode 100644 PROMS/VEPROMS.CSLA.Library/Generated/FigureInfoList.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Generated/ItemInfo.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Generated/RevisionROCheck.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/Generated/RevisionROCheckInfo.cs.bak delete mode 100644 PROMS/VEPROMS.CSLA.Library/NewGenerated/CommonRules.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/NewGenerated/Database.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/NewGenerated/Owner.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/NewGenerated/OwnerInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/NewGenerated/OwnerInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/NewGenerated/PropertyDescriptor.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/NewGenerated/Session.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/NewGenerated/SessionInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/NewGenerated/SessionInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/NewGenerated/addSession.SQL delete mode 100644 PROMS/VEPROMS.CSLA.Library/NewGenerated/deleteSession.SQL delete mode 100644 PROMS/VEPROMS.CSLA.Library/NewGenerated/existsSession.SQL delete mode 100644 PROMS/VEPROMS.CSLA.Library/NewGenerated/getSession.SQL delete mode 100644 PROMS/VEPROMS.CSLA.Library/NewGenerated/getSessions.SQL delete mode 100644 PROMS/VEPROMS.CSLA.Library/NewGenerated/purgeData.SQL delete mode 100644 PROMS/VEPROMS.CSLA.Library/NewGenerated/updateSession.SQL delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Annotation.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationType.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationTypeAnnotation.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationTypeAnnotations.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationTypeInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationTypeInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Assignment.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/AssignmentInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/AssignmentInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ChildFolders.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ChildFormats.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/CommonRules.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Connection.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ConnectionFolder.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ConnectionFolders.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ConnectionInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ConnectionInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Content.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentDetail.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentDetails.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentItem.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentItems.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentPart.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentParts.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentRoUsage.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentRoUsages.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentTransition.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentTransitions.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Database.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Detail.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/DetailInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/DetailInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersion.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionDocVersionROFst.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionDocVersionROFsts.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionROFst.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionROFstInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionROFstInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Document.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/DocumentEntries.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/DocumentEntry.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/DocumentInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/DocumentInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Entry.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/EntryInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/EntryInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Folder.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderAssignment.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderAssignments.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderDocVersion.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderDocVersions.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Format.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatContent.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatContents.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatDocVersion.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatDocVersions.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatFolder.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatFolders.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Generated.zip delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Group.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupAssignment.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupAssignments.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupMembership.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupMemberships.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Item.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemAnnotation.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemAnnotations.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemDocVersion.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemDocVersions.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemPart.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemParts.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemTransition_RangeID.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemTransition_ToID.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemTransitions_RangeID.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemTransitions_ToID.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Membership.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/MembershipInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/MembershipInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/NextItems.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Part.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/PartInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/PartInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Permission.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/PermissionInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/PermissionInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/PropertyDescriptor.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RODb.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbROFst.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbROFsts.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbROImage.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbROImages.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbRoUsage.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbRoUsages.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFst.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstDocVersionROFst.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstDocVersionROFsts.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstImage.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstImageInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstImageInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstROFstImage.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstROFstImages.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImage.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImageInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImageInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImageROFstImage.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImageROFstImages.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RoUsage.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RoUsageInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RoUsageInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Role.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RoleAssignment.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RoleAssignments.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RoleInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RoleInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RolePermission.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/RolePermissions.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/Transition.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/TransitionInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/TransitionInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/User.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/UserInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/UserInfoList.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/UserMembership.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/UserMemberships.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ZContent.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ZContentInfo.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ZTransition.cs delete mode 100644 PROMS/VEPROMS.CSLA.Library/OldGenerated/ZTransitionInfo.cs delete mode 100644 PROMS/VG/VG.csproj.bak delete mode 100644 PROMS/Volian.Controls.Library/DSOTabPanel - Copy.cs delete mode 100644 PROMS/Volian.Controls.Library/DSOTabPanel.Designer - Copy.cs delete mode 100644 PROMS/Volian.Controls.Library/DSOTabPanel.cs.bak delete mode 100644 PROMS/Volian.Controls.Library/DisplayHistory.cs.bak delete mode 100644 PROMS/Volian.Controls.Library/DisplayRO.cs.bak delete mode 100644 PROMS/Volian.Controls.Library/DisplayRTBSimple.cs delete mode 100644 PROMS/Volian.Controls.Library/DisplayRTBSimple.designer.cs delete mode 100644 PROMS/Volian.Controls.Library/DisplayReports.cs.bak delete mode 100644 PROMS/Volian.Controls.Library/DisplaySearch.cs.bak delete mode 100644 PROMS/Volian.Controls.Library/DisplaySecurity.Designer.cs delete mode 100644 PROMS/Volian.Controls.Library/DisplaySecurity.cs delete mode 100644 PROMS/Volian.Controls.Library/DisplaySecurity.resx delete mode 100644 PROMS/Volian.Controls.Library/DisplayTabItem.cs.bak delete mode 100644 PROMS/Volian.Controls.Library/DisplayTags.cs.bak delete mode 100644 PROMS/Volian.Controls.Library/DisplayText.cs delete mode 100644 PROMS/Volian.Controls.Library/DisplayText.cs.bak delete mode 100644 PROMS/Volian.Controls.Library/DisplayTextRO.cs delete mode 100644 PROMS/Volian.Controls.Library/EditItem.cs.bak delete mode 100644 PROMS/Volian.Controls.Library/EditItem.cs.org delete mode 100644 PROMS/Volian.Controls.Library/GridItem.cs.bak delete mode 100644 PROMS/Volian.Controls.Library/GridItem.cs.org delete mode 100644 PROMS/Volian.Controls.Library/IEditItem.cs delete mode 100644 PROMS/Volian.Controls.Library/OutlineRTFTable.cs delete mode 100644 PROMS/Volian.Controls.Library/RTBAPI - WithSaveHandlesCode.cs delete mode 100644 PROMS/Volian.Controls.Library/RTBItem - Copy.cs delete mode 100644 PROMS/Volian.Controls.Library/RTBItem - Copy.resx delete mode 100644 PROMS/Volian.Controls.Library/RTBItem.designer - Copy.cs delete mode 100644 PROMS/Volian.Controls.Library/StepPanel.cs.bak delete mode 100644 PROMS/Volian.Controls.Library/StepRTB.cs.bak delete mode 100644 PROMS/Volian.Controls.Library/StepTabRibbon.cs.bak delete mode 100644 PROMS/Volian.Controls.Library/TemporaryFormat.cs delete mode 100644 PROMS/Volian.Controls.Library/VlnFlexGrid.cs.bak delete mode 100644 PROMS/Volian.Controls.Library/VlnSpellCheckDlg - ForDebugAutoIgnor.cs delete mode 100644 PROMS/Volian.Controls.Library/Volian.Controls.Library.csproj.bak delete mode 100644 PROMS/Volian.Controls.Library/mytransitionquery delete mode 100644 PROMS/Volian.Controls.Library/vlnStackTrace.cs delete mode 100644 PROMS/Volian.Controls.Library/vlnTreeView - Copy.cs delete mode 100644 PROMS/Volian.Controls.Library/vlnTreeView.cs.bak delete mode 100644 PROMS/Volian.Pipe.Library/Volian.Pipe.Library.sln delete mode 100644 PROMS/Volian.Print.Library/ContActionSum - Copy.cs delete mode 100644 PROMS/Volian.Print.Library/Grid2Pdf.cs.bak delete mode 100644 PROMS/Volian.Print.Library/Pagination.cs.bak delete mode 100644 PROMS/Volian.Print.Library/PromsPrinter.cs.bak delete mode 100644 PROMS/Volian.Print.Library/VlnSvgPageHelper.cs.bak delete mode 100644 PROMS/Volian.Print.Library/Volian.Print.Library.csproj.bak delete mode 100644 PROMS/Volian.Print.Library/app.config delete mode 100644 PROMS/Volian.Print.Library/vlnBox - Copy.cs delete mode 100644 PROMS/Volian.Print.Library/vlnBox.cs.bak delete mode 100644 PROMS/Volian.Print.Library/vlnParagraph.cs.bak delete mode 100644 PROMS/Volian.Print.Library/vlnParagraph.cs1.bak delete mode 100644 PROMS/Volian.Print.Library/vlnParagraph.cs2.bak delete mode 100644 PROMS/Volian.Print.Library/vlnPrintObject.cs.org delete mode 100644 PROMS/Volian.Print.Library/vlnTab.cs.bak delete mode 100644 PROMS/Volian.Print.Library/vlnTab.cs.org delete mode 100644 PROMS/Volian.Print.Library/vlnTabMcG.cs delete mode 100644 PROMS/Volian.Svg.Library/DisplayText.cs delete mode 100644 PROMS/Volian.Svg.Library/SvgRtf.cs delete mode 100644 PROMS/Volian.Svg.Library/Volian.Svg.Library.sln delete mode 100644 PROMS/Volian.Svg.Library/iTextSharp.cs.bak delete mode 100644 PROMS/Volian.Utils.Library/CvtFont/CvtFont.cs delete mode 100644 PROMS/Volian.Utils.Library/CvtFont/CvtFont.csproj delete mode 100644 PROMS/Volian.Utils.Library/CvtFont/Properties/AssemblyInfo.cs delete mode 100644 PROMS/Volian.Utils.Library/Volian.Utils.Library.sln delete mode 100644 PROMS/Volian.Utils.Library/vlnControl.xml delete mode 100644 PROMS/Volian.Utils.Library/vlnControl.xml.org delete mode 100644 PROMS/XYPlots/XYPlots.sln diff --git a/PROMS/AdjustBuildRevision/AdjustBuildRevision.sln b/PROMS/AdjustBuildRevision/AdjustBuildRevision.sln deleted file mode 100644 index aa7e3659..00000000 --- a/PROMS/AdjustBuildRevision/AdjustBuildRevision.sln +++ /dev/null @@ -1,36 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdjustBuildRevision", "AdjustBuildRevision.csproj", "{D1AB675E-828D-4781-BACD-8A2324CD84A5}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection -EndProject -Global - GlobalSection(SourceCodeControl) = preSolution - SccNumberOfProjects = 2 - SccProjectUniqueName0 = AdjustBuildRevision.csproj - SccLocalPath0 = . - SccLocalPath1 = . - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D1AB675E-828D-4781-BACD-8A2324CD84A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D1AB675E-828D-4781-BACD-8A2324CD84A5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D1AB675E-828D-4781-BACD-8A2324CD84A5}.Debug|x86.ActiveCfg = Debug|x86 - {D1AB675E-828D-4781-BACD-8A2324CD84A5}.Debug|x86.Build.0 = Debug|x86 - {D1AB675E-828D-4781-BACD-8A2324CD84A5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D1AB675E-828D-4781-BACD-8A2324CD84A5}.Release|Any CPU.Build.0 = Release|Any CPU - {D1AB675E-828D-4781-BACD-8A2324CD84A5}.Release|x86.ActiveCfg = Release|x86 - {D1AB675E-828D-4781-BACD-8A2324CD84A5}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/PROMS/Formats/Formats.sln b/PROMS/Formats/Formats.sln deleted file mode 100644 index 415b0927..00000000 --- a/PROMS/Formats/Formats.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30723.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Formats", "Formats.csproj", "{F479493D-A543-4CCF-9541-039FD5126794}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F479493D-A543-4CCF-9541-039FD5126794}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F479493D-A543-4CCF-9541-039FD5126794}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F479493D-A543-4CCF-9541-039FD5126794}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F479493D-A543-4CCF-9541-039FD5126794}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/PROMS/Formats/Production Formats.sln b/PROMS/Formats/Production Formats.sln deleted file mode 100644 index a8cc0e9c..00000000 --- a/PROMS/Formats/Production Formats.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Formats", "Formats.csproj", "{F479493D-A543-4CCF-9541-039FD5126794}" -EndProject -Global - GlobalSection(SourceCodeControl) = preSolution - SccNumberOfProjects = 2 - SccLocalPath0 = . - SccProjectUniqueName1 = Formats.csproj - SccLocalPath1 = . - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F479493D-A543-4CCF-9541-039FD5126794}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F479493D-A543-4CCF-9541-039FD5126794}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F479493D-A543-4CCF-9541-039FD5126794}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F479493D-A543-4CCF-9541-039FD5126794}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/PROMS/LBWordLibrary/LBBozoComObject.cs b/PROMS/LBWordLibrary/LBBozoComObject.cs deleted file mode 100644 index f76b369f..00000000 --- a/PROMS/LBWordLibrary/LBBozoComObject.cs +++ /dev/null @@ -1,1751 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Reflection; - -namespace LBWordLibrary -{ - public abstract partial class LBComObject - { - private Object _Item; - internal Object Item - { - get { return _Item; } - set - { - _Item = value; - if (value != null) _MyType = _Item.GetType(); - } - } - private Type _MyType; - public Type MyType - { - get { return _MyType; } - set { _MyType = value; } - } - protected LBComObject() { } - protected LBComObject(string ProgID) - { - Type objClassType; - objClassType = Type.GetTypeFromProgID(ProgID); - Item = Activator.CreateInstance(objClassType); - } - protected LBComObject(Object item) - { - Item = item; - } - private Object DoInvokeMember(string name, Object[] parameters, BindingFlags bf, Binder b) - { - try - { - return _MyType.InvokeMember(name, bf, b, _Item, parameters); - } - catch (Exception ex) - { - throw new Exception(string.Format("LBComObject.DoInvokeMember {0}.{1}", _MyType.Name, name), ex); - } - return null; - } - protected void SetProperty(string propertyName, params Object[] parameters) - { - DoInvokeMember(propertyName, parameters, BindingFlags.SetProperty, null); - } - protected Object GetProperty(string propertyName) - { - return DoInvokeMember(propertyName, null, BindingFlags.GetProperty, null); - } - protected Object GetProperty(string propertyName, params Object[] parameters) - { - return DoInvokeMember(propertyName, parameters, BindingFlags.GetProperty, null); - } - protected Object InvokeMethod(string methodName, params Object[] parameters) - { - if (parameters != null) - FixParameters(parameters); - return DoInvokeMember(methodName, parameters, BindingFlags.InvokeMethod, null); - } - private void FixParameters(object[] parameters) - { - // Loop through parameters checking to make sure that none of them are LBComObjects - for (int i = 0; i < parameters.Length; i++) - if (parameters[i] is LBComObject) - parameters[i] = (parameters[i] as LBComObject).Item; - } - protected Object InvokeMethod(string methodName) - { - return InvokeMethod(methodName, null); - } - } - public class LBComObjectList : LBComObject - where TList : LBComObjectList - where TItem : LBComObject, new() - { - //public new(Object item):base(item){} - public TItem Add() - { - TItem tmp = new TItem(); - tmp.Item = InvokeMethod("Add"); - return tmp; - } - //public TItem this[int item] - //{ - // get - // { - // TItem tmp = new TItem(); - // tmp.Item = GetProperty("Item", item); - // return tmp; - // } - //} - } - public partial class LBApplicationClass : LBComObject - { - public LBApplicationClass() : base("Word.Application") { } - public LBApplicationClass(Object item) : base(item) { } - public Boolean Visible - { - get { return (GetProperty("Visible") as Boolean? ?? false); } - set { SetProperty("Visible", value); } - } - public LBDocuments Documents - { - get { return new LBDocuments(GetProperty("Documents")); } - } - public LBSelection Selection - { - get { return new LBSelection(GetProperty("Selection")); } - } - public LBDocumentClass ActiveDocument - { - get { return new LBDocumentClass(GetProperty("ActiveDocument")); } - } - public LBWindow ActiveWindow - { - get { return new LBWindow(GetProperty("ActiveWindow")); } - } - public String Version - { - get { return (GetProperty("Version").ToString()); } - } - public String ActivePrinter - { - get { return (GetProperty("ActivePrinter").ToString()); } - set { SetProperty("ActivePrinter", value); } - } - public int BackgroundPrintingStatus - { - get { return (GetProperty("BackgroundPrintingStatus") as int? ?? 0); } - } - public LBWdWindowState WindowState - { - get { return (LBWdWindowState)GetProperty("WindowState"); } - set { SetProperty("WindowState", value); } - } - public int BackgroundSavingStatus - { - get { return (GetProperty("BackgroundSavingStatus") as int? ?? 0); } - } - public void Quit() - { - InvokeMethod("Quit", Missing.Value, Missing.Value, Missing.Value); - } - public void Quit(object SaveChanges, object OriginalFormat, object RouteDocument) - { - InvokeMethod("Quit", SaveChanges, OriginalFormat, RouteDocument); - } - public void PrintOut() - { - InvokeMethod("PrintOut", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value); - } - public void PrintOut(object Background, object Append, object Range, object OutputFileName, object From, object To, object Item, object Copies, object Pages, object PageType, object PrintToFile, object Collate, object FileName, object ActivePrinterMacGX, object ManualDuplexPrint, object PrintZoomColumn, object PrintZoomRow, object PrintZoomPaperWidth, object PrintZoomPaperHeight) - { - InvokeMethod("PrintOut", Background, Append, Range, OutputFileName, From, To, Item, Copies, Pages, PageType, PrintToFile, Collate, FileName, ActivePrinterMacGX, ManualDuplexPrint, PrintZoomColumn, PrintZoomRow, PrintZoomPaperWidth, PrintZoomPaperHeight); - } - public void Activate() - { - InvokeMethod("Activate"); - } - } - public partial class LBDocuments : LBComObjectList /* Collection */ - { - public LBDocuments(Object item) - { - Item = item; - } - public LBDocumentClass Open(object FileName) - { - return new LBDocumentClass(InvokeMethod("Open", FileName, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value)); - } - public LBDocumentClass Open(object FileName, object ConfirmConversions, object ReadOnly, object AddToRecentFiles, object PasswordDocument, object PasswordTemplate, object Revert, object WritePasswordDocument, object WritePasswordTemplate, object Format, object Encoding, object Visible, object OpenAndRepair, object DocumentDirection, object NoEncodingDialog, object XMLTransform) - { - return new LBDocumentClass(InvokeMethod("Open", FileName, ConfirmConversions, ReadOnly, AddToRecentFiles, PasswordDocument, PasswordTemplate, Revert, WritePasswordDocument, WritePasswordTemplate, Format, Encoding, Visible, OpenAndRepair, DocumentDirection, NoEncodingDialog, XMLTransform)); - } - } - public partial class LBSelection : LBComObject - { - public LBSelection() { } - public LBSelection(Object item) : base(item) { } - public LBRange Range - { - get { return new LBRange(GetProperty("Range")); } - } - public LBParagraphFormatClass ParagraphFormat - { - get { return new LBParagraphFormatClass(GetProperty("ParagraphFormat")); } - } - public String Text - { - get { return (GetProperty("Text").ToString()); } - set { SetProperty("Text", value); } - } - public LBWdSelectionType Type - { - get { return (LBWdSelectionType)GetProperty("Type"); } - } - public LBFind Find - { - get { return new LBFind(GetProperty("Find")); } - } - public LBFontClass Font - { - get { return new LBFontClass(GetProperty("Font")); } - } - public int End - { - get { return (GetProperty("End") as int? ?? 0); } - set { SetProperty("End", value); } - } - public int Start - { - get { return (GetProperty("Start") as int? ?? 0); } - set { SetProperty("Start", value); } - } - public LBInlineShapes InlineShapes - { - get { return new LBInlineShapes(GetProperty("InlineShapes")); } - } - public LBParagraphs Paragraphs - { - get { return new LBParagraphs(GetProperty("Paragraphs")); } - } - public LBTables Tables - { - get { return new LBTables(GetProperty("Tables")); } - } - public LBCells Cells - { - get { return new LBCells(GetProperty("Cells")); } - } - public LBRows Rows - { - get { return new LBRows(GetProperty("Rows")); } - } - public void WholeStory() - { - InvokeMethod("WholeStory"); - } - public int MoveStart() - { - return InvokeMethod("MoveStart", Missing.Value, Missing.Value) as int? ?? 0; - } - public int MoveStart(object Unit, object Count) - { - return InvokeMethod("MoveStart", Unit, Count) as int? ?? 0; - } - public int MoveEnd() - { - return InvokeMethod("MoveEnd", Missing.Value, Missing.Value) as int? ?? 0; - } - public int MoveEnd(object Unit, object Count) - { - return InvokeMethod("MoveEnd", Unit, Count) as int? ?? 0; - } - public void Copy() - { - InvokeMethod("Copy"); - } - public int EndKey() - { - return InvokeMethod("EndKey", Missing.Value, Missing.Value) as int? ?? 0; - } - public int EndKey(object Unit, object Extend) - { - return InvokeMethod("EndKey", Unit, Extend) as int? ?? 0; - } - public void TypeText(string Text) - { - InvokeMethod("TypeText", Text); - } - public int EndOf() - { - return InvokeMethod("EndOf", Missing.Value, Missing.Value) as int? ?? 0; - } - public int EndOf(object Unit, object Extend) - { - return InvokeMethod("EndOf", Unit, Extend) as int? ?? 0; - } - public LBRange GoTo() - { - return new LBRange(InvokeMethod("GoTo", Missing.Value, Missing.Value, Missing.Value, Missing.Value)); - } - public LBRange GoTo(object What, object Which, object Count, object Name) - { - return new LBRange(InvokeMethod("GoTo", What, Which, Count, Name)); - } - public void InsertSymbol(int CharacterNumber) - { - InvokeMethod("InsertSymbol", CharacterNumber, Missing.Value, Missing.Value, Missing.Value); - } - public void InsertSymbol(int CharacterNumber, object Font, object Unicode, object Bias) - { - InvokeMethod("InsertSymbol", CharacterNumber, Font, Unicode, Bias); - } - public int MoveRight() - { - return InvokeMethod("MoveRight", Missing.Value, Missing.Value, Missing.Value) as int? ?? 0; - } - public int MoveRight(object Unit, object Count, object Extend) - { - return InvokeMethod("MoveRight", Unit, Count, Extend) as int? ?? 0; - } - public int MoveLeft() - { - return InvokeMethod("MoveLeft", Missing.Value, Missing.Value, Missing.Value) as int? ?? 0; - } - public int MoveLeft(object Unit, object Count, object Extend) - { - return InvokeMethod("MoveLeft", Unit, Count, Extend) as int? ?? 0; - } - public void SelectCell() - { - InvokeMethod("SelectCell"); - } - public void SelectRow() - { - InvokeMethod("SelectRow"); - } - public void SelectColumn() - { - InvokeMethod("SelectColumn"); - } - public void TypeParagraph() - { - InvokeMethod("TypeParagraph"); - } - public void TypeBackspace() - { - InvokeMethod("TypeBackspace"); - } - public int MoveDown() - { - return InvokeMethod("MoveDown", Missing.Value, Missing.Value, Missing.Value) as int? ?? 0; - } - public int MoveDown(object Unit, object Count, object Extend) - { - return InvokeMethod("MoveDown", Unit, Count, Extend) as int? ?? 0; - } - public int MoveUp() - { - return InvokeMethod("MoveUp", Missing.Value, Missing.Value, Missing.Value) as int? ?? 0; - } - public int MoveUp(object Unit, object Count, object Extend) - { - return InvokeMethod("MoveUp", Unit, Count, Extend) as int? ?? 0; - } - } - public partial class LBDocumentClass : LBComObject - { - public LBDocumentClass() { } - public LBDocumentClass(Object item) : base(item) { } - public LBApplicationClass Application - { - get { return new LBApplicationClass(GetProperty("Application")); } - } - public int SaveFormat - { - get { return (GetProperty("SaveFormat") as int? ?? 0); } - } - public String FullName - { - get { return (GetProperty("FullName").ToString()); } - } - public LBShapes Shapes - { - get { return new LBShapes(GetProperty("Shapes")); } - } - public LBWindow ActiveWindow - { - get { return new LBWindow(GetProperty("ActiveWindow")); } - } - public LBPageSetup PageSetup - { - get { return new LBPageSetup(GetProperty("PageSetup")); } - } - public Boolean Saved - { - get { return (GetProperty("Saved") as Boolean? ?? false); } - set { SetProperty("Saved", value); } - } - public LBTables Tables - { - get { return new LBTables(GetProperty("Tables")); } - } - public float DefaultTabStop - { - get { return (GetProperty("DefaultTabStop") as float? ?? 0); } - set { SetProperty("DefaultTabStop", value); } - } - public void SaveAs2000() - { - InvokeMethod("SaveAs2000", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value); - } - public void SaveAs2000(object FileName, object FileFormat, object LockComments, object Password, object AddToRecentFiles, object WritePassword, object ReadOnlyRecommended, object EmbedTrueTypeFonts, object SaveNativePictureFormat, object SaveFormsData, object SaveAsAOCELetter) - { - InvokeMethod("SaveAs2000", FileName, FileFormat, LockComments, Password, AddToRecentFiles, WritePassword, ReadOnlyRecommended, EmbedTrueTypeFonts, SaveNativePictureFormat, SaveFormsData, SaveAsAOCELetter); - } - public void SaveAs() - { - InvokeMethod("SaveAs", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value); - } - public void SaveAs(object FileName, object FileFormat, object LockComments, object Password, object AddToRecentFiles, object WritePassword, object ReadOnlyRecommended, object EmbedTrueTypeFonts, object SaveNativePictureFormat, object SaveFormsData, object SaveAsAOCELetter, object Encoding, object InsertLineBreaks, object AllowSubstitutions, object LineEnding, object AddBiDiMarks) - { - InvokeMethod("SaveAs", FileName, FileFormat, LockComments, Password, AddToRecentFiles, WritePassword, ReadOnlyRecommended, EmbedTrueTypeFonts, SaveNativePictureFormat, SaveFormsData, SaveAsAOCELetter, Encoding, InsertLineBreaks, AllowSubstitutions, LineEnding, AddBiDiMarks); - } - public void Close() - { - InvokeMethod("Close", Missing.Value, Missing.Value, Missing.Value); - } - public void Close(object SaveChanges, object OriginalFormat, object RouteDocument) - { - InvokeMethod("Close", SaveChanges, OriginalFormat, RouteDocument); - } - public void ExportAsFixedFormat(string OutputFileName, LBWdExportFormat ExportFormat) - { - InvokeMethod("ExportAsFixedFormat", OutputFileName, ExportFormat, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value); - } - public void ExportAsFixedFormat(string OutputFileName, LBWdExportFormat ExportFormat, Boolean OpenAfterExport, LBWdExportOptimizeFor OptimizeFor, LBWdExportRange Range, int From, int To, LBWdExportItem Item, Boolean IncludeDocProps, Boolean KeepIRM, LBWdExportCreateBookmarks CreateBookmarks, Boolean DocStructureTags, Boolean BitmapMissingFonts, Boolean UseISO19005_1, object FixedFormatExtClassPtr) - { - InvokeMethod("ExportAsFixedFormat", OutputFileName, ExportFormat, OpenAfterExport, OptimizeFor, Range, From, To, Item, IncludeDocProps, KeepIRM, CreateBookmarks, DocStructureTags, BitmapMissingFonts, UseISO19005_1, FixedFormatExtClassPtr); - } - public LBRange Range() - { - return new LBRange(InvokeMethod("Range", Missing.Value, Missing.Value)); - } - public LBRange Range(object Start, object End) - { - return new LBRange(InvokeMethod("Range", Start, End)); - } - public Boolean Undo() - { - return InvokeMethod("Undo", Missing.Value) as Boolean? ?? false; - } - public Boolean Undo(object Times) - { - return InvokeMethod("Undo", Times) as Boolean? ?? false; - } - } - public partial class LBWindow : LBComObject - { - public LBWindow() { } - public LBWindow(Object item) : base(item) { } - public LBPane ActivePane - { - get { return new LBPane(GetProperty("ActivePane")); } - } - public LBView View - { - get { return new LBView(GetProperty("View")); } - } - } - public enum LBWdWindowState - { - wdWindowStateNormal = 0, - wdWindowStateMaximize = 1, - wdWindowStateMinimize = 2 - } - public partial class LBRange : LBComObject - { - public LBRange() { } - public LBRange(Object item) : base(item) { } - public LBFontClass Font - { - get { return new LBFontClass(GetProperty("Font")); } - } - public LBWdColorIndex HighlightColorIndex - { - get { return (LBWdColorIndex)GetProperty("HighlightColorIndex"); } - set { SetProperty("HighlightColorIndex", value); } - } - public LBParagraphFormatClass ParagraphFormat - { - get { return new LBParagraphFormatClass(GetProperty("ParagraphFormat")); } - } - public LBParagraphs Paragraphs - { - get { return new LBParagraphs(GetProperty("Paragraphs")); } - } - public int End - { - get { return (GetProperty("End") as int? ?? 0); } - set { SetProperty("End", value); } - } - public int Start - { - get { return (GetProperty("Start") as int? ?? 0); } - set { SetProperty("Start", value); } - } - public String Text - { - get { return (GetProperty("Text").ToString()); } - set { SetProperty("Text", value); } - } - public LBTables Tables - { - get { return new LBTables(GetProperty("Tables")); } - } - public LBRows Rows - { - get { return new LBRows(GetProperty("Rows")); } - } - public LBColumns Columns - { - get { return new LBColumns(GetProperty("Columns")); } - } - public LBCells Cells - { - get { return new LBCells(GetProperty("Cells")); } - } - public LBRange GoTo() - { - return new LBRange(InvokeMethod("GoTo", Missing.Value, Missing.Value, Missing.Value, Missing.Value)); - } - public LBRange GoTo(object What, object Which, object Count, object Name) - { - return new LBRange(InvokeMethod("GoTo", What, Which, Count, Name)); - } - } - public partial class LBParagraphFormatClass : LBComObject - { - public LBParagraphFormatClass() { } - public LBParagraphFormatClass(Object item) : base(item) { } - public LBWdLineSpacing LineSpacingRule - { - get { return (LBWdLineSpacing)GetProperty("LineSpacingRule"); } - set { SetProperty("LineSpacingRule", value); } - } - public float LineSpacing - { - get { return (GetProperty("LineSpacing") as float? ?? 0); } - set { SetProperty("LineSpacing", value); } - } - public float SpaceAfter - { - get { return (GetProperty("SpaceAfter") as float? ?? 0); } - set { SetProperty("SpaceAfter", value); } - } - public int SpaceAfterAuto - { - get { return (GetProperty("SpaceAfterAuto") as int? ?? 0); } - set { SetProperty("SpaceAfterAuto", value); } - } - public float SpaceBefore - { - get { return (GetProperty("SpaceBefore") as float? ?? 0); } - set { SetProperty("SpaceBefore", value); } - } - public int SpaceBeforeAuto - { - get { return (GetProperty("SpaceBeforeAuto") as int? ?? 0); } - set { SetProperty("SpaceBeforeAuto", value); } - } - public LBWdParagraphAlignment Alignment - { - get { return (LBWdParagraphAlignment)GetProperty("Alignment"); } - set { SetProperty("Alignment", value); } - } - public float FirstLineIndent - { - get { return (GetProperty("FirstLineIndent") as float? ?? 0); } - set { SetProperty("FirstLineIndent", value); } - } - public float LeftIndent - { - get { return (GetProperty("LeftIndent") as float? ?? 0); } - set { SetProperty("LeftIndent", value); } - } - } - public enum LBWdSelectionType - { - wdNoSelection = 0, - wdSelectionIP = 1, - wdSelectionNormal = 2, - wdSelectionFrame = 3, - wdSelectionColumn = 4, - wdSelectionRow = 5, - wdSelectionBlock = 6, - wdSelectionInlineShape = 7, - wdSelectionShape = 8 - } - public partial class LBFind : LBComObject - { - public LBFind() { } - public LBFind(Object item) : base(item) { } - public LBReplacement Replacement - { - get { return new LBReplacement(GetProperty("Replacement")); } - } - public Boolean Forward - { - get { return (GetProperty("Forward") as Boolean? ?? false); } - set { SetProperty("Forward", value); } - } - public LBWdFindWrap Wrap - { - get { return (LBWdFindWrap)GetProperty("Wrap"); } - set { SetProperty("Wrap", value); } - } - public Boolean Format - { - get { return (GetProperty("Format") as Boolean? ?? false); } - set { SetProperty("Format", value); } - } - public Boolean MatchWholeWord - { - get { return (GetProperty("MatchWholeWord") as Boolean? ?? false); } - set { SetProperty("MatchWholeWord", value); } - } - public Boolean MatchWildcards - { - get { return (GetProperty("MatchWildcards") as Boolean? ?? false); } - set { SetProperty("MatchWildcards", value); } - } - public Boolean MatchSoundsLike - { - get { return (GetProperty("MatchSoundsLike") as Boolean? ?? false); } - set { SetProperty("MatchSoundsLike", value); } - } - public Boolean MatchAllWordForms - { - get { return (GetProperty("MatchAllWordForms") as Boolean? ?? false); } - set { SetProperty("MatchAllWordForms", value); } - } - public String Text - { - get { return (GetProperty("Text").ToString()); } - set { SetProperty("Text", value); } - } - public Boolean MatchCase - { - get { return (GetProperty("MatchCase") as Boolean? ?? false); } - set { SetProperty("MatchCase", value); } - } - public Boolean Execute() - { - return InvokeMethod("Execute", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value) as Boolean? ?? false; - } - public Boolean Execute(object FindText, object MatchCase, object MatchWholeWord, object MatchWildcards, object MatchSoundsLike, object MatchAllWordForms, object Forward, object Wrap, object Format, object ReplaceWith, object Replace, object MatchKashida, object MatchDiacritics, object MatchAlefHamza, object MatchControl) - { - return InvokeMethod("Execute", FindText, MatchCase, MatchWholeWord, MatchWildcards, MatchSoundsLike, MatchAllWordForms, Forward, Wrap, Format, ReplaceWith, Replace, MatchKashida, MatchDiacritics, MatchAlefHamza, MatchControl) as Boolean? ?? false; - } - public void ClearFormatting() - { - InvokeMethod("ClearFormatting"); - } - } - public partial class LBFontClass : LBComObject - { - public LBFontClass() { } - public LBFontClass(Object item) : base(item) { } - public LBWdColor Color - { - get { return (LBWdColor)GetProperty("Color"); } - set { SetProperty("Color", value); } - } - public int Position - { - get { return (GetProperty("Position") as int? ?? 0); } - set { SetProperty("Position", value); } - } - public int Subscript - { - get { return (GetProperty("Subscript") as int? ?? 0); } - set { SetProperty("Subscript", value); } - } - public int Superscript - { - get { return (GetProperty("Superscript") as int? ?? 0); } - set { SetProperty("Superscript", value); } - } - public float Size - { - get { return (GetProperty("Size") as float? ?? 0); } - set { SetProperty("Size", value); } - } - public String Name - { - get { return (GetProperty("Name").ToString()); } - set { SetProperty("Name", value); } - } - public LBWdUnderline Underline - { - get { return (LBWdUnderline)GetProperty("Underline"); } - set { SetProperty("Underline", value); } - } - public int Bold - { - get { return (GetProperty("Bold") as int? ?? 0); } - set { SetProperty("Bold", value); } - } - } - public enum LBWdInformation - { - wdActiveEndAdjustedPageNumber = 1, - wdActiveEndSectionNumber = 2, - wdActiveEndPageNumber = 3, - wdNumberOfPagesInDocument = 4, - wdHorizontalPositionRelativeToPage = 5, - wdVerticalPositionRelativeToPage = 6, - wdHorizontalPositionRelativeToTextBoundary = 7, - wdVerticalPositionRelativeToTextBoundary = 8, - wdFirstCharacterColumnNumber = 9, - wdFirstCharacterLineNumber = 10, - wdFrameIsSelected = 11, - wdWithInTable = 12, - wdStartOfRangeRowNumber = 13, - wdEndOfRangeRowNumber = 14, - wdMaximumNumberOfRows = 15, - wdStartOfRangeColumnNumber = 16, - wdEndOfRangeColumnNumber = 17, - wdMaximumNumberOfColumns = 18, - wdZoomPercentage = 19, - wdSelectionMode = 20, - wdCapsLock = 21, - wdNumLock = 22, - wdOverType = 23, - wdRevisionMarking = 24, - wdInFootnoteEndnotePane = 25, - wdInCommentPane = 26, - wdInHeaderFooter = 28, - wdAtEndOfRowMarker = 31, - wdReferenceOfType = 32, - wdHeaderFooterType = 33, - wdInMasterDocument = 34, - wdInFootnote = 35, - wdInEndnote = 36, - wdInWordMail = 37, - wdInClipboard = 38 - } - public partial class LBInlineShapes : LBComObjectList /* Collection */ - { - public LBInlineShapes(Object item) - { - Item = item; - } - public LBInlineShape AddPicture(string FileName) - { - return new LBInlineShape(InvokeMethod("AddPicture", FileName, Missing.Value, Missing.Value, Missing.Value)); - } - public LBInlineShape AddPicture(string FileName, object LinkToFile, object SaveWithDocument, object Range) - { - return new LBInlineShape(InvokeMethod("AddPicture", FileName, LinkToFile, SaveWithDocument, Range)); - } - } - public partial class LBParagraphs : LBComObjectList /* Collection */ - { - public LBParagraphs(Object item) - { - Item = item; - } - public int Count - { - get { return (GetProperty("Count") as int? ?? 0); } - } - public LBParagraph First - { - get { return new LBParagraph(GetProperty("First")); } - } - public LBParagraph Last - { - get { return new LBParagraph(GetProperty("Last")); } - } - public System.Object GetEnumerator() - { - return InvokeMethod("GetEnumerator"); - } - } - public partial class LBTables : LBComObjectList /* Collection */ - { - public LBTables(Object item) - { - Item = item; - } - public LBTable Add(LBRange Range, int NumRows, int NumColumns) - { - return new LBTable(InvokeMethod("Add", Range, NumRows, NumColumns, Missing.Value, Missing.Value)); - } - public LBTable Add(LBRange Range, int NumRows, int NumColumns, object DefaultTableBehavior, object AutoFitBehavior) - { - return new LBTable(InvokeMethod("Add", Range, NumRows, NumColumns, DefaultTableBehavior, AutoFitBehavior)); - } - } - public partial class LBCells : LBComObjectList /* Collection */ - { - public LBCells(Object item) - { - Item = item; - } - public LBWdCellVerticalAlignment VerticalAlignment - { - get { return (LBWdCellVerticalAlignment)GetProperty("VerticalAlignment"); } - set { SetProperty("VerticalAlignment", value); } - } - public float Height - { - get { return (GetProperty("Height") as float? ?? 0); } - set { SetProperty("Height", value); } - } - public LBBorders Borders - { - get { return new LBBorders(GetProperty("Borders")); } - } - public System.Object GetEnumerator() - { - return InvokeMethod("GetEnumerator"); - } - public void Merge() - { - InvokeMethod("Merge"); - } - } - public partial class LBRows : LBComObjectList /* Collection */ - { - public LBRows(Object item) - { - Item = item; - } - public int HeadingFormat - { - get { return (GetProperty("HeadingFormat") as int? ?? 0); } - set { SetProperty("HeadingFormat", value); } - } - public LBRow First - { - get { return new LBRow(GetProperty("First")); } - } - public int AllowBreakAcrossPages - { - get { return (GetProperty("AllowBreakAcrossPages") as int? ?? 0); } - set { SetProperty("AllowBreakAcrossPages", value); } - } - } - public partial class LBShapes : LBComObjectList /* Collection */ - { - public LBShapes(Object item) - { - Item = item; - } - public LBShape AddPicture(string FileName) - { - return new LBShape(InvokeMethod("AddPicture", FileName, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value)); - } - public LBShape AddPicture(string FileName, object LinkToFile, object SaveWithDocument, object Left, object Top, object Width, object Height, object Anchor) - { - return new LBShape(InvokeMethod("AddPicture", FileName, LinkToFile, SaveWithDocument, Left, Top, Width, Height, Anchor)); - } - } - public partial class LBPageSetup : LBComObject - { - public LBPageSetup() { } - public LBPageSetup(Object item) : base(item) { } - public float BottomMargin - { - get { return (GetProperty("BottomMargin") as float? ?? 0); } - set { SetProperty("BottomMargin", value); } - } - public float LeftMargin - { - get { return (GetProperty("LeftMargin") as float? ?? 0); } - set { SetProperty("LeftMargin", value); } - } - public float RightMargin - { - get { return (GetProperty("RightMargin") as float? ?? 0); } - set { SetProperty("RightMargin", value); } - } - public float TopMargin - { - get { return (GetProperty("TopMargin") as float? ?? 0); } - set { SetProperty("TopMargin", value); } - } - public LBWdOrientation Orientation - { - get { return (LBWdOrientation)GetProperty("Orientation"); } - set { SetProperty("Orientation", value); } - } - public float PageHeight - { - get { return (GetProperty("PageHeight") as float? ?? 0); } - set { SetProperty("PageHeight", value); } - } - public float PageWidth - { - get { return (GetProperty("PageWidth") as float? ?? 0); } - set { SetProperty("PageWidth", value); } - } - public LBWdPaperSize PaperSize - { - get { return (LBWdPaperSize)GetProperty("PaperSize"); } - set { SetProperty("PaperSize", value); } - } - public float LinesPage - { - get { return (GetProperty("LinesPage") as float? ?? 0); } - set { SetProperty("LinesPage", value); } - } - public float CharsLine - { - get { return (GetProperty("CharsLine") as float? ?? 0); } - set { SetProperty("CharsLine", value); } - } - } - public enum LBWdExportFormat - { - wdExportFormatPDF = 17, - wdExportFormatXPS = 18 - } - public enum LBWdExportOptimizeFor - { - wdExportOptimizeForPrint = 0, - wdExportOptimizeForOnScreen = 1 - } - public enum LBWdExportRange - { - wdExportAllDocument = 0, - wdExportSelection = 1, - wdExportCurrentPage = 2, - wdExportFromTo = 3 - } - public enum LBWdExportItem - { - wdExportDocumentContent = 0, - wdExportDocumentWithMarkup = 7 - } - public enum LBWdExportCreateBookmarks - { - wdExportCreateNoBookmarks = 0, - wdExportCreateHeadingBookmarks = 1, - wdExportCreateWordBookmarks = 2 - } - public partial class LBPane : LBComObject - { - public LBPane() { } - public LBPane(Object item) : base(item) { } - public LBPages Pages - { - get { return new LBPages(GetProperty("Pages")); } - } - public LBView View - { - get { return new LBView(GetProperty("View")); } - } - } - public partial class LBView : LBComObject - { - public LBView() { } - public LBView(Object item) : base(item) { } - public LBWdViewType Type - { - get { return (LBWdViewType)GetProperty("Type"); } - set { SetProperty("Type", value); } - } - public Boolean ShowRevisionsAndComments - { - get { return (GetProperty("ShowRevisionsAndComments") as Boolean? ?? false); } - set { SetProperty("ShowRevisionsAndComments", value); } - } - public LBWdRevisionsView RevisionsView - { - get { return (LBWdRevisionsView)GetProperty("RevisionsView"); } - set { SetProperty("RevisionsView", value); } - } - public LBZoom Zoom - { - get { return new LBZoom(GetProperty("Zoom")); } - } - } - public enum LBWdColorIndex - { - wdNoHighlight = 0, - wdBlack = 1, - wdBlue = 2, - wdTurquoise = 3, - wdBrightGreen = 4, - wdPink = 5, - wdRed = 6, - wdYellow = 7, - wdWhite = 8, - wdDarkBlue = 9, - wdTeal = 10, - wdGreen = 11, - wdViolet = 12, - wdDarkRed = 13, - wdDarkYellow = 14, - wdGray50 = 15, - wdGray25 = 16, - wdByAuthor = -1 - } - public partial class LBColumns : LBComObjectList /* Collection */ - { - public LBColumns(Object item) - { - Item = item; - } - public LBColumn First - { - get { return new LBColumn(GetProperty("First")); } - } - public LBColumn Last - { - get { return new LBColumn(GetProperty("Last")); } - } - public int Count - { - get { return (GetProperty("Count") as int? ?? 0); } - } - public System.Object GetEnumerator() - { - return InvokeMethod("GetEnumerator"); - } - } - public enum LBWdLineSpacing - { - wdLineSpaceSingle = 0, - wdLineSpace1pt5 = 1, - wdLineSpaceDouble = 2, - wdLineSpaceAtLeast = 3, - wdLineSpaceExactly = 4, - wdLineSpaceMultiple = 5 - } - public enum LBWdParagraphAlignment - { - wdAlignParagraphLeft = 0, - wdAlignParagraphCenter = 1, - wdAlignParagraphRight = 2, - wdAlignParagraphJustify = 3, - wdAlignParagraphDistribute = 4, - wdAlignParagraphJustifyMed = 5, - wdAlignParagraphJustifyHi = 7, - wdAlignParagraphJustifyLow = 8, - wdAlignParagraphThaiJustify = 9 - } - public partial class LBReplacement : LBComObject - { - public LBReplacement() { } - public LBReplacement(Object item) : base(item) { } - public String Text - { - get { return (GetProperty("Text").ToString()); } - set { SetProperty("Text", value); } - } - public void ClearFormatting() - { - InvokeMethod("ClearFormatting"); - } - } - public enum LBWdFindWrap - { - wdFindStop = 0, - wdFindContinue = 1, - wdFindAsk = 2 - } - public enum LBWdColor - { - wdColorBlack = 0, - wdColorDarkRed = 128, - wdColorRed = 255, - wdColorDarkGreen = 13056, - wdColorOliveGreen = 13107, - wdColorBrown = 13209, - wdColorOrange = 26367, - wdColorGreen = 32768, - wdColorDarkYellow = 32896, - wdColorLightOrange = 39423, - wdColorLime = 52377, - wdColorGold = 52479, - wdColorBrightGreen = 65280, - wdColorYellow = 65535, - wdColorGray95 = 789516, - wdColorGray90 = 1644825, - wdColorGray875 = 2105376, - wdColorGray85 = 2500134, - wdColorGray80 = 3355443, - wdColorGray75 = 4210752, - wdColorGray70 = 5000268, - wdColorGray65 = 5855577, - wdColorGray625 = 6316128, - wdColorDarkTeal = 6697728, - wdColorPlum = 6697881, - wdColorGray60 = 6710886, - wdColorSeaGreen = 6723891, - wdColorGray55 = 7566195, - wdColorDarkBlue = 8388608, - wdColorViolet = 8388736, - wdColorTeal = 8421376, - wdColorGray50 = 8421504, - wdColorGray45 = 9211020, - wdColorIndigo = 10040115, - wdColorBlueGray = 10053222, - wdColorGray40 = 10066329, - wdColorTan = 10079487, - wdColorLightYellow = 10092543, - wdColorGray375 = 10526880, - wdColorGray35 = 10921638, - wdColorGray30 = 11776947, - wdColorGray25 = 12632256, - wdColorRose = 13408767, - wdColorAqua = 13421619, - wdColorGray20 = 13421772, - wdColorLightGreen = 13434828, - wdColorGray15 = 14277081, - wdColorGray125 = 14737632, - wdColorGray10 = 15132390, - wdColorGray05 = 15987699, - wdColorBlue = 16711680, - wdColorPink = 16711935, - wdColorLightBlue = 16737843, - wdColorLavender = 16751052, - wdColorSkyBlue = 16763904, - wdColorPaleBlue = 16764057, - wdColorTurquoise = 16776960, - wdColorLightTurquoise = 16777164, - wdColorWhite = 16777215, - wdColorAutomatic = -16777216 - } - public enum LBWdUnderline - { - wdUnderlineNone = 0, - wdUnderlineSingle = 1, - wdUnderlineWords = 2, - wdUnderlineDouble = 3, - wdUnderlineDotted = 4, - wdUnderlineThick = 6, - wdUnderlineDash = 7, - wdUnderlineDotDash = 9, - wdUnderlineDotDotDash = 10, - wdUnderlineWavy = 11, - wdUnderlineDottedHeavy = 20, - wdUnderlineDashHeavy = 23, - wdUnderlineDotDashHeavy = 25, - wdUnderlineDotDotDashHeavy = 26, - wdUnderlineWavyHeavy = 27, - wdUnderlineDashLong = 39, - wdUnderlineWavyDouble = 43, - wdUnderlineDashLongHeavy = 55 - } - public partial class LBInlineShape : LBComObject - { - public LBInlineShape() { } - public LBInlineShape(Object item) : base(item) { } - public float Height - { - get { return (GetProperty("Height") as float? ?? 0); } - set { SetProperty("Height", value); } - } - public float Width - { - get { return (GetProperty("Width") as float? ?? 0); } - set { SetProperty("Width", value); } - } - } - public partial class LBParagraph : LBComObject - { - public LBParagraph() { } - public LBParagraph(Object item) : base(item) { } - public LBRange Range - { - get { return new LBRange(GetProperty("Range")); } - } - } - public partial class LBTable : LBComObject - { - public LBTable() { } - public LBTable(Object item) : base(item) { } - public LBColumns Columns - { - get { return new LBColumns(GetProperty("Columns")); } - } - public LBRows Rows - { - get { return new LBRows(GetProperty("Rows")); } - } - public float TopPadding - { - get { return (GetProperty("TopPadding") as float? ?? 0); } - set { SetProperty("TopPadding", value); } - } - public float RightPadding - { - get { return (GetProperty("RightPadding") as float? ?? 0); } - set { SetProperty("RightPadding", value); } - } - public float LeftPadding - { - get { return (GetProperty("LeftPadding") as float? ?? 0); } - set { SetProperty("LeftPadding", value); } - } - public float BottomPadding - { - get { return (GetProperty("BottomPadding") as float? ?? 0); } - set { SetProperty("BottomPadding", value); } - } - } - public enum LBWdCellVerticalAlignment - { - wdCellAlignVerticalTop = 0, - wdCellAlignVerticalCenter = 1, - wdCellAlignVerticalBottom = 3 - } - public partial class LBBorders : LBComObjectList /* Collection */ - { - public LBBorders(Object item) - { - Item = item; - } - public int Count - { - get { return (GetProperty("Count") as int? ?? 0); } - } - } - public partial class LBRow : LBComObject - { - public LBRow() { } - public LBRow(Object item) : base(item) { } - public float Height - { - get { return (GetProperty("Height") as float? ?? 0); } - set { SetProperty("Height", value); } - } - public void Select() - { - InvokeMethod("Select"); - } - } - public partial class LBShape : LBComObject - { - public LBShape() { } - public LBShape(Object item) : base(item) { } - public float Height - { - get { return (GetProperty("Height") as float? ?? 0); } - set { SetProperty("Height", value); } - } - public float Width - { - get { return (GetProperty("Width") as float? ?? 0); } - set { SetProperty("Width", value); } - } - public LBRange Anchor - { - get { return new LBRange(GetProperty("Anchor")); } - } - public LBMsoTriState LockAspectRatio - { - get { return (LBMsoTriState)GetProperty("LockAspectRatio"); } - set { SetProperty("LockAspectRatio", value); } - } - public float Left - { - get { return (GetProperty("Left") as float? ?? 0); } - set { SetProperty("Left", value); } - } - public float LeftRelative - { - get { return (GetProperty("LeftRelative") as float? ?? 0); } - set { SetProperty("LeftRelative", value); } - } - public float Top - { - get { return (GetProperty("Top") as float? ?? 0); } - set { SetProperty("Top", value); } - } - public float TopRelative - { - get { return (GetProperty("TopRelative") as float? ?? 0); } - set { SetProperty("TopRelative", value); } - } - public LBWdRelativeHorizontalPosition RelativeHorizontalPosition - { - get { return (LBWdRelativeHorizontalPosition)GetProperty("RelativeHorizontalPosition"); } - set { SetProperty("RelativeHorizontalPosition", value); } - } - public LBWdRelativeVerticalPosition RelativeVerticalPosition - { - get { return (LBWdRelativeVerticalPosition)GetProperty("RelativeVerticalPosition"); } - set { SetProperty("RelativeVerticalPosition", value); } - } - public int LockAnchor - { - get { return (GetProperty("LockAnchor") as int? ?? 0); } - set { SetProperty("LockAnchor", value); } - } - } - public enum LBWdOrientation - { - wdOrientPortrait = 0, - wdOrientLandscape = 1 - } - public enum LBWdPaperSize - { - wdPaper10x14 = 0, - wdPaper11x17 = 1, - wdPaperLetter = 2, - wdPaperLetterSmall = 3, - wdPaperLegal = 4, - wdPaperExecutive = 5, - wdPaperA3 = 6, - wdPaperA4 = 7, - wdPaperA4Small = 8, - wdPaperA5 = 9, - wdPaperB4 = 10, - wdPaperB5 = 11, - wdPaperCSheet = 12, - wdPaperDSheet = 13, - wdPaperESheet = 14, - wdPaperFanfoldLegalGerman = 15, - wdPaperFanfoldStdGerman = 16, - wdPaperFanfoldUS = 17, - wdPaperFolio = 18, - wdPaperLedger = 19, - wdPaperNote = 20, - wdPaperQuarto = 21, - wdPaperStatement = 22, - wdPaperTabloid = 23, - wdPaperEnvelope9 = 24, - wdPaperEnvelope10 = 25, - wdPaperEnvelope11 = 26, - wdPaperEnvelope12 = 27, - wdPaperEnvelope14 = 28, - wdPaperEnvelopeB4 = 29, - wdPaperEnvelopeB5 = 30, - wdPaperEnvelopeB6 = 31, - wdPaperEnvelopeC3 = 32, - wdPaperEnvelopeC4 = 33, - wdPaperEnvelopeC5 = 34, - wdPaperEnvelopeC6 = 35, - wdPaperEnvelopeC65 = 36, - wdPaperEnvelopeDL = 37, - wdPaperEnvelopeItaly = 38, - wdPaperEnvelopeMonarch = 39, - wdPaperEnvelopePersonal = 40, - wdPaperCustom = 41 - } - public partial class LBPages : LBComObjectList /* Collection */ - { - public LBPages(Object item) - { - Item = item; - } - public int Count - { - get { return (GetProperty("Count") as int? ?? 0); } - } - } - public enum LBWdViewType - { - wdNormalView = 1, - wdOutlineView = 2, - wdPrintView = 3, - wdPrintPreview = 4, - wdMasterView = 5, - wdWebView = 6, - wdReadingView = 7 - } - public enum LBWdRevisionsView - { - wdRevisionsViewFinal = 0, - wdRevisionsViewOriginal = 1 - } - public partial class LBZoom : LBComObject - { - public LBZoom() { } - public LBZoom(Object item) : base(item) { } - public LBWdPageFit PageFit - { - get { return (LBWdPageFit)GetProperty("PageFit"); } - set { SetProperty("PageFit", value); } - } - public int Percentage - { - get { return (GetProperty("Percentage") as int? ?? 0); } - set { SetProperty("Percentage", value); } - } - } - public partial class LBColumn : LBComObject - { - public LBColumn() { } - public LBColumn(Object item) : base(item) { } - public float Width - { - get { return (GetProperty("Width") as float? ?? 0); } - set { SetProperty("Width", value); } - } - public int Index - { - get { return (GetProperty("Index") as int? ?? 0); } - } - public LBColumn Next - { - get { return new LBColumn(GetProperty("Next")); } - } - public LBColumn Previous - { - get { return new LBColumn(GetProperty("Previous")); } - } - public void SetWidth(float ColumnWidth, LBWdRulerStyle RulerStyle) - { - InvokeMethod("SetWidth", ColumnWidth, RulerStyle); - } - } - public enum LBWdRelativeHorizontalPosition - { - wdRelativeHorizontalPositionMargin = 0, - wdRelativeHorizontalPositionPage = 1, - wdRelativeHorizontalPositionColumn = 2, - wdRelativeHorizontalPositionCharacter = 3, - wdRelativeHorizontalPositionLeftMarginArea = 4, - wdRelativeHorizontalPositionRightMarginArea = 5, - wdRelativeHorizontalPositionInnerMarginArea = 6, - wdRelativeHorizontalPositionOuterMarginArea = 7 - } - public enum LBWdRelativeVerticalPosition - { - wdRelativeVerticalPositionMargin = 0, - wdRelativeVerticalPositionPage = 1, - wdRelativeVerticalPositionParagraph = 2, - wdRelativeVerticalPositionLine = 3, - wdRelativeVerticalPositionTopMarginArea = 4, - wdRelativeVerticalPositionBottomMarginArea = 5, - wdRelativeVerticalPositionInnerMarginArea = 6, - wdRelativeVerticalPositionOuterMarginArea = 7 - } - public enum LBWdPageFit - { - wdPageFitNone = 0, - wdPageFitFullPage = 1, - wdPageFitBestFit = 2, - wdPageFitTextFit = 3 - } - public enum LBWdRulerStyle - { - wdAdjustNone = 0, - wdAdjustProportional = 1, - wdAdjustFirstColumn = 2, - wdAdjustSameWidth = 3 - } - public partial class LBBorder : LBComObject - { - public LBBorder() { } - public LBBorder(Object item) : base(item) { } - public LBWdLineStyle LineStyle - { - get { return (LBWdLineStyle)GetProperty("LineStyle"); } - set { SetProperty("LineStyle", value); } - } - public Boolean Visible - { - get { return (GetProperty("Visible") as Boolean? ?? false); } - set { SetProperty("Visible", value); } - } - } - public enum LBWdLineStyle - { - wdLineStyleNone = 0, - wdLineStyleSingle = 1, - wdLineStyleDot = 2, - wdLineStyleDashSmallGap = 3, - wdLineStyleDashLargeGap = 4, - wdLineStyleDashDot = 5, - wdLineStyleDashDotDot = 6, - wdLineStyleDouble = 7, - wdLineStyleTriple = 8, - wdLineStyleThinThickSmallGap = 9, - wdLineStyleThickThinSmallGap = 10, - wdLineStyleThinThickThinSmallGap = 11, - wdLineStyleThinThickMedGap = 12, - wdLineStyleThickThinMedGap = 13, - wdLineStyleThinThickThinMedGap = 14, - wdLineStyleThinThickLargeGap = 15, - wdLineStyleThickThinLargeGap = 16, - wdLineStyleThinThickThinLargeGap = 17, - wdLineStyleSingleWavy = 18, - wdLineStyleDoubleWavy = 19, - wdLineStyleDashDotStroked = 20, - wdLineStyleEmboss3D = 21, - wdLineStyleEngrave3D = 22, - wdLineStyleOutset = 23, - wdLineStyleInset = 24 - } - public enum LBWdBorderType - { - wdBorderDiagonalUp = -8, - wdBorderDiagonalDown = -7, - wdBorderVertical = -6, - wdBorderHorizontal = -5, - wdBorderRight = -4, - wdBorderBottom = -3, - wdBorderLeft = -2, - wdBorderTop = -1 - } - public partial class LBCell : LBComObject - { - public LBCell() { } - public LBCell(Object item) : base(item) { } - public LBColumn Column - { - get { return new LBColumn(GetProperty("Column")); } - } - public LBCell Next - { - get { return new LBCell(GetProperty("Next")); } - } - public LBCell Previous - { - get { return new LBCell(GetProperty("Previous")); } - } - public LBRow Row - { - get { return new LBRow(GetProperty("Row")); } - } - public LBWdCellVerticalAlignment VerticalAlignment - { - get { return (LBWdCellVerticalAlignment)GetProperty("VerticalAlignment"); } - set { SetProperty("VerticalAlignment", value); } - } - public float Width - { - get { return (GetProperty("Width") as float? ?? 0); } - set { SetProperty("Width", value); } - } - public LBTables Tables - { - get { return new LBTables(GetProperty("Tables")); } - } - public void SetWidth(float ColumnWidth, LBWdRulerStyle RulerStyle) - { - InvokeMethod("SetWidth", ColumnWidth, RulerStyle); - } - } - public enum LBWdSaveFormat - { - wdFormatDocument = 0, - wdFormatTemplate = 1, - wdFormatText = 2, - wdFormatTextLineBreaks = 3, - wdFormatDOSText = 4, - wdFormatDOSTextLineBreaks = 5, - wdFormatRTF = 6, - wdFormatUnicodeText = 7, - wdFormatHTML = 8, - wdFormatWebArchive = 9, - wdFormatFilteredHTML = 10, - wdFormatXML = 11, - wdFormatXMLDocument = 12, - wdFormatXMLDocumentMacroEnabled = 13, - wdFormatXMLTemplate = 14, - wdFormatXMLTemplateMacroEnabled = 15, - wdFormatDocumentDefault = 16, - wdFormatPDF = 17, - wdFormatXPS = 18, - wdFormatFlatXML = 19, - wdFormatFlatXMLMacroEnabled = 20, - wdFormatFlatXMLTemplate = 21, - wdFormatFlatXMLTemplateMacroEnabled = 22, - wdFormatOpenDocumentText = 23 - } - public enum LBWdFindMatch - { - wdMatchGraphic = 1, - wdMatchCommentMark = 5, - wdMatchTabCharacter = 9, - wdMatchCaretCharacter = 11, - wdMatchColumnBreak = 14, - wdMatchField = 19, - wdMatchNonbreakingHyphen = 30, - wdMatchOptionalHyphen = 31, - wdMatchNonbreakingSpace = 160, - wdMatchEnDash = 8211, - wdMatchEmDash = 8212, - wdMatchParagraphMark = 65551, - wdMatchFootnoteMark = 65554, - wdMatchEndnoteMark = 65555, - wdMatchManualPageBreak = 65564, - wdMatchAnyDigit = 65567, - wdMatchSectionBreak = 65580, - wdMatchAnyLetter = 65583, - wdMatchAnyCharacter = 65599, - wdMatchWhiteSpace = 65655 - } - public enum LBWdReplace - { - wdReplaceNone = 0, - wdReplaceOne = 1, - wdReplaceAll = 2 - } - public partial class LBPage : LBComObject - { - public LBPage() { } - public LBPage(Object item) : base(item) { } - public int Height - { - get { return (GetProperty("Height") as int? ?? 0); } - } - public int Left - { - get { return (GetProperty("Left") as int? ?? 0); } - } - public LBRectangles Rectangles - { - get { return new LBRectangles(GetProperty("Rectangles")); } - } - public int Top - { - get { return (GetProperty("Top") as int? ?? 0); } - } - public int Width - { - get { return (GetProperty("Width") as int? ?? 0); } - } - } - public partial class LBRectangles : LBComObjectList /* Collection */ - { - public LBRectangles(Object item) - { - Item = item; - } - public int Count - { - get { return (GetProperty("Count") as int? ?? 0); } - } - } - public partial class LBRectangle : LBComObject - { - public LBRectangle() { } - public LBRectangle(Object item) : base(item) { } - public LBLines Lines - { - get { return new LBLines(GetProperty("Lines")); } - } - } - public partial class LBLines : LBComObjectList /* Collection */ - { - public LBLines(Object item) - { - Item = item; - } - public int Count - { - get { return (GetProperty("Count") as int? ?? 0); } - } - } - public partial class LBLine : LBComObject - { - public LBLine() { } - public LBLine(Object item) : base(item) { } - public int Top - { - get { return (GetProperty("Top") as int? ?? 0); } - } - public int Height - { - get { return (GetProperty("Height") as int? ?? 0); } - } - } - public enum LBWdMovementType - { - wdMove = 0, - wdExtend = 1 - } - public enum LBWdUnits - { - wdCharacter = 1, - wdWord = 2, - wdSentence = 3, - wdParagraph = 4, - wdLine = 5, - wdStory = 6, - wdScreen = 7, - wdSection = 8, - wdColumn = 9, - wdRow = 10, - wdWindow = 11, - wdCell = 12, - wdCharacterFormatting = 13, - wdParagraphFormatting = 14, - wdTable = 15, - wdItem = 16 - } - public enum LBWdGoToDirection - { - wdGoToAbsolute = 1, - wdGoToNext = 2, - wdGoToPrevious = 3, - wdGoToLast = -1 - } - public enum LBWdGoToItem - { - wdGoToSection = 0, - wdGoToPage = 1, - wdGoToTable = 2, - wdGoToLine = 3, - wdGoToFootnote = 4, - wdGoToEndnote = 5, - wdGoToComment = 6, - wdGoToField = 7, - wdGoToGraphic = 8, - wdGoToObject = 9, - wdGoToEquation = 10, - wdGoToHeading = 11, - wdGoToPercent = 12, - wdGoToSpellingError = 13, - wdGoToGrammaticalError = 14, - wdGoToProofreadingError = 15, - wdGoToBookmark = -1 - } - public partial class LBPictureFormat : LBComObject - { - public LBPictureFormat() { } - public LBPictureFormat(Object item) : base(item) { } - } - public partial class LBStyle : LBComObject - { - public LBStyle() { } - public LBStyle(Object item) : base(item) { } - public String NameLocal - { - get { return (GetProperty("NameLocal").ToString()); } - set { SetProperty("NameLocal", value); } - } - public int ListLevelNumber - { - get { return (GetProperty("ListLevelNumber") as int? ?? 0); } - } - } - public partial class LBStyles : LBComObjectList /* Collection */ - { - public LBStyles(Object item) - { - Item = item; - } - public int Count - { - get { return (GetProperty("Count") as int? ?? 0); } - } - public LBStyle Item - { - get { return new LBStyle(GetProperty("Item")); } - } - public System.Object GetEnumerator() - { - return InvokeMethod("GetEnumerator"); - } - } -} diff --git a/PROMS/LBWordLibrary/LBComObject.old.cs b/PROMS/LBWordLibrary/LBComObject.old.cs deleted file mode 100644 index 63456181..00000000 --- a/PROMS/LBWordLibrary/LBComObject.old.cs +++ /dev/null @@ -1,1617 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Reflection; - -namespace LBWordLibrary -{ - public abstract partial class LBComObject - { - private Object _Item; - internal Object Item - { - get { return _Item; } - set - { - _Item = value; - if (value != null) _MyType = _Item.GetType(); - } - } - private Type _MyType; - public Type MyType - { - get { return _MyType; } - set { _MyType = value; } - } - protected LBComObject() { } - protected LBComObject(string ProgID) - { - Type objClassType; - objClassType = Type.GetTypeFromProgID(ProgID); - Item = Activator.CreateInstance(objClassType); - } - protected LBComObject(Object item) - { - Item = item; - } - private Object DoInvokeMember(string name, Object[] parameters, BindingFlags bf, Binder b) - { - try - { - return _MyType.InvokeMember(name, bf, b, _Item, parameters); - } - catch (Exception ex) - { - throw new Exception(string.Format("LBComObject.DoInvokeMember {0}.{1}", _MyType.Name, name), ex); - } - return null; - } - protected void SetProperty(string propertyName, params Object[] parameters) - { - DoInvokeMember(propertyName, parameters, BindingFlags.SetProperty, null); - } - protected Object GetProperty(string propertyName) - { - return DoInvokeMember(propertyName, null, BindingFlags.GetProperty, null); - } - protected Object GetProperty(string propertyName, params Object[] parameters) - { - return DoInvokeMember(propertyName, parameters, BindingFlags.GetProperty, null); - } - protected Object InvokeMethod(string methodName, params Object[] parameters) - { - if (parameters != null) - FixParameters(parameters); - return DoInvokeMember(methodName, parameters, BindingFlags.InvokeMethod, null); - } - private void FixParameters(object[] parameters) - { - // Loop through parameters checking to make sure that none of them are LBComObjects - for (int i = 0; i < parameters.Length; i++) - if (parameters[i] is LBComObject) - parameters[i] = (parameters[i] as LBComObject).Item; - } - protected Object InvokeMethod(string methodName) - { - return InvokeMethod(methodName, null); - } - } - public class LBComObjectList : LBComObject - where TList : LBComObjectList - where TItem : LBComObject, new() - { - //public new(Object item):base(item){} - public TItem Add() - { - TItem tmp = new TItem(); - tmp.Item = InvokeMethod("Add"); - return tmp; - } - //public TItem this[int item] - //{ - // get - // { - // TItem tmp = new TItem(); - // tmp.Item = GetProperty("Item", item); - // return tmp; - // } - //} - } - public partial class LBApplicationClass : LBComObject - { - public LBApplicationClass() : base("Word.Application") { } - public LBApplicationClass(Object item) : base(item) { } - public Boolean Visible - { - get { return (GetProperty("Visible") as Boolean? ?? false); } - set { SetProperty("Visible", value); } - } - public LBDocuments Documents - { - get { return new LBDocuments(GetProperty("Documents")); } - } - public LBSelection Selection - { - get { return new LBSelection(GetProperty("Selection")); } - } - public LBDocumentClass ActiveDocument - { - get { return new LBDocumentClass(GetProperty("ActiveDocument")); } - } - public LBWindow ActiveWindow - { - get { return new LBWindow(GetProperty("ActiveWindow")); } - } - public String Version - { - get { return (GetProperty("Version").ToString()); } - } - public String ActivePrinter - { - get { return (GetProperty("ActivePrinter").ToString()); } - set { SetProperty("ActivePrinter", value); } - } - public int BackgroundPrintingStatus - { - get { return (GetProperty("BackgroundPrintingStatus") as int? ?? 0); } - } - public LBWdWindowState WindowState - { - get { return (LBWdWindowState)GetProperty("WindowState"); } - set { SetProperty("WindowState", value); } - } - public int BackgroundSavingStatus - { - get { return (GetProperty("BackgroundSavingStatus") as int? ?? 0); } - } - public void Quit() - { - InvokeMethod("Quit", Missing.Value, Missing.Value, Missing.Value); - } - public void Quit(object SaveChanges, object OriginalFormat, object RouteDocument) - { - InvokeMethod("Quit", SaveChanges, OriginalFormat, RouteDocument); - } - public void PrintOut() - { - InvokeMethod("PrintOut", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value); - } - public void PrintOut(object Background, object Append, object Range, object OutputFileName, object From, object To, object Item, object Copies, object Pages, object PageType, object PrintToFile, object Collate, object FileName, object ActivePrinterMacGX, object ManualDuplexPrint, object PrintZoomColumn, object PrintZoomRow, object PrintZoomPaperWidth, object PrintZoomPaperHeight) - { - InvokeMethod("PrintOut", Background, Append, Range, OutputFileName, From, To, Item, Copies, Pages, PageType, PrintToFile, Collate, FileName, ActivePrinterMacGX, ManualDuplexPrint, PrintZoomColumn, PrintZoomRow, PrintZoomPaperWidth, PrintZoomPaperHeight); - } - public void Activate() - { - InvokeMethod("Activate"); - } - } - public partial class LBDocuments : LBComObjectList /* Collection */ - { - public LBDocuments(Object item) - { - Item = item; - } - public LBDocumentClass Open(object FileName) - { - return new LBDocumentClass(InvokeMethod("Open", FileName, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value)); - } - public LBDocumentClass Open(object FileName, object ConfirmConversions, object ReadOnly, object AddToRecentFiles, object PasswordDocument, object PasswordTemplate, object Revert, object WritePasswordDocument, object WritePasswordTemplate, object Format, object Encoding, object Visible, object OpenAndRepair, object DocumentDirection, object NoEncodingDialog, object XMLTransform) - { - return new LBDocumentClass(InvokeMethod("Open", FileName, ConfirmConversions, ReadOnly, AddToRecentFiles, PasswordDocument, PasswordTemplate, Revert, WritePasswordDocument, WritePasswordTemplate, Format, Encoding, Visible, OpenAndRepair, DocumentDirection, NoEncodingDialog, XMLTransform)); - } - } - public partial class LBSelection : LBComObject - { - public LBSelection() { } - public LBSelection(Object item) : base(item) { } - public LBRange Range - { - get { return new LBRange(GetProperty("Range")); } - } - public LBParagraphFormatClass ParagraphFormat - { - get { return new LBParagraphFormatClass(GetProperty("ParagraphFormat")); } - } - public String Text - { - get { return (GetProperty("Text").ToString()); } - set { SetProperty("Text", value); } - } - public LBWdSelectionType Type - { - get { return (LBWdSelectionType)GetProperty("Type"); } - } - public LBFind Find - { - get { return new LBFind(GetProperty("Find")); } - } - public LBFontClass Font - { - get { return new LBFontClass(GetProperty("Font")); } - } - public int End - { - get { return (GetProperty("End") as int? ?? 0); } - set { SetProperty("End", value); } - } - public int Start - { - get { return (GetProperty("Start") as int? ?? 0); } - set { SetProperty("Start", value); } - } - public LBInlineShapes InlineShapes - { - get { return new LBInlineShapes(GetProperty("InlineShapes")); } - } - public LBParagraphs Paragraphs - { - get { return new LBParagraphs(GetProperty("Paragraphs")); } - } - public LBTables Tables - { - get { return new LBTables(GetProperty("Tables")); } - } - public LBCells Cells - { - get { return new LBCells(GetProperty("Cells")); } - } - public LBRows Rows - { - get { return new LBRows(GetProperty("Rows")); } - } - public void WholeStory() - { - InvokeMethod("WholeStory"); - } - public int MoveStart() - { - return InvokeMethod("MoveStart", Missing.Value, Missing.Value) as int? ?? 0; - } - public int MoveStart(object Unit, object Count) - { - return InvokeMethod("MoveStart", Unit, Count) as int? ?? 0; - } - public int MoveEnd() - { - return InvokeMethod("MoveEnd", Missing.Value, Missing.Value) as int? ?? 0; - } - public int MoveEnd(object Unit, object Count) - { - return InvokeMethod("MoveEnd", Unit, Count) as int? ?? 0; - } - public void Copy() - { - InvokeMethod("Copy"); - } - public int EndKey() - { - return InvokeMethod("EndKey", Missing.Value, Missing.Value) as int? ?? 0; - } - public int EndKey(object Unit, object Extend) - { - return InvokeMethod("EndKey", Unit, Extend) as int? ?? 0; - } - public void TypeText(string Text) - { - InvokeMethod("TypeText", Text); - } - public int EndOf() - { - return InvokeMethod("EndOf", Missing.Value, Missing.Value) as int? ?? 0; - } - public int EndOf(object Unit, object Extend) - { - return InvokeMethod("EndOf", Unit, Extend) as int? ?? 0; - } - public LBRange GoTo() - { - return new LBRange(InvokeMethod("GoTo", Missing.Value, Missing.Value, Missing.Value, Missing.Value)); - } - public LBRange GoTo(object What, object Which, object Count, object Name) - { - return new LBRange(InvokeMethod("GoTo", What, Which, Count, Name)); - } - public void InsertSymbol(int CharacterNumber) - { - InvokeMethod("InsertSymbol", CharacterNumber, Missing.Value, Missing.Value, Missing.Value); - } - public void InsertSymbol(int CharacterNumber, object Font, object Unicode, object Bias) - { - InvokeMethod("InsertSymbol", CharacterNumber, Font, Unicode, Bias); - } - public int MoveRight() - { - return InvokeMethod("MoveRight", Missing.Value, Missing.Value, Missing.Value) as int? ?? 0; - } - public int MoveRight(object Unit, object Count, object Extend) - { - return InvokeMethod("MoveRight", Unit, Count, Extend) as int? ?? 0; - } - public int MoveLeft() - { - return InvokeMethod("MoveLeft", Missing.Value, Missing.Value, Missing.Value) as int? ?? 0; - } - public int MoveLeft(object Unit, object Count, object Extend) - { - return InvokeMethod("MoveLeft", Unit, Count, Extend) as int? ?? 0; - } - public void SelectCell() - { - InvokeMethod("SelectCell"); - } - public void SelectRow() - { - InvokeMethod("SelectRow"); - } - public void SelectColumn() - { - InvokeMethod("SelectColumn"); - } - public void TypeParagraph() - { - InvokeMethod("TypeParagraph"); - } - public void TypeBackspace() - { - InvokeMethod("TypeBackspace"); - } - } - public partial class LBDocumentClass : LBComObject - { - public LBDocumentClass() { } - public LBDocumentClass(Object item) : base(item) { } - public LBApplicationClass Application - { - get { return new LBApplicationClass(GetProperty("Application")); } - } - public int SaveFormat - { - get { return (GetProperty("SaveFormat") as int? ?? 0); } - } - public String FullName - { - get { return (GetProperty("FullName").ToString()); } - } - public LBShapes Shapes - { - get { return new LBShapes(GetProperty("Shapes")); } - } - public LBWindow ActiveWindow - { - get { return new LBWindow(GetProperty("ActiveWindow")); } - } - public LBPageSetup PageSetup - { - get { return new LBPageSetup(GetProperty("PageSetup")); } - } - public Boolean Saved - { - get { return (GetProperty("Saved") as Boolean? ?? false); } - set { SetProperty("Saved", value); } - } - public LBTables Tables - { - get { return new LBTables(GetProperty("Tables")); } - } - public float DefaultTabStop - { - get { return (GetProperty("DefaultTabStop") as float? ?? 0); } - set { SetProperty("DefaultTabStop", value); } - } - public void SaveAs2000() - { - InvokeMethod("SaveAs2000", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value); - } - public void SaveAs2000(object FileName, object FileFormat, object LockComments, object Password, object AddToRecentFiles, object WritePassword, object ReadOnlyRecommended, object EmbedTrueTypeFonts, object SaveNativePictureFormat, object SaveFormsData, object SaveAsAOCELetter) - { - InvokeMethod("SaveAs2000", FileName, FileFormat, LockComments, Password, AddToRecentFiles, WritePassword, ReadOnlyRecommended, EmbedTrueTypeFonts, SaveNativePictureFormat, SaveFormsData, SaveAsAOCELetter); - } - public void SaveAs() - { - InvokeMethod("SaveAs", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value); - } - public void SaveAs(object FileName, object FileFormat, object LockComments, object Password, object AddToRecentFiles, object WritePassword, object ReadOnlyRecommended, object EmbedTrueTypeFonts, object SaveNativePictureFormat, object SaveFormsData, object SaveAsAOCELetter, object Encoding, object InsertLineBreaks, object AllowSubstitutions, object LineEnding, object AddBiDiMarks) - { - InvokeMethod("SaveAs", FileName, FileFormat, LockComments, Password, AddToRecentFiles, WritePassword, ReadOnlyRecommended, EmbedTrueTypeFonts, SaveNativePictureFormat, SaveFormsData, SaveAsAOCELetter, Encoding, InsertLineBreaks, AllowSubstitutions, LineEnding, AddBiDiMarks); - } - public void Close() - { - InvokeMethod("Close", Missing.Value, Missing.Value, Missing.Value); - } - public void Close(object SaveChanges, object OriginalFormat, object RouteDocument) - { - InvokeMethod("Close", SaveChanges, OriginalFormat, RouteDocument); - } - public void ExportAsFixedFormat(string OutputFileName, LBWdExportFormat ExportFormat) - { - InvokeMethod("ExportAsFixedFormat", OutputFileName, ExportFormat, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value); - } - public void ExportAsFixedFormat(string OutputFileName, LBWdExportFormat ExportFormat, Boolean OpenAfterExport, LBWdExportOptimizeFor OptimizeFor, LBWdExportRange Range, int From, int To, LBWdExportItem Item, Boolean IncludeDocProps, Boolean KeepIRM, LBWdExportCreateBookmarks CreateBookmarks, Boolean DocStructureTags, Boolean BitmapMissingFonts, Boolean UseISO19005_1, object FixedFormatExtClassPtr) - { - InvokeMethod("ExportAsFixedFormat", OutputFileName, ExportFormat, OpenAfterExport, OptimizeFor, Range, From, To, Item, IncludeDocProps, KeepIRM, CreateBookmarks, DocStructureTags, BitmapMissingFonts, UseISO19005_1, FixedFormatExtClassPtr); - } - public LBRange Range() - { - return new LBRange(InvokeMethod("Range", Missing.Value, Missing.Value)); - } - public LBRange Range(object Start, object End) - { - return new LBRange(InvokeMethod("Range", Start, End)); - } - public Boolean Undo() - { - return InvokeMethod("Undo", Missing.Value) as Boolean? ?? false; - } - public Boolean Undo(object Times) - { - return InvokeMethod("Undo", Times) as Boolean? ?? false; - } - } - public partial class LBWindow : LBComObject - { - public LBWindow() { } - public LBWindow(Object item) : base(item) { } - public LBPane ActivePane - { - get { return new LBPane(GetProperty("ActivePane")); } - } - public LBView View - { - get { return new LBView(GetProperty("View")); } - } - } - public enum LBWdWindowState - { - wdWindowStateNormal = 0, - wdWindowStateMaximize = 1, - wdWindowStateMinimize = 2 - } - public partial class LBRange : LBComObject - { - public LBRange() { } - public LBRange(Object item) : base(item) { } - public LBFontClass Font - { - get { return new LBFontClass(GetProperty("Font")); } - } - public LBWdColorIndex HighlightColorIndex - { - get { return (LBWdColorIndex)GetProperty("HighlightColorIndex"); } - set { SetProperty("HighlightColorIndex", value); } - } - public LBParagraphFormatClass ParagraphFormat - { - get { return new LBParagraphFormatClass(GetProperty("ParagraphFormat")); } - } - public LBParagraphs Paragraphs - { - get { return new LBParagraphs(GetProperty("Paragraphs")); } - } - public int End - { - get { return (GetProperty("End") as int? ?? 0); } - set { SetProperty("End", value); } - } - public int Start - { - get { return (GetProperty("Start") as int? ?? 0); } - set { SetProperty("Start", value); } - } - public String Text - { - get { return (GetProperty("Text").ToString()); } - set { SetProperty("Text", value); } - } - public LBRange GoTo() - { - return new LBRange(InvokeMethod("GoTo", Missing.Value, Missing.Value, Missing.Value, Missing.Value)); - } - public LBRange GoTo(object What, object Which, object Count, object Name) - { - return new LBRange(InvokeMethod("GoTo", What, Which, Count, Name)); - } - } - public partial class LBParagraphFormatClass : LBComObject - { - public LBParagraphFormatClass() { } - public LBParagraphFormatClass(Object item) : base(item) { } - public LBWdLineSpacing LineSpacingRule - { - get { return (LBWdLineSpacing)GetProperty("LineSpacingRule"); } - set { SetProperty("LineSpacingRule", value); } - } - public float LineSpacing - { - get { return (GetProperty("LineSpacing") as float? ?? 0); } - set { SetProperty("LineSpacing", value); } - } - public float SpaceAfter - { - get { return (GetProperty("SpaceAfter") as float? ?? 0); } - set { SetProperty("SpaceAfter", value); } - } - public int SpaceAfterAuto - { - get { return (GetProperty("SpaceAfterAuto") as int? ?? 0); } - set { SetProperty("SpaceAfterAuto", value); } - } - public float SpaceBefore - { - get { return (GetProperty("SpaceBefore") as float? ?? 0); } - set { SetProperty("SpaceBefore", value); } - } - public int SpaceBeforeAuto - { - get { return (GetProperty("SpaceBeforeAuto") as int? ?? 0); } - set { SetProperty("SpaceBeforeAuto", value); } - } - public LBWdParagraphAlignment Alignment - { - get { return (LBWdParagraphAlignment)GetProperty("Alignment"); } - set { SetProperty("Alignment", value); } - } - public float FirstLineIndent - { - get { return (GetProperty("FirstLineIndent") as float? ?? 0); } - set { SetProperty("FirstLineIndent", value); } - } - public float LeftIndent - { - get { return (GetProperty("LeftIndent") as float? ?? 0); } - set { SetProperty("LeftIndent", value); } - } - } - public enum LBWdSelectionType - { - wdNoSelection = 0, - wdSelectionIP = 1, - wdSelectionNormal = 2, - wdSelectionFrame = 3, - wdSelectionColumn = 4, - wdSelectionRow = 5, - wdSelectionBlock = 6, - wdSelectionInlineShape = 7, - wdSelectionShape = 8 - } - public partial class LBFind : LBComObject - { - public LBFind() { } - public LBFind(Object item) : base(item) { } - public LBReplacement Replacement - { - get { return new LBReplacement(GetProperty("Replacement")); } - } - public Boolean Forward - { - get { return (GetProperty("Forward") as Boolean? ?? false); } - set { SetProperty("Forward", value); } - } - public LBWdFindWrap Wrap - { - get { return (LBWdFindWrap)GetProperty("Wrap"); } - set { SetProperty("Wrap", value); } - } - public Boolean Format - { - get { return (GetProperty("Format") as Boolean? ?? false); } - set { SetProperty("Format", value); } - } - public Boolean MatchWholeWord - { - get { return (GetProperty("MatchWholeWord") as Boolean? ?? false); } - set { SetProperty("MatchWholeWord", value); } - } - public Boolean MatchWildcards - { - get { return (GetProperty("MatchWildcards") as Boolean? ?? false); } - set { SetProperty("MatchWildcards", value); } - } - public Boolean MatchSoundsLike - { - get { return (GetProperty("MatchSoundsLike") as Boolean? ?? false); } - set { SetProperty("MatchSoundsLike", value); } - } - public Boolean MatchAllWordForms - { - get { return (GetProperty("MatchAllWordForms") as Boolean? ?? false); } - set { SetProperty("MatchAllWordForms", value); } - } - public String Text - { - get { return (GetProperty("Text").ToString()); } - set { SetProperty("Text", value); } - } - public Boolean MatchCase - { - get { return (GetProperty("MatchCase") as Boolean? ?? false); } - set { SetProperty("MatchCase", value); } - } - public Boolean Execute() - { - return InvokeMethod("Execute", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value) as Boolean? ?? false; - } - public Boolean Execute(object FindText, object MatchCase, object MatchWholeWord, object MatchWildcards, object MatchSoundsLike, object MatchAllWordForms, object Forward, object Wrap, object Format, object ReplaceWith, object Replace, object MatchKashida, object MatchDiacritics, object MatchAlefHamza, object MatchControl) - { - return InvokeMethod("Execute", FindText, MatchCase, MatchWholeWord, MatchWildcards, MatchSoundsLike, MatchAllWordForms, Forward, Wrap, Format, ReplaceWith, Replace, MatchKashida, MatchDiacritics, MatchAlefHamza, MatchControl) as Boolean? ?? false; - } - public void ClearFormatting() - { - InvokeMethod("ClearFormatting"); - } - } - public partial class LBFontClass : LBComObject - { - public LBFontClass() { } - public LBFontClass(Object item) : base(item) { } - public LBWdColor Color - { - get { return (LBWdColor)GetProperty("Color"); } - set { SetProperty("Color", value); } - } - public int Position - { - get { return (GetProperty("Position") as int? ?? 0); } - set { SetProperty("Position", value); } - } - public int Subscript - { - get { return (GetProperty("Subscript") as int? ?? 0); } - set { SetProperty("Subscript", value); } - } - public int Superscript - { - get { return (GetProperty("Superscript") as int? ?? 0); } - set { SetProperty("Superscript", value); } - } - public float Size - { - get { return (GetProperty("Size") as float? ?? 0); } - set { SetProperty("Size", value); } - } - public String Name - { - get { return (GetProperty("Name").ToString()); } - set { SetProperty("Name", value); } - } - public LBWdUnderline Underline - { - get { return (LBWdUnderline)GetProperty("Underline"); } - set { SetProperty("Underline", value); } - } - public int Bold - { - get { return (GetProperty("Bold") as int? ?? 0); } - set { SetProperty("Bold", value); } - } - } - public enum LBWdInformation - { - wdActiveEndAdjustedPageNumber = 1, - wdActiveEndSectionNumber = 2, - wdActiveEndPageNumber = 3, - wdNumberOfPagesInDocument = 4, - wdHorizontalPositionRelativeToPage = 5, - wdVerticalPositionRelativeToPage = 6, - wdHorizontalPositionRelativeToTextBoundary = 7, - wdVerticalPositionRelativeToTextBoundary = 8, - wdFirstCharacterColumnNumber = 9, - wdFirstCharacterLineNumber = 10, - wdFrameIsSelected = 11, - wdWithInTable = 12, - wdStartOfRangeRowNumber = 13, - wdEndOfRangeRowNumber = 14, - wdMaximumNumberOfRows = 15, - wdStartOfRangeColumnNumber = 16, - wdEndOfRangeColumnNumber = 17, - wdMaximumNumberOfColumns = 18, - wdZoomPercentage = 19, - wdSelectionMode = 20, - wdCapsLock = 21, - wdNumLock = 22, - wdOverType = 23, - wdRevisionMarking = 24, - wdInFootnoteEndnotePane = 25, - wdInCommentPane = 26, - wdInHeaderFooter = 28, - wdAtEndOfRowMarker = 31, - wdReferenceOfType = 32, - wdHeaderFooterType = 33, - wdInMasterDocument = 34, - wdInFootnote = 35, - wdInEndnote = 36, - wdInWordMail = 37, - wdInClipboard = 38 - } - public partial class LBInlineShapes : LBComObjectList /* Collection */ - { - public LBInlineShapes(Object item) - { - Item = item; - } - public LBInlineShape AddPicture(string FileName) - { - return new LBInlineShape(InvokeMethod("AddPicture", FileName, Missing.Value, Missing.Value, Missing.Value)); - } - public LBInlineShape AddPicture(string FileName, object LinkToFile, object SaveWithDocument, object Range) - { - return new LBInlineShape(InvokeMethod("AddPicture", FileName, LinkToFile, SaveWithDocument, Range)); - } - } - public partial class LBParagraphs : LBComObjectList /* Collection */ - { - public LBParagraphs(Object item) - { - Item = item; - } - public int Count - { - get { return (GetProperty("Count") as int? ?? 0); } - } - public LBParagraph First - { - get { return new LBParagraph(GetProperty("First")); } - } - public LBParagraph Last - { - get { return new LBParagraph(GetProperty("Last")); } - } - public System.Object GetEnumerator() - { - return InvokeMethod("GetEnumerator"); - } - } - public partial class LBTables : LBComObjectList /* Collection */ - { - public LBTables(Object item) - { - Item = item; - } - public LBTable Add(LBRange Range, int NumRows, int NumColumns) - { - return new LBTable(InvokeMethod("Add", Range, NumRows, NumColumns, Missing.Value, Missing.Value)); - } - public LBTable Add(LBRange Range, int NumRows, int NumColumns, object DefaultTableBehavior, object AutoFitBehavior) - { - return new LBTable(InvokeMethod("Add", Range, NumRows, NumColumns, DefaultTableBehavior, AutoFitBehavior)); - } - } - public partial class LBCells : LBComObjectList /* Collection */ - { - public LBCells(Object item) - { - Item = item; - } - public LBWdCellVerticalAlignment VerticalAlignment - { - get { return (LBWdCellVerticalAlignment)GetProperty("VerticalAlignment"); } - set { SetProperty("VerticalAlignment", value); } - } - public float Height - { - get { return (GetProperty("Height") as float? ?? 0); } - set { SetProperty("Height", value); } - } - public System.Object GetEnumerator() - { - return InvokeMethod("GetEnumerator"); - } - public void Merge() - { - InvokeMethod("Merge"); - } - } - public partial class LBRows : LBComObjectList /* Collection */ - { - public LBRows(Object item) - { - Item = item; - } - public int HeadingFormat - { - get { return (GetProperty("HeadingFormat") as int? ?? 0); } - set { SetProperty("HeadingFormat", value); } - } - public LBRow First - { - get { return new LBRow(GetProperty("First")); } - } - public int AllowBreakAcrossPages - { - get { return (GetProperty("AllowBreakAcrossPages") as int? ?? 0); } - set { SetProperty("AllowBreakAcrossPages", value); } - } - } - public partial class LBShapes : LBComObjectList /* Collection */ - { - public LBShapes(Object item) - { - Item = item; - } - public LBShape AddPicture(string FileName) - { - return new LBShape(InvokeMethod("AddPicture", FileName, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value)); - } - public LBShape AddPicture(string FileName, object LinkToFile, object SaveWithDocument, object Left, object Top, object Width, object Height, object Anchor) - { - return new LBShape(InvokeMethod("AddPicture", FileName, LinkToFile, SaveWithDocument, Left, Top, Width, Height, Anchor)); - } - } - public partial class LBPageSetup : LBComObject - { - public LBPageSetup() { } - public LBPageSetup(Object item) : base(item) { } - public float BottomMargin - { - get { return (GetProperty("BottomMargin") as float? ?? 0); } - set { SetProperty("BottomMargin", value); } - } - public float LeftMargin - { - get { return (GetProperty("LeftMargin") as float? ?? 0); } - set { SetProperty("LeftMargin", value); } - } - public float RightMargin - { - get { return (GetProperty("RightMargin") as float? ?? 0); } - set { SetProperty("RightMargin", value); } - } - public float TopMargin - { - get { return (GetProperty("TopMargin") as float? ?? 0); } - set { SetProperty("TopMargin", value); } - } - public LBWdOrientation Orientation - { - get { return (LBWdOrientation)GetProperty("Orientation"); } - set { SetProperty("Orientation", value); } - } - public float PageHeight - { - get { return (GetProperty("PageHeight") as float? ?? 0); } - set { SetProperty("PageHeight", value); } - } - public float PageWidth - { - get { return (GetProperty("PageWidth") as float? ?? 0); } - set { SetProperty("PageWidth", value); } - } - public LBWdPaperSize PaperSize - { - get { return (LBWdPaperSize)GetProperty("PaperSize"); } - set { SetProperty("PaperSize", value); } - } - public float LinesPage - { - get { return (GetProperty("LinesPage") as float? ?? 0); } - set { SetProperty("LinesPage", value); } - } - public float CharsLine - { - get { return (GetProperty("CharsLine") as float? ?? 0); } - set { SetProperty("CharsLine", value); } - } - } - public enum LBWdExportFormat - { - wdExportFormatPDF = 17, - wdExportFormatXPS = 18 - } - public enum LBWdExportOptimizeFor - { - wdExportOptimizeForPrint = 0, - wdExportOptimizeForOnScreen = 1 - } - public enum LBWdExportRange - { - wdExportAllDocument = 0, - wdExportSelection = 1, - wdExportCurrentPage = 2, - wdExportFromTo = 3 - } - public enum LBWdExportItem - { - wdExportDocumentContent = 0, - wdExportDocumentWithMarkup = 7 - } - public enum LBWdExportCreateBookmarks - { - wdExportCreateNoBookmarks = 0, - wdExportCreateHeadingBookmarks = 1, - wdExportCreateWordBookmarks = 2 - } - public partial class LBPane : LBComObject - { - public LBPane() { } - public LBPane(Object item) : base(item) { } - public LBPages Pages - { - get { return new LBPages(GetProperty("Pages")); } - } - public LBView View - { - get { return new LBView(GetProperty("View")); } - } - } - public partial class LBView : LBComObject - { - public LBView() { } - public LBView(Object item) : base(item) { } - public LBWdViewType Type - { - get { return (LBWdViewType)GetProperty("Type"); } - set { SetProperty("Type", value); } - } - public Boolean ShowRevisionsAndComments - { - get { return (GetProperty("ShowRevisionsAndComments") as Boolean? ?? false); } - set { SetProperty("ShowRevisionsAndComments", value); } - } - public LBWdRevisionsView RevisionsView - { - get { return (LBWdRevisionsView)GetProperty("RevisionsView"); } - set { SetProperty("RevisionsView", value); } - } - public LBZoom Zoom - { - get { return new LBZoom(GetProperty("Zoom")); } - } - } - public enum LBWdColorIndex - { - wdNoHighlight = 0, - wdBlack = 1, - wdBlue = 2, - wdTurquoise = 3, - wdBrightGreen = 4, - wdPink = 5, - wdRed = 6, - wdYellow = 7, - wdWhite = 8, - wdDarkBlue = 9, - wdTeal = 10, - wdGreen = 11, - wdViolet = 12, - wdDarkRed = 13, - wdDarkYellow = 14, - wdGray50 = 15, - wdGray25 = 16, - wdByAuthor = -1 - } - public enum LBWdLineSpacing - { - wdLineSpaceSingle = 0, - wdLineSpace1pt5 = 1, - wdLineSpaceDouble = 2, - wdLineSpaceAtLeast = 3, - wdLineSpaceExactly = 4, - wdLineSpaceMultiple = 5 - } - public enum LBWdParagraphAlignment - { - wdAlignParagraphLeft = 0, - wdAlignParagraphCenter = 1, - wdAlignParagraphRight = 2, - wdAlignParagraphJustify = 3, - wdAlignParagraphDistribute = 4, - wdAlignParagraphJustifyMed = 5, - wdAlignParagraphJustifyHi = 7, - wdAlignParagraphJustifyLow = 8, - wdAlignParagraphThaiJustify = 9 - } - public partial class LBReplacement : LBComObject - { - public LBReplacement() { } - public LBReplacement(Object item) : base(item) { } - public String Text - { - get { return (GetProperty("Text").ToString()); } - set { SetProperty("Text", value); } - } - public void ClearFormatting() - { - InvokeMethod("ClearFormatting"); - } - } - public enum LBWdFindWrap - { - wdFindStop = 0, - wdFindContinue = 1, - wdFindAsk = 2 - } - public enum LBWdColor - { - wdColorBlack = 0, - wdColorDarkRed = 128, - wdColorRed = 255, - wdColorDarkGreen = 13056, - wdColorOliveGreen = 13107, - wdColorBrown = 13209, - wdColorOrange = 26367, - wdColorGreen = 32768, - wdColorDarkYellow = 32896, - wdColorLightOrange = 39423, - wdColorLime = 52377, - wdColorGold = 52479, - wdColorBrightGreen = 65280, - wdColorYellow = 65535, - wdColorGray95 = 789516, - wdColorGray90 = 1644825, - wdColorGray875 = 2105376, - wdColorGray85 = 2500134, - wdColorGray80 = 3355443, - wdColorGray75 = 4210752, - wdColorGray70 = 5000268, - wdColorGray65 = 5855577, - wdColorGray625 = 6316128, - wdColorDarkTeal = 6697728, - wdColorPlum = 6697881, - wdColorGray60 = 6710886, - wdColorSeaGreen = 6723891, - wdColorGray55 = 7566195, - wdColorDarkBlue = 8388608, - wdColorViolet = 8388736, - wdColorTeal = 8421376, - wdColorGray50 = 8421504, - wdColorGray45 = 9211020, - wdColorIndigo = 10040115, - wdColorBlueGray = 10053222, - wdColorGray40 = 10066329, - wdColorTan = 10079487, - wdColorLightYellow = 10092543, - wdColorGray375 = 10526880, - wdColorGray35 = 10921638, - wdColorGray30 = 11776947, - wdColorGray25 = 12632256, - wdColorRose = 13408767, - wdColorAqua = 13421619, - wdColorGray20 = 13421772, - wdColorLightGreen = 13434828, - wdColorGray15 = 14277081, - wdColorGray125 = 14737632, - wdColorGray10 = 15132390, - wdColorGray05 = 15987699, - wdColorBlue = 16711680, - wdColorPink = 16711935, - wdColorLightBlue = 16737843, - wdColorLavender = 16751052, - wdColorSkyBlue = 16763904, - wdColorPaleBlue = 16764057, - wdColorTurquoise = 16776960, - wdColorLightTurquoise = 16777164, - wdColorWhite = 16777215, - wdColorAutomatic = -16777216 - } - public enum LBWdUnderline - { - wdUnderlineNone = 0, - wdUnderlineSingle = 1, - wdUnderlineWords = 2, - wdUnderlineDouble = 3, - wdUnderlineDotted = 4, - wdUnderlineThick = 6, - wdUnderlineDash = 7, - wdUnderlineDotDash = 9, - wdUnderlineDotDotDash = 10, - wdUnderlineWavy = 11, - wdUnderlineDottedHeavy = 20, - wdUnderlineDashHeavy = 23, - wdUnderlineDotDashHeavy = 25, - wdUnderlineDotDotDashHeavy = 26, - wdUnderlineWavyHeavy = 27, - wdUnderlineDashLong = 39, - wdUnderlineWavyDouble = 43, - wdUnderlineDashLongHeavy = 55 - } - public partial class LBInlineShape : LBComObject - { - public LBInlineShape() { } - public LBInlineShape(Object item) : base(item) { } - public float Height - { - get { return (GetProperty("Height") as float? ?? 0); } - set { SetProperty("Height", value); } - } - public float Width - { - get { return (GetProperty("Width") as float? ?? 0); } - set { SetProperty("Width", value); } - } - } - public partial class LBParagraph : LBComObject - { - public LBParagraph() { } - public LBParagraph(Object item) : base(item) { } - public LBRange Range - { - get { return new LBRange(GetProperty("Range")); } - } - } - public partial class LBTable : LBComObject - { - public LBTable() { } - public LBTable(Object item) : base(item) { } - public LBColumns Columns - { - get { return new LBColumns(GetProperty("Columns")); } - } - public LBRows Rows - { - get { return new LBRows(GetProperty("Rows")); } - } - public float TopPadding - { - get { return (GetProperty("TopPadding") as float? ?? 0); } - set { SetProperty("TopPadding", value); } - } - public float RightPadding - { - get { return (GetProperty("RightPadding") as float? ?? 0); } - set { SetProperty("RightPadding", value); } - } - public float LeftPadding - { - get { return (GetProperty("LeftPadding") as float? ?? 0); } - set { SetProperty("LeftPadding", value); } - } - public float BottomPadding - { - get { return (GetProperty("BottomPadding") as float? ?? 0); } - set { SetProperty("BottomPadding", value); } - } - } - public enum LBWdCellVerticalAlignment - { - wdCellAlignVerticalTop = 0, - wdCellAlignVerticalCenter = 1, - wdCellAlignVerticalBottom = 3 - } - public partial class LBRow : LBComObject - { - public LBRow() { } - public LBRow(Object item) : base(item) { } - public float Height - { - get { return (GetProperty("Height") as float? ?? 0); } - set { SetProperty("Height", value); } - } - public void Select() - { - InvokeMethod("Select"); - } - } - public partial class LBShape : LBComObject - { - public LBShape() { } - public LBShape(Object item) : base(item) { } - public float Height - { - get { return (GetProperty("Height") as float? ?? 0); } - set { SetProperty("Height", value); } - } - public float Width - { - get { return (GetProperty("Width") as float? ?? 0); } - set { SetProperty("Width", value); } - } - public LBRange Anchor - { - get { return new LBRange(GetProperty("Anchor")); } - } - public LBMsoTriState LockAspectRatio - { - get { return (LBMsoTriState)GetProperty("LockAspectRatio"); } - set { SetProperty("LockAspectRatio", value); } - } - public float Left - { - get { return (GetProperty("Left") as float? ?? 0); } - set { SetProperty("Left", value); } - } - public float LeftRelative - { - get { return (GetProperty("LeftRelative") as float? ?? 0); } - set { SetProperty("LeftRelative", value); } - } - public float Top - { - get { return (GetProperty("Top") as float? ?? 0); } - set { SetProperty("Top", value); } - } - public float TopRelative - { - get { return (GetProperty("TopRelative") as float? ?? 0); } - set { SetProperty("TopRelative", value); } - } - public LBWdRelativeHorizontalPosition RelativeHorizontalPosition - { - get { return (LBWdRelativeHorizontalPosition)GetProperty("RelativeHorizontalPosition"); } - set { SetProperty("RelativeHorizontalPosition", value); } - } - public LBWdRelativeVerticalPosition RelativeVerticalPosition - { - get { return (LBWdRelativeVerticalPosition)GetProperty("RelativeVerticalPosition"); } - set { SetProperty("RelativeVerticalPosition", value); } - } - public int LockAnchor - { - get { return (GetProperty("LockAnchor") as int? ?? 0); } - set { SetProperty("LockAnchor", value); } - } - } - public enum LBWdOrientation - { - wdOrientPortrait = 0, - wdOrientLandscape = 1 - } - public enum LBWdPaperSize - { - wdPaper10x14 = 0, - wdPaper11x17 = 1, - wdPaperLetter = 2, - wdPaperLetterSmall = 3, - wdPaperLegal = 4, - wdPaperExecutive = 5, - wdPaperA3 = 6, - wdPaperA4 = 7, - wdPaperA4Small = 8, - wdPaperA5 = 9, - wdPaperB4 = 10, - wdPaperB5 = 11, - wdPaperCSheet = 12, - wdPaperDSheet = 13, - wdPaperESheet = 14, - wdPaperFanfoldLegalGerman = 15, - wdPaperFanfoldStdGerman = 16, - wdPaperFanfoldUS = 17, - wdPaperFolio = 18, - wdPaperLedger = 19, - wdPaperNote = 20, - wdPaperQuarto = 21, - wdPaperStatement = 22, - wdPaperTabloid = 23, - wdPaperEnvelope9 = 24, - wdPaperEnvelope10 = 25, - wdPaperEnvelope11 = 26, - wdPaperEnvelope12 = 27, - wdPaperEnvelope14 = 28, - wdPaperEnvelopeB4 = 29, - wdPaperEnvelopeB5 = 30, - wdPaperEnvelopeB6 = 31, - wdPaperEnvelopeC3 = 32, - wdPaperEnvelopeC4 = 33, - wdPaperEnvelopeC5 = 34, - wdPaperEnvelopeC6 = 35, - wdPaperEnvelopeC65 = 36, - wdPaperEnvelopeDL = 37, - wdPaperEnvelopeItaly = 38, - wdPaperEnvelopeMonarch = 39, - wdPaperEnvelopePersonal = 40, - wdPaperCustom = 41 - } - public partial class LBPages : LBComObjectList /* Collection */ - { - public LBPages(Object item) - { - Item = item; - } - public int Count - { - get { return (GetProperty("Count") as int? ?? 0); } - } - } - public enum LBWdViewType - { - wdNormalView = 1, - wdOutlineView = 2, - wdPrintView = 3, - wdPrintPreview = 4, - wdMasterView = 5, - wdWebView = 6, - wdReadingView = 7 - } - public enum LBWdRevisionsView - { - wdRevisionsViewFinal = 0, - wdRevisionsViewOriginal = 1 - } - public partial class LBZoom : LBComObject - { - public LBZoom() { } - public LBZoom(Object item) : base(item) { } - public LBWdPageFit PageFit - { - get { return (LBWdPageFit)GetProperty("PageFit"); } - set { SetProperty("PageFit", value); } - } - public int Percentage - { - get { return (GetProperty("Percentage") as int? ?? 0); } - set { SetProperty("Percentage", value); } - } - } - public partial class LBColumns : LBComObjectList /* Collection */ - { - public LBColumns(Object item) - { - Item = item; - } - public LBColumn First - { - get { return new LBColumn(GetProperty("First")); } - } - public LBColumn Last - { - get { return new LBColumn(GetProperty("Last")); } - } - public int Count - { - get { return (GetProperty("Count") as int? ?? 0); } - } - public System.Object GetEnumerator() - { - return InvokeMethod("GetEnumerator"); - } - } - public enum LBWdRelativeHorizontalPosition - { - wdRelativeHorizontalPositionMargin = 0, - wdRelativeHorizontalPositionPage = 1, - wdRelativeHorizontalPositionColumn = 2, - wdRelativeHorizontalPositionCharacter = 3, - wdRelativeHorizontalPositionLeftMarginArea = 4, - wdRelativeHorizontalPositionRightMarginArea = 5, - wdRelativeHorizontalPositionInnerMarginArea = 6, - wdRelativeHorizontalPositionOuterMarginArea = 7 - } - public enum LBWdRelativeVerticalPosition - { - wdRelativeVerticalPositionMargin = 0, - wdRelativeVerticalPositionPage = 1, - wdRelativeVerticalPositionParagraph = 2, - wdRelativeVerticalPositionLine = 3, - wdRelativeVerticalPositionTopMarginArea = 4, - wdRelativeVerticalPositionBottomMarginArea = 5, - wdRelativeVerticalPositionInnerMarginArea = 6, - wdRelativeVerticalPositionOuterMarginArea = 7 - } - public enum LBWdPageFit - { - wdPageFitNone = 0, - wdPageFitFullPage = 1, - wdPageFitBestFit = 2, - wdPageFitTextFit = 3 - } - public partial class LBColumn : LBComObject - { - public LBColumn() { } - public LBColumn(Object item) : base(item) { } - public float Width - { - get { return (GetProperty("Width") as float? ?? 0); } - set { SetProperty("Width", value); } - } - public int Index - { - get { return (GetProperty("Index") as int? ?? 0); } - } - public LBColumn Next - { - get { return new LBColumn(GetProperty("Next")); } - } - public LBColumn Previous - { - get { return new LBColumn(GetProperty("Previous")); } - } - public void SetWidth(float ColumnWidth, LBWdRulerStyle RulerStyle) - { - InvokeMethod("SetWidth", ColumnWidth, RulerStyle); - } - } - public enum LBWdRulerStyle - { - wdAdjustNone = 0, - wdAdjustProportional = 1, - wdAdjustFirstColumn = 2, - wdAdjustSameWidth = 3 - } - public partial class LBCell : LBComObject - { - public LBCell() { } - public LBCell(Object item) : base(item) { } - public LBColumn Column - { - get { return new LBColumn(GetProperty("Column")); } - } - public LBCell Next - { - get { return new LBCell(GetProperty("Next")); } - } - public LBCell Previous - { - get { return new LBCell(GetProperty("Previous")); } - } - public LBRow Row - { - get { return new LBRow(GetProperty("Row")); } - } - public LBWdCellVerticalAlignment VerticalAlignment - { - get { return (LBWdCellVerticalAlignment)GetProperty("VerticalAlignment"); } - set { SetProperty("VerticalAlignment", value); } - } - public float Width - { - get { return (GetProperty("Width") as float? ?? 0); } - set { SetProperty("Width", value); } - } - public LBTables Tables - { - get { return new LBTables(GetProperty("Tables")); } - } - public void SetWidth(float ColumnWidth, LBWdRulerStyle RulerStyle) - { - InvokeMethod("SetWidth", ColumnWidth, RulerStyle); - } - } - public enum LBWdSaveFormat - { - wdFormatDocument = 0, - wdFormatTemplate = 1, - wdFormatText = 2, - wdFormatTextLineBreaks = 3, - wdFormatDOSText = 4, - wdFormatDOSTextLineBreaks = 5, - wdFormatRTF = 6, - wdFormatUnicodeText = 7, - wdFormatHTML = 8, - wdFormatWebArchive = 9, - wdFormatFilteredHTML = 10, - wdFormatXML = 11, - wdFormatXMLDocument = 12, - wdFormatXMLDocumentMacroEnabled = 13, - wdFormatXMLTemplate = 14, - wdFormatXMLTemplateMacroEnabled = 15, - wdFormatDocumentDefault = 16, - wdFormatPDF = 17, - wdFormatXPS = 18, - wdFormatFlatXML = 19, - wdFormatFlatXMLMacroEnabled = 20, - wdFormatFlatXMLTemplate = 21, - wdFormatFlatXMLTemplateMacroEnabled = 22, - wdFormatOpenDocumentText = 23 - } - public enum LBWdFindMatch - { - wdMatchGraphic = 1, - wdMatchCommentMark = 5, - wdMatchTabCharacter = 9, - wdMatchCaretCharacter = 11, - wdMatchColumnBreak = 14, - wdMatchField = 19, - wdMatchNonbreakingHyphen = 30, - wdMatchOptionalHyphen = 31, - wdMatchNonbreakingSpace = 160, - wdMatchEnDash = 8211, - wdMatchEmDash = 8212, - wdMatchParagraphMark = 65551, - wdMatchFootnoteMark = 65554, - wdMatchEndnoteMark = 65555, - wdMatchManualPageBreak = 65564, - wdMatchAnyDigit = 65567, - wdMatchSectionBreak = 65580, - wdMatchAnyLetter = 65583, - wdMatchAnyCharacter = 65599, - wdMatchWhiteSpace = 65655 - } - public enum LBWdReplace - { - wdReplaceNone = 0, - wdReplaceOne = 1, - wdReplaceAll = 2 - } - public partial class LBPage : LBComObject - { - public LBPage() { } - public LBPage(Object item) : base(item) { } - public int Height - { - get { return (GetProperty("Height") as int? ?? 0); } - } - public int Left - { - get { return (GetProperty("Left") as int? ?? 0); } - } - public LBRectangles Rectangles - { - get { return new LBRectangles(GetProperty("Rectangles")); } - } - public int Top - { - get { return (GetProperty("Top") as int? ?? 0); } - } - public int Width - { - get { return (GetProperty("Width") as int? ?? 0); } - } - } - public partial class LBRectangles : LBComObjectList /* Collection */ - { - public LBRectangles(Object item) - { - Item = item; - } - public int Count - { - get { return (GetProperty("Count") as int? ?? 0); } - } - } - public partial class LBRectangle : LBComObject - { - public LBRectangle() { } - public LBRectangle(Object item) : base(item) { } - public LBLines Lines - { - get { return new LBLines(GetProperty("Lines")); } - } - } - public partial class LBLines : LBComObjectList /* Collection */ - { - public LBLines(Object item) - { - Item = item; - } - public int Count - { - get { return (GetProperty("Count") as int? ?? 0); } - } - } - public partial class LBLine : LBComObject - { - public LBLine() { } - public LBLine(Object item) : base(item) { } - public int Top - { - get { return (GetProperty("Top") as int? ?? 0); } - } - public int Height - { - get { return (GetProperty("Height") as int? ?? 0); } - } - } - public enum LBWdMovementType - { - wdMove = 0, - wdExtend = 1 - } - public enum LBWdUnits - { - wdCharacter = 1, - wdWord = 2, - wdSentence = 3, - wdParagraph = 4, - wdLine = 5, - wdStory = 6, - wdScreen = 7, - wdSection = 8, - wdColumn = 9, - wdRow = 10, - wdWindow = 11, - wdCell = 12, - wdCharacterFormatting = 13, - wdParagraphFormatting = 14, - wdTable = 15, - wdItem = 16 - } - public enum LBWdGoToDirection - { - wdGoToAbsolute = 1, - wdGoToNext = 2, - wdGoToPrevious = 3, - wdGoToLast = -1 - } - public enum LBWdGoToItem - { - wdGoToSection = 0, - wdGoToPage = 1, - wdGoToTable = 2, - wdGoToLine = 3, - wdGoToFootnote = 4, - wdGoToEndnote = 5, - wdGoToComment = 6, - wdGoToField = 7, - wdGoToGraphic = 8, - wdGoToObject = 9, - wdGoToEquation = 10, - wdGoToHeading = 11, - wdGoToPercent = 12, - wdGoToSpellingError = 13, - wdGoToGrammaticalError = 14, - wdGoToProofreadingError = 15, - wdGoToBookmark = -1 - } - public partial class LBPictureFormat : LBComObject - { - public LBPictureFormat() { } - public LBPictureFormat(Object item) : base(item) { } - } -} diff --git a/PROMS/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs b/PROMS/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs deleted file mode 100644 index 9742e16a..00000000 --- a/PROMS/PROMS/VEPROMS User Interface/dlgApproveProcedure.cs +++ /dev/null @@ -1,1309 +0,0 @@ -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.Base.Library; -using Volian.Print.Library; -using System.IO; -using System.Text.RegularExpressions; -using DevComponents.DotNetBar; - -namespace VEPROMS -{ - public partial class dlgApproveProcedure : Form - { - public event DisplayConsistencyReportEvent ConsistencyPrintRequest; - private void OnConsistencyPrintRequest(ConsistencyReportArgs args) - { - if (ConsistencyPrintRequest != null) - ConsistencyPrintRequest(this, args); - } - private bool CanApprove - { - get { return btnApprove2.Enabled;} - set - { - btnApprove2.Enabled = value; - tsslStatus.ForeColor = Color.Red; - tsslStatus.BackColor = Color.Yellow; - tsslStatus.Text = value ? "" : "Need to correct the Rev Numbers marked with Question Marks"; - } - } - private int _ApplicabilityIndex = 0; - public int ApplicabilityIndex - { - get { return _ApplicabilityIndex; } - set { _ApplicabilityIndex = value; } - } - private SessionInfo _MySessionInfo; - public SessionInfo MySessionInfo - { - get { return _MySessionInfo; } - set - { - _MySessionInfo = value; - _MyApproval.MySessionInfo = _MySessionInfo; - } - } - private ApprovalInfo _MyApproval; - private bool _CheckForMore = false; - private DocVersionInfo _MyDocVersion; - frmVEPROMS _MyFrmVEPROMS = null; - public frmVEPROMS MyFrmVEPROMS - { - get { return _MyFrmVEPROMS; } - set { _MyFrmVEPROMS = value; } - } - public dlgApproveProcedure(DocVersionInfo myDocVersion, frmVEPROMS myFrmVEPROMS) - { - MyFrmVEPROMS = myFrmVEPROMS; - _MyApproval = new ApprovalInfo(myFrmVEPROMS); - ApplicabilityIndex = myDocVersion.DocVersionConfig.SelectedSlave; - this.ConsistencyPrintRequest += new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest); - _MyDocVersion = myDocVersion; - InitializeComponent(); - FlexGridAddEvents(); - _MyApproval.StatusUpdated += new ApprovalStatusChangeEvent(_MyApproval_StatusUpdated); - SetupComboBoxes(); - foreach (ProcedureInfo pi in myDocVersion.Procedures) - { - pi.MyDocVersion.DocVersionConfig.SelectedSlave = ApplicabilityIndex; - _MyApproval.AddProcedure(pi); - } - SetupMyApproval(); - //pnlApprove.LocationChanged += new EventHandler(Panel_LocationChanged); - //pnlSelect.LocationChanged += new EventHandler(Panel_LocationChanged); - pnlApprove.SendToBack(); - this.Width = pnlApprove.Width + this.Width - this.ClientSize.Width; - } - - private void FlexGridAddEvents() - { - //fgProcs.ChangeEdit += new EventHandler(fgProcs_ChangeEdit); - //Console.WriteLine(fgProcs.ComboBoxEditor.GetType().Name); - //Console.WriteLine(fgProcs.Editor.GetType().Name); - //fgProcs.ImeModeChanged += new EventHandler(fgProcs_ImeModeChanged); - //fgProcs.LeaveEdit += new C1.Win.C1FlexGrid.RowColEventHandler(fgProcs_LeaveEdit); - //fgProcs.SetupEditor += new C1.Win.C1FlexGrid.RowColEventHandler(fgProcs_SetupEditor); - //fgProcs.StartEdit += new C1.Win.C1FlexGrid.RowColEventHandler(fgProcs_StartEdit); - //fgProcs.ValidateEdit += new C1.Win.C1FlexGrid.ValidateEditEventHandler(fgProcs_ValidateEdit); - fgProcs.ComboCloseUp += new C1.Win.C1FlexGrid.RowColEventHandler(fgProcs_ComboCloseUp); - //fgProcs.MouseDown += new MouseEventHandler(fgProcs_MouseDown); - //fgProcs.MouseUp += new MouseEventHandler(fgProcs_MouseUp); - } - - void fgProcs_MouseUp(object sender, MouseEventArgs e) - { - C1.Win.C1FlexGrid.HitTestInfo hti = fgProcs.HitTest(e.X, e.Y); - Console.WriteLine("fgProcs_MouseUp X={0},Y={1},Row={2},Col={3}", e.X, e.Y, hti.Row, hti.Column); - } - - void fgProcs_MouseDown(object sender, MouseEventArgs e) - { - C1.Win.C1FlexGrid.HitTestInfo hti = fgProcs.HitTest(e.X, e.Y); - Console.WriteLine("fgProcs_MouseDown X={0},Y={1},Row={2},Col={3}", e.X, e.Y,hti.Row,hti.Column); - - } - - void fgProcs_ComboCloseUp(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) - { - Console.WriteLine("fgProcs_ComboCloseUp e.row={0}, fgprocs.mouserow={1}", e.Row, fgProcs.MouseRow); - if (e.Row == fgProcs.MouseRow) - return; - fgProcs_AfterEdit(sender, e); - //Console.WriteLine("fgProcs_ComboCloseUp row: {0}, col: {1}, val: {2}, etostring: {3}", e.Row, e.Col, fgProcs[e.Row, e.Col], e.ToString()); - } - - void fgProcs_ValidateEdit(object sender, C1.Win.C1FlexGrid.ValidateEditEventArgs e) - { - Console.WriteLine("fgProcs_ValidateEdit"); - } - - void fgProcs_StartEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) - { - - object val = fgProcs[e.Row, e.Col]; - DateTime dt = (DateTime)val; - if (dt != null) - dt = dt.AddHours(1); - fgProcs[e.Row, e.Col] = dt; - Console.WriteLine("fgProcs_StartEdit val: {0}, dt: {1}",val,dt); - } - - void fgProcs_SetupEditor(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) - { - Console.WriteLine("fgProcs_SetupEditor"); - } - - void fgProcs_LeaveEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) - { - object val = fgProcs[e.Row, e.Col]; - DateTime dt = (DateTime)val; - if (dt != null && dt.Hour != 0) - dt = dt.AddHours(-1); - fgProcs[e.Row, e.Col] = dt; - Console.WriteLine("fgProcs_LeaveEdit val: {0}, dt: {1}, mouserow={2}, mousecol={3}", val, dt,fgProcs.MouseRow,fgProcs.MouseCol); - } - - void fgProcs_ImeModeChanged(object sender, EventArgs e) - { - Console.WriteLine("fgProcs_ImeModeChanged"); - } - - void fgProcs_ChangeEdit(object sender, EventArgs e) - { - Console.WriteLine("fgProcs_ChangeEdit"); - } - void Panel_LocationChanged(object sender, EventArgs e) - { - if (pnlApprove.Location.X == 0 && pnlSelect.Location.X == 0) - return; - if (pnlApprove.Location.X == 0) - { - chkViewPDF.Visible = false; - chkSetAllDates.Visible = true; - if (_MyApproval.MyProcedures.Count == 1) - { - this.Text = "Approve " + _MyApproval.MyProcedures[0].ProcInfo.DisplayNumber; - chkViewPDF.Visible = true; - chkSetAllDates.Visible = false; - } - else if (_MyApproval.MyProcedures.Count == _MyDocVersion.Procedures.Count) - this.Text = "Approve All Procedures"; - else - this.Text = "Approve Selected Procedures"; - InitializePanelApprove(); - } - if (pnlSelect.Location.X == 0) - { - this.Text = "Select Procedures To Approve"; - InitializePanelSelect(); - } - } - private void InitializePanelSelect() - { - if (clbMore.Items.Count == 0) - { - foreach (ProcedureInfo pi in _MyDocVersion.Procedures) - { - OwnerInfo oi = OwnerInfo.GetByItemID(pi.ItemID, CheckOutType.Procedure); - pi.MyDocVersion.DocVersionConfig.SelectedSlave = _MyDocVersion.DocVersionConfig.SelectedSlave; - if (oi != null && oi.SessionID != MySessionInfo.SessionID) - { - string prcNumber = pi.DisplayNumber + string.Format(" Checked out to {0}", oi.SessionUserID); - clbMore.Items.Add(prcNumber); - } - else - clbMore.Items.Add(pi.DisplayNumber); - tmpProcedures.Add(pi.DisplayNumber, pi); - } - } - for (int i = 0; i < clbMore.Items.Count; i++) - { - ProcedureInfo pi = GetProcedureInfoByKey(clbMore.Items[i].ToString()); - clbMore.SetItemChecked(i, _MyApproval.ProcedureExists(pi)); - } - } - private void InitializePanelApprove() - { - SetupMyApproval(); - } - private Dictionary tmpProcedures = new Dictionary(); - private ProcedureInfo GetProcedureInfoByKey(string key) - { - if (key.Contains(" Checked out to ")) - key = key.Substring(0, key.IndexOf(" Checked out to ")); - if (tmpProcedures.ContainsKey(key)) - return tmpProcedures[key]; - else - return tmpProcedures[GetDisplayNumberOnly(key)]; - } - public dlgApproveProcedure(DocVersionInfo myDocVersion, bool selectSome, frmVEPROMS myFrmVEPROMS) - { - MyFrmVEPROMS = myFrmVEPROMS; - _MyApproval = new ApprovalInfo(myFrmVEPROMS); - this.ConsistencyPrintRequest += new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest); - _MyDocVersion = myDocVersion; - InitializeComponent(); - FlexGridAddEvents(); - _MyApproval.StatusUpdated += new ApprovalStatusChangeEvent(_MyApproval_StatusUpdated); - _CheckForMore = false; - //pnlApprove.LocationChanged += new EventHandler(Panel_LocationChanged); - //pnlSelect.LocationChanged += new EventHandler(Panel_LocationChanged); - pnlSelect.SendToBack(); - this.Width = pnlSelect.Width + this.Width - this.ClientSize.Width; ; - } - public dlgApproveProcedure(ProcedureInfo myProcedure, frmVEPROMS myFrmVEPROMS) - { - MyFrmVEPROMS = myFrmVEPROMS; - _MyApproval = new ApprovalInfo(myFrmVEPROMS); - this.ConsistencyPrintRequest += new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest); - _MyDocVersion = myProcedure.MyDocVersion; - InitializeComponent(); - FlexGridAddEvents(); - SetupComboBoxes(); - _MyApproval.AddProcedure(myProcedure); - //SetupMyApproval(); - //pnlApprove.LocationChanged += new EventHandler(Panel_LocationChanged); - //pnlSelect.LocationChanged += new EventHandler(Panel_LocationChanged); - pnlApprove.SendToBack(); - this.Width = pnlApprove.Width; - } - void _MyApproval_StatusUpdated(ApprovalInfo sender, ApprovalMessageArgs e) - { - tsslMsg2.Text = e.MyStatus; - Application.DoEvents(); - } - private void SetupMyApproval() - { - approvalInfoBindingSource.DataSource = _MyApproval; - //if(_MyApproval.MyProcedures.Count == 1) - // lblOldRevNumber.Text = _MyApproval.RevNumber; - //else if (_MyApproval.MyProcedures.Count > 1) - // lblMaxRevNumber1.Text = GetMaxRevNumber(); - _MyApproval.RevType = (revTypeBindingSource.Current as RevType).TypeID; - _MyApproval.RevStage = (stageInfoBindingSource.Current as StageInfo).StageID; - approvalInfoBindingSource.ResetBindings(false); - approvalProcedureBindingSource.DataSource = _MyApproval.MyProcedures; - approvalProcedureBindingSource.ResetBindings(false); - //this.ConsistencyPrintRequest -= new DisplayConsistencyReportEvent(dlgApproveProcedure_ConsistencyPrintRequest); - } - private string GetMaxRevNumber() - { - string mrn = string.Empty; - foreach (ApprovalProcedure ap in _MyApproval.MyProcedures) - { - int k = _MyApproval.FancyShmancyRevCompare(mrn, ap.RevNumber); - if (k < 0) - mrn = ap.RevNumber; - } - return mrn; - } - void dlgApproveProcedure_ConsistencyPrintRequest(object sender, ConsistencyReportArgs args) - { - foreach (ProcedureInfo pi in args.MyItems) - pi.IsSelected = _MyApproval.ProcedureExists(pi); - PDFConsistencyCheckReport rpt = new PDFConsistencyCheckReport(args.ReportName, args.MyItems); - rpt.BuildReport(); - } - private void SetupComboBoxes() - { - RevTypes rt = new RevTypes(); - foreach (int i in Enum.GetValues(typeof(Rev_Types))) - { - RevType t = new RevType(i, Enum.GetName(typeof(Rev_Types), i)); - if (t.TypeID == 1) // only show first item for now - rt.Add(t); - } - revTypeBindingSource.DataSource = rt; - stageInfoBindingSource.DataSource = StageInfoList.Get(); - } - private void btnApprove_Click(object sender, EventArgs e) - { - this.Cursor = Cursors.WaitCursor; - if(!_MyApproval.Approve(new Point(Left,Bottom))) - this.DialogResult = DialogResult.None; - this.Cursor = Cursors.Default; - } - private void cmbRevisionType_SelectedIndexChanged(object sender, EventArgs e) - { - RevType rt = cmbRevisionType2.SelectedItem as RevType; - _MyApproval.RevType = rt.TypeID; - } - private void cmbRevisionStage_SelectedIndexChanged(object sender, EventArgs e) - { - StageInfo si = cmbRevisionStage2.SelectedItem as StageInfo; - _MyApproval.RevStage = si.StageID; - } - private void clbMore_ItemCheck(object sender, ItemCheckEventArgs e) - { - ProcedureInfo pi = GetProcedureInfoByKey(clbMore.Items[e.Index].ToString()); - OwnerInfo oi = OwnerInfo.GetByItemID(pi.ItemID, CheckOutType.Procedure); - if (oi != null && oi.SessionID != MySessionInfo.SessionID) - { - string msg = string.Format("Cannot select this procedure for approval.\n\n It is checked out to {0}", oi.SessionUserID); - MessageBox.Show(msg,pi.DisplayNumber); - e.NewValue = CheckState.Unchecked; - return; - } - if (e.NewValue == CheckState.Checked) - btnOkay.Enabled = true; - else - btnOkay.Enabled = (clbMore.CheckedItems.Count > 1); - btnCheckMore.Enabled = btnOkay.Enabled; - btnReportMore.Enabled = false; - } - private void btnOkay_Click(object sender, EventArgs e) - { - UpdateMyApproval(); - //lbProcs.DataSource = null; - //lbProcs.DataSource = _MyApproval.MyProcedures; - //lbProcs.DisplayMember = "DisplayNumber"; - approvalProcedureBindingSource.DataSource = _MyApproval.MyProcedures; - approvalProcedureBindingSource.ResetCurrentItem(); - pnlApprove.SendToBack(); - } - private void UpdateMyApproval() - { - if (clbMore.CheckedItems.Count == 0) - pnlApprove.SendToBack(); - SetupComboBoxes(); - for (int i = 0; i < clbMore.Items.Count; i++) - { - string xyz = clbMore.Items[i].ToString(); - ProcedureInfo pi = GetProcedureInfoByKey(clbMore.Items[i].ToString()); - if (clbMore.GetItemChecked(i)) - { - if (!_MyApproval.ProcedureExists(pi)) - _MyApproval.AddProcedure(pi); - } - else - { - if (_MyApproval.ProcedureExists(pi)) - _MyApproval.DeleteProcedure(pi); - } - } - SetupMyApproval(); - } - private void btnCheck_Click(object sender, EventArgs e) - { - //if (chkCascade1.Checked || chkCascade2.Checked) - //{ - // MessageBox.Show("cascade"); - //} - //else - //{ - pnlSelect.SendToBack(); - UpdateClbMore(); - //} - } - private ItemInfoList _MyItemInfoList; - private void UpdateClbMore() - { - int checkedCount = clbMore.CheckedItems.Count; - int z = int.Parse("0" + lblPhase.Text); - z++; - lblPhase.Text = z.ToString(); - string oldLabel = lblMore.Text; - pbMore.Visible = true; - pbMore.Maximum = _MyApproval.MyProcedures.Count; - ItemInfoList.ConsistencyCheckUpdated += new ItemInfoListCCEvent(ItemInfoList_ConsistencyCheckUpdated); - List myProcs = new List(); - foreach (ApprovalProcedure ap in _MyApproval.MyProcedures) - myProcs.Add(ap.ProcInfo); - _MyItemInfoList = ItemInfoList.GetMoreProcedures(myProcs); - ItemInfoList.ConsistencyCheckUpdated -= new ItemInfoListCCEvent(ItemInfoList_ConsistencyCheckUpdated); - lblMore.Text = oldLabel; - pbMore.Visible = false; - //clbMore.Items.Clear(); - //tmpProcedures.Clear(); - for (int i = 0; i < clbMore.Items.Count; i++) - { - string info = clbMore.Items[i].ToString(); - if(info.Contains(" - (")) - clbMore.Items[i] = info.Substring(0, info.IndexOf(" - (")); - } - foreach (ProcedureInfo npi in _MyItemInfoList) - { - string info = string.Format(npi.MyDifferenceReasons.StartsWith("No ") ? "{0}" : "{0} - ({1})", npi.DisplayNumber, npi.MyDifferenceReasons); - //checked list box - //int k = clbMore.Items.Add(info); - for (int i = 0; i < clbMore.Items.Count; i++) - { - if (clbMore.Items[i].ToString().StartsWith(npi.DisplayNumber)) - { - clbMore.Items[i] = info; - tmpProcedures[npi.DisplayNumber] = npi; - if (chkCascade2.Checked || chkCascadeMore.Checked) - clbMore.SetItemChecked(i, true); - break; - } - } - } - Application.DoEvents(); - clbMore.Enabled = btnAll.Enabled = btnClear.Enabled = true; - //if (clbMore.Items.Count == 0) - //{ - // clbMore.Items.Add("None Found"); - // clbMore.Enabled = btnAll.Enabled = btnClear.Enabled = false; - //} - lblMore.Text = string.Format("{0} Procedures, {1} Selected", clbMore.Items.Count, clbMore.CheckedItems.Count); - btnReportMore.Enabled = true; - _CheckForMore = true; - - if (chkCascade2.Checked || chkCascadeMore.Checked) - { - if (clbMore.CheckedItems.Count > checkedCount) - { - //btnAll_Click(btnAll, new EventArgs()); - UpdateMyApproval(); - UpdateClbMore(); - } - else - lblPhase.Text = ""; - } - } - void ItemInfoList_ConsistencyCheckUpdated(object sender, ItemInfoListCCEventArgs args) - { - if (sender != null) - { - pbMore.Value = args.MyCount; - lblMore.Text = args.MyProcedure.DisplayNumber; - } - else - { - pbMore.Value = pbMore.Maximum; - lblMore.Text = "Querying Database"; - } - Application.DoEvents(); - } - //private void dtiRevisionDate_ValueChanged(object sender, EventArgs e) - //{ - // DevComponents.Editors.DateTimeAdv.DateTimeInput dti = sender as DevComponents.Editors.DateTimeAdv.DateTimeInput; - //} - private void btnAll_Click(object sender, EventArgs e) - { - for (int i = 0; i < clbMore.Items.Count; i++) - clbMore.SetItemChecked(i, true); - } - private void btnClear_Click(object sender, EventArgs e) - { - for (int i = 0; i < clbMore.Items.Count; i++) - clbMore.SetItemChecked(i, false); - } - private void btnCancelMore_Click(object sender, EventArgs e) - { - if (!_CheckForMore) - { - this.Close(); - return; - } - //if (_MyApproval.MyProcedures.Count == 1) - // pnlOne.SendToBack(); - //else - pnlApprove.SendToBack(); - } - //private void tsmiRemove_Click(object sender, EventArgs e) - //{ - // ApprovalProcedure ap = approvalProcedureBindingSource.Current as ApprovalProcedure; - // _MyApproval.RemoveProcedure(ap.ProcInfo); - // approvalProcedureBindingSource.DataSource = _MyApproval.MyProcedures; - // approvalProcedureBindingSource.ResetCurrentItem(); - // //_MyApproval.RemoveProcedure(lbProcs.SelectedItem as ProcedureInfo); - // //lbProcs.DataSource = null; - // //lbProcs.DataSource = _MyApproval.MyProcedures; - // //lbProcs.DisplayMember = "DisplayNumber"; - //} - private int _LastIndex = -1; - private void clbMore_MouseMove(object sender, MouseEventArgs e) - { - if (_MyApproval.MyProcedures.Count > 0) - { - int itemIndex = clbMore.IndexFromPoint(new Point(e.X, e.Y)); - if (itemIndex == -1) - sttMore.HideTooltip(); - if (itemIndex == _LastIndex) - return; - _LastIndex = itemIndex; - if (itemIndex >= 0) - { - if (clbMore.Items[itemIndex] != null) - { - SuperTooltipInfo stti = sttMore.GetSuperTooltip(clbMore); - //string headerText = tmpProcedures[xyz].DisplayNumber; - //string bodyText = tmpProcedures[xyz].MyDifferencesText; - stti.HeaderText = GetProcedureInfoByKey(clbMore.Items[itemIndex].ToString()).DisplayNumber; - stti.BodyText = GetProcedureInfoByKey(clbMore.Items[itemIndex].ToString()).MyDifferencesText; - stti.FooterVisible = false; - using (Graphics g = CreateGraphics()) - { - SizeF sf = g.MeasureString(stti.BodyText, this.Font); - stti.CustomSize = new Size(10 + sf.ToSize().Width, 0); - } - sttMore.ShowTooltip(sender); - return; - } - } - } - //sttMore.HideTooltip(); - } - private string GetDisplayNumberOnly(string s) - { - int d = s.IndexOf(" - "); - if (d > -1) - s = s.Substring(0, d).Trim(); - return s; - } - private void btnCheckMore_Click(object sender, EventArgs e) - { - UpdateMyApproval(); - UpdateClbMore(); - } - private void btnReportMore_Click(object sender, EventArgs e) - { - OnConsistencyPrintRequest(new ConsistencyReportArgs(Volian.Base.Library.VlnSettings.TemporaryFolder + @"\MyConsistency.pdf", _MyItemInfoList)); - } - private void CascadeChecksUpdated(object sender, EventArgs e) - { - DevComponents.DotNetBar.Controls.CheckBoxX cb = sender as DevComponents.DotNetBar.Controls.CheckBoxX; - if (cb != null) - { - chkCascade2.Checked = chkCascadeMore.Checked = cb.Checked; - } - } - private void fgProcs_AfterEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) - { - ApprovalProcedure ap = approvalProcedureBindingSource.Current as ApprovalProcedure; - if (e.Col == 1) - { //revnumber - _MyApproval.Refresh(); - approvalInfoBindingSource.ResetBindings(false); - bool ok = true; - foreach (ApprovalProcedure app in _MyApproval.MyProcedures) - { - ok = ok && !app.RevNumber.Contains(" ?"); - } - CanApprove = ok; - } - if (e.Col == 2) - { //revdate - DateTime dts = DateTime.Parse(fgProcs[e.Row, e.Col].ToString()); - //store mouse row because the popup calendar can goof up the datagrid mouse row - int fgmr = fgProcs.MouseRow; - if (e.Row == fgmr && ap.RevDate == dts) - return; - if (chkSetAllDates.Checked) - { - foreach (ApprovalProcedure app in _MyApproval.MyProcedures) - { - app.RevDate = ap.RevDate; - } - approvalProcedureBindingSource.ResetBindings(false); - } - } - } - //private void tsmiAddMore_Click(object sender, EventArgs e) - //{ - // pnlSelect.SendToBack(); - //} - private void btnModifyList_Click(object sender, EventArgs e) - { - pnlSelect.SendToBack(); - } - - private void btnIncrement_Click(object sender, EventArgs e) - { - StringBuilder sb = new StringBuilder(); - string sep = "Procedures that failed to increment\r\n\r\n"; - foreach (ApprovalProcedure ap in _MyApproval.MyProcedures) - if (!IncrementRev(ap)) - { - sb.Append(sep + ap.DisplayNumber); - sep = "\r\n"; - } - approvalProcedureBindingSource.ResetBindings(false); - if (sb.Length > 0) - { - sb.AppendLine(); sb.AppendLine(); - sb.AppendLine("These will be marked with a question mark."); - sb.Append("They need to be corrected before Approval can be run."); - MessageBox.Show(sb.ToString(), "Increment Failures", MessageBoxButtons.OK, MessageBoxIcon.Warning); - CanApprove = false; - } - else - CanApprove = true; - } - private bool IncrementRev(ApprovalProcedure ap) - { - bool rv = true; - if (Regex.IsMatch(ap.RevNumber, "^[0-9]+$")) - ap.RevNumber = (int.Parse(ap.RevNumber) + 1).ToString(); - else if (Regex.IsMatch(ap.RevNumber, "^[0-9]*[a-yA-Y]+$")) - { - char lastCar = ap.RevNumber[ap.RevNumber.Length - 1]; - lastCar++; - ap.RevNumber = ap.RevNumber.Substring(0, ap.RevNumber.Length - 1) + lastCar.ToString(); - } - else if (ap.RevNumber == string.Empty) - ap.RevNumber = "1"; - else if (Regex.IsMatch(ap.RevNumber, "^[0-9.]+[.][0-9]+$")) - { - string[] parts = ap.RevNumber.Split(".".ToCharArray()); - string sep = ""; - string lastPart = parts[parts.Length - 1]; - int w = lastPart.Length; - lastPart = (int.Parse(lastPart) + 1).ToString(); - //if(w > lastPart.Length) - lastPart = lastPart.PadLeft(w, '0'); - parts[parts.Length - 1] = lastPart; - StringBuilder sb = new StringBuilder(); - foreach (string part in parts) - { - sb.Append(sep + part); - sep = "."; - } - ap.RevNumber = sb.ToString(); - } - else if (Regex.IsMatch(ap.RevNumber, "[?]$")) - rv = false; //do nothing - else - { - ap.RevNumber += " ?"; - rv = false; - } - return rv; - } - } - public class ApprovalProcedure - { - private ProcedureInfo _ProcInfo; - public ProcedureInfo ProcInfo - { - get { return _ProcInfo; } - set { _ProcInfo = value; } - } - private string _RevNumber; - public string RevNumber - { - get { return _RevNumber; } - set - { - if (value.Trim() != _RevNumber) - { - _RevNumber = value.Trim(); - //_RevDate = DateTime.Now; // commented out for bug fix B2013-012 - } - } - } - private DateTime _RevDate; - public DateTime RevDate - { - get { return _RevDate; } - set { _RevDate = value; } - } - // added RevNumAndDate to handle the use use of the DoRevDate flag - // this fixes bug B2013-011 where Today's date would print on the approved procedures (Westinghouse data) - // instead of the the Revision Date assigned to the procedure. - public string RevNumAndDate - { - get - { - if (_ProcInfo.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate) - return RevNumber + "/" + RevDate.ToString("M/d/yyyy"); - else - return RevNumber; - } - } - public string DisplayNumber - { - get { return _ProcInfo.DisplayNumber; } - } - public override string ToString() - { - return string.Format("{0}\t{1}\t{2:M/d/yyyy}", _ProcInfo.DisplayNumber, _RevNumber, _RevDate); - } - public ApprovalProcedure(ProcedureInfo proc) - { - proc.ProcedureConfig.SelectedSlave = proc.MyDocVersion.DocVersionConfig.SelectedSlave; - ProcInfo = proc; - RevNumber = proc.ProcedureConfig.Print_Rev == string.Empty ? "0" : proc.ProcedureConfig.Print_Rev; - //AppRevDate Change - //DateTime revdate; - string sRevDate = proc.ProcedureConfig.Print_RevDate; - if (sRevDate == string.Empty) - sRevDate = DateTime.Now.ToString("M/d/y"); - DateTime revDate; - if (!DateTime.TryParse(sRevDate, out revDate)) revDate = DateTime.Now; - RevDate = revDate; - //RevDate = DateTime.Parse(sRevDate); - //RevDate = DateTime.Parse(proc.ProcedureConfig.Print_RevDate); - //if (print_revdate == string.Empty && DateTime.TryParse(RevNumber, out revdate)) - // ; - //else - // revdate = DateTime.TryParse(proc.ProcedureConfig.Print_RevDate.Replace("-", "/").Replace("00/", "01/"), out revdate) ? revdate : DateTime.Now; - //RevDate = revdate; - } - } - public class ApprovalMessageArgs : EventArgs - { - public ApprovalMessageArgs(string msg) - { - _MyStatus = msg; - } - private string _MyStatus; - public string MyStatus - { - get { return _MyStatus; } - set { _MyStatus = value; } - } - } - public delegate void ApprovalStatusChangeEvent(ApprovalInfo sender, ApprovalMessageArgs e); - public class ApprovalInfo - { - frmVEPROMS _MyFrmVEPROMS = null; - public frmVEPROMS MyFrmVEPROMS - { - get { return _MyFrmVEPROMS; } - set { _MyFrmVEPROMS = value; } - } - public event ApprovalStatusChangeEvent StatusUpdated; - public void OnStatusUpdated(ApprovalInfo sender, ApprovalMessageArgs e) - { - if (StatusUpdated != null) - StatusUpdated(sender, e); - } - private SessionInfo _MySessionInfo; - public SessionInfo MySessionInfo - { - get { return _MySessionInfo; } - set { _MySessionInfo = value; } - } - private int _RevType; - public int RevType - { - get { return _RevType; } - set { _RevType = value; } - } - private string _RevNumber; - public string RevNumber - { - get { return _RevNumber; } - set { _RevNumber = value; } - } - private Nullable _RevDate; - public Nullable RevDate - { - get { return _RevDate == null ? _RevDate : _RevDate.Value; } - set { _RevDate = value; } - } - private int _RevStage; - public int RevStage - { - get { return _RevStage; } - set { _RevStage = value; } - } - private string _RevNote; - public string RevNote - { - get { return _RevNote; } - set { _RevNote = value; } - } - private bool _ViewPDF; - public bool ViewPDF - { - get { return _ViewPDF; } - set { _ViewPDF = value; } - } - private string _MsgNumber; - public string MsgNumber - { - get { return _MsgNumber; } - set { _MsgNumber = value; } - } - private string _MsgDate; - public string MsgDate - { - get { return _MsgDate; } - set { _MsgDate = value; } - } - private bool _CanIncrement; - public bool CanIncrement - { - get { return _CanIncrement; } - set { _CanIncrement = value; } - } - private List _MyProcedures; - public List MyProcedures - { - get { return _MyProcedures; } - //set { _MyProcedures = value; } - } - public ApprovalInfo(frmVEPROMS myFrmVEPROMS) - { - MyFrmVEPROMS = myFrmVEPROMS; - _MyProcedures = new List(); - } - private static string FormatRev(Match m) - { - return "".PadLeft(5 - m.Groups[1].Value.Length, '0') + m.Groups[1].Value; - } - public void AddProcedure(ProcedureInfo proc) - { - ApprovalProcedure ap = new ApprovalProcedure(proc); - MyProcedures.Add(ap); - Refresh(); - } - public void RemoveProcedure(ProcedureInfo pi) - { - ApprovalProcedure apr = null; - foreach (ApprovalProcedure ap in MyProcedures) - { - if (ap.ProcInfo == pi) - { - apr = ap; - break; - } - } - MyProcedures.Remove(apr); - Refresh(); - } - public bool ProcedureExists(ProcedureInfo pi) - { - foreach (ApprovalProcedure pp in MyProcedures) - { - if(pp.ProcInfo.ItemID == pi.ItemID) - return true; - } - return false; - } - public void Refresh() - { - bool ok = true; - int rv = 0; - foreach (ApprovalProcedure ap in MyProcedures) - { - ok = ok && int.TryParse(ap.RevNumber, out rv); - } - _CanIncrement = ok; - //if (MyProcedures.Count == 1) - //{ - // ProcedureInfo pi = _MyProcedures[0].ProcInfo; - // RevNumber = pi.ProcedureConfig.Print_Rev == string.Empty ? "0" : pi.ProcedureConfig.Print_Rev; - // DateTime revdate = pi.ProcedureConfig.Print_RevDate == string.Empty ? DateTime.Now : DateTime.TryParse(pi.ProcedureConfig.Print_RevDate, out revdate) ? revdate : DateTime.Now; - // RevDate = revdate; - // RevNote = string.Empty; - // ViewPDF = false; - //} - //else if (MyProcedures.Count > 1) - //{ - // Regex myRegEx = new Regex("^([0-9]{1,5})"); - // SortedList printRevs = new SortedList(); - // SortedList printRevDates = new SortedList(); - // string printRev = string.Empty; - // foreach (ApprovalProcedure pi in MyProcedures) - // { - // printRev = myRegEx.Replace(pi.RevNumber, new MatchEvaluator(FormatRev)); - // printRev = printRev == string.Empty ? "0" : printRev; - // if (printRev != string.Empty) - // if (!printRevs.ContainsKey(printRev)) - // printRevs.Add(printRev, pi.ProcInfo); - // if (pi.RevDate != null) - // if (!printRevDates.ContainsKey(pi.RevDate.ToString())) - // printRevDates.Add(pi.RevDate.ToString(), pi.ProcInfo); - // } - // if (printRevs.Count > 1) - // { - // ProcedureInfo pi = printRevs[printRevs.Keys[printRevs.Count - 1]]; - // RevNumber = "*"; - // MsgNumber = "Multiple Revision Numbers found. Enter asterisk (*) to use current revision numbers or plus sign (+) to increment revision numbers"; - // } - // else if (printRevs.Count == 1) - // { - // ProcedureInfo pi = printRevs[printRevs.Keys[printRevs.Count - 1]]; - // RevNumber = pi.ProcedureConfig.Print_Rev; - // MsgNumber = string.Empty; - // } - // if (printRevDates.Count > 1) - // { - // RevDate = null; - // MsgDate = "Multiple Revision Dates found. Use current revision dates or manually assign revision date by selecting a date"; - // } - // else if (printRevDates.Count == 1) - // { - // ProcedureInfo pi = printRevDates[printRevDates.Keys[printRevDates.Count - 1]]; - // RevDate = DateTime.Parse(pi.ProcedureConfig.Print_RevDate); - // MsgDate = string.Empty; - // } - // else if (printRevDates.Count == 0) - // RevDate = DateTime.Now; - //} - } - public void DeleteProcedure(ProcedureInfo pi) - { - ApprovalProcedure tpi = null; - foreach (ApprovalProcedure pii in MyProcedures) - { - if (pii.ProcInfo.ItemID == pi.ItemID) - tpi = pii; - } - if (tpi != null) - { - MyProcedures.Remove(tpi); - Refresh(); - } - } - public bool CanApprove - { - get { return _RevType > 0 && _RevNumber != string.Empty && _RevStage > 0; } - } - public int FancyShmancyRevCompare(string s1, string s2) - { - if (s1 == s2) - return 0; - while (s1 != string.Empty && s2 != string.Empty) - { - //look for numbers - Match m1 = Regex.Match(s1, "^[0-9]+"); - Match m2 = Regex.Match(s2, "^[0-9]+"); - if (m1.Length > 0 && m2.Length > 0) - { - int i1 = int.Parse(m1.Value); - int i2 = int.Parse(m2.Value); - if (i1 < i2) - return -1; - if (i1 > i2) - return 1; - s1 = s1.Substring(m1.Length); - s2 = s2.Substring(m2.Length); - } - else - { - if (m1.Length > 0) - return 1; - if (m2.Length > 0) - return -1; - } - //look for letters - m1 = Regex.Match(s1, "^[A-Za-z]+"); - m2 = Regex.Match(s2, "^[A-Za-z]+"); - if (m1.Length > 0 && m2.Length > 0) - { - if (m1.Length > m2.Length) - return 1; - if (m1.Length < m2.Length) - return -1; - int c = m1.Value.CompareTo(m2.Value); - if (c != 0) - return c; - s1 = s1.Substring(m1.Length); - s2 = s2.Substring(m2.Length); - } - else - { - if (m1.Length > 0) - return 1; - if (m2.Length > 0) - return -1; - } - //look for symbols - m1 = Regex.Match(s1, "^[^0-9A-Za-z]+"); - m2 = Regex.Match(s2, "^[^0-9A-Za-z]+"); - if (m1.Length > 0 && m2.Length > 0) - { - int c = m1.Value.CompareTo(m2.Value); - if (c != 0) - return c; - s1 = s1.Substring(m1.Length); - s2 = s2.Substring(m2.Length); - } - else - { - if (m1.Length > 0) - return 1; - if (m2.Length > 0) - return -1; - } - } - return s1.CompareTo(s2); - } - public bool Approve(Point location) - { - ViewPDF = ViewPDF && MyProcedures.Count == 1; - StringBuilder sb = new StringBuilder(); - StageInfo nsi = StageInfo.GetJustStage(RevStage); - foreach (ApprovalProcedure ap in MyProcedures) //spin thru looking for updating current revision - { - //RevisionInfo ric = RevisionInfo.GetCurrentByItemID(ap.ProcInfo.ItemID); - RevisionInfo ric = ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave > 0 ? RevisionInfo.GetCurrentByItemIDandUnitID(ap.ProcInfo.ItemID,ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave) : RevisionInfo.GetCurrentByItemID(ap.ProcInfo.ItemID); - if (ric != null) - { - VersionInfo vi = ric.LatestVersion; - if (ap.RevNumber == ric.RevisionNumber && nsi.IsApproved == 0 && vi.MyStage.IsApproved == 1) - sb.AppendLine(string.Format("{0} - '{1}'", ap.ProcInfo.DisplayNumber, vi.MyStage.Name)); - } - } - if (sb.Length > 0) - { - sb.Insert(0, string.Format("The following procedures will be reverted to '{0}'\r\n\r\n", nsi.Name)); - sb.AppendLine("\r\nThis will restore change bars and summary of change results!"); - sb.AppendLine("\r\nIf you do not want this to occur, answer No to this dialog \r\nand then change the revision number to create a new revision."); - sb.Append(string.Format("\r\nAre you sure you want to revert to '{0}'?",nsi.Name)); - if (MessageBox.Show(sb.ToString(),string.Format("Revert to {0}",nsi.Name),MessageBoxButtons.YesNo,MessageBoxIcon.Stop) == DialogResult.No) - return false; - } - foreach (ApprovalProcedure ap in MyProcedures) - { - ProcedureInfo pi = ap.ProcInfo; - OnStatusUpdated(this, new ApprovalMessageArgs(string.Format("Processing {0}", pi.DisplayNumber))); - string summaryPDF = string.Format(@"{0}\{1} Summary of Changes.pdf", VlnSettings.TemporaryFolder, pi.PDFNumber); - string pdfTmp = string.Format(@"{0}.pdf", pi.PDFNumber); - string pdfPath = string.Format(@"{0}\{1}", VlnSettings.TemporaryFolder, pdfTmp); - if (!TryToDelete(summaryPDF)) break; - if (!TryToDelete(pdfPath)) break; - RevisionInfo ric = pi.MyDocVersion.DocVersionConfig.SelectedSlave > 0 ? RevisionInfo.GetCurrentByItemIDandUnitID(pi.ItemID, pi.MyDocVersion.DocVersionConfig.SelectedSlave) : RevisionInfo.GetCurrentByItemID(pi.ItemID); -// RevisionInfo rip = RevisionInfo.GetPreviousByItemID(pi.ItemID); - DateTime myDTS = pi.DTS; - string cbDTS = (pi.MyConfig as ProcedureConfig).Print_ChangeBarDate; - if ((cbDTS ?? "") != "") - myDTS = DateTime.Parse(cbDTS); - if (ric != null && ap.RevNumber == ric.RevisionNumber && ric.LatestVersion.MyStage.IsApproved == 1) - { - myDTS = ric.MyConfig.History_StartDate; - //UpdateProcedureDTS(pi, myDTS); - } - if (ric != null && ap.RevNumber != ric.RevisionNumber && ric.LatestVersion.MyStage.IsApproved == 1) - { - myDTS = ric.DTS; -// myDTS = DateTime.Parse(pi.ProcedureConfig.Print_RevDate); - } - ContentAuditInfoList cail; - AnnotationAuditInfoList aail; - if (pi.MyDocVersion.DocVersionConfig.SelectedSlave > 0) - { - pi = ProcedureInfo.GetItemAndChildrenByUnit(pi.ItemID, 0, pi.MyDocVersion.DocVersionConfig.SelectedSlave); - pi.ChangeBarDate = myDTS; - cail = ContentAuditInfoList.GetSummaryByUnit(pi.ItemID, pi.ItemID, false, pi.MyDocVersion.DocVersionConfig.SelectedSlave, pi.ChangeBarDate); - aail = AnnotationAuditInfoList.GetChronologyByUnit(pi.ItemID, pi.ItemID, pi.MyDocVersion.DocVersionConfig.SelectedSlave, pi.ChangeBarDate); - } - else - { - if (pi.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier) - pi = ProcedureInfo.GetItemAndChildrenByUnit(pi.ItemID, 0, pi.MyDocVersion.DocVersionConfig.SelectedSlave); - else - pi = ProcedureInfo.GetItemAndChildren(pi.ItemID); - pi.ChangeBarDate = myDTS; - cail = ContentAuditInfoList.GetSummary(pi.ItemID, pi.ItemID, false, pi.ChangeBarDate); - aail = AnnotationAuditInfoList.GetChronology(pi.ItemID, pi.ItemID, pi.ChangeBarDate); - } - Volian.Print.Library.PDFChronologyReport myChronoRpt = new Volian.Print.Library.PDFChronologyReport(summaryPDF, pi, cail, aail); - myChronoRpt.BuildSummary(ViewPDF); - FileInfo pdfFile = new FileInfo(summaryPDF); - FileStream fs = pdfFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - byte[] summaryBuf = new byte[pdfFile.Length]; - fs.Read(summaryBuf, 0, summaryBuf.Length); - fs.Close(); - Revision revision = null; - if (ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave > 0) - { - revision = Revision.GetByItemIDAndRevisionNumberAndUnitID(pi.ItemID, ap.RevNumber, ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave); - if (revision == null) - { - RevisionConfig cfg = new RevisionConfig(); - cfg.History_StartDate = myDTS; // pi.DTS; - cfg.Applicability_Index = ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave; - //cfg.Save(); - revision = Revision.MakeRevision(pi.ItemID, RevType, ap.RevNumber, ap.RevDate, RevNote, cfg.ToString(), DateTime.Now, Volian.Base.Library.VlnSettings.UserID); - // revision.MyConfig.History_StartDate = pi.DTS; - // revision.MyConfig.Save(); - // revision = revision.Save(); - } - else if (revision.Notes != RevNote || revision.RevisionDate != ap.RevDate) - { - //C2016-036 - Inform the user that an existing approved version will be replaced - if (MessageBox.Show("Replace Existing Revision " + ap.RevNumber + "\r\n\r\nChange the Rev Number to create a new revision.", "Replace Existing", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel) - return false; - revision.Notes = RevNote; - revision.RevisionDate = ap.RevDate; - revision = revision.Save(); - } - } - else - { - revision = Revision.GetByItemIDAndRevisionNumber(pi.ItemID, ap.RevNumber); - if (revision == null) - { - RevisionConfig cfg = new RevisionConfig(); - cfg.History_StartDate = pi.DTS; - //cfg.Save(); - revision = Revision.MakeRevision(pi.ItemID, RevType, ap.RevNumber, ap.RevDate, RevNote, cfg.ToString(), DateTime.Now, Volian.Base.Library.VlnSettings.UserID); - // revision.MyConfig.History_StartDate = pi.DTS; - // revision.MyConfig.Save(); - // revision = revision.Save(); - } - else if (revision.Notes != RevNote || revision.RevisionDate != ap.RevDate) - { - //C2016-036 - Inform the user that an existing approved version will be replaced - if (MessageBox.Show("Replace Existing Revision " + ap.RevNumber + "\r\n\r\nChange the Rev Number to create a new revision.", "Replace Existing", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel) - return false; - revision.Notes = RevNote; - revision.RevisionDate = ap.RevDate; - revision = revision.Save(); - } - } - DateTime currentDTS = DateTime.Now; - Check check = Check.MakeCheck(revision, Stage.GetJustStage(RevStage), RevisionInfo.BuildRevisionChecks(pi), currentDTS, VlnSettings.UserID); - //make pdf with promsprinter and get byte stream - // Moved to end so that Item and Content are saved at the same time - //UpdateProcedureConfig(pi, ap.RevNumber, ap.RevDate, myDTS); - string waterMark = Stage.GetJustStage(RevStage).IsApproved > 0 ? null : Stage.GetJustStage(RevStage).Name; - //ProcedureInfo myproc = pi; - //frmPDFStatusForm frm = new frmPDFStatusForm(myproc, ap.RevNumber, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location); - //myproc.ChangeBarDate = myDTS; - frmPDFStatusForm frm = new frmPDFStatusForm(pi, ap.RevNumAndDate, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location, pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts, true,"",false,false); - frm.AllowAllWatermarks = true; - frm.CloseWhenDone = !ViewPDF; - frm.DocReplace = new Dictionary(); // will hold the Word Attachments with resolved ROs - frm.ShowDialog(); - //if (ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave > 0) - //{ - // using (ProcedureInfo myproc = ProcedureInfo.GetItemAndChildrenByUnit(pi.ItemID, 0, ap.ProcInfo.MyDocVersion.DocVersionConfig.SelectedSlave)) - // { - // //frmPDFStatusForm frm = new frmPDFStatusForm(myproc, ap.RevNumber, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location); - // myproc.ChangeBarDate = myDTS; - // frmPDFStatusForm frm = new frmPDFStatusForm(myproc, ap.RevNumAndDate, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location); - // frm.AllowAllWatermarks = true; - // frm.CloseWhenDone = !ViewPDF; - // frm.ShowDialog(); - // } - //} - //else - //{ - // using (ProcedureInfo myproc = ProcedureInfo.GetItemAndChildren(pi.ItemID)) - // { - // //frmPDFStatusForm frm = new frmPDFStatusForm(myproc, ap.RevNumber, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location); - // myproc.ChangeBarDate = myDTS; - // frmPDFStatusForm frm = new frmPDFStatusForm(myproc, ap.RevNumAndDate, /* revdate change: ap.RevDate.ToString("MM/dd/yyyy") ,*/ waterMark, false, false, ViewPDF, true, VlnSettings.TemporaryFolder, new ChangeBarDefinition(pi.MyDocVersion.MyConfig as DocVersionConfig, pi.ActiveFormat), pdfTmp, location); - // frm.AllowAllWatermarks = true; - // frm.CloseWhenDone = !ViewPDF; - // frm.ShowDialog(); - // } - //} - pdfFile = new FileInfo(pdfPath); - fs = pdfFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - byte[] buf = new byte[pdfFile.Length]; - fs.Read(buf, 0, buf.Length); - fs.Close(); - VEPROMS.CSLA.Library.Version version = VEPROMS.CSLA.Library.Version.MakeVersion(revision, Stage.GetJustStage(RevStage), buf, summaryBuf, currentDTS, VlnSettings.UserID); - StageInfo si = StageInfo.GetJustStage(RevStage); - int selectedSlave = pi.MyDocVersion.DocVersionConfig.SelectedSlave; - pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0; - if (si.IsApproved == 1) - { - dlgExportImport dlg = new dlgExportImport("Export", pi, MyFrmVEPROMS); // "true tell export to convert ROs and Transitions to text - dlg.DocReplace = frm.DocReplace; // this tells approval to prepare an export file with resolved transitions and ROs, word sections are saved with resolved ROs during approval PDF creation and saved in DocReplace - System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); - dlg.ExportItem(xd, pi, "procedure"); - frm.DocReplace = dlg.DocReplace = null; - version.ApprovedXML = xd.OuterXml; - version.Save(); - dlg.Dispose(); - UpdateProcedureConfig(pi, ap.RevNumber, ap.RevDate, DateTime.Now, selectedSlave); - - // Clear the change bar override for this procedure: - pi.ClearChangeBarOverrides(); - } - else - UpdateProcedureConfig(pi, ap.RevNumber, ap.RevDate, myDTS, selectedSlave); - //UpdateProcedureDTS(pi, DateTime.Now); - pi.MyDocVersion.DocVersionConfig.SelectedSlave = selectedSlave; - } - return true; - } - private bool TryToDelete(string pdfFile) - { - int cntr = 0; - while (File.Exists(pdfFile)) - { - try - { - File.Delete(pdfFile); - return true; - } - catch - { - cntr++; - StringBuilder sb = new StringBuilder(); - sb.AppendLine("Could not create"); - sb.AppendLine(); - sb.AppendLine(pdfFile + "."); - sb.AppendLine(); - sb.AppendLine("If it is open, close and retry."); - if (cntr >= 3) - { - sb.Insert(0, "PAY ATTENTION!!!\r\n\r\n"); - sb.AppendLine("\r\n\r\nFIRST CLOSE IT, THEN PRESS THE OK BUTTON!!!"); - } - if(MessageBox.Show(sb.ToString(), "Error on CreatePdf", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK) - return false; - Application.DoEvents(); - } - } - return true; - } - - private void UpdateProcedureDTS(ProcedureInfo pi, DateTime dts) - { - using (Item itm = Item.Get(pi.ItemID)) - { - itm.DTS = dts; - itm.Save(); - } - } - private void UpdateProcedureConfig(ProcedureInfo procedureInfo, string revNumber, DateTime revDate, DateTime dts, int selectedSlave) - { - ProcedureConfig pc = procedureInfo.MyConfig as ProcedureConfig; - if (pc == null) return; - pc.SelectedSlave = selectedSlave; - pc.Print_Rev = revNumber; - //AppRevDate Change - pc.Print_RevDate = revDate.ToString("MM/dd/yyyy"); - pc.Print_ChangeBarDate = dts.ToString("MM/dd/yyyy HH:mm:ss"); - using (Item itm = Item.Get(procedureInfo.ItemID)) - { - itm.MyContent.Config = pc.ToString(); - //itm.DTS = dts; - itm.UserID = Volian.Base.Library.VlnSettings.UserID; - itm.Save(); - } - - } - } - public class RevType - { - private int _TypeID; - public int TypeID - { - get { return _TypeID; } - set { _TypeID = value; } - } - private string _TypeName; - public string TypeName - { - get { return _TypeName; } - set { _TypeName = value; } - } - public RevType(int i, string s) - { - _TypeID = i; - _TypeName = s; - } - } - public class RevTypes : List - { - } - public delegate void DisplayConsistencyReportEvent(object sender, ConsistencyReportArgs args); - public class ConsistencyReportArgs : EventArgs - { - private string _ReportName; - public string ReportName - { - get { return _ReportName; } - set { _ReportName = value; } - } - private ItemInfoList _MyItems; - public ItemInfoList MyItems - { - get { return _MyItems; } - set { _MyItems = value; } - } - public ConsistencyReportArgs(string reportName, ItemInfoList myItems) - { - _ReportName = reportName; - _MyItems = myItems; - } - } -} \ No newline at end of file diff --git a/PROMS/PROMS/VEPROMS User Interface/dlgExportImport.cs b/PROMS/PROMS/VEPROMS User Interface/dlgExportImport.cs deleted file mode 100644 index 51e44cc0..00000000 --- a/PROMS/PROMS/VEPROMS User Interface/dlgExportImport.cs +++ /dev/null @@ -1,4287 +0,0 @@ -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.Base.Library; -using System.Xml; -using System.IO; -using Ionic.Zip; -using System.Text.RegularExpressions; - -namespace VEPROMS -{ - public partial class dlgExportImport : Form -{ - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - frmVEPROMS _MyFrmVEPROMS = null; - public frmVEPROMS MyFrmVEPROMS - { - get { return _MyFrmVEPROMS; } - set { _MyFrmVEPROMS = value; } - } - private bool _ConvertROsToTextDuringImport = false; - private bool _ConvertROsAndTransitionsToText = false; // set to true when Approval creates an Export file - - // B2016-225 notify user when Transitions and/or ROs are converted to text - private bool _DidConvertTransitionsToText = false; - private bool _DidConvertROsToText = false; - - private ItemInfo _ExternalTransitionItem = null; - public ItemInfo ExternalTransitionItem - { - get { return _ExternalTransitionItem; } - set { _ExternalTransitionItem = value; } - } - private Dictionary floatFoldout; - private Dictionary oldFormat; - private Dictionary newFormat; - private int oldRODbID; - private int newRODbID; - private FolderInfo _MyNewFolder; - public FolderInfo MyNewFolder - { - get { return _MyNewFolder; } - } - private ProcedureInfo _MyNewProcedure; - public ProcedureInfo MyNewProcedure - { - get { return _MyNewProcedure; } - set { _MyNewProcedure = value; } - } - private string PEIPath; - private string _MyMode; - private FolderInfo MyFolder = null; - private DocVersionInfo MyDocVersion = null; - private ProcedureInfo MyProcedure = null; - private XmlAttribute AddAttribute(XmlDocument xd, string name, string value) - { - XmlAttribute xa = xd.CreateAttribute(name); - xa.InnerText = value; - return xa; - } - public dlgExportImport(string mode, FolderInfo folderInfo, frmVEPROMS myFrmVEPROMS) - { - MyFrmVEPROMS = myFrmVEPROMS; - _MyMode = mode; - MyFolder = folderInfo; - InitializeComponent(); - this.Text = mode + " Dialog for " + folderInfo.Name; - } - public dlgExportImport(string mode, DocVersionInfo docVersionInfo, frmVEPROMS myFrmVEPROMS) - { - MyFrmVEPROMS = myFrmVEPROMS; - _MyMode = mode; - MyDocVersion = docVersionInfo; - InitializeComponent(); - this.Text = mode + " Dialog for " + docVersionInfo.Name + " of " + docVersionInfo.MyFolder.Name; - } - public dlgExportImport(string mode, ProcedureInfo procedureInfo, frmVEPROMS myFrmVEPROMS) - { - MyFrmVEPROMS = myFrmVEPROMS; - _MyMode = mode; - MyProcedure = procedureInfo; - InitializeComponent(); - this.Text = mode + " Dialog for " + procedureInfo.DisplayNumber; - } - private void dlgExportImport_Load(object sender, EventArgs e) - { - PEIPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\PEI_" + Database.VEPROMS_SqlConnection.Database; - if (!Directory.Exists(PEIPath)) - Directory.CreateDirectory(PEIPath); - if (_MyMode == "Import") - { - //If you try to import a procedure into an empty PROMS folder, the code was deleting the File System Folder including the import file. This happened during D.C. Cook training (12/3/2015). - //if (MyFolder != null && MyFolder.ChildFolderCount == 0 ) - //{ - // Directory.Delete(PEIPath, true); - // Directory.CreateDirectory(PEIPath); - //} - } - pnlExport.Dock = DockStyle.Fill; - pnlImport.Dock = DockStyle.Fill; - if (_MyMode.ToLower() == "export") - { - sfd.InitialDirectory = PEIPath; - pnlExport.BringToFront(); - } - else - { - ofd.InitialDirectory = PEIPath; - pnlImport.BringToFront(); - } - this.Height = this.Height / 2; - } - private void btnExport_Click(object sender, EventArgs e) - { - if (MyFolder != null) - { - //Database.SelectedDatabase - //sfd.FileName = string.Format("{0}.expx", MyFolder.Name); - sfd.FileName = string.Format("{0}-{1}.expx",Database.ActiveDatabase, MyFolder.Name); - if (sfd.ShowDialog(this) == DialogResult.OK) - { - if (sfd.FileName != string.Empty) - { - txtExport.Text = sfd.FileName; - if (File.Exists(txtExport.Text)) - File.Delete(txtExport.Text); - MyExpxZipFile = new ZipFile(txtExport.Text, Encoding.UTF8); - MyExpxZipFile.Save(); - } - } - } - else if (MyProcedure != null) - { - txtExport.Text = string.Format(@"{0}\{1}.pxml", PEIPath, MyProcedure.DisplayNumber.Replace("/", "_").Replace("\\","_")); - } - } - private void txtExport_TextChanged(object sender, EventArgs e) - { - btnDoExport.Enabled = txtExport.TextLength > 0; - if (btnDoExport.Enabled) - lblExportStatus.Text = "Ready To Perform Export"; - else - lblExportStatus.Text = "Awaiting Export File Name:"; - } - private XmlWriter MyWriter = null; - private ZipFile MyExpxZipFile = null; - private ZipFile MyImpxZipFile = null; - private DateTime MyStart; - private bool successfullExport = true; - private void btnDoExport_Click(object sender, EventArgs e) - { - btnExport.Enabled = false; - string msg = "Finished Exporting:\n\n"; - if (MyFolder != null) - { - this.Cursor = Cursors.WaitCursor; - MyStart = DateTime.Now; - btnDoExport.Enabled = false; - lblExportStatus.Text = "Performing Export"; - SaveExportData(); - //SaveExportDataWriter(); - - TimeSpan elapsed = DateTime.Now.Subtract(MyStart); - lblExportStatus.Text = "Export Completed in " + elapsed.ToString(); - this.Cursor = Cursors.Default; - msg += MyFolder.Name; - } - else if (MyProcedure != null) - { - this.Cursor = Cursors.WaitCursor; - MyStart = DateTime.Now; - btnDoExport.Enabled = false; - lblExportStatus.Text = "Performing Export"; - pbExportProcedure.Maximum = 1; - XmlDocument xd = new XmlDocument(); - ExportItem(xd, MyProcedure, "procedure"); - xd.Save(txtExport.Text); - TimeSpan elapsed = DateTime.Now.Subtract(MyStart); - lblExportStatus.Text = "Export Completed in " + elapsed.ToString(); - this.Cursor = Cursors.Default; - } - // added message to user when export of a procedure or procedure set has completed - if (successfullExport) - msg += MyProcedure; - else - msg = "Could not complete export"; - MessageBox.Show(msg, "Export", MessageBoxButtons.OK, MessageBoxIcon.Information); - btnCloseExport.Enabled = true; - } - private void SaveExportData() - { - XmlDocument xd = new XmlDocument(); - ExportFolder(xd, MyFolder, "folder"); - } - - // appears to not be used -jsj 4-29-2016 - //private void SaveExportDataWriter() - //{ - // XmlWriterSettings ws = new XmlWriterSettings(); - // ws.Indent = true; - // ws.NewLineHandling = NewLineHandling.Entitize; - // ws.CheckCharacters = false; - // MyWriter = XmlWriter.Create(txtExport.Text, ws); - // ExportFolder(MyFolder, "folder"); - // MyWriter.Close(); - //} - - private void btnDoImport_Click(object sender, EventArgs e) - { - bool isImported = false; - bool canceledPressed = false; - btnImport.Enabled = false; - this.Cursor = Cursors.WaitCursor; - MyStart = DateTime.Now; - btnDoImport.Enabled = false; - lblImportStatus.Text = "Performing Import"; - _DidConvertTransitionsToText = false; - _DidConvertROsToText = false; - //LoadImportDataReader(); - if (MyFolder != null) // import a folder - a .expx file - { - TurnChangeManagerOff.Execute(); - MyFrmVEPROMS.DisablePing = true; - TryToLoadImportDataDocument();// Added Try Catch Error Handling to assure that the Change Manager is tuned-on - MyDocVersion = null; - isImported = true; - MyFrmVEPROMS.DisablePing = false; - TurnChangeManagerOn.Execute(); - } - if (MyDocVersion != null) // import a procedure - a .pxml file - { - // compare the ROPath of MyDocVerion - // if no path set, display Pick RO Folder dialog - // if MyDocVersion ROPath is different than the import file ROPath, then ask user: - // - use MyDocVersion ROPath (warn resulting RO values may be be correct) - // * set oldRODbID to id in import file - // * set newRODbid to MyDocVersion rodbid - // - or convert ROs to text - TurnChangeManagerOff.Execute(); - // Added Try Catch Error Handling to assure that the Change Manager is tuned-on - bool result = TryToImportProcedure(ref isImported, ref canceledPressed); - TurnChangeManagerOn.Execute(); - if (!result) return; - if (isImported) - { - TimeSpan elapsed = DateTime.Now.Subtract(MyStart); - lblImportStatus.Text = "Import Completed in " + elapsed.ToString(); - } - else - { - btnImport.Enabled = true; - btnDoImport.Enabled = true; - } - } - this.Cursor = Cursors.Default; - btnCloseImport.Enabled = true; - if (isImported) - { - string msg = string.Format("Finished Importing:\n\n{0}", txtImport.Text.Substring(txtImport.Text.LastIndexOf("\\") + 1)); - if (_DidConvertTransitionsToText || _DidConvertROsToText) - { - string msg1 = (_DidConvertTransitionsToText && _DidConvertROsToText)?"Transitions and Referenced Objects":(_DidConvertTransitionsToText)?"Transitions":"Referenced Objects"; - msg += string.Format("\n\n{0} converted to text.\n\nThe locations can be found by doing a Global Search for the \"Link Converted To Text\" annotation type",msg1); - } - // B2016-225 added more information to the finish import message to tell the user when ROs or Transitions are converted to text. - MessageBox.Show(msg, "Import", MessageBoxButtons.OK, MessageBoxIcon.Information); - //MessageBox.Show(string.Format("Finished Importing:\n\n{0}", txtImport.Text.Substring(txtImport.Text.LastIndexOf("\\") + 1)), "Import", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - if (canceledPressed) - { - MessageBox.Show(string.Format("Canceling the import of:\n\n{0}",txtImport.Text.Substring(txtImport.Text.LastIndexOf("\\")+1)),"Import",MessageBoxButtons.OK,MessageBoxIcon.Information); - btnCloseImport.PerformClick(); - } - } - private bool TryToImportProcedure(ref bool isImported, ref bool canceledPressed) - { - try - { - return ImportProcedure(ref isImported, ref canceledPressed); - } - catch (Exception ex) - { - MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Asterisk); - _MyLog.Warn("Failed during Procedure Import", ex); - this.Close(); - return false; - } - } - private bool ImportProcedure(ref bool isImported, ref bool canceledPressed) - { - XmlDocument xd = new XmlDocument(); - xd.Load(txtImport.Text); - pbImportProcedure.Maximum = 1; - string rofolderpath = xd.DocumentElement.Attributes.GetNamedItem("rofolderpath").InnerText; - int rodbid = int.Parse(xd.DocumentElement.Attributes.GetNamedItem("rodbid").InnerText); - int rofstid = int.Parse(xd.DocumentElement.Attributes.GetNamedItem("rofstid").InnerText); - if (MyDocVersion.DocVersionAssociationCount > 0) - { - // use current ROPath - MyRODb = RODb.GetJustRoDb(MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.RODbID); - // if the current RO Path and the import file RO Path are not the same - // then ask if we should import using the current workingdraft RO Path, convert the ROs to text, or cancel the import - if (MyRODb.FolderPath != rofolderpath) - { - dlgImpHowToHandleROs dlg = new dlgImpHowToHandleROs(); - dlg.ImportedROFolder = rofolderpath; - dlg.WorkingDraftROFolder = MyRODb.FolderPath; - dlg.ShowDialog(this); - if (dlg.CancelImport) - { - this.Cursor = Cursors.Default; - this.btnImport.Enabled = true; // allow user to select a different export file to import - this.btnDoImport.Enabled = true; // allow user to change mind and perform the import - return false; // Return False to Indicate that the Import did not succeed - } - _ConvertROsToTextDuringImport = dlg.ConvertROsToText; - } - // this saves the old RO database ID and the current RO database ID so that we can change the RODBIDs in the RO links - newRODbID = MyRODb.RODbID; - oldRODbID = rodbid; - } - else - { - #region NeedToSelectROPath - // MyDocVersion does not have an RO database (ro folder path) assigned to it so we need to select an RO Path - List localROPaths = new List(); - RODbInfoList rolist = RODbInfoList.Get(); - foreach (RODbInfo dbi in rolist) - { - if (dbi.FolderPath == rofolderpath && dbi.RODbID == rodbid) - { - MyRODb = RODb.GetJustRoDb(rodbid); - oldRODbID = newRODbID = rodbid; - break; - } - // B2016-175 have the correct (matching) RO Path but the rodbid is different (procedure came from a different SQL database) - // We can use the RO Path but we need to change the rodbid in the RO links of the procedure we are importing - else if (dbi.FolderPath == rofolderpath && dbi.RODbID != rodbid) - { - MyRODb = RODb.GetByFolderPath(rofolderpath); - newRODbID = MyRODb.RODbID; - oldRODbID = rodbid; - break; - } - else - { - DirectoryInfo di = new DirectoryInfo(dbi.FolderPath); - if (di.Exists) - localROPaths.Add(dbi.FolderPath); - } - } - if (MyRODb == null) - { - if (localROPaths.Count == 0) - { - MessageBox.Show("There has been no RO folder defined for this database.\r\n\r\nIn order to import a procedure, you need to assign a RO folder path.\r\n\r\nImport process will terminate."); - this.Cursor = Cursors.Default; - return false;// Return False to Indicate that the Import did not succeed - } - else - { - this.Cursor = Cursors.Default; - dlgPickROFolder dlg = new dlgPickROFolder(); - dlg.ImportedROFolder = rofolderpath; - dlg.LocalROFolders = localROPaths; - dlg.ShowDialog(this); - if ((dlg.SelectedROFolder ?? string.Empty) != string.Empty) // B2015-216 If the return value is null treat it like an empty string - { - MyRODb = RODb.GetByFolderPath(dlg.SelectedROFolder); - RODbInfo myRODBInfo = RODbInfo.Get(MyRODb.RODbID); - oldRODbID = newRODbID = MyRODb.RODbID; - ROFstInfo fstInfo = null; - foreach (ROFstInfo tmp in myRODBInfo.RODbROFsts) - if (fstInfo == null || tmp.ROFstID > fstInfo.ROFstID) - fstInfo = tmp; - using (DocVersion dv = MyDocVersion.Get()) - { - using (ROFst fst = fstInfo.Get()) - { - dv.DocVersionAssociations.Add(fst); - dv.Save(); - } - dv.Reset_DocVersionAssociations(); - MyDocVersion.RefreshDocVersionAssociations(); - } - } - else - { - MessageBox.Show("Since you did not pick an existing RO folder defined for this database, the import process will terminate."); - this.Close();// Close the Import Window - return false;// Return False to Indicate that the Import did not succeed - } - } - } - #endregion - } // end - need to select RO Path - - // use resolvedProcNum to determine if procedure is 'unique', i.e. if the procedure number exists - // and user does not overwrite or copy, then the procedure should NOT be imported. Fix for B2016-045 - bool resolvedProcNum = true; - foreach (ProcedureInfo pi in MyDocVersion.Procedures) - { - // procedure numbers that contain a hyphen may have the hyphen represented as the unicode character - // '\u8209?' or the '-' character. If proc number is same except for hyphen representation, they - // should be considered the same procedure (fix for B2016-084) - string hyphenNum = pi.MyContent.Number == null ? "" : pi.MyContent.Number.Replace(@"\u8209?", "-").Replace("\u2011", "-").Replace(@"\u9586?", @"\").Replace("\u2572", @"\"); - string hyphenImpNum = xd.SelectSingleNode("procedure/content/@number").InnerText; - // bug fix C2015-044 - jsj - // - the cancel button would ignor the user's wishes and proceed with the import (overwriting the existing procedure) - // - also found that the message about overwriting or making a copy wasn't appearing because we where not converting the import procedure number - // - our standard unicode dash (\u8209?) before conparing the existing and imported - // - also found the Overrite and make a copy of messages looked too similar - fixed that as well. - //hyphenImpNum = hyphenImpNum == null ? "" : hyphenImpNum.Replace("\u8030?", "-"); -did not find any reason to have this \u8030? - note retested sourcesafe doc for B2016-084 without this logic and it was fine - hyphenImpNum = hyphenImpNum == null ? "" : hyphenImpNum.Replace(@"\u8209?", "-").Replace("\u2011", "-").Replace(@"\u9586?", @"\").Replace("\u2572", @"\"); - - if (hyphenNum == hyphenImpNum) - { - string msg = string.Format("The procedure you are importing{0}already exists in this procedure set.\n\nDo you want to OVERWRITE the existing procedure?", !hyphenImpNum.Equals("") ? string.Format(" ({0}) ", hyphenImpNum) : " "); - DialogResult dr = MessageBox.Show(this, msg, "Overwrite Existing Procedure", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Stop); - if (dr == DialogResult.Yes) - { - ImportProcedureOverwrite(xd, pi); - isImported = true; - break; - } - if (dr == DialogResult.No) - { - msg = string.Format("Do you want to import {0} as a COPY of the existing procedure?\n\nThis will prefix the procedure number with \"Copy of\"", !hyphenImpNum.Equals("") ? string.Format("({0})", hyphenImpNum) : "the procedure"); - dr = MessageBox.Show(this, msg, "Create Copy Of Existing Procedure", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Stop); - if (dr == DialogResult.Yes) - { - ImportProcedureCopy(xd); - isImported = true; - break; - } - else - resolvedProcNum = false; - } - if (dr == System.Windows.Forms.DialogResult.Cancel) - { - canceledPressed = true; - resolvedProcNum = false; - } - break; // user selected No or Cancel so break out of the foreach loop - } - } - if (!canceledPressed && !isImported && resolvedProcNum) - { - ImportProcedureNew(xd); - isImported = true; - } - return true;// Import Suceeded - } - // Added Error Handling to assure that Change Manager is turned-on regardless of success or failure of the import - private void TryToLoadImportDataDocument() - { - try - { - LoadImportDataDocument(); - } - catch (Exception ex) - { - _MyLog.Warn("Failure During Import", ex); - } - } - private void ImportProcedureNew(XmlDocument xd) - { - //add imported procedure - floatFoldout = new Dictionary(); - oldFormat = new Dictionary(); - newFormat = new Dictionary(); - FormatInfoList fil = FormatInfoList.Get(); - foreach (FormatInfo fi in fil) - { - oldFormat.Add(fi.FormatID, fi.Name); - newFormat.Add(fi.Name, fi.FormatID); - } - Old2NewItem = new Dictionary(); - Old2NewContent = new Dictionary(); - Old2NewLibDoc = new Dictionary(); - PendingTransitions = new XmlDocument(); - XmlElement xe = PendingTransitions.CreateElement("transitions"); - PendingTransitions.AppendChild(xe); - string fn = PEIPath + @"\transitions.xml"; - PendingTransitions.Save(fn); - ProcedureInfo lastProcedure = null; - foreach (ProcedureInfo pi in MyDocVersion.Procedures) - lastProcedure = pi; - _MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure); - //update transitions - AddTransitions(PendingTransitions); - PendingTransitions.Save(fn); - FixFloatingFoldouts(); - //File.Delete(fn); - } - private void ImportProcedureCopy(XmlDocument xd) - { - floatFoldout = new Dictionary(); - oldFormat = new Dictionary(); - newFormat = new Dictionary(); - FormatInfoList fil = FormatInfoList.Get(); - foreach (FormatInfo fi in fil) - { - oldFormat.Add(fi.FormatID, fi.Name); - newFormat.Add(fi.Name, fi.FormatID); - } - Old2NewItem = new Dictionary(); - Old2NewContent = new Dictionary(); - Old2NewLibDoc = new Dictionary(); - PendingTransitions = new XmlDocument(); - XmlElement xe = PendingTransitions.CreateElement("transitions"); - PendingTransitions.AppendChild(xe); - string fn = PEIPath + @"\transitions.xml"; - PendingTransitions.Save(fn); - ProcedureInfo lastProcedure = null; - //determine count of existing procedures with same number - string number = xd.SelectSingleNode("procedure/content/@number").InnerText; - - // kbr - could replace '-' with unicode in number, here. - int count = 0; - foreach (ProcedureInfo pi in MyDocVersion.Procedures) - { - lastProcedure = pi; - if (pi.MyContent.Number.EndsWith(number)) - count++; - } - xd.SelectSingleNode("procedure/content/@number").InnerText = string.Format("Copy({0}) of {1}", count.ToString(), number); - //add imported procedure and copy count - _MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure); - //update transitions - AddTransitions(PendingTransitions); - FixFloatingFoldouts(); - File.Delete(fn); - } - private void ImportProcedureOverwrite(XmlDocument xd, ProcedureInfo pi) - { - floatFoldout = new Dictionary(); - oldFormat = new Dictionary(); - newFormat = new Dictionary(); - FormatInfoList fil = FormatInfoList.Get(); - foreach (FormatInfo fi in fil) - { - oldFormat.Add(fi.FormatID, fi.Name); - newFormat.Add(fi.Name, fi.FormatID); - } - Old2NewItem = new Dictionary(); - Old2NewContent = new Dictionary(); - Old2NewLibDoc = new Dictionary(); - PendingTransitions = new XmlDocument(); - XmlElement xe = PendingTransitions.CreateElement("transitions"); - PendingTransitions.AppendChild(xe); - string fn = PEIPath + @"\transitions.xml"; - PendingTransitions.Save(fn); - ProcedureInfo lastProcedure = null; - //delete old procedure - foreach (ProcedureInfo lp in MyDocVersion.Procedures) - lastProcedure = lp; - //delete opi - try - { - TurnChangeManagerOn.Execute(); // Import Turns off the Change Manager - Delete needs to have it on - Item.DeleteItemAndChildren(pi); - TurnChangeManagerOff.Execute(); // Assure that the Change Manager is off - } - catch(Exception ex) - { - ExternalTransitionItem = pi.HandleSqlExceptionOnDelete(ex); - File.Delete(fn); - TurnChangeManagerOff.Execute(); // Assure that the Change Manager is off - return; - } - //add imported procedure - _MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure); - //update transitions - AddTransitions(PendingTransitions); - FixFloatingFoldouts(); - } - private void LoadImportDataDocument() - { - floatFoldout = new Dictionary(); - ZipEntry ze = MyExpxZipFile[0]; - string fn = PEIPath + @"\" + ze.FileName; - ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently); - XmlDocument xd = new XmlDocument(); - xd.Load(fn); - LoadFormats(xd); - Folder ff = AddFolder(Folder.Get(MyFolder.FolderID), xd); - if (ff == null) - { - MessageBox.Show("You can not import the same procedure set more than once", "Duplicate Import Error"); - return; - } - _MyNewFolder = FolderInfo.Get(ff.FolderID); - AddAnnotationTypes(xd); - DocVersionInfo dvi = AddDocVersion(ff, xd); - MyDocVersion = dvi; - xd = null; - lblImportStatus.Text = "Creating Procedures..."; - Application.DoEvents(); - ProcedureInfo pi = null; - pbImportProcedure.Value = 0; - pbImportProcedure.Maximum = MyExpxZipFile.Entries.Count - 1; - for (int i = 1; i < MyExpxZipFile.Entries.Count; i++) - { - ze = MyExpxZipFile[i]; - fn = PEIPath + @"\" + ze.FileName; - ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently); - xd = new XmlDocument(); - xd.Load(fn); - 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(); - } - private void FixSectionStart(ProcedureInfo pi) - { - Content c = Content.Get(pi.MyContent.ContentID); - XmlDocument xd = new XmlDocument(); - // If the config field is empty, add an empty xml node. - if (c.Config == "") c.Config = ""; - xd.LoadXml(c.Config); - XmlNode xn = xd.SelectSingleNode("Config/Procedure/@SectionStart"); - if (xn != null) - { - int iid = int.Parse(xn.InnerText); - if (Old2NewItem.ContainsKey(iid)) - iid = Old2NewItem[iid]; - else - { - int oldid = iid; - iid = pi.ItemID; - XmlAttribute xa = xd.CreateAttribute("ErrorSectionStart"); - xa.InnerText = oldid.ToString(); - XmlNode xp = xd.SelectSingleNode("Config/Procedure"); - xp.Attributes.SetNamedItem(xa); - } - xn.InnerText = iid.ToString(); - c.Config = xd.OuterXml; - c.Save(); - } - } - private void FixFloatingFoldouts() - { - foreach (int key in floatFoldout.Keys) - { - lblImportStatus.Text = "Updating Floating Foldouts"; - int cid = Old2NewContent[key]; - int iid = Old2NewItem[floatFoldout[key]]; - Content c = Content.Get(cid); - XmlDocument xd = new XmlDocument(); - xd.LoadXml(c.Config); - XmlNode xn = xd.SelectSingleNode("Config/Step/@FloatingFoldout"); - xn.InnerText = iid.ToString(); - c.Config = xd.OuterXml; - c.Save(); - } - } - - // note that his is only used when importing a folder - private void LoadFormats(XmlDocument xd) - { - oldFormat = new Dictionary(); - XmlNodeList nl = xd.SelectNodes("folder/formats/format"); - foreach (XmlNode nd in nl) - { - int formatid = int.Parse(nd.Attributes.GetNamedItem("formatid").InnerText); - string name = nd.Attributes.GetNamedItem("name").InnerText; - oldFormat.Add(formatid, name); - } - newFormat = new Dictionary(); - FormatInfoList fil = FormatInfoList.Get(); - foreach (FormatInfo fi in fil) - newFormat.Add(fi.Name, fi.FormatID); - } - - //jsj 4-29-2016 appears to not be used - //Dictionary dicParentItem = null; - //private void UpdateParentItem(int depth, ItemInfo ii) - //{ - // if (dicParentItem == null) dicParentItem = new Dictionary(); - // if (!dicParentItem.ContainsKey(depth)) dicParentItem.Add(depth, null); - // dicParentItem[depth] = ii; - //} - - //jsj 4-29-2016 appears to not be used - //Dictionary dicPreviousItem = null; - //private void UpdatePreviousItem(int depth, ItemInfo ii) - //{ - // if (dicPreviousItem == null) dicPreviousItem = new Dictionary(); - // if (!dicPreviousItem.ContainsKey(depth)) dicPreviousItem.Add(depth, null); - // dicPreviousItem[depth] = ii; - //} - - Dictionary dicItemDepth = null; - - // jsj 4-29-2016 appears to not be used - //private void UpdateItemDepth(int depth, int id) - //{ - // if (dicItemDepth == null) dicItemDepth = new Dictionary(); - // if (!dicItemDepth.ContainsKey(depth)) dicItemDepth.Add(depth, 0); - // dicItemDepth[depth] = id; - //} - // jsj 2016Feb17 - this appears to not be used - //private void LoadImportDataReader() - //{ - // int pCount = 0; - // int sCount = 0; - // Folder folder = null; - // DocVersion docversion = null; - // Dictionary dicRofst = null; - // Dictionary dicEntry = null; - // ROFst rofst = null; - // GetImportDataCounts(); - // pbImportProcedure.Maximum = MyCounts.Count; - // pbImportProcedure.Value = 0; - // Application.DoEvents(); - // FileStream fs = File.OpenRead(txtImport.Text); - // XmlReaderSettings rs = new XmlReaderSettings(); - // rs.CheckCharacters = false; - // XmlReader xr = XmlReader.Create(fs, rs); - // while (xr.Read()) - // { - // if (xr.IsStartElement()) - // { - // switch (xr.Name) - // { - // case "annotation": - // AddAnnotation(xr); - // break; - // //case "association": - // // break; - // case "content": - // { - // if (xr.Depth == 3) //content for procedure - // { - // ItemInfo ii = AddProcedure(xr, docversion, dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); - // UpdatePreviousItem(xr.Depth, ii); - // UpdateParentItem(xr.Depth, ii); - // } - // else - // { - - // int fromtype = dicItemDepth.ContainsKey(xr.Depth - 2) ? dicItemDepth[xr.Depth - 2] : 0; - // switch (fromtype) - // { - // case 2: - // { //sections - // ItemInfo ii = AddSection(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); - // UpdatePreviousItem(xr.Depth, ii); - // UpdateParentItem(xr.Depth, ii); - // break; - // } - // case 3: - // { //cautions - // ItemInfo ii = AddCaution(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); - // UpdatePreviousItem(xr.Depth, ii); - // UpdateParentItem(xr.Depth, ii); - // break; - // } - // case 4: - // { //notes - // ItemInfo ii = AddNote(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); - // UpdatePreviousItem(xr.Depth, ii); - // UpdateParentItem(xr.Depth, ii); - // break; - // } - // case 5: - // { //rnos - // ItemInfo ii = AddRNO(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); - // UpdatePreviousItem(xr.Depth, ii); - // UpdateParentItem(xr.Depth, ii); - // break; - // } - // case 6: - // { //steps - // ItemInfo ii = AddStep(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); - // UpdatePreviousItem(xr.Depth, ii); - // UpdateParentItem(xr.Depth, ii); - // break; - // } - // case 7: - // { //tables - // ItemInfo ii = AddTable(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); - // UpdatePreviousItem(xr.Depth, ii); - // UpdateParentItem(xr.Depth, ii); - // break; - // } - // default: - // break; - // } - // } - // break; - // } - // case "document": - // AddDocument(xr, dicEntry); - // break; - // case "docversion": - // { - // docversion = AddDocVersion(folder, xr); - // UpdatePreviousItem(xr.Depth + 2, null); - // break; - // } - // case "entry": - // dicEntry = AddEntry(xr); - // break; - // case "folder": - // folder = AddFolder(Folder.Get(MyFolder.FolderID), xr); - // break; - // case "grid": - // AddGrid(xr); - // break; - // case "procedure": - // { - // UpdateItemDepth(xr.Depth + 1, int.Parse(xr.GetAttribute("itemid"))); - // pbImportProcedure.PerformStep(); - // lblImportProcedure.Text = string.Format("{0} of {1} Procedures", pbImportProcedure.Value.ToString(), pbImportProcedure.Maximum.ToString()); - // pCount++; - // pbImportSection.Maximum = MyCounts[pCount].Count; - // pbImportSection.Value = 0; - // sCount = 0; - // Application.DoEvents(); - // break; - // } - // case "section": - // { - // UpdateItemDepth(xr.Depth + 1, int.Parse(xr.GetAttribute("itemid"))); - // pbImportSection.PerformStep(); - // lblImportSection.Text = string.Format("{0} of {1} Sections", pbImportSection.Value.ToString(), pbImportSection.Maximum.ToString()); - // sCount++; - // pbImportStep.Maximum = MyCounts[pCount][sCount]; - // pbImportStep.Value = 0; - // Application.DoEvents(); - // break; - // } - // case "step": - // { - // UpdateItemDepth(xr.Depth + 1, int.Parse(xr.GetAttribute("itemid"))); - // if (xr.Depth == 8) - // { - // pbImportStep.PerformStep(); - // lblImportStep.Text = string.Format("{0} of {1} Steps", pbImportStep.Value.ToString(), pbImportStep.Maximum.ToString()); - // Application.DoEvents(); - // } - // break; - // } - // case "caution": - // case "note": - // case "rno": - // case "table": - // UpdateItemDepth(xr.Depth + 1, int.Parse(xr.GetAttribute("itemid"))); - // break; - // case "cautions": - // case "notes": - // case "rnos": - // case "sections": - // case "steps": - // case "tables": - // { - // UpdateItemDepth(xr.Depth, int.Parse(xr.GetAttribute("fromtype"))); - // UpdatePreviousItem(xr.Depth + 2, null); - // UpdateParentItem(xr.Depth + 2, dicParentItem[xr.Depth - 1]); - // break; - // } - // case "rodb": - // { - // MyRODb = AddRODb(xr); - // rofst = AddROFst(dicRofst); - // docversion.DocVersionAssociations.Add(rofst); - // docversion.Save(); - // break; - // } - // case "rofst": - // dicRofst = GetROFstData(xr); - // break; - // case "rousage": - // AddROUsage(xr); - // break; - // //case "transition": - // // break; - // default: - // break; - // } - // Console.WriteLine("{0} - {1}", xr.Name, xr.Depth.ToString()); - // } - // } - // pbImportProcedure.PerformStep(); - // Application.DoEvents(); - // fs.Close(); - // FixImportDataTransitions(); - // StoreItemContentIDs(); - // ResolveExternalTransitions(folder); - //} - - // This is called only when we are importing an entire folder. - // if there is a .impx file (a zip file generated from the last folder export file and based on location -folder name- of the export file you are importing), then it updates it with new values, - // else it will create a .impx file, and saves the id information listed below. - // This will create and save the ItemIDs (old and new), ContentIDs (old andnew), library document IDs (old and new), and pending transitions each in their own xml file - // the xml files are then added (or replaced) in the .impx file. - private void SaveTransitionAndItemContentIDs() - { - XmlDocument xd = new XmlDocument(); - XmlElement xe = xd.CreateElement("items"); - xd.AppendChild(xe); - string fn = PEIPath + @"\items.xml"; - foreach (int key in Old2NewItem.Keys) - { - xe = xd.CreateElement("item"); - xe.Attributes.SetNamedItem(AddAttribute(xd, "old", key.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xd, "new", Old2NewItem[key].ToString())); - xd.DocumentElement.AppendChild(xe); - } - xd.Save(fn); - ZipEntry ze = MyImpxZipFile["items.xml"]; - MyImpxZipFile.RemoveEntry(ze); - MyImpxZipFile.Save(); - MyImpxZipFile.AddFile(fn, ""); - MyImpxZipFile.Save(); - File.Delete(fn); - xd = new XmlDocument(); - xe = xd.CreateElement("contents"); - xd.AppendChild(xe); - fn = PEIPath + @"\contents.xml"; - foreach (int key in Old2NewContent.Keys) - { - xe = xd.CreateElement("content"); - xe.Attributes.SetNamedItem(AddAttribute(xd, "old", key.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xd, "new", Old2NewContent[key].ToString())); - xd.DocumentElement.AppendChild(xe); - } - xd.Save(fn); - ze = MyImpxZipFile["contents.xml"]; - MyImpxZipFile.RemoveEntry(ze); - MyImpxZipFile.Save(); - MyImpxZipFile.AddFile(fn, ""); - MyImpxZipFile.Save(); - File.Delete(fn); - xd = new XmlDocument(); - xe = xd.CreateElement("transitions"); - xd.AppendChild(xe); - fn = PEIPath + @"\transitions.xml"; - if (PendingTransitions != null && PendingTransitions.DocumentElement.HasChildNodes) - { - foreach (XmlNode nd in PendingTransitions.DocumentElement.ChildNodes) - { - if(nd.InnerText == "") - xd.DocumentElement.AppendChild(xd.ImportNode(nd, true)); - } - } - xd.Save(fn); - ze = MyImpxZipFile["transitions.xml"]; - MyImpxZipFile.RemoveEntry(ze); - MyImpxZipFile.Save(); - MyImpxZipFile.AddFile(fn, ""); - MyImpxZipFile.Save(); - File.Delete(fn); - } - // appears to not be used - jsj 4-28-2016 - //private void StoreItemContentIDs() - //{ - // XmlDocument xd = new XmlDocument(); - // string fn = PEIPath + @"\ExternalTransitions.xml"; - // xd.Load(fn); - // XmlElement xe = (XmlElement)xd.SelectSingleNode("externaltransitions/oldtonewitem"); - // foreach (int key in Old2NewItem.Keys) - // { - // XmlElement xee = xd.CreateElement("item"); - // XmlAttribute xa = AddAttribute(xd, "old", key.ToString()); - // xee.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "new", Old2NewItem[key].ToString()); - // xee.Attributes.SetNamedItem(xa); - // xe.AppendChild(xee); - // } - // xd.Save(fn); - // xe = (XmlElement)xd.SelectSingleNode("externaltransitions/oldtonewcontent"); - // foreach (int key in Old2NewContent.Keys) - // { - // XmlElement xee = xd.CreateElement("content"); - // XmlAttribute xa = AddAttribute(xd, "old", key.ToString()); - // xee.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "new", Old2NewContent[key].ToString()); - // xee.Attributes.SetNamedItem(xa); - // xe.AppendChild(xee); - // } - // xd.Save(fn); - //} - //private void ResolveExternalTransitions(Folder folder) - //{ - // XmlDocument xd = new XmlDocument(); - // string fn = PEIPath + @"\ExternalTransitions.xml"; - // xd.Load(fn); - // AddStoredItemContentIDs(xd); - // XmlNodeList nl = xd.SelectNodes("//transition[@folder!='']"); - // foreach (XmlNode nd in nl) - // { - // int transitionid = int.Parse(nd.Attributes.GetNamedItem("transitionid").InnerText); - // int fromid = int.Parse(nd.Attributes.GetNamedItem("fromid").InnerText); - // int toid = int.Parse(nd.Attributes.GetNamedItem("toid").InnerText); - // int rangeid = int.Parse(nd.Attributes.GetNamedItem("rangeid").InnerText); - // if (Old2NewContent.ContainsKey(fromid) && Old2NewItem.ContainsKey(toid) && Old2NewItem.ContainsKey(rangeid)) - // { - // int isrange = int.Parse(nd.Attributes.GetNamedItem("isrange").InnerText); - // int trantype = int.Parse(nd.Attributes.GetNamedItem("trantype").InnerText); - // string config = nd.Attributes.GetNamedItem("config").InnerText; - // string userid = nd.Attributes.GetNamedItem("userid").InnerText; - // DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - // string lookfor; - // if (isrange == 0) - // lookfor = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - // else - // lookfor = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - // fromid = Old2NewContent[fromid]; - // toid = Old2NewItem[toid]; - // rangeid = Old2NewItem[rangeid]; - // Content cc = Content.Get(fromid); - // Transition tt = Transition.MakeTransition(cc, Item.Get(toid), Item.Get(rangeid), isrange, trantype, config, dts, userid); - // transitionid = tt.TransitionID; - // string replacewith; - // if (isrange == 0) - // replacewith = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - // else - // replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - // cc.Text = cc.Text.Replace(lookfor, replacewith); - // cc.Save(); - // nd.Attributes.GetNamedItem("folder").InnerText = ""; - // } - // } - // xd.Save(fn); - //} - - // This is called only when we are importing an entire folder and there is a .impx file (a zip file) - // the name of the .impx file is based on the folder name containing the export file being imported - // This will read in the saved ItemIDs (old and new), ContentIDs (old andnew), library document IDs (old and new), and pending transitions - private void ReadTransitionAndItemContentIDs() - { - ZipEntry ze = MyImpxZipFile["items.xml"]; - ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently); - string fn = PEIPath + @"\items.xml"; - XmlDocument xd = new XmlDocument(); - xd.Load(fn); - // B2016-176, B2016-197 Transitions were no always properly resolved - don't load in the old item ids - //XmlNodeList nl = xd.SelectNodes("//item"); - //foreach (XmlNode nd in nl) - //{ - // int oldid = int.Parse(nd.Attributes.GetNamedItem("old").InnerText); - // int newid = int.Parse(nd.Attributes.GetNamedItem("new").InnerText); - // //if (!Old2NewItem.ContainsKey(oldid)) - // Old2NewItem.Add(oldid, newid); - //} - File.Delete(fn); - ze = MyImpxZipFile["contents.xml"]; - ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently); - fn = PEIPath + @"\contents.xml"; - xd = new XmlDocument(); - xd.Load(fn); - // B2016-176, B2016-197 Transitions were no always properly resolved - don't load in the old content ids - //nl = xd.SelectNodes("//content"); - //foreach (XmlNode nd in nl) - //{ - // int oldid = int.Parse(nd.Attributes.GetNamedItem("old").InnerText); - // int newid = int.Parse(nd.Attributes.GetNamedItem("new").InnerText); - // //if (!Old2NewContent.ContainsKey(oldid)) - // Old2NewContent.Add(oldid, newid); - //} - File.Delete(fn); - ze = MyImpxZipFile["libdocs.xml"]; - ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently); - fn = PEIPath + @"\libdocs.xml"; - xd = new XmlDocument(); - xd.Load(fn); - XmlNodeList nl = xd.SelectNodes("//libdoc"); - //nl = xd.SelectNodes("//libdoc"); - foreach (XmlNode nd in nl) - { - int oldid = int.Parse(nd.Attributes.GetNamedItem("old").InnerText); - int newid = int.Parse(nd.Attributes.GetNamedItem("new").InnerText); - //if (!Old2NewContent.ContainsKey(oldid)) - Old2NewLibDoc.Add(oldid, newid); - } - File.Delete(fn); - ze = MyImpxZipFile["transitions.xml"]; - ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently); - fn = PEIPath + @"\transitions.xml"; - PendingTransitions.Load(fn); - File.Delete(fn); - } - // appears not to be used - jsj 4-28-2016 - //private void AddStoredItemContentIDs(XmlDocument xd) - //{ - // XmlNodeList nl = xd.SelectNodes("//item"); - // foreach (XmlNode nd in nl) - // { - // int oldid = int.Parse(nd.Attributes.GetNamedItem("old").InnerText); - // int newid = int.Parse(nd.Attributes.GetNamedItem("new").InnerText); - // if (!Old2NewItem.ContainsKey(oldid)) - // Old2NewItem.Add(oldid, newid); - // } - // nl = xd.SelectNodes("//content"); - // foreach (XmlNode nd in nl) - // { - // int oldid = int.Parse(nd.Attributes.GetNamedItem("old").InnerText); - // int newid = int.Parse(nd.Attributes.GetNamedItem("new").InnerText); - // if (!Old2NewContent.ContainsKey(oldid)) - // Old2NewContent.Add(oldid, newid); - // } - //} - - // appears not to be used - jsj 4-28-2016 - //private void FixImportDataTransitions() - //{ - // XmlDocument xd = new XmlDocument(); - // string fn = PEIPath + @"\ExternalTransitions.xml"; - // if (!File.Exists(fn)) - // { - // XmlElement xe = xd.CreateElement("externaltransitions"); - // XmlElement xee = xd.CreateElement("oldtonewitem"); - // xe.AppendChild(xee); - // xee = xd.CreateElement("oldtonewcontent"); - // xe.AppendChild(xee); - // xee = xd.CreateElement("transitions"); - // xe.AppendChild(xee); - // xd.AppendChild(xe); - // xd.Save(fn); - // } - // else - // { - // xd.Load(fn); - // } - // FileStream fs = File.OpenRead(txtImport.Text); - // XmlReaderSettings rs = new XmlReaderSettings(); - // rs.CheckCharacters = false; - // XmlReader xr = XmlReader.Create(fs, rs); - // while (xr.Read()) - // { - // if (xr.IsStartElement()) - // { - // switch (xr.Name) - // { - // case "transition": - // AddTransitions(xr); - // break; - // case "externaltransition": - // { - // AddExternalTransition(xr, xd); - // break; - // } - // default: - // break; - // } - // } - // } - // fs.Close(); - // xd.Save(fn); - //} - - // jsj 4-29-2016 appears to not be used - //private Dictionary> MyCounts = null; - //private Dictionary MySubCounts = null; - //private void GetImportDataCounts() - //{ - // int pCount = 0; - // int sCount = 0; - // int tCount = 0; - // MyCounts = new Dictionary>(); - // MySubCounts = new Dictionary(); - // FileStream fs = File.OpenRead(txtImport.Text); - // XmlReaderSettings rs = new XmlReaderSettings(); - // rs.CheckCharacters = false; - // XmlReader xr = XmlReader.Create(fs, rs); - // while (xr.Read()) - // { - // if (xr.IsStartElement()) - // { - // switch (xr.Name) - // { - // case "procedure": - // { - // if (pCount > 0) - // { - // MySubCounts.Add(sCount, tCount); - // MyCounts.Add(pCount, MySubCounts); - // sCount = 0; - // tCount = 0; - // MySubCounts = new Dictionary(); - // } - // pCount++; - // break; - // } - // case "section": - // { - // if (sCount > 0) - // { - // MySubCounts.Add(sCount, tCount); - // tCount = 0; - // } - // sCount++; - // break; - // } - // case "step": - // { - // if (xr.Depth == 8) - // tCount++; - // break; - // } - // default: - // break; - // } - // } - // } - // MySubCounts.Add(sCount, tCount); - // MyCounts.Add(pCount, MySubCounts); - // fs.Close(); - //} - - private void btnImport_Click(object sender, EventArgs e) - { - if (MyFolder != null) - { - if (ofd.ShowDialog(this) == DialogResult.OK) - { - if (ofd.FileName != string.Empty) - { - Old2NewItem = new Dictionary(); - Old2NewContent = new Dictionary(); - Old2NewLibDoc = new Dictionary(); - PendingTransitions = new XmlDocument(); - FileInfo fi = new FileInfo(ofd.FileName); - string dn; - if (fi.Name.IndexOf("-") > 0) - dn = fi.Name.Substring(0, fi.Name.IndexOf("-")); - else - dn = fi.Name.Substring(0,fi.Name.IndexOf(".")); - txtImport.Text = ofd.FileName; - ReadOptions ro = new ReadOptions(); - ro.Encoding = Encoding.UTF8; - MyExpxZipFile = ZipFile.Read(txtImport.Text, ro); - string fn = string.Format(@"{0}\{1}.impx", PEIPath, dn); - if (File.Exists(fn)) - { - MyImpxZipFile = ZipFile.Read(fn, ro); - ReadTransitionAndItemContentIDs(); - } - else - { - MyImpxZipFile = new ZipFile(fn, Encoding.UTF8); - //transitions - XmlElement xe = PendingTransitions.CreateElement("transitions"); - PendingTransitions.AppendChild(xe); - fn = PEIPath + @"\transitions.xml"; - PendingTransitions.Save(fn); - MyImpxZipFile.AddFile(fn, ""); - MyImpxZipFile.Save(); - File.Delete(fn); - //itemids - XmlDocument xd = new XmlDocument(); - xe = xd.CreateElement("items"); - xd.AppendChild(xe); - fn = PEIPath + @"\items.xml"; - xd.Save(fn); - MyImpxZipFile.AddFile(fn, ""); - MyImpxZipFile.Save(); - File.Delete(fn); - //contentids - xd = new XmlDocument(); - xe = xd.CreateElement("contents"); - xd.AppendChild(xe); - fn = PEIPath + @"\contents.xml"; - xd.Save(fn); - MyImpxZipFile.AddFile(fn, ""); - MyImpxZipFile.Save(); - File.Delete(fn); - //libdocids - xd = new XmlDocument(); - xe = xd.CreateElement("libdocs"); - xd.AppendChild(xe); - fn = PEIPath + @"\libdocs.xml"; - xd.Save(fn); - MyImpxZipFile.AddFile(fn, ""); - MyImpxZipFile.Save(); - File.Delete(fn); - } - } - } - } - if (MyDocVersion != null) - { - ofd.Filter = "PROMS Procedure Export Files|*.pxml"; - if (ofd.ShowDialog(this) == DialogResult.OK) - txtImport.Text = ofd.FileName; - } - } - private void txtImport_TextChanged(object sender, EventArgs e) - { - btnDoImport.Enabled = txtImport.TextLength > 0; - if (btnDoImport.Enabled) - lblImportStatus.Text = "Ready To Perform Import"; - else - lblImportStatus.Text = "Awaiting Import File Name:"; - } - #region Export for Merge - private string FromFolderName = string.Empty; - private void ExportFolder(XmlDocument xd, FolderInfo fi, string nodename) - { - /* - FolderID - ParentID - DBID - Name - Title - ShortName - FormatID - ManualOrder - Config - DTS - UsrID - */ - lblExportStatus.Text = "Exporting Folder..."; - Application.DoEvents(); - string formatFileName = (fi.MyFormat != null)? fi.MyFormat.Name:""; - FromFolderName = fi.Name; - XmlElement xe = xd.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xd, "folderid", fi.FolderID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xd, "parentid", fi.ParentID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xd, "dbid", fi.DBID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xd, "name", fi.Name)); - xe.Attributes.SetNamedItem(AddAttribute(xd, "title", fi.Title)); - xe.Attributes.SetNamedItem(AddAttribute(xd, "shortname", fi.ShortName)); - xe.Attributes.SetNamedItem(AddAttribute(xd, "formatid", fi.FormatID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xd, "manualorder", fi.ManualOrder.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xd, "config", fi.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xd, "dts", fi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xd, "usrid", fi.UsrID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xd, "formatfilename",formatFileName)); - xd.AppendChild(xe); - ExportAnnotationTypes(xe, "annotationtypes"); - ExportFormats(xe, "formats"); - if (fi.FolderDocVersionCount > 0) - foreach (DocVersionInfo dvi in fi.FolderDocVersions) - ExportDocVersion(xe, dvi, "docversion"); - } - private void ExportFormats(XmlElement xn, string nodename) - { - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - FormatInfoList fil = FormatInfoList.Get(); - foreach (FormatInfo fi in fil) - ExportFormat(xe, fi, "format"); - xn.AppendChild(xe); - } - private void ExportFormat(XmlElement xn, FormatInfo fi, string nodename) - { - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatid", fi.FormatID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "name", fi.Name)); - xn.AppendChild(xe); - } - private void ExportAnnotationTypes(XmlElement xn, string nodename) - { - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - AnnotationTypeInfoList atl = AnnotationTypeInfoList.Get(); - foreach (AnnotationTypeInfo ati in atl) - ExportAnnotationType(xe, ati, "annotationtype"); - xn.AppendChild(xe); - } - private void ExportAnnotationType(XmlElement xn, AnnotationTypeInfo ati, string nodename) - { - /* - TypeID - Name - Config - DTS - UserID - */ - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "typeid", ati.TypeID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "name", ati.Name)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", ati.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ati.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ati.UserID.ToString())); - xn.AppendChild(xe); - } - - // jsj 4-29-2016 appears to not be used - //private void ExportFolder(FolderInfo fi, string nodename) - //{ - // /* - // FolderID - // ParentID - // DBID - // Name - // Title - // ShortName - // FormatID - // ManualOrder - // Config - // DTS - // UsrID - // */ - // string formatFileName = (fi.MyFormat != null) ? fi.MyFormat.Name : ""; - // FromFolderName = fi.Name; - // MyWriter.WriteStartDocument(); - // MyWriter.WriteStartElement(nodename); - // MyWriter.WriteAttributeString("folderid", fi.FolderID.ToString()); - // MyWriter.WriteAttributeString("parentid", fi.ParentID.ToString()); - // MyWriter.WriteAttributeString("dbid", fi.DBID.ToString()); - // MyWriter.WriteAttributeString("name", fi.Name); - // MyWriter.WriteAttributeString("title", fi.Title); - // MyWriter.WriteAttributeString("shortname", fi.ShortName); - // MyWriter.WriteAttributeString("formatid", fi.FormatID.ToString()); - // MyWriter.WriteAttributeString("manualorder", fi.ManualOrder.ToString()); - // MyWriter.WriteAttributeString("config", fi.Config); - // MyWriter.WriteAttributeString("dts", fi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - // MyWriter.WriteAttributeString("usrid", fi.UsrID.ToString()); - // MyWriter.WriteAttributeString("formatfilename", formatFileName); - - // if (fi.FolderDocVersionCount > 0) - // foreach (DocVersionInfo dvi in fi.FolderDocVersions) - // ExportDocVersion(dvi, "docversion"); - // MyWriter.WriteEndElement(); - // MyWriter.WriteEndDocument(); - //} - - // bug fix: B2017-082 don't export if no RO Path - display an message to the user to assign a RO Path - private bool ValidDocVersionAssociation(DocVersionInfo dvi) - { - if (dvi.DocVersionAssociationCount <= 0) - { - MessageBox.Show("Assign a Referenced Object path to the Working Draft tree node before exporting.", "RO Path not assigned"); - successfullExport = false; - return false; - } - return true; - } - private void ExportDocVersion(XmlElement xn, DocVersionInfo dvi, string nodename) - { - /* - VersionID - FolderID - VersionType - Name - Title - ItemID - FormatID - Config - DTS - UserID - */ - lblExportStatus.Text = "Exporting DocVersion..."; - Application.DoEvents(); - string formatFileName = (dvi.MyFormat != null) ? dvi.MyFormat.Name : ""; - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "versionid", dvi.VersionID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "folderid", dvi.FolderID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "versiontype", dvi.VersionType.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "name", dvi.Name)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "title", dvi.Title)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "itemid", dvi.ItemID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatid", dvi.FormatID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", dvi.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", dvi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", dvi.UserID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatfilename", formatFileName)); - xn.AppendChild(xe); - if (!ValidDocVersionAssociation(dvi)) return; // bug fix: B2017-082 don't export if no RO Path - if (dvi.DocVersionAssociationCount > 0) - foreach (AssociationInfo ai in dvi.DocVersionAssociations) - ExportAssociation(xe, ai, "association"); - string fn = PEIPath + @"\folder.xml"; - xn.OwnerDocument.Save(fn); - MyExpxZipFile.AddFile(fn, "folder"); - MyExpxZipFile.Save(); - File.Delete(fn); - //here - lblExportStatus.Text = "Exporting Procedures..."; - Application.DoEvents(); - if (dvi.Procedures.Count > 0) - { - pbExportProcedure.Value = 0; - pbExportProcedure.Maximum = dvi.Procedures.Count; - lblExportProcedure.Text = pbExportProcedure.Maximum.ToString() + " Procedures"; - foreach (ItemInfo ii in dvi.Procedures) - { - XmlDocument xd = new XmlDocument(); - ExportItem(xd, ii, "procedure"); - fn = string.Format(@"{0}\proc{1}.xml", PEIPath, pbExportProcedure.Value.ToString().PadLeft(4, '0')); - xd.Save(fn); - MyExpxZipFile.AddFile(fn, "procedures"); - MyExpxZipFile.Save(); - File.Delete(fn); - xd = null; - } - } - } - private void ExportDocVersion(DocVersionInfo dvi, string nodename) - { - /* - VersionID - FolderID - VersionType - Name - Title - ItemID - FormatID - Config - DTS - UserID - */ - string formatFileName = (dvi.MyFormat != null) ? dvi.MyFormat.Name : ""; - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("versionid", dvi.VersionID.ToString()); - MyWriter.WriteAttributeString("folderid", dvi.FolderID.ToString()); - MyWriter.WriteAttributeString("versiontype", dvi.VersionType.ToString()); - MyWriter.WriteAttributeString("name", dvi.Name); - MyWriter.WriteAttributeString("title", dvi.Title); - MyWriter.WriteAttributeString("itemid", dvi.ItemID.ToString()); - MyWriter.WriteAttributeString("formatid", dvi.FormatID.ToString()); - MyWriter.WriteAttributeString("config", dvi.Config); - MyWriter.WriteAttributeString("dts", dvi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", dvi.UserID.ToString()); - MyWriter.WriteAttributeString("formatfilename", formatFileName); - if (dvi.DocVersionAssociationCount > 0) - foreach (AssociationInfo ai in dvi.DocVersionAssociations) - ExportAssociation(ai, "association"); - if (dvi.Procedures.Count > 0) - { - pbExportProcedure.Value = 0; - pbExportProcedure.Maximum = dvi.Procedures.Count; - lblExportProcedure.Text = pbExportProcedure.Maximum.ToString() + " Procedures"; - foreach (ItemInfo ii in dvi.Procedures) - { - ExportItem(ii, "procedure"); - } - } - MyWriter.WriteEndElement(); - } - private void ExportAssociation(XmlElement xn, AssociationInfo ai, string nodename) - { - /* - AssociationID - VersionID - ROFstID - Config - DTS - UserID - */ - lblExportStatus.Text = "Exporting Association..."; - Application.DoEvents(); - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "associationid", ai.AssociationID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "versionid", ai.VersionID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rofstid", ai.ROFstID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", ai.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ai.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ai.UserID.ToString())); - xn.AppendChild(xe); - ExportROFst(xe, ai.MyROFst, "rofst"); - } - private void ExportAssociation(AssociationInfo ai, string nodename) - { - /* - AssociationID - VersionID - ROFstID - Config - DTS - UserID - */ - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("associationid", ai.AssociationID.ToString()); - MyWriter.WriteAttributeString("versionid", ai.VersionID.ToString()); - MyWriter.WriteAttributeString("rofstid", ai.ROFstID.ToString()); - MyWriter.WriteAttributeString("config", ai.Config); - MyWriter.WriteAttributeString("dts", ai.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", ai.UserID.ToString()); - ExportROFst(ai.MyROFst, "rofst"); - MyWriter.WriteEndElement(); - } - private void ExportROFst(XmlElement xn, ROFstInfo fst, string nodename) - { - /* - ROFstID - RODbID - ROLookup - Config - DTS - UserID - */ - lblExportStatus.Text = "Exporting ROFst..."; - Application.DoEvents(); - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rofstid", fst.ROFstID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", fst.RODbID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rolookup", Convert.ToBase64String(fst.ROLookup))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", fst.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", fst.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", fst.UserID.ToString())); - xn.AppendChild(xe); - ExportFigures(xe, fst); - ExportRODb(xe, fst.MyRODb, "rodb"); - } - private void ExportROFst(ROFstInfo fst, string nodename) - { - /* - ROFstID - RODbID - ROLookup - Config - DTS - UserID - */ - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("rofstid", fst.ROFstID.ToString()); - MyWriter.WriteAttributeString("rodbid", fst.RODbID.ToString()); - MyWriter.WriteAttributeString("rolookup", Convert.ToBase64String(fst.ROLookup)); - MyWriter.WriteAttributeString("config", fst.Config); - MyWriter.WriteAttributeString("dts", fst.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", fst.UserID.ToString()); - ExportRODb(fst.MyRODb, "rodb"); - MyWriter.WriteEndElement(); - } - private void ExportFigures(XmlElement xn, ROFstInfo fst) - { - if (fst.ROFstFigureCount > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("figures"); - xn.AppendChild(xe); - foreach (FigureInfo figure in fst.ROFstFigures) - { - XmlElement xee = xn.OwnerDocument.CreateElement("figure"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "figureid", figure.FigureID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "rofstid", figure.ROFstID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "imageid", figure.ImageID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "config", figure.Config)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", figure.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", figure.UserID)); - xe.AppendChild(xee); - ExportROImage(xee, figure.MyROImage); - } - } - } - private void ExportROImage(XmlElement xn, ROImageInfo image) - { - XmlElement xe = xn.OwnerDocument.CreateElement("image"); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "imageid", image.ImageID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", image.RODbID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "filename", image.FileName)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "content", Convert.ToBase64String(image.Content))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", image.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", image.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", image.UserID)); - xn.AppendChild(xe); - } - private void ExportRODb(XmlElement xn, RODbInfo db, string nodename) - { - /* - RODbID - ROName - FolderPath - DBConnectionString - Config - DTS - UserID - */ - lblExportStatus.Text = "Exporting RODb..."; - Application.DoEvents(); - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", db.RODbID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "roname", db.ROName)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "folderpath", db.FolderPath)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dbconnectionstring", db.DBConnectionString)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", db.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", db.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", db.UserID.ToString())); - xn.AppendChild(xe); - } - private void ExportRODb(RODbInfo db, string nodename) - { - /* - RODbID - ROName - FolderPath - DBConnectionString - Config - DTS - UserID - */ - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("rodbid", db.RODbID.ToString()); - MyWriter.WriteAttributeString("roname", db.ROName); - MyWriter.WriteAttributeString("folderpath", db.FolderPath); - MyWriter.WriteAttributeString("dbconnectionstring", db.DBConnectionString); - MyWriter.WriteAttributeString("config", db.Config); - MyWriter.WriteAttributeString("dts", db.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", db.UserID.ToString()); - MyWriter.WriteEndElement(); - } - - public void ExportItem(XmlDocument xd, ItemInfo ii, string nodename) - { - XmlElement xe = xd.CreateElement(nodename); - if (ii.IsProcedure) - { - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.RODbID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rofolderpath", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rofstid", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.ROFstID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rofstdts", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - } - xd.AppendChild(xe); - ExportItem(xe, ii, nodename); - } - private void ExportItem(XmlElement xn, ItemInfo ii, string nodename) - { - /* - ItemID - PreviousID - ContentID - DTS - */ - XmlElement xe = null; - if (xn.Name == "procedure") - xe = xn; - else - { - xe = xn.OwnerDocument.CreateElement(nodename); - xn.AppendChild(xe); - } - if (ii.IsProcedure) - { - pbExportProcedure.PerformStep(); - lblExportProcedure.Text = string.Format("{0} of {1} Procedures", pbExportProcedure.Value.ToString(), pbExportProcedure.Maximum.ToString()); - TimeSpan elapsed = DateTime.Now.Subtract(MyStart); - lblExportTime.Text = "Elapsed Time: " + elapsed.ToString(); - Application.DoEvents(); - pbExportSection.Value = 0; - pbExportSection.Maximum = pbExportSection.Value; - pbExportStep.Value = 0; - pbExportStep.Maximum = pbExportStep.Value; - if(ii.Sections != null) - pbExportSection.Maximum = ii.Sections.Count; - else - { - pbExportSection.Maximum = 1; - pbExportSection.PerformStep(); - pbExportStep.Maximum = 1; - pbExportStep.PerformStep(); - lblExportSection.Text = "Sections"; - lblExportStep.Text = "Steps"; - Application.DoEvents(); - } - } - if (ii.IsSection && ii.ActiveParent.IsProcedure) - { - pbExportSection.PerformStep(); - lblExportSection.Text = string.Format("{0} of {1} Sections", pbExportSection.Value.ToString(), pbExportSection.Maximum.ToString()); - Application.DoEvents(); - pbExportStep.Value = 0; - pbExportStep.Maximum = pbExportStep.Value; - if (ii.Steps != null) - pbExportStep.Maximum = ii.Steps.Count; - else - { - pbExportStep.Maximum = 1; - pbExportStep.PerformStep(); - lblExportStep.Text = "Word Section Data"; - Application.DoEvents(); - } - } - if (ii.IsStep && ii.ActiveParent.IsSection && ii.ActiveParent.ActiveParent.IsProcedure) - { - pbExportStep.PerformStep(); - lblExportStep.Text = string.Format("{0} of {1} Steps", pbExportStep.Value.ToString(), pbExportStep.Maximum.ToString()); - Application.DoEvents(); - } - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "itemid", ii.ItemID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "previousid", ii.PreviousID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", ii.ContentID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ii.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - //item audits - ExportItemAudits(xe, ii); - ExportContent(xe, ii.MyContent, "content"); - if (ii.ItemAnnotationCount > 0) - foreach (AnnotationInfo ai in ii.ItemAnnotations) - ExportAnnotation(xe, ai, "annotation"); - } - private void ExportItemAudits(XmlElement xn, ItemInfo ii) - { - if (cbxExportAudits.Checked) - { - ItemAuditInfoList audits = ItemAuditInfoList.Get(ii.ItemID); - if (audits.Count > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("audits"); - foreach (ItemAuditInfo audit in audits) - { - if (audit.DeleteStatus == 0) - { - XmlElement xee = xn.OwnerDocument.CreateElement("audit"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "auditid", audit.AuditID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "contentid", audit.ContentID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "deletestatus", audit.DeleteStatus.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", audit.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "itemid", audit.ItemID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "previousid", audit.PreviousID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", audit.UserID)); - xe.AppendChild(xee); - } - } - xn.AppendChild(xe); - } - } - } - // used to save word sections with resolved ROs (export generated from Approve) - private Dictionary _DocReplace; - public Dictionary DocReplace - { - get { return _DocReplace; } - set - { - _DocReplace = value; - _ConvertROsAndTransitionsToText = (value != null); - } - } - private void ExportItem(ItemInfo ii, string nodename) - { - /* - ItemID - PreviousID - ContentID - DTS - */ - if (ii.IsProcedure) - { - pbExportProcedure.PerformStep(); - lblExportProcedure.Text = string.Format("{0} of {1} Procedures", pbExportProcedure.Value.ToString(), pbExportProcedure.Maximum.ToString()); - Application.DoEvents(); - pbExportSection.Value = 0; - pbExportStep.Value = 0; - pbExportSection.Maximum = ii.Sections.Count; - if (ii.Sections != null) - pbExportSection.Maximum = ii.Sections.Count; - else - { - pbExportSection.Maximum = 1; - pbExportSection.PerformStep(); - pbExportStep.Maximum = 1; - pbExportStep.PerformStep(); - lblExportSection.Text = "Sections"; - lblExportStep.Text = "Steps"; - Application.DoEvents(); - } - } - if (ii.IsSection) - { - pbExportSection.PerformStep(); - lblExportSection.Text = string.Format("{0} of {1} Sections", pbExportSection.Value.ToString(), pbExportSection.Maximum.ToString()); - Application.DoEvents(); - pbExportStep.Value = 0; - if (ii.Steps != null) - pbExportStep.Maximum = ii.Steps.Count; - else - { - pbExportStep.Maximum = 1; - pbExportStep.PerformStep(); - lblExportStep.Text = "Word Section Data"; - Application.DoEvents(); - } - } - if (ii.IsStep) - { - pbExportStep.PerformStep(); - lblExportStep.Text = string.Format("{0} of {1} Steps", pbExportStep.Value.ToString(), pbExportStep.Maximum.ToString()); - Application.DoEvents(); - } - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("itemid", ii.ItemID.ToString()); - MyWriter.WriteAttributeString("previousid", ii.PreviousID.ToString()); - MyWriter.WriteAttributeString("contentid", ii.ContentID.ToString()); - MyWriter.WriteAttributeString("dts", ii.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - ExportContent(ii.MyContent, "content"); - if (ii.ItemAnnotationCount > 0) - foreach (AnnotationInfo ai in ii.ItemAnnotations) - ExportAnnotation(ai, "annotation"); - MyWriter.WriteEndElement(); - } - private void ExportContent(XmlElement xn, ContentInfo ci, string nodename) - { - /* - ContentID - Number - Text - Type - FormatID - Config - DTS - UserID - */ - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - // strip the link information if we are convertingthe RO and Transitions to text - string ciText = (_ConvertROsAndTransitionsToText)?ItemInfo.StripLinks(ci.Text):ci.Text; - string formatFileName = (ci.MyFormat != null) ? ci.MyFormat.Name : ""; - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", ci.ContentID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "number", ci.Number)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "text", ciText)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "type", ci.Type.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatid", ci.FormatID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", ci.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ci.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ci.UserID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatfilename", formatFileName)); - //content audits - ExportContentAudits(xe, ci); - xn.AppendChild(xe); - if (ci.ContentTransitionCount > 0) - foreach (TransitionInfo ti in ci.ContentTransitions) - ExportTransition(xe, ti, "transition"); - if (ci.ContentRoUsageCount > 0) - foreach (RoUsageInfo ri in ci.ContentRoUsages) - ExportROUsage(xe, ri, "rousage"); - if (ci.ContentEntryCount > 0) - ExportEntry(xe, ci.MyEntry, "entry"); - if (ci.ContentGridCount > 0) - ExportGrid(xe, ci.MyGrid, "grid"); - if (ci.ContentImageCount > 0) - ExportImage(xe, ci.MyImage, "image"); - if (ci.ContentPartCount > 0) - foreach (PartInfo pi in ci.ContentParts) - ExportPart(xe, pi, ((E_FromTypes)pi.FromType).ToString().ToLower()); - } - private void ExportContentAudits(XmlElement xn, ContentInfo ci) - { - if (cbxExportAudits.Checked) - { - ContentAuditInfoList audits = ContentAuditInfoList.Get(ci.ContentID); - if (audits.Count > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("audits"); - foreach (ContentAuditInfo audit in audits) - { - if (audit.DeleteStatus == 0) - { - XmlElement xee = xn.OwnerDocument.CreateElement("audit"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "auditid", audit.AuditID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "contentid", audit.ContentID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "number", audit.Number)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "text", audit.Text)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "type", audit.Type.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "formatid", audit.FormatID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "config", audit.Config)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", audit.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", audit.UserID)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "deletestatus", audit.DeleteStatus.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "actiondts", audit.ActionWhen.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.AppendChild(xee); - } - } - } - } - } - private void ExportContent(ContentInfo ci, string nodename) - { - /* - ContentID - Number - Text - Type - FormatID - Config - DTS - UserID - */ - // strip the link information if we are convertinga the ROs and Transitions to text - string ciText = (_ConvertROsAndTransitionsToText) ? ItemInfo.StripLinks(ci.Text) : ci.Text; - string formatFileName = (ci.MyFormat != null) ? ci.MyFormat.Name : ""; - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("contentid", ci.ContentID.ToString()); - MyWriter.WriteAttributeString("number", ci.Number); - MyWriter.WriteAttributeString("text", ciText); - MyWriter.WriteAttributeString("type", ci.Type.ToString()); - MyWriter.WriteAttributeString("formatid", ci.FormatID.ToString()); - MyWriter.WriteAttributeString("config", ci.Config); - MyWriter.WriteAttributeString("dts", ci.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", ci.UserID.ToString()); - MyWriter.WriteAttributeString("formatfilename", formatFileName); - if (ci.ContentTransitionCount > 0) - foreach (TransitionInfo ti in ci.ContentTransitions) - ExportTransition(ti, "transition"); - if (ci.ContentRoUsageCount > 0) - foreach (RoUsageInfo ri in ci.ContentRoUsages) - ExportROUsage(ri, "rousage"); - if (ci.ContentEntryCount > 0) - ExportEntry(ci.MyEntry, "entry"); - if (ci.ContentGridCount > 0) - ExportGrid(ci.MyGrid, "grid"); - if (ci.ContentImageCount > 0) - ExportImage(ci.MyImage, "image"); - if (ci.ContentPartCount > 0) - foreach (PartInfo pi in ci.ContentParts) - ExportPart(pi, ((E_FromTypes)pi.FromType).ToString().ToLower()); - MyWriter.WriteEndElement(); - } - private void ExportGrid(XmlElement xn, GridInfo gi, string nodename) - { - /* - ContentID - Data - Config - DTS - UserID - */ - string giData = gi.Data; - if (_ConvertROsAndTransitionsToText) - { - giData = giData.Replace("True", "False"); // converts a RO table to a unlinked regular table - giData = ItemInfo.StripLinks(giData); // this converts ROs and transitions to text - } - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", gi.ContentID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "data", giData)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", gi.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", gi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", gi.UserID.ToString())); - //grid audits - ExportGridAudits(xe, gi); - xn.AppendChild(xe); - } - private void ExportGridAudits(XmlElement xn, GridInfo gi) - { - if (cbxExportAudits.Checked) - { - GridAuditInfoList audits = GridAuditInfoList.Get(gi.ContentID); - if (audits.Count > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("audits"); - foreach (GridAuditInfo audit in audits) - { - if (audit.DeleteStatus == 0) - { - XmlElement xee = xn.OwnerDocument.CreateElement("audit"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "auditid", audit.AuditID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "contentid", audit.ContentID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "data", audit.Data)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "config", audit.Config)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", audit.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", audit.UserID)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "deletestatus", audit.DeleteStatus.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "contentauditid", audit.ContentAuditID.ToString())); - xe.AppendChild(xee); - - } - } - } - } - } - private void ExportGrid(GridInfo gi, string nodename) - { - /* - ContentID - Data - Config - DTS - UserID - */ - string giData = gi.Data; - if (_ConvertROsAndTransitionsToText) - { - giData = giData.Replace("IsRoTable>True", "IsRoTable>False"); // converts a RO table to regular table - giData = ItemInfo.StripLinks(giData); // converts ROs and Transitions to text - } - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("contentid", gi.ContentID.ToString()); - MyWriter.WriteAttributeString("data", giData); - MyWriter.WriteAttributeString("config", gi.Config); - MyWriter.WriteAttributeString("dts", gi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", gi.UserID.ToString()); - MyWriter.WriteEndElement(); - } - private void ExportEntry(XmlElement xn, EntryInfo ei, string nodename) - { - /* - ContentID - DocID - DTS - UserID - */ - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", ei.ContentID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "docid", ei.DocID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ei.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ei.UserID.ToString())); - //entry audits - ExportEntryAudits(xe, ei); - xn.AppendChild(xe); - ExportDocument(xe, ei.MyDocument, "document"); - } - private void ExportEntryAudits(XmlElement xn, EntryInfo ei) - { - if (cbxExportAudits.Checked) - { - EntryAuditInfoList audits = EntryAuditInfoList.Get(ei.ContentID); - if (audits.Count > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("audits"); - foreach (EntryAuditInfo audit in audits) - { - if (audit.DeleteStatus == 0) - { - XmlElement xee = xn.OwnerDocument.CreateElement("audit"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "auditid", audit.AuditID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "contentid", audit.ContentID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "docid", audit.DocID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", audit.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", audit.UserID)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "deletestatus", audit.DeleteStatus.ToString())); - xe.AppendChild(xee); - } - } - } - } - } - private void ExportEntry(EntryInfo ei, string nodename) - { - /* - ContentID - DocID - DTS - UserID - */ - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("contentid", ei.ContentID.ToString()); - MyWriter.WriteAttributeString("docid", ei.DocID.ToString()); - MyWriter.WriteAttributeString("dts", ei.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", ei.UserID.ToString()); - ExportDocument(ei.MyDocument, "document"); - MyWriter.WriteEndElement(); - } - private void ExportImage(XmlElement xn, ImageInfo ii, string nodename) - { - /* - ContentID - ImageType - FileName - Data - Config - DTS - UserID - */ - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", ii.ContentID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "imagetype", ii.ImageType.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "filename", ii.FileName)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "data", Convert.ToBase64String(ii.Data))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", ii.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ii.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ii.UserID.ToString())); - //image audits - ExportImageAudits(xe, ii); - xn.AppendChild(xe); - } - private void ExportImageAudits(XmlElement xn, ImageInfo ii) - { - if (cbxExportAudits.Checked) - { - ImageAuditInfoList audits = ImageAuditInfoList.Get(ii.ContentID); - if (audits.Count > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("audits"); - foreach (ImageAuditInfo audit in audits) - { - if (audit.DeleteStatus == 0) - { - XmlElement xee = xn.OwnerDocument.CreateElement("audit"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "auditid", audit.AuditID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "contentid", audit.ContentID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "imagetype", audit.ImageType.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "filename", audit.FileName)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "data", Convert.ToBase64String(audit.Data))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "config", audit.Config)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", audit.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", audit.UserID)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "deletestatus", audit.DeleteStatus.ToString())); - xe.AppendChild(xee); - } - } - } - } - } - private void ExportImage(ImageInfo ii, string nodename) - { - /* - ContentID - ImageType - FileName - Data - Config - DTS - UserID - */ - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("contentid", ii.ContentID.ToString()); - MyWriter.WriteAttributeString("imagetype", ii.ImageType.ToString()); - MyWriter.WriteAttributeString("filename", ii.FileName); - MyWriter.WriteAttributeString("data", Convert.ToBase64String(ii.Data)); - MyWriter.WriteAttributeString("config", ii.Config); - MyWriter.WriteAttributeString("dts", ii.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", ii.UserID.ToString()); - MyWriter.WriteEndElement(); - } - private void ExportDocument(XmlElement xn, DocumentInfo di, string nodename) - { - /* - DocID - LibTitle - DocContent - DocAscii - Config - DTS - UserID - FileExtension - */ - byte[] buf = di.DocContent; - string libDocTitle = di.LibTitle; - if (DocReplace != null && DocReplace.ContainsKey(di.DocID) && _ConvertROsAndTransitionsToText) - { - buf = DocReplace[di.DocID]; - libDocTitle = null; // unlink the word section from the library document - } - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "docid", di.DocID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "libtitle", libDocTitle)); // di.LibTitle)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "doccontent", Convert.ToBase64String(buf))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "docascii", di.DocAscii)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", di.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", di.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", di.UserID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "fileextension", di.FileExtension)); - //document audits - ExportDocumentAudits(xe, di); - xn.AppendChild(xe); - } - private void ExportDocumentAudits(XmlElement xn, DocumentInfo di) - { - if (cbxExportAudits.Checked) - { - DocumentAuditInfoList audits = DocumentAuditInfoList.Get(di.DocID); - if (audits.Count > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("audits"); - foreach (DocumentAuditInfo audit in audits) - { - if (audit.DeleteStatus == 0) - { - XmlElement xee = xn.OwnerDocument.CreateElement("audit"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "auditid", audit.AuditID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "docid", audit.DocID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "libtitle", audit.LibTitle)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "doccontent",Convert.ToBase64String(audit.DocContent))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "docascii", audit.DocAscii)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "config", audit.Config)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", audit.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", audit.UserID)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "fileextension", audit.FileExtension)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "deletestatus", audit.DeleteStatus.ToString())); - xe.AppendChild(xee); - } - } - } - } - } - private void ExportDocument(DocumentInfo di, string nodename) - { - /* - DocID - LibTitle - DocContent - DocAscii - Config - DTS - UserID - FileExtension - */ - byte[] buf = di.DocContent; - string libDocTitle = di.LibTitle; - if (DocReplace != null && DocReplace.ContainsKey(di.DocID) && _ConvertROsAndTransitionsToText) - { - buf = DocReplace[di.DocID]; - libDocTitle = null; // unlink the word section from the library document - } - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("docid", di.DocID.ToString()); - MyWriter.WriteAttributeString("libtitle", libDocTitle);// di.LibTitle); - MyWriter.WriteAttributeString("doccontent", Convert.ToBase64String(buf)); - MyWriter.WriteAttributeString("docascii", di.DocAscii); - MyWriter.WriteAttributeString("config", di.Config); - MyWriter.WriteAttributeString("dts", di.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", di.UserID.ToString()); - MyWriter.WriteAttributeString("fileextension", di.FileExtension); - MyWriter.WriteEndElement(); - } - private void ExportROUsage(XmlElement xn, RoUsageInfo ri, string nodename) - { - /* - ROUsageID - ContentID - ROID - Config - DTS - UserID - RODbID - */ - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rousageid", ri.ROUsageID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", ri.ContentID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "roid", ri.ROID)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", ri.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ri.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ri.UserID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", ri.RODbID.ToString())); - //rousage audits - ExportROUsageAudits(xe, ri); - xn.AppendChild(xe); - } - private void ExportROUsageAudits(XmlElement xe, RoUsageInfo ri) - { - if (cbxExportAudits.Checked) - { - } - } - private void ExportROUsage(RoUsageInfo ri, string nodename) - { - /* - ROUsageID - ContentID - ROID - Config - DTS - UserID - RODbID - */ - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("rousageid", ri.ROUsageID.ToString()); - MyWriter.WriteAttributeString("contentid", ri.ContentID.ToString()); - MyWriter.WriteAttributeString("roid", ri.ROID); - MyWriter.WriteAttributeString("config", ri.Config); - MyWriter.WriteAttributeString("dts", ri.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", ri.UserID.ToString()); - MyWriter.WriteAttributeString("rodbid", ri.RODbID.ToString()); - MyWriter.WriteEndElement(); - } - private void ExportPart(XmlElement xn, PartInfo pi, string nodename) - { - /* - ContentID - FromType - ItemID - DTS - UserID - */ - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", pi.ContentID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "fromtype", pi.FromType.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "itemid", pi.ItemID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", pi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", pi.UserID.ToString())); - //part audits - ExportPartAudits(xe, pi); - xn.AppendChild(xe); - foreach (ItemInfo ii in pi.MyItems) - ExportItem(xe, ii, pi.PartType.ToString().ToLower()); - } - private void ExportPartAudits(XmlElement xn, PartInfo pi) - { - if (cbxExportAudits.Checked) - { - PartAuditInfoList audits = PartAuditInfoList.Get(pi.ContentID); - if (audits.Count > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("audits"); - foreach (PartAuditInfo audit in audits) - { - if (audit.DeleteStatus == 0) - { - XmlElement xee = xn.OwnerDocument.CreateElement("audit"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "auditid", audit.AuditID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "contentid", audit.ContentID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "fromtype", audit.FromType.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "itemid", audit.ItemID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", audit.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", audit.UserID)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "deletestatus", audit.DeleteStatus.ToString())); - xe.AppendChild(xee); - } - } - } - } - } - private void ExportPart(PartInfo pi, string nodename) - { - /* - ContentID - FromType - ItemID - DTS - UserID - */ - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("contentid", pi.ContentID.ToString()); - MyWriter.WriteAttributeString("fromtype", pi.FromType.ToString()); - MyWriter.WriteAttributeString("itemid", pi.ItemID.ToString()); - MyWriter.WriteAttributeString("dts", pi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", pi.UserID.ToString()); - foreach (ItemInfo ii in pi.MyItems) - ExportItem(ii, pi.PartType.ToString().ToLower()); - MyWriter.WriteEndElement(); - } - private void ExportTransition(XmlElement xn, TransitionInfo ti, string nodename) - { - /* - TransitionID - FromID - ToID - RangeID - IsRange - TranType - Config - DTS - UserID - */ - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "transitionid", ti.TransitionID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "fromid", ti.FromID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "toid", ti.ToID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rangeid", ti.RangeID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "isrange", ti.IsRange.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "trantype", ti.TranType.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", ti.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ti.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ti.UserID.ToString())); - //transition audits - ExportTransitionAudits(xe, ti); - xn.AppendChild(xe); - } - private void ExportTransitionAudits(XmlElement xe, TransitionInfo ti) - { - if (cbxExportAudits.Checked) - { - } - } - private void ExportTransition(TransitionInfo ti, string nodename) - { - /* - TransitionID - FromID - ToID - RangeID - IsRange - TranType - Config - DTS - UserID - */ - string folder = string.Empty; - if (ti.MyItemToID.MyDocVersion != null && ti.MyItemToID.MyDocVersion.MyFolder.Name != MyFolder.Name) - { - nodename = "external" + nodename; - folder = ti.MyItemToID.MyDocVersion.MyFolder.Name; - } - else - { - nodename = "external" + nodename; - folder = "UNKNOWN"; - } - MyWriter.WriteStartElement(nodename); - if (folder != string.Empty) - MyWriter.WriteAttributeString("folder", folder); - MyWriter.WriteAttributeString("transitionid", ti.TransitionID.ToString()); - MyWriter.WriteAttributeString("fromid", ti.FromID.ToString()); - MyWriter.WriteAttributeString("toid", ti.ToID.ToString()); - MyWriter.WriteAttributeString("rangeid", ti.RangeID.ToString()); - MyWriter.WriteAttributeString("isrange", ti.IsRange.ToString()); - MyWriter.WriteAttributeString("trantype", ti.TranType.ToString()); - MyWriter.WriteAttributeString("config", ti.Config); - MyWriter.WriteAttributeString("dts", ti.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", ti.UserID.ToString()); - MyWriter.WriteEndElement(); - } - private void ExportAnnotation(XmlElement xn, AnnotationInfo ai, string nodename) - { - /* - AnnotationID - ItemID - TypeID - RtfText - SearchText - Config - DTS - UserID - */ - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "annotationid", ai.AnnotationID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "itemid", ai.ItemID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "typeid", ai.TypeID.ToString())); - //if(ai.TypeID > 6) - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "typename", ai.MyAnnotationType.Name)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rtftext", ai.RtfText)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "searchtext", ai.SearchText)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", ai.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ai.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ai.UserID.ToString())); - //annotation audits - ExportAnnotationAudits(xe, ai); - xn.AppendChild(xe); - } - private void ExportAnnotationAudits(XmlElement xn, AnnotationInfo ai) - { - if (cbxExportAudits.Checked) - { - AnnotationAuditInfoList audits = AnnotationAuditInfoList.GetByAnnotationID(ai.AnnotationID); - if (audits.Count > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("audits"); - foreach (AnnotationAuditInfo audit in audits) - { - if (audit.DeleteStatus == 0) - { - XmlElement xee = xn.OwnerDocument.CreateElement("audit"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "auditid", audit.AuditID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "annotationid", audit.AnnotationID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "itemid", audit.ItemID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "typeid", audit.TypeID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "rtftext", audit.RtfText)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "searchtext", audit.SearchText)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "config", audit.Config)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "deletestatus", audit.DeleteStatus.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", audit.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", audit.UserID)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "actiondts", audit.ActionWhen.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.AppendChild(xee); - } - } - xn.AppendChild(xe); - } - } - } - private void ExportAnnotation(AnnotationInfo ai, string nodename) - { - /* - AnnotationID - ItemID - TypeID - RtfText - SearchText - Config - DTS - UserID - */ - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("annotationid", ai.AnnotationID.ToString()); - MyWriter.WriteAttributeString("itemid", ai.ItemID.ToString()); - MyWriter.WriteAttributeString("typeid", ai.TypeID.ToString()); - MyWriter.WriteAttributeString("rtftext", ai.RtfText); - MyWriter.WriteAttributeString("searchtext", ai.SearchText); - MyWriter.WriteAttributeString("config", ai.Config); - MyWriter.WriteAttributeString("dts", ai.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", ai.UserID.ToString()); - MyWriter.WriteEndElement(); - } - #endregion - #region Import for Merge - - // jsj 4-29-2016 appears to not be used - //private void AddExternalTransition(XmlReader xr, XmlDocument xd) - //{ - // XmlElement xe = xd.CreateElement("transition"); - // XmlAttribute xa = AddAttribute(xd, "folder", xr.GetAttribute("folder")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "transitionid", xr.GetAttribute("transitionid")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "fromid", xr.GetAttribute("fromid")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "toid", xr.GetAttribute("toid")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "rangeid", xr.GetAttribute("rangeid")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "isrange", xr.GetAttribute("isrange")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "trantype", xr.GetAttribute("trantype")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "config", xr.GetAttribute("config")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "userid", xr.GetAttribute("userid")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "dts", xr.GetAttribute("dts")); - // xe.Attributes.SetNamedItem(xa); - // xd.SelectSingleNode("externaltransitions/transitions").AppendChild(xe); - //} - - // jsj 4-29-2016 appears to not be used - //private void AddTransitions(XmlReader xr) - //{ - // int transitionid = int.Parse(xr.GetAttribute("transitionid")); - // int fromid = int.Parse(xr.GetAttribute("fromid")); - // int toid = int.Parse(xr.GetAttribute("toid")); - // int rangeid = int.Parse(xr.GetAttribute("rangeid")); - // int isrange = int.Parse(xr.GetAttribute("isrange")); - // int trantype = int.Parse(xr.GetAttribute("trantype")); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // string lookfor; - // if (isrange == 0) - // lookfor = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - // else - // lookfor = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - // fromid = Old2NewContent[fromid]; - // toid = Old2NewItem[toid]; - // rangeid = Old2NewItem[rangeid]; - // Content cc = Content.Get(fromid); - // Transition tt = Transition.MakeTransition(cc, Item.Get(toid), Item.Get(rangeid), isrange, trantype, config, dts, userid); - // transitionid = tt.TransitionID; - // string replacewith; - // if (isrange == 0) - // replacewith = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - // else - // replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - // cc.Text = cc.Text.Replace(lookfor, replacewith); - // cc.Save(); - //} - - private void AddTransitions(Content content, XmlNode xn) - { - /* - Content - Item - Item - int - int - string - dts - string - - - #Link:Transition:1 2 187 - type,id,toid - - #Link:TransitionRange:2 1 175 177 - type,id,toid,rangeid - */ - XmlNodeList nl = xn.SelectNodes("./transition"); - foreach (XmlNode nd in nl) - { - int toid = int.Parse(nd.Attributes.GetNamedItem("toid").InnerText); - int rangeid = int.Parse(nd.Attributes.GetNamedItem("rangeid").InnerText); - if (Old2NewItem.ContainsKey(toid) && Old2NewItem.ContainsKey(rangeid)) - { - int transitionid = int.Parse(nd.Attributes.GetNamedItem("transitionid").InnerText); - int isrange = int.Parse(nd.Attributes.GetNamedItem("isrange").InnerText); - int trantype = int.Parse(nd.Attributes.GetNamedItem("trantype").InnerText); - string config = nd.Attributes.GetNamedItem("config").InnerText; - string userid = nd.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - string lookfor; - if (isrange == 0) - lookfor = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - else - lookfor = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - //fromid = content.ContentID; - toid = Old2NewItem[toid]; - rangeid = Old2NewItem[rangeid]; - Transition tt = Transition.MakeTransition(content, Item.Get(toid), Item.Get(rangeid), isrange, trantype, config, dts, userid); - transitionid = tt.TransitionID; - string replacewith; - if (isrange == 0) - replacewith = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - else - replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - content.Text = content.Text.Replace(lookfor, replacewith); - if (content.MyGrid != null && content.MyGrid.Data != "") - content.MyGrid.Data = content.MyGrid.Data.Replace(lookfor, replacewith); - content.FixTransitionText(TransitionInfo.Get(tt.TransitionID)); - // B2017=003 make sure any grid changes are saved. - // done here because FixTransitionText() could update the transitions in the grid - if (content.MyGrid != null && content.MyGrid.Data != "") - content.MyGrid.Save(); - content.Save(); - } - else - { - PendingTransitions.DocumentElement.AppendChild(PendingTransitions.ImportNode(nd, true)); - //save to holding pen - } - } - } - private void AddTransitions() - { - AddTransitions(PendingTransitions); - } - private void AddTransitions(XmlDocument xd) - { - /* - Content - Item - Item - int - int - string - dts - string - - - #Link:Transition:1 2 187 - type,id,toid - - #Link:TransitionRange:2 1 175 177 - type,id,toid,rangeid - */ - XmlNodeList nl = xd.SelectNodes("//transition"); - lblImportStatus.Text = string.Format("Updating {0} Tranistions", nl.Count.ToString()); - foreach (XmlNode nd in nl) - { - int fromid = int.Parse(nd.Attributes.GetNamedItem("fromid").InnerText); - int toid = int.Parse(nd.Attributes.GetNamedItem("toid").InnerText); - int rangeid = int.Parse(nd.Attributes.GetNamedItem("rangeid").InnerText); - int trantype = int.Parse(nd.Attributes.GetNamedItem("trantype").InnerText); - if (Old2NewContent.ContainsKey(fromid)) //transition from new contentid - { - if (Old2NewItem.ContainsKey(toid) && Old2NewItem.ContainsKey(rangeid)) //transition to new itemid (internal) - { - int transitionid = int.Parse(nd.Attributes.GetNamedItem("transitionid").InnerText); - int isrange = int.Parse(nd.Attributes.GetNamedItem("isrange").InnerText); - string config = nd.Attributes.GetNamedItem("config").InnerText; - string userid = nd.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - string lookfor; - if (isrange == 0) - lookfor = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - else - lookfor = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - fromid = Old2NewContent[fromid]; - toid = Old2NewItem[toid]; - rangeid = Old2NewItem[rangeid]; - Content cc = Content.Get(fromid); - Transition tt = Transition.MakeTransition(cc, Item.Get(toid), Item.Get(rangeid), isrange, trantype, config, dts, userid); - transitionid = tt.TransitionID; - string replacewith; - if (isrange == 0) - replacewith = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - else - replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - cc.Text = cc.Text.Replace(lookfor, replacewith); - if (cc.MyGrid != null && cc.MyGrid.Data != "") - cc.MyGrid.Data = cc.MyGrid.Data.Replace(lookfor, replacewith); - bool forceConvertToText = false; - if (TransitionInfo.Get(tt.TransitionID).MyItemToID.ActiveSection != null) - { - SectionConfig sc = TransitionInfo.Get(tt.TransitionID).MyItemToID.ActiveSection.MyConfig as SectionConfig; - forceConvertToText = (sc.SubSection_Edit == "N"); - } - cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText); - // B2017=003 make sure any grid changes are saved. - // done here because FixTransitionText() could update the transitions in the grid - if (cc.MyGrid != null && cc.MyGrid.Data != "") - cc.MyGrid.Save(); - cc.Save(); - nd.InnerText = "done"; - } - else //transition to existing itemid (external) - { - bool forceConvertToText = false; - int transitionid = int.Parse(nd.Attributes.GetNamedItem("transitionid").InnerText); - int isrange = int.Parse(nd.Attributes.GetNamedItem("isrange").InnerText); - string config = nd.Attributes.GetNamedItem("config").InnerText; - string userid = nd.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - string lookfor; - if (isrange == 0) - lookfor = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - else - lookfor = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - fromid = Old2NewContent[fromid]; - Content cc = Content.Get(fromid); - Transition tt = Transition.MakeTransition(cc, Item.Get(toid), Item.Get(rangeid), isrange, trantype, config, dts, userid); - if (tt.TransitionID < 0) - { - forceConvertToText = true; - cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText); - cc.Save(); - nd.InnerText = "done"; - } - else - { - transitionid = tt.TransitionID; - string replacewith; - if (isrange == 0) - replacewith = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - else - replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - cc.Text = cc.Text.Replace(lookfor, replacewith); - if (cc.MyGrid != null && cc.MyGrid.Data != "") - cc.MyGrid.Data = cc.MyGrid.Data.Replace(lookfor, replacewith); - if (TransitionInfo.Get(tt.TransitionID).MyItemToID.ActiveSection != null) - { - SectionConfig sc = TransitionInfo.Get(tt.TransitionID).MyItemToID.ActiveSection.MyConfig as SectionConfig; - forceConvertToText = (sc.SubSection_Edit == "N"); - } - // B2016-176, B2016197 - external transitions should be convert to text - forceConvertToText = true; - //if (!forceConvertToText) //check to see if external with internal format - //{ - // TransitionInfo tran = TransitionInfo.Get(transitionid); - // if (tran.MyContent.ContentItems[0].MyProcedure.ItemID != tran.MyItemToID.MyProcedure.ItemID) - // if (!tran.MyContent.ContentItems[0].ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[tran.TranType].TransMenu.Contains("Proc")) - // forceConvertToText = true; - //} - //if (!forceConvertToText) //check to see if external to different doc version - //{ - // TransitionInfo tran = TransitionInfo.Get(transitionid); - // if (tran.MyContent.ContentItems[0].MyDocVersion.VersionID != tran.MyItemToID.MyDocVersion.VersionID) - // forceConvertToText = true; - //} - cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText); - // B2017=003 make sure any grid changes are saved. - // done here because FixTransitionText() could update the transitions in the grid - if (cc.MyGrid != null && cc.MyGrid.Data != "") - cc.MyGrid.Save(); - cc.Save(); - nd.InnerText = "done"; - _DidConvertTransitionsToText |= forceConvertToText; // B2016-225 - notify user when transitions are converted to text - } - } - } - } - } - - private Dictionary Old2NewItem; - private Dictionary Old2NewContent; - private Dictionary Old2NewLibDoc; - private XmlDocument PendingTransitions; - private RODb MyRODb = null; - - // jsj 4-29-2016 appears to not be used - //private Folder AddFolder(Folder folder, XmlReader xr) - //{ - // Old2NewItem = new Dictionary(); - // Old2NewContent = new Dictionary(); - // Old2NewLibDoc = new Dictionary(); - // string title = xr.GetAttribute("title"); - // string name = xr.GetAttribute("name"); - // string shortname = xr.GetAttribute("shortname"); - // string usrid = xr.GetAttribute("usrid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // string formatid = xr.GetAttribute("formatid"); - // string formatfilename = xr.GetAttribute("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - // Format format = formatid == string.Empty ? null : OldToNewFormat(int.Parse(formatid),formatfilename); - // folder = Folder.MakeFolder(folder, folder.MyConnection, name, title, shortname, format, null, dts, usrid); - // //f.Save(); - // return folder; - //} - - private Folder AddFolder(Folder p, XmlDocument xd) - { - lblImportStatus.Text = "Creating Folder..."; - Application.DoEvents(); - string title = xd.DocumentElement.Attributes.GetNamedItem("title").InnerText; - string name = xd.DocumentElement.Attributes.GetNamedItem("name").InnerText; - string shortname = xd.DocumentElement.Attributes.GetNamedItem("shortname").InnerText; - string usrid = xd.DocumentElement.Attributes.GetNamedItem("usrid").InnerText; - DateTime dts = DateTime.Parse(xd.DocumentElement.Attributes.GetNamedItem("dts").InnerText); - string formatid = xd.DocumentElement.Attributes.GetNamedItem("formatid").InnerText; - XmlNode fnNode = xd.DocumentElement.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - Format format = formatid == string.Empty ? null : OldToNewFormat(int.Parse(formatid),formatfilename); - if (Folder.GetByParentID_Name(p.FolderID, name) != null) - return null; - Folder f = Folder.MakeFolder(p, p.MyConnection, name, title, shortname, format, null, dts, usrid); - return f; - } - private Format OldToNewFormat(int formatID, string formatFileName) - { - try - { - string formatName = formatFileName; // B2016-103, new export files include the format filename use that if it exists - if (formatFileName == string.Empty) - { - if (formatID >= oldFormat.Count) return null; // formatID not found, use default file name - formatName = oldFormat[formatID]; // for backwards compatibility with older export files - } - formatID = newFormat[formatName]; - return Format.Get(formatID); - } - catch - { - return null; // format not found return null to use default format - } - } - private DocVersion AddDocVersion(Folder f, XmlReader xr) - { - int versiontype = int.Parse(xr.GetAttribute("versiontype")); - string name = xr.GetAttribute("name"); - string config = xr.GetAttribute("config"); - string userid = xr.GetAttribute("userid"); - DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - string formatid = xr.GetAttribute("formatid"); - string formatfilename = xr.GetAttribute("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - Format format = formatid == string.Empty ? null : OldToNewFormat(int.Parse(formatid),formatfilename); - DocVersion dv = DocVersion.MakeDocVersion(f, versiontype, name, null, null, format, config, dts, userid); - return dv; - } - private void AddAnnotationTypes(XmlDocument xd) - { - XmlNodeList nl = xd.SelectNodes("folder/annotationtypes/annotationtype"); - foreach (XmlNode nd in nl) - { - AnnotationTypeInfo ati = AnnotationTypeInfo.GetByName(nd.Attributes.GetNamedItem("name").InnerText); - if (ati == null) - AnnotationType.MakeAnnotationType(nd.Attributes.GetNamedItem("name").InnerText, nd.Attributes.GetNamedItem("config").InnerText, DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText), nd.Attributes.GetNamedItem("userid").InnerText); - } - } - private DocVersionInfo AddDocVersion(Folder f, XmlDocument xd) - { - lblImportStatus.Text = "Creating DocVersion..."; - Application.DoEvents(); - XmlElement xe = (XmlElement)xd.SelectSingleNode("folder/docversion"); - int versiontype = int.Parse(xe.Attributes.GetNamedItem("versiontype").InnerText); - string name = xe.Attributes.GetNamedItem("name").InnerText; - string config = xe.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - string userid = xe.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xe.Attributes.GetNamedItem("dts").InnerText); - string formatid = xe.Attributes.GetNamedItem("formatid").InnerText; - XmlNode fnNode = xe.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - Format format = formatid == string.Empty ? null : OldToNewFormat(int.Parse(formatid),formatfilename); - DocVersion dv = DocVersion.MakeDocVersion(f, versiontype, name, null, null, format, config, dts, userid); - XmlNode xassoc = xe.SelectSingleNode("association"); - if (xassoc != null) - { - XmlNode xrofst = xassoc.SelectSingleNode("rofst"); - XmlNode xrodb = xrofst.SelectSingleNode("rodb"); - MyRODb = AddRODb(xrodb); - ROFst rofst = AddROFst(xrofst); - DocVersionAssociation dva = dv.DocVersionAssociations.Add(rofst); - dv.Save(); - } - return DocVersionInfo.Get(dv.VersionID); - } - - // jsj 4-29-2016 appears to not be used - //private Dictionary GetROFstData(XmlReader xr) - //{ - // Dictionary rv = new Dictionary(); - // rv.Add("rolookup", xr.GetAttribute("rolookup")); - // rv.Add("config", xr.GetAttribute("config")); - // rv.Add("userid", xr.GetAttribute("userid")); - // rv.Add("dts", xr.GetAttribute("dts")); - // return rv; - //} - - // jsj 4-29-2016 appears to not be used - //private ROFst AddROFst(Dictionary dic) - //{ - // byte[] rolookup = Convert.FromBase64String(dic["rolookup"]); - // string config = dic["config"]; - // string userid = dic["userid"]; - // DateTime dts = DateTime.Parse(dic["dts"]); - // ROFst rv = null; - // rv = ROFst.GetByRODbID_DTS(MyRODb.RODbID, dts); //MyRODb.DTS); - // if (rv == null) - // rv = ROFst.MakeROFst(MyRODb, rolookup, config, dts, userid); - // return rv; - //} - - private ROFst AddROFst(XmlNode xrofst) - { - lblImportStatus.Text = "Creating ROFst..."; - Application.DoEvents(); - byte[] rolookup = Convert.FromBase64String(xrofst.Attributes.GetNamedItem("rolookup").InnerText); - string config = xrofst.Attributes.GetNamedItem("config").InnerText; - string userid = xrofst.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xrofst.Attributes.GetNamedItem("dts").InnerText); - ROFst rv = null; - rv = ROFst.GetByRODbID_DTS(MyRODb.RODbID, dts); - // if the RO database is not found in the current data (does not have the same RODBid nor date/time stamp - // then spin through the list of RO databases and compare the FST information. - // If the RO FST information is the same, then use that current RO database when importing - if (rv == null) - { - RODbInfoList rodblst = RODbInfoList.Get(); - foreach (RODbInfo roinfo in rodblst) - { - rv = ROFst.GetByRODbID_DTS(roinfo.RODbID, dts); - if (rv != null && Same(rv.ROLookup,rolookup)) return rv; - } - rv = ROFst.MakeROFst(MyRODb, rolookup, config, dts, userid); - XmlNode xfigures = xrofst.SelectSingleNode("figures"); - if (xfigures != null) - AddFigures(xfigures, rv); - } - return rv; - } - - private bool Same(byte[] p, byte[] rolookup) - { - if (p.Length != rolookup.Length) return false; - for (int i = 0; i < p.Length; i++) - if (p[i] != rolookup[i]) return false; - return true; - } - - private void AddFigures(XmlNode xfigures, ROFst rofst) - { - foreach (XmlNode nd in xfigures.SelectNodes("figure")) - { - XmlNode image = nd.SelectSingleNode("image"); - int imageid = int.Parse(image.Attributes.GetNamedItem("imageid").InnerText); - ROImage roimage = ROImage.Get(imageid); - string config; - DateTime dts; - string userid; - if (roimage == null) - { - string filename = image.Attributes.GetNamedItem("filename").InnerText; - byte[] content = Convert.FromBase64String(image.Attributes.GetNamedItem("content").InnerText); - config = image.Attributes.GetNamedItem("config").InnerText; - dts = DateTime.Parse(image.Attributes.GetNamedItem("dts").InnerText); - userid = image.Attributes.GetNamedItem("userid").InnerText; - roimage = ROImage.MakeROImage(MyRODb, filename, content, config, dts, userid); - } - config = nd.Attributes.GetNamedItem("config").InnerText; - dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - userid = nd.Attributes.GetNamedItem("userid").InnerText; - Figure fig = Figure.MakeFigure(rofst, roimage, config, dts, userid); - } - } - - // jsj 4-29-2016 appears to not be used - //private RODb AddRODb(XmlReader xr) - //{ - // oldRODbID = int.Parse(xr.GetAttribute("rodbid")); - // string roname = xr.GetAttribute("roname"); - // string folderpath = xr.GetAttribute("folderpath"); - // string dbconnectionstring = xr.GetAttribute("dbconnectionstring"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // RODb rv = null; - // rv = RODb.GetByFolderPath(folderpath); - // if (rv == null) - // rv = RODb.MakeRODb(roname, folderpath, dbconnectionstring, config, dts, userid); - // newRODbID = rv.RODbID; - // return rv; - //} - - private RODb AddRODb(XmlNode xrodb) - { - lblImportStatus.Text = "Creating RODb..."; - Application.DoEvents(); - oldRODbID = int.Parse(xrodb.Attributes.GetNamedItem("rodbid").InnerText); - string roname = xrodb.Attributes.GetNamedItem("roname").InnerText; - string folderpath = xrodb.Attributes.GetNamedItem("folderpath").InnerText; - string dbconnectionstring = xrodb.Attributes.GetNamedItem("dbconnectionstring").InnerText; - string config = xrodb.Attributes.GetNamedItem("config").InnerText; - string userid = xrodb.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xrodb.Attributes.GetNamedItem("dts").InnerText); - RODb rv = null; - rv = RODb.GetByFolderPath(folderpath); - if (rv == null) - { - // create a list of the RO databases currently in the database - List roDbNameList = new List(); - RODbInfoList rolist = RODbInfoList.Get(); - foreach (RODbInfo rodbinfo in rolist) - { - if (!roDbNameList.Contains(rodbinfo.ROName)) - roDbNameList.Add(rodbinfo.ROName); - } - rolist.Dispose(); - int cnt = 0; - string roNameNew = roname; - // if the ROname we are importing is the same as one already in the database - // and the ROpaths are different, then rename the one we are importing - while (roDbNameList.Contains(roNameNew)) - roNameNew = string.Format("{0}_{1}",roname,(++cnt).ToString()); - rv = RODb.MakeRODb(roNameNew, folderpath, dbconnectionstring, config, dts, userid); - } - newRODbID = rv.RODbID; - return rv; - } - - // jsj 4-29-2016 appears to not be used - //private int GetProcedureData(XmlReader xr) - //{ - // return int.Parse(xr.GetAttribute("itemid")); - //} - - // jsj 4-29-2016 appears to not be used - //private ItemInfo AddProcedure(XmlReader xr, DocVersion dv, ItemInfo procInfo, int oldid) - //{ - // DocVersionInfo dvInfo = DocVersionInfo.Get(dv.VersionID); - // string number = xr.GetAttribute("number"); - // string text = xr.GetAttribute("text"); - // int proctype = int.Parse(xr.GetAttribute("type")); - // string formatid = xr.GetAttribute("formatid"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Procedure p = Procedure.MakeProcedure(dvInfo, procInfo, number, text, proctype); - // p.DTS = dts; - // p.UserID = userid; - // string formatfilename = xr.GetAttribute("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - // if (formatid != string.Empty) - // p.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid),formatfilename); - // p.MyContent.Config = config; - // p.MyContent.DTS = dts; - // p.MyContent.UserID = userid; - // p.Save(); - // Old2NewItem.Add(oldid, p.ItemID); - // Old2NewContent.Add(int.Parse(xr.GetAttribute("contentid")), p.MyContent.ContentID); - // procInfo = ProcedureInfo.Get(p.ItemID); - // return procInfo; - //} - private ProcedureInfo AddProcedure(XmlNode xn, DocVersionInfo dvInfo, ProcedureInfo procInfo) - { - pbImportProcedure.PerformStep(); - lblImportProcedure.Text = string.Format("{0} of {1} Procedures", pbImportProcedure.Value.ToString(), pbImportProcedure.Maximum.ToString()); - TimeSpan elapsed = DateTime.Now.Subtract(MyStart); - lblImportTime.Text = "Elapsed Time: " + elapsed.ToString(); - Application.DoEvents(); - XmlNode xc = xn.SelectSingleNode("content"); - string number = xc.Attributes.GetNamedItem("number").InnerText; - string text = xc.Attributes.GetNamedItem("text").InnerText; - int proctype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); - string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; - string config = xc.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - string userid = xc.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); - Procedure p = Procedure.MakeProcedure(dvInfo, procInfo, number, text, proctype); - p.DTS = dts; - p.UserID = userid; - // check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute) - XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode !=null)? fnNode.InnerText : ""; - if (formatid != string.Empty) - p.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid),formatfilename); - p.MyContent.Config = config; - p.MyContent.DTS = dts; - p.MyContent.UserID = userid; - p.Save(); - if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText))) - Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), p.ItemID); - else - Old2NewItem[int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText)] = p.ItemID; // B2016-176, B2016-197 refresh saved ItemId with current ItemID - if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText))) - Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), p.MyContent.ContentID); - else - Old2NewContent[int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText)] = p.MyContent.ContentID; // B2016-176, B2016-197 refresh saved ContentID with current ContentID - if (xn.SelectNodes("annotation").Count > 0) - AddAnnotations(p.ItemID, xn); - if (xc.SelectNodes("rousage").Count > 0) - AddROUsages(p.MyContent, xc); - if (xc.SelectNodes("transition").Count > 0) - AddTransitions(p.MyContent, xc); - procInfo = ProcedureInfo.Get(p.ItemID); - if (xc.HasChildNodes) - AddParts(xc, procInfo); - FixSectionStart(procInfo); - return procInfo; - } - // jsj 2016Feb16 - This appears to not be used - //private void AddROUsage(XmlReader xr) - //{ - // int contentid = int.Parse(xr.GetAttribute("contentid")); - // contentid = Old2NewContent[contentid]; - // Content content = Content.Get(contentid); - // string rousageid = xr.GetAttribute("rousageid"); - // string roid = xr.GetAttribute("roid"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // RoUsage rou = RoUsage.MakeRoUsage(content, roid, config, dts, userid, MyRODb); - // rou.Save(); - // string lookFor = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rousageid, roid, oldRODbID.ToString()); - // string replaceWith = (cbxCvrtROsToText.Checked) ? "" : string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rou.ROUsageID.ToString(), roid, newRODbID.ToString()); - // if (lookFor != replaceWith) - // { - // content.Text = content.Text.Replace(lookFor, replaceWith); - // content.Save(); - // } - //} - private string GetMyPrefix(string text, int start, int lastIndex) - { - string defPrefix = text.Substring(start - 3, 3); - if (defPrefix != @"\v ") throw new Exception(string.Format("rtf string {0} does not match expected format", defPrefix)); - string txt = text.Substring(lastIndex, start - lastIndex - 3); - int lastSlash = txt.LastIndexOf(@"\"); - int lastSpace = txt.LastIndexOf(" "); - int lastCR = txt.LastIndexOf("\r"); - if (lastSpace < lastCR) - lastSpace = lastCR; - if (lastSlash <= lastSpace) //this will return "\v " - return defPrefix; - txt = txt.Substring(lastSlash); - if (txt.StartsWith(@"\'")) //this is a hex - return defPrefix; - if (Regex.IsMatch(txt, @"\\u[0-9].*")) //this is unicode - return defPrefix; - return @"\v"; - } - private string GetMySuffix(string text, int start) - { - string txt = text.Substring(start); - int firstSlashVeeZero = txt.IndexOf(@"\v0"); - if (firstSlashVeeZero == 0 && txt.Length > 3 && txt[3] == ' ') //"\v0 " - return text.Substring(start, 4); - return text.Substring(start, firstSlashVeeZero + 3); //everything upto \v0" - } - private void ConvertImportProcedureROsToText(Content content, XmlNode xn) - { - foreach (XmlNode nd in xn.SelectNodes("rousage")) - { - string rousageid = nd.Attributes.GetNamedItem("rousageid").InnerText; - string roid = nd.Attributes.GetNamedItem("roid").InnerText; - - string findLink = @""; - MatchCollection ms = Regex.Matches(content.Text, findLink); - string lookFor = string.Format(@"^$", rousageid); - int lastIndex = 0; - string newText = content.Text; - foreach (Match mm in ms) - { - int offset = mm.Index; - Match m = Regex.Match(mm.Value, lookFor, RegexOptions.Singleline); - if (m != null && m.Groups.Count > 1) - { - string prefix = GetMyPrefix(content.Text, mm.Index, lastIndex); - string suffix = GetMySuffix(content.Text, mm.Index + mm.Length); - int myIndex = m.Groups[4].Index + mm.Index; - int myLength = m.Groups[4].Length; - if (m.Groups[3].Value != " ") - { - myIndex = m.Groups[3].Index + mm.Index; - myLength += m.Groups[3].Length; - } - string gg = newText.Substring(myIndex, myLength); - gg = gg.Replace("{", @"\{").Replace("}", @"\}"); - string part1 = newText.Substring(0, mm.Index); - string part2 = gg; - string part3 = newText.Substring(mm.Index + mm.Length); - //modify part1 based on prefix - if (prefix == @"\v ") - part1 = part1.Substring(0, part1.Length - 3); - else - part1 = part1.Substring(0, part1.Length - 3) + " "; - //modify part3 based on suffix - if (suffix == @"\v0 ") - part3 = part3.Substring(4); - else - part3 = suffix.Replace(@"\v0", "") + part3.Substring(suffix.Length); - content.Text = part1 + part2 + part3; - ROToTextAnnotation(content, part2); // B2016-225 (follow through) add annotation when RO is converted to text - } - lastIndex = mm.Index + mm.Length; - } - } - content.Save(); - } - - // B2016-225 (follow through) add annotation when RO is converted to text - private void ROToTextAnnotation(Content content, string txtRO) - { - // replace unicode symbols to DOS code symbols - txtRO = txtRO.Replace(@"\u8209?", "-"); // dash - txtRO = txtRO.Replace(@"\u9586?", @"\\"); // backslash - txtRO = txtRO.Replace(@"\'b0", "\xb0"); //degree - txtRO = txtRO.Replace(@"\u160?"," "); //hard space - txtRO = txtRO.Replace(@"\u916?", "\x7F"); // delta - txtRO = txtRO.Replace(@"\u8805?", "\xF2"); //greater than or equal - txtRO = txtRO.Replace(@"\u8804?", "\xF3"); // less than or equal - txtRO = txtRO.Replace(@"\u931?", "\xE4"); // sigma - txtRO = txtRO.Replace(@"\u947?", "\xE7"); // gamma - txtRO = txtRO.Replace(@"\u9604?", "\xFE"); // accum 2584 - txtRO = txtRO.Replace(@"\u9679?", "\x7"); // bullet 25CF - txtRO = txtRO.Replace(@"\u8776?", "\xF7"); // approx eq - txtRO = txtRO.Replace(@"\u8773?", "\xF0"); // similar eq 2245 - txtRO = txtRO.Replace(@"\u8730?", "\xFB"); // square root - txtRO = txtRO.Replace(@"\u961?", "\xE2"); // rho 3C1 - txtRO = txtRO.Replace(@"\u960?", "\xE3"); // pi - txtRO = txtRO.Replace(@"\u956?", "\xE6"); // micro - txtRO = txtRO.Replace(@"\u948?", "\xEB"); // lower case delta - txtRO = txtRO.Replace(@"\u963?", "\xE5"); // lower case sigma - txtRO = txtRO.Replace(@"\u274?", "\x90"); // energy, 112 - txtRO = txtRO.Replace(@"\u949?", "\xEE"); // epsilon - txtRO = txtRO.Replace(@"\u952?", "\xE9"); // theta, 3B8 - txtRO = txtRO.Replace(@"\u8857?", "\xEC"); // dot in oval, 2299 - txtRO = txtRO.Replace(@"\u964?", "\xA8"); // tau, 3C4 - txtRO = txtRO.Replace(@"\u9830?", "\xA9"); // diamond, 2666 - txtRO = txtRO.Replace(@"\u8593?", "\x18"); // Up Arrow - changes to \xff - txtRO = txtRO.Replace(@"\u8595?", "\x19"); // Down Arrow - changes to \xd6 - - Item myitem = content.ContentItems[0].MyItem; // The Using statement caused the content.text to disappear - //using (Item myitem = content.ContentItems[0].MyItem) // so that myitem does not stay in cache - //{ - Annotation.MakeAnnotation(myitem, AnnotationType.GetByNameOrCreate("Link Converted To Text"), "", string.Format("RO value ({0}) converted to text", txtRO), null); - //} - _DidConvertROsToText |= true; - } - private void AddROUsages(Content content, XmlNode xn) - { - AddROUsages(content, xn, false); - } - // part of bug fix B2017-060 added the isGrid parameter - private void AddROUsages(Content content, XmlNode xn, bool isGrid) - { - if (_ConvertROsToTextDuringImport) - ConvertImportProcedureROsToText(content, xn); - else - { - foreach (XmlNode nd in xn.SelectNodes("rousage")) - { - string rousageid = nd.Attributes.GetNamedItem("rousageid").InnerText; - string roid = nd.Attributes.GetNamedItem("roid").InnerText; - string config = nd.Attributes.GetNamedItem("config").InnerText; - string userid = nd.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - if (MyDocVersion.DocVersionAssociations == null) - MyDocVersion.RefreshDocVersionAssociations(); - ROFSTLookup lookup = MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(MyDocVersion); - string roval = lookup.GetRoValue(roid); - if (roval == "?") - { - RoUsageInfo roui = RoUsageInfo.Get(int.Parse(rousageid)); - content.FixContentText(roui, roval, 0, MyDocVersion.DocVersionAssociations[0].MyROFst, null, rousageid); // + " " + roid); - _DidConvertROsToText |= true; // B2016-225 (follow through) add annotation when RO is converted to text - } - else - { - RoUsage rou = RoUsage.MakeRoUsage(content, roid, config, dts, userid, MyRODb); - rou.Save(); - RoUsageInfo roui = RoUsageInfo.Get(rou.ROUsageID); - string lookFor = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rousageid, roid, oldRODbID.ToString()); - string replaceWith = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rou.ROUsageID.ToString(), roid, newRODbID.ToString()); - if (lookFor != replaceWith) - { - content.Text = content.Text.Replace(lookFor, replaceWith); - content.FixContentText(roui, roval, 0, MyDocVersion.DocVersionAssociations[0].MyROFst); - } - if (isGrid) // B2017-060 when importing a grid, also update the grid's xml defination - { - string glookFor = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rousageid, roid, oldRODbID.ToString()); - string greplaceWith = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rou.ROUsageID.ToString(), roid, newRODbID.ToString()); - if (glookFor != greplaceWith) - { - content.MyGrid.Data = content.MyGrid.Data.Replace(glookFor, greplaceWith); - } - } - } - } - content.Save(); - if (isGrid) - GridInfo.Refresh(content.MyGrid); // force the updated grid (table) to refresh - } - } - - // jsj 4-29-2016 appears to not be used - //private void AddAnnotation(XmlReader xr) - //{ - // int itemid = int.Parse(xr.GetAttribute("itemid")); - // itemid = Old2NewItem[itemid]; - // Item itm = Item.Get(itemid); - // int typeid = int.Parse(xr.GetAttribute("typeid")); - // string rtftext = xr.GetAttribute("rtftext"); - // string searchtext = xr.GetAttribute("searchtext"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Annotation ann = Annotation.MakeAnnotation(itm, AnnotationType.Get(typeid), rtftext, searchtext, config, dts, userid); - //} - private void AddImage(Content content, XmlNode xc) - { - XmlNode xn = xc.SelectSingleNode("image"); - int imagetype = int.Parse(xn.Attributes.GetNamedItem("imagetype").InnerText); - string filename = xn.Attributes.GetNamedItem("filename").InnerText; - byte[] data = Convert.FromBase64String(xn.Attributes.GetNamedItem("data").InnerText); - string config = xn.Attributes.GetNamedItem("config").InnerText; - string userid = xn.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xn.Attributes.GetNamedItem("dts").InnerText); - VEPROMS.CSLA.Library.Image img = VEPROMS.CSLA.Library.Image.MakeImage(content, imagetype, filename, data, config, dts, userid); - img.Save(); - } - private void AddAnnotations(int itemID, XmlNode xn) - { - Item itm = Item.Get(itemID); - foreach (XmlNode nd in xn.SelectNodes("annotation")) - { - int typeid = int.Parse(nd.Attributes.GetNamedItem("typeid").InnerText); - string rtftext = nd.Attributes.GetNamedItem("rtftext").InnerText; - string searchtext = nd.Attributes.GetNamedItem("searchtext").InnerText; - string config = nd.Attributes.GetNamedItem("config").InnerText; - string userid = nd.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - AnnotationType annType = AnnotationType.GetByNameOrCreate(nd.Attributes.GetNamedItem("typename").InnerText); - Annotation ann = Annotation.MakeAnnotation(itm, annType, rtftext, searchtext, config, dts, userid); - ann.Save(); - } - } - private void AddParts(XmlNode myNode, ItemInfo parentInfo) - { - foreach (XmlNode xn in myNode.ChildNodes) - { - switch (xn.Name) - { - case "sections": - AddSections(xn, parentInfo); - break; - case "cautions": - AddCautions(xn, parentInfo); - break; - case "notes": - AddNotes(xn, parentInfo); - break; - case "rnos": - AddRNOs(xn, parentInfo); - break; - case "steps": - AddSteps(xn, parentInfo); - break; - case "supinfos": - AddSupInfos(xn, parentInfo); - break; - case "tables": - AddTables(xn, parentInfo); - break; - case "entry": // this is word section max out the status bar - lblImportStep.Text = "Word Section Data"; - pbImportStep.Maximum = 1; - pbImportStep.PerformStep(); - break; - default: - break; - } - } - } - private void AddTables(XmlNode xn, ItemInfo parentInfo) - { - if (parentInfo.IsProcedure) - { - pbImportSection.Value = 0; - pbImportStep.Value = 0; - pbImportSection.Maximum = xn.ChildNodes.Count; - } - if (parentInfo.IsSection) - { - pbImportStep.Value = 0; - pbImportStep.Maximum = xn.ChildNodes.Count; - } - ItemInfo prevInfo = null; - foreach (XmlNode nd in xn.ChildNodes) - prevInfo = AddTable(nd, parentInfo, prevInfo); - } - // jsj 2016Feb16 - This appears to not be used - //private ItemInfo AddTable(XmlReader xr, ItemInfo parentInfo, ItemInfo prevInfo, int oldid) - //{ - // string number = xr.GetAttribute("number"); - // string text = xr.GetAttribute("text"); - // int steptype = int.Parse(xr.GetAttribute("type")); - // string formatid = xr.GetAttribute("formatid"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Step step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Table); - // step.DTS = dts; - // step.UserID = userid; - // if (formatid != string.Empty) - // step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid)); - // step.MyContent.Config = config; - // step.MyContent.DTS = dts; - // step.MyContent.UserID = userid; - // step.Save(); - // Old2NewItem.Add(oldid, step.ItemID); - // Old2NewContent.Add(int.Parse(xr.GetAttribute("contentid")), step.MyContent.ContentID); - // prevInfo = StepInfo.Get(step.ItemID); - // return prevInfo; - //} - private ItemInfo AddTable(XmlNode xn, ItemInfo parentInfo, ItemInfo prevInfo) - { - pbImportStep.PerformStep(); - lblImportStep.Text = string.Format("{0} of {1} Steps", pbImportStep.Value.ToString(), pbImportStep.Maximum.ToString()); - Application.DoEvents(); - XmlNode xc = xn.SelectSingleNode("content"); - Step step; - string number = xc.Attributes.GetNamedItem("number").InnerText; - string text = xc.Attributes.GetNamedItem("text").InnerText; - int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); - string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; - string config = xc.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); - CheckForFloatingFoldout(contentid, config); - string userid = xc.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); - using (step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Table)) - { - step.DTS = dts; - step.UserID = userid; - // check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute) - XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - if (formatid != string.Empty) - step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - step.MyContent.Config = config; - step.MyContent.DTS = dts; - step.MyContent.UserID = userid; - step.Save(); - if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText))) - Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), step.ItemID); - else - Old2NewItem[int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText)] = step.ItemID; // B2016-176, B2016-197 refresh saved ItemId with current ItemID - if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText))) - Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), step.MyContent.ContentID); - else - Old2NewContent[int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText)] = step.MyContent.ContentID; // B2016-176, B2016-197 refresh saved ContentID with current ContentID - if (xc.SelectNodes("grid").Count > 0) - AddGrid(step.MyContent, xc); - if (xc.SelectNodes("image").Count > 0) - AddImage(step.MyContent, xc); - if (xn.SelectNodes("annotation").Count > 0) - AddAnnotations(step.ItemID, xn); - if (xc.SelectNodes("rousage").Count > 0) - AddROUsages(step.MyContent, xc, true); // part of bug fix: B2017060 to properly convert invalid RO to text - if (xc.SelectNodes("transition").Count > 0) - AddTransitions(step.MyContent, xc); - prevInfo = StepInfo.Get(step.ItemID); - if (xc.HasChildNodes) - AddParts(xc, prevInfo); - } - return prevInfo; - } - private void AddSteps(XmlNode xn, ItemInfo parentInfo) - { - if (parentInfo.IsProcedure) - { - pbImportSection.Value = 0; - pbImportStep.Value = 0; - pbImportSection.Maximum = xn.ChildNodes.Count; - } - if (parentInfo.IsSection) - { - pbImportStep.Value = 0; - pbImportStep.Maximum = xn.ChildNodes.Count; - } - ItemInfo prevInfo = null; - foreach (XmlNode nd in xn.ChildNodes) - prevInfo = AddStep(nd, parentInfo, prevInfo); - } - - // jsj 4-29-2016 appears to not be used - //private ItemInfo AddStep(XmlReader xr, ItemInfo parentInfo, ItemInfo prevInfo, int oldid) - //{ - // string number = xr.GetAttribute("number"); - // string text = xr.GetAttribute("text"); - // int steptype = int.Parse(xr.GetAttribute("type")); - // string formatid = xr.GetAttribute("formatid"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Step step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Step); - // step.DTS = dts; - // step.UserID = userid; - // string formatfilename = xr.GetAttribute("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - // if (formatid != string.Empty) - // step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid),formatfilename); - // step.MyContent.Config = config; - // step.MyContent.DTS = dts; - // step.MyContent.UserID = userid; - // step.Save(); - // Old2NewItem.Add(oldid, step.ItemID); - // Old2NewContent.Add(int.Parse(xr.GetAttribute("contentid")), step.MyContent.ContentID); - // prevInfo = StepInfo.Get(step.ItemID); - // return prevInfo; - //} - private ItemInfo AddStep(XmlNode xn, ItemInfo parentInfo, ItemInfo prevInfo) - { - pbImportStep.PerformStep(); - lblImportStep.Text = string.Format("{0} of {1} Steps", pbImportStep.Value.ToString(), pbImportStep.Maximum.ToString()); - Application.DoEvents(); - XmlNode xc = xn.SelectSingleNode("content"); - Step step; - string number = xc.Attributes.GetNamedItem("number").InnerText; - string text = xc.Attributes.GetNamedItem("text").InnerText; - int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); - string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; - string config = xc.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); - CheckForFloatingFoldout(contentid, config); - string userid = xc.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); - using (step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Step)) - { - step.DTS = dts; - step.UserID = userid; - // check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute) - XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - if (formatid != string.Empty) - step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - step.MyContent.Config = config; - step.MyContent.DTS = dts; - step.MyContent.UserID = userid; - step.Save(); - if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText))) - Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), step.ItemID); - else - Old2NewItem[int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText)] = step.ItemID; // B2016-176, B2016-197 refresh saved ItemId with current ItemID - if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText))) - Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), step.MyContent.ContentID); - else - Old2NewContent[int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText)] = step.MyContent.ContentID; // B2016-176, B2016-197 refresh saved ContentID with current ContentID - if (xn.SelectNodes("annotation").Count > 0) - AddAnnotations(step.ItemID, xn); - if (xc.SelectNodes("rousage").Count > 0) - AddROUsages(step.MyContent, xc); - if (xc.SelectNodes("transition").Count > 0) - AddTransitions(step.MyContent, xc); - prevInfo = StepInfo.Get(step.ItemID); - if (xc.HasChildNodes) - AddParts(xc, prevInfo); - } - return prevInfo; - } - private void AddRNOs(XmlNode xn, ItemInfo parentInfo) - { - if (parentInfo.IsProcedure) - { - pbImportSection.Value = 0; - pbImportStep.Value = 0; - pbImportSection.Maximum = xn.ChildNodes.Count; - } - if (parentInfo.IsSection) - { - pbImportStep.Value = 0; - pbImportStep.Maximum = xn.ChildNodes.Count; - } - ItemInfo prevInfo = null; - foreach (XmlNode nd in xn.ChildNodes) - prevInfo = AddRNO(nd, parentInfo, prevInfo); - } - private void AddSupInfos(XmlNode xn, ItemInfo parentInfo) - { - if (parentInfo.IsProcedure) - { - pbImportSection.Value = 0; - pbImportStep.Value = 0; - pbImportSection.Maximum = xn.ChildNodes.Count; - } - if (parentInfo.IsSection) - { - pbImportStep.Value = 0; - pbImportStep.Maximum = xn.ChildNodes.Count; - } - ItemInfo prevInfo = null; - foreach (XmlNode nd in xn.ChildNodes) - prevInfo = AddSupInfo(nd, parentInfo, prevInfo); - } - // jsj 4-29-2016 appears to not be used - //private ItemInfo AddRNO(XmlReader xr, ItemInfo parentInfo, ItemInfo prevInfo, int oldid) - //{ - // string number = xr.GetAttribute("number"); - // string text = xr.GetAttribute("text"); - // int steptype = int.Parse(xr.GetAttribute("type")); - // string formatid = xr.GetAttribute("formatid"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Step step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.RNO); - // step.DTS = dts; - // step.UserID = userid; - // string formatfilename = xr.GetAttribute("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - // if (formatid != string.Empty) - // step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - // step.MyContent.Config = config; - // step.MyContent.DTS = dts; - // step.MyContent.UserID = userid; - // step.Save(); - // Old2NewItem.Add(oldid, step.ItemID); - // Old2NewContent.Add(int.Parse(xr.GetAttribute("contentid")), step.MyContent.ContentID); - // prevInfo = StepInfo.Get(step.ItemID); - // return prevInfo; - //} - - private ItemInfo AddRNO(XmlNode xn, ItemInfo parentInfo, ItemInfo prevInfo) - { - pbImportStep.PerformStep(); - lblImportStep.Text = string.Format("{0} of {1} Steps", pbImportStep.Value.ToString(), pbImportStep.Maximum.ToString()); - Application.DoEvents(); - XmlNode xc = xn.SelectSingleNode("content"); - Step step; - string number = xc.Attributes.GetNamedItem("number").InnerText; - string text = xc.Attributes.GetNamedItem("text").InnerText; - int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); - string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; - string config = xc.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); - CheckForFloatingFoldout(contentid, config); - string userid = xc.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); - using (step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.RNO)) - { - step.DTS = dts; - step.UserID = userid; - // check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute) - XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - if (formatid != string.Empty) - step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - step.MyContent.Config = config; - step.MyContent.DTS = dts; - step.MyContent.UserID = userid; - step.Save(); - if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText))) - Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), step.ItemID); - else - Old2NewItem[int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText)] = step.ItemID; // B2016-176, B2016-197 refresh saved ItemId with current ItemID - if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText))) - Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), step.MyContent.ContentID); - else - Old2NewContent[int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText)] = step.MyContent.ContentID; // B2016-176, B2016-197 refresh saved ContentID with current ContentID - if (xn.SelectNodes("annotation").Count > 0) - AddAnnotations(step.ItemID, xn); - if (xc.SelectNodes("rousage").Count > 0) - AddROUsages(step.MyContent, xc); - if (xc.SelectNodes("transition").Count > 0) - AddTransitions(step.MyContent, xc); - prevInfo = StepInfo.Get(step.ItemID); - if (xc.HasChildNodes) - AddParts(xc, prevInfo); - } - return prevInfo; - } - private ItemInfo AddSupInfo(XmlNode xn, ItemInfo parentInfo, ItemInfo prevInfo) - { - pbImportStep.PerformStep(); - lblImportStep.Text = string.Format("{0} of {1} Steps", pbImportStep.Value.ToString(), pbImportStep.Maximum.ToString()); - Application.DoEvents(); - XmlNode xc = xn.SelectSingleNode("content"); - Step step; - string number = xc.Attributes.GetNamedItem("number").InnerText; - string text = xc.Attributes.GetNamedItem("text").InnerText; - int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); - string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; - string config = xc.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); - CheckForFloatingFoldout(contentid, config); - string userid = xc.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); - using (step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.SupInfo)) - { - step.DTS = dts; - step.UserID = userid; - // check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute) - XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - if (formatid != string.Empty) - step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - step.MyContent.Config = config; - step.MyContent.DTS = dts; - step.MyContent.UserID = userid; - step.Save(); - if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText))) - Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), step.ItemID); - if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText))) - Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), step.MyContent.ContentID); - if (xn.SelectNodes("annotation").Count > 0) - AddAnnotations(step.ItemID, xn); - if (xc.SelectNodes("rousage").Count > 0) - AddROUsages(step.MyContent, xc); - if (xc.SelectNodes("transition").Count > 0) - AddTransitions(step.MyContent, xc); - prevInfo = StepInfo.Get(step.ItemID); - if (xc.HasChildNodes) - AddParts(xc, prevInfo); - } - return prevInfo; - } - private void AddNotes(XmlNode xn, ItemInfo parentInfo) - { - if (parentInfo.IsProcedure) - { - pbImportSection.Value = 0; - pbImportStep.Value = 0; - pbImportSection.Maximum = xn.ChildNodes.Count; - } - if (parentInfo.IsSection) - { - pbImportStep.Value = 0; - pbImportStep.Maximum = xn.ChildNodes.Count; - } - ItemInfo prevInfo = null; - foreach (XmlNode nd in xn.ChildNodes) - prevInfo = AddNote(nd, parentInfo, prevInfo); - } - - // jsj 4-29-2016 appears to not be used - //private ItemInfo AddNote(XmlReader xr, ItemInfo parentInfo, ItemInfo prevInfo, int oldid) - //{ - // string number = xr.GetAttribute("number"); - // string text = xr.GetAttribute("text"); - // int steptype = int.Parse(xr.GetAttribute("type")); - // string formatid = xr.GetAttribute("formatid"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Step step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Note); - // step.DTS = dts; - // step.UserID = userid; - // string formatfilename = xr.GetAttribute("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - // if (formatid != string.Empty) - // step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - // step.MyContent.Config = config; - // step.MyContent.DTS = dts; - // step.MyContent.UserID = userid; - // step.Save(); - // Old2NewItem.Add(oldid, step.ItemID); - // Old2NewContent.Add(int.Parse(xr.GetAttribute("contentid")), step.MyContent.ContentID); - // prevInfo = StepInfo.Get(step.ItemID); - // return prevInfo; - //} - - private ItemInfo AddNote(XmlNode xn, ItemInfo parentInfo, ItemInfo prevInfo) - { - pbImportStep.PerformStep(); - lblImportStep.Text = string.Format("{0} of {1} Steps", pbImportStep.Value.ToString(), pbImportStep.Maximum.ToString()); - Application.DoEvents(); - XmlNode xc = xn.SelectSingleNode("content"); - Step step; - string number = xc.Attributes.GetNamedItem("number").InnerText; - string text = xc.Attributes.GetNamedItem("text").InnerText; - int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); - string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; - string config = xc.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); - CheckForFloatingFoldout(contentid, config); - string userid = xc.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); - using (step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Note)) - { - step.DTS = dts; - step.UserID = userid; - // check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute) - XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - if (formatid != string.Empty) - step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - step.MyContent.Config = config; - step.MyContent.DTS = dts; - step.MyContent.UserID = userid; - step.Save(); - if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText))) - Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), step.ItemID); - else - Old2NewItem[int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText)] = step.ItemID; // B2016-176, B2016-197 refresh saved ItemId with current ItemID - if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText))) - Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), step.MyContent.ContentID); - else - Old2NewContent[int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText)] = step.MyContent.ContentID; // B2016-176, B2016-197 refresh saved ContentID with current ContentID - if (xn.SelectNodes("annotation").Count > 0) - AddAnnotations(step.ItemID, xn); - if (xc.SelectNodes("rousage").Count > 0) - AddROUsages(step.MyContent, xc); - if (xc.SelectNodes("transition").Count > 0) - AddTransitions(step.MyContent, xc); - prevInfo = StepInfo.Get(step.ItemID); - if (xc.HasChildNodes) - AddParts(xc, prevInfo); - } - return prevInfo; - } - private void AddCautions(XmlNode xn, ItemInfo parentInfo) - { - if (parentInfo.IsProcedure) - { - pbImportSection.Value = 0; - pbImportStep.Value = 0; - pbImportSection.Maximum = xn.ChildNodes.Count; - } - if (parentInfo.IsSection) - { - pbImportStep.Value = 0; - pbImportStep.Maximum = xn.ChildNodes.Count; - } - ItemInfo prevInfo = null; - foreach (XmlNode nd in xn.ChildNodes) - prevInfo = AddCaution(nd, parentInfo, prevInfo); - } - - // jsj 4-29-2016 appears to not be used - //private ItemInfo AddCaution(XmlReader xr, ItemInfo parentInfo, ItemInfo prevInfo, int oldid) - //{ - // string number = xr.GetAttribute("number"); - // string text = xr.GetAttribute("text"); - // int steptype = int.Parse(xr.GetAttribute("type")); - // string formatid = xr.GetAttribute("formatid"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Step step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Caution); - // step.DTS = dts; - // step.UserID = userid; - // string formatfilename = xr.GetAttribute("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - // if (formatid != string.Empty) - // step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - // step.MyContent.Config = config; - // step.MyContent.DTS = dts; - // step.MyContent.UserID = userid; - // step.Save(); - // Old2NewItem.Add(oldid, step.ItemID); - // Old2NewContent.Add(int.Parse(xr.GetAttribute("contentid")), step.MyContent.ContentID); - // prevInfo = StepInfo.Get(step.ItemID); - // return prevInfo; - //} - - private ItemInfo AddCaution(XmlNode xn, ItemInfo parentInfo, ItemInfo prevInfo) - { - pbImportStep.PerformStep(); - lblImportStep.Text = string.Format("{0} of {1} Steps", pbImportStep.Value.ToString(), pbImportStep.Maximum.ToString()); - Application.DoEvents(); - XmlNode xc = xn.SelectSingleNode("content"); - Step step; - string number = xc.Attributes.GetNamedItem("number").InnerText; - string text = xc.Attributes.GetNamedItem("text").InnerText; - int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); - string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; - string config = xc.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); - CheckForFloatingFoldout(contentid, config); - string userid = xc.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); - using (step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Caution)) - { - step.DTS = dts; - step.UserID = userid; - // check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute) - XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - if (formatid != string.Empty) - step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - step.MyContent.Config = config; - step.MyContent.DTS = dts; - step.MyContent.UserID = userid; - step.Save(); - if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText))) - Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), step.ItemID); - else - Old2NewItem[int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText)] = step.ItemID; // B2016-176, B2016-197 refresh saved ItemId with current ItemID - if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText))) - Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), step.MyContent.ContentID); - else - Old2NewContent[int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText)] = step.MyContent.ContentID; // B2016-176, B2016-197 refresh saved ContentID with current ContentID - if (xn.SelectNodes("annotation").Count > 0) - AddAnnotations(step.ItemID, xn); - if (xc.SelectNodes("rousage").Count > 0) - AddROUsages(step.MyContent, xc); - if (xc.SelectNodes("transition").Count > 0) - AddTransitions(step.MyContent, xc); - prevInfo = StepInfo.Get(step.ItemID); - if (xc.HasChildNodes) - AddParts(xc, prevInfo); - } - return prevInfo; - } - private void AddSections(XmlNode xn, ItemInfo parentInfo) - { - if (parentInfo.IsProcedure) - { - pbImportSection.Value = 0; - pbImportStep.Value = 0; - pbImportSection.Maximum = xn.ChildNodes.Count; - } - if (parentInfo.IsSection) - { - pbImportStep.Value = 0; - pbImportStep.Maximum = xn.ChildNodes.Count; - } - ItemInfo prevInfo = null; - foreach (XmlNode nd in xn.ChildNodes) - prevInfo = AddSection(nd, parentInfo, prevInfo); - } - private Dictionary GetSectionData(XmlReader xr) - { - Dictionary rv = new Dictionary(); - rv.Add("itemid", xr.GetAttribute("itemid")); - return rv; - } - - // js j4-29-2016 appears to not be used - //private ItemInfo AddSection(XmlReader xr, ItemInfo parentInfo, ItemInfo prevInfo, int oldid) - //{ - // string number = xr.GetAttribute("number"); - // string text = xr.GetAttribute("text"); - // int sectiontype = int.Parse(xr.GetAttribute("type")); - // string formatid = xr.GetAttribute("formatid"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Section sect = Section.MakeSection(parentInfo, prevInfo, number, text, sectiontype); - // sect.DTS = dts; - // sect.UserID = userid; - // string formatfilename = xr.GetAttribute("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - // if (formatid != string.Empty) - // sect.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - // sect.MyContent.Config = config; - // sect.MyContent.DTS = dts; - // sect.MyContent.UserID = userid; - // sect.Save(); - // Old2NewItem.Add(oldid, sect.ItemID); - // Old2NewContent.Add(int.Parse(xr.GetAttribute("contentid")), sect.MyContent.ContentID); - // prevInfo = SectionInfo.Get(sect.ItemID); - // return prevInfo; - //} - - private ItemInfo AddSection(XmlNode xn, ItemInfo parentInfo, ItemInfo prevInfo) - { - pbImportSection.PerformStep(); - lblImportSection.Text = string.Format("{0} of {1} Sections", pbImportSection.Value.ToString(), pbImportSection.Maximum.ToString()); - Application.DoEvents(); - XmlNode xc = xn.SelectSingleNode("content"); - Section sect; - string number = xc.Attributes.GetNamedItem("number").InnerText; - string text = xc.Attributes.GetNamedItem("text").InnerText; - int sectiontype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); - string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; - string config = xc.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); - CheckForFloatingFoldout(contentid, config); - string userid = xc.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); - sect = Section.MakeSection(parentInfo, prevInfo, number, text, sectiontype); - sect.DTS = dts; - sect.UserID = userid; - // check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute) - XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - if (formatid != string.Empty) - sect.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - sect.MyContent.Config = config; - sect.MyContent.DTS = dts; - sect.MyContent.UserID = userid; - sect.Save(); - if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText))) - Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), sect.MyContent.ContentID); - else - Old2NewContent[int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText)] = sect.MyContent.ContentID; // B2016-176, B2016-197 refresh saved ContentID with current ContentID - if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText))) - Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), sect.ItemID); - else - Old2NewItem[int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText)] = sect.ItemID; // B2016-176, B2016-197 refresh saved ItemId with current ItemID - if (xn.SelectNodes("annotation").Count > 0) - AddAnnotations(sect.ItemID, xn); - if (xc.SelectNodes("entry").Count > 0) - AddEntry(sect.MyContent, xc); - if (xc.SelectNodes("rousage").Count > 0) - AddROUsages(sect.MyContent, xc); - if (xc.SelectNodes("transition").Count > 0) - AddTransitions(sect.MyContent, xc); - prevInfo = SectionInfo.Get(sect.ItemID); - if (xc.HasChildNodes) - AddParts(xc, prevInfo); - return prevInfo; - } - private string StripEnhanced(string config) - { - if (config.Length > 0) - { - XmlDocument xd = new XmlDocument(); - xd.LoadXml(config); - XmlNodeList nl = xd.DocumentElement.SelectNodes("//Enhanced"); - foreach (XmlNode nd in nl) - nd.ParentNode.RemoveChild(nd); - return xd.OuterXml; - } - return config; - } - private void CheckForFloatingFoldout(int contentid, string config) - { - if (config != string.Empty) - { - XmlDocument xd = new XmlDocument(); - xd.LoadXml(config); - XmlNode xn = xd.SelectSingleNode("Config/Step/@FloatingFoldout"); - if (xn != null) - floatFoldout.Add(contentid, int.Parse(xn.InnerText)); - } - } - - // jsj 2016Feb16 - This appears to not be used - //private void AddGrid(XmlReader xr) - //{ - // int contentid = int.Parse(xr.GetAttribute("contentid")); - // contentid = Old2NewContent[contentid]; - // Content content = Content.Get(contentid); - // string data = xr.GetAttribute("data"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Grid gg = Grid.MakeGrid(content, data, config, dts, userid); - //} - - private void AddGrid(Content content, XmlNode xc) - { - XmlNode nd = xc.SelectSingleNode("grid"); - string data = nd.Attributes.GetNamedItem("data").InnerText; - XmlDocument xd = new XmlDocument(); - xd.LoadXml(data); - XmlNode gn = xd.SelectSingleNode("C1FlexGrid/Control/IsRoTable"); - if (gn.InnerText.ToLower() == "true") - { - if (_ConvertROsToTextDuringImport) - { - gn.InnerText = "False"; - ROToTextAnnotation(content, "RO Table"); // B2016-225 (follow through) add annotation when RO is converted to text - } - else - { - gn = xd.SelectSingleNode("C1FlexGrid/Control/RODbId"); - gn.InnerText = newRODbID.ToString(); - } - data = xd.OuterXml; - } - else - { - XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Cells/Cell/Data"); - bool modified = false; - if (_ConvertROsToTextDuringImport) - { - string newvalue = ""; - // if it's an ro within a table, need to process into an flex grid to save the grid data: - string findLinkXml = @"<START\].*?\[END>"; - //string lookForXml = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}} \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>$", rousageid); - string lookForXml = @"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}} \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:.*?\[END>$"; - MatchCollection msg = Regex.Matches(data, findLinkXml); - int nmsg = msg.Count; - for (int i = nmsg - 1; i >= 0; i--) - { - Match mmg = msg[i]; - Match mg = Regex.Match(mmg.Value, lookForXml);// Regex.Match(MyGrid.Data, lookForXml); - if (mg != null && mg.Groups.Count > 1) - { - int myIndex = mg.Groups[4].Index + mmg.Index; - int myLength = mg.Groups[4].Length; - if (mg.Groups[3].Value != " ") - { - myIndex = mg.Groups[3].Index + mmg.Index; - myLength += mg.Groups[3].Length; - } - string ss = data.Substring(myIndex, myLength); - if (ss != newvalue) - { - data = Content.ConvertGridROsToText(data, mmg, mg, ss); // part of bug fix: B2017060 to properly convert invalid RO to text - } - } - } - } - else - { - string lookFor = string.Format(" {0}[END", oldRODbID.ToString()); - string replaceWith = string.Format(" {0}[END", newRODbID.ToString()); - foreach (XmlNode nn in nl) - { - if (nn.InnerText.Contains("#Link:ReferencedObject:")) - { - nn.InnerText = nn.InnerText.Replace(lookFor, replaceWith); - modified = true; - } - } - if (modified) - data = xd.OuterXml; - } - } - string config = nd.Attributes.GetNamedItem("config").InnerText; - string userid = nd.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - Grid gg = Grid.MakeGrid(content, data, config, dts, userid); - gg.Save(); - content.MyGrid = gg; - } - - - // jsj 4-29-2016 appears to not be used - //private Dictionary AddEntry(XmlReader xr) - //{ - // Dictionary dic = new Dictionary(); - // dic.Add("contentid", xr.GetAttribute("contentid")); - // dic.Add("dts", xr.GetAttribute("dts")); - // dic.Add("userid", xr.GetAttribute("userid")); - // return dic; - //} - - private void AddEntry(Content content, XmlNode xc) - { - XmlNode nd = xc.SelectSingleNode("entry"); - string userid = nd.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - Document dd = AddDocument(nd.SelectSingleNode("document")); - Entry ee = Entry.MakeEntry(content, dd, dts, userid); - ee.Save(); - } - // jsj 2016Feb16 - This appears to not be used - //private void AddDocument(XmlReader xr, Dictionary dic) - //{ - // string libtitle = xr.GetAttribute("libtitle"); - // byte[] doccontent = Convert.FromBase64String(xr.GetAttribute("doccontent")); - // string docascii = xr.GetAttribute("docascii"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // string fileextension = xr.GetAttribute("fileextension"); - // Document dd = Document.MakeDocument(libtitle, doccontent, docascii, config, dts, userid, fileextension); - // int contentid = int.Parse(dic["contentid"]); - // contentid = Old2NewContent[contentid]; - // Content content = Content.Get(contentid); - // dts = DateTime.Parse(dic["dts"]); - // userid = dic["userid"]; - // Entry ee = Entry.MakeEntry(content, dd, dts, userid); - //} - private Document AddDocument(XmlNode xn) - { - Document d; - int docid = int.Parse(xn.Attributes.GetNamedItem("docid").InnerText); - if (Old2NewLibDoc.ContainsKey(docid)) - { - docid = Old2NewLibDoc[docid]; - d = Document.Get(docid); - } - else - { - string libtitle = xn.Attributes.GetNamedItem("libtitle").InnerText; - DateTime dts = DateTime.Parse(xn.Attributes.GetNamedItem("dts").InnerText); - if (libtitle != "") - { - DocumentInfoList dil = DocumentInfoList.GetLibraries(true); - foreach (DocumentInfo di in dil) - { - if (di.LibTitle == libtitle && di.DTS == dts) - return di.Get(); // found library document in exiting database - } - } - byte[] doccontent = Convert.FromBase64String(xn.Attributes.GetNamedItem("doccontent").InnerText); - string docascii = xn.Attributes.GetNamedItem("docascii").InnerText; - string config = xn.Attributes.GetNamedItem("config").InnerText; - string userid = xn.Attributes.GetNamedItem("userid").InnerText; - string fileextension = xn.Attributes.GetNamedItem("fileextension").InnerText; - d = Document.MakeDocument(libtitle, doccontent, docascii, config, dts, userid, fileextension); - d.Save(); - Old2NewLibDoc.Add(docid, d.DocID); - } - return d; - } - #endregion - - private void btnCloseExport_Click(object sender, EventArgs e) - { - this.Close(); - } - - private void btnCloseImport_Click(object sender, EventArgs e) - { - this.Close(); - } - } -} diff --git a/PROMS/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/PROMS/VEPROMS User Interface/frmVEPROMS.cs deleted file mode 100644 index 5e1dded9..00000000 --- a/PROMS/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ /dev/null @@ -1,3967 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using System.IO; -using System.Configuration; -using VEPROMS.CSLA.Library; -//using Csla; -using DevComponents; -using DevComponents.DotNetBar; -using DevComponents.DotNetBar.Rendering; -using VEPROMS.Properties; -using Volian.Controls.Library; -using DescriptiveEnum; -using Volian.Base.Library; -using Volian.Print.Library; -[assembly: log4net.Config.XmlConfigurator(Watch = true)] - -namespace VEPROMS -{ - enum PropPgStyle { Button = 1, Tab = 2, Grid = 3 }; - - public partial class frmVEPROMS : DevComponents.DotNetBar.Office2007RibbonForm - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region PropertiesVariables - private int securityRole; - private bool _panelExpandedChanging = false; - Color _CommentTitleBckColor; - DocVersionInfo _SelectedDVI = null; - StepTabPanel _SelectedStepTabPanel = null; - public FindReplace dlgFindReplace = null; - public VlnSpellCheck SpellChecker = null; - private Int64 _LastContentChange; - public Int64 LastContentChange - { - get { return _LastContentChange; } - set { _LastContentChange = value; } - } - public void RefreshLastChange() - { - lblLastChange.Text = string.Format("Last Change: {0}", MySessionInfo.LastContentChange - this.LastContentChange); - } - public StepTabPanel SelectedStepTabPanel - { - get - { - return _SelectedStepTabPanel; - } - set - { - _SelectedStepTabPanel = value; - if (value == null) // DSO Tab Panel - { - dlgFindReplace.Visible = false; // Find/Replace dialog should not be visable for DSO tab panels - if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.MyItemInfo != null) // 2nd part is for unassociated libdocs - SelectedDVI = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion; - else - SelectedDVI = null; - } - else // Step Tab Panel - { - // The following line was broken into separate lines because a NullReferenceError was occuring. - // Now we should be able to tell what is wrong by which line causes the Null Reference Error - // RHM 20101217 - //SelectedDVI = value.MyStepPanel.MyProcedureItemInfo.MyProcedure.ActiveParent as DocVersionInfo; - StepPanel stepPanel = value.MyStepPanel; - ItemInfo itemInfo = stepPanel.MyProcedureItemInfo; - ProcedureInfo procedureInfo = itemInfo.MyProcedure; - SelectedDVI = procedureInfo.MyDocVersion; - // Remove it first, if it wasn't set, this doesn't do anything, but if it was set, you don't want - // multiple events because the print dialog will be displayed for each time the event was added. - _SelectedStepTabPanel.MyStepTabRibbon.PrintRequest -= new StepTabRibbonEvent(MyStepTabRibbon_PrintRequest); - _SelectedStepTabPanel.MyStepTabRibbon.PrintRequest += new StepTabRibbonEvent(MyStepTabRibbon_PrintRequest); - _SelectedStepTabPanel.MyStepTabRibbon.ProgressBar = bottomProgBar; - _SelectedStepTabPanel.MyStepTabRibbon.ContActionSummaryRequest -= MyStepTabRibbon_ContActionSummaryRequest; - _SelectedStepTabPanel.MyStepTabRibbon.ContActionSummaryRequest += MyStepTabRibbon_ContActionSummaryRequest; - _SelectedStepTabPanel.MyStepTabRibbon.AddProcToDVInTree -= new StepTabRibbonEvent(MyStepTabRibbon_AddProcToDocVersionInTree); - _SelectedStepTabPanel.MyStepTabRibbon.AddProcToDVInTree += new StepTabRibbonEvent(MyStepTabRibbon_AddProcToDocVersionInTree); - } - } - } - - void MyStepTabRibbon_ContActionSummaryRequest(object sender, StepTabRibbonEventArgs args) - { - DialogResult dr = System.Windows.Forms.DialogResult.Yes; - ProcedureInfo piThis = null; - if (_CurrentItem != null) piThis = _CurrentItem.MyProcedure; - ProcedureInfo pi = args.Proc as ProcedureInfo; - if (piThis != null && pi.ItemID != piThis.ItemID) pi = piThis; - - //added by jcb 20130718 to support create pdf button when multiunit and user selects a unit - pi.MyDocVersion.DocVersionConfig.SelectedSlave = pi.ProcedureConfig.SelectedSlave; - //end added by jcb 20130718 - if (pi == null) return; - DlgPrintProcedure prnDlg = new DlgPrintProcedure(pi); - //added by jcb 20130718 to support create pdf button when multiunit and user selects a unit - prnDlg.SelectedSlave = pi.ProcedureConfig.SelectedSlave == 0 ? -1 : pi.ProcedureConfig.SelectedSlave; - prnDlg.MySessionInfo = MySessionInfo; - //end added by jcb 20130718 - prnDlg.Automatic = true; - prnDlg.CreateContinuousActionSummary = true; - prnDlg.OpenAfterCreate = (dr == System.Windows.Forms.DialogResult.Yes); - prnDlg.Prefix = "CASTMP_"; // A temporary procedure PDF is created to grab page numbers - prnDlg.SetupForProcedure(); - prnDlg.CreatePDF(); - //added by jcb 20130718 to support create pdf button when multiunit and user selects a unit - pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0; - //end added by jcb 20130718 - } - - public DocVersionInfo SelectedDVI - { - get { return _SelectedDVI; } - set - { - if (_SelectedDVI != value) - { - _SelectedDVI = value; - _SelectedROFst = null; - } - InitiateSearch(false); - InitiateDisplayReports(false); - } - } - // TODO: Should the following be an info - // For the initial release, we are assuming there will be only one rofst fro a docversion. Changes - // will be needed here if more than 1. - private ROFstInfo _SelectedROFst; - public ROFstInfo SelectedROFst - { - get - { - if (_SelectedROFst == null && SelectedDVI != null) - { - if (SelectedDVI.DocVersionAssociationCount <= 0) - { - MessageBox.Show("There is no Referenced Object (RO) data for this procedure set. Use the Properties for the set to define the RO data."); - return null; - } - _SelectedROFst = SelectedDVI.DocVersionAssociations[0].MyROFst; - } - return _SelectedROFst; - } - set { _SelectedROFst = value; } - } - #endregion - private frmVEPROMS _MyParent; - public frmVEPROMS MyParent - { - get { return _MyParent; } - set { _MyParent = value; } - } - //private FolderInfo _MyFolder = null; - //public FolderInfo MyFolder - //{ - // get { return _MyFolder; } - // set { _MyFolder = value; } - //} - private DocVersionInfo _MyDocVersion = null; - - public DocVersionInfo MyDocVersion - { - get { return _MyDocVersion; } - set { _MyDocVersion = value; } - } - public frmVEPROMS(frmVEPROMS myParent, DocVersionInfo myDocVersion) - { - MyParent = myParent; - MyDocVersion=myDocVersion; - InitializeComponent(); - SetupFolder(MyDocVersion.FolderID); - tc.MySessionInfo = MyParent.MySessionInfo; - displaySearch1.TopFolderID = myDocVersion.FolderID; - SelectedDVI = myDocVersion; - tc.VersionID = myDocVersion.VersionID; - } - public void OpenItem(ItemInfo myItemInfo) - { - tc.OpenItem(myItemInfo); - } - public void RefreshItem(ItemInfo myItemInfo) - { - tc.RefreshItem(myItemInfo); - } - public frmVEPROMS() - { - // The following Try/Catch was added to protect against a problem seen by Kathy and Michelle - // on January 1, 2013. Michelle's user.config file was empty and PROMS would not run. - // This logic will delete a "Bad" config file to attempt to eliminate the problem, and - // instructs the user to try again. - try - { - if (Properties.Settings.Default.UpdateSettings) - { - Properties.Settings.Default.Upgrade(); - Properties.Settings.Default.UpdateSettings = false; - Properties.Settings.Default.Save(); - } - } - catch (Exception ex) - { - _MyLog.Error(ex.GetType().Name + " - " + ex.InnerException, ex); - if (ex.Message.StartsWith("Configuration system failed to initialize")) - { - string filename = ex.InnerException.Message; - filename = filename.Substring(filename.IndexOf("(") + 1); - filename = filename.Substring(0, filename.IndexOf("user.config") + 11); - FileInfo myfile = new FileInfo(filename); - myfile.Delete(); - MessageBox.Show("Config file was corrupt, it has been deleted.\r\nTry Again", "Corrupt config file", MessageBoxButtons.OK, MessageBoxIcon.Error); - System.Diagnostics.Process.GetCurrentProcess().Kill(); - } - } - // If first time close any remaining WinWords. These will sometimes get hung in memory and cause problems. - if (System.Diagnostics.Process.GetProcessesByName(System.Diagnostics.Process.GetCurrentProcess().ProcessName).Length == 1) - Volian.MSWord.WordDoc.KillWordApps(); - // cleanup from previous run: - Volian.Base.Library.TmpFile.RemoveAllTmps(); - - if (VlnSettings.DebugMode) - { - //use local data (for development/debug mode) - if (Environment.MachineName == "RMARK-PC") - VEPROMS.CSLA.Library.Database.ConnectionName = "VEPROMS_RMARK_DEBUG"; - else if (Environment.MachineName == "WINDOWS7-RHM") - VEPROMS.CSLA.Library.Database.ConnectionName = "VEPROMS_RMARK_DEBUG"; - else if (Environment.UserName.ToUpper() == "BODINE") - VEPROMS.CSLA.Library.Database.ConnectionName = "VEPROMS_BODINE_DEBUG"; - else - VEPROMS.CSLA.Library.Database.ConnectionName = "VEPROMS_LOCAL"; - } - else - { - // use server data (default) - // - except for the volian laptop and Rich's Demo version where we need to use local data - if (Environment.MachineName == "RMARK-PC") - VEPROMS.CSLA.Library.Database.ConnectionName = "VEPROMS_RMARK_DEMO"; - else if (Environment.MachineName == "WINDOWS7-RHM") - VEPROMS.CSLA.Library.Database.ConnectionName = "VEPROMS_RMARK_DEMO"; - else if (Environment.UserName.ToUpper() == "BODINE") - VEPROMS.CSLA.Library.Database.ConnectionName = "VEPROMS_BODINE_DEMO"; - else - VEPROMS.CSLA.Library.Database.ConnectionName = "VEPROMS_LOCAL"; - } - InitializeComponent(); - bottomProgBar.ValueChanged += new EventHandler(bottomProgBar_ValueChanged); - - // 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; - } - else - { - MSWordToPDF.DebugStatus = 0; - MSWordToPDF.OverrideColor = Color.Transparent; - } - MSWordToPDF.FormForPlotGraphics = this; - - // set the color of the ribbon - RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable((eOffice2007ColorScheme)Settings.Default.SystemColor); - - // LATER: get the user setting to control what is displayed for each tree node - // The logic is in the ToString() functions in FolderExt.cs and DocVersionExt.cs - //the GetFolder(1) function will read in the frist node (using ToString() to assign node text) - - // Get the saved Tree Node Diplay settings - //if (Settings.Default["UseNameOnTreeNode"]) - //{ - //} - //if (Settings.Default["UseTitleOnTreeNode"]) - //{ - //} - cmbFont.DataSource = FontFamily.Families; - cmbFont.DisplayMember = "Name"; - cmbFont.SelectedIndex = -1; - string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray()); - string db = Volian.Base.Library.VlnSettings.GetDB(); - if(db != null) - Database.SelectedDatabase = db; - if (Properties.Settings.Default["DefaultDB"] != string.Empty) - Database.LastDatabase = Properties.Settings.Default.DefaultDB; - // Setup the Context menu for DisplaySearch including the symbols - displaySearch1.SetupContextMenu(); - displaySearch1.SearchComplete += displaySearch1_SearchComplete; - if (!FormatInfo.HasLatestChanges()) - throw new Exception("Inconsistent Formats"); - if (!ItemAuditInfo.IsChangeManagerVersion()) - throw new Exception("Inconsistent Data"); - // set a static variable to the PROMS Base format (BASEall.xml) - // this is used to resolve Global Search bug B2014-057 so that we can get to the symbol list when no DocVersion is selected - if (FormatInfo.PROMSBaseFormat == null) - throw new Exception("Could not set PROMSBaseFormat"); - if ((Database.LastDatabase ?? "") != (Database.SelectedDatabase ?? "")) - { - if(Properties.Settings.Default.VersionWindows != null) - Properties.Settings.Default.VersionWindows.Clear(); - Properties.Settings.Default.MRIList = null; - Properties.Settings.Default.DefaultDB = Database.SelectedDatabase; - Properties.Settings.Default.Save(); - } - displayBookMarks.SetupBookMarks(); - DateTime dtSunday = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfWeek)); - string c = Database.DBServer; - ChangeLogFileName("LogFileAppender", Database.ActiveDatabase + " " + dtSunday.ToString("yyyyMMdd") + " ErrorLog.txt"); - _MyLog.InfoFormat("\r\nSession Beginning\r\n<===={0}[SQL:{1:yyMM.ddHH}]====== User: {2}/{3} Started {4} ===============>" - , Application.ProductVersion,Database.RevDate, Environment.UserDomainName,Environment.UserName, DateTime.Now.ToString("dddd MMMM d, yyyy h:mm:ss tt")); - foreach (string parameter in parameters) - { - if (parameter.ToUpper().StartsWith("/UF=")) - UpdateFormats(parameter.Substring(4)); - else if (parameter.ToUpper().StartsWith("/UF")) - UpdateFormats(null); - } - SetupFolder(1); - tc.VersionID = 0; - tv.PauseRefresh += tv_PauseRefresh; - tv.UnPauseRefresh += tv_UnPauseRefresh; - } - void displaySearch1_SearchComplete(object sender, DisplaySearchEventArgs args) - { - ProgBarText = string.Format("{0} Seconds", args.HowLong.TotalSeconds); - } - private bool _PauseRefresh = false; - public bool PauseRefresh - { - get { return _PauseRefresh; } - set { - //_MyLog.WarnFormat(value ? "=== Pause" : "=== UnPause"); - _PauseRefresh = value; - } - } - void tv_UnPauseRefresh(object sender, vlnTreeSectionInfoEventArgs args) - { - //_MyLog.WarnFormat("Unpause"); - PauseRefresh = false; - } - void tv_PauseRefresh(object sender, vlnTreeSectionInfoEventArgs args) - { - //_MyLog.WarnFormat("Pause"); - //PauseRefresh = true; - } - private void SetupFolder(int folderID) - { - VETreeNode tn = VETreeNode.GetFolder(folderID); - tv.Nodes.Add(tn); - tv.NodePSI += new vlnTreeViewPSIEvent(tv_NodePSI); - tv.NodeSI += new vlnTreeViewSIEvent(tv_NodeSI); - tv.NodeOpenProperty += new vlnTreeViewPropertyEvent(tv_NodeOpenProperty); - tv.NodeSelect += new Volian.Controls.Library.vlnTreeViewEvent(tv_NodeSelect); - tv.NodeNew += new vlnTreeViewEvent(tv_NodeNew); - tv.OpenItem += new vlnTreeViewItemInfoEvent(tv_OpenItem); - tv.TabDisplay += new StepPanelTabDisplayEvent(tc_PanelTabDisplay); - tv.DeleteItemInfo += new vlnTreeViewItemInfoDeleteEvent(tv_DeleteItemInfo); - tv.InsertItemInfo += new vlnTreeViewItemInfoInsertEvent(tv_InsertItemInfo); - tv.NodeInsert += new vlnTreeViewEvent(tv_NodeInsert); - tv.PasteItemInfo += new vlnTreeViewItemInfoPasteEvent(tv_PasteItemInfo); - tv.GetChangeId += new vlnTreeViewGetChangeIdEvent(tv_GetChangeId); - tv.NodeCopy += new vlnTreeViewEvent(tv_NodeCopy); - tv.ClipboardStatus += new vlnTreeViewClipboardStatusEvent(tv_ClipboardStatus); - tv.ProgressBar = bottomProgBar; - tc.ItemPaste += new StepPanelItemPastedEvent(tc_ItemPasted); - displayHistory.HistorySelectionChanged += new DisplayHistoryEvent(displayHistory_HistorySelectionChanged); - _CommentTitleBckColor = epAnnotations.TitleStyle.BackColor1.Color; - if (!btnAnnoDetailsPushPin.Checked) - epAnnotations.Expanded = false; - infoPanel.Expanded = false; - toolsPanel.Expanded = false; - displayTags.Visible = false; - ribbonControl1.ExpandedChanged += new EventHandler(ribbonControl1_ExpandedChanged); - dlgFindReplace = new FindReplace(); - SpellChecker = new VlnSpellCheck(); - displaySearch1.PrintRequest += new DisplaySearchEvent(displaySearch1_PrintRequest); - displayHistory.ChronologyPrintRequest += new DisplayHistoryReportEvent(displayHistory_ChronologyPrintRequest); - displayHistory.SummaryPrintRequest += new DisplayHistoryReportEvent(displayHistory_SummaryPrintRequest); - displayHistory.AnnotationRestored += new AnnotationRestoredHandler(displayHistory_AnnotationRestored); - displayReports.PrintRequest += new DisplayReportsEvent(displayReports_PrintRequest); - this.Activated += new EventHandler(frmVEPROMS_Activated); - VlnSettings.StepTypeToolType = Settings.Default.StepTypeToolTip; - displayLibDocs.PrintRequest += new DisplayLibDocEvent(displayLibDocs_PrintRequest); - ContentInfo.InfoChanged += new ContentInfoEvent(RefreshDisplayHistory); - AnnotationInfo.InfoChanged += new AnnotationInfoEvent(RefreshDisplayHistory); - ItemInfo.InfoRestored += new ItemInfoEvent(RefreshDisplayHistory); - ItemInfo.ItemDeleted += new ItemInfoEvent(RefreshDisplayHistory); - tv.PrintProcedure += new vlnTreeViewEvent(tv_PrintProcedure); - tv.PrintAllProcedures += new vlnTreeViewEvent(tv_PrintAllProcedures); - tv.ApproveProcedure += new vlnTreeViewEvent(tv_ApproveProcedure); - tv.ApproveAllProcedures += new vlnTreeViewEvent(tv_ApproveAllProcedures); - tv.ApproveSomeProcedures += new vlnTreeViewEvent(tv_ApproveSomeProcedures); - tv.ReportAllProceduresInconsistencies += new vlnTreeViewEvent(tv_ReportAllProceduresInconsistencies); - tv.RefreshCheckedOutProcedures += new vlnTreeViewEvent(tv_RefreshCheckedOutProcedures); - tv.ProcedureCheckedOutTo += new vlnTreeViewEvent(tv_ProcedureCheckedOutTo); - tv.ViewPDF += new vlnTreeViewPdfEvent(tv_ViewPDF); - displayApplicability.ApplicabilityViewModeChanged += new DisplayApplicability.DisplayApplicabilityEvent(displayApplicability_ApplicabilityViewModeChanged); - tv.ExportImportProcedureSets += new vlnTreeViewEvent(tv_ExportImportProcedureSets); - tv.PrintTransitionReport += new vlnTreeViewEvent(tv_PrintTransitionReport); - tv.ProcessingComplete += tv_ProcessingComplete; - tv.Processing += tv_Processing; - tv.CreateContinuousActionSummary += new vlnTreeViewEvent(tv_CreateContinuousActionSummary); - tv.SelectDateToStartChangeBars += tv_SelectDateToStartChangeBars; - } - - void tv_SelectDateToStartChangeBars(object sender, vlnTreeEventArgs args) - { - ProcedureInfo pi = (args.Node as VETreeNode).VEObject as ProcedureInfo; - if (pi == null) return; - tc.SaveCurrentEditItem(pi); - - ProcedureConfig pc = pi.MyConfig as ProcedureConfig; - if (pc == null) return; - - dlgSetChangeBarStartDate cbdDlg = new dlgSetChangeBarStartDate(pc); - if (cbdDlg.ShowDialog() == DialogResult.OK) - { - using (Item itm = Item.Get(pi.ItemID)) - { - itm.MyContent.Config = pc.ToString(); - itm.UserID = Volian.Base.Library.VlnSettings.UserID; - itm.Save(); - } - } - } - - private bool _SkipRefresh = false; - public bool SkipRefresh - { - get { return _SkipRefresh; } - set { _SkipRefresh = value; } - } - void tv_Processing(object sender, vlnTreeStatusEventArgs args) - { - SkipRefresh = args.MyStatus; - if (args.MyStatus) - bottomProgBar.ColorTable = eProgressBarItemColor.Paused; - else - bottomProgBar.ColorTable = eProgressBarItemColor.Normal; - bottomProgBar.Text = args.MyMessage; - bottomProgBar.TextVisible = true; - Application.DoEvents(); - } - void tv_ProcessingComplete(object sender, vlnTreeTimeEventArgs args) - { - bottomProgBar.Text = string.Format("{0} seconds - {1}", args.MyTimeSpan.TotalSeconds, args.MyMessage); - Application.DoEvents(); - } - void bottomProgBar_ValueChanged(object sender, EventArgs e) - { - if (bottomProgBar.Value < 10 && bottomProgBar.ColorTable != eProgressBarItemColor.Normal) - bottomProgBar.ColorTable = eProgressBarItemColor.Normal; - } - string tv_GetChangeId(object sender, vlnTreeItemInfoEventArgs args) - { - tc.HandleChangeId(args.MyItemInfo, null); - return tc.ChgId; - } - ItemInfo tv_ClipboardStatus(object sender, vlnTreeEventArgs args) - { - return tc.MyCopyStep; - } - void tv_NodeCopy(object sender, vlnTreeEventArgs args) - { - VETreeNode tn = args.Node as VETreeNode; - ItemInfo ii = tn.VEObject as ItemInfo; - tc.MyCopyStep = ii; - } - void tv_PrintTransitionReport(object sender, vlnTreeEventArgs args) - { - FolderInfo fi = null; - ProcedureInfo pi = null; - if ((args.Node as VETreeNode).VEObject is FolderInfo) - fi = (args.Node as VETreeNode).VEObject as FolderInfo; - if ((args.Node as VETreeNode).VEObject is ProcedureInfo) - pi = (args.Node as VETreeNode).VEObject as ProcedureInfo; - if (fi != null) //working with folder - { - dlgTransitionReport dlg = new dlgTransitionReport(fi); - dlg.ShowDialog(this); - } - if (pi != null) //working with procedure - { - this.Cursor = Cursors.WaitCursor; - Application.DoEvents(); - dlgTransitionReport dlg = new dlgTransitionReport(pi); - dlg.ShowDialog(this); - this.Cursor = Cursors.Default; - } - } - - void tv_ExportImportProcedureSets(object sender, vlnTreeEventArgs args) - { - FolderInfo fi = null; - DocVersionInfo dvi = null; - ProcedureInfo pi = null; - if ((args.Node as VETreeNode).VEObject is FolderInfo) - fi = (args.Node as VETreeNode).VEObject as FolderInfo; - if ((args.Node as VETreeNode).VEObject is DocVersionInfo) - dvi = (args.Node as VETreeNode).VEObject as DocVersionInfo; - if ((args.Node as VETreeNode).VEObject is ProcedureInfo) - pi = (args.Node as VETreeNode).VEObject as ProcedureInfo; - if (fi != null) - { - string msg = string.Empty; - bool ok = MySessionInfo.CanCheckOutItem(fi.FolderID, CheckOutType.Session, ref msg); - if (!ok) - { - if (args.Index == 0) - MessageBox.Show(this, msg, "Export Procedure Set Unavailable"); - else - MessageBox.Show(this, msg, "Import Procedure Set Unavailable"); - } - else - { - int ownerid = MySessionInfo.CheckOutItem(fi.FolderID, CheckOutType.Session); - dlgExportImport dlg = new dlgExportImport(args.Index == 0 ? "Export" : "Import", fi, this); - dlg.ShowDialog(this); - MySessionInfo.CheckInItem(ownerid); - if (args.Index == 1 && dlg.MyNewFolder != null) - tv.AddNewNode(dlg.MyNewFolder); - } - } - if (dvi != null) - { - string msg = string.Empty; - bool ok = MySessionInfo.CanCheckOutItem(dvi.VersionID, CheckOutType.DocVersion, ref msg); - if (!ok) - { - MessageBox.Show(this, msg, "Import Procedure Unavailable"); - } - else - { - dvi.RefreshDocVersionAssociations(); // Refresh Associations Count - //Only allow Import if the Referenced Object Database is set - if ( dvi.DocVersionAssociationCount == 0) - { - MessageBox.Show("Prior to Importing Procedures you must set the Referenced Object Database", "No RO Database set", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - return; - } - int ownerid = MySessionInfo.CheckOutItem(dvi.VersionID, CheckOutType.DocVersion); - dlgExportImport dlg = new dlgExportImport("Import", dvi, this); - dlg.MyNewProcedure = null; - dlg.ExternalTransitionItem = null; - dlg.ShowDialog(this); - MySessionInfo.CheckInItem(ownerid); - if(dlg.MyNewProcedure != null) - tv.AddNewNode(dlg.MyNewProcedure); - if (dlg.ExternalTransitionItem != null) - tc.OpenItem(dlg.ExternalTransitionItem); - } - } - if (pi != null) - { - string msg = string.Empty; - bool ok = MySessionInfo.CanCheckOutItem(pi.ItemID, CheckOutType.Procedure, ref msg); - if (!ok) - { - MessageBox.Show(this, msg, "Export Procedure Unavailable"); - } - else - { - int ownerid = MySessionInfo.CheckOutItem(pi.ItemID, CheckOutType.Procedure); - dlgExportImport dlg = new dlgExportImport("Export", pi, this); - dlg.ShowDialog(this); - MySessionInfo.CheckInItem(ownerid); - } - } - } - - private void MakeDatabaseChanges() - { - // September 2012: Decided to store roimages as zipped. Any previous data may not have them zipped. - // Check the top folders config to see, and if needed, zip them: - ROImageInfo.CompressAllExistingImages += new ROImageInfoCompressionEvent(ROImageInfo_CompressAllExistingImages); - ROImageInfo.ZipImages(); - ROImageInfo.CompressAllExistingImages -= new ROImageInfoCompressionEvent(ROImageInfo_CompressAllExistingImages); - - } - - void ROImageInfo_CompressAllExistingImages(object sender, ROImageInfoCompressionEventArgs args) - { - switch (args.Type) - { - case ROImageCompressionEventType.Complete: - ProgBarText = "Compressing Complete"; - break; - case ROImageCompressionEventType.Initialize: - ProgBarMax = args.Total; - ProgBarText = "Compressing RO Images"; - break; - case ROImageCompressionEventType.Update: - ProgBarValue = args.Current; - ProgBarText = args.FileName; - break; - default: - break; - } - } - - static string _ErrorLogFileName; - - public static string ErrorLogFileName - { - get { return frmVEPROMS._ErrorLogFileName; } - set { frmVEPROMS._ErrorLogFileName = value; } - } - static bool ChangeLogFileName(string AppenderName, string NewFilename) - { - log4net.Repository.ILoggerRepository RootRep; - RootRep = log4net.LogManager.GetRepository(); - foreach (log4net.Appender.IAppender iApp in RootRep.GetAppenders()) - { - if (iApp.Name.CompareTo(AppenderName) == 0 - && iApp is log4net.Appender.FileAppender) - { - log4net.Appender.FileAppender fApp = (log4net.Appender.FileAppender)iApp; - string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); - //fApp.File = folderPath + @"\VEPROMS\" + (Volian.Base.Library.VlnSettings.GetCommand("U","") + "_").TrimStart("_".ToCharArray()) + NewFilename; - fApp.File = folderPath + @"\VEPROMS\" + (Volian.Base.Library.VlnSettings.GetCommand("prefix", "") + "_").TrimStart("_".ToCharArray()) + NewFilename; - ErrorLogFileName = fApp.File; - fApp.ActivateOptions(); - return true; // Appender found and name changed to NewFilename - } - } - return false; - } - - void displayApplicability_ApplicabilityViewModeChanged(object sender, EventArgs args) - { - if (tc.SelectedDisplayTabItem == null) return; - StepPanel pnl = tc.SelectedDisplayTabItem.MyStepTabPanel.MyStepPanel; - if (pnl != null) - { - pnl.ApplDisplayMode = displayApplicability.ViewMode; - displayHistory.ApplDisplayMode = pnl.ApplDisplayMode; - //added by jcb 20130718 to support enabling/diabling create pdf button until user selects a unit - if (pnl.ApplDisplayMode > 0) - { - pnl.MyStepTabPanel.MyStepTabRibbon.btnPdfCreate.Enabled = true; - pnl.MyStepTabPanel.MyStepTabRibbon.btnCASCreate.Enabled = true; - pnl.MyStepTabPanel.MyStepTabRibbon.btnReviewCreatePDF.Enabled = true; - btnPrint.Visible = true; - } - else - { - pnl.MyStepTabPanel.MyStepTabRibbon.btnPdfCreate.Enabled = false; - pnl.MyStepTabPanel.MyStepTabRibbon.btnCASCreate.Enabled = false; - pnl.MyStepTabPanel.MyStepTabRibbon.btnReviewCreatePDF.Enabled = false; - btnPrint.Visible = false; - } - //end added by jcb 20130718 - } - } - - void tv_ViewPDF(object sender, vlnTreeViewPdfArgs args) - { - byte[] buffer; - if (args.MyWatermark != string.Empty) - buffer = PromsPrinter.WatermarkPDF(args.MyBuffer, args.MyWatermark); - else - buffer = args.MyBuffer; - string fileName = Volian.Base.Library.VlnSettings.TemporaryFolder + "\\" + args.MyFilename; - try - { - FileStream fs = new FileStream(fileName, FileMode.Create); - fs.Write(buffer, 0, buffer.Length); - fs.Close(); - System.Diagnostics.Process.Start(fileName); - } - catch (Exception ex) - { - StringBuilder sb = new StringBuilder(); - sb.AppendLine("Could not create"); - sb.AppendLine(); - sb.AppendLine(fileName + "."); - sb.AppendLine(); - sb.AppendLine("If it is open, close and retry."); - MessageBox.Show(sb.ToString(), "Error on CreatePdf",MessageBoxButtons.OK,MessageBoxIcon.Warning); -// MessageBox.Show("Could not create " + fileName + ". If it is open, close and retry.", "Error on CreatePdf"); - } - } - - void displayHistory_AnnotationRestored(AnnotationInfo restoredAnnotationInfo, ItemInfo currentItem) - { - ctrlAnnotationDetails.UpdateAnnotationGrid(currentItem); - } - - void tv_ReportAllProceduresInconsistencies(object sender, vlnTreeEventArgs args) - { - DocVersionInfo dvi = (args.Node as VETreeNode).VEObject as DocVersionInfo; - if (dvi == null) return; - this.Cursor = Cursors.WaitCursor; - ItemInfoList iil = ItemInfoList.GetAllInconsistencies(dvi.VersionID); - Volian.Print.Library.PDFConsistencyCheckReport rpt = new Volian.Print.Library.PDFConsistencyCheckReport(Volian.Base.Library.VlnSettings.TemporaryFolder + @"\AllInconsistencies.pdf", iil); - rpt.BuildAllReport(dvi); - this.Cursor = Cursors.Default; - } - - void tv_ApproveSomeProcedures(object sender, vlnTreeEventArgs args) - { - DocVersionInfo dvi = (args.Node as VETreeNode).VEObject as DocVersionInfo; - if (dvi == null) return; - tc.SaveCurrentEditItem(); - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(dvi.VersionID, CheckOutType.DocVersion, ref message)) - { - MessageBox.Show(this, message, "Working Draft Has Items Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; - } - int ownerid = MySessionInfo.CheckOutItem(dvi.VersionID, CheckOutType.DocVersion); - dvi.DocVersionConfig.SelectedSlave = args.UnitIndex; - dlgApproveProcedure dlg = new dlgApproveProcedure(dvi, true, this); - dlg.MySessionInfo = MySessionInfo; - dlg.ShowDialog(this); - displayHistory.RefreshList(); - dvi.DocVersionConfig.SelectedSlave = 0; - MySessionInfo.CheckInItem(ownerid); - } - - void tv_ApproveAllProcedures(object sender, vlnTreeEventArgs args) - { - DocVersionInfo dvi = (args.Node as VETreeNode).VEObject as DocVersionInfo; - if (dvi == null) return; - tc.SaveCurrentEditItem(); - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(dvi.VersionID, CheckOutType.DocVersion, ref message)) - { - MessageBox.Show(this, message, "Working Draft Has Items Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; - } - int ownerid = MySessionInfo.CheckOutItem(dvi.VersionID, CheckOutType.DocVersion); - dvi.DocVersionConfig.SelectedSlave = args.UnitIndex; - dlgApproveProcedure dlg = new dlgApproveProcedure(dvi,this); - dlg.MySessionInfo = MySessionInfo; - dlg.ShowDialog(this); - displayHistory.RefreshList(); - dvi.DocVersionConfig.SelectedSlave = 0; - MySessionInfo.CheckInItem(ownerid); - } - - void tv_RefreshCheckedOutProcedures(object sender, vlnTreeEventArgs args) - { - OwnerInfoList.Reset(); - OwnerInfoList oil = OwnerInfoList.Get(); - Dictionary dicProcCheckedOut = new Dictionary(); - Dictionary dicDocCheckedOut = new Dictionary(); - foreach (OwnerInfo oi in oil) - { - if (oi.SessionID != MySessionInfo.SessionID && oi.OwnerType == (byte)CheckOutType.Procedure) - dicProcCheckedOut.Add(oi.OwnerItemID, oi.OwnerID); - else if (oi.SessionID != MySessionInfo.SessionID && oi.OwnerType == (byte)CheckOutType.Document) - dicDocCheckedOut.Add(oi.OwnerItemID, oi.OwnerID); - } - if (args.Node.IsExpanded) - { - foreach (TreeNode tn in args.Node.Nodes) - { - ProcedureInfo pi = (tn as VETreeNode).VEObject as ProcedureInfo; - if (pi != null && dicProcCheckedOut.ContainsKey(pi.ItemID)) - tn.ForeColor = Color.Red; - else - tn.ForeColor = Color.Black; - bool expanded = tn.IsExpanded; - if (!expanded) - tn.Expand(); - foreach (TreeNode tnn in tn.Nodes) - { - SectionInfo si = (tnn as VETreeNode).VEObject as SectionInfo; - if (si != null && si.MyContent.MyEntry != null) - { - if (dicDocCheckedOut.ContainsKey(si.MyContent.MyEntry.DocID)) - tnn.ForeColor = Color.Red; - else - tnn.ForeColor = Color.Black; - } - } - if (!expanded) - tn.Collapse(); - } - } - } - - void tv_ProcedureCheckedOutTo(object sender, vlnTreeEventArgs args) - { - ProcedureInfo pi = null; - SectionInfo si = null; - pi = (args.Node as VETreeNode).VEObject as ProcedureInfo; - if(pi == null) - si = (args.Node as VETreeNode).VEObject as SectionInfo; - UserInfo ui = UserInfo.GetByUserID(MySessionInfo.UserID); - dlgCheckedOutProcedure cop = new dlgCheckedOutProcedure(pi, si, ui); - cop.ShowDialog(this); - tv_RefreshCheckedOutProcedures(sender, new vlnTreeEventArgs(args.Node.Parent, null, 0)); - } - - void tv_ApproveProcedure(object sender, vlnTreeEventArgs args) - { - ProcedureInfo pi = (args.Node as VETreeNode).VEObject as ProcedureInfo; - pi.MyDocVersion.DocVersionConfig.SelectedSlave = args.UnitIndex; - if (pi == null) return; - tc.SaveCurrentEditItem(pi); - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(pi.ItemID, CheckOutType.Procedure, ref message)) - { - MessageBox.Show(this, message, "Procedure Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; - } - int ownerid = MySessionInfo.CheckOutItem(pi.ItemID, 0); - dlgApproveProcedure dlg = new dlgApproveProcedure(pi,this); - dlg.MySessionInfo = MySessionInfo; - dlg.ShowDialog(this); - displayHistory.RefreshList(); - pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0; - MySessionInfo.CheckInItem(ownerid); - } - - void tv_PrintAllProcedures(object sender, vlnTreeEventArgs args) - { - DocVersionInfo dvi = (args.Node as VETreeNode).VEObject as DocVersionInfo; - if (dvi == null) return; - tc.SaveCurrentEditItem(); - DlgPrintProcedure prnDlg = new DlgPrintProcedure(dvi); - prnDlg.MySessionInfo = MySessionInfo; - prnDlg.SelectedSlave = args.UnitIndex; - prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window - } - void tv_PrintProcedure(object sender, vlnTreeEventArgs args) - { - ProcedureInfo pi = (args.Node as VETreeNode).VEObject as ProcedureInfo; - pi.MyDocVersion.DocVersionConfig.SelectedSlave = args.UnitIndex; - if (pi == null) return; - tc.SaveCurrentEditItem(pi); - DlgPrintProcedure prnDlg = new DlgPrintProcedure(pi); - prnDlg.MySessionInfo = MySessionInfo; - prnDlg.SelectedSlave = args.UnitIndex; -// prnDlg.Show(this); // RHM 20120925 - Center dialog over PROMS window - prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window - pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0; - } - void tv_CreateContinuousActionSummary(object sender, vlnTreeEventArgs args) - { - DialogResult dr = System.Windows.Forms.DialogResult.Yes; - ProcedureInfo pi = (args.Node as VETreeNode).VEObject as ProcedureInfo; - pi.MyDocVersion.DocVersionConfig.SelectedSlave = args.UnitIndex; - if (pi == null) return; - tc.SaveCurrentEditItem(pi); - DlgPrintProcedure prnDlg = new DlgPrintProcedure(pi, true); - prnDlg.MySessionInfo = MySessionInfo; - prnDlg.SelectedSlave = args.UnitIndex; - prnDlg.Automatic = true; - prnDlg.CreateContinuousActionSummary = true; - prnDlg.OpenAfterCreate = (dr == System.Windows.Forms.DialogResult.Yes); - prnDlg.Prefix = "CASTMP_"; // prefix the temporary procedure PDF file that is generated (to grab page numbers) - prnDlg.SetupForProcedure(); - prnDlg.CreatePDF(); - pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0; - } - void RefreshDisplayHistory(object sender) - { - displayHistory.RefreshChangeList(); - } - void displayHistory_HistorySelectionChanged(object sender, DisplayHistoryEventArgs args) - { - tc.OpenItem(ItemInfo.Get(args.ItemID)); - } - void displayHistory_SummaryPrintRequest(object sender, DisplayHistoryReportEventArgs args) - { - Volian.Print.Library.PDFChronologyReport myChronoRpt = new Volian.Print.Library.PDFChronologyReport(args.ReportTitle, args.ProcedureInfo, args.AuditList, args.AnnotationList); - myChronoRpt.BuildSummary(); - } - void displayHistory_ChronologyPrintRequest(object sender, DisplayHistoryReportEventArgs args) - { - Volian.Print.Library.PDFChronologyReport myChronoRpt = new Volian.Print.Library.PDFChronologyReport(args.ReportTitle, args.ProcedureInfo, args.AuditList, args.AnnotationList); - myChronoRpt.BuildChronology(); - } - DialogResult tv_NodePSI(object sender, vlnTreeEventArgs args) - { - VETreeNode vNode = (VETreeNode)args.Node; - IVEDrillDownReadOnly veObj = vNode.VEObject; - ProcedureInfo myProc = veObj as ProcedureInfo; - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(myProc.ItemID, CheckOutType.Procedure, ref message)) - { - MessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return DialogResult.None; - } - int ownerID = MySessionInfo.CheckOutItem(myProc.ItemID, 0); - frmPSI fpsi = new frmPSI(myProc); - DialogResult dr = fpsi.ShowDialog(this); - MySessionInfo.CheckInItem(ownerID); - return dr; - } - DialogResult tv_NodeSI(object sender, vlnTreeEventArgs args) - { - VETreeNode vNode = (VETreeNode)args.Node; - IVEDrillDownReadOnly veObj = vNode.VEObject; - // see if working draft or folder & get associated 'SI' info from its config. - // For now, do folder. - bool doFolder = true; - FolderInfo myFolder = veObj as FolderInfo; - DocVersionInfo myDV = veObj as DocVersionInfo; ; - if (myFolder == null) doFolder = false; - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(doFolder?myFolder.FolderID:myDV.VersionID, doFolder?CheckOutType.Folder:CheckOutType.DocVersion, ref message)) - { - MessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return DialogResult.None; - } - string strConfig = doFolder ? myFolder.Config : myDV.Config; - FormatInfo fi = doFolder ? myFolder.ActiveFormat : myDV.ActiveFormat; - if (fi == null) - { - MessageBox.Show("You must define a format at this level before access of Specific Information"); - return DialogResult.Cancel; - } - int ownerID = MySessionInfo.CheckOutItem(doFolder ? myFolder.FolderID : myDV.VersionID, doFolder ? CheckOutType.Folder : CheckOutType.DocVersion); - frmSI fsi = new frmSI(fi.PlantFormat.FormatData.SI, strConfig, doFolder, myFolder, myDV); - DialogResult dr = fsi.ShowDialog(this); - MySessionInfo.CheckInItem(ownerID); - return dr; - } - /// - /// Activate tmrTreeView so that the newly created Step recieves focus - /// - /// - /// - void tv_NodeInsert(object sender, vlnTreeEventArgs args) - { - tmrTreeView.Enabled = true; - } - void frmVEPROMS_Activated(object sender, EventArgs e) - { - if (ActiveControl == tc) tc.HideCaret(); - // refresh anything that pertains to external files or programs: - - // if ro.fst was 'updated' from the roeditor, enable the update ro.fst values on - // the steptabribbon. - if (tc.ShuttingDown) return; - if (SelectedStepTabPanel!=null && SelectedStepTabPanel.MyStepTabRibbon != null) - SelectedStepTabPanel.MyStepTabRibbon.SetUpdRoValBtn(SelectedStepTabPanel.MyStepTabRibbon.NewerRoFst()); - } - // Add a tree node for a procedure if this is the first procedure in the docversion, added from - // step editor (used for creating enhanced procedure in empty docversion) - void MyStepTabRibbon_AddProcToDocVersionInTree(object sender, StepTabRibbonEventArgs args) - { - tv.AdjustTree(args.Proc as ProcedureInfo); - } - void MyStepTabRibbon_PrintRequest(object sender, StepTabRibbonEventArgs args) - { - // Fix for B2013-173: - // if the user did the print by using the shortcut keys 'Ctrl-P' the arguments sent in - // is the first opened procedure rather than the active procedure. So check for this - // and if they are not the same, use the CurrentItem from the main frmVEPROMS. - ProcedureInfo piThis = null; - if (_CurrentItem != null) piThis = _CurrentItem.MyProcedure; - ProcedureInfo pi = args.Proc as ProcedureInfo; - if (piThis != null && pi.ItemID != piThis.ItemID) pi = piThis; - - //added by jcb 20130718 to support create pdf button when multiunit and user selects a unit - pi.MyDocVersion.DocVersionConfig.SelectedSlave = pi.ProcedureConfig.SelectedSlave; - //end added by jcb 20130718 - if (pi == null) return; - DlgPrintProcedure prnDlg = new DlgPrintProcedure(pi); - //added by jcb 20130718 to support create pdf button when multiunit and user selects a unit - prnDlg.SelectedSlave = pi.ProcedureConfig.SelectedSlave == 0 ? -1 : pi.ProcedureConfig.SelectedSlave; - prnDlg.MySessionInfo = MySessionInfo; - //end added by jcb 20130718 - prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window - //added by jcb 20130718 to support create pdf button when multiunit and user selects a unit - pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0; - //end added by jcb 20130718 - } - void displaySearch1_PrintRequest(object sender, DisplaySearchEventArgs args) - { - Volian.Print.Library.PDFReport myReport = new Volian.Print.Library.PDFReport(args.ReportTitle, args.TypesSelected, args.MyItemInfoList, - Volian.Base.Library.VlnSettings.TemporaryFolder + @"\searchresults.pdf"); - if (args.SearchString != null) - myReport.SearchString = args.SearchString; - if (!args.ReportTitle.Contains("Annotation")) - { - int annotationCount = 0; - foreach (ItemInfo itm in args.MyItemInfoList) - annotationCount += itm.ItemAnnotationCount; - if (annotationCount > 0) - myReport.ShowAnnotations = (MessageBox.Show("Show Annotations", "Include Annotations", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes); - } - myReport.Build(); - } - - void displayLibDocs_PrintRequest(object sender, DisplayLibDocEventArgs args) - { - Volian.Print.Library.PDFReport myReport = new Volian.Print.Library.PDFReport(args.ReportTitle, args.LibDocList, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\LibDocUsage.pdf"); - myReport.Build(); - } - - void displayReports_PrintRequest(object sender, DisplayReportsEventArgs args) - { - if (args.TypesSelected == "RO Usage") - { - Volian.Print.Library.PDFReport myReport = new Volian.Print.Library.PDFReport(args.ReportTitle, args.MyItemInfoList, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\ROUsageReport.pdf", args.SortUsageByProcedure,args.IncludeMissingROs); - myReport.Build(); - } - else if (args.TypesSelected == "Complete RO Report") - { - Volian.Print.Library.PDFReport myReport = new Volian.Print.Library.PDFReport(args.ReportTitle, args.RODataFile, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\CompleteROReport.pdf", args.RofstLookup, args.CompleteROReport, args.ConvertCaretToDelta, args.IncludeEmptyROFields); - myReport.Build(); - } - else if (args.TypesSelected == "RO Summary Report") - { - Volian.Print.Library.PDFReport myReport = new Volian.Print.Library.PDFReport(args.ReportTitle, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\ROSummaryReport.pdf", args.RofstLookup, args.ROListForReport); - myReport.Build(); - - } - } - - - bool tv_InsertItemInfo(object sender, vlnTreeItemInfoInsertEventArgs args) - { - // Don't select the newly created Step. This will be handled by tmrTreeView - return tc.InsertRTBItem(args.MyItemInfo, args.StepText, args.InsertType, args.FromType, args.Type, false); - } - private bool tv_DeleteItemInfo(object sender, vlnTreeItemInfoEventArgs args) - { - if (displayHistory.MyEditItem != null && displayHistory.MyItemInfo.MyProcedure.ItemID == args.MyItemInfo.ItemID) - displayHistory.MyEditItem = null; - // bug fix B2016-005 - set MyCopyStep to null. This will take the paste options off of the tree node context menus. jsj 4-19-2016 - // B2016-105 - added null reference check -jsj - if (tc.MyCopyStep != null && args.MyItemInfo.ItemID == tc.MyCopyStep.ItemID) - tc.MyCopyStep = null; - bool rtval = tc.DeleteRTBItem(args.MyItemInfo); - // Also disable the paste options on the ribbon if it is open. jsj 4-19-2016 - if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.MyStepTabPanel != null) // MyStepTabPanel will be null if the active tab is a Word Attachment - { - StepPanel pnl = tc.SelectedDisplayTabItem.MyStepTabPanel.MyStepPanel; - if (pnl != null) - pnl.MyStepTabPanel.MyStepTabRibbon.SetPasteButtons(false); - } - return rtval; - } - private bool tv_PasteItemInfo(object sender, vlnTreeItemInfoPasteEventArgs args) - { - return tc.PasteRTBItem(args.MyItemInfo, args.CopyStartID, args.PasteType, (int)args.Type); - } - private void frmVEPROMS_FormClosing(object sender, FormClosingEventArgs e) - { - tc.ShuttingDown = true; // This keeps PROMS from Hanging under certain circumstances - foreach (DisplayTabItem dti in tc.MyBar.Items) - { - if (dti.MyDSOTabPanel != null) - dti.MyDSOTabPanel.CloseDSO(); - } - _MyLog.WarnFormat("frmVEPROMS_FormClosing"); - if (MyParent == null) - { - if (MyActivityTimer != null) MyActivityTimer.Dispose(); - if (MySessionInfo != null) MySessionInfo.EndSession(); - // Save the location and size of the VE-PROMS appication for this user - if (this.WindowState == FormWindowState.Normal) - { - Settings.Default.Location = this.Location; - Settings.Default.Size = this.Size; - } - if (this.MyVersionWindowList != null) - Settings.Default.VersionWindows = this.MyVersionWindowList.ToSettings(); - Settings.Default.WindowState = this.WindowState; - Settings.Default.QATItems = ribbonControl1.QatLayout; - SaveMRU(); - //Settings.Default.Save(); - Volian.Base.Library.DebugPagination.Close(); - Volian.Base.Library.DebugText.Close(); - } - } - void frmVEPROMS_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e) - { - // Close any open documents - tc.Dispose(); - // RHM 20121010 - // Something was causing the process to remain in memory for an extended period of time - // after printing procedures. The following lines kills the process immediately. - if (MyParent == null) - { - try - { - System.Diagnostics.Process.GetCurrentProcess().Kill(); - } - catch (Exception ex) - { - _MyLog.Warn("Attempting to Close", ex); - } - } - } - // Get the "Procedures" Panel Heading (title). - // by default the heading is "Procedures" (handled in the getting from the config) - // the heading is stored in the "title" field of the folder config. - // we currently only use the "title" field for the top (VEPROMS) tree node. - private string getProcedurePanelHeading() - { - VETreeNode jj_vetn = (VETreeNode)tv.Nodes[0]; // the VEPROMS tree node - return ((FolderConfig)jj_vetn.VEObject.MyConfig).Title; // get the panel heading - } - private int getTimeout() - { - VETreeNode jj_vetn = (VETreeNode)tv.Nodes[0]; // the VEPROMS tree node - string s = ((FolderConfig)jj_vetn.VEObject.MyConfig).Timeout; // get the panel heading - int result = 30; - if (!int.TryParse(s, out result)) - result = 30; - return result; - } - - private Timer _RefreshTimer; - - public Timer RefreshTimer - { - get - { - if (_RefreshTimer == null) - { - _RefreshTimer = new Timer(); - _RefreshTimer.Interval = 20000; // - _RefreshTimer.Enabled = true; - _RefreshTimer.Tick += _RefreshTimer_Tick; - } - return _RefreshTimer; - } - } - private bool _RefreshTimerActive = false; - - public bool RefreshTimerActive - { - get { return _RefreshTimerActive; } - set { _RefreshTimerActive = value; } - } - void _RefreshTimer_Tick(object sender, EventArgs e) - { - //_MyLog.DebugFormat("_RefreshTimer_Tick {0}", RefreshTimerActive); - if (RefreshTimerActive) - { - RefreshTimerActive = false; - if (PauseRefresh) return; - RefreshChanged(this); - } - } - - private void btnStepRTF_Click(object sender, System.EventArgs e) - { - // Only simulate Threaded Timer Ping if in the debugger - if (System.Diagnostics.Process.GetCurrentProcess().ProcessName.ToLower().EndsWith("vshost")) - { - PingSession(null); - StartRefreshChanged(null); - //RefreshChanged(null); - //if (tc.MyStepRTB != null) - //{ - // StepConfig sc = new StepConfig(tc.MyStepRTB.MyItemInfo.MyContent.Config); - // if (sc.Step_SourceToBackground != null) - // OpenMyItem(sc.Step_SourceToBackground); - // if(sc.Step_BackgroundToSource != null) - // OpenMyItem(sc.Step_BackgroundToSource); - - //frmStepRTF frm = new frmStepRTF(); - //frm.MyStepRTB = tc.MyStepRTB; - //frm.Show(); - //} - } - } - - private SessionInfo _MySessionInfo; - public SessionInfo MySessionInfo - { - get { - if (_MySessionInfo == null) - _MySessionInfo = MyParent.MySessionInfo; - return _MySessionInfo; - } - set { _MySessionInfo = value; } - } - private System.Threading.Timer MyActivityTimer; - private System.Threading.Timer MyRefreshTimer; - private DevComponents.DotNetBar.ButtonItem btnManageSecurity; - private DevComponents.DotNetBar.ButtonItem btnResetSecurity; - private DevComponents.DotNetBar.ButtonItem btnAdministrativeTools; - private TabItemsToClose _MyCloseTabList = new TabItemsToClose(); - public TabItemsToClose MyCloseTabList - { - get { return _MyCloseTabList; } - } - private bool _DisablePing = false; - public bool DisablePing - { - get { return _DisablePing; } - set - { - _DisablePing = value; - _MyLog.WarnFormat("DisableSessionPing = {0}", value); - } - } - private void PingSession(Object obj) - { - MySemaphore.WaitOne(); - if (!DisablePing) - { - List myList = MySessionInfo.PingSession(); - foreach (DisplayTabItem dti in tc.MyBar.Items) - { - if (!myList.Contains(dti.OwnerID)) - MyCloseTabList.PushDTI(dti); - } - } - MySemaphore.Release(); - } - WindowsFormsSynchronizationContext mUIContext = new WindowsFormsSynchronizationContext(); - public void MyFindNodeAndExpand(object obj) - { - if (tv == null || tv.SelectedNode == null) return; - IVEDrillDownReadOnly veObj1 = ((tv.SelectedNode as VETreeNode).VEObject as IVEDrillDownReadOnly); - int id = (int)obj; - ItemInfo ii = ItemInfo.Get(id); - ii.ResetParts(); - using (Item i = Item.Get(id)) - ItemInfo.Refresh(i); - tv.RefreshRelatedNode(ii); - IVEDrillDownReadOnly veObj2 = ((tv.SelectedNode as VETreeNode).VEObject as IVEDrillDownReadOnly); - if (veObj1.ToString() != veObj2.ToString()) - { - VETreeNode tnNew = null; - foreach (VETreeNode tn in tv.SelectedNode.Nodes) - { - if (tn.VEObject.ToString() == veObj1.ToString()) - tnNew = tn; - } - if (tnNew != null) tv.SelectedNode = tnNew; - } - } - private void StartRefreshChanged(Object obj) - { - //_MyLog.Debug("StartRefreshChanged"); - //if (SkipRefresh) return; - MySemaphore.WaitOne(); - RefreshTimerActive = !PauseRefresh; - MySemaphore.Release(); - } - private void RefreshChanged(Object obj) - { - //if (SkipRefresh) return; - //MySemaphore.WaitOne(); - Int64 lastChanged = 0; - //_MyLog.WarnFormat(">>> RefreshChanged"); - try - { - //Int64 lastChanged = 0; - if (MySessionInfo.ChangedItems.Count > 0) - { - foreach (int id in MySessionInfo.ChangedItems.Keys) - { - if (ItemInfo.IsInCache(id)) - //mUIContext.Post(MyFindNodeAndExpand, id); - MyFindNodeAndExpand(id); - } - } - if (MySessionInfo.ChangedContents.Count > 0) - foreach (int id in MySessionInfo.ChangedContents.Keys) - { - if (ContentInfo.IsInCache(id)) - { - ContentInfo ci = ContentInfo.Get(id); - //if (ci.LastChangedInt64 > MySessionInfo.LastChangedInt64) - if (MySessionInfo.LastContentChange >= ci.LastChangedInt64) - { - using (Content c = Content.Get(id)) - { - ContentInfo.Refresh(c); - } - } - } - lastChanged = MySessionInfo.ChangedContents[id]; - } - MySessionInfo.ChangedItems.Clear(); - MySessionInfo.ChangedContents.Clear(); - if (lastChanged > 0) - { - MySessionInfo.LastContentChange = lastChanged; - RefreshLastChange(); - } - } - catch - { - } - //MySemaphore.Release(); - //_MyLog.DebugFormat("{0},{1:X},{2:X},{3:X}", DateTime.Now.ToLongTimeString(), lastChanged, MySessionInfo.LastContentChange, MySessionInfo.LastChangedInt64); - } - private int TotalCount(TreeNodeCollection tns) - { - int total = tns.Count; - foreach (TreeNode tn in tns) - total += TotalCount(tn.Nodes); - return total; - } - private bool ByteArrayIsEmpty(byte[] myArray) - { - for (int i = 0; i < myArray.Length; i++) - { - if (myArray[i] != 0) - return false; - } - return true; - } - - public UserInfo MyUserInfo = null; - - public VersionWindowList MyVersionWindowList; - public ContentInfo ci1; - public ContentInfo ci2; - public ContentInfo ci3; - public Timer tmrCloseTabItems; - public System.Threading.Semaphore MySemaphore = new System.Threading.Semaphore(1, 1); - private void frmVEPROMS_Load(object sender, EventArgs e) - { - InitializeSecurity(); - UpdateUser(); - btnManageSecurity = new ButtonItem("btnManageSecurity", "Manage Security"); - btnAdmin.SubItems.Add(btnManageSecurity); - btnManageSecurity.Click += new EventHandler(btnManageSecurity_Click); - //added by jcb - //menu item to reset security - //requires password to implement - btnResetSecurity = new ButtonItem("btnResetSecurity", "Reset Security"); - btnAdmin.SubItems.Add(btnResetSecurity); - btnResetSecurity.Click += new EventHandler(btnResetSecurity_Click); - //end added by jcb - //batch refresh transitions - btnAdministrativeTools = new ButtonItem("btnAdministrativeTools", "Administrative Tools"); - btnAdministrativeTools.Click += new EventHandler(btnAdministrativeTools_Click); - btnAdmin.SubItems.Add(btnAdministrativeTools); - this.superTooltip1.SetSuperTooltip(btnPrint, new SuperTooltipInfo("Create PDF", null, null, null, null, eTooltipColor.Gray)); - this.superTooltip1.SetSuperTooltip(btnExit, new SuperTooltipInfo("Exit", null, null, null, null, eTooltipColor.Gray)); - this.superTooltip1.SetSuperTooltip(btnOptions, new SuperTooltipInfo("Options", null, null, null, null, eTooltipColor.Gray)); - this.superTooltip1.SetSuperTooltip(btnManageSecurity, new SuperTooltipInfo("Manage Security", null, null, null, null, eTooltipColor.Gray)); - this.superTooltip1.SetSuperTooltip(btnResetSecurity, new SuperTooltipInfo("Reset Security",null, null, null, null, eTooltipColor.Gray)); - this.superTooltip1.SetSuperTooltip(btnAdministrativeTools, new SuperTooltipInfo("Administrative Tools",null, null, null, null, eTooltipColor.Gray)); - this.superTooltip1.SetSuperTooltip(btnUpdateFormats, new SuperTooltipInfo("Update Formats",null, null, null, null, eTooltipColor.Gray)); - //end batch refresh transitions - try - { - MyUserInfo = UserInfo.GetByUserID(VlnSettings.UserID); - } - catch - { - MessageBox.Show("This database is not compatible with this version of PROMS. The PROMS program will terminate. Please contact Volian to assist in resolution."); - Application.Exit(); - } - if (MyUserInfo == null) - { - User u = User.MakeUser(VlnSettings.UserID, "", "", "", "", "", "", "", "", "", "", DateTime.Now, VlnSettings.UserID); - Group g = Group.Get(securityRole); - Membership.MakeMembership(u, g, null, ""); - MyUserInfo = UserInfo.Get(u.UID); - } - ctrlAnnotationDetails.MyUserInfo = MyUserInfo; - DisplayRO.MyUserInfo = MyUserInfo; // set the user's security information in the properties RO panel - StepTabRibbon.MyUserInfo = MyUserInfo; // set the user's security information in the ribbon - DisplayTransition.MyUserInfo = MyUserInfo; // set the user's security information in the Transition panel - DisplayTags.MyUserInfo = MyUserInfo; // set the user's security information in the Tags panel - DisplayHistory.MyUserInfo = MyUserInfo; // set the user's security information in the History panel - DisplayApplicability.MyUserInfo = MyUserInfo; // set the user's security information in the Applicability panel - StepRTB.MyUserInfo = MyUserInfo; // set the user's security information in the StepRTB - VlnFlexGrid.MyUserInfo = MyUserInfo; // set the user's security information in the VlnFlexGrid - bool isVisible = MyUserInfo.IsAdministrator(); - btnManageSecurity.Visible = isVisible; - btnUpdateFormats.Visible = isVisible; - btnResetSecurity.Visible = isVisible; - btnAdministrativeTools.Visible = isVisible || HasSetAdministrator(MyUserInfo); - tmrCloseTabItems = new Timer(); - tmrCloseTabItems.Interval = 100; - tmrCloseTabItems.Tick += new EventHandler(tmrCloseTabItems_Tick); - tmrCloseTabItems.Enabled = true; - CloseSessionsNoLongerActive(); - MySessionInfo = SessionInfo.BeginSession(Environment.MachineName, System.Diagnostics.Process.GetCurrentProcess().Id); - if (MySessionInfo == null) - { - MessageBox.Show("This database is locked by the Administrator. Please try again later", "PROMS is Locked"); - Application.Exit(); - } - this.LastContentChange = MySessionInfo.LastContentChange; - //_MyLog.WarnFormat("Original last content change {0}", this.LastContentChange); - RefreshLastChange(); - tc.MySessionInfo = MySessionInfo; - tv.MySessionInfo = MySessionInfo; - tv.MyUserInfo = MyUserInfo; - // 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); - //System.Diagnostics.Process xyzzy = System.Diagnostics.Process.GetCurrentProcess(); - if (!System.Diagnostics.Debugger.IsAttached)// running in Production Mode (Not in the debugger) - { - System.Threading.TimerCallback timerDelegate = new System.Threading.TimerCallback(this.PingSession); - MyActivityTimer = new System.Threading.Timer(timerDelegate, autoEvent, 10000, 10000); - // System.Threading.Thread.Sleep(5000); - // System.Threading.TimerCallback timerRefresh = new System.Threading.TimerCallback(this.StartRefreshChanged); - // RefreshTimer.Enabled = true; - // MyRefreshTimer = new System.Threading.Timer(timerRefresh, autoEvent, 10000, 10000); - } - - //string debugMode = ConfigurationManager.AppSettings["Debug"]; - //VlnSettings.DebugMode = bool.Parse(debugMode); // set debug for the Volian.Controls.Library - // get the saved location and size of the VE-PROMS appication for this user - this.txtSearch.KeyPress += new KeyPressEventHandler(txtSearch_KeyPress); - this.txtSearch.KeyUp += txtSearch_KeyUp; // RHM20150506 Multiline ItemID TextBox - this.txtSearch.TextChanged += txtSearch_TextChanged; // RHM20150506 Multiline ItemID TextBox - this.btnNext.Click += btnNext_Click; // RHM20150506 Multiline ItemID TextBox - this.btnPrint1.Click += btnPrint1_Click; // RHM20150506 Multiline ItemID TextBox - this.btnPrevious.Click += btnPrevious_Click; // RHM20150506 Multiline ItemID TextBox - if (Settings.Default["Location"] != null) this.Location = Settings.Default.Location; - if (Settings.Default["Size"] != null) this.Size = Settings.Default.Size; - //if (Settings.Default["WindowState"] != null) this.WindowState = Settings.Default.WindowState; - //if (Settings.Default.SaveTreeviewExpanded) epProcedures.Expanded = Settings.Default.TreeviewExpanded; - // if the Procedures panel was left open from the last session, then open it - epProcedures.Expanded = Settings.Default.TreeviewExpanded; - if (Settings.Default["QATItems"] != null) ribbonControl1.QatLayout = Settings.Default.QATItems; - - // See if any database 'changes' need done and do them: - MakeDatabaseChanges(); - - _MyMRIList = MostRecentItemList.GetMRILst((System.Collections.Specialized.StringCollection)(Properties.Settings.Default["MRIList"])); - _MyMRIList.AfterRemove += new ItemInfoEvent(_MyMRIList_AfterRemove); - SetupMRU(); - // if the user selected to "Remember Last" (was "Save Expanded") then use the MRU list to - // expand the tree to the last opened procedure - //if (epProcedures.Expanded && _MyMRIList.Count > 0) - if (MyParent == null) - { - if (Settings.Default.SaveTreeviewExpanded && _MyMRIList.Count > 0) - { - tv.AdjustTree(_MyMRIList[0].MyItemInfo.MyProcedure); - tv.SelectedNode.Expand(); - SetCaption(tv.SelectedNode as VETreeNode); - } - } - //get version windows settings - MyVersionWindowList = VersionWindowList.GetVersionWindowList(Properties.Settings.Default.VersionWindows); - tc.SyncEnhancedDocuments = Properties.Settings.Default.SyncEnhancedDocuments; - // Assign the Procedure Panel's title (heading) - epProcedures.TitleText = getProcedurePanelHeading();// get the panel heading - Database.DefaultTimeout = 20 * getTimeout(); - // if the procedure panel is expanded, make sure we enable the splitter so the user can resize the panel - // Bug fix: B2013-89 - expandableSplitter1.Enabled = epProcedures.Expanded; - - displaySearch1.SetupAnnotationSearch(ctrlAnnotationDetails, tc); - AnnotationTypeInfoList.ListChanged += new AnnotationTypeInfoListEvent(AnnotationTypeInfoList_ListChanged); - ctrlAnnotationDetails.SetupAnnotations(displaySearch1); - SetupButtons(); - displayBookMarks.MyDisplayTabControl = tc; // allows bookmark selection to bring up steps/docs - office2007StartButton1.MouseDown += new MouseEventHandler(office2007StartButton1_MouseDown); - //displayRO.EnabledChanged += new EventHandler(displayRO_EnabledChanged); - tc.Enter += new EventHandler(tc_Enter); - tc.Leave += new EventHandler(tc_Leave); - tc.StatusChanged += new DisplayTabControlStatusEvent(tc_StatusChanged); - tc.ToggleRibbonExpanded += new DisplayTabControlEvent(tc_ToggleRibbonExpanded); - tc.OpenEnhancedDocument += tc_OpenEnhancedDocument; - tc.RefreshEnhancedDocument += tc_RefreshEnhancedDocument; - this.Deactivate += new EventHandler(frmVEPROMS_Deactivate); - if (VlnSettings.DemoMode) StepRTB.MyFontFamily = GetFamily("Bookman Old Style"); - displaySearch1.Enter += new EventHandler(displaySearch1_Enter); - displayHistory.Enter += new EventHandler(displayHistory_Enter); - ctrlAnnotationDetails.Enter += new EventHandler(ctrlAnnotationDetails_Enter); - Application.DoEvents(); - if (RunningNewRevision && ShowEULA() != DialogResult.OK) - { - Timer tmrShutDown = new Timer(); - tmrShutDown.Interval = 250; - tmrShutDown.Tick += new EventHandler(tmrShutDown_Tick); - tmrShutDown.Enabled = true; - } - else - tmrAutomatic.Enabled = true; - //// Shutoff UpdateFormats for Production Mode - //if (Volian.Base.Library.VlnSettings.ProductionMode) - // btnAdmin.Visible = false; - StepTabRibbon.PasteNoReturnsSetting = Properties.Settings.Default.PasteNoReturns; - StepTabRibbon.PastePlainTextSetting = Properties.Settings.Default.PastePlainText; - StepTabRibbon.SpecifiedVisioPath = Properties.Settings.Default.VisioPath; - Activate(); - //FolderInfo fi = FolderInfo.Get(1); - //FormatInfo frmI = FormatInfo.Get(fi.FormatID ?? 1); - //if (frmI.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds) - //{ - // dlgChgId dlgCI = new dlgChgId(tc); - // dlgCI.ShowDialog(this); - //} - // RHM20150506 Multiline ItemID TextBox - if (MyParent == null) - { - this.txtSearch.Text = Volian.Base.Library.VlnSettings.GetItemIDs().Replace(",", "\r\n"); - // Open First Item - if (this.txtSearch.Text.Length > 0 && !this.txtSearch.Text.Contains("\r\n")) - CurrentID = txtSearch.Text; - } - } - void tc_RefreshEnhancedDocument(object sender, ItemSelectedChangedEventArgs args) - { - // if the procedure is opened then move to the select step - if (!Properties.Settings.Default.SeparateWindows) - { - tc.RefreshItem(args.MyItemInfo); - } - else - { - int versionID = args.MyItemInfo.MyDocVersion.VersionID; - frmVEPROMS child = null; - if (EnhancedForms.ContainsKey(versionID)) - { - child = EnhancedForms[versionID]; - child.RefreshItem(args.MyItemInfo); - } - } - } - - /// - /// This looks for sessions associated with the current PC and user which are no longer active and removes them. - /// This will in-turn close any related procedure owner records and allow the user to re-open a previously open procedure. - /// - private void CloseSessionsNoLongerActive() - { - SessionInfoList sil = SessionInfoList.Get(); - int i = 0; - foreach(SessionInfo si in sil) - { - if (si.DTSEnd == null && si.MachineName == Environment.MachineName && si.UserID == Volian.Base.Library.VlnSettings.UserID) - { - try - { - System.Diagnostics.Process p = System.Diagnostics.Process.GetProcessById(si.ProcessID); - } - catch (Exception ex)// Process not found - { - Session.Delete(si.SessionID);// Remove Session record associated with a closed process - } - } - else if (si.DTSEnd == null) - i = i + 1; - } - if (i == 0)// Turn-on Change Manger if there are no active Sessions - TurnChangeManagerOn.Execute(); - } - //public bool IsEnhancedDocumentOpen(ItemInfo ii) - //{ - // if (tc.dicEnhancedDocuments.ContainsKey(ii.MyProcedure)) - // return true; - // return false; - //} - Dictionary _EnhancedForms=null; - public Dictionary EnhancedForms - { - get - { - if(_EnhancedForms == null) - { - if (_MyParent == null) - _EnhancedForms = new Dictionary(); - else - _EnhancedForms = MyParent.EnhancedForms; - } - return _EnhancedForms; - } - set { _EnhancedForms = value; } - } - void tc_OpenEnhancedDocument(object sender, ItemSelectedChangedEventArgs args) - { - if (!Properties.Settings.Default.SeparateWindows) - { - tc.OpenItem(args.MyItemInfo); - } - else - { - int versionID = args.MyItemInfo.MyDocVersion.VersionID; - if(MyParent != null && args.MyItemInfo.MyDocVersion.DocVersionConfig.MyEnhancedDocuments.Count > 0 - && !args.MyItemInfo.MyDocVersion.DocVersionConfig.MyEnhancedDocuments.HasSourcePointer) - { - MyParent.OpenItem(args.MyItemInfo); - return; - } - frmVEPROMS child = null; - if (EnhancedForms.ContainsKey(versionID)) - child = EnhancedForms[versionID]; - else - { - child = CreateEnhancedWindow(args.MyItemInfo.MyDocVersion); - } - child.OpenItem(args.MyItemInfo); - //if (!tc.dicEnhancedDocuments.ContainsKey(args.MyItemInfo.MyProcedure.MyDocVersion)) - //{ - // frmEnhanced frm = new frmEnhanced(args.MyItemInfo); - // frm.MySessionInfo = MySessionInfo; - // tc.dicEnhancedDocuments.Add(args.MyItemInfo.MyProcedure.MyDocVersion, frm); - // frm.FormClosed += frm_FormClosed; - // //frm.Show(this); When this was specified the child form displayed on top of the parent form. - // frm.Show(); // With this removed either form can be on top (user selectable - currently active form on top) - //} - //else - //{ - // frmEnhanced frm = tc.dicEnhancedDocuments[args.MyItemInfo.MyProcedure.MyDocVersion]; - // frm.MyItemInfo = args.MyItemInfo; - // frm.OpenItem(); - //} - } - } - private frmVEPROMS CreateEnhancedWindow(DocVersionInfo dvi) - { - frmVEPROMS child; - if (EnhancedForms.ContainsKey(dvi.VersionID)) - { - child = EnhancedForms[dvi.VersionID]; - } - else{ - child = new frmVEPROMS(this, dvi); - EnhancedForms.Add(dvi.VersionID, child); - child.Visible = false; - child.Show(); - foreach (VersionWindow vw in MyVersionWindowList) - if (vw.VersionID == dvi.VersionID) - { - child.SetDesktopBounds(vw.MyRectangle.Left, vw.MyRectangle.Top, vw.MyRectangle.Width, vw.MyRectangle.Height); - break; - } - child.Visible = true; - child.Move += child_MoveOrSize; - child.Resize += child_MoveOrSize; - child.FormClosed += child_FormClosed; - } - return child; - } - void child_FormClosed(object sender, FormClosedEventArgs e) - { - EnhancedForms.Remove((sender as frmVEPROMS).MyDocVersion.VersionID) ; - } - void child_MoveOrSize(object sender, EventArgs e) - { - frmVEPROMS frm = sender as frmVEPROMS; - RectangleConverter rc = new RectangleConverter(); - string str = string.Format("{0}~{1}", frm.MyDocVersion.VersionID, rc.ConvertToString(frm.DesktopBounds)); - MyVersionWindowList.Add(new VersionWindow(str)); - - } - private bool HasSetAdministrator(UserInfo ui) - { - DocVersionInfoList dvil = DocVersionInfoList.Get(); - foreach (DocVersionInfo dvi in dvil) - if (ui.IsSetAdministrator(dvi)) - return true; - return false; - - } - // RHM20150507 Table Scrunch - private TableScrunching _DefaultScrunchingRules = TableScrunching.Phase1 | TableScrunching.Phase5 | TableScrunching.Phase2 | TableScrunching.Phase3 | TableScrunching.Phase4 | TableScrunching.Phase5 | TableScrunching.Phase6 | TableScrunching.Phase7 | TableScrunching.Phase8; - void btnPrint1_Click(object sender, EventArgs e) - { - string[] ids = txtSearch.Text.Split("\r\n ".ToCharArray()); - Dictionary dicProcs= new Dictionary(); - foreach (string id in ids) - { - if(id != "") - { - ItemInfo ii = GetItemInfoFromString(id); - if (!dicProcs.ContainsKey(ii.MyProcedure.ItemID)) - dicProcs.Add(ii.MyProcedure.ItemID, ii.MyProcedure); - } - } - DialogResult dr = System.Windows.Forms.DialogResult.Yes; - //dr = MessageBox.Show("Do you want all of the PDFs to be opened?", "Open After Create", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - // RHM20150507 Table Scrunch - Rtf2Pdf.AllowTableScrunching = cbScrunch.Checked ? _DefaultScrunchingRules : TableScrunching.None; - foreach (int key in dicProcs.Keys) - { - ProcedureInfo proc = dicProcs[key]; - //Console.WriteLine("{0}", proc.ShortPath); - DlgPrintProcedure prnDlg = new DlgPrintProcedure(proc,true);//dvi.DocVersionConfig,pnum); - prnDlg.MySessionInfo = MySessionInfo; - //prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window - prnDlg.Prefix = proc.MyDocVersion.VersionID.ToString() + "_"; - prnDlg.Automatic = true; - prnDlg.OpenAfterCreate = (dr == System.Windows.Forms.DialogResult.Yes); - prnDlg.SetupForProcedure(); - prnDlg.CreatePDF(); - } - } - bool ProcessingPaste = false; - private void txtSearch_TextChanged(object sender, EventArgs e) - { - if (!ProcessingPaste) // RHM20150507 Multiline ItemID TextBox - { - ProcessingPaste = true; - if (txtSearch.Text.Contains("\n")) - { - txtSearch.Text = txtSearch.Text.Trim("\r\n ".ToCharArray()); - txtSearch.SelectionStart = 0; - CurrentID = GetCurrentLine(); - } - btnNext.Visible = btnPrint1.Visible = cbScrunch.Visible = btnPrevious.Visible = txtSearch.Text.Contains("\r\n"); - ProcessingPaste = false; - } - } - void btnPrevious_Click(object sender, EventArgs e) - { - CurrentID = FindPreviousLine(); - } - void btnNext_Click(object sender, EventArgs e) - { - CurrentID = FindNextLine(); - } - public string CurrentID - { - get - { - return GetCurrentLine(); - } - set - { - if (value == null) - { - System.Media.SystemSounds.Beep.Play(); - } - else - OpenMyItem(value); - } - } - private string FindNextLine() - { - if (txtSearch.SelectionLength > 0) - txtSearch.SelectionLength = 0; - string sub = txtSearch.Text.Substring(txtSearch.SelectionStart); - if (sub.Contains("\n")) - { - txtSearch.SelectionStart += sub.IndexOf("\n") + 1; - txtSearch.ScrollToCaret(); - return GetCurrentLine(); - } - return null; - } - private string FindPreviousLine() - { - if (txtSearch.SelectionLength > 0) - txtSearch.SelectionLength = 0; - string sub = txtSearch.Text; - int selStart = 0; - if (txtSearch.SelectionStart == 0) return null; - if (txtSearch.SelectionStart > 2) - { - sub = txtSearch.Text.Substring(0, txtSearch.SelectionStart - 2); - if (sub.Contains("\n")) - selStart = sub.LastIndexOf("\r\n") + 2; - } - txtSearch.SelectionStart = selStart; - txtSearch.ScrollToCaret(); - return GetCurrentLine(); - } - void txtSearch_KeyUp(object sender, KeyEventArgs e) - { - if (e.Control && e.KeyCode == Keys.V) - { - txtSearch.SelectionStart = 0; - txtSearch.SelectionLength = txtSearch.TextLength; - txtSearch.SelectedText = Clipboard.GetText().TrimEnd("\r\n ".ToCharArray()); - btnNext.Visible = btnPrint1.Visible = cbScrunch.Visible = btnPrevious.Visible = txtSearch.Text.Contains("\r\n"); - txtSearch.SelectionLength = 0; - txtSearch.SelectionStart = 0; - txtSearch.ScrollToCaret(); - CurrentID= GetCurrentLine(); - e.Handled = true; - } - if (e.Control && e.KeyCode == Keys.A) - { - txtSearch.SelectionStart = 0; - txtSearch.SelectionLength = txtSearch.TextLength; - e.Handled = true; - } - } - private string GetCurrentLine() - { - while (txtSearch.SelectionStart > 0 && txtSearch.Text[txtSearch.SelectionStart - 1] != '\n') - txtSearch.SelectionStart--; - string sub = txtSearch.Text.Substring(txtSearch.SelectionStart).TrimStart("\r\n ".ToCharArray()); - if (sub.Contains("\r\n")) return sub.Substring(0, sub.IndexOf("\r\n")); - return sub; - } - void txtSearch_KeyPress(object sender, KeyPressEventArgs e) - { - if (e.KeyChar == '\r') - { - e.Handled = true; - if (txtSearch.Text.Length > 0) - { - if (txtSearch.Text.Contains("\r\n")) // RHM20150506 Multiline ItemID TextBox - CurrentID = GetCurrentLine(); - else - OpenMyItem(txtSearch.Text); - } - } - if (e.KeyChar == 1 || e.KeyChar==22) - { - e.Handled = true; - } - } - - private void OpenMyItem(string str) // RHM20150506 Multiline ItemID TextBox - { - ItemInfo ii = GetItemInfoFromString(str); // RHM20150506 Multiline ItemID TextBox - if (ii != null) - { - tc.OpenItem(ii); - tv.AdjustTree(ii); - } - else - MessageBox.Show(string.Format("Looking for: {0}",str),"No item found"); - } - - private static ItemInfo GetItemInfoFromString(string str) // RHM20150506 Multiline ItemID TextBox - { - ItemInfo ii = null; - int id = 0; - ContentInfo ci = null; - if (str.ToUpper().StartsWith("C=")) - { - if (int.TryParse(str.Substring(2), out id)) - ci = ContentInfo.Get(id); - if (ci != null) - ii = ci.ContentItems[0]; - } - else - { - if (int.TryParse(str, out id)) - ii = ItemInfo.Get(id); - } - return ii; - } - - void btnAdministrativeTools_Click(object sender, EventArgs e) - { - frmBatchRefresh frm = new frmBatchRefresh(); - frm.ProgressBar = bottomProgBar; - frm.MySessionInfo = MySessionInfo; - frm.ShowDialog(this); - } - - void tmrCloseTabItems_Tick(object sender, EventArgs e) - { - tmrCloseTabItems.Enabled = false; - while (MyCloseTabList.CountDTI > 0) - { - DisplayTabItem dti = MyCloseTabList.PopDTI(); - if (dti.MyDSOTabPanel != null) - dti.MyDSOTabPanel.OverrideClose = true; - tc.CloseTabItem(dti); - } - tmrCloseTabItems.Enabled = true; - } - - private void InitializeSecurity() - { - Folder f = Folder.Get(1); - GroupInfo gi = GroupInfo.Get(1); - if (f.FolderConfig.Security_Group == 0) - { - f.FolderConfig.Security_Group = gi.GID; - f.Save(); - } - securityRole = f.FolderConfig.Security_Group; - } - - private string proxyUser; - private void UpdateUser() - { - string newUser = VlnSettings.GetCommand("U", null); - if (newUser != null) - VlnSettings.UserID = newUser; - newUser = VlnSettings.GetCommand("V3Pr0m5" + GetSecurityKey(), null); - if (newUser != null) - { - VlnSettings.UserID = newUser; - UserInfo ui = UserInfo.GetByUserID(VlnSettings.UserID); - User u; - if (ui != null) - { - u = User.Get(ui.UID); - foreach (UserMembership um in u.UserMemberships) - { - if (um.EndDate == null || um.EndDate == string.Empty) - { - Membership m = Membership.Get(um.UGID); - m.EndDate = DateTime.Now.ToShortDateString(); - m.Save(); - } - } - } - else - { - u = User.MakeUser(VlnSettings.UserID, "", "", "", "", "", "", "", "", "", "", DateTime.Now, VlnSettings.UserID); - Group g = Group.GetByGroupName("Administrators"); - Membership.MakeMembership(u, g, null, ""); - } - } - if (MyParent == null) - { - if (VlnSettings.GetCommandFlag("VeauLeeAnn" + GetSecurityKey()) || VlnSettings.GetCommandFlag("VeauLeeAnnXYZZY")) - { - //pop up user list to select from - ContextMenuStrip cms = BuildUserMenu(); - while (proxyUser == null) - { - cms.Show(new System.Drawing.Point((System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - cms.Width) / 2, (System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - cms.Height) / 2)); - System.Windows.Forms.Application.DoEvents(); - } - VlnSettings.UserID = proxyUser; - } - } - lblUser.Text = VlnSettings.UserID; - lblUser.MouseDown += new MouseEventHandler(lblUser_MouseDown); - } - private string GetSecurityKey() - { - Random rnd = new Random(DateTime.Now.Year + DateTime.Now.DayOfYear * 1000); - return rnd.Next(10000).ToString(); - } - void lblUser_MouseDown(object sender, MouseEventArgs e) - { - if (e.Button == MouseButtons.Right) - { - /* -- Devin- Volian0 -- Diane- Volian0 -- Jess- Volian0 -- John- Volian0 -- Kathy- Volian0 -- Jim- JCB2-HP -- Rich- WINDOWS7-RHM -- Paul- Paul-PC -- Michelle- Michelle-PC -- Harry’s Mac- WIN-04QLPEH7JKH -- Harry’s PC- Harry-7100 -- Caitlin- Caitlin-PC - */ - if ("|VOLIAN0|JCB2-HP|BODINE-64|WINDOWS7-RHM|PAUL-PC|MICHELLE-PC|WIN-O4QLPEH7JKH|HARRY-7100|CAITLIN-PC|".Contains("|" + Environment.UserDomainName.ToUpper() + "|")) - { - Random rnd = new Random(DateTime.Now.Year + DateTime.Now.DayOfYear * 1000); - MessageBox.Show(this, GetSecurityKey(), "Today's Security Key"); - } - _MyLog.WarnFormat("Environment.UserName = '{0}'", Environment.UserName); - _MyLog.WarnFormat("Environment.UserDomainName = '{0}'", Environment.UserDomainName); - _MyLog.WarnFormat("Environment.MachineName = '{0}'", Environment.MachineName); - _MyLog.WarnFormat("Environment.OSVersion = '{0}'", Environment.OSVersion); - } - } - - private ContextMenuStrip BuildUserMenu() - { - System.Windows.Forms.ContextMenuStrip cms = new System.Windows.Forms.ContextMenuStrip(); - cms.Items.Add("Choose User"); - System.Windows.Forms.ToolStripMenuItem tsmi = cms.Items[0] as System.Windows.Forms.ToolStripMenuItem; - tsmi.BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.ActiveCaption);// System.Drawing.Color.Pink; - tsmi.ForeColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.ActiveCaptionText); - tsmi.Font = new System.Drawing.Font(tsmi.Font, System.Drawing.FontStyle.Bold); - UserInfoList uil = UserInfoList.Get(); - foreach (UserInfo ui in uil) - { - if (ui.UserMembershipCount > 0) - { - foreach (MembershipInfo mi in ui.UserMemberships) - { - if (mi.EndDate == string.Empty) - { - string txt = string.Format("{0} - {1}", ui.UserID, mi.MyGroup.GroupName); - ToolStripItem tsi = cms.Items.Add(txt, null, new EventHandler(User_Click)); - tsi.Tag = ui; - break; - } - } - } - } - return cms; - } - - private void User_Click(object sender, EventArgs e) - { - ToolStripMenuItem tsmi = sender as ToolStripMenuItem; - if (tsmi != null) - { - UserInfo ui = tsmi.Tag as UserInfo; - proxyUser = ui.UserID; - } - } - void btnManageSecurity_Click(object sender, EventArgs e) - { - dlgManageSecurity dlg = new dlgManageSecurity(); - dlg.ShowDialog(this); - } - void btnResetSecurity_Click(object sender, EventArgs e) - { - string password = string.Empty; - if (ShowInputDialog(ref password) == DialogResult.OK) - { - if(password == "V3Pr0m5") - { - StringBuilder sb = new StringBuilder(); - sb.AppendLine("***** WARNING *****"); - sb.AppendLine(); - sb.AppendLine("This action will delete all Groups, Users and Memberships from the database."); - sb.AppendLine("This action is NOT reversible."); - sb.AppendLine("Following this action the application will terminate."); - sb.AppendLine(); - sb.AppendLine("Are you sure you want to continue?"); - if (MessageBox.Show(sb.ToString(), "Confirm Security Reset", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Stop) == DialogResult.Yes) - { - ResetSecurity.Execute(); - Application.Exit(); - } - } - else - MessageBox.Show("You have entered an incorrect password."); - } - } - private static DialogResult ShowInputDialog(ref string input) - { - System.Drawing.Size size = new System.Drawing.Size(200, 70); - Form inputBox = new Form(); - - inputBox.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - inputBox.ClientSize = size; - inputBox.Text = "Enter Password"; - inputBox.StartPosition = FormStartPosition.CenterScreen; - - System.Windows.Forms.TextBox textBox = new TextBox(); - textBox.Size = new System.Drawing.Size(size.Width - 10, 23); - textBox.Location = new System.Drawing.Point(5, 5); - textBox.PasswordChar = '*'; - textBox.Text = input; - inputBox.Controls.Add(textBox); - - Button okButton = new Button(); - okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - okButton.Name = "okButton"; - okButton.Size = new System.Drawing.Size(75, 23); - okButton.Text = "&OK"; - okButton.Location = new System.Drawing.Point(size.Width - 80 - 80, 39); - inputBox.Controls.Add(okButton); - - Button cancelButton = new Button(); - cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - cancelButton.Name = "cancelButton"; - cancelButton.Size = new System.Drawing.Size(75, 23); - cancelButton.Text = "&Cancel"; - cancelButton.Location = new System.Drawing.Point(size.Width - 80, 39); - inputBox.Controls.Add(cancelButton); - - - DialogResult result = inputBox.ShowDialog(); - input = textBox.Text; - return result; - } - - void tc_StatusChanged(object sender, DisplayTabControlStatusEventArgs args) - { - switch (args.Type) - { - case VolianStatusType.Initialize: - ProgBarMax = args.Count; - ProgBarText = args.Text; - ProgBarValue = 0; - break; - case VolianStatusType.Update: - ProgBarText = args.Text; - ProgBarValue = args.Count; - break; - case VolianStatusType.Complete: - ProgBarText = args.Text; - ProgBarValue = 0; - break; - default: - break; - } - } - void tmrShutDown_Tick(object sender, EventArgs e) - { - (sender as Timer).Enabled = false; - this.Close(); - } - private DialogResult ShowEULA() - { - string eulaFile = string.Format(@"\{0}", VlnSettings.EULAfile); - string strEULA = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + eulaFile; - //string strEULA = System.Environment.CurrentDirectory + eulaFile; - frmViewTextFile ViewFile = new frmViewTextFile(strEULA, RichTextBoxStreamType.PlainText); - ViewFile.Text = "End-User License Agreement"; - ViewFile.ButtonText = "Agree"; - if (ViewFile.ShowDialog() == DialogResult.OK) - { - System.Version ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; - string thisVersion = ver.Major.ToString() + "." + ver.Minor.ToString(); - Properties.Settings.Default.LastVersion = thisVersion; - return DialogResult.OK; - } - return DialogResult.Cancel; - } - private bool RunningNewRevision - { - get - { - string lastVersion = Properties.Settings.Default.LastVersion; - System.Version ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; - string thisVersion = ver.Major.ToString() + "." + ver.Minor.ToString(); - return thisVersion != lastVersion; - } - } - void displayHistory_Enter(object sender, EventArgs e) - { - tc.HideCaret(); - } - void AnnotationTypeInfoList_ListChanged() - { - displaySearch1.SetupAnnotationSearch(ctrlAnnotationDetails, tc); - ctrlAnnotationDetails.SetupAnnotations(displaySearch1); - } - private void RunAutomatic() - { - string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray()); - bool ranAuto = false; - foreach (string parameter in parameters) - { - if(parameter.StartsWith("/P=")) - { - string[] dvstrs = parameter.Substring(3).Split(",".ToCharArray()); - foreach (string dvstr in dvstrs) - { - if (dvstr != "") - { - DocVersionInfo dvi = DocVersionInfo.Get(int.Parse(dvstr)); - if (dvi != null) - { - DlgPrintProcedure prnDlg = new DlgPrintProcedure(dvi, true); - if (dvi.MultiUnitCount == 0) - prnDlg.SelectedSlave = -1; - prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window - //prnDlg.FormClosed += new FormClosedEventHandler(prnDlg_FormClosed); - //while (!_RunNext) Application.DoEvents(); - } - } - ranAuto = true; - } - } - } - if (ranAuto) - { - this.Close(); - } - } - private bool _RunNext = false; - //void prnDlg_FormClosed(object sender, FormClosedEventArgs e) - //{ - // _RunNext = true; - //} - private FontFamily GetFamily(string name) - { - foreach (FontFamily ff in FontFamily.Families) - if (ff.Name == name) return ff; - return null; - } - void tc_ToggleRibbonExpanded(object sender, EventArgs args) - { - Volian.Base.Library.vlnStackTrace.ShowStackLocal("tc_ToggleRibbonExpanded {0}", ribbonControl1.Expanded); - ribbonControl1.Expanded = !ribbonControl1.Expanded; - } - void frmVEPROMS_Deactivate(object sender, EventArgs e) - { - tc.HideCaret(); // Hide the pseudo cursor (caret) - } - void tc_Leave(object sender, EventArgs e) - { - if (tc.ShuttingDown) return; - tc.ShowCaret();// Show the pseudo cursor (caret) - } - void tc_Enter(object sender, EventArgs e) - { - tc.HideCaret();// Hide the pseudo cursor (caret) - } - void displaySearch1_Enter(object sender, EventArgs e) - { - tc.HideCaret();// Hide the pseudo cursor (caret) - } - void ctrlAnnotationDetails_Enter(object sender, EventArgs e) - { - tc.HideCaret();// Hide the pseudo cursor (caret) - } - //void displayRO_EnabledChanged(object sender, EventArgs e) - //{ - // Console.WriteLine("here"); - //} - void _MyMRIList_AfterRemove(object sender) - { - SetupMRU(); - } - private void SetupButtons() - { - if (!VlnSettings.DebugMode) - { - lblItemID.Visible = false; - btnItemInfo.Visible = false; - cmbFont.Visible = false; - btnEditItem.Visible = false; - lblResolution.Visible = false; - txtSearch.Visible = false; - lblLastChange.Visible = false; - btnStepRTF.Visible = false; - } - } - #region MRU - private MostRecentItemList _MyMRIList; - private void SetupMRU() - { - icRecentDocs.SubItems.Clear(); - if (_MyMRIList.Count > 0) - { - LabelItem lblItem = new LabelItem(); - lblItem.Text = "Recent Documents:"; - icRecentDocs.SubItems.Add(lblItem); - //icRecentDocs.SubItems.Add(); - for (int i = 0; i < _MyMRIList.Count; i++) - { - MostRecentItem mri = _MyMRIList[i]; - ButtonItem btnItem = new ButtonItem(); - string menuTitle = mri.MenuTitle.Replace("\u2011", "-").Replace("\u2572", @"\"); - if (i < 9) - btnItem.Text = string.Format("&{0}. {1}", i + 1, menuTitle); - else - btnItem.Text = string.Format(" {1}", i + 1, menuTitle); - btnItem.Tag = mri.ItemID; - btnItem.Tooltip = mri.ToolTip; - btnItem.Click += new EventHandler(btnItem_Click); - icRecentDocs.SubItems.Add(btnItem); - } - } - } - - void btnItem_Click(object sender, EventArgs e) - { - ButtonItem btnItem = (ButtonItem)sender; - MostRecentItem mri = _MyMRIList.Add((int)(btnItem.Tag)); - //SaveMRU(); - SetupMRU(); - if (mri != null) tc.OpenItem(mri.MyItemInfo); - } - private void SaveMRU() - { - if(_MyMRIList != null) Properties.Settings.Default.MRIList = _MyMRIList.ToSettings(); - Properties.Settings.Default.TreeviewExpanded = epProcedures.Expanded; - Properties.Settings.Default.Save(); - } - #endregion - #region Tree View - /// - /// Get the selected tree node's properties - /// - /// VETreeNode - bool SetupNodes(VETreeNode node) - { - if (_MyMRIList.Add(node.VEObject) != null) - SetupMRU(); - #region Sample Display Table Code - // display an exiting table in that rtf grid thing - //if ((_LastStepInfo.MyContent.Type == 20007) || (_LastStepInfo.MyContent.Type == 20009)) - //{ - // //MessageBox.Show("Source Grid"); - // //frmTable newtable1 = new frmTable(_LastStepInfo.MyContent.Text); - // //newtable1.ShowDialog(); - // //MessageBox.Show("IGrid"); - // //frmIGrid newtable2 = new frmIGrid(_LastStepInfo.MyContent.Text); - // //newtable2.ShowDialog(); - // //MessageBox.Show("GridView"); //standard Visual Studio Control - // //frmGridView newtable3 = new frmGridView(_LastStepInfo.MyContent.Text); - // //newtable3.ShowDialog(); - // MessageBox.Show("FlexCell"); - // frmFlexCell newtable4 = new frmFlexCell(_LastStepInfo.MyContent.Text); - // newtable4.ShowDialog(); - //} - #endregion - ItemInfo ii = node.VEObject as ItemInfo; - if (ii != null) tc.OpenItem(ii); - SetCaption(node); - return (ii != null); // return if successful on opening item in step editor or word - } - // The following code is used to setup the user interface depending on what - // is selected on the tree view (see vlnTreeView.cs) - void tv_NodeNew(object sender, vlnTreeEventArgs args) - { - VETreeNode vNode = (VETreeNode)args.Node; - IVEDrillDownReadOnly veObj = vNode.VEObject; - SectionInfo mySection = veObj as SectionInfo; - if (mySection != null && mySection.MyContent.MyEntry != null) - { - // if it is a word section, find the DisplayTabItem; - DisplayTabItem tabItem = tc.GetProcDisplayTabItem(mySection); - if(tabItem != null)tabItem.MyStepTabPanel.MyStepPanel.Reset(); - } - // Don't select the newly created Step. This will be handled by tmrTreeView - //SetupNodes((VETreeNode)args.Node); - } - private void tv_NodeSelect(object sender, vlnTreeEventArgs args) - { - SetupNodes((VETreeNode)args.Node); - } - private void SetCaption(VETreeNode tn) - { - StringBuilder caption = new StringBuilder(); - string sep = string.Empty; - while (tn != null) - { - if (tn.VEObject.GetType() == typeof(FolderInfo) || tn.VEObject.GetType() == typeof(DocVersionInfo)) - { - //caption.Append(sep + tn.Text); - caption.Insert(0, tn.Text + sep); - sep = " - "; - } - tn = (VETreeNode)tn.Parent; - } - caption.Insert(0,VEPROMS.CSLA.Library.Database.DBServer + sep); - this.Text = caption.ToString(); - } - void tv_OpenItem(object sender, vlnTreeItemInfoEventArgs args) - { - tc.OpenItem(args.MyItemInfo); - } - /// - /// When the treeview is clicked - a timer is set - /// This is done because the focus is returned to the treeview after the click event - /// This approach did not work and was replaced with the code below. - /// The problem was that each time the treeview was clicked, the last selected node - /// was opened again, or the edit window was repositioned. - /// If the item was deleted and another treenode expanded, the click to expand the - /// node would cause the deleted node to be selected. - /// - /// - /// - //private void tv_Click(object sender, EventArgs e) - //{ - //tv.Enabled = false; - //tmrTreeView.Enabled = true; - //} - /// - /// This opens nodes if the mouse is within the bounds of a node. - /// By using the timer, the focus can be passed to the edit window. - /// - /// - /// - void tv_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) - { - _ExpandingTree = false; - } - void tv_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) - { - if (_ExpandingTree) - { - _ExpandingTree = false; - return; - } - if (e.Button != MouseButtons.Right) - { - Point newPoint = new Point(e.X, e.Y); - VETreeNode tn = tv.GetNodeAt(newPoint) as VETreeNode; - // Check to make sure that a node has been selected and - // that the mouse is within the bounds of the node. - if (tn != null && tn.Bounds.Left < newPoint.X) - { - tv.SelectedNode = tn; - tv.Enabled = false; - tmrTreeView.Enabled = true; - } - else - { - if (tn != null && tn.Bounds.Left < newPoint.X + 30) - return; - if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.SelectedItemInfo != null) - { - tv.AdjustTree(tc.SelectedDisplayTabItem.SelectedItemInfo); - tc.SelectedDisplayTabItem.Focus(); - SetCaption(tv.SelectedNode as VETreeNode); - } - } - } - } - /// - /// This event is fired from the timer after the treeview click event completes - /// - /// - /// - private void tmrTreeView_Tick(object sender, EventArgs e) - { - bool giveTvFocus = true; - tmrTreeView.Enabled = false; // Timer has now fired - VETreeNode tn = tv.SelectedNode as VETreeNode; - if (tn != null) giveTvFocus = !SetupNodes(tn); - tv.Enabled = true; - if (giveTvFocus) tv.Focus(); - } - private void tmrAutomatic_Tick(object sender, EventArgs e) - { - tmrAutomatic.Enabled = false; // Timer has now fired - RunAutomatic(); - } - private bool _ExpandingTree=false; - private void tv_BeforeExpand(object sender, TreeViewCancelEventArgs e) - { - //_MyLog.DebugFormat("tv_BeforeExpand \n{0}",Volian.Base.Library.vlnStackTrace.StackToStringLocal(2,10)); - _ExpandingTree = true; - VETreeNode tn = ((VETreeNode)e.Node); - if (MyParent == null && - Properties.Settings.Default.SeparateWindows && tn.VEObject is FolderInfo - && (tn.VEObject as FolderInfo).FolderDocVersionCount == 1 - && (tn.VEObject as FolderInfo).FolderDocVersions[0].DocVersionConfig.MyEnhancedDocuments.HasSourcePointer) - { - CreateEnhancedWindow((tn.VEObject as FolderInfo).FolderDocVersions[0]); - tn.Nodes.Clear(); - } - else - { - tn.LoadingChildrenDone += new VETreeNodeEvent(tn_LoadingChildrenDone); - tn.LoadingChildrenMax += new VETreeNodeEvent(tn_LoadingChildrenMax); - tn.LoadingChildrenValue += new VETreeNodeEvent(tn_LoadingChildrenValue); - tn.LoadingChildrenSQL += new VETreeNodeEvent(tn_LoadingChildrenSQL); - tn.LoadChildren(true); - } - } - #region Property Page and Grid - DialogResult tv_NodeOpenProperty(object sender, vlnTreePropertyEventArgs args) - { - this.Cursor = Cursors.WaitCursor; - DialogResult dr = DialogResult.Cancel; - if ((int)Settings.Default["PropPageStyle"] == (int)PropPgStyle.Grid) - { - frmPropGrid propGrid = new frmPropGrid(args.ConfigObject, args.Title); - dr = propGrid.ShowDialog(); - } - else - { - if (args.FolderConfig != null) - { - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(args.FolderConfig.MyFolder.FolderID, CheckOutType.Folder, ref message)) - { - MessageBox.Show(this, message, "Folder Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - this.Cursor = Cursors.Default; - return DialogResult.None; - } - int ownerID = MySessionInfo.CheckOutItem(args.FolderConfig.MyFolder.FolderID, CheckOutType.Folder); - frmFolderProperties frmfld = new frmFolderProperties(args.FolderConfig); - dr = frmfld.ShowDialog(); - if (dr == DialogResult.OK) - { - epProcedures.TitleText = getProcedurePanelHeading();// get the panel heading - Database.DefaultTimeout = 20 * getTimeout(); - } - MySessionInfo.CheckInItem(ownerID); - } - else if (args.DocVersionConfig != null) - { - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(args.DocVersionConfig.MyDocVersion.VersionID, CheckOutType.DocVersion, ref message)) - { - MessageBox.Show(this, message, "Working Draft Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - this.Cursor = Cursors.Default; - return DialogResult.None; - } - int ownerID = MySessionInfo.CheckOutItem(args.DocVersionConfig.MyDocVersion.VersionID, CheckOutType.DocVersion); - frmVersionsProperties frmver = new frmVersionsProperties(args.DocVersionConfig); - frmver.ProgressBar = bottomProgBar; - dr = frmver.ShowDialog(); - MySessionInfo.CheckInItem(ownerID); - } - else if (args.ProcedureConfig != null) - { - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(args.ProcedureConfig.MyProcedure.ItemID, CheckOutType.Procedure, ref message)) - { - MessageBox.Show(this, message, "Procedure Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - this.Cursor = Cursors.Default; - return DialogResult.None; - } - int ownerID = MySessionInfo.CheckOutItem(args.ProcedureConfig.MyProcedure.ItemID, CheckOutType.Procedure); - frmProcedureProperties frmproc = new frmProcedureProperties(args.ProcedureConfig); - dr = frmproc.ShowDialog(); - MySessionInfo.CheckInItem(ownerID); - } - else if (args.SectionConfig != null) - { - //// If this is a word document, close any edit sessions... - //ItemInfo ii = null; - //using (Section tmp = args.SectionConfig.MySection) - //{ - // ii = ItemInfo.Get(tmp.ItemID); - // if (!ii.IsStepSection) tc.CloseWordItem(ii); - //} - - frmSectionProperties frmsec = new frmSectionProperties(args.SectionConfig); - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(args.SectionConfig.MySection.MySectionInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message)) - { - MessageBox.Show(this, message, "Procedure Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - this.Cursor = Cursors.Default; - return DialogResult.None; - } - int ownerID; - if (args.SectionConfig.MySection.MyContent.MyEntry.MyDocument == null) - ownerID = MySessionInfo.CheckOutItem(args.SectionConfig.MySection.MySectionInfo.MyProcedure.ItemID, CheckOutType.Procedure); - else - ownerID = MySessionInfo.CheckOutItem(args.SectionConfig.MySection.MyContent.MyEntry.MyDocument.DocID, CheckOutType.Document); - dr = frmsec.ShowDialog(); - if (dr == DialogResult.OK && displayLibDocs.LibDocList != null) - { - displayLibDocs.LibDocListFillIn(tc); - displayLibDocs.SetSelectedLibDoc(); - } - MySessionInfo.CheckInItem(ownerID); - } - } - this.Cursor = Cursors.Default; - return dr; - } - #endregion - #endregion - #region ColorStuff - /// - /// Get a System.Drawing.Color from an Argb or color name - /// - /// Color Name or "[(alpha,)red,green,blue]" - /// - private static Color cGetColor(string strColor) - { - // This was copied from frmFolderProperties.CS - Color rtnColor; - if (strColor == null || strColor.Equals("")) - rtnColor = Color.White; - else - { - if (strColor[0] == '[') - { - string[] parts = strColor.Substring(1, strColor.Length - 2).Split(",".ToCharArray()); - int parts_cnt = 0; - foreach (string s in parts) - { - parts[parts_cnt] = parts[parts_cnt].TrimStart(' '); // remove preceeding blanks - parts_cnt++; - } - if (parts_cnt == 3) - rtnColor = Color.FromArgb(Int32.Parse(parts[0]), Int32.Parse(parts[1]), Int32.Parse(parts[2])); - else - rtnColor = Color.FromArgb(Int32.Parse(parts[0].Substring(2)), Int32.Parse(parts[1].Substring(2)), Int32.Parse(parts[2].Substring(2)), Int32.Parse(parts[3].Substring(2))); - } - else rtnColor = Color.FromName(strColor); - } - return rtnColor; - } - //private void SetupEditorColors(DisplayPanel vlnCSLAPanel1, TabPage pg) - //{ - // // setup color - // if (_LastFolderInfo == null) - // { - // // user didn't select a FolderInfo type of node. - // // walk up the tree to find the first FolderInfo node type - // VETreeNode tn = (VETreeNode)(tv.SelectedNode); - // while (tn != null && tn.VEObject.GetType() != typeof(FolderInfo)) - // tn = (VETreeNode)tn.Parent; - // _LastFolderInfo = (FolderInfo)(tn.VEObject); - // _LastFolder = _LastFolderInfo.Get(); - // } - - // if ((_LastFolderInfo.FolderConfig.Color_editbackground != null) && !(_LastFolderInfo.FolderConfig.Color_editbackground.Equals(""))) - // { - // vlnCSLAPanel1.ActiveColor = cGetColor(_LastFolderInfo.FolderConfig.Color_editbackground); - // } - // if ((_LastFolderInfo.FolderConfig.Default_BkColor != null) && !(_LastFolderInfo.FolderConfig.Default_BkColor.Equals(""))) - // { - // vlnCSLAPanel1.InactiveColor = _LastFolderInfo.FolderConfig.Default_BkColor; - // vlnCSLAPanel1.TabColor = vlnCSLAPanel1.InactiveColor; - // vlnCSLAPanel1.PanelColor = vlnCSLAPanel1.InactiveColor; - // pg.BackColor = vlnCSLAPanel1.InactiveColor; - // } - //} - #endregion - #region Table Insert Sample Code - // TODO: for tables - //private void btnInsTable_Click(object sender, EventArgs e) - //{ - // Point loc = btnInsTable.DisplayRectangle.Location; - // loc.X += 300; - // int top = this.Top + (btnInsTable.Size.Height * 2); - // TablePickerDlg(sender, e, loc, top); - //} - - //private void TablePickerDlg(object sender, EventArgs e, Point loc, int top) - //{ - // Accentra.Controls.TablePicker tp = new Accentra.Controls.TablePicker(); - // tp.Location = loc; - // tp.Top += top; - // tp.Show(); - // while (tp.Visible) - // { - // Application.DoEvents(); - // System.Threading.Thread.Sleep(0); - // } - // // This was used to display a dialog containing a table grid - // // using a product called Source Grid - was for demo purposes only - // // - // //if (!tp.Cancel) - // //{ - // // frmTable newtable = new frmTable(tp.SelectedRows, tp.SelectedColumns); - // // newtable.Show(); - // //} - //} - #endregion - #region Progress Bar - - /// - /// Used for the status bar in the lower left corner of the main screen - /// - /// - /// - void tn_LoadingChildrenSQL(object sender, VETreeNodeEventArgs args) - { - ProgBarText = "Loading SQL"; - } - - /// - /// Used for the status bar in the lower left corner of the main screen - /// - /// - /// - void tn_LoadingChildrenValue(object sender, VETreeNodeEventArgs args) - { - ProgBarValue = args.Value; - } - - /// - /// Used for the status bar in the lower left corner of the main screen - /// - /// - /// - void tn_LoadingChildrenMax(object sender, VETreeNodeEventArgs args) - { - //_MyLog.DebugFormat("tn_LoadingChildrenMax \n{0}", Volian.Base.Library.vlnStackTrace.StackToStringLocal(2, 10)); - ProgBarMax = args.Value; - ProgBarText = "Loading..."; - } - - /// - /// Used for the status bar in the lower left corner of the main screen - /// - /// - /// - void tn_LoadingChildrenDone(object sender, VETreeNodeEventArgs args) - { - if (VlnSettings.DebugMode) - ProgBarText = args.Info + " Seconds"; - else - ProgBarText = ""; - } - - public int ProgBarMax - { - get { return bottomProgBar.Maximum; } - set { bottomProgBar.Maximum = value; } - } - - public int ProgBarValue - { - get { return bottomProgBar.Value; } - set { bottomProgBar.Value = value; } - } - - public string ProgBarText - { - get { return bottomProgBar.Text; } - set - { - bottomProgBar.TextVisible = true; - bottomProgBar.Text = value; - } - } - - #endregion - #region Find/Replace and Search - - /// - /// Find/Replace button on the ribbon - /// Display the Find/Replace dialog - /// - /// - /// - //private void btnFindRplDlg_Click_1(object sender, EventArgs e) - //{ - // FindReplace frmFindRepl = new FindReplace(); - // frmFindRepl.Show(); - //} - - /// - /// Global Search button on the ribbon - /// Opens the Information Pannel and selects the Results tab - /// - /// - /// - //private void btnGlbSrch_Click(object sender, EventArgs e) - //{ - // toolsPanel.Expanded = true; - // toolsTabs.SelectedTab = toolstabResults; - //} - - #endregion - #region Similar Steps - - /// - /// Similar Steps button on the ribbon - /// Opens the Information Pannel and selects the Results tab - /// - /// - /// - private void btnSimStps_Click(object sender, EventArgs e) - { - //infoPanel.Expanded = true; - //infoTabs.SelectedTab = toolstabResults; - //btnSimStpsRslt.Checked = true; - } - - #endregion - #region Help/About - - /// - /// About button on the ribbon - /// Display the About dialog - /// - /// - /// - private void btnAbout_Click(object sender, EventArgs e) - { - AboutVEPROMS about = new AboutVEPROMS(); - about.ShowDialog(); - } - - /// - /// Volian Web button on the ribbon - /// display the Volian web site on a pop up form - /// - /// - /// - private void btnVlnWeb_Click(object sender, EventArgs e) - { - VlnWeb veWWW = new VlnWeb(); - veWWW.Show(); - } - - #endregion - #region Ribbon - /// - /// This Opens the treeView or opens the selected item in the TreeView - /// - /// - /// - private void btnOpen_Click(object sender, EventArgs e) - { - if (!epProcedures.Expanded) // If panel not expanded - expand it. - { - epProcedures.Expanded = true; - if (tv.Nodes.Count > 0 && tv.SelectedNode == null) - tv.SelectedNode = tv.Nodes[0]; - tv.Focus(); - } - else - { - // TODO: DeleteMe - //VETreeNode tn = (VETreeNode)(tv.SelectedNode); - tv.OpenNode(); - } - } - private void btnNew_Click(object sender, EventArgs e) - { - if (!epProcedures.Expanded) return; - VETreeNode vtn = tv.SelectedNode as VETreeNode; - if (vtn == null) return; // nothing was selected. - if (btnNew.SubItems.Count > 0) return; // submenu will be displayed - vtn.Expand(); - - // Determine type of 'new' based on tree node's object type. The - // only options here are those that would not have created, based on - // containers, a submenu (see the office2007buttonstartbutton1_click code) - FolderInfo fi = vtn.VEObject as FolderInfo; - if (fi != null) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.Folder); - return; - } - - DocVersionInfo dvi = vtn.VEObject as DocVersionInfo; - if (dvi != null) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.Procedure); - return; - } - - // All other types are handled with sub-menus. - - } - - /// - /// Options button on the dialog that appears when the V icon is clicked (top left of application window) - /// note that the "V icon" is also called the Office 2007 Start Button - /// - /// - /// - private void btnOptions_Click(object sender, EventArgs e) - { - frmSysOptions VeSysOpts = new frmSysOptions(); - VeSysOpts.ShowDialog(); - StepTabRibbon.PasteNoReturnsSetting = Properties.Settings.Default.PasteNoReturns; - StepTabRibbon.PastePlainTextSetting = Properties.Settings.Default.PastePlainText; - StepTabRibbon.SpecifiedVisioPath = Properties.Settings.Default.VisioPath; - tc.SyncEnhancedDocuments = Properties.Settings.Default.SyncEnhancedDocuments; - } - /// - /// Exit button on the dialog that appears when the V icon is clicked (top left of application window) - /// note that the "V icon" is also called the Office 2007 Start Button - /// - /// - /// - private void btnExit_Click(object sender, EventArgs e) - { - this.Close(); - } - #endregion - #region InfoTabRO - private void infotabRO_Click(object sender, EventArgs e) - { - infoPanel.Expanded = true; - infoTabs.SelectedTab = infotabRO; - //if (dtp == null) return; - - //displayRO.Mydvi = SelectedDVI; - displayRO.MyROFSTLookup = SelectedROFst.GetROFSTLookup(SelectedDVI); - displayRO.MyRTB = (SelectedStepTabPanel == null) ? null : - SelectedStepTabPanel.MyStepPanel.SelectedEditItem == null ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; - displayRO.TabControl = tc; - - displayRO.ProgressBar = bottomProgBar; - } - #endregion - #region InfoTabTransition - private void infotabTransition_Click(object sender, EventArgs e) - { - if (tc == null || tc.SelectedDisplayTabItem == null) return; - if (SelectedStepTabPanel == null) return; - displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; - //displayTransition.RangeColor = global::VEPROMS.Properties.Settings.Default.TransitionRangeColor; - // RHM - The follwing line was reseting the settings on the transtion panel to "not" show the currently selected transition. - //displayTransition.CurTrans = null; - } - #endregion - #region InfoTabLibDocs - private void tabItemLibDocs_Click(object sender, EventArgs e) - { - displayLibDocs.RefreshLibDocPanel(tc); - //displayLibDocs.LibDocListFillIn(tc); - } - private void tv_SectionShouldClose(object sender, vlnTreeSectionInfoEventArgs args) - { - if (!args.MySectionInfo.IsStepSection) tc.CloseWordItem(args.MySectionInfo, args.IsDeleting); - else - { - if (tc == null) return; - StepTabPanel tp = tc.GetProcedureTabPanel(args.MySectionInfo as ItemInfo); - if (tp == null) return; - DisplayTabItem ti = tp.MyDisplayTabItem; - tc.CloseTabItem(ti); - } - } - private void tv_WordSectionDeleted(object sender, WordSectionEventArgs args) - { - // is it a library document - if so and libdoc panel is visible, update lists on panel. - // entry is null if it's a table of contents. - if ((!args.MySectionInfo.IsStepSection) && (args.MySectionInfo.MyContent.MyEntry != null) && ((args.MySectionInfo.MyContent.MyEntry.MyDocument.LibTitle ?? "") != "") && (toolsPanel.Expanded)) - { - if (toolsTabs.SelectedTab == tabItemLibDocs) - { - displayLibDocs.RefreshLibDocPanel(tc); - } - } - } - #endregion - #region InfoTabTags - private void infotabTags_Click(object sender, EventArgs e) - { - infoPanel.Expanded = true; - infoTabs.SelectedTab = infotabTags; - displayTags.MyEditItem = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem; - displayTags.Mydvi = SelectedDVI; - } - #endregion - #region InfoTabBookMarks - private void infotabBookMarks_Click(object sender, EventArgs e) - { - infoPanel.Expanded = true; - infoTabs.SelectedTab = infotabTags; - displayTags.MyEditItem = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem; - } - #endregion - #region PanelSupport - private void tc_WordSectionClose(object sender, WordSectionEventArgs args) - { - if (!args.MySectionInfo.IsStepSection) tc.CloseWordItem(args.MySectionInfo); - } - private void tc_WordSectionDeleted(object sender, WordSectionEventArgs args) - { - // is it a library document - if so and libdoc panel is visible, update lists on panel. - if ((!args.MySectionInfo.IsStepSection) && (args.MySectionInfo.MyContent.MyEntry != null && (args.MySectionInfo.MyContent.MyEntry.MyDocument.LibTitle ?? "") != "") && (toolsPanel.Expanded)) - { - if (toolsTabs.SelectedTab == tabItemLibDocs) - { - displayLibDocs.RefreshLibDocPanel(tc); - } - } - } - private void tc_ItemPasted(object sender, vlnTreeItemInfoPasteEventArgs args) - { - // all this needs to do is refresh the libdoc display - if it is visible - // and the current item is word section, i.e. it may be a lib doc & would - // require refresh of the lib doc panel. - if (toolsTabs.SelectedTab == tabItemLibDocs && args.MyItemInfo.IsSection) - { - SectionInfo si = args.MyItemInfo as SectionInfo; - if (si != null && (si.MyContent.MyEntry.MyDocument.LibTitle ?? "") != "") displayLibDocs.RefreshLibDocPanel(tc); - } - displayHistory.RefreshChangeList(); - } - private void tc_PanelTabDisplay(object sender, StepPanelTabDisplayEventArgs args) - { - if (_SelectedDVI == null) return; - if (args.PanelTabName == "Bookmarks") - { - toolsPanel.Expanded = true; - toolsTabs.SelectedTab = toolsTabBookMarks; - if (_CurrentItem != null && !dlgFindReplace.Visible) displayBookMarks.AddBookMark(_CurrentItem); - } - else if (args.PanelTabName == "Global Search") - { - toolsPanel.Expanded = true; - toolsTabs.SelectedTab = toolstabResults; - } - else if (args.PanelTabName == "LibDocs") - { - toolsPanel.Expanded = true; - toolsTabs.SelectedTab = tabItemLibDocs; - toolsTabs.SelectedTab.PerformClick(); - } - else if (args.PanelTabName == "Annots") - { - epAnnotations.Expanded = true; - } - else if (args.PanelTabName == "Change Step Type") - { - infoPanel.Expanded = true; - infoTabs.SelectedTab = infotabTags; - displayTags.HighlightChangeStep(); - } - else if (args.PanelTabName == "Change Image Size") - { - // B2016-237 added context menu item to change image size - infoPanel.Expanded = true; - infoTabs.SelectedTab = infotabTags; - displayTags.FocusOnImageSize(); - } - else if (args.PanelTabName == "FndRpl") - { - dlgFindReplace.InApproved = (_SelectedDVI != null && _SelectedDVI.VersionType == 127); - dlgFindReplace.Mydocversion = _SelectedDVI; - dlgFindReplace.Visible = true; - dlgFindReplace.MyDisplayBookMarks = displayBookMarks; - dlgFindReplace.SetFocusToTextBox(); // bug fix: B2016-107, when Find/Replace is initially opened, set the cursor focus to the Find Text box - } - else if (args.PanelTabName == "SpellChecker") - { - SpellChecker.DoSpellCheck(); - } - else if (args.PanelTabName == "DisplayROUpdateROFST") - { - _SelectedROFst = null; - displayRO.MyROFST = SelectedROFst; // need this to update RO Tree after UpdateRofst (B2015-226) - displayRO.MyROFSTLookup = SelectedROFst.GetROFSTLookup(SelectedDVI); - displayRO.RefreshRoTree(); - // resetting the MyROFSTLookup for the search & reports panels will refresh the RO trees after UpdateRofst in each of those panels (B2015-226) - if (SelectedDVI != null) - { - displaySearch1.MyROFSTLookup = SelectedDVI.DocVersionAssociations[0].MyROFst.GetROFSTLookup(SelectedDVI); - displayReports.MyROFSTLookup = SelectedDVI.DocVersionAssociations[0].MyROFst.GetROFSTLookup(SelectedDVI); - } - } - } - private void tc_SelectedDisplayTabItemChanged(object sender, EventArgs args) - { - // If the current procedure or section in the treeview doesn't match then change the treeview selection. - //jcb added for error B2012-117 - ItemInfo tvii; - if (tv.SelectedNode == null) - tvii = null; - else - tvii = ((tv.SelectedNode as VETreeNode).VEObject) as ItemInfo; - if (tc.SelectedDisplayTabItem == null) return; - if (tc.SelectedDisplayTabItem.MyItemInfo == null) return; // library document. - if (tc.SelectedDisplayTabItem.MyItemInfo.IsProcedure) - { - if (tvii == null || tvii.IsSection || tc.SelectedDisplayTabItem.MyItemInfo.ItemID != tvii.MyProcedure.ItemID) - tv.AdjustTree(tc.SelectedDisplayTabItem.MyItemInfo); - } - else - { - if (tvii == null || tc.SelectedDisplayTabItem.MyItemInfo.ItemID != tvii.ItemID) - tv.AdjustTree(tc.SelectedDisplayTabItem.MyItemInfo); - } - - // the following line will determine if the format uses the change id feature, and if so - // either prompts the user for change id, or uses an already input one if the procedure has been - // accessed. This gets run when the user clicks on procedure tabs in the step editor. - tc.HandleChangeId(tc.SelectedDisplayTabItem.MyItemInfo, tc.SelectedDisplayTabItem); - - SetCaption(tv.SelectedNode as VETreeNode); - displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem; - if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0) - displayRO.MyROFSTLookup = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion); - lblUser.Text = tc.SelectedDisplayTabItem.MyUserRole; - if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.MultiUnitCount > 1) - btnPrint.Visible = false; - else - btnPrint.Visible = true; - // Reset the ribbon buttons B2016-148 (ex. a copystep done in a different procedure tab my require the paste step options to be active - if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.MyStepTabPanel != null) // MyStepTabPanel will be null if the active tab is a Word Attachment - { - StepPanel pnl = tc.SelectedDisplayTabItem.MyStepTabPanel.MyStepPanel; - if (pnl != null) - pnl.MyStepTabPanel.MyStepTabRibbon.SetButtonAndMenuEnabling(true); - } - } - private void tc_StepPanelModeChange(object sender, StepRTBModeChangeEventArgs args) - { - this.lblEditView.Text = args.ViewMode == E_ViewMode.Edit ? "Edit" : "View"; - this.dlgFindReplace.ToggleReplaceTab(args.ViewMode); - } - private ItemInfo _CurrentItem = null; - private StepRTB _LastStepRTB = null; - //private Timer _TmrRefreshItem = null; - //public Timer TmrRefreshItem - //{ - // get - // { - // if (_TmrRefreshItem == null) - // { - // _TmrRefreshItem = new Timer(); - // _TmrRefreshItem.Interval = 1000; // one second - // _TmrRefreshItem.Tick += _TmrRefreshItem_Tick; - // } - // return _TmrRefreshItem; - // } - //} - //private StepRTB _RefreshRTB = null; - //void _TmrRefreshItem_Tick(object sender, EventArgs e) - //{ - // _TmrRefreshItem.Enabled = false; - // if (_RefreshRTB != null) _RefreshRTB.Focus(); - //} - private void tc_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args) - { - tc.HideTheCaret(); - //if (args.MyEditItem != null) - //Volian.Base.Library.vlnStackTrace.ShowStackLocal(2,10,"Edit item {0}, Step Panel {1}",args.MyEditItem.MyStepRTB.ContainsFocus, args.MyEditItem.MyStepPanel.ContainsFocus); - if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus) return; - //if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus) - //{ - // _RefreshRTB = args.MyEditItem.MyStepRTB; - // TmrRefreshItem.Enabled = true; - // return; - //} - btnFixMSWord.Visible = (args != null && ( args.MyItemInfo != null && args.MyEditItem == null)); - if (_LastStepRTB != null && !_LastStepRTB.Disposing && !_LastStepRTB.Closed) - _LastStepRTB.EditModeChanged -= new StepRTBEvent(_LastStepRTB_EditModeChanged); - _LastStepRTB = args != null && args.MyEditItem != null ? args.MyEditItem.MyStepRTB : null; - if (_LastStepRTB != null) _LastStepRTB.EditModeChanged += new StepRTBEvent(_LastStepRTB_EditModeChanged); - lblEditView.Text = " "; - if (args == null) - { - _CurrentItem = null; - ctrlAnnotationDetails.CurrentAnnotation = null; - ctrlAnnotationDetails.Annotations = null; - infotabFoldoutMaint.Visible = infotabRO.Visible = infotabTransition.Visible = infotabTags.Visible = infotabHistory.Visible = infotabApplicability.Visible = false; - ctrlAnnotationDetails.Enabled = false; - epAnnotations.Enabled = false; - epAnnotations.Expanded = false; - // When infotabTags is set to InVisible, the matching panel also needs to be set to invisible - infotabControlPanelTags.Visible = false; - displayTags.MyEditItem = null; - displayTags.Visible = false; - SelectedStepTabPanel = null; - lblItemID.Text = "No Item Selected"; - lblItemID.ForeColor = Color.Yellow; - } - else - { - lblItemID.Text = string.Format("ItemID = {0}", args.MyItemInfo.ItemID); - lblItemID.ForeColor = Color.DarkBlue; - if (_CurrentItem != args.MyItemInfo) - { - if (_CurrentItem != null) _CurrentItem.Deleted -= new ItemInfoEvent(_CurrentItem_Deleted); - _CurrentItem = args.MyItemInfo; - } - //vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem); - if (args.MyEditItem == null) - { - ctrlAnnotationDetails.Enabled = false; - epAnnotations.Enabled = false; - infotabFoldoutMaint.Visible = false; - infotabTransition.Visible = false; - infotabRO.Visible = false; - if (args.MyItemInfo.MyDocVersion.DocVersionAssociations != null) - { - displayRO.MyROFST = args.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst; - displayRO.MyRTB = null; - infotabRO.Visible = true; - } - infotabTags.Visible = false; - infotabApplicability.Visible = false; - // Not sure why but the following line was causing a hang if - // you opened a procedure - // and then created a word section - // and then you selected the procedure "Tab" - infotabHistory.Visible = false; - displayBookMarks.MyEditItem = null; - displayFoldoutMaint.Visible = false; - //vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem); - } - else - { - epAnnotations.Enabled = true; - ctrlAnnotationDetails.Enabled = true; - if (args.MyEditItem.MyItemInfo.IsSection || args.MyEditItem.MyItemInfo.IsProcedure) - { - infotabRO.Visible = infotabTransition.Visible = false; - infotabTags.Visible = false; - displayTags.Visible = false; - } - else - { - infotabTags.Visible = true; - if (_LastStepRTB != null) - { - infotabRO.Visible = _LastStepRTB.MyItemInfo.MyDocVersion.DocVersionAssociationCount > 0; - infotabTransition.Visible = !_CurrentItem.IsFigure && !_CurrentItem.IsRtfRaw; - // don't allow ro insert for a non-ro figure. First check that it is visible (from above line of code), - // and allow for non-figures or ro figures (for replace of existing ro figures) - infotabRO.Visible = infotabRO.Visible && (!_CurrentItem.IsRtfRaw && (!_CurrentItem.IsFigure || (_CurrentItem.IsFigure && _CurrentItem.MyContent.MyImage == null))); - displayRO.Enabled = _LastStepRTB.EditMode || _LastStepRTB.IsRoTable; - displayTransition.Enabled = _LastStepRTB.EditMode; - } - else - infotabRO.Visible = infotabTransition.Visible = false; - - // When infotabTags is set to Visible, the matching panel also needs to be set to visible - // the other panels will appear as they are selected by the user. - infotabControlPanelTags.Visible = true; - displayTags.IsVisible = true; - } - infotabHistory.Visible = true; - if (args.MyItemInfo.MyDocVersion.MultiUnitCount > 1 && !args.MyItemInfo.IsProcedure ) - { - infotabApplicability.Visible = true; - displayApplicability.MyItemInfo = args.MyEditItem.MyItemInfo; - } - else - infotabApplicability.Visible = false; - if (args.MyEditItem.MyItemInfo.ActiveFormat != null) - { - // see if format has floating foldouts, and if so, display the panel. - if (args.MyEditItem.MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout) - { - - displayFoldoutMaint.Visible = true; - infotabFoldoutMaint.Visible = true; - displayFoldoutMaint.Enabled = true; - displayFoldoutMaint.MyItemInfo = args.MyItemInfo; - } - } - // When infotabTags is set to Visible, it is given focus. The next line returns focus to the StepRTB - args.MyEditItem.SetFocus(); - displayTransition.MyRTB = args.MyEditItem.MyStepRTB; - - displayRO.MyRTB = args.MyEditItem.MyStepRTB; - displayBookMarks.MyEditItem = args.MyEditItem; - displayHistory.MyEditItem = args.MyEditItem; - - displayRO.ProgressBar = bottomProgBar; - - lblEditView.Text = args.MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit ? "Edit" : "View" ; - _CurrentItem.Deleted += new ItemInfoEvent(_CurrentItem_Deleted); - dlgFindReplace.MyEditItem = args.MyEditItem; - SpellChecker.MyEditItem = args.MyEditItem; - } - if (args.MyEditItem != null) - { - SelectedStepTabPanel = args.MyEditItem.MyStepPanel.MyStepTabPanel; - displayTags.Mydvi = SelectedDVI; - displayTags.MyEditItem = args.MyEditItem; - displayRO.ROTypeFilter = SelectedStepTabPanel.MyStepPanel.SelectedEditItem is Volian.Controls.Library.GridItem && (SelectedStepTabPanel.MyStepPanel.SelectedEditItem as Volian.Controls.Library.GridItem).MyFlexGrid.IsRoTable ? - E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image : E_ROValueType.Text; - if (_LastStepRTB.IsRoTable && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 0) - displayRO.CurROLink = _LastStepRTB.MyItemInfo.MyContent.ContentRoUsages[0]; - if (_LastStepRTB.IsRoFigure && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 0) - displayRO.CurROLink = _LastStepRTB.MyItemInfo.MyContent.ContentRoUsages[0]; - // if this is an enhanced step (linked from a source document), don't bring up the ro or transition panel, - // and don't allow replace on the find/replace dialog. - if (args.MyItemInfo.IsEnhancedStep) - { - // originally had these two lines to make the step properties panel/tran & ro tabs invisitble for - // enhanced steps but this was causing an error in the caret management code in StepTabPanel (Hide/ShowCaret) - //infotabTransition.Visible = false; - //infotabRO.Visible = false; - - // RHM: Had to use a timer to keep from getting into an infinite loop - // Not sure why , but tc_Leave was being called over and over again. - //KBR:TmrSetTransROInVisible.Enabled = true; - } - displayRO.SetFindDocROButton(false); - } - else - { - SelectedDVI = args.MyItemInfo.MyDocVersion; - displayRO.ROTypeFilter = E_ROValueType.All; // allow all RO types for Word attachments (but fix) - displayRO.SetFindDocROButton(true); - } - } - if (ctrlAnnotationDetails.Enabled && epAnnotations.Enabled) - { - ctrlAnnotationDetails.UpdateAnnotationGrid(_CurrentItem); - AnnotationPanelView(); - } - btnPrint.Enabled = (_CurrentItem != null); - } - /*KBR:Timer _tmrSetTransROInVisible; - public Timer TmrSetTransROInVisible - { - get - { - if (_tmrSetTransROInVisible == null) - { - _tmrSetTransROInVisible = new Timer(); - _tmrSetTransROInVisible.Enabled = false; - _tmrSetTransROInVisible.Interval = 50; - _tmrSetTransROInVisible.Tick += _tmrSetTransROInVisible_Tick; - } - return _tmrSetTransROInVisible; - } - } - void _tmrSetTransROInVisible_Tick(object sender, EventArgs e) - { - TmrSetTransROInVisible.Enabled = false; - infotabTransition.Visible = false; - infotabRO.Visible = false; - } - */ - void _LastStepRTB_EditModeChanged(object sender, EventArgs args) - { - if (_LastStepRTB.EditMode) // going into edit mode in a cell of the grid. - displayRO.Enabled = displayTransition.Enabled = _LastStepRTB.EditMode; - else // going out of edit mode in a cell of the grid. - { - if (this.ActiveControl != tc || (!_LastStepRTB.Parent.Focused && (infotabRO.IsSelected || infotabTransition.IsSelected))) return; - displayRO.Enabled = displayTransition.Enabled = _LastStepRTB.EditMode; - } - } - - void _CurrentItem_Deleted(object sender) - { - //displayBookMarks.DeleteItemBookMarkPanel(_CurrentItem); - } - #endregion - #region Annotations - /// - /// Display or hide the Annotation Details panel - /// - private void AnnotationPanelView() - { - if (ctrlAnnotationDetails.Annotations != null && ctrlAnnotationDetails.Annotations.Count != 0) - { - if (Settings.Default.AutoPopUpAnnotations) //cbAnnotationPopup.Checked - epAnnotations.Expanded = true; - else - epAnnotations.TitleStyle.BackColor1.Color = Color.Yellow; - } - else - { - if (!btnAnnoDetailsPushPin.Checked) - epAnnotations.Expanded = false; - epAnnotations.TitleStyle.BackColor1.Color = _CommentTitleBckColor; - ctrlAnnotationDetails.AnnotationText = null; - } - } - #endregion - #region LinkSupport - private void tc_LinkActiveChanged(object sender, StepPanelLinkEventArgs args) - { - // determine if any infotabs are visisble, and if it is the Transition, - // change the curitem for the transition to the current item. - if (infoPanel.Expanded == true && infoTabs.SelectedTab == infotabTransition) - { - displayTransition.CurTrans = null; - } - } - private void tc_LinkModifyTran(object sender, StepPanelLinkEventArgs args) - { - infoPanel.Expanded = true; - infoTabs.SelectedTab = infotabTransition; - if (SelectedStepTabPanel == null) return; - //displayTransition.RangeColor = global::VEPROMS.Properties.Settings.Default.TransitionRangeColor; - displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; - displayTransition.CurTrans = args.MyLinkText.MyTransitionInfo; - } - private void tc_LinkModifyRO(object sender, StepPanelLinkEventArgs args) - { - if (_SelectedROFst == null && (SelectedDVI == null || SelectedDVI.DocVersionAssociationCount == 0)) return; // B2016-128, not RO path associated to the working draft - if (SelectedStepTabPanel == null) return; - - infoPanel.Expanded = true; - infoTabs.SelectedTab = infotabRO; - - displayRO.MyROFSTLookup = SelectedROFst.GetROFSTLookup(SelectedDVI); - displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; - displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo; - displayRO.ROTypeFilter = SelectedStepTabPanel.MyStepPanel.SelectedEditItem is Volian.Controls.Library.GridItem && (SelectedStepTabPanel.MyStepPanel.SelectedEditItem as Volian.Controls.Library.GridItem).MyFlexGrid.IsRoTable ? - E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image: E_ROValueType.Text; - //displayRO.Mydvi = SelectedDVI; - displayRO.ProgressBar = bottomProgBar; - displayRO.TabControl = tc; - } - #endregion - #region VButton - private void office2007StartButton1_Click(object sender, EventArgs e) - { - // If the V-Button is clicked, check to see what tree node is s selected - // to set up the New submenus. The New submenus are dependent on the type of - // object selected, i.e. folder, docversion, etc. - - // reset in case previous selection changed items. - btnNew.SubItems.Clear(); - btnNew.Enabled = false; - - VETreeNode vtn = tv.SelectedNode as VETreeNode; - if (vtn == null) return; - btnNew.Enabled = true; - vtn.Expand(); - - // Folders can have either folders & docversions, but - // not a mix. - FolderInfo fi = vtn.VEObject as FolderInfo; - if (fi != null) - { - // Enable/disable the New button based on the user's security settings at the current folder level - // B2015-193 - btnNew.Enabled = UserInfo.CanCreateFolders(MyUserInfo, fi); - if (!btnNew.Enabled) return; // just return, user cannot add a new folder or workingdraft - - // if at top, 'VEPROMS', folder and childfolders below this only - // option is to create a new (sub)folder, i.e. no submenu items. - if (fi.ChildFolderCount > 0 && fi.MyParent == null) return; - - // submenu folders/docversion - if (fi.MyParent != null && UserInfo.CanCreateFolders(MyUserInfo,fi)) - { - ButtonItem fldbbtn = new ButtonItem("fldbtn", "Folder Before"); - ButtonItem fldabtn = new ButtonItem("fldabtn", "Folder After"); - btnNew.SubItems.Add(fldbbtn); - btnNew.SubItems.Add(fldabtn); - fldbbtn.Click += new EventHandler(fldbbtn_Click); - fldabtn.Click += new EventHandler(fldabtn_Click); - } - ButtonItem fldbtn = new ButtonItem("fldbtn", "Folder"); - btnNew.SubItems.Add(fldbtn); - fldbtn.Click += new EventHandler(fldbtn_Click); - - // offer adding a Working Draft only if the folder has no sub-folders and there is not already a Working Draft node - if (fi.ChildFolderCount == 0 && fi.FolderDocVersionCount == 0) - { - ButtonItem dvbtn = new ButtonItem("dvbtn", "Working Draft"); - btnNew.SubItems.Add(dvbtn); - dvbtn.Click += new EventHandler(dvbtn_Click); - } - return; - } - - // DocVersions can only have procedures, so no sub-menu - DocVersionInfo dvi = vtn.VEObject as DocVersionInfo; - if (dvi != null) - { - if (!UserInfo.CanEdit(MyUserInfo, dvi)) - btnNew.Enabled = false; // reviewers cannot create a new procedure B2015-193 - return; - } - - // Procedures can have a section added or a new procedure before - // or after. - ProcedureInfo pi = vtn.VEObject as ProcedureInfo; - if (pi != null) - { - // if user is a reviewer then don't allow adding new procedures - // bug B2015-193 - if (!UserInfo.CanEdit(MyUserInfo, pi.MyDocVersion)) - { - btnNew.Enabled = false; - return; - } - ButtonItem pbbtn = new ButtonItem("pfbtn", "Procedure Before"); - ButtonItem pabtn = new ButtonItem("pabtn", "Procedure After"); - ButtonItem sctbtn = new ButtonItem("sctbtn", "Section"); - btnNew.SubItems.Add(pbbtn); - btnNew.SubItems.Add(pabtn); - btnNew.SubItems.Add(sctbtn); - pbbtn.Click += new EventHandler(pbbtn_Click); - pabtn.Click += new EventHandler(pabtn_Click); - sctbtn.Click += new EventHandler(sctbtn_Click); - return; - } - - // Sections can have sections before, after, new subsections & if is - // a step section, can have steps - SectionInfo si = vtn.VEObject as SectionInfo; - if (si != null) - { - // if user is a reviewer then don't allow adding new sections - // bug B2015-193 - if (!UserInfo.CanEdit(MyUserInfo, si.MyDocVersion)) - { - btnNew.Enabled = false; - return; - } - ButtonItem sbbtn = new ButtonItem("sbbtn", "Section Before"); - ButtonItem sabtn = new ButtonItem("sabtn", "Section After"); - - btnNew.SubItems.Add(sbbtn); - btnNew.SubItems.Add(sabtn); - sbbtn.Click += new EventHandler(sbbtn_Click); - sabtn.Click += new EventHandler(sabtn_Click); - - if (si.IsStepSection) - { - // B2016-282: Don't allow insert of subsections off Word Section. - if (si.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections) - { - ButtonItem subbtn = new ButtonItem("subbtn", "SubSection"); - btnNew.SubItems.Add(subbtn); - subbtn.Click += new EventHandler(subbtn_Click); - } - ButtonItem stpbtn = new ButtonItem("stpbtn", "New Step"); - btnNew.SubItems.Add(stpbtn); - stpbtn.Click += new EventHandler(stpbtn_Click); - } - return; - } - - // Steps can have steps before or after only. - StepInfo stpi = vtn.VEObject as StepInfo; - if (stpi != null) - { - // if user is a reviewer then don't allow adding new procedures, sections, or steps - // bug B2015-193 - if (!UserInfo.CanEdit(MyUserInfo, stpi.MyDocVersion)) - { - btnNew.Enabled = false; - return; - } - ButtonItem stpbbtn = new ButtonItem("stpbbtn", "New Step Before"); - ButtonItem stpabtn = new ButtonItem("stpabtn", "New Step After"); - btnNew.SubItems.Add(stpbbtn); - btnNew.SubItems.Add(stpabtn); - stpbbtn.Click += new EventHandler(stpbbtn_Click); - stpabtn.Click += new EventHandler(stpabtn_Click); - return; - } - btnNew.Enabled = false; // should not get this far, but just in case turn off the New button - } - - void fldabtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.FolderAfter); - } - - void fldbbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.FolderBefore); - } - - void stpabtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.StepAfter); - } - - void stpbbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.StepBefore); - } - - void subbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.Section); - } - - void sabtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.SectionAfter); - } - - void sbbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.SectionBefore); - } - - void stpbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.Step); - } - - void sctbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.Section); - } - - void pabtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.ProcedureAfter); - } - - void pbbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.ProcedureBefore); - } - - void dvbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.DocVersion); - } - - void fldbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.Folder); - } - private void btnSave_Click(object sender, EventArgs e) - { - } - #endregion - #region PanelEvents - private void infoPanel_Click(object sender, EventArgs e) - { - displayTags.MyEditItem = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem; - displayTags.Mydvi = SelectedDVI; - } - //private void tv_SectionShouldClose(object sender, vlnTreeSectionInfoEventArgs args) - //{ - // if (!args.MySectionInfo.IsStepSection) tc.CloseWordItem(args.MySectionInfo); - //} - - private void infotabResults_Click(object sender, EventArgs e) - { - toolsPanel.Expanded = true; - InitiateSearch(true); - } - private void InitiateSearch(bool searchFocus) - { - if (toolsPanel.Expanded) - { - if (displaySearch1.Mydocversion == null)//!displaySearch1.OpenDocFromSearch) - { - if (SelectedDVI != null) - { - displaySearch1.Mydocversion = SelectedDVI; - displaySearch1.StartAdvTreeStepTypesFillIn();// B2016-258 Hang after selecting a procedure if the Step Type panel is open on the search panel - } - displaySearch1.advTreeProcSetsFillIn(searchFocus); - } - } - } - - private void toosTabReports_Click(object sender, EventArgs e) - { - toolsPanel.Expanded = true; - InitiateDisplayReports(true); - } - - private void InitiateDisplayReports(bool reportFocus) - { - if (toolsPanel.Expanded) - { - if (SelectedDVI != null) - displayReports.Mydocversion = SelectedDVI; - displayReports.advTreeProcSetsFillIn(reportFocus); - displayReports.advTreeROFillIn(reportFocus); - displayReports.SelectReferencedObjectTab(); // to enable RO selection - } - } - - private void ribbonControl1_ExpandedChanged(object sender, EventArgs e) - { - Console.WriteLine("Size {0}", ribbonControl1.Expanded); - // TODO: Need to send message to all StepTabPanels and tell them to minimize their ribbons. - tc.RibbonExpanded = ribbonControl1.Expanded; - } - - private void btnItemInfo_Click(object sender, EventArgs e) - { - if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.SelectedItemInfo != null) - { - frmPropGrid pg = new frmPropGrid(tc.SelectedDisplayTabItem.SelectedItemInfo, tc.SelectedDisplayTabItem.SelectedItemInfo.ShortPath); - pg.Show(); - } - else - MessageBox.Show("Select Item First", "Item not selected", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - } - private void lblItemID_Click(object sender, System.EventArgs e) - { - if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.SelectedItemInfo != null) - { - ItemInfo myitem = tc.SelectedDisplayTabItem.SelectedItemInfo; - FolderInfo myfolder = myitem.MyDocVersion.MyFolder; - string sep = ""; - string fPath = ""; - while (myfolder.FolderID != myfolder.ParentID) - { - fPath = myfolder.Name + sep + fPath; - sep = "/"; - myfolder = myfolder.MyParent; - } - Clipboard.Clear(); - DataObject mydo = new DataObject(DataFormats.Text, string.Format("{0} - {1}", fPath, myitem.ShortPath)); - 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) - { - if (epAnnotations.Expanded && !_panelExpandedChanging) - { - // if the height of the panel is smaller than the titleheight+20 - //(due to the user dragging the splitter down), then un-expand the - // panel and set the height to the titleheight+75 - if (epAnnotations.Size.Height < epAnnotations.TitleHeight + 20) - { - Size sz = new Size(epAnnotations.Size.Width, epAnnotations.TitleHeight + 75); - epAnnotations.Size = sz; - epAnnotations.Expanded = false; - } - } - } - - private void resizeVerticalExpandedPanel(object sender, EventArgs e) - { - ExpandablePanel ep = (ExpandablePanel)sender; - if (ep.Expanded && !_panelExpandedChanging) - { - // if the width of the panel is smaller than the titleheight+20 - //(due to the user dragging the splitter over), then un-expand the - // panel and set the width to the titleheight+50 - if (ep.Size.Width < ep.TitleHeight + 10) - { - Size sz = new Size(ep.TitleHeight + 50, ep.Size.Height); - ep.Size = sz; - ep.Expanded = false; - } - } - } - - private void expandPanelExpandedChanging(object sender, ExpandedChangeEventArgs e) - { - _panelExpandedChanging = true; - } - - private void toolsPanel_ExpandedChanged(object sender, ExpandedChangeEventArgs e) - { - _panelExpandedChanging = false; - expandableSplitter4.Enabled = toolsPanel.Expanded; - if (toolsPanel.Expanded) - { - InitiateSearch(true); - InitiateDisplayReports(true); - } - } - - private void epAnnotations_ExpandedChanged(object sender, ExpandedChangeEventArgs e) - { - _panelExpandedChanging = false; - expandableSplitter2.Enabled = epAnnotations.Expanded; - } - - private void epProcedures_ExpandedChanged(object sender, ExpandedChangeEventArgs e) - { - _panelExpandedChanging = false; - expandableSplitter1.Enabled = epProcedures.Expanded; - } - - private void infoPanel_ExpandedChanged(object sender, ExpandedChangeEventArgs e) - { - _panelExpandedChanging = false; - expandableSplitter3.Enabled = infoPanel.Expanded; - // if our active tab is a Word attachment, call the Click even on the RO tab - // to ensure that the RO FST is loaded. This fixes a bug where if the first thing you - // open is a Word attachment, the RO panel would not have the RO's listed. - if (infoPanel.Expanded && _CurrentItem != null && _CurrentItem.HasWordContent && infotabRO.Visible) - infotabRO_Click(sender, e); - } - #endregion - - private void btnShortCuts_Click(object sender, EventArgs e) - { - ShortcutLists scListdlg = new ShortcutLists(); - scListdlg.Show(); - } - - private void cmbFont_SelectedIndexChanged(object sender, EventArgs e) - { - StepRTB.MyFontFamily = cmbFont.SelectedValue as FontFamily; - } - - private void btnPrint_Click(object sender, EventArgs e) - { - //VETreeNode vtn = tv.SelectedNode as VETreeNode; - //DocVersionInfo dvi = vtn.VEObject as DocVersionInfo; - //while (dvi == null) - //{ - // vtn = vtn.Parent as VETreeNode; - // dvi = vtn.VEObject as DocVersionInfo; - //} - //string pnum = DisplayText.StaticStripRtfCommands(this._CurrentItem.MyProcedure.ProcedureConfig.Number).Replace("\\u8209?", "-"); - DlgPrintProcedure prnDlg = new DlgPrintProcedure(this._CurrentItem.MyProcedure);//dvi.DocVersionConfig,pnum); - prnDlg.MySessionInfo = MySessionInfo; - prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window - } - - private void lblResolution_Click(object sender, EventArgs e) - { - if (this.WindowState != FormWindowState.Normal) - { - this.WindowState = FormWindowState.Normal; - } - else if (this.Size.Width != 1280) - { - this.Size = new Size(1280, 800); - } - else - { - this.Size = new Size(1024, 768); - } - } - - private void frmVEPROMS_Resize(object sender, EventArgs e) - { - lblResolution.Text = string.Format("Resolution {0} x {1}", Size.Width, Size.Height); - } - private void office2007StartButton1_MouseDown(object sender, MouseEventArgs e) - { - // Refresh the MostRecentlyUsedList - _MyMRIList.Refresh(); - SetupMRU(); - } - - private void btnEditItem_Click(object sender, EventArgs e) - { - if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.MyStepTabPanel.SelectedEditItem != null) - { - frmPropGrid pg = new frmPropGrid(tc.SelectedDisplayTabItem.MyStepTabPanel.SelectedEditItem, "EditItem"); - pg.Show(); - } - else - MessageBox.Show("Select Item First", "Item not selected", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - } - private void btnUpdateFormat_Click(object sender, EventArgs e) - { - UpdateFormats(null); - } - - private void UpdateFormats(string mypath) - { - if (mypath == null) - { - string fmtPath = Properties.Settings.Default.FormatPath ?? ""; - DirectoryInfo di = null; - do - { - fbd.Description = "Select folder containing FmtAll and GenMacAll folders to update formats"; - fbd.SelectedPath = fmtPath; - DialogResult dr = fbd.ShowDialog(); - if (dr == DialogResult.Cancel) - { - bottomProgBar.Text = "Format Update Cancelled"; - return; - } - di = new DirectoryInfo(fbd.SelectedPath); - fmtPath = di.FullName; - } while (((fmtPath ?? "") == "") || (!di.Exists || !Directory.Exists(di.FullName + @"\fmtall") || !Directory.Exists(di.FullName + @"\genmacall"))); - Properties.Settings.Default.FormatPath = fbd.SelectedPath; - Properties.Settings.Default.Save(); - mypath = di.FullName; - } - string fmtPathAll = mypath + @"\fmtall"; - string genmacPathAll = mypath + @"\genmacall"; - Format.FormatLoaded += new FormatEvent(Format_FormatLoaded); - Format.UpdateFormats(fmtPathAll, genmacPathAll); - Format.FormatLoaded -= new FormatEvent(Format_FormatLoaded); - _MyLog.WarnFormat("Formats in {0} updated to {1}", Database.SelectedDatabase, fmtPathAll); - } - - void Format_FormatLoaded(object sender, FormatEventArgs args) - { - if (args.Status.EndsWith("Formats to Load")) - { - bottomProgBar.Value = 0; - bottomProgBar.Maximum = int.Parse(args.Status.Split(" ".ToCharArray())[0]); - } - else - { - if (args.Status.StartsWith("Error")) - MessageBox.Show(args.Status, "Error Loading Format", MessageBoxButtons.OK, MessageBoxIcon.Error); - else if (!args.Status.Contains("SubFormat")) bottomProgBar.Value++; - } - bottomProgBar.Text = args.Status; - bottomProgBar.TextVisible = true; - Application.DoEvents(); - Console.WriteLine(args.Status); - } - - private void btnSendErrorLog_Click(object sender, EventArgs e) - { - - frmSendErrorLog frm = new frmSendErrorLog(Properties.Settings.Default.OutlookEmail, Properties.Settings.Default["SMTPServer"].ToString(), Properties.Settings.Default["SMTPUser"].ToString(),ErrorLogFileName); - if (frm.ShowDialog(this) == DialogResult.OK) - { - Properties.Settings.Default.OutlookEmail = frm.OutlookEmail; - Properties.Settings.Default.SMTPServer = frm.SMTPServer; - Properties.Settings.Default.SMTPUser = frm.SMTPUser; - Properties.Settings.Default.Save(); - MessageBox.Show("PROMS Error Log successfully sent to Volian support"); - } - } - } - #region Lock stuff / used for multi-user support - public class TabItemsToClose : Stack - { - public void PushDTI(DisplayTabItem dti) - { - lock (this) - { - if(!this.Contains(dti)) - this.Push(dti); - } - } - public DisplayTabItem PopDTI() - { - lock (this) - { - return this.Pop(); - } - } - public int CountDTI - { - get - { - lock (this) - { - return this.Count; - } - } - } - } - #endregion - public class VersionWindow - { - private int _VersionID; - public int VersionID - { - get { return _VersionID; } - set { _VersionID = value; } - } - private int _DBId; - public int DBId - { - get { return _DBId; } - set { _DBId = value; } - } - private Rectangle _MyRectangle; - public Rectangle MyRectangle - { - get { return _MyRectangle; } - set { _MyRectangle = value; } - } - public override string ToString() - { - RectangleConverter rc = new RectangleConverter(); - return string.Format("{0}~{1}", _VersionID, rc.ConvertToString(_MyRectangle)); - } - public VersionWindow(string str) - { - string[] parts = str.Split('~'); - _VersionID = int.Parse(parts[0]); - RectangleConverter rc = new RectangleConverter(); - _MyRectangle = (Rectangle)rc.ConvertFromString(parts[1]); - } - } - public class VersionWindowList : List - { - public static VersionWindowList GetVersionWindowList(System.Collections.Specialized.StringCollection list) - { - VersionWindowList vwl = new VersionWindowList(); - if (list != null) - { - foreach (string str in list) - vwl.Add(new VersionWindow(str)); - } - return vwl; - } - public System.Collections.Specialized.StringCollection ToSettings() - { - if (Count == 0) return null; - System.Collections.Specialized.StringCollection retval = new System.Collections.Specialized.StringCollection(); - foreach (VersionWindow vw in this) - retval.Add(vw.ToString()); - return retval; - } - public new void Add(VersionWindow versionWindow) - { - foreach (VersionWindow vw in this) - { - if (vw.VersionID == versionWindow.VersionID) - { - this.Remove(vw); - break; - } - } - base.Add(versionWindow); - } - } - -} diff --git a/PROMS/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/PROMS/Volian.Controls.Library/StepRTB.cs deleted file mode 100644 index 8f7f9df7..00000000 --- a/PROMS/PROMS/Volian.Controls.Library/StepRTB.cs +++ /dev/null @@ -1,3705 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.IO; -using System.Drawing; -using System.Data; -using System.Text; -using System.Windows.Forms; -using System.Runtime.InteropServices; -using System.Text.RegularExpressions; -using VEPROMS.CSLA.Library; -using Volian.Base.Library; - -namespace Volian.Controls.Library -{ - public delegate void StepRTBEvent(object sender, EventArgs args); - public delegate void StepRTBCursorKeysEvent(object sender, KeyEventArgs args); - public delegate void StepRTBCursorMovementEvent(object sender, StepRTBCursorMovementEventArgs args); - public delegate void StepRTBModeChangeEvent(object sender, StepRTBModeChangeEventArgs args); - public delegate void StepRTBMenuEvent(object sender, StepRTBMenuEventArgs args); - public delegate void StepRTBTableWidthEvent(object sender, StepRTBTableWidthEventArgs args); - public delegate bool StepRTBBooleanEvent(object sender, EventArgs args); - public delegate void StepRTBLocationEvent(object sender, StepRTBLocationEventArgs args); - public delegate void StepRTBMouseEvent(object sender, MouseEventArgs args); - public delegate void StepRTBRoEvent(object sender, StepRTBRoEventArgs args); - //public delegate void StepRTBMouseWheelEvent(object sender, MouseEventArgs args); - public partial class StepRTB : RichTextBox // , IStepRTB - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - - private bool _Disposed = false; - private static int _CountCreated = 0; - private static int _CountDisposed = 0; - private static int _CountFinalized = 0; - private static int IncrementCountCreated - { get { return ++_CountCreated; } } - private int _CountWhenCreated = IncrementCountCreated; - public static int CountCreated - { get { return _CountCreated; } } - public static int CountNotDisposed - { get { return _CountCreated - _CountDisposed; } } - public static int CountNotFinalized - { get { return _CountCreated - _CountFinalized; } } - private bool _Finalized = false; - ~StepRTB() - { - if (!_Finalized) _CountFinalized++; - _Finalized = true; - } - #region Events - public event StepRTBRoEvent RoInsert; - public void OnRoInsert(object sender, StepRTBRoEventArgs args) - { - if (RoInsert != null) RoInsert(sender, args); - } - public event StepRTBEvent ReturnToEditor; - public void OnReturnToEditor(object sender, EventArgs args) - { - if (ReturnToEditor != null) ReturnToEditor(sender, args); - } - public event StepRTBEvent EditModeChanged; - public void OnEditModeChanged(object sender, EventArgs args) - { - if (EditModeChanged != null) EditModeChanged(sender, args); - } - public event StepRTBEvent DoSaveContents; - public void OnDoSaveContents(object sender, EventArgs args) - { - if (DoSaveContents != null) DoSaveContents(sender, args); - } - public event StepRTBMouseEvent DoMouseWheel; - public void OnDoMouseWheel(object sender, MouseEventArgs args) - { - if (DoMouseWheel != null) DoMouseWheel(sender, args); - } - public event StepRTBLocationEvent OpenContextMenu; - public void OnOpenContextMenu(object sender, StepRTBLocationEventArgs args) - { - if (OpenContextMenu != null) OpenContextMenu(sender, args); - } - public event StepRTBEvent CopyStep; - public void OnCopyStep(object sender, EventArgs args) - { - if (CopyStep != null) CopyStep(sender, args); - } - public event StepRTBBooleanEvent CheckClipboard; - public bool OnCheckClipboard(object sender, EventArgs args) - { - if (CheckClipboard != null) return CheckClipboard(sender, args); - return false; - } - public event StepRTBCursorKeysEvent EnterKeyPressed; - public void OnEnterKeyPressed(object sender, KeyEventArgs args) - { - if (EnterKeyPressed != null) EnterKeyPressed(sender, args); - } - public event StepRTBEvent ToggleChangeBar; // shortcut key - public void OnToggleChangeBar(object sender, EventArgs args) - { - if (ToggleChangeBar != null) ToggleChangeBar(sender, args); - } - public event StepRTBEvent ToggleContinuousActionSummary; // shortcut key - public void OnToggleContinuousActionSummary(object sender, EventArgs args) - { - if (ToggleContinuousActionSummary != null) ToggleContinuousActionSummary(sender, args); - } - public event StepRTBEvent TogglePlaceKeeper; // shortcut key - public void OnTogglePlaceKeeper(object sender, EventArgs args) - { - if (TogglePlaceKeeper != null) TogglePlaceKeeper(sender, args); - } - public event StepRTBEvent TogglePlaceKeeperContAct; // shortcut key - public void OnTogglePlaceKeeperContAct(object sender, EventArgs args) - { - if (TogglePlaceKeeperContAct != null) TogglePlaceKeeperContAct(sender, args); - } - public event StepRTBEvent ToggleSuperScript; // shortcut key <=> - public void OnToggleSuperScript(object sender, EventArgs args) - { - if (ToggleSuperScript != null) ToggleSuperScript(sender, args); - } - public event StepRTBEvent ToggleSubScript; // shortcut key <=> - public void OnToggleSubScript(object sender, EventArgs args) - { - if (ToggleSubScript != null) ToggleSubScript(sender, args); - } - public event StepRTBEvent InsertPgBrk; // short key - public void OnInsertPgBrk(object sender, EventArgs args) - { - if (InsertPgBrk != null) InsertPgBrk(sender, args); - } - public event StepRTBEvent OpenAnnotations; - public void OnOpenAnnotations(object sender, EventArgs args) - { - if (OpenAnnotations != null) OpenAnnotations(sender, args); - } - public event StepRTBBooleanEvent IsNotCurrentSelection; - public bool OnIsNotCurrentSelection(object sender, EventArgs args) - { - if (IsNotCurrentSelection != null) return IsNotCurrentSelection(sender, args); - return false; - } - public event StepRTBTableWidthEvent AdjustTableWidth; - public void OnAdjustTableWidth(object sender, StepRTBTableWidthEventArgs args) - { - if (AdjustTableWidth != null) AdjustTableWidth(sender, args); - } - public event StepRTBMenuEvent SetMenu; - private void OnSetMenu(object sender, StepRTBMenuEventArgs args) - { - if (SetMenu != null) SetMenu(sender, args); - } - public event StepRTBEvent RTBSelectionChanged; - private void OnRTBSelectionChanged(object sender, EventArgs args) - { - if (RTBSelectionChanged != null) RTBSelectionChanged(sender, args); - } - public event StepRTBEvent LinkLocationsChanged; - private void OnLinkLocationChanged(object sender, EventArgs args) - { - if (LinkLocationsChanged != null) LinkLocationsChanged(sender, args); - } - public event StepRTBEvent RTBRangeStatusChanged; - private void OnRTBRangeStatusChanged(object sender, EventArgs args) - { - if (RTBRangeStatusChanged != null) RTBRangeStatusChanged(sender, args); - } - public event StepRTBCursorKeysEvent CursorKeyPress; - private void OnCursorKeyPress(object sender, KeyEventArgs args) - { - if (CursorKeyPress != null) CursorKeyPress(sender, args); - } - public event StepRTBCursorMovementEvent CursorMovement; - private void OnCursorMovement(object sender, StepRTBCursorMovementEventArgs args) - { - if (CursorMovement != null) CursorMovement(sender, args); - } - //public event StepRTBModeChangeEvent ModeChange; - //private void OnModeChange(object sender, StepRTBModeChangeEventArgs args) - //{ - // //_MyModeChangeEventArgs = args; - // if (ModeChange != null) ModeChange(sender, args); - // else MessageBox.Show("StepRTB - no mode change defined"); - //} - //public event StepRTBMouseWheelEvent MouseWheel; - //private void OnMouseWheel(object sender, MouseEventArgs args) - //{ - // if (MouseWheel != null) MouseWheel(sender, args); - //} - - /// - /// This event is not raised during all the in-between changes for link deletions - /// - public event StepRTBEvent RTBTextChanged; - private void OnRTBTextChanged(object sender, EventArgs args) - { - if (RTBTextChanged != null) RTBTextChanged(sender, args); - } - #endregion - #region Properties and Variables - - public bool IsRoTable - { - get { return (Parent is VlnFlexGrid && (Parent as VlnFlexGrid).IsRoTable); } - } - public bool HasVScroll - { - get - { - return RTBAPI.HasVertScroll(this); - } - - } - public bool HasHScroll - { - get - { - return RTBAPI.HasHorzScroll(this); - } - - } - private bool _EditMode = true; - /// - /// Allows insert of links. If false, don't allow selection of links. - /// - public bool EditMode - { - get { return _EditMode; } - set - { - _EditMode = value; - OnEditModeChanged(this, new EventArgs()); - } - } - private static string _MySymbolFontName; - public static string MySymbolFontName - { - get { return StepRTB._MySymbolFontName; } - set { StepRTB._MySymbolFontName = value; } - } - private static FontFamily _MyFontFamily = null; - public static FontFamily MyFontFamily - { - get { return StepRTB._MyFontFamily; } - set - { - _MyFontFamily = value; - if (value != null) - { - Font font; - if (value.IsStyleAvailable(FontStyle.Regular)) - font = new Font(value, 10); - else if (value.IsStyleAvailable(FontStyle.Bold)) - font = new Font(value, 10, FontStyle.Bold); - else // (value.IsStyleAvailable(FontStyle.Italic)) - font = new Font(value, 10, FontStyle.Italic); - using (StepRTB srtb = new StepRTB()) - { - if (srtb.FontIsFixed(font)) MySymbolFontName = "FreeMono"; // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing - else MySymbolFontName = "Arial Unicode MS"; - } - } - else - { - MySymbolFontName = null; - } - } - } - // use newer rich text box.... - //[DllImport("kernel32.dll", CharSet = CharSet.Auto)] - //static extern IntPtr LoadLibrary(string lpFileName); - //protected override CreateParams CreateParams - //{ - // get - // { - // CreateParams prams = base.CreateParams; - // if (LoadLibrary("msftedit.dll") != IntPtr.Zero) - // { - // //prams.ExStyle |= 0x020; // transparent - - // prams.ClassName = "RICHEDIT50W"; - // } - // return prams; - // } - //} - private E_FieldToEdit _FieldToEdit = E_FieldToEdit.StepText; - public E_FieldToEdit FieldToEdit - { - get { return _FieldToEdit; } - set { _FieldToEdit = value; } - } - private string _RtfPrefix; // contains Font table and styles (bold/underline/italics) for rtb from step style - public string RtfPrefixForSymbols - { - get - { - if (_RtfPrefix == null) - { - StringBuilder selectedRtfSB = new StringBuilder(); - AddFontTable(selectedRtfSB, FormatFont, FontIsFixed(FormatFont)); - _RtfPrefix = selectedRtfSB.ToString(); - } - return _RtfPrefix + @"\f1\fs" + FormatFont.SizeInPoints * 2 + " "; - } - } - public string RtfPrefix - { - get - { - if (_RtfPrefix == null) - { - StringBuilder selectedRtfSB = new StringBuilder(); - AddFontTable(selectedRtfSB, FormatFont, FontIsFixed(FormatFont)); - _RtfPrefix = selectedRtfSB.ToString(); - } - return _RtfPrefix;// +@"{\colortbl ;\red255\green0\blue0;}"; - } - } - // August 5, 2009 - KBR & RHM: - // Insert/Overwrite will be developed later if needed. various issues - // were found during initial development that made its scope larger than - // expected. Problems were related to having overstrike on in the following - // cases: - // 1) left arrow when on link - positions after link - // 2) left arrow and after link - does not move - // 3) shift left arrow does not move past links correctly and also, first - // shift left arrow looks more like insert mode. - // private bool _OverWrite; - // _IsDirty compares the original rtf to the current rtf from the - // richtextbox to see if a change was made. - public bool IsDirty - { - get { return OrigRTF != Rtf; } - } - private bool _InitializingRTB; - private bool _IsExperimenting = false; - public bool IsExperimenting - { - get { return _IsExperimenting; } - set { _IsExperimenting = value; } - } - private IContainer _Container = null; - private string _MyClassName=string.Empty; - public string MyClassName - { - get { if (_MyClassName == string.Empty)_MyClassName = CreateParams.ClassName; return _MyClassName; } - set { _MyClassName = value; } - } - //private E_EditPrintMode _epMode = E_EditPrintMode.Edit; - //public E_EditPrintMode EpMode - //{ - // get { return _epMode; } - // set { - // if (value == E_EditPrintMode.Print) Console.WriteLine(""); - // _epMode = value; } - //} - private E_ViewMode _vwMode = E_ViewMode.Edit; - public E_ViewMode VwMode - { - get { return _vwMode; } - set { _vwMode = value; } - } - private VE_Font _MyStyleFont; - public VE_Font MyStyleFont - { - get - { - if (_MyStyleFont == null) _MyStyleFont = MyItemInfo.GetItemFont(); - return _MyStyleFont; - } - } - private bool _ActiveMode = false; - public bool ActiveMode - { - get { return _ActiveMode; } - set { _ActiveMode = value; } - } - private ItemInfo _MyItemInfo; - public ItemInfo MyItemInfo - { - get - { - if (_MyItemInfo == null && Parent is EditItem) - _MyItemInfo = (Parent as EditItem).MyItemInfo; - else if (_MyItemInfo == null && Parent != null && Parent.Parent is EditItem) - _MyItemInfo = (Parent.Parent as EditItem).MyItemInfo; - return _MyItemInfo; - } - set { _MyItemInfo = value; } - } - private string _OrigRTF; - public string OrigRTF - { - get { return _OrigRTF; } - set { _OrigRTF = value; } - } - private Font _FormatFont; - public Font FormatFont - { - get - { - if (_FormatFont == null) - { - Font formatFont; - if (MyItemInfo != null) - formatFont = MyItemInfo.GetItemFont().WindowsFont; // OrigDisplayText.TextFont.WindowsFont; - else - formatFont = Font; - if (MyItemInfo != null && (MyItemInfo.IsTable || MyItemInfo.IsFigure)) - _FormatFont = formatFont; - else - { - //if (VlnSettings.DebugMode || VlnSettings.ProductionMode) - _FormatFont = new Font(MyFontFamily == null ? formatFont.FontFamily : MyFontFamily, formatFont.Size, formatFont.Style); - //else - // _FormatFont = new Font("Bookman Old Style", formatFont.Size, formatFont.Style); - // TODO: Release Mode - //Font = _origDisplayText.TextFont.WindowsFont; // font defined in plant's format - } - } - // We found that the characters in the Letter Gothic font do not all use the same spacing. - // Also, the character spacing is even more different between screen resolutions. - // But the Letter Gothic font will print just fine. - // We also found that the Letter Gothic Tall font works just fine on the screen, the only difference - // is that the characters are a little bit taller. - // So we decided to use the Letter Gothic Tall font for the screen display any time that Letter Gothic is used. - if (_FormatFont.Name.ToUpper().Equals("LETTER GOTHIC")) - _FormatFont = new Font("Letter Gothic Tall", _FormatFont.Size, _FormatFont.Style); - return _FormatFont; - } - set { _FormatFont = value; } - } - public void SetupRichText(string rtf, VE_Font vFont) - { - //FormatFont = vFont.WindowsFont; - DisplayText vlnText = new DisplayText(rtf, vFont, true); - AddRtfText(vlnText.StartText); - ReadOnly = true; - } - public void RefreshDisplay() - { - if (Closed) return; - try - { - RefreshDisplay(ActiveMode); - } - catch (Exception ex) - { - _MyLog.Error(string.Format("MyItemInfo: {0} - {1} Problem doing RefreshDisplay",MyItemInfo.ItemID,MyItemInfo.ShortPath), ex); - } - } - // RefreshDisplay is used to update the rtb for an entire Item as defined by MyItemInfo. - public void RefreshDisplay(bool activeMode) - { - if (IsExperimenting) return; - ActiveMode = activeMode; - OnAdjustTableWidth(this, new StepRTBTableWidthEventArgs(true)); - _InitializingRTB = true; - DisplayText vlntxt = new DisplayText(MyItemInfo, E_EditPrintMode.Edit, VwMode, !ActiveMode, FieldToEdit, true,null, null); - //if (_origDisplayText != null && vlntxt.StartText == _origDisplayText.StartText) - //{ - // ReadOnly = !(EpMode == E_EditPrintMode.Edit && VwMode == E_ViewMode.Edit); - // if (!ReadOnly && !edit) ReadOnly = true; - // return; - //} - OrigDisplayText = vlntxt; - - // RHM 20101201 - Don't reset the text. Calculate the text and compare it with the existing text in AddRTFText - //Text = ""; // Initialize text before add text - // IMPORTANT: SetLineSpacing must be set before Links, otherwise it - // was confusing the 'handle' of the rtf box. - //Console.WriteLine("'font',{0}", Font); - //if(Text == "")SelectionFont = Font; // Initialize SelectionFont - if (FieldToEdit == E_FieldToEdit.StepText) - { - if (MyItemInfo != null) - { - if (MyItemInfo.IsStep) Font = MyFontFamily == null ? MyItemInfo.FormatStepData.Font.WindowsFont : new Font(MyFontFamily, MyItemInfo.FormatStepData.Font.WindowsFont.Size, MyItemInfo.FormatStepData.Font.WindowsFont.Style); - else Font = Font = MyFontFamily == null ? MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont : new Font(MyFontFamily, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont.Size, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont.Style); - LastRtf = Rtf; - } - } - RTBAPI.SetLineSpacing(this, RTBAPI.ParaSpacing.PFS_EXACT); - bool readOnlyStep = MyItemInfo == null || MyItemInfo.FormatStepData == null ? false : MyItemInfo.FormatStepData.ReadOnly; - if (!readOnlyStep) - { - StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config); - if (IsDerived(sc)) - readOnlyStep = true; - } - ReadOnly = readOnlyStep || VwMode == E_ViewMode.View || ActiveMode == false; - AddRtfText(vlntxt.StartText); - //AddRtfStyles(); - // set readonly based on initial modes, however, these may change if - // user selected view mode. - ClearUndo(); - // RHM: 20101122 - Not sure why the RightMargin is set. The following line was added in Rev 23 - // in May of 2008. - // - // RightMargin = Width; - // - // Normally a the Right Margin is handled by the RichTextBox it defaults to a value of 0. - // - // If the RightMargin is equal to the width of the RichTextBox the word-wrap occurs just beyond - // the visible extent (right edge) of the RichTextBox when it is in view mode. In edit mode it - // wraps within the visible extent. An example of this is Step 24 of ES02 in HLP EOPs. - // - // If the RightMargin is greater than the width of the RichTextBox, the word-wrap occurs beyond - // the visible extent of the RichTextBox for both view and edit modes. - // - // Setting the RightMargin to the Width minus one, accounts for the slight indent (1 pixel) of - // the text within the RichTextBox. - RightMargin = Width > 0 ? Width - 1 : 0; - // figure out if needs outlined, depends on table/figure type - if (!ActiveMode) - { - RemoveEventHandlers(); - OnAdjustTableWidth(this, new StepRTBTableWidthEventArgs(false));// View Mode - SelectAll(); - //if (SelectionHangingIndent !=0) SelectionHangingIndent = 0; - int indchar = 0; - string indentToken = MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IndentToken; - if (indentToken == null || indentToken=="0") indentToken = "\x5"; - - // this line of code was moved before the find for the indent so that - // the window gets resized if the indent changes the height, i.e. more line(s) in window. - AddEventHandlers(); - //if (MyItemInfo.InList(186722)) Console.WriteLine("here"); - if ((indchar = Find(indentToken, indchar, RichTextBoxFinds.None)) >= 0) - { - int nindents = 0; - while ((indchar = Find(indentToken, indchar, RichTextBoxFinds.None)) >= 0) - { - nindents++; - Point indent = GetPositionFromCharIndex(indchar); - SelectionHangingIndent = indent.X; - - // RHM 02/20/2013 - // The following line attempts to remove the indent character for display purposes. - // However, if the indent is followed immediately by an RO or Transition the - // RichTextBox will not allow the character to be removed this way and the RichTextBox - // will beep. So, to keep from going in an infintie loop, the value of indchar is incremented. - SelectedRtf = SelectedRtf.Replace(@"\'05",""); - indchar ++;// Don't so the same one twice. - } - if (MyItemInfo != null && MyItemInfo.ActiveFormat != null - && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.DontResetIndentOnNewline) - { - if (nindents == 1) Rtf = Rtf.Replace("\\par\r\n", @"\line "); - Rtf = Rtf.Replace(@"\line\pard", @"\line"); - } - } - } - // This is to fix an issue with Hard Spaces. To Summarize: - // The Microsoft RichTextBox has a problem with hardspaces, that they don't work between numbers and lettters - // This is the majority of cases for PROMS including ROs (Sepoint Number and Units) and transtions (Step ###) - // As I investigated this further I found that if you pass a rtf unicode value for a hard space (\u160?) to - // the RichTextBox, the RichTextBox will return an ASCII representation (\'A0). If you pass an ASCII representation - // the RichTextBox will return a space. - // Alternatively, If you pass a unicode representation of zero (\u0?) it acts like a hard space and returns an ASCII - // representation (\'00). If you pass in the ASCII representation, it truncates the text. - // The following two lines replace hard spaces (ASCII) with the UNICODE represntation of Zero. - // Lastly, If you pass a unicode representation of one (\u1?) it acts like a hard space and returns an ASCII - // representation (\'01). If you pass in the ASCII representation, it keeps the ASCII representation. - // The following two lines replace hard spaces (ASCII) with the UNICODE represntation of Zero. - // Other characters which behave like hard spaces are 28-31 and 128-159. - if (!activeMode && Rtf.Contains(@"\'a0")) - Rtf = Rtf.Replace(@"\'a0", @"\u1?"); - OrigRTF = Rtf; - _InitializingRTB = false; - - AdjustSizeForContents(!ActiveMode); - } - private bool IsDerived(StepConfig sc) - { - Console.WriteLine("EnhancedDOcument2"); - foreach (EnhancedDocument ed in sc.MyEnhancedDocuments) - if (ed.Type == 0) //New Design - return true; - return false; - } - private bool _ProcessKeystrokes = true; - public bool ProcessKeystrokes - { - get { return _ProcessKeystrokes; } - set { _ProcessKeystrokes = value; } - } - private Point ScrollPos - { - get { return RTBAPI.GetScrollLocation(this); } - set { RTBAPI.SetScrollLocation(this, value); } - } - private Rectangle _ContentsRectangle = new Rectangle(0,0,0,0); - public Rectangle ContentsRectangle - { - get - { - if (_ContentsRectangle.X == 0 && _ContentsRectangle.Y == 0 && _ContentsRectangle.Width == 0 && _ContentsRectangle.Height == 0) - _ContentsRectangle = this.ClientRectangle; - return _ContentsRectangle; - } - set - { - _ContentsRectangle = value; - AdjustSizeForContents(false); - } - } - public Size ContentsSize - { - get { return _ContentsRectangle.Size; } - } - private Size _AdjustSize = new Size(0,0); // if 0,0 puts text right next to bottom of box. - public Size AdjustSize - { - get { return _AdjustSize; } - set - { - _AdjustSize = value; - AdjustSizeForContents(false); - } - } - public System.Windows.Forms.AutoScaleMode AutoScaleMode; - private DisplayText _OrigDisplayText; - - public DisplayText OrigDisplayText - { - get { return _OrigDisplayText; } - set { _OrigDisplayText = value; } - } - private RichTextBox _rtbTemp = new RichTextBox(); - private string _MyLinkText; - public string MyLinkText - { - get { return _MyLinkText; } - set - { - //if (value != _MyLinkText) - //{ - // updates to the info panel were not always occurring when the previous two - // lines were active - _MyLinkText = value; - OnLinkChanged(this, new StepPanelLinkEventArgs(_MyLinkText)); - //} - } - } - #endregion - #region Constructors - public StepRTB() - { - InitializeComponent(); - SetUpStepRTB(); - AddEventHandlers(); - this.BorderStyleChanged += new EventHandler(StepRTB_BorderStyleChanged); - - } - public StepRTB(IContainer container) - { - container.Add(this); - InitializeComponent(); - _Container = container; - SetUpStepRTB(); - AddEventHandlers(); - this.BorderStyleChanged += new EventHandler(StepRTB_BorderStyleChanged); - } - protected override void OnMouseWheel(MouseEventArgs e) - { - OnDoMouseWheel(this, e); - //MyRTBItem.MyStepPanel.MouseWheel(e); - //base.OnMouseWheel(e); - } - // When a border style is changed, the richtextbox's handle is 'destroyed', so that the handleDestroyed - // event is done. This was causing the event handlers to be removed (RemoveEventHandler) so that the - // keypress event handler was not run. - private void RemoveEventHandlers() - { - if (_EventHandlersForKeyPress==0) return; - ContentsResized -= new ContentsResizedEventHandler(StepRTB_ContentsResized); - this.Click -= new EventHandler(StepRTB_Click); - this.KeyPress -= new KeyPressEventHandler(StepRTB_KeyPress); - this.KeyDown -= new KeyEventHandler(StepRTB_KeyDown); - this.KeyUp -= new KeyEventHandler(StepRTB_KeyUp); - this.TextChanged -= new EventHandler(StepRTB_TextChanged); - this.MouseUp -= new MouseEventHandler(StepRTB_MouseUp); - this.MouseDown -= new MouseEventHandler(StepRTB_MouseDown); - this.MouseLeave -= new EventHandler(StepRTB_MouseLeave); - this.SelectionChanged -= new EventHandler(StepRTB_SelectionChanged); - this.ContextMenuStripChanged -= new EventHandler(StepRTB_ContextMenuStripChanged); - this.RTBSelectionChanged -= new StepRTBEvent(StepRTB_RTBSelectionChanged); - this.HandleCreated -= new EventHandler(StepRTB_HandleCreated); - this.HandleDestroyed -= new EventHandler(StepRTB_HandleDestroyed); - _EventHandlersForKeyPress = _EventHandlersForKeyPress - 1; - } - private int _EventHandlersForKeyPress = 0; - // When a border style is changed, the richtextbox's handle is 'destroyed', so that the handleDestroyed - // event is done. This was causing the event handlers to be removed (RemoveEventHandler) so that the - // keypress event handler was not run. - private void AddEventHandlers() - { - if (_EventHandlersForKeyPress>0) return; - // Always be sure to add the same event handlers to RemoveEventHandlers - BorderStyle = System.Windows.Forms.BorderStyle.None; - this.DetectUrls = false; - ContentsResized += new ContentsResizedEventHandler(StepRTB_ContentsResized); - this.Click +=new EventHandler(StepRTB_Click); - this.KeyPress += new KeyPressEventHandler(StepRTB_KeyPress); - this.KeyDown += new KeyEventHandler(StepRTB_KeyDown); - this.KeyUp += new KeyEventHandler(StepRTB_KeyUp); - this.TextChanged += new EventHandler(StepRTB_TextChanged); - this.MouseUp += new MouseEventHandler(StepRTB_MouseUp); - this.MouseDown += new MouseEventHandler(StepRTB_MouseDown); - this.MouseLeave += new EventHandler(StepRTB_MouseLeave); - this.SelectionChanged +=new EventHandler(StepRTB_SelectionChanged); - this.ContextMenuStripChanged += new EventHandler(StepRTB_ContextMenuStripChanged); - this.RTBSelectionChanged += new StepRTBEvent(StepRTB_RTBSelectionChanged); - this.HandleCreated += new EventHandler(StepRTB_HandleCreated); - this.HandleDestroyed += new EventHandler(StepRTB_HandleDestroyed); - _EventHandlersForKeyPress = _EventHandlersForKeyPress+1; - } - private int _HandleCount = 0; - void StepRTB_HandleCreated(object sender, EventArgs e) - { - _HandleCount++; - } - // When a border style is changed, the richtextbox's handle is 'destroyed', so that the handleDestroyed - // event is done. This was causing the event handlers to be removed (RemoveEventHandler) so that the - // keypress event handler was not run. The following was added so that the keypress event is restored - // after the border style was changed. This is specifically for the steprtb's on property pages. - void StepRTB_BorderStyleChanged(object sender, EventArgs e) - { - if (_EventHandlersForKeyPress==0) - this.KeyPress += new KeyPressEventHandler(StepRTB_KeyPress); - _EventHandlersForKeyPress++; - } - private bool _Closed = false; - public bool Closed - { - get { return _Closed; } - set { _Closed = value; } - } - void StepRTB_HandleDestroyed(object sender, EventArgs e) - { - if (_HandleCount == 0) - { - Closed = true; - RemoveEventHandlers(); - } - _HandleCount--; - } - void StepRTB_RTBSelectionChanged(object sender, EventArgs args) - { - //Console.WriteLine("RTBSelectionChanged id= {0}", MyItemInfo.ItemID); - if (!Focused) Focus(); - } - void StepRTB_ContextMenuStripChanged(object sender, EventArgs e) - { - //Console.WriteLine("********** StepRTB_ContextMenuStripChanged"); - int sublocation = 0; - try - { - //Console.WriteLine("{0}", ContextMenuStrip.GetType().FullName); - OnSetMenu(this, new StepRTBMenuEventArgs(null)); - sublocation = 1; - _ContextMenuStripChanged = true; - sublocation = 2; - _ContextMenuStepRTB = this; - sublocation = 3; - _ContextMenuStrip = ContextMenuStrip; - sublocation = 4; - } - catch(Exception ex) - { - Console.WriteLine("StepRTB_ContextMenuStripChanged {0} - {1} [{2}]", ex.GetType().Name, ex.Message, sublocation); - } - } - private void SetUpStepRTB() - { - DetectUrls = false; - if(DoSpellCheck) - C1SpellChecker2.SetActiveSpellChecking(this, true); - this.Height = 10; // initialize the height to 10, the default height was too big for the cells in grid tables - BorderStyle = System.Windows.Forms.BorderStyle.None; - this.ScrollBars = RichTextBoxScrollBars.None; - this.DetectUrls = false; - } - // An event is needed to set MouseDown to false on mouse leave, because additional rtb's may - // have been exposed based on entering a step, which causes the underlying item/rtb for which - // the mouse event occurs to not be the current rtb. RTB gets selected on MouseDown, MouseEnter - // and MouseUp are - void StepRTB_MouseLeave(object sender, EventArgs e) - { - _MouseDown = false; - } - //void MyConfig_PropertyChanged(object sender, PropertyChangedEventArgs e) - //{ - // SaveConfig(); - //} - private void StepRTB_Click(object sender, EventArgs e) - { - if (ReadOnly) return; - } - void StepRTB_SelectionChanged(object sender, EventArgs e) - { - if (_InitializingRTB || _IsExperimenting) return; - HandleSelectionChange(); - } - private bool _MouseDown = false; - private bool _ContextMenuStripChanged = false; - private void StepRTB_MouseDown(object sender, MouseEventArgs e) - { - - //Console.WriteLine("vvvvvvvvvv StepRTB Mouse Down id= {0}",MyItemInfo.ItemID); - bool inPsi = this.Parent.FindForm().Name.Contains("frmPSI"); - if (!_ContextMenuStripChanged) - OnSetMenu(this, new StepRTBMenuEventArgs(inPsi?"PSI":"OpenContextMenu")); - _ContextMenuStripChanged = false; - CorrectSelectionAtEndOfLine(); - } - void StepRTB_MouseUp(object sender, MouseEventArgs e) - { - _MouseDown = false; - //Console.WriteLine("^^^^^^^^^^ StepRTB Mouse Up id= {0}", MyItemInfo.ItemID); - - if(this.Focused) // Only HandleSelectionChange if this control has focus. - { - HandleSelectionChange(); - // save our context menu to add to the spell checker's context menu - ThisContextMenuStrip = this.ContextMenuStrip; - } - } - #endregion - #region ApplicationSupport - // Used in StepTabRibbon: - //public void ToggleEditView(E_ViewMode vwMode) - //{ - // OnDoSaveContents(this, new EventArgs()); // SaveText(); - // //ItemInfo tmp = MyItemInfo; - // //MyItemInfo = null; - // //ReadOnly = !ReadOnly; - // //EpMode = ReadOnly ? E_EditPrintMode.Print : E_EditPrintMode.Edit; - // VwMode = vwMode; - // ReadOnly = VwMode == E_ViewMode.View; - // ViewRTB = ReadOnly; - // Clear(); - // RefreshDisplay(!ViewRTB); - // //MyItemInfo = tmp; - // SelectionStart = 0; - // SelectionLength = 0; - // //OnModeChange(this, new StepRTBModeChangeEventArgs(ViewRTB?E_ViewMode.View:E_ViewMode.Edit)); - //} - public void InsertRO(string value, string link) - { - AddRtfLink(value, link); - } - public void InsertTran(string value, string link) - { - AddRtfLink(value, link); - } - public void InsertSymbol(int symbcode) - { - string sym = string.Format(symbcode < 256 ? "\'{0:X2}" : @"\u{0}", symbcode); - if (symbcode < 256) - AddText(((char)symbcode).ToString()); - else - AddSymbol(sym); // Adds font commands around symbol, needed for higher codes - } - public void InsertSymbol(string symbol) - { - AddSymbol(symbol); - } - public void InsertIndent(string indentToken) - { - if (indentToken == null || indentToken == "0") indentToken = "\x5"; - AddText(indentToken); - } - public void InsertText(string txt) - { - AddText(txt); - } - - private void ToggleCase() - { - char type = 'l'; - // do not change case on linked text - RangeStatus rs = FindRangeStatus(); - string tmp = null; - if (rs != RangeStatus.NoContainedLinks) - { - int start = SelectionStart; - int ostart = SelectionStart; - int end = SelectionStart + SelectionLength; - bool processed = false; - while (!processed && start <= end) - { - foreach (LinkLocation ll in LinkLocations) - { - if (ll.Start >= start && ll.End <= end) - { - processed = true; - if (start < ll.Start) - { - SelectionStart = start; - SelectionLength = ll.Start - start; - } - start = ll.End + 1; - break; - } - } - } - } - string ostring = SelectedText; - if (ostring.Length == 0) return; // nothing selected - if (ostring.Length == 1) - type = char.IsUpper(ostring, 0) ? 'l' : 'U'; - else if ((char.IsUpper(ostring, 0) && char.IsUpper(ostring, 1)) || - (char.IsLower(ostring, 0) && char.IsUpper(ostring, 1))) type = 'l'; // lower case - else if ((char.IsUpper(ostring, 0) && char.IsLower(ostring, 1))) type = 'U'; // upper case - else type = 'T'; // Title case - SetSelectedCase(type); - } - - public void SetSelectedCase(char type) - { - // do not change case on linked text - RangeStatus rs = FindRangeStatus(); - string tmp = null; - if (rs == RangeStatus.NoContainedLinks) - SetCase(type); - else - { - int start = SelectionStart; - int ostart = SelectionStart; - int end = SelectionStart + SelectionLength; - StringBuilder sb = new StringBuilder(); - while (start <= end) - { - bool processed = false; - foreach (LinkLocation ll in LinkLocations) - { - if (ll.Start >= start && ll.End <= end) - { - processed = true; - if (start < ll.Start) - { - SelectionStart = start; - SelectionLength = ll.Start - start; - SetCase(type); - } - start = ll.End + 1; - break; - } - } - // if none were processed, no more links, copy over any remaining text. - if (!processed) - { - SelectionStart = start; - SelectionLength = end-start; - SetCase(type); - start = end + 1; - } - } - SelectionStart = ostart; - SelectionLength = end - ostart; - } - } - - private void SetCase(char type) - { - int ostart = SelectionStart; - int olen = SelectionLength; - string ostring = SelectedText; - string tmp = null; - bool docap = true; - // go character by character. Because of symbols, setting entire - // to upper or lower set symbols incorrectly some of time (depending - // on symbol) . - for (int i = 0; i < olen; i++) - { - SelectionStart = ostart + i; - SelectionLength = 1; - switch (type) - { - case 'l': - if (SelectedText[0] >= 'A' && SelectedText[0] <= 'Z') - SelectedText = SelectedText.ToLower(); - break; - case 'U': - if (SelectedText[0] >= 'a' && SelectedText[0] <= 'z') - SelectedText = SelectedText.ToUpper(); - break; - case 'T': - if (docap && SelectedText[0] >= 'a' && SelectedText[0] <= 'z') - SelectedText = SelectedText.ToUpper(); - else if (!docap && SelectedText[0] >= 'A' && SelectedText[0] <= 'Z') - SelectedText = SelectedText.ToLower(); - docap = ostring[i] == ' '; - break; - } - } - SelectionStart = ostart; - SelectionLength = olen; - } - #endregion - #region AddRtfTextAndStyles - private string _LastRtf = ""; - public string LastRtf - { - get { return _LastRtf; } - set { _LastRtf = value; } - } - private bool _lastReadOnly = false; - private void AddRtfText(string txt) - { - //Console.WriteLine("ItemID:{0}", MyItemInfo.ItemID); - //if(MyItemInfo.ItemID==10256) - // Volian.Base.Library.vlnStackTrace.ShowStackLocal("ItemID:{0}", MyItemInfo.ItemID.ToString()); - StringBuilder selectedRtfSB = new StringBuilder(); - AddFontTable(selectedRtfSB, FormatFont, FontIsFixed(FormatFont)); - _RtfPrefix = selectedRtfSB.ToString(); - selectedRtfSB.Append(txt); - string newRtf = selectedRtfSB.ToString() + "}"; - if(newRtf != _LastRtf || ReadOnly != _lastReadOnly) - { - //Console.WriteLine("ItemID:{0}\r\nOld:'{1}'\r\nNew:'{2}'\r\n", MyItemInfo.ItemID, Rtf, newRtf); - this.ContentsResized -= new ContentsResizedEventHandler(StepRTB_ContentsResized); - Text = ""; - this.ContentsResized += new ContentsResizedEventHandler(StepRTB_ContentsResized); - // indents went from being handled by code support of an indent character (usually \05) to - // using rtf commands to fix various indent bugs including B2015-103). The following code - // puts the rtf indent characters that are stored at beginning of string into correct location - // of rtf header (have to be after the \pard). Otherwise the indents did not show up. - Match match = Regex.Match(txt,@"\\fi([-0-9]+) ?\\li([0-9]+)"); - if (match.Success) - { - string indentStr = @"\fi" + match.Groups[1].Value + @"\li" + match.Groups[2].Value; - Rtf = Rtf.Replace(@"\pard", @"\pard" + indentStr); - } - SelectedRtf = _LastRtf = newRtf; - _lastReadOnly = ReadOnly; - } - FindAllLinks(); - if (txt == "") SelectionFont = FormatFont; - } - public void SetTableGridCellRTFPrefix(Font myfont) - { - if (_FormatFont == null) - _FormatFont = myfont; - - if (_RtfPrefix == null) - { - StringBuilder selectedRtfSB = new StringBuilder(); - AddFontTable(selectedRtfSB, myfont, FontIsFixed(myfont)); - _RtfPrefix = selectedRtfSB.ToString(); - } - } - // The following code is used to display the little 'tic' marks to show indenting: - private const int WM_PAINT = 15; - protected override void WndProc(ref Message m) - { - if (m.Msg == WM_PAINT) - { - this.Invalidate(); - base.WndProc(ref m); - if ((FieldToEdit == E_FieldToEdit.StepText) && (SelectionHangingIndent > 0 || SelectionIndent > 0) && (ActiveMode || MyItemInfo.IsTable)) - { - using (Graphics g = Graphics.FromHwnd(this.Handle)) - { - int size = 2; - g.DrawLine(Pens.DarkBlue, SelectionIndent, 0, SelectionIndent + size, 0); - g.DrawLine(Pens.DarkBlue, SelectionIndent, 2 * size, SelectionIndent, 0); - g.DrawLine(Pens.DarkBlue, SelectionHangingIndent, Height - 1, SelectionHangingIndent + size, Height - 1); - g.DrawLine(Pens.DarkBlue, SelectionHangingIndent, Height - 1 - 2 * size, SelectionHangingIndent, Height - 1); - } - } - } - else - { - base.WndProc(ref m); - } - } - private static void AddFontTable(StringBuilder selectedRtfSB, Font myFont, bool isFixed) - { - StringBuilder sbbeg = new StringBuilder(); - StringBuilder sbend = new StringBuilder(); - if (myFont.Bold) - { - sbbeg.Append(@"\b"); - sbend.Append(@"\b0"); - } - if (myFont.Underline) - { - sbbeg.Append(@"\ul"); - sbend.Insert(0, @"\ulnone"); - } - if (myFont.Italic) - { - sbbeg.Append(@"\i"); - sbend.Insert(0, @"\i0"); - } - selectedRtfSB.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 " + myFont.FontFamily.Name + @";}"); //}\f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}}"; - if (!isFixed) - selectedRtfSB.Append(@"{\f1\fnil\fcharset0 Arial Unicode MS;}}{\colortbl ;\red255\green0\blue0;}"); - else - selectedRtfSB.Append(@"{\f1\fnil\fcharset0 FreeMono;}}{\colortbl ;\red255\green0\blue0;}"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing - selectedRtfSB.Append("\r\n"); - // use styles to construct rtf commands to insert into next line (where \b, etc is) - selectedRtfSB.Append(@"\viewkind4\uc1\pard\sl-240\slmult0" + sbbeg.ToString() + @"\fs" + Convert.ToInt32(myFont.SizeInPoints * 2).ToString() + @" "); // \f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}"; - } - - private bool FontIsFixed(Font myFont) - { - Graphics grph = Graphics.FromHwnd(this.Handle); - SizeF sfW = grph.MeasureString("W", myFont); - SizeF sfE = grph.MeasureString("!", myFont); - if (sfW.Width == sfE.Width) return true; - return false; - } - private void AddRtf(string str) - { - // Because we're inserting rtf with { }, the surrounding styles are not included. Get the font - // style of current position & use it after the insert to set the style. - RTBAPI.E_FontStyle fs = RTBAPI.GetFontStyle(this); - int positionStart = SelectionStart; - SelectedRtf = @"{\rtf1{\fonttbl{\f0\fcharset2 " + this.Font.FontFamily.Name + @";}}\f0\fs" + this.Font.SizeInPoints * 2 + @" " + str + @"}}"; - // Note that SelectedRtf does not contain the inserted text after the previous line. We need - // to determine how long the inserted string is in order to set its style. SelectionStart contains - // the location after the insertion. - int positionAfter = SelectionStart; - Select(positionStart, positionAfter - positionStart); - RTBAPI.SetFontStyle(this, fs); - Select(positionAfter, 0); - } - private void AddText(string str) - { - // See comments in AddRtf(string str) to explain the font style setting - RTBAPI.E_FontStyle fs = RTBAPI.GetFontStyle(this); - int positionStart = SelectionStart; - SelectedText = str; - int positionAfter = SelectionStart; - Select(positionStart, positionAfter - positionStart); - RTBAPI.SetFontStyle(this, fs); - Select(positionAfter, 0); - } - private void AddSymbol(string str) - { - // See comments in AddRtf(string str) to explain the font style setting - RTBAPI.E_FontStyle fs = RTBAPI.GetFontStyle(this); - Font locfont = this.Font; - int position = SelectionStart; - SelectedRtf = RtfPrefixForSymbols + str + @"}"; - Select(position, 1); - RTBAPI.SetFontStyle(this, fs); - Select(position + 1, 0); - if (FieldToEdit == E_FieldToEdit.StepText) - SelectionFont = MyItemInfo.GetItemFont().WindowsFont; - else - // if doing properties for folder, docversion, proc or sect, don't get item's font. - SelectionFont = locfont; - } - private string GetAddSymbolText(string symtxt) - { - return (@"{\f0\fs" + this.Font.SizeInPoints * 2 + @" " + symtxt + @"}"); - } - public void AddRtfLink(string linkUrl, string linkValue) - { - if (CreateParams.ClassName == "RICHEDIT50W") - - AddLink50(linkUrl, linkValue); - else - AddLink20(linkUrl, linkValue); - } - public string FontTable - { - get - { - StringBuilder sb = new StringBuilder(); - sb.Append(@"{\fonttbl{\f0\fnil\fcharset2 " + this.Font.FontFamily.Name + @";}"); - if (!FontIsFixed(this.Font)) - sb.Append(@"{\f1\fnil\fcharset0 Arial Unicode MS;}}"); - else - sb.Append(@"{\f1\fnil\fcharset0 FreeMono;}}"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing - return sb.ToString(); - } - } - private string FontSize - { - get - { - Match match = Regex.Match(Rtf, @"\\fs[0-9]*"); - return match.Value; - } - } - - private void AddLink20(string linkValue, string linkUrl) - { - string fonttab = FontTable; - string fontsize = FontSize; - //if (this.DetectUrls) this.DetectUrls = false; - if (SelectionLength > 0)HandleDeleteKeyWithSelectedText(new KeyEventArgs(Keys.None), null); - int position = SelectionStart; - SelectionLength = 0; - linkValue = linkValue.Replace("\\u8209?", "\\f1\\u8209?\\f0 "); - linkValue = linkValue.Replace("\\u916?", "\\f1\\u916?\\f0 "); - linkValue = linkValue.Replace(@"{", @"\{"); - linkValue = linkValue.Replace(@"}", @"\}"); - SelectedRtf = @"{\rtf1\ansi"+FontTable+@"{\colortbl ;\red255\green0\blue0;}\v"+FontSize+@" \v0 }"; - this.SelectionLength = 0; - this.SelectionStart = position; - FindAllLinks(); - } - private void AddLink50(string linkValue, string linkUrl) - { - //this.DetectUrls = false; - int position = SelectionStart; - SelectionLength = 0; - SelectedRtf = string.Format(@"{{\rtf\field{{\*\fldinst{{HYPERLINK ""www.volian.com #{0}"" }}}}{{\fldrslt{{\cf2\ul {1}}}}}}}", linkUrl, linkValue); - this.SelectionStart = this.TextLength; - this.SelectionLength = 0; - } - private void AddRtfStyles() - { - if ((OrigDisplayText.TextFont.Style & E_Style.Bold) > 0) - { - this.SelectAll(); - RTBAPI.ToggleBold(true, this, RTBAPI.RTBSelection.SCF_SELECTION); - this.Select(0, 0); - } - // Bug Fix - // The code below was changed to select all of the text and then - // apply the underlining to the selected text, because if the - // the underlining was applied to RTBAPI.RTBSelection.SCF_ALL - // the Links were changed so that they were no longer hidden. - if ((OrigDisplayText.TextFont.Style & E_Style.Underline) > 0) - // RTBAPI.ToggleUnderline(true, this, RTBAPI.RTBSelection.SCF_ALL); - { - this.SelectAll(); - RTBAPI.ToggleUnderline(true, this, RTBAPI.RTBSelection.SCF_SELECTION); - this.Select(0, 0); - } - // Bug Fix - // The code below was changed to select all of the text and then - // apply the italics to the selected text, because if the - // the italics was applied to RTBAPI.RTBSelection.SCF_ALL - // the Links were changed so that they were no longer hidden. - if ((OrigDisplayText.TextFont.Style & E_Style.Italics) > 0) - // RTBAPI.ToggleItalic(true, this, RTBAPI.RTBSelection.SCF_ALL); - { - this.SelectAll(); - RTBAPI.ToggleItalic(true, this, RTBAPI.RTBSelection.SCF_SELECTION); - this.Select(0, 0); - } - } - #endregion - #region HeightSupport - public event StepRTBEvent HeightChanged; - private void OnHeightChanged(object sender, EventArgs args) - { - if (HeightChanged != null) HeightChanged(sender, args); - } - private void AdjustSizeForContents(bool adjustWidth) - { - if (!_InitializingRTB) - { - Size offset = Size - ClientSize; - int widthNew = (this is TableCellEditor) ? Width : (ContentsSize.Width + offset.Width + AdjustSize.Width); - //int widthNew = Width; - //if (!(this is TableCellEditor)) - // widthNew = ContentsSize.Width + offset.Width + AdjustSize.Width; - int heightNew = ContentsSize.Height + offset.Height + AdjustSize.Height; - // Don't make the window narrower unless it has text - RHM - 20100107 - Size szNew = new Size(((Text != "" && adjustWidth) ? widthNew : (widthNew > Width ? widthNew : Width)), heightNew); - if (this.Size != szNew) - { - int heightOld = Height; - //Console.WriteLine("before {0}, {1}, {2}, {3}, {4}", Size, szNew, widthNew, Width, this.GetType().Name); - this.Size = szNew; - //Console.WriteLine("after {0}, {1}, {2}, {3}", Size, szNew, widthNew, Width); - if (heightOld != Height) - { - OnHeightChanged(this, new EventArgs()); - if (ScrollPos.Y != 0) // Adjust ScrollPosition if it isn't Zero - ScrollPos = new Point(0, 0); - } - } - } - } - private float GetStringWidth(string strMeasureString) - { - using (Graphics g = Graphics.FromHwnd(Handle)) - { - return g.MeasureString(strMeasureString, Font).Width; - } - } - private int Ceiling(float f) - { - return (int)(Math.Ceiling(f)); - } - public int MaxTextWidth - { - get - { - int maxWidth = 0; - for (int i = 0; i < TextLength; i++) - { - int w = GetPositionFromCharIndex(i).X; - maxWidth = Math.Max(maxWidth, w); - } - return maxWidth+10; // add 10 to account for the last character - } - } - public void AdjustWidthForContent() - { - AdjustWidthForContent(0); - } - public void AdjustWidthForContent(int count) - { - int widthNL = Ceiling(GetStringWidth("\n")); - int widthMax = 0; - int widthMaxWW = 0; - int indexStart = 0; - int lineCountFromLines = Lines.Length; - int lineCountFromGet = GetLineFromCharIndex(TextLength)+1; - for (int i = 0; i < Lines.Length; i++) - { - int lineStart = GetLineFromCharIndex(indexStart); - int indexEnd = indexStart + Lines[i].Length; - int lineEnd = GetLineFromCharIndex(indexEnd); - Point pointStart = GetPositionFromCharIndex(indexStart); - Point pointEnd = GetPositionFromCharIndex(indexEnd); - int indexEndPos = GetCharIndexFromPosition(pointEnd); - if (indexEndPos + 1 < indexEnd) // This indicates that the text is wider than the Rich Text Box - { - int w = pointEnd.X + (indexEnd - indexEndPos) * widthNL; - if (w > widthMaxWW) - widthMaxWW = w; - } - if (lineEnd > lineStart)// this indicates that there was word-wrap on this line. - { - int w = pointEnd.X + Width * (lineEnd - lineStart); - if (w > widthMaxWW) - widthMaxWW = w; - } - else - { - if (pointEnd.X > widthMax) - widthMax = pointEnd.X; - } - indexStart = indexEnd + 1; - } - if (widthMaxWW == 0) - { - int widthBorder = Width - ClientSize.Width; - int w = widthMax + widthNL + widthBorder; - if (Width != w) - { - if (count < 5 || Width < w) - { - Width = w; - AdjustWidthForContent(count + 1);// Try one more time - } - } - } - else - { - if (count < 5 || Width < widthMaxWW) - { - Width = widthMaxWW; - AdjustWidthForContent(count + 1); - } - } - } - public int CalculateHeight() - { - if (this.CreateParams.ClassName == "RICHEDIT50W") - return CalculateHeight50(); - else - return CalculateHeight20(); - } - private int CalculateHeight20() - { - Application.DoEvents(); - int yBottom = GetPositionFromCharIndex(TextLength).Y; - int yTop = GetPositionFromCharIndex(0).Y; - int heightFont = SelectionFont.Height; - int borderSize = this.Height - this.ClientSize.Height; - int heightNext = (yBottom - yTop) + heightFont + borderSize + 2;// 2 pixels - 1 at the top and 1 at the bottom - if (heightNext != Height) - { - Height = heightNext; - - OnHeightChanged(this, new EventArgs()); - ScrollPos = new Point(0, 0); // Scroll to make sure that the first line is displayed as the first line - } - return heightNext; - } - private int CalculateHeight50() - { - Application.DoEvents(); - int heightFont = SelectionFont.Height; - int borderSize = this.Height - this.ClientSize.Height; - int heightNext = (1 + GetLineFromCharIndex(TextLength)) * heightFont + borderSize + 2;// 2 pixels - 1 at the top and 1 at the bottom - return heightNext; - } - #endregion - #region ColorSupport - Not currently used. - //private void SetBackGroundColor(ItemInfo itemInfo) - //{ - // string backcolor = null; - // int type = (int)itemInfo.MyContent.Type; - // FormatInfo formatinfo = itemInfo.ActiveFormat; - // if (type == (int)E_FromType.Procedure) - // backcolor = formatinfo.PlantFormat.FormatData.ProcData.BackColor; - // else if (type == (int)E_FromType.Section) - // backcolor = formatinfo.PlantFormat.FormatData.SectData.BackColor; - // else - // { - // int typindx = (int)itemInfo.MyContent.Type - 20000; // what to do for other types rather than steps - // backcolor = formatinfo.PlantFormat.FormatData.StepDataList[typindx].StepLayoutData.BackColor; - // } - // BackColor = Color.FromName(backcolor); - //} - #endregion - #region EventSupport - #region LinkEvents - private StepPanelLinkEventArgs _MyLinkClickedEventArgs; - public event StepRTBLinkEvent LinkChanged; - private void OnLinkChanged(object sender, StepPanelLinkEventArgs args) - { - _MyLinkClickedEventArgs = args; - if (LinkChanged != null) LinkChanged(sender, args); - } - public event StepRTBLinkEvent LinkGoTo; - private void OnLinkGoTo(object sender, StepPanelLinkEventArgs args) - { - _MyLinkClickedEventArgs = args; - if (LinkGoTo != null) LinkGoTo(sender, args); - } - public event StepRTBLinkEvent LinkModifyTran; - private void OnLinkModifyTran(object sender, StepPanelLinkEventArgs args) - { - _MyLinkClickedEventArgs = args; - if (LinkModifyTran != null) LinkModifyTran(sender, args); - } - public event StepRTBLinkEvent LinkModifyRO; - private void OnLinkModifyRO(object sender, StepPanelLinkEventArgs args) - { - _MyLinkClickedEventArgs = args; - if (LinkModifyRO != null) LinkModifyRO(sender, args); - } - #endregion - #region TextAndContentsEvents - void StepRTB_TextChanged(object sender, EventArgs e) - { - if (_InitializingRTB || _IsExperimenting) return; - // Was setting _IsDirty to true here, but this was getting called from - // 'dotnetbar' when text was NOT Changed. So _IsDirty was made into - // a property and compared original rtf versus current richtextbox's - // rtf. - // the below 2 lines were added to solve the problem with the change manager detail not showing the text of an audit when the same audit - //was selected twice - if (Text == string.Empty) - LastRtf = string.Empty; - FindAllLinks(); - } - private void ShowMyParentsFonts() - { - Console.WriteLine("\r\n--- Parents Fonts ---- For ----{0}", Text); - ShowMyParentsFonts(this); - Console.WriteLine("Selection Font".PadRight(31) + SelectionFont); - } - private void ShowMyParentsFonts(Control ctrl) - { - if (ctrl.Parent is Control) - ShowMyParentsFonts(ctrl.Parent); - Console.WriteLine("{0} {1}", ctrl.GetType().Name.PadRight(30), ctrl.Font); - } - public void StepRTB_ContentsResized(object sender, ContentsResizedEventArgs e) - { - ContentsRectangle = e.NewRectangle; - } - #endregion - #region Selection Handlers - bool _AdjustingSelection = false; - private bool _ProcessingDelete; - private bool _HandlingCtrlA = false; - private void HandleLocalSelectionChange() - { - //if (MyRTBItem != null && MyRTBItem.MyStepPanel.SelectedStepRTB != this) - if (OnIsNotCurrentSelection(this, new EventArgs())) - return; - - HandleSelectionChange(); - } - private void HandleSelectionChange() - { - if (_HandlingCtrlA) return; - if (!_HandlingCtrlA && this.TextLength == this.SelectionLength && this.SelectedRtf.EndsWith("\\par\r\n}\r\n")) - { - _HandlingCtrlA = true; - SelectAll(); - _HandlingCtrlA = false; - } - //HandleOverWrite(); - //vlnStackTrace.ShowStackLocal("HandleSelectionChangeStack", 1, 10); - bool startingValue = _AdjustingSelection; - if (_IdentifyingLinks || _ProcessingDelete) return; - // If the cursor is beyond the end of the line then move the cursor back one character - if (CorrectSelectionAtEndOfLine()) - return; - if (ProcessKeystrokes) - { - if (!_MouseDown && !_AdjustingSelection) - { - if (_LinkLocations != null) - { - DebugPrint("HSC===================>Beginning: SelectionStart {0}, SelectionLength {1}", SelectionStart, SelectionLength); - _AdjustingSelection = true; - LinkLocation ll = FindLinkLocation(); - LinkLocation llend = null; - if (SelectionLength != 0) - llend = FindLinkLocation(SelectionStart + SelectionLength - 1); - if (ll != null) - { - if (SelectionStart == ll.Start && SelectionLength == 0) - { - if (SelectionStart >= 7) - { - // If the cursor is at the beginning of the line and a link is at the beginning of the line - // then select the link rather than postitioning the cursor at the end of the previous line - if (!_LastWasLeftArrow && GetFirstCharIndexOfCurrentLine() == SelectionStart) - SetSelection(ll); - else - { - DebugPrint("HSC===================>ll Insert: Sel {0}, Length {1}, Link Start {2}, Link Length {3}", SelectionStart, SelectionLength, ll.Start, ll.Length); - SelectionStart = ll.Start - 7; - } - } - } - else if (SelectionStart + SelectionLength > ll.End) // Beyond the end of the starting link - { - int end = SelectionStart + SelectionLength; - if (llend != null) end = llend.End; // If it extends into another link extend the end to the end of that link - DebugPrint("HSC===================>ll After: Sel {0}, Length {1}, Link Start {2}, Link Length {3}", SelectionStart, SelectionLength, ll.Start, ll.Length); - SetSelection(ll.Start, end - ll.Start); - } - else if (SelectionStart >= ll.Start || SelectionLength > 0)// Within the starting link - { - DebugPrint("HSC===================>ll: Sel {0}, Length {1}, Link Start {2}, Link Length {3}", SelectionStart, SelectionLength, ll.Start, ll.Length); - SetSelection(ll); - } - } - else if (llend != null) - { - DebugPrint("HSC===================>llend: Sel {0}, Length {1}, Link Start {2}, Link Length {3}", SelectionStart, SelectionLength, llend.Start, llend.Length); - // Check to see if the beginning starts before the Removing ending Removing starting _AdjustingSelection problem"); - DebugPrint("RS------ SelectionChange > {0}", FindRangeStatus()); - if (SelectionLength > 0 && IsSelectionLinked(SelectionStart, SelectionLength)) - { - if (SelectedText.IndexOf(@"[END>") > 0) MyLinkText = SelectedText.Substring(0, SelectedText.IndexOf(@"[END>")); - else MyLinkText = SelectedText; - } - else - MyLinkText = null; - OnRTBSelectionChanged(this, new EventArgs()); - _LastWasLeftArrow = false; - } - /// - /// If the Selection is beyond the end of the line, move the selection back one character - /// - /// - private bool CorrectSelectionAtEndOfLine() - { - if (SelectionStart > 0 && SelectionLength == 0 && - GetFirstCharIndexFromLine(GetLineFromCharIndex(SelectionStart)) > - GetFirstCharIndexOfCurrentLine()) - { - SelectionStart--; // Move the cursor back one character - return true; - } - return false; - } - - //private void HandleOverWrite() - //{ - // if (!_OverWrite) return; - // if (SelectionLength > 0) return; - // if (SelectionStart == TextLength) return; - // Console.WriteLine("Handle Overwrite, SelectionStart = {0}, SelectionLength = {1}", SelectionStart, SelectionLength); - // SelectionLength = 1; - //} - private bool _CheckSelection = false; - #endregion - #region Delete Handlers - private void HandleDeleteKeyWithSelectedText(KeyEventArgs e, string keychars) - { - _ProcessingDelete = true; - FindRangeStatus(); - //DebugPrint("RS---------------- Delete > {0}", _RTBRangeStatus); - switch (_RTBRangeStatus) - { - case RangeStatus.NoContainedLinks: - case RangeStatus.Before_After: - case RangeStatus.Before_EndLink: - case RangeStatus.Before_EndBox: - default: - DeleteCurrentSelection(keychars); - e.SuppressKeyPress = true; - break; - case RangeStatus.Before_Between: //myRTB1.SelectedText.EndsWith(@"[END> - /// This inserts a space in between two links. - /// It actually inserts "\v0 {space}\v " between the END tag and the START tag - /// - /// - /// - /// - private void InsertCharBetweenLinks(LinkLocation ll, char charToAdd, bool setSelect) - { - //_InsertingSpaceBetweenLinks = true; - DebugPrint("ICBLvvvvvvvvvvvvvvv>>>"); - Rtf = Rtf.Substring(0, ll.StartRtf) + @"\v0 " + charToAdd.ToString() + @"\v " + Rtf.Substring(ll.StartRtf); - //_InsertingSpaceBetweenLinks = false; - if (setSelect) - SelectionStart = ll.Start - 6; // account for >>"); - } - private void ExpandSelectionToIncludeStart() - { - //_AdjustingSelection = true; - SetSelection(SelectionStart - 7, SelectionLength + 7); // Expand selection to include start - //_AdjustingSelection = false; - } - public string GetSelectionForClipBoard() - { - string selTxtRTF = SelectedRtf; - LinkLocation llstart = FindLinkLocation(); - if (llstart != null) - { - selTxtRTF = Rtf.Substring(llstart.StartRtf, llstart.EndRtf - llstart.StartRtf); - string lookfor = selTxtRTF.Substring(selTxtRTF.IndexOf(' ')); - return SelectedRtf.Replace(lookfor, @"\v " + selTxtRTF); - } - return (selTxtRTF); - } - - private void DeleteBetweenBetweenLinks(string keychars) - { - - DebugSelection("DeleteBetweenBetweenLinks"); - int selStart = SelectionStart - 7; - int selLength = SelectionLength + 2; // Include the two added spaces - InsertCharBetweenLinks(_RangeEndLink.NextLink); // Add a space at the end link - InsertCharBetweenLinks(_RangeStartLink); // Add a space a the start link - SetSelection(selStart, selLength);// Select everything including the spaces - DeleteCurrentSelection(keychars);// Delete Selection - } - /// - /// This is added to handle a glitch in richtextbox. Depending on - /// which direction that selection is made (left -> right or right -> left) - /// a replacement or delete may not work, you'll just get a 'beep'. - /// This approach consistently works. - /// - public bool WasXDelete = false; - private void DeleteCurrentSelection(string keys) - { - - DebugPrint("vvvvvvvvvvvvxxxxxxxxxxxx>"); - DebugSelection("Before X"); - DebugPrint(keys == null ? "NULL" : "NOT NULL"); - SelectedText = keys==null?"X":keys; // replace text with X - WasXDelete = (keys == null); - DebugSelection("After X"); - DebugPrint("------------xxxxxxxxxxxx>"); - if (keys == null) - { - _SendBackSpace = true; - RtbSendKeys("{BS}"); // remove X - //this.ClearUndo(); // undo was redisplay 'X' and then deleted text - Application.DoEvents(); - DebugSelection("After BS"); - } - DebugPrint("^^^^^^^^^^^^xxxxxxxxxxxx>"); - } - private void DeleteSelection(int start, int length, string keychars) - { - SetSelection(start, length); - DeleteCurrentSelection(keychars); - } - private void DeleteEndBetweenLinks(string keychars) - { - _ProcessingKeys++; - DebugSelection("DeleteEndBetweenLinks"); - int sstart = SelectionStart; - int slen = SelectionLength + 1 - 7; - // This puts a space at the link that starts at the end of the selection - InsertCharBetweenLinks(_RangeEndLink.NextLink); - //_AdjustingSelection = true; - DeleteSelection(sstart, slen, keychars); - //_AdjustingSelection = false; - _ProcessingKeys--; - } - private void DeleteStartBetweenLinks(string keychars) - { - _ProcessingKeys++; - DebugSelection("DeleteStartBetweenLinks"); - int slen = SelectionLength + 8; - int sstart = SelectionStart - 7; - //LinkLocation ll = FindBetweenLinks(SelectionStart); - InsertCharBetweenLinks(_RangeStartLink); - DeleteSelection(sstart, slen, keychars); - _ProcessingKeys--; - } - private void DeleteFromStartOfBox(string keychars) - { - _ProcessingKeys++; - DebugSelection("DeleteFromStartOfBox"); - int slen = SelectionLength; - SetSelection(0, 0); - //RtbSendKeys(" "); // open for space between links which separates END/START tokens - SelectedText = " "; - DeleteSelection(0, slen + 8, keychars); - _ProcessingKeys--; - } - private void DeleteFromStartOfBoxEndBetweenLinks(string keychars) - { - _ProcessingKeys++; - DebugSelection("DeleteFromStartOfBoxEndBetweenLinks"); - // This puts a space at the link that starts at the end of the selection - int sLen = SelectionStart + SelectionLength - 7 + 2;// -7 for 0) SetSelection(SelectionStart, newend - SelectionStart); - break; - case Keys.Space: - if (e.Control) // Hardspace - Ctrl+Shift+Space - InsertSymbol(@"\u160?"); - break; - case Keys.F3: // shift F3 - e.Handled = true; - ToggleCase(); // toggle through Upper, Lower, and Title case - break; - default: - break; - } - } - - private string GetSelectedDisplayableText() - { - using (StepRTB srtb = new StepRTB()) - { - srtb.Rtf = this.SelectedRtf.Replace(@"\u8209?", "-"); - string rtnstr = ""; - string ctxt = srtb.Text;//this.SelectedText; - if (ctxt.EndsWith(""); - if ((strtidx == -1 || strtidx > lnkidx) && lnkidx > -1 && endidx > -1) - { - rtnstr += ctxt.Substring(idx, lnkidx); - idx = endidx + 5; - strtidx = ctxt.IndexOf("", idx); - } - while (strtidx > -1) - { - rtnstr += ctxt.Substring(idx, strtidx - idx); - idx = strtidx + 7; - rtnstr += ctxt.Substring(idx, lnkidx - idx); - idx = endidx + 5; - strtidx = ctxt.IndexOf("", idx); - } - if (idx < ctxt.Length) - rtnstr += ctxt.Substring(idx); - return rtnstr; - } - } - - private bool IsControlChar = false; - private bool _SendBackSpace = false; - private int _ImageWidth = 0; - public int ImageWidth - { - get { return _ImageWidth; } - set { _ImageWidth = value; } - } - void StepRTB_KeyDown(object sender, KeyEventArgs e) - { - // added jcb 20130103 to support set ro from word doc with annotation when right click menu is opened by keyboard - if (e.KeyCode == Keys.Apps) - OnSetMenu(this, new StepRTBMenuEventArgs("OpenContextMenu")); - if (e.Control) - { - IsControlChar = true; - if (e.Shift) - { - //Console.WriteLine("keycode = {0} key value = {1}",e.KeyCode,e.KeyValue); - switch (e.KeyCode) - { - // The following keys are supported in underlying RTB (with ctrl+shift key), - // but PROMS should not do anything for that functionality: - case Keys.Add: // the plus on the key pad - case Keys.Subtract: - case Keys.L: - case Keys.Oemplus: // the plus on the keyboard (not the key pad) - e.Handled = true; - break; - } - } - else - { - switch (e.KeyCode) - { - case Keys.X: //ctrl-X - case Keys.C: //ctrl-C - // handle the clipboard copy and cut when a Transition or RO is selected - // For now, we are coping/cutting just the displayed text to the clipboard (like 16-bit VE-PROMS) - string ts = GetSelectedDisplayableText(); - if (ts != null && ts != "") Clipboard.SetText(GetSelectedDisplayableText()); - e.Handled = true; - e.SuppressKeyPress = true; - if (ts != null && ts != "" && e.KeyCode == Keys.X) // cut to clipboard - delete the selected text - HandleDeleteKeyWithSelectedText(e, null); - break; - case Keys.V: - // NOTE that if in a Properties Dialog StepRTB (for numbers and titles) or in a Procedure Specific - // Information (PSI) Dialog, i.e. any non-EditItem/Step editor field, the following code is run - // for the ctrl-V. For EditItems & Grid cells, the code in StepTabRibbon's btnPaste_Click is - // run. The way this occurs is that in the designer for StepTabRibbon (StepTabRibbon.designer.cs), - // the line of code: - // this.btnPaste.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlV); - // maps the Ctrl-V to btnPaste for those StepRTB's that are associated with the StepTabRibbon, i.e. - // EditItems & Grid cells. - IDataObject iData = Clipboard.GetDataObject(); - if (iData.GetDataPresent(DataFormats.Dib)) // Device Independent Bitmap - { - System.Drawing.Image img = Clipboard.GetImage(); - ImageWidth = img.Width; - Width = ImageWidth + 2; - Paste(); - } - else - { - if (!iData.GetDataPresent(DataFormats.Text) && !iData.GetDataPresent(DataFormats.Rtf)) - { - MessageBox.Show("Cannot paste, text has special characters or symbols that will not paste correctly."); - } - else - { - // if contains bad rtf (from Word), paste as text, otherwise, do the paste here. - if (!PasteRtfAsText(true)) Paste(); - if (SelectionLength == 0) SelectionFont = MyStyleFont.WindowsFont; - } - } - e.Handled = true; - return; - case Keys.Home: - StepRTB_HomeEndPressed(e); - e.Handled = true; - break; - case Keys.End: - StepRTB_HomeEndPressed(e); - e.Handled = true; - break; - // 16bit Proms used 'ctrl-enter' for Hard returns. 32bit Proms uses 'shift-enter' - // because the richtextbox does this by default. Also Word uses 'shift-enter' - // for Hard return. And Word uses 'ctrl-enter' for inserting of page break. So - // 'ctrl-enter' for 32bit will insert page break - case Keys.Enter: - OnInsertPgBrk(this, new EventArgs()); - e.Handled = true; - break; - // The following keys are supported in underlying RTB (with ctrl key), but PROMS should not - // do anything for that functionality: - case Keys.R: // Right Align text - case Keys.L: // Left Align text - case Keys.E: // Center Align text - case Keys.D1: // Single space text (D1 is the '1' key) - case Keys.D2: // Double space text - case Keys.D5: // 1.5 space text - case Keys.H: // Find (proms uses Ctrl+F for find) - case Keys.Oemplus: // plus on the keyboard (not the key pad) - e.Handled = true; - break; - } - } - } - if (((int)e.KeyCode) == 220) e.Handled = true; - switch (e.KeyCode) - { - case Keys.Left: - if (e.Shift) - { - int linkWidth = FindlinkWidth(false,e.Control); - - if (linkWidth == 0)// if not link, don't do special processing - { - if (e.Control) - { - this.AutoWordSelection = true; // this will select a word at a time - } - return; - } - else - linkWidth++; - int len = SelectionLength - linkWidth; - SetSelection(SelectionStart, len); // adjust the selcection around the linked text - e.Handled = true; - return; - } - if (e.Control || SelectionStart == 0) - { - StepRTB_ArrowPressed(e.Control ? E_ArrowKeys.CtrlLeft : E_ArrowKeys.Left); - e.Handled = true; - } - HandleLocalSelectionChange(); - break; - case Keys.Up: - int ln = GetLineFromCharIndex(SelectionStart); - if (e.Control || ln == 0) - { - StepRTB_ArrowPressed(e.Control ? E_ArrowKeys.CtrlUp : E_ArrowKeys.Up); - e.Handled = true; - } - // if shift-up & at selection had a link, handle this as special case. - if (e.Shift && SelectionLength > 0) - { - RangeStatus rs = FindRangeStatus(); - if (rs != RangeStatus.NoContainedLinks) - { - int curend = SelectionStart + SelectionLength; - SelectionLength = 0; - RtbSendKeys("{Up}"); - Application.DoEvents(); - Select(SelectionStart, curend - SelectionStart); - e.Handled = true; - } - } - else - { - HandleLocalSelectionChange(); - } - break; - case Keys.Right: - // If at beginning of box that starts with a link, don't worry about shift or not, - // because selection is first character or link without any other selection. Don't - // need to write code to handle link at beginning of box in Shift Right code because - // it's handled in HandleSelectionChange. - if (e.Shift && ((SelectionStart > 0) || (SelectionStart == 0 && _LinkLocations.Count > 0 && _LinkLocations[0].Start != 7))) - { - int newlen = FindlinkWidth(true,e.Control); - if (newlen == 0) // not on linked text - { - if (e.Shift && e.Control) - this.AutoWordSelection = true; - return; - } - else if (e.Shift && e.Control) - newlen++; - int len = SelectionLength + newlen; - SetSelection(SelectionStart, len); // adjust the selection around the linked text - e.Handled = true; - return; - } - if (e.Control || SelectionStart == this.Text.Length) - { - StepRTB_ArrowPressed(e.Control ? E_ArrowKeys.CtrlRight : E_ArrowKeys.Right); - e.Handled = true; - } - HandleLocalSelectionChange(); - break; - case Keys.Down: - int l = GetLineFromCharIndex(SelectionStart); - Point pos = new Point(); - pos.X = ClientRectangle.Width; - pos.Y = ClientRectangle.Height; - int lastIndex = this.GetCharIndexFromPosition(pos); - int lastLine = this.GetLineFromCharIndex(lastIndex); - if (e.Control || l >= lastLine) - { - StepRTB_ArrowPressed(e.Control ? E_ArrowKeys.CtrlDown : E_ArrowKeys.Down); - HandleLocalSelectionChange(); - e.Handled = true; - return; - } - if (!e.Shift) HandleLocalSelectionChange(); - // if shift-down & on link at beginning of box - do special processing (regular processing - // didn't handle it correctly. - if (e.Shift && lastLine > 0 && SelectionStart == 0 && _LinkLocations.Count > 0 && _LinkLocations[0].Start == 7) - { - Point cpos = GetPositionFromCharIndex(SelectionStart); - int addon = ClientRectangle.Height / (lastLine + 1); - cpos.Y = cpos.Y + addon; - int selend = GetCharIndexFromPosition(cpos); - Select(7, selend - 7); - e.Handled = true; - } - break; - case Keys.PageUp: - StepRTB_PageKeyPressed(e); - e.Handled = true; - break; - case Keys.PageDown: - StepRTB_PageKeyPressed(e); - e.Handled = true; - break; - case Keys.Delete: - if (SelectionLength == 0) - { - foreach (LinkLocation lls in _LinkLocations) - { - if (SelectionStart >= lls.Start - 7 && SelectionStart < lls.End) - { - SetSelection(lls);// Select the link to the right - HandleDeleteKeyWithSelectedText(e, null); - e.SuppressKeyPress = true; - return; - } - } - if (SelectionStart != TextLength) - { - SelectionStart++;// A Delete can be accomplished with a right arrow followed by a backspace. - RtbSendKeys("{BS}"); // This is done due to a glitch in the RichTextBox that sometimes causes a beep rather than a delete - e.SuppressKeyPress = true; - } - } - else - HandleDeleteKeyWithSelectedText(e, null); - break; - case Keys.Back: - if (_SendBackSpace) - { - _SendBackSpace = false; - return; - } - _CheckSelection = true; - if (SelectionLength == 0) - { - foreach (LinkLocation lls in _LinkLocations) - { - if (SelectionStart > lls.Start - 7 && SelectionStart <= lls.End) - { - SetSelection(lls); - break; - } - } - } - if (SelectionLength > 0) HandleDeleteKeyWithSelectedText(e, null); - break; - case Keys.Insert: - //_OverWrite = !_OverWrite; - //if (_OverWrite) - //{ - // HandleSelectionChange(); - //} - //else - //{ - // SelectionLength = 0; - // HandleSelectionChange(); - //} - // For now, don't allow for toggling between insert/overwrite mode - see - // comment on _OverWrite - e.Handled = true; - break; - case Keys.F5: - if (e.Shift) - { - e.Handled = true; - ItemInfo myCopyStep = (this.Parent.Parent.Parent as StepTabPanel).MyDisplayTabControl.MyCopyStep; - if (myCopyStep != null) - { - if (this.MyItemInfo.IsSection && myCopyStep.IsSection) - OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste")); - if (this.MyItemInfo.IsStep && myCopyStep.IsStep) - { - if ((this.MyItemInfo.IsHigh && myCopyStep.IsHigh) || (!this.MyItemInfo.IsHigh && !myCopyStep.IsHigh)) - OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste")); - } - } - //if (!OnCheckClipboard(this, new EventArgs())) return; // check if 'clipboard' contains a step. - //OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste")); - } - else if (!e.Control && !e.Alt) - { - e.Handled = true; - OnCopyStep(this, new EventArgs()); - } - break; - case Keys.F6: - e.Handled = true; - SendKeys.Send("%H{ESC}"); - break; - case Keys.Tab: - VlnFlexGrid myGrid = Parent as VlnFlexGrid; - if (myGrid == null) - { - e.SuppressKeyPress = true; - e.Handled = true; - Form frm = ParentForm(this); - if (frm != null) - frm.SelectNextControl(this, true, true, true, true); - else - StepRTB_ArrowPressed(e.Shift ? E_ArrowKeys.CtrlUp : E_ArrowKeys.CtrlRight); - } - else - { - if (e.Shift) - { - e.SuppressKeyPress = true; - e.Handled = true; - if (!myGrid.SelectPrevCell()) - { - // don't do anything if at top (for now) - } - } - else - { - e.SuppressKeyPress = true; - e.Handled = true; - if (!myGrid.SelectNextCell()) - { - myGrid.MyBorders.InsertRow(myGrid.Rows.Count - 1); - myGrid.Rows.Add(1); - myGrid.SelectNextCell(); - } - } - } - break; - case Keys.Enter: - if (!e.Control && !e.Shift && !e.Alt) - { - OnEnterKeyPressed(sender, e); - } - break; - case Keys.F2: - if (e.Alt && !e.Control && !e.Shift) // toggle change bar - { - OnToggleChangeBar(this, new EventArgs()); - e.Handled = true; - } - break; - case Keys.F7: - if (!e.Alt) // for the Include On check boxes on the step properties page - { - if (e.Control && e.Shift) // Toggle include on Placekeeper as Continuous Action - OnTogglePlaceKeeperContAct(this, new EventArgs()); - else if (e.Control) // Toggle include on Placekeeper - OnTogglePlaceKeeper(this, new EventArgs()); - else if (e.Shift) // toggle include on Continuous Action Summary - OnToggleContinuousActionSummary(this, new EventArgs()); - e.Handled = true; - } - break; - } - if (e.KeyValue == 187 && e.Control) // equal key pressed - { - if (e.Shift) // superscript - { - OnToggleSuperScript(this, new EventArgs()); - } - else // subscript - { - OnToggleSubScript(this, new EventArgs()); - } - e.Handled = true; - } - } - private static Form ParentForm(Control ctrl) - { - while (!(ctrl.Parent is Form || ctrl.Parent is EditItem)) - ctrl = ctrl.Parent; - return ctrl.Parent as Form; - } - private void StepRTB_HomeEndPressed(KeyEventArgs keyargs) - { - if (MyItemInfo.IsProcedure || MyItemInfo.IsSection) return; - // Cursor moves out of box only if control is pressed too - otherwise key is - // handled in rtb. - //if (keyargs.Control)MyRTBItem.MyStepPanel.StepCursorKeys(this, keyargs); // Replaced with an event - if (keyargs.Control) OnCursorKeyPress(this, keyargs); - } - private void StepRTB_PageKeyPressed(KeyEventArgs keyargs) - { - if (MyItemInfo.IsProcedure || MyItemInfo.IsSection) return; - //MyRTBItem.MyStepPanel.StepCursorKeys(this, keyargs); Replaced with an event - OnCursorKeyPress(this, keyargs); - } - public void StepRTB_ArrowPressed(E_ArrowKeys key) - { - Point cp = PointToClient(Cursor.Position); - //MyRTBItem.MyStepPanel.CursorMovement(this, cp, key); Replaced with an event - OnCursorMovement(this, new StepRTBCursorMovementEventArgs(cp, key)); - } - private void StepRTB_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) - { - if (!ReadOnly) - { - if (Text == "" && Parent != null && Parent is VlnFlexGrid) - { - //ShowMyParentsFonts(); - SelectionFont = Parent.Font; - } - // add the character with its font depending on the char.... - if (!IsControlChar) - { - string strpressed = null; - if (e.KeyChar == '-') - strpressed = GetAddSymbolText(@"\u8209?"); - else - strpressed = e.KeyChar.ToString(); - if (e.KeyChar >= ' ') - { - LinkLocation ll = FindBetweenLinks(); - if (ll != null && SelectionLength == 0) // SelectionLength = 0 means insert - { - if (e.KeyChar == '}') - strpressed = @"\}"; - else if (e.KeyChar == '{') - strpressed = @"\{"; - InsertCharBetweenLinks(ll, strpressed); // e.KeyChar); - e.Handled = true; - } - else if (SelectionLength != 0) - { - HandleDeleteKeyWithSelectedText(new KeyEventArgs(Keys.None), strpressed); - e.Handled = true; - } - } - if (!e.Handled) - { - if (e.KeyChar == '-') - AddSymbol(@"\u8209?"); - else if (e.KeyChar == '{') - AddRtf(@"\{"); - else if (e.KeyChar == '}') - AddRtf(@"\}"); - else if (e.KeyChar == '\\') - AddRtf(@"\\"); - else - return; - e.Handled = true; // flag that it's been handled, otherwise, will get 2 chars. - } - if (e.Handled && SelectionLength != 0) SelectionFont = MyStyleFont.WindowsFont; - } - IsControlChar = false; - } - } - private void RtbSendKeys(string keys) - { - Focus(); - SendKeys.Send(keys); // With .Net Framework 3.0 this can be replaced with EditingCommands - // http://msdn.microsoft.com/en-us/library/ms771634.aspx - } - public bool PasteRtfAsText(bool PasteNoReturnsSetting) - { - // check if rtf is coming from Word, i.e. if it has 'SCHEMAS.MICROSOFT.COM/OFFICE/WORD'. - // If it is coming from Word, it will be pasted as text so as not to get any rtf commands - // that PROMS does not support such as odd Fonts, other symbols, etc. This isn't a complete - // solution, clipboard data may come from other 3rd-party tools and unsupported Rtf may get - // pasted in. But the hope is that this will happen less often than getting it from MS Word. - IDataObject myDO = Clipboard.GetDataObject(); - if (myDO.GetDataPresent(DataFormats.Text)) return false; - string tmpForLink = myDO.GetData(DataFormats.Rtf).ToString(); - if (tmpForLink.ToUpper().Contains(@"SCHEMAS.MICROSOFT.COM/OFFICE/WORD")) - { - SelectedText = GetPasteText(PasteNoReturnsSetting, myDO); - return true; - } - return false; - } - - public string GetPasteText(bool PasteNoReturnsSetting, IDataObject myDO) - { - // allowable symbols are those symbols between 127-256 that the proms editor supports that - // can be pasted from word as is. These symbols are (in the order they are in the following - // string): degree, plus/minus, exponent 2, exponent 3, micro, quarter, half, divide: - char[] allowableSymbols = { '\xb0', '\xb1', '\xb2', '\xb3', '\xb5', '\xbc', '\xbd', '\xf7' }; - string ptext = myDO.GetData(DataFormats.Text).ToString(); - ptext = ptext.TrimEnd("\r\n\t ".ToCharArray()); - if (PasteNoReturnsSetting) ptext = ptext.Replace("\r\n", " "); - StringBuilder sb = new StringBuilder(ptext); - bool didCharReplace = false; - for (int i = 0; i < ptext.Length; i++) - { - // if allowable, allow for it to pasted. Otherwise, replace that character with a '?'. - if ((sb[i] > 0x7e)) - if ((ptext.Substring(i, 1).IndexOfAny(allowableSymbols) < 0)) - { - sb[i] = '?'; - didCharReplace = true; - } - } - ptext = sb.ToString(); - ptext = ptext.Replace("\u2013", "-"); // Replace EN Dash with hyphen - ptext = ptext.Replace("\u2014", "-"); // Replace EM Dash with hyphen - ptext = ptext.Replace("\u2011", "-"); // Replace non-breaking hyphen with hyphen - if (didCharReplace) - MessageBox.Show("Replacing pasted characters that are not supported by Proms with a '?'."); - return ptext; - } - private void DoDeleteEndBetweenLinks() - { - DebugSelection("Beginning"); - int sstart = SelectionStart; - RtbSendKeys("{RIGHT} "); // open for space between links which separates END/START tokens - SetSelection(sstart, SelectionStart - sstart - 1); // 1 is accounting for typed space - DebugSelection("SetSelection"); - RtbSendKeys("{DELETE}"); // deletes text including link - RtbSendKeys("{RIGHT}{BS}"); // deletes space that was added - } - private void DoDeleteStartBetweenLinks() - { - int slen = SelectionLength; - RtbSendKeys("{LEFT} "); - SetSelection(SelectionStart, slen + 7); - RtbSendKeys("{DELETE}"); - RtbSendKeys("{BS}"); - } - #endregion - #region LinkSelectionAndHandling - public bool IsSelectionLinked(int index, int len) - { - if (_LinkLocations == null)return false; - int sel = index; - int selLength = len; - foreach (LinkLocation ll in _LinkLocations) - { - // When the selector moved to the right of a link, the GOTO button was still lit. - // Removing the "+7" seems to have fixed this. - jsj 1/08/2010 - //if (sel >= ll.Start && sel < ll.Start + ll.Length + 7) return true; - if (sel >= ll.Start && sel < ll.Start + ll.Length) return true; - } - return false; - } - /// - /// For use in Find/Replace. - /// If text is found is part of the link information and not the link value, - /// then we want to continue searching. - /// - /// - /// - /// - public bool SkipLinkInfo(int index, int len) - { - if (_LinkLocations == null)return false; - int sel = index; - int selLength = len; - foreach (LinkLocation ll in _LinkLocations) - { - if (sel >= ll.Start - 7 && sel < ll.Start + ll.Length) - { - int pos = ll.Text.IndexOf("#Link:"); - if (sel < ll.Start || sel >= ll.Start-7+pos) - return (true); - } - } - return false; - } - #endregion - #endregion - #region SelectionStack - Stack _SelectionStack = null; - public Stack SelectionStack - { - get - { - if (_SelectionStack == null) - _SelectionStack = new Stack(); - return _SelectionStack; - } - } - public void PushSelection() - { - SelectionStack.Push(new SelectionData(this)); - } - public void PopSelection() - { - SelectionData selection = SelectionStack.Pop(); - if (SelectionStack.Count == 0) - _SelectionStack = null; - Select(selection.SelectionStart, selection.SelectionLength); - selection = null; - } - public class SelectionData - { - int _SelectionStart; - public int SelectionStart - { - get { return _SelectionStart; } - set { _SelectionStart = value; } - } - int _SelectionLength; - public int SelectionLength - { - get { return _SelectionLength; } - set { _SelectionLength = value; } - } - public SelectionData(RichTextBox richTextBox) - { - _SelectionStart = richTextBox.SelectionStart; - _SelectionLength = richTextBox.SelectionLength; - } - } - #endregion - #region Link Support - int _ProcessingKeys = 0; - - List _LinkLocations; - public List LinkLocations - { - get { return _LinkLocations; } - } - private int _FALLevel = 0; - private bool _IdentifyingLinks = false; - public void FindAllLinks() - { - if (_IdentifyingLinks || _ProcessingDelete) return; - //DebugPrint("FAL{0}vvvvvvvvvvvvvvvvvvvvvvvvv>>", ++_FALLevel); - _AdjustingSelection = true; - PushSelection(); - FindLinks(); - //IdentifyLinks(); - PopSelection(); - LinkLocation llx = FindLinkLocation(); - if (_CheckSelection) - { - if (llx != null) SetSelection(llx.End, 0); - _CheckSelection = false; - } - _AdjustingSelection = false; - if (!_ProcessingDelete) - OnLinkLocationChanged(this, new EventArgs()); - //DebugPrint("FAL{0}^^^^^^^^^^^^^^^^^^^^^^^^^>>", _FALLevel--); - - } - private void FindLinks() - { - //int oldRegexCacheSize = Regex.CacheSize; - string str = Text; - _LinkLocations = new List(); - MatchCollection matches = Regex.Matches(str, @"", RegexOptions.Singleline); - MatchCollection matchesRtf = Regex.Matches(Rtf, "", RegexOptions.Singleline); - LinkLocation thisLink = null; - for (int i = 0; i < matches.Count; i++) //each (Match match in matches) - { - Match match = matches[i]; - Match matchrtf = matchesRtf[i]; - thisLink = new LinkLocation(match.Index + 7, // If the [END> is immediately followed by "); - if (_LinkLocations == null) return null; - foreach (LinkLocation ll in _LinkLocations) - if (ll.Start == start && ll.StartsBetween) - return ll; - return null; - } - private LinkLocation FindLinkLocation() - { - return FindLinkLocation(SelectionStart); - } - private LinkLocation FindLinkLocation(int sel) - { - //DebugPrint("FL----------------Location>"); - if (_LinkLocations == null) return null; - foreach (LinkLocation ll in _LinkLocations) - { - // Moving right: - // if less than, allows stopping between two links - if (ll.Start < sel && ll.End > sel) - { - DebugPrint("Greater Than {0} {1} {2}", sel, ll.Start, ll.End); - return ll; - } - // if less than or equal, does not stop between two links - if ((!ll.StartsBetween) && ll.Start <= sel && ll.End > sel) - { - DebugPrint("Greater Than or Equal {0} {1} {2}", sel, ll.Start, ll.End); - return ll; - } - } - return null; - } - public DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg) - { - DialogResult dlgrslt = DialogResult.Yes; - if (SelectionLength > 0) - { - if (IsSelectionLinked(SelectionStart, SelectionLength)) - { - MessageBox.Show(fndrpldlg,"Cannot replace linked text!", "Find/Replace"); - dlgrslt = DialogResult.No; - } - else - { - if (prompt) - dlgrslt = MessageBox.Show(fndrpldlg,"Replace This Occurence?", "Replace Text", MessageBoxButtons.YesNoCancel); - if (dlgrslt == DialogResult.Yes) - SelectedText = rpltxt; - } - } - return dlgrslt; - } - private RichTextBoxFinds _FindOptions = RichTextBoxFinds.None; - public bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse) - { - using (StepRTB savRTF = new StepRTB()) - { - int startpos = SelectionStart + SelectionLength; - savRTF.Text = this.Text; - - _FindOptions = RichTextBoxFinds.None; - if (caseSensitive) - _FindOptions |= RichTextBoxFinds.MatchCase; - if (matchWholeWord) - _FindOptions |= RichTextBoxFinds.WholeWord; - if (reverse) - { - _FindOptions |= RichTextBoxFinds.Reverse; - savRTF.Text = this.Text.Substring(0, SelectionStart); - startpos = savRTF.Text.Length; - if (startpos == 0) - return false; // at beginning of rtfbox during a reverse find - } - else - { - if (startpos >= savRTF.Text.Length) - return false; // at end of rtfbox during a forward find - } - // look for the find string in the temporary rtfbox - // then set the cursor selection in the real rtfbox - bool keepgoing = true; - while (keepgoing) - { - int pos = savRTF.Find(str, startpos, _FindOptions); - keepgoing = false; - if (pos >= 0) - { - if (this.SkipLinkInfo(pos, str.Length)) - { - if (reverse) - { - startpos--; - savRTF.Text = savRTF.Text.Substring(0, startpos); - } - else - startpos++; - if (startpos > 0 && startpos < savRTF.Text.Length) - keepgoing = true; - } - else - { - SelectionStart = pos; - SelectionLength = str.Length; - } - } - else - return false; - } - return true; - } - } - private int FindStart() - { - foreach (LinkLocation ll in _LinkLocations) - { - if (SelectionStart == ll.End) return ll.Start; - if (SelectionStart == ll.Start) - { - if (ll.Start == 7) return 7; - return ll.Start - 8; - } - } - if (SelectionStart > 0) return SelectionStart - 1; - return 0; - } - private int FindEnd() - { - foreach (LinkLocation ll in _LinkLocations) - { - if (SelectionStart + SelectionLength + 7 == ll.Start) return ll.Length + 7; - // this is for in-between links - if (SelectionStart + SelectionLength == ll.Start) return ll.Length; - } - if (SelectionStart + SelectionLength < TextLength) return 1; - return 0; - } - private int FindEndDown() - { - foreach (LinkLocation ll in _LinkLocations) - { - if (SelectionStart + SelectionLength >= ll.Start && SelectionStart + SelectionLength <= ll.End) return ll.End; - } - return 0; - } - // if the selection is on linked text, then return the length of that linked text (the rtf length) - private int FindlinkWidth(bool movingRight, bool ctrlKey) - { - foreach (LinkLocation ll in _LinkLocations) - { - int selLen = SelectionLength + ((movingRight) ? 7 : 0); - if (SelectionStart + selLen >= ll.Start && SelectionStart + selLen - ((!movingRight && ctrlKey)?1:0) <= ll.End) return ll.End - ll.Start + 7; - } - return 0; - } - private int FindStartUp() - { - foreach (LinkLocation ll in _LinkLocations) - { - if ((SelectionStart >= ll.Start) && (SelectionStart <= ll.End)) return ll.Start; - } - return -1; - } - public void SetSelection(LinkLocation ll) - { - SetSelection(ll.Start, ll.Length); - } - public void SetSelection(int locStart, int locLength) - { - //Application.DoEvents(); // Not needed since SendKeys is always done last. - if (_IdentifyingLinks) - DebugPrint("SS------------------------> {0} {1}", locStart, locLength); - else - DebugPrint("SS========================> {0} {1}", locStart, locLength); - Select(locStart, locLength); - } - #endregion - //#region FontAndStylesSupport - //private void ToggleFontStyle(FontStyle style, bool att_on) - //{ - // int start = SelectionStart; - // int len = SelectionLength; - // System.Drawing.Font currentFont; - // FontStyle fs; - // for (int i = 0; i < len; ++i) - // { - // Select(start + i, 1); - // currentFont = SelectionFont; - // fs = currentFont.Style; - // //add or remove style - // if (!att_on)fs = fs | style; - // else fs = fs & ~style; - - // SelectionFont = new Font( - // currentFont.FontFamily, - // currentFont.Size, - // fs - // ); - // } - //} - /// - /// Returns a Font with: - /// 1) The font applying to the entire selection, if none is the default font. - /// 2) The font size applying to the entire selection, if none is the size of the default font. - /// 3) A style containing the attributes that are common to the entire selection, default regular. - /// - /// - //public Font GetFontDetails() - //{ - // //This method should handle cases that occur when multiple fonts/styles are selected - - // int start = SelectionStart; - // int len = SelectionLength; - // int TempStart = 0; - - // if (len <= 1) - // { - // // Return the selection or default font - // if (SelectionFont != null) - // return SelectionFont; - // else - // return Font; // should be default from format. - // } - - // // Step through the selected text one char at a time - // // after setting defaults from first char - // _rtbTemp.Rtf = SelectedRtf; - - // //Turn everything on so we can turn it off one by one - // FontStyle replystyle = - // FontStyle.Bold | FontStyle.Italic | FontStyle.Underline; - - // // Set reply font, size and style to that of first char in selection. - // _rtbTemp.Select(TempStart, 1); - // string replyfont = _rtbTemp.SelectionFont.Name; - // float replyfontsize = _rtbTemp.SelectionFont.Size; - // replystyle = replystyle & _rtbTemp.SelectionFont.Style; - - // // Search the rest of the selection - // for (int i = 1; i < len; ++i) - // { - // _rtbTemp.Select(TempStart + i, 1); - - // // Check reply for different style - // replystyle = replystyle & _rtbTemp.SelectionFont.Style; - - // // Check font - // if (replyfont != _rtbTemp.SelectionFont.FontFamily.Name) - // replyfont = ""; - - // // Check font size - // if (replyfontsize != _rtbTemp.SelectionFont.Size) - // replyfontsize = (float)0.0; - // } - - // // Now set font and size if more than one font or font size was selected - // if (replyfont == "") - // replyfont = _rtbTemp.Font.FontFamily.Name; - - // if (replyfontsize == 0.0) - // replyfontsize = _rtbTemp.Font.Size; - - // // generate reply font - // Font reply - // = new Font(replyfont, replyfontsize, replystyle); - - // return reply; - //} - //#endregion - #region EnumsSelectionRange - private enum StartStatus : int - { - Before = 100, - Between = 200, - StartLink = 300, - StartBox = 400 - }; - private enum EndStatus : int - { - After = 1, - Between = 2, - EndLink = 3, - EndBox = 4, - StartLink = 5 - }; - public enum RangeStatus : int - { - NoContainedLinks = 0, - Before_After = StartStatus.Before + EndStatus.After, - Before_Between = StartStatus.Before + EndStatus.Between, - Before_EndLink = StartStatus.Before + EndStatus.EndLink, - Before_EndBox = StartStatus.Before + EndStatus.EndBox, - Before_StartLink = StartStatus.Before + EndStatus.StartLink, - Between_After = StartStatus.Between + EndStatus.After, - Between_Between = StartStatus.Between + EndStatus.Between, - Between_EndLink = StartStatus.Between + EndStatus.EndLink, - Between_EndBox = StartStatus.Between + EndStatus.EndBox, - Between_StartLink = StartStatus.Between + EndStatus.StartLink, - StartLink_After = StartStatus.StartLink + EndStatus.After, - StartLink_Between = StartStatus.StartLink + EndStatus.Between, - StartLink_EndLink = StartStatus.StartLink + EndStatus.EndLink, - StartLink_EndBox = StartStatus.StartLink + EndStatus.EndBox, - StartLink_StartLink = StartStatus.StartLink + EndStatus.StartLink, - StartBox_After = StartStatus.StartBox + EndStatus.After, - StartBox_Between = StartStatus.StartBox + EndStatus.Between, - StartBox_EndLink = StartStatus.StartBox + EndStatus.EndLink, - StartBox_EndBox = StartStatus.StartBox + EndStatus.EndBox, - StartBox_StartLink = StartStatus.StartBox + EndStatus.StartLink - }; - private RangeStatus _RTBRangeStatus; - public RangeStatus RTBRangeStatus - { - get { return _RTBRangeStatus; } - set - { - _RTBRangeStatus = value; - if (!_ProcessingDelete) OnRTBRangeStatusChanged(this, new EventArgs()); - } - } - private LinkLocation _RangeStartLink = null; - private LinkLocation _RangeEndLink = null; - public RangeStatus FindRangeStatus() - { - _RangeStartLink = null; - _RangeEndLink = null; - if (_LinkLocations == null || _LinkLocations.Count == 0) - { - return RTBRangeStatus = RangeStatus.NoContainedLinks; - } - LinkLocation foundLink = null; - int start = SelectionStart; - int end = start + SelectionLength; - - foreach (LinkLocation ll in _LinkLocations) - { - if (foundLink == null && ((ll.Start >= start && ll.Start < end) || (ll.End >= start && ll.End < end))) - foundLink = ll; - if (_RangeStartLink == null && start >= ll.Start - 7 && start < ll.End) - _RangeStartLink = ll; - if (_RangeEndLink == null && end >= ll.Start && end <= ll.End) - _RangeEndLink = ll; - } - DebugPrint("SelectionStart {0}, SelectionEnd {1}, TextLength {2}", - SelectionStart, SelectionStart + SelectionLength, - TextLength); - //if (_RangeStartLink != null) - // _RangeStartLink.Show("startLink"); - //if (_RangeEndLink != null) - // _RangeEndLink.Show("endLink"); - //if (foundLink != null) - // foundLink.Show("foundLink"); - - if (foundLink == null) - return RTBRangeStatus = RangeStatus.NoContainedLinks; - - StartStatus myStartStatus = StartStatus.Before; - EndStatus myEndStatus = EndStatus.After; - if (_RangeStartLink != null) - { - if (_RangeStartLink.Start == 7) - myStartStatus = StartStatus.StartBox; - else if (_RangeStartLink.StartsBetween) - myStartStatus = StartStatus.Between; - else - myStartStatus = StartStatus.StartLink; - } - if (_RangeEndLink != null) - { - if (_RangeEndLink.End == TextLength) - myEndStatus = EndStatus.EndBox; - else if (_RangeEndLink.NextStart == _RangeEndLink.End) - myEndStatus = EndStatus.Between; - else if (end == _RangeEndLink.Start) - myEndStatus = EndStatus.StartLink; // Should not happen because of code in HandleSelectionChange - else //if (end == endLink.End) - myEndStatus = EndStatus.EndLink; - } - return RTBRangeStatus = (RangeStatus)((int)myStartStatus + (int)myEndStatus); - } - #endregion - #region OutlineTable - private string _CheckRight = "-\u2500\u2011"; - public string CheckRight - { - get { return _CheckRight; } - set { _CheckRight = value; } - } - private string _CheckAbove = "|\u2502\u2514\u252c\u253c\u251c\u250c\u2534\u2510\u2524"; - public string CheckAbove - { - get { return _CheckAbove; } - set { _CheckAbove = value; } - } - private string _CheckLeft = "-\u2500\u2524\u252c\u251c\u253c\u250c\u2510\u2514\u2011"; - public string CheckLeft - { - get { return _CheckLeft; } - set { _CheckLeft = value; } - } - private string _CheckBelow = "|\u2502"; - public string CheckBelow - { - get { return _CheckBelow; } - set { _CheckBelow = value; } - } - // This is a table of graphics characters - // The index into this table (0-15) is a bitmask with each bit representing - // a different direction from the current character. - // Right is Bit 0 (0 or 1) - // Above is Bit 1 (0 or 2) - // Left is Bit 2 (0 or 4) - // Below is Bit 3 (0 or 8) - // The index is contolled in the following way: - // If there is a graphics character to the right, then you add 1 - // If there is a graphics character above, then you add 2 - // If there is a graphics character left, then you add 4 - // If there is a graphics character below, then you add 8 - // The total results in an index into this array and gives the appropriate character - // combining horizontal and vertical lines. - - static private string [] TableCharsU = { - "\x0", // HEX"\x0", // No character - @"\u9472", // HEX@"\u2500",// - Horizontal line - 16-bit char: '\xC4' - @"\u9474", // HEX@"\u2502",// | Vertical line - 16-bit char: '\xB3' - @"\u9492", // HEX@"\u2514",// L Bottom Left corner - 16-bit char: '\xC0' - @"\u9472", // HEX@"\u2500",// - Horizontal line - 16-bit char: '\xC4' - @"\u9472", // HEX@"\u2500",// - Horizontal line - 16-bit char: '\xC4' - @"\u9496", // HEX@"\u2518",// Bottom Right Corner - 16-bit char: '\xD9' - @"\u9524", // HEX@"\u2534",// Bottom Tee - 16-bit char: '\xC1' - @"\u9474", // HEX@"\u2502",// | Vertical Bar - 16-bit char: '\xB3' - @"\u9484", // HEX@"\u250c",// Upper Left corner - 16-bit char: '\xDA' - @"\u9474", // HEX@"\u2502",// | Vertical Bar - 16-bit char: '\xB3' - @"\u9500", // HEX@"\u251c",// Left Tee - 16-bit char: '\xC3' - @"\u9488", // HEX@"\u2510",// Upper Right corner - 16-bit char: '\xBF' - @"\u9516", // HEX@"\u252c",// T Top Tee - 16-bit char: '\xC2' - @"\u9508", // HEX@"\u2524",// Right Tee - 16-bit char: '\xB4' - @"\u9532", // HEX@"\u253c" // + Plus - 16-bit char: '\xC5' - }; - - private int MaxCharacterWidth() - { - // loop through lines and get the width in characters - int w = 0; - foreach (string line in Lines) - { - string cleanLine = RemoveLinkComments(line); - if (w < cleanLine.Length) - w = cleanLine.Length; - } - return w; - } - internal static string RemoveLinkComments(string line) - { - StringBuilder sb = new StringBuilder(); - int lastIndex = 0; - MatchCollection mc = Regex.Matches(line, @"", RegexOptions.Singleline); - foreach (Match m in mc) - { - sb.Append(line.Substring(lastIndex, m.Index - lastIndex)); // Append text before the link - sb.Append(m.Groups[1].Value); // Append the text portion of the link - lastIndex = m.Index + m.Length; // Calculate the beginning of the remaining text - } - sb.Append(line.Substring(lastIndex)); // Append the text following the last link - string result = sb.ToString(); - result = result.Replace(@""); - if (mcEnd.Count > 0) - { - result = result.Substring(0, mcEnd[0].Index) + result.Substring(mcEnd[0].Index + mcEnd[0].Length); - } - return result; - } - private void ReplaceLinesInTable(bool withBorder) - { - int rowWidth = Lines[0].Length; - for (int row=1;row", RegexOptions.Singleline);// this last parameter was commented out in 7/24/09 but it appears to be valid - if (matchCollection.Count == 0) matchCollection = Regex.Matches(line, @""); - Match match = matchCollection.Count > 0 ? matchCollection[0] : null; - int matchOffset = 0; - for (int col = 1; col < rowWidth - 1; col++) - { - if (match != null && match.Index == matchOffset + col) - { - matchOffset += match.Length - match.Groups[1].Length; // Increment the offset by the link comment length - col += match.Groups[1].Length; // increment the column by the link value length - if (col >= rowWidth - 1) break;// Don't continue if beyond the contents - match = match.NextMatch(); // Watch for the next match - } - int coll = matchOffset + col; - char chr = line[coll]; - char chrLast = line[coll - 1]; - char chrNext = line[coll + 1]; - char chrAbove = lineAbove[col]; - char chrBelow = lineBelow[col]; - // The following is all using symbol font (either unicode for proportional or - // VeSymbFix for fixed font): - // if this character is a table line draw character, i.e. a dash or vertical bar, or - // graphics characters for those, look around it to see what table character it is - // replaced with - - // Look for -||-- (last three are graphics chars or unicode dash) - if ("-|\u2500\u2502\u2011".IndexOf(chr) > -1) - { - bool horizontalCharacter = "-\u2500\u2011".IndexOf(chr) > -1; - int lineDrawRight = (CheckRight.IndexOf(chrNext) > -1 || (horizontalCharacter && "\u2502".IndexOf(chrNext) > -1)) ? 1 : 0; - int lineDrawAbove = (CheckAbove.IndexOf(chrAbove) > -1 || (!horizontalCharacter && "\u2500\u2011".IndexOf(chrAbove) > -1)) ? 2 : 0; - int lineDrawLeft = (CheckLeft.IndexOf(chrLast) > -1 || (horizontalCharacter && "\u2502".IndexOf(chrLast) > -1)) ? 4 : 0; - int lineDrawBelow = (CheckBelow.IndexOf(chrBelow) > -1 || (!horizontalCharacter && "-\u2500\u2011".IndexOf(chrBelow) > -1)) ? 8 : 0; - int tableCharIndx = lineDrawRight + lineDrawAbove + lineDrawLeft + lineDrawBelow; - if (tableCharIndx > 0) - { - SetTableChar(row, coll, tableCharIndx); - if (withBorder) // Adjust the border as it intersects with lines within the box - { - if (row == 1 && !horizontalCharacter ) SetTableChar(row - 1, col, 13); // Top Row - if (row == Lines.Length - 2 && !horizontalCharacter) SetTableChar(row + 1, col, 7); // Bottom Row - if (col == 1 && horizontalCharacter && ((tableCharIndx & 4)==4)) SetTableChar(row, col - 1, 11); // First Column - if (col == rowWidth - 2 && horizontalCharacter && ((tableCharIndx & 1) == 1)) SetTableChar(row, coll + 1, 14); // Last Column - } - } - } - } - } - } - private void SetTableChar(int row, int col, int tableCharIndx) - { - int rowOffset = GetFirstCharIndexFromLine(row); - Select(rowOffset + col, 1); - string charToBeReplaced = SelectedText; - if (Text.Length > (rowOffset + col + 7) && Text.Substring(rowOffset + col + 1, 6) != "#Link:") - SelectedRtf = RtfPrefixForSymbols + TableCharsU[tableCharIndx] + "?}"; - else - { - SelectionStart++; - int lenComment = 1 + SelectionStart - (rowOffset + col); - //Console.WriteLine("{0},{1},{2}", rowOffset + col, SelectionStart, SelectionLength); - Select(rowOffset + col, 0); - SelectedRtf = RtfPrefixForSymbols + TableCharsU[tableCharIndx] + "?}"; - Select(rowOffset + col, lenComment); - //Console.WriteLine("'{0}',{1},{2},{3}", SelectedText, lenComment, SelectionLength, SelectionStart); - //Console.WriteLine("'{0}'", SelectedRtf); - SelectedRtf = SelectedRtf.Replace(" " + charToBeReplaced, ""); - } - } - #endregion - #region SpellChecker - private static bool _DoSpellCheck = true; - public static bool DoSpellCheck - { - get { return StepRTB._DoSpellCheck; } - set { StepRTB._DoSpellCheck = value; } - } - // We made the Spell Checker method a static so that all of the StepRTB boxes will bare the same instance of the dictionary. - // This allow all the StepRTB's to automatically update when a new word is added. - private static C1.Win.C1SpellChecker.C1SpellChecker _C1SpellChecker2; - - private static C1.Win.C1SpellChecker.C1SpellChecker C1SpellChecker2 - { - get - { - if (_C1SpellChecker2 == null) - { - _C1SpellChecker2 = new C1.Win.C1SpellChecker.C1SpellChecker(); - _C1SpellChecker2.ContextMenuCreated += new C1.Win.C1SpellChecker.ContextMenuEventHandler(_C1SpellChecker2_ContextMenuCreated); - // The veproms.dct file is the main spell checker dictionary. - // We edited the C1 dictionary (C:\Program Files\ComponentOne\Dictionaries\C1Spell_en-US.dct) using ComponentOne's - // dictionary editor (C:\Program Files\ComponentOne\Studio for WinForms\C1SpellChecker\C1DictionaryEditor.exe) - // and added the veproms.words list as another word list in the dictionary. We saved the resulting file as veproms.dct. - string dictpath = string.Format(@"{0}\veproms.dct", Application.StartupPath); - - // Only use the veproms.dct if it is found in the BIN folder. Otherwise, let it default to use the standard dictionary. - if (File.Exists(dictpath)) - _C1SpellChecker2.MainDictionary.FileName = dictpath; // looks in the bin folder by default - - // NOTE: By default, a "Custom.dct" file (UserDictionary) will be created in the BIN folder when a user adds words to the - // spell checker dictionary. The words that the user adds are not placed in the Volian.dct file. - //_C1SpellChecker2.UserDictionary.FileName = @"C:\Development\proms\VEPROMS User Interface\bin\Debug\MYDictionary.dct"; - } - return StepRTB._C1SpellChecker2; - } - } - - // the grid uses this to reference the same instance of the spell checker - public C1.Win.C1SpellChecker.C1SpellChecker SpellCheckerInstance - { - get { return C1SpellChecker2; } - } - - // Get or Save our context menu - // This is added to the the spell checker's context menu for a mis-spelled word - private static ContextMenuStrip _ThisContextMenuStrip; - public ContextMenuStrip ThisContextMenuStrip - { - get { return _ThisContextMenuStrip; } - set { _ThisContextMenuStrip = value; } - } - - private static StepRTB _ContextMenuStepRTB; - private static object _ContextMenuStrip; - - static void _C1SpellChecker2_ContextMenuCreated(object sender, C1.Win.C1SpellChecker.ContextMenuEventArgs e) - { - // Adjust their bad word context menu - //Console.WriteLine("==========> spell check context menu {0}",e.Menu.Items[0].Text); - if (e.Menu.Equals(_ContextMenuStrip)) - { - // Add an item for our "Edit Menu" context menu on their spell check context menu - // This gives the user access to our regular context menu when on a mis-spelled word - ToolStripItem tsi = e.Menu.Items.Add("Edit Menu"); - tsi.Click += new EventHandler(tsi_Click); - //Now replace their "Spell" item with ours, so that we can display our custom spell check dialog - for (int i = 0; i < e.Menu.Items.Count; i++) - { - ToolStripItem tsi1 = e.Menu.Items[i]; - if (tsi1 is ToolStripMenuItem && tsi1.Text == "Spell") - { - e.Menu.Items.RemoveAt(i); // remove their spell check dialog item - ToolStripMenuItem tsi2 = new ToolStripMenuItem("Spell"); - tsi2.Click += new EventHandler(tsi2_Click); - e.Menu.Items.Insert(i, tsi2); // add our spell check dialog item - } - } - } - } - - static void tsi2_Click(object sender, EventArgs e) - { - C1SpellChecker2.CheckControl(_ContextMenuStepRTB, true, MySpellCheckDlg); - } - - // Click event to display our "Edit Menu" (StepRTB context menu) - static void tsi_Click(object sender, EventArgs e) - { - ToolStripMenuItem tsmi = sender as ToolStripMenuItem; - //_ContextMenuStepRTB.MyRTBItem.MyStepPanel.MyStepTabPanel.MyStepTabRibbon.OpenContextMenu(tsmi.Owner.Location); - _ContextMenuStepRTB.OnOpenContextMenu(sender, new StepRTBLocationEventArgs(tsmi.Owner.Location)); - } - - // This is our customized Spell Check dialog - // This is display when the use clicks the Spell button from the Ribbon - // or when the "Spell" item is selected from the context menu when on a mis-spelled word - static VlnSpellCheckDlg _MySpellCheckDlg; - public static VlnSpellCheckDlg MySpellCheckDlg - { - get - { - if (_MySpellCheckDlg == null) - _MySpellCheckDlg = new VlnSpellCheckDlg(); - return _MySpellCheckDlg; - } - } - - // This is used when walking through the section doing a spell check - // (from the Spell button on the ribbon) - public bool SpellCheckNext() - { - int nBad = C1SpellChecker2.CheckControl(this, false, MySpellCheckDlg); - return (nBad >= 0); // nBad = -1 means user pressed Cancel button - } - - // This allows us to turn off/on the specll check context menu when we toggle in and out of View Mode. - // see btnToggleEditView_Click() in StepTabRibbon.cs - public void SpellCheckContextMenuOn(bool turnOnMenu) - { - C1SpellChecker2.Options.ShowSuggestionsInContextMenu = turnOnMenu; - } - #endregion - #region - public string DoNewLinkInGridCell() - { - // first find the new link and determine whether it's RO or transition. - int indx = Rtf.IndexOf(@"#Link:ReferencedObject:"); - if (indx > 0) - { - Match mro = Regex.Match(Rtf.Substring(indx, Rtf.Length - indx), @"([A-Za-z]*):(.*?)\[END>"); - string linkstr = mro.Groups[2].Value; - string[] roparts = linkstr.Split(" ".ToCharArray()); - ContentRoUsage rousg = null; - int oldid = -1; - using (Item itm = MyItemInfo.Get()) - { - using (RODb rodb = RODb.GetJustRoDb(Convert.ToInt32(roparts[2]))) - { - rousg = itm.MyContent.ContentRoUsages.Add(roparts[1], rodb); - } - //get temporary rousageid - oldid = rousg.ROUsageID; - Rtf = Rtf.Replace("", string.Format("", rousg.ROUsageID)); - //save temporary rousageid to get real rousageid - itm.Save(); - //replace temprorary rousageid with real rousageid - Rtf = Rtf.Replace(string.Format("", oldid), rousg.ROUsageID.ToString()); - //save real rousageid - itm.Save(); - MyItemInfo.MyContent.RefreshContentRoUsages(); - } - } - // Need to look for any 'New' transitions, don't include existing ones. - Match mt = Regex.Match(Rtf, @"#Link:Transition:([0-9]+) "); - if (mt.Length <= 0) mt = Regex.Match(Rtf, @"#Link:TransitionRange:([0-9]+) "); - if (mt.Length > 0) - { - indx = mt.Index+6; // get past '#Link:" - Match m = Regex.Match(Rtf.Substring(indx, Rtf.Length - indx), @"([A-Za-z]*):(.*?)\[END>"); - bool isSingleTran = true; - if (Rtf.Substring(indx, 16).IndexOf("TransitionRange") >= 0) isSingleTran = false; - string linkstr = m.Groups[2].Value; - string[] tparts = linkstr.Split(" ".ToCharArray()); - int type = System.Convert.ToInt32(tparts[0]); - int tr1 = System.Convert.ToInt32(tparts[2]); // tparts[2] is token for tranid - int tr2 = tr1; - if (tparts.Length > 3) - tr2 = System.Convert.ToInt32(tparts[3]); // tparts[3] is token for rangeid - bool dispose1 = false; - Item itm1 = null; - bool dispose2 = false; - Item itm2 = null; - using (Item itm = MyItemInfo.Get()) - { - if (itm.ItemID == tr1) - itm1 = itm; // a transition that points to itself should not dispose - else - { - dispose1 = true; - itm1 = Item.Get(tr1); - } - if (itm.ItemID == tr2) - itm2 = itm; // a transition that points to itself should not dispose - else if (tr1 == tr2) - itm2 = itm1; // if both destinations are the same only dispose the first one - else - { - dispose2 = true; - itm2 = Item.Get(tr2); - } - ContentTransition ct = itm.MyContent.ContentTransitions.Add(itm1, itm2); - //Console.WriteLine("CT {0},{1},{2},{3}", ct.TransitionID, itm.ItemID, itm.MyContent.MyContentUnique, itm.MyContent.ContentTransitions.Count); - ct.TranType = type; - if (isSingleTran) - ct.IsRange = 0; - else if (tr1 != tr2) - ct.IsRange = 1; - else - ct.IsRange = 2; - - int oldidt = ct.TransitionID; - Rtf = Rtf.Replace("", string.Format("", ct.TransitionID)); - itm.Save(); - Rtf = Rtf.Replace(string.Format("", oldidt), ct.TransitionID.ToString()); - itm.Save(); - MyItemInfo.MyContent.RefreshContentTransitions(); - } - - if (dispose2) itm2.Dispose(); - if (dispose1) itm1.Dispose(); - } - return Rtf; - } - #endregion - #region RoInsertInterface - public void UpdateStepRtb(string linktxt, string valtxt) - { - int ss = SelectionStart; // Remember where the link is being added - int sl = SelectionLength; - OnReturnToEditor(this, new EventArgs()); - Select(ss, sl); - InsertRO(valtxt, linktxt); // Insert the LINK - OnDoSaveContents(this, new EventArgs()); // .SaveText(); // Save the text with the LINK - This also moves the cursor to the end of the text - // By selecting a starting position within a link, StepRTB (HandleSelectionChange) will select the link - Select(ss + 7 + valtxt.Length, 0);// Select the link, Try 7 for " 255) && !"\r\n\t".Contains(c.ToString())) - // sb.Append(string.Format("x{0:X4}", (int)c)); - // else - // sb.Append(c); - // } - // return sb.ToString(); - //} - public bool IsDirty - { - get - { - return IsGridChanged(this._MyItemInfo.MyContent.MyGrid.Data, this.GetXMLData(), true); - } - } - private bool IsGridChanged(string oldXml, string newXml, bool checkFormat) - { - if (this.TableCellEditor.Text.Contains("")) - return false; - XmlDocument XdOld = new XmlDocument(); - XdOld.LoadXml(AdjustHeightAndWidthForDPI(oldXml)); - XmlDocument XdNew = new XmlDocument(); - XdNew.LoadXml(AdjustHeightAndWidthForDPI(newXml)); - //check volian borders 1st - if (checkFormat && XdNew.SelectSingleNode("C1FlexGrid/Control/MyBorderDetailString").InnerText != XdOld.SelectSingleNode("C1FlexGrid/Control/MyBorderDetailString").InnerText) - return true; - //check row/col sizes 2nd - if (checkFormat && ( GetRowColSizeString(XdNew) != GetRowColSizeString(XdOld))) - return true; - //check for cell data changes 3rd - if (GetCellDataString(XdNew) != GetCellDataString(XdOld)) - return true; - //check for cell format changes 4th - if (checkFormat && GetCellFormatString(XdNew) != GetCellFormatString(XdOld)) - return true; - //check for text alignment changes 5th - // put check in for bug fix B2014-106 - if (checkFormat && GetCellTextAlignString(XdNew) != GetCellTextAlignString(XdOld)) - return true; - //check for merged cells 6th - if (GetCellMergeString(XdNew) != GetCellMergeString(XdOld)) - return true; - return false; - } - private string GetRowColSizeString(XmlDocument xd) - { - string defCW = xd.SelectSingleNode("C1FlexGrid/ColumnInfo/DefaultSize").InnerText; - string defRH = xd.SelectSingleNode("C1FlexGrid/RowInfo/DefaultSize").InnerText; - int cols = ColumnCount(xd); - int rows = RowCount(xd); - List rh = new List(); - for (int i = 0; i < rows; i++) - rh.Add(defRH); - List cw = new List(); - for (int i = 0; i < cols; i++) - cw.Add(defCW); - XmlNodeList nlr = xd.SelectNodes("C1FlexGrid/Rows/Row"); - foreach (XmlNode nr in nlr) - { - int idx = int.Parse(nr.Attributes.GetNamedItem("index").InnerText); - rh[idx] = nr.SelectSingleNode("Height").InnerText; - } - XmlNodeList nlc = xd.SelectNodes("C1FlexGrid/Columns/Column"); - foreach (XmlNode nc in nlc) - { - int idx = int.Parse(nc.Attributes.GetNamedItem("index").InnerText); - cw[idx] = nc.SelectSingleNode("Width").InnerText; - } - string rhcw = "RowHeights: "; - string sep = string.Empty; - foreach (string s in rh) - { - rhcw += sep + s; - sep = ","; - } - rhcw += " - ColWidths: "; - sep = string.Empty; - foreach (string s in cw) - { - rhcw += sep + s; - sep = ","; - } - return rhcw; - } - private int ColumnCount(XmlDocument xd) - { - XmlNode xn = xd.SelectSingleNode("C1FlexGrid/ColumnInfo/Count"); - int cols = 0; - if (xn != null) - cols = int.Parse(xn.InnerText); - else - { - XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Columns/Column"); - cols = nl.Count; - } - return cols; - } - private int RowCount(XmlDocument xd) - { - XmlNode xn = xd.SelectSingleNode("C1FlexGrid/RowInfo/Count"); - int rows = 0; - if (xn != null) - rows = int.Parse(xn.InnerText); - else - { - XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Rows/Row"); - rows = nl.Count; - } - return rows; - } - private string GetCellDataString(XmlDocument xd) - { - int cols = ColumnCount(xd); - int rows = RowCount(xd); - List datum = new List(); - for (int i = 0; i < rows * cols; i++) - datum.Add("|"); - XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Cells/Cell/Data"); - string data = string.Empty; - foreach (XmlNode xn in nl) - { - RichTextBox rtb = new RichTextBox(); - rtb.Rtf = xn.InnerText; - XmlAttribute xa = xn.ParentNode.Attributes.GetNamedItem("index") as XmlAttribute; - string[] rc = xa.InnerText.Split(','); - int r = int.Parse(rc[0]); - int c = int.Parse(rc[1]); - int index = r * cols + c; - datum[index] = "|" + (rtb.Text == "" ? "" : rtb.Text); - } - foreach (string s in datum) - data += s; - return data; - } - private string GetCellFormatString(XmlDocument xd) - { - int cols = ColumnCount(xd); - int rows = RowCount(xd); - List datum = new List(); - for (int i = 0; i < rows * cols; i++) - datum.Add("|"); - XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Cells/Cell/Data"); - string data = string.Empty; - foreach (XmlNode xn in nl) - { - RichTextBox rtb = new RichTextBox(); - rtb.Rtf = xn.InnerText; - XmlAttribute xa = xn.ParentNode.Attributes.GetNamedItem("index") as XmlAttribute; - string[] rc = xa.InnerText.Split(','); - int r = int.Parse(rc[0]); - int c = int.Parse(rc[1]); - int index = r * cols + c; - datum[index] = "|" + (rtb.Text == "" ? "" : rtb.Rtf); - } - foreach (string s in datum) - data += s; - return data; - } - private string GetCellMergeString(XmlDocument xd) - { - if(xd.SelectSingleNode("C1FlexGrid/MergedRanges") == null) - return string.Empty; - return xd.SelectSingleNode("C1FlexGrid/MergedRanges").InnerXml; - } - private string GetCellTextAlignString(XmlDocument xd) - { - // Note that I could not save (and later compare) the entire Definition string - // because the xml for the old and new table was always different. - // The old xml table data would have, for example "white" for the background color, while - // the new xml table data would have "255,255,255" for the background color. - // Therefore this check is specific for only the TextAlign setting - jsj 9-30-2014 - XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Styles/Style/Definition"); - string data = string.Empty; - foreach (XmlNode xn in nl) - { - string str = xn.InnerText; - string[] splStr = str.Split(';'); - foreach (string s in splStr) - if (s.StartsWith("TextAlign:")) - data += "|" + s; // only save the TextAlign setting - } - return data; - } - private static GridCopyInfo _MyCopyInfo; - public static GridCopyInfo MyCopyInfo - { - get - { - if (_MyCopyInfo == null) - _MyCopyInfo = new GridCopyInfo(); - return _MyCopyInfo; - } - } - private Color _DefaultCellBackgroundcolor; - - public Color DefaultCellBackgroundcolor - { - get { return _DefaultCellBackgroundcolor; } - } - private Color _DefaultFixedBackgroundColor; - - public Color DefaultFixedBackgroundColor - { - get { return _DefaultFixedBackgroundColor; } - } - public void CopyToCopiedFlexGrid(GridCopyOption myCopyOption) - { - MyCopyInfo.MyCopiedFlexGrid = new VlnFlexGrid(); //make a copy of the grid being copied - using (StringReader sr = new StringReader(this.GetXMLData())) - { - MyCopyInfo.MyCopiedFlexGrid.ReadXml(sr); - this.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None; - sr.Close(); - } - MyCopyInfo.MyCopyOption = myCopyOption; - OnCopyOptionChanged(this, new EventArgs()); - switch (MyCopyInfo.MyCopyOption) - { - case GridCopyOption.Row: - MyCopyInfo.MyCopiedCellRange = MyCopyInfo.MyCopiedFlexGrid.GetCellRange(Selection.r1, 0, Selection.r2, Cols.Count - 1); - break; - case GridCopyOption.Column: - MyCopyInfo.MyCopiedCellRange = MyCopyInfo.MyCopiedFlexGrid.GetCellRange(0, Selection.c1, Rows.Count - 1, Selection.c2); - break; - case GridCopyOption.Selection: - MyCopyInfo.MyCopiedCellRange = MyCopyInfo.MyCopiedFlexGrid.GetCellRange(Selection.r1, Selection.c1, Selection.r2, Selection.c2); - break; - default: - break; - } - } - public event VlnFlexGridEvent CopyOptionChanged; - public void OnCopyOptionChanged(object sender, EventArgs args) - { - if (CopyOptionChanged != null) CopyOptionChanged(sender, args); - } - - [XmlElement("MyBorders")] - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - public string MyBorderDetailString - { - get - { - return MyBorders.ConvertToString(); - } - set - { - if (value != null) - _MyBorders = VlnBorders.Get(value); - else - _MyBorders = null; - } - } - private VlnBorders _MyBorders; - [XmlIgnore] - public VlnBorders MyBorders - { - get - { - if (_MyBorders == null) - _MyBorders = new VlnBorders(GridLinePattern.Single, Rows.Count, Cols.Count); - return _MyBorders; - } - set { _MyBorders = value; } - } - private ItemInfo _MyItemInfo; - public ItemInfo GetMyItemInfo() - { - return _MyItemInfo; - } - //public ItemInfo MyItemInfo - //{ - // get { return _MyItemInfo; } - // set { _MyItemInfo = value; } - //} - public bool TopRowHasBorder() - { - for (int c = 0; c < Cols.Count; c++) - if (MyBorders.HorizontalLines[0, c] != GridLinePattern.None) return true; - return false; - } - public void SetBorders(CellRange myRange, - GridLinePattern top, GridLinePattern middle, GridLinePattern bottom, - GridLinePattern left, GridLinePattern center, GridLinePattern right) - { - for (int r = myRange.r1; r <= myRange.r2; r++) - for (int c = myRange.c1; c <= myRange.c2; c++) - { - CellRange cr = GetMergedRange(r, c); - if (r == myRange.r1) // Top Border - if(top != GridLinePattern.Mixed) MyBorders.HorizontalLines[cr.r1, cr.c1]=top; - if (c == myRange.c1) // Left Border - if(left != GridLinePattern.Mixed) MyBorders.VerticalLines[cr.r1, cr.c1]=left; - if (r == myRange.r2) // Bottom Border - if(bottom != GridLinePattern.Mixed) MyBorders.HorizontalLines[cr.r2 + 1, cr.c2]=bottom; - if (c == myRange.c2) // Right Border - if(right != GridLinePattern.Mixed) MyBorders.VerticalLines[cr.r2, cr.c2 + 1] = right; - if (r == cr.r1 && c == cr.c1) // Look for inside lines - { - if (cr.r1 > myRange.r1 && cr.r1 <= myRange.r2) // Inside Horizontal Top - if (middle != GridLinePattern.Mixed) - { - MyBorders.HorizontalLines[cr.r1, cr.c1] = middle; - MyBorders.HorizontalLines[cr.r1, cr.c2] = middle; - } - if (cr.r2 > myRange.r1 && cr.r2 < myRange.r2) // Inside Horizontal Bottom - if(middle != GridLinePattern.Mixed) MyBorders.HorizontalLines[cr.r2 + 1, cr.c2]=middle; - if (cr.c1 > myRange.c1 && cr.c1 <= myRange.c2) // Inside Vertical Left - if (center != GridLinePattern.Mixed) - { - MyBorders.VerticalLines[cr.r1, cr.c1] = center; - MyBorders.VerticalLines[cr.r2, cr.c1] = center; - } - if (cr.c2 > myRange.c1 && cr.c2 < myRange.c2) // Inside Vertical Right - if(center != GridLinePattern.Mixed) MyBorders.VerticalLines[cr.r2, cr.c2 + 1]=center; - } - c = cr.c2;//Skip to the end of the merged cells - } - - } - public void PasteBorders(int r, int c, int br, int bc) - { - MyBorders.HorizontalLines[r, c] = MyCopyInfo.MyCopiedFlexGrid.MyBorders.HorizontalLines[br,bc]; - MyBorders.VerticalLines[r, c] = MyCopyInfo.MyCopiedFlexGrid.MyBorders.VerticalLines[br, bc]; - MyBorders.HorizontalLines[r+1, c] = MyCopyInfo.MyCopiedFlexGrid.MyBorders.HorizontalLines[br+1, bc]; - MyBorders.VerticalLines[r, c+1] = MyCopyInfo.MyCopiedFlexGrid.MyBorders.VerticalLines[br, bc+1]; - } - - [XmlIgnore] - public bool HasVScroll - { - get - { - return RTBAPI.HasVertScroll(this); - } - } - [XmlIgnore] - public bool HasHScroll - { - get - { - return RTBAPI.HasHorzScroll(this); - } - } - public event VlnFlexGridEvent OpenAnnotations; - public void OnOpenAnnotations(object sender, EventArgs args) - { - if (OpenAnnotations != null) OpenAnnotations(sender, args); - } - public event VlnFlexGridCursorMovementEvent CursorMovement; - internal void OnCursorMovement(object sender, VlnFlexGridCursorMovementEventArgs args) - { - if (CursorMovement != null) CursorMovement(sender, args); - } - public event VlnFlexGridPasteEvent AdjustPastedText; - internal string OnAdjustPastedText(object sender, VlnFlexGridPasteEventArgs args) - { - if (AdjustPastedText != null) return AdjustPastedText(sender, args); - return args.Text; - } - public event VlnFlexGridkeyEvent EnterKeyPressed; - public void OnEnterKeyPressed(object sender, KeyEventArgs args) - { - if (EnterKeyPressed != null) EnterKeyPressed(sender, args); - } - - private TableCellEditor _tableCellEditor; - - public TableCellEditor TableCellEditor - { - get { return _tableCellEditor; } - set { _tableCellEditor = value; } - } - private TableClipBoardFuncts _clpbrdCpyPste; - private int _minColSplitWidth = 10; - //private int _minRowSplitHeight = 23; - - //private int _minSplitColWidth = 10; - //private int _minSplitRowHeight = 20; - private E_ViewMode _vwMode = E_ViewMode.Edit; - [XmlIgnore] - internal E_ViewMode VwMode - { - get { return _vwMode; } - set - { - _vwMode = value; - AllowEditing = _vwMode == E_ViewMode.Edit; - } - } - private bool _IsRoTable = false; - public bool IsRoTable - { - get { return _IsRoTable; } - set { _IsRoTable = value; } - } - private int _RODbId; - public int RODbId - { - get { return _RODbId; } - set { _RODbId = value; } - } - private string _ROID; - - public string ROID - { - get { return _ROID; } - set { _ROID = value; } - } - private float? _DPI = null; - public float? DPI - { - get - { - if (_DPI == null) - _DPI = 120; - return _DPI; - } - set - { - if (DPI != value) - { - _DPI = value; - } - } - } - #region Grid Initialize - - public VlnFlexGrid() - { - InitializeComponent(); - SetupGrid(4, 3); // use a default row and column count - } - - public VlnFlexGrid(int rows, int cols) - { - InitializeComponent(); - SetupGrid(rows, cols); - } - - public VlnFlexGrid(IContainer container) - { - container.Add(this); - InitializeComponent(); - SetupGrid(1, 1); - } - public VlnFlexGrid(ContentItem ci) - { - InitializeComponent(); - SetupGrid(4, 3); // use a default row and column count - _MyItemInfo = ci.MyItem.MyItemInfo; - } - //public VlnFlexGrid(IContainer container) - //{ - // container.Add(this); - - // InitializeComponent(); - // _tableCellEditor = new TableCellEditor(this); - // _tableCellEditor.ContentsResized += new ContentsResizedEventHandler(_tableCellEditor_ContentsResized); - //} - - //void _tableCellEditor_ContentsResized(object sender, ContentsResizedEventArgs e) - //{ - // if (_tableCellEditor._initializingEdit) return; - // CellRange cr = GetMergedRange(Row, Col); - // int oH = cr.UserData == null? 0 : (int)cr.UserData; - // int nH = _tableCellEditor.ContentsRectangle.Height; - // int Hadj = (nH - oH); - // cr.UserData = _tableCellEditor.ContentsRectangle.Height; - // int cellHeight = GetCellHeight(Row,Col); - // int cellheightNLines = cellHeight / (Rows.DefaultSize - 3); - // int nHNLines = nH / (Rows.DefaultSize - 3); - // if (Hadj != 0) - // { - // int curHeight = (Rows[Row].Height == -1) ? Rows.DefaultSize : Rows[Row].Height; - // //if (Hadj > 0 && cellHeight <= oH) - // if (Hadj > 0 && cellheightNLines < nHNLines) - // curHeight += (Rows.DefaultSize - 3); - // if (Hadj < 0 && CanReduceRow()) - // curHeight -= (Rows.DefaultSize-3); - // Rows[Row].Height = curHeight; - // AdjustGridControlSize(); - // } - // //cr.UserData = _tableCellEditor.ContentsRectangle.Height; - // //int mh = GetMaxRowHeight(); - // ////Rows[Row].Height = mh + 2; - // //int h = 0; - // //if (cr.r1 == cr.r2 && cr.c1 == cr.c2) - // // h = Rows[Row].Height - 2; - // //else - // //{ - // // for (int r = cr.r1; r <= cr.r2; r++) - // // h += Rows[r].Height - 2; - // //} - // //Rows[Row].Height += (mh - h); - // ////AdjustGridControlSize(); - //} - private int GetCellHeight(int row, int col) - { - return GetRangeHeight(GetMergedRange(row, col))-3; - } - - public int GetRangeHeight(CellRange cr) - { - int height = 0; - for (int r = cr.r1; r <= cr.r2; r++) - height += (Rows[r].Height == -1) ? Rows.DefaultSize : Rows[r].Height; - return height; - } - - public int GetRangeTop(CellRange cr) - { - int top = 0; - for (int r = 0; r < cr.r1; r++) - top += (Rows[r].Height == -1) ? Rows.DefaultSize : Rows[r].Height; - return top; - } - - public int GetRangeWidth(CellRange cr) - { - int width = 0; - for (int c = cr.c1; c <= cr.c2; c++) - width += (Cols[c].Width == -1) ? Cols.DefaultSize : Cols[c].Width; - return width; - } - - public int GetRangeLeft(CellRange cr) - { - int left = 0; - for (int c = 0; c < cr.c1; c++) - left += (Cols[c].Width == -1) ? Cols.DefaultSize : Cols[c].Width; - return left; - } - - public int GetRangeRowsMin(CellRange cr) - { - int rowsMin = 1 + cr.r2 - cr.r1; - for (int c = cr.c1; c <= cr.c2; c++) - { - int rows = 0; - for (int r = cr.r1; r <= cr.r2; r++) - { - CellRange chk = GetMergedRange(r, c); - if (chk.r1 == r && chk.c1 == c) - rows++; - } - rowsMin = Math.Min(rowsMin, rows); - } - return rowsMin; - } - - public int GetRangeRowsMax(CellRange cr) - { - int rowsMax = 0; - for (int c = cr.c1; c <= cr.c2; c++) - { - int rows = 0; - for (int r = cr.r1; r <= cr.r2; r++) - { - CellRange chk = GetMergedRange(r, c); - if (chk.r1 == r && chk.c1 == c) - rows++; - } - rowsMax = Math.Max(rowsMax, rows); - } - return rowsMax; - } - - public int GetRangeColsMin(CellRange cr) - { - int colsMin = 1 + cr.c2 - cr.c1; - for (int r = cr.r1; r <= cr.r2; r++) - { - int cols = 0; - for (int c = cr.c1; c <= cr.c2; c++) - { - CellRange chk = GetMergedRange(r, c); - if (chk.r1 == r && chk.c1 == c) - cols++; - } - colsMin = Math.Min(colsMin, cols); - } - return colsMin; - } - - public int GetRangeColsMax(CellRange cr) - { - int colsMax = 0; - for (int c = cr.c1; c <= cr.c2; c++) - { - int cols = 0; - for (int r = cr.r1; r <= cr.r2; r++) - { - CellRange chk = GetMergedRange(r, c); - if (chk.r1 == r && chk.c1 == c) - cols++; - } - colsMax = Math.Max(colsMax, cols); - } - return colsMax; - } - - public string GetRangeRowList(CellRange cr) - { - StringBuilder sb = new StringBuilder(); - string sep = ""; - for (int r = cr.r1; r <= cr.r2; r++) - { - CellRange crm = GetMergedRange(r, cr.c1); - if (crm.r1 == r) - { - sb.Append(sep + r.ToString()); - sep = "."; - } - r = crm.r2; - } - return sb.ToString(); - } - - private int BlankRowSpace() - { - int curRowHeight = (Rows[Row].Height == -1) ? Rows.DefaultSize - 3 : Rows[Row].Height - 3; - if (curRowHeight <= (Rows.DefaultSize - 3)) return 0; // never have row less than default height - int blankRowSpace = curRowHeight; - for (int c = 0; c < Cols.Count; c++) - { - CellRange cr = GetMergedRange(Row, c); - if (Row >= cr.r1 && Row <= cr.r2) - { - int cellHeight = GetCellHeight(Row, c); - int dataHeight = (cr.UserData == null) ? cellHeight : (int)cr.UserData; - int ud = dataHeight / (Rows.DefaultSize - 3); - //if (cellHeight < dataHeight) - // Console.WriteLine("r {0}, c {1}, cell{2}, data{3}", Row, c, cellHeight, dataHeight); - blankRowSpace = Math.Min(blankRowSpace, Math.Max(0,cellHeight - dataHeight)); - } - } - //Console.WriteLine("BlankRowSpace {0}", blankRowSpace); - return blankRowSpace; - } - - private int GetCellWidth(int row, int col) - { - int width = 0; - CellRange cr = GetMergedRange(row, col); - for (int c = cr.c1; c <= cr.c2; c++) - { - width += (Cols[c].Width == -1) ? Cols.DefaultSize - 3 : Cols[c].Width -3; - } - return width; - } - - private int BlankColSpace() - { - int curColWidth = (Cols[Col].Width == -1) ? Cols.DefaultSize - 3 : Cols[Col].Width-3; - //int curRowHeightNLines = curRowHeight / (Rows.DefaultSize - 3); - if (curColWidth <= Cols.DefaultSize - 3) return 0; // never have col less than default width - int blankColSpace = curColWidth; - for (int r = 0; r < Rows.Count; r++) - { - using (StepRTB srtb = new StepRTB()) - { - CellRange cr = GetMergedRange(r, Col); - srtb.Rtf = GetCellRTFString(cr.r1, cr.c1); - if (Col >= cr.c1 && Col <= cr.c2) - { - int cellWidth = GetCellWidth(r, Col); - //srtb.Width = cellWidth; - srtb.AdjustWidthForContent(); - //Application.DoEvents(); - //int mergeCellHeightNLines = cellHeight / (Rows.DefaultSize - 3); - //int dataHeight = (cr.UserData == null) ? cellHeight : (int)cr.UserData; - //int ud = dataHeight / (Rows.DefaultSize - 3); - //if (cellHeight < dataHeight) - // Console.WriteLine("r {0}, c {1}, cell{2}, data{3}", Row, c, cellHeight, dataHeight); - //blankColSpace = Math.Min(blankColSpace, Math.Max(0, cellWidth - srtb.MaxTextWidth)); - blankColSpace = Math.Min(blankColSpace, Math.Max(0, cellWidth - srtb.Width)); - } - } - } - //Console.WriteLine("BlankRowSpace {0}", blankRowSpace); - return blankColSpace; - } - //private bool CanReduceRow() - //{ - // int curRowHeight = (Rows[Row].Height == -1) ? Rows.DefaultSize - 3 : Rows[Row].Height - 3; - // int curRowHeightNLines = curRowHeight / (Rows.DefaultSize - 3); - // bool bReduce = (curRowHeight > (Rows.DefaultSize - 3)); - // if (bReduce) - // { - // for (int c = 0; c < Cols.Count; c++) - // { - // CellRange cr = GetMergedRange(Row, c); - // if (Row >= cr.r1 && Row <= cr.r2) - // { - // int mergeCellHeightNLines = GetCellHeight(Row, c) / (Rows.DefaultSize - 3); - // //int ud = (cr.UserData == null) ? 0 : (int)cr.UserData; - // //if ((c != Col) && curRowHeight <= ud && ud >= mergeCellHeight) - // // bReduce = false; - // int ud = ((cr.UserData == null) ? 0 : (int)cr.UserData) / (Rows.DefaultSize - 3); - // if ((c != Col) && curRowHeightNLines <= ud && ud >= mergeCellHeightNLines) - // bReduce = false; - // } - // } - // } - // //Console.WriteLine("canreduce {0}, {1}", Row, bReduce); - // return bReduce; - //} - //private int GetMaxRowHeight() - //{ - // int maxRTFHeight = _minRowSplitHeight; //Rows.DefaultSize;// the smallest a row can be - // Console.WriteLine("================================================================="); - // for (int c = 0; c < Cols.Count; c++) - // { - // CellRange cr = GetMergedRange(Row, c);//GetCellRange(Row, c); - // maxRTFHeight = Math.Max(maxRTFHeight, (int)cr.UserData); - // if (c == 0) - // Console.WriteLine("Height in Row[{0}] = {1}", Row, Rows[Row].Height); - // Console.WriteLine("UserData Cell[{0},{1}] = {2}", Row, c, cr.UserData); - // } - // return maxRTFHeight; - //} - - private bool IsInMergeRange(int row, int col) - { - //foreach (CellRange cr in this.MergedRanges) - //{ - // if (cr.Contains(row, col)) - // return true; // in a merged range - //} - CellRange cr = GetMergedRange(row, col); - return (cr.r1 == row && cr.c1 == col); - } - private bool _ReadingXml = false; - - public bool ReadingXml - { - get { return _ReadingXml; } - } - private static Regex _ReplaceVESymbFix = new Regex(@"({\\f[0-9]+[^ ]* )(FreeMono)(;})"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing - private static Regex _ReplaceArialUnicodeMS = new Regex(@"({\\f[0-9]+[^ ]* )(Arial Unicode MS)(;})"); - private static Regex _ReplaceTextFont = new Regex(@"({\\f[0-9]+[^ ]* )(?((?!FreeMono)(?!Arial Unicode MS))([^;]*)|(!!!!))(;})"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing - private bool FontIsFixed(Font myFont) - { - Graphics grph = Graphics.FromHwnd(this.Handle); - SizeF sfW = grph.MeasureString("W", myFont); - SizeF sfE = grph.MeasureString("!", myFont); - if (sfW.Width == sfE.Width) return true; - return false; - } - public void LoadGrid(ItemInfo itemInfo) - { - int profileDepth = ProfileTimer.Push(">>>> VlnFlexGrid.LoadGrid"); - _MyItemInfo = itemInfo; - string str = itemInfo.MyContent.MyGrid.Data; - VE_Font vefont = _MyItemInfo.GetItemFont(); - - // the following code is used to be sure that the font used for symbols is the correct font - // based on whether the font for non-symbol text is fixed or proportional. Each steprtb has - // a font for the non-symbol AND the symbol text, and these must be the correct association, i.e. - // for fixed fonts, the symbol font is 'VESymbFix', for proportional fonts, the symbol font is - // 'Arial Unicode MS'. The underlying flexgrid stores the fonts, and if the table font was - // reset for some reason (for example from the drop-down font selection in the user interface), - // this code 'cleans' up if there is a mismatch. - if (StepRTB.MyFontFamily != null) - { - FontFamily ff = StepRTB.MyFontFamily; - if (StepRTB.MySymbolFontName != "FreeMono") // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing - str = _ReplaceVESymbFix.Replace(str, "$1" + StepRTB.MySymbolFontName + "$3"); - if (StepRTB.MySymbolFontName != "Arial Unicode MS") - str = _ReplaceArialUnicodeMS.Replace(str, "$1" + StepRTB.MySymbolFontName + "$3"); - str = _ReplaceTextFont.Replace(str, "$1" + ff.Name + "$4"); - } - else - { - FontFamily ff = vefont.WindowsFont.FontFamily; - if (FontIsFixed(vefont.WindowsFont)) - str = _ReplaceArialUnicodeMS.Replace(str, "$1" + "FreeMono" + "$3"); // FreeMono is now used for the edit screen only. VESymbFix and Consolas are used for printing - else - str = _ReplaceVESymbFix.Replace(str, "$1" + "Arial Unicode MS" + "$3"); - str = _ReplaceTextFont.Replace(str, "$1" + ff.Name + "$4"); - } - // To prevent scroll bars from being flashed on/off - // - save an image of the current grid - // - set Visible to false - // - draw the saved grid image - // - do the the load/reload of the grid - // - set Visible back to true. - Visible = false; - if (Parent is GridItem) - { - try - { - System.Drawing.Image img = this.CreateImage(); - using (Graphics gr = (Parent as GridItem).CreateGraphics()) - { - gr.DrawImage(img, Left, Top); - } - } - catch (Exception ex) - { - _MyLog.WarnFormat("Table Content Corrupted"); - } - } - Clear(); - MergedRanges.Clear(); - _ReadingXml = true; - //Console.WriteLine("LoadGrid - Before ReadXML"); - ReadXml(str); - //Console.WriteLine("LoadGrid - After ReadXML"); - _ReadingXml = false; - Select(-1, -1); // this keeps the cell from being selected when the grid is first displayed - Visible = true; - ProfileTimer.Pop(profileDepth); - } - - private void ReadXml(string str) - { - // Get the height/width adjusted for the DPI. Depending on if the DPI setting for the current user's - // monitor is different than the DPI setting saved in the grid record, table height/width of rows/columns - // will be incorrect, i.e. lots of extra white space. The reason behind this is that the height/width - // of table cells are stored as dots (from the monitor) in the underlying component one flexgrid. - str = AdjustHeightAndWidthForDPI(str); - using (StringReader sr = new StringReader(str)) - { - ReadXml(sr); - this.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None; - sr.Close(); - } - } - - private string AdjustHeightAndWidthForDPI(string str) - { - // create a graphics to get the DPI and then compare it to the DPI that is stored in the grid. - // if they are the same, we don't need to do anything. - int DPIscreen = 0; - using (Graphics gr = this.CreateGraphics()) - { - DPIscreen = (int)gr.DpiX; - } - XmlDocument xd = new XmlDocument(); - xd.LoadXml(str); - XmlNode xn = xd.SelectSingleNode("//DPI"); - if (xn != null && xn.InnerText != DPIscreen.ToString()) - { - int DPIgrid = int.Parse(xn.InnerText); - xn.InnerText = DPIscreen.ToString(); - // adjust heights and widths based on the difference in DPIs between that what was saved - // in the database(grid) and the current DPI from the screen. Without doing this the - // heights/widths will be 'off', i.e. lots of white space. - XmlNodeList xnl = xd.SelectNodes("//Height"); - foreach (XmlNode xni in xnl) - { - int measurement = int.Parse(xni.InnerText); - if (measurement != -1) - xni.InnerText = ((measurement * DPIscreen) / DPIgrid).ToString(); - } - xnl = xd.SelectNodes("//Width"); - foreach (XmlNode xni in xnl) - { - int measurement = int.Parse(xni.InnerText); - if (measurement != -1) - xni.InnerText = ((measurement * DPIscreen) / DPIgrid).ToString(); - } - xnl = xd.SelectNodes("//DefaultSize"); - foreach (XmlNode xni in xnl) - { - int measurement = int.Parse(xni.InnerText); - if (measurement != -1) - xni.InnerText = ((measurement * DPIscreen) / DPIgrid).ToString(); - } - str = xd.OuterXml; - } - return str; - } - private void SetupGrid(int numrows, int numcols) //C1FlexGrid NewGrid() - { - // setup the default size of each cell in the table/grid - this.Cols.DefaultSize = (int) DPI; - this.Rows.DefaultSize = 20; - - // setup the number of rows and columns - this.Rows.Count = numrows; - this.Cols.Count = numcols; - - // make all the cell editable - this.Rows.Fixed = 0; - this.Cols.Fixed = 0; - - this.DrawMode = DrawModeEnum.OwnerDraw; - this.ScrollBars = ScrollBars.None; - - // grid styles - this.Styles.EmptyArea.BackColor = Color.Transparent; - this.Styles.EmptyArea.Border.Style = BorderStyleEnum.None; - this.Styles.Normal.Border.Color = Color.Black; - this.Styles.Normal.TextAlign = C1.Win.C1FlexGrid.TextAlignEnum.LeftTop; - - //SetupCellStyles(); - - this.FocusRect = FocusRectEnum.Solid; - this.Styles.Highlight.BackColor = Color.LightCyan; - this.Styles.Highlight.ForeColor = Color.Black; - this.Styles.Focus.BackColor = Color.LightCyan; - this.HighLight = HighLightEnum.WithFocus; - - _DefaultCellBackgroundcolor = this.StyleBackColor; - _DefaultFixedBackgroundColor = this.Styles.Fixed.BackColor; - this.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.Custom; - - this.AllowResizing = C1.Win.C1FlexGrid.AllowResizingEnum.Both; - - - _tableCellEditor = new TableCellEditor(this); - _tableCellEditor.HeightChanged += new StepRTBEvent(_tableCellEditor_HeightChanged); - _clpbrdCpyPste = new TableClipBoardFuncts(); - _SpellChecker = _tableCellEditor.SpellCheckerInstance; - - this.AfterResizeRow += new C1.Win.C1FlexGrid.RowColEventHandler(this.Grid_AfterResize); - this.StartEdit += new C1.Win.C1FlexGrid.RowColEventHandler(this._StartEdit); - this.AfterEdit += new C1.Win.C1FlexGrid.RowColEventHandler(this._AfterEdit); - this.AfterScroll += new C1.Win.C1FlexGrid.RangeEventHandler(this._AfterScroll); - this.AfterResizeColumn += new C1.Win.C1FlexGrid.RowColEventHandler(this.Grid_AfterResize); - this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this._KeyPress); - this.OwnerDrawCell += new OwnerDrawCellEventHandler(this.Grid_OwnerDrawCell); - - this.KeyDown += new KeyEventHandler(VlnFlexGrid_KeyDown); - this.KeyUp +=new KeyEventHandler(VlnFlexGrid_KeyUp); - TableCellEditor.EditMode = TableCellEditor.Visible; // need to comment out for compile for only jsj - 07FEB2011 - this.MouseDown += new MouseEventHandler(VlnFlexGrid_MouseDown); - } - - private bool _FirstEntry = false; - - public bool FirstEntry - { - get { return _FirstEntry; } - set { _FirstEntry = value; } - } - - void VlnFlexGrid_MouseDown(object sender, MouseEventArgs e) - { - int left = 0; - int top = 0; - int col = 0; - int row = 0; - int strow = Selection.r1; - int stcol = Selection.c1; - int erow = Selection.r2; - int ecol = Selection.c2; - while (e.X > left && col < Cols.Count) - { - left += Cols[col].Width > 0 ? Cols[col].Width : Cols.DefaultSize; - col++; - } - while (e.Y > top && row < Rows.Count) - { - top += Rows[row].Height > 0 ? Rows[row].Height : Rows.DefaultSize; - row++; - } - col--; - row--; - //Console.WriteLine("Mousedown Selection {0}", Selection); - //Console.WriteLine("Mousedown Row, Col [{0},{1}]", row, col); - erow = Math.Max(erow, row); - ecol = Math.Max(ecol, col); - if (_FirstEntry) - Select(row, col); - else - Select(strow, stcol, erow, ecol); - _FirstEntry = false; - } - - - - void _tableCellEditor_HeightChanged(object sender, EventArgs args) - { - if (_tableCellEditor._initializingEdit || !_tableCellEditor.Visible) return; - int curHeight = GetCellHeight(Row, Col);//(Rows[Row].Height == -1) ? Rows.DefaultSize : Rows[Row].Height; - CellRange cr = GetMergedRange(Row, Col); - int oH = cr.UserData == null ? curHeight : (int)cr.UserData; - int nH = _tableCellEditor.Height; //.ContentsRectangle.Height; - int nW = _tableCellEditor.Width; // Width - int Hadj = (nH - curHeight);//oH); - cr.UserData = _tableCellEditor.Height; //.ContentsRectangle.Height; - //int cellHeight = GetCellHeight(Row, Col); - //int cellheightNLines = cellHeight / (Rows.DefaultSize - 3); - //int nHNLines = nH / (Rows.DefaultSize - 3); - if (Hadj != 0) - { - //if (Hadj > 0 && cellHeight <= oH) - //if (Hadj > 0 && cellheightNLines < nHNLines) - // curHeight += (Rows.DefaultSize - 3); - //if (Hadj < 0 && CanReduceRow()) - // curHeight -= (Rows.DefaultSize - 3); - int blankRowSpace = BlankRowSpace(); - if (Hadj < 0) - Hadj = -Math.Min(-Hadj, blankRowSpace); - //if (Hadj > 0) - // Console.WriteLine("r {0}, nh {1}, curh{2}", Row, nH, curHeight); - if (Hadj != 0) - { - int newHeight = Hadj + ((Rows[Row].Height < 0) ? Rows.DefaultSize : Rows[Row].Height); - //Rows[Row].Height += Hadj;//= curHeight; - Rows[Row].Height = newHeight; - AdjustGridControlSize(); - } - } - if (_tableCellEditor is StepRTB && (_tableCellEditor as StepRTB).ImageWidth > 0) - { - Width = Cols[0].Width = (_tableCellEditor as StepRTB).ImageWidth; - } - } - void VlnFlexGrid_KeyUp(object sender, KeyEventArgs e) - { - if (e.Control) - { - if (e.Alt) - { - switch (e.KeyCode) - { - case Keys.M: - OnOpenAnnotations(this, new EventArgs()); - e.Handled = true; - break; - default: - break; - } - } - } - } - void VlnFlexGrid_KeyDown(object sender, KeyEventArgs e) - { - switch (e.KeyCode) - { - case Keys.Left: - if (e.Shift) return; - _tableCellEditor.StepRTB_ArrowPressed(e.Control ? E_ArrowKeys.CtrlLeft : E_ArrowKeys.Left); - e.Handled = true; - break; - case Keys.Up: - if (e.Shift) return; - _tableCellEditor.StepRTB_ArrowPressed(e.Control ? E_ArrowKeys.CtrlUp : E_ArrowKeys.Up); - e.Handled = true; - break; - case Keys.Right: - if (e.Shift) return; - if (IsRoTable) Select(Rows.Count - 1, Cols.Count - 1); - _tableCellEditor.StepRTB_ArrowPressed(e.Control ? E_ArrowKeys.CtrlRight : E_ArrowKeys.Right); - e.Handled = true; - break; - case Keys.Down: - if (e.Shift) return; - if (IsRoTable) Select(Rows.Count - 1, 0); - _tableCellEditor.StepRTB_ArrowPressed(e.Control ? E_ArrowKeys.CtrlDown : E_ArrowKeys.Down); - e.Handled = true; - break; - case Keys.Enter: - //if (e.Shift) return; - //Select(Rows.Count - 1, 0); - //_tableCellEditor.StepRTB_ArrowPressed(E_ArrowKeys.Down); - //e.Handled = true; - if (!e.Control && !e.Shift && !e.Alt) - { - OnEnterKeyPressed(sender, e); - } - break; - } - } - //void VlnFlexGrid_LeaveEdit(object sender, RowColEventArgs e) - //{ - // //Console.WriteLine("LeaveEdit Style = {0}", this.GetCellRange(e.Row, e.Col).Style.Name); - // this.GetCellRange(e.Row, e.Col).Style.ForeColor = Color.Black; - //} - private void Grid_OwnerDrawCell(object sender, C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e) - { - using (RTF _rtf = new RTF()) - { - // use nearest solid color - // (the RTF control doesn't dither, and doesn't support transparent backgrounds) - Color solid = e.Graphics.GetNearestColor(e.Style.BackColor); - DPI = e.Graphics.DpiX; - if (e.Style.BackColor != solid) - e.Style.BackColor = solid; - - // check whether the cell contains RTF - string rtfText = this.GetDataDisplay(e.Row, e.Col).Replace(@"\~", @"\u160?"); - GridItem gi = Parent as GridItem; - if (gi != null) - { - DisplayText dt = new DisplayText(gi.MyItemInfo, rtfText, true); - rtfText = dt.StartText; - } - // it does, so draw background - e.DrawCell(DrawCellFlags.Background); - if (rtfText.StartsWith(@"{\rtf")) - { - // Please add a comment if this value needs to be changed - _rtf.Rtf = rtfText; - // draw the RTF text - if (e.Bounds.Width > 0 && e.Bounds.Height > 0) - { - _rtf.Width = e.Bounds.Width - 1; // This has also been -3 which matchs the rener command - CellRange cr = GetMergedRange(e.Row, e.Col); - cr.UserData = _rtf.Height; - int hAdjust = 0; - int hDiff = e.Bounds.Height - _rtf.Height; - if (hDiff < 0) - { - Rows[e.Row].Height = _rtf.Height + 4; - AdjustGridControlSize(); - hDiff = 0; - } - if (e.Style != null) - { - switch (e.Style.TextAlign) - { - case TextAlignEnum.CenterBottom: - case TextAlignEnum.GeneralBottom: - case TextAlignEnum.LeftBottom: - case TextAlignEnum.RightBottom: - hAdjust = hDiff; - break; - case TextAlignEnum.CenterCenter: - case TextAlignEnum.GeneralCenter: - case TextAlignEnum.LeftCenter: - case TextAlignEnum.RightCenter: - hAdjust = hDiff / 2; - break; - default: - break; - } - } - if (IsRoTable) - { - _rtf.ForeColor = Color.Red; - } - else - { - _rtf.ForeColor = e.Style.ForeColor; - } - _rtf.BackColor = e.Style.BackColor; - _rtf.Render(e.Graphics, new Rectangle(e.Bounds.X + 1, e.Bounds.Y + hAdjust, e.Bounds.Width - 3, e.Bounds.Height)); - } - } - else - _rtf.Text = rtfText; - - // spell check unless (we're just measuring) - if (!e.Measuring) - { - CharRangeList errors = SpellChecker.CheckText(_rtf.Text);//(text); - // underline errors - if (errors.Count > 0) - { - CharacterRange[] ranges = new CharacterRange[1]; - ranges[0] = new CharacterRange(0, 1); - Pen pn = new Pen(Color.Green, 2); - StringFormat sf = new StringFormat(e.Style.StringFormat); - sf.SetMeasurableCharacterRanges(ranges); - Rectangle rc = e.Style.GetTextRectangle(e.Bounds, null); - Region[] rgns = e.Graphics.MeasureCharacterRanges(_rtf.Text, e.Style.Font, rc, sf);//(text, e.Style.Font, rc, sf); - float btm = rgns[0].GetBounds(e.Graphics).Bottom; - float top = rgns[0].GetBounds(e.Graphics).Top; - int adj = (int)(btm - top); - for (int i = 0; i < errors.Count; i++) - { - // The positioning of the the squigle line does not account for mixed font sizes - // should we support having mixed fonts in the table cells, we will need to add - // logic to support it. - Point ptStart = _rtf.GetPositionFromCharIndex(errors[i].Start); - Point ptEnd = _rtf.GetPositionFromCharIndex(errors[i].Start + errors[i].Length); - SquigleLine(e.Graphics, e.Bounds.Left + ptStart.X, e.Bounds.Top + ptStart.Y + adj, e.Bounds.Left + ptEnd.X); - } - } - } - // and draw border last - //e.DrawCell(DrawCellFlags.Border); - // This can be used to draw more specific borders - DrawCellBorder(e); - Console.WriteLine("Here"); - // we're done with this cell - e.Handled = true; - } - } - - private void SquigleLine(Graphics graphics, int x1, int y1, int x2) - { - for (Point pt = new Point(x1, y1); pt.X + 2 < x2; pt.X += 4) - { - //Console.WriteLine("squiggle point {0}", pt); - graphics.DrawLines(Pens.Red, new Point[] - { - new Point(pt.X, pt.Y), - new Point(pt.X + 2, pt.Y - 2), - new Point(pt.X + 4, pt.Y) - }); - } - } - private static Color _BorderColor = Color.Black; - public static Color BorderColor - { - get { return VlnFlexGrid._BorderColor; } - set { VlnFlexGrid._BorderColor = value; } - } - private void DrawCellBorder(C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e) - { - Graphics grGrid =e.Graphics; - Rectangle bounds = e.Bounds; - int row = e.Row; - int col = e.Col; - CellRange cr = GetMergedRange(row, col); - GridLinePattern topSide = MyBorders.HorizontalLines[cr.r1,cr.c1]; - GridLinePattern rightOfTopSide = cr.c2 == Cols.Count - 1 ? GridLinePattern.None : MyBorders.HorizontalLines[cr.r1, cr.c2 + 1]; - GridLinePattern leftOfTopSide = cr.c1 == 0? GridLinePattern.None : MyBorders.HorizontalLines[cr.r1, cr.c1 - 1]; - GridLinePattern leftSide = MyBorders.VerticalLines[cr.r1, cr.c1]; - GridLinePattern aboveLeftSide = cr.r1 == 0 ? GridLinePattern.None : MyBorders.VerticalLines[cr.r1 - 1, cr.c1]; - GridLinePattern belowLeftSide = cr.r2 == Rows.Count - 1 ? GridLinePattern.None : MyBorders.VerticalLines[cr.r2 + 1, cr.c1]; - GridLinePattern bottomSide = MyBorders.HorizontalLines[cr.r2+1, cr.c2]; - GridLinePattern rightOfBottomSide = cr.c2 == Cols.Count - 1 ? GridLinePattern.None : MyBorders.HorizontalLines[cr.r2 + 1, cr.c2 + 1]; - GridLinePattern rightSide = MyBorders.VerticalLines[cr.r2, cr.c2+1]; - GridLinePattern belowRightSide = cr.r2 == Rows.Count - 1 ? GridLinePattern.None : MyBorders.VerticalLines[cr.r2 + 1, cr.c2 + 1]; - GridLinePattern none = GridLinePattern.None; - int x1 = bounds.Left; - int y1 = bounds.Top; - int x2 = bounds.Right - 1; - int y2 = bounds.Bottom - 1; - GridItem myGridItem = Parent as GridItem; - Panel myPanel = Parent as Panel; - if (myGridItem == null && myPanel == null) return; - if (row == 0 || col == 0) // Top or Left Edge - Draw on parent - { - using (Graphics grParent = myGridItem != null ? myGridItem.CreateGraphics() : myPanel.CreateGraphics()) - { - if (row == 0) - { - if (col == 0) - { - // Draw the top left intersection - DrawIntersection(grParent, Left - 3, Top-1, none, topSide,leftSide, none); - } - // Draw the top right intersection - DrawIntersection(grParent, Left +x2 - 2, Top-1, none, rightOfTopSide,rightSide,topSide); - // Draw the top side on the parent - DrawLine(grParent, topSide, Left + x1, Top + y1 - 1, Left + x2-3, Top + y1 -1); - } - if (col == 0) - { - // Draw the bottom left intersection - DrawIntersection(grParent, Left -3, Top + y2, leftSide,bottomSide,belowLeftSide,none); - // Draw the left side - DrawLine(grParent, leftSide, Left + x1 - 1, Top + y1, Left + x1 - 1, Top + y2-3); - } - } - } - // Draw the bottom right intersection - DrawIntersection(grGrid, x2 - 2, y2, rightSide, rightOfBottomSide, belowRightSide, bottomSide); - // Draw the bottom side - DrawLine(grGrid, bottomSide, x1, y2, x2-3, y2); - // Draw the right side - DrawLine(grGrid, rightSide, x2, y1, x2, y2-3); - } - private static void DrawLine(Graphics gr, GridLinePattern pattern, int x1, int y1, int x2, int y2) - { - if (pattern == GridLinePattern.None) return; - Pen pn = VlnBorders.LinePen(pattern, BorderColor); - DrawLine(gr, pn, pattern, x1, y1, x2, y2); - } - private static void DrawLine(Graphics gr, Pen pn, int x1, int y1, int x2, int y2) - { - DrawLine(gr, pn, GridLinePattern.Single, x1, y1, x2, y2); - } - private static void DrawLine(Graphics gr, Pen pn, GridLinePattern pattern, int x1, int y1, int x2, int y2) - { - int dx = 0; - int dy = 0; - int dblx = 0; - int dbly = 0; - int xThick = 0; - int yThick = 0; - if (x1 == x2) // Vertical Line - { - dx = (int) (-pn.Width / 2); - dblx = -2; - if (pn.Width > 2) - yThick = 1; - } - else // Horizontal Line - { - dy = (int) (-pn.Width / 2); - dbly = -2; - if (pn.Width > 2) - xThick = 1; - } - gr.DrawLine(pn, x1 + dx, y1 + dy, x2 + dx + xThick, y2 + dy + yThick); - if(pattern == GridLinePattern.Double) - gr.DrawLine(pn, x1 + dx +dblx, y1 + dy + dbly, x2 + dx+dblx, y2 + dy+dbly); - } - private static void DrawIntersection(Graphics gr, int x, int y, GridLinePattern up, GridLinePattern right, GridLinePattern down, GridLinePattern left) - { - if (up == GridLinePattern.Double) - if (right == GridLinePattern.Double) - if (down == GridLinePattern.Double) - if (left == GridLinePattern.Double) DrawIntersectionAllDoubles(gr, x, y); - else DrawDrawIntersection3Doubles_URD(gr, x, y); - else // Down is not double - if (left == GridLinePattern.Double) DrawDrawIntersection3Doubles_URL(gr, x, y); - else DrawDrawIntersection2Doubles_UR(gr, x, y, down, left); - else // right is not double - if (down == GridLinePattern.Double) - if (left == GridLinePattern.Double) DrawDrawIntersection3Doubles_UDL(gr, x, y); - else DrawDrawIntersection2Doubles_UD(gr, x, y, right, left); - else // Down is not double - if (left == GridLinePattern.Double) DrawIntersection2Doubles_UL(gr, x, y, right, down); - else DrawIntersectionOneDoubleOrLess(gr, x, y, up, right, down, left); - else - if (right == GridLinePattern.Double) - if (down == GridLinePattern.Double) - if (left == GridLinePattern.Double) DrawDrawIntersection3Doubles_RDL(gr, x, y); - else DrawDrawIntersection2Doubles_RD(gr, x, y, up, left); - else // Down is not double - if (left == GridLinePattern.Double) DrawDrawIntersection2Doubles_RL(gr, x, y, up, down); - else DrawIntersectionOneDoubleOrLess(gr, x, y, up, right, down, left); - else - if (down == GridLinePattern.Double) - if (left == GridLinePattern.Double) DrawDrawIntersection2Doubles_DL(gr, x, y, up, right); - else DrawIntersectionOneDoubleOrLess(gr, x, y, up, right, down, left); - else // These both use the same function with the same parameters - if (left == GridLinePattern.Double) DrawIntersectionOneDoubleOrLess(gr, x, y, up, right, down, left); - else DrawIntersectionOneDoubleOrLess(gr, x, y, up, right, down, left); - } - private static Pen pnDouble = VlnBorders.LinePen(GridLinePattern.Double, BorderColor); - private static Pen pnThick = VlnBorders.LinePen(GridLinePattern.Thick, BorderColor); - private static void DrawIntersectionAllDoubles(Graphics gr, int x, int y) - { - DrawLine(gr, pnDouble, x-1, y, x, y); - DrawLine(gr, pnDouble, x, y - 2, x, y - 3); - DrawLine(gr, pnDouble, x + 2, y - 2, x + 3, y - 2); - DrawLine(gr, pnDouble, x + 2, y, x + 2, y + 1); - } - private static void DrawDrawIntersection3Doubles_URD(Graphics gr, int x, int y) - { - DrawLine(gr, pnDouble, x , y, x, y - 3); - DrawLine(gr, pnDouble, x + 2, y - 2, x + 3, y - 2); - DrawLine(gr, pnDouble, x + 2, y, x + 2, y + 1); - } - private static void DrawDrawIntersection3Doubles_URL(Graphics gr, int x, int y) - { - DrawLine(gr, pnDouble, x, y, x + 2, y); - DrawLine(gr, pnDouble, x -1, y - 2, x , y - 2); - DrawLine(gr, pnDouble, x + 2, y - 2, x + 3, y - 2); - } - private static void DrawDrawIntersection3Doubles_UDL(Graphics gr, int x, int y) - { - DrawLine(gr, pnDouble, x-1, y, x, y); - DrawLine(gr, pnDouble, x , y - 2, x , y - 3); - DrawLine(gr, pnDouble, x + 2, y-3, x + 2, y); - } - private static void DrawDrawIntersection3Doubles_RDL(Graphics gr, int x, int y) - { - DrawLine(gr, pnDouble, x-1, y, x, y); - DrawLine(gr, pnDouble, x, y - 2, x + 2, y - 2); - DrawLine(gr, pnDouble, x + 2, y, x + 2, y + 1); - } - private static void DrawDrawIntersection2Doubles_UR(Graphics gr, int x, int y, GridLinePattern lp1, GridLinePattern lp2) - { - if (lp1 == GridLinePattern.Thick && lp2 == GridLinePattern.Thick) - DrawLine(gr, pnThick, x, y, x + 3, y); - else - { - DrawLine(gr, pnDouble, x, y, x + 2, y); - DrawLine(gr, pnDouble, x , y, x , y - 2); - DrawLine(gr, pnDouble, x + 2, y - 2, x + 3, y - 2); - } - } - private static void DrawDrawIntersection2Doubles_UD(Graphics gr, int x, int y, GridLinePattern lp1, GridLinePattern lp2) - { - if (lp1 == GridLinePattern.Thick && lp2 == GridLinePattern.Thick) - DrawLine(gr, pnThick, x, y, x + 3, y); - else - { - DrawLine(gr, pnDouble, x, y, x, y - 2); - DrawLine(gr, pnDouble, x + 2, y, x + 2, y - 2); - } - } - private static void DrawIntersection2Doubles_UL(Graphics gr, int x, int y, GridLinePattern lp1, GridLinePattern lp2) - { - if (lp1 == GridLinePattern.Thick && lp2 == GridLinePattern.Thick) - DrawLine(gr, pnThick, x, y, x + 3, y); - else - { - DrawLine(gr, pnDouble, x, y, x + 2, y); - DrawLine(gr, pnDouble, x , y - 2, x, y - 3); - DrawLine(gr, pnDouble, x + 2, y, x + 2, y - 2); - } - } - private static void DrawDrawIntersection2Doubles_RD(Graphics gr, int x, int y, GridLinePattern lp1, GridLinePattern lp2) - { - if (lp1 == GridLinePattern.Thick && lp2 == GridLinePattern.Thick) - DrawLine(gr, pnThick, x, y, x + 3, y); - else - { - DrawLine(gr, pnDouble, x, y, x, y - 2); - DrawLine(gr, pnDouble, x, y - 2, x + 2, y - 2); - DrawLine(gr, pnDouble, x + 2, y, x + 2, y + 1); - } - } - private static void DrawDrawIntersection2Doubles_RL(Graphics gr, int x, int y, GridLinePattern lp1, GridLinePattern lp2) - { - if (lp1 == GridLinePattern.Thick && lp2 == GridLinePattern.Thick) - DrawLine(gr, pnThick, x, y, x + 2, y); - else - { - DrawLine(gr, pnDouble, x, y, x + 2, y); - DrawLine(gr, pnDouble, x, y - 2, x + 2, y - 2); - } - } - private static void DrawDrawIntersection2Doubles_DL(Graphics gr, int x, int y, GridLinePattern lp1, GridLinePattern lp2) - { - if (lp1 == GridLinePattern.Thick && lp2 == GridLinePattern.Thick) - DrawLine(gr, pnThick, x, y, x + 2, y); - else - { - DrawLine(gr, pnDouble, x-1, y, x, y); - DrawLine(gr, pnDouble, x, y - 2, x + 2, y - 2); - DrawLine(gr, pnDouble, x + 2, y, x + 2, y - 2); - } - } - private static void DrawIntersectionOneDoubleOrLess(Graphics gr, int x, int y, - GridLinePattern up, GridLinePattern right, GridLinePattern down, GridLinePattern left) - { - Pen pnUp = VlnBorders.LinePen(up, BorderColor); - Pen pnLeft = VlnBorders.LinePen(left, BorderColor); - int widthUpDown = Math.Max(VlnBorders.LineWidth0(up), VlnBorders.LineWidth0(down)); - int heightLeftRight = Math.Max(VlnBorders.LineWidth0(left), VlnBorders.LineWidth0(right)); - if (heightLeftRight > 0 && widthUpDown > 0) - { - Pen pn = new Pen(BorderColor, widthUpDown); - if(heightLeftRight > 1) - DrawLine(gr, pn, x + 2, y + 1 - heightLeftRight, x + 2, y); - else if(up == GridLinePattern.None) // Work around to set a pixel (actually set two) - DrawLine(gr, pn, x + 2, y, x + 2, y + 1); - } - if (left != GridLinePattern.None) - { - DrawLine(gr, pnLeft, x, y, x + 2 - widthUpDown, y); - if (left == GridLinePattern.Double) - DrawLine(gr, pnLeft, x, y - 2, x + 2 - widthUpDown, y - 2); - } - if (up != GridLinePattern.None) - { - DrawLine(gr, pnUp, x + 2, y - 3 , x + 2, y +1 - heightLeftRight); - if (up == GridLinePattern.Double) - DrawLine(gr, pnUp, x, y - 3, x, y +1 - heightLeftRight); - } - } - #endregion //Grid Initialize - #region Grid and Cell Styles - public void ChangeBackgroundColor(string bckgndColor) - { - CellRange cr = this.Selection; - if (!bckgndColor.EndsWith(";")) - bckgndColor+=";"; - string strBckgndColor = string.Format("BackColor:{0}", bckgndColor); - - for (int rw = cr.r1; rw <= cr.r2; rw++) - for (int cl = cr.c1; cl <= cr.c2; cl++) - { - CellRange tmp = this.GetCellRange(rw, cl, rw, cl); - string StyleName = string.Format("R{0}C{1}Style", rw, cl); - CellStyle cs = this.Styles.Add(StyleName, tmp.Style); - cs.ParseString(strBckgndColor); - tmp.Style = cs; - } - } - - public void ToggleCellTextAlignment() - { - // only used in test program - CellRange cr = this.Selection; - using (StepRTB srtb = new StepRTB()) - { - srtb.Rtf = this.GetCellRTFString(cr.r1, cr.c1); - - srtb.SelectAll(); - int align = (int)srtb.SelectionAlignment; - align = (align + 1) % 3; - - srtb.SelectionAlignment = (HorizontalAlignment)align; - this.PutCellRTFString(cr.r1, cr.c1, srtb.Rtf); - } - } - - public void RTFTextAlignment(CellRange cr, HorizontalAlignment ha) - { - using (StepRTB srtb = new StepRTB()) - { - for (int rw = cr.r1; rw <= cr.r2; rw++) - for (int cl = cr.c1; cl <= cr.c2; cl++) - { - srtb.Rtf = this.GetCellRTFString(rw, cl); - srtb.SelectAll(); - srtb.SelectionAlignment = ha; - this.PutCellRTFString(rw, cl, srtb.Rtf); - } - } - } - - - public void SetTableBorder(C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum border) - { - this.BorderStyle = border; - this.AdjustGridControlSize(); - } - public void ChangeCellAlign(CellRange cr, TextAlignEnum newAlign) - { - for (int rw = cr.r1; rw <= cr.r2; rw++) - for (int col = cr.c1; col <= cr.c2; col++) - { - CellRange tmp = this.GetCellRange(rw, col, rw, col); - string StyleName = string.Format("R{0}C{1}Style", rw, col); - CellStyle cs = null; - if (Styles.Contains(StyleName)) - cs = Styles[StyleName]; - else - cs = this.Styles.Add(StyleName, tmp.Style); - cs.TextAlign = newAlign; - tmp.Style = cs; - } - // If one column and one row, then go into edit mode. - if (cr.r1 == cr.r2 && cr.c1 == cr.c2) - SendKeys.Send("{F2}"); // Toggle Edit Mode with F2 - } - public void ChangeCellBorder(CellRange cr, BorderStyleEnum newBorder) - { - for (int rw = cr.r1; rw <= cr.r2; rw++) - for (int col = cr.c1; col <= cr.c2; col++) - { - CellRange tmp = this.GetCellRange(rw, col, rw, col); - string StyleName = string.Format("R{0}C{1}Style", rw, col); - CellStyle cs = null; - if (Styles.Contains(StyleName)) - cs = Styles[StyleName]; - else - cs = this.Styles.Add(StyleName, tmp.Style); - cs.Border.Style = newBorder; - tmp.Style = cs; - } - } - public void ListStyles() - { - for (int r = 0; r < Rows.Count; r++) - for (int c = 0; c < Cols.Count; c++) - { - CellRange cr = GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - if (cr.Style != null) Console.WriteLine("{0}, {1}, {2}, {3}", r, c, cr.Style.Name, cr.Style.BackColor); - } - } - } - //public void VerticalCenterText() - //{ - // StepRTB myStepRTB = new StepRTB(); - // CellRange selRange = this.Selection; - // for (int r = selRange.r1; r <= selRange.r2; r++) - // for (int c = selRange.c1; c <= selRange.c2; c++) - // { - // CellRange mr = this.GetMergedRange(r, c); - // if (mr.r1 == r) - // { - // int editHeight = (int)mr.UserData; - // int cellHeight = GetCellHeight(mr.r1, mr.c1); - // if (editHeight < cellHeight) - // { - // myStepRTB.Rtf = (string)mr.Data; - // RTBAPI.SetSpaceBefore(myStepRTB, (cellHeight - editHeight) / 2); - // PutCellRTFString(mr.r1, mr.c1, myStepRTB.Rtf); - // } - // } - // } - //} - //public void VerticalTopText() - //{ - // StepRTB myStepRTB = new StepRTB(); - // CellRange selRange = this.Selection; - // for (int r = selRange.r1; r <= selRange.r2; r++) - // for (int c = selRange.c1; c <= selRange.c2; c++) - // { - // CellRange mr = this.GetMergedRange(r, c); - // if (mr.r1 == r) - // { - // myStepRTB.Rtf = (string)mr.Data; - // RTBAPI.SetSpaceBefore(myStepRTB, 0); - // PutCellRTFString(mr.r1, mr.c1, myStepRTB.Rtf); - // } - // } - //} - //public void VerticalBottomText() - //{ - // StepRTB myStepRTB = new StepRTB(); - // CellRange selRange = this.Selection; - // for (int r = selRange.r1; r <= selRange.r2; r++) - // for (int c = selRange.c1; c <= selRange.c2; c++) - // { - // CellRange mr = this.GetMergedRange(r, c); - // if (mr.r1 == r) - // { - // int editHeight = (int)mr.UserData; - // int cellHeight = GetCellHeight(mr.r1, mr.c1); - // if (editHeight < cellHeight) - // { - // myStepRTB.Rtf = (string)mr.Data; - // RTBAPI.SetSpaceBefore(myStepRTB, (cellHeight - editHeight)); - // PutCellRTFString(mr.r1, mr.c1, myStepRTB.Rtf); - // } - // } - // } - //} - - //public void SetupCellStyles() - //{ - // //CellStyle cs; - - // //cs = this.Styles.Add("Dotted"); - // //cs.Border.Style = BorderStyleEnum.Dotted; - // //cs = this.Styles.Add("Double"); - // //cs.Border.Style = BorderStyleEnum.Double; - // //cs = this.Styles.Add("Fillet"); - // //cs.Border.Style = BorderStyleEnum.Fillet; - // //cs = this.Styles.Add("Flat"); - // //cs.Border.Style = BorderStyleEnum.Flat; - // //cs = this.Styles.Add("Groove"); - // //cs.Border.Style = BorderStyleEnum.Groove; - // //cs = this.Styles.Add("Inset"); - // //cs.Border.Style = BorderStyleEnum.Inset; - // //cs = this.Styles.Add("None"); - // //cs.Border.Style = BorderStyleEnum.None; - // //cs = this.Styles.Add("Raised"); - // //cs.Border.Style = BorderStyleEnum.Raised; - // //cs = this.Styles.Add("CenterRight"); - // //cs.TextAlign = TextAlignEnum.RightCenter; //.LeftCenter; // this is being ignored - probably due to RTF conversion - // //cs = this.Styles.Add("Yellow"); - // //cs.BackColor = Color.Yellow; - // //cs = this.Styles.Add("Margins"); - // //cs.Margins.Bottom = 5; - // //cs.Margins.Top = 10; - // //cs.Margins.Left = 15; - // //cs.Margins.Right = 20; - //} - #endregion //Grid and Cell Styles - - #region Grid Size Adjustments - - /// - /// Adjust the grid control size based on the cell sizes. - /// - public void AdjustGridControlSize() - { - if (Parent is GridItem ? (Parent as GridItem).Initializing : false ) return; - int difW = this.Width - this.ClientSize.Width; - int difH = this.Height - this.ClientSize.Height; - int wid = 0; - if (this != null) - { - foreach (C1.Win.C1FlexGrid.Column col in this.Cols) - wid += (col.Width >= 0) ? col.Width : this.Cols.DefaultSize; - - int height = 0; - foreach (C1.Win.C1FlexGrid.Row row in this.Rows) - //height += (row.Height >= 0) ? row.Height : this.Rows.DefaultSize + 2; - height += (row.Height >= 0) ? row.Height : this.Rows.DefaultSize; - - this.Size = new Size(wid + difW, height + difH); - } - } - - public void ConvertTextCellToRTF(int r, int c) - { - using (StepRTB trtb = new StepRTB()) - { - string tstr = null; - bool dummyCharWidth = false; - bool AllowWidthShrink = false; - trtb.SetTableGridCellRTFPrefix(this.Font); - trtb.Clear(); - tstr = (string)this[r, c]; - trtb.Font = this.Font; - if (tstr != null && tstr.Length > 0) - { - string tsave = tstr; - // regular text has special characters to toggle Bold, Underline, and Italics - // we need to subtract the width of these characters (allow column/row to shrink) - //AllowWidthShrink = RemoveBoldUlineItalicChars(trtb.Rtf); - AllowWidthShrink = tstr.Contains("#Link:"); - // this will convert the special characters for Bold, Underline, and Italics - // into RTF commands - //trtb.Rtf = trtb.RtfPrefix + ConvertTableText(trtb.Rtf) + "}"; - //string fromRTF = trtb.Rtf; - //string prefix = trtb.RtfPrefix; - //if (tstr.Contains("#Link:")) prefix += @"{\colortbl ;\red255\green0\blue0;}"; - //if (tstr.Contains("#Link:")) - // Console.WriteLine("here"); - //string jText = trtb.RtfPrefix + ConvertTableText(tstr) + @"\par}"; - //trtb.Rtf = jText; - trtb.Rtf = trtb.RtfPrefix + ConvertTableText(tstr) + @"\par}"; - //string fromStr = trtb.Rtf; - //if (fromRTF.Contains("SimSun")) - // Console.WriteLine("SimSun"); - //else - // Compare(fromRTF, fromStr, tsave); - } - else - { - trtb.Text = "X"; // this is to trick steprtf in giving a char width to fit one character - // note that a space character was too small. - dummyCharWidth = true; - } - // find the needed cell width - trtb.AdjustWidthForContent(); - if (dummyCharWidth) - { - trtb.Text = ""; // clear out the dummy character before saving - dummyCharWidth = false; - } - - this[r, c] = trtb.Rtf; // save the cleaned up and processed cell text as RTF - this.Select(r, c, false); - CellRange sel = this.Selection; - //sel.UserData = trtb.ContentsRectangle.Height; - - // Now adjust the Height and Width in the defined merge ranges - AdjustMergeRangeHeightWidth(r, c, trtb, tstr, AllowWidthShrink); - - - //// Now see the the selected row,col is in the defined merge ranges - //bool mrgrows = false; - //bool mrgcols = false; - //foreach (CellRange cr in this.MergedRanges) - //{ - // if (cr.Contains(r, c)) - // { - // if (cr.c1 != cr.c2) - // mrgcols = true; // in a range of merged columns - // if (cr.r1 != cr.r2) - // mrgrows = true; // in a range of merged rows - // continue; - // } - //} - //if (!mrgcols || !mrgrows) - //{ - // // IF the row of the selected cell is NOT in merged range - // // then go ahead and adjust the row height (if needed) - // if (!mrgrows) - // { - // // add adjustment for grid and cell borders - // int newheight = trtb.Height + 3; - - // //Console.WriteLine("{0} {1} {2} '{3}'", r, c, newheight,trtb.Text); - // if (newheight > this.Rows[r].Height) - // { - // //Console.WriteLine("1 Row {0} Old Height = {1}, New Height = {2}", r, Rows[r].Height, newheight); - // this.Rows[r].Height = newheight; - // } - // } - // // IF the column of the selected cell is NOT in merged range - // // then go ahead and adjust the column width (if needed) - // if (!mrgcols) - // { - // // add adjustment for grid and cell borders - // int newwidth = trtb.Width + 2; - - // if (newwidth > this.Cols[c].Width || AllowWidthShrink || r == 0) - // this.Cols[c].Width = newwidth; - // } - //} - //if (mrgrows && tstr != null) - //{ - // CellRange cr = GetMergedRange(r, c); - // //Console.WriteLine("grid[{0},{1}] merge = {2}", r, c,cr); - // if (cr.r1 == r && cr.c1 == c) - // { - // // if in merged rows, then make sure the cell's height is large enough - // string[] strary = tstr.Split("\n".ToCharArray()); - // // count number of lines of text - // int nlines = strary.Length; - // // count number of rows in merge range - // int nrows = (cr.r2 - cr.r1) + 1; - // //Console.WriteLine("2 Row {0} Height = {1}", cr.r1, Rows[cr.r1].Height); - // while (nlines > nrows) - // { - // // add length to first row in merged range - // int h = this.Rows[cr.r1].Height; - // int defH = Rows.DefaultSize - 3; - // //h = (h == -1) ? _minRowHeight * 2 : h + _minRowHeight; - // h = (h == -1) ? (defH * 2) + 3 : h + defH; - // //h = (h == -1) ? (Rows.DefaultSize + 2) * 2 : h + Rows.DefaultSize + 2; - // //Console.WriteLine("3 Row {0} Old Height = {1}, New Height = {2}", cr.r1, Rows[cr.r1].Height, h); - // this.Rows[cr.r1].Height = h; - // nrows++; - // } - // } - //} - } - } - private void AdjustCellHeightWidth(int r, int c) - { - using (StepRTB trtb = new StepRTB()) - { - string tstr = null; - bool dummyCharWidth = false; - bool AllowWidthShrink = false; - trtb.SetTableGridCellRTFPrefix(this.Font); - trtb.Clear(); - trtb.Font = this.Font; - trtb.Rtf = (string)this[r, c]; - tstr = trtb.Text; - if (tstr != null && tstr.Length > 0) - AllowWidthShrink = tstr.Contains("#Link:"); - else - { - trtb.Text = "X"; // this is to trick steprtf in giving a char width to fit one character - // note that a space character was too small. - dummyCharWidth = true; - } - // find the needed cell width - trtb.AdjustWidthForContent(); - - if (dummyCharWidth) - { - trtb.Text = ""; // clear out the dummy character before saving - dummyCharWidth = false; - } - - this.Select(r, c, false); - CellRange sel = this.Selection; - - // Now adjust the Height and Width in the defined merge ranges - AdjustMergeRangeHeightWidth(r, c, trtb, tstr, AllowWidthShrink); - } - } - - private void AdjustMergeRangeHeightWidth(int r, int c, StepRTB trtb, string tstr, bool AllowWidthShrink) - { - bool mrgrows = false; - bool mrgcols = false; - foreach (CellRange cr in this.MergedRanges) - { - if (cr.Contains(r, c)) - { - if (cr.c1 != cr.c2) - mrgcols = true; // in a range of merged columns - if (cr.r1 != cr.r2) - mrgrows = true; // in a range of merged rows - continue; - } - } - if (!mrgcols || !mrgrows) - { - // IF the row of the selected cell is NOT in merged range - // then go ahead and adjust the row height (if needed) - if (!mrgrows) - { - // add adjustment for grid and cell borders - int newheight = trtb.Height + 3; - - //Console.WriteLine("{0} {1} {2} '{3}'", r, c, newheight,trtb.Text); - if (newheight > this.Rows[r].Height) - { - //Console.WriteLine("1 Row {0} Old Height = {1}, New Height = {2}", r, Rows[r].Height, newheight); - this.Rows[r].Height = newheight; - } - } - // IF the column of the selected cell is NOT in merged range - // then go ahead and adjust the column width (if needed) - if (!mrgcols) - { - // add adjustment for grid and cell borders - int newwidth = trtb.Width + 3; // 2; - if (newwidth > (this.Cols[c].Width == -1 ? this.Cols.DefaultSize : this.Cols[c].Width) || AllowWidthShrink || r == 0) - this.Cols[c].Width = newwidth; - } - } - if (mrgrows && tstr != null) - { - CellRange cr = GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - // if in merged rows, then make sure the cell's height is large enough - string[] strary = tstr.Split("\n".ToCharArray()); - // count number of lines of text - int nlines = strary.Length; - // count number of rows in merge range - int nrows = (cr.r2 - cr.r1) + 1; - //Console.WriteLine("2 Row {0} Height = {1}", cr.r1, Rows[cr.r1].Height); - while (nlines > nrows) - { - // add length to first row in merged range - int h = this.Rows[cr.r1].Height; - int defH = Rows.DefaultSize - 3; - h = (h == -1) ? (defH * 2) + 3 : h + defH; - this.Rows[cr.r1].Height = h; - nrows++; - } - } - } - } - private int TotalColWidths() - { - int cwid = 0; - foreach (Column c in Cols) - { - cwid += ((c.Width > 0) ? c.Width : Cols.DefaultSize); - } - return cwid; - } - /// - /// This will adjust the column widths of the current table based upon the page width - /// Note: This is for use in creating a new table - not to process an existing table. - /// - /// - public void FitTableToPageWidth(int pgWidthPoints) - { - int grdWidth = TotalColWidths(); - int pgwidth = (int)((pgWidthPoints / 72) * this._DPI); - - if (grdWidth > pgwidth) - { - int difWid = grdWidth - pgwidth; - int colAdj = (difWid / Cols.Count) +(((difWid % Cols.Count) > 0) ? 1 : 0); - foreach (Column c in Cols) - { - int cwid = (c.Width > 0) ? c.Width : Cols.DefaultSize; - if ((cwid - colAdj) > 0) - c.Width = cwid - colAdj; - } - } - } - //private void AdjustCellHeightWidth(int r, int c) - //{ - // StepRTB trtb = new StepRTB(); - // string tstr = null; - // bool dummyCharWidth = false; - // bool AllowWidthShrink = false; - // trtb.SetTableGridCellRTFPrefix(this.Font); - // trtb.Clear(); - // trtb.Font = this.Font; - // trtb.Rtf = (string)this[r, c]; - // tstr = trtb.Text; - // if (tstr != null && tstr.Length > 0) - // AllowWidthShrink = tstr.Contains("#Link:"); - // else - // { - // trtb.Text = "X"; // this is to trick steprtf in giving a char width to fit one character - // // note that a space character was too small. - // dummyCharWidth = true; - // } - // // find the needed cell width - // trtb.AdjustWidthForContent(); - - // if (dummyCharWidth) - // { - // trtb.Text = ""; // clear out the dummy character before saving - // dummyCharWidth = false; - // } - - // this.Select(r, c, false); - // CellRange sel = this.Selection; - - // // Now see the the selected row,col is in the defined merge ranges - // bool mrgrows = false; - // bool mrgcols = false; - // foreach (CellRange cr in this.MergedRanges) - // { - // if (cr.Contains(r, c)) - // { - // if (cr.c1 != cr.c2) - // mrgcols = true; // in a range of merged columns - // if (cr.r1 != cr.r2) - // mrgrows = true; // in a range of merged rows - // continue; - // } - // } - // if (!mrgcols || !mrgrows) - // { - // // IF the row of the selected cell is NOT in merged range - // // then go ahead and adjust the row height (if needed) - // if (!mrgrows) - // { - // // add adjustment for grid and cell borders - // int newheight = trtb.Height + 3; - - // //Console.WriteLine("{0} {1} {2} '{3}'", r, c, newheight,trtb.Text); - // if (newheight > this.Rows[r].Height) - // { - // //Console.WriteLine("1 Row {0} Old Height = {1}, New Height = {2}", r, Rows[r].Height, newheight); - // this.Rows[r].Height = newheight; - // } - // } - // // IF the column of the selected cell is NOT in merged range - // // then go ahead and adjust the column width (if needed) - // if (!mrgcols) - // { - // // add adjustment for grid and cell borders - // int newwidth = trtb.Width + 2; - - // if (newwidth > this.Cols[c].Width || AllowWidthShrink || r == 0) - // this.Cols[c].Width = newwidth; - // } - // } - // if (mrgrows && tstr != null) - // { - // CellRange cr = GetMergedRange(r, c); - // if (cr.r1 == r && cr.c1 == c) - // { - // // if in merged rows, then make sure the cell's height is large enough - // string[] strary = tstr.Split("\n".ToCharArray()); - // // count number of lines of text - // int nlines = strary.Length; - // // count number of rows in merge range - // int nrows = (cr.r2 - cr.r1) + 1; - // //Console.WriteLine("2 Row {0} Height = {1}", cr.r1, Rows[cr.r1].Height); - // while (nlines > nrows) - // { - // // add length to first row in merged range - // int h = this.Rows[cr.r1].Height; - // int defH = Rows.DefaultSize - 3; - // h = (h == -1) ? (defH * 2) + 3 : h + defH; - // this.Rows[cr.r1].Height = h; - // nrows++; - // } - // } - // } - //} - - //private void Compare(string fromRTF, string fromStr, string rawstr) - //{ - // int istart = fromRTF.IndexOf(" ",fromRTF.IndexOf("viewkind")); - // int jstart = fromStr.IndexOf(" ",fromStr.IndexOf("viewkind")); - // for (int i = istart; i < fromRTF.Length; i++) - // { - // int j = i - istart + jstart; - // //else if (fromRTF[i] != fromStr[j]) - // if (fromRTF[i] != fromStr[j]) - // { - // if (fromRTF.Substring(i, 1) == @"~" && fromStr.Substring(j, 3) == @"'a0") - // { - // //i++; - // jstart += 2; - // } - // else - // { - // Console.WriteLine("fromStr:\r\n'{0}'\r\nfromRTF:\r\n'{1}'", fromStr, fromRTF); - // ShowRawString(rawstr, "rawstr"); - // Console.WriteLine("Str:'{0}' , RTF:'{1}'", fromStr.Substring(j, Math.Min(10,fromStr.Length-j-1)), fromRTF.Substring(i, Math.Min(10,fromRTF.Length-i-1))); - // return; - // } - // } - // } - //} - - #region DEBUG - //private void ShowRawString(string str, string title) - //{ - // Console.WriteLine("Raw Start --{0}:\n", title); - // foreach (char c in str) - // { - // int ic= (int)c; - // if (c!='\n'&&( ic > 126 || ic < 32)) - // Console.Write("<<{0:x4}>>", ic); - // else - // Console.Write(c); - // } - // Console.WriteLine("\n-- Raw End:{0}", title); - //} - #endregion - - private void Grid_AfterResize(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) - { - this.AdjustGridControlSize(); - } - - #endregion // Grid Size Adjustments - - #region Cell Text - public void MakeRTFcells() - { - // This will spin through all the cells in the grid: - // - convert the text to RTF if needed - // - adjust the grid dimensions based on the cell info. - for (int r = 0; r < this.Rows.Count; r++) - { - this.Rows[r].Height = Rows.DefaultSize;//_minRowHeight;//20;//10; - for (int c = 0; c < this.Cols.Count; c++) - this.ConvertTextCellToRTF(r, c); - } - - TrimColumnWidths(); - RemoveBlankSpaceFromRows(); - SetupCellUserData(); - this.AdjustGridControlSize(); - } - - public void FixTableCellsHeightWidth() - { - RemoveBlankSpaceFromColumns(); - RemoveBlankSpaceFromRows(); - } - - private void RemoveBlankSpaceFromRows() - { - for (int r = 0; r < Rows.Count; r++) - { - Select(r, 0); - int blankRowSpace = BlankRowSpace(); - if (blankRowSpace > 0) - Rows[r].Height -= blankRowSpace; - } - } - - private void RemoveBlankSpaceFromColumns() - { - for (int c = 0; c < Cols.Count; c++) - { - Select(0, c); - int blankColSpace = BlankColSpace(); - if (blankColSpace > 0) - Cols[c].Width -= blankColSpace; - } - } - - private void TrimColumnWidths() - { - for (int c = 0; c < Cols.Count; c++) - { - Select(0, c); - int newColWidth = MinColWidth(); - Cols[c].Width = newColWidth; - } - } - - private int MinColWidth() - { - int curColWidth = 0; - for (int r = 0; r < Rows.Count; r++) - { - CellRange cr = GetMergedRange(r, Col); - // find the needed cell width - if (Col == cr.c1) - { - using (StepRTB srtb = new StepRTB()) - { - srtb.Rtf = GetCellRTFString(cr.r1, cr.c1); - srtb.AdjustWidthForContent(); - curColWidth = Math.Max(curColWidth, srtb.Width + 3); - } - } - } - return curColWidth; - } - - //private bool RemoveBoldUlineItalicChars(string str) - //{ - // int rtn = 0; - - // // Underline next word - // rtn += str.IndexOf(@"\'17"); - - // // Bold next word - // rtn += str.IndexOf(@"\'13"); - - // // Italics On - // rtn += str.IndexOf(@"\'1B4"); - - // // Italics Off - // rtn += str.IndexOf(@"\'1B5"); - - // // underline On - // rtn += str.IndexOf(@"\'ab"); - // // underline Off - // rtn += str.IndexOf(@"\'bb"); - - // return rtn > 0; - - //} - - private string ConvertTableText(string str) - { - string rtn = str; - //ShowRawString(str, "ConvertTableText IN"); - rtn = rtn.Replace(@"START]\v0", @"START]\cf1\v0"); - rtn = rtn.Replace(@"\v #Link:", @"\cf0\v #Link:"); - rtn = rtn.Replace("\n", "\\par\r\n"); - rtn = rtn.Replace("\xB3", @"\f1\u9474?\f0"); // Vert Bar - rtn = rtn.Replace("\xF2", @"\f1\u8805?\f0 "); // greater than or equal - rtn = rtn.Replace("\x7F", @"\f1\u916?\f0 "); // delta - rtn = rtn.Replace("\xF3", @"\f1\u8804?\f0 "); // less than or equal - rtn = rtn.Replace("\xE4", @"\f1\u931?\f0 "); // sigma - rtn = rtn.Replace("\xE7", @"\f1\u947?\f0 "); // gamma - rtn = rtn.Replace("\xFE", @"\f1\u9604?\f0 "); // accum 2584 - rtn = rtn.Replace("\x7", @"\f1\u9679?\f0 "); // bullet 25CF - rtn = rtn.Replace("\xF7", @"\f1\u8776?\f0 "); // approx eq - rtn = rtn.Replace("\xF0", @"\f1\u8773?\f0 "); // similar eq 2245 - rtn = rtn.Replace("\xFB", @"\f1\u8730?\f0 "); // square root - rtn = rtn.Replace("\xE2", @"\f1\u961?\f0 "); // rho 3C1 - rtn = rtn.Replace("\xE3", @"\f1\u960?\f0 "); // pi - rtn = rtn.Replace("\xE6", @"\f1\u956?\f0 "); // micro - rtn = rtn.Replace("\xEB", @"\f1\u948?\f0 "); // lower case delta - rtn = rtn.Replace("\xE5", @"\f1\u963?\f0 "); // lower case sigma - rtn = rtn.Replace("\x90", @"\f1\u274?\f0 "); // energy, 112 - rtn = rtn.Replace("\xEE", @"\f1\u949?\f0 "); // epsilon - rtn = rtn.Replace("\xE9", @"\f1\u952?\f0 "); // theta, 3B8 - rtn = rtn.Replace("\xEC", @"\f1\u8857?\f0 "); // dot in oval, 2299 - rtn = rtn.Replace("\xA8", @"\f1\u964?\f0 "); // tau, 3C4 - rtn = rtn.Replace("\xA9", @"\f1\u9830?\f0 "); // diamond, 2666 - rtn = rtn.Replace("\x18", @"\f1\u8593?\f0 "); // Up Arrow - rtn = rtn.Replace("\x19", @"\f1\u8595?\f0 "); // Down Arrow - rtn = rtn.Replace("\xFF", @"\u160?"); // hardspace - //rtn = rtn.Replace(@"\'a0", @"\u160?"); - //rtn = rtn.Replace("\xff", @"\u160?"); - //rtn = rtn.Replace("\xA0", @"\u160?"); - // underline On - rtn = rtn.Replace("\xab", @"\ul"); - // underline Off - rtn = rtn.Replace("\xbb", @"\ulnone"); - //rtn = rtn.Replace("\xef\xe6", @"\up2 "); - //rtn = rtn.Replace("\xef\xe7", @"\up0 "); - rtn = rtn.Replace("\x9566", @"\up2 "); - rtn = rtn.Replace("\x9567", @"\up0 "); - rtn = rtn.Replace("{", @"\{"); - rtn = rtn.Replace("}", @"\}"); - rtn = rtn.Replace("\xd5", @"\b"); - rtn = rtn.Replace("\xd6", @"\b0"); - - //ShowRawString(rtn, "ConvertTableText OUT"); - return rtn; - } - - private static string SomethingNextWord(string str, string nxtwordcmd, string cmdOn, string cmdOff) - { - string rtn = ""; - int bidx = 0; - int fidx = str.IndexOf(nxtwordcmd, bidx); - char[] term = " \r\n\x02".ToCharArray(); - while (fidx > 0) - { - rtn += str.Substring(bidx, fidx - bidx) + cmdOn; - bidx = fidx + 4; - - if (bidx < str.Length) - { - fidx = str.IndexOfAny(term, bidx); - if (fidx > 0) - { - rtn += str.Substring(bidx, fidx - bidx) + cmdOff + str.Substring(fidx, 1); - bidx = fidx + 1; - } - } - - if (bidx < str.Length) - fidx = str.IndexOf(nxtwordcmd, bidx); - else - fidx = -1; - } - if (bidx < str.Length) - rtn += str.Substring(bidx); - - return rtn; - } - - private void _StartEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) - { - // start editing the cell with the custom editor - _tableCellEditor.StartEditing(e.Row, e.Col); - e.Cancel = true; - } - - // after edit handler (built-in editors) - private void _AfterEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) - { - this.GetCellRange(e.Row, e.Col).Style.ForeColor = Color.Black; - this.AdjustGridControlSize(); - } - - // if the custom editor is visible, make it follow the cell being edited - private void _AfterScroll(object sender, C1.Win.C1FlexGrid.RangeEventArgs e) - { - this._tableCellEditor.UpdatePosition(); - } - - // save last key pressed for the custom editor - private void _KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) - { - this._tableCellEditor.SetPendingKey(e.KeyChar); - } - - public string GetCellRTFString(int row, int col) - { - string rtnstr = ""; - foreach (CellRange r in this.MergedRanges) - { - if (r.ContainsRow(row) && r.ContainsCol(col)) - { - rtnstr = (string)this[r.r1, r.c1]; - return rtnstr; - } - } - rtnstr = (string)this[row, col]; - return rtnstr; - } - - public void PutCellRTFString(int row, int col, string str) - { - foreach (CellRange r in this.MergedRanges) - { - if (r.ContainsRow(row) && r.ContainsCol(col)) - { - this[r.r1, r.c1] = str; - return; - } - } - this[row, col] = str; - return; - } - public void ClearSelectedCellText() - { - CellRange cr = this.Selection; - cr.Clear(ClearFlags.Content); - } - public void SetupCellUserData() - { - for (int r = 0; r < Rows.Count; r++) - for (int c = 0; c < Cols.Count; c++) - { - string rtfText = GetDataDisplay(r, c); - if (rtfText.StartsWith(@"{\rtf")) - { - using (StepRTB _rtf = new StepRTB()) - { - _rtf.Width = Cols[c].Width; - _rtf.Rtf = rtfText; - CellRange cr = GetCellRange(r, c); - cr.UserData = _rtf.ContentsRectangle.Height; - } - } - } - } - - #endregion //Cell Text - - #region Merged / Split Range - - public void MergeSelection() - { - this.MergedRanges.Add(this.Selection,true); - this.Invalidate(); - this.Select(Selection.r1, Selection.c1); - } - public bool IsInMergeRange() - { - C1.Win.C1FlexGrid.CellRange sel = GetMergedRange(this.Selection.r1, this.Selection.c1); - return MergedRanges.Contains(sel); - } - public void SplitSelection(bool bSplitCols) - { - //Console.WriteLine("SplitSelection this.selection {0}", this.Selection); - //Debug_WritelineMySelection(); - //C1.Win.C1FlexGrid.CellRange sel = this.GetMergedRange(this.Selection.r1, this.Selection.c1); - //Console.WriteLine("SplitSelection myselection {0}", MySelection); - //foreach (CellRange sel in MySelection) - //{ - // //Console.WriteLine("SplitSelection foreach sel {0}", sel); - // if (sel.IsSingleCell) - // this.MergedRanges.Remove(sel); - // if (!(this.MergedRanges.Contains(sel)) && !didit) - // if (bSplitCols) - // SplitSelectionColumns(); - // else - // SplitSelectionRows(); - // didit = true; - //} - if (bSplitCols) - SplitSelectionColumns(); - else - SplitSelectionRows(); - //Debug_WritelineMySelection(); - //foreach (CellRange sel in MySelection) - //{ - // //Console.WriteLine("SplitSelection foreach sel {0}", sel); - // if (this.MergedRanges.Contains(sel)) - // SplitMergedRange(sel, bSplitCols); - //} - //this.Refresh(); - //RefreshMergeRangeCollection(); - this.AdjustGridControlSize(); - } - - private void SplitMergedRange(CellRange sel, bool bSplitCols) - { - int sR = sel.r1; - int eR = sel.r2; - int sC = sel.c1; - int eC = sel.c2; - if (bSplitCols && (IsMergedCols(sel) && !IsMergedRows(sel)) || - (!bSplitCols && (IsMergedRows(sel) && !IsMergedCols(sel)))) - MergedRanges.Remove(sel); - else - { - CellRange saveSelection = Selection; - if (bSplitCols && IsMergedRows(sel)) - { - MergedRanges.Remove(sel); - for (int c = sC; c <= eC; c++) - { - Select(sR, c, eR, c); - MergeSelection(); - } - } - else if (!bSplitCols && IsMergedCols(sel)) - { - MergedRanges.Remove(sel); - for (int r = sR; r <= eR; r++) - { - Select(r, sC, r, eC); - MergeSelection(); - } - } - Select(saveSelection); - } - } - private bool IsMergedRows(CellRange sel) - { - return (sel.r1 != sel.r2); - } - private bool IsMergedCols(CellRange sel) - { - return (sel.c1 != sel.c2); - } - private void SplitSelectionColumns() - { - bool hasNonMergedColumn = false; - //Console.WriteLine("SplitSelectionColumns this.selection {0}", this.Selection); - //Debug_WritelineMySelection(); - CellRange cr = this.Selection; - int numSelCols = (cr.c2 - cr.c1) + 1; - foreach (CellRange sel in MySelection) - { - if (!this.MergedRanges.Contains(sel)) - hasNonMergedColumn = true; - else - { - CellRange mr = GetMergedRange(sel.r1, sel.c1); - if (mr.c1 == mr.c2) - hasNonMergedColumn = true; - } - } - // for each column in the selection, add a new column - if (hasNonMergedColumn) - { - for (int c = cr.c2; c >= cr.c1; c--) - { - Select(cr.r1, c, cr.r2, c); - InsertColumnAfter(); - } - } - // include new columns in selection - this.Select(cr.r1, cr.c1, cr.r2, cr.c2 + ((hasNonMergedColumn) ? numSelCols : 0)); - //if a merged range is part of the selectin, try to split it - foreach (CellRange sel in MySelection) - { - //Console.WriteLine("SplitSelection foreach sel {0}", sel); - if (this.MergedRanges.Contains(sel)) - SplitMergedRange(sel, true); - } - cr = this.Selection; - if (hasNonMergedColumn) - { - for (int r = 0; r < this.Rows.Count; r++) - for (int c = cr.c1; c <= cr.c2; c += 2) - { - if (!this.IsCellSelected(r, c)) - { - CellRange crTmp = GetMergedRange(r, c); - if (crTmp.IsSingleCell) - { - CellRange tcr = this.GetCellRange(r, c, r, c + 1); - this.MergedRanges.Add(tcr); - this.Invalidate(); - } - //CellRange tcr = this.GetCellRange(r, c, r, c + 1); - //this.MergedRanges.Add(tcr); - } - } - // Adjust selected column widths - for (int c = cr.c1; c <= cr.c2; c++) - { - int recWidth = (Cols[c].Width < 0) ? Cols.DefaultSize : Cols[c].Width; // this.GetCellRect(cr.r1, c).Width; - int newWidth = Math.Max(recWidth / 2, _minColSplitWidth); - this.Cols[c].Width = newWidth; - //Console.WriteLine("Cell[{0},{1}].Width = {2}", cr.r1, c, recWidth); - //Console.WriteLine("Cell[{0},{1}].NewWidth = {2}", cr.r1, c, newWidth); - } - } - } - - private void SplitSelectionRows() - { - bool hasNonMergedRow = false; - CellRange cr = this.Selection; - int numSelRows = (cr.r2 - cr.r1) + 1; - //Console.WriteLine("numSelRows = {0}", numSelRows); - //Console.WriteLine("Inital Selection [{0},{1}] - [{2},{3}]", cr.r1, cr.c1, cr.r2, cr.c2); - foreach (CellRange sel in MySelection) - { - if (!this.MergedRanges.Contains(sel)) - hasNonMergedRow = true; - else - { - CellRange mr = GetMergedRange(sel.r1, sel.c1); - if (mr.r1 == mr.r2) - hasNonMergedRow = true; - } - } - // for each row in the selection, add a new row - if (hasNonMergedRow) - { - for (int r = cr.r2; r >= cr.r1; r--) - { - //Console.WriteLine("Inserted new Row at [{0},{1}]", r, cr.c1); - Select(r, cr.c1, r, cr.c2); - InsertRowAfter(); - } - } - // include new rows in selection - this.Select(cr.r1, cr.c1, cr.r2 + numSelRows, cr.c2); - //if a merged range is part of the selectin, try to split it - foreach (CellRange sel in MySelection) - { - //Console.WriteLine("SplitSelection foreach sel {0}", sel); - if (this.MergedRanges.Contains(sel)) - SplitMergedRange(sel, false); - } - cr = this.Selection; - //Console.WriteLine(" After Insert [{0},{1}] - [{2},{3}]", cr.r1, cr.c1, cr.r2, cr.c2); - if (hasNonMergedRow) - { - for (int c = 0; c < this.Cols.Count; c++) - for (int r = cr.r1; r <= cr.r2; r += 2) - { - if (!this.IsCellSelected(r, c)) - { - CellRange crTmp = GetMergedRange(r, c); - if (crTmp.IsSingleCell) - { - CellRange tcr = this.GetCellRange(r, c, r + 1, c); - this.MergedRanges.Add(tcr); - this.Invalidate(); - } - } - } - // Adjust selected Row Heights - for (int r = cr.r1; r <= cr.r2; r++) - { - int recHeight = this.GetCellRect(r, cr.c1).Height; - this.Rows[r].Height = Math.Max(recHeight / 2, Rows.DefaultSize); - //this.Rows[r].Height = Math.Max(recHeight / 2, _minRowSplitHeight); - //Console.WriteLine("Cell[{0},{1}].Height = {2}", r, cr.c1, recHeight); - } - } - //foreach (CellRange crng in this.MergedRanges) - // Console.WriteLine("merge ranges [{0},{1}] - [{2},{3}]", crng.r1, crng.c1, crng.r2, crng.c2); - } - private void AdjustMergedRows(int row, bool above, bool removing) - { - AdjustMergedRows(row, 1, above, removing); - } - - private void AdjustMergedRows(int row, int cnt, bool above, bool removing) - { - CellRangeCollection crc = new CellRangeCollection(this); - if (removing) - { - foreach (CellRange r in this.MergedRanges) - { - CellRange cr = r; - if (r.ContainsRow(row)) - { - if (r.TopRow != r.BottomRow) - { - cr.r2 -= cnt; - crc.Add(cr); - } - } - else - { - if (row <= r.r1) - { - if (row < r.r1) - cr.r1 -= cnt; - cr.r2 -= cnt; - } - crc.Add(cr); - } - } - } - else // adding - foreach (CellRange r in this.MergedRanges) - { - CellRange cr = r; - int inspos = (above) ? row : row - 1; - if (r.ContainsRow(inspos)) - { - bool adjustMergeValues = true; - if (cr.r1 == row && cr.r2 == row + cnt -1) - adjustMergeValues = false; // don't add to existing merge range - we will add a new merge range for this copy - for (int insCnt = 0; insCnt < cnt; insCnt++) - { - if ((above && cr.r1 == inspos) || (!above && cr.r2 == inspos)) - { - string tstr = ""; - int newrow = 0; - if (above) - { - if (this[cr.r1 + cnt, cr.c1] != null) - tstr = this[cr.r1 + cnt, cr.c1].ToString(); - newrow = cr.r1; - } - else - { - if (this[cr.r2, cr.c1] != null) - tstr = this[cr.r2, cr.c1].ToString(); - newrow = cr.r2 + cnt; - } - if (tstr != null && tstr.Length > 0) - for (int x = cr.c1; x <= cr.c2; x++) - this[newrow, x] = tstr; - } - if (adjustMergeValues) cr.r2++; - } - } - else - { - if (inspos < cr.r1) - { - cr.r1 += cnt; - cr.r2 += cnt; - } - } - crc.Add(cr); - } - this.MergedRanges.Clear(); - foreach (CellRange r in crc) - { - if ((r.r1 != r.r2) || (r.c1 != r.c2)) - this.MergedRanges.Add(r); - } - } - - private void AdjustMergedColumns(int col, bool left, bool removing) - { - AdjustMergedColumns(col, 1, left, removing); //adjusting for just one column - } - - private void AdjustMergedColumns(int col, int cnt, bool left, bool removing) - { - CellRangeCollection crc = new CellRangeCollection(this); - if (removing) - { - foreach (CellRange r in this.MergedRanges) - { - CellRange cr = r; - if (r.ContainsCol(col)) - { - if (r.LeftCol != r.RightCol) - { - cr.c2 -= cnt; - crc.Add(cr); - } - } - else - { - if (col < cr.c1) - { - cr.c1-=cnt; - cr.c2-=cnt; } - crc.Add(cr); - } - } - } - else // adding - foreach (CellRange r in this.MergedRanges) - { - CellRange cr = r; - int inspos = (left) ? col : col - 1; - if (r.ContainsCol(inspos)) - { - for (int insCnt = 0; insCnt < cnt; insCnt++) - { - string tstr = ""; - int newcol = 0; - if (left) - { - if (inspos == cr.c1) - tstr = (this[cr.r1, cr.c1 + 1] == null) ? "" : this[cr.r1, cr.c1 + 1].ToString(); - else - tstr = (this[cr.r1, cr.c1] == null) ? "" : this[cr.r1, cr.c1].ToString(); - newcol = cr.c1; - } - else - { - if (this[cr.r1, cr.c2] != null) - tstr = this[cr.r1, cr.c2].ToString(); - newcol = cr.c2 + 1; - } - for (int x = cr.r1; x <= cr.r2; x++) - this[x, newcol] = tstr; - - cr.c2++; - } - } - else if (col <= r.c1) - { - cr.c1+=cnt; - cr.c2+=cnt; - } - crc.Add(cr); - } - this.MergedRanges.Clear(); - foreach (CellRange r in crc) - { - if ((r.r1 != r.r2) || (r.c1 != r.c2)) - this.MergedRanges.Add(r); - } - } - - private bool RowIsInMergeRange(int row) - { - bool rtn = false; - if (row >= 0) - { - CellRange cr = this.Selection; - //rtn = true; // KBR: is this wrong, i.e. should it be like ColIsInMergeRange - int c = cr.c1; - while (!rtn && (c <= cr.c2)) - { - int idx = this.MergedRanges.IndexOf(row, c); - rtn = (idx > -1); - c++; - } - } - return rtn; - } - - private bool ColIsInMergeRange(int col) - { - bool rtn = false; - if (col >= 0) - { - CellRange cr = this.Selection; - //rtn = true; - int r = cr.r1; - while (!rtn && (r <= cr.r2)) - { - int idx = this.MergedRanges.IndexOf(r, col); - rtn = (idx > -1); - r++; - } - } - return rtn; - } - - #endregion //Merged / Split Range - - #region Grid Add and Remove Row / Column - - private int GetRowInsertPosition(Boolean before) - { - int rtnrow; - CellRange selcr = this.Selection; - CellRange cr = selcr; - int idx = this.MergedRanges.IndexOf(cr.r1, cr.c2); - if (idx > -1) - cr = this.MergedRanges[idx]; // we want first or last row in merge range - rtnrow = (before) ? cr.r1 : cr.r2; - // The following is an adjustment needed when we are copying an entire row that includes some merged cells - if (selcr.c1 != selcr.c2) - { - while (!before && rtnrow > selcr.r2) rtnrow--; - while (before && rtnrow < selcr.r2) rtnrow++; - } - - return rtnrow; - } - - private int GetColInsertPosition(Boolean before) - { - int rtncol; - CellRange selcr = this.Selection; - CellRange cr = selcr; - int idx = this.MergedRanges.IndexOf(cr.r1, cr.c2); - if (idx > -1) - cr = this.MergedRanges[idx]; // we want the first of last col in merge range - rtncol = (before) ? cr.c1 : cr.c2; - // The following is an adjustment needed when we are copying an entire column that includes some merged cells - if (selcr.r1 != selcr.r2) - { - while (!before && rtncol > selcr.c2) rtncol--; - while (before && rtncol < selcr.c2) rtncol++; - } - return rtncol; - } - - public void InsertColumnBefore() - { - int newcol = this.GetColInsertPosition(true); - this.Cols.Insert(newcol); - // set new column width to same width as column from where it was inserted - this.Cols[newcol].Width = this.Cols[newcol + 1].Width; - MyBorders.InsertColumn(newcol); - this.AdjustMergedColumns(newcol, true, false); - this.AdjustGridControlSize(); - } - - public void InsertColumnAfter() - { - int colidx = this.GetColInsertPosition(false); - if (colidx == this.Cols.Count - 1) // last column - this.Cols.Add(1); - else - this.Cols.Insert(colidx + 1); - MyBorders.InsertColumn(colidx); - // set new column width to same width as column from where it was inserted - this.Cols[colidx + 1].Width = this.Cols[colidx].Width; - this.AdjustMergedColumns(colidx + 1, false, false); - this.AdjustGridControlSize(); - } - - public void InsertRowBefore() - { - int newrow = this.GetRowInsertPosition(true); - this.Rows.Insert(newrow); - // set new row Height to same heidht as row from where it was inserted - this.Rows[newrow].Height = (Rows[newrow + 1].Height == -1) ? Rows.DefaultSize : Rows[newrow + 1].Height; - //this.Rows[newrow].Height = this.Rows[newrow + 1].Height; - MyBorders.InsertRow(newrow); - this.AdjustMergedRows(newrow, true, false); - this.AdjustGridControlSize(); - } - - public void InsertRowAfter() - { - int rowidx = this.GetRowInsertPosition(false); - if (rowidx == this.Rows.Count - 1) // last row - this.Rows.Add(1); - else - this.Rows.Insert(rowidx + 1); - // set new row Height to same heidht as row from where it was inserted - this.Rows[rowidx + 1].Height = (Rows[rowidx].Height == -1) ? Rows.DefaultSize : Rows[rowidx].Height; - //this.Rows[rowidx + 1].Height = this.Rows[rowidx].Height; - MyBorders.InsertRow(rowidx + 1); - this.AdjustMergedRows(rowidx + 1, false, false); - this.AdjustGridControlSize(); - } - - public bool AllRowsSelected() - { - int maxrow = Selection.r2; - foreach (CellRange cr in MySelection) - maxrow = Math.Max(maxrow, cr.r2); - return (Selection.r1 == 0 && maxrow == Rows.Count - 1); - } - - public bool AllColumnsSelected() - { - int maxcol = Selection.c2; - foreach (CellRange cr in MySelection) - maxcol = Math.Max(maxcol, cr.c2); - return (Selection.c1 == 0 && maxcol == Cols.Count - 1); - } - - public void RemoveSelectedColumn() - { - string msg = ""; - string title = ""; - CellRange saveCR = Selection; - this.SelectionMode = SelectionModeEnum.ColumnRange; - //this.Select(this.Selection.r1, this.Selection.c1); - this.Select(0, Selection.c1, Rows.Count - 1, Selection.c2); - this.SelectionMode = SelectionModeEnum.Default; - if (Selection.c1 != Selection.c2) - { - msg = "Remove selected columns?"; - title = "Delete Columns"; - } - else - { - msg = "Remove this column?"; - title = "Delete Column"; - } - DialogResult dr = MessageBox.Show(msg, title, MessageBoxButtons.YesNo); - if (dr == DialogResult.Yes) - RemoveColumns(this.Selection.r1, this.Selection.c1, 1+this.Selection.c2-this.Selection.c1); - else - Select(saveCR); - } - - public void RemoveSelectedRow() - { - string msg = ""; - string title = ""; - CellRange saveCR = Selection; - this.SelectionMode = SelectionModeEnum.RowRange; - this.Select(Selection.r1, 0, Selection.r2, Cols.Count - 1); - this.SelectionMode = SelectionModeEnum.Default; - if (Selection.r1 != Selection.r2) - { - msg = "Remove selected rows?"; - title = "Delete Rows"; - } - else - { - msg = "Remove this row?"; - title = "Delete Row"; - } - DialogResult dr = MessageBox.Show(msg, title, MessageBoxButtons.YesNo); - if (dr == DialogResult.Yes) - this.RemoveRows(this.Selection.r1, this.Selection.c1, 1 + this.Selection.r2 - this.Selection.r1); - else - Select(saveCR); - } - - private void RemoveRows(int strow, int stcol, int cnt) - { - bool mergedRow = false; - for (int i = 0; i < cnt; i++) - { - for (int cl = 0; cl < this.Cols.Count && !mergedRow; cl++) - { - int idx = this.MergedRanges.IndexOf(strow, cl); - if (idx > -1) - { - CellRange cr = this.MergedRanges[idx]; - if (cr.r1 < cr.r2) - mergedRow = true; - } - cl++; - } - this.Rows.Remove(strow); - this.AdjustMergedRows(strow, false, true); - mergedRow = false; - } - MyBorders.DeleteRows(strow, cnt); - this.AdjustGridControlSize(); - } - - private void RemoveColumns(int strow, int stcol, int cnt) - { - bool mergedCol = false; - for (int i = 0; i < cnt; i++) - { - for (int rw = 0; rw < this.Rows.Count && !mergedCol; rw++) - { - int idx = this.MergedRanges.IndexOf(rw, stcol); - if (idx > -1) - { - CellRange cr = this.MergedRanges[idx]; - if (cr.c1 < cr.c2) - mergedCol = true; - } - } - this.Cols.Remove(stcol); - this.AdjustMergedColumns(stcol, false, true); - mergedCol = false; - } - MyBorders.DeleteColumns(stcol, cnt); - this.AdjustGridControlSize(); - } - #endregion //Grid Add and Remove Row / Column - - #region Copy/Paste - - public void CopyRow() - { - DialogResult dr = DialogResult.Yes; - SelectRow(); - if (Selection.r1 != Selection.r2) - { - //dr = MessageBox.Show("You selected a row that includes merged cells.\n\nThese additional rows must be included.\n\nCopy these rows?", "Copy Rows", MessageBoxButtons.YesNo); - dr = MessageBox.Show("Your selection was expanded due to merged cell regions.\n\nContinue with the copy?", "Copy Rows", MessageBoxButtons.YesNo); - } - if (dr == DialogResult.Yes) - CopyToCopiedFlexGrid(GridCopyOption.Row); - } - - public void CopyColumn() - { - SelectCol(); - DialogResult dr = DialogResult.Yes; - if (Selection.c1 != Selection.c2) - { - //dr = MessageBox.Show("You selected a column that includes merged cells.\n\nThese additional columns must be included.\n\nCopy these columns?", "Copy Columns", MessageBoxButtons.YesNo); - dr = MessageBox.Show("Your selection was expanded due to merged cell regions.\n\nContinue with the copy?", "Copy Columns", MessageBoxButtons.YesNo); - } - if (dr == DialogResult.Yes) - CopyToCopiedFlexGrid(GridCopyOption.Column); - } - - public void CopyCellSelection() - { - DialogResult dr = DialogResult.Yes; - CellRange cr = Selection; - MakeSelectionEven(); - if (!cr.Equals(Selection)) - { - dr = MessageBox.Show("Your selection was expanded due to merged cell regions.\n\nContinue with the copy?", "Copy Selection", MessageBoxButtons.YesNo); - } - if (dr == DialogResult.Yes) - CopyToCopiedFlexGrid(GridCopyOption.Selection); - } - - public enum enmPastePos : int - { - Before = 1, Replace = 0, After = -1 - } - - public void PasteRows(enmPastePos pp) - { - if (MyCopyInfo.MyCopiedFlexGrid == null || MyCopyInfo.MyCopyOption != GridCopyOption.Row) return; - int rowsToAdd = MyCopyInfo.MyCopiedCellRange.r2 - MyCopyInfo.MyCopiedCellRange.r1 + 1; - int colsToAdd = Math.Max((MyCopyInfo.MyCopiedCellRange.c2 - MyCopyInfo.MyCopiedCellRange.c1 + 1) - Cols.Count, 0); - int selR1 = Selection.r1; - int selR2 = Selection.r2; - int rowOffset = selR1 + (pp == enmPastePos.After ?(selR2-selR1)+1 : 0) - MyCopyInfo.MyCopiedCellRange.r1; - - // If the rows we are copying has more columns than the current table, then append then needed columns to the grid - if (colsToAdd > 0) - { - Cols.Add(colsToAdd); - AdjustMergedColumns(Cols.Count - 1, colsToAdd, false, false); - MyBorders.InsertColumns(Cols.Count - colsToAdd - 1, colsToAdd); - } - - switch (pp) - { - case enmPastePos.Before: - this.Rows.InsertRange(selR1, rowsToAdd); - AdjustMergedRows(selR1, rowsToAdd, true, false); - MyBorders.InsertRows(Rows.Count - rowsToAdd - 1, rowsToAdd); - break; - case enmPastePos.After: - if (selR2+1 < Rows.Count - 1) - { - this.Rows.InsertRange(selR2 + 1, rowsToAdd); - AdjustMergedRows(selR1+1, rowsToAdd, false, false); - } - else - this.Rows.Add(rowsToAdd); - MyBorders.InsertRows(Rows.Count - rowsToAdd - 1, rowsToAdd); - break; - case enmPastePos.Replace: - if (rowsToAdd > Rows.Count - Selection.r1) - { - int numToAdd = rowsToAdd - (Rows.Count = selR1); - this.Rows.Add(numToAdd); - AdjustMergedRows(selR1, numToAdd, false, false); - } - break; - } - - RemoveMergedRanges(MyCopyInfo.MyCopiedCellRange.r1 + rowOffset, MyCopyInfo.MyCopiedCellRange.c1, MyCopyInfo.MyCopiedCellRange.r2 + rowOffset, MyCopyInfo.MyCopiedCellRange.c2); - for (int r = MyCopyInfo.MyCopiedCellRange.r1; r <= MyCopyInfo.MyCopiedCellRange.r2; r++) - { - Rows[r + rowOffset].Height = MyCopyInfo.MyCopiedFlexGrid.Rows[r].Height; - for (int c = MyCopyInfo.MyCopiedCellRange.c1; c <= Math.Min(MyCopyInfo.MyCopiedCellRange.c2 + colsToAdd, Cols.Count - 1); c++) - { - CellRange crm = MyCopyInfo.MyCopiedFlexGrid.GetMergedRange(r, c); - if (r == crm.r1 && c == crm.c1) - { - Cols[c].Width = Math.Max(Cols[c].Width, MyCopyInfo.MyCopiedFlexGrid.Cols[c].Width); - CellRange cr = GetCellRange(crm.r1 + rowOffset, crm.c1, crm.r2 + rowOffset, crm.c2); - // if the paste is above - copy merge range for the destination - // if the paste is below - put back the range for the source location - if ((crm.r2 > crm.r1) || (crm.c2 > crm.c1)) - MergedRanges.Add(cr); - this[r + rowOffset, c] = MyCopyInfo.MyCopiedFlexGrid[r, c]; - MatchStyle(crm, cr); - PasteBorders(r + rowOffset, c, r, c); - // if the paste is above - put back the range for the source location - // if the paste is below - copy merge range for the destination - int r1 = crm.r1 + rowsToAdd - rowOffset; - int r2 = crm.r2 + rowsToAdd - rowOffset; - CellRange ncr = GetCellRange(r1, crm.c1, r2, crm.c2); - if ((crm.r2 > crm.r1) || (crm.c2 > crm.c1)) - MergedRanges.Add(ncr); - } - } - } - - this.AdjustGridControlSize(); - CopyToCopiedFlexGrid(MyCopyInfo.MyCopyOption); - } - - private void MatchStyle(CellRange crm, CellRange cr) - { - if (crm.Style != null) - { - ChangeCellAlign(cr, crm.Style.TextAlign); - ChangeCellBorder(cr, crm.Style.Border.Style); - } - //else - //{ - // cr.Style = null; // - didn't like the null - //} - } - - private void RemoveMergedRanges(int r1, int c1, int r2, int c2) - { - for (int r = r1; r <= r2; r++) - for (int c = c1; c <= c2; c++) - { - CellRange cr = GetMergedRange(r, c); - if (cr.r1 < cr.r2 || cr.c1 < cr.c2) - MergedRanges.Remove(cr); - } - } - - public void PasteColumns(enmPastePos pp) - { - if (MyCopyInfo.MyCopiedFlexGrid == null || MyCopyInfo.MyCopyOption != GridCopyOption.Column) return; - - int colsToAdd = MyCopyInfo.MyCopiedCellRange.c2 - MyCopyInfo.MyCopiedCellRange.c1 + 1; - int rowsToAdd = Math.Max((MyCopyInfo.MyCopiedCellRange.r2 - MyCopyInfo.MyCopiedCellRange.r1 + 1) - Rows.Count, 0); - int selC1 = Selection.c1; - int selC2 = Selection.c2; - int colOffset = selC1 + (pp == enmPastePos.After ? (selC2-selC1)+1 : 0) - MyCopyInfo.MyCopiedCellRange.c1; - - // If the columns we are copying has more rows than the current table, then append the needed rows to the grid - if (rowsToAdd > 0) - { - Rows.Add(rowsToAdd); - AdjustMergedRows(Rows.Count, false, false); - MyBorders.InsertRows(Rows.Count - rowsToAdd - 1,rowsToAdd); - } - - switch (pp) - { - case enmPastePos.Before: - this.Cols.InsertRange(selC1, colsToAdd); - AdjustMergedColumns(selC1, colsToAdd, true, false); - MyBorders.InsertColumns(Cols.Count - colsToAdd - 1, colsToAdd); - break; - case enmPastePos.After: - if (selC2+1 < Cols.Count - 1) - { - this.Cols.InsertRange(selC2+1, colsToAdd); - AdjustMergedColumns(selC1+1, colsToAdd, false, false); - } - else - this.Cols.Add(colsToAdd); - MyBorders.InsertColumns(Cols.Count - colsToAdd - 1, colsToAdd); - break; - case enmPastePos.Replace: - if (colsToAdd > Cols.Count - selC1) - { - int numToAdd = colsToAdd - (Cols.Count - selC1); - this.Cols.Add(numToAdd); - AdjustMergedColumns(selC1, numToAdd, true, false); - } - break; - } - - RemoveMergedRanges(MyCopyInfo.MyCopiedCellRange.r1, MyCopyInfo.MyCopiedCellRange.c1 + colOffset, MyCopyInfo.MyCopiedCellRange.r2, MyCopyInfo.MyCopiedCellRange.c2 + colOffset); - - // Fix the merge ranges - for (int c = MyCopyInfo.MyCopiedCellRange.c1; c <= MyCopyInfo.MyCopiedCellRange.c2; c++) - { - Cols[c + colOffset].Width = MyCopyInfo.MyCopiedFlexGrid.Cols[c].Width; - for (int r = MyCopyInfo.MyCopiedCellRange.r1; r <= Math.Min(MyCopyInfo.MyCopiedCellRange.r2 + rowsToAdd, Rows.Count - 1); r++) - { - CellRange crm = MyCopyInfo.MyCopiedFlexGrid.GetMergedRange(r, c); - if (r == crm.r1 && c == crm.c1) - { - Rows[r].Height = Math.Max(Rows[r].Height, MyCopyInfo.MyCopiedFlexGrid.Rows[r].Height); - CellRange cr = GetCellRange(crm.r1, crm.c1 + colOffset, crm.r2, crm.c2 + colOffset); - // if the paste is to the left - copy merge range for the destination - // if the paste is to the right - put back the range for the source location - if ((crm.r2 > crm.r1) || (crm.c2 > crm.c1)) - MergedRanges.Add(cr); - // copy cell text to the destination, copy the style, copy the cell borders - this[r, c + colOffset] = MyCopyInfo.MyCopiedFlexGrid[r, c]; - MatchStyle(crm, cr); - PasteBorders(r, c + colOffset, r, c); - // if the paste is to the left - put back the range for the source location - // if the paste is to the right - copy merge range for the destination - int c1 = crm.c1 + colsToAdd - colOffset; - int c2 = crm.c2 + colsToAdd - colOffset; - CellRange ncr = GetCellRange(crm.r1, c1, crm.r2, c2); - if ((crm.r2 > crm.r1) || (crm.c2 > crm.c1)) - MergedRanges.Add(ncr); - } - } - } - - this.AdjustGridControlSize(); - CopyToCopiedFlexGrid(MyCopyInfo.MyCopyOption); - - } - - public void PasteCopiedCells() - { - // Warn the user that this type of paste will replace the currently selected (highlighted) table cells and give the option to abort. - DialogResult dr = MessageBox.Show("This will replace the cells that are currently selected (highlighted). \n\nContinue with the paste?","Paste Table Cells",MessageBoxButtons.YesNo,MessageBoxIcon.Question); - if (dr == DialogResult.No) return; - - int nSelRows = Selection.r2 - Selection.r1 + 1; - int nSelCols = Selection.c2 - Selection.c1 + 1; - int nCpyRows = MyCopyInfo.MyCopiedCellRange.r2 - MyCopyInfo.MyCopiedCellRange.r1 + 1; - int nCpyCols = MyCopyInfo.MyCopiedCellRange.c2 - MyCopyInfo.MyCopiedCellRange.c1 + 1; - int colsToAdd = Math.Max(nCpyCols - nSelCols, 0); - int rowsToAdd = Math.Max(nCpyRows - nSelRows, 0); - int rowOffset = Selection.r1 - MyCopyInfo.MyCopiedCellRange.r1; - int colOffset = Selection.c1 - MyCopyInfo.MyCopiedCellRange.c1; - int selR2 = Selection.r2; - int selC2 = Selection.c2; - // If there are more cells to copy than what is seleceted in the target table - // Add extra rows and columns as needed - if (rowsToAdd > 0) - { - if (selR2 < Rows.Count - 1) - { - this.Rows.InsertRange(selR2 + 1, rowsToAdd); - AdjustMergedRows(selR2 + 1, false, false); - } - else - this.Rows.Add(rowsToAdd); - MyBorders.InsertRows(selR2,rowsToAdd); - } - - if (colsToAdd > 0) - { - if (selC2 < Cols.Count - 1) - { - this.Cols.InsertRange(selC2 + 1, colsToAdd); - AdjustMergedColumns(selC2 + 1, false, false); - } - else - this.Cols.Add(colsToAdd); - MyBorders.InsertColumns(selC2,colsToAdd); - } - - RemoveMergedRanges(MyCopyInfo.MyCopiedCellRange.r1 + rowOffset, MyCopyInfo.MyCopiedCellRange.c1 + colOffset, MyCopyInfo.MyCopiedCellRange.r2 + rowOffset, MyCopyInfo.MyCopiedCellRange.c2 + colOffset); - - for (int c = MyCopyInfo.MyCopiedCellRange.c1; c <= Math.Min(MyCopyInfo.MyCopiedCellRange.c2, Cols.Count - 1 - colOffset); c++) - Cols[c + colOffset].Width = Math.Max(MyCopyInfo.MyCopiedFlexGrid.Cols[c].Width, Cols[c + colOffset].Width); - - for (int r = MyCopyInfo.MyCopiedCellRange.r1; r <= Math.Min(MyCopyInfo.MyCopiedCellRange.r2, Rows.Count - 1 - rowOffset); r++) - { - Rows[r + rowOffset].Height = Math.Max(MyCopyInfo.MyCopiedFlexGrid.Rows[r].Height, Rows[r + rowOffset].Height); - for (int c = MyCopyInfo.MyCopiedCellRange.c1; c <= Math.Min(MyCopyInfo.MyCopiedCellRange.c2, Cols.Count - 1 - colOffset); c++) - { - CellRange crm = MyCopyInfo.MyCopiedFlexGrid.GetMergedRange(r, c); - if (r == crm.r1 && c == crm.c1) - { - CellRange cr = GetCellRange(crm.r1 + rowOffset, crm.c1 + colOffset, crm.r2 + rowOffset, crm.c2 + colOffset); - if ((crm.r2 > crm.r1) || (crm.c2 > crm.c1)) - MergedRanges.Add(cr); - this[r + rowOffset, c + colOffset] = MyCopyInfo.MyCopiedFlexGrid[r, c]; - MatchStyle(crm, cr); - PasteBorders(r + rowOffset, c + colOffset, r, c); - } - } - } - this.AdjustGridControlSize(); - CopyToCopiedFlexGrid(MyCopyInfo.MyCopyOption); - } - - #endregion // Copy/Paste - #region Selection - public bool SelectNextCell() - { - int r = this.Row; - int c = this.Col; - CellRange cr = GetMergedRange(r, c); - do - { - c = cr.c2 + 1; - if (c >= this.Cols.Count) - { - r = r + 1; - c = 0; - if (r >= this.Rows.Count) return false; - } - cr = GetMergedRange(r, c); - } while (r != cr.r1 || c != cr.c1); - Select(r, c); - return true; - } - public bool SelectPrevCell() - { - int r = this.Row; - int c = this.Col; - CellRange cr = GetMergedRange(r, c); - do - { - c = cr.c1 - 1; - if (c < 0) - { - r = r - 1; - c = this.Cols.Count-1; - if (r < 0) return false; - } - cr = GetMergedRange(r, c); - c = cr.c1; - } while (r != cr.r1); - Select(r, c); - return true; - } - #endregion - #region SearchableText - public string GetSearchableText() - { - StringBuilder sb = new StringBuilder(); - int r = 0; - int c = 0; - int w = Cols.Count; - int h = Rows.Count; - - while (r < h) - { - CellRange cr = GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - if (this[r, c] != null) - { - string strp = DisplayText.StaticStripRtfCommands((string)this[r, c]); - sb.Append(strp.Replace("\r\n", " ")); - } - sb.Append("\r\n"); - } - c = c + 1; - if (c == w) - { - c = 0; - r = r + 1; - } - } - return sb.ToString(); - } - #endregion - #region Import / Export Grid - - /// - /// Prompts user with Save File dialog. - /// Grid will be saved to an XML file. - /// - /// - public void ExportToXML(string initDir) - { - SaveFileDialog sfd = new SaveFileDialog(); - sfd.DefaultExt = ".xml"; - sfd.Filter = "XML files (*.xml)|*.xml|All files (*.*)|*.* "; - //sfd.InitialDirectory = @"C:\Development\SampleTableData"; - sfd.InitialDirectory = initDir; - sfd.Title = "Save XML File"; - sfd.ShowDialog(); - this.WriteXml(sfd.FileName); - } - public string GetXMLData() - { - string retstr = null; - using (StringWriter sw = new StringWriter()) - { - this.WriteXml(sw); - retstr = sw.GetStringBuilder().ToString(); - sw.Close(); - } - return retstr; - } - /// - /// Prompts user with Save File dialog. - /// Grid will be saved to an Excel file. - /// - /// - public void ExportToExcel(string initDir) - { - SaveFileDialog sfd = new SaveFileDialog(); - sfd.DefaultExt = ".xls"; - sfd.Filter = "Excel files (*.xls)|*.xls|All files (*.*)|*.* "; - //sfd.InitialDirectory = @"C:\Development\SampleTableData"; - sfd.InitialDirectory = initDir; - sfd.Title = "Save Excel File"; - sfd.ShowDialog(); - this.SaveExcel(sfd.FileName); - } - - /// - /// Prompts user with Open File dialog. - /// XML file will be imported to a table grid. - /// - /// - /// - public string ImportXML(string initDir) - { - string rtn = ""; - OpenFileDialog ofd = new OpenFileDialog(); - ofd.DefaultExt = ".xml"; - ofd.Filter = "XML files (*.xml)|*.xml|All files (*.*)|*.* "; - //ofd.InitialDirectory = @"C:\Development\SampleTableData"; - ofd.InitialDirectory = initDir; - ofd.Multiselect = false; - ofd.Title = "Select XML File"; - ofd.ShowDialog(); - this.Clear(); - this.MergedRanges.Clear(); - this.ReadXml(ofd.FileName); - this.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None; - this.KeyActionTab = KeyActionEnum.MoveAcross; - this.AdjustGridControlSize(); - rtn = ofd.SafeFileName; - return rtn; - } - - /// - /// Prompts user with Open File dialog. - /// Excel file will be imported to a table grid. - /// - /// - /// - public string ImportExcel(string initDir) - { - string rtn = ""; - //VlnFlexGrid grd = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3; //GetActiveGrid(); - OpenFileDialog ofd = new OpenFileDialog(); - ofd.DefaultExt = ".xls"; - ofd.Filter = "Excel files (*.xls)|*.xls|All files (*.*)|*.*"; - //ofd.InitialDirectory = @"C:\Development\SampleTableData"; - ofd.InitialDirectory = initDir; - ofd.Multiselect = false; - ofd.Title = "Select Excel File"; - ofd.ShowDialog(); - this.Clear(); - this.MergedRanges.Clear(); - this.LoadExcel(ofd.FileName); - this.AdjustGridControlSize(); - rtn = ofd.SafeFileName; - return rtn; - } - public static List ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args) - { - string xml = null; - string srchtxt = null; - Content content = (Content)sender; - bool isdirty = false; - using (VlnFlexGrid myGrid = new VlnFlexGrid(content.ContentItems[0])) - { - using (StringReader sr = new StringReader(args.OldGridXml)) - { - myGrid.ReadXml(sr); - sr.Close(); - } - string roid = content.ContentRoUsages[0].ROID; //myGrid.ROID; - int rodbid = content.ContentRoUsages[0].RODbID; //myGrid.RODbId; - myGrid.Visible = false; - myGrid.ConvertTableROToGrid(args.ROText, rodbid, roid); - myGrid.FixTableCellsHeightWidth(); - myGrid.AdjustGridControlSize(); - myGrid.Visible = true; - using (StringWriter sw = new StringWriter()) - { - myGrid.WriteXml(sw); - xml = sw.GetStringBuilder().ToString(); - sw.Close(); - } - srchtxt = myGrid.GetSearchableText(); - isdirty = myGrid.IsGridChanged(args.OldGridXml, xml, false); - } - List retlist = new List(); - retlist.Add(srchtxt); - if(isdirty) - retlist.Add(xml); - else - retlist.Add(args.OldGridXml); - return retlist; - } - public void ConvertTableROToGrid(string valtext, int rodbid, string roid) - { - VE_Font vefont = _MyItemInfo.GetItemFont(); - this.Font = vefont.WindowsFont; - this.MergedRanges.Clear(); - this.Clear(); - this.IsRoTable = true; - this.ParseTableFromText(valtext, GridLinePattern.Single); - this.AutoSizeCols(); - this.AutoSizeRows(); - this.MakeRTFcells(); - this.RODbId = rodbid; - this.ROID = roid; - } - - private Regex _ReplaceSpaceNewLine = new Regex(@"(?<=\\[^' \\?\r\n\t]*) (?=\r\n)"); - private Regex _ReplaceTokenSpaceToken = new Regex(@"(?<=\\[^' \\?\r\n\t]*) (?=\\)"); - private Regex _RemoveComments = new Regex(@"\\v .*?\\v0( |$)"); - - private string PrepROTableText(string stepText) - { - // we need to convert some RTF command to DOS so that we can - // figure out the table size - stepText = stepText.Replace("\r", ""); - stepText = stepText.Replace("\xF8", @"\'f8"); - stepText = stepText.Replace(@"\par ", "\r\n"); - stepText = _ReplaceTokenSpaceToken.Replace(stepText, ""); - - //Change Token Order to match RTB output - stepText = stepText.Replace(@"\v0\b0", @"\b0\v0"); - stepText = stepText.Replace(@"\b0\ulnone", @"\ulnone\b0"); - stepText = _ReplaceSpaceNewLine.Replace(stepText, ""); - - // Now change the Unicode symbols to DOS symbols - stepText = stepText.Replace(@"\u8209?", "-"); - stepText = stepText.Replace(@"\u9474?", "\xB3"); // Vert Line graphic character - stepText = stepText.Replace(@"\'b0", "\xB0"); - stepText = stepText.Replace(@"\up2 ", "\x9566"); - stepText = stepText.Replace(@"\up0 ", "\x9567"); - stepText = stepText.Replace(@"\ulnone", "\xBB"); - stepText = stepText.Replace(@"\ul", "\xAB"); - stepText = stepText.Replace(@"\{", "{"); - stepText = stepText.Replace(@"\}", "}"); - stepText = stepText.Replace(@"\b0", "\xD6"); - stepText = stepText.Replace(@"\b", "\xD5"); - stepText = stepText.Replace(@"\u160?", "\xA0"); //hard space - stepText = stepText.Replace(@"\u916?", "\x7F"); // delta - stepText = stepText.Replace(@"\u8805?", "\xF2"); //greater than or equal - stepText = stepText.Replace(@"\u8804?", "\xF3"); // less than or equal - stepText = stepText.Replace(@"\u931?", "\xE4"); // sigma - stepText = stepText.Replace(@"\u947?", "\xE7"); // gamma - stepText = stepText.Replace(@"\u9604?", "\xFE"); // accum 2584 - stepText = stepText.Replace(@"\u9679?", "\x7"); // bullet 25CF - stepText = stepText.Replace(@"\u8776?", "\xF7"); // approx eq - stepText = stepText.Replace(@"\u8773?", "\xF0"); // similar eq 2245 - stepText = stepText.Replace(@"\u8730?", "\xFB"); // square root - stepText = stepText.Replace(@"\u961?", "\xE2"); // rho 3C1 - stepText = stepText.Replace(@"\u960?", "\xE3"); // pi - stepText = stepText.Replace(@"\u956?", "\xE6"); // micro - stepText = stepText.Replace(@"\u948?", "\xEB"); // lower case delta - stepText = stepText.Replace(@"\u963?", "\xE5"); // lower case sigma - stepText = stepText.Replace(@"\u274?", "\x90"); // energy, 112 - stepText = stepText.Replace(@"\u949?", "\xEE"); // epsilon - stepText = stepText.Replace(@"\u952?", "\xE9"); // theta, 3B8 - stepText = stepText.Replace(@"\u8857?", "\xEC"); // dot in oval, 2299 - stepText = stepText.Replace(@"\u964?", "\xA8"); // tau, 3C4 - stepText = stepText.Replace(@"\u9830?", "\xA9"); // diamond, 2666 - stepText = stepText.Replace(@"\u8593?", "\x18"); // Up Arrow - changes to \xff - stepText = stepText.Replace(@"\u8595?", "\x19"); // Down Arrow - changes to \xd6 - // Fix "|" followed by a newline - this confuses the table converter - stepText = stepText.Replace(@"|\r\n", @"| \r\n"); - stepText = stepText.Replace(@"|\n\r", @"| \n\r"); - stepText = stepText.Replace(@"|\n", @"| \n"); - - // if the entire row is underlined, then remove the underline and insert a row of dashes - stepText = ConvertUnderlineToRow(stepText); - - return stepText; - } - private bool IsPrintableTableChar(char c) - { - string printablSymbols = "\xB3\xA0\x7F\xF2\xF3\xE4\xE7\xFE\x07\xF7\xF0\xFB\xE2\xE3\xE6\xEB\xE5\x90\xEE\xE9\xEC\xA8\xA9\x18\x19"; - return (((c > '\x1F') && (c < '\x80')) || (printablSymbols.IndexOf(c) >= 0)); - } - private string ConvertUnderlineToRow(string stepText) - { - string rtnStr = ""; - char[] sep = { '\n' }; - string[] lines = stepText.Split(sep); - foreach (string line in lines) - { - int idx = 0; - int chrCnt = 0; - int uOnPos = -1; - int uOffPos = -1; - bool ulineOn = false; - //char curChar = line[idx]; - string dashRow = ""; - while (idx < line.Length && !IsPrintableTableChar(line[idx])) - { - if (line[idx] == '\xAB') //underline ON - { - ulineOn = true; - uOnPos = idx; - } - idx++; - } - while (ulineOn && idx < line.Length) - { - if (IsPrintableTableChar(line[idx])) - { - if (line[idx] == '|' || line[idx] == '\xB3') - { - dashRow += new string('-', chrCnt); - dashRow += "|"; - chrCnt = 0; - } - else - chrCnt++; - idx++; - } - else - { - if (line[idx] == '\xBB') //underline OFF - { - uOffPos = idx; - ulineOn = false; - while ((idx < line.Length) && !IsPrintableTableChar(line[idx])) - { - if (line[idx] == '\xAB') - ulineOn = true; - idx++; - } - if (idx == line.Length) - ulineOn = true; - if (!ulineOn) - dashRow = ""; - } - else - idx++; - } - } - string curLine = line; - curLine = curLine.Replace('\xB3', '|'); // replace graphic vert bar with DOS vert bar - if (ulineOn && idx == line.Length) // entire line is underlined, remove underline, insert row of dashes - { - curLine = curLine.Replace("\xAB", ""); // remove Underline ON - curLine = curLine.Replace("\xBB", ""); // remove Underline OFF - dashRow += new string('-', chrCnt); - dashRow = "\n" + dashRow; - } - if (rtnStr.Length > 0) rtnStr += "\n"; - rtnStr += curLine; - rtnStr += dashRow; - } - return rtnStr; - } - - /// - /// This will parse a string containing the ascii text of the old style VE-PROMS (16-bit) tables. - /// It will find the number of rows and columns base on newlines, vertical bars, and dashes. - /// Then it will parse the the text, place them in cells, and attempt to merge cells were needed. - /// - /// - public void ParseTableFromText(string buff,GridLinePattern border) - { - string txtbuff = PrepROTableText(buff); - if (IsRoTable) txtbuff = _RemoveComments.Replace(txtbuff, ""); - int curRow = 0; - int curCol = 0; - int maxRow = 0; - int maxCol = 0; - // Get Max Rows and Max Cols - char[] test = "|\n\x02".ToCharArray(); - int idx = 0; - int idxst = 0; - int colPos = 0; - int strow = 0; - Dictionary dicCols = new Dictionary(); - do - { - idx = txtbuff.IndexOfAny(test, idxst); - if (idx > -1) - { - switch (txtbuff[idx]) - { - case '|': // end of a column - colPos = idxst - strow; - if (!dicCols.ContainsKey(colPos)) - dicCols.Add(colPos, curCol); - else if (curCol > dicCols[colPos]) - { - dicCols.Remove(colPos); - dicCols.Add(colPos, curCol); - } - curCol++; - break; - case '\x02': - case '\n': // end of a row - colPos = idxst - strow; - if (!dicCols.ContainsKey(colPos)) - dicCols.Add(colPos, curCol); - else if (curCol > dicCols[colPos]) - { - dicCols.Remove(colPos); - dicCols.Add(colPos, curCol); - } - curRow++; - strow = idx + 1; - if (curCol > maxCol) - maxCol = curCol; - curCol = 0; - break; - } - idxst = idx + 1; - if (idxst >= txtbuff.Length) - idx = -1; - } - } while (idx != -1); - if (idxst < txtbuff.Length) - { - colPos = idxst - strow; - if (!dicCols.ContainsKey(colPos)) - dicCols.Add(colPos, curCol); - else if (curCol > dicCols[colPos]) - { - dicCols.Remove(colPos); - dicCols.Add(colPos, curCol); - } - } - maxRow = curRow; // +1; - curRow = 0; - curCol = 0; - if (maxCol == 0) maxCol = dicCols.Count; - // The resulting Table Grid size in rows and columns - this.Cols.Count = maxCol + 1; - this.Rows.Count = maxRow + 1; - - // make all rows and columns editable - this.Rows.Fixed = 0; - this.Cols.Fixed = 0; - - // TableCellInfo is used to assign merge ranges - // Make a two dimensional array of TableCellinfo the same size as the table grid - TableCellInfo[,] tci = new TableCellInfo[maxRow + 1, maxCol + 1]; - for (int r = 0; r <= maxRow; r++) - for (int c = 0; c <= maxCol; c++) - tci[r, c] = new TableCellInfo(); - // Read in each cell of the grid - idx = 0; - idxst = 0; - colPos = 0; - strow = 0; - int prevCol = 0; - int tstidx = 0; - string tstr = ""; - bool incRow = false; - do - { - idx = txtbuff.IndexOfAny(test, idxst); - if (idx > -1) - { - switch (txtbuff[idx]) - { - case '|': // end of column - colPos = idxst - strow; - // based on the position of the | char, find what column we are in. - // note that this will tell us if any columns to the left were merged - // the while loop will flag cell that need to be merged - curCol = dicCols[colPos]; - while (curCol > prevCol + 1) - { - tci[curRow, prevCol].MergeColRight = true; - prevCol++; - } - prevCol = curCol; - - // parse out the text to be placed in the table cell - tstr = txtbuff.Substring(idxst, idx - idxst); - if (tstr.Length == 0) - tstr += " "; - // test for a string of '-' characters - for (tstidx = 0; (tstidx < tstr.Length) && (tstr[tstidx] == '-'); tstidx++) ; - if (tstidx < tstr.Length) // not a full line (row) of '-' chars - { - // take a peek at the start of the next piece of table text to parse - // if it starts with a '-' char, then flag to merge the columns up to - // this point with the same columns in the next row - if (idx < txtbuff.Length - 1 && txtbuff[idx + 1] == '-') - { - for (int c = curCol; c >= 0; c--) - if (!tci[curRow, c].ColEnd) - tci[curRow, c].MergeRowBellow = true; - } - // if this column is in a merged grouping of rows, - // get the cell text in the first cell of the merged grouping of cells - // we will append the newly parsed text to this cell's text. - int rw = curRow; - while (rw - 1 >= 0 && tci[rw - 1, curCol].MergeRowBellow) rw--; - int cl = curCol; - while (cl - 1 >= 0 && tci[rw, cl-1].MergeColRight) cl--; - //string jstr = (string)this[rw, curCol]; - string jstr = (string)this[rw, cl]; - if (jstr == null) - jstr = tstr; - else - jstr += ((cl==curCol)? "\n" : "") + tstr; // multi line cell - //jstr += "\n" + tstr; // multi line cell - //this[rw, curCol] = jstr; - this[rw, cl] = jstr; - //// take a peek at the start of the next piece of table text to parse - //// if it starts with a '-' char, then flag to merge the columns up to - //// this point with the same columns in the next row - //if (idx < txtbuff.Length - 1 && txtbuff[idx + 1] == '-') - //{ - // for (int c = curCol; c >= 0; c--) - // if (!tci[curRow, c].ColEnd) - // tci[curRow, c].MergeRowBellow = true; - //} - //int tcol = dicCols[idx]; - //// if were are that the end of the 16-bit text line, but not in the last column, - //// merge the remaining columns to the right - //if (curCol < tcol) - //{ - // for (int i = curCol; i <= tcol; i++) - // tci[curRow, i].MergeColRight = true; - //} - } - else // parsed text contains all dashes - { - // take a peek at the start of the next piece of table text to parse - // if it starts with a space, return, newline, or EndOfFile char, - // then flag to merge the columns up to - // this point with the same columns in the next row - if (idx < txtbuff.Length - 1 && " \r\n\x02".IndexOf(txtbuff[idx + 1]) > 0) - { - int nextCol = (curCol + 1 > this.Cols.Count) ? curCol : curCol + 1; - if (!tci[curRow, nextCol].ColEnd) - tci[curRow, nextCol].MergeRowBellow = true; - //for (int c = nextCol; c >= 0; c--) - // if (!tci[curRow, c].ColEnd) - // tci[curRow, c].MergeRowBellow = true; - } - tci[curRow, curCol].ColEnd = true; - incRow = true; - } - break; - case '\x02': // end of file - case '\n': // new line of 16-bit table text - colPos = idxst - strow; - curCol = dicCols[colPos]; - // see what column we are in - new line might occure before last grid column - strow = idx + 1; - // parse out the cell text - tstr = txtbuff.Substring(idxst, idx - idxst); - if (tstr.EndsWith("\r")) // strip off carrage return - tstr = tstr.Substring(0, tstr.Length - 1); - //tstr = tstr.TrimEnd(" ".ToCharArray()); - if (tstr.Length == 0) - tstr += " "; - // test for a string of '-' characters - for (tstidx = 0; (tstidx < tstr.Length) && (tstr[tstidx] == '-'); tstidx++) ; - if (tstidx < tstr.Length) // not a full line (row) of '-' chars - { - //curCol = dicCols[colPos]; - while (curCol > prevCol + 1) - { - tci[curRow, prevCol].MergeColRight = true; - prevCol++; - } - // if this column is in a merged grouping of rows, - // get the cell text in the first cell of the merged grouping of cells - // we will append the newly parsed text to this cell's text. - int rw = curRow; - while (rw - 1 >= 0 && tci[rw - 1, curCol].MergeRowBellow) rw--; - int cl = curCol; - while (cl - 1 >= 0 && tci[rw, cl-1].MergeColRight) cl--; - //string jstr = (string)this[rw, curCol]; - string jstr = (string)this[rw, cl]; - if (jstr == null) - jstr = tstr; - else - jstr += ((cl == curCol) ? "\n" : "") + tstr; // multi line cell - //jstr += "\n" + tstr; // multi line cell - - //this[rw, curCol] = jstr; - this[rw, cl] = jstr; - } - else if (tstr.Length > 0) // parsed text is all dash characters - { - incRow = true; - if (curRow > 0 && curCol > 0) // merge the column in the previous row with this one - tci[curRow - 1, curCol].MergeRowBellow = false; - } - // if were are that the end of the 16-bit text line, but not in the last column, - // merge the remaining columns to the right - if ((curCol < maxCol) && (tstidx < tstr.Length)) - { - for (int i = curCol; i < maxCol; i++) - tci[curRow, i].MergeColRight = true; - } - if (incRow) - curRow++; - curCol = 0; - incRow = false; - break; - } - idxst = idx + 1; - if (idxst >= txtbuff.Length) - idx = -1; - } - else if (idxst < txtbuff.Length - 1) // handle any remaining text not yet parsed - { - // find the curent column and merge remaining columns to the right - colPos = idxst - strow; - curCol = dicCols.Count==0?0:dicCols[colPos]; - while (curCol > prevCol + 1) - { - tci[curRow, prevCol].MergeColRight = true; - prevCol++; - } - // parse out the remaining text - tstr = txtbuff.Substring(idxst); - //tstr = tstr.TrimEnd(" ".ToCharArray()); - if (tstr.Length == 0) - tstr += " "; - // test for a string of '-' characters - for (tstidx = 0; (tstidx < tstr.Length) && (tstr[tstidx] == '-'); tstidx++) ; - if (tstidx < tstr.Length) - { - // if this column is in a merged grouping of rows, - // get the cell text in the first cell of the merged grouping of cells - // we will append the newly parsed text to this cell's text. - int rw = curRow; - while (rw - 1 >= 0 && tci[rw - 1, curCol].MergeRowBellow) rw--; - int cl = curCol; - while (cl - 1 >= 0 && tci[rw, cl-1].MergeColRight) cl--; - //string jstr = (string)this[rw, curCol]; - string jstr = (string)this[rw, cl]; - if (jstr == null) - jstr = tstr; - else - jstr += ((cl == curCol) ? "\n" : "") + tstr; // multi line cell - //jstr += "\n" + tstr; // multi line cell - //this[rw, curCol] = jstr; - this[rw, cl] = jstr; - } - } - } while (idx != -1); - - // we are done parsing the 16-bit text. - // now set the merge ranges in the table grid, based on the - // information saved in that two dimensional array of TableCellinfo - this.Rows.Count = curRow + 1; - this.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.Custom; - maxRow = curRow; - int rR = 0; - int rC = 0; - for (int r = 0; r <= maxRow; r++) - for (int c = 0; c <= maxCol; c++) - { - if (tci[r, c].MergeColRight) - { - rC = c; - while ((rC < maxCol) && (tci[r, rC].MergeColRight)) rC++; - if (rC > c) - { - this.MergedRanges.Add(this.GetCellRange(r, c, r, rC)); - string cellstr = (this[r,c]==null)? " ": this[r, c].ToString(); - for (int x = c + 1; x <= rC; x++) - this[r, x] = cellstr; - c = rC; - } - } - } - for (int c = 0; c <= maxCol; c++) - for (int r = 0; r <= maxRow; r++) - { - if (tci[r, c].MergeRowBellow) - { - rR = r; - while ((rR < maxRow) && (tci[rR, c].MergeRowBellow)) rR++; - if (rR > r) - { - this.MergedRanges.Add(this.GetCellRange(r, c, rR, c)); - string cellstr = this[r, c].ToString(); - for (int x = r + 1; x <= rR; x++) - this[x, c] = cellstr; - r = rR; - } - } - } - for (int c = 0; c <= maxCol; c++) - for (int r = 0; r <= maxRow; r++) - { - if (this[r, c] != null) - { - string cellstr = this[r, c].ToString(); - this[r, c] = cellstr.TrimEnd("\r\n\t".ToCharArray()); - //this[r, c] = cellstr.TrimEnd(" \r\n\t".ToCharArray()); - CellRange cr = this.GetMergedRange(r, c); - if (cr.r1 != cr.r2) - TrimMergedRangeCellText(cr); - } - } - MyBorders = new VlnBorders(border, Rows.Count, Cols.Count); - } - - private void TrimMergedRangeCellText(CellRange cr) - { - // count number of newlines - string cellstr = this[cr.r1, cr.c1].ToString(); - string[] strary = cellstr.Split("\n".ToCharArray()); - int nlines = strary.Length; - // count number of rows in merge range - int nrows = (cr.r2 - cr.r1) + 1; - int neededLines = (nlines - (nrows - 1)); - bool bNeedToTrim = (nlines > neededLines); - string jstr = ""; - int LinesToGo = neededLines; - if (bNeedToTrim) - { - int numBlanksEnd = 0; - // find the number of blank lines at the end of this table cell - for (int i = nlines-1; i >= 0; i--) - { - if (strary[i].Trim().Length == 0) - numBlanksEnd++; - else - break; - } - int preBlanksLines = 0; - //foreach (string tmpstr in strary) - // we ignore the ending blank lines - // this allows us to include any blank lines that are between text lines - for (int i = 0; i < nlines - numBlanksEnd; i++) - { - string tmpstr = strary[i]; - int tlen = tmpstr.Trim().Length; - if (tlen > 0 || (LinesToGo < neededLines)) - { - if (jstr.Length > 0) jstr += "\n"; - jstr += tmpstr; - LinesToGo--; - } - else if (LinesToGo == (nlines - (nrows - 1))) - preBlanksLines++; - } - while (LinesToGo > 0) - { - // need to put this type of hard space (not \xA0) to hold the newline position - if (preBlanksLines > 0) - { - jstr = "\\~\n" + jstr; - LinesToGo--; - } - if (numBlanksEnd > 0) - { - jstr += "\n\\~"; - LinesToGo--; - } - } - this[cr.r1, cr.c1] = jstr; - } - } - - #endregion //Import / Export Grid - - #region Bug Work Around - protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) - { - - // Note: this fixes a bug that happens when the grid has more rows than columns - // notified ComponentOne of the problem 6/25/09 via Email - try - { - base.OnMouseDown(e); - } - catch (Exception ex) - { - while (ex != null) - { - Console.WriteLine("{0} {1} {2}", ex.GetType().Name, ex.Message, ex.StackTrace); - ex = ex.InnerException; - } - } - - } - #endregion //Bug Work Around - - //public void CenterTheCellText() - //{ - // // Cannot use this type of text allignment with RTF text cells - // CellRange cr = this.Selection; - // for (int rw = cr.r1; rw <= cr.r2; rw++) - // for (int col = cr.c1; col <= cr.c2; col++) - // { - // CellRange tmp = this.GetCellRange(rw, col, rw, col); - // string StyleName = string.Format("R{0}C{1}Style", rw, col); - // CellStyle cs = this.Styles.Add(StyleName, tmp.Style); - // cs.TextAlign = TextAlignEnum.CenterCenter; - // tmp.Style = cs; - // } - - //} - #region Uneven Selections - /// - /// True if the top and bottom row of the selection is the same for every column - /// - public bool EvenSelection - { - get - { - if (Selection.c1 < 0 || Selection.c2 < 0 || Selection.r1 < 0 || Selection.r2 < 0) return true; // Even if there is no selection - if (Selection.IsSingleCell) return true; // One cell by definition is Even - int cMin = MinimumColumn(Selection.r1, Selection.c1); // Get the left column of the top row - int cMax = MaximumColumn(Selection.r1, Selection.c2); // Get the right column of the top row - for (int r = Selection.r1 + 1; r <= Selection.r2; r++) - { - // Uneven if the top row in this column doesn't match the first column - if (MinimumColumn(r, Selection.c1) != cMin) - return false; - // Uneven if the bottom row in this column doesn't match the first column - if (MaximumColumn(r, Selection.c2) != cMax) - return false; - } - int rMin = MinimumRow(Selection.r1, Selection.c1); // Get the top row of the left column - int rMax = MaximumRow(Selection.r2, Selection.c1); // Get the bottom row of the left column - for (int c = Selection.c1 + 1; c <= Selection.c2; c++) - { - // Uneven if the top row in this column doesn't match the first column - if (MinimumRow(Selection.r1, c) != rMin) - return false; - // Uneven if the bottom row in this column doesn't match the first column - if (MaximumRow(Selection.r2, c) != rMax) - return false; - } - return true; - } - } - public void MakeSelectionEven() - { - if (Selection.IsSingleCell) return; // One cell by definition is Even - MakeSelectionEven(Selection.r1, Selection.c1, Selection.r2, Selection.c2); - } - public void SelectRow() - { - MakeSelectionEven(Selection.r1, 0, Selection.r2, Cols.Count - 1); - } - public void SelectCol() - { - MakeSelectionEven(0, Selection.c1, Rows.Count - 1, Selection.c2); - } - public void MakeSelectionEven(int r1,int c1, int r2, int c2) - { - if (c1 < 0 || c2 < 0 || r1 < 0 || r2 < 0) return; // if there is no selection don't bother - CellRange cr = GetEvenSelection(r1, c1, r2, c2); - Select(cr); - } - - public CellRange GetEvenSelection() - { - return GetEvenSelection(Selection.r1, Selection.c1, Selection.r2, Selection.c2); - } - - public CellRange GetEvenSelection(int r1, int c1, int r2, int c2) - { - int cMinNew = MinimumColumn(r1, c1); // Get the left column of the top row - int cMaxNew = MaximumColumn(r1, c2); // Get the right column of the top row - int rMinNew = MinimumRow(r1, c1); // Get the top row of the left column - int rMaxNew = MaximumRow(r2, c1); // Get the bottom row of the left column - int cMin = cMinNew; - int cMax = cMaxNew; - int rMin = rMinNew; - int rMax = rMaxNew; - do - { - cMin = cMinNew; - cMax = cMaxNew; - rMin = rMinNew; - rMax = rMaxNew; - for (int r = rMin; r <= rMax; r++) - { - // Uneven if the top row in this column doesn't match the first column - int myMin = MinimumColumn(r, cMin); - if (myMin < cMinNew) - cMinNew = myMin; - // Uneven if the bottom row in this column doesn't match the first column - int myMax = MaximumColumn(r, cMax); - if (myMax > cMaxNew) - cMaxNew = myMax; - } - for (int c = cMinNew; c <= cMaxNew; c++) - { - // if the top row in this column is less than the minimum save it - int myMin = MinimumRow(rMin, c); - if (myMin < rMinNew) - rMinNew = myMin; - // Uneven if the bottom row in this column doesn't match the first column - int myMax = MaximumRow(rMax, c); - if (myMax > rMax) - rMaxNew = myMax; - } - } - while (cMinNew < cMin || cMaxNew > cMax || rMinNew < rMin || rMaxNew > rMax); - CellRange cr = GetCellRange(rMinNew, cMinNew, rMaxNew, cMaxNew); - return cr; - } - private int MinimumColumn(int r, int c) - { - return GetMergedRange(r, c).c1; - } - private int MaximumColumn(int r, int c) - { - return GetMergedRange(r, c).c2; - } - private int MinimumRow(int r, int c) - { - return GetMergedRange(r, c).r1; - } - private int MaximumRow(int r, int c) - { - return GetMergedRange(r, c).r2; - } - public Color StyleBackColor - { - get {return Styles.Normal.BackColor;} - set - { - Styles.Normal.BackColor = value; - Styles.Alternate.BackColor = value; - for (int c = 0; c < Cols.Count; c++) - for (int r = 0; r < Rows.Count; r++) - { - CellRange cr = GetMergedRange(r, c); - if (cr.Style != null && cr.Style.BackColor != value && cr.Style.Name != "Fixed") - { - cr.Style.BackColor = value; - //Console.WriteLine("{0}, {1}, {2}, {3}", r, c, cr.Style.Name, cr.Style.BackColor); - } - } - } - } - /// - /// Returns a list of cells or merged cells within the selection - /// - public List MySelection - { - get - { - List ranges = new List(); - for (int c = Selection.c1; c <= Selection.c2; c++) - for (int r = Selection.r1; r <= Selection.r2; r++) - { - CellRange cr = GetMergedRange(r, c); - if (!ranges.Contains(cr)) - ranges.Add(cr); - } - //} - return ranges; - } - } - /// - /// This is a test to see if MySelection works. - /// - public void BoldMySelection() - { - foreach (CellRange cr in MySelection) - { - using (StepRTB rtb = new StepRTB()) - { - rtb.Rtf = GetCellRTFString(cr.r1, cr.c1); - rtb.SelectAll(); - rtb.SelectionFont = new Font(rtb.SelectionFont, FontStyle.Bold); - this[cr.r1, cr.c1] = rtb.Rtf; - } - } - } - - public void ShowMySelection() - { - int r1 = MySelection[0].r1; - int r2 = MySelection[0].r2; - int c1 = MySelection[0].c1; - int c2 = MySelection[0].c2; - foreach (CellRange cr in MySelection) - { - r1 = Math.Min(r1, cr.r1); - c1 = Math.Min(c1, cr.c1); - r2 = Math.Max(r2, cr.r2); - c2 = Math.Max(c2, cr.c2); - } - Select(r1,c1,r2,c2); - } - - public void Debug_WritelineMySelection() - { - int r1 = MySelection[0].r1; - int r2 = MySelection[0].r2; - int c1 = MySelection[0].c1; - int c2 = MySelection[0].c2; - Console.WriteLine("Initial MySelection[0] {0}", MySelection[0]); - foreach (CellRange cr in MySelection) - { - r1 = Math.Min(r1, cr.r1); - c1 = Math.Min(c1, cr.c1); - r2 = Math.Max(r2, cr.r2); - c2 = Math.Max(c2, cr.c2); - Console.WriteLine("Foreach range ({0},{1}) - ({2},{3})", r1, c1, r2, c2); - } - } - - #endregion - } - /// - /// This is used for storing the grid selection for copy/past Row/Column - /// - public enum GridCopyOption { Row, Column, Selection }; - - #region RTF Class for Cell rendering - /// - /// RTF Should only be used if the contents of the richtextbox are to be converted to an image. - /// - class RTF : StepRTB - { - // messages used by RichEd20.dll - internal const int - WM_USER = 0x0400, - EM_FORMATRANGE = WM_USER + 57; - - // FORMATRANGE is used by RichEd20.dll to render RTF - internal struct FORMATRANGE - { - internal IntPtr hdc, hdcTarget; - internal Rectangle rc, rcPage; - internal int cpMin, cpMax; - } - - // render the control directly into a given Graphics object - // (this does not honor clipping set in the target Graphics object; it that is - // a problem, use the RenderClipped method instead). - public void Render(Graphics g, Rectangle rc) - { - // convert rect from pixels to twips - rc.X = (int)(rc.X * 1440 / g.DpiX); - rc.Y = (int)(rc.Y * 1440 / g.DpiY); - rc.Width = rc.X + (int)((rc.Width) * 1440 / g.DpiX); - rc.Height = rc.Y + (int)((rc.Height) * 1440 / g.DpiY); - - // get dc - IntPtr hdc = g.GetHdc(); - - // set up FORMATRANGE struct - FORMATRANGE fmt = new FORMATRANGE(); - fmt.hdc = fmt.hdcTarget = hdc; - fmt.rc = fmt.rcPage = rc; - fmt.cpMin = 0; - fmt.cpMax = -1; - - // render RTF - int render = 1; - SendMessageFormatRange(Handle, EM_FORMATRANGE, render, ref fmt); - - // clean up - SendMessage(Handle, EM_FORMATRANGE, render, 0); - - // done with dc - g.ReleaseHdc(hdc); - } - - // render RTF into a Graphics object using a temporary bitmap to ensure - // clipping works correctly. - public void RenderClipped(Graphics g, Rectangle rc) - { - // create temp bitmap - Rectangle rcSrc = new Rectangle(0, 0, rc.Width, rc.Height); - using (Bitmap bmp = new Bitmap(rc.Width, rc.Height)) - { - // render RTF into bitmap - using (Graphics gBmp = Graphics.FromImage(bmp)) - { - Render(gBmp, rcSrc); - // transfer bitmap to original Graphics object - // (this honors clipping set in the target Graphics object) - g.DrawImage(bmp, rc, rcSrc, GraphicsUnit.Pixel); - } - } - } - - // SendMessage - [DllImport("USER32.DLL", CharSet = CharSet.Auto)] - static private extern int SendMessage( - IntPtr hWnd, - uint wMsg, - int wParam, - int lParam); - [DllImport("USER32.DLL", CharSet = CharSet.Auto, EntryPoint = "SendMessage")] - static private extern int SendMessageFormatRange( - IntPtr hWnd, - uint wMsg, - int wParam, - ref FORMATRANGE lParam); - } - - #endregion //RTF Class for Cell rendering - # region TableCellInfo for text parse - class TableCellInfo - { - private bool _MergeRowBellow; - - public bool MergeRowBellow - { - get { return _MergeRowBellow; } - set { _MergeRowBellow = value; } - } - private bool _MergeColRight; - - public bool MergeColRight - { - get { return _MergeColRight; } - set { _MergeColRight = value; } - } - private bool _ColEnd; - - public bool ColEnd - { - get { return _ColEnd; } - set { _ColEnd = value; } - } - private string _Text; - - public string Text - { - get { return _Text; } - set { _Text = value; } - } - } - #endregion //TableCellInfo for text parse - #region TableCellEditor - /// - /// TableCellEditor inherits from a StepRTB and is used as a custom cell editor - /// for the C1FlexGrid control. - /// - public class TableCellEditor : StepRTB //System.Windows.Forms.RichTextBox //System.Windows.Forms.TextBox // System.Windows.Forms.ComboBox - { - private VlnFlexGrid _owner; - private int _row, _col; - private char _pendingKey; - private bool _cancel; - public bool _initializingEdit; - - // constructor: attach to owner grid - public TableCellEditor(VlnFlexGrid owner) - { - Visible = false; - AutoSize = false; - BackColor = Color.SkyBlue; - BorderStyle = BorderStyle.None; - ScrollBars = RichTextBoxScrollBars.None; - _initializingEdit = false; - _pendingKey = (char)0; - _cancel = false; - _owner = owner; - _owner.Controls.Add(this); - this.CursorMovement += new StepRTBCursorMovementEvent(TableCellEditor_CursorMovement); - this.CursorKeyPress += new StepRTBCursorKeysEvent(TableCellEditor_CursorKeyPress); - this.Leave += new EventHandler(_editor_Leave); - //this.HeightChanged += new StepRTBEvent(_HeightChanged); - } - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - } - // start editing: move to cell and activate - public void StartEditing(int row, int col) - { - _initializingEdit = true; - ReadOnly = IsRoTable; - // save coordinates of cell being edited - _row = row; - _col = col; - //this.Clear(); //jsj - // assume we'll save the edits - _cancel = false; - // move editor over the current cell - Rectangle rc = _owner.GetCellRect(row, col, true); - rc.Width--; - rc.Height--; - Bounds = rc; - // initialize control content - Text = ""; - FindAllLinks(); // jsj 1-5-2011 - if (_pendingKey > ' ' && !ReadOnly) - Text = _pendingKey.ToString(); - else if (_owner[row, col] != null) - { - string tmp = _owner[row, col].ToString(); - if (tmp.StartsWith(@"{\rtf")) - Rtf = tmp.Replace(@"\~",@"\u160?"); - else - Text = tmp; - } - Select(Text.Length, 0); - - Size sz = new Size(rc.Width, rc.Height); - - //this.Size = sz; - this.Width = rc.Width; - - // make editor visible - Visible = true; - - // and get the focus - //Select(); - Focus(); - _initializingEdit = false; - } - - void TableCellEditor_CursorKeyPress(object sender, KeyEventArgs args) - { - //throw new Exception("The method or operation is not implemented."); - } - - void TableCellEditor_CursorMovement(object sender, StepRTBCursorMovementEventArgs args) - { - int row = _owner.Selection.r1; - int col = _owner.Selection.c1; - CellRange cr = _owner.GetMergedRange(row, col); - //Console.WriteLine("keystroke {0} selection {1},{2}", args.Key, row, col); - //vlnStackTrace.ShowStack("keystroke {0} selection {1},{2}", args.Key, row, col); - _owner.Select(); - // See if we are in a merged range of cells. - // if so, use the merged range instead of the selected range - // so that we can jump to the top/bottom/left/right of the range - // before attempting the move to the next grid cell. - //int idx = _owner.MergedRanges.IndexOf(row, col); - //if (idx > -1) cr = _owner.MergedRanges[idx]; - - switch (args.Key) - { - case VEPROMS.CSLA.Library.E_ArrowKeys.CtrlDown: - case VEPROMS.CSLA.Library.E_ArrowKeys.Down: - row = cr.r2; - if (row < _owner.Rows.Count - 1) - _owner.Select(_owner.GetMergedRange(row + 1, col)); - else - _owner.OnCursorMovement(this, new VlnFlexGridCursorMovementEventArgs(args.Key)); - break; - case VEPROMS.CSLA.Library.E_ArrowKeys.CtrlLeft: - case VEPROMS.CSLA.Library.E_ArrowKeys.Left: - col = cr.c1; - if (col > 0) - _owner.Select(_owner.GetMergedRange(row, col - 1)); - else if(row > 0) - _owner.Select(_owner.GetMergedRange(row - 1, _owner.Cols.Count - 1)); - else - _owner.OnCursorMovement(this, new VlnFlexGridCursorMovementEventArgs(args.Key)); - break; - case VEPROMS.CSLA.Library.E_ArrowKeys.CtrlRight: - case VEPROMS.CSLA.Library.E_ArrowKeys.Right: - col = cr.c2; - if (col < _owner.Cols.Count - 1) - _owner.Select(_owner.GetMergedRange(row, col + 1)); - else if (cr.r2 < _owner.Rows.Count - 1) - { - CellRange crDest = _owner.GetMergedRange(cr.r2 + 1, 0); - if (cr.r2 < crDest.r1) // It will move to the correct place - _owner.Select(crDest); - else if (crDest.r2 < _owner.Rows.Count) - _owner.Select(_owner.GetMergedRange(crDest.r2 + 1, 0)); - else - _owner.OnCursorMovement(this, new VlnFlexGridCursorMovementEventArgs(args.Key)); - } - else - _owner.OnCursorMovement(this, new VlnFlexGridCursorMovementEventArgs(args.Key)); - break; - case VEPROMS.CSLA.Library.E_ArrowKeys.CtrlUp: - case VEPROMS.CSLA.Library.E_ArrowKeys.Up: - row = cr.r1; - if (row > 0) - _owner.Select(_owner.GetMergedRange(row - 1, col)); - else - _owner.OnCursorMovement(this, new VlnFlexGridCursorMovementEventArgs(args.Key)); - break; - default: - break; - } - //Console.WriteLine("selection {0}", _owner.Selection); - //_owner.Focus(); // focus was jumping out of the grid this keeps it in. - } - - // after edit handler (custom editor) - void _editor_Leave(object sender, EventArgs e) - { - _owner.Invalidate(); - _owner.AdjustGridControlSize(); - } - //void _HeightChanged(object sender, EventArgs args) - //{ - // _owner.Invalidate(); - //} - - // save key that started the editing mode - public void SetPendingKey(char chr) - { - _pendingKey = chr; - } - - // expose internal variables - public bool Cancel { get { return _cancel; } } - public int Row { get { return _row; } } - public int Col { get { return _col; } } - - // move editor after the grid has scrolled - public void UpdatePosition() - { - // get cell rect now - Rectangle rcCell = _owner.GetCellRect(_row, _col, false); - - // intersect with scrollable part of the grid - Rectangle rcScroll = _owner.ClientRectangle; - rcScroll.X = _owner.Cols[_owner.Cols.Fixed].Left; - rcScroll.Y = _owner.Rows[_owner.Rows.Fixed].Top; - rcScroll.Width -= rcScroll.X; - rcScroll.Height -= rcScroll.Y; - rcCell = Rectangle.Intersect(rcCell, rcScroll); - - // and move the control - if (rcCell.Width > 0) rcCell.Width--; - if (rcCell.Height > 0) rcCell.Height--; - Bounds = rcCell; - - Size sz = new Size(_owner.GetCellRect(_row, _col).Width, _owner.GetCellRect(_row, _col).Height); - this.Size = sz; - } - - // lost focus: hide the editor - override protected void OnLeave(System.EventArgs e) - { - // base processing - base.OnLeave(e); - - // copy text to owner grid - if (!_cancel) - { - _owner[_row, _col] = Rtf; //Text; - } - // no more pending keys - _pendingKey = (char)0; - - // done for now, hide editor - Visible = false; - } - - // we will handle the Tab key ourselves - override protected bool IsInputKey(Keys keyData) - { - if (keyData == Keys.Tab) return true; - return base.IsInputKey(keyData); - } - - //// some keys end the editing - //override protected void OnKeyDown(System.Windows.Forms.KeyEventArgs e) - //{ - // switch (e.KeyCode) - // { - // case Keys.Escape: // cancel edits - // _cancel = true; - // _owner.Select(); - // e.Handled = true; - // return; - - // case Keys.Enter: // finish editing - // case Keys.Tab: - // case Keys.Up: - // case Keys.Down: - // case Keys.PageUp: - // case Keys.PageDown: - // _owner.Select(); - // e.Handled = true; - // MoveCursor(e.KeyCode); - // return; - - // default: // default processing - // base.OnKeyDown(e); - // return; - // } - //} - - //// move cursor after done editing - //protected void MoveCursor(Keys key) - //{ - // int row = _owner.Row; - // int col = _owner.Col; - // switch (key) - // { - // case Keys.Tab: col++; break; - // case Keys.Up: row--; break; - // //case Keys.Return: row++; break; - // case Keys.Down: row++; break; - // //case Keys.PageUp: row -= 10; break; - // //case Keys.PageDown: row += 10; break; - // } - - // // validate new selection - // if (row < _owner.Rows.Fixed) row = _owner.Rows.Fixed; - // if (col < _owner.Cols.Fixed) col = _owner.Cols.Fixed; - // if (row > _owner.Rows.Count - 1) row = _owner.Rows.Count - 1; - // if (col > _owner.Cols.Count - 1) col = _owner.Cols.Count - 1; - - // // apply new selection - // _owner.Select(row, col); - //} - - //// suppress some keys to avoid annoying beep - //override protected void OnKeyPress(System.Windows.Forms.KeyPressEventArgs e) - //{ - // switch (e.KeyChar) - // { - // case (char)27: // Keys.Escape: - // case (char)13: // Keys.Enter: - // case (char)9: // Keys.Tab: - // e.Handled = true; - // return; - // } - // base.OnKeyPress(e); - //} - } - #endregion // TableCellEditor - #region TableClipBoardFuncts Class - class TableClipBoardFuncts - { - DataFormats.Format dfmtTableCellRange = DataFormats.GetFormat("TableCellRange"); - private SelectedTableCells mySeldTableCellsObject; - private DataObject myDataObject; - public TableClipBoardFuncts() - { - //mySeldTableCellsObject = new DataObject(dfmtTableCellRange.Name, seldTableCells); - } - - public void Put(CellRange cr) - { - // Copies myObject into the clipboard. - // Clip get the value (text) of all the cells in the selected range - // This is saved as one RTF string. - Clipboard.SetDataObject(cr.Clip, true); // the "true" make the copy persistent - //Console.WriteLine("\nClip: '{0}' \n'{1}'", cr.Clip,cr.DataDisplay); - //mySeldTableCellsObject = new SelectedTableCells(); - //mySeldTableCellsObject.CpbrdCellRange = cr; - // myDataObject = new DataObject(dfmtTableCellRange.Name, mySeldTableCellsObject); - // try - // { - // Clipboard.SetDataObject(myDataObject); //,true); - // } - // catch (Exception ex) - // { - // Console.WriteLine(ex.Message); - // } - - } - - public ArrayList Get() - { - // Retrieves the data from the clipboard. - IDataObject myRetrievedObject = Clipboard.GetDataObject(); - string jj = (string)myRetrievedObject.GetData(DataFormats.Text); - return GetCellStrings(jj); - } - - //public CellRange get_cr_Paste() - //{ - // mySeldTableCellsObject = new SelectedTableCells(); - // CellRange cr = new CellRange(); - // SelectedTableCells sc; - // IDataObject myRetrievedObject = Clipboard.GetDataObject(); - // try - // { - // //object obj = myRetrievedObject.GetData(dfmtTableCellRange.Name); - // object obj = myRetrievedObject.GetData("TableCellRange"); - // //sc = (SelectedTableCells)myRetrievedObject.GetData(dfmtTableCellRange.Name); - // sc = (SelectedTableCells)obj; - // cr = sc.CpbrdCellRange; - // } - // catch (Exception ex) - // { - // Console.WriteLine(ex.Message); - // } - // return cr; - //} - - private ArrayList GetCellStrings(string instr) - { - // The table cells placed on the clipboard is saved as one long RTF string. - // "\r\n\t" defines a cell border - // "\r\n\r" defines beginning of next line (row) - // This function will separate each cell text and place them in an array. - // This allow the clipboard information to be pasted independently from - // how it was selected. - - // Bug fix: the CellRange.Clip (see cr.clip in the Put() function above) is replacing - // new lines with spaces. We need to put them back. - instr = instr.Replace(@"}} \", "}}\r\n\\"); - string tstr = ""; // this will contain the parsed out cell text - ArrayList arylstCellStrings = new ArrayList(); - int sidx = 0; // start index - int tidx = 0; - if (instr != null) - { - int idx = instr.IndexOf(@"{\rtf",sidx+1); // cell boarder - while (idx > 0) - { - tstr = instr.Substring(sidx, idx - sidx); - tstr = tstr.Substring(0, tstr.LastIndexOf('}') + 1); - //Console.WriteLine("\ntstr: '{0}'", tstr); - arylstCellStrings.Add(tstr); - sidx = idx; - idx = instr.IndexOf(@"{\rtf",sidx+1); - } - if (sidx < instr.Length) - { - tstr = instr.Substring(sidx); - arylstCellStrings.Add(tstr); - } - } - return arylstCellStrings; - } - - //private ArrayList GetCellStrings(string instr) - //{ - // // The table cells placed on the clipboard is saved as one long RTF string. - // // "\r\n\t" defines a cell border - // // "\r\n\r" defines beginning of next line (row) - // // This function will separate each cell text and place them in an array. - // // This allow the clipboard information to be pasted independently from - // // how it was selected. - - // string tstr = ""; // this will contain the parsed out cell text - // ArrayList arylstCellStrings = new ArrayList(); - // int sidx = 0; // start index - // int tidx = 0; - // if (instr != null) - // { - // int idx = instr.IndexOf("\r\n\t"); // cell boarder - // if (idx < 0) idx = instr.IndexOf("\r\n\r"); // new line (needed for multiple lines in one cell) - // while (idx > 0) - // { - // tstr = instr.Substring(sidx, idx - sidx); - // tidx = tstr.IndexOf("\r\n\r"); - // if (tidx > 0) - // { - // idx = instr.IndexOf("\r\n\r", sidx); - // tstr = instr.Substring(sidx, idx - sidx); - // } - // arylstCellStrings.Add(tstr.Substring(tstr.IndexOf("{\\rtf"))); - // sidx = idx + 3; - // if (sidx < instr.Length) - // { - // idx = instr.IndexOf("\r\n\t", sidx); - // if (idx < 0) idx = instr.IndexOf("\r\n\r", sidx); - // } - // } - // if (sidx < instr.Length) - // { - // tstr = instr.Substring(sidx); - // arylstCellStrings.Add(tstr.Substring(tstr.IndexOf("{\\rtf"))); - // } - // } - // return arylstCellStrings; - //} - } - - [Serializable] - public class SelectedTableCells : Object - { - private CellRange _cpbrdCellRange; - - public CellRange CpbrdCellRange - { - get { return _cpbrdCellRange; } - set { _cpbrdCellRange = value; } - } - public SelectedTableCells() - { - } - } - #endregion // TableClipBoardFuncts Class - public class VlnFlexGridCursorMovementEventArgs - { - private E_ArrowKeys _Key; - public E_ArrowKeys Key - { - get { return _Key; } - set { _Key = value; } - } - public VlnFlexGridCursorMovementEventArgs(E_ArrowKeys key) - { - _Key = key; - } - } - public class VlnFlexGridPasteEventArgs - { - private string _Text; - public string Text - { - get { return _Text; } - set { _Text = value; } - } - public VlnFlexGridPasteEventArgs(string text) - { - _Text = text; - } - } - public class GridCopyInfo - { - private GridCopyOption _MyCopyOption = GridCopyOption.Selection; - - public GridCopyOption MyCopyOption - { - get { return _MyCopyOption; } - set - { - //Console.WriteLine("MyCopyOption = {0}", _MyCopyOption); - //if (_MyCopyOption != value) - // Console.WriteLine("Changed Option to {0}", value); - _MyCopyOption = value; - } - } - private VlnFlexGrid _MyCopiedFlexGrid = null; - - public VlnFlexGrid MyCopiedFlexGrid - { - get { return _MyCopiedFlexGrid; } - set { _MyCopiedFlexGrid = value; } - } - private CellRange _MyCopiedCellRange; - - public CellRange MyCopiedCellRange - { - get { return _MyCopiedCellRange; } - set { _MyCopiedCellRange = value; } - } - - } -} diff --git a/PROMS/PROMS/Volian.Print.Library/Grid2Pdf.cs b/PROMS/PROMS/Volian.Print.Library/Grid2Pdf.cs deleted file mode 100644 index 112326d5..00000000 --- a/PROMS/PROMS/Volian.Print.Library/Grid2Pdf.cs +++ /dev/null @@ -1,1536 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using C1.Win.C1FlexGrid; -using System.IO; -using Itenso.Rtf; -using Itenso.Rtf.Parser; -using Itenso.Rtf.Interpreter; -using Itenso.Rtf.Support; -using Volian.Print.Library; -using Volian.Controls.Library; -using iTextSharp.text; -using iTextSharp.text.pdf; -using VEPROMS.CSLA.Library; -using System.Text.RegularExpressions; - -namespace Volian.Print.Library -{ - #region Settings // RHM20150429 - Table Scrunch - public partial class vlnTable - { - private string _DebugInfo = null; // RHM20150429 - Table Scrunch - public string DebugInfo - { - get { return _DebugInfo; } - set { _DebugInfo = value; } - } - private int _ItemID = 0; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - private bool _ShowDetails = false; - public bool ShowDetails - { - get { return _ShowDetails; } - set { _ShowDetails = value; } - } - private bool _IsTooBig = false; - public bool IsTooBig - { - get { return _IsTooBig; } - set { _IsTooBig = value; } - } - } - public partial class vlnCells - { - private static float YAdjust_HContent = 4; // 4 - private float YAdjust_SpacingAfter - { - get - { - return 8-8*MyTable.Adjustment;//0; // 8 - } - } - } - public partial class vlnCell - { - public bool ShowDetails - { get { return MyTable.ShowDetails; } } - private static float YAdjust_h = 0; // 0 - private float YAdjust_TextLocation - { - get - { - return 4 - 4 * MyTable.Adjustment; ;//0; // 4 - } - } - } - //public partial class vlnTable - //{ - // private static float YAdjust_RowTop = 0;//8; // 0 - //} - //public partial class vlnCells - //{ - // private static float YAdjust_HContent = 4; // 4 - // private static float YAdjust_SpacingAfter = 8;//0; // 8 - //} - //public partial class vlnCell - //{ - // private static float YAdjust_h = 0; // 0 - // private static float YAdjust_TextLocation = 4;//0; // 4 - //} - #endregion - public partial class vlnTable - { - #region Properties - private float[] _HContents;// RHM20150525 - Table Scrunch - public float[] HContents - { - get { return _HContents; } - set { _HContents = value; } - } - private float[] _RowTop; - public float[] RowTop - { - get { return _RowTop; } - set { _RowTop = value; } - } - private float[] _ColLeft; - public float[] ColLeft - { - get { return _ColLeft; } - set { _ColLeft = value; } - } - private VlnFlexGrid _MyFlexGrid; - public VlnFlexGrid MyFlexGrid - { - get { return _MyFlexGrid; } - set { _MyFlexGrid = value; } - } - private VlnBorders _MyBorders; - public VlnBorders MyBorders - { - get { return _MyBorders; } - set { _MyBorders = value; } - } - private iTextSharp.text.pdf.PdfContentByte _MyContentByte; - public iTextSharp.text.pdf.PdfContentByte MyContentByte - { - get { return _MyContentByte; } - set { _MyContentByte = value; } - } - private vlnCells _MyCells; - public vlnCells MyCells - { - get { return _MyCells; } - set { _MyCells = value; } - } - public float Height - { get - { - return RowTop[RowTop.Length - 1]; - } } - public float Width - { get - { - return ColLeft[ColLeft.Length - 1]; - } } - - private static float _XOffset = -1; // This moves the borders with respect to the text - public static float XOffset - { - get { return vlnTable._XOffset; } - set { vlnTable._XOffset = value; } - } - private static float _YOffset = 0; // This moves the borders with respect to the text - public static float YOffset - { - get { return vlnTable._YOffset; } - set { vlnTable._YOffset = value; } - } - private static float _LineThicknessForThin = .9F; - public static float LineThicknessForThin - { - get { return vlnTable._LineThicknessForThin; } - set { vlnTable._LineThicknessForThin = value; } - } - private static float _LineThicknessForThick = 1.8F; - public static float LineThicknessForThick - { - get { return vlnTable._LineThicknessForThick; } - set { vlnTable._LineThicknessForThick = value; } - } - private static float _LineThicknessForDouble = .6F; - public static float LineThicknessForDouble - { - get { return vlnTable._LineThicknessForDouble; } - set { vlnTable._LineThicknessForDouble = value; } - } - public static float DoubleLineOffset - { - get { return (LineThicknessForThick - LineThicknessForDouble) / 2; }//LineThicknessForThick - 2 * LineThicknessForDouble; } - } - private float _TotalContentHeight = 0;// RHM20150525 - Table Scrunc - public float TotalContentHeight - { - get - { - if (_TotalContentHeight == 0) - { - foreach (float h in HContents) - _TotalContentHeight += h; - } - return _TotalContentHeight; - } - } - public float SpaceAvailable// RHM20150525 - Table Scrunc - { - get { return TotalContentHeight ==0 ? 0 : RowTop[RowTop.Length - 1] - TotalContentHeight; } - } - private float _TooBig;// RHM20150525 - Table Scrunc - public float TooBig - { - get { return _TooBig; } - set - { - _TooBig = value; - //_Adjustment = Math.Min(1F, (_TooBig / (RowTop.Length - 1)) / 12); - //if (ShowDetails) Console.WriteLine("TooBig\t{0}\t{1}", value, _Adjustment); - //if(ShowDetails) Console.WriteLine("Before RowTop={0}", RowTop[RowTop.Length-1] ); - float extra=(TooBig < SpaceAvailable)?(SpaceAvailable - TooBig) / HContents.Length:0; - for (int r = 0; r < RowTop.Length - 1; r++) - RowTop[r + 1] = RowTop[r] + HContents[r] + extra; - //if(ShowDetails) Console.WriteLine("After RowTop={0}", RowTop[RowTop.Length-1] ); - } - } - private float _Adjustment = 0;// RHM20150525 - Table Scrunc - public float Adjustment - { - get { return _Adjustment; } - set { _Adjustment = value; } - } - //private float _YAdjust_RowTop = 0;//8; // 0 - public float YAdjust_RowTop - { - get - { - return _Adjustment * 12; - } - } - private void DrawRuler(PdfContentByte cb, float x, float yTop, float height)// RHM20150525 - Table Scrunc - { - VlnSvgPageHelper myPageHelper = cb.PdfWriter.PageEvent as VlnSvgPageHelper; - if (myPageHelper.DebugLayer != null) - { - cb.BeginLayer(myPageHelper.DebugLayer); - cb.SaveState(); - cb.SetLineWidth(.1F); - cb.SetColorStroke(new Color(System.Drawing.Color.Orange)); - float yBottom = yTop - height; - cb.MoveTo(x, yTop); - cb.LineTo(x, yBottom); - int i = 0; - for (float y = yTop; y >= yBottom; y -= 10) - { - float w = 10; - if (i % 10 == 0) w = 30; - else if (i % 5 == 0) w = 20; - cb.SetLineWidth(w / 30); - i++; - cb.MoveTo(x + w, y); - cb.LineTo(x, y); - cb.Stroke(); - } - i = 0; - cb.Stroke(); - cb.RestoreState(); - cb.EndLayer(); - } - } - private void ShowRowTops(string location)// RHM20150525 - Table Scrunc - { - if (!ShowDetails) return; - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < RowTop.Length; i++) - sb.Append("\t" + RowTop[i].ToString()); - Console.WriteLine(location + "\t" + sb.ToString()); - } - private void EndSetup()// RHM20150525 - Table Scrunc - { - if (ShowDetails) ShowRowTops("vlnTable.ctor.2"); - if (ShowDetails) Console.WriteLine("^^^^^^vlnTable============{0}===============", ItemID); - } - private void SetupDebug(VlnFlexGrid myFlexGrid)// RHM20150525 - Table Scrunc - { - //ShowDetails = myFlexGrid.GetMyItemInfo().InList(38329); - //if(ShowDetails) Console.WriteLine("vvvvvvlnTable============{0}===============", ItemID); - ItemInfo myItemInfo = myFlexGrid.GetMyItemInfo(); - ItemID = myItemInfo.ItemID; - DebugInfo = string.Format("DebugID = {0}, ID={1} Type={2} TypeName='{3}' StepLevel={4} ShortPath={5} Width={6} Left={7} YOffset={8}", - 0, myItemInfo.ItemID, myItemInfo.FormatStepType, myItemInfo.FormatStepData == null ? "NoStepData" : myItemInfo.FormatStepData.Type, - myItemInfo.StepLevel, myItemInfo.ShortPath, Width, XOffset, YOffset); - } - #endregion - #region Constructors - public vlnTable(VlnFlexGrid myFlexGrid, iTextSharp.text.pdf.PdfContentByte myContentByte) - { - MyFlexGrid = myFlexGrid; - MyContentByte = myContentByte; - InitializeSizes(); - SetupDebug(myFlexGrid);// RHM20150525 - Table Scrunc - MyCells = new vlnCells(this, MyFlexGrid, MyContentByte); - EndSetup();// RHM20150525 - Table Scrunc - } - #endregion - #region Private Methods - private void InitializeSizes() - { - RowTop = new float[MyFlexGrid.Rows.Count + 1]; - HContents = new float[MyFlexGrid.Rows.Count];// RHM20150525 - Table Scrunc - RowTop[0] = 0; - for (int r = 0; r < MyFlexGrid.Rows.Count; r++) - RowTop[r + 1] = RowTop[r] + 72 * (MyFlexGrid.Rows[r].Height == -1 - ? MyFlexGrid.Rows.DefaultSize : MyFlexGrid.Rows[r].Height) / (float)MyFlexGrid.DPI; - ColLeft = new float[MyFlexGrid.Cols.Count + 1]; - ColLeft[0] = 0; - for (int c = 0; c < MyFlexGrid.Cols.Count; c++) - ColLeft[c + 1] = 2 + ColLeft[c] + 72 * (MyFlexGrid.Cols[c].Width == -1 // RHM20150429 - Table Scrunch - ? MyFlexGrid.Cols.DefaultSize : MyFlexGrid.Cols[c].Width) / (float)MyFlexGrid.DPI; - } - #endregion - #region Public Methods - public void AdjustRowTop(int row1, int row2, float hNew) - { - float hAdjust = hNew - (RowTop[row2 + 1] - RowTop[row1]); - for (int r = row2; r < MyFlexGrid.Rows.Count; r++) - RowTop[r + 1] += hAdjust; - } - public void ToPdf(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top) - { - //ZoomGrid(myColumnText, left, top); - if(ShowDetails) Console.WriteLine("vvvvvvToPdf============{0}===============", ItemID);// RHM20150525 - Table Scrunc - ShowRowTops("ToPDF1"); - PdfContentByte cb = myColumnText.Canvas; // RHM20150429 - Table Scrunch - VlnSvgPageHelper myPageHelper = cb.PdfWriter.PageEvent as VlnSvgPageHelper; - string myLPI = myPageHelper.YMultiplier == 1.0F ? ",6LPI" : ",7LPI"; - Rtf2Pdf.DrawPdfDebug(myColumnText.Canvas, left-2, top+1, left + Width, top-myPageHelper.YMultiplier *(Height+1), - DebugInfo+", Height= " + (myPageHelper.YMultiplier * Height).ToString() + myLPI, 0); - PdfLayer textLayer = myPageHelper == null ? null : myPageHelper.TextLayer; // RHM20150429 - Table Scrunch - if (textLayer != null) cb.BeginLayer(textLayer); - myPageHelper.AddGap(top, top - Height, left, left + Width); - MyCells.ToPdf(myColumnText, left, top); - DrawRuler(myColumnText.Canvas, left + Width, top, myPageHelper.YMultiplier * (Height + 1)); // RHM20150429 - Table Scrunch - if (textLayer != null) cb.EndLayer(); - ShowRowTops("ToPDF2"); - if (ShowDetails) Console.WriteLine("^^^^^^ToPdf============{0}===============", ItemID); - } - private void ZoomGrid(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top) - { - PdfDestination dest = new PdfDestination(PdfDestination.FITR, left - 4, top - Height - 4, left + Width, top + 4); - myColumnText.Canvas.SetAction(PdfAction.GotoLocalPage(myColumnText.Canvas.PdfWriter.CurrentPageNumber, dest, myColumnText.Canvas.PdfWriter), left, top - Height, left + Width, top); - } - #endregion - } - public partial class vlnCells : List // RHM20150429 - Table Scrunch - { - #region Properties - private VlnFlexGrid _MyFlexGrid; - public VlnFlexGrid MyFlexGrid - { - get { return _MyFlexGrid; } - set { _MyFlexGrid = value; } - } - private vlnTable _MyTable; - public vlnTable MyTable - { - get { return _MyTable; } - set { _MyTable = value; } - } - public bool ShowDetails// RHM20150525 - Table Scrunc - { get { return MyTable.ShowDetails; }} - private iTextSharp.text.pdf.PdfContentByte _MyContentByte; - public iTextSharp.text.pdf.PdfContentByte MyContentByte - { - get { return _MyContentByte; } - set { _MyContentByte = value; } - } - #endregion - #region Constructors - public vlnCells(vlnTable myTable, VlnFlexGrid myFlexGrid, iTextSharp.text.pdf.PdfContentByte myContentByte) - { - MyTable = myTable; - MyFlexGrid = myFlexGrid; - MyContentByte = myContentByte; - SetupCells(); - foreach(vlnCell cell in this) - { - myTable.MyBorders = VlnBorders.Get(myFlexGrid.MyBorders.ConvertToString()); - GridLinePattern glp = cell.AboveLeftSide; - glp = cell.AboveRightSide; - glp = cell.BelowLeftSide; - glp = cell.BelowRightSide; - glp = cell.RightOfBottomSide; - glp = cell.RightOfTopSide; - object ta = cell.TextAlign; - } - } - #endregion - #region Private Methods - private void SetupCells() - { - // Create a ColumnText to determine the cell heights - iTextSharp.text.pdf.ColumnText myColumnText1 = new iTextSharp.text.pdf.ColumnText(MyContentByte); - // Walk through - for (int r = 0; r < MyFlexGrid.Rows.Count; r++) - { - float hMax = 12; // RHM20150429 - Table Scrunch - for (int c = 0; c < MyFlexGrid.Cols.Count; c++) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - float w = MyTable.ColLeft[cr.c2 + 1] - MyTable.ColLeft[cr.c1]; - float h = MyTable.RowTop[cr.r2 + 1] - MyTable.RowTop[cr.r1]; - string str = MyFlexGrid.GetCellRTFString(r, c) ?? string.Empty; - if (str.Contains(@"\cf")) - { - str = System.Text.RegularExpressions.Regex.Replace(str, @"\\cf[0-9]\\", @"\"); - str = System.Text.RegularExpressions.Regex.Replace(str, @"\\cf[0-9] ", @""); - } - // the FreeMono font is used for the editor, but VESymbFix is used for printing - // The font spefication is embeded in the table text so we need to change the font reference from - // FreeMono to VESymbFix before we print the table - if (str.ToUpper().Contains("FREEMONO")) - str = str.Replace("FreeMono", "VESymbFix"); - DisplayText dt = new DisplayText(MyFlexGrid.GetMyItemInfo(), str, false); - str = dt.StartText; - str = PreProcessRTF(w, str); - - // If the font is not proportional, pass the symbol font through to RtfToParagraph. It is needed - // in underlying code to set the chunk's font if the first character of a cell is a hardspace. Without - // this, pdfs were using the Helvetica font, which is a default itextsharp font. - ItemInfo ii = MyFlexGrid.GetMyItemInfo(); - iTextSharp.text.Font ff = null; - if (!ii.FormatStepData.Font.FontIsProportional()) - ff = Volian.Svg.Library.VolianPdf.GetFont("VESymbFix", (int)ii.FormatStepData.Font.Size, (int)ii.FormatStepData.Font.WindowsFont.Style); - iTextSharp.text.Paragraph myPara = RtfToParagraph(str, ff); - - myColumnText1.SetSimpleColumn(0, 0, w-2, MyContentByte.PdfDocument.PageSize.Top); // Padding = 4 - if (str.Contains(@"\'05")) - { - // if there is a hanging indent, the iTextSharp paragraph properties must be set - // to print the indent. Replace the indent 'token' with a non-used symbol, this will - // create a chunk with that symbol. Then loop through all of the chunks until we find - // this symbol, adding up the widths to that point. This width is the value that - // needs to be used to set the indent. - // Notes: - // A hard return will reset the chkW (indent width) back to zero. - // We jump out of the processing loop after the first indent token is found and ignor any other ones - float chkW = CalculateHangingIndent(str); - myPara.IndentationLeft = chkW; - myPara.FirstLineIndent = -chkW; - } - Match match = Regex.Match(str, @"\\fi([-0-9]*) ?\\li([0-9]*)"); - if (match.Success) - { - float fi = float.Parse(match.Groups[1].Value) / 20; // 72 is dots per inch & 96 is standard DPI (120 is KBR's machine) - float li = float.Parse(match.Groups[2].Value) / 20; - // if there is a hanging indent, the iTextSharp paragraph properties must be set - // to print the indent. - myPara.IndentationLeft = li; - myPara.FirstLineIndent = fi; - } - // RHM 20120925 - Line spacing should be 6 lines per inch. In order to get a valid value - // for TotalLeading you have to set MultipliedLeading first: - myPara.MultipliedLeading = 1.0f; - // once there is valid value for TotalLeading (from previous line), you can use it to - // calculate a MultipliedLeading to give 6 LPI (12 points) - myPara.MultipliedLeading = 12.0f / myPara.TotalLeading; - myPara.SpacingAfter = 8; // RHM 20120925 - Add a line to properly space text from lines. - if(Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase2)) // RHM20150429 - Table Scrunch - myPara.SpacingAfter = 0;// YAdjust_SpacingAfter; // RHM 20120925 - Add a line to properly space text from lines. - FixHyphens(myPara, MyTable); - if (Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase3)) - TrimNewlines(myPara); // RHM20150429 - Table Scrunch - myColumnText1.AddElement(myPara); - //myColumnText1.Canvas.SetColorFill(PrintOverride.OverrideTextColor(System.Drawing.Color.Black)); - float posBefore = myColumnText1.YLine; - int status = myColumnText1.Go(true); - float posAfter = myColumnText1.YLine; - float hContent = 4 + posBefore - posAfter; - if (Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase4))// RHM20150525 - Table Scrunc - { - hContent = 0 + posBefore - posAfter;//YAdjust_HContent + posBefore - posAfter; - // if (myPara.Chunks.Count > 0 && myPara.Chunks[myPara.Chunks.Count - 1] == "\n") - // hContent -= 12; - } - //if(ShowDetails) Console.WriteLine("{0}\t{1}\t{2}",r,c, hContent/12); - if (cr.r1 == cr.r2) - hMax = Math.Max(hMax, hContent); - else - hMax = Math.Max(hMax, hContent - (cr.r2 - cr.r1) * _SixLinesPerInch); - if (hContent > h) - { // RHM20150429 - Table Scrunch - //if (ShowDetails) Console.WriteLine("Less {0},{1},{2},{3},{4},{5}", r, c, posBefore, posAfter, hContent, hMax); - MyTable.AdjustRowTop(cr.r1, cr.r2, hContent); - } // RHM20150429 - Table Scrunch - if (Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase5)) - { - //if (ShowDetails) Console.WriteLine("Greater{0},{1},{2},{3},{4},{5}", r, c, posBefore, posAfter, hContent, hMax); - //if (c == MyFlexGrid.Cols.Count - 1) - //MyTable.AdjustRowTop(cr.r1, cr.r2, hMax + 6); - MyTable.HContents[cr.r2] = hMax+2; - } - Add(new vlnCell(cr.r1, cr.c1, cr.r2, cr.c2, MyTable, myPara,hContent)); - } - } - } - } - private void ShowChunks(System.Collections.ArrayList chunks) // RHM20150429 - Table Scrunch - { - StringBuilder sb = new StringBuilder(); - foreach (Chunk chk in chunks) - { - sb.Append(BuildChunks(chk.Content)); - } - //if (ShowDetails) Console.WriteLine("Chunks = '{0}'", sb.ToString()); - } - private string BuildChunks(string str) - { - StringBuilder sb = new StringBuilder(); - foreach(char c in str) - { - if (((int)c) < 0x20 || ((int)c) > 0x7F) - sb.Append(string.Format("<{0:X4}>",(int)c)); - else - sb.Append(c); - } - return "{" + sb.ToString() + "}"; - } - private void TrimNewlines(Paragraph myPara) - { - //while (myPara.Count > 0 && ParaEndsWithNewLine(myPara)) - // myPara.RemoveAt(myPara.Count - 1); - } - private bool ParaEndsWithNewLine(Paragraph myPara) - { - Chunk chk = myPara[myPara.Count - 1] as Chunk; - if (chk == null) return false; - if (chk.Content == "\n") return true; - return false; - } - public class VlnSplitCharacter : ISplitCharacter - { - public bool IsSplitCharacter(int start, int current, int end, char[] cc, PdfChunk[] ck) - { - return (cc[current] == ' '); - } - public bool IsSplitCharacter(char c) - { - return (c == ' '); - } - } - public static VlnSplitCharacter mySplitter = new VlnSplitCharacter(); - internal static void FixHyphens(Paragraph myPara, vlnTable myTable) - { - // Find chunk with hardhyphen - - // If a hard hyphen is found, the remove it and add a dash (keyboard minus sign) to the beginning - // of the text that follows it. - int hype=-1; - Font fnt = null; - while ((hype = GetHyphen(myPara)) > -1) - { - fnt = null; - if (hype > 0) - { - Chunk chk1 = (Chunk)myPara[hype - 1]; - if (hype > 1 && chk1.Content.Equals("\n")) - chk1 = (Chunk)myPara[hype - 2]; - fnt = chk1.Font; // use the font of the text that follows the hyphen (dash) - } - else if (hype < myPara.Count - 1) - { - Chunk chk2 = (Chunk)myPara[hype + 1]; - if (hype != 0 && !chk2.Content.Equals("\n")) - fnt = chk2.Font; // use the font of the text that follows the hyphen (dash) - } - if (fnt == null) - { - // if there was no text following the hypen, then use the font defined for tables in the plant's format - VEPROMS.CSLA.Library.VE_Font vfnt = myTable.MyFlexGrid.GetMyItemInfo().FormatStepData.Font; - System.Drawing.Font ffont = new System.Drawing.Font(vfnt.Family, (float)vfnt.Size); - fnt = Volian.Svg.Library.VolianPdf.GetFont(ffont); - fnt.SetStyle(myPara.Font.Style); - fnt.SetColor(myPara.Font.Color.R,myPara.Font.Color.G,myPara.Font.Color.B); - } - Chunk chk = (Chunk)myPara[hype]; - // THIS CODE IS USED FOR DEBUGGING - //if (!fnt.Familyname.StartsWith("L")) - //{ - // Console.WriteLine("font = {0}", makeitpretty(fnt)); - // Console.WriteLine("Hype = {0}\r\n{1}",hype, myPara.Content); - // if (hype > 0) - // { - // Chunk chk3 = (Chunk)myPara[hype - 1]; - // Console.WriteLine("before '{0}'", chk3.Content); - // } - // Chunk chk4 = (Chunk)myPara[hype]; - // Console.WriteLine("during '{0}'", chk4.Content); - // if (hype < myPara.Count -1) - // { - // Chunk chk5 = (Chunk)myPara[hype + 1]; - // Console.WriteLine("after '{0}'", chk5.Content); - // } - //} - string prefix = ""; - if (chk.Content == "\u2011" && hype < (myPara.Count - 1)) - { - myPara.RemoveAt(hype);// Remove standalone hyphen - chk = (Chunk)myPara[hype]; - prefix = "-"; - } - myPara.RemoveAt(hype); - myPara.Insert(hype, new Chunk(prefix + chk.Content.Replace("\u2011", "-"), fnt)); - } - } - - // THIS FUNCTION IS USED FOR DEBUGGING - private static string makeitpretty(Font fnt) - { - return string.Format("font {0}, size {1}, style {2}", fnt.Familyname, fnt.Size, fnt.Style); - } - - private static int GetHyphen(Paragraph myPara) - { - int index=0; - foreach (Chunk chk in myPara.Chunks) - if (chk.Content.Contains("\u2011")) - return index; - else - index++; - return -1; - } - public static float CalculateHangingIndent(string rtf) - { - float chkW = 0; - // **** This is intened to be a temporary fix for V.C.Summer **** - // Two procedures would not print: A-2 SAG in Summer's SAMG set, and SAG-3 in Summer's PWOG DAMG set. - // These procedures have tables with hanging indents and use the Letter Gothic Tall font. - // It appears that the font information for the hanging indent character is not included in the RTF - // for those table cells. - // This piece of code checks for the existance of a font definition of \f1 which is need for the \u9999? indent character - // If the a font definition of \f1 is not found then the indent character is removed. This will allow the procedure to print - // but the text in that table cell will not be indented. - jsj 10/10/2014 - //IRtfDocument rtfDoc2 = RtfInterpreterTool.BuildDoc(rtf.Replace(@"\'05", @"\f1 \u9999? \f0 ")); - IRtfDocument rtfDoc2 = null; - //if (rtf.Contains(@"\f1\fnil\fcharset0 ")) - // rtfDoc2 = RtfInterpreterTool.BuildDoc(rtf.Replace(@"\'05", @"\f1 \u9999? \f0 ")); - //else - //{ - // first add the symbol font and then surround the indent as above. - rtfDoc2 = RtfInterpreterTool.BuildDoc(rtf.Replace(@"\'05", @"\par\u9999?\par")); - //} - - Rtf2iTextSharp rtf2IText2 = new Rtf2iTextSharp(rtfDoc2); - iTextSharp.text.Paragraph para2 = rtf2IText2.Convert(); - for (int ic = 0; ic < para2.Chunks.Count; ic++) - { - Chunk chk = para2.Chunks[ic] as Chunk; - if (chk.Content[0] == 9999) break; - if (chk.Content.Contains("\u270f")) - { - int i = chk.Content.IndexOf('\u270F'); - int n = chk.Content.Length; - chkW += chk.GetWidthPoint() * i / (n - i); - break; - } - if (chk.Content.Contains("\n")) - { - if (ic < para2.Chunks.Count - 2 && (para2.Chunks[ic + 1] as Chunk).Content.StartsWith("\u270f")) return chkW; - chkW = 0; //hard return - reset chkW (indent start) - } - chkW += chk.GetWidthPoint(); - } - return chkW; - } - - private static StepRTB _StatRTB = new StepRTB(); - private string PreProcessRTF(float w, string str) - { - _StatRTB.Text = string.Empty; - _StatRTB.Width = (int)w; - _StatRTB.Font = MyFlexGrid.Font; - if (str.StartsWith(@"{\rtf")) - // The 'Replace(@" \ulnone", @"\u160?\ulnone")' was added so that data in VEWCN SUR_WTC - // tables would print. There were a number of tables, for example in STN NB-106/8.1.6, - // that had a series of spaces underlined and these spaces were not underlined in the - // generated pdf. It seems that there is a problem somewhere in the rtb -> itextsharp - // level. This fixed the immediate problem. If there is 'b0' (bold off) after the - // space before the 'ulnone' the following won't work. Also, this change was not - // made in the non-table code. If the problem occurs there, it should be added. - _StatRTB.Rtf = str.Replace(@"\~", @"\u160?").Replace(@" \ulnone", @"\u160?\ulnone"); - else - _StatRTB.Text = str; - _StatRTB.SelectAll(); - _StatRTB.SelectionColor = PrintOverride.OverrideTextColor(System.Drawing.Color.Black); - str = _StatRTB.Rtf; - return str; - } - public static iTextSharp.text.Paragraph RtfToParagraph(string rtf, iTextSharp.text.Font mySymFont) - { - IRtfDocument rtfDoc = RtfInterpreterTool.BuildDoc(rtf); - Rtf2iTextSharp rtf2IText = new Rtf2iTextSharp(rtfDoc); - rtf2IText.DefaultFont = mySymFont; - iTextSharp.text.Paragraph para = rtf2IText.Convert(); - para.SetLeading(_SixLinesPerInch, 0); - return para; - } - private static float _SixLinesPerInch = 12; // twips - #endregion - #region Public Methods - public void ToPdf(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top) - { - foreach (vlnCell myCell in this) - myCell.ToPdf(myColumnText, left, top); - } - #endregion - } - public partial class vlnCell // RHM20150429 - Table Scrunch - { - #region Properties - private vlnTable _MyTable; - public vlnTable MyTable - { - get { return _MyTable; } - set { _MyTable = value; } - } - public VlnBorders MyBorders - { - get { return _MyTable.MyBorders; } - } - private int _r1; - public int r1 - { - get { return _r1; } - set { _r1 = value; } - } - private int _c1; - public int c1 - { - get { return _c1; } - set { _c1 = value; } - } - private int _r2; - public int r2 - { - get { return _r2; } - set { _r2 = value; } - } - private int _c2; - public int c2 - { - get { return _c2; } - set { _c2 = value; } - } - private iTextSharp.text.Paragraph _MyPara; - public iTextSharp.text.Paragraph MyPara - { - get { return _MyPara; } - set { _MyPara = value; } - } - private float _HContent; - public float HContent - { - get { return _HContent; } - set { _HContent = value; } - } - #endregion - #region Line Pattern Diagram - /* - The diagram below identifies the various border names for the cell in the center - - |-AboveLeftSide |-AboveRightSide - | | - | | - | | - LeftOfTopSide | TopSide | RightOfTopSide - ------------------|-------------------|------------------ - | | - | | - |-LeftSide |-RightSide - | | - | | - LeftOfBottomSide | BottomSide | RightOfBottomSide - --------------------------------------|------------------ - | | - | | - | | - | | - |-BelowLeftSide |-BelowRightSide - */ - - #endregion - #region Horizontal Line Patterns - private GridLinePattern _TopSide = GridLinePattern.Unknown; - public GridLinePattern TopSide - { - get - { - if (_TopSide == GridLinePattern.Unknown) - _TopSide = MyBorders.HorizontalLines[r1, c1]; - return _TopSide; - } - } - private GridLinePattern _BottomSide = GridLinePattern.Unknown; - public GridLinePattern BottomSide - { - get - { - if (_BottomSide == GridLinePattern.Unknown) - _BottomSide = MyBorders.HorizontalLines[r2 + 1, c2]; - return _BottomSide; - } - } - private GridLinePattern _RightOfTopSide = GridLinePattern.Unknown; - public GridLinePattern RightOfTopSide - { - get - { - if (_RightOfTopSide == GridLinePattern.Unknown) - { - if (c2 == MyTable.MyFlexGrid.Cols.Count - 1) - _RightOfTopSide = GridLinePattern.None; - else - { - CellRange cr = MyTable.MyFlexGrid.GetMergedRange(r1, c2 + 1); - if (cr.r1 == r1) - _RightOfTopSide = MyBorders.HorizontalLines[r1, c2 + 1]; - else - _RightOfTopSide = GridLinePattern.None; - } - } - return _RightOfTopSide; - } - } - private GridLinePattern _LeftOfTopSide = GridLinePattern.Unknown; - public GridLinePattern LeftOfTopSide - { - get - { - if (_LeftOfTopSide == GridLinePattern.Unknown) - { - if (c1 == 0) - _LeftOfTopSide = GridLinePattern.None; - else - { - // This property is only used if c1==0 or r1==0: - // A merged range for row = 0 will always return an r1=0. - CellRange cr = MyTable.MyFlexGrid.GetMergedRange(r1, c1 - 1); - if (cr.r1 == r1) - _LeftOfTopSide = MyBorders.HorizontalLines[r1, c1 - 1]; - else // Since this section of code is only entered when r1==0, this else condition should never happen - _LeftOfTopSide = GridLinePattern.None; - } - } - return _LeftOfTopSide; - } - } - private GridLinePattern _RightOfBottomSide = GridLinePattern.Unknown; - public GridLinePattern RightOfBottomSide - { - get - { - if (_RightOfBottomSide == GridLinePattern.Unknown) // Need to consider Merged Cells - { - if (c2 == MyTable.MyFlexGrid.Cols.Count - 1) - _RightOfBottomSide = GridLinePattern.None; - else - { - CellRange cr = MyTable.MyFlexGrid.GetMergedRange(r2, c2 + 1); - if (cr.r2 == r2) - _RightOfBottomSide = MyBorders.HorizontalLines[r2 + 1, c2 + 1]; - else - _RightOfBottomSide = GridLinePattern.None; - } - } - return _RightOfBottomSide; - } - } - private GridLinePattern _LeftOfBottomSide = GridLinePattern.Unknown; - public GridLinePattern LeftOfBottomSide - { - get - { - if (_LeftOfBottomSide == GridLinePattern.Unknown) // Need to consider Merged Cells - { - if (c1 == 0) - _LeftOfBottomSide = GridLinePattern.None; - else - { - CellRange cr = MyTable.MyFlexGrid.GetMergedRange(r2, c1 - 1); - if (cr.r2 == r2) - _LeftOfBottomSide = MyBorders.HorizontalLines[r2 + 1, c1 - 1]; - else - _LeftOfBottomSide = GridLinePattern.None; - } - } - return _LeftOfBottomSide; - } - } - #endregion - #region Vertical Line Patterns - private GridLinePattern _LeftSide = GridLinePattern.Unknown; - public GridLinePattern LeftSide - { - get - { - if (_LeftSide == GridLinePattern.Unknown) - _LeftSide = MyBorders.VerticalLines[r1, c1]; - return _LeftSide; - } - } - private GridLinePattern _RightSide = GridLinePattern.Unknown; - public GridLinePattern RightSide - { - get - { - if (_RightSide == GridLinePattern.Unknown) - _RightSide = MyBorders.VerticalLines[r2, c2 + 1]; - return _RightSide; - } - } - private GridLinePattern _BelowRightSide = GridLinePattern.Unknown; - public GridLinePattern BelowRightSide - { - get - { - if (_BelowRightSide == GridLinePattern.Unknown) - { - if (r2 == MyTable.MyFlexGrid.Rows.Count - 1) - _BelowRightSide = GridLinePattern.None; - else - { - CellRange cr = MyTable.MyFlexGrid.GetMergedRange(r2 + 1, c2); - if (cr.c2 == c2) - _BelowRightSide = MyBorders.VerticalLines[r2 + 1, c2 + 1]; - else - _BelowRightSide = GridLinePattern.None; - } - } - return _BelowRightSide; - } - } - private GridLinePattern _AboveRightSide = GridLinePattern.Unknown; - public GridLinePattern AboveRightSide - { - get - { - if (_AboveRightSide == GridLinePattern.Unknown) - { - if (r1 == 0) - _AboveRightSide = GridLinePattern.None; - else - { - CellRange cr = MyTable.MyFlexGrid.GetMergedRange(r1 - 1, c2); - if (cr.c2 == c2) - _AboveRightSide = MyBorders.VerticalLines[r1 - 1, c2 + 1]; - else - _AboveRightSide = GridLinePattern.None; - } - } - return _AboveRightSide; - } - } - private GridLinePattern _BelowLeftSide = GridLinePattern.Unknown; - public GridLinePattern BelowLeftSide - { - get - { - if (_BelowLeftSide == GridLinePattern.Unknown) - { - if (r2 == MyTable.MyFlexGrid.Rows.Count - 1) - _BelowLeftSide = GridLinePattern.None; - else - { - CellRange cr = MyTable.MyFlexGrid.GetMergedRange(r2 + 1, c1); - if (cr.c1 == c1) - _BelowLeftSide = MyBorders.VerticalLines[r2 + 1, c1]; - else - _BelowLeftSide = GridLinePattern.None; - } - } - return _BelowLeftSide; - } - } - private GridLinePattern _AboveLeftSide = GridLinePattern.Unknown; - public GridLinePattern AboveLeftSide - { - get - { - if (_AboveLeftSide == GridLinePattern.Unknown) - { - if (r1 == 0) - _AboveLeftSide = GridLinePattern.None; - else - { - // This property is only used if c1==0 or r1==0: - // A merged range for col = 0 will always return an c1=0. - CellRange cr = MyTable.MyFlexGrid.GetMergedRange(r1 - 1, c1); - if (cr.c1 == c1) - _AboveLeftSide = MyBorders.VerticalLines[r1 - 1, c1]; - else // Since this section of code is only entered when c1==0, this else condition should never happen - _AboveLeftSide = GridLinePattern.None; - } - } - return _AboveLeftSide; - } - } - #endregion - #region Static Properties - private static float XOffset { get { return vlnTable.XOffset; } } - private static float YOffset { get { return vlnTable.YOffset; } } - private static float LineThicknessForThin { get { return vlnTable.LineThicknessForThin; } } - private static float LineThicknessForThick { get { return vlnTable.LineThicknessForThick; } } - private static float LineThicknessForDouble { get { return vlnTable.LineThicknessForDouble; } } - private static float DoubleLineOffset { get { return vlnTable.DoubleLineOffset; } } - - // adjustments for line intersections: - private static float ThickOverDouble { get { return ((2 * DoubleLineOffset) + LineThicknessForDouble - LineThicknessForThick) / 2; } } - private static float ThickUnderDouble { get { return DoubleLineOffset + (LineThicknessForThick - LineThicknessForDouble) / 2; } } - private static float ThickOverThin { get { return (LineThicknessForThin - LineThicknessForThick) / 2; } } - private static float ThinOverThick { get { return (LineThicknessForThick - LineThicknessForThin) / 2; } } - private static float ThinUnderDouble { get { return DoubleLineOffset + (LineThicknessForThin - LineThicknessForDouble) / 2; } } - private static float ThinOverDouble { get { return (DoubleLineOffset + LineThicknessForThin - LineThicknessForDouble) / 2; } } - private static float DoubleUnderThin { get { return (LineThicknessForThin - LineThicknessForDouble) / 2; } } - private static float DoubleUnderThick { get { return (LineThicknessForThick - LineThicknessForDouble) / 2; } } - #endregion - #region Constructors - public vlnCell(int r1, int c1, int r2, int c2, vlnTable myTable, iTextSharp.text.Paragraph myPara, float hContent) - { - this.r1 = r1; - this.c1 = c1; - this.r2 = r2; - this.c2 = c2; - MyTable = myTable; - MyPara = myPara; - HContent = hContent; - } - #endregion - #region Public Methods - public override string ToString() - { - return string.Format("{0}:{1}", r1, c1); - } - public void ToPdf(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top) - { - myColumnText.Canvas.SaveState(); - VlnSvgPageHelper _MyPageHelper = myColumnText.Canvas.PdfWriter.PageEvent as VlnSvgPageHelper; - float mult = _MyPageHelper.YMultiplier; - float x = MyTable.ColLeft[c1]; - float w = MyTable.ColLeft[c2 + 1] - x; - float y = mult * MyTable.RowTop[r1]; - float h = mult * MyTable.RowTop[r2 + 1] - y; - if (Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase6))// RHM20150525 - Table Scrunc - { - h = YAdjust_h + mult * MyTable.RowTop[r2 + 1] - y; - - } - BordersToPdf(myColumnText, left, top, x, w, y, h ); - float hAdjust = VeritcalTextAlignment(h,_MyPageHelper.YMultiplier); - iTextSharp.text.pdf.ColumnText myColumnText1 = new iTextSharp.text.pdf.ColumnText(myColumnText.Canvas); - float adjustTextLocation = mult * 4; // RHM 20120925 Move text down about 1 half line from the border - if (Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase7))// RHM20150525 - Table Scrunc - { - adjustTextLocation = mult * 0; - if (mult != 1F) adjustTextLocation=1; - } - myColumnText1.SetSimpleColumn(1 + left + x, top - y - h , left + x + w - 2, 1 + top - y - hAdjust - adjustTextLocation); // 2 == Default Padding - if (ShowDetails) Console.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t\"{9}\"" - , r1, c1, hAdjust, adjustTextLocation, y, h, top, 1 + top - y - hAdjust - adjustTextLocation, - _MyPageHelper.YMultiplier, MyPara.Content.Substring(0, Math.Min(20, MyPara.Content.Length))); - MyPara.MultipliedLeading *= _MyPageHelper.YMultiplier; - vlnCells.FixHyphens(MyPara, MyTable); - myColumnText1.AddElement(MyPara); - foreach(object obj in MyPara) - { - if(obj is iTextSharp.text.Image) - { - iTextSharp.text.Image img = obj as iTextSharp.text.Image; - img.SetAbsolutePosition(left,top-h); - img.ScaleAbsoluteWidth(w); - img.ScaleAbsoluteHeight(h); - myColumnText.Canvas.AddImage(img); - } - } - float posBefore = myColumnText1.YLine; // RHM20150429 - Table Scrunch - myColumnText1.Go(); - float posAfter = myColumnText1.YLine; // RHM20150429 - Table Scrunch - if(ShowDetails)Console.WriteLine("ToPDF posBefore,posAfter,difference={0},{1},{2},{3}", - posBefore, posAfter, posBefore - posAfter,w); - myColumnText.Canvas.RestoreState(); - } - private static float _SixLinesPerInch = 12; // twips - public bool IsRangeStyleNull = false; - private TextAlignEnum? _TextAlign = null; - public TextAlignEnum? TextAlign - { - get - { - if (_TextAlign == null) - { - CellRange cr = MyTable.MyFlexGrid.GetCellRange(r1, c1, r2, c2); - if (cr.Style == null) - { - IsRangeStyleNull = true; - return _TextAlign; - } - else - { - IsRangeStyleNull = false; - _TextAlign = cr.Style.TextAlign; - } - } - return (TextAlignEnum)_TextAlign; - } - } - #endregion - #region Private Text Methods - private float VeritcalTextAlignment(float h, float mult) - { - float hAdjust = 0; - //CellRange cr = MyTable.MyFlexGrid.GetCellRange(r1, c1, r2, c2); - if (!IsRangeStyleNull) - { - switch (TextAlign) - { - case TextAlignEnum.CenterBottom: - case TextAlignEnum.GeneralBottom: - case TextAlignEnum.LeftBottom: - case TextAlignEnum.RightBottom: - hAdjust = Math.Max(0,h - (mult * HContent) )-1; - //Console.WriteLine("\"Bottom\",{0},{1},{2}", h, HContent, hAdjust); - break; - case TextAlignEnum.CenterCenter: - case TextAlignEnum.GeneralCenter: - case TextAlignEnum.LeftCenter: - case TextAlignEnum.RightCenter: - hAdjust = Math.Max(0,(h - (mult * HContent)) / 2)-1; - //Console.WriteLine("\"Middle\",{0},{1},{2}", h, HContent, hAdjust); - break; - default: - break; - } - } - return hAdjust; - } - #endregion - #region Private Border Methods - // coordinate system is upside down of screen. 0,0 on screen is top/left. 0,0 on pdf is bottom/left. - // i.e. x is same, y is flipped. - private void BordersToPdf(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top, float x, float w, float y, float h) - { - PdfContentByte cb = myColumnText.Canvas; - cb.SaveState();// Save state before drawing borders - //SetOpacity(cb, .7F); // This line makes the borders transparent for testing - float xLeft = left + x + XOffset; - float yTop = top - y + YOffset; - float xRight = left + x + w + XOffset; - float yBottom = top - y - h + YOffset; - // ZoomToCell(myColumnText, xLeft, yTop, xRight, yBottom); - // Draw Top Side for the first row - if (r1 == 0) - DrawHorizontalLine(cb, "Top", xLeft, xRight, yTop, TopSide, LeftSide, AboveLeftSide, LeftOfTopSide, AboveRightSide, RightSide, RightOfTopSide); - // Draw Left Side for the first column - if (c1 == 0) - DrawLineVertical(cb, "Left", xLeft, yBottom, yTop, LeftSide, BottomSide, LeftOfBottomSide, BelowLeftSide, LeftOfTopSide, TopSide, AboveLeftSide); - // Draw Bottom Side - DrawHorizontalLine(cb, "Bottom", xLeft, xRight, yBottom, BottomSide, BelowLeftSide, LeftSide, LeftOfBottomSide, RightSide, BelowRightSide, RightOfBottomSide); - // Draw Right Side - DrawLineVertical(cb, "Right", xRight, yBottom, yTop, RightSide, RightOfBottomSide, BottomSide, BelowRightSide, TopSide, RightOfTopSide, AboveRightSide); - cb.RestoreState(); - } - private void DrawHorizontalLine(PdfContentByte cb, string side, float xStart, float xEnd, float y, GridLinePattern LinePattern, - GridLinePattern startToLeft, GridLinePattern startToRight, GridLinePattern startAhead, - GridLinePattern endToLeft, GridLinePattern endToRight, GridLinePattern endAhead) - { - if (LinePattern != GridLinePattern.None) - { - float direction = (xStart < xEnd) ? 1 : -1; - InitializeLineStyle(cb); - SetLineColor(cb, r1, c1, side); - if (LinePattern == GridLinePattern.Double) - { - // Top Line - float dStart = -direction * DoubleIntersectionRight(startToLeft, startToRight, startAhead); - float dEnd = direction * DoubleIntersectionLeft(endToLeft, endToRight, endAhead); - DrawLine(cb, LineThicknessForDouble, xStart + dStart, y + DoubleLineOffset, xEnd + dEnd, y + DoubleLineOffset); - // Bottom Line - dStart = -direction * DoubleIntersectionLeft(startToLeft, startToRight, startAhead); - dEnd = direction * DoubleIntersectionRight(endToLeft, endToRight, endAhead); - DrawLine(cb, LineThicknessForDouble, xStart + dStart, y - DoubleLineOffset, xEnd + dEnd, y - DoubleLineOffset); - } - else if (LinePattern != GridLinePattern.Thick) - { - SetLinePattern(cb, LinePattern); - float dStart = -direction * ThinIntersection(startToLeft, startToRight, startAhead); - float dEnd = direction * ThinIntersection(endToLeft, endToRight, endAhead); - DrawLine(cb, LineThicknessForThin, xStart + dStart, y, xEnd + dEnd, y); - } - else - { - float dStart = -direction * ThickIntersection(startToLeft, startToRight, startAhead); - float dEnd = direction * ThickIntersection(endToLeft, endToRight, endAhead); - DrawLine(cb, LineThicknessForThick, xStart + dStart, y, xEnd + dEnd, y); - } - cb.Stroke(); - } - } - private void DrawLineVertical(PdfContentByte cb, string side, float x, float yStart, float yEnd, GridLinePattern LinePattern, - GridLinePattern startToLeft, GridLinePattern startToRight, GridLinePattern startAhead, - GridLinePattern endToLeft, GridLinePattern endToRight, GridLinePattern endAhead) - { - if (LinePattern != GridLinePattern.None) - { - float direction = (yStart < yEnd) ? 1 : -1; - InitializeLineStyle(cb); - SetLineColor(cb, r1, c1, side); - if (LinePattern == GridLinePattern.Double) - { - //Left Line - float dStart = -direction * DoubleIntersectionRight(startToLeft, startToRight, startAhead); - float dEnd = direction * DoubleIntersectionLeft(endToLeft, endToRight, endAhead); - DrawLine(cb, LineThicknessForDouble, x - DoubleLineOffset, yStart + dStart, x - DoubleLineOffset, yEnd + dEnd); - //Right Line - dStart = -direction * DoubleIntersectionLeft(startToLeft, startToRight, startAhead); - dEnd = direction * DoubleIntersectionRight(endToLeft, endToRight, endAhead); - DrawLine(cb, LineThicknessForDouble, x + DoubleLineOffset, yStart + dStart, x + DoubleLineOffset, yEnd + dEnd); - } - else if (LinePattern != GridLinePattern.Thick) - { - SetLinePattern(cb, LinePattern); - float dStart = -direction * ThinIntersection(startToLeft, startToRight, startAhead); - float dEnd = direction * ThinIntersection(endToLeft, endToRight, endAhead); - DrawLine(cb, LineThicknessForThin, x, yStart + dStart, x, yEnd + dEnd); - } - else - { - float dStart = -direction * ThickIntersection(startToLeft, startToRight, startAhead); - float dEnd = direction * ThickIntersection(endToLeft, endToRight, endAhead); - DrawLine(cb, LineThicknessForThick, x, yStart + dStart, x, yEnd + dEnd); - } - cb.Stroke(); - } - } - #endregion - #region Intersection Diagram - /* driving into an intersection on line being drawn, facing the intersection. Each intersection requires - * drawing of each of the four cases: - - Case 1: Line being drawn right: - - lineToLeft - ^ - | - Line Being Drawn ----->|---> LineAhead - | - v - lineToRight - - - Case 2: Line being drawn left: - - lineToRight - ^ - | - LineAhead <-----|<--- Line Being Drawn - | - v - lineToLeft - - Case 3: Line being drawn up: - - lineAhead - ^ - | - lineToLeft <-----|----> lineToRight - ^ - | - | - Line Being Drawn - - Case 4: Line being drawn down: - - Line Begin Drawn - | - | - v - lineToRight <-----|----> lineToLeft - | - | - v - lineAhead - * - */ - #endregion - #region Border Intersection Methods - private static float DoubleIntersectionLeft(GridLinePattern lineToLeft, GridLinePattern lineToRight, GridLinePattern lineAhead) - { - if (lineToLeft == GridLinePattern.Double) - return -DoubleLineOffset; - if (lineToRight == GridLinePattern.Double || lineAhead == GridLinePattern.Double) - return DoubleLineOffset; - if (lineToLeft == GridLinePattern.Thick || lineToRight == GridLinePattern.Thick) - return DoubleUnderThick; - if (VlnBorders.LineWidth(lineToLeft) == 1 || VlnBorders.LineWidth(lineToRight) == 1) - return DoubleUnderThin; - return 0; - } - private static float DoubleIntersectionRight(GridLinePattern lineToLeft, GridLinePattern lineToRight, GridLinePattern lineAhead) - { - if (lineToRight == GridLinePattern.Double) - return -DoubleLineOffset; - if (lineToLeft == GridLinePattern.Double || lineAhead == GridLinePattern.Double) - return DoubleLineOffset; - if (lineToLeft == GridLinePattern.Thick || lineToRight == GridLinePattern.Thick) - return DoubleUnderThick; - if (VlnBorders.LineWidth(lineToLeft) == 1 || VlnBorders.LineWidth(lineToRight) == 1) - return DoubleUnderThin; - return 0; - } - private static float ThinIntersection(GridLinePattern lineToLeft, GridLinePattern lineToRight, GridLinePattern lineAhead) - { - if (lineToLeft == GridLinePattern.Double && lineToRight == GridLinePattern.Double) - return -ThinUnderDouble; - if (lineToLeft == GridLinePattern.Double || lineToRight == GridLinePattern.Double) - { - if (lineAhead == GridLinePattern.Double) return -ThinUnderDouble; - return ThinOverDouble; - } - if (lineToLeft == GridLinePattern.Thick || lineToRight == GridLinePattern.Thick) - return ThinOverThick; - return 0; - } - private static float ThickIntersection(GridLinePattern lineToLeft, GridLinePattern lineToRight, GridLinePattern lineAhead) - { - if (lineToLeft == GridLinePattern.Double && lineToRight == GridLinePattern.Double) - { - if (lineAhead == GridLinePattern.Thick) return ThickOverDouble; - return -ThickUnderDouble; - } - if ( lineToLeft == GridLinePattern.Double || lineToRight == GridLinePattern.Double) - { - if (lineAhead == GridLinePattern.Double) - { - if (lineToLeft == GridLinePattern.Thick || lineToRight == GridLinePattern.Thick) - return ThickOverDouble; - return -ThickUnderDouble; - } - return ThickOverDouble; - } - if (VlnBorders.LineWidth(lineToLeft) == 1 && VlnBorders.LineWidth(lineToRight) == 1) - return ThickOverThin; - return 0; - } - #endregion - #region Basic Border Methods - private static void DrawLine(PdfContentByte cb, float lineThickness, float xStart, float yStart, float xEnd, float yEnd) - { - cb.SetLineWidth(lineThickness); - cb.MoveTo(xStart, yStart); - cb.LineTo(xEnd, yEnd); - } - private static void SetLinePattern(PdfContentByte cb, GridLinePattern linePattern) - { - if (linePattern == GridLinePattern.Dotted) - { - cb.SetLineDash(0, 2, 0); - cb.SetLineCap(PdfContentByte.LINE_CAP_ROUND); - } - else if (linePattern == GridLinePattern.Dashed) - cb.SetLineDash(4, 4, 0); - } - private static void SetLineColor(PdfContentByte cb, int row, int col, string side) - { - iTextSharp.text.Color lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Black)); - //switch (side) - //{ - // case "Top": - // if (col == 0) lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Blue)); - // else lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Cyan)); - // break; - // case "Left": - // if (row == 0) lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Red)); - // else lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Magenta)); - // break; - // case "Bottom": - // if (col == 0) lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Green)); - // else lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Cyan)); - // break; - // case "Right": - // if (row == 0) lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Orange)); - // else lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Magenta)); - // break; - //} - cb.SetColorStroke(lineColor); - } - private static void InitializeLineStyle(PdfContentByte cb) - { - cb.SetLineCap(PdfContentByte.LINE_CAP_PROJECTING_SQUARE); // Extend the line by half of it's thickness - cb.SetLineDash(0);// Solid Line - } - #endregion - #region Debug Methods - private static void SetOpacity(PdfContentByte cb, float opacity) - { - PdfGState gs = new PdfGState(); - gs.StrokeOpacity = opacity; - cb.SetGState(gs); - } - private static void ZoomToCell(iTextSharp.text.pdf.ColumnText myColumnText, float xLeft, float yTop, float xRight, float yBottom) - { - PdfDestination dest = new PdfDestination(PdfDestination.FITR, xLeft - 4, yBottom , xRight, yTop + 4); - myColumnText.Canvas.SetAction(PdfAction.GotoLocalPage(myColumnText.Canvas.PdfWriter.CurrentPageNumber, dest, myColumnText.Canvas.PdfWriter), xLeft, yBottom, xRight, yTop); - } - #endregion - #region Old Border Methods - //private void DrawLeftLine(PdfContentByte cb, float xLeft, float yTop, float yBottom) - //{ - // if (c1 == 0 && LineLeft != GridLinePattern.None) - // { - // InitializeLineStyle(cb); - // SetLineColor(cb, r1, c1, "Left"); - // if (LineLeft == GridLinePattern.Double) - // { - // //Left Line - // float dyTop = DoubleIntersectionLeft(LineTopLeft, LineTop, LineLeftAbove); - // float dyBottom = -DoubleIntersectionRight(LineBottom, LineBottomLeft, LineLeftBelow); - // DrawLine(cb, LineThicknessForDouble, xLeft - DoubleLineOffset, yTop + dyTop, xLeft - DoubleLineOffset, yBottom + dyBottom); - // //Right Line - // dyTop = DoubleIntersectionRight(LineTopLeft, LineTop, LineLeftAbove); - // dyBottom = -DoubleIntersectionLeft(LineBottom, LineBottomLeft, LineLeftBelow); - // DrawLine(cb, LineThicknessForDouble, xLeft + DoubleLineOffset, yTop + dyTop, xLeft + DoubleLineOffset, yBottom + dyBottom); - // } - // else if (LineLeft != GridLinePattern.Thick) - // { - // SetLinePattern(cb, LineLeft); - // float dyTop = ThinIntersection(LineTopLeft, LineTop, LineLeftAbove); - // float dyBottom = -ThinIntersection(LineBottom, LineBottomLeft, LineLeftBelow); - // DrawLine(cb, LineThicknessForThin, xLeft, yTop + dyTop, xLeft, yBottom + dyBottom); - // } - // else - // { - // float dyTop = ThickIntersection(LineTopLeft, LineTop, LineLeftAbove); - // float dyBottom = -ThickIntersection(LineBottom, LineBottomLeft, LineLeftBelow); - // DrawLine(cb, LineThicknessForThick, xLeft, yTop + dyTop, xLeft, yBottom + dyBottom); - // } - // cb.Stroke(); - // } - //} - //private void DrawRightLine(PdfContentByte cb, float xRight, float yTop, float yBottom) - //{ - // if (LineRight != GridLinePattern.None) - // { - // InitializeLineStyle(cb); - // SetLineColor(cb, r1, c1, "Right"); - // if (LineRight == GridLinePattern.Double) - // { - // //Left Line - // float dyTop = DoubleIntersectionLeft(LineTop, LineTopRight, LineRightAbove); - // float dyBottom = -DoubleIntersectionRight(LineBottomRight, LineBottom, LineRightBelow); - // DrawLine(cb, LineThicknessForDouble, xRight - DoubleLineOffset, yTop + dyTop, xRight - DoubleLineOffset, yBottom + dyBottom); - // //Right Line - // dyTop = DoubleIntersectionRight(LineTop, LineTopRight, LineRightAbove); - // dyBottom = -DoubleIntersectionLeft(LineBottomRight, LineBottom, LineRightBelow); - // DrawLine(cb, LineThicknessForDouble, xRight + DoubleLineOffset, yTop + dyTop, xRight + DoubleLineOffset, yBottom + dyBottom); - // } - // else if (LineRight != GridLinePattern.Thick) - // { - // float dyTop = ThinIntersection(LineTop, LineTopRight, LineRightAbove); - // float dyBottom = -ThinIntersection(LineBottomRight, LineBottom, LineRightBelow); - // SetLinePattern(cb, LineRight); - // DrawLine(cb, LineThicknessForThin, xRight, yTop + dyTop, xRight, yBottom + dyBottom); - // } - // else - // { - // float dyTop = ThickIntersection(LineTop, LineTopRight, LineRightAbove); - // float dyBottom = -ThickIntersection(LineBottomRight, LineBottom, LineRightBelow); - // DrawLine(cb, LineThicknessForThick, xRight, yTop + dyTop, xRight, yBottom + dyBottom); - // } - // cb.Stroke(); - // } - //} - //private void DrawTopLine(PdfContentByte cb, float xLeft, float xRight, float yTop) - //{ - // if (r1 == 0 && TopSide != GridLinePattern.None) - // { - // InitializeLineStyle(cb); - // SetLineColor(cb, r1, c1, "Top"); - // if (TopSide == GridLinePattern.Double) - // { - // // Top Line - // float dxLeft = -DoubleIntersectionRight(LeftSide, AboveLeftSide, LeftOfTopSide); - // float dxRight = DoubleIntersectionLeft(AboveRightSide, RightSide, RightOfTopSide); - // DrawLine(cb, LineThicknessForDouble, xLeft + dxLeft, yTop + DoubleLineOffset, xRight + dxRight, yTop + DoubleLineOffset); - // // Bottom Line - // dxLeft = -DoubleIntersectionLeft(LeftSide, AboveLeftSide, LeftOfTopSide); - // dxRight = DoubleIntersectionRight(AboveRightSide, RightSide, RightOfTopSide); - // DrawLine(cb, LineThicknessForDouble, xLeft + dxLeft, yTop - DoubleLineOffset, xRight + dxRight, yTop - DoubleLineOffset); - // } - // else if (TopSide != GridLinePattern.Thick) - // { - // SetLinePattern(cb, TopSide); - // float dxLeft = -ThinIntersection(LeftSide, AboveLeftSide, LeftOfTopSide); - // float dxRight = ThinIntersection(AboveRightSide, RightSide, RightOfTopSide); - // DrawLine(cb, LineThicknessForThin, xLeft + dxLeft, yTop, xRight + dxRight, yTop); - // } - // else - // { - // float dxLeft = -ThickIntersection(LeftSide, AboveLeftSide, LeftOfTopSide); - // float dxRight = ThickIntersection(AboveRightSide, RightSide, RightOfTopSide); - // if (c1 == 0) - // Console.WriteLine("'{0}','{1}','{2}',{3},{4}", LeftSide, AboveLeftSide, LeftOfTopSide, dxLeft, ThickOverThin); - // DrawLine(cb, LineThicknessForThick, xLeft + dxLeft, yTop, xRight + dxRight, yTop); - // } - // cb.Stroke(); - // } - //} - //private void DrawBottomLine(PdfContentByte cb, float xLeft, float xRight, float yBottom) - //{ - // if (BottomSide != GridLinePattern.None) - // { - // InitializeLineStyle(cb); - // SetLineColor(cb, r1, c1, "Bottom"); - // if (BottomSide == GridLinePattern.Double) - // { - // // Top Line - // float dxLeft = -DoubleIntersectionRight(BelowLeftSide, LeftSide, LeftOfBottomSide); - // float dxRight = DoubleIntersectionLeft(RightSide, BelowRightSide, RightOfBottomSide); - // DrawLine(cb, LineThicknessForDouble, xLeft + dxLeft, yBottom + DoubleLineOffset, xRight + dxRight, yBottom + DoubleLineOffset);// Top Line - // // Bottom Line - // dxLeft = -DoubleIntersectionLeft(BelowLeftSide, LeftSide, LeftOfBottomSide); - // dxRight = DoubleIntersectionRight(RightSide, BelowRightSide, RightOfBottomSide); - // DrawLine(cb, LineThicknessForDouble, xLeft + dxLeft, yBottom - DoubleLineOffset, xRight + dxRight, yBottom - DoubleLineOffset);//Bottom Line - // } - // else if (BottomSide != GridLinePattern.Thick) // Bottom line is thin. Determine if intersecting with double: - // { - // SetLinePattern(cb, BottomSide); - // float dxLeft = -ThinIntersection(BelowLeftSide, LeftSide, LeftOfBottomSide); - // float dxRight = ThinIntersection(RightSide, BelowRightSide, RightOfBottomSide); - // DrawLine(cb, LineThicknessForThin, xLeft + dxLeft, yBottom, xRight + dxRight, yBottom); - // } - // else - // { - // float dxLeft = -ThickIntersection(BelowLeftSide, LeftSide, LeftOfBottomSide); - // float dxRight = ThickIntersection(RightSide, BelowRightSide, RightOfBottomSide); - // DrawLine(cb, LineThicknessForThick, xLeft + dxLeft, yBottom, xRight + dxRight, yBottom); - // } - // cb.Stroke(); - // } - //} - #endregion - } -} diff --git a/PROMS/PROMS/Volian.Print.Library/Rtf2iTextSharp.cs b/PROMS/PROMS/Volian.Print.Library/Rtf2iTextSharp.cs deleted file mode 100644 index 91cc2c0b..00000000 --- a/PROMS/PROMS/Volian.Print.Library/Rtf2iTextSharp.cs +++ /dev/null @@ -1,415 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using iTextSharp.text; -using iTextSharp.text.pdf; -using iTextSharp.text.factories; -using Itenso.Rtf; -using Itenso.Rtf.Parser; -using Itenso.Rtf.Interpreter; -//using Itenso.Rtf.Model; -using Itenso.Rtf.Support; -using Microsoft.Win32; -using Volian.Base.Library; - -namespace Volian.Print.Library -{ - public partial class PrintOverride - { - public static bool CompressSub = false; - public static bool CompressSuper = false; - public static bool CompressPropSubSup = false; - private static System.Drawing.Color _TextColor = System.Drawing.Color.Empty; - public static System.Drawing.Color TextColor - { - get { return _TextColor; } - set { _TextColor = value; } - } - public static System.Drawing.Color OverrideTextColor(System.Drawing.Color color) - { - if (_TextColor == System.Drawing.Color.Empty) - return color; - return _TextColor; - } - private static System.Drawing.Color _SvgColor = System.Drawing.Color.Empty; - public static System.Drawing.Color SvgColor - { - get { return _SvgColor; } - set { _SvgColor = value; Volian.Svg.Library.Svg.OverrideColor = value; } - } - public static System.Drawing.Color OverrideSvgColor(System.Drawing.Color color) - { - if (_SvgColor == System.Drawing.Color.Empty) - return color; - return _SvgColor; - } - private static System.Drawing.Color _BoxColor = System.Drawing.Color.Empty; - public static System.Drawing.Color BoxColor - { - get { return _BoxColor; } - set { _BoxColor = value; } - } - public static System.Drawing.Color OverrideBoxColor(System.Drawing.Color color) - { - if (_BoxColor == System.Drawing.Color.Empty) - return color; - return _BoxColor; - } - private static System.Drawing.Color _ChangeBarColor = System.Drawing.Color.Empty; - public static System.Drawing.Color ChangeBarColor - { - get { return _ChangeBarColor; } - set { _ChangeBarColor = value; } - } - public static System.Drawing.Color OverrideChangeBarColor(System.Drawing.Color color) - { - if (_ChangeBarColor == System.Drawing.Color.Empty) - return color; - return _ChangeBarColor; - } - private static System.Drawing.Color _DebugColor = System.Drawing.Color.Empty; - public static System.Drawing.Color DebugColor - { - get { return _DebugColor; } - set { _DebugColor = value; } - } - public static System.Drawing.Color OverrideDebugColor(System.Drawing.Color color) - { - if (_DebugColor == System.Drawing.Color.Empty) - return color; - return _DebugColor; - } - public static void Reset() - { - DebugColor = System.Drawing.Color.Empty; - TextColor = System.Drawing.Color.Empty; - SvgColor = System.Drawing.Color.Empty; - BoxColor = System.Drawing.Color.Empty; - ChangeBarColor = System.Drawing.Color.Empty; - } - } - public class Rtf2iTextSharp : RtfVisualVisitorBase - { - private bool _HasIndent = false; - public bool HasIndent - { - get { return _HasIndent; } - set { _HasIndent = value; } - } - private static bool _DoingComparison = false; - public static bool DoingComparison - { - get { return Rtf2iTextSharp._DoingComparison; } - set { Rtf2iTextSharp._DoingComparison = value; } - } - - private IRtfDocument _RtfDoc; - private Paragraph _MyParagraph = new Paragraph(); - private iTextSharp.text.Font _MyFont; - - // Allow for definition of a default font: if the font is not proportional, this gets set. - // It is needed to set the chunk's font if the first character of a cell is a hardspace (or various - // other special cases (see its use below). Without this, pdfs were using the Helvetica font, - // which is a default itextsharp font (this was causing a problem for HLP, their pdfs could not - // contain a Helvetica font when putting them in their production environment). - private iTextSharp.text.Font _DefaultFont; - public iTextSharp.text.Font DefaultFont - { - get { return _DefaultFont; } - set { _DefaultFont = value; } - } - private string _MyDebugID = null; - public string MyDebugID - { - get { return _MyDebugID; } - set { _MyDebugID = value; } - } - - // public Rtf2iTextSharp(IRtfDocument rtfDoc, Document doc, PdfWriter writer) - public Rtf2iTextSharp(IRtfDocument rtfDoc) - { - if (rtfDoc == null) - throw new ArgumentNullException("rtfDoc"); - - _RtfDoc = rtfDoc; - } - public Paragraph Convert() - { - int profileDepth = ProfileTimer.Push(">>>> Rtf2ITextSharp.Convert"); - _MyParagraph.Clear(); - _MyFont = null; - foreach (IRtfVisual visual in _RtfDoc.VisualContent) - { - visual.Visit(this); - } - //_MyParagraph.SetLeading(0, 1); - ProfileTimer.Pop(profileDepth); - return _MyParagraph; - } - // ---------------------------------------------------------------------- - protected override void DoVisitBreak(IRtfVisualBreak visualBreak) - { - switch (visualBreak.BreakKind) - { - case RtfVisualBreakKind.Line: - Chunk ck = HasIndent ? new Chunk("".PadLeft(200)) : new Chunk("".PadLeft(200)); - _MyParagraph.Add(ck); - break; - case RtfVisualBreakKind.Page: - break; - case RtfVisualBreakKind.Paragraph: - Chunk ck1 = HasIndent ? new Chunk("".PadLeft(200)) : Chunk.NEWLINE; - _MyParagraph.Add(ck1); - break; - case RtfVisualBreakKind.Section: - break; - default: - break; - } - //_MyParagraph.Add(string.Format("<{0}>", visualBreak.BreakKind.ToString())); - } - private void AddChunk(string str, iTextSharp.text.Font font) - { - if (font == null) - _MyParagraph.Add(new Chunk(str)); - else - _MyParagraph.Add(new Chunk(str, font)); - } - protected override void DoVisitSpecial(IRtfVisualSpecialChar visualSpecialChar) - { - //_MyParagraph.Add(string.Format("", visualSpecialChar.CharKind.ToString())); - iTextSharp.text.Font activeFont = _MyFont ?? DefaultFont; - switch (visualSpecialChar.CharKind) - { - case RtfVisualSpecialCharKind.Bullet: - AddChunk("\u2022", activeFont); - break; - case RtfVisualSpecialCharKind.EmDash: - AddChunk("\u2014", activeFont); - break; - case RtfVisualSpecialCharKind.EmSpace: - AddChunk("\u2003", activeFont); - break; - case RtfVisualSpecialCharKind.EnDash: - AddChunk("\u2013", activeFont); - break; - case RtfVisualSpecialCharKind.EnSpace: - AddChunk(" ", activeFont); - break; - case RtfVisualSpecialCharKind.LeftDoubleQuote: - AddChunk("\u201C", activeFont); - break; - case RtfVisualSpecialCharKind.LeftSingleQuote: - AddChunk("\u2018", activeFont); - break; - case RtfVisualSpecialCharKind.NonBreakingHyphen: - AddChunk("\u2011", activeFont); - break; - case RtfVisualSpecialCharKind.NonBreakingSpace: - //iTextSharp.text.Font font = Volian.Svg.Library.VolianPdf.GetFont(sdf); - AddChunk("\u00A0", activeFont); - break; - case RtfVisualSpecialCharKind.OptionalHyphen: - AddChunk("\u00AD", activeFont); - break; - case RtfVisualSpecialCharKind.ParagraphNumberBegin: - break; - case RtfVisualSpecialCharKind.ParagraphNumberEnd: - break; - case RtfVisualSpecialCharKind.QmSpace: - break; - case RtfVisualSpecialCharKind.RightDoubleQuote: - AddChunk("\u201D", activeFont); - break; - case RtfVisualSpecialCharKind.RightSingleQuote: - AddChunk("\u2019", activeFont); - break; - case RtfVisualSpecialCharKind.Tabulator: - break; - default: - break; - } - } - private bool ContainsAllSymbols(string p) - { - foreach (char c in p) - if (c <= '\x7F') return false; - return true; - } - private bool ContainsAnySymbols(string p) - { - foreach (char c in p) - if (c > '\x7F' && c != '\xA0' && c != '\xB0') return true; - return false; - } - protected override void DoVisitText(IRtfVisualText visualText) - { - int profileDepth = ProfileTimer.Push(">>>> DoVisitText"); - if (visualText.Format.IsHidden) - { - ProfileTimer.Pop(profileDepth); - return; - } - iTextSharp.text.Font font = Volian.Svg.Library.VolianPdf.GetFont(visualText.Format.Font.Name, visualText.Format.FontSize, - (visualText.Format.IsBold ? iTextSharp.text.Font.BOLD : 0) + - (visualText.Format.IsItalic ? iTextSharp.text.Font.ITALIC : 0)); - font.Color = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(visualText.Format.ForegroundColor.AsDrawingColor)); - // The following line of code was added to allow for comparisons between the 16bit and 32bit pdf files. Without - // the size change, the overlays did not match up. It seems that the 16bit font size may be inaccurate - // and the 16bit conversion to be pdf may be off. - //if (font.Familyname.StartsWith("Arial") && font.Size == 11 && DoingComparison) font.Size = 11.15f; - iTextSharp.text.pdf.FontSelector fs = new FontSelector(); - // DEBUG - //if (visualText.Format.Font.Name != "VESymbFix" && ContainsAnySymbols(visualText.Text)) - //{ - // Console.WriteLine("Font: {0} TEXT: {1}", visualText.Format.Font.Name, ShowSpecialCharacters(visualText.Text)); - //} - if (visualText.Format.Font.Name == "VESymbFix" && ContainsAllSymbols(visualText.Text)) - { - fs.AddFont(font); - // if the symbol character cannot be found in VESymbFix then check/use the Consolas font - // We are using the VESymbFix font first because not all of the symbols that we use are in the Consolas font - // The Consolas font will give us other symbols that we don't have in VESymbFix (ex the Omega) - fs.AddFont(FontFactory.GetFont("Consolas", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, (visualText.Format.FontSize * 1.1F) / 2, - (visualText.Format.IsBold ? iTextSharp.text.Font.BOLD : 0) + - (visualText.Format.IsItalic ? iTextSharp.text.Font.ITALIC : 0), font.Color)); - Phrase ph = fs.Process(visualText.Text); - foreach (Chunk chk in ph.Chunks) - { - AdjustChunk(visualText, font, chk); - _MyParagraph.Add(chk); - } - } - else - { - // The bullet character for some unknown reason was entered in a text font rather than a symbol font - // switch from x25cf ot x2022 moves to a valid bullet character in the text font - Chunk chk = new Chunk(visualText.Text.Replace("\u25cf", "\u2022"), font); - AdjustChunk(visualText, font, chk); - _MyParagraph.Add(chk); - } - ProfileTimer.Pop(profileDepth); - } - - private void AdjustChunk(IRtfVisualText visualText, iTextSharp.text.Font font, Chunk chk) - { - if (visualText.Format.BackgroundColor.AsDrawingColor.ToArgb() != System.Drawing.Color.White.ToArgb()) - chk.SetBackground(new iTextSharp.text.Color(visualText.Format.BackgroundColor.AsDrawingColor)); - if (visualText.Format.IsStrikeThrough) - chk.SetUnderline(font.Color, 0, 0.05F, 0, .3F, PdfContentByte.LINE_CAP_ROUND); // Relative Based upon font size - if (visualText.Format.IsUnderline) - if (visualText.Format.SuperScript < 0) - { - if (PrintOverride.CompressSub) - { - float yoffundx = (_MyParagraph.Leading < 12 && font.Size >= 12) ? -0.06F : -0.18F; - chk.SetUnderline(font.Color, 0, 0.07F, 0, yoffundx, PdfContentByte.LINE_CAP_ROUND); // Relative Based upon font size - } - else - chk.SetUnderline(font.Color, 0, 0.05F, 0, -.381F, PdfContentByte.LINE_CAP_ROUND); // Relative Based upon font size - } - else if (visualText.Format.SuperScript > 0 && PrintOverride.CompressSuper) - { - float yoffundx = (_MyParagraph.Leading < 12 && font.Size >= 12) ? -0.06F : -0.18F; - chk.SetUnderline(font.Color, 0, 0.07F, 0, yoffundx, PdfContentByte.LINE_CAP_ROUND); - } - else - { - // If on a compressed printed step (Leading < 12) and a larger underlined font, then set the underlining - // a little less far down the page. Without this, the underline was touching the 2nd line of text, if it existed. - // Any plant that had compressed steps with the font size/underline would have this problem. An example - // was Braidwood FSG-6, high level steps. - float yoffund = (_MyParagraph.Leading < 12 && font.Size >= 12) ? -0.06F : -0.131F; - chk.SetUnderline(font.Color, 0, 0.05F, 0, yoffund, PdfContentByte.LINE_CAP_ROUND); // Relative Based upon font size - } - - if (visualText.Format.SuperScript > 0) - { - if (PrintOverride.CompressPropSubSup) - { - chk.SetTextRise(.33F * chk.Font.Size); - chk.Font.Size *= .75f; - } - else - { - chk.SetTextRise(.25F * chk.Font.Size); - if (PrintOverride.CompressSuper) chk.Font.Size = 9; - } - - } - else if (visualText.Format.SuperScript < 0) - { - if (PrintOverride.CompressPropSubSup) - chk.Font.Size *= .75f; - else - { - // if the subscript is not compressed or if it is compress but not underlined, then move it down - if (!PrintOverride.CompressSub || !visualText.Format.IsUnderline) chk.SetTextRise(-.25F * chk.Font.Size); - if (PrintOverride.CompressSub) chk.Font.Size = 9; - } - } - else - chk.SetTextRise(0); - switch (visualText.Format.Alignment) - { - case RtfTextAlignment.Center: - _MyParagraph.Alignment = Element.ALIGN_CENTER; - break; - case RtfTextAlignment.Justify: - _MyParagraph.Alignment = Element.ALIGN_JUSTIFIED; - break; - case RtfTextAlignment.Left: - _MyParagraph.Alignment = Element.ALIGN_LEFT; - break; - case RtfTextAlignment.Right: - _MyParagraph.Alignment = Element.ALIGN_RIGHT; - break; - default: - break; - } - if (_MyFont == null) - { - _MyFont = font; - _MyParagraph.Font = _MyFont; - } - } - - private string ShowSpecialCharacters(string p) - { - StringBuilder sb = new StringBuilder(); - foreach (char c in p) - { - int i = (int)c; - if (i < 20 || i > 127) - sb.Append(string.Format("<{0:x}>", i)); - else - sb.Append(c); - } - return sb.ToString(); - }// DoVisitText - - - // ---------------------------------------------------------------------- - protected override void DoVisitImage(IRtfVisualImage visualImage) - { - //_MyParagraph.Add(new Chunk("")); - DateTime dt1 = DateTime.Now; - //System.Drawing.Image img2 = visualImage.ImageForDrawing; - //Console.WriteLine("1 Time Span {0}", TimeSpan.FromTicks(DateTime.Now.Ticks - dt1.Ticks).TotalMilliseconds); - //img2.Save(@"c:\datacvrt\x.png"); - System.IO.MemoryStream ms = new System.IO.MemoryStream(); - - //Console.WriteLine("2 Time Span {0}", TimeSpan.FromTicks(DateTime.Now.Ticks - dt1.Ticks).TotalMilliseconds); - Console.WriteLine("Size {0}", visualImage.ImageForDrawing.Size); - visualImage.ImageForDrawing.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); - //Console.WriteLine("3 Time Span {0}", TimeSpan.FromTicks(DateTime.Now.Ticks - dt1.Ticks).TotalMilliseconds); - ms.Seek(0, System.IO.SeekOrigin.Begin); - //Console.WriteLine("4 Time Span {0}", TimeSpan.FromTicks(DateTime.Now.Ticks - dt1.Ticks).TotalMilliseconds); - iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(ms); - //Console.WriteLine("5 Time Span {0}", TimeSpan.FromTicks(DateTime.Now.Ticks - dt1.Ticks).TotalMilliseconds); - _MyParagraph.Add(img); - Console.WriteLine("6 Time Span {0}", TimeSpan.FromTicks(DateTime.Now.Ticks - dt1.Ticks).TotalMilliseconds); - } // DoVisitImage - - } -} diff --git a/PROMS/PROMS/proms.sln b/PROMS/PROMS/proms.sln deleted file mode 100644 index 2a895c9a..00000000 --- a/PROMS/PROMS/proms.sln +++ /dev/null @@ -1,111 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataLoader", "DataLoader\DataLoader.csproj", "{8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volian.Controls.Library", "Volian.Controls.Library\Volian.Controls.Library.csproj", "{8556527C-6615-487F-8AF7-22EBC3EF0268}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Volian.Utils.Library", "Volian.Utils.Library", "{5A0EDD18-70A4-4D5E-93CC-39F4D246352A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IniReader", "Volian.Utils.Library\IniReader\IniReader.csproj", "{889E30F7-CFBC-470D-9488-7009C354F9C9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSWord", "Volian.Utils.Library\MSWord\MSWord.csproj", "{2F79D7F9-885E-4441-99F3-045D7612B2E5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vlnObjectLibrary", "Volian.Utils.Library\vlnObject\vlnObjectLibrary.csproj", "{933269F5-C3AD-423E-88EB-133A7333FD6B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vlnServerLibrary", "Volian.Utils.Library\vlnServerLibrary\vlnServerLibrary.csproj", "{F9B53DDC-2A2E-4A17-B777-4EC0EE585DE2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "veproms", "veproms\veproms.csproj", "{0D8723B4-51DD-486A-A5E1-8D55BB526690}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volian.CSLA.Library", "Volian.CSLA.Library\Volian.CSLA.Library.csproj", "{3C162BD7-5DBC-45A6-90D8-9391AC8CD0FD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volian.Object.Library", "Volian.Object.Library\Volian.Object.Library.csproj", "{B8BED4CF-D60A-4CC0-B652-CEFA04B774B1}" -EndProject -Global - GlobalSection(SourceCodeControl) = preSolution - SccNumberOfProjects = 10 - SccLocalPath0 = . - SccProjectUniqueName1 = DataLoader\\DataLoader.csproj - SccLocalPath1 = . - SccProjectFilePathRelativizedFromConnection1 = DataLoader\\ - SccProjectUniqueName2 = veproms\\veproms.csproj - SccLocalPath2 = . - SccProjectFilePathRelativizedFromConnection2 = veproms\\ - SccProjectUniqueName3 = Volian.Controls.Library\\Volian.Controls.Library.csproj - SccLocalPath3 = . - SccProjectFilePathRelativizedFromConnection3 = Volian.Controls.Library\\ - SccProjectUniqueName4 = Volian.CSLA.Library\\Volian.CSLA.Library.csproj - SccLocalPath4 = . - SccProjectFilePathRelativizedFromConnection4 = Volian.CSLA.Library\\ - SccProjectUniqueName5 = Volian.Utils.Library\\IniReader\\IniReader.csproj - SccProjectTopLevelParentUniqueName5 = proms.sln - SccLocalPath5 = . - SccProjectFilePathRelativizedFromConnection5 = Volian.Utils.Library\\IniReader\\ - SccProjectUniqueName6 = Volian.Utils.Library\\MSWord\\MSWord.csproj - SccProjectTopLevelParentUniqueName6 = proms.sln - SccLocalPath6 = . - SccProjectFilePathRelativizedFromConnection6 = Volian.Utils.Library\\MSWord\\ - SccProjectUniqueName7 = Volian.Utils.Library\\vlnObject\\vlnObjectLibrary.csproj - SccProjectTopLevelParentUniqueName7 = proms.sln - SccLocalPath7 = . - SccProjectFilePathRelativizedFromConnection7 = Volian.Utils.Library\\vlnObject\\ - SccProjectUniqueName8 = Volian.Utils.Library\\vlnServerLibrary\\vlnServerLibrary.csproj - SccProjectTopLevelParentUniqueName8 = proms.sln - SccLocalPath8 = . - SccProjectFilePathRelativizedFromConnection8 = Volian.Utils.Library\\vlnServerLibrary\\ - SccProjectUniqueName9 = Volian.Object.Library\\Volian.Object.Library.csproj - SccLocalPath9 = . - SccProjectFilePathRelativizedFromConnection9 = Volian.Object.Library\\ - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E239A2B-B38C-4CD5-BA0D-A41A88BD2AEE}.Release|Any CPU.Build.0 = Release|Any CPU - {8556527C-6615-487F-8AF7-22EBC3EF0268}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8556527C-6615-487F-8AF7-22EBC3EF0268}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8556527C-6615-487F-8AF7-22EBC3EF0268}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8556527C-6615-487F-8AF7-22EBC3EF0268}.Release|Any CPU.Build.0 = Release|Any CPU - {889E30F7-CFBC-470D-9488-7009C354F9C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {889E30F7-CFBC-470D-9488-7009C354F9C9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {889E30F7-CFBC-470D-9488-7009C354F9C9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {889E30F7-CFBC-470D-9488-7009C354F9C9}.Release|Any CPU.Build.0 = Release|Any CPU - {2F79D7F9-885E-4441-99F3-045D7612B2E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2F79D7F9-885E-4441-99F3-045D7612B2E5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2F79D7F9-885E-4441-99F3-045D7612B2E5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2F79D7F9-885E-4441-99F3-045D7612B2E5}.Release|Any CPU.Build.0 = Release|Any CPU - {933269F5-C3AD-423E-88EB-133A7333FD6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {933269F5-C3AD-423E-88EB-133A7333FD6B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {933269F5-C3AD-423E-88EB-133A7333FD6B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {933269F5-C3AD-423E-88EB-133A7333FD6B}.Release|Any CPU.Build.0 = Release|Any CPU - {F9B53DDC-2A2E-4A17-B777-4EC0EE585DE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F9B53DDC-2A2E-4A17-B777-4EC0EE585DE2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F9B53DDC-2A2E-4A17-B777-4EC0EE585DE2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F9B53DDC-2A2E-4A17-B777-4EC0EE585DE2}.Release|Any CPU.Build.0 = Release|Any CPU - {0D8723B4-51DD-486A-A5E1-8D55BB526690}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0D8723B4-51DD-486A-A5E1-8D55BB526690}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0D8723B4-51DD-486A-A5E1-8D55BB526690}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0D8723B4-51DD-486A-A5E1-8D55BB526690}.Release|Any CPU.Build.0 = Release|Any CPU - {3C162BD7-5DBC-45A6-90D8-9391AC8CD0FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3C162BD7-5DBC-45A6-90D8-9391AC8CD0FD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3C162BD7-5DBC-45A6-90D8-9391AC8CD0FD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3C162BD7-5DBC-45A6-90D8-9391AC8CD0FD}.Release|Any CPU.Build.0 = Release|Any CPU - {B8BED4CF-D60A-4CC0-B652-CEFA04B774B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B8BED4CF-D60A-4CC0-B652-CEFA04B774B1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B8BED4CF-D60A-4CC0-B652-CEFA04B774B1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B8BED4CF-D60A-4CC0-B652-CEFA04B774B1}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {889E30F7-CFBC-470D-9488-7009C354F9C9} = {5A0EDD18-70A4-4D5E-93CC-39F4D246352A} - {2F79D7F9-885E-4441-99F3-045D7612B2E5} = {5A0EDD18-70A4-4D5E-93CC-39F4D246352A} - {933269F5-C3AD-423E-88EB-133A7333FD6B} = {5A0EDD18-70A4-4D5E-93CC-39F4D246352A} - {F9B53DDC-2A2E-4A17-B777-4EC0EE585DE2} = {5A0EDD18-70A4-4D5E-93CC-39F4D246352A} - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/AssemblyInfo.cs b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/AssemblyInfo.cs index 893433cd..02cbcbe1 100644 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/AssemblyInfo.cs +++ b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/AssemblyInfo.cs @@ -23,8 +23,8 @@ using System.Runtime.CompilerServices; // Build YYMM (two digit year, two digit month) // Revision DHH (day - no leading zero, two digit hour - military time // -[assembly: AssemblyVersion("2.3.2410.907")] -[assembly: AssemblyFileVersion("2.3.2410.907")] +[assembly: AssemblyVersion("2.4.2608.2507")] +[assembly: AssemblyFileVersion("2.4.2608.2507")] // // In order to sign your assembly you must specify a key to use. Refer to the @@ -93,6 +93,8 @@ using System.Runtime.CompilerServices; + + diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.sln b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.sln deleted file mode 100644 index e4558b4d..00000000 --- a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.sln +++ /dev/null @@ -1,212 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.32901.82 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ROEditor", "ROEditor.csproj", "{3A4A3543-2D44-11D6-8452-00A0CC271352}" - ProjectSection(ProjectDependencies) = postProject - {6D44F537-879E-11D6-84B8-00A0CC271352} = {6D44F537-879E-11D6-84B8-00A0CC271352} - {DECA8343-6351-11D6-8487-00A0CC271352} = {DECA8343-6351-11D6-8487-00A0CC271352} - {0C782592-AA05-11D6-84D1-00A0CC271352} = {0C782592-AA05-11D6-84D1-00A0CC271352} - {551CB7B3-00B1-11D7-8590-482B59000000} = {551CB7B3-00B1-11D7-8590-482B59000000} - {0C7825FD-AA05-11D6-84D1-00A0CC271352} = {0C7825FD-AA05-11D6-84D1-00A0CC271352} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VlnStatus", "..\..\..\LibSource\VlnStatus\VlnStatus.csproj", "{551CB7B3-00B1-11D7-8590-482B59000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ROFields", "..\..\..\LibSource\ROField\ROFields.csproj", "{0C782592-AA05-11D6-84D1-00A0CC271352}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DBEncapsulation", "..\..\..\LibSource\DBEncapsulation\DBEncapsulation.csproj", "{6D44F537-879E-11D6-84B8-00A0CC271352}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RODBInterface", "..\..\..\LibSource\RODBInterface\RODBInterface.csproj", "{0C7825FD-AA05-11D6-84D1-00A0CC271352}" - ProjectSection(ProjectDependencies) = postProject - {6D44F537-879E-11D6-84B8-00A0CC271352} = {6D44F537-879E-11D6-84B8-00A0CC271352} - {0C782592-AA05-11D6-84D1-00A0CC271352} = {0C782592-AA05-11D6-84D1-00A0CC271352} - {551CB7B3-00B1-11D7-8590-482B59000000} = {551CB7B3-00B1-11D7-8590-482B59000000} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ctlXMLEditLib", "..\..\..\LibSource\ctlXMLEditLib\ctlXMLEditLib.csproj", "{DECA8343-6351-11D6-8487-00A0CC271352}" - ProjectSection(ProjectDependencies) = postProject - {0C7825FD-AA05-11D6-84D1-00A0CC271352} = {0C7825FD-AA05-11D6-84D1-00A0CC271352} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VlnProfiler", "..\..\..\LibSource\VlnProfiler\VlnProfiler.csproj", "{38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ROFST", "..\..\..\LibSource\ROFST\ROFST.csproj", "{134D8938-9CDC-4712-9444-D5DCC6638AB6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.Mentalis.Files", "..\..\..\LibSource\Org.Mentalis.Files\Org.Mentalis.Files.csproj", "{A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utils", "..\..\..\LibSource\Utils\Utils.csproj", "{680054D3-49C4-40E7-92A5-67B97DCE6308}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Win32 = Debug|Win32 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|Win32 = Release|Win32 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Debug|Win32.ActiveCfg = Debug|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Debug|x86.ActiveCfg = Debug|x86 - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Debug|x86.Build.0 = Debug|x86 - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Release|Any CPU.Build.0 = Release|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Release|Win32.ActiveCfg = Release|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Release|x86.ActiveCfg = Release|x86 - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Release|x86.Build.0 = Release|x86 - {551CB7B3-00B1-11D7-8590-482B59000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Debug|Win32.ActiveCfg = Debug|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Debug|x86.ActiveCfg = Debug|x86 - {551CB7B3-00B1-11D7-8590-482B59000000}.Debug|x86.Build.0 = Debug|x86 - {551CB7B3-00B1-11D7-8590-482B59000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Release|Any CPU.Build.0 = Release|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Release|Win32.ActiveCfg = Release|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Release|x86.ActiveCfg = Release|x86 - {551CB7B3-00B1-11D7-8590-482B59000000}.Release|x86.Build.0 = Release|x86 - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug|Win32.ActiveCfg = Debug|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug|x86.ActiveCfg = Debug|x86 - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug|x86.Build.0 = Debug|x86 - {0C782592-AA05-11D6-84D1-00A0CC271352}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Release|Any CPU.Build.0 = Release|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Release|Win32.ActiveCfg = Release|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Release|x86.ActiveCfg = Release|x86 - {0C782592-AA05-11D6-84D1-00A0CC271352}.Release|x86.Build.0 = Release|x86 - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug|Win32.ActiveCfg = Debug|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug|x86.ActiveCfg = Debug|x86 - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug|x86.Build.0 = Debug|x86 - {6D44F537-879E-11D6-84B8-00A0CC271352}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Release|Any CPU.Build.0 = Release|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Release|Win32.ActiveCfg = Release|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Release|x86.ActiveCfg = Release|x86 - {6D44F537-879E-11D6-84B8-00A0CC271352}.Release|x86.Build.0 = Release|x86 - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug|Win32.ActiveCfg = Debug|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug|x86.ActiveCfg = Debug|x86 - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug|x86.Build.0 = Debug|x86 - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release|Any CPU.Build.0 = Release|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release|Win32.ActiveCfg = Release|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release|x86.ActiveCfg = Release|x86 - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release|x86.Build.0 = Release|x86 - {DECA8343-6351-11D6-8487-00A0CC271352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Debug|Win32.ActiveCfg = Debug|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Debug|x86.ActiveCfg = Debug|x86 - {DECA8343-6351-11D6-8487-00A0CC271352}.Debug|x86.Build.0 = Debug|x86 - {DECA8343-6351-11D6-8487-00A0CC271352}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Release|Any CPU.Build.0 = Release|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Release|Win32.ActiveCfg = Release|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Release|x86.ActiveCfg = Release|x86 - {DECA8343-6351-11D6-8487-00A0CC271352}.Release|x86.Build.0 = Release|x86 - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Debug|Win32.ActiveCfg = Debug|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Debug|x86.ActiveCfg = Debug|x86 - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Debug|x86.Build.0 = Debug|x86 - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Release|Any CPU.Build.0 = Release|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Release|Win32.ActiveCfg = Release|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Release|x86.ActiveCfg = Release|x86 - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Release|x86.Build.0 = Release|x86 - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Debug|Win32.ActiveCfg = Debug|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Debug|x86.ActiveCfg = Debug|x86 - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Debug|x86.Build.0 = Debug|x86 - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Release|Any CPU.Build.0 = Release|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Release|Win32.ActiveCfg = Release|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Release|x86.ActiveCfg = Release|x86 - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Release|x86.Build.0 = Release|x86 - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Debug|Win32.ActiveCfg = Debug|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Debug|x86.ActiveCfg = Debug|x86 - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Debug|x86.Build.0 = Debug|x86 - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Release|Any CPU.Build.0 = Release|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Release|Win32.ActiveCfg = Release|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Release|x86.ActiveCfg = Release|x86 - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Release|x86.Build.0 = Release|x86 - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Debug|Any CPU.Build.0 = Debug|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Debug|Win32.ActiveCfg = Debug|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Debug|x86.ActiveCfg = Debug|x86 - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Debug|x86.Build.0 = Debug|x86 - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Release|Any CPU.ActiveCfg = Release|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Release|Any CPU.Build.0 = Release|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Release|Win32.ActiveCfg = Release|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Release|x86.ActiveCfg = Release|x86 - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {4814B42F-2708-4185-8450-20347EB2FDF6} - EndGlobalSection - GlobalSection(SourceCodeControl) = preSolution - SccNumberOfProjects = 5 - SccProjectName0 = \u0022$/PROMS/ReferencedObjects/ROEditor\u0022,\u0020XSEAAAAA - SccLocalPath0 = ..\\..\\.. - SccProvider0 = MSSCCI:Microsoft\u0020Visual\u0020SourceSafe - SccProjectFilePathRelativizedFromConnection0 = Exe\\RefObj\\ROEditor\\ - SccProjectUniqueName1 = ..\\..\\..\\LibSource\\Org.Mentalis.Files\\Org.Mentalis.Files.csproj - SccLocalPath1 = ..\\..\\.. - SccProjectFilePathRelativizedFromConnection1 = LibSource\\Org.Mentalis.Files\\ - SccProjectUniqueName2 = ..\\..\\..\\LibSource\\ROFST\\ROFST.csproj - SccLocalPath2 = ..\\..\\.. - SccProjectFilePathRelativizedFromConnection2 = LibSource\\ROFST\\ - SccProjectUniqueName3 = ..\\..\\..\\LibSource\\Utils\\Utils.csproj - SccLocalPath3 = ..\\..\\.. - SccProjectFilePathRelativizedFromConnection3 = LibSource\\Utils\\ - SccProjectUniqueName4 = ..\\..\\..\\LibSource\\VlnProfiler\\VlnProfiler.csproj - SccLocalPath4 = ..\\..\\.. - SccProjectFilePathRelativizedFromConnection4 = LibSource\\VlnProfiler\\ - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.vsscc b/PROMS/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.vsscc deleted file mode 100644 index e07954777a4d1ce9bff2928cf9b56bc49ccb86e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 48 xcmezW&x;|Ep_0LX!IhzcA(bJ9AqYsOG59kiF=T;x{y>=&hD?SMhJ1!11^^=23TyxX diff --git a/PROMS/ReferencedObjects/Exe/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.csproj b/PROMS/ReferencedObjects/Exe/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.csproj deleted file mode 100644 index adb2c251..00000000 --- a/PROMS/ReferencedObjects/Exe/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.csproj +++ /dev/null @@ -1,242 +0,0 @@ - - - - bin\x86\Release\ - TRACE;Upgrade2005; - 285212672 - true - - - x86 - prompt - - - Local - 8.0.50727 - 2.0 - {3A4A3543-2D44-11D6-8452-00A0CC271352} - Debug - AnyCPU - App.ico - - - ROEditor - - - JScript - Grid - IE50 - false - WinExe - ROEditor - OnBuildSuccess - ROEditor.Form1 - - - - - v3.5 - 2.0 - "%24/PROMS/ReferencedObjects/ROEditor", XSEAAAAA - ..\..\.. - - MSSCCI:Microsoft Visual SourceSafe - - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - - TRACE;Upgrade2005; - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - - - true - ..\..\..\..\VEPROMS User Interface\bin\Debug\ - DEBUG;TRACE - 285212672 - full - x86 - prompt - - - - System - - - System.Data - - - System.Drawing - - - System.Windows.Forms - - - System.XML - - - - - Form - - - AboutROEditor.cs - - - Code - - - Form - - - Form - - - Form - - - Form - - - Form - - - True - True - Resources.resx - - - Form - - - Form - - - Code - - - Designer - AboutROEditor.cs - - - FieldCombFrm.cs - Designer - - - FieldTextFrm.cs - Designer - - - FieldTypeDefFrm.cs - Designer - - - GroupDefFrm.cs - Designer - - - GroupNewFrm.cs - Designer - - - Designer - ResXFileCodeGenerator - Resources.Designer.cs - - - RODefFrm.cs - Designer - - - - ROEditor.cs - Designer - - - - - - - - - - - {AEEE9FD1-6892-45E2-A67E-418C06D46FF9} - Volian.Base.Library - - - {DECA8343-6351-11D6-8487-00A0CC271352} - ctlXMLEditLib - - - {6D44F537-879E-11D6-84B8-00A0CC271352} - DBEncapsulation - - - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04} - Org.Mentalis.Files - - - {0C7825FD-AA05-11D6-84D1-00A0CC271352} - RODBInterface - - - {0C782592-AA05-11D6-84D1-00A0CC271352} - ROFields - - - {134D8938-9CDC-4712-9444-D5DCC6638AB6} - ROFST - - - {551CB7B3-00B1-11D7-8590-482B59000000} - VlnStatus - - - - - cmd /c "$(ProjectDir)FixRev.bat" - - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjects/Exe/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.sln b/PROMS/ReferencedObjects/Exe/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.sln deleted file mode 100644 index 668302d8..00000000 --- a/PROMS/ReferencedObjects/Exe/ReferencedObjects/Exe/RefObj/ROEditor/ROEditor.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.32901.82 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ROEditor", "ROEditor.csproj", "{3A4A3543-2D44-11D6-8452-00A0CC271352}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Debug|x86.ActiveCfg = Debug|x86 - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Debug|x86.Build.0 = Debug|x86 - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Release|Any CPU.Build.0 = Release|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Release|x86.ActiveCfg = Release|x86 - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {7CEE041D-449C-4B54-B381-6845BD8E9B79} - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.sln b/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.sln deleted file mode 100644 index 9f600430..00000000 --- a/PROMS/ReferencedObjects/LibSource/RODBInterface/RODBInterface.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.32901.82 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RODBInterface", "RODBInterface.csproj", "{0C7825FD-AA05-11D6-84D1-00A0CC271352}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug|x86.ActiveCfg = Debug|x86 - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug|x86.Build.0 = Debug|x86 - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release|Any CPU.Build.0 = Release|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release|x86.ActiveCfg = Release|x86 - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {59F24713-865F-46BB-907B-46D78C3F7DA4} - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/App.ico b/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/App.ico deleted file mode 100644 index 3a5525fd794f7a7c5c8e6187f470ea3af38cd2b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1078 zcmeHHJr05}7=1t!Hp3A*8IHkVf+j?-!eHY14Gtcw1Eb*_9>Bq^zETJ@GKj{_2j4$w zo9}xCh!8{T3=X##Skq>ikMjsvB|y%crWBM2iW(4pI}c%z6%lW!=~4v77#3{z!dmB1 z__&l)-{KUYR+|8|;wB^R|9ET$J@(@=#rd^=)qs85?vAy(PSF5CyNkus435LVkZ$rj zNw|JG-P7^hF<(;#o*Vk}5R#e|^13tBbQkeF?djULtvqyxd3<{9 diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/AssemblyInfo.cs deleted file mode 100644 index 7e3b35a5..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/AssemblyInfo.cs.bak deleted file mode 100644 index 6b2b0662..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/CmpRpt.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/CmpRpt.cs deleted file mode 100644 index 15e724d4..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/CmpRpt.cs +++ /dev/null @@ -1,206 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: CmpRpt.cs $ $Revision: 3 $ - * $Author: Jsj $ $Date: 6/08/05 4:31p $ - * - * $History: CmpRpt.cs $ - * - * ***************** Version 3 ***************** - * User: Jsj Date: 6/08/05 Time: 4:31p - * Updated in $/EXE/RefObj/CmpRpt - * cleanup - * - * ***************** Version 2 ***************** - * User: Jsj Date: 1/08/04 Time: 2:51p - * Updated in $/EXE/RefObj/CmpRpt - * constructor of RODB() class changed - * - * ***************** Version 1 ***************** - * User: Kathy Date: 11/11/02 Time: 7:17a - * Created in $/EXE/RefObj/CmpRpt - *********************************************************************************************/ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.IO; -using System.Data; -using RODBInterface; - - -// CmpRpt reads data for the RO database and puts the data into the -// temporary file, 'print.tmp'. After this, it is sorted and printed. -namespace CmpRpt -{ - // Form1 just acts as the container for this app. - public class Form1 : System.Windows.Forms.Form - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public Form1() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - // - // Form1 - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(292, 273); - this.Name = "Form1"; - this.Text = "Form1"; - - } - #endregion - - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main(string[] args) - { - bool success; - VlnXmlElement rootXml; - VlnXmlDocument myroXmlDoc; - string recid=null; - string tbl=null; - RODB myrodb=null; - - // the next two lists contain group headers for the reports. - ArrayList headers = new ArrayList(); - ArrayList reversehdrs = new ArrayList(); - - if (args.Length <= 0) return; - // if an RO directory path was passed in, then change the - // current working directory to it. - // this path will also be used to generate a connection string - // for the Access database. - if (args.Length == 2) - { -// MessageBox.Show(args[1],"args[1]"); - string path = args[0]; - Directory.SetCurrentDirectory(path); - tbl = args[1].Substring(0,4); - recid = args[1].Substring(4,8); -// myrodb = new RODB(path); - } - else - { - tbl = args[0].Substring(0,4); - recid = args[0].Substring(4,8); -// myrodb = new RODB(Directory.GetCurrentDirectory()); - } - myrodb = new RODB(Directory.GetCurrentDirectory()); - VlnXmlElement rptele=null; - - // Add the root to the tree - myroXmlDoc = myrodb.RODB_GetRoot(); - rootXml = (VlnXmlElement) myroXmlDoc.FirstChild; - success = myrodb.RODB_GetRootGroups(rootXml); - if (success == false) return; - - // if the table & recid = all zeros, we have a request - // for all ROs, otherwise it's a request for specific RO(s) - if (tbl == "0000" && recid == "00000000") - { - // the report element becomes the root. - rptele = rootXml; - } - else - { - // from the input tbl string, get a table name. - int itbl = System.Convert.ToInt32(tbl,16); - string stbl = System.Convert.ToString(itbl,10); - string pstbl = stbl.PadLeft(6,'0'); - string tbname = "RO" + pstbl; - - // read in this element from the table. - rptele = myrodb.RODB_ReadRO(tbname, recid); - - VlnXmlElement parent; - string parentid; - parentid = rptele.GetAttribute("ParentID"); - string rpteleParentid = parentid; - - // walk up tree to get the path through the tree. - VlnXmlElement child = rptele; - while (parentid != null && parentid != "00000000") - { - parent = myrodb.RODB_ReadRO(tbname, parentid); - if (parent != null) - { - parentid = parent.GetAttribute("ParentID"); - if (parentid == "00000000") - { - reversehdrs.Add(parent.InnerText); - break; - } - parent.AppendChild(child); - child = parent; - reversehdrs.Add(parent.GetAttribute("MenuTitle")); - } - else - parentid = null; - } - - // Now hook this into the top part of tree by looking at the table - // names. - VlnXmlElement group = (VlnXmlElement) rootXml.FirstChild; - while (group != null) - { - string curtbname = group.GetAttribute("Table"); - // hook it in here. - if (curtbname == tbname) - { - if (rpteleParentid != "00000000") - group.AppendChild(child); - else // if this is a top group, just reset rept ele - rptele = group; - break; - } - group = (VlnXmlElement) group.NextSibling; - } - // Set up the headers array, it's in reverse order since we walked - // up the tree, not down. - int cnt = reversehdrs.Count; - for (int i=cnt-1; i>=0; i--) - headers.Add(reversehdrs[i]); - } - - rptele.Show(myrodb,headers); - - } - } -} diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/CmpRpt.csproj b/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/CmpRpt.csproj deleted file mode 100644 index 4ea10231..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/CmpRpt.csproj +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/CmpRpt.resx b/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/CmpRpt.resx deleted file mode 100644 index add6c98e..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/CmpRpt.resx +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Form1 - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/CmpRpt.sln b/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/CmpRpt.sln deleted file mode 100644 index 7af5537b..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/CmpRpt.sln +++ /dev/null @@ -1,39 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CmpRpt", "CmpRpt.csproj", "{C4293263-EA9C-11D6-8515-00A0CC271352}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DBEncapsulation", "..\..\..\LibSource\DBEncapsulation\DBEncapsulation.csproj", "{6D44F537-879E-11D6-84B8-00A0CC271352}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RODBInterface", "..\..\..\LibSource\RODBInterface\RODBInterface.csproj", "{0C7825FD-AA05-11D6-84D1-00A0CC271352}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ROFields", "..\..\..\LibSource\ROField\ROFields.csproj", "{0C782592-AA05-11D6-84D1-00A0CC271352}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {C4293263-EA9C-11D6-8515-00A0CC271352}.Debug.ActiveCfg = Debug|.NET - {C4293263-EA9C-11D6-8515-00A0CC271352}.Debug.Build.0 = Debug|.NET - {C4293263-EA9C-11D6-8515-00A0CC271352}.Release.ActiveCfg = Release|.NET - {C4293263-EA9C-11D6-8515-00A0CC271352}.Release.Build.0 = Release|.NET - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug.ActiveCfg = Debug|.NET - {6D44F537-879E-11D6-84B8-00A0CC271352}.Release.ActiveCfg = Release|.NET - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug.ActiveCfg = Debug|.NET - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release.ActiveCfg = Release|.NET - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug.ActiveCfg = Debug|.NET - {0C782592-AA05-11D6-84D1-00A0CC271352}.Release.ActiveCfg = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/app.config b/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/app.config deleted file mode 100644 index 97bf3116..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/CmpRpt/app.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/App.ico b/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/App.ico deleted file mode 100644 index b0936becc9bef13a969fe7ca35791f72ba9cd2f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1078 zcmb_bv2MaJ5WNs2QWXh2w3euVOcj4o28K@kmU?nGT&WU_T|4zx{3(nb85t1ndv+2M zq^hb^!#m%*dv|s&Ad*Q>#^bSYEi#dN>}8qwS5M>#u?1p`lt3nZSP>U(GR&n4a+i|M zMGY-nz=`)B`4GPn0zCj9hG;}S-f7RvJ}3WTA6OgX*2V;A3~;NJ%x_+m+Bi6wQslqv z$F<1ep^N=oWH%D=13W{{7HKEH)N)QGumtKkVZ6=y$2m1U;SAdZbMY-curh4tF{bzu zDhUS1bevmdSZ<8f)@q}TvaB{()*4I8en=Rjl-7{3Uz3L>>Y1qO*^jN`iSaxSj=C+D zL);I=;+&#jfcJ%7Yh5^2xcEHOCte^1eZyr-Rf|&qZYw<*?yqdsFL7MWq<#(W?c(=>$RB!t6_6S)R7Fajn3 jWAquj0&amjVCwSY%;l%K%LDNVgrDG%+W~vvus-7(;1btc diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/AssemblyInfo.cs deleted file mode 100644 index 7e3b35a5..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/AssemblyInfo.cs.bak deleted file mode 100644 index 6b2b0662..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/ConvertParadoxROs.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/ConvertParadoxROs.cs deleted file mode 100644 index b58ca997..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/ConvertParadoxROs.cs +++ /dev/null @@ -1,1535 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ConvertParadoxROs.cs $ $Revision: 16 $ - * $Author: Jsj $ $Date: 8/02/04 11:02a $ - * - * $History: ConvertParadoxROs.cs $ - * - * ***************** Version 16 ***************** - * User: Jsj Date: 8/02/04 Time: 11:02a - * Updated in $/EXE/RefObj/ParadoxConversion - * Bug fix B2004-028 added check of local defined fields when checking if - * the field we are converting is a combo field. - * - * ***************** Version 15 ***************** - * User: Kathy Date: 10/15/03 Time: 10:29a - * Updated in $/EXE/RefObj/ParadoxConversion - * Found/fix during debugging of B2003-060 (will go through QA process - * with that bug fix) - * - * ***************** Version 14 ***************** - * User: Kathy Date: 3/13/03 Time: 1:15p - * Updated in $/EXE/RefObj/ParadoxConversion - * master different than local field name, use local - * - * ***************** Version 13 ***************** - * User: Jsj Date: 1/22/03 Time: 12:49p - * Updated in $/EXE/RefObj/ParadoxConversion - * remove old paradox user and lock files before trying the convert. Was - * not able to open the paradox master file. - * - * ***************** Version 12 ***************** - * User: Jsj Date: 1/06/03 Time: 12:56p - * Updated in $/EXE/RefObj/ParadoxConversion - * uses a special ROMASTER.MDB to convert data, will now remove temporary - * TXT files if the DEBUG switch is not passed in. - * - * ***************** Version 11 ***************** - * User: Jsj Date: 12/19/02 Time: 9:17a - * Updated in $/EXE/RefObj/ParadoxConversion - * now modifies the VEPROMS INI file if it has a [Graphics] section - * - * ***************** Version 10 ***************** - * User: Jsj Date: 12/18/02 Time: 9:01a - * Updated in $/EXE/RefObj/ParadoxConversion - * fix for IP2 and FNP data - * - * ***************** Version 9 ***************** - * User: Jsj Date: 12/06/02 Time: 3:20p - * Updated in $/EXE/RefObj/ParadoxConversion - * added Debug and new function to replace invalid characters in the field - * names - * - * ***************** Version 8 ***************** - * User: Jsj Date: 12/04/02 Time: 11:01a - * Updated in $/EXE/RefObj/ParadoxConversion - * added logic to handle Parameter Display Data data - * - * ***************** Version 7 ***************** - * User: Jsj Date: 11/27/02 Time: 1:39p - * Updated in $/EXE/RefObj/ParadoxConversion - * Handle - and / in field names - * - * ***************** Version 6 ***************** - * User: Jsj Date: 10/15/02 Time: 11:39a - * Updated in $/EXE/RefObj/ParadoxConversion - * added "a" to combo field names in non-master tables. - * - * ***************** Version 5 ***************** - * User: Jsj Date: 10/04/02 Time: 2:02p - * Updated in $/EXE/RefObj/ParadoxConversion - * added better user interface - * - * ***************** Version 4 ***************** - * User: Jsj Date: 9/27/02 Time: 2:57p - * Updated in $/EXE/RefObj/ParadoxConversion - * Fixed Graphic image information storage - * - * ***************** Version 3 ***************** - * User: Jsj Date: 9/26/02 Time: 4:17p - * Updated in $/EXE/RefObj/ParadoxConversion - * There was a leading space in all of the field values - is now fixed. - * - * ***************** Version 2 ***************** - * User: Jsj Date: 9/25/02 Time: 10:19a - * Updated in $/EXE/RefObj/ParadoxConversion - * added header - *********************************************************************************************/ - -using System; -using System.Collections; -using System.IO; -using System.Xml; -using System.Windows.Forms; // Application.StartupPath -using System.Diagnostics; -using DBEncapsulation; -using ROFields; - -namespace ParadoxConversion -{ - /// - /// This class contains the functions needed to convert the old Paradox RO Database - /// to a newer type database. - /// - public class ConvertParadoxROs - { - System.Windows.Forms.Label StatusWin; - bool ProcessingMasterTable = false; - bool DoDebugFile = false; - BinaryReader BReader; // read text file as binary (for chars like hard spaces) - BinaryWriter BWrite; // for a debug file - String AppPath; - String ROConvertPath; - String ROPath; - String LineOfText; - String ROTableName, ROTblElmt; - String RecID, RecType, ParentRecID, AccPageID, DateTime, Info, GroupTitle; - int intRecType = 0; - int CurrentFieldType = 0; - int NumCRLFs = 0; - XmlTextWriter xmlTxtWriter = null; - RODBRecordInterface MyDbRec; - ROField NewDbField; - struct FieldInfo - { - public String fldRecID; // Field Record ID - public String fldName; // Field name - public String fldType; - }; - ArrayList MasterFieldInfoList = new ArrayList(); - ArrayList LocalFieldInfoList = new ArrayList(); - - struct GroupTitles - { - public String GrpRecID; - public String GrpTitle; - } - ArrayList GroupTitlesList = new ArrayList(); - - public void OpenTextFile(String FName) - { - BReader = new BinaryReader(File.Open(FName,System.IO.FileMode.Open,System.IO.FileAccess.ReadWrite)); - } - - public void CloseTextFile() - { - BReader.Close(); - } - - public String TxF_ReadLine() - { - bool success = true; - String TxFstr = ""; - byte rdByte = 0; - if (BReader != null) - { - NumCRLFs = 0; - while (success) - { - try - { - rdByte = BReader.ReadByte(); - } - catch (Exception e) - { - success = false; - TxFstr = null; - } - if (rdByte == 0x0D) // carrage return (end of line) - { - NumCRLFs++; - rdByte = BReader.ReadByte(); // read the new line character - if (rdByte == 0x0D) // sometimes there's an extra carrage return - { - rdByte = BReader.ReadByte(); - NumCRLFs++; - } - success = false; // to stop the loop - } - if (success) - { - TxFstr += Convert.ToString(Convert.ToChar(rdByte)); - } - } - } - return TxFstr; - } - -/*** for debugging..... */ - public void DEBUG_OpenFile(String FName) - { - if (DoDebugFile) - BWrite = new BinaryWriter(File.Open(FName,System.IO.FileMode.Create,System.IO.FileAccess.ReadWrite)); - } - - public void DEBUG_CloseFile() - { - if (DoDebugFile) - BWrite.Close(); - } - - public void DEBUG_Write(string str) - { - if (DoDebugFile) - { - DEBUG_WriteString(str); - DEBUG_WriteString("\n"); - } - } - - public void DEBUG_WriteString(string str) - { - if (DoDebugFile) - { - int i; - for(i =0; i < str.Length; i++) - { - byte WrByte; - WrByte = (byte)str[i]; - BWrite.Write(WrByte); - } - } - } - - public void DEBUG_CheckFieldName(string fldname) - { - if (DoDebugFile) - { - char[] tmpstr = fldname.ToCharArray(); - int len = fldname.Length; - int cnt = 0; - bool FirstOne = true; - string OKpunch = " -._"; // we're also going to ignore spaces - string outstr = ""; - int decval; - - while (cnt < len) - { - char tmpchr = tmpstr[cnt]; - if(!char.IsLetterOrDigit(tmpchr)) - { - if (OKpunch.IndexOf(tmpchr) == -1) // not found - { - if (FirstOne) - { - FirstOne = false; - DEBUG_Write(fldname); - } - decval = tmpchr; - outstr = " " + tmpchr.ToString() +" [" + decval.ToString() + "]";; - DEBUG_Write(outstr); - } - } - cnt++; - } - if (!FirstOne) - DEBUG_Write("----------------\n"); - } - } - -/** End - For Debugging **/ - - public ConvertParadoxROs(System.Windows.Forms.Label statWin, bool DoingDebugFile) - { - // Assume we are currently in the RO directory to be converted - - // Was it already converted? (check for existance of a backup - // created during the conversion process) - // Yes - return - // else select the new database type - - StatusWin = statWin; - DoDebugFile = DoingDebugFile; - - ClearFieldStrings(); - } - - /* - * Initialize the fields to empty strings. - */ - public void ClearFieldStrings() - { - RecID = ""; - RecType = ""; - ParentRecID = ""; - AccPageID = ""; - DateTime = ""; - Info = ""; - } - - public void CreateNewRoDatabase() - { - // Prompt user to select the new databaes type (ex Access, SQL Server, etc) - - // For now, we will be creating just an Access database. - - /* - * Copy our empty ROMaster.mdb file into the CONVERT directory (is the current - * directory at this point) This RomasterCvrt.mdb is located in the VE-PROMS.NET\BIN16 - * directory and is different than the ROMaster.mdb in VE-PROM.NET\BIN. The one in the BIN16 - * directory does not have any tables, while the one in the BIN directory has an - * ROMASTER table with the default records needed to create RO tables. - */ - String toPath = ROConvertPath + "\\ROMaster.mdb"; - String fromPath = AppPath + "16\\RomasterCvrt.mdb"; - File.Copy(fromPath,toPath,true); // overwrite the file if already there - - // Create an empty database. - MyDbRec = new RODBRecordInterface(1,ROConvertPath); - - // Open the database connection - MyDbRec.RODB_OpenConnection(); - } - - public void CloseNewRoDatabase() - { - MyDbRec.RODB_CloseConnection(); - } - - /* - * Create a ORIG_RO directory and move everything(except for the CONVERT directory) - * in RO into it. Then move everying in CONVERT into RO. - */ - public void MoveOldROData() - { - Directory.SetCurrentDirectory("..\\"); - Directory.Move("RO","ORIG_RO"); - Directory.Move("CONVERT","RO"); - - } - - /* This function will create TXT files from the Paradox database (PX2TXT.EXE) then parse - * them and place the RO information in the new database. - * - * Note that the Microsoft Paradox driver could not read our Paradox BLOB fields. - * We had to write a program in the old Borland 16-bit environment that would basically - * dump the RO information into a file that the Microsoft drivers could read. We decided - * to keep things simple and just dump the RO information into text files. - * - * Each line in the text file represents a database record. Each "field" is separated by - * a space. Each "record" has the following fields: - * - * RECORD ID - * RECORD TYPE - * PARENT ID - * ACCPAGE ID - * DATETIME - * The Paradox BLOB data - */ - - public void TestMessage() - { - StatusWin.Text = "This is a TEST!"; - StatusWin.Refresh(); - } - - private void StatusMessage(String Mess1) - { - StatusWin.Text = Mess1; - StatusWin.Refresh(); - } - - private void StatusMessage(String Mess1, String Mess2) - { - StatusWin.Text = Mess1 + Mess2; - StatusWin.Refresh(); - } - - private void StatusMessage(String Mess1, String Mess2, String Mess3) - { - StatusWin.Text = Mess1 + Mess2 + Mess3; - StatusWin.Refresh(); - } - - - public void ConvertParadoxRODb(string PassedInROPath) - { - // Set the current working directory to my sample RO directory -// Directory.SetCurrentDirectory("G:\\PROMSDAT\\VEWPB\\RO"); -// ROPath = "G:\\PROMSDAT\\VEBRAID\\RO"; -// Directory.SetCurrentDirectory(ROPath); - - ROPath = PassedInROPath; - - ROConvertPath = ROPath.Substring(0,ROPath.LastIndexOf("\\")); - ROConvertPath += "\\CONVERT"; - - // Create text files from the Paradox RO Database - StatusMessage("Paradox to Text Files"); - - // Get the path of where this executable resides - AppPath = Application.StartupPath; - // append "16\\px2txt.exe" to the path of the VE-PROMS.NET\BIN path - // to get the resulting path: VE-PROMS.NET\BIN16\px2txt.exe - String ToTxtAppPath = AppPath + "16\\px2txt.exe"; - - /* - * Before we run the PX2TXT.EXE program, delete any Paradox lock files that might - * be hanging around. - */ - File.Delete("Pdoxusrs.net"); - File.Delete("Pdoxusrs.lck"); - File.Delete("paradox.lck"); - - // create a process & wait until it exits. - Process myProcess = new Process(); - myProcess.StartInfo.FileName = ToTxtAppPath; - myProcess.Start(); - myProcess.WaitForExit(); - - /* - * Now change directory to the CONVERT sub-directory that was created - * from PX2TXT.EXE - * - * This directory should have the TXT files containing the RO data and - * the graphic files (Intergrated Graphics) used in the current RO database. - * Note that some of the graphic files might be converted to a different - * graphics format than what is used in the old RO Editor. - */ - Directory.SetCurrentDirectory(ROConvertPath); - - /* The PX2TXT.EXE program also creates a file called PXCONLST.TXT which - * contains a list of the TXT files that it created. - * - * Read the PXCONLST.TXT file. This contains the list of TXT files - * that were generated as the first step to the conversion. - * Place these in a array list for processing. - * Assume that we are in the RO directory that is being converted - */ - - string FileName = "Pxconlst.txt"; - int numDbs = 0; - ArrayList DbList = new ArrayList(); - ArrayList DbTitleList = new ArrayList(); - if (!File.Exists(FileName)) - { - // Conversion from Paradox to a text file failed. - // **** provide error message **** - StatusMessage("Conversion from Paradox to a text file failed."); - return; - } - - OpenTextFile(FileName); - String FileNameTitle; // the title of the ROxxxxxx file - String TextFileName; - while ((FileNameTitle = TxF_ReadLine())!=null) - { - DbTitleList.Add(FileNameTitle); - TextFileName = TxF_ReadLine(); - DbList.Add(TextFileName); - numDbs++; - } - CloseTextFile(); - - // delete the Pxconlst.txt file if we are NOT debugging - if (!DoDebugFile) - File.Delete(FileName); - - // Create a new (empty) database - CreateNewRoDatabase(); - - // DEBUG - write the field names that have problem characters - DEBUG_OpenFile("DebugFieldNames"); - - // For each file listed in PXCONLST.TXT - // Open the file - // read each line - // (each line represents a record from the old Paradox database) - // translate each line into a database record - - System.Collections.IEnumerator myEnumerator = DbList.GetEnumerator(); - System.Collections.IEnumerator myTitleEnumerator = DbTitleList.GetEnumerator(); - while(myEnumerator.MoveNext()) - { - myTitleEnumerator.MoveNext(); - // Clear the GroupTitles Array - GroupTitlesList.Clear(); - // Clear the LocalFieldInfoList Array - LocalFieldInfoList.Clear(); - - TextFileName = myEnumerator.Current.ToString(); - // Get the RO Table Name (ex. ROMASTER, RO000001) - ROTableName = myEnumerator.Current.ToString(); - int slen = ROTableName.Length; - ROTableName = ROTableName.Remove(slen-4,4); - // Create the database table - MyDbRec.RODB_AddNewTable(ROTableName); - - if (StringsAreEqualU(ROTableName,"ROMASTER")) - ProcessingMasterTable = true; - else - ProcessingMasterTable = false; - - String tmpMess; - - tmpMess = "Processing " + myTitleEnumerator.Current.ToString(); - StatusMessage(tmpMess); - - OpenTextFile(TextFileName); // Open the text file - DEBUG_Write("==================="); - DEBUG_Write(tmpMess); - DEBUG_Write(TextFileName); - - int cnt = 0; - while ((LineOfText = TxF_ReadLine()) != null) - { - // Process the text line (each line is a record) - ClearFieldStrings(); - cnt++; - StatusMessage(tmpMess,"\nRecord: ",Convert.ToString(cnt)); - ProcessTextLine(); - } - StatusMessage(" "); - CloseTextFile(); - - // delete the ROxxxx.txt file if we are NOT debugging - if (!DoDebugFile) - File.Delete(TextFileName); - - // Close database table - } - - // DEBUG - Close Debug file - DEBUG_CloseFile(); - - CloseNewRoDatabase(); - MoveOldROData(); - } - - /* This function makes a copy of the passed in string, then replaces - * any blank character with an underbar ('_') character. - * The copy is returned. - */ - String StrBlanksToUnderbars(String TheString) - { - String RtnStr = TheString; - RtnStr.Replace(" ", "_"); - return RtnStr; - } - - /* - * This function compares a String with a (char *) array and returns - * true if they are equal, else it returns false - */ - bool StringsAreEqual(String thisStr, String thatStr) - { - bool StringsAreEqual = false; - StringsAreEqual = (thisStr.CompareTo(thatStr) == 0); - return StringsAreEqual; - } - - /* - * This function will first uppercase the strings then compare them - * and returns true if they are equal, else it returns false - */ - bool StringsAreEqualU(String thisStr, String thatStr) - { - String ThisOne = thisStr; - String ThatOne = thatStr; - - ThisOne.ToUpper(); - ThatOne.ToUpper(); - bool StringsAreEqual = false; - StringsAreEqual = (ThisOne.CompareTo(ThatOne) == 0); - return StringsAreEqual; - } - - /* - * This function reads up to the next space character (or null) - */ - String GetFieldTxt() - { - String RtnStr = "0"; - char[] space = new char[1]{' '}; - int txtIdxEnd = LineOfText.IndexOfAny(space); // blank is the end of a the field - if (txtIdxEnd > 0) - { - RtnStr = LineOfText.Substring(0,txtIdxEnd); - LineOfText = LineOfText.Remove(0,txtIdxEnd+1); // remove this "field" from the string - } - else if (LineOfText.Length > 0) // last field in the string - { - RtnStr = LineOfText; - LineOfText = ""; - } - return RtnStr; - } - - /* - * This function converts the given string to an interger - */ - int GetFieldInt(String TmpStr) - { - int RtnInt; - RtnInt = Convert.ToInt32(TmpStr); - return RtnInt; - } - - - /* This function will first read the length of the string (number of characters to get) - * Then get the string of that length. - */ - String GetStringByLength() - { - String RtnStr = ""; - int len = (int)GetFieldInt(GetFieldTxt()); - int LineTextLen = LineOfText.Length; - while (len > LineTextLen) - { - RtnStr += LineOfText + "\r\n"; // need both a '\r' and a '\n' - /* NumCRLFs accounts for the number of "\r\n"s that was originally counted when the text - * file was created. - */ - len -= (LineTextLen + NumCRLFs); - LineOfText = TxF_ReadLine(); - if (len == 0) - // end of string had \r\n still may need to remove a blank at the beginning of the string buffer - { - if (LineOfText.StartsWith(" ")) - LineOfText = LineOfText.Remove(0,1); - } - LineTextLen = LineOfText.Length; - } - if (len > 0) - { - RtnStr += LineOfText.Substring(0,len); - LineOfText = LineOfText.Remove(0,len+1); // add one to remove following space - } - return RtnStr; - } - - - /* - * This function builds the field definition string - */ - String GetFieldDefinition() - { - String tmpStr; - String RtnStr = ""; - String FieldTypeStr = ""; - int FieldType = 0; - String FieldLength = ""; - String FieldName = ""; - - FieldName = GetStringByLength(); // get the field name - FieldName = FixFieldName(FieldName); - NewDbField.SetFieldname(FieldName); - - // get the field type - FieldTypeStr = GetFieldTxt(); - FieldType = GetFieldInt(FieldTypeStr); - - // Save the name and rec id and type in an array - FieldInfo TheFieldInfo = new FieldInfo(); - TheFieldInfo.fldName = FieldName; - TheFieldInfo.fldRecID = RecID; - TheFieldInfo.fldType = FieldTypeStr; - if (ProcessingMasterTable) - { - MasterFieldInfoList.Add(TheFieldInfo); - } - else // is a local definition - { - LocalFieldInfoList.Add(TheFieldInfo); - } - - NewDbField.SetFieldType((uint)FieldType); - - switch (FieldType) - { - case 1: // Fixed Length Text - case 2: // Variable Length Text - case 8: // X/Y Plot - case 0x10: // Table - // Get the field length - FieldLength = GetFieldTxt(); - // append/save the Field Name and Field Length to RtnStr - RtnStr += NewDbField.MakeSchemaString(FieldName,FieldLength,""); - break; - - case 4: // Formatted Text - String Pattern; - // Get the field length - FieldLength = GetFieldTxt(); - // Get the pattern - Pattern = GetStringByLength(); - // append/save the Field Name, Length, and Pattern to RtnStr - RtnStr += NewDbField.MakeSchemaString(FieldName,FieldLength,Pattern); - break; - - case 0x20: // Image (Intergrated Graphics) - // append/save only the type to RtnStr - RtnStr = NewDbField.MakeImageSchemaString(FieldName); - break; - - case 0x40: // Multi Field (used by Parameter Display Data) - RtnStr += FieldName + " " + FieldTypeStr; - tmpStr = GetFieldTxt(); - // Create a list of RecIDs separated by a blank - while (!StringsAreEqual(tmpStr,"0")) // while not "0" - { - // append/save the RefRecID to Rtn Str - RtnStr += " " + tmpStr; - tmpStr = GetFieldTxt(); - } - if (intRecType == 2) - { - RecType = "4"; - intRecType = 4; - } - break; - - case 0x100: // Generic Field (reference to a field definition) - tmpStr = GetFieldTxt(); - string tmp1 = GetSavedMasterFieldNameAndType(tmpStr).Substring(0,4); - if (tmp1.Equals("128 ")) - RtnStr = tmpStr + " " + tmp1 + FieldName + "a"; - else - RtnStr = tmpStr + " " + tmp1 + FieldName; -// RtnStr = tmpStr + " " + (GetSavedMasterFieldNameAndType(tmpStr)); - break; - - case 0x80: // Combo Field - String SingleLineWidth = ""; - String MultiLineWidth = ""; - String TableWidth = ""; - String XYPlotWidth = ""; - bool Single = false, Multi = false, Tbl = false, XYPlt = false; - int fldtyp; - - do - { - tmpStr = GetFieldTxt(); - fldtyp = GetFieldInt(tmpStr); - switch (fldtyp) - { - case 1: // single line text - SingleLineWidth = GetFieldTxt(); - Single = true; - break; - - case 2: // multi line text - MultiLineWidth = GetFieldTxt(); - Multi = true; - break; - - case 8: // X/Y Plot - XYPlotWidth = GetFieldTxt(); - XYPlt = true; - break; - - case 16: // Table - TableWidth = GetFieldTxt(); - Tbl = true; - break; - - default: - break; - } // end switch - } while (!StringsAreEqual(tmpStr,"0")); - // append/save the Field Type to RtnStr - RtnStr = NewDbField.MakeComboSchemaString(FieldName,Single,SingleLineWidth,Multi,MultiLineWidth,Tbl,TableWidth,XYPlt,XYPlotWidth); - break; - - default: // nothing to do - break; - - } // end switch - - return RtnStr; - } - - - String GetValueDefinition() - { - String RtnStr = ""; - String tmpStr = ""; - String tmpStr2 = ""; - String tmpStr3 = ""; - String RecIDRef = ""; - String MenuText = ""; - String ValueDefTypeStr = ""; - int ValueDefType = 0; - int NumItems; - do - { - ValueDefTypeStr = GetFieldTxt(); - ValueDefType = GetFieldInt(ValueDefTypeStr); - - switch (ValueDefType) - { - case 1: // Record ID referencing a field record - RecIDRef = GetFieldTxt(); - tmpStr = GetSavedLocalFieldName(RecIDRef); - // append/save ValueDefType and RecIDRef to RtnStr - RtnStr += "<" + tmpStr + ">"; - break; - - case 2: // Text value - tmpStr = GetStringByLength(); - tmpStr = FixString(tmpStr); - // append/save ValueDefType and TxtStr to Rtn Str - RtnStr += tmpStr; - break; - - case 3: // Decimal allignment field - // append/save RecIDRef, OffSetVal, and Width to RtnStr - RecIDRef = GetFieldTxt(); - tmpStr = GetSavedLocalFieldName(RecIDRef); - // append/save ValueDefType and RecIDRef to RtnStr - RtnStr += "<" + tmpStr; - tmpStr = GetFieldTxt(); - //int OffSetVal = GetFieldInt(tmpStr); - RtnStr += ","+tmpStr; - tmpStr = GetFieldTxt(); - //int Width = GetFieldInt(tmpStr); - RtnStr += ","+tmpStr+">"; - break; - - case 4: // Menu value definition - MenuText = ""; - // number of menu items - tmpStr = GetFieldTxt(); - NumItems = GetFieldInt(tmpStr); - tmpStr2 = ""; - while (NumItems > 0) - { - // menu text string (maybe) - tmpStr = GetFieldTxt(); - if (!StringsAreEqual(tmpStr,"0")) // do we have MenuText? - { - MenuText = GetStringByLength(); - MenuText = FixString(MenuText); - } - - // append/save ValueDefType, NumItems, tmpStr, and MenuText to RtnStr - - // Get list of other ValueDefTypes - tmpStr = GetValueDefinition(); // call itself - // append/save tmpStr to RtnStr - tmpStr2 += "{" + MenuText + "=" + tmpStr + "}"; - NumItems--; - } - RtnStr += tmpStr2; - break; - - case 5: // Conditional value definition - MenuText = ""; - // number of menu items - tmpStr = GetFieldTxt(); - NumItems = GetFieldInt(tmpStr); - tmpStr3 = ""; - tmpStr2 = ""; - while (NumItems > 0) - { - // menu text string (maybe) - tmpStr = GetFieldTxt(); - if (!StringsAreEqual(tmpStr,"0")) // do we have MenuText? - { - MenuText = GetStringByLength(); - MenuText = FixString(MenuText); - } - // append/save ValueDefType, NumItems, tmpStr, and MenuText to RtnStr - - // Get list of other ValueDefTypes - tmpStr = GetValueDefinition(); // call itself - // append/save tmpStr to RtnStr - tmpStr2 += "{" + MenuText + "=" + tmpStr + "}"; - NumItems--; - } - - // Conditional text??? - tmpStr = GetStringByLength(); - // append/save tmpStr to RtnStr - tmpStr = FixString(tmpStr); - - tmpStr3 = "{" + tmpStr + tmpStr2 + "}"; - RtnStr += tmpStr3; - break; - - - case 6: // VARUSE - tmpStr = GetStringByLength(); - tmpStr = FixString(tmpStr); - // append/save ValueDefType and TxtStr to RtnStr - RtnStr += "{" + tmpStr + "}"; - break; - - case 7: // VARDEFINE - tmpStr2 = GetStringByLength(); - tmpStr2 = FixString(tmpStr2); - tmpStr = GetValueDefinition(); // call itself - // append/save ValueDefType, TxtStr, and tmpStr to RtnStr - RtnStr += "{" + tmpStr2 + "=" + tmpStr + "}"; - break; - - default: // nothing to do - break; - - } // end switch - } while (ValueDefType != 0); - - /* - * Need to replace '<' with '<' and '>' with '>' - */ - RtnStr = ReplaceGreaterLessSigns(RtnStr); - - return RtnStr; - } - - /* - * This function returns a string containing a value to an RO field. - */ - String GetFieldValue() - { - String RtnStr; - String tmpStr; - String ValueTypeStr; - int ValueType = 0; - - ValueTypeStr = GetFieldTxt(); - ValueType = GetFieldInt(ValueTypeStr); - - CurrentFieldType = ValueType; - - RtnStr = ""; - - switch (ValueType) - { - case 1: // Text String - case 2: // variable text string - tmpStr = GetStringByLength(); - tmpStr = FixString(tmpStr); - RtnStr += tmpStr; - break; - - case 0x20: // Image File (Intergrated Graphics) - tmpStr = GetStringByLength(); // image file name - tmpStr = FixString(tmpStr); - String DateTimeStr = GetFieldTxt(); - String ImgHeight = GetFieldTxt(); - String ImgWidth = GetFieldTxt(); - RtnStr += "\r\n" + DateTimeStr + " " + tmpStr + "\r\n"; - RtnStr += "" + ImgHeight + "\r\n"; - RtnStr += "" + ImgWidth + "\r\n"; - break; - - case 0x40: // Parameter Display Data - tmpStr = GetFieldTxt(); - while (!StringsAreEqual(tmpStr,"0")) - { - tmpStr = GetFieldTxt(); // get the RecID of the field - while (!StringsAreEqual(tmpStr,"0")) - { - string FieldName = GetSavedLocalFieldName(tmpStr); - RtnStr += "<" + FieldName+ ">"; - RtnStr += GetFieldValue(); - RtnStr += "\r\n"; - tmpStr = GetFieldTxt(); // next - } - tmpStr = GetFieldTxt(); // next - } - break; - - default: - // should never get into here.... - tmpStr = GetStringByLength(); - tmpStr = FixString(tmpStr); - RtnStr += tmpStr; - break; - } // end switch - - return RtnStr; - } - - // Search the local list for the given Record ID - // Return the field name - String GetSavedLocalFieldName(String RecordID) - { - String RtnStr = ""; - FieldInfo TmpInfo; - System.Collections.IEnumerator FldLstEnumerator = LocalFieldInfoList.GetEnumerator(); - while (FldLstEnumerator.MoveNext() && StringsAreEqual(RtnStr,"")) - { - TmpInfo = (FieldInfo)FldLstEnumerator.Current; - if (StringsAreEqual(TmpInfo.fldRecID,RecordID)) - RtnStr = TmpInfo.fldName; - } - return RtnStr; - } - - // Search the master field list for a the given Record ID - // Return the field name and type if found - String GetSavedMasterFieldNameAndType(String RecordID) - { - String RtnStr = ""; - FieldInfo TmpInfo; - System.Collections.IEnumerator FldLstEnumerator = MasterFieldInfoList.GetEnumerator(); - while (FldLstEnumerator.MoveNext() && StringsAreEqual(RtnStr,"")) - { - TmpInfo = (FieldInfo)FldLstEnumerator.Current; - if (StringsAreEqual(TmpInfo.fldRecID,RecordID)) - { - RtnStr = TmpInfo.fldType.PadLeft(3,'0') + " " + TmpInfo.fldName; - if (TmpInfo.fldType.Equals("128")) // is this a combo type? - RtnStr += "a"; // append an "a" - } - } - return RtnStr; - } - - /* - * See if the given RECID is referencing a combo field. - */ - bool IsComboFieldType(String fldName) - { - bool IsACombo = false; - bool wasFound = false; - FieldInfo TmpInfo; - System.Collections.IEnumerator LocFldLstEnumerator = LocalFieldInfoList.GetEnumerator(); - System.Collections.IEnumerator FldLstEnumerator = MasterFieldInfoList.GetEnumerator(); -// Bug fix: B2004-028 -// Need to check local list of fields (of this group) -// Then then if not in the local list, check the "global" list - while (!IsACombo && LocFldLstEnumerator.MoveNext()) - { - TmpInfo = (FieldInfo)LocFldLstEnumerator.Current; - if (StringsAreEqual(TmpInfo.fldName,fldName)) - { - wasFound = true; - if (StringsAreEqual(TmpInfo.fldType,"128")) - IsACombo = true; - } - } - if (!wasFound) - { - while (!IsACombo && FldLstEnumerator.MoveNext()) - { - TmpInfo = (FieldInfo)FldLstEnumerator.Current; - if (StringsAreEqual(TmpInfo.fldName,fldName) && StringsAreEqual(TmpInfo.fldType,"128")) - IsACombo = true; - } - } - return IsACombo; - } - - String BuildComboFieldName(String FldName) - { - String RtnStr = FldName; - switch (CurrentFieldType) - { - case 1: //Fixed Text - RtnStr += "a"; - break; - case 2: // Variable Text - RtnStr += "b"; - break; - case 16: // Table - RtnStr += "c"; - break; - case 8: - RtnStr += "d"; - break; - default: - break; - } - return RtnStr; - } - - String GetGroupTitle(String RecordID) - { - String RtnStr = ""; - GroupTitles Tmpitem; - System.Collections.IEnumerator GrpLstEnumerator = GroupTitlesList.GetEnumerator(); - while (GrpLstEnumerator.MoveNext() && StringsAreEqual(RtnStr,"")) - { - Tmpitem = (GroupTitles)GrpLstEnumerator.Current; - if (StringsAreEqual(Tmpitem.GrpRecID,RecordID)) - RtnStr = Tmpitem.GrpTitle; - } - return RtnStr; - } - - String ReplaceGreaterLessSigns(String InStr) - { - String OutStr = InStr; - OutStr = OutStr.Replace("<","<"); - OutStr = OutStr.Replace(">",">"); - - return OutStr; - } - - // Replace any character less than 32 (space) or greater then - // 126 (~) with "&#D;" where D is the decimal value of the character - String ReplaceNonStandardChars(string instring) - { - string outstring = ""; - int len = instring.Length; - int i=0; - int substart=0; - ushort decchar; - - while (i < len) - { - while (i < len && instring[i] < 127) i++; - outstring += instring.Substring(substart, i-substart); - if (i < len) - { - decchar = instring[i]; - outstring += "&#" + decchar.ToString() + ";"; - i++; - substart = i; - } - } - return outstring; - } - - - /* - * String cannot have '&' or '/' chars - * replace them with an '_' - */ - String FixString(String instring) - { - String FixedString = ""; - - StringWriter strWriter = new StringWriter(); - xmlTxtWriter = new XmlTextWriter(strWriter); - xmlTxtWriter.WriteString(instring); - - FixedString = strWriter.ToString(); - xmlTxtWriter.Close(); - - // Now replace any character less than 32 (space) or greater then - // 126 (~) with "&#D;" where D is the decimal value of the character - FixedString = ReplaceNonStandardChars(FixedString); - // need to replace the forward slash with an character reference - FixedString = FixedString.Replace("/","/"); - /* - * The WriteString method is not replacing the single - * and double quotes. So we will do it manually - */ - FixedString = FixedString.Replace("'","'"); - FixedString = FixedString.Replace("\"","""); - - return FixedString; - } - - public string ReplaceNonValidCharsInFieldName(string fldname) - { - string tmpstr = fldname; - int len = fldname.Length; - int cnt = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval; - - while (cnt < len) - { - char tmpchr = tmpstr[cnt]; - if(!char.IsLetterOrDigit(tmpchr)&& (OKpunch.IndexOf(tmpchr) == -1) ) - { - decval = tmpchr; - outstr += OKpunch + decval.ToString("D3"); - } - else - { - outstr += tmpchr.ToString(); - } - cnt++; - } - DEBUG_Write(outstr); - return outstr; - } - -/* - * Field names cannot have ' ', '&', or '/' characters - */ - String FixFieldName(String fldname) - { - String fixedField = fldname; - - DEBUG_CheckFieldName(fldname); - - fixedField = fixedField.Replace(" ","__"); - - /* - * If the first character is 0-9, then put a '_' in front of the field name - */ - if (Char.IsDigit(fixedField,0)) - fixedField = "__" + fixedField; - fixedField = ReplaceNonValidCharsInFieldName(fixedField); - - return fixedField; - } - - - /* - * This function will parse the remaining information in the LineOfText string - * and create the value needed for the Info field of the database record. - */ - String ParseInfoField() - { - String RtnStr = ""; - String tmpStr; - String Title; - String ROMenuHead; - String GrpMenuHead; - String RoValueDef; - String RoMenuItemDef; - String GroupMenuItemDef; - String RoFieldsInUse; - String GroupFieldsInUse; - String FieldName; - int intRecType = GetFieldInt(RecType); - - switch (intRecType) - { - case 0: // Next Record Id or next database table name - RtnStr = GetFieldTxt(); - break; - - case 1: // Database title and database name - RtnStr = GetStringByLength(); // database title - ROTblElmt = FixFieldName(RtnStr); - RtnStr += "\t"; - tmpStr = GetStringByLength(); // database table name - if (tmpStr.Length == 0) - RtnStr += "RO000001"; // default database table name - else - RtnStr += tmpStr; - break; - - case 2: // Field Description - // get the field definition - RtnStr = GetFieldDefinition(); - break; - - case 3: // RO Group - GroupTitle = GetStringByLength(); // group name (title) - ROMenuHead = GetStringByLength(); // RO menu header - GrpMenuHead = GetStringByLength();// Group menu header - - RtnStr = ""; - SubGrpFldsAndVals += GetFieldValue(); - SubGrpFldsAndVals += "\r\n"; - - tmpStr = GetFieldTxt(); // next - } - RtnStr += SubGrpFldsAndVals; - RtnStr += ""; // end group definition - break; - - case 5: // RO Value Record - // RO Menu Item Value - String ROMenuItemValue = GetStringByLength(); - ROMenuItemValue = FixString(ROMenuItemValue); - - RtnStr = "<" + FixFieldName(GroupTitle) + " "; - - // RO Menu Item - RtnStr += "MenuTitle=\"" + ROMenuItemValue + "\">\r\n"; - - //RO fields and values - String ROFldsAndVals = ""; - tmpStr = GetFieldTxt(); - while (!StringsAreEqual(tmpStr,"0")) - { - FieldName = GetSavedLocalFieldName(tmpStr); - tmpStr = GetFieldValue(); - if (IsComboFieldType(FieldName)) - { - FieldName = BuildComboFieldName(FieldName); - } - ROFldsAndVals += "<" + FieldName + ">"; - ROFldsAndVals += tmpStr; - ROFldsAndVals += "\r\n"; - - tmpStr = GetFieldTxt(); - } - RtnStr += ROFldsAndVals; - RtnStr += "\r\n"; - break; - - default: - break; - }// end switch - - return RtnStr; - } - - /* - * This function will parse the given text record (string) and place the - * information in a database record. - */ - void ProcessTextLine() - { - - /* - * Get the first 5 database fields and save them in string types. - */ - - RecID= GetFieldTxt(); - RecType = GetFieldTxt(); - ParentRecID = GetFieldTxt(); - AccPageID = GetStringByLength(); - DateTime = GetFieldTxt(); - intRecType = GetFieldInt(RecType); -/***** For Debugging ***/ -// if (RecID.Equals("000000c1")) -// { -// int test; -// test = 1; -// } - -// if (AccPageID.Equals("R.29")) -// { -// MessageBox.Show("debug"); -// } -/**** End - for debugging ****/ - - // setup a new database record - NewDbField = new ROField("", RecID, ParentRecID, (uint)intRecType); - - /* - * Now what's remaining in the txtRecord string is the BLOB info from - * the old Paradox database record. - * Parse the remaining information and build the XML or XSD string that - * represents the data. - */ - Info = ParseInfoField(); - - // Fix the single quotes before writing to the database - // MS Access complained when we tried to write "C'.'99", wanted "C''.''99" instead - Info = Info.Replace("'","''"); - - // if we are processing a record type 4, save it as a record type 3. - // record type 4's were considered subgroups. We are going to store them - // as groups (type 3) with the parent id pointing to the the parent group - // or subgroup. - if (intRecType == 4 && !StringsAreEqual(RecType,"2")) - intRecType = 3; - - // write to database - MyDbRec.RODB_WriteDbRecord(ROTableName,RecID,intRecType,ParentRecID,AccPageID,DateTime,Info); - - if (StringsAreEqual(RecType,"0")&& StringsAreEqual(RecID,"00000001")) - { - // build schema header for the table just inserted - Info = "\r\n"; - Info += ""; - Info += "\r\n"; - Info += ""; - // write the schema header record (type 6) - // Note that a null recid will cause RODB_WriteDbRecord to get the next - // available one and update the "next RecID" database record. - MyDbRec.RODB_WriteDbRecord(ROTableName,"",6,"00000000","",DateTime,Info); - - // build the schema footer for the table just inserted - Info = "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - Info += "\r\n"; - // write the schema footer record (type 7) - // Note that a null recid will cause RODB_WriteDbRecord to get the next - // available one and update the "next RecID" database record. - MyDbRec.RODB_WriteDbRecord(ROTableName,"",7,"00000000","",DateTime,Info); - } - - } - } -} diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/Form1.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/Form1.cs deleted file mode 100644 index a06d1b1d..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/Form1.cs +++ /dev/null @@ -1,351 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: Form1.cs $ $Revision: 7 $ - * $Author: Jsj $ $Date: 1/06/03 12:53p $ - * - * $History: Form1.cs $ - * - * ***************** Version 7 ***************** - * User: Jsj Date: 1/06/03 Time: 12:53p - * Updated in $/EXE/RefObj/ParadoxConversion - * cleanup - * - * ***************** Version 6 ***************** - * User: Jsj Date: 1/06/03 Time: 11:35a - * Updated in $/EXE/RefObj/ParadoxConversion - * When called from the RO Editor, hide the Find RO Directory button - * - * ***************** Version 5 ***************** - * User: Jsj Date: 12/18/02 Time: 12:47p - * Updated in $/EXE/RefObj/ParadoxConversion - * new icons - * - * ***************** Version 4 ***************** - * User: Jsj Date: 12/06/02 Time: 3:21p - * Updated in $/EXE/RefObj/ParadoxConversion - * added command line argument (DEBUG) to turn on writing debug message to - * a file - * - * ***************** Version 3 ***************** - * User: Jsj Date: 10/04/02 Time: 2:02p - * Updated in $/EXE/RefObj/ParadoxConversion - * added better user interface - * - * ***************** Version 2 ***************** - * User: Jsj Date: 9/25/02 Time: 10:19a - * Updated in $/EXE/RefObj/ParadoxConversion - * added header - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Data; -using System.IO; - -namespace ParadoxConversion -{ - /// - /// Summary description for Form1. - /// - public class Form1 : System.Windows.Forms.Form - { - bool DidConvert = false; - bool ShowBtnFndRO = true; - public Form MainForm; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Label StatWindow; - private string PassedInDirPath; - private System.Windows.Forms.Button btnFndRO; - private System.Windows.Forms.Button btnExit; - private bool DoDebugFile; - - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public void StatusWindow(String Message1,String Message2, String Message3) - { - StatWindow.Text = Message1 + Message2 + Message3; - } - - public Form1(string Connpath, bool doingDebug) - { - // - // Required for Windows Form Designer support - // -// Icon = new Icon(typeof(Form1),"V.ico"); - InitializeComponent(); - PassedInDirPath = Connpath; - if (!Connpath.Equals("")) - ShowBtnFndRO = false; - DoDebugFile = doingDebug; - - // - // TODO: Add any constructor code after InitializeComponent call - // - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1)); - this.button1 = new System.Windows.Forms.Button(); - this.StatWindow = new System.Windows.Forms.Label(); - this.btnFndRO = new System.Windows.Forms.Button(); - this.btnExit = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // button1 - // - this.button1.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.button1.Location = new System.Drawing.Point(176, 152); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(80, 40); - this.button1.TabIndex = 0; - this.button1.Text = "Convert"; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // StatWindow - // - this.StatWindow.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.StatWindow.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.StatWindow.Location = new System.Drawing.Point(8, 16); - this.StatWindow.Name = "StatWindow"; - this.StatWindow.Size = new System.Drawing.Size(368, 112); - this.StatWindow.TabIndex = 1; - this.StatWindow.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // btnFndRO - // - this.btnFndRO.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnFndRO.Location = new System.Drawing.Point(8, 152); - this.btnFndRO.Name = "btnFndRO"; - this.btnFndRO.Size = new System.Drawing.Size(152, 40); - this.btnFndRO.TabIndex = 2; - this.btnFndRO.Text = "Find RO Directory"; - this.btnFndRO.Click += new System.EventHandler(this.btnFndRO_Click); - // - // btnExit - // - this.btnExit.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnExit.Location = new System.Drawing.Point(288, 152); - this.btnExit.Name = "btnExit"; - this.btnExit.Size = new System.Drawing.Size(80, 40); - this.btnExit.TabIndex = 3; - this.btnExit.Text = "Exit"; - this.btnExit.Click += new System.EventHandler(this.btnExit_Click); - // - // Form1 - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(384, 197); - this.Controls.AddRange(new System.Windows.Forms.Control[] { - this.btnExit, - this.btnFndRO, - this.StatWindow, - this.button1}); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "Form1"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Referenced Object Database Conversion"; - this.Load += new System.EventHandler(this.Form1_Load); - this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint); - this.ResumeLayout(false); - - } - #endregion - - /// - /// The main entry point for the application. - /// - - static bool ValidateConnectionPath(string ConPath) - { - bool validPath = true; - string tmpstr = ""; - - if (ConPath.Equals("")) - validPath = false; - else - { - // make sure we are in a directory named "RO" - if (ConPath.IndexOf("\\") != -1) - { - tmpstr = ConPath.Substring(ConPath.LastIndexOf("\\")); - tmpstr = tmpstr.ToUpper(); - } - else - tmpstr = ConPath; - if (!tmpstr.Equals("\\RO")) - { - string tstr = "This is not an RO directory:\n\n" + ConPath; - MessageBox.Show(tstr,"Error",MessageBoxButtons.OK,MessageBoxIcon.Error); - // Application.Exit(); - validPath = false; - } - // make sure there is at least an ROMASTER file - if (validPath && !File.Exists("ROMASTER.db")) - { - string tstr = "This RO directory is empty:" + ConPath; - MessageBox.Show(tstr,"Error",MessageBoxButtons.OK,MessageBoxIcon.Error); - // Application.Exit(); - validPath = false; - } - } - - return validPath; - } - - static string GetRODirPath(string ConPath) - { - string rtnstr = ""; - string tmpstr = ""; - OpenFileDialog ofDlg = new OpenFileDialog(); - ofDlg.Title = "Navigate to the Referenced Objects (RO) directory"; - ofDlg.Filter = "Referenced Objects|ROMASTER.DB;|All Files|*.*"; - - if (ConPath.Equals("")) - tmpstr = "c:\\"; - - ofDlg.CheckPathExists = true; - ofDlg.FileName = "ROMASTER.DB"; - ofDlg.InitialDirectory = tmpstr; - - if (ofDlg.ShowDialog() == DialogResult.OK) - { - tmpstr = ofDlg.FileName; - rtnstr = Path.GetDirectoryName(tmpstr); - } - else - { - string tstr = "Cannot convert Referenced Objects data.\n\nInvalid RO directory:\n\n" + ConPath; - MessageBox.Show(tstr,"Error",MessageBoxButtons.OK,MessageBoxIcon.Error); - rtnstr = null; - } - return rtnstr; - } - - [STAThread] - static void Main(string[] args) - { - string ConnectionPath = ""; - bool DebugFile = false; - // if an RO directory path was passed in, then change the - // current working directory to it. - // this path will also be used to generate a connection string - // to the Access database. - if (args.Length > 0) - { - string tmpstr; - for (int i = 0; i - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, Publ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AAAAAAHcXcRcI - gAAAAAAAAAAAAABxF3F3CIAAAAAAAAAAAAAAdxd3FwiAAAAAAAAAAAAAAAAAAAAIgAAAAAAAAAAAAACI - iIiICIAAAAAAAAAAAAAACIcAeICAAAAAAAAAAAAAAACEREiIAAAAAAAAAAAAAAAABERAAAAAAAAAAAAA - AAAAAAREQAAAAAAAAAAAAAAAAAAEREAAAAAAAAAAAAAAAAAABERAAAAAAAAAAAAAAAD///8e///+Hf// - /Br///gVgAAAC4AAABeAAAAPgAAAGoAAABWAAAAPgAAAF4AAAAmAAAAWgAAAG4AAAB2AA/wegAP+H4AD - /x+AA/+fgAP//4AD//+AA///gAP//4AD//+AA///gAP//8AD///gA///8AP///h////4f///+H///w== - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/ParadoxConversion.csproj b/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/ParadoxConversion.csproj deleted file mode 100644 index c9adb591..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/ParadoxConversion.csproj +++ /dev/null @@ -1,129 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {2FEB12F6-B8F7-11D6-8550-A8738D000000} - Debug - AnyCPU - ROConvrt.ico - - - ParadoxConversion - - - JScript - Grid - IE50 - false - WinExe - ParadoxConversion - OnBuildSuccess - - - - - - - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - - - - System - - - System.Data - - - System.Drawing - - - System.Windows.Forms - - - System.XML - - - - - - - Code - - - Code - - - Form - - - Code - - - Form1.cs - - - - - - {6D44F537-879E-11D6-84B8-00A0CC271352} - DBEncapsulation - - - {0C782592-AA05-11D6-84D1-00A0CC271352} - ROFields - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/ParadoxConversion.sln b/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/ParadoxConversion.sln deleted file mode 100644 index 32d85df4..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/ParadoxConversion.sln +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ParadoxConversion", "ParadoxConversion.csproj", "{2FEB12F6-B8F7-11D6-8550-A8738D000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ROFields", "..\..\..\LibSource\ROField\ROFields.csproj", "{0C782592-AA05-11D6-84D1-00A0CC271352}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DBEncapsulation", "..\..\..\LibSource\DBEncapsulation\DBEncapsulation.csproj", "{6D44F537-879E-11D6-84B8-00A0CC271352}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2FEB12F6-B8F7-11D6-8550-A8738D000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2FEB12F6-B8F7-11D6-8550-A8738D000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2FEB12F6-B8F7-11D6-8550-A8738D000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2FEB12F6-B8F7-11D6-8550-A8738D000000}.Release|Any CPU.Build.0 = Release|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Release|Any CPU.ActiveCfg = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/ROConvrt.ico b/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/ROConvrt.ico deleted file mode 100644 index c67c7e8e0918e1e3d3f1e904116338892898ffcf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1078 zcmbtTJ8l9o5FJ<~HVP7Kkys*vY!z_~3W`)YOI!^dE+UbRBjhSRO3IY!pg=h9+1||} zB?ZZ_Z^rZHV~=+c=}BKElZj9kJ&_04x=#K_U*rkg0vwqd=*a+D#7F&;aw2%dxn!WR z1e|#95eV^-5V!*HBSqE7ChQJjC(_vUD+Ru8*GfLyzwi#5u^toWwVU-G9Ukyc?hRj2*+s%hZ`qy4H#eyOaXFSle+?LfjeO4 aisRfBr+Zff;tdGD!6Wt#d;*8fH@*O#`uJA> diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/RODBRecordInterface.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/RODBRecordInterface.cs deleted file mode 100644 index c834b166..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/RODBRecordInterface.cs +++ /dev/null @@ -1,352 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: RODBRecordInterface.cs $ $Revision: 4 $ - * $Author: Jsj $ $Date: 1/27/03 2:56p $ - * - * $History: RODBRecordInterface.cs $ - * - * ***************** Version 4 ***************** - * User: Jsj Date: 1/27/03 Time: 2:56p - * Updated in $/EXE/RefObj/ParadoxConversion - * using OLEDB for the connection - * - * ***************** Version 3 ***************** - * User: Jsj Date: 10/04/02 Time: 2:02p - * Updated in $/EXE/RefObj/ParadoxConversion - * added better user interface - * - * ***************** Version 2 ***************** - * User: Jsj Date: 9/25/02 Time: 10:20a - * Updated in $/EXE/RefObj/ParadoxConversion - * added header - *********************************************************************************************/ - -using System; -//using System.Collections; -using System.IO; -using System.Data; -using System.Text; -using System.Windows.Forms; -using DBEncapsulation; - -namespace ParadoxConversion -{ - /// - /// This class contains a very simple interface to the RO Database. - /// All the database conversion module needs is to create a new table - /// and write a database record. - /// - public class RODBRecordInterface - { - bool success; - - DBEncapsulation.DBEncapsulate DBE; - DBEncapsulation.OLEDB_DBEncap DBE_OLEDB; - DBEncapsulation.ODBC_DBEncap DBE_ODBC; - - private string strAccOLEDBconn = ""; - private string strSQLOLEDBconn = ""; - private string strAccODBCconn = ""; - private string strodbcConn = ""; - - public RODBRecordInterface(int conntype, string connectstring) - { - // Setup the connection string -// if (connectstring.Equals("")) -// GetConnectionStringFromFile(); -// else - BuildConnectionString(connectstring); - - // Initialize the connection depending on OLE-DB or ODBC: - conntype = 2; // for now - till valid data passed in. -// conntype = 1; // for now - till valid data passed in. - //END OF TEMPORARY - - // Either use an OLE-DB or ODBC connection, depending on what was passed in. - if ( conntype == 1) - { - DBE_ODBC = new ODBC_DBEncap(); - DBE = DBE_ODBC; - } - else - { - DBE_OLEDB = new OLEDB_DBEncap(); - DBE = DBE_OLEDB; - } - - try - { - DBE.Connection(strAccOLEDBconn); -// DBE.Connection(strodbcConn); - } - catch (Exception e) - { - Console.WriteLine("error {0}", e.Message); - } - } - - public void RODB_OpenConnection() - { - try - { - DBE.OpenConnection(); - } - catch (Exception e) - { - Console.WriteLine("Error opening database connection.\n{0}",e.Message); - } - } - - public void RODB_CloseConnection() - { - try - { - DBE.CloseConnection(); - } - catch (Exception e) - { - Console.WriteLine("Error closing database connection.\n",e.Message); - } - } - - /* - * Create a new Referenced Objects table in the current database - */ - public void RODB_AddNewTable(String TblName) - { - - string strMkTable = "CREATE TABLE "+ TblName + " ("; -// strMkTable = strMkTable + "UID Integer NULL ,"; - strMkTable = strMkTable + "RecID Char(8) NULL ,"; - strMkTable = strMkTable + "RecType Integer ,"; - strMkTable = strMkTable + "ParentID char(8) NULL ,"; - strMkTable = strMkTable + "AccPageID char(32) NULL ,"; - strMkTable = strMkTable + "ModDateTime char(14) NULL ,"; - strMkTable = strMkTable + "Info Memo NULL)"; - try - { - DBE.Command(strMkTable); -// DBE.Reader(); - } - catch (Exception e) - { - Console.WriteLine("Command error:\n{0}", e.Message); - // bool retval = false; - } - // DBE.ReaderClose(); - try - { - DBE.NonQuery(); - } - catch (Exception e) - { - Console.WriteLine("NonQuery error:\n{0}", e.Message); - // bool retval = false; - } - DBE.CommandDispose(); - } - - /* - * Write an RO Database record - */ - public void RODB_WriteDbRecord(String DBTable, String RecID, int RecType, String ParID, String AcPgID, String DateTime, String Info) - { - String DbRecCmd; - - // if no RecID provided, then get the next available one. - if (RecID.CompareTo("") == 0) - { - RecID = RODB_GetNextRecid(DBTable); - } - - DbRecCmd = "INSERT INTO " + DBTable + " (RecID, RecType, ParentID, AccPageID, ModDateTime, Info) VALUES ('"; - DbRecCmd += RecID + "', " + RecType + ", '" + ParID + "', '" + AcPgID + "', '" + DateTime + "', '" + Info + "');"; - try - { - DBE.Command(DbRecCmd); - } - catch (Exception e) - { - success = false; - Console.WriteLine("RODB_WriteDbRecord Caught an exception:\n{0}", e.Message); - } - try - { - DBE.NonQuery(); - } - catch (Exception e) - { - Console.WriteLine("NonQuery error:\n{0}", e.Message); - // bool retval = false; - } - DBE.CommandDispose(); - } - - public void GetConnectionStringFromFile() - { - /* This file should contain the connection strings in the followin order: - * AccOLEDBconn, SQLOLEDBconn, AccODBCconn, odbcConn. - */ - // append "ConnectList.txt" to the path of the location of the exe being run - // for example: VE-PROMS.NET\BIN or BIN\DEBUG - // This set in Visual Studio .NET in the properties dialog of the project, select - // Configuration Properties. You will see an option call Output Path. - string FileName = Application.StartupPath + "\\ConnectList.txt"; - - if (!File.Exists(FileName)) - { - // File does not exist - Console.WriteLine("Could not find ConnectList.txt file"); - return; - } - - /* - * Open the text file for reading - */ - StreamReader sr = File.OpenText(FileName); - - /* - * Connection string to MS-access use with oledb directly - */ - strAccOLEDBconn = sr.ReadLine(); - - /* - * connection string to SQL-server use with oledb - */ - strSQLOLEDBconn = sr.ReadLine(); - - /* - * connection string to for oledb to odbc dsn - */ - strAccODBCconn = sr.ReadLine(); - - /* - * ODBC connection: - * ACCESS: - */ - strodbcConn = sr.ReadLine(); - - sr.Close(); // close ConnectList.txt - - } - - public void BuildConnectionString(string DataConnectionPath) - { - /* - * Connect to MSAccess using OLEDB directly - */ - - // strAccOLEDBconn = "Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";User ID=Admin;Data Source=I:\\RO Design\\RO\\ROMaster.mdb;Mode=Share Deny None;Extended Properties=\"\";Jet OLEDB:System database=\"\";Jet OLEDB:Registry Path=\"\";Jet OLEDB:Database Password=\"\";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"; - - strAccOLEDBconn = "Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";User ID=Admin;Data Source=" + DataConnectionPath +"\\ROMaster.mdb;Mode=Share Deny None;Extended Properties=\"\";Jet OLEDB:System database=\"\";Jet OLEDB:Registry Path=\"\";Jet OLEDB:Database Password=\"\";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"; - - /* - * Connect to SQL-server using OLEDB - */ - // !!!!! do we need the Workstation ID? if so, we need to pass this in too! - - // strSQLOLEDBconn = "Provider=SQLOLEDB;Persist Security Info=False;User ID=sa;Initial Catalog=ROMaster;Data Source=DELL-W2K-SERVER\\SQL2000;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=KATHY;Use Encryption for Data=False;Tag with column collation when possible=False"; - - strSQLOLEDBconn = "Provider=SQLOLEDB;Persist Security Info=False;User ID=sa;Initial Catalog=ROMaster;Data Source=" + DataConnectionPath +"\\ROMaster.mdb;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=KATHY;Use Encryption for Data=False;Tag with column collation when possible=False"; - - /* - * Connect to MSAccess using OLEDB and ODBC DSN - */ - - // strAccODBCconn = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=Access for RO;Extended Properties=\"DSN=Access for RO;DBQ=I:\\RO Design\\RO\\ROMaster.mdb;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;\""; - - strAccODBCconn = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=Access for RO;Extended Properties=\"DSN=Access for RO;DBQ=" + DataConnectionPath + "\\ROMaster.mdb;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;\""; - - /* - * Connection to MSAccess using an ODBC connection - */ - // strodbcConn = "Driver={Microsoft Access Driver (*.mdb)};DBQ=i:\\Ro Design\\RO\\ROMaster.mdb"; - strodbcConn = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" + DataConnectionPath + "\\ROMaster.mdb"; - - // Connection to SQL Server using an ODBC connection - //strodbcConn = "Driver={SQL Server};Server=DELL-W2K-SERVER\\SQL2000;UID=sa;Database=ROMaster"; - - //SQL - DSN - worked: string strodbcConn = "DSN=SQL RO;UID=sa"; - //Initial odbc tests on strodbcconn - } - - /* - * Get the next available RO Database RecID - */ - public String RODB_GetNextRecid(String DBTable) - { - String NextRecID=""; - String RtnStr = ""; - String SpcStr = " "; - String ZeroStr = "0"; - String DbCmd = "SELECT Info FROM " + DBTable + " WHERE RecID = '00000000'"; - - try - { - DBE.Command(DbCmd); - } - catch (Exception e) - { - success = false; - Console.WriteLine("RODB_GetNextRecid - Read NextRecID Caught an exception:\n{0}", e.Message); - } - - - if (DBE.Reader()) - { - if (DBE.Read()) - { - RtnStr = DBE.GetString(0); - DBE.ReaderClose(); - } - } - else - { - System.Windows.Forms.MessageBox.Show("Could Not Open Reader"); - } - - // Create the new next RecID - if (RtnStr.CompareTo("") != 0) - { - uint nxID = Convert.ToUInt32(RtnStr,16); - nxID++; - NextRecID = String.Format("{0,8:X}",nxID);// 8 char field padded on left with blanks - NextRecID = NextRecID.Replace(SpcStr,ZeroStr); - } - else - { - // there is no next RecID - Console.WriteLine("RODB_GetNextRecid No Next RecID!"); - } - - // Write the new next RecID - DbCmd = "UPDATE " + DBTable + " SET " + DBTable + ".Info = '" + NextRecID + "'"; - DbCmd = DbCmd + " WHERE RecID = '00000000';"; - - try - { - DBE.Command(DbCmd); - } - catch (Exception e) - { - success = false; - Console.WriteLine("RODB_GetNextRecid - Write new NextRecID Caught an exception:\n{0}", e.Message); - } - - try - { - DBE.NonQuery(); - } - catch (Exception e) - { - Console.WriteLine("NonQuery error:\n{0}", e.Message); - // bool retval = false; - } - DBE.CommandDispose(); - - return RtnStr; - } - } -} diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/V.ico b/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/V.ico deleted file mode 100644 index db073430350c6e3c5c8697248b6528ff47d505c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1078 zcmdr|I}(C06kO05hf0o+%HbHEz_Zwe&UD&Ao7?0#-T=F}F99JyqZZD%aItCw+Bn`Ou z=HVM)sP#=iuCKKgy|16>hKGo6*Y))bXaVoUyS^P8?%6T+aZZZ%N5(KGj`szbVVtZ; zCakaKBsRZ;ogF>ng>91$mOR~1*p%BjZ&O2ygcnOrX#~lVPySHMriOt}4AyvJI3D%y F-4lSEh4lac diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/app.config b/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/app.config deleted file mode 100644 index 3124cd94..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ParadoxConversion/app.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/About.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/About.cs deleted file mode 100644 index c4b6cbc4..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/About.cs +++ /dev/null @@ -1,184 +0,0 @@ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace ROEditor -{ - /// - /// Summary description for About. - /// - public class AboutDlg : System.Windows.Forms.Form - { - private System.Windows.Forms.Button btnHlpAbtOK; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label CopyrightMessage; - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.PictureBox pictureBox2; - private System.Windows.Forms.LinkLabel VolianWebLink; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public AboutDlg() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - CopyrightMessage.Text = "Copyright \x00A9 1993 - 2008. All Rights Reserved."; - - // - // TODO: Add any constructor code after InitializeComponent call - // - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutDlg)); - this.btnHlpAbtOK = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.CopyrightMessage = new System.Windows.Forms.Label(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.pictureBox2 = new System.Windows.Forms.PictureBox(); - this.VolianWebLink = new System.Windows.Forms.LinkLabel(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); - this.SuspendLayout(); - // - // btnHlpAbtOK - // - this.btnHlpAbtOK.BackColor = System.Drawing.Color.YellowGreen; - this.btnHlpAbtOK.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnHlpAbtOK.Location = new System.Drawing.Point(120, 118); - this.btnHlpAbtOK.Name = "btnHlpAbtOK"; - this.btnHlpAbtOK.Size = new System.Drawing.Size(75, 28); - this.btnHlpAbtOK.TabIndex = 0; - this.btnHlpAbtOK.Text = "OK"; - this.btnHlpAbtOK.UseVisualStyleBackColor = false; - this.btnHlpAbtOK.Click += new System.EventHandler(this.btnHlpAbtOK_Click); - // - // label1 - // - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(73, 28); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(216, 14); - this.label1.TabIndex = 1; - this.label1.Text = "Referenced Object Editor"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label2 - // - this.label2.BackColor = System.Drawing.Color.Transparent; - this.label2.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label2.Location = new System.Drawing.Point(60, 69); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(216, 23); - this.label2.TabIndex = 2; - this.label2.Text = "Version 4 Release 0"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // CopyrightMessage - // - this.CopyrightMessage.BackColor = System.Drawing.Color.Transparent; - this.CopyrightMessage.Font = new System.Drawing.Font("Arial", 6F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.CopyrightMessage.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.CopyrightMessage.Location = new System.Drawing.Point(0, 159); - this.CopyrightMessage.Name = "CopyrightMessage"; - this.CopyrightMessage.Size = new System.Drawing.Size(207, 14); - this.CopyrightMessage.TabIndex = 4; - this.CopyrightMessage.Text = "Copyright C 1993 - 2007. All Rights Reserved."; - this.CopyrightMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // pictureBox1 - // - this.pictureBox1.BackColor = System.Drawing.Color.Transparent; - this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); - this.pictureBox1.Location = new System.Drawing.Point(24, 24); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(32, 32); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.pictureBox1.TabIndex = 5; - this.pictureBox1.TabStop = false; - // - // pictureBox2 - // - this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image"))); - this.pictureBox2.Location = new System.Drawing.Point(227, 104); - this.pictureBox2.Name = "pictureBox2"; - this.pictureBox2.Size = new System.Drawing.Size(70, 32); - this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.pictureBox2.TabIndex = 7; - this.pictureBox2.TabStop = false; - this.pictureBox2.Visible = false; - // - // VolianWebLink - // - this.VolianWebLink.BackColor = System.Drawing.SystemColors.GrayText; - this.VolianWebLink.Font = new System.Drawing.Font("Microsoft Sans Serif", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.VolianWebLink.Location = new System.Drawing.Point(207, 159); - this.VolianWebLink.Name = "VolianWebLink"; - this.VolianWebLink.Size = new System.Drawing.Size(93, 14); - this.VolianWebLink.TabIndex = 10; - this.VolianWebLink.TabStop = true; - this.VolianWebLink.Text = "Volian Enterprises Inc."; - this.VolianWebLink.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // AboutDlg - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage"))); - this.ClientSize = new System.Drawing.Size(363, 204); - this.Controls.Add(this.VolianWebLink); - this.Controls.Add(this.pictureBox2); - this.Controls.Add(this.pictureBox1); - this.Controls.Add(this.CopyrightMessage); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.Controls.Add(this.btnHlpAbtOK); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "AboutDlg"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "About"; - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - #endregion - - private void btnHlpAbtOK_Click(object sender, System.EventArgs e) - { - this.Close(); - } - - } -} diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/About.resx b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/About.resx deleted file mode 100644 index fd163d92..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/About.resx +++ /dev/null @@ -1,4062 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAScgAA - EnIBXmVb4wAAAaVJREFUWEe1lgEOgzAMA8fPeRo/Y2shyKR2koKGhIa6UF+dNGX5jNdOxtrQAuMqBl/F - eDElEV/Xdd+2bbffX0gTM8H+jP/7ePJeBbaTXKI4SXs2CCWWjcMCpBNSvK2WwWWiwkkKcK0Q7L6lAF3A - GHyeSMsAsfvL8owCQ5AbqMKwdFCAFvj0igr1ZzcW9VF8zIGn4vYeg2ji7YaUcoC34gwCxb0LZT1VgNEE - 3WFY+SMHXDNiW6nnlV5nzpvtJu4hQgcK4gh0nwtWb70EIWxHSAC3HWUXc38c84G45XzKAaziSisdIAiA - T0PogFlmrbi6/DNucMBcQAgJgOJ+z06ApGkIAay3s85VhKAAUw6wii2KHx02KcTQAVWxbwHeOlD+uskc - wJ3FD6Pz0CBpqEKENZACsNbpWmgEIrdh+ThmrVM0EvpFpQqQNTWZggoEg/LisGrqmgRg3cvvDl8jTDzr - JSEA0itxOzGfiB8Ng3xgJjbe8q6Es5VbTykDREIBcNq7/gIwc4Trz3LSzysuzIjLGrBzPSswA7K4WfEO - IG6fOxVn42muWcAXe2L5o6rhd/EAAAAASUVORK5CYII= - - - - - R0lGODlhRgAgAPcAAACK/wCN/wCP/wCT/wCR/xCZ/6ja/7jh//b7//j8/wCX/w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BshvoKosSRCiJoe - ykv40VIrigdXxVKIitqzgrbCcVtVEBk3WANVPVQV8hVLmC0f1guJlKKujxGTQRU4FSrEfJYuGfy47GO1 - h6YgjiNpNSK8h6tIhrSU76E1puIginv3UBxPrQQd/gNHcddDfhBZoc06bpzQi2pDxvvoydIntWQRXzwp - +eOvqQTT/uPGdOBDcEwh7nuIiapkzom3VsYVGfBkYL58QZ78T1jBpy1N8+NE+5+toxEjB//nyt9F3rlJ - jkz+cOK/cp3L9W58MFhk0/6y9W56TmCoqfaglv8K/fBU5/MGu23bJsvSekul1rPSVm3bwHr//IESuF7T - wEzG/ZPJQMRcRdA5D8EzUDXVXCOQJtxgY9KEFFZo4YUYZqjhhgTpoMAABS0gogAEibiAFyWKCKJAbSyQ - oogEERCiiC6kmMJBKjBgCQgWEKSjQTre8eNADDhBkCNDWsLAigQpUFCSAzm5gJMFfXgQAxVU8KQbIUBZ - 5JFJMqCAEWE0+WSWVVoSCZSWLAAiAm/4eCUCDODxpJEDIenjAm3MYaacBjmpBptjMGCHAkH4aMUgU8g5 - gIs+4imQnkQyGeWTgwyCYpRliImQDI0U9MWohxD0hSWUnGqqGwTdoapAX3R7YdCmA436BRqmvsrhrrz2 - 6isABAQr7LDEFmvsscgmayyJvjbr7LPQDsQDBwf1ES2GdAiEggUyWlLIFQ9AkgezBLBgSR4BXMvQCAqQ - CMcXhOxgUBcExAGHuhmtaIhAebBpCR8CIYAvQw8MJEC2VAaAxEBxCBBGjQNHrFFAADs= - - - - True - - - - Qk0OjAMAAAAAADYAAAAoAAAAcgEAANEAAAABABgAAAAAAAAAAAASCwAAEgsAAAAAAAAAAAAApaWlpaWl - pqampqanpqanpqanpaWlpaWlpKSko6Oko6Oko6OkpaWlpqanpqanpqanpqampaWlo6Okpqanpqanpqan - paWmo6Oko6Oko6Oko6Oko6OkoqKjoaGhoqKio6Oko6OkpKSlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWm - pqanpqanpqanpaWmpaWlpaWlpaWlpa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so6OuIuLvImJvYiIvIqKvIaGwoSExIODx4SE - xI2NuJqaqqGhoaGhoaGhoaGhoaGhoKCgopiYq5WVr5CQto2NuYiIvIODwoODxoODxYKCxoaGwo+PtpmZ - qp+foqGhoaGhoaCgoKCgoKGhoaKiop+fppKStYiIwIODxYODxoODxYODxYODxYSExYODxYiIvpWVr6Gh - o6KioqKioqKioqGhoaGhoaCgoZycppCQsoaGwYKCx4ODxYKCxYGBw4GBw4CAwn9/wX9/wX9/wX9/wYCA - wYCAxISEw4qKvYuLu4qKvpeXsKGhpKCgpJaWro6Ot4+Pt4+PtZCQs42NtIiItoWFuIiIuoqKvIyMv42N - vY+PupGRuJGRtpWVsJ+fp5mZrpCQuJGRuIyMvY2NuoeHvoGBwn9/wn9/wYGBw4ODxIWFxIWFxYaGxI2N - upqarKGhop+fpKCgpJ6epJWVrYqKu4ODwYCAwoCAwYCAwoODwoiIvIuLuomJv5aWsZ6eqZycq56eqaSk - paCgqJqarZaWs4+Pu4iIwomJwIeHvoiIuYWFuoGBwYGBxYGBxIODxYODxoSExI2NuZycqaKiopycqJOT - so6OuY2Nuo6Ot4yMtomJuIeHt4WFtoaGt4qKuY2NuZCQupCQupSUt5aWt5ycsaenpaWlpaSkpJ2drJGR - uYmJv4qKvImJu4SEvoCAwICAwYGBwYODwoaGw4yMvZKSuZWVuJaWuJubsqSkp6SkpZqar4+PvIeHxYSE - yIWFx4SExYKCw39/xIODwImJu4qKu4yMvIyMvIqKvpOTs6CgpKOjoaKio6OjpKOjpKOjpKWlpqamp6am - p6ampqampaSkpKSkpKWlpaWlpaWlpaSkpaOjpKOjpKOjpKOjpKSkpKampaamp6amp6amp6ampqWlpaWl - paWlpaWlpaWlpaSkpKOjpKOjpKOjpKOjpKSkpKWlpaWlpaWlpaWlpqamp6amp6amp6amp6WlpaWlpaWl - paWlpaOjo6KioqSkpaWlpaWlpaWlpaWlpaWlpbAPpqanpqanpqanpaWlpaWlpqampqanpqanpqampqal - paWlpKSlpKSlpKSk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8gYG+gIDAgYHCgoLCioq+ - kJC3k5O1k5O4lJS5l5e2nZ2vpqamm5uuioq/g4PHhITGhYXGg4PFgYHEgYG/hoa5ioq3iYm7h4fBh4fB - hobDjIy7mZmuoKCjoqKio6Ojo6OjoqKjo6OkpaWmpqanpqanpqanpaWlpKSkpKSkpaWlpaWlpaWlpaWl - o6Olo6Oko6Oko6OkpKSkpaWlpqanpqanpqanpqampaWlpaWlpaWlpaWlpKSko6Oko6Oko6Oko6Oko6Ok - pKSlpaWlpaWlpaWlpqampqampqampqampaWlpaWlpaWlpaWlpKSkoqKjoqKjo6OkpaWlpaWlpaWlpaWl - sA+mpqempqempqempqelpaalpaWmpqampqempqempqelpaalpaWlpaWlpaWlpaWlpaWlpaWmpqampqam - pqelpaWjo6SkpKWlpaalpaalpaalpaampqempqempqekpKWjo6SioqKioqKioqOjo6Sjo6SkpKWlpaWl - paWlpaWlpaWlpaWlpaWlpaWmpqampqempqempqelpaalpaWlpaWlpaWlpaWkpKSjo6Sjo6Sjo6Sjo6Sj - o6Sjo6SioqKhoaGioqKjo6Ojo6Ojo6OioqOjo6ShoaWcnKuUlLWKisGDg8iFhcaEhMaEhMSHh76JibmJ - ibqHh7yUlKyfn6GioqCioqKjo6Ojo6Sjo6SkpKSamq6Kir2CgseDg8aDg8WFhcOKir+MjLyLi72Kir6O - jrubm66kpKWmpqSlpaWlpaalpaalpaampqWjo6WamqyNjbmJib6Kir2Kir2Jib6FhcCBgcODg8SFhcOM - jLuTk7Kbm6ijo5+hoaGhoaGhoaGhoaGhoaGdnaWQkLWKiruIiL+EhMOBgcaCgsWDg8WEhMaDg8eFhcWO - jryZma2hoaGhoaGhoaGhoaGhoaChoaCenqWSkrSLi76GhsSDg8aDg8WDg8WCgsSBgcWEhMOMjLqVlbCZ - mamhoaGioqKioqKioqKioqGhoaKZmamUlLCOjreHh76EhMKDg8KBgcSAgMKBgcKAgMF/f8F/f8F/f8J/ - f8KBgcGHh7yKiriJibqLi7qZmaqgoKShoa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qWdnayTk7aKisKEhMiFhcaDg8WDg8WEhMWF - hcSFhcOKir6Xl6+hoaSioqCfn5+fn5+fn5+fn6CYmKuPj7iKir2Li7yHh8CDg8SDg8SCgsaDg8SJibmS - krGVla6bm6igoKOhoaChoaGhoaKjo6SlpaOioqSXl7CJib+Dg8aEhMSDg8WCgsaGhsSKisGJicKIiMSR - kbidnaykpKakpKWjo6ShoaGgoKCfn6Kbm6mTk7GNjbiLi7yIiMCDg8WBgcaBgcWBgcWBgcV/f8WIiLmO - jq2Li66FhbiCgr19fcJ+fsKAgMKCgsSDg8aCgseGhsKJib6SkrScnKmhoaSioqKfn6SdnaaUlLGRkbWR - kbOMjLWLi7OIiLSGhriHh7qJibuJibyJib6NjbySkreenqyjo6ednayamq6WlrOUlLKOjraIiLmGhriD - g7yAgMF/f8SCgsKIiLyPj7eSkrWRkbecnK2jo6SioqWXl6+MjL2Li76Li72KiryKiruIiLmGhreGhriI - iLqKirqJibuKiruOjraTk7OXl7GgoKekpKKjo6OenqaXl66QkLaLi7qJibyJibqJibiIiLiIiLqJibuL - i7uOjrqUlLWcnKygoKehoaKhoaOcnKmYmK2ZmauXl66MjLiJibqIiLiGhriGhruHh7yGhsCNjbuUlLWV - lbKVlbOWlrSjo6empqSmpqWmpqaioqyUlLmMjMCIiMODg8SAgMOBgcKBgcGAgMKEhMCJibyMjLqLi72M - jLyWlrOioqampqGfn6qSkrmKisKMjMGNjcGJicKGhsGEhL6Dg7qGhraIiLeJibmJibyMjLqVla6jo56i - oqCioqOlpaWmpqampqampqalpaWmpqampqempqempqempqalpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWk - pKWkpKWkpKWkpKWkpKWjo6Sjo6SlpaWmpqempqempqempqalpaWlpaWlpaWlpaWkpKWkpKWlpaampqem - pqempqempqalpaWkpKWjo6Sjo6Sjo6Sjo6Sjo6SkpKWkpKWkpKWkpKWjo6SwD6SkpKOjpKOjpKOjpKWl - paampqampqampqampqamp6amp6WlpaWlpaWlpaSkpK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Qs42NsoeH - uIaGt4aGuIiIuoqKu4uLvIyMvYyMv5iYsqOjp6WlpJ+fppeXr4yMu4eHwIWFwoSEwISEvIaGt4eHuIiI - uYuLt42NuIyMuo+PuZqarqKipaOjo6OjpKOjpKSkpaSkpZ6eqZ2dqZOTtImJvYmJuYiIuYeHuIiIuImJ - uomJvIqKvYyMvJGRtpubqJ+fpKGhpKOjpKGhppycq5SUsI2Nt4qKuoiIuYeHuIWFtoGBvoGBw4ODxYSE - xoWFxYyMvpaWtJ+frKOjpqOjo6OjpKOjpKamp6amp6amp6ampqWlpaWlpaamp6amp6amp6ampqWlpaWl - paWlpaWlpaWlpaSkpaOjpKOjpKOjpKWlpaWlpaWlpaWlpaWlpaWlpaWlpaampqamp6amp6amp6WlpaWl - paWlpaSkpKOjpKWlpaWlpaamp6amp6amp6ampqWlpaWlpaOjpKOjpKOjpKOjpKOjpKKiorAPpqanpqan - pqanpqanpqanpqanpaWlo6OlpaWmpqanpqanpqanpaWlpaWlpaWlpaWlpaWlpaWlpaWlo6OkpKSlpaWl - paWmpqanpqanpaWmo6OkpKSkpaWlpaWlpaWlpaWlpaWlpaWlpKSlo6OkpaWlpqanpqanpqanpaWmo6Ok - o6OkpaWlpaWlpqampqanpqanpqanpKSlpaWlpaWlpaWlpKSkoqKjoqKjo6Oko6Oko6OkpKSkpaWlpaWl - paWlp6ejnp6skpK4j4+8jo68h4fDhYXGhITGhITGhITGg4PFgoLGjY26l5eun5+loqKgoaGhoaGio6Ok - pKSjo6OknJyqk5O0jIy9i4u8hobCg4PGhITFhITFhYXFhobEkJC6mpqvoaGnpKSkoqKioaGhoaGhoaGh - oaGgoKCgmZmljIy2ioq9jIy9iYnAhITGg4PEhITFhITGhITGh4fEkZG4np6oo6OjoqKhoaGhoaGho6Oh - oaGjlpavjY27iYm9iIi8iIi8iIi8ioq+jo69jY2/j4+7lpaxnJynoaGjoqKioqKhoKCgn5+en5+goKCk - oaGilpatiYm+goLHgoLGg4PFhITFg4PEgoLFhITDiIi9jo61nZ2noaGioqKjpKSlpKSlpKSloaGom5uu - kZG4h4fDg4PIg4PGgYHFgYHDgYHDgYHDgoLChYW/j4+ynJymnp6jmpqnlJSvjo61h4e7hoa7hoa5goK8 - f3/AgIDCgYHDhYXChYXChYXGh4fFj4+7nZ2so6Oko6Oin5+nkpK1iIjAioq+iYm8iIi7h4e2g4O6gIDB - gYHDgoLEg4PGjY26mJitnp6loKCjn5+mlpawkJC5kJC6jo67iYm+iIi5hoa3h4e1hYW8goLEgoLGg4PG - goLHiIi/lpawoKClo6OioaGklpaylJS0lJS1kpK2kZG2kJC0jo6yjY2uj4+tkpKukpKzj4+8jo67jY29 - kpK3nJyppKSfn5+lk5O0k5O1k5O1k5OykJC0ioq6h4e5h4e5h4e5iIi5iYm5iYm7jY28kpK3mpqwo6On - p6ejoaGok5O0h4fBhYXChYXDhYW+hoa3hoa3hoa3iIi1i4u1i4u3j4+0mpqpnp6loaGmoKCmoaGlpKSj - oqKlnp6pn5+omZmulJSzjo63iIi6iYm5hYW2h4e4iYm7ioq9jIy/jY2/jo69lJS3mpqyn5+po6OgoaGi - lZWwjY25iYm7iYm7ioq5h4e5gYG/gIDBgYHCgoLEgoLGhYXEk5O2mZmxmpqwoKCqpaWko6Oko6OkpKSl - paWmpqanpqanpqanpaWlpaWlpqampqanpqanpqanpaWlpaWlpaWlpaWlpaWlpKSlo6Oko6Oko6OkpaWm - pqanpqanpqanpqanpaWlpaWlpqampqanpqanpqanpaWlpaWlpaWlpKSlo6OkpaWlpaWlpqampqanpqan - pqanpaWlpaWlpKSko6Oko6Oko6Oko6OksA+lpaampqempqempqempqempqempqakpKSkpKSlpaampqem - pqempqalpaWlpaWlpaWlpaWlpaWlpaWkpKWkpKSlpaSlpaWlpaampqempqempqekpKWkpKSlpaWlpaWl - paWlpaWlpaWkpKWjo6SkpKSmpqampqempqempqelpaWkpKSkpKSlpaWlpaalpaempqempqempqalpaWl - paWlpaWlpaWkpKSioqOioqOjo6Sjo6Sjo6S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ampqempqem - pqempqalpaWlpaWlpaWlpaWlpaWkpKWkpKWjo6Sjo6SlpaampqempqempqempqalpaWlpaWlpaampqem - pqempqalpaWlpaWlpaWkpKWkpKSlpaWlpaampqempqempqempqalpaWkpKWjo6Sjo6Sjo6SlpaWwD6Wl - paampqamp6amp6amp6amp6amp6ampqWlpaSkpKWlpqamp6amp6ampqWlpaWlpaWlpaWlpaWlpaWlpaOj - pKSkpKWlpaWlpaampqamp6amp6WlpqSkpKSkpKWlpaWlpaWlpaWlpaWlpaSkpKOjpKSkpKampaamp6am - p6amp6ampqSkpKSkpKWlpaamp6amp6amp6amp6ampqWlpaWlpaWlpaWlpaSkpKKio6OjpKOjpKOjpKOj - pKOjpKWlpKSkpZ+fqZaWs4uLvoiIwoODxYSEx4WFx4SEyYWFyI2NvZeXsZ6epqKioaKioaKioqKioqGh - oaKioJubqJSUs4+PuIuLvIeHwYKCxISExYWFxYSEx4WFx4mJwo2NvJiYrqKipaWlpKSkpaSkpaOjpKKi - o6KioJ+fpJaWr4yMu4uLuYuLt4uLuImJu4aGwISExoODxoaGxI6OuZqaraKipaSko6OjpKOjpKKipKGh - oqKioKGho5OTspGRtoqKvYSExYGBxoGBxYODx4KCyImJwZOTt52draKip6SkpKKioqKioqKioqKioZ+f - oZmZpY+PsYmJuomJuYmJuIaGv4SExYODxoSExIqKvpGRtpeXr5ycqKCgn6Cgn6GhoaGhoaOjo6Skpp+f - qpWVtI6OvYyMvo2NvY2NvomJwYSEwoGBw4KCw4mJupSUq5ycoZ6enqGhnJmZqZCQtY6Oto2NuIyMuIaG - vYSEvYODvYGBwISEwIWFwoiIwYuLvo+PvJOTuJmZsKWlpaWlpKGhppubq5SUs46OuYyMvIiIv4ODxIGB - xIGBwoGBwoGBxImJvJGRtJKSs5GRtZOTspqaqqGhoqOjopmZrpCQt46OuImJuoSEvH9/wX9/w4GBxIKC - xIiIwIyMvIyMvo2NvZWVtJ+fqKOjpKCgpJaWsZKStpKStZOTtZKSspKSsImJtoKCwH5+xYCAw4aGv4uL - vIyMvY2NvJiYsKOjpKKio56epJ+fopWVrIqKuIeHvYiIu4iIuYiIuYiIuYmJuomJvImJvIqKu5CQtJiY - rKKipqeno6Skpp6eq5iYsY2Nu4mJvIiIuoiIuYmJtoiItoeHuIiIuomJvImJvYqKu5KSs5OTtJWVs52d - qqWlo6OjpKCgppiYsJGRuYyMvouLvouLu4mJuoaGuIaGuImJuoqKvYeHwoSExoODyIqKw5OTup+fr6en - paOjppWVrpKSsI+PsYmJuIKCwYCAw4GBwn9/wX5+woCAwIWFu4qKuIqKvY6OupSUtZ6erKWlpaWlpaSk - paSkpaSkpKSkpKWlpqamp6amp6ampqWlpaWlpaamp6amp6amp6ampqWlpaWlpaWlpaWlpaWlpaWlpaSk - paOjpKSkpaamp6amp6amp6amp6ampqWlpaWlpaampqamp6amp6ampqampaWlpaWlpaSkpKSkpKWlpaam - pqampqamp6amp6ampqWlpaSkpKOjpKOjpKSkpbAPpaWlpaWlpqalpqanpqanpqanpqanpqanpqanpKSl - o6OkpaWmpqanpqanpaWmpaWlpaWlpKSlpKSlpKSlo6Oko6OkpKSlpaWlpaWlpqampqanpqanpaWmpKSl - pKSkpKSlpKSlpKSlpqalpqampKSlpKSlpaWlpqalpqanpqanpqanpqamo6OkpaWmpqanpqanpqanpqan - pqanpaWmpaWlpaWlpaWlpaWlo6OkoqKjoqKjo6Oko6Oko6OkoqKknZ2olpawj4+2i4u7iYnAgoLFg4PG - hITHhYXGjo69mpqwnZ2toqKlo6OioqKioqKioqKioaGhoqKgmpqokJC1iYm8hoa+goLFg4PEhITFhITG - hYXGiIjCjo67j4+6m5uto6OkpKSkpKSlpKSlpKSlo6OlpKShnZ2mkZG0jo62jo63jY22i4u8hobDgoLH - hITFhobCjo67mJivoaGkpaWio6Oko6Oko6Oko6Oko6OjoqKgnZ2kkZG1ioq/g4PFgoLGg4PFg4PFg4PG - hITGh4fDk5O3oaGpp6ejpaWlo6OjoqKioqKioqKin5+mk5OviYm6iYm6iIi6hITAgoLGg4PGhYXEi4u9 - kJC3lpawnZ2ooaGioqKioKCfn5+foKCgoqKhoaGkmZmwjY29jIy/jY28jIy9iYnBhITFg4PEgoLCiIi6 - lJSrnZ2fn5+dnp6en5+cmpqkk5Oxjo63j4+2jIy5i4u5iYm5hYW8goLBg4PCg4PEjIy/jo6+jY2+kJC7 - lZW1oqKopaWlpqajoqKllZWxiYnAiYnAhITFg4PGgoLDgIDCgIDCg4O/jo6zkJC0kJC1lJSxmZmtnJyp - oaGhnJyolZWxkZG0jo63hYW/f3/Df3/Cf3/CgoLDh4fBjIy8i4u9jo66lpaznZ2roqKnpKSlpKSilJSx - kJC1kpK0k5O0k5O0jY25goLCgIDEgYHBhYW9i4u5ioq6jIy8i4u/kZG4nZ2qo6Oko6OioaGilZWtjIy2 - i4u3ioq3iIi5iIi5h4e5h4e5iYm6iYm8ioq7kJCxlZWsnJyoo6OlpaWloqKonJyvkZG5jY27jIy4jIy3 - i4u3h4e6hoa5iIi6iYm7iYm8iIi+iIi+h4fBjo64m5urpKSjo6OkpKSjoKCnk5O0jY27i4u7iYm7iYm6 - hYW4hoa3h4e6hYXAg4PEhITEiYnAlZW1nZ2voKCspaWopqann5+qlJSviYm6goLCgIDEgYHCgYHCgIDC - gIDAhIS5iIi2i4u5j4+5lJS0l5ewnJyro6OnpaWlpaWlpaWlpaWlpKSko6OlpaWmpqanpqanpaWmpaWl - paWlpqampqanpqanpaWmpaWlpaWlpaWlpaWlpaWlpaWlpKSko6Oko6OlpaWmpqanpqanpqanpqanpaWm - paWlpqampqampqanpqampaWlpaWlpaWlo6Oko6OlpaWlpaWlpqampqanpqanpaWmpKSlo6Oko6Oko6Ok - sA+lpaWlpaWlpaWlpaampqempqempqempqempqempqakpKSjo6SlpaampqempqempqakpKSjo6Sjo6Sj - o6Sjo6Sjo6SkpKSlpaWlpaWlpaWmpqampqempqelpaajo6Sjo6Sjo6SkpKSmpqampqempqempqelpaWl - paWlpaampqempqempqelpaWlpaWlpaampq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RkbiVlbScnKyjo6Wl - paWlpaWlpaWlpaWlpaWkpKWjo6SlpaampqempqelpaalpaWlpaWmpqempqempqelpaalpaWlpaWlpaWl - paWlpaWlpaWkpKWjo6Sjo6SmpqempqempqempqempqalpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWj - o6SkpKSlpaWlpaWmpqempqempqekpKWjo6Sjo6Sjo6SwD6WlpaWlpaWlpaWlpaWlpqamp6amp6amp6am - p6amp6ampqWlpaOjpKWlpqamp6amp6ampqWlpaOjpKOjpKOjpKOjpKOjpKOjpKWlpaWlpaWlpaampqam - p6amp6amp6OjpKOjpKOjpKSkpKWlpqamp6amp6amp6WlpqWlpaWlpqamp6amp6amp6WlpqWlpaWlpqam - p6amp6amp6amp6amp6ampqWlpaWlpaWlpaWlpaSkpKKio6Kio6OjpJiYr5CQuI2NvImJwYODxoKCxIKC - xIKCxoaGwI6OuJOTtpSUt5qasKOjp6WlpKOjpKKio6KioqKiop2dqJeXrpCQtYiIv4ODxoSExoSExoOD - x4eHwYyMuo+Pt5WVspubraKip6WlpKSkpaSkpaOjpKSkpaWlpKGhqZiYsZCQtY2NuIqKu4WFw4SExoSE - xoSExoWFxYSExYaGw5GRt56eqKOjoaKioqOjpKOjpKSko6Cgp5WVtIiIwYKCxYKCxYODxoSExoSExoWF - xYiIwYaGwoyMvZiYsKKipaWlpaWlpaWlpaWlpaOjo6KioaGho5mZrI2Nu4SEw4GBw4CAwoODwIyMuZCQ - tZSUsZSUsZiYrp+fpqKio6KioqKioqKioqCgoJ+fn5+fopmZqpOTsYyMuYaGwYODxYSExISExImJvpWV - r52dop+fnp6enp6enp6enp+fnZycopWVq46OtIqKu4qKu4uLuoaGwYGBxYGBw4GBwoGBw4mJvpGRt5WV - tZaWtJmZsZmZsZ+fq6WlpaOjppiYsYuLvoSExYODxYKCxICAwoGBv4WFuoaGvYiIvoqKvYqKvImJvImJ - vIyMu5qarJ2dqJKStIWFwoGBxoKCxIGBw39/w4ODu4iIt4qKu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Q - kLmRkbaSkrSRkbSJibmFhbyHh7qKiriKirmLi7qQkLSSkrKWlq6fn6ilpaWlpaWdnbCVlbiQkL2Njb6L - i7yJibmIiLeDg7yAgMGBgcKCgsSDg8aJicCKir6QkLmdna2np6OlpaWjo6SkpKWlpaWlpaWlpaWlpaWl - paWkpKSjo6SkpKSlpaWlpaWlpaWlpaWlpaWlpaWkpKWjo6SlpaWlpaWlpaWlpaWlpaWlpaWlpaWjo6Sj - o6SlpaampqempqempqempqelpaalpaWlpaWlpaWlpaWjo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6SioqOi - oqKioqKjo6SwD6OjpKSkpKWlpaWlpaWlpaWlpaWlpaWlpqamp6amp6amp6amp6amp6ampqWlpKSkpKWl - pqamp6enqKamp6WlpqOjpKOjpKOjpKKioqOjpKSkpKWlpaWlpaWlpaWlpqWlpqampqWlpqOjpKOjpKOj - pKSkpKampaamp6amp6amp6ampqWlpaWlpaWlpaWlpaSkpaOjpKSkpKampqamp6amp6amp6amp6amp6Wl - paWlpaWlpaampKSkppaWs4uLvYWFxYSExoSExYSExYODxYSExISExYSExIeHwJCQtJycpaGhoqSkpKWl - paWlpaWlpaSkppubrpqaq5ubqZeXro2NuYaGwoSExoWFx4SEyIODyoeHxJSUtKGhpaKio6Kio6Kio6Oj - pKSkpaSkpaOjppycrZGRuYuLv4yMvo2NvYiIwoWFxYODx4SExYeHwYqKvpWVs5ubq6GhpaOjoqKio6Ki - o6Kio6Kiop+fpZWVsoqKv4mJwImJwIiIwoWFwoODwIODwIaGwpCQupiYr56eqKKipaOjpKOjpKSkpaSk - paamo5+fqpCQu4SEyIODyISExYSExYSExYODxoODxoaGvoeHvY6OtpqaqaGhoaGhoaKioqKio6Kio6Oj - oqKio5qaqpCQtYmJu4mJuIeHvYSEw4ODxoSEx4iIwY6OupWVsJ2dpqGhoaGhoaCgoJ+fn5+fnZuboJOT - q4qKuIODwICAxICAw4CAwX9/wX9/wYGBvYaGtoaGuYyMuJKSt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u4qKuYuLvIuLvYuLvYyMvJSUsJubqKCgo6OjoqKi - oaGho5SUsoeHwYKCxoODxYODxYGBxH9/w4WFu4qKt4iIvYODxIODxIWFxYqKvpaWr6GhpaKipJycqpWV - spOTtZKStpKStI+PtIiIuYeHuIaGt4aGuImJuIeHvYODxYSExIODxY2NupycqKSkoaOjpKWlpaWlpaWl - paWlpaWlpaWlpaWlpaOjpKSkpaWlpaWlpaWlpaWlpaOjpKOjpKKio6Kio6SkpaWlpaWlpaamp6amp6am - p6WlpqOjo6KioqKioqOjo6OjpKSkpKWlpaWlpaWlpaWlpaWlpaSkpaOjpKOjpKOjpKOjpKOjpKOjpKOj - pKWlpbAPo6Oko6OjoqKioqKioqKioqKipaWmpqanpqanpqanpaWmpKSlpaWlpaWlo6OjoqKioqKioqKi - o6Oko6Oko6OkpKSlpqanpqanpqanpqanpaWmpaWlpaWlpaWlpaWlpaWlpaWlpqampqanpqanpqanpqan - pqanpaWmpaWlpaWlpaWlpaWlpKSlo6OkoqKioqKioqKio6Oko6Oko6Oko6OkpKSjo6OknJyqlJSyjo65 - iYnAhYXDhYXCg4PFhITFh4fCjY26lJSympqqnZ2ioaGhoaGhoaGhoaGhoaGinZ2mmJivlZWxjo65h4fC - hITFg4PFhITGg4PIiYnEk5O8mZm0nZ2vpKSnpaWlpaWlpaWlpKSlo6OkoqKioaGjnZ2nkpKxhoa+gYHD - gYHDgoLEg4PFhITFg4PGhITFi4u9kZG3nZ2oo6OioqKjoqKjo6Oko6OkpaWioKColpayjo66i4u8i4u9 - hobChITGgoLIhobEkpK3mZmroKClo6Oko6Oko6Oko6OjoKCgnp6enJygmZmolJSxj4+1i4u6hYXBhYXD - hobEhobFh4fDjY29jIy8kJC1nJyopKShoqKjoqKjoqKio6Ohn5+mkpK0iIjAiorAioq/jIy9jIy8jIy8 - i4u9ioq9j4+2lJSxlpavnZ2ooqKioqKioqKio6Ohm5unkpKxjIy5ioq6ioq5hITAg4PDhITEh4fCjo67 - lZWzl5ewnp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SmpqempqempqempqempqempqelpaWkpKWlpaWlpaWlpaWlpaWjo6ShoaGioqCenqeVlbKMjL2D - g8eEhMaEhMaEhMaEhMaGhsSNjbyPj7mUlLOVlbGamqujo6GioqKioqKioqKiop+cnKSQkLSFhcODg8aD - g8WEhMSIiL+Li7uLi7qRkbGXl6uZmauenqakpKCjo6SmpqempqempqempqelpaWkpKWgoKqTk7eIiMOE - hMeEhMWDg8WDg8KBgcGIiLmOjrOTk62ZmaednaOioqKioqKioqKioqKioqKioqOenqiRkbWMjL2MjL2M - jL2MjL2Li7yKiryPj7eTk7KVlbGXl6+enqmioqWkpKSioqKhoaGioqKioqWXl7CQkLmHh8KBgcaCgsOD - g8SEhMSMjL6OjryNjb2Njb2Rkbienqqjo6WlpaWjo6WioqOhoaGioqOVlbCMjLyJib6Hh7+BgcWDg8WE - hMWEhMWDg8aGhsOOjrqZma2enqahoaOioqGhoaGioqKhoaOamquOjrmFhcSDg8eEhMWEhMWEhMWEhMaF - hcOLi7yTk7GcnKWhoaGjo6OkpKSioqSamqyOjrmMjLuMjLuGhsGCgsOBgcGBgb+Hh7mPj7KRkbKPj7eO - jruOjrqNjbuUlLSioqehoaiXl7OTk7mTk7mUlLmOjryKiryIiLiGhreJibmKiruKiruJibyMjLmUlLOZ - ma+hoaicnK2ZmbCZmbCUlLWJicCDg8aBgcWAgMKAgL+Bgb6Cgr+EhMGIiL6OjrmQkLmSkriamq+kpKWj - o6KdnaiRkbWGhsCBgcOCgsGDg7+GhriMjLKRkbCRkbGRkbSPj7mPj7qPj7yQkLiXl6yioqKenqeenqiZ - ma6MjL2CgsiEhMaCgsSBgcKKiraSkq+QkLWKisCEhMeDg8eBgcmJicGbm6+mpqSkpKWcnKyWlrKOjrmK - ir2KiruHh7mGhreHh7iJibmKiryKisCLi7+MjL6Tk7Wbm62hoaejo6OioqKjo6CXl66NjbuLi72Kir6B - gcWBgcGAgMGAgMGEhLuJibeIiLmJibyJib6JicCMjLyYmLCkpKOhoaOcnKmUlL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6amp6amp6WlpqWlpJ2dqZKStI2Nu4uLvoyMvYiIwYWFxYODxYKCxIODxIGB - x4aGw5OTtJ+fpaGhn6CgoJ+fn5+fn6CgnqCgoZubqZSUsJSUsJCQs4uLvIqKwIuLvouLvouLvoqKv4+P - upiYr6CgpaKioqGhoaGhoaGhoaGhoaGhoaGhop2dppaWr4qKvISExYSExYODxIKCw4ODxIWFxIuLv5KS - tpmZr5+fqKKioqKioqKio6Kio6Kio6OjpZubrY2NvYmJwomJwIaGwoSExoSExoWFxYmJvouLu4uLu5GR - tp6eq6SkpqWlpaWlpaWlpaWlpaKippiYr4+PuIqKvoaGwoKCxoODxYODxYODxYWFxIeHw46OvJubqqKi - o6Ojo6SkpaSkpaSkpaOjpaGho5eXr4iIv4GBx4ODxYODxYODxYSEx4qKwZGRuZKSt5KStpiYsJ+fpqKi - oqKioqKioqGhoZycpZSUr42NuYeHwYODxoKCxoKCxYGBxIGBxYSEw46OupqarZ+fqKSko6SkpKKipKKi - o6Kio6Kio52dpZiYqY+PsoiIuoeHu4eHu4eHu4KCwn9/xX9/xICAwIKCu4WFuIWFt4WFt4KCvYCAwoKC - woSExISExYSExoSExomJwJaWs6SkpqWlpZubr5OTt5KSuJGRt4yMuoWFv4CAw39/w39/wn9/w4ODwYqK - vIuLvYiIwY6OuZubqZycp5KSso6OuI6OuYyMuIqKuYqKt4SEuICAwYKCxYSExoSExoWFxoWFxoqKwZiY - s6KipaSkoKCgpJOTsoyMvIuLvYyMu42NuYyMt4iIt4eHtoeHt4iIuoqKvIqKvYuLvYuLwJWVt6GhrKen - paOjpZycrJeXsZOTsZGRsY2Nt4WFvoCAwYGBwoGBw4SExIiIwYuLvYyMvYuLvpaWsaCgqKampKOjp52d - rZqasZSUt4yMv4aGw4SEwYSEv4KCvoiIuomJuomJvIqKvZCQt5ubq5+fpqCgpaGho6KioJ2do5KSsYyM - uIyMuYuLuYyMtouLtImJtoeHtoiIuImJuYmJuoqKu46OuJubq5qarJiYrp6eqKOjopycq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aSkpKOjpKWlpaWlpaWlpaSkpKOjpKOjpKOjpKOj - pKOjpKWlpqamp6amp6amp6WlpaWlpaSkpKOjpKOjpKOjpKKioqKioqKioqKioqKio6SkpKWlpaamp6en - p6Kiq5mZspGRt4yMuIuLu4aGwoSExYSExYODxoWFw46OuJOTsJiYp56eoaKioaKioqKioqKiop+fopeX - qZOTrZGRr4mJuYODwoODxISExYeHwoyMvo2NvpOTuJmZsaGhqaWlpKOjpKOjpKOjpKKioqKioqOjn56e - pJCQtYSExIKCxIODw4ODw4KCxIGBxYKCxYODxoGByIWFw5OTtKCgp6OjpKOjpKOjpKOjpKKipJ+fppmZ - rY6OuouLvYyMvIiIwIKCxoKCxIKCxYmJv5CQt5GRtZaWr6OjoaGhoaGhoaKio6SkpKSkpqCgqpqar46O - voaGxYSExoSExYODxYSExYODx4iIwY+PuZeXsJ6ep6KioqKioqKio6Kio6Kio6Ojo6WlpZ+fqpKSuIiI - woWFxYSExYODxISExISExYSExYODxoeHwZaWsqOjpqWlpaOjpKSko6CgppWVsYeHv4ODxYKCxoGBxYGB - xIKCw4GBw4aGvY2NtI+PsJKSrJubpaGhoqOjpKOjpKOjpKOjpKKipZ2dqpiYroqKvoSExISExIKCxYKC - xIKCxIGBxoSEwIuLtJKSrJCQroODvYGBv4GBv4CAwICAwYGBwYODxIiIwYqKwIqKwIqKwI2NvZWVtKKi - p6amo52drY+PvYSEx4SExoSExoKCxYKCwYSEu4WFtoaGtoiIuI+Ps5KSsJKSs5WVsZycqKKioqOjoZ6e - pJKSsYaGv4CAw4CAwYCAwYCAwYGBxIaGw4yMvYaGxIaGxISEx42NvpycrqampKKipJ2dqZWVro2NtYmJ - uYiIuIaGt4aGt4aGt4aGt4aGuIiIt4yMtY6OtpSUs5SUs5ycrqiopqOjqpeXtomJwoSExoODxoGBxH9/ - wYWFuIGBvoCAwoCAwoKCxIODxYWFxISEx46OvZ+frKeno6KippmZrJmZrJubq5eXro6OtYiIu4aGuIaG - t4iIuIqKuoqKuoqKuoyMu4uLvJaWr5+fpaKio6OjoqGhpJOTspCQs5CQsYyMtYmJuomJuYODv39/wYCA - woKCw4KCxYODxYSExISExY2NvJycq6WloaKippeXsY+PuI6OuI6Ot4+PtY+PsomJuIaGtYODvYKCxIKC - xYODxYODxYWFxIyMvJiYr6GhpaSkpKWlpaamp6amp6amp6ampqSkpaOjpKOjpKWlpaWlpaWlpaWlpaWl - paWlpaWlpaampqamp6amp6amp6amp6amp6SkpaSkpKWlpaWlpaWlpaWlpaWlpaWlpaSkpaOjpKOjpKKi - oqKioqSkpKWlpaWlpaWlpbAPoqKio6OkpaWmpqanpqanpqanpqanpqanpqanpKSlo6OkpaWlpaWlpaWl - paWlpaWlo6Olo6OkpaWlpaWlpaWlpKSlo6Oko6Oko6OkpKSkpaWmpqanpqanpqanpqanpaWlpaWlpKSk - o6Oko6Oko6OkoqKioaGhoaGhoaGio6OjpKSkpqamoaGqm5uwlJS2jo65ioq9hYXDhITGhITGhITGg4PG - hITFjIy9lZWunp6joKCfn5+foaGhoqKipKShmpqrlJSukpKujY23goLDgoLEg4PFg4PGh4fCjo66k5O2 - lJS3mJixoqKopqakpKSlo6Oko6Oko6Oko6OioaGjm5upkpKziIi+iYm+hITCgYHEgYHEgYHFgYHFgIDG - hYXEkJC4nJypo6Oio6Oko6Oko6Oko6Oko6Oknp6nlpati4u7ioq6hoa+goLCgIDEgIDEh4e+kJC2kZG1 - k5Ozm5upo6OhoqKioaGhoaGho6OioqKnmZmyjo6+hobGhITIhITGhITFg4PFg4PFgYHHjIy8mJiwnJys - nZ2qoqKioqKioqKioqKjoqKjoqKknZ2qk5O3iYnChYXGhYXGg4PEgoLDg4PEhITEgoLHiIjBlZWznJyr - pKSlpKSlpKSlpKSknJyrjo65iYm/ioq+hobDgoLFgYHEg4PDiIi9jo61kJCylJStmZmknZ2eoKCgoqKi - o6Oko6OkoqKlnp6pl5ewioq/hYXDg4PEg4PFg4PFg4PFg4PGhYXBi4u4kZGvjY2xg4O/gIDDg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ODx4SExYODxoSExYiIwZCQuZiYsJycraSkpaWl - pKOjpaOjpKOjpKKio6CgpZOTs4iIvoODw4KCxYGBw4GBw4GBw4GBxIGBx4aGxJWVtqGhqKKipaOjpKOj - pKOjpKOjpKCgpZWVsY6OuIqKu4eHvIeHuoWFuYWFt4eHuImJuYuLuYyMu42NvY+PvJGRuZubrqWlpKKi - p5aWs4uLv4KCyIGByYODyIODxIaGvYaGu4eHvIeHwImJwY2NvZCQuZaWsqGhpqeno56erI6OvISEx4WF - woSEwYSEwoKCwoGBwoGBwYKCxISExYODxoSEw4iIv4+Pu56erKSkpaampKOjpZ6eqZaWs4uLvYWFwYGB - xICAxX9/w4CAwYWFvIyMto6OuI6Ouo2Nu42NvJCQuZubrqKipKOjoZeXq4qKuImJuYiIuYaGuIWFuIaG - uYiIuYyMt5KStpOTtZKStpSUtJmZrpycqJ6epaKin5mZqYuLuISEwIWFwISEwYaGvIODvoCAv4GBvoSE - v4iIv4yMvY2Nvo6Ovo2NvZCQuZqaraGhpaKioqCgop6epZmZqpKSs4eHvYWFvYODvISEuIaGtoeHuIqK - uoqKuomJvoiIwYeHwoqKv5aWr6CgoqGhoZiYrIyMu4WFxISExoODxYKCxYGBwoGBwYCAw4KCxIeHv46O - t5KSspSUsZqaq6OjoKOjoqOjpKOjpKOjpKSkpKWlpaWlpaWlpaWlpqWlp6amp6amp6amp6WlpaWlpaWl - paWlpaWlpaSkpaSkpaSkpaSkpaOjpKOjpKOjpKOjpKOjpKOjpKSkpaWlpqWlpqWlpqWlpaWlpaWlp6am - p6amp7APpKSlo6Oko6Oko6Oko6Oko6OkpKSlpaWlpaWlpaWlpKSko6Oko6OkpKSlpKSkpKSko6OkoqKj - oqKjoqKjo6Oko6Oko6Oko6OkpKSlpqampqanpqanpqanpqampKSko6OkpKSlpqanpqanpqanpqanpqan - pqanpqamn5+slJS2j4+3j4+1kJC1kpK1jo67h4fEhITGhITHhITGj4+4n5+opqajpKSlpKSlo6Oko6Ok - paWinp6pkZG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pKSlpaWlpaWlpaWloqKioqKioqKioqKioqKio6OkpaWl - paWlpaWlpaWmpqanpqanpqanpaWmpKSko6Oko6Oko6Oko6OkpKSjnp6pmpqum5utmJivk5O0hobAg4PD - hYXEhobDjo67mZmuoqKmo6OlpKSlo6OkoqKio6OkpKSloaGnnJyskZG4hobDhITDgoLFgYHDgYHEgoLG - hITEjIy8mJiuoaGlo6OioqKjoqKjoaGhn5+fnp6en5+foKCenp6hmJirjIy8i4u+jIy9jIy9i4u8iYm6 - ioq6kZGzkpKylZWvnJyno6OioqKjoqKjoqKioqKioaGkmpqsjIy7h4fCg4PEgoLEgoLEg4PFhYXHhYXH - hYXGiIjClJS2oKCoo6OjoqKjoqKioqKioaGgnZ2hmJiqk5OxjIy5hYXBg4PFhITFhITFhYXEioq9ioq7 - jIy2k5Oum5unoKCgoqKho6Oko6OkpKSjoqKlmZmukpK1j4+2j4+0jY23ioq7ioq7hITDhITEhITEhYXE - i4u8mJiroKCioqKhoKCgoKCfoKCjmpqsjY28hobDhITDg4PCgYHDgYHDgYHDiIi8j4+2lpavnJymoqKg - oaGho6Oko6OkpKSkpKSkn5+pkZG4jIy9i4u+h4fCg4PGhITFhYXGhYXGhITGiIjCjY28lZWxoKCkoqKi - o6OjpKSlpKSlpKSlpKSlo6OkpKSjoKCnkpK0iIi8iYm6iIi5gYHAf3/BgIDBgoLDgoLEgoLEh4e8jo60 - lZWwnJyto6OnpaWlnp6rkZG5iIjBhobAhYW+hIS9hoa4hYW5jIyyjo6ziYm8iYm8ioq+ioq/kJC4mpqt - oaGmoqKllZWziIjChITGg4PEgIDCgIC/hYW2iIi3hYXBg4PHhITGhITGhITGkJC5n5+opqaioqKnmpqv - lJS1kJC3kJC3j4+2i4u2iIi6hYW7hITChYXEhITFh4fBjY26kZG0kpK0mZmuoqKloKColZW0kJC5kJC3 - jo63j4+zj4+wjIyujIytjY2tiYm3iYm7ioq+kJC5nZ2rnp6pnp6po6Oknp6ojo63hITDhYXBhITBiIi8 - iI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aGhoaKioaKioqCgpJmZrJSUsomJvoSEw4WFwYaGwIuLvYyMvY+PuZGRuZWV - tZ+fqqWlpaOjpKOjpKOjpKOjpKOjpKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaampKOj - p5WVtIeHw4KCxoGBxIGBwoGBwn9/woGBxICAx4qKvZSUspKStJKStJGRtZeXr5+fpaKin5ycpZCQtIyM - uYeHv4WFwIWFv4WFvIaGt4aGt4eHuYmJuYqKuoqKu4qKu4uLupiYraGho6CgpZWVsYmJvIqKu4qKu4iI - u4mJtYuLr46Oro+PsIeHvYODxISExoSEx4eHxJWVtKKipqWloqGhppaWsYmJv4aGw4aGwoODwoaGuoqK - s4mJtomJuomJuoiIvI6OtpKStJWVtJycrKOjpKOjpKSko6GhppqarJSUspCQsYqKt4mJt4SEvH9/woGB - woGBw4ODxYODx4eHw5GRt56eqaKioqKioJeXqoiIuoGBw4ODwYODwYGBwoGBwYCAwYCAw4GBw4GBw4OD - w4SEw4mJv5CQupqasKampKWlpaampJ+fqZqarZubrJqarpOTtYuLuoODwX9/w39/wYGBwoKCxIqKv4qK - v4+Pu5eXs56eq6WlpaampJycrJeXsJmZrpaWsouLvoODxIGBw4CAwYCAwoKCxIODxYSExYSExYODxoeH - wpKStZ6eqKOjpKWlpaWlpaWlpaWlpaWlpaWlpaOjpKSkpKampqamp6amp6amp6Wlpaampqamp6amp6am - p6WlpaWlpaWlpaWlpaSkpaOjpKOjpKOjpKWlpqamp6amp6amp6amp7APoqKioqKioqKjpKSkpaWmpqan - pqanpqanpaWmpaWlpKSlo6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6OkpKSlpKSl - pKSlpKSlpKSlpKSloqKjo6Oin5+llJSxiYm/hITFg4PEg4PEg4PFg4PFgoLGg4PEioq6j4+1m5uloKCf - oaGgoaGhoaGhoaGhoaGhoKCjnZ2olZWyiYm/hYXEhYXFhYXGhYXGhITHh4fEkZG1mZmsnp6ko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MGBgcOBgcOBgcKFhb6MjLiNjbmamqqjo6KioqOioqOgoKSb - m6mPj7eLi72MjLuLi7uKirqKiraIiLWIiLaMjLaPj7WNjbuMjLuMjL6SkridnaukpKSfn6uZmbGTk7iN - jb2Kir2JibqIiLmGhriGhreGhriGhriHh7mIiLqJibmIiLuMjLiZmaujo6Gjo6Sjo6Sjo6SkpKWlpaWl - paWlpaWlpaWkpKSkpKWlpaWlpaWlpaWlpaWkpKWjo6Sjo6Sjo6Sjo6Sjo6SwD6ampqamp6amp6amp6Sk - paOjpKOjpKOjpKOjpKKio6Kio6OjpKOjpKOjpKOjpKOjo6CgpJubq5WVsZOTtJKStI6OtoqKuImJuIqK - uYqKuYqKuoqKuZGRrp2doKCgn6CgoKGhoaKioaOjop+fp5WVso+PuouLvouLvouLvIqKuoqKuouLuYuL - uY2NtZSUrJ2dpKOjoaKio6Kio6OjpKOjpKOjpKOjpKGhopqaqo+PuIeHwoWFxIaGwoSExYSExYSExYSE - xYiIwpCQuJqaq6GhpaKio6KioqKio6OjpKSkpaWlpZqaroyMuoODwoGBxYKCxIKCxYSExoSExoSEx4aG - xY2NvpqasJ+fqKGhoqGhoKGhoaKioqKio6Ojop2dqJWVso6OuouLvYeHvYCAxIKCxYODxYODxYWFwoyM - upKSs5ycpaKioKKioqKioqKioqKioqKiopqaqY+PtomJvomJvYeHv4KCxYGBxoKCxIGBw4KCwYiIu5GR - rZubo5+fn5+fn5+fn5+fn5qapJWVrI6OtImJuYiIuomJu4eHvYiIvomJv4yMvJKStZiYr52dqaKipKOj - oqKioqKioqGhoaKin5ubp5CQt4mJv4eHwYKCxYODxYODxYSExYaGw4iIwYyMv5WVuJubsaSkqaiopqam - p6WlpqOjpKSkpaWlpqWlpqWlpqSkpaSkpaOjpKOjpKOjpKOjpKOjpKOjpKSkpaSkpaSkpaSkpaSkpaWl - paOjpKSkpaWlpaampaampqamp6amp6Wlpqamp6amp6amp6amp6WlpqOjpKOjpaWlpaWlpaWlpaWlpaWl - paW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KCgsKDg8WFhcSLi7uKiryUlLKfn6ajo6KioqOkpKWYmLCKisCEhMeFhcWGhsOK - iryKirqCgr+AgMKBgcOCgsSCgsSCgsSJib6MjLuUlLKgoKWioqOcnKmWlrOVlbeSkrqKisKDg8WBgcOB - gcKCgsKIiL+MjLyLi7yLi72Li76JicCSkreenqijo6GioqOdnamcnKqbm6qZmaiWlquJibmFhbuFhbqD - g76CgsSFhcaGhseJicWJicWGhsaLi76amq6kpKWenqudnayenqyamrCRkbmMjL6KiruIiLiHh7iIiLmK - iruLi72Li7yQkLeRkbWbm6ulpaKjo6SkpKWkpKWkpKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWkpKWjo6Sl - paWlpaWlpaWlpaWlpaWlpaWjo6SwD6OjpKWlpaWlpaWlpqamp6amp6amp6WlpaSkpKOjpKOjo6KioqKi - oqKioqGhopycppWVr5GRtZGRtIeHwIWFw4SEwoODxIODxYKCxoeHwZOTs5+fpqOjoaCgoJ6enp6enp6e - nZ2doZ2dpJycppWVsZCQt4yMvIuLvYuLvYuLvYqKvIqKvI6Ot5SUrpubpaCgoKCgoKCgoKCgoKGhoqKi - o6Gho56eppmZr5KSto+PuYiIwIODxYSExoODx4qKv4yMvYuLvoyMvJSUsqGhpKOjpKOjpKOjpKOjpKOj - o6GhopWVsYiIwYODxoODx4SEx4SEyIWFx4eHxYiIw4aGw4uLvZqar6SkpqSkpaSkpaSkpaSkpKGhopub - ppaWrZGRtIiIv4ODxoSExoSExoSExoSExoiIwY+Pt5WVr5ycqKGhoqGhoaGhoaGhoaGhoaGhopubqY2N - uYmJvoqKvIiIvoSExISExYSExYODxoWFwomJvI6OtZqapZ2dnp2dnZ2dnZ6enZ6eoJiYppOTrIyMtoqK - uYiIvYWFxoWFxYWFx5CQvJWVtpWVs5ubqaGho6Kio6OjpKOjpKOjpKOjo6GhpJaWsIiIwIODxoKCxIGB - w4ODxYSExYSExYSExYODxoeHwpGRtZ2dp6Gho6SkpKampqamp6amp6amp6amp6amp6am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mZmln5+hoqKhoaGhoqKi - oqKioqKjoKCklJSvi4u2ioq4h4e9iYm+iYnAioq+jY26j4+4jo67jo67l5exoKCmo6OioqKjoqKioaGh - oKCgoaGfnJyll5erlparkZG1ioq+hITFgoLGg4PEhobBjIy7jY27jIy8kJC4nJyspaWjo6OkoqKjoqKi - o6Ohn5+llZWyioq/i4u+jIy+jIy9h4fCgoLHg4PFh4fDjIy/kpK4m5uuo6OnpaWlpKSloqKjoqKjpaWj - oKCpkZG6hITHhYXGhYXFgoLFgYHEgYHDgYHEgoLEh4fCj4+6mZmwoaGno6OkoqKjoaGhoaGhoqKgnJyn - j4+3i4u7jIy6i4u5i4u5i4u6ioq+hobDhobDhYXEiYm/lZWyoKCloqKioaGhoKCgoKCfnJyikZGthYW+ - gIDDgoLFhITFhITFhobCjo67lJS1lJS0k5O3nJywqamlpqanpqampKSko6OhoaGjmJiui4u9jY27i4u9 - hobEg4PHhITGhITGg4PFiYm+kpK0mZmtnp6oo6OkpKSkpKSko6OjoqKioqKio6OkpKSlpaWmpqanpqan - pqanpqanpqanpqanpqanpqanpqanpaWmpaWlpaWlpKSko6Oko6OkpKSlpaWmpaWmpKSlo6Oko6Oko6Ok - o6Oko6OkpKSlpaWmpqanpqanpqanpaWmpaWlpaWlpqalpqampqanpqanpKSlo6Oko6OkpKSko6OmnJyt - nZ2snp6rl5exjY25iIi8hoa8f3/BgIDCgYHDh4e9j4+2j4+2jo63jY25k5OynZ2no6OioqKjnp6nkZG1 - hITBgIDEgYHCgIDBf3/BgYHBgoLDgoLHg4PHiIjDlJS1nJyrnJypnp6pnJytlZW0l5ezlZW1kZG2hoa/ - f3/EgYHAgoK+iIi5i4u4jIy7j4+6lJS3lpa4mpqypKSoo6OpnJyxlZW3jo65jY26i4u6h4e8g4O8g4O8 - h4e9ioq6ioq6i4u7ioq9jo65l5evnJyooaGjpKShoaGlnJyql5eslJSsi4u3h4e3h4e1h4e2hoa9goLE - g4PDhITDiYm7jo60lZWtoKChoaGhnp6lkpK0jIy8jY26i4u5iIi5hIS5gYG9gIC/gYHAg4PBiYm/iIjB - iIjAioq+j4+5mJiuo6Oko6OkpKSjm5utj4+5jIy8i4u+h4fDhYXChITAgYHAf3/BgYHDgoLFgYHHhobE - i4vCjY3Al5e1paWopqampqakoKColpaxkZG1kJC2j4+1jY2zh4e1hIS4iIi4i4u3kZGxlZWxmJiwmpqu - m5uupKSlpaWmpaWmpaWmpaWmpKSlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpKSko6OkpKSlpaWl - sA+lpaWlpaWlpaWlpaWkpKWjo6SlpaWlpaWlpaWlpaWkpKWjo6SioqWYmLCJicCDg8aDg8SCgsOCgsSB - gcOBgcWKirmTk66RkbGRka+dnZ+fn52goKChoaGhoaGioqKgoKWamquUlLGNjbeGhr6CgsWDg8aDg8aI - iMCMjLyLi72Li72Rkbienqmjo6Sjo6OioqOioqOioqKhoaGhoZ+dnaSWlqyOjrSIiLuCgsOCgsWDg8WG - hsGLi7uKiryLi72MjLyWlq+hoaSkpKSjo6Sjo6SioqKhoaOenqaWlq+MjL2MjL2MjL2Hh8ODg8aDg8SF - hcKMjLuNjb2RkbqenqyoqKKlpaWlpaWkpKWioqSkpKKgoKiSkriGhsWFhcaEhMWCgsWCgsWCgsWCgsWD - g8KDg8SMjL2cnKylpaGjo6Sjo6SioqOioqGgoKKYmKyMjLqNjbiNjbmPj7WNjbWHh72FhcKFhcKGhsOF - hcSNjbubm6qjo6KioqKioqKioqKfn6KYmKiMjLaAgMSAgMOCgsSEhMWHh8KOjrqSkrSUlLWUlLWYmK+h - oamnp6empqempqempqakpKOhoaKZmayNjbuMjL2EhMWEhMeFhcaFhceFhceFhcaKisCRkbaZmayfn6ak - pKSlpaWlpaWlpaWkpKWjo6Sjo6Sjo6Sjo6SkpKWlpaWlpaampqempqempqempqempqempqempqelpaWl - paWlpaWlpaWkpKSjo6WmpqempqempqempqakpKSjo6Sjo6Sjo6Sjo6SlpaampqempqempqempqelpaWl - pa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KvYuLvI6Ouo6OupmZr6Wlp6Oj - q5qas5ubspqasJubrZWVroyMtIeHuIaGt4SEv4WFwISEw4yMu5iYrpubqZqaqqKipKOjo6OjpKSkpKWl - paWlpaWlpqWlpqSkpqSkpqSkpaWlpaWlpaSkpKOjpKOjpKOjpKOjpLAPoqKjoqKio6Oio6Oko6Oko6Ok - o6Oko6OkoqKko6OhoKCjlpaviIjAhYXChYXBhYXCiIjAjo67jY29jY2+jo6+kpK5nZ2tp6eio6OjoaGh - oaGhoaGhoKCenJygkZGvhYW/hITBhITBiIi9i4u7iYnAiorBiorBiorBj4+7m5utpKShoqKioqKjoqKj - oqKjoqKjo6OkpKSjmJiwioq/hYXEh4fBiIjAiIi/hITDg4PFhITChoa/iYm7jY21mpqpoKCioaGgoaGh - oaGhoqKioaGjl5evjIy7hobDgoLGg4PEhITFiIjAiIjAioq9kZG4lpa2l5e2oqKspqanpKSlo6Oko6Ok - pKSlp6ejmpqxk5O5kJC8h4fDg4PHg4PFg4PGg4PGioq8lZWvlpaumZmuoKCqpKSmpaWlo6OjoKCgoKCg - oqKim5uskJC4iYnBhYXEhITFhITFg4PGhITFiYnAjIy8j4+5lJSynp6lo6OfoaGhoaGhoqKinZ2pmpqt - lpaxj4+5h4fCg4PGgYHDgYHDgoLEhITFioq/lJS1mpqvoqKopKSjoqKjoqKjo6OkpKSkoaGlm5uukpK7 - iYnFhobIhYXIhYXGhYXGhYXGhobFi4vBlJS3n5+tpKSnpaWmpaWmpaWmpaWlpKSko6OkpKSlpqanpqan - pqanpaWmpaWlpaWlpaWlpKSko6Oko6Oko6OkpaWlpqampqampqampKSko6Oko6OlpaWlpaWlpaWlpaWl - paWlpaWlpaWlpqampqanpqanpqampaWlpKSkpKSlpaWlpaWlpqanpqanpqanpqanpqanpqampaWlpaWl - paWlpKSko6Oko6OkpaWinJyslZW0kZG2jo63i4u7goLBgIDCgIDBgYHCgoLEh4fAjIy7jIy8jIy7kJC2 - mpqso6OhoqKflpaujIy5iYm7iY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aeamquQkLeFhcSDg8aDg8WBgcOAgMOCgsOJibySkrOX - l7CgoKikpKWkpKSjo6SioqOioqOhoaaamq+OjruGhsWFhcmFhciFhciFhcaFhcaFhceEhMiFhceUlLik - pKmnp6ampqempqempqelpaalpaWkpKSkpKSlpaWmpqempqempqelpaalpaWlpaWlpaWkpKSjo6Sjo6Sk - pKWkpKWkpKSkpKSjo6Sjo6Sjo6Sjo6SkpKWlpaWlpaWlpaWlpaWlpaWlpaWmpqampqempqempqekpKWj - o6SkpKWlpaWmpqempqempqempqempqempqelpaalpaWlpaWlpaWkpKSjo6SkpKOXl7CQkLeQkLmNjbyL - i7qCgsKBgcN/f8GAgMGFhb+KirqLi7uLi72Skreamq6fn6mioqWioqKamqqSkrSMjLmLi7mLi7iLi7eN - jbSDg759fcR/f8KFhb6RkbObm6qbm6udnaiioqOfn6iUlLWOjruQkLqIiMKAgMmBgcWAgMSAgMOBgcOC - gsWDg8eCgsiDg8mDg8mJicKXl7OioqaioqScnKqWlrGNjbuFhcOEhMWDg8OCgr+IiLSOjq+RkbCTk7ST - k7aWlrScnK6hoamjo6elpaSenqmRkbaPj7mOjraOjrWLi7aKiriKiriIiLiGhruHh7+IiMGJib6OjreT - k7CXl66cnKmgoKSkpKGgoKaRkbWEhMKCgsOBgcOFhbyKirOKirCKirCNjbKQkLGTk6+Vla+VlbCWlq+X - l7CgoKelpaOioqWdnaiYmKyPj7SNjbaMjLiKirmJibiIiLiHh7iIiLqJibyJib2Kir2NjbmVlbKbm6yh - oaajo6Sioqafn6mamrCOjryLi76JibyEhL6AgMKAgMKCgsGHh7qNjbeOjriOjrmOjrmWlq+fn6Wjo6Oj - o6Sjo6SkpKWlpaWlpaalpaalpaalpaakpKWlpaWlpaWlpaWlpaWkpKSjo6SwD6OjpKOjpKKio6KioqKi - o6OjpKOjpKOjpKSko6Cgp5aWsY+PuIyMu4yMu4uLvIqKvIeHv4KCx4ODxoODxo+PvJ6eraampKWlpaWl - paWlpaOjo6GhoZ6epJe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oZ6ep5KStIyMuouLuYuL - uYyMtYyMsIqKsYiIsoyMso6OsouLt4qKu4uLu4yMupOTs5+fp6Sko6OjpKSko6OjoZycp5WVroyMt4iI - u4iIuYeHuYaGt4aGuYiIvImJvouLu5KStJGRtZaWr6CgpqWlo6KipZqarY2NvIyMvYyMvYaGwoGBxYGB - woGBwIeHuImJt4WFv4KCxoODxoSExpCQt56ep6OjoaKio6OjpKOjpKWlpaWlpaWlpqWlpqWlpqWlpqSk - paWlpaWlpaWlpaWlpaOjpLAPo6Oko6Oko6Oko6OjoqKioqKio6Oko6Oko6OkmZmtjo66jY29jIy7jIy7 - hobCgoLGg4PFg4PFg4PFj4+5l5ewn5+ppaWlpaWlpaWlpaWlpqaloaGml5eskJC0ioq7iYm6iYm5hITA - gIDFgYHEgYHEgYHEiIi/j4+5nJytp6ejpaWlpaWlo6OkoqKjoqKioaGjnp6mmZmsjo66i4u+h4fCg4PH - hITGg4PFiIi9iYm8iYm8kZG0nJyloKCgn5+fn5+foKCgoqKhoKCim5uolpavkJC2h4fAgoLGhITGhITG - hITGhITGiYm/jIy8jY28k5OzoKCmo6OjpaWmpqanpqanpaWnnp6qmZmui4u+g4PGg4PEg4PEg4PFg4PF - goLGh4fBjIy7jo63lZWvoKCioaGgoaGho6OjpaWlpaWloKCqk5O1hobAgYHEgoLEg4PFg4PFiIi/jIy7 - jo66jo65j4+4lZWyoKCmo6OioqKjoqKhoKCimZmpj4+3hYXDg4PGhITFhITFhITFg4PEh4e+jo61kpKv - k5OsmpqmoaGipKSkpKSlpKSlpKSloaGlm5uqkZG2h4fChITGhITEg4PFhITFhITFhITGhobHjY3Ampqy - oKCspKSnpaWlpaWmpqanpqanpqanpqanpaWmpaWlpKSlo6OkpaWlpqanpqanpqanpqampaWlpaWlpaWl - pKSko6OkpKSkpaWlpaWlpaWlpKSko6Oko6Oko6Oko6OkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpqanpqan - pqanpqampaWlo6OkpaWlpqampqanpqanpqanpq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amqigoKKhoaGhoaGhoaGj - o6Kmpqabm6+MjL6EhMWCgsWBgcaDg8WIiL+KiryKiryKir2Li72Ojrmbm6qhoaSioqOioqOjo6KgoKST - k7KFhcKBgceCgseFhcOKiruJibyKiruJibyNjbeTk6+ZmaeenqCgoKChoaKjo6SlpaWjo6adnauXl6+R - kbWIiMCDg8eCgsSBgcODg8WEhMWDg8eGhsSSkrigoKylpaelpaalpaalpaWlpaWmpqempqempqempqem - pqalpaWlpaWjo6SlpaWmpqampqempqempqelpaWlpaWlpaWkpKSjo6Sjo6SlpaWlpaWlpaWkpKSjo6Sj - o6Sjo6Sjo6SlpaWlpaWlpaWlpaWlpaWlpaWlpaWmpqampqempqempqelpaWjo6SkpKSmpqampqempqem - pqempqempqekpKWjo6SlpaWlpaWlpaWlpaKZma2Pj7eRkbWRkbSRkbOLi7iHh7iHh7iHh7mJibqJibmE - hMGDg8SDg8WHh8GVlbOioqWlpaKZma6RkbWQkLKNjbKLi7WKirWMjLGLi7GJibWJibmMjLuHh8WGhsaF - hciHh8OSkrSenqabm6qOjrmJibyIiL2CgsSAgMN/f8J+fsF/f8GBgcOCgsSDg8WDg8aIiMGPj7ubm7Cl - paWlpaWkpKWhoaWbm6eWlq2SkrKPj7GNja+OjqyNjbKHh76Dg8aEhMeEhMiKisOXl7WioqmmpqSkpKad - nayVlbOTk7OOjraHh76CgsSBgcOAgMF/f8OEhL+IiLqLi7iVlbCXl66Xl6+Zmamfn6KioqOenqienqee - nqecnKeXl6yNjbWCgrx/f8GAgMOCgsSEhMWDg8aGhsOSkrSbm6mcnKifn6Wjo6Kjo6WhoaaioqSbm6uS - krCLi7SGhrmFhbmFhbmGhrqJibqMjLyNjb+Ojr2Tk7iTk7eamrGhoaejo6KhoaaUlLWHh8OCgsiCgsiF - hcSJibuHh7eDg76BgcGAgMODg8KMjLqSkrWUlLOamq6hoaejo6OioqOioqOjo6Sjo6SkpKWlpaWlpaWl - paWlpaWkpKSjo6Sjo6Sjo6Sjo6SwD6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ipp2dqJWVrpCQspCQsY6OroqK - sYWFvIGBw4GBxYSExomJwZCQu5+frKampaampaSkp5ycrpSUtJCQuImJv4ODxYKCxYKCxICAw4SEvomJ - uouLu4uLvIqKvYuLvIiIv5CQtZycpqGhoZ6ep5+fpp2dqZmZrY+PtoWFwICAwn9/wYCAwoKCxIODxYOD - xoWFw46OuZGRtZSUsZycp6OjoKKiop6epZubqpmZq5WVrYyMtIWFuoaGuYaGt4iIuIqKuYyMu46Ovo6O - vZSUt5qasZycrqGhqqamo6GhpJWVtIqKv4iIwomJwYuLvouLuoODv4CAwX9/w4SEvoeHvISEwYiIwIWF - w46Ou5ycrKSko6OjpKKio6Kio6OjpKSkpKSkpKWlpaWlpaWlpaSkpaOjpaKio6KioqKio7APoqKjoqKj - oqKjoqKjo6Oko6Oko6OjoaGjlZWwjo65i4u8hITDgoLGgYHFgoLFhITFhobDiIjAhobDkZG1nZ2noqKi - oaGioqKkpKSlpaWlo6Omnp6rl5e0jo6+hobEgoLGg4PHhITHhobFioq+j4+2kpKwl5eqnp6koaGhoaGh - oqKjpKSlpaWlpqalo6Omm5utkJC4hITEgoLGgYHHhYXDiYm+ioq9iYm+h4e/jY24lZWtnJykoaGhoaGh - oaGhoaGhoKCgnp6fmJini4u5g4PFgYHGg4PGhITGhYXEiorBjY2/i4vBjo69l5eyoaGopKSioqKioqKj - oqKjoqKjo6Olo6Oonp6tkZG7iorChobFg4PHhYXFiYnAi4u8i4u7ioq8kJC2nZ2po6OjoqKioaGhoaGh - oqKgn5+jl5eskJC3jIy7jIy8jIy9jY29jY29jIy+jIy+ioq9i4u7lJSxoKCjo6OioqKioqKjo6OioqKj - nZ2ol5evjo65jIy6iYm8hYXCg4PGgoLFhYXBioq6k5OwnZ2lo6OfoaGhn5+fn5+foKCgoqKinZ2qkZG5 - iorAhYXGg4PHgoLFgoLEg4PFgoLFhobCiYm+jo64mJiuoaGlpaWmpaWmpaWmpaWmpaWmpaWlpaWmpqan - pqanpqanpqanpqampaWlpK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w4KCxoaGxYyMwI6OvJCQup2dqqOjpKSko6OjpJycqo6OuoSExYODx4KCxoCAxYGBwYOD - uoKCuoCAwYKCxYODxYODxYWFxI6OupycrKOjpaWlpKKippycrJWVsYmJvIGBw4CAxIGBwn9/wX9/wYCA - woGBxYWFxIiIwo2NvZycraSkpqWlpaamp6amp6amp6amp6amp6amp6amp6amp6WlpqWlprAPoaGml5e0 - iIjEg4PJhYXHhYXGhYXEhYXChYXDhYXDiIi9kZGznJynoaGjoqKioqKioqKioaGhoqKio6OjmZmvkpK3 - jY29hobFhITHhYXIhYXIhobHjIzBlJS3lpawnJyqoaGkoqKioqKjo6Oko6Oko6Oko6Ojo6OlmZmxjIy/ - iIjDhITIhITHgoLGgoLDiYm/jY28jIy+jY27kpK2nZ2ppKSgoqKioqKioaGhoaGhoKCimpqpj4+2h4fB - goLGgoLGgoLFhITFhITFg4PGhobCjY25lJSwnJyno6OgoKCgoaGhoaGhoqKhn5+lmZmrl5etkpK0kZG1 - i4u6iIi7iYm7h4e/hITEg4PGhobDj4+4m5upoqKgoaGhoKCgoKCgoKCgoaGgnZ2oj4+6iYnBhITGg4PH - hITGg4PFhYW/iYm7jY25k5O0mpqroKCloqKhoKCgoaGgoKCim5unk5OvjY23iIi7iYm5iIi9hITEgoLH - hITFiIjAj4+4lZWwmpqpn5+koqKioqKioqKioqKioqKjnp6mlZWtioq6iYm7h4fBhobEh4fDhYXEg4PG - g4PGgoLIi4u9mZmqo6OfoaGhoaGho6Oio6Oko6Oko6Oko6OkpKSkpqampqanpqanpaWmpKSlpKSkpaWl - paWlpaWlpaWlpKSkpKSlpaWlpaWlpaWlpKSko6Oko6OkoqKjoqKio6OjpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaWlpqampqanpqanpaWnpaWlpaWlpaWlpaWlpaWlpaWlpaWlpKSkpKSko6OkpKSlpaWlpaWlpaWl - paWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpKSkpKSjnp6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ruJibyFhcODg8aDg8WEhMSMjLyQkLeXl66fn6Sjo5+hoaGioqKioqKj - o6GgoKSbm6uSkrSJibyFhcCFhcWFhcaFhcWEhMWEhMWEhMSEhMOPj7ednaijo6ChoaGhoaGioqKjo6Ok - pKSjo6Sjo6Sjo6SkpKWlpaampqempqempqejo6WkpKWlpaWlpaWlpaWlpaWjo6SkpKWlpaWlpaWkpKWj - o6Sjo6Sjo6SioqOioqKjo6OkpKSlpaWlpaWlpaWlpaWlpaWlpaWkpKSlpaampqempqempqalpaWlpaWl - paWlpaWlpaWlpaWlpaWlpaWjo6Sjo6SkpKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaWlpaWlpaWlpaWjo6SioqWenqmUlLSIiMCCgsaDg8WBgcSBgcKAgMF/f8GBgcOCgsGHh7uRka6Z - maKenp2goKGioqSlpaKfn6iWlrOTk7eSkrWKirqIiLmGhraHh7iIiLuJibyKir6Kir2QkLqTk7ebm6+l - paSjo6KenqWcnKibm6qUlLKLi7uGhr2BgcCAgL+Cgr+Ghr2MjLiSkrSUlLKcnKqcnKmfn6aioqOdnamY - mK6VlbOMjLyDg8N/f8SAgMCBgb6FhbqHh7uIiL2IiL2IiL2Jib6Hh8GTk7ShoaelpaSfn6qSkriKir2F - hcKCgsWAgMWAgMN/f8KAgMGBgcODg8aFhcaJicONjb6Njb6Tk7egoKqmpqOjo6acnK+Pj7yOjruOjriG - hrx/f8KAgMKAgMGBgcCGhruEhL+BgceEhMiIiMSRkbqenqukpKOkpKOioqScnKqPj7qNjbyOjrqMjLqH - h75/f8OAgMGBgcKBgcKDg8OEhMSFhcSFhcSKir6YmLGkpKWhoaiSkreEhMaDg8aCgsWCgsWBgcOAgMKA - gMKBgcGIiLyKiruRkbaenqiioqWjo6ejo6ekpKampqampqempqempqempqempqempqempqempqewD5GR - toeHwoSExoWFxoWFxoaGxYWFw4SExIeHwI6Ot5SUr5iYq52do6CgoaKioqKioqKioqGho52dp5WVro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qKip5aWs4eHw4KCxoGBxYCAw39/wn9/wYCAwYGBw4ODxYmJwY+P - vI2Nvo2NvpSUtpycrqKipqCgpJmZrJSUspSUsZSUromJuICAwoGBwIGBv4WFuIKCwIGBxYKCxYeHwJWV - tJWVtZqasKGhp6Sko6OjpKCgpZKStJCQtpKStIyMvYKCx4GBw4CAwYCAwYCAwYKCwYSEwoWFw4mJwIeH - wpCQt5+fqaSkpZubrpCQu4aGxYODxoODxYKCxIGBwoKCwYaGuYmJuY+PtZaWrJubqpqarJqarZqar6Gh - qaampKWlpaamp6amp6amp6amp6amp6amp6amp7APkZG1jY26iIi/hYXDhITFhITFhITFhITFg4PGhobB - j4+0m5unoaGhoaGhoaGhoqKio6OhoaGjlpavioq+hYXFg4PFg4PFg4PFgoLFhYXGhITHiYnCj4+8lpa3 - n5+upqaopqalpKSkoqKjoqKjoqKjo6OinJyqlJSzkpK1kJC3jIy9jIy9jIy9ioq8iIi8i4u4kJCwkZGx - n5+lpKSjo6Oko6Oko6Oko6Oko6Oin5+llJSyi4u9i4u8i4u8hITDgoLEg4PGh4fCj4+4lJSymZmroKCk - o6OhoqKioqKioaGhoaGhoaGhoaGfnp6jlpatkJC2i4u8jIy8iIjChYXGhobFhobEiYm/h4e/kpKzn5+m - o6OhoqKioqKioqKioqKhnp6jlJSujIy4jY23iYm7ioq7ioq7ioq7ioq7ioq6jIy4kpKxl5eonZ2ioqKh - oqKjoqKjo6Oinp6mlJSvjIy3iYm7goLEgYHDgoLEg4PFg4PFg4PFg4PFjo64np6mpKSgoqKioqKioaGh - oaGhoKCkm5upkZG1hobDhYXEhYXEhITFhITFhYXFhYXFh4fDjo6+lJS4oKCspqako6OjoqKioqKioaGh - oqKjpKSlpaWlpaWlpaWlpaWlpKSkpKSkpqampqanpqanpqanpKSlpKSkpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaWlpaWlpaWlpKSko6Oko6OjoqKio6OkpaWlpaWlpaWlpaWlpaWlpaWloqKioqKjpaWmpqanpqan -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maefn6GioqGioqKioqKioqKhoaOWlq+MjLqMjLmNjbeQ - kLONjbeHh7+Dg8SEhMOEhMOFhcGOjrabm6agoJ6fn6ChoaKioqOenqeWlrCPj7eJibyDg8OCgsODg8WC - gsWCgsWCgsWDg8aGhsSSkrSenqSjo6CioqKioqKioqKioqCbm6eRkbWIiMKEhMWFhcSEhMWEhMWEhMWE - hMWHh8ONjbuTk7eamrGioqmmpqWlpaWjo6OioqKioqKioqKioqOkpKSlpaWlpaWlpaWlpaWkpKSjo6Sl - paWmpqempqempqekpKWjo6SlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWkpKSjo6Sjo6SlpaWl - paWlpaWlpaWlpaWlpaWlpaWkpKSioqKioqOkpKWmpqempqempqelpaWlpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaWkpKWjo6SlpaWlpaWlpaWlpaWlpaampqempqempqelpaalpaWlpaWlpaWlpaWlpaWmpqShoaeU - lLKIiMGEhMWDg8WCgsSAgMWAgMGGhraOjq2Pj66QkK+NjbSLi7iLi7mMjLeYmKidnZ2amqOZmaebm6WY - mKmMjLmHh72EhL2Dg72EhLyJibuJibuKiruHh7+GhsKGhsSKisCYmLCfn6iUlLaLi76Li72Li7yKiruI - iLiIiLWEhLyBgcKCgsOEhMSKiryKiryKir6Tk7Sfn6aioqOZmayamqyUlLCOjreHh72BgcKBgcKAgMGB - gcGCgsOCgsWDg8WJib2RkbKTk7GXl6yenqWjo6Ofn6eTk7aHh8OEhMeEhMaCgsSBgcJ/f8KFhb2JibqN - jbqMjL+GhsaGhsWEhMePj7yfn6ulpaWenqqcnKiamquamqqVla6NjbWGhrmAgL9/f8F/f8OEhL+KirmM - jLmLi7uLi7yXl7Kjo6enp6SlpaShoaWTk7OMjLuLi7yHh8CCgsWCgsOBgcGBgcCBgcCBgcCCgsGDg8KD - g8OHh7+Rkbabm6uioqOhoaWUlLSMjL+Li8GLi8CJib+Hh72IiLqMjK+KirOKireMjLiOjreVlbGamqqd - na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pKSkpqampqanp6eop6eopaWmpKSkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaWlpaWlpaWlpaWlpaWlpaWlpqampqaopqaopqampaWmpaWmpqanpqanpqampqalpaWlpaWlpaWl - paWlpaWlpaWlpaWlpaWlpKSkpKSkpaWlpaWlpaWlpaWlpaWmpqanpqanpqanpqampaWlpaWlpaWlpaWl - paWhnJyojo66hYXEhobDhobEjIy4jIyyhIS7f3/Ef3/Cf3/Eg4PBhYXAiIi+kJCynp6joaGfoaGdm5uh - j4+vhIS+hIS+hYW9hoa8hoa5hoa3h4e4hYW8hITBhITChYXAioq8k5OznJyqoqKkmpquj4+7jIy/jIy9 - jIy8iIjAgYHEf3/EgYG/hoa7i4u5i4u6jY28jIy9kZG3mpqsn5+mo6OimZmti4u+g4PHgYHHgYHDgIDC - f3/Cf3/CgoLAh4e8ioq6ioq7ioq8ioq/kpK3nJysoaGmoqKimJiviorAhYXGhobEh4fDiIjAioq6iYm3 - hoa6hITBg4PGhITGiIjCj4+7j4+7mJiypKSmpqalpqalmpqtkJC3i4u9iYm/hobBhYW+g4O8hoa4iYm5 - iYm7ioq7i4u7i4u9j4+2lpauoKCopqakpqalo6OonZ2qnJypmZmrkJC1hobAhYW+goLAgIDBgYHBhYXB - ioq+jIy6iYm9j4+1mJisn5+loqKjmZmrkJC3jY26jo65kJC2kZGyjIyzh4e3h4e3hoa6hYW/hobBh4fB - jY26kpK1mZmsoKClpKSkpKSkpaWlpaWlpaWmpaWmpaWmpqamsA+EhMWEhMWEhMWEhMaEhMaIiMGOjriT - k7KXl66enqajo6GhoaGhoaGhoaGhoaGioqCioqCdnaWPj7WDg8KBgcSDg8SCgsaDg8SLi7uRkbOXl62X - l66cnKulpaOlpaWlpaWmpqampqempqempqejo6ibm62NjbyKir6Li7uKiruMjLyMjL2Njb2Njb6MjL+O - jryVlbSgoKajo6OioqKgoKCgoKChoaKioqSenqmUlLWOjryLi76GhsGCgsaDg8WDg8WDg8aEhMaHh8CU - lLOfn6SioqKioqKioqKioqKioqKhoaOXl6+QkLaLi7uFhcKCgsaDg8WEhMSFhcSEhMaFhcaMjL+VlbWj - o6empqSkpKWioqOgoKCgoKCdnaaamqyYmK6VlbGOjrmHh8CCgsaDg8aEhMWFhcSJib+QkLednaiioqKh - oaCgoKCgoKChoaCdnaKUlK2KiruFhcSDg8aDg8WCgsWCgsWCgsWCgsWFhcKPj7abm6ehoaGioqGioqKi - oqKhoaGioqGcnKqWlrCTk7KRkbSOjreMjLyNjbyNjbyMjLyLi72Njb2UlLaenqmjo6WlpaWlpaWlpaal - paalpaakpKWjo6SioqOkpKSlpaWlpaWlpaWlpaWlpaWlpaWlpaWkpKSkpKSlpaWlpaalpaalpaajo6Sk - pKWkpKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWmpqam - pqempqempqelpaampqampqempqempqelpaakpKWlpaWlpaalpaalpaalpaalpaWlpaWkpKSkpKWkpKWk - pKWkpKWlpaWmpqampqempqempqelpaalpaWkpKWkpKWkpKKdnaeTk7SSkrWSkrSRkbaOjraGhrx/f8SA - gMGAgMGBgcKAgMSCgsSGhsGKiruRkbObm6ahoZ+cnKOOjrGEhL6GhryGhryHh7qGhriFhbeDg7qBgb+D - g8CHh8CKir2Pj7aVlbCZma2fn6acnKuUlLSOjrqLi76Hh8GEhMaBgcWCgsKGhrqHh7eGhr+Hh7+JicGI - iMKLi76UlLSenqmioqOXl6+IiMCDg8WFhcKEhMGEhL6Dg72Cgr6FhbqJibeJibqGhr+Hh8CIiMKLi8CT - k7idnayjo6Obm6iRkbaNjbyNjbyLi76NjbyLi7qHh7uBgb+AgMODg8OIiMGOjryQkLqOjryWlrSjo6em - pqSlpaWXl7OQkLmMjLyLi72MjLqKiriHh7eHh7eIiLmJibyHh8GHh8CHh8CHh8COjrebm6mkpKKjo6Ok - pKOkpKGkpJ+goKOWlq6Li7qHh76Dg8KBg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7OTk7STk7SYmK2fn6aioqGhoaGioqOioqOkpKSmpqWkpKaf - n6uZmbGUlLeQkLuJicGEhMaEhMaDg8WDg8WKir6Li7uUlLKhoaampqWlpaWlpaWkpKSjo6Sjo6OhoaKZ - mamMjLiDg8OBgcaCgsWCgsWDg8SDg8WHh7+Pj7aUlLKYmK6jo6GioqKioqKioqKioqKjo6GhoaOUlLKG - hsKBgcaCgsWCgsWDg8WEhMaEhMeNjb2RkbeRkbaZma2jo6SlpaWlpaWlpaWlpaWlpaWlpaWdnaqOjraI - iLuJibmJibqJibqJibqIiLqLi7aRkbCZmaqfn6WioqKioqKioqKjo6KhoaOamqmOjreFhcKCgsWCgsOC - gsODg8SEhMWEhMWDg8aKiryZmauioqChoaGhoaGhoaGhoaGhoaKgoKWamquamquVlbCOjrmLi76Njb6N - jb6Njb6MjL2MjL2MjL2SkrWgoKejo6Sjo6Sjo6SkpKSlpaWlpaWlpaWlpaalpaalpaakpKWjo6Sjo6Sl - paWlpaWlpaWlpaWlpaWlpaWlpaWmpqampqempqempqempqejo6Sjo6Slpaampqempqempqempqelpaal - paWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWkpKSkpKSlpaampqempqempqelpaalpaWl - paWlpaWjo6Sjo6SkpKSmpqampqempqempqelpaWlpaWlpaWkpKWjo6Sjo6Sjo6SkpKWlpaWlpaampqem - pqempqelpaakpKSkpKKfn6WQkLSEhMKCgsOCgsSCgsSBgcOBgcKAgMGEhLmIiLmKir2MjL6MjL2MjL2U - lLObm6ugoKOgoKCZmaiMjLiIiLmHh7mHh7mFhbqAgL9/f8GAgMGAgMOFhb+OjreTk7OSkrSVlbCdnaeZ - mayPj7iKir6Li72KiruKirmEhL+AgMKAgMGBgcOCgsSIiL2Li7yLi72MjL2QkLidnaqioqSlpaKbm6qN - jbaJibuJibuIiLmGhreCgrx/f8KAgMKAgMKAgMSGhr6SkrGcnKeenqegoKmlpaWioqiZma6SkrKQkLKO - jrGJibiHh7aC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66mJiuo6OjoqKioqKjo6Oko6Oko6Oko6OksA+FhcWFhcWEhMaF - hcWLi7+WlrSfn6qkpKWlpaWjo6Wjo6Sjo6OioqGcnKiRkbSKir2GhsKBgcSCgsSCgsWDg8WEhMWFhcWK - ir6WlrCenqWioqKioqKioqOioqOioqOhoaKioqKioqOenqiVlbSIiMKFhceEhMiEhMeDg8WDg8KGhr+H - h8CMjLuZmauhoaGioqGioqKioqOkpKWlpaWkpKacnK6RkbmMjL2Kir+FhcODg8WDg8WEhMSHh7+JibyM - jLmRkbOamqiiop+hoaGioqKioqKjo6GgoKWVlbGIiL+Dg8OCgsWBgcSBgcSBgcWCgsWCgsaFhcKNjbqb - m6ykpKOjo6Sjo6SioqOioqOkpKOjo6ebm7CVlbaSkrmOjr6Kir6IiLuJibmMjLeOjrSNjbWOjrSTk66Z - maWfn5+goKCioqGhoaOcnKiWlq6SkrOQkLeGhsKCgsWDg8SDg8SEhMSGhsKIiL+UlLGenqWhoaKhoaGh - oaGhoaGhoaGgoKGcnKWYmKqWlqyLi7mDg8OCgsWDg8SCgsSEhMWEhMeOjr6dna+lpaWlpaSjo6Sjo6Sj - o6Sjo6Sjo6Sjo6Sjo6SkpKSlpaWlpaWlpaWlpaWlpaWlpaakpKWjo6Sjo6SkpKSlpaWlpaWlpaWkpKSk - pKSlpaWmpqampqempqempqempqempqalpaWlpaampqempqempqempqempqalpaWlpaWlpaWkpKSjo6Sk - pKSlpaWlpaWlpaWlpaWlpaWlpaWkpKSlpaWlpaampqempqempqempqalpaWlpaWlpaWjo6SioqOjo6Sk - pKampqempqempqempqalpaWlpaWioqOioqOioqSjo6SkpKSlpaWlpaampqempqempqelpaahoaWfn6aR - kbOMjLaOjrONjbSJibmEhL6BgcGBgcOCgsWDg8WGhsOLi7+QkLmYmLGgoKmjo6ShoaWVla6Hh72CgsSB - gcWAgMWBgcKEhL2FhbeHh7mKirqJibyGhr+Ghr+FhcGRkbWdnaehoaOamquNjbyHh8CGhsCGhr6Fhb6F -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WlpaWlpaWlpaWlpaSkpKSkpKampqamp6amp6amp6amp6WlpqWl - paampqamp6amp6amp6amp6WlpqWlpaWlpaWlpKOjpKOjpKSkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl - paampqamp6amp6amp6WlpqWlpaWlpaSkpKKio6Kio6Kio6Skpaamp6amp6amp6WlpqSkpKKioqKioqKi - pKKipKOjpKSkpaWlpaampqampqamp6ampqSkpKamopubrJSUr5KSsIyMtoSEvYCAwoGBwoGBw4ODxYWF - womJvouLvZCQuZGRuJeXsqGhqKOjpZeXr4mJvYSEwYSEwYWFwoWFwIiIuIWFuIeHt4iIuoSEwIKCxYKC - xIODw4iIvZeXrZ2dp5OTs4mJv4uLuouLuYuLuImJuIeHuISEuoSEwIWFwYeHwIqKvpCQuJeXr5qaq52d - qaKipKGhppiYrpCQuIyMvYeHwoSEwYODwISEu4mJs4uLtomJuomJvIiIvo6Ot5qaqZ6epqCgpaGhoqWl - op+fq4+PvIODyIWFxoSExYKCw4GBwYGBwYGBw4ODxYSEx4SEx4SEx4uLv5eXr6KipKSko56eqZCQuIiI - woqKv4mJvoeHvIKCv39/wX5+woCAwoiIvZGRt5KSt5CQupCQupiYs6ampKSkpaSkpaWlo56ep4+PtoWF - xIODxYODxYKCxYCAwoODu4eHt4iIuYqKu4uLvIuLvYmJvouLu5iYraGho6OjoqCgpJaWrYiIvYKCxoGB - xYCAwn9/wn9/wYSEvIqKuIuLu4yMvYyMvoyMvpGRuJycqaKioqKioaKioqKioqOjo6OjpLAPh4fDhobE - i4u/kZG4lpa0mpqwoaGnpaWlpaWlpaWlpaWko6Okn5+pkJC3ioq+hYXDgYHHgoLFgoLEgoLDgoLDiIi9 - kJC1l5eunJynoaGioqKioqKioqKioqKjoqKjoqKjoqKkl5eviYm9hITEhobBhobBioq+hYXBgYHFgoLE - hYXBjIy2mJiqoKCioqKgoaGhoaGhoqKioqKjpKSioaGnlpa1iYnChITHhITGhITFhITFhITGhITHg4PH - kJC4mJisoKCioqK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lZWynJypoqKioaGhoqKioqKioqKioqKi - oqKinp6mm5uplpawj4+4iYnAhITEg4PFg4PGiIjBi4u8ioq9ioq7l5eroKCioKCfn5+foKCgoaGhoaGh - nZ2llZWvjY26ioq/iYm/hITEg4PFgoLFgYHGhobCkZG4mJiynp6roqKno6Olo6OjoqKioaGhoaGhnp6k - k5OviYm9g4PDgoLDgoLDgYHEhoa+iYm7iYm8ioq6iYm9k5OunJyhoaGfoaGhoaGhoaGho6OhmJiujo67 - i4u+i4u+i4u9i4u9ioq8ioq7ioq7ioq7i4u5jo6yk5Oqmpqhnp6dn5+fn5+fnZ2hlpapkZGwkJCykpKy - lJS2j4+7iIjChYXFhITHhobDkJC2l5eunp6moqKioqKioqKioqKioaGhnp6ll5etk5OxkJC0ioq9g4PF - goLFhITGhYXIh4fFjo69lJS2mpqwoqKopaWlpaWlpaWlo6OkpaWlpaWlpaWlpKSlo6Oko6OkoqKioqKi - o6Ojo6Oko6Oko6OkpaWlpqanpqanpqanpqampaWlpaWlo6Oko6Oko6OkpKSkpaWlpaWlpaWlo6OkpKSk - pqampqanpqanpqanpqanpaWmpaWlpaWlpqanpqanpqanpqanpqanpqanpqanpqanpaWmpKSko6OkpKSk - paWlpaWlpaWlpaWlpaWlpaWlpaWlo6Oko6Oko6Oko6OkpKSkpaWlpaWlpaWlpKSko6Oko6Oko6Oko6Ok - paWlpaWlpaWlpaWlpaWlpaWlo6Oko6Oko6Oko6Oko6Oko6Oko6Oilpavh4fBgoLIg4PGg4PFiIi7hIS9 - gIDBgIDDgYHDgoLEgoLFhobAk5OxnJynnp6moKCopKSlnJytm5uvnJytlZWyiIi+g4PCgIDCf3/DgoK/ - hoa8iIi9ioq+kJC1k5OzlJSxmJirm5ummZmomZmplZWvjo63ioq6iIi6gIC/gIDAgIDCg4PEg4PHh4fD - k5O2m5uunp6onp6noaGkoKClmZmtmZmukpK0jY25i4u9ioq8h4e4hoa2goLAg4PEhITHh4fEjIy+jY2+ - kpK2nZ2npKSfnp6nkpK1i4u9i4u+hYXDg4PGg4PFgoLDgYHCf3/CgIDDgIDEgoLGhITGhobGiorBl5ez - oqKnpKSjn5+ml5eukJC2kJC2kJC1jIy2h4e3hoa3hoa3iYm4ioq6ioq6i4u6j4+4mpqvnp6rpKSmpqak - pKSlm5utkJC6kJC6jIy7ioq7ioq6iIi4hoa3hoa3iIi5ioq7i4u8i4u8jY25kpK0mZmtoKClo6OioqKi - oaGhnZ2jl5epjo61hYW+gYHBgYHBgIDCh4e8jIy7jY29jo6+j4+8kZG6lZW1oaGppqakpaWmpqanpqan - sA+EhMWDg8aLi7+Xl7OgoKqlpaWkpKWjo6SkpKSlpaSenquSkriRkbmPj7uNjb6MjL2KiryMjLuRkbaU - lLWTk7WWlrGdnaqioqSioqOioqKhoaGhoaGioqKioqKjo6GdnaeXl6yRkbaNjbuKir+CgseDg8WCgsaI - iL+Li7yLi7yQkLWdnaShoaGhoaCfn5+fn5+goKCgoKKVla6MjLqJib+IiMCEhMSDg8WDg8WBgceFhcKO - jraWlq6Xl7CgoKqkpKakpKWkpKSjo6KioqGjo5+ZmamLi7qDg8SDg8SDg8SDg8SDg8SEhMKHh72IiLyI - iL6RkbGamqaenqCgoJ+goKChoaGhoaGiop+Wlq2NjbuKir+Li76KiryMjL2Li7yLi7yLi7yLi7yMjLmS - krGamqSenp2dnZ2fn56fn6CYmKmUlK2UlK2Tk66RkbOPj7qJicGGhsSCgsiHh8OSkreZma6enqehoaOi - oqKioqKioqKioqKioqKWlq6Tk7GTk7CNjbeEhMWCgsaCgsSEhMaFhciFhceKisGWlrSioqilpaWlpaWl - paWlpaWkpKWjo6SkpKWlpaWlpaWkpKWkpKSkpKSkpKSjo6Sjo6Sjo6Sjo6SkpKSmpqampqempqempqem - pqalpaWioqKioqOjo6Sjo6SkpKSkpKSkpKSjo6Sjo6SlpaWmpqampqempqempqelpaalpaWlpaWlpaam - pqempqempqempqempqampqempqempqalpaWjo6Sjo6SkpKSlpaWlpaWlpaWlpaWlpaWlpa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CwYSEw4SExoWFx4WFxoWFx4+Pup2dqKSkoqSkpaSkpaSkpJeXsY2Nu4qK - vIuLuYqKt42Nr4iIt4iIuoaGv4SExYWFxIWFxIqKv5CQuZycrKWloaGho5qaq5SUso2Nu4uLvYeHvoCA - w4CAwYCAwYCAwoKCxISExoWFxoeHxo6Ov4+Pvpqas6Skp6ampqamp7APlJSympqsoKCkoqKhoaGhoaGh - oqKjoqKlo6OloaGpmpqwlJS3jIy9ioq7iYm6iIi7i4u4kpKxkpKxkJCznJymoqKfoaGioqKjo6Oko6Ok - o6OkpKSjoaGlmJivi4u9g4PDgYHEgYHFgoLGhITDi4u6i4u6i4u6iYm8kZGznp6loqKioqKioqKioqKi - o6Ohnp6mkJCyjIy5hITCgYHFgYHFhYXBioq8hYXFhYXHhITIiIjDlJS2oaGppaWloqKjoqKioqKhoaGi - np6ol5eyjY29hobEhITHhITGhITFhYXEioq+i4u9ioq+jY27l5euo6OhoaGhoaGhoKCgn5+foaGfn5+i - kpKwioq3iYm6ioq7h4e+goLFg4PEgoLFiIi9j4+0lparnZ2mo6Oko6Oko6Oko6Oin5+kl5erkpKykZGx - kJCvjIy2hobBgoLGg4PFg4PFgoLHioq7mZmqpKSjpKSlpKSlpKSlpKSlpKSkoaGlmpqrkpK1jIy7hYXD - g4PGhITFhITFhITFhITDiorAkJC7mZmvpKSkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl - paWlo6Oko6OkpKSlpqampqanpqanpqanpqanpqanpqanpqampaWlpaWlpaWlpqanpqanpqanpaWmo6Ok - o6Oko6Oko6Oko6Oko6Oko6OkoqKioqKioqKipKSkpaWlpaWlpaWlpaWlpaWlpqampqanpqanpqanpaWl - o6OkpKSkpqampqanpqanpqanpaWlpKSko6Oko6Oko6OkpaWlpaWlpaWlpaWlpaWlpaWlo6Oko6OkoqKj - oqKioqKioqKioqKio6Oko6Oko6Oko6Oko6Oko6OkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl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xYKCxoSExIeHw4iIwo+Pup2drKWlpZycrpubr5iYsY6OuYeHwYiIwIeHvoWFvYWF - uYeHt4mJuYqKvIyMvpGRvJmZtZ2dsKGhq6WlpZ+fpZ2dp52dp5ubqJSUsImJvISEwIGBwoCAwYGBwoKC - xISEw4uLvpSUtZaWspubraKip6Sko6Kio5+fppOTr5CQsZCQsY2NtYiIu4SEwYGBw4CAw4KCxISExoWF - xYuLwI2Nvo+PvJGRuJiYrqSkpKSkpJ2dqZOTsouLu4WFwoCAxICAw39/wn5+w4KCv4mJu46Ou46OvY+P - vZCQvZOTupycsKWlp6amp7APoKCmoqKkoqKjoqKjoqKioqKin5+lmZmqkpKzjY27i4u/h4fChITGhITF - hITFg4PGg4PFiYm+lJSynp6noqKjoqKioqKioaGhoaGhoaGio6OhoaGknJypmJivk5O2kZG3kpK2kJC3 - jY25i4u8i4u8kJC4mJivnZ2noKCioaGhoaGhoaGhoaGhpKSfnJypj4+3i4u8jIy7jIy6iYm9hITDg4PG - hITFg4PGhobAjIy4mpqspaWkpaWlpaWlpaWlpqalo6Olnp6nl5eujo64ioq6iIi9hITCgYHDgoLDgoLE - gYHFhYXCjo66nJyrpKSgoqKjoqKjoqKio6OhoaGjlpauioq7iYm6hoa9g4PDg4PFg4PGhITGjIy9kpK1 - kpKzkpKxmJiooaGfoKCgoKCgoqKgnp6omJiwlZWzjo66hobBgoLGgYHFgoLEg4PFhITEh4fBjo63lpaw - np6oo6OhoaGhoaGho6OjpaWjn5+qkJC5hYXFhITGhITHhobDioq+jIy8jIy9jY28kJC4lpaxnJypoKCk - paWkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpqampqanpqanpqanpqanpqampKSkpKSlpKSkpKSkpaWlpaWm - pqanpqanpqanpqanpqanpqanpqampaWlpaWlpaWlpaWmpqanpqanpqampaWlpaWlpKSlo6Oko6Oko6Ok - o6Oko6Oko6OkpKSlpKSlpKSlo6Oko6OkpaWkpaWlpaWmpqanpqanpqanpaWlpKSkpKSkpqampq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CioqGioqOi - oqOjo6Sjo6SkpKOhoaaXl7CVlbKQkLaKir+EhMWCgsaCgsWDg8SGhsCJib6OjriXl62dnaeioqKioqKi - oqKioqKioqKfn6Sbm6mSkrSJicCGhsKHh8CJicGMjLyLi72Kir+MjL6Skreamq6goKahoaKhoaGioqGi - oqKioqKgoKWamqyRkbOLi7eKirmMjLePj7WPj7aKir6IiMKHh8OJib+Tk6+cnKKfn5+goJ+hoaGhoaGh - oaGhoZ6UlKyMjLeKirqKirqLi7mLi7mLi7qJibyLi7qQkLSRkbGOjrKdnaChoZ+ioqKjo6OioqWZma6U - lLSPj7mJib+EhMSDg8WEhMWEhMaGhsWOjryYmLGenqqjo6SioqOioqKioqKioqKioqKioqOhoaWWlrGL - i7qIiLyKirqLi7yLi72Kir6MjLuQkLeWlrKdnaufn6ijo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6SkpKSlpaWl - paWlpaWlpaWlpaWlpaWlpaWlpaempqempqelpaalpaampqempqempqempqempqempqalpaWlpaWlpaWl - paWkpKSjo6Sjo6SlpaWmpqampqampqempqempqelpaWkpKSjo6SioqOjo6OkpKSlpaWlpaWkpKWjo6Sj - o6Sjo6Sjo6Sjo6SkpKSlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaalpaampqampqakpKSioqKioqOjo6Sk - pKSlpaWlpaWlpaWlpaWkpKWjo6SioqOioqOjo6Sjo6Sjo6Ojo6OioqOioqOjo6Sjo6Sjo6SioqOioqOj - o6Sjo6Sjo6SkpKWmpqempqempqempqelpaahoaWTk7WOjrmPj7eNjbaNjbOPj6uKirGGhreGhrmJibqM - jLyQkLmUlLWbm62goKihoaShoaOYmK2Tk7SOjrqJib+GhsCHh7+Hh76EhLyAgMB/f8SAgMWEhMSIiMKI - iMOMjMGYmLOfn6mbm6qUlK2Skq6MjLaEhMCAgMKBgb+Bgb6FhbuIiLmJibqIiL2Li7qVla+fn6SenqSg - oKKjo6GdnaiQkLeNjbyIiMKFhcaDg8WBgcOBgcGE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Li7uMjLqFhcGCgsSDg8WFhcSLi72QkLeVla6e - nqSioqCgoKChoaGhoaGhoaGhoaKdnaaVlbCLi76FhcSEhMWDg8aGhsKOjrqSkrSSkrSSkrKVla2bm6eg - oKKhoaGioqKioqKioqKjo6KgoKKVlaqJibuJibuDg8GBgcWDg8aFhcOPj7iQkLeQkLiPj7uWlrOhoaek - pKWkpKWjo6SioqGgoKKcnKmVlbGMjLyEhMSCgseDg8aDg8WCgsSCgsSCgsaMjLyYmK+fn6WhoaChoaGh - oaGiop+bm6aOjraFhcWFhcSFhcSIiMGJib2Ghr+BgcWCgsSCgseLi7yVlbCdnaejo6GioqKioqKhoaGi - oqCfn6OXl6yQkLSRkbOSkrKMjLeIiLuJibqKiruKiruPj7WZmaydnamfn6mmpqalpaalpaakpKWjo6Sj - o6Sjo6Sjo6SmpqempqempqempqalpaWlpaWlpaWlpaWlpaWlpaWlpaWjo6SlpaWmpqempqempqempqem - pqelpaWlpaWlpaWlpaWlpaampqempqempqempqempqakpKSjo6SlpaWlpaWlpaWkpKWjo6Sjo6SlpaWl - paWlpaWlpaWkpKWjo6Sjo6Sjo6Sjo6SkpKSmpqampqempqempqelpaalpaWlpaWkpKWjo6SlpaWlpaWl - paWlpaWlpaWlpaWlpaWlpaWkpKSjo6Sjo6OioqKlpaWmpqempqempqempqempqempqempqelpaalpaWl - paWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWjo6SkpKWlpaWlpaWlpaWjo6Sjo6Sjo6Sjo6Sjo6Sjo6Oi - oqKjo6Sjo6Sjo6Sjo6Sjo6SioqWbm6yVlbSSkrWTk7OPj7WIiLmJibmGhrqHh7uKiryIiMCDg8iEhMaD - g8eJicCXl7ChoaSioqOenqeYmK2RkbOHh76AgMSBgcOBgcKAgMGAgMGBgcGAgMODg8GKirqQkLSXl62i - oqWenqySkreUlLWSkraHh8KCgsSBgcKBgcGBgcGBgcOCgsOCgsWHh8CMjLyNjbuUlLOhoaWkpKGdnamT - k7OOjreNjbmE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Khn5+jmZmpkJCziIi9g4PCgYHEgYHFgYHFgIDGgoLDi4u4k5OvmZmmoKCio6OhoqKioqKioqKi - oqKio6OgnZ2llJSvkpKyjo63ioq6ioq8i4u9i4u9jIy9jIy8ioq/lJSxn5+jo6OgoqKipKSlpaWmpaWm - paWmpKSlo6Oko6Oko6Oko6OkpaWmpqanpqanpqampaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWmpqanpqan - pqanpqanpqanpqampaWlpaWlpaWlpaWlpaWmpqanpqanpqanpqanpqampKSko6OkpKSlpaWlpaWlpKSl - o6OkpKSkpaWlpaWlpaWlpaWlo6OkoqKjoqKio6OjpaWlpaWlpaWmpqanpqanpqanpqampaWlpaWlpKSl - o6OkpKSlpaWlpaWlpaWlpKSkpaWlpaWlpaWlpKSlpKSlpaWlpaWlpaWmpqanpqanpqanpqanpqanpqan - pqanpqanpqanpqanpqampaWlpaWlpaWlpaWlpaWlpaWlpKSlo6OkpKSkpaWlpaWlpKSlo6Oko6Oko6Ok - oqKjoqKjoqKioqKioqKioqKioqKioqKin5+km5upl5etkJC0iYm5iYm5h4e5h4e2goK8gYHDgYHGgYHG - hITEhobFh4fEjY27mpqspKShoKClkZG1hYXEgoLHg4PEgoLEgoLEgYHCf3/Cg4O/iYm7iYm6ioq6kJCy - mZmpmZmonJyonZ2pmpqvmJiykJC6i4u+hobBgYHCgIDCgIDCgoLEg4PFhYXEh4fBjIy6mJisoqKjpKSh - o6OimpqrjY27iIjAh4e9h4e+ioq5h4e4gIC/gYHCgYHDgoLFg4PGh4fCkJC3lpaumpqooaGio6OhmZms - j4+5jIy8hobDg4PFgYHFgYHEf3/EgIDEioq3kZGvlJStlpatl5eumpqwn5+ro6OopqajnJyrkpKxkpKs - j4+wg4O/f3/Efn7Dfn7BgIDBgYHCgoLDhITEiYm/kpK3m5uvoaGopKSlpKSlpKSim5upkpKylJSylZWx - kZG2iIi+gYHDf3/Df3/BgYHCgIDFhobBiYm+jIy7kZG2lZWzn5+ppKSinp6nk5O0i4u9iIi/iIi/h4e+ - hoa7hoa4hYW5goK/sA+IiMCMjL6Njb2MjL+Njb2WlrSlpaWlpaSioqKgoKCgoKCioqKioqOhoaWXl6+P - j7mLi76GhsGCgsWCgsSCgsSAgMWCgsOLi7iVla2hoaKjo6GioqKioqKioqKhoaGhoaCenqKSkrGJib2J - ib2JibqKirmLi7qJib6GhsKGhsOJicCPj7mYmKyfn6WioqOioqGgoKCgoKChoaCgoKSYmK2NjbqEhMOC - gsaCgsWDg8OEhMODg8WCgsaCgsaCgseLi72amquioqKjo6OkpKWkpKWkpKWkpKaenquUlLONjbmMjLuJ - ib6FhcODg8aDg8WCgsWDg8SDg8KNjbObm6Sjo6CioqKioqKioqKfn6SXl62MjLqDg8OAgMaBgcWAgMSA - gMSCgsOIiL2OjrWWlqybm6Ofn5+hoaGioqKioqKioqKjo6GioqKcnKeVla+OjreKiryKiruKiruKir2L - i72MjL2MjL2RkbmdnaykpKSkpKOioqOioqOkpKWlpaalpaalpaakpKWjo6Sjo6Sjo6SkpKWmpqempqem - pqempqalpaWlpaWlpaWlpaWlpaWlpaWlpaWmpqWmpqempqempqempqempqempqempqWlpaWlpaWlpaWm - pqampqempqempqempqempqakpKSkpKSlpaWlpaWlpaWkpKWjo6SkpKWlpaWlpaWlpaWkpKWkpKWjo6Oj - o6Ojo6SkpKWlpaWmpqampqampqampqalpaWlpaWlpaWkpKSkpKSkpKSkpKWkpKWjo6SkpKWlpaWlpaWl - paWlpaWlpaWlpaWlpaWmpqWmpqampqempqempqempqempqempqempqempqempqempqalpaWlpaWlpaWl - paWlpaWlpaWkpKSkpKSkpKSlpaWlpaWkpKWjo6WioqOioqKioqKioqKioqKioqKioqKioqKioqKjo6Gc - nKmQkLaJib6Jib6JibqJibiEhLx/f8F+fsSBgcSDg8OFhcOIiMKOjruUlLWbm6yjo6KhoaSYmK6Li76E - hMWDg8WDg8WCgsSAgMOCgr6Hh7mJibqKiruPj7WUlK+Xl6yXl6ybm6ednaeUlLOQk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SlpKSlpKSlpqajoaGokJC4goLGgYHFgYHDgYHDgYHBgoK+iYm4iYm8ioq/ - i4vAi4vAjIy9j4+6mZmuoKCnpKSjn5+pkpK3ioq9iYm+iIi+g4PCgIDEgYHBgYG/sA+Njb2MjL6RkbmZ - mbGgoKmkpKWlpaWlpaWlpaWlpaWkpKSioqGgoKCbm6eRkbaHh8KDg8aEhMWEhMWEhMaFhcaEhMeHh8SQ - kLmamqqgoKKhoaCgoKChoaGioqKioqKcnKmamqmWlq2Pj7WHh72CgsWEhMWEhMaHh8KKir6Li72MjLyS - krWfn6ajo6KioqOioqOioqOioqOdnaeQkLOGhsCCgsSDg8ODg8ODg8WEhMWEhMWEhMWGhsKNjbmUlLGe - nqSioqCioqKioqKioqKioqKioqOdnaqYmLGTk7eMjL6FhcWDg8aDg8WDg8WGhsOMjLyWlrCdnaegoKKh - oaCfn5+enp6goKCWlq+Hh8GCgsiDg8aCgsWDg8WJibyIiL2Ghr6Fhb6GhryOjrSZmaWfn6CgoKCgoKCg - oKCgoKCioqCYmK2OjrmLi72Li7yLi72Njb6Njb6Njb6MjL+QkLeamqibm6qhoaWjo6OkpKSlpaWlpaWl - paWjo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6OioqKjo6SmpqempqempqempqalpaWlpaWjo6Sj - o6SkpKWlpaWlpaWlpaWmpqempqempqempqempqempqelpaWlpaWlpaWlpaWlpaampqempqempqempqem - pqakpKSjo6SlpaWlpaWlpaWkpKWjo6Sjo6SlpaWmpqempqempqempqalpaWjo6Sjo6SkpKWlpaWlpaWl - paWlpaWlpaWlpaWkpKSjo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6SkpKSlpaWlpaWlpaWlpaWlpaWlpaWlpaWl - paWmpqempqempqempqempqempqempqempqempqempqempqelpaWlpaWlpaWlpaWlpaWlpaWlpaWjo6Sk - pKWlpaWlpaWlpaWjo6SioqOioqOioqOioqOioqKioqKioqKioqKioqKjo6GgoKSXl66Li72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mZkImAD///B4AA - AAAAAACZmQiYkA////BwAAAAAAAPmZkJiYAP////AAAAAAAA//mZCJiQD/////AAAAAAD///kImJgA// - ////8AAAD////wmYmAAP//////////////B4mYkAD//w//////////8Hh4mYAA//8A/////////weHh4 - kAAP//BwAP////8AB4eHhwAAAAAAhwgAAAAAeHh4eHAAAACHhwhwh4eHh4eHh4cAAAAACHhwgAh4eHh4 - eHhwAAAAAACHhwAAB4eHh4cAAAAAAAAAAAAAAAAAAAAAAAAAAAADwD//AgAH/wAAA/8AAAH/AAAA/wAA - AH8AAAA/AAAAHwAAAA8AAAAHAAH4AwAH/AEAD/wBAB/8AAAf/AAAP/wAAD/8AAA/+AAAP/gAAD/wAAA/ - 4AAAH4AAAAAAAQAAAAEAAAABAAAAAwAAAAcAAAAPgAAAH8AAAD/gIAB/8DgD/w== - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AboutBckgnd_370x209.bmp b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AboutBckgnd_370x209.bmp deleted file mode 100644 index 21c5ce4934637654487494f3581db020d9fd8918..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 232464 zcmb5%NtPT(5+-QWt7UEa^{S3gC#VC|zAw}JOacKQFwgT4Km-PYBsc*e2+qVvGHX{i z>Q8<#Q#bbrFthy`92V}TrfRApzx*O9s{X(Jpa1LZe?3&M|LNcV@bCZqFNY5OAOHWC zL;u}-zy9z4cIZ(3n_rLf`m|n8`shy{J$m%;;dJ<9eCs-Y`f7aQ%W-9&Jb3VMZ*T8` z|8j>%kNTGT-LI(_=5lP7;Ub*hfjr++?u`q%U4 zf4F@4`PHk>Zr%EPcekrcoq4-=@5#-ZUthTJ!|Bt%<@#Ta9eaQD=m*Ev)*r`@zw<1& zZavxE)vML9^XuWYYu}zd`_q{-znnbz+tH(cbdl}tw+@wFx$?pVw{I)BR-^k|z50#E zRO-kPRlIi`Ir8qvk++8rzy0KsHxB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L6*Vl54*Y5*cNPS%{<9~p5#T^8<6}E*h{r~V=47(4KKClS{?whn3oT&=HYablilW~?Yu$MOX-?R` z{~yo-J|FqG`CeH+mw0sN(&hGwF3H%epF&DO0yD2)nE83z9`lm-Xfiu=!p5&>WJV5g z%?AI1D@HVg3YcmJ9^N1gat9157%oJKfY4Yf?vITMve3*3yt?Q?0f6Z7ymA}v%ps)w4-H2y9h;eC)< zKB7i=F)HXH+7K7X5C~D1uvY-9SxM(BC4|VxPKy`RghLn-uTV=msN_|1%PFz01~;?x WoJ|%e-)ce)6vu^{UFPzG&;I~+FTO1R diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AboutBckgnd_80.bmp b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AboutBckgnd_80.bmp deleted file mode 100644 index 7b2503a1210678adbac317a86e0a27c630e1317b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 166884 zcmcHCSGpxfvL$9TU-`x-4uK=+0q~tu>RZS}Dx}t00Vn`fD2RgADogZ0I1v73E5eTF zJ}2{nP4@XbBYnqqVQy~A%-q}~_W${R{ofb=mpAI~zxwxo)c^nGjW@pV|9^Soe|OE_ z|MtJW@kagI|Nh*6@4x>+Qa-->?t4i-u3x!1AE!(*&!0bk=bd+^R@zywQ*pg{(8%$R z)#Oghd++@@>E6A+U%mQW(v2HmUcUU@<;&l?Ub*u9ojZSj{P-`bAjTi6o;`bZ`}QXa zoId>z>CBmbojLPw>GI{DFJJ!U%9Wp=Jo#9&I?51aq(_hba_Q3d7cYKy{``*@E>wE^ z?H?{){PFtrFK^!b{QmvFD7^mZ^!Dw)U%dE}VsF3wBPoZGiQd-SNv&)<_L?_Rs6{P(9${UhnkH($K@=I{UUAHPX5eRJ#a#*MGi z(Zh#-)dezqtNfWW-(0@@$@%l&?Zf#=Uk@Mt4X)5^yy!;EIoMeiNWFw zo-3nGh2MPhw^OHn)2z9;cI^l0-o4KizJLFVBov-GV`xc5`KePc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+NSdSlkFngTvlMl9`+pXd0Ubs8ZF)XU;?a6|&G;r2%)LXZw zxdY`|a-+TE@}iz^=Gq>exns$X*Lj+O-8!TueM9Xt?M_^E09Bc;&}p(Z7AZjgAk_Hm z$}+pMot&^_VXi(YkvKzPbY@`-&|azG@wsI-8g3s|>inHplZKZL7Q3oTwp5qB9x=TTWXqGc%cP=IR z{T(hA!YhFCDHJ^`2)3ht`K1;cvqwpaQHc?c6>WNY)N^5~_3Bi@Bq=clGzA#781eiT zqAW5pOVkuVQR@IbSF4bIqh44TP+lDB&*!V6y7{1xnrwNyPaE0$BIhGNW!$GrWYaXk zndTvJv+Q-Bo{^>Y966IUe!ffmXv%G(D^eYqZz-ANGtzNDZl}NWz7CJQ<^{D;Wg{L7 zgQGc!z-X^a>|s=^;lGp4%~rO#YsOWC(}U_wXPQpnT2iE}hI@5cRzt^4I&Py%G9{D3 z&tT_ - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.logoPictureBox = new System.Windows.Forms.PictureBox(); - this.labelProductName = new System.Windows.Forms.Label(); - this.labelVersion = new System.Windows.Forms.Label(); - this.labelCopyright = new System.Windows.Forms.Label(); - this.labelCompanyName = new System.Windows.Forms.LinkLabel(); - this.textBoxDescription = new System.Windows.Forms.TextBox(); - this.panel1 = new System.Windows.Forms.Panel(); - this.panel2 = new System.Windows.Forms.Panel(); - this.panel3 = new System.Windows.Forms.Panel(); - this.labelVersionDateTime = new System.Windows.Forms.Label(); - this.labelServer = new System.Windows.Forms.Label(); - this.labelDatabase = new System.Windows.Forms.Label(); - this.panel4 = new System.Windows.Forms.Panel(); - this.panel5 = new System.Windows.Forms.Panel(); - this.panel6 = new System.Windows.Forms.Panel(); - this.panel7 = new System.Windows.Forms.Panel(); - this.btnEULA = new System.Windows.Forms.Button(); - this.btnOK = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit(); - this.panel1.SuspendLayout(); - this.panel2.SuspendLayout(); - this.panel3.SuspendLayout(); - this.panel4.SuspendLayout(); - this.panel5.SuspendLayout(); - this.panel6.SuspendLayout(); - this.panel7.SuspendLayout(); - this.SuspendLayout(); - // - // logoPictureBox - // - this.logoPictureBox.Cursor = System.Windows.Forms.Cursors.Hand; - this.logoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill; - this.logoPictureBox.Image = global::ROEditor.Properties.Resources.Red_V_txt_NB_bur_1984; - this.logoPictureBox.Location = new System.Drawing.Point(0, 0); - this.logoPictureBox.Margin = new System.Windows.Forms.Padding(4); - this.logoPictureBox.Name = "logoPictureBox"; - this.logoPictureBox.Size = new System.Drawing.Size(577, 174); - this.logoPictureBox.TabIndex = 25; - this.logoPictureBox.TabStop = false; - this.logoPictureBox.Click += new System.EventHandler(this.logoPictureBox_Click); - // - // labelProductName - // - this.labelProductName.Dock = System.Windows.Forms.DockStyle.Top; - this.labelProductName.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelProductName.Location = new System.Drawing.Point(0, 0); - this.labelProductName.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0); - this.labelProductName.MaximumSize = new System.Drawing.Size(0, 21); - this.labelProductName.Name = "labelProductName"; - this.labelProductName.Size = new System.Drawing.Size(577, 21); - this.labelProductName.TabIndex = 19; - this.labelProductName.Text = "Referenced Object Editor"; - this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // labelVersion - // - this.labelVersion.Dock = System.Windows.Forms.DockStyle.Top; - this.labelVersion.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelVersion.Location = new System.Drawing.Point(0, 0); - this.labelVersion.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0); - this.labelVersion.MaximumSize = new System.Drawing.Size(0, 21); - this.labelVersion.Name = "labelVersion"; - this.labelVersion.Size = new System.Drawing.Size(577, 21); - this.labelVersion.TabIndex = 0; - this.labelVersion.Text = "Version 1 Beta Release"; - this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // labelCopyright - // - this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelCopyright.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelCopyright.Location = new System.Drawing.Point(0, 0); - this.labelCopyright.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0); - this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 21); - this.labelCopyright.Name = "labelCopyright"; - this.labelCopyright.Size = new System.Drawing.Size(577, 21); - this.labelCopyright.TabIndex = 21; - this.labelCopyright.Text = "Copyright 2008"; - this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // labelCompanyName - // - this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelCompanyName.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelCompanyName.Location = new System.Drawing.Point(0, 0); - this.labelCompanyName.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0); - this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 21); - this.labelCompanyName.Name = "labelCompanyName"; - this.labelCompanyName.Size = new System.Drawing.Size(577, 21); - this.labelCompanyName.TabIndex = 22; - this.labelCompanyName.TabStop = true; - this.labelCompanyName.Text = "Volian Enterprises Inc."; - this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.labelCompanyName.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.labelCompanyName_LinkClicked); - // - // textBoxDescription - // - this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBoxDescription.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.textBoxDescription.Location = new System.Drawing.Point(0, 0); - this.textBoxDescription.Margin = new System.Windows.Forms.Padding(8, 4, 4, 4); - this.textBoxDescription.Multiline = true; - this.textBoxDescription.Name = "textBoxDescription"; - this.textBoxDescription.ReadOnly = true; - this.textBoxDescription.Size = new System.Drawing.Size(577, 119); - this.textBoxDescription.TabIndex = 23; - this.textBoxDescription.TabStop = false; - this.textBoxDescription.Text = "Thank you for choosing PROMS for your procedure maintenance solution.\r\n\r\nPROMS is" + - " protected under the copyright laws.\r\n\r\nPlease refer the the End User Licence Ag" + - "reement (EULA) for the terms of use.\r\n"; - // - // panel1 - // - this.panel1.Controls.Add(this.logoPictureBox); - this.panel1.Dock = System.Windows.Forms.DockStyle.Top; - this.panel1.Location = new System.Drawing.Point(12, 11); - this.panel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(577, 174); - this.panel1.TabIndex = 26; - // - // panel2 - // - this.panel2.Controls.Add(this.labelProductName); - this.panel2.Dock = System.Windows.Forms.DockStyle.Top; - this.panel2.Location = new System.Drawing.Point(12, 185); - this.panel2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(577, 31); - this.panel2.TabIndex = 27; - // - // panel3 - // - this.panel3.Controls.Add(this.labelVersionDateTime); - this.panel3.Controls.Add(this.labelServer); - this.panel3.Controls.Add(this.labelDatabase); - this.panel3.Controls.Add(this.labelVersion); - this.panel3.Dock = System.Windows.Forms.DockStyle.Top; - this.panel3.Location = new System.Drawing.Point(12, 216); - this.panel3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(577, 82); - this.panel3.TabIndex = 28; - // - // labelVersionDateTime - // - this.labelVersionDateTime.Dock = System.Windows.Forms.DockStyle.Bottom; - this.labelVersionDateTime.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelVersionDateTime.Location = new System.Drawing.Point(0, 19); - this.labelVersionDateTime.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0); - this.labelVersionDateTime.MaximumSize = new System.Drawing.Size(0, 21); - this.labelVersionDateTime.Name = "labelVersionDateTime"; - this.labelVersionDateTime.Size = new System.Drawing.Size(577, 21); - this.labelVersionDateTime.TabIndex = 1; - this.labelVersionDateTime.Text = "Version Date/Time"; - this.labelVersionDateTime.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // labelServer - // - this.labelServer.Dock = System.Windows.Forms.DockStyle.Bottom; - this.labelServer.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelServer.Location = new System.Drawing.Point(0, 40); - this.labelServer.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0); - this.labelServer.MaximumSize = new System.Drawing.Size(0, 21); - this.labelServer.Name = "labelServer"; - this.labelServer.Size = new System.Drawing.Size(577, 21); - this.labelServer.TabIndex = 3; - this.labelServer.Text = "SQL Server Name"; - this.labelServer.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.labelServer.Visible = false; - // - // labelDatabase - // - this.labelDatabase.Dock = System.Windows.Forms.DockStyle.Bottom; - this.labelDatabase.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelDatabase.Location = new System.Drawing.Point(0, 61); - this.labelDatabase.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0); - this.labelDatabase.MaximumSize = new System.Drawing.Size(0, 21); - this.labelDatabase.Name = "labelDatabase"; - this.labelDatabase.Size = new System.Drawing.Size(577, 21); - this.labelDatabase.TabIndex = 2; - this.labelDatabase.Text = "Database Name"; - this.labelDatabase.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.labelDatabase.Visible = false; - // - // panel4 - // - this.panel4.Controls.Add(this.labelCopyright); - this.panel4.Dock = System.Windows.Forms.DockStyle.Top; - this.panel4.Location = new System.Drawing.Point(12, 298); - this.panel4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.panel4.Name = "panel4"; - this.panel4.Size = new System.Drawing.Size(577, 28); - this.panel4.TabIndex = 29; - // - // panel5 - // - this.panel5.Controls.Add(this.labelCompanyName); - this.panel5.Dock = System.Windows.Forms.DockStyle.Top; - this.panel5.Location = new System.Drawing.Point(12, 326); - this.panel5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.panel5.Name = "panel5"; - this.panel5.Size = new System.Drawing.Size(577, 28); - this.panel5.TabIndex = 30; - // - // panel6 - // - this.panel6.Controls.Add(this.textBoxDescription); - this.panel6.Dock = System.Windows.Forms.DockStyle.Top; - this.panel6.Location = new System.Drawing.Point(12, 354); - this.panel6.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.panel6.Name = "panel6"; - this.panel6.Size = new System.Drawing.Size(577, 119); - this.panel6.TabIndex = 31; - // - // panel7 - // - this.panel7.Controls.Add(this.btnEULA); - this.panel7.Controls.Add(this.btnOK); - this.panel7.Dock = System.Windows.Forms.DockStyle.Top; - this.panel7.Location = new System.Drawing.Point(12, 473); - this.panel7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.panel7.Name = "panel7"; - this.panel7.Size = new System.Drawing.Size(577, 47); - this.panel7.TabIndex = 32; - // - // btnEULA - // - this.btnEULA.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnEULA.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnEULA.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnEULA.Location = new System.Drawing.Point(309, 14); - this.btnEULA.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.btnEULA.Name = "btnEULA"; - this.btnEULA.Size = new System.Drawing.Size(91, 30); - this.btnEULA.TabIndex = 27; - this.btnEULA.Text = "&View EULA"; - this.btnEULA.Visible = false; - this.btnEULA.Click += new System.EventHandler(this.btnViewEULA_Click); - // - // btnOK - // - this.btnOK.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnOK.Location = new System.Drawing.Point(499, 14); - this.btnOK.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(75, 30); - this.btnOK.TabIndex = 26; - this.btnOK.Text = "&OK"; - // - // AboutROEditor - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.ClientSize = new System.Drawing.Size(601, 529); - this.Controls.Add(this.panel7); - this.Controls.Add(this.panel6); - this.Controls.Add(this.panel5); - this.Controls.Add(this.panel4); - this.Controls.Add(this.panel3); - this.Controls.Add(this.panel2); - this.Controls.Add(this.panel1); - this.DoubleBuffered = true; - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Margin = new System.Windows.Forms.Padding(4); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "AboutROEditor"; - this.Padding = new System.Windows.Forms.Padding(12, 11, 12, 11); - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "About Proms 2010"; - ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit(); - this.panel1.ResumeLayout(false); - this.panel2.ResumeLayout(false); - this.panel3.ResumeLayout(false); - this.panel4.ResumeLayout(false); - this.panel5.ResumeLayout(false); - this.panel6.ResumeLayout(false); - this.panel6.PerformLayout(); - this.panel7.ResumeLayout(false); - this.ResumeLayout(false); - - } - //private void InitializeComponentORG() - //{ - // System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutROEditor)); - // this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); - // this.logoPictureBox = new System.Windows.Forms.PictureBox(); - // this.labelProductName = new System.Windows.Forms.Label(); - // this.labelVersion = new System.Windows.Forms.Label(); - // this.labelCopyright = new System.Windows.Forms.Label(); - // this.labelCompanyName = new System.Windows.Forms.Label(); - // this.textBoxDescription = new System.Windows.Forms.TextBox(); - // this.okButton = new System.Windows.Forms.Button(); - // this.tableLayoutPanel.SuspendLayout(); - // ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).BeginInit(); - // this.SuspendLayout(); - // // - // // tableLayoutPanel - // // - // this.tableLayoutPanel.ColumnCount = 2; - // this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33F)); - // this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 67F)); - // this.tableLayoutPanel.Controls.Add(this.logoPictureBox, 0, 0); - // this.tableLayoutPanel.Controls.Add(this.labelProductName, 1, 0); - // this.tableLayoutPanel.Controls.Add(this.labelVersion, 1, 1); - // this.tableLayoutPanel.Controls.Add(this.labelCopyright, 1, 2); - // this.tableLayoutPanel.Controls.Add(this.labelCompanyName, 1, 3); - // this.tableLayoutPanel.Controls.Add(this.textBoxDescription, 1, 4); - // this.tableLayoutPanel.Controls.Add(this.okButton, 1, 5); - // this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; - // this.tableLayoutPanel.Location = new System.Drawing.Point(12, 11); - // this.tableLayoutPanel.Margin = new System.Windows.Forms.Padding(4); - // this.tableLayoutPanel.Name = "tableLayoutPanel"; - // this.tableLayoutPanel.RowCount = 6; - // this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - // this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - // this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - // this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - // this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - // this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 10F)); - // this.tableLayoutPanel.Size = new System.Drawing.Size(556, 326); - // this.tableLayoutPanel.TabIndex = 0; - // // - // // logoPictureBox - // // - // this.logoPictureBox.Dock = System.Windows.Forms.DockStyle.Fill; - // this.logoPictureBox.Image = ((System.Drawing.Image)(resources.GetObject("logoPictureBox.Image"))); - // this.logoPictureBox.Location = new System.Drawing.Point(4, 4); - // this.logoPictureBox.Margin = new System.Windows.Forms.Padding(4); - // this.logoPictureBox.Name = "logoPictureBox"; - // this.tableLayoutPanel.SetRowSpan(this.logoPictureBox, 6); - // this.logoPictureBox.Size = new System.Drawing.Size(175, 318); - // this.logoPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - // this.logoPictureBox.TabIndex = 12; - // this.logoPictureBox.TabStop = false; - // // - // // labelProductName - // // - // this.labelProductName.Dock = System.Windows.Forms.DockStyle.Fill; - // this.labelProductName.Location = new System.Drawing.Point(191, 0); - // this.labelProductName.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0); - // this.labelProductName.MaximumSize = new System.Drawing.Size(0, 21); - // this.labelProductName.Name = "labelProductName"; - // this.labelProductName.Size = new System.Drawing.Size(361, 21); - // this.labelProductName.TabIndex = 19; - // this.labelProductName.Text = "Product Name"; - // this.labelProductName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // // - // // labelVersion - // // - // this.labelVersion.Dock = System.Windows.Forms.DockStyle.Fill; - // this.labelVersion.Location = new System.Drawing.Point(191, 32); - // this.labelVersion.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0); - // this.labelVersion.MaximumSize = new System.Drawing.Size(0, 21); - // this.labelVersion.Name = "labelVersion"; - // this.labelVersion.Size = new System.Drawing.Size(361, 21); - // this.labelVersion.TabIndex = 0; - // this.labelVersion.Text = "Version"; - // this.labelVersion.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // // - // // labelCopyright - // // - // this.labelCopyright.Dock = System.Windows.Forms.DockStyle.Fill; - // this.labelCopyright.Location = new System.Drawing.Point(191, 64); - // this.labelCopyright.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0); - // this.labelCopyright.MaximumSize = new System.Drawing.Size(0, 21); - // this.labelCopyright.Name = "labelCopyright"; - // this.labelCopyright.Size = new System.Drawing.Size(361, 21); - // this.labelCopyright.TabIndex = 21; - // this.labelCopyright.Text = "Copyright"; - // this.labelCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // // - // // labelCompanyName - // // - // this.labelCompanyName.Dock = System.Windows.Forms.DockStyle.Fill; - // this.labelCompanyName.Location = new System.Drawing.Point(191, 96); - // this.labelCompanyName.Margin = new System.Windows.Forms.Padding(8, 0, 4, 0); - // this.labelCompanyName.MaximumSize = new System.Drawing.Size(0, 21); - // this.labelCompanyName.Name = "labelCompanyName"; - // this.labelCompanyName.Size = new System.Drawing.Size(361, 21); - // this.labelCompanyName.TabIndex = 22; - // this.labelCompanyName.Text = "Company Name"; - // this.labelCompanyName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // // - // // textBoxDescription - // // - // this.textBoxDescription.Dock = System.Windows.Forms.DockStyle.Fill; - // this.textBoxDescription.Location = new System.Drawing.Point(191, 132); - // this.textBoxDescription.Margin = new System.Windows.Forms.Padding(8, 4, 4, 4); - // this.textBoxDescription.Multiline = true; - // this.textBoxDescription.Name = "textBoxDescription"; - // this.textBoxDescription.ReadOnly = true; - // this.textBoxDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both; - // this.textBoxDescription.Size = new System.Drawing.Size(361, 155); - // this.textBoxDescription.TabIndex = 23; - // this.textBoxDescription.TabStop = false; - // this.textBoxDescription.Text = "Description"; - // // - // // okButton - // // - // this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - // this.okButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - // this.okButton.Location = new System.Drawing.Point(452, 295); - // this.okButton.Margin = new System.Windows.Forms.Padding(4); - // this.okButton.Name = "okButton"; - // this.okButton.Size = new System.Drawing.Size(100, 27); - // this.okButton.TabIndex = 24; - // this.okButton.Text = "&OK"; - // // - // // AboutROEditor - // // - // this.AcceptButton = this.okButton; - // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - // this.ClientSize = new System.Drawing.Size(580, 348); - // this.Controls.Add(this.tableLayoutPanel); - // this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - // this.Margin = new System.Windows.Forms.Padding(4); - // this.MaximizeBox = false; - // this.MinimizeBox = false; - // this.Name = "AboutROEditor"; - // this.Padding = new System.Windows.Forms.Padding(12, 11, 12, 11); - // this.ShowIcon = false; - // this.ShowInTaskbar = false; - // this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - // this.Text = "AboutROEditor"; - // this.tableLayoutPanel.ResumeLayout(false); - // this.tableLayoutPanel.PerformLayout(); - // ((System.ComponentModel.ISupportInitialize)(this.logoPictureBox)).EndInit(); - // this.ResumeLayout(false); - - //} - - #endregion - - //private System.Windows.Forms.TableLayoutPanel tableLayoutPanel; - //private System.Windows.Forms.PictureBox logoPictureBox; - //private System.Windows.Forms.Label labelProductName; - //private System.Windows.Forms.Label labelVersion; - //private System.Windows.Forms.Label labelCopyright; - //private System.Windows.Forms.Label labelCompanyName; - //private System.Windows.Forms.TextBox textBoxDescription; - //private System.Windows.Forms.Button okButton; - private System.Windows.Forms.Label labelProductName; - private System.Windows.Forms.Label labelVersion; - private System.Windows.Forms.Label labelCopyright; - private System.Windows.Forms.LinkLabel labelCompanyName; - private System.Windows.Forms.TextBox textBoxDescription; - private System.Windows.Forms.PictureBox logoPictureBox; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.Panel panel3; - private System.Windows.Forms.Panel panel4; - private System.Windows.Forms.Panel panel5; - private System.Windows.Forms.Panel panel6; - private System.Windows.Forms.Panel panel7; - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button btnEULA; - private System.Windows.Forms.Label labelVersionDateTime; - private System.Windows.Forms.Label labelServer; - private System.Windows.Forms.Label labelDatabase; - } -} diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AboutROEditor.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AboutROEditor.cs deleted file mode 100644 index ec1f1b9b..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AboutROEditor.cs +++ /dev/null @@ -1,166 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Windows.Forms; -using System.Reflection; - -namespace ROEditor -{ - partial class AboutROEditor : Form - { - public AboutROEditor() - { - InitializeComponent(); - - // Initialize the AboutBox to display the product information from the assembly information. - // Change assembly information settings for your application through either: - // - Project->Properties->Application->Assembly Information - // - AssemblyInfo.cs - //this.Text = String.Format("About {0}", AssemblyTitle); - //this.labelProductName.Text = AssemblyProduct; - //this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion); - //this.labelCopyright.Text = AssemblyCopyright; - //this.labelCompanyName.Text = AssemblyCompany; - //this.textBoxDescription.Text = AssemblyDescription; - - // Initialize the AboutBox to display the product information from the assembly information. - // Change assembly information settings for your application through either: - // - Project->Properties->Application->Assembly Information - // - AssemblyInfo.cs - DateTime buildDateTime = new System.IO.FileInfo(Assembly.GetExecutingAssembly().Location).LastWriteTime; - // If the AssemblyConfiguration is "DEMO" then we are running a Demo version - string demoTxt = "";//VlnSettings.ReleaseMode.Equals("DEMO")?"(Demo)": ""; - //string connectionString = Database.VEPROMS_Connection; - //Match mServer = Regex.Match(connectionString,".*Data Source=([^;]*).*"); - //string server = (mServer.Success)?mServer.Groups[1].Value:"unknown"; - //if (server.StartsWith(@".\")) server = @"Local \ " + server.Substring(2); - //string databaseName = Database.SelectedDatabase; - this.Text = String.Format("About {0}", AssemblyTitle + " " + demoTxt); - this.labelProductName.Text = AssemblyProduct; - this.labelVersion.Text = String.Format("Version {0}", (demoTxt.Equals(""))? AssemblyVersion : demoTxt); - this.labelVersionDateTime.Text = String.Format("Build Date: {0}", buildDateTime.ToString()); - this.labelCopyright.Text = String.Format("Copyright © {0}. All Rights Reserved.", buildDateTime.Year.ToString()); - this.labelCompanyName.Text = AssemblyCompany; -// this.textBoxDescription.Text = AssemblyDescription; - this.labelCompanyName.Links[0].LinkData = "Volian Enterprises Inc."; - this.labelCompanyName.Links.Add(0,23,"www.volian.com"); - //this.labelServer.Text = string.Format("SQL Server: {0}", server); - //this.labelDatabase.Text = string.Format("Database: {0}", databaseName); - - } - - #region Assembly Attribute Accessors - - public string AssemblyTitle - { - get - { - // Get all Title attributes on this assembly - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false); - // If there is at least one Title attribute - if (attributes.Length > 0) - { - // Select the first one - AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[0]; - // If it is not an empty string, return it - if (titleAttribute.Title != "") - return titleAttribute.Title; - } - // If there was no Title attribute, or if the Title attribute was the empty string, return the .exe name - return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase); - } - } - - public string AssemblyVersion - { - get - { - return Assembly.GetExecutingAssembly().GetName().Version.ToString(); - } - } - - public string AssemblyDescription - { - get - { - // Get all Description attributes on this assembly - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false); - // If there aren't any Description attributes, return an empty string - if (attributes.Length == 0) - return ""; - // If there is a Description attribute, return its value - return ((AssemblyDescriptionAttribute)attributes[0]).Description; - } - } - - public string AssemblyProduct - { - get - { - // Get all Product attributes on this assembly - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false); - // If there aren't any Product attributes, return an empty string - if (attributes.Length == 0) - return ""; - // If there is a Product attribute, return its value - return ((AssemblyProductAttribute)attributes[0]).Product; - } - } - - //public string AssemblyCopyright - //{ - // get - // { - // // Get all Copyright attributes on this assembly - // object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); - // // If there aren't any Copyright attributes, return an empty string - // if (attributes.Length == 0) - // return ""; - // // If there is a Copyright attribute, return its value - // return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; - // } - //} - - public string AssemblyCompany - { - get - { - // Get all Company attributes on this assembly - object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false); - // If there aren't any Company attributes, return an empty string - if (attributes.Length == 0) - return ""; - // If there is a Company attribute, return its value - return ((AssemblyCompanyAttribute)attributes[0]).Company; - } - } - #endregion - private void labelCompanyName_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - // Determine which link was clicked within the LinkLabel. - this.labelCompanyName.Links[0].Visited = true; - - // Display the appropriate link based on the value of the - // LinkData property of the Link object. - string target = e.Link.LinkData as string; - - System.Diagnostics.Process.Start(target); // this should start the default web browser - } - - private void logoPictureBox_Click(object sender, EventArgs e) - { - System.Diagnostics.Process.Start(labelCompanyName.Links[0].LinkData as string); // this should start the default web browser - } - - private void btnViewEULA_Click(object sender, EventArgs e) - { - //string EulaFile = string.Format(@"\{0}", VlnSettings.EULAfile); - //string strEULA = System.Environment.CurrentDirectory + EulaFile; - //frmViewTextFile ViewFile = new frmViewTextFile(strEULA,RichTextBoxStreamType.PlainText); - //ViewFile.Text = "End-User License Agreement"; - //ViewFile.ShowDialog(); - } - - } -} diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AboutROEditor.resx b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AboutROEditor.resx deleted file mode 100644 index 19dc0dd8..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AboutROEditor.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/App.ico b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/App.ico deleted file mode 100644 index 7a50cb6143b90cd71ade904cfe3d3fbabaa26d9c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1078 zcmbVLu};G<6ntrr+$iXSfonk?l~!K z#QYTs-)MM$aOBVMyv+!z)Y@i2ar31*{OmNuRrmg zGY}U;xDCUANYtOi$Qg)>A>J-f#!;jPrZ{v#+4n&s&`C}iCt4F!W5yyDP=~^~76B$u zn;j5R0(5W+BqX0UQ~SQqe7G$nbO@|ZE*}vbwR3b;?~;GiuD$RBbjQU3*3-ATda8#X zjaQq`qaT-(-=lH*WAaP%r~dR3(~rFGi>lrnZ5 zIz@k;e^ivEwN@Lmh6CKrW3<+II10v1=UYQF*-Q|vO~p((MLslfAqIQM!Hjz$w_pRV zz!Ef)?Q=1QOiFNdfCDx&_n4E|X!8!wqXftHn>f)}18aG>1G8$`j<+opbY?aG$Vw(zn0=_xSLl*gU=|Hm_;j0bQPfpPE05{6gRjrtehb E3(<8_q5uE@ diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AssemblyInfo.cs deleted file mode 100644 index f1adcaa6..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AssemblyInfo.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("RO Editor")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Volian Enterprises Inc.")] -[assembly: AssemblyProduct("Referenced Objects Editor")] -[assembly: AssemblyCopyright("2013")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build YYMM (two digit year, two digit month) -// Revision DHH (day - no leading zero, two digit hour - military time -// -[assembly: AssemblyVersion("1.0.1303.2513")] -[assembly: AssemblyFileVersion("1.0.1303.2513")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AssemblyInfo.cs.bak deleted file mode 100644 index 6b2b0662..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Cancel.ico b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Cancel.ico deleted file mode 100644 index b008e0861a89d37c4dbb647b2f1bbdc65ef357e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 318 zcmbu3u@M6y3 diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Cert_prt_rgb_70x32.gif b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Cert_prt_rgb_70x32.gif deleted file mode 100644 index 421f061b5f51c2e0a4fe21ffd1335fd5d180d36f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1430 zcmWlYdoqLCygs8}e5{%?33WR1OqZnggY4Q072|3)(f% zu0xFr^?a-^zy=<)Z$O&|otw}r#Fio$@bO&{jEZ4Wf*rT;eJOU9!MqfVa{N>Qt14LE zg-sRg?!vAbb~SLQg<~z81aP^B19fn_5BK{xR1c4Ocs9Vh5xx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usT(tRpX-6*I9!iS`}BPSr*7Px# diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Copy.ico b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Copy.ico deleted file mode 100644 index 000bed12ddad442cb7316dc4b1b168c51cf04baf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 318 zcmbu3Ar1pE3;@R`?2o8JIyjfZJ6wKz_+sYE czqZ)VY0XE;W?RFT8%Lvariabletxt - * - * ***************** Version 4 ***************** - * User: Kathy Date: 9/25/02 Time: 9:56a - * Updated in $/EXE/RefObj/ROEditor - * dev - * - * ***************** Version 3 ***************** - * User: Kathy Date: 9/11/02 Time: 1:15p - * Updated in $/EXE/RefObj/ROEditor - * vlnxml - * - * ***************** Version 2 ***************** - * User: Kathy Date: 9/05/02 Time: 12:41p - * Updated in $/EXE/RefObj/ROEditor - * dev - * - * ***************** Version 1 ***************** - * User: Jsj Date: 8/23/02 Time: 3:33p - * Created in $/EXE/RefObj/ROEditor - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Xml; -using System.Xml.Schema; -using System.Text; -using ROFields; -using RODBInterface; - -namespace ROEditor -{ - /// - /// Summary description for FieldCombFrm. - /// - public class FieldCombFrm : System.Windows.Forms.Form - { - private System.Windows.Forms.Label lblFieldName; - private System.Windows.Forms.TextBox tbFieldName; - private System.Windows.Forms.GroupBox gbAlternatives; - private System.Windows.Forms.CheckBox cbSingleTxt; - private System.Windows.Forms.CheckBox cbVariableTxt; - private System.Windows.Forms.CheckBox cbTable; - private System.Windows.Forms.CheckBox cbXYPlot; - private System.Windows.Forms.Label lblW1; - private System.Windows.Forms.Label lblW2; - private System.Windows.Forms.Label lblW3; - private System.Windows.Forms.Label lblW4; - private System.Windows.Forms.TextBox tbSingleTxtWid; - private System.Windows.Forms.TextBox tbVariableTxtWid; - private System.Windows.Forms.TextBox tbTableWid; - private System.Windows.Forms.TextBox tbXYPlotWid; - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button btnCancel; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private ROField myrof; - private RODB myrodb; - private VlnXmlElement myelem; - private string origname; - private int origFixedLength=0; - private int origVariableTxtLength = 0; - private int origTableLength = 0; - private int origXYPlotLength = 0; - private ArrayList avail_list; - private ArrayList inuse_list; - private uint editlevel; - private bool exists = false; - public FieldCombFrm(ROField rof, RODB rodb, VlnXmlElement elem, uint elevel, string oname, ArrayList alist, ArrayList ilist) - { - int idx; - string strlen; - string fielddef; - // - // Required for Windows Form Designer support - // - myrof = rof; - myrodb = rodb; - myelem = elem; - editlevel = elevel; - avail_list = alist; - inuse_list = ilist; - InitializeComponent(); - this.tbFieldName.Text = rof.GetFieldname; - origname = oname; - - if (rof.GetRecID != null) // it's new if it's null - { - exists = true; - string recid = rof.GetMasterRecID; - if (recid != null && recid != "") - fielddef = myrodb.RODB_GetSchemaPiece(recid,"ROMaster"); - else - fielddef = myrodb.RODB_GetSchemaPiece(rof.GetRecID,myelem.GetAttribute("Table")); - // search for combination items included & their original length. - idx = fielddef.IndexOf("Fixed"); - if (idx >= 0) - { - idx=fielddef.IndexOf("xsd:maxLength value=\"",idx); - strlen = fielddef.Substring(idx+21,2); - origFixedLength = System.Convert.ToInt32(strlen); - this.tbSingleTxtWid.Text = strlen; - this.cbSingleTxt.Checked = true; - } - else - this.cbSingleTxt.Checked = false; - idx = fielddef.IndexOf("type=\"Variable"); - if (idx >= 0) - { - idx=fielddef.IndexOf("xsd:maxLength value=\"",idx); - strlen = fielddef.Substring(idx+21,2); - origVariableTxtLength = System.Convert.ToInt32(strlen); - this.tbVariableTxtWid.Text = strlen; - this.cbVariableTxt.Checked = true; - } - else - this.cbVariableTxt.Checked = false; - idx = fielddef.IndexOf("Table"); - if (idx >= 0) - { - idx=fielddef.IndexOf("xsd:maxLength value=\"",idx); - strlen = fielddef.Substring(idx+21,2); - origTableLength = System.Convert.ToInt32(strlen); - this.tbTableWid.Text = strlen; - this.cbTable.Checked = true; - } - else - this.cbTable.Checked = false; - idx = fielddef.IndexOf("XYPlot"); - if (idx >= 0) - { - idx=fielddef.IndexOf("xsd:maxLength value=\"",idx); - strlen = fielddef.Substring(idx+21,2); - origXYPlotLength = System.Convert.ToInt32(strlen); - this.tbXYPlotWid.Text = strlen; - this.cbXYPlot.Checked = true; - } - else - this.cbXYPlot.Checked = false; - } - - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.lblFieldName = new System.Windows.Forms.Label(); - this.tbFieldName = new System.Windows.Forms.TextBox(); - this.gbAlternatives = new System.Windows.Forms.GroupBox(); - this.tbXYPlotWid = new System.Windows.Forms.TextBox(); - this.tbTableWid = new System.Windows.Forms.TextBox(); - this.tbVariableTxtWid = new System.Windows.Forms.TextBox(); - this.tbSingleTxtWid = new System.Windows.Forms.TextBox(); - this.lblW4 = new System.Windows.Forms.Label(); - this.lblW3 = new System.Windows.Forms.Label(); - this.lblW2 = new System.Windows.Forms.Label(); - this.lblW1 = new System.Windows.Forms.Label(); - this.cbXYPlot = new System.Windows.Forms.CheckBox(); - this.cbTable = new System.Windows.Forms.CheckBox(); - this.cbVariableTxt = new System.Windows.Forms.CheckBox(); - this.cbSingleTxt = new System.Windows.Forms.CheckBox(); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.gbAlternatives.SuspendLayout(); - this.SuspendLayout(); - // - // lblFieldName - // - this.lblFieldName.Location = new System.Drawing.Point(16, 8); - this.lblFieldName.Name = "lblFieldName"; - this.lblFieldName.Size = new System.Drawing.Size(72, 16); - this.lblFieldName.TabIndex = 0; - this.lblFieldName.Text = "Field Name:"; - // - // tbFieldName - // - this.tbFieldName.Location = new System.Drawing.Point(96, 8); - this.tbFieldName.Name = "tbFieldName"; - this.tbFieldName.Size = new System.Drawing.Size(384, 22); - this.tbFieldName.TabIndex = 1; - this.tbFieldName.Text = ""; - // - // gbAlternatives - // - this.gbAlternatives.Controls.AddRange(new System.Windows.Forms.Control[] { - this.tbXYPlotWid, - this.tbTableWid, - this.tbVariableTxtWid, - this.tbSingleTxtWid, - this.lblW4, - this.lblW3, - this.lblW2, - this.lblW1, - this.cbXYPlot, - this.cbTable, - this.cbVariableTxt, - this.cbSingleTxt}); - this.gbAlternatives.Location = new System.Drawing.Point(16, 48); - this.gbAlternatives.Name = "gbAlternatives"; - this.gbAlternatives.Size = new System.Drawing.Size(464, 152); - this.gbAlternatives.TabIndex = 2; - this.gbAlternatives.TabStop = false; - this.gbAlternatives.Text = "Alternatives"; - // - // tbXYPlotWid - // - this.tbXYPlotWid.Location = new System.Drawing.Point(320, 120); - this.tbXYPlotWid.Name = "tbXYPlotWid"; - this.tbXYPlotWid.Size = new System.Drawing.Size(40, 22); - this.tbXYPlotWid.TabIndex = 11; - this.tbXYPlotWid.Text = ""; - // - // tbTableWid - // - this.tbTableWid.Location = new System.Drawing.Point(320, 88); - this.tbTableWid.Name = "tbTableWid"; - this.tbTableWid.Size = new System.Drawing.Size(40, 22); - this.tbTableWid.TabIndex = 10; - this.tbTableWid.Text = ""; - // - // tbVariableTxtWid - // - this.tbVariableTxtWid.Location = new System.Drawing.Point(320, 56); - this.tbVariableTxtWid.Name = "tbVariableTxtWid"; - this.tbVariableTxtWid.Size = new System.Drawing.Size(40, 22); - this.tbVariableTxtWid.TabIndex = 9; - this.tbVariableTxtWid.Text = ""; - // - // tbSingleTxtWid - // - this.tbSingleTxtWid.Location = new System.Drawing.Point(320, 24); - this.tbSingleTxtWid.Name = "tbSingleTxtWid"; - this.tbSingleTxtWid.Size = new System.Drawing.Size(40, 22); - this.tbSingleTxtWid.TabIndex = 8; - this.tbSingleTxtWid.Text = ""; - // - // lblW4 - // - this.lblW4.Location = new System.Drawing.Point(264, 120); - this.lblW4.Name = "lblW4"; - this.lblW4.Size = new System.Drawing.Size(56, 16); - this.lblW4.TabIndex = 7; - this.lblW4.Text = "Width:"; - // - // lblW3 - // - this.lblW3.Location = new System.Drawing.Point(264, 96); - this.lblW3.Name = "lblW3"; - this.lblW3.Size = new System.Drawing.Size(56, 16); - this.lblW3.TabIndex = 6; - this.lblW3.Text = "Width:"; - // - // lblW2 - // - this.lblW2.Location = new System.Drawing.Point(264, 64); - this.lblW2.Name = "lblW2"; - this.lblW2.Size = new System.Drawing.Size(56, 16); - this.lblW2.TabIndex = 5; - this.lblW2.Text = "Width:"; - // - // lblW1 - // - this.lblW1.Location = new System.Drawing.Point(264, 32); - this.lblW1.Name = "lblW1"; - this.lblW1.Size = new System.Drawing.Size(56, 16); - this.lblW1.TabIndex = 4; - this.lblW1.Text = "Width:"; - // - // cbXYPlot - // - this.cbXYPlot.Location = new System.Drawing.Point(16, 120); - this.cbXYPlot.Name = "cbXYPlot"; - this.cbXYPlot.Size = new System.Drawing.Size(144, 24); - this.cbXYPlot.TabIndex = 3; - this.cbXYPlot.Text = "X/Y Plot"; - // - // cbTable - // - this.cbTable.Location = new System.Drawing.Point(16, 88); - this.cbTable.Name = "cbTable"; - this.cbTable.Size = new System.Drawing.Size(144, 24); - this.cbTable.TabIndex = 2; - this.cbTable.Text = "Table"; - // - // cbVariableTxt - // - this.cbVariableTxt.Location = new System.Drawing.Point(16, 56); - this.cbVariableTxt.Name = "cbVariableTxt"; - this.cbVariableTxt.Size = new System.Drawing.Size(144, 24); - this.cbVariableTxt.TabIndex = 1; - this.cbVariableTxt.Text = "Variable Line Text"; - // - // cbSingleTxt - // - this.cbSingleTxt.Location = new System.Drawing.Point(16, 24); - this.cbSingleTxt.Name = "cbSingleTxt"; - this.cbSingleTxt.Size = new System.Drawing.Size(144, 24); - this.cbSingleTxt.TabIndex = 0; - this.cbSingleTxt.Text = "Single Line Text"; - // - // btnOK - // - this.btnOK.Location = new System.Drawing.Point(264, 216); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(88, 24); - this.btnOK.TabIndex = 3; - this.btnOK.Text = "OK"; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(392, 216); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(88, 24); - this.btnCancel.TabIndex = 4; - this.btnCancel.Text = "Cancel"; - // - // FieldCombFrm - // - this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); - this.ClientSize = new System.Drawing.Size(504, 253); - this.Controls.AddRange(new System.Windows.Forms.Control[] { - this.btnCancel, - this.btnOK, - this.gbAlternatives, - this.tbFieldName, - this.lblFieldName}); - this.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.Name = "FieldCombFrm"; - this.Text = "Combination Field Definition"; - this.gbAlternatives.ResumeLayout(false); - this.ResumeLayout(false); - - } - #endregion - - private string CvtUserFldToFld(string fldname) - { - if (fldname.Length < 2) - return fldname; - // a digit cannot start an xml fieldname, prepend a "__" to it. - string tmp0; - if (char.IsDigit(fldname,0)) - tmp0 = "__" + fldname; - else - tmp0 = fldname; - // an xml fieldname cannot have a space, change it to a "__" - string tmpstr = tmp0.Replace(" ","__"); - int len = tmpstr.Length; - int cnt = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval; - - while (cnt < len) - { - char tmpchr = tmpstr[cnt]; - if(!char.IsLetterOrDigit(tmpchr)&& (OKpunch.IndexOf(tmpchr) == -1) ) - { - decval = tmpchr; - outstr += OKpunch + decval.ToString("D3"); - } - else - { - outstr += tmpchr.ToString(); - } - cnt++; - } - return outstr; - } - - private bool CheckValidWidth(string wid) - { - long val; - try - { - // Attempt to convert to long, if it fails, there are problems in the text - val = System.Convert.ToInt64(wid); - } - catch - { - MessageBox.Show("The field width is not a valid number. Please re-enter"); - return false; - } - return true; - } - - private void btnOK_Click(object sender, System.EventArgs e) - { - string savschemapiece; - bool success=false; - - // check for field validity - if (this.tbFieldName.Text == null) - { - MessageBox.Show("Cannot have empty field definition name."); - return; - } - - if (this.cbSingleTxt.Checked == true && this.tbSingleTxtWid.Text == null) - { - MessageBox.Show("Cannot have empty width for Single Line Text"); - return; - } - if (this.cbSingleTxt.Checked == true) - { - success=CheckValidWidth(this.tbSingleTxtWid.Text); - if (success == false) return; - } - - if (this.cbVariableTxt.Checked == true && this.tbVariableTxtWid.Text == null) - { - MessageBox.Show("Cannot have empty width for Variable Length Text"); - return; - } - if (this.cbVariableTxt.Checked == true) - { - success=CheckValidWidth(this.tbSingleTxtWid.Text); - if (success == false) return; - } - - if (this.cbTable.Checked == true && this.tbTableWid.Text == null) - { - MessageBox.Show("Cannot have empty width for Table Text"); - return; - } - if (this.cbTable.Checked == true) - { - success=CheckValidWidth(this.tbTableWid.Text); - if (success == false) return; - } - - if (this.cbXYPlot.Checked == true && this.tbXYPlotWid.Text == null) - { - MessageBox.Show("Cannot have empty width for XYPlot Text"); - return; - } - if (this.cbXYPlot.Checked == true) - { - success=CheckValidWidth(this.tbXYPlotWid.Text); - if (success == false) return; - } - - // check that it is not duplicate name. - ROField rof; - for (int i=0; i< avail_list.Count; i++) - { - rof = (ROField) avail_list[i]; - if (rof.GetFieldname == this.tbFieldName.Text && rof.GetRecID != myrof.GetRecID) - { - MessageBox.Show("The field name is not unique. Please re-enter"); - return; - } - } - for (int i=0; i< inuse_list.Count; i++) - { - rof = (ROField) inuse_list[i]; - if (rof.GetFieldname == this.tbFieldName.Text && rof.GetRecID != myrof.GetRecID) - { - MessageBox.Show("The field name is not unique. Please re-enter"); - return; - } - } - - // generate the new schema string based on text box input. - string fname=CvtUserFldToFld(this.tbFieldName.Text); - savschemapiece = myrof.MakeComboSchemaString(fname, this.cbSingleTxt.Checked, - this.tbSingleTxtWid.Text, this.cbVariableTxt.Checked, this.tbVariableTxtWid.Text, - this.cbTable.Checked, this.tbTableWid.Text, this.cbXYPlot.Checked, this.tbXYPlotWid.Text); - myrof.SetFieldname(fname); - // if this is 'new'. create a new element and do an insert to database - if (exists == false) - success = myrodb.RODB_NewFieldRecord(myrof, myelem, savschemapiece, editlevel, "a"); - else // modification of existing... - success = myrodb.RODB_UpdateFieldRecord(myrof, myelem, savschemapiece, CvtUserFldToFld(origname), fname, editlevel, true); - - // update the local/internal copy of the schema. - if (success != true) - { - return; // DO YET process an error. - } - else - { - // if this is a RRO schema, reload. We're not reloading the group schema - // because it is rarely used and is only loaded as needed. - if (editlevel == (uint) RecordType.Schema) - { - XmlSchema myschema; - VlnXmlElement parent; - parent = myelem; - while (parent != null) - { - if (parent.HasAttribute("Schema") == true) break; - if (parent.HasAttribute("FieldsInUse") == true) break; - parent = (VlnXmlElement) parent.ParentNode; - } - // if a schema has been read in, delete it and reread it. - if (parent.HasAttribute("Schema")) - { - // delete this attribute because we'll reread it in. - parent.RemoveAttribute("Schema"); - myschema = myrodb.RODB_GetSchema(myelem); - } - } - - } - - - this.Close(); - } - } -} diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldCombFrm.resx b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldCombFrm.resx deleted file mode 100644 index 2a46b324..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldCombFrm.resx +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - FieldCombFrm - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldTextFrm.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldTextFrm.cs deleted file mode 100644 index a3f29b8a..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldTextFrm.cs +++ /dev/null @@ -1,425 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: FieldTextFrm.cs $ $Revision: 12 $ - * $Author: Kathy $ $Date: 7/15/04 11:11a $ - * - * $History: FieldTextFrm.cs $ - * - * ***************** Version 12 ***************** - * User: Kathy Date: 7/15/04 Time: 11:11a - * Updated in $/EXE/RefObj/ROEditor - * Fix B2004-015 - * - * ***************** Version 11 ***************** - * User: Kathy Date: 12/09/03 Time: 9:29a - * Updated in $/EXE/RefObj/ROEditor - * B2003-066 fix - add new fieldname crash - * - * ***************** Version 10 ***************** - * User: Kathy Date: 5/21/03 Time: 12:46p - * Updated in $/EXE/RefObj/ROEditor - * B2003-041: edit of field name didn't always save - * - * ***************** Version 9 ***************** - * User: Kathy Date: 12/10/02 Time: 2:25p - * Updated in $/EXE/RefObj/ROEditor - * fieldname special chars - * - * ***************** Version 8 ***************** - * User: Kathy Date: 12/02/02 Time: 8:29a - * Updated in $/EXE/RefObj/ROEditor - * fieldname replace chars - * - * ***************** Version 7 ***************** - * User: Kathy Date: 12/02/02 Time: 6:13a - * Updated in $/EXE/RefObj/ROEditor - * added arg on db call - * - * ***************** Version 6 ***************** - * User: Kathy Date: 11/19/02 Time: 11:31a - * Updated in $/EXE/RefObj/ROEditor - * add wait cursor for long op - * - * ***************** Version 5 ***************** - * User: Kathy Date: 9/27/02 Time: 1:13p - * Updated in $/EXE/RefObj/ROEditor - * fix digit as first char in fieldname - * - * ***************** Version 4 ***************** - * User: Kathy Date: 9/25/02 Time: 9:56a - * Updated in $/EXE/RefObj/ROEditor - * dev - * - * ***************** Version 3 ***************** - * User: Kathy Date: 9/11/02 Time: 1:15p - * Updated in $/EXE/RefObj/ROEditor - * vlnxml - * - * ***************** Version 2 ***************** - * User: Kathy Date: 9/05/02 Time: 12:41p - * Updated in $/EXE/RefObj/ROEditor - * dev - * - * ***************** Version 1 ***************** - * User: Jsj Date: 8/23/02 Time: 3:33p - * Created in $/EXE/RefObj/ROEditor - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Xml; -using System.Xml.Schema; -using System.Text; -using ROFields; -using RODBInterface; - -namespace ROEditor -{ - /// - /// Summary description for FieldText. - /// - public class FieldTextFrm : System.Windows.Forms.Form - { - private System.Windows.Forms.Label lblFName; - private System.Windows.Forms.Label lblWidth; - private System.Windows.Forms.TextBox tbFieldName; - private System.Windows.Forms.TextBox tbWidth; - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Label lblPattern; - private System.Windows.Forms.TextBox tbPattern; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - private ROField myrof; - private RODB myrodb; - private VlnXmlElement myelem; - private string schemapiece; - private string origname; - private bool exists=false; - private uint original_type; - private uint editlevel; - private ArrayList avail_list; - private ArrayList inuse_list; - public FieldTextFrm(ROField rof, RODB rodb, VlnXmlElement elem, uint otype, uint elevel, string oname, ArrayList alist, ArrayList ilist) - { - // - // Required for Windows Form Designer support - // - myrodb = rodb; - myelem = elem; - myrof = rof; - original_type = otype; - editlevel = elevel; - avail_list = alist; - inuse_list = ilist; - uint ftype = rof.GetFieldType; - // origname is the original name if this is a modification of a fieldname - // if it's new, it will be null - if(oname!=null)origname=CvtUserFldToFld(oname); - InitializeComponent(); - - if (ftype == (uint)FieldTypes.FrmtSingleTxt) - { - this.tbPattern.Visible = true; - this.lblPattern.Visible = true; - } - else - { - this.tbPattern.Visible = false; - this.lblPattern.Visible = false; - } - - // put name out. and if it's an existing field get current data to - // put out. - this.tbFieldName.Text = rof.GetFieldname; - if (rof.GetRecID != null) - { - exists = true; - if (rof.GetMasterRecID != null) - // get it from the master, else read in the definition from - // the local table - schemapiece = myrodb.RODB_GetSchemaPiece(rof.GetMasterRecID,"ROMaster"); - else - schemapiece = myrodb.RODB_GetSchemaPiece(rof.GetRecID,myelem.GetAttribute("Table")); - int indxs = schemapiece.IndexOf("maxLength value="); - int indxe = schemapiece.IndexOf("\"",indxs+17); // +17, get past maxLength value =" - this.tbWidth.Text = schemapiece.Substring(indxs+17,indxe-(indxs+17)); - - // get pattern too. - if (ftype == (uint)FieldTypes.FrmtSingleTxt) - { - indxs = schemapiece.IndexOf("pattern value="); - indxe = schemapiece.IndexOf("\"",indxs+15); - this.tbPattern.Text = schemapiece.Substring(indxs+15,indxe-(indxs+15)); - } - } - } - - private string CvtUserFldToFld(string fldname) - { - if (fldname.Length < 2) - return fldname; - // a digit cannot start an xml fieldname, prepend a "__" to it. - string tmp0; - if (char.IsDigit(fldname,0)) - tmp0 = "__" + fldname; - else - tmp0 = fldname; - // an xml fieldname cannot have a space, change it to a "__" - string tmpstr = tmp0.Replace(" ","__"); - int len = tmpstr.Length; - int cnt = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval; - - while (cnt < len) - { - char tmpchr = tmpstr[cnt]; - if(!char.IsLetterOrDigit(tmpchr)&& (OKpunch.IndexOf(tmpchr) == -1) ) - { - decval = tmpchr; - outstr += OKpunch + decval.ToString("D3"); - } - else - { - outstr += tmpchr.ToString(); - } - cnt++; - } - return outstr; - } - - private bool CheckValidWidth(string wid) - { - long val; - try { - // Attempt to convert to long, if it fails, there are problems in the text - val = System.Convert.ToInt64(wid); - } - catch { - MessageBox.Show("The field width is not a valid number. Please re-enter"); - return false; - } - return true; - } - - private void btnOK_Click(object sender, System.EventArgs e) - { - string savschemapiece; - bool success=false; - - // check for field validity - if (this.tbFieldName.Text == null || this.tbWidth.Text == null) - { - MessageBox.Show("Cannot have empty field defintion name or width"); - return; - } - success=CheckValidWidth(this.tbWidth.Text); - if (success == false) return; - // check that it is not duplicate name. - ROField rof; - for (int i=0; i< avail_list.Count; i++) - { - rof = (ROField) avail_list[i]; - if (rof.GetFieldname == this.tbFieldName.Text && rof.GetRecID != myrof.GetRecID) - { - MessageBox.Show("The field name is not unique. Please re-enter"); - return; - } - } - for (int i=0; i< inuse_list.Count; i++) - { - rof = (ROField) inuse_list[i]; - if (rof.GetFieldname == this.tbFieldName.Text && rof.GetRecID != myrof.GetRecID) - { - MessageBox.Show("The field name is not unique. Please re-enter"); - return; - } - } - - // generate the new schema string based on text box input. - string fname=CvtUserFldToFld(this.tbFieldName.Text); - savschemapiece = myrof.MakeSchemaString(fname, this.tbWidth.Text, this.tbPattern.Text); - myrof.SetFieldname(fname); - // if this is 'new'. create a new element and do an insert to Master database - if (exists == false) - success = myrodb.RODB_NewFieldRecord(myrof, myelem, savschemapiece, editlevel, null); - else // modification of existing.... - { - Cursor.Current = Cursors.WaitCursor; - success = myrodb.RODB_UpdateFieldRecord(myrof, myelem, savschemapiece, origname, fname, editlevel, false); - Cursor.Current = Cursors.Default; - } - - if (success != true) - { - return; // DO YET process an error. - } - else - { - // if this is a RRO schema, reload. We're not reloading the group schema - // because it is rarely used and is only loaded as needed. - if (editlevel == (uint) RecordType.Schema) - { - XmlSchema myschema; - VlnXmlElement parent; - parent = myelem; - while (parent != null) - { - if (parent.HasAttribute("Schema") == true) break; - if (parent.HasAttribute("FieldsInUse") == true) break; - // If loop to top, fields haven't been defined yet, don't - // crash on caste - just set to return null (B2004-015) - if (parent.ParentNode is VlnXmlElement) - parent = (VlnXmlElement) parent.ParentNode; - else - parent = null; - } - // if a schema has been read in, delete it and reread it. - if (parent !=null && parent.HasAttribute("Schema")) - { - // delete this attribute because we'll reread it in. - parent.RemoveAttribute("Schema"); - myschema = myrodb.RODB_GetSchema(myelem); - } - } - - } - this.Close(); - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.lblFName = new System.Windows.Forms.Label(); - this.lblWidth = new System.Windows.Forms.Label(); - this.tbFieldName = new System.Windows.Forms.TextBox(); - this.tbWidth = new System.Windows.Forms.TextBox(); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.lblPattern = new System.Windows.Forms.Label(); - this.tbPattern = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // lblFName - // - this.lblFName.Location = new System.Drawing.Point(16, 16); - this.lblFName.Name = "lblFName"; - this.lblFName.Size = new System.Drawing.Size(80, 16); - this.lblFName.TabIndex = 0; - this.lblFName.Text = "Field Name:"; - // - // lblWidth - // - this.lblWidth.Location = new System.Drawing.Point(16, 40); - this.lblWidth.Name = "lblWidth"; - this.lblWidth.Size = new System.Drawing.Size(72, 16); - this.lblWidth.TabIndex = 1; - this.lblWidth.Text = "Width:"; - // - // tbFieldName - // - this.tbFieldName.Location = new System.Drawing.Point(104, 8); - this.tbFieldName.Name = "tbFieldName"; - this.tbFieldName.Size = new System.Drawing.Size(320, 22); - this.tbFieldName.TabIndex = 2; - this.tbFieldName.Text = ""; - // - // tbWidth - // - this.tbWidth.Location = new System.Drawing.Point(104, 40); - this.tbWidth.Name = "tbWidth"; - this.tbWidth.Size = new System.Drawing.Size(32, 22); - this.tbWidth.TabIndex = 3; - this.tbWidth.Text = ""; - // - // btnOK - // - this.btnOK.Location = new System.Drawing.Point(216, 72); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(88, 24); - this.btnOK.TabIndex = 4; - this.btnOK.Text = "OK"; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(336, 72); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(88, 24); - this.btnCancel.TabIndex = 5; - this.btnCancel.Text = "Cancel"; - // - // lblPattern - // - this.lblPattern.Location = new System.Drawing.Point(160, 40); - this.lblPattern.Name = "lblPattern"; - this.lblPattern.Size = new System.Drawing.Size(48, 16); - this.lblPattern.TabIndex = 6; - this.lblPattern.Text = "Pattern:"; - this.lblPattern.Visible = false; - // - // tbPattern - // - this.tbPattern.Location = new System.Drawing.Point(224, 40); - this.tbPattern.Name = "tbPattern"; - this.tbPattern.Size = new System.Drawing.Size(176, 22); - this.tbPattern.TabIndex = 7; - this.tbPattern.Text = ""; - this.tbPattern.Visible = false; - // - // FieldTextFrm - // - this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); - this.ClientSize = new System.Drawing.Size(464, 101); - this.Controls.AddRange(new System.Windows.Forms.Control[] { - this.tbPattern, - this.lblPattern, - this.btnCancel, - this.btnOK, - this.tbWidth, - this.tbFieldName, - this.lblWidth, - this.lblFName}); - this.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.Name = "FieldTextFrm"; - this.Text = "Text Field Definition"; - this.ResumeLayout(false); - - } - #endregion - } -} diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldTextFrm.resx b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldTextFrm.resx deleted file mode 100644 index 5acd684b..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldTextFrm.resx +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - FieldTextFrm - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldTypeDefFrm.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldTypeDefFrm.cs deleted file mode 100644 index c5498ffa..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldTypeDefFrm.cs +++ /dev/null @@ -1,435 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: FieldTypeDefFrm.cs $ $Revision: 11 $ - * $Author: Kathy $ $Date: 5/21/03 12:49p $ - * - * $History: FieldTypeDefFrm.cs $ - * - * ***************** Version 11 ***************** - * User: Kathy Date: 5/21/03 Time: 12:49p - * Updated in $/EXE/RefObj/ROEditor - * B2003-041: edit of fieldname didn't always save - * - * ***************** Version 10 ***************** - * User: Kathy Date: 12/10/02 Time: 2:25p - * Updated in $/EXE/RefObj/ROEditor - * fieldname special chars - * - * ***************** Version 9 ***************** - * User: Kathy Date: 12/02/02 Time: 8:29a - * Updated in $/EXE/RefObj/ROEditor - * fieldname replace chars - * - * ***************** Version 8 ***************** - * User: Kathy Date: 12/02/02 Time: 6:17a - * Updated in $/EXE/RefObj/ROEditor - * added arg and close form - * - * ***************** Version 7 ***************** - * User: Kathy Date: 9/27/02 Time: 1:13p - * Updated in $/EXE/RefObj/ROEditor - * fix digit as first char in fieldname - * - * ***************** Version 6 ***************** - * User: Kathy Date: 9/25/02 Time: 2:30p - * Updated in $/EXE/RefObj/ROEditor - * multitxt->variable - * - * ***************** Version 5 ***************** - * User: Kathy Date: 9/25/02 Time: 9:56a - * Updated in $/EXE/RefObj/ROEditor - * dev - * - * ***************** Version 4 ***************** - * User: Kathy Date: 9/11/02 Time: 1:15p - * Updated in $/EXE/RefObj/ROEditor - * vlnxml - * - * ***************** Version 3 ***************** - * User: Kathy Date: 9/05/02 Time: 12:41p - * Updated in $/EXE/RefObj/ROEditor - * dev - * - * ***************** Version 2 ***************** - * User: Kathy Date: 8/30/02 Time: 9:43a - * Updated in $/EXE/RefObj/ROEditor - * image def - * - * ***************** Version 1 ***************** - * User: Jsj Date: 8/23/02 Time: 3:34p - * Created in $/EXE/RefObj/ROEditor - *********************************************************************************************/ - - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Xml; -using System.Text; -using RODBInterface; -using ROFields; - -namespace ROEditor -{ - /// - /// Summary description for FieldType. - /// - /// - - public class FieldTypeDefFrm : System.Windows.Forms.Form - { - private System.Windows.Forms.Label lblFldName; - private System.Windows.Forms.TextBox tbFieldName; - private System.Windows.Forms.GroupBox gbFldType; - private System.Windows.Forms.RadioButton rbSingleLine; - private System.Windows.Forms.RadioButton rbFormSingleLine; - private System.Windows.Forms.RadioButton rbVariableTxt; - private System.Windows.Forms.RadioButton rbTable; - private System.Windows.Forms.RadioButton rbXYPlot; - private System.Windows.Forms.RadioButton rbImage; - private System.Windows.Forms.RadioButton rbCombination; - private System.Windows.Forms.RadioButton rbMultiple; - private System.Windows.Forms.Button btnContinue; - private System.Windows.Forms.Button btnCancel; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private ROField myrof; - private RODB myrodb; - private VlnXmlElement myelem; - private uint original_type=0; - private string origname; - private uint editlevel; - private ArrayList avlist; // available list from rodef form - private ArrayList iulist; // inuse list from rodef form - public FieldTypeDefFrm(ROField rof, RODB rodb, VlnXmlElement elem, uint elevel, ArrayList alist, ArrayList ilist) - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - myrof = rof; - myrodb = rodb; - myelem = elem; - editlevel = elevel; - avlist = alist; - iulist = ilist; - origname = null; - - if (rof.GetFieldname != null) // initialize some values. - { - origname = CvtUserFldToFld(rof.GetFieldname); - original_type = rof.GetFieldType; - uint ftype = rof.GetFieldType; - this.tbFieldName.Text = rof.GetFieldname; - // disable image, because it's only enabled for image type. - this.rbImage.Enabled = false; - if (ftype == (uint)FieldTypes.Combination) - this.rbCombination.Checked = true; - else if (ftype == (uint)FieldTypes.FrmtSingleTxt) - this.rbFormSingleLine.Checked = true; - else if (ftype == (uint)FieldTypes.Image) - { - this.rbImage.Enabled = true; - this.rbImage.Checked = true; - // for image - you can't change it's type. - this.rbCombination.Enabled = false; - this.rbFormSingleLine.Enabled = false; - this.rbVariableTxt.Enabled = false; - this.rbSingleLine.Enabled = false; - this.rbTable.Enabled = false; - this.rbXYPlot.Enabled = false; - } - else if (ftype == (uint)FieldTypes.VariableTxt) - this.rbVariableTxt.Checked = true; - else if (ftype == (uint)FieldTypes.SingleTxt) - this.rbSingleLine.Checked = true; - else if (ftype == (uint)FieldTypes.Table) - this.rbTable.Checked = true; - else if (ftype == (uint)FieldTypes.XYPlot) - this.rbXYPlot.Checked = true; - else - return; - } - } - - private string CvtUserFldToFld(string fldname) - { - if (fldname.Length < 2) - return fldname; - // a digit cannot start an xml fieldname, prepend a "__" to it. - string tmp0; - if (char.IsDigit(fldname,0)) - tmp0 = "__" + fldname; - else - tmp0 = fldname; - // an xml fieldname cannot have a space, change it to a "__" - string tmpstr = tmp0.Replace(" ","__"); - int len = tmpstr.Length; - int cnt = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval; - - while (cnt < len) - { - char tmpchr = tmpstr[cnt]; - if(!char.IsLetterOrDigit(tmpchr)&& (OKpunch.IndexOf(tmpchr) == -1) ) - { - decval = tmpchr; - outstr += OKpunch + decval.ToString("D3"); - } - else - { - outstr += tmpchr.ToString(); - } - cnt++; - } - return outstr; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - private void btnContinue_Click(object sender, System.EventArgs e) - { - if (this.tbFieldName.Text == "") - { - MessageBox.Show("Cannot have empty field name."); - return; - } - - myrof.SetFieldname(this.tbFieldName.Text); - uint ftype=0; - if (this.rbSingleLine.Checked == true) - ftype = (uint)FieldTypes.SingleTxt; - else if (this.rbFormSingleLine.Checked == true) - ftype = (uint)FieldTypes.FrmtSingleTxt; - else if (this.rbVariableTxt.Checked == true) - ftype = (uint)FieldTypes.VariableTxt; - else if (this.rbTable.Checked == true) - ftype = (uint)FieldTypes.Table; - else if (this.rbXYPlot.Checked == true) - ftype = (uint)FieldTypes.XYPlot; - else if (this.rbImage.Checked == true) - { - bool success; - string savschemapiece; - string fname=CvtUserFldToFld(this.tbFieldName.Text); - myrof.SetFieldType((uint)FieldTypes.Image); - myrof.SetFieldname(fname); - savschemapiece = myrof.MakeImageSchemaString(this.tbFieldName.Text); - if (original_type == (uint)FieldTypes.Nil) // new one. - success = myrodb.RODB_NewFieldRecord(myrof, myelem, savschemapiece, editlevel, null); - else // modification of existing.... - success = myrodb.RODB_UpdateFieldRecord(myrof, myelem, savschemapiece, origname, fname, editlevel, false); - - if (success != true) - { - return; // DO YET process an error. - } - return; - - } - else if (this.rbCombination.Checked == true) - { - ftype = (uint)FieldTypes.Combination; - myrof.SetFieldType(ftype); - FieldCombFrm comb = new FieldCombFrm(myrof, myrodb, myelem, editlevel, origname, avlist, iulist); - comb.ShowDialog(); - if (comb.DialogResult == DialogResult.OK) - { - } - return; - } - else - { - MessageBox.Show("Must define a field type."); - return; - } - myrof.SetFieldType(ftype); - FieldTextFrm ftxt = new FieldTextFrm(myrof, myrodb, myelem, original_type, editlevel, origname, avlist, iulist); - ftxt.ShowDialog(); - this.Close(); - } - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.lblFldName = new System.Windows.Forms.Label(); - this.tbFieldName = new System.Windows.Forms.TextBox(); - this.gbFldType = new System.Windows.Forms.GroupBox(); - this.rbMultiple = new System.Windows.Forms.RadioButton(); - this.rbCombination = new System.Windows.Forms.RadioButton(); - this.rbImage = new System.Windows.Forms.RadioButton(); - this.rbXYPlot = new System.Windows.Forms.RadioButton(); - this.rbTable = new System.Windows.Forms.RadioButton(); - this.rbVariableTxt = new System.Windows.Forms.RadioButton(); - this.rbFormSingleLine = new System.Windows.Forms.RadioButton(); - this.rbSingleLine = new System.Windows.Forms.RadioButton(); - this.btnContinue = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.gbFldType.SuspendLayout(); - this.SuspendLayout(); - // - // lblFldName - // - this.lblFldName.Location = new System.Drawing.Point(16, 8); - this.lblFldName.Name = "lblFldName"; - this.lblFldName.Size = new System.Drawing.Size(88, 16); - this.lblFldName.TabIndex = 0; - this.lblFldName.Text = "Field Name:"; - // - // tbFieldName - // - this.tbFieldName.Location = new System.Drawing.Point(120, 8); - this.tbFieldName.Name = "tbFieldName"; - this.tbFieldName.Size = new System.Drawing.Size(368, 22); - this.tbFieldName.TabIndex = 1; - this.tbFieldName.Text = ""; - // - // gbFldType - // - this.gbFldType.Controls.AddRange(new System.Windows.Forms.Control[] { - this.rbMultiple, - this.rbCombination, - this.rbImage, - this.rbXYPlot, - this.rbTable, - this.rbVariableTxt, - this.rbFormSingleLine, - this.rbSingleLine}); - this.gbFldType.Location = new System.Drawing.Point(24, 40); - this.gbFldType.Name = "gbFldType"; - this.gbFldType.Size = new System.Drawing.Size(464, 120); - this.gbFldType.TabIndex = 2; - this.gbFldType.TabStop = false; - this.gbFldType.Text = "Field Type"; - // - // rbMultiple - // - this.rbMultiple.Enabled = false; - this.rbMultiple.Location = new System.Drawing.Point(248, 96); - this.rbMultiple.Name = "rbMultiple"; - this.rbMultiple.Size = new System.Drawing.Size(128, 16); - this.rbMultiple.TabIndex = 7; - this.rbMultiple.Text = "Multiple Field"; - // - // rbCombination - // - this.rbCombination.Location = new System.Drawing.Point(248, 72); - this.rbCombination.Name = "rbCombination"; - this.rbCombination.Size = new System.Drawing.Size(128, 16); - this.rbCombination.TabIndex = 6; - this.rbCombination.Text = "Combination Field"; - // - // rbImage - // - this.rbImage.Location = new System.Drawing.Point(248, 48); - this.rbImage.Name = "rbImage"; - this.rbImage.Size = new System.Drawing.Size(128, 16); - this.rbImage.TabIndex = 5; - this.rbImage.Text = "Image"; - // - // rbXYPlot - // - this.rbXYPlot.Location = new System.Drawing.Point(248, 24); - this.rbXYPlot.Name = "rbXYPlot"; - this.rbXYPlot.Size = new System.Drawing.Size(128, 16); - this.rbXYPlot.TabIndex = 4; - this.rbXYPlot.Text = "X/Y Plot"; - // - // rbTable - // - this.rbTable.Location = new System.Drawing.Point(24, 96); - this.rbTable.Name = "rbTable"; - this.rbTable.Size = new System.Drawing.Size(128, 16); - this.rbTable.TabIndex = 3; - this.rbTable.Text = "Table"; - // - // rbVariableTxt - // - this.rbVariableTxt.Location = new System.Drawing.Point(24, 72); - this.rbVariableTxt.Name = "rbVariableTxt"; - this.rbVariableTxt.Size = new System.Drawing.Size(160, 16); - this.rbVariableTxt.TabIndex = 2; - this.rbVariableTxt.Text = "Variable Length Text"; - // - // rbFormSingleLine - // - this.rbFormSingleLine.Location = new System.Drawing.Point(24, 48); - this.rbFormSingleLine.Name = "rbFormSingleLine"; - this.rbFormSingleLine.Size = new System.Drawing.Size(184, 16); - this.rbFormSingleLine.TabIndex = 1; - this.rbFormSingleLine.Text = "Formatted Single Line Text"; - // - // rbSingleLine - // - this.rbSingleLine.Location = new System.Drawing.Point(24, 24); - this.rbSingleLine.Name = "rbSingleLine"; - this.rbSingleLine.Size = new System.Drawing.Size(128, 16); - this.rbSingleLine.TabIndex = 0; - this.rbSingleLine.Text = "Single Line Text"; - // - // btnContinue - // - this.btnContinue.Location = new System.Drawing.Point(248, 176); - this.btnContinue.Name = "btnContinue"; - this.btnContinue.Size = new System.Drawing.Size(104, 24); - this.btnContinue.TabIndex = 3; - this.btnContinue.Text = "Continue ..."; - this.btnContinue.Click += new System.EventHandler(this.btnContinue_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(384, 176); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(104, 24); - this.btnCancel.TabIndex = 4; - this.btnCancel.Text = "Cancel"; - // - // FieldTypeDefFrm - // - this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); - this.ClientSize = new System.Drawing.Size(512, 221); - this.Controls.AddRange(new System.Windows.Forms.Control[] { - this.btnCancel, - this.btnContinue, - this.gbFldType, - this.tbFieldName, - this.lblFldName}); - this.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.Name = "FieldTypeDefFrm"; - this.Text = " Field Type Selection"; - this.gbFldType.ResumeLayout(false); - this.ResumeLayout(false); - - } - #endregion - } -} diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldTypeDefFrm.resx b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldTypeDefFrm.resx deleted file mode 100644 index 65521144..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FieldTypeDefFrm.resx +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - FieldTypeDefFrm - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FixRev.Bat b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FixRev.Bat deleted file mode 100644 index 81176489..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/FixRev.Bat +++ /dev/null @@ -1,4 +0,0 @@ -PUSHD ..\..\..\ReferencedObjects\Exe\RefObj\ROEditor" -"..\..\..\..\AdjustBuildRevision\bin\Debug\AdjustBuildRevision" "%CD%\AssemblyInfo.cs" -POPD -pause diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/GroupDefFrm.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/GroupDefFrm.cs deleted file mode 100644 index 27498d32..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/GroupDefFrm.cs +++ /dev/null @@ -1,667 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: GroupDefFrm.cs $ $Revision: 17 $ - * $Author: Jsj $ $Date: 7/02/03 9:25a $ - * - * $History: GroupDefFrm.cs $ - * - * ***************** Version 17 ***************** - * User: Jsj Date: 7/02/03 Time: 9:25a - * Updated in $/EXE/RefObj/ROEditor - * made messagebox calls modal by removing the parent window reference - * - * ***************** Version 16 ***************** - * User: Kathy Date: 5/21/03 Time: 12:50p - * Updated in $/EXE/RefObj/ROEditor - * B2003-034: process if only one field. Also, check for all data on okay - * button select. - * - * ***************** Version 15 ***************** - * User: Kathy Date: 5/07/03 Time: 1:58p - * Updated in $/EXE/RefObj/ROEditor - * B2003-033 fixed - * - * ***************** Version 14 ***************** - * User: Jsj Date: 4/14/03 Time: 3:01p - * Updated in $/EXE/RefObj/ROEditor - * changes resulting from speeding up RO FST file creation - * - * ***************** Version 13 ***************** - * User: Kathy Date: 3/11/03 Time: 11:25a - * Updated in $/EXE/RefObj/ROEditor - * allow extra text on accpageid template - * - * ***************** Version 12 ***************** - * User: Kathy Date: 12/10/02 Time: 2:26p - * Updated in $/EXE/RefObj/ROEditor - * fieldname special char - * - * ***************** Version 11 ***************** - * User: Kathy Date: 12/02/02 Time: 8:29a - * Updated in $/EXE/RefObj/ROEditor - * fieldname replace chars - * - * ***************** Version 10 ***************** - * User: Kathy Date: 12/02/02 Time: 6:18a - * Updated in $/EXE/RefObj/ROEditor - * added status on long ops & check for fieldname change for textbox - * - * ***************** Version 9 ***************** - * User: Kathy Date: 10/15/02 Time: 2:18p - * Updated in $/EXE/RefObj/ROEditor - * mods for new group (toplevel) - * - * ***************** Version 8 ***************** - * User: Kathy Date: 10/10/02 Time: 10:02a - * Updated in $/EXE/RefObj/ROEditor - * accessory page id - * - * ***************** Version 7 ***************** - * User: Kathy Date: 10/02/02 Time: 1:40p - * Updated in $/EXE/RefObj/ROEditor - * clean up - * - * ***************** Version 6 ***************** - * User: Kathy Date: 9/27/02 Time: 1:14p - * Updated in $/EXE/RefObj/ROEditor - * fix digit as first char in fieldname - * - * ***************** Version 5 ***************** - * User: Kathy Date: 9/25/02 Time: 9:57a - * Updated in $/EXE/RefObj/ROEditor - * dev - * - * ***************** Version 4 ***************** - * User: Kathy Date: 9/19/02 Time: 10:03a - * Updated in $/EXE/RefObj/ROEditor - * only allow mods at root - * - * ***************** Version 3 ***************** - * User: Kathy Date: 9/11/02 Time: 1:15p - * Updated in $/EXE/RefObj/ROEditor - * vlnxml - * - * ***************** Version 2 ***************** - * User: Kathy Date: 8/28/02 Time: 10:56a - * Updated in $/EXE/RefObj/ROEditor - * development - *********************************************************************************************/ - - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Xml; -using System.Text; -using RODBInterface; -using ROFields; -using VlnStatus; - -namespace ROEditor -{ - /// - /// Summary description for GroupDefinition. - /// - public class GroupDefFrm : System.Windows.Forms.Form - { - private System.Windows.Forms.Label lblGroup; - private System.Windows.Forms.TextBox tbGroup; - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.Label lblPrefix; - private System.Windows.Forms.Label lblValue; - private System.Windows.Forms.TextBox tbPrefix; - private System.Windows.Forms.TextBox tbValue; - private System.Windows.Forms.Button btnRODef; - private System.Windows.Forms.Button btnSubDef; - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button btnCancel; - - private RODB myrodb; - private VlnXmlElement elem; - private string origGroup; - private string origPrefix; - private string origValue; - private int dbtype; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public GroupDefFrm(VlnXmlElement pelem, RODB rodb, string gpname,int idbtype) - { - myrodb = rodb; - elem = pelem; - origGroup = gpname; - dbtype=idbtype; // if new, 3 = user define, must define fields before save. - // - // Required for Windows Form Designer support - // - InitializeComponent(); - FillInData(); - } - - private string CvtUserFldToFld(string fldname) - { - if (fldname.Length < 2) - return fldname; - // a digit cannot start an xml fieldname, prepend a "__" to it. - string tmp0; - if (char.IsDigit(fldname,0)) - tmp0 = "__" + fldname; - else - tmp0 = fldname; - // an xml fieldname cannot have a space, change it to a "__" - string tmpstr = tmp0.Replace(" ","__"); - int len = tmpstr.Length; - int cnt = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval; - - while (cnt < len) - { - char tmpchr = tmpstr[cnt]; - if(!char.IsLetterOrDigit(tmpchr)&& (OKpunch.IndexOf(tmpchr) == -1) ) - { - decval = tmpchr; - outstr += OKpunch + decval.ToString("D3"); - } - else - { - outstr += tmpchr.ToString(); - } - cnt++; - } - return outstr; - } - - private string CvtFldToUserFld(string fldname) - { - string tmpstr0; - if (fldname.Length < 2) return fldname; - // an xml element name cannot begin with a digit. we had prepended a "__" - if (fldname.Substring(0,2) == "__" && char.IsDigit(fldname,2)) - tmpstr0 = fldname.Substring(2,fldname.Length-2); - else - tmpstr0 = fldname; - // an xml element name cannot have a space, we converted to a "__" - string tmpstr = tmpstr0.Replace("__"," "); - int len = tmpstr.Length; - int cur = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval, indx; - if (len <6) - indx = -1; - else - indx=tmpstr.IndexOf(OKpunch,cur); - string asc_spchar; - while (indx>=0) - { - outstr += tmpstr.Substring(cur,indx-cur); - asc_spchar = tmpstr.Substring(indx+3,3); - decval = System.Convert.ToInt16(asc_spchar,10); - outstr += System.Convert.ToChar(decval).ToString(); - cur = indx+6; - if (cur+6 > len) - indx = -1; - else - indx = tmpstr.IndexOf(OKpunch,cur); - } - if (cur - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.lblGroup = new System.Windows.Forms.Label(); - this.tbGroup = new System.Windows.Forms.TextBox(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.tbValue = new System.Windows.Forms.TextBox(); - this.tbPrefix = new System.Windows.Forms.TextBox(); - this.lblValue = new System.Windows.Forms.Label(); - this.lblPrefix = new System.Windows.Forms.Label(); - this.btnRODef = new System.Windows.Forms.Button(); - this.btnSubDef = new System.Windows.Forms.Button(); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.groupBox1.SuspendLayout(); - this.SuspendLayout(); - // - // lblGroup - // - this.lblGroup.Location = new System.Drawing.Point(24, 8); - this.lblGroup.Name = "lblGroup"; - this.lblGroup.Size = new System.Drawing.Size(56, 16); - this.lblGroup.TabIndex = 0; - this.lblGroup.Text = "Group:"; - // - // tbGroup - // - this.tbGroup.Location = new System.Drawing.Point(88, 8); - this.tbGroup.Name = "tbGroup"; - this.tbGroup.Size = new System.Drawing.Size(248, 22); - this.tbGroup.TabIndex = 1; - this.tbGroup.Text = "textBox1"; - // - // groupBox1 - // - this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] { - this.tbValue, - this.tbPrefix, - this.lblValue, - this.lblPrefix}); - this.groupBox1.Location = new System.Drawing.Point(24, 56); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(312, 96); - this.groupBox1.TabIndex = 2; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Accessory Page Access"; - // - // tbValue - // - this.tbValue.Location = new System.Drawing.Point(72, 56); - this.tbValue.Name = "tbValue"; - this.tbValue.Size = new System.Drawing.Size(216, 22); - this.tbValue.TabIndex = 3; - this.tbValue.Text = "textBox1"; - // tbPrefix - // - this.tbPrefix.Location = new System.Drawing.Point(72, 24); - this.tbPrefix.Name = "tbPrefix"; - this.tbPrefix.Size = new System.Drawing.Size(216, 22); - this.tbPrefix.TabIndex = 2; - this.tbPrefix.Text = "textBox1"; - // - // lblValue - // - this.lblValue.Location = new System.Drawing.Point(16, 56); - this.lblValue.Name = "lblValue"; - this.lblValue.Size = new System.Drawing.Size(48, 16); - this.lblValue.TabIndex = 1; - this.lblValue.Text = "Value:"; - // - // lblPrefix - // - this.lblPrefix.ForeColor = System.Drawing.SystemColors.ControlText; - this.lblPrefix.Location = new System.Drawing.Point(16, 24); - this.lblPrefix.Name = "lblPrefix"; - this.lblPrefix.Size = new System.Drawing.Size(48, 16); - this.lblPrefix.TabIndex = 0; - this.lblPrefix.Text = "Prefix:"; - // - // btnRODef - // - this.btnRODef.Location = new System.Drawing.Point(24, 168); - this.btnRODef.Name = "btnRODef"; - this.btnRODef.Size = new System.Drawing.Size(312, 24); - this.btnRODef.TabIndex = 3; - this.btnRODef.Text = "Referenced Object Definition..."; - this.btnRODef.Click += new System.EventHandler(this.btnRODef_Click); - // - // btnSubDef - // - this.btnSubDef.Location = new System.Drawing.Point(24, 208); - this.btnSubDef.Name = "btnSubDef"; - this.btnSubDef.Size = new System.Drawing.Size(312, 24); - this.btnSubDef.TabIndex = 4; - this.btnSubDef.Text = "Subgroup Definition ..."; - this.btnSubDef.Click += new System.EventHandler(this.btnSubDef_Click); - // - // btnOK - // - this.btnOK.Location = new System.Drawing.Point(24, 248); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(144, 24); - this.btnOK.TabIndex = 5; - this.btnOK.Text = "OK"; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(192, 248); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(144, 24); - this.btnCancel.TabIndex = 6; - this.btnCancel.Text = "Cancel"; - // - // GroupDefFrm - // - this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); - this.ClientSize = new System.Drawing.Size(368, 293); - this.Controls.AddRange(new System.Windows.Forms.Control[] { - this.btnCancel, - this.btnOK, - this.btnSubDef, - this.btnRODef, - this.groupBox1, - this.tbGroup, - this.lblGroup}); - this.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.Name = "GroupDefFrm"; - this.Text = "Group Definition"; - this.groupBox1.ResumeLayout(false); - this.ResumeLayout(false); - - } - #endregion - - private bool ProcessRROAccPageIDChange(VlnXmlElement mnuele, string newtmpl) - { - bool success; - XmlNode chldnode = (XmlNode) mnuele.FirstChild; - VlnXmlElement echild; - while (chldnode != null) - { - if (chldnode is VlnXmlElement) - { - echild = (VlnXmlElement) chldnode; - if (echild.Name != "vlnGroup") - { - // If this is a group defintion subtree it will only have one - // child, which is the text definition for the subgroup. Don't - // include these in the tree. - int levelCnt = chldnode.ChildNodes.Count; - string TheMenuTitle = echild.GetAttribute("MenuTitle"); - if ((levelCnt > 1) || (levelCnt==1 && !TheMenuTitle.Equals(""))) - { - string accid = echild.GetAccPageIDString(newtmpl); - echild.SetAttribute("AccPageID",accid); - success = myrodb.RODB_WriteRO(echild); - if (success==false) return false; - } - } - } - chldnode = chldnode.NextSibling; - } - return true; - } - - private bool UpdateAccPageID(VlnXmlElement grp, string newtmpl, VlnStatusMessage StatMsgWindow) - { - // For this group and below in the xml tree, update Accessory Page ID using the new - // template. - bool success; - string haskids; - string kidsloaded; - XmlNode node = (XmlNode) grp.FirstChild; - VlnXmlElement child; - while (node != null) - { - if (node is VlnXmlElement) - { - child = (VlnXmlElement) node; - - // If this is a group menu edit, process group nodes, otherwise - // process rros. - - if (child.Name == "vlnGroup") - { - haskids = child.GetAttribute("HasChild"); - kidsloaded = child.GetAttribute("ChildLoaded"); - if (haskids == "True" && kidsloaded == "False" ) - { - elem.SetAttribute("TreeNotData","True"); - myrodb.RODB_GetChildData(child,true); - child.SetAttribute("ChildLoaded","True"); - } - StatMsgWindow.StatusMessage = child.GetAttribute("MenuTitle"); - success = UpdateAccPageID(child, newtmpl, StatMsgWindow); - if (success == false) return false; - - success = ProcessRROAccPageIDChange(grp, newtmpl); - if (success==false)return false; - } - } - node = node.NextSibling; - } - success = ProcessRROAccPageIDChange(grp, newtmpl); - if (success==false) return false; - return true; - } - - private void btnOK_Click(object sender, System.EventArgs e) - { - // if the fields were disabled, just return. (Only need to check one of them) - if(this.tbGroup.Enabled == false) - { - this.Close(); - return; - } - // is this is a database level group, and is a user defined type, the - // accessory page value, fields in use & group fields in use must all be set. - // (doesn't need a prefix. - if (elem.ParentNode.Name == "RO_Root" && dbtype==3) //3 is user defined. - { - string strattr; - strattr = elem.GetAttribute("FieldsInUse"); - if (strattr == null || strattr=="") - { - MessageBox.Show("No fields defined for Referenced Objects","Group Definition Error"); - return; - } - strattr = this.tbValue.Text; - if (strattr == null || strattr=="") - { - MessageBox.Show("No Value defined for this group","Group Definition Error"); - return; - } - strattr = elem.GetAttribute("GroupFieldsInUse"); - if (strattr == null || strattr=="") - { - MessageBox.Show("No fields defined for subgroup","Group Definition Error"); - return; - } - } - bool modaccpageid=false; - bool modified=false; - if ((elem.HasAttribute("AccPageID")&&this.tbValue.Text!=origValue) || this.tbValue.Modified) - { - string dummy = ""; // need for RODB_GetFIeldsInUse call, won't be used. - ArrayList AvailList, InUseList; - //first see if it is a valid 'InUse' Field. - AvailList = myrodb.RODB_GetFields(elem, (uint) RecordType.Schema); - InUseList = myrodb.RODB_GetFieldsInUse(elem, AvailList,"FieldsInUse", ref dummy, true); - int chkbracketo, chkbracketc; // open & close bracket indexes - chkbracketo = this.tbValue.Text.IndexOf("<"); - chkbracketc = this.tbValue.Text.IndexOf(">"); - if (chkbracketo == -1 || chkbracketc == -1) - { - MessageBox.Show("Missing bracket () in value definition."); - return; - } - //if (chkbracketo != 0 || chkbracketc != this.tbValue.Text.Length-1) - //{ - // MessageBox.Show("Value definition contains extraneous text."); - // return; - //} - // check for more than one field, don't allow this, - int twobrk = this.tbValue.Text.IndexOf("<",chkbracketo+1); - if (twobrk != -1) - { - MessageBox.Show("Cannot have two fields in accessory page id."); - return; - } - string val = this.tbValue.Text.Substring(chkbracketo+1,chkbracketc-chkbracketo-1); - // loop thru inuse list and see if it's there. - bool found = false; - for(int i=0; i0) - accidattr.Append(this.tbValue.Text.Substring(0,chkbracketo+1)); // +1 include the "<" - else - accidattr.Append("<"); - accidattr.Append(CvtUserFldToFld(this.tbValue.Text.Substring(chkbracketo+1,chkbracketc-chkbracketo-1))); - if (chkbracketc>this.tbValue.Text.Length) - accidattr.Append(this.tbValue.Text.Substring(chkbracketc+1,this.tbValue.Text.Length-chkbracketc+1)); - else - accidattr.Append(">"); - elem.SetAttribute("AccPageID",accidattr.ToString()); -// elem.SetAttribute("AccPageID",CvtUserFldToFld(this.tbValue.Text)); - - } - if (this.tbGroup.Text != origGroup) - { - XmlNode tmpn = (XmlNode) elem; - tmpn.FirstChild.Value = tmpn.FirstChild.Value.Replace(origGroup, this.tbGroup.Text); - modified=true; - } - if ((elem.HasAttribute("AccPageIDPrefix")&&this.tbPrefix.Text != origPrefix) || this.tbPrefix.Modified==true) - { - elem.SetAttribute("AccPageIDPrefix",this.tbPrefix.Text); - modified=true; - } - bool success=true; - if (modified==true) success = myrodb.RODB_WriteRO(elem); - if (modified == true && success == true && modaccpageid==true) - { - Cursor.Current = Cursors.WaitCursor; - VlnStatusMessage StatMsgWindow = new VlnStatusMessage("Status of Accessory Page ID Change"); - success = UpdateAccPageID(elem, this.tbValue.Text,StatMsgWindow); - Cursor.Current = Cursors.Default; - StatMsgWindow.Dispose(); - } - if (success == false) - MessageBox.Show("Could not save data."); - this.Close(); - } - - private void btnRODef_Click(object sender, System.EventArgs e) - { - RODefFrm rodef = new RODefFrm(elem,myrodb,"FieldsInUse", this.tbGroup.Text, dbtype); - rodef.ShowDialog(); - // get accpageid, in case field name changed. - string accvalue = elem.GetAttribute("AccPageID"); - - VlnXmlElement parent; - parent = (VlnXmlElement) elem.ParentNode; - while (parent != null && accvalue=="") - { - // walk up tree to get parent. - if (accvalue == "") accvalue = parent.GetAttribute("AccPageID"); - if (parent.Name != "RO_Root") - parent = (VlnXmlElement) parent.ParentNode; - else - parent = null; - } - if (accvalue != "") - this.tbValue.Text = CvtFldToUserFld(accvalue); - else - this.tbValue.Text = ""; - } - - private void btnSubDef_Click(object sender, System.EventArgs e) - { - RODefFrm rodef = new RODefFrm(elem,myrodb,"GroupFieldsInUse", this.tbGroup.Text, dbtype); - rodef.ShowDialog(); - } - } -} diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/GroupDefFrm.resx b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/GroupDefFrm.resx deleted file mode 100644 index 07b710fc..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/GroupDefFrm.resx +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - GroupDefFrm - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/GroupNewFrm.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/GroupNewFrm.cs deleted file mode 100644 index eb4a300a..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/GroupNewFrm.cs +++ /dev/null @@ -1,425 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: GroupNewFrm.cs $ $Revision: 7 $ - * $Author: Kathy $ $Date: 5/07/03 1:58p $ - * - * $History: GroupNewFrm.cs $ - * - * ***************** Version 7 ***************** - * User: Kathy Date: 5/07/03 Time: 1:58p - * Updated in $/EXE/RefObj/ROEditor - * B2003-033 - * - * ***************** Version 6 ***************** - * User: Kathy Date: 4/04/03 Time: 9:40a - * Updated in $/EXE/RefObj/ROEditor - * B2003-030: set HasChild Attribute for new group - * - * ***************** Version 5 ***************** - * User: Kathy Date: 12/10/02 Time: 2:26p - * Updated in $/EXE/RefObj/ROEditor - * fieldname special char - * - * ***************** Version 4 ***************** - * User: Kathy Date: 12/06/02 Time: 11:58a - * Updated in $/EXE/RefObj/ROEditor - * fix new table can't delete without exiting program - * - * ***************** Version 3 ***************** - * User: Kathy Date: 12/02/02 Time: 8:30a - * Updated in $/EXE/RefObj/ROEditor - * fieldname replace chars - * - * ***************** Version 2 ***************** - * User: Kathy Date: 10/17/02 Time: 11:35a - * Updated in $/EXE/RefObj/ROEditor - * don't save twice if continue selected to close - * - * ***************** Version 1 ***************** - * User: Kathy Date: 10/15/02 Time: 2:24p - * Created in $/EXE/RefObj/ROEditor - * new hi level group, form & code - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Xml; -using System.Text; -using ROFields; -using RODBInterface; - -namespace ROEditor -{ - /// - /// Summary description for GroupNewFrm. - /// - public class GroupNewFrm : System.Windows.Forms.Form - { - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.TextBox tbGroup; - private System.Windows.Forms.Label lblGroup; - private System.Windows.Forms.Button btnContinue; - private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.RadioButton rbbtnUserDef; - private System.Windows.Forms.RadioButton rbbtnGraphics; - private System.Windows.Forms.RadioButton rbbtnSetpoint; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private RODB myrodb; - private VlnXmlElement elem; - private string lastSavedGroup; - private VlnXmlElement nelem; // new group element - private string tbname; // new group table name - private string toprecid; // new group master rec id - - public GroupNewFrm(RODB rodb, VlnXmlElement topelem) - { - elem = topelem; - myrodb = rodb; - nelem = null; - toprecid = null; - tbname = null; - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - // - // TODO: Add any constructor code after InitializeComponent call - // - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.btnCancel = new System.Windows.Forms.Button(); - this.btnContinue = new System.Windows.Forms.Button(); - this.tbGroup = new System.Windows.Forms.TextBox(); - this.lblGroup = new System.Windows.Forms.Label(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.rbbtnSetpoint = new System.Windows.Forms.RadioButton(); - this.rbbtnGraphics = new System.Windows.Forms.RadioButton(); - this.rbbtnUserDef = new System.Windows.Forms.RadioButton(); - this.groupBox1.SuspendLayout(); - this.SuspendLayout(); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(176, 244); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(120, 24); - this.btnCancel.TabIndex = 10; - this.btnCancel.Text = "Cancel"; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // btnContinue - // - this.btnContinue.Location = new System.Drawing.Point(40, 244); - this.btnContinue.Name = "btnContinue"; - this.btnContinue.Size = new System.Drawing.Size(106, 24); - this.btnContinue.TabIndex = 9; - this.btnContinue.Text = "Continue"; - this.btnContinue.Click += new System.EventHandler(this.btnContinue_Click); - // - // tbGroup - // - this.tbGroup.Location = new System.Drawing.Point(72, 8); - this.tbGroup.Name = "tbGroup"; - this.tbGroup.Size = new System.Drawing.Size(248, 22); - this.tbGroup.TabIndex = 8; - this.tbGroup.Text = ""; - // - // lblGroup - // - this.lblGroup.Location = new System.Drawing.Point(8, 8); - this.lblGroup.Name = "lblGroup"; - this.lblGroup.Size = new System.Drawing.Size(56, 16); - this.lblGroup.TabIndex = 7; - this.lblGroup.Text = "Group:"; - // - // groupBox1 - // - this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] { - this.rbbtnSetpoint, - this.rbbtnGraphics, - this.rbbtnUserDef}); - this.groupBox1.Location = new System.Drawing.Point(24, 56); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(288, 152); - this.groupBox1.TabIndex = 11; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Group Type"; - // - // rbbtnSetpoint - // - this.rbbtnSetpoint.Location = new System.Drawing.Point(48, 64); - this.rbbtnSetpoint.Name = "rbbtnSetpoint"; - this.rbbtnSetpoint.Size = new System.Drawing.Size(184, 24); - this.rbbtnSetpoint.TabIndex = 2; - this.rbbtnSetpoint.Text = "Setpoint Database"; - // - // rbbtnGraphics - // - this.rbbtnGraphics.Location = new System.Drawing.Point(48, 96); - this.rbbtnGraphics.Name = "rbbtnGraphics"; - this.rbbtnGraphics.Size = new System.Drawing.Size(184, 24); - this.rbbtnGraphics.TabIndex = 1; - this.rbbtnGraphics.TabStop = true; - this.rbbtnGraphics.Text = "Graphics Database"; - // - // rbbtnUserDef - // - this.rbbtnUserDef.Location = new System.Drawing.Point(48, 32); - this.rbbtnUserDef.Name = "rbbtnUserDef"; - this.rbbtnUserDef.Size = new System.Drawing.Size(184, 24); - this.rbbtnUserDef.TabIndex = 0; - this.rbbtnUserDef.Text = "User Defined Database"; - // - // GroupNewFrm - // - this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); - this.ClientSize = new System.Drawing.Size(376, 273); - this.Controls.AddRange(new System.Windows.Forms.Control[] { - this.groupBox1, - this.btnCancel, - this.btnContinue, - this.tbGroup, - this.lblGroup}); - this.Font = new System.Drawing.Font("Tahoma", 9F); - this.Name = "GroupNewFrm"; - this.Text = "New Group (Database)"; - this.Load += new System.EventHandler(this.GroupNewFrm_Load); - this.groupBox1.ResumeLayout(false); - this.ResumeLayout(false); - - } - #endregion - - private void GroupNewFrm_Load(object sender, System.EventArgs e) - { - - } - - private string CvtUserFldToFld(string fldname) - { - if (fldname.Length < 2) - return fldname; - // a digit cannot start an xml fieldname, prepend a "__" to it. - string tmp0; - if (char.IsDigit(fldname,0)) - tmp0 = "__" + fldname; - else - tmp0 = fldname; - // an xml fieldname cannot have a space, change it to a "__" - string tmpstr = tmp0.Replace(" ","__"); - int len = tmpstr.Length; - int cnt = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval; - - while (cnt < len) - { - char tmpchr = tmpstr[cnt]; - if(!char.IsLetterOrDigit(tmpchr)&& (OKpunch.IndexOf(tmpchr) == -1) ) - { - decval = tmpchr; - outstr += OKpunch + decval.ToString("D3"); - } - else - { - outstr += tmpchr.ToString(); - } - cnt++; - } - return outstr; - } - - private void btnCancel_Click(object sender, System.EventArgs e) - { - if (toprecid != null) - { - myrodb.RODB_DeleteGroup((XmlNode)nelem,tbname,toprecid); - } - if(nelem!=null) - { - XmlNode par = (XmlNode)nelem.ParentNode; - par.RemoveChild((XmlNode)nelem); - } - } - - private void btnContinue_Click(object sender, System.EventArgs e) - { - bool success; - if (this.tbGroup.Text == null || this.tbGroup.Text == "") - { - MessageBox.Show("Need to specify group name."); - return; - } - // if this was already saved, i.e. user hit continue button already, - // just return; - if (this.tbGroup.Text == lastSavedGroup) - { - this.Close(); - return; - } - lastSavedGroup = this.tbGroup.Text; - int dbtype=-1; - if (this.rbbtnGraphics.Checked == true) dbtype = 1; - else if (this.rbbtnSetpoint.Checked == true) dbtype = 2; - else if (this.rbbtnUserDef.Checked == true) dbtype = 3; - if (dbtype<0) - { - MessageBox.Show("Need to define type of group."); - return; - } - Cursor.Current = Cursors.WaitCursor; - // make a new table with the next table name id - tbname = myrodb.RODB_GetNextGroupTable(); - if (tbname == null) - { - Cursor.Current = Cursors.Default; - return; - } - toprecid = myrodb.RODB_AddNewTable(tbname, this.tbGroup.Text); - if (toprecid == null) - { - Cursor.Current = Cursors.Default; - return; - } - // for the given type, copy over the required fields. - success = myrodb.RODB_CopyFieldDefs("ROMaster",tbname,dbtype); - if (success == false) - { - Cursor.Current = Cursors.Default; - return; - } - // create top level group node with input name. - nelem = (VlnXmlElement) elem.OwnerDocument.CreateElement("vlnGroup"); - nelem.InnerText = CvtUserFldToFld(this.tbGroup.Text); - nelem.SetAttribute("Table",tbname); - nelem.SetAttribute("ParentID", "00000000"); - string nrecid = myrodb.RODB_GetNextRecId(tbname); - nelem.SetAttribute("RecID", nrecid); - elem.AppendChild((XmlNode) nelem); - success = myrodb.RODB_InsertGroup(nelem); - Cursor.Current = Cursors.Default; - if (success == false) return; - nelem.SetAttribute("TreeNotData", "True"); - nelem.SetAttribute("MenuTitle", this.tbGroup.Text); - nelem.SetAttribute("MasterRecID",toprecid); - nelem.SetAttribute("HasChild", "False"); - - // if this is a setpoint db or image db, get fields and find those fields needed - // to define ro & group. This is hardcoded, yuk. - if(dbtype == 1 || dbtype == 2) - { - ArrayList FieldList = myrodb.RODB_GetFields(nelem, (uint) RecordType.Schema); - string[] fldlist=null, grplist=null; - ROField rof; - string curfld; - StringBuilder Inuse = new StringBuilder(); - // Get list of inuse fields for the rro. - if (dbtype == 1) - fldlist = new string[] {"Name", "Image ID", "Image"}; - else - fldlist = new string[] {"Setpoint ID", "Setpoint Value", "Associated System Component", "Applicability", "Revision", "Short Description", - "Description", "Key Assumptions", "Basis", "References"}; - for (int i=0; i< fldlist.Length; i++) - { - curfld = fldlist[i]; - for (int j=0; j"); - nelem.SetAttribute("MenuItem"," "); - nelem.SetAttribute("GroupMenuItem",""); - nelem.SetAttribute("AccPageIDPrefix","SP2"); - nelem.SetAttribute("AccPageID",""); - } - else if (dbtype == 1) // image - { - nelem.SetAttribute("RetVal",""); - nelem.SetAttribute("MenuItem",""); - nelem.SetAttribute("GroupMenuItem",""); - nelem.SetAttribute("AccPageIDPrefix","IG2"); - nelem.SetAttribute("AccPageID",""); - } - success = myrodb.RODB_WriteRO(nelem); - if (success == false) return; - } - - // now let the user specify the group name, etc to define the group. - GroupDefFrm grdef = new GroupDefFrm(nelem,myrodb,nelem.InnerText,dbtype); - grdef.ShowDialog(); - } - } -} diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/GroupNewFrm.resx b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/GroupNewFrm.resx deleted file mode 100644 index 7ebaaeb7..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/GroupNewFrm.resx +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - GroupNewFrm - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Properties/Resources.Designer.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Properties/Resources.Designer.cs deleted file mode 100644 index 86954426..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Properties/Resources.Designer.cs +++ /dev/null @@ -1,70 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4234 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace ROEditor.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ROEditor.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - internal static System.Drawing.Bitmap Red_V_txt_NB_bur_1984 { - get { - object obj = ResourceManager.GetObject("Red_V_txt_NB_bur_1984", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Properties/Resources.resx b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Properties/Resources.resx deleted file mode 100644 index 2eb5abf1..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Properties/Resources.resx +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - ..\Red_V_txt_NB_bur_1984.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/RODefFrm.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/RODefFrm.cs deleted file mode 100644 index 256f4cb7..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/RODefFrm.cs +++ /dev/null @@ -1,1219 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: RODefFrm.cs $ $Revision: 18 $ - * $Author: Kathy $ $Date: 9/06/05 11:26a $ - * - * $History: RODefFrm.cs $ - * - * ***************** Version 18 ***************** - * User: Kathy Date: 9/06/05 Time: 11:26a - * Updated in $/EXE/RefObj/ROEditor - * B2005-035 - * - * ***************** Version 17 ***************** - * User: Jsj Date: 7/02/03 Time: 9:25a - * Updated in $/EXE/RefObj/ROEditor - * made messagebox calls modal by removing the parent window reference - * - * ***************** Version 16 ***************** - * User: Kathy Date: 5/21/03 Time: 12:52p - * Updated in $/EXE/RefObj/ROEditor - * B2003-041: process if only one field for RO & not always saving ro - * field name edit - * - * ***************** Version 15 ***************** - * User: Kathy Date: 5/07/03 Time: 1:58p - * Updated in $/EXE/RefObj/ROEditor - * B2003-033 fixed - * - * ***************** Version 14 ***************** - * User: Jsj Date: 4/14/03 Time: 3:03p - * Updated in $/EXE/RefObj/ROEditor - * changes due to RO FST file creation speed up - * - * ***************** Version 13 ***************** - * User: Kathy Date: 12/10/02 Time: 2:26p - * Updated in $/EXE/RefObj/ROEditor - * fieldname special chars & bug fixes - * - * ***************** Version 12 ***************** - * User: Kathy Date: 12/02/02 Time: 9:25a - * Updated in $/EXE/RefObj/ROEditor - * after edit fieldname, update menu & retval correctly - * - * ***************** Version 11 ***************** - * User: Kathy Date: 12/02/02 Time: 8:30a - * Updated in $/EXE/RefObj/ROEditor - * fieldname replace chars - * - * ***************** Version 10 ***************** - * User: Kathy Date: 12/02/02 Time: 6:19a - * Updated in $/EXE/RefObj/ROEditor - * status on long ops & update text box for fieldname change - * - * ***************** Version 9 ***************** - * User: Kathy Date: 11/19/02 Time: 11:30a - * Updated in $/EXE/RefObj/ROEditor - * validate retval (handle {}) - * - * ***************** Version 8 ***************** - * User: Kathy Date: 10/15/02 Time: 2:18p - * Updated in $/EXE/RefObj/ROEditor - * new group (table) - * - * ***************** Version 7 ***************** - * User: Kathy Date: 10/10/02 Time: 10:02a - * Updated in $/EXE/RefObj/ROEditor - * try to m ake xml tree & tree control in sync - * - * ***************** Version 6 ***************** - * User: Kathy Date: 9/25/02 Time: 2:31p - * Updated in $/EXE/RefObj/ROEditor - * multitxt->variable - * - * ***************** Version 5 ***************** - * User: Kathy Date: 9/25/02 Time: 9:57a - * Updated in $/EXE/RefObj/ROEditor - * dev - * - * ***************** Version 4 ***************** - * User: Kathy Date: 9/19/02 Time: 10:04a - * Updated in $/EXE/RefObj/ROEditor - * mods for subgroup apply below node. if mod menutitle template, update - * menu titles from node down. - * - * ***************** Version 3 ***************** - * User: Kathy Date: 9/11/02 Time: 1:15p - * Updated in $/EXE/RefObj/ROEditor - * vlnxml - * - * ***************** Version 2 ***************** - * User: Kathy Date: 8/28/02 Time: 10:57a - * Updated in $/EXE/RefObj/ROEditor - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Xml; -using System.Xml.Schema; -using System.Text; -using ROFields; -using RODBInterface; -using VlnStatus; - - -namespace ROEditor -{ - - /// - /// Summary description for RODefinition. - /// - public class RODefFrm : System.Windows.Forms.Form - { - private System.Windows.Forms.Label lblGroup; - private System.Windows.Forms.Label lblRetVal; - private System.Windows.Forms.Label lblMenuVal; - private System.Windows.Forms.TextBox tbRetVal; - private System.Windows.Forms.TextBox tbMenuVal; - private System.Windows.Forms.Label lblGroupText; - private System.Windows.Forms.GroupBox gbFields; - private System.Windows.Forms.Label lblInUse; - private System.Windows.Forms.Label lblAvail; - private System.Windows.Forms.ListBox lboxInUse; - private System.Windows.Forms.ListBox lboxAvail; - private System.Windows.Forms.Button btnAdd; - private System.Windows.Forms.Button btnEdit; - private System.Windows.Forms.Button btnRemove; - private System.Windows.Forms.Button btnNew; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private RODB myrodb; - ArrayList AvailList; - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button btnCancel; - ArrayList InUseList; - private VlnXmlElement elem; - private uint editlevel; // flag for group definition or ro definition - private string strFieldsInUse; - private string origFieldsInUse; - private string origRetVal; - private string origMenuItem; - StringBuilder parseerror; - private int hi, lo; - private int dbtype; - // pass in Group Element - public RODefFrm(VlnXmlElement pelem, RODB rodb, string fields, string grptxt, int idbtype) - { - myrodb = rodb; - strFieldsInUse = fields; - dbtype = idbtype; - if (fields == "FieldsInUse") // not a group level edit. - editlevel = (uint) RecordType.Schema; - else - editlevel = (uint) RecordType.GroupSchema; - elem = pelem; - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - if(editlevel==(uint)RecordType.GroupSchema)this.Text = "Subgroup Definition"; - FillInData(grptxt); - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - private void FillInAvailable() - { - ROField rof; - - // put the items in the AvailList box. - for (int i=0; i< AvailList.Count; i++) - { - rof = (ROField) AvailList[i]; - if (rof.GetFieldname != null) // DO YET: Why null? - this.lboxAvail.Items.Add(rof.GetFieldname); - } - } - - - private void SetUpListBoxes() - { - ROField rof; - // Get list of available fields (all fields in this type, i.e. rectype = 'Schema' - // or 'GroupSchema') and get list of inuse from the schema definition. - AvailList = myrodb.RODB_GetFields(elem, editlevel); - InUseList = myrodb.RODB_GetFieldsInUse(elem, AvailList, strFieldsInUse, ref origFieldsInUse, true); - FillInAvailable(); - - // set up the listbox for inuse items. - if (InUseList != null) - { - // add items to the InUseList box. - for (int i=0; i< InUseList.Count; i++) - { - rof = (ROField) InUseList[i]; - if (rof.GetFieldname != null) //DO YET: why null? - this.lboxInUse.Items.Add(rof.GetFieldname); - } - } - } - - - private void DoValueTextBoxes() - { - string menuitm, retval; - if (editlevel == (uint) RecordType.GroupSchema) - { - menuitm = elem.GetAttribute("GroupMenuItem"); - this.tbRetVal.Visible = false; - this.lblRetVal.Visible = false; - VlnXmlElement parent; - parent = (VlnXmlElement) elem.ParentNode; - while (parent != null && (menuitm == "")) - { - // walk up tree to get parent and check for data there - if (menuitm == "") menuitm = parent.GetAttribute("GroupMenuItem"); - if (parent.Name != "RO_Root") - parent = (VlnXmlElement) parent.ParentNode; - else - parent = null; - } - if (menuitm !="") - this.tbMenuVal.Text = CvtFldToUserFld(menuitm); - else - this.tbMenuVal.Text = ""; - } - else - { - menuitm = elem.GetAttribute("MenuItem"); - retval = elem.GetAttribute("RetVal"); - this.tbRetVal.Visible = true; - this.lblRetVal.Visible = true; - VlnXmlElement parent; - parent = (VlnXmlElement) elem.ParentNode; - while (parent != null && (menuitm == "" || retval=="")) - { - // walk up tree to get parent and check for data there - if (menuitm == "") menuitm = parent.GetAttribute("MenuItem"); - if (retval == "") retval = parent.GetAttribute("RetVal"); - if (parent.Name != "RO_Root") - parent = (VlnXmlElement) parent.ParentNode; - else - parent = null; - } - if (menuitm!="") - this.tbMenuVal.Text = CvtFldToUserFld(menuitm); - else - this.tbMenuVal.Text = ""; - if (retval!="") - this.tbRetVal.Text = CvtFldToUserFld(retval); - else - this.tbRetVal.Text = ""; - } - } - - private void FillInData(string grptxt) - { - this.lblGroupText.Text = grptxt; - DoValueTextBoxes(); - SetUpListBoxes(); - - lboxInUse.GotFocus += new EventHandler(this.lboxInUse_GotFocus); - lboxAvail.GotFocus += new EventHandler(this.lboxAvail_GotFocus); - - // save copies of local data, so if there is a change, we know we must save them. - origRetVal=this.tbRetVal.Text; - origMenuItem=this.tbMenuVal.Text; - - // if this is a database level definition & it's a user defined database, - // the okay button is disabled until a field is used. - if (elem.ParentNode.Name == "RO_Root" && dbtype==3) - { - string attr; - if (editlevel==(uint)RecordType.Schema) - attr = elem.GetAttribute("FieldsInUse"); - else - attr = elem.GetAttribute("GroupFieldsInUse"); - if (attr==null || attr=="") btnOK.Enabled=false; - } - } - - protected void lboxInUse_GotFocus (object sender, EventArgs e) - { - lboxAvail.ClearSelected(); - this.btnRemove.Enabled = true; - this.btnAdd.Enabled = false; - this.btnEdit.Enabled = true; - } - protected void lboxAvail_GotFocus (object sender, EventArgs e) - { - lboxInUse.ClearSelected(); - this.btnAdd.Enabled = true; - this.btnRemove.Enabled = false; - this.btnEdit.Enabled = true; - } - private void btnRemove_Click(object sender, System.EventArgs e) - { - //get item in lboxInUse (in use list) and remove it from there - // and add it to the lboxAvail list. - if (lboxInUse.SelectedIndex >=0 ) - { - // get the selected item and its string. Remove it from the listbox, - // add it to the available array list & listbox & then remove it from - // the inuse array list. - int indx = lboxInUse.SelectedIndex; - lboxInUse.Items.RemoveAt(indx); - - // copy if over to availlist - ROField rof = (ROField) InUseList[indx]; - ROField copyrof = new ROField(rof.GetFieldname,rof.GetRecID,rof.GetMasterRecID, rof.GetFieldType); - AvailList.Add(copyrof); - - lboxAvail.Items.Add(copyrof.GetFieldname); - InUseList.RemoveAt(indx); - lboxAvail.Refresh(); - lboxInUse.Refresh(); - } - } - private void btnAdd_Click(object sender, System.EventArgs e) - { - //get item in lboxInUse (in use list) and remove it from there - // and add it to the lboxAvail list. - if (lboxAvail.SelectedIndex >=0 ) - { - // get the selected item and its string. Remove it from the listbox, - // add it to the inuse array list & listbox & then remove it from - // the avail(able) array list. - int indx = lboxAvail.SelectedIndex; - lboxAvail.Items.RemoveAt(indx); - - // copy if over to availlist - ROField rof = (ROField) AvailList[indx]; - ROField copyrof = new ROField(rof.GetFieldname,rof.GetRecID,rof.GetMasterRecID,rof.GetFieldType); - InUseList.Add(copyrof); - - lboxInUse.Items.Add(copyrof.GetFieldname); - AvailList.RemoveAt(indx); - lboxAvail.Refresh(); - lboxInUse.Refresh(); - btnOK.Enabled=true; - - } - } - - private void syntax(string prob,int start, int end) - { - lo=start; - hi=end; - parseerror.Append("Invalid Syntax - "); - parseerror.Append(prob); - } - - private void missingDelimiter(char chr,int start,int end) - { - lo=start; - hi=end; - string delim = "{}{<><"; - int delindx; - delindx = delim.IndexOf(chr,0); - parseerror.Append("Couldn't find matching "); - if (delindx >-1) - parseerror.Append(delim.Substring(delindx,1)); - else - parseerror.Append("?"); - } - private bool isWhiteSpace(char chr) - { - return(chr!=0 && " \t\n\r".IndexOf(chr)!=-1); - } - private int endsIn(char chr, string str, int start, int end) - { - while(start <= end && isWhiteSpace(str[end]))end--; - if(start <= end && str[end]==chr)return 1; - return 0; - } - - private void processBrace(string str, int start, int end) - { - int where=str.IndexOfAny("<>{}=".ToCharArray(),start,end-start); - if(where!=0) - { - char chr=str[where]; - switch(chr) - { - case '{': - // verify that this ends in a } - if(endsIn('}',str,where,end)==0) - { - syntax("should end with }",where,end); - } - break; - case '<': - syntax("< not permitted here",where,where); - break; - case '}': - syntax("} not permitted here",start,where); - break; - case '>': - syntax("> not permitted here",start,where); - break; - } - } - } - - private int findMatchingBrace(string str, int start, int end) - { - int where=start+1; - int last=where; - int termlevel=1; - while(hi==0 && where <= end && termlevel!=0) - { - char chr=str[where]; - switch (chr) - { - case '{': - where=findMatchingBrace(str,where,end); - where++; - break; - case '}': - termlevel=0; - break; - case '>': - missingDelimiter(chr,last,where); - break; - case '<': - int next; - next=str.IndexOfAny("{}<>".ToCharArray(),where+1,end-where); - if(next==0) - { - missingDelimiter(chr,last,end); - } - else if(str[next]!='>') - { - missingDelimiter(chr,last,next); - } - else - { - last=where=next+1; - } - break; - default: - where++; - break; - } - } - if(hi==0 && termlevel!=0) - { - missingDelimiter('{',start,end); - } - return where; - } - - private bool ValidReturnFieldSpec(string str, int start, int end) - { - if (parseerror != null) - parseerror.Remove(0,parseerror.Length); - else - parseerror = new StringBuilder(); - int where=start; - int last=start; - hi=lo=0; - while(hi==0 && where <= end) - { - char chr=str[where]; - switch (chr) - { - case '{': - int next; - next=findMatchingBrace(str,where,end); - if(hi==0) - { - processBrace(str,where+1,next-1); - where=next+1; - last=where; - } - break; - case '}': - missingDelimiter(chr,last,where); - break; - case '>': - missingDelimiter(chr,last,where); - break; - case '<': - int strt=where+1; - where = str.IndexOfAny("<>{}".ToCharArray(),where+1,end-where); - if (where==0) - missingDelimiter('<',start,end); - else if (str[where]=='>') - { - string inusename = str.Substring(strt,where-strt); - // now check field name. - bool found = false; - string rofname; - for (int i=0; i0) - { - MessageBox.Show(parseerror.ToString(),"Error in validating return value"); - return false; - } - else - return true; - } - - private bool ValidFieldSpec(string field) - { - int left = field.IndexOf("<"); - int right; - int stindx = 0; - while (left != -1) - { - // get right bracket and then check for valid field & if commas with - // this, check for integer values. - right = field.IndexOf(">",stindx); - if (right == -1) - { - MessageBox.Show("Missing > in Menu value."); - return false; - } - string substring = field.Substring(left+1,right-left-1); - // do comma parts now. - string inusename; - int comma1 = substring.IndexOf(","); - if (comma1 != -1) - { - // get any numbers for formatting & check for ints. - int comma2 = substring.IndexOf(",",comma1+1); - if (comma2 != -1) // two ints. - { - if (comma2-comma1 > 1) // first format field - not empty - { - string int1 = substring.Substring(comma1+1,comma2-comma1-1); - try - { - int l = System.Convert.ToInt32(int1); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"invalid format number"); - return false; - } - } - if (comma2field.Length) - left = -1; - else - { - stindx=right+1; - left = field.IndexOf("<",left+1); - } - } - return true; - } - private bool ProcessRROMenuChange(VlnXmlElement mnuele, string newtmpl) - { - bool success; - XmlNode chldnode = (XmlNode) mnuele.FirstChild; - VlnXmlElement echild; - while (chldnode != null) - { - if (chldnode is VlnXmlElement) - { - echild = (VlnXmlElement) chldnode; - if (echild.Name != "vlnGroup") - { - // If this is a group defintion subtree it will only have one - // child, which is the text definition for the subgroup. Don't - // include these in the tree. - int levelCnt = chldnode.ChildNodes.Count; - string TheMenuTitle = echild.GetAttribute("MenuTitle"); - if ((levelCnt >= 1) && !TheMenuTitle.Equals("")) - { - string mnustring = echild.GetMenuString(newtmpl,false); - echild.SetAttribute("MenuTitle",mnustring); - success = myrodb.RODB_WriteRO(echild); - if (success==false) return false; - } - } - } - chldnode = chldnode.NextSibling; - } - return true; - } - - private bool UpdateMenuTitles(VlnXmlElement mnuele, string newtmpl, string stredittype, VlnStatusMessage StatMsgWindow) - { - // For this group and below in the xml tree, update menu titles using the new - // template. - bool success; - string haskids; - string kidsloaded; - XmlNode node = (XmlNode) mnuele.FirstChild; - VlnXmlElement child; - - while (node != null) - { - if (node is VlnXmlElement) - { - child = (VlnXmlElement) node; - - // If this is a group menu edit, process group nodes, otherwise - // process rros. For both, when hitting a group node, check that - // it doesn't have a menu item string redefining the menu template. - - if (child.Name == "vlnGroup" && child.HasAttribute(stredittype) == false) - { - haskids = child.GetAttribute("HasChild"); - kidsloaded = child.GetAttribute("ChildLoaded"); - if (haskids == "True" && kidsloaded == "False" ) - { - myrodb.RODB_GetChildData(child,true); - child.SetAttribute("ChildLoaded","True"); - } - StatMsgWindow.StatusMessage = child.GetAttribute("MenuTitle"); - success = UpdateMenuTitles(child,newtmpl, stredittype, StatMsgWindow); - if (success == false) return false; - - if (editlevel == (uint) RecordType.Schema) - { - success = ProcessRROMenuChange(mnuele, newtmpl); - if (success==false)return false; - } - else if (editlevel == (uint) RecordType.GroupSchema) - { - string mnustring = child.GetMenuString(newtmpl,true); - child.SetAttribute("MenuTitle",mnustring); - success = myrodb.RODB_WriteGroup(child,child); - if (success==false) return false; - } - } - } - node = node.NextSibling; - } - // if doing RO menu updates, do all at the current level, otherwise, skip it - // because it is a group menu item. - if (stredittype == "MenuItem") - { - success = ProcessRROMenuChange(mnuele, newtmpl); - if (success==false) return false; - } - return true; - } - - private string CvtUserFldToFld(string fldname) - { - if (fldname.Length < 2) - return fldname; - // a digit cannot start an xml fieldname, prepend a "__" to it. - string tmp0; - if (char.IsDigit(fldname,0)) - tmp0 = "__" + fldname; - else - tmp0 = fldname; - // an xml fieldname cannot have a space, change it to a "__" - string tmpstr = tmp0.Replace(" ","__"); - int len = tmpstr.Length; - int cnt = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval; - - while (cnt < len) - { - char tmpchr = tmpstr[cnt]; - if(!char.IsLetterOrDigit(tmpchr)&& (OKpunch.IndexOf(tmpchr) == -1) ) - { - decval = tmpchr; - outstr += OKpunch + decval.ToString("D3"); - } - else - { - outstr += tmpchr.ToString(); - } - cnt++; - } - return outstr; - } - - private string CvtFldToUserFld(string fldname) - { - string tmpstr0; - if (fldname.Length < 2) return fldname; - // an xml element name cannot begin with a digit. we had prepended a "__" - if (fldname.Substring(0,2) == "__" && char.IsDigit(fldname,2)) - tmpstr0 = fldname.Substring(2,fldname.Length-2); - else - tmpstr0 = fldname; - // an xml element name cannot have a space, we converted to a "__" - string tmpstr = tmpstr0.Replace("__"," "); - int len = tmpstr.Length; - int cur = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval, indx; - if (tmpstr.Length <6) - indx = -1; - else - indx=tmpstr.IndexOf(OKpunch,cur); - string asc_spchar; - while (indx>=0) - { - outstr += tmpstr.Substring(cur,indx-cur); - asc_spchar = tmpstr.Substring(indx+3,3); - decval = System.Convert.ToInt16(asc_spchar,10); - outstr += System.Convert.ToChar(decval).ToString(); - cur = indx+6; - if (cur+6 > len) - indx = -1; - else - indx = tmpstr.IndexOf(OKpunch,cur); - } - if (cur= 0) - rof = (ROField) InUseList[indx]; - else - { - isInSelList = false; - indx = lboxAvail.SelectedIndex; - if (indx >= 0) - rof = (ROField) AvailList[indx]; - else - { - // message - bad one. - return; - } - } - - uint ftype = rof.GetFieldType; - if (ftype == (uint)FieldTypes.FrmtSingleTxt || ftype == (uint)FieldTypes.VariableTxt || - ftype == (uint)FieldTypes.SingleTxt || ftype == (uint)FieldTypes.Table || - ftype == (uint)FieldTypes.XYPlot || ftype == (uint)FieldTypes.Image) - - { - FieldTypeDefFrm nwtyp = new FieldTypeDefFrm(rof, myrodb, elem, editlevel, AvailList, InUseList); - nwtyp.ShowDialog(); - } - else - { - FieldCombFrm nwcomb = new FieldCombFrm(rof, myrodb, elem, editlevel, rof.GetFieldname, AvailList, InUseList); - nwcomb.ShowDialog(); - } - - // Update Lists & Text boxes to represent any modified text. - if (isInSelList) - { - lboxInUse.Items.Clear(); - // add items to the InUseList box. - for (int i=0; i< InUseList.Count; i++) - { - rof = (ROField) InUseList[i]; - if (rof.GetFieldname != null) - this.lboxInUse.Items.Add(rof.GetFieldname); - } - } - else - { - lboxAvail.Items.Clear(); - // add items to the AvailList box. - for (int i=0; i< AvailList.Count; i++) - { - rof = (ROField) AvailList[i]; - if (rof.GetFieldname != null) - this.lboxAvail.Items.Add(rof.GetFieldname); - } - } - } - - private void btnNew_Click(object sender, System.EventArgs e) - { - ROField rof = new ROField(null,null,null,0); - FieldTypeDefFrm nwtyp = new FieldTypeDefFrm(rof, myrodb, elem, editlevel, AvailList, InUseList); - nwtyp.ShowDialog(); - - if (rof.GetFieldname != null) - { - AvailList.Add(rof); - lboxAvail.Items.Add(rof.GetFieldname); - } - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.lblGroup = new System.Windows.Forms.Label(); - this.lblRetVal = new System.Windows.Forms.Label(); - this.lblMenuVal = new System.Windows.Forms.Label(); - this.tbRetVal = new System.Windows.Forms.TextBox(); - this.tbMenuVal = new System.Windows.Forms.TextBox(); - this.lblGroupText = new System.Windows.Forms.Label(); - this.gbFields = new System.Windows.Forms.GroupBox(); - this.btnNew = new System.Windows.Forms.Button(); - this.btnRemove = new System.Windows.Forms.Button(); - this.btnEdit = new System.Windows.Forms.Button(); - this.btnAdd = new System.Windows.Forms.Button(); - this.lboxAvail = new System.Windows.Forms.ListBox(); - this.lboxInUse = new System.Windows.Forms.ListBox(); - this.lblAvail = new System.Windows.Forms.Label(); - this.lblInUse = new System.Windows.Forms.Label(); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.gbFields.SuspendLayout(); - this.SuspendLayout(); - // - // lblGroup - // - this.lblGroup.Location = new System.Drawing.Point(24, 0); - this.lblGroup.Name = "lblGroup"; - this.lblGroup.Size = new System.Drawing.Size(88, 16); - this.lblGroup.TabIndex = 0; - this.lblGroup.Text = "Group:"; - this.lblGroup.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // lblRetVal - // - this.lblRetVal.Location = new System.Drawing.Point(16, 32); - this.lblRetVal.Name = "lblRetVal"; - this.lblRetVal.Size = new System.Drawing.Size(96, 16); - this.lblRetVal.TabIndex = 1; - this.lblRetVal.Text = "Return Value:"; - this.lblRetVal.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // lblMenuVal - // - this.lblMenuVal.Location = new System.Drawing.Point(16, 64); - this.lblMenuVal.Name = "lblMenuVal"; - this.lblMenuVal.Size = new System.Drawing.Size(96, 16); - this.lblMenuVal.TabIndex = 2; - this.lblMenuVal.Text = "Menu Value:"; - this.lblMenuVal.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // tbRetVal - // - this.tbRetVal.Location = new System.Drawing.Point(120, 32); - this.tbRetVal.Name = "tbRetVal"; - this.tbRetVal.Size = new System.Drawing.Size(464, 22); - this.tbRetVal.TabIndex = 4; - this.tbRetVal.Text = "textBox1"; - // - // tbMenuVal - // - this.tbMenuVal.Location = new System.Drawing.Point(120, 64); - this.tbMenuVal.Name = "tbMenuVal"; - this.tbMenuVal.Size = new System.Drawing.Size(464, 22); - this.tbMenuVal.TabIndex = 5; - this.tbMenuVal.Text = "textBox1"; - // - // lblGroupText - // - this.lblGroupText.Location = new System.Drawing.Point(120, 0); - this.lblGroupText.Name = "lblGroupText"; - this.lblGroupText.Size = new System.Drawing.Size(464, 16); - this.lblGroupText.TabIndex = 7; - this.lblGroupText.Text = "label1"; - // - // gbFields - // - this.gbFields.Controls.AddRange(new System.Windows.Forms.Control[] { - this.btnNew, - this.btnRemove, - this.btnEdit, - this.btnAdd, - this.lboxAvail, - this.lboxInUse, - this.lblAvail, - this.lblInUse}); - this.gbFields.Location = new System.Drawing.Point(8, 112); - this.gbFields.Name = "gbFields"; - this.gbFields.Size = new System.Drawing.Size(704, 224); - this.gbFields.TabIndex = 8; - this.gbFields.TabStop = false; - this.gbFields.Text = "Fields"; - // - // btnNew - // - this.btnNew.Location = new System.Drawing.Point(608, 48); - this.btnNew.Name = "btnNew"; - this.btnNew.Size = new System.Drawing.Size(80, 24); - this.btnNew.TabIndex = 7; - this.btnNew.Text = "New..."; - this.btnNew.Click += new System.EventHandler(this.btnNew_Click); - // - // btnRemove - // - this.btnRemove.Enabled = false; - this.btnRemove.Location = new System.Drawing.Point(272, 144); - this.btnRemove.Name = "btnRemove"; - this.btnRemove.Size = new System.Drawing.Size(80, 24); - this.btnRemove.TabIndex = 6; - this.btnRemove.Text = "Remove>>"; - this.btnRemove.Click += new System.EventHandler(this.btnRemove_Click); - // - // btnEdit - // - this.btnEdit.Enabled = false; - this.btnEdit.Location = new System.Drawing.Point(272, 96); - this.btnEdit.Name = "btnEdit"; - this.btnEdit.Size = new System.Drawing.Size(80, 24); - this.btnEdit.TabIndex = 5; - this.btnEdit.Text = "Edit..."; - this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click); - // - // btnAdd - // - this.btnAdd.Enabled = false; - this.btnAdd.Location = new System.Drawing.Point(272, 48); - this.btnAdd.Name = "btnAdd"; - this.btnAdd.Size = new System.Drawing.Size(80, 24); - this.btnAdd.TabIndex = 4; - this.btnAdd.Text = "<< Add"; - this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click); - // - // lboxAvail - // - this.lboxAvail.ItemHeight = 14; - this.lboxAvail.Location = new System.Drawing.Point(376, 48); - this.lboxAvail.Name = "lboxAvail"; - this.lboxAvail.Size = new System.Drawing.Size(216, 144); - this.lboxAvail.TabIndex = 3; - // - // lboxInUse - // - this.lboxInUse.ItemHeight = 14; - this.lboxInUse.Location = new System.Drawing.Point(24, 48); - this.lboxInUse.Name = "lboxInUse"; - this.lboxInUse.Size = new System.Drawing.Size(216, 144); - this.lboxInUse.TabIndex = 2; - // - // lblAvail - // - this.lblAvail.Location = new System.Drawing.Point(384, 24); - this.lblAvail.Name = "lblAvail"; - this.lblAvail.Size = new System.Drawing.Size(80, 16); - this.lblAvail.TabIndex = 1; - this.lblAvail.Text = "Available:"; - // - // lblInUse - // - this.lblInUse.Location = new System.Drawing.Point(24, 24); - this.lblInUse.Name = "lblInUse"; - this.lblInUse.Size = new System.Drawing.Size(64, 16); - this.lblInUse.TabIndex = 0; - this.lblInUse.Text = "In Use:"; - // - // btnOK - // - this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnOK.Location = new System.Drawing.Point(512, 376); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(88, 24); - this.btnOK.TabIndex = 9; - this.btnOK.Text = "OK"; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(616, 376); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(80, 24); - this.btnCancel.TabIndex = 10; - this.btnCancel.Text = "Cancel"; - // - // RODefFrm - // - this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); - this.ClientSize = new System.Drawing.Size(792, 437); - this.Controls.AddRange(new System.Windows.Forms.Control[] { - this.btnCancel, - this.btnOK, - this.gbFields, - this.lblGroupText, - this.tbMenuVal, - this.tbRetVal, - this.lblMenuVal, - this.lblRetVal, - this.lblGroup}); - this.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.Name = "RODefFrm"; - this.Text = "Referenced Object Definition"; - this.gbFields.ResumeLayout(false); - this.ResumeLayout(false); - - } - #endregion - } -} diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/RODefFrm.resx b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/RODefFrm.resx deleted file mode 100644 index c87ed6c9..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/RODefFrm.resx +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - RODefFrm - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.cs deleted file mode 100644 index f3706f40..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.cs +++ /dev/null @@ -1,2577 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ROEditor.cs $ $Revision: 54 $ - * $Author: Kathy $ $Date: 7/20/04 2:15p $ - * - * $History: ROEditor.cs $ - * - * ***************** Version 54 ***************** - * User: Kathy Date: 7/20/04 Time: 2:15p - * Updated in $/EXE/RefObj/ROEditor - * B2004-021 improve duplicate error message - * - * ***************** Version 53 ***************** - * User: Kathy Date: 7/15/04 Time: 11:11a - * Updated in $/EXE/RefObj/ROEditor - * Fix B2004-017 - * - * ***************** Version 52 ***************** - * User: Jsj Date: 1/21/04 Time: 12:11p - * Updated in $/EXE/RefObj/ROEditor - * calls new function to get currently selected field type for multi type - * field - * - * ***************** Version 51 ***************** - * User: Jsj Date: 1/07/04 Time: 2:19p - * Updated in $/EXE/RefObj/ROEditor - * allow use of SQL Server - * - * ***************** Version 50 ***************** - * User: Kathy Date: 10/15/03 Time: 10:30a - * Updated in $/EXE/RefObj/ROEditor - * found/fixed as part of B2003-060 - will go thru QA process for that - * bug's fix - * - * ***************** Version 49 ***************** - * User: Jsj Date: 7/02/03 Time: 9:25a - * Updated in $/EXE/RefObj/ROEditor - * made messagebox calls modal by removing the parent window reference - * - * ***************** Version 48 ***************** - * User: Kathy Date: 5/30/03 Time: 12:48p - * Updated in $/EXE/RefObj/ROEditor - * B2003-044: sync up xml with UI tree view - * - * ***************** Version 47 ***************** - * User: Kathy Date: 5/21/03 Time: 12:52p - * Updated in $/EXE/RefObj/ROEditor - * B2003-034: if only one field for ro, wasn't always processing it. - * - * ***************** Version 46 ***************** - * User: Kathy Date: 5/07/03 Time: 1:59p - * Updated in $/EXE/RefObj/ROEditor - * B2003-033 fixed. - * - * ***************** Version 45 ***************** - * User: Jsj Date: 4/14/03 Time: 3:03p - * Updated in $/EXE/RefObj/ROEditor - * changes due to RO FST file creation speed up - * - * ***************** Version 44 ***************** - * User: Kathy Date: 3/26/03 Time: 2:20p - * Updated in $/EXE/RefObj/ROEditor - * speed up initial load - * - * ***************** Version 43 ***************** - * User: Kathy Date: 3/11/03 Time: 11:26a - * Updated in $/EXE/RefObj/ROEditor - * be sure tree isloaded for group def change - * - * ***************** Version 42 ***************** - * User: Kathy Date: 3/04/03 Time: 11:13a - * Updated in $/EXE/RefObj/ROEditor - * may be more than 1 new database for tree at a time - * - * ***************** Version 41 ***************** - * User: Kathy Date: 2/24/03 Time: 11:09a - * Updated in $/EXE/RefObj/ROEditor - * fixed new with implicit cancel bug (crash) - * - * ***************** Version 40 ***************** - * User: Jsj Date: 2/21/03 Time: 5:33p - * Updated in $/EXE/RefObj/ROEditor - * fixed RO | Save menu item enable/disable state - * - * ***************** Version 39 ***************** - * User: Kathy Date: 2/03/03 Time: 10:40a - * Updated in $/EXE/RefObj/ROEditor - * ui improve - * - * ***************** Version 38 ***************** - * User: Kathy Date: 1/22/03 Time: 12:18p - * Updated in $/EXE/RefObj/ROEditor - * duplicate/save as bug - * - * ***************** Version 37 ***************** - * User: Kathy Date: 1/15/03 Time: 1:57p - * Updated in $/EXE/RefObj/ROEditor - * improve UI - * - * ***************** Version 36 ***************** - * User: Jsj Date: 1/13/03 Time: 12:00p - * Updated in $/EXE/RefObj/ROEditor - * fixed call to data conversion - * - * ***************** Version 35 ***************** - * User: Kathy Date: 1/08/03 Time: 10:07a - * Updated in $/EXE/RefObj/ROEditor - * view image support - * - * ***************** Version 34 ***************** - * User: Kathy Date: 1/07/03 Time: 9:25a - * Updated in $/EXE/RefObj/ROEditor - * roeditor.own & specific ro (from vfw) - * - * ***************** Version 33 ***************** - * User: Jsj Date: 1/06/03 Time: 11:31a - * Updated in $/EXE/RefObj/ROEditor - * logic for No RO directory, Emply RO directroy, and RO directory with - * paradox database - * - * ***************** Version 32 ***************** - * User: Jsj Date: 1/02/03 Time: 3:57p - * Updated in $/EXE/RefObj/ROEditor - * added INI file logic - * - * ***************** Version 31 ***************** - * User: Kathy Date: 12/17/02 Time: 9:47a - * Updated in $/EXE/RefObj/ROEditor - * fix some duplicate/save as bugs - * - * ***************** Version 30 ***************** - * User: Kathy Date: 12/16/02 Time: 12:12p - * Updated in $/EXE/RefObj/ROEditor - * added cancel button & fixed some duplicate/saveas bugs - * - * ***************** Version 29 ***************** - * User: Kathy Date: 12/13/02 Time: 10:06a - * Updated in $/EXE/RefObj/ROEditor - * if 'cancel' from edit, was 'stuck' on that edit control - * - * ***************** Version 28 ***************** - * User: Kathy Date: 12/10/02 Time: 2:26p - * Updated in $/EXE/RefObj/ROEditor - * fieldname special chars & bug fixes - * - * ***************** Version 27 ***************** - * User: Jsj Date: 12/06/02 Time: 3:28p - * Updated in $/EXE/RefObj/ROEditor - * fix for parameter display data (ignoring the data for now) - * - * ***************** Version 26 ***************** - * User: Kathy Date: 12/06/02 Time: 11:59a - * Updated in $/EXE/RefObj/ROEditor - * improve tree view & fix minor menuing things - * - * ***************** Version 25 ***************** - * User: Kathy Date: 12/02/02 Time: 8:30a - * Updated in $/EXE/RefObj/ROEditor - * fieldname replace chars - * - * ***************** Version 24 ***************** - * User: Jsj Date: 11/27/02 Time: 12:54p - * Updated in $/EXE/RefObj/ROEditor - * Modification to create the RO.FST file - * - * ***************** Version 23 ***************** - * User: Kathy Date: 11/26/02 Time: 11:10a - * Updated in $/EXE/RefObj/ROEditor - * add icons, list view & improve sizing - * - * ***************** Version 22 ***************** - * User: Kathy Date: 11/20/02 Time: 1:29p - * Updated in $/EXE/RefObj/ROEditor - * selecting 'x' doesn't close it - fixed. - * - * ***************** Version 21 ***************** - * User: Kathy Date: 11/20/02 Time: 11:37a - * Updated in $/EXE/RefObj/ROEditor - * zoom btn & ask about save for mod data - * - * ***************** Version 20 ***************** - * User: Kathy Date: 11/19/02 Time: 11:30a - * Updated in $/EXE/RefObj/ROEditor - * Fix a variety of UI bugs - * - * ***************** Version 19 ***************** - * User: Kathy Date: 10/24/02 Time: 11:17a - * Updated in $/EXE/RefObj/ROEditor - * save as, duplicate and delete top group - * - * ***************** Version 18 ***************** - * User: Kathy Date: 10/15/02 Time: 2:19p - * Updated in $/EXE/RefObj/ROEditor - * added new hi-level group - * - * ***************** Version 17 ***************** - * User: Kathy Date: 10/11/02 Time: 11:37a - * Updated in $/EXE/RefObj/ROEditor - * Restore Btn, bug fixes - * - * ***************** Version 16 ***************** - * User: Kathy Date: 10/10/02 Time: 10:03a - * Updated in $/EXE/RefObj/ROEditor - * accessory page id & try to make xml tree in sync with tree control - * - * ***************** Version 15 ***************** - * User: Jsj Date: 10/03/02 Time: 4:53p - * Updated in $/EXE/RefObj/ROEditor - * got the Edit menus (cut,paste,etc) working - * - * ***************** Version 14 ***************** - * User: Jsj Date: 10/03/02 Time: 1:27p - * Updated in $/EXE/RefObj/ROEditor - * put back missing variables for tree nodes - * - * ***************** Version 13 ***************** - * User: Jsj Date: 10/02/02 Time: 5:46p - * Updated in $/EXE/RefObj/ROEditor - * added an Edit menu item to the popup and RO menus. Added logic to - * enable or disable the Save, Expand/Collaspe, and Properties menu items, - * added an About dialog box. Added logic to clear the edit pane. - * - * ***************** Version 12 ***************** - * User: Kathy Date: 10/02/02 Time: 2:43p - * Updated in $/EXE/RefObj/ROEditor - * more tying tree to data - * - * ***************** Version 11 ***************** - * User: Kathy Date: 10/02/02 Time: 1:39p - * Updated in $/EXE/RefObj/ROEditor - * insert/delete group/ro tie tree to code (round 1) - * - * ***************** Version 10 ***************** - * User: Jsj Date: 10/02/02 Time: 12:11p - * Updated in $/EXE/RefObj/ROEditor - * added Delete to popup, and added logic to right mouse button so that it - * selects the tree node and modifies the popup menu based on if that node - * is colasped or expanded. - * - * ***************** Version 9 ***************** - * User: Jsj Date: 10/01/02 Time: 4:50p - * Updated in $/EXE/RefObj/ROEditor - * added menus and ability to pass in a database path - * - * ***************** Version 8 ***************** - * User: Kathy Date: 9/27/02 Time: 1:20p - * Updated in $/EXE/RefObj/ROEditor - * fix minor problems with listing groups without ros - * - * ***************** Version 7 ***************** - * User: Kathy Date: 9/25/02 Time: 9:57a - * Updated in $/EXE/RefObj/ROEditor - * dev - * - * ***************** Version 6 ***************** - * User: Kathy Date: 9/19/02 Time: 10:04a - * Updated in $/EXE/RefObj/ROEditor - * minor changes during dev - * - * ***************** Version 5 ***************** - * User: Kathy Date: 9/11/02 Time: 1:16p - * Updated in $/EXE/RefObj/ROEditor - * vlnxml - * - * ***************** Version 4 ***************** - * User: Kathy Date: 9/10/02 Time: 12:55p - * Updated in $/EXE/RefObj/ROEditor - * menutitle attribute - * - * ***************** Version 3 ***************** - * User: Kathy Date: 9/05/02 Time: 12:41p - * Updated in $/EXE/RefObj/ROEditor - * dev - * - * ***************** Version 2 ***************** - * User: Kathy Date: 8/28/02 Time: 10:58a - * Updated in $/EXE/RefObj/ROEditor - * development - * - * ***************** Version 1 ***************** - * User: Jsj Date: 8/23/02 Time: 3:35p - * Created in $/EXE/RefObj/ROEditor - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Diagnostics; -using System.Windows.Forms; -using System.Data; -using System.Xml; -using System.Xml.Schema; -using System.Text; -using System.IO; -using ctlXMLEditLib; -using RODBInterface; -using ROFields; -using Org.Mentalis.Files; -//using IniFileIO; - - - -namespace ROEditor -{ - /// - /// Summary description for Form1. - /// - /// - - public class Form1 : System.Windows.Forms.Form - { - private ctlXMLEditLib.ctlXMLEdit ctlXMLEdit2; - private RODB myrodb; - private string DbConnectPath; - private System.ComponentModel.IContainer components; - private System.Windows.Forms.Splitter splitter1; - private System.Windows.Forms.MainMenu mainMenu1; - private System.Windows.Forms.MenuItem menuItem10; - private System.Windows.Forms.MenuItem menuNewGroup; - private System.Windows.Forms.MenuItem menuEdit; - private System.Windows.Forms.MenuItem menuEditCopy; - private System.Windows.Forms.MenuItem menuEditCut; - private System.Windows.Forms.MenuItem menuEditPaste; - private System.Windows.Forms.MenuItem menuTools; - private System.Windows.Forms.MenuItem menuToolsROFST; - private System.Windows.Forms.MenuItem menuHelp; - private System.Windows.Forms.MenuItem menuHelpAbout; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.MenuItem menuRO; - private System.Windows.Forms.MenuItem menuRONew; - private System.Windows.Forms.MenuItem menuNewRefObj; - private System.Windows.Forms.MenuItem menuROEdit; - private System.Windows.Forms.MenuItem menuRODelete; - private System.Windows.Forms.MenuItem menuROSave; - private System.Windows.Forms.MenuItem menuROProperties; - private System.Windows.Forms.MenuItem menuROExit; - private System.Windows.Forms.MenuItem menuItem1; - - private XmlDocument myroXmlDoc; - private VlnXmlElement newone; - private TreeNode TreeNewparent; - private System.Windows.Forms.MenuItem menuItem3; - private System.Windows.Forms.MenuItem menuItem5; - private System.Windows.Forms.MenuItem menuEditUndo; - private System.Windows.Forms.MenuItem menuEditDelete; - private System.Windows.Forms.MenuItem menuEditSelAll; - private TreeNode LastSelectedNode; - private TextBox CurrentTextBox; // currently selected TextBox field - private VlnXmlElement rootXml; - private TreeNode rootNode; - - private System.Windows.Forms.ImageList imageListRoTree; - private System.Windows.Forms.TreeView roTreeView; - private System.Windows.Forms.ListView roListView; - private System.Windows.Forms.ToolBar tbar; - private bool duplicate_active; - - private const int ROGROUPIMAGE = 0; - private System.Windows.Forms.Panel panel2; - private const int ROIMAGE = 1; - - private ToolBarButton tbtnSave; - private ToolBarButton tbtnRestore; - private ToolBarButton tbtnCancel; - private ToolBarButton tbtnSaveAs; - private ToolBarButton tbtnDuplicate; - private System.Windows.Forms.MenuItem menuItem2; - private System.Windows.Forms.ImageList imageListToolBar; - private ToolBarButton tbtnZoom; - - public Form1(string PassedInPath, string specificro) - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - // The data path the was passed in. - DbConnectPath = PassedInPath; - - // Setup the context menu - MenuItem[] ContextMenuItemList = new MenuItem[6]; - ContextMenuItemList[0] = new MenuItem("Expand/Collaspe",new EventHandler(roTreeView_ToggleExpandCollapse)); - ContextMenuItemList[1] = menuRONew.CloneMenu(); - ContextMenuItemList[2] = menuROEdit.CloneMenu(); - ContextMenuItemList[3] = menuRODelete.CloneMenu(); - ContextMenuItemList[4] = menuROSave.CloneMenu(); - ContextMenuItemList[5] = menuROProperties.CloneMenu(); - - ContextMenu treePopupMenu = new ContextMenu(ContextMenuItemList); - - // Add the root to the tree. - myrodb = new RODB(DbConnectPath); - myroXmlDoc = myrodb.RODB_GetRoot(); - rootXml = (VlnXmlElement) myroXmlDoc.FirstChild; - rootNode = new TreeNode("Referenced Objects",ROGROUPIMAGE,ROGROUPIMAGE); - rootNode.Tag = rootXml; - roTreeView.Nodes.Add(rootNode); - roTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.roTreeView_AfterSelect); - roTreeView.DoubleClick += new System.EventHandler(this.roTreeView_OnDoubleClick); - roTreeView.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.roTreeView_BeforeExpand); - roTreeView.Sorted = true; - roTreeView.ContextMenu = treePopupMenu; - roTreeView.MouseDown += new System.Windows.Forms.MouseEventHandler(roTreeView_OnMouseDown); - - // For each group, get its subgroup. - bool success = myrodb.RODB_GetRootGroups((VlnXmlElement)myroXmlDoc.FirstChild); - if (success == false) this.Close(); - VlnXmlElement group = (VlnXmlElement) myroXmlDoc.FirstChild.FirstChild; - while (group != null) - { - // Add the top groups to tree control as a node. - TreeNode grnode = new TreeNode(CvtFldToUserFld(group.InnerText),ROGROUPIMAGE,ROGROUPIMAGE); - grnode.Tag = group; - rootNode.Nodes.Add(grnode); - string haskids = group.GetAttribute("HasChild"); - - if (haskids == "True") // add a 'dummy' node to tree if there are any - { - TreeNode subch = new TreeNode("VLN_DUMMY_FOR_TREE"); - subch.Tag = group; - grnode.Nodes.Add(subch); - } - group = (VlnXmlElement) group.NextSibling; - } - newone = null; - rootNode.Expand(); - duplicate_active = false; - if (specificro != null) DoSpecificRO(specificro); - } - - private void DoSpecificRO(string specificro) - { - // if a specific RO was passed in. Load the xml tree from it to the root & then - // edit it through the ctlXmledit. - // from the input tbl string, get a table name. - - ArrayList levelRecids = new ArrayList(); - int itbl = System.Convert.ToInt32(specificro.Substring(0,4),16); - string stbl = System.Convert.ToString(itbl,10); - string pstbl = stbl.PadLeft(6,'0'); - string tbname = "RO" + pstbl; - string recid = specificro.Substring(4,8); - - // read in this element from the table. - VlnXmlElement spro; - spro = myrodb.RODB_ReadRO(tbname, recid); - - VlnXmlElement parent; - string parentid; - parentid = spro.GetAttribute("ParentID"); - string sproParentid = parentid; - - // walk up tree to get the path through the tree. - VlnXmlElement child = spro; - while (parentid != null && parentid != "00000000") - { - parent = myrodb.RODB_ReadRO(tbname, parentid); - if (parent != null) - { - parentid = parent.GetAttribute("ParentID"); - levelRecids.Add(parent.GetAttribute("RecID")); - if (parentid == "00000000") break; - parent.AppendChild(child); - child = parent; - } - else - parentid = null; - } - - // Now hook this into the top part of tree by loading data into - // xml & hooking it into the tree control. - string attrele; - string attrspro; - TreeNode trnd = rootNode.FirstNode; - VlnXmlElement ele; - for (int i=levelRecids.Count-1; i>=0; i--) - { - ele = (VlnXmlElement) trnd.Tag; - attrele = ele.GetAttribute((i==levelRecids.Count-1)?"Table":"RecID"); - if (i==levelRecids.Count-1) - attrspro = spro.GetAttribute("Table"); - else - attrspro = (string) levelRecids[i]; - while (attrele != attrspro) - { - // get next one. - trnd = trnd.NextNode; - ele = (VlnXmlElement) trnd.Tag; - attrele = ele.GetAttribute((i==levelRecids.Count-1)?"Table":"RecID"); - } - if (trnd == null) - { - MessageBox.Show("Error editting RO"); - return; - } - LoadKids(trnd); - trnd = trnd.FirstNode; - } - // lastly select the active node, this will load up everything we need. - if (trnd == null) - { - MessageBox.Show("Error editting RO"); - return; - } - ele = (VlnXmlElement) trnd.Tag; - attrele = ele.GetAttribute("RecID"); - while (attrele != spro.GetAttribute("RecID")) - { - trnd = trnd.NextNode; - ele = (VlnXmlElement) trnd.Tag; - attrele = ele.GetAttribute("RecID"); - } - if (trnd == null) - { - MessageBox.Show("Error editting RO"); - return; - } - roTreeView.SelectedNode = trnd; - - } - - protected void roTreeView_AfterSelect (object sender, - System.Windows.Forms.TreeViewEventArgs e) - { - // if the same node was selected, don't do anything. - if (LastSelectedNode != null && LastSelectedNode.Equals(roTreeView.SelectedNode)) return; - - TreeNode CurrentNode = roTreeView.SelectedNode; - if (LastSelectedNode == null) - LastSelectedNode = CurrentNode; - if (CurrentNode != null) - { - if (!LastSelectedNode.Equals(CurrentNode)) - { - int retval = roTreeView_ClearEditDisplay(false); - if (retval == -1) // cancel - { - roTreeView.SelectedNode = LastSelectedNode; - - return; - } - LastSelectedNode = CurrentNode; - } - - // if selected to make new, but didn't add any data, remove it. - if (newone!=null) - { - XmlNode parent = newone.ParentNode; - parent.RemoveChild(newone); - newone=null; - } - - /* enable/disable menu items */ - - // Enable the Save item if changes were made - // Just copy the state of the Save Button - menuROSave.Enabled = tbtnSave.Enabled; - roTreeView.ContextMenu.MenuItems[4].Enabled = tbtnSave.Enabled; - - // Should the properties menu item be available? - VlnXmlElement curelem = (VlnXmlElement) CurrentNode.Tag; - if (curelem.Name == "vlnGroup") - menuROProperties.Enabled = true; - else - menuROProperties.Enabled = false; - - // Should the delete menu item be available, i.e. at top node, NO! - if (curelem.Name == "RO_Root") - { - menuRODelete.Enabled = false; - menuNewRefObj.Enabled = false; - } - else - { - menuRODelete.Enabled = true; - menuNewRefObj.Enabled = true; - } - - // Is there field text to edit? - // yes if current node is either a subgroup or ro value node - menuROEdit.Enabled = roTreeView_IsSubgroupOrRO(); - LoadKids(CurrentNode); - if (curelem.Name != "RO_Root" && curelem.Name != "vlnGroup") - EditRO(curelem); - else - updateRoListView(CurrentNode); - } - } - - private string CvtUserFldToFld(string fldname) - { - if (fldname.Length < 2) - return fldname; - // a digit cannot start an xml fieldname, prepend a "__" to it. - string tmp0; - if (char.IsDigit(fldname,0)) - tmp0 = "__" + fldname; - else - tmp0 = fldname; - // an xml fieldname cannot have a space, change it to a "__" - string tmpstr = tmp0.Replace(" ","__"); - int len = tmpstr.Length; - int cnt = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval; - - while (cnt < len) - { - char tmpchr = tmpstr[cnt]; - if(!char.IsLetterOrDigit(tmpchr)&& (OKpunch.IndexOf(tmpchr) == -1) ) - { - decval = tmpchr; - outstr += OKpunch + decval.ToString("D3"); - } - else - { - outstr += tmpchr.ToString(); - } - cnt++; - } - return outstr; - } - - private string CvtFldToUserFld(string fldname) - { - string tmpstr0; - if (fldname.Length < 2) return fldname; - // an xml element name cannot begin with a digit. we had prepended a "__" - if (fldname.Substring(0,2) == "__" && char.IsDigit(fldname,2)) - tmpstr0 = fldname.Substring(2,fldname.Length-2); - else - tmpstr0 = fldname; - // an xml element name cannot have a space, we converted to a "__" - string tmpstr = tmpstr0.Replace("__"," "); - int len = tmpstr.Length; - int cur = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval, indx; - if (tmpstr.Length <6) - indx = -1; - else - indx=tmpstr.IndexOf(OKpunch,cur); - string asc_spchar; - while (indx>=0) - { - outstr += tmpstr.Substring(cur,indx-cur); - asc_spchar = tmpstr.Substring(indx+3,3); - decval = System.Convert.ToInt16(asc_spchar,10); - outstr += System.Convert.ToChar(decval).ToString(); - cur = indx+6; - if (cur+6 > len) - indx = -1; - else - indx = tmpstr.IndexOf(OKpunch,cur); - } - if (cur 0) - { - if (CurrentNode.IsExpanded) - roTreeView.ContextMenu.MenuItems[0].Text = "Collapse"; - else - roTreeView.ContextMenu.MenuItems[0].Text = "Expand"; - roTreeView.ContextMenu.MenuItems[0].Enabled = true; - } - else - { - roTreeView.ContextMenu.MenuItems[0].Text = "Expand/Collapse"; - roTreeView.ContextMenu.MenuItems[0].Enabled = false; - } - - - // Should the save option be available? - // Just reflect the Save button state. - roTreeView.ContextMenu.MenuItems[4].Enabled = tbtnSave.Enabled; - menuROSave.Enabled = tbtnSave.Enabled; - - // Should the properties menu item be available? - VlnXmlElement curelem = (VlnXmlElement) CurrentNode.Tag; - if (curelem.Name == "vlnGroup") - roTreeView.ContextMenu.MenuItems[5].Enabled = true; - else - roTreeView.ContextMenu.MenuItems[5].Enabled = false; - - // should delete menu item be available, i.e. top node NO! - if (curelem.Name == "RO_Root") - { - roTreeView.ContextMenu.MenuItems[3].Enabled = false; - roTreeView.ContextMenu.MenuItems[1].MenuItems[1].Enabled = false; - } - else - { - roTreeView.ContextMenu.MenuItems[3].Enabled = true; - roTreeView.ContextMenu.MenuItems[1].MenuItems[1].Enabled = true; - } - - // Is there field text to edit? - // yes if current node is either a subgroup or ro value node - roTreeView.ContextMenu.MenuItems[2].Enabled = roTreeView_IsSubgroupOrRO(); - } - } - } - - /* - * return true if current tree node is a either a subgroup or a RO - */ - protected bool roTreeView_IsSubgroupOrRO() - { - bool rtnval = false; - TreeNode CurrentNode = roTreeView.SelectedNode; - VlnXmlElement curelem = (VlnXmlElement) CurrentNode.Tag; - if (curelem.Name != "RO_Root") - { - if (curelem.Name == "vlnGroup") - { - TreeNode PNode = CurrentNode.Parent; - VlnXmlElement pelem = (VlnXmlElement) PNode.Tag; - rtnval = (pelem.Name == "vlnGroup"); - } - else - rtnval = true; - } - return rtnval; - } - /* - * Clear the edit display (panel on the right side) - */ - protected int roTreeView_ClearEditDisplay(bool cancel) - { - if (ctlXMLEdit2 != null) - { - if (cancel != true) - { - // first see if there is changes to data, if so, then prompt to see if - // user wants to continue. - bool chgdata = ctlXMLEdit2.DataChanged(); - if (chgdata == true) - { - DialogResult dr = MessageBox.Show("Do you want to save your changes?","Warning:",MessageBoxButtons.YesNoCancel); - if (dr == DialogResult.Yes) - { - TreeNode tr=null; - bool ok = SaveRO(ref tr); // savero needs a tree node - if (ok == false) return -1; - } - else if (dr == DialogResult.Cancel) - return -1; - } - } - ctlXMLEdit2.Dispose(); - this.panel2.Controls.Remove(ctlXMLEdit2); - this.panel2.Visible = false; - tbtnSave.Enabled = false; - menuROSave.Enabled = tbtnSave.Enabled; - tbtnRestore.Enabled = false; - tbtnSaveAs.Enabled = false; - tbtnDuplicate.Enabled = false; - tbtnZoom.Enabled = false; - tbtnZoom.Text = "Zoom"; - ctlXMLEdit2 = null; - } - // The current text box no longer has focus. - CurrentTextBox = null; - tbtnCancel.Enabled = false; - roTreeView_ResetEditMenu(); - duplicate_active = false; - return 0; - } - - protected void roListView_ClearListDisplay() - { - if (roListView != null) - { - roListView.Dispose(); - this.panel1.Controls.Remove(roListView); - roListView=null; - } - } - - private void CreateCtlXmlEdit2(VlnXmlElement curelem, XmlSchema myschema, ArrayList reqfields) - { - ctlXMLEdit2 = new ctlXMLEditLib.ctlXMLEdit(curelem,myschema,reqfields); - ctlXMLEdit2.AutoScroll = true; - ctlXMLEdit2.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - ctlXMLEdit2.Name = "ctlXMLEdit2"; - ctlXMLEdit2.Size = new System.Drawing.Size(ctlXMLEdit2.GetMaxWidth(),ctlXMLEdit2.GetMaxLength()); - this.panel2.Visible = true; - this.panel2.Size = new System.Drawing.Size(ctlXMLEdit2.GetMaxWidth()+20,ctlXMLEdit2.GetMaxLength()+10); - this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - ctlXMLEdit2.TabIndex = 4; - ctlXMLEdit2.Tag = ""; - /* - * Spin through all of the controls and assign an event handler - * for changed text so that when the user changes any of the RO Text, - * the Save button will become enabled - */ - System.Collections.IEnumerator ctlEnumerator = ctlXMLEdit2.Controls.GetEnumerator(); - while (ctlEnumerator.MoveNext()) - { - Control TmpInfo; - TmpInfo = (Control)ctlEnumerator.Current; - if (TmpInfo is GroupBox) - { - System.Collections.IEnumerator ctlGroup = TmpInfo.Controls.GetEnumerator();; - while(ctlGroup.MoveNext()) - { - Control tmpradio = (Control) ctlGroup.Current; - tmpradio.Click += new EventHandler(ctlXMLEdit2_ClickControl); - } - } - else - { - TmpInfo.TextChanged += new EventHandler(ctlXMLEdit2_TextChanged); - TmpInfo.Click += new EventHandler(ctlXMLEdit2_ClickControl); - } - } - this.panel2.Controls.Add(ctlXMLEdit2); - tbtnCancel.Enabled = true; - } - - private void EditRO(VlnXmlElement curelem) - { - newone=null; - // can't edit fields for top or top group nodes (top node not editable, - // and top group node data change at properties level). - if (curelem.Name == "RO_Root" || curelem.ParentNode.Name == "RO_Root") return; - - int retval = roTreeView_ClearEditDisplay(false); - if (retval == -1) return; - roListView_ClearListDisplay(); - - XmlSchema myschema; - // If no schema exists, then the definition of the item may not be complete - give - // a message. (B2004-017) - if (curelem.Name != "vlnGroup") - { - myschema = myrodb.RODB_GetSchema(curelem); - if (myschema==null) - { - MessageBox.Show("RO Definition does not exist, check RO Definition under Properties for the Group that contains this RO."); - return; - } - } - else - { - myschema = myrodb.RODB_GetGroupSchema(curelem); - if (myschema==null) - { - MessageBox.Show("Subgroup Definition does not exist, check Subgroup Definition under Properties for the Group that contains this Subgroup."); - return; - } - } - - ArrayList reqfields = curelem.GetRequiredFields(); - CreateCtlXmlEdit2(curelem,myschema,reqfields); - this.panel2.Controls.Add(ctlXMLEdit2); - tbtnSave.Enabled=false; // set initial states of buttons on edit - tbtnRestore.Enabled=false; - tbtnCancel.Enabled=true; - tbtnSaveAs.Enabled=false; - tbtnDuplicate.Enabled=true; - tbtnZoom.Enabled = false; - ctlXMLEdit2.Focus(); - } - protected void roTreeView_OnDoubleClick (object sender, System.EventArgs e) - { - VlnXmlElement curelem = (VlnXmlElement) roTreeView.SelectedNode.Tag; - EditRO(curelem); - } - - protected void roTreeView_ResetEditMenu () - { - this.menuEditCopy.Enabled = false; - this.menuEditCut.Enabled = false; - this.menuEditPaste.Enabled = false; - this.menuEditDelete.Enabled = false; - this.menuEditSelAll.Enabled = false; - this.menuEditUndo.Enabled = false; - } - - - protected void ctlXMLEdit2_ClickControl(object sender, EventArgs e) - { - TextBox tmpTxtbx = new TextBox(); - CurrentTextBox = null; - - roTreeView_ResetEditMenu(); - - if (sender.GetType() == tmpTxtbx.GetType()) - { - tmpTxtbx = (TextBox)sender; - CurrentTextBox = tmpTxtbx; // the text box currently selected - - if (CurrentTextBox.Multiline) - { - tbtnZoom.Text = "Zoom"; - tbtnZoom.Enabled = true; - } - else if (CurrentTextBox == ctlXMLEdit2.GetGraphicsFiletextbox() && CurrentTextBox.Text != null && CurrentTextBox.Text != "") - { - tbtnZoom.Enabled = true; - tbtnZoom.Text = "View Image"; - } - else - { - tbtnZoom.Text = "Zoom"; - tbtnZoom.Enabled = false; - } - - if (tmpTxtbx.CanUndo) - this.menuEditUndo.Enabled = true; - - if (tmpTxtbx.TextLength != tmpTxtbx.SelectionLength) - { - this.menuEditSelAll.Enabled = true; - } - - if (tmpTxtbx.SelectionLength > 0) - { - this.menuEditDelete.Enabled = true; - this.menuEditCopy.Enabled = true; - this.menuEditCut.Enabled = true; - } - object dataobj = System.Windows.Forms.Clipboard.GetDataObject(); - if (dataobj != null) - this.menuEditPaste.Enabled=true; - } - else if (sender is RadioButton) - { - tbtnCancel.Enabled = true; - tbtnSave.Enabled = true; - tbtnRestore.Enabled = true; - tbtnSaveAs.Enabled = true; - } - menuROSave.Enabled = tbtnSave.Enabled; - } - - - protected void ctlXMLEdit2_TextChanged(object sender, EventArgs e) - { - if (CurrentTextBox != null) - { - this.menuEditUndo.Enabled = true; - this.menuEditSelAll.Enabled = (CurrentTextBox.TextLength > 0); - } - - tbtnSave.Enabled = true; - tbtnRestore.Enabled = true; - tbtnSaveAs.Enabled = true; - tbtnCancel.Enabled = true; - menuROSave.Enabled = tbtnSave.Enabled; - } - - private void LoadKids(TreeNode enode) - { - VlnXmlElement elem; - elem = (VlnXmlElement)enode.Tag; - string haskids; - string kidsloaded; - haskids = elem.GetAttribute("HasChild"); - kidsloaded = elem.GetAttribute("ChildLoaded"); - if (haskids == "True" && kidsloaded == "False" ) - { - // if there's a dummy tree node (used to have tree control expansion for - // items not yet loaded, delete child in tree control) - XmlNode tmpnode = (XmlNode) elem; - XmlNode chldnode; - VlnXmlElement echild; - if (enode.FirstNode.Text == "VLN_DUMMY_FOR_TREE") enode.FirstNode.Remove(); - Cursor.Current = Cursors.WaitCursor; - myrodb.RODB_GetChildData(elem,true); - chldnode = tmpnode.FirstChild; - while (chldnode != null) - { - if (chldnode is VlnXmlElement) - { - echild = (VlnXmlElement) chldnode; - TreeNode chldnd; - if (echild.Name == "vlnGroup") - { - chldnd = new TreeNode(echild.GetAttribute("MenuTitle"),ROGROUPIMAGE,ROGROUPIMAGE); - chldnd.Tag = echild; - enode.Nodes.Add(chldnd); - // add a 'dummy' node to tree if there are any children - string haskids1="False"; - string kidsloaded1="False"; - if (echild.HasAttribute("HasChild")==true) - haskids1 = echild.GetAttribute("HasChild"); - if (echild.HasAttribute("ChildLoaded")==true) - kidsloaded1 = echild.GetAttribute("ChildLoaded"); - if (haskids1=="True" && kidsloaded1=="False") - { - TreeNode subch = new TreeNode("VLN_DUMMY_FOR_TREE"); - chldnd.Nodes.Add(subch); - } - } - else - { - // If this is a group defintion subtree it will only have one - // child, which is the text definition for the subgroup. Don't - // include these in the tree. - int levelcnt = chldnode.ChildNodes.Count; - string TheMenuTitle = echild.GetAttribute("MenuTitle"); - if (levelcnt>=1 && !TheMenuTitle.Equals("")) - { - chldnd = new TreeNode(TheMenuTitle,ROIMAGE,ROIMAGE); - chldnd.Tag = echild; - enode.Nodes.Add(chldnd); - } - } - } - chldnode = chldnode.NextSibling; - } - Cursor.Current = Cursors.Default; - } - } - - protected void roTreeView_BeforeExpand(object sender, - System.Windows.Forms.TreeViewCancelEventArgs e) - { - LoadKids(e.Node); - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the co`de editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); - this.imageListRoTree = new System.Windows.Forms.ImageList(this.components); - this.splitter1 = new System.Windows.Forms.Splitter(); - this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components); - this.menuRO = new System.Windows.Forms.MenuItem(); - this.menuRONew = new System.Windows.Forms.MenuItem(); - this.menuNewGroup = new System.Windows.Forms.MenuItem(); - this.menuNewRefObj = new System.Windows.Forms.MenuItem(); - this.menuItem1 = new System.Windows.Forms.MenuItem(); - this.menuROEdit = new System.Windows.Forms.MenuItem(); - this.menuRODelete = new System.Windows.Forms.MenuItem(); - this.menuROSave = new System.Windows.Forms.MenuItem(); - this.menuROProperties = new System.Windows.Forms.MenuItem(); - this.menuItem10 = new System.Windows.Forms.MenuItem(); - this.menuROExit = new System.Windows.Forms.MenuItem(); - this.menuEdit = new System.Windows.Forms.MenuItem(); - this.menuEditUndo = new System.Windows.Forms.MenuItem(); - this.menuItem3 = new System.Windows.Forms.MenuItem(); - this.menuEditCut = new System.Windows.Forms.MenuItem(); - this.menuEditCopy = new System.Windows.Forms.MenuItem(); - this.menuEditPaste = new System.Windows.Forms.MenuItem(); - this.menuEditDelete = new System.Windows.Forms.MenuItem(); - this.menuItem5 = new System.Windows.Forms.MenuItem(); - this.menuEditSelAll = new System.Windows.Forms.MenuItem(); - this.menuTools = new System.Windows.Forms.MenuItem(); - this.menuToolsROFST = new System.Windows.Forms.MenuItem(); - this.menuHelp = new System.Windows.Forms.MenuItem(); - this.menuHelpAbout = new System.Windows.Forms.MenuItem(); - this.menuItem2 = new System.Windows.Forms.MenuItem(); - this.panel1 = new System.Windows.Forms.Panel(); - this.panel2 = new System.Windows.Forms.Panel(); - this.roTreeView = new System.Windows.Forms.TreeView(); - this.tbar = new System.Windows.Forms.ToolBar(); - this.tbtnSave = new System.Windows.Forms.ToolBarButton(); - this.tbtnCancel = new System.Windows.Forms.ToolBarButton(); - this.tbtnRestore = new System.Windows.Forms.ToolBarButton(); - this.tbtnSaveAs = new System.Windows.Forms.ToolBarButton(); - this.tbtnDuplicate = new System.Windows.Forms.ToolBarButton(); - this.tbtnZoom = new System.Windows.Forms.ToolBarButton(); - this.imageListToolBar = new System.Windows.Forms.ImageList(this.components); - this.panel1.SuspendLayout(); - this.SuspendLayout(); - // - // imageListRoTree - // - this.imageListRoTree.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListRoTree.ImageStream"))); - this.imageListRoTree.TransparentColor = System.Drawing.Color.Transparent; - this.imageListRoTree.Images.SetKeyName(0, ""); - this.imageListRoTree.Images.SetKeyName(1, ""); - // - // splitter1 - // - this.splitter1.Location = new System.Drawing.Point(264, 31); - this.splitter1.Name = "splitter1"; - this.splitter1.Size = new System.Drawing.Size(10, 588); - this.splitter1.TabIndex = 4; - this.splitter1.TabStop = false; - // - // mainMenu1 - // - this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuRO, - this.menuEdit, - this.menuTools, - this.menuHelp, - this.menuItem2}); - // - // menuRO - // - this.menuRO.Index = 0; - this.menuRO.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuRONew, - this.menuItem1, - this.menuROEdit, - this.menuRODelete, - this.menuROSave, - this.menuROProperties, - this.menuItem10, - this.menuROExit}); - this.menuRO.Text = "RO"; - // - // menuRONew - // - this.menuRONew.Index = 0; - this.menuRONew.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuNewGroup, - this.menuNewRefObj}); - this.menuRONew.Text = "New ..."; - // - // menuNewGroup - // - this.menuNewGroup.Index = 0; - this.menuNewGroup.Text = "Group"; - this.menuNewGroup.Click += new System.EventHandler(this.menuNewGroup_Click); - // - // menuNewRefObj - // - this.menuNewRefObj.Index = 1; - this.menuNewRefObj.Text = "Referenced Object"; - this.menuNewRefObj.Click += new System.EventHandler(this.menuNewRefObj_Click); - // - // menuItem1 - // - this.menuItem1.Index = 1; - this.menuItem1.Text = "-"; - // - // menuROEdit - // - this.menuROEdit.Enabled = false; - this.menuROEdit.Index = 2; - this.menuROEdit.Text = "Edit"; - this.menuROEdit.Click += new System.EventHandler(this.menuROEdit_Click); - // - // menuRODelete - // - this.menuRODelete.Index = 3; - this.menuRODelete.Text = "Delete"; - this.menuRODelete.Click += new System.EventHandler(this.menuRODelete_Click); - // - // menuROSave - // - this.menuROSave.Enabled = false; - this.menuROSave.Index = 4; - this.menuROSave.Text = "Save"; - this.menuROSave.Click += new System.EventHandler(this.menuROSave_Click); - // - // menuROProperties - // - this.menuROProperties.Index = 5; - this.menuROProperties.Text = "Properties"; - this.menuROProperties.Click += new System.EventHandler(this.menuROProperties_Click); - // - // menuItem10 - // - this.menuItem10.Index = 6; - this.menuItem10.Text = "-"; - // - // menuROExit - // - this.menuROExit.Index = 7; - this.menuROExit.Text = "Exit RO Editor"; - this.menuROExit.Click += new System.EventHandler(this.menuROExit_Click); - // - // menuEdit - // - this.menuEdit.Index = 1; - this.menuEdit.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuEditUndo, - this.menuItem3, - this.menuEditCut, - this.menuEditCopy, - this.menuEditPaste, - this.menuEditDelete, - this.menuItem5, - this.menuEditSelAll}); - this.menuEdit.Text = "Edit"; - // - // menuEditUndo - // - this.menuEditUndo.Enabled = false; - this.menuEditUndo.Index = 0; - this.menuEditUndo.Text = "&Undo"; - this.menuEditUndo.Click += new System.EventHandler(this.menuEditUndo_Click); - // - // menuItem3 - // - this.menuItem3.Index = 1; - this.menuItem3.Text = "-"; - // - // menuEditCut - // - this.menuEditCut.Enabled = false; - this.menuEditCut.Index = 2; - this.menuEditCut.Text = "Cu&t"; - this.menuEditCut.Click += new System.EventHandler(this.menuEditCut_Click); - // - // menuEditCopy - // - this.menuEditCopy.Enabled = false; - this.menuEditCopy.Index = 3; - this.menuEditCopy.Text = "&Copy"; - this.menuEditCopy.Click += new System.EventHandler(this.menuEditCopy_Click); - // - // menuEditPaste - // - this.menuEditPaste.Enabled = false; - this.menuEditPaste.Index = 4; - this.menuEditPaste.Text = "&Paste"; - this.menuEditPaste.Click += new System.EventHandler(this.menuEditPaste_Click); - // - // menuEditDelete - // - this.menuEditDelete.Enabled = false; - this.menuEditDelete.Index = 5; - this.menuEditDelete.Text = "&Delete"; - this.menuEditDelete.Click += new System.EventHandler(this.menuEditDelete_Click); - // - // menuItem5 - // - this.menuItem5.Index = 6; - this.menuItem5.Text = "-"; - // - // menuEditSelAll - // - this.menuEditSelAll.Enabled = false; - this.menuEditSelAll.Index = 7; - this.menuEditSelAll.Text = "Select &All"; - this.menuEditSelAll.Click += new System.EventHandler(this.menuEditSelAll_Click); - // - // menuTools - // - this.menuTools.Index = 2; - this.menuTools.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuToolsROFST}); - this.menuTools.Text = "Tools"; - // - // menuToolsROFST - // - this.menuToolsROFST.Index = 0; - this.menuToolsROFST.Text = "Create RO.FST"; - this.menuToolsROFST.Click += new System.EventHandler(this.menuToolsROFST_Click); - // - // menuHelp - // - this.menuHelp.Index = 3; - this.menuHelp.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuHelpAbout}); - this.menuHelp.Text = "Help"; - // - // menuHelpAbout - // - this.menuHelpAbout.Index = 0; - this.menuHelpAbout.Text = "About"; - this.menuHelpAbout.Click += new System.EventHandler(this.menuHelpAbout_Click); - // - // menuItem2 - // - this.menuItem2.Index = 4; - this.menuItem2.Text = ""; - // - // panel1 - // - this.panel1.AutoScroll = true; - this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.panel1.Controls.Add(this.panel2); - this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel1.Location = new System.Drawing.Point(274, 31); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(542, 588); - this.panel1.TabIndex = 5; - // - // panel2 - // - this.panel2.AutoScroll = true; - this.panel2.Location = new System.Drawing.Point(0, 0); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(282, 136); - this.panel2.TabIndex = 0; - this.panel2.Visible = false; - // - // roTreeView - // - this.roTreeView.Dock = System.Windows.Forms.DockStyle.Left; - this.roTreeView.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.roTreeView.ImageIndex = 0; - this.roTreeView.ImageList = this.imageListRoTree; - this.roTreeView.ItemHeight = 18; - this.roTreeView.Location = new System.Drawing.Point(0, 31); - this.roTreeView.Name = "roTreeView"; - this.roTreeView.SelectedImageIndex = 0; - this.roTreeView.Size = new System.Drawing.Size(264, 588); - this.roTreeView.TabIndex = 3; - this.roTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.roTreeView_AfterSelect_1); - // - // tbar - // - this.tbar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] { - this.tbtnSave, - this.tbtnCancel, - this.tbtnRestore, - this.tbtnSaveAs, - this.tbtnDuplicate, - this.tbtnZoom}); - this.tbar.DropDownArrows = true; - this.tbar.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tbar.ImageList = this.imageListToolBar; - this.tbar.Location = new System.Drawing.Point(0, 0); - this.tbar.Name = "tbar"; - this.tbar.ShowToolTips = true; - this.tbar.Size = new System.Drawing.Size(816, 31); - this.tbar.TabIndex = 0; - this.tbar.TextAlign = System.Windows.Forms.ToolBarTextAlign.Right; - this.tbar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tbar_OnClick); - // - // tbtnSave - // - this.tbtnSave.Enabled = false; - this.tbtnSave.ImageIndex = 0; - this.tbtnSave.Name = "tbtnSave"; - this.tbtnSave.Text = "Save"; - // - // tbtnCancel - // - this.tbtnCancel.Enabled = false; - this.tbtnCancel.ImageIndex = 1; - this.tbtnCancel.Name = "tbtnCancel"; - this.tbtnCancel.Text = "Cancel"; - // - // tbtnRestore - // - this.tbtnRestore.Enabled = false; - this.tbtnRestore.ImageIndex = 2; - this.tbtnRestore.Name = "tbtnRestore"; - this.tbtnRestore.Text = "Restore"; - // - // tbtnSaveAs - // - this.tbtnSaveAs.Enabled = false; - this.tbtnSaveAs.ImageIndex = 3; - this.tbtnSaveAs.Name = "tbtnSaveAs"; - this.tbtnSaveAs.Text = "Save As"; - // - // tbtnDuplicate - // - this.tbtnDuplicate.Enabled = false; - this.tbtnDuplicate.ImageIndex = 4; - this.tbtnDuplicate.Name = "tbtnDuplicate"; - this.tbtnDuplicate.Text = "Duplicate"; - // - // tbtnZoom - // - this.tbtnZoom.Enabled = false; - this.tbtnZoom.ImageIndex = 5; - this.tbtnZoom.Name = "tbtnZoom"; - this.tbtnZoom.Text = "Zoom"; - // - // imageListToolBar - // - this.imageListToolBar.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListToolBar.ImageStream"))); - this.imageListToolBar.TransparentColor = System.Drawing.Color.Transparent; - this.imageListToolBar.Images.SetKeyName(0, ""); - this.imageListToolBar.Images.SetKeyName(1, ""); - this.imageListToolBar.Images.SetKeyName(2, ""); - this.imageListToolBar.Images.SetKeyName(3, ""); - this.imageListToolBar.Images.SetKeyName(4, ""); - this.imageListToolBar.Images.SetKeyName(5, ""); - // - // Form1 - // - this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); - this.ClientSize = new System.Drawing.Size(816, 619); - this.Controls.Add(this.panel1); - this.Controls.Add(this.splitter1); - this.Controls.Add(this.roTreeView); - this.Controls.Add(this.tbar); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Menu = this.mainMenu1; - this.Name = "Form1"; - this.Text = "RO Edit"; - this.panel1.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - #endregion - - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main(string[] args) - { - bool StartupROEditor = true; - FileStream fsown=null; - FileInfo fiown=null; - String specificro = null; - string ConnectionPath = ""; - // Let's open the database & set up for the tree structure... - - // if an RO directory path was passed in, then change the - // current working directory to it. - // this path will also be used to generate a connection string - // the the Access database. - if (args.Length > 0) - { - ConnectionPath = args[0]; -// Directory.SetCurrentDirectory(ConnectionPath); - } - else // find ROPATH - { - ConnectionPath = FindTheRODirectory(); - } - if (args.Length > 1) - specificro = args[1]; - try - { - // Convert the RO data if needed - if (!CheckForDataConversion(ConnectionPath)) - ConnectionPath = null; // force exit - } - catch (Exception e) - { - MessageBox.Show(e.Message, "Error on check for data conversion"); - // Application.Exit(); - } - // Process the given RO Path - if (ConnectionPath == null) - { - // no RO directory - MessageBox.Show("Could not locate a Referenced Objects (RO) directory.\n\nIt should be inside your VExxx directory or at the same level as your VExxx directory.","RO Editor"); - StartupROEditor = false; - } - else if (ConnectionPath.Equals("")) - { - // already in RO directory - ConnectionPath = Directory.GetCurrentDirectory(); - } - else - { - // Change to the RO Directory - try - { - Directory.SetCurrentDirectory(ConnectionPath); - } - catch (Exception e) - { - MessageBox.Show(e.Message, e.GetType().ToString()); - } - } - - if (StartupROEditor) - { - // open an existing file, or create a new one - try - { - fiown = new FileInfo("RoEditor.own"); - } - catch(Exception e) - { - MessageBox.Show(e.Message,"fileinfo"); - } - // Open the file just specified. Open it so that no-one else can use it - try - { - fsown = fiown.Open( FileMode.Create, FileAccess.ReadWrite, FileShare.None ); - } - catch (IOException) - { - MessageBox.Show("Another user is executing the RoEditor"); - return; - } - - // If there isn't a RO database file, ask user if we should create an empty one. - if (!File.Exists("ROMaster.mdb") && !UsingSQLServer(Directory.GetCurrentDirectory())) - { - DialogResult AnswerYN; - string msgstr = "The RO directory (" + Directory.GetCurrentDirectory() +") is empty.\n\n Create an empty RO database?"; - AnswerYN = MessageBox.Show(msgstr,"RO Editor",MessageBoxButtons.YesNo); - if (AnswerYN == DialogResult.Yes) - { - string SourceRODatabase = Application.StartupPath + "\\ROMaster.mdb"; - string DestRODatabase = Directory.GetCurrentDirectory() + "\\ROMaster.mdb"; - File.Copy(SourceRODatabase,DestRODatabase); - } - else - StartupROEditor = false; - } - } - - if (StartupROEditor) - { - Application.Run(new Form1(ConnectionPath,specificro)); - - if (fsown != null) - { - fsown.Close(); - fiown.Delete(); - } - Application.Exit(); - } - } - - /* - * Look for the RO directory via PROC.INI and by - * looking for a \RO directory in the current VEplant - * directory and at the same level as VEplant - */ - static string FindTheRODirectory() - { - string RtnStr = ""; - string CurDir = Directory.GetCurrentDirectory(); - CurDir = CurDir.ToUpper(); - bool InProcdureDir = false; - - // are we in the RO directory? - if (!CurDir.EndsWith("\\RO")) //not in RO directory - { - if (File.Exists("PROC.INI")) // Get the ROPATH from the PROC.INI file if possible - { - InProcdureDir = true; - IniReader ini = new IniReader("PROC.INI"); - RtnStr = ini.ReadString("RO Defaults","ROPATH",""); - } - if (RtnStr.Equals("")) // no ROPATH specified - { - RtnStr = "..\\RO"; // check default location - if (!Directory.Exists(RtnStr)) - { - // Check for Global ROs (at the same directory level as the VEplant directory) - if (CurDir.EndsWith("TMPCHG")) // handle temporary change directory - { - InProcdureDir = false; - RtnStr = "..\\..\\..\\..\\RO"; - } - else // Check for Global RO, assume we are in PROCS or .PRC directory - RtnStr = "..\\..\\RO"; - if (!Directory.Exists(RtnStr) && InProcdureDir) - { - // Could not find RO directory. - // Instruct the user to create one. - DialogResult AnswerYN; - int idx = CurDir.LastIndexOf("\\"); - RtnStr = CurDir.Substring(0,idx+1) + "RO"; // default location - string msgstr = "A RO directory (folder) does not exist.\n\n Create a RO directory in the default location (" + RtnStr + ")?"; - AnswerYN = MessageBox.Show(msgstr,"RO Editor",MessageBoxButtons.YesNo); - if (AnswerYN == DialogResult.Yes) - { - Directory.CreateDirectory(RtnStr); - } - else - RtnStr = null; - } - else RtnStr = null; - } - } - } - return RtnStr; - } - - static bool UsingSQLServer(string ROdir) - { - bool Rtn = false; - string RtnStr; - string ROiniPath = ROdir + "\\ROAPP.INI"; - IniReader ini = new IniReader(ROiniPath); - RtnStr = ini.ReadString("Database Server","Path",""); - if (RtnStr.Length > 1) - Rtn = true; - return Rtn; - } - - static bool CheckForDataConversion(string ROdir) - { - bool Rtn = true; - // Check to see if we need to convert Old RO data - if (ROdir != null) - { - string testParadoxFile = ROdir; - string testAccessFile = ROdir; - if (!ROdir.Equals("")) - { - testParadoxFile += "\\"; - testAccessFile += "\\"; - } - - testParadoxFile += "ROMASTER.DB"; // Paradox file - testAccessFile += "ROMaster.mdb"; // Access file -// if (File.Exists(testParadoxFile)) - if (File.Exists(testParadoxFile) && !(File.Exists(testAccessFile) || UsingSQLServer(ROdir))) - { - // Display a message to the user that the data needs converted - DialogResult AnswerYN; - AnswerYN = MessageBox.Show("The RO data needs to be converted for the New RO Editor.\n\n Proceed with the data conversion?","RO Editor",MessageBoxButtons.YesNo); - if (AnswerYN == DialogResult.Yes) - { - // Convert old RO Data - string argstr = ROdir; - if (ROdir.Equals("")) - argstr = Directory.GetCurrentDirectory(); - string ConversionExePath = Application.StartupPath + "\\ParadoxConversion.exe "; - - // Need to move out of RO directory to convert it - Directory.SetCurrentDirectory("..\\"); - - // create a process & wait until it exits. - Process myProcess = new Process(); - myProcess.StartInfo.FileName = ConversionExePath; - myProcess.StartInfo.Arguments=argstr; - - myProcess.Start(); - myProcess.WaitForExit(); - - Directory.SetCurrentDirectory(argstr); - } - else - Rtn = false; - } - } - return Rtn; - } - - private void menuROSave_Click(object sender, System.EventArgs e) - { - tbar_SaveClick(); - } - - private void menuROExit_Click(object sender, System.EventArgs e) - { - Close(); - Application.Exit(); // Exit() does not run the destructors - } - - /* - * If the xml data becomes inconsistent with the tree view, reload the first - * level. - */ - private void CleanUpTree(VlnXmlElement curelem, TreeNode nd) - { - // Unload any children because data may have changed and it can be - // reloaded. - nd.Collapse(); - int cnt = nd.Nodes.Count; - bool add_dummykid = false; - if (cnt > 0) add_dummykid = true; - for (int i=0; i 1) || (levelcnt==1 && !TheMenuTitle.Equals(""))) - { - AllGroups = false; - ListViewItem item=null; - bool first = true; - for (int i=0; i< InUseList.Count; i++) - { - rof = (ROField) InUseList[i]; - if (rof.GetFieldname != null) - { - uint ftype = rof.GetFieldType; - if (ftype == 1 || ftype == 2 || ftype == 4 || ftype == 128) - { - string nm0 = rof.GetFieldname; - nm = rof.MakeFieldName(nm0); - nd = curele.SelectSingleNode(nm); - if (nd==null)nd = curele.SelectSingleNode("*/"+nm); - if (nd==null) - nd = curele.GetCurrentOfMultiFields(curele,nm); -// if (nd==null)nd = curele.SelectSingleNode(nm+"a"); -// if (nd==null)nd = curele.SelectSingleNode(nm+"b"); -// if (nd==null)nd = curele.SelectSingleNode(nm+"c"); -// if (nd==null)nd = curele.SelectSingleNode(nm+"d"); - string data; - if(nd==null) - data=" "; - else - data=nd.InnerText; - if(first==true) - { - item = new ListViewItem(data,ROIMAGE); - first=false; - item.Tag = curele; - } - else - item.SubItems.Add(data); - } - } - } - roListView.Items.Add(item); - } - } - } - curnd = curnd.NextSibling; - } - if (AllGroups == true) - { - roListView.Columns.Clear(); - roListView.Columns.Add("Group",250,HorizontalAlignment.Left); - } - - roListView.Visible=true; - } - - private void updateRoListView(TreeNode node) - { - VlnXmlElement selele; - selele = (VlnXmlElement) node.Tag; - if (selele.Name != "vlnGroup" && selele.Name != "RO_Root") - { - // if we already have a list view, and we're still under the same parent, - // leave the list view, otherwise clear it. - VlnXmlElement curele = null; - if (roListView != null && roListView.Items.Count > 0) - { - curele = (VlnXmlElement) roListView.Items[0].Tag; - if (selele.ParentNode != curele.ParentNode)roListView_ClearListDisplay(); - } - return; - } - else - { - if (roListView == null) - { - this.roListView = new System.Windows.Forms.ListView(); - this.panel1.Controls.Add(roListView); - this.roListView.Dock = System.Windows.Forms.DockStyle.Fill; - this.roListView.LargeImageList = this.imageListRoTree; - this.roListView.Name = "roListView"; - this.roListView.Size = new System.Drawing.Size(688, 700); - this.roListView.AllowColumnReorder = true; - this.roListView.FullRowSelect = true; - this.roListView.SmallImageList = this.imageListRoTree; - this.roListView.TabIndex = 5; - this.roListView.DoubleClick += new System.EventHandler(this.roListView_OnDoubleClick); - this.roListView.View = View.Details; - MyListViewComparer LVCompare = new MyListViewComparer(); - this.roListView.ListViewItemSorter = LVCompare; - roListView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.roListView_Column_Header_OnClick); - } - - DisplayGroupElements(selele); - } - - } - - void roListView_Column_Header_OnClick(object sender, ColumnClickEventArgs e) - { - int indx = e.Column; - MyListViewComparer LVCompare = (MyListViewComparer) roListView.ListViewItemSorter; - LVCompare.SetColumnToSortBy(indx); - roListView.Sort(); - } - - private void roTreeView_AfterSelect_1(object sender, System.Windows.Forms.TreeViewEventArgs e) - { - - } - } - - // This class is used to sort by the selected list view column - public class MyListViewComparer : IComparer - { - int column; - - public int Compare (object x, object y) - { - ListViewItem xitm = (ListViewItem) x; - ListViewItem yitm = (ListViewItem) y; - - string xbuff = xitm.SubItems[column].Text; - string ybuff = yitm.SubItems[column].Text; - int rtnval = 0; - int xcnt=0,ycnt=0; - int xlen,ylen; - byte xbyte, ybyte; - xlen = xbuff.Length; - ylen = ybuff.Length; - if (xbuff[0] == '<') - rtnval = 0; - if (ybuff[0] == '<') - rtnval = 0; - while ((rtnval==0) && ((xcnt < xlen) || (ycnt < ylen))) - { - xbyte = (xcnt == xlen)? (byte)0 : (byte)xbuff[xcnt++]; - ybyte = (ycnt == ylen)? (byte)0 : (byte)ybuff[ycnt++]; - rtnval = xbyte - ybyte; - } - - return rtnval; - } - - public void SetColumnToSortBy(int col) - { - column = col; - } - - } - -} diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.csproj b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.csproj deleted file mode 100644 index 075353b8..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.csproj +++ /dev/null @@ -1,198 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {3A4A3543-2D44-11D6-8452-00A0CC271352} - Debug - AnyCPU - App.ico - - - ROEditor - - - JScript - Grid - IE50 - false - WinExe - ROEditor - OnBuildSuccess - ROEditor.Form1 - - - - - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - - TRACE;Upgrade2005; - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - - - - System - - - System.Data - - - System.Drawing - - - System.Windows.Forms - - - System.XML - - - - - Form - - - Code - - - Form - - - Form - - - Form - - - Form - - - Form - - - Form - - - Form - - - Code - - - About.cs - Designer - - - FieldCombFrm.cs - Designer - - - FieldTextFrm.cs - Designer - - - FieldTypeDefFrm.cs - Designer - - - GroupDefFrm.cs - Designer - - - GroupNewFrm.cs - Designer - - - RODefFrm.cs - Designer - - - - ROEditor.cs - Designer - - - - - - - - - - {DECA8343-6351-11D6-8487-00A0CC271352} - ctlXMLEditLib - - - {6D44F537-879E-11D6-84B8-00A0CC271352} - DBEncapsulation - - - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04} - Org.Mentalis.Files - - - {0C7825FD-AA05-11D6-84D1-00A0CC271352} - RODBInterface - - - {0C782592-AA05-11D6-84D1-00A0CC271352} - ROFields - - - {134D8938-9CDC-4712-9444-D5DCC6638AB6} - ROFST - - - {551CB7B3-00B1-11D7-8590-482B59000000} - VlnStatus - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.ico b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.ico deleted file mode 100644 index 50c18a468a0778852e37bf8b6089d1602ca11523..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 766 zcmZ9KF>-@25JeZ089_y=w5H4v(vc%kN|n{ARmbQy93^E+N_)mLoBvnfc)ajIf8Q>w zutgdiA(?w`;IeM61B;feq|g4MNynP{iP$Q6WxDO}cdMMmuuRjwc$O!4v( zgKi=PvFG7?+ETJ*;H%v$p1c*9$BIpCpwE2>GZHMIcMBrd0{9#(P*6EBOH1jk9(0C< z&zb#|@)bGIhd^q6sr=!?{K7MQ;=>W_C-?UB+7GTS8s_`RwcB~Y;N)B71LiZne?-0Q zoL`WGD>lY{bePqC;e3zSQnC4uMCXIezn5$&VN%Q&`9rC6-g_I&JKjK3#NB%rK`fYe zDb9|tVit(?)@GJGN4rjX5{EssP{X}Y7ifac&;U7UuC2IxBLj54gFw@vE7lY?I{kn} XwBT?1uNG^LJw(uzRij+CuU7v6w@2_} diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.resx b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.resx deleted file mode 100644 index f5122820..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.resx +++ /dev/null @@ -1,249 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 124, 17 - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACE - CAAAAk1TRnQBSQFMAgEBAgEAAQQBAAEEAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo - AwABQAMAARADAAEBAQABCAYAAQQY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AAAAAAAACZmQl5AP//8HgAAAAAAAAJmZkHlwD///CHAA - AAAAAACZmQeXkA////CAAAAAAAAPmZkJeXAP////AAAAAAAA//mZB5eQD/////AAAAAAD///kHl5cA// - ////8AAAD////wmXlwAP//////////////CHmXkAD//w//////////8IeHmXAA//8A/////////wh4eH - kAAP//CAAP////8ACHh4eAAAAAAAeAcAAAAAh4eHh4AAAAB4eAeAeHh4eHh4eHgAAAAAB4eAcAeHh4eH - h4eAAAAAAAB4eAAACHh4eHgAAAAAAAAAAAAAAAAAAAAAAAAAAAADwD//AgAH/wAAA/8AAAH/AAAA/wAA - AH8AAAA/AAAAHwAAAA8AAAAHAAH4AwAH/AEAD/wBAB/8AAAf/AAAP/wAAD/8AAA/+AAAP/gAAD/wAAA/ - 4AAAH4AAAAAAAQAAAAEAAAABAAAAAwAAAAcAAAAPgAAAH8AAAD/gIAB/8DgD/w== - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.sln b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.sln deleted file mode 100644 index 5f00199a..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROEditor.sln +++ /dev/null @@ -1,146 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ROEditor", "ROEditor.csproj", "{3A4A3543-2D44-11D6-8452-00A0CC271352}" - ProjectSection(ProjectDependencies) = postProject - {6D44F537-879E-11D6-84B8-00A0CC271352} = {6D44F537-879E-11D6-84B8-00A0CC271352} - {DECA8343-6351-11D6-8487-00A0CC271352} = {DECA8343-6351-11D6-8487-00A0CC271352} - {0C782592-AA05-11D6-84D1-00A0CC271352} = {0C782592-AA05-11D6-84D1-00A0CC271352} - {551CB7B3-00B1-11D7-8590-482B59000000} = {551CB7B3-00B1-11D7-8590-482B59000000} - {0C7825FD-AA05-11D6-84D1-00A0CC271352} = {0C7825FD-AA05-11D6-84D1-00A0CC271352} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VlnStatus", "..\..\..\LibSource\VlnStatus\VlnStatus.csproj", "{551CB7B3-00B1-11D7-8590-482B59000000}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ROFields", "..\..\..\LibSource\ROField\ROFields.csproj", "{0C782592-AA05-11D6-84D1-00A0CC271352}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DBEncapsulation", "..\..\..\LibSource\DBEncapsulation\DBEncapsulation.csproj", "{6D44F537-879E-11D6-84B8-00A0CC271352}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RODBInterface", "..\..\..\LibSource\RODBInterface\RODBInterface.csproj", "{0C7825FD-AA05-11D6-84D1-00A0CC271352}" - ProjectSection(ProjectDependencies) = postProject - {6D44F537-879E-11D6-84B8-00A0CC271352} = {6D44F537-879E-11D6-84B8-00A0CC271352} - {0C782592-AA05-11D6-84D1-00A0CC271352} = {0C782592-AA05-11D6-84D1-00A0CC271352} - {551CB7B3-00B1-11D7-8590-482B59000000} = {551CB7B3-00B1-11D7-8590-482B59000000} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ctlXMLEditLib", "..\..\..\LibSource\ctlXMLEditLib\ctlXMLEditLib.csproj", "{DECA8343-6351-11D6-8487-00A0CC271352}" - ProjectSection(ProjectDependencies) = postProject - {0C7825FD-AA05-11D6-84D1-00A0CC271352} = {0C7825FD-AA05-11D6-84D1-00A0CC271352} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VlnProfiler", "..\..\..\LibSource\VlnProfiler\VlnProfiler.csproj", "{38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ROFST", "..\..\..\LibSource\ROFST\ROFST.csproj", "{134D8938-9CDC-4712-9444-D5DCC6638AB6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.Mentalis.Files", "..\..\..\LibSource\Org.Mentalis.Files\Org.Mentalis.Files.csproj", "{A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utils", "..\..\..\LibSource\Utils\Utils.csproj", "{680054D3-49C4-40E7-92A5-67B97DCE6308}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Win32 = Debug|Win32 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Debug|Win32.ActiveCfg = Debug|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Release|Any CPU.Build.0 = Release|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3A4A3543-2D44-11D6-8452-00A0CC271352}.Release|Win32.ActiveCfg = Release|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Debug|Win32.ActiveCfg = Debug|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Release|Any CPU.Build.0 = Release|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {551CB7B3-00B1-11D7-8590-482B59000000}.Release|Win32.ActiveCfg = Release|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug|Win32.ActiveCfg = Debug|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Release|Any CPU.Build.0 = Release|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {0C782592-AA05-11D6-84D1-00A0CC271352}.Release|Win32.ActiveCfg = Release|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug|Win32.ActiveCfg = Debug|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Release|Any CPU.Build.0 = Release|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {6D44F537-879E-11D6-84B8-00A0CC271352}.Release|Win32.ActiveCfg = Release|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug|Win32.ActiveCfg = Debug|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release|Any CPU.Build.0 = Release|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release|Win32.ActiveCfg = Release|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Debug|Win32.ActiveCfg = Debug|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Release|Any CPU.Build.0 = Release|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {DECA8343-6351-11D6-8487-00A0CC271352}.Release|Win32.ActiveCfg = Release|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Debug|Win32.ActiveCfg = Debug|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Release|Any CPU.Build.0 = Release|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Release|Win32.ActiveCfg = Release|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Debug|Win32.ActiveCfg = Debug|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Release|Any CPU.Build.0 = Release|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Release|Win32.ActiveCfg = Release|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Debug|Win32.ActiveCfg = Debug|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Release|Any CPU.Build.0 = Release|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04}.Release|Win32.ActiveCfg = Release|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Debug|Any CPU.Build.0 = Debug|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Debug|Win32.ActiveCfg = Debug|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Release|Any CPU.ActiveCfg = Release|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Release|Any CPU.Build.0 = Release|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Release|Win32.ActiveCfg = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROGROUPYellow.ICO b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/ROGROUPYellow.ICO deleted file mode 100644 index 3952150bb913b013e84cfa940dead7a7d3898993..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 766 zcmc&wI}XAy41Gl`RfjS$cjOq{h%596U2}`8Y=xEeUTtNy$owJnU#Ds7Qd)&Kkp Dji^+G diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/RO_FST.cs b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/RO_FST.cs deleted file mode 100644 index 151ddba2..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/RO_FST.cs +++ /dev/null @@ -1,876 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: RO_FST.cs $ $Revision: 15 $ - * $Author: Jsj $ $Date: 8/23/06 11:33a $ - * - * $History: RO_FST.cs $ - * - * ***************** Version 15 ***************** - * User: Jsj Date: 8/23/06 Time: 11:33a - * Updated in $/EXE/RefObj/ROEditor - * debug statements commented out - * - * ***************** Version 14 ***************** - * User: Jsj Date: 5/03/05 Time: 11:48a - * Updated in $/EXE/RefObj/ROEditor - * 2005 upgrade, move some ROFST logic to ROFST library - * - * ***************** Version 13 ***************** - * User: Jsj Date: 5/11/04 Time: 9:29a - * Updated in $/EXE/RefObj/ROEditor - * Bug fix B2004-011, could not create FST file if user opened nodes on - * tree. - * - * ***************** Version 12 ***************** - * User: Jsj Date: 4/08/04 Time: 9:48a - * Updated in $/EXE/RefObj/ROEditor - * Modified code to speed up the creation of the RO.FST file - * - * ***************** Version 11 ***************** - * User: Jsj Date: 6/30/03 Time: 1:20p - * Updated in $/EXE/RefObj/ROEditor - * a NULL Accessory Page ID was giving problems in creating a new RO.FST - * file. - * - * ***************** Version 10 ***************** - * User: Kathy Date: 6/11/03 Time: 2:01p - * Updated in $/EXE/RefObj/ROEditor - * Fix bug B2003-045 - * - * ***************** Version 9 ***************** - * User: Kathy Date: 5/30/03 Time: 12:48p - * Updated in $/EXE/RefObj/ROEditor - * B2003-044: sync up xml with UI tree view - * - * ***************** Version 8 ***************** - * User: Kathy Date: 5/21/03 Time: 12:51p - * Updated in $/EXE/RefObj/ROEditor - * B2003-034: process data if only one field for RO & also, convert return - * value for xml save - * - * ***************** Version 7 ***************** - * User: Jsj Date: 4/14/03 Time: 3:02p - * Updated in $/EXE/RefObj/ROEditor - * Speed up the creation of the RO.FST file - * - * ***************** Version 6 ***************** - * User: Kathy Date: 4/04/03 Time: 9:41a - * Updated in $/EXE/RefObj/ROEditor - * B2003-030 convert new top group name to user readable for ro.fst - * - * ***************** Version 5 ***************** - * User: Jsj Date: 2/21/03 Time: 9:51a - * Updated in $/EXE/RefObj/ROEditor - * added RO FST completed message - * - * ***************** Version 4 ***************** - * User: Jsj Date: 1/02/03 Time: 9:31a - * Updated in $/EXE/RefObj/ROEditor - * Save Graphics file date in RO.FST file - * - * ***************** Version 3 ***************** - * User: Jsj Date: 12/17/02 Time: 4:54p - * Updated in $/EXE/RefObj/ROEditor - * save real date for graphic files - * - * ***************** Version 2 ***************** - * User: Jsj Date: 12/06/02 Time: 3:26p - * Updated in $/EXE/RefObj/ROEditor - * parameter display data fix (ingoring this data for now) - * - * ***************** Version 1 ***************** - * User: Jsj Date: 11/27/02 Time: 12:53p - * Created in $/EXE/RefObj/ROEditor - * Modification to create the RO.FST file - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Data; -using System.Xml; -using System.Xml.Schema; -using System.Text; -using System.IO; -using RODBInterface; -using System.Runtime.InteropServices; -using VlnStatus; -using System.Collections.Specialized; -using ROFST_FILE; - -//using VlnProfiler; //don't forget to add VlnProfiler to the reference list - -namespace ROEditor -{ - /// - /// This creates an RO.FST file - /// - - class FstTmpSTRC - { - public ushort thistype; - public uint thisoff; - public string title; - - public FstTmpSTRC(ushort type, uint offset, string tl) - { - thistype = type; - thisoff = offset; - title = tl; - } - - void WriteString(BinaryWriter bw, string str) - { - int n=str.Length; - byte [] b = new byte[n+1]; - for(int i =0; i < n; i++) - { - b[i] = (byte)str[i]; - } - bw.Write(b,0,n+1); // +1 to include null - /** - byte nullbyte = 0; - int i; - for(i =0; i < str.Length; i++) - { - byte WrByte; - WrByte = (byte)str[i]; - bw.Write(WrByte); - } - bw.Write(nullbyte); -***/ - } - - public void Write(BinaryWriter bw) - { - 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. -// This sorting function compares two strings by doing a character by character comparison. - public class MyComparer : IComparer - { - public int Compare (object x, object y) - { - int rtnval = 0; - int xcnt=0,ycnt=0; - int xlen,ylen; - byte xbyte, ybyte; - string xbuff = x.ToString(); - string ybuff = y.ToString(); - xlen = xbuff.Length; - ylen = ybuff.Length; - if (xbuff[0] == '<') - rtnval = 0; - if (ybuff[0] == '<') - rtnval = 0; - while ((rtnval==0) && ((xcnt < xlen) || (ycnt < ylen))) - { - xbyte = (xcnt == xlen)? (byte)0 : (byte)xbuff[xcnt++]; - ybyte = (ycnt == ylen)? (byte)0 : (byte)ybuff[ycnt++]; - rtnval = xbyte - ybyte; - } - - return rtnval; - } - } - - - public class RO_FST - { - private FST_FileHeader FstHeader; - private string FstDir; // path to the RO directory - private string FstPath; // RO directory Path and RO.FST file name - private string FstOld; // ROFST.Old file name (backup of previous fst file) - private string FstNew; // ROFST.New hold the RO.FST info during creation - - private BinaryWriter fhFST; // write handle to FST file being created - - private VlnStatusBar StatusWin; - - private RODB ROdatabase; - - private XmlDocument FSTroXmlDoc; -// private HybridDictionary dicTiming; -// private HybridDictionary dicDuration; - - ushort widestAcPgId; - SortedList IdsAndAccPgIds; - SortedList IdsAndOffsets; - - ushort AllTypesUsed; - - private Stack InUseListStack; - private Stack RtnValTmplateStack; -// private DateTime dtLast=DateTime.Now; - - public RO_FST(RODB TheROdb, XmlDocument TheXmlDoc) - { - ROdatabase = TheROdb; // point to the RO database - FSTroXmlDoc = TheXmlDoc; - } - public bool Create() - { - bool RtnStat = true; -// dicDuration=new HybridDictionary(); -// dicTiming=new HybridDictionary(); -// Profiler.Reset(); - // position to the top of the tree - // CurrentNode = roTree.TopNode; - - // Setup the paths to the FST files - FstDir = Directory.GetCurrentDirectory(); - FstPath = FstDir + "\\RO.FST"; - FstOld = FstDir + "\\ROFST.Old"; - FstNew = FstDir + "\\ROFST.New"; - - // open a temporary file for building the RO.FST - try - { - fhFST = new BinaryWriter(File.Open(FstNew,System.IO.FileMode.Create,System.IO.FileAccess.ReadWrite)); - } - catch (Exception fhExc) - { - string errmsg = fhExc.Message; - MessageBox.Show(errmsg,"Error Creating RO.FST file",System.Windows.Forms.MessageBoxButtons.OK); - RtnStat = false; - } - - // If we were able to open a new ROFST.NEW file then go ahead and put the - // new FST information into it. - if (RtnStat) - RtnStat = BuildNewRoFST(); - - if (RtnStat) // successful in creating new RO FST file? - { - //If an RO.FST file already exists, - // rename the existing file for safe keeping - if (File.Exists(FstPath)) - { - // copy the existing RO.FST to ROFST.OLD - // - overrite ROFST.OLD if it already exists - File.Copy(FstPath,FstOld,true); // save RO.FST as ROFST.OLD - File.Delete(FstPath); // remove RO.FST - } - File.Copy(FstNew,FstPath,true); // save ROFST.NEW as RO.fST - File.Delete(FstNew); // remove ROFST.NEW - MessageBox.Show("New RO.FST file created successfully.","Create RO.FST file",System.Windows.Forms.MessageBoxButtons.OK); - } -// MessageBox.Show(Profiler.ToString("000.00%"),"Timings"); -// dicDuration=null; -// dicTiming=null; - return RtnStat; - } - - - private bool BuildNewRoFST() - { - bool RtnVal = true; - int i; - int numDatabases; - // write the empty header - save space for the header info - FstHeader = new FST_FileHeader(); - FstHeader.Write(fhFST); - - // point to the ROMASTER and get the number of databases it has - VlnXmlElement ROdbtables = (VlnXmlElement) FSTroXmlDoc.FirstChild; - numDatabases = ROdbtables.ChildNodes.Count; - - // Allocate a list of database info structures - ROFST_DbInfo[] dbinfo = new ROFST_DbInfo[numDatabases]; - //For each RO database, process each group - XmlNode ROtableNode = ROdbtables; - ROtableNode = ROtableNode.FirstChild; - StatusWin = new VlnStatusBar("Creating RO.FST file"); - for (i=0; i < numDatabases && RtnVal; i++) - { - dbinfo[i] = new ROFST_DbInfo(); - RtnVal = SaveToFSTFile(ROtableNode,dbinfo[i]); - dbinfo[i].dbiType = AllTypesUsed; - ROtableNode = ROtableNode.NextSibling; - } - - if (RtnVal) - { - VlnXmlElement tblnode = (VlnXmlElement) ROdbtables.FirstChild; - StatusWin.BarMax = numDatabases * 2; - StatusWin.BarStepValue = 1; - StatusWin.BarValue = 0; - // All of the RO database, group, and return value information - // was saved to the FST file. Now save the information needed - // to read the FST file. - - // Save DB list - uint lngbuf = 0; - uint dblength = (uint)fhFST.BaseStream.Position; - - fhFST.Write(lngbuf); - - ushort intbuf = Convert.ToUInt16(numDatabases); - fhFST.Write(intbuf); - - // The old code did a sizeof() on a structure containing the ROFSTDatabaseInfo (dbi) - // You cannot read/write a Struct type in C# like you can with C++. The C# books suggest - // creating a Class to replace the Struct, then create methods that perform the binary - // read/write. So I created a method that calculates the "struct" size to simulate the - // sizeof(struct dbi) - uint lngval = (dbinfo[0].GetStructSize()) * (uint)numDatabases; - - for (i=0; i=0) - { - outstr += tmpstr.Substring(cur,indx-cur); - asc_spchar = tmpstr.Substring(indx+3,3); - decval = System.Convert.ToInt16(asc_spchar,10); - outstr += System.Convert.ToChar(decval).ToString(); - cur = indx+6; - if (cur+6 > len) - indx = -1; - else - indx = tmpstr.IndexOf(OKpunch,cur); - } - if (cur= 1) && !TheMenuTitle.Equals("")) - { - curOffset = (uint)fhFST.BaseStream.Position; - curType = SaveROToFST(chldnode,InUseList,RtnValTmplate,AccPageIDTplate); - } - else - { - SkipThisOne = true; - } - } - if (!SkipThisOne) - { - string tmpstr = ChildElem.GetAttribute("MenuTitle"); - tmpfststrc = new FstTmpSTRC(curType,curOffset,tmpstr); - FstTmp.Add(tmpfststrc); - typ |= curType; - numgroups++; - } - } // end if VlnXmlElement - - // Get next child - chldnode = chldnode.NextSibling; - }// end while - } // if child is not null - - // pop the InUseList stack - if (PopInUseStack) - InUseListStack.Pop(); - - // pop the return valuse template stack - if (PopRtnValStack) - RtnValTmplateStack.Pop(); - - - // save the current position of the FST file for the return value - RtnVal = (uint)fhFST.BaseStream.Position; - - // Save the ID and offset entry for the current ID - IdsAndOffsets.Add(curRecID,RtnVal); - - fhFST.Write(curRecID); - fhFST.Write(elemParentID); - fhFST.Write(numgroups); - - // write the FstTmp - for (int i=0; i < FstTmp.Count; i++) - { - tmpfststrc = (FstTmpSTRC)FstTmp[i]; - tmpfststrc.Write(fhFST); - } - FstTmp.Clear(); - - return RtnVal; - } - - - public void WriteGraphicsReturnValue(string OrigStr) - { - string text, tmptext, hgttxt, widtxt, imgdateStr; - int idx; - int hgt, wid; - int imgdateInt; - byte newline = 10; - - char[] tmpbuf = OrigStr.ToCharArray(); - - // remove the trailing "\r\n" - tmptext = OrigStr.Substring(0,OrigStr.Length-2); - - // parse out the image width - idx = tmptext.LastIndexOf("\r\n"); - widtxt = tmptext.Substring(idx+2,tmptext.Length-(idx+2)); - wid = Convert.ToInt32(widtxt,10); - widtxt = wid.ToString("x4"); - tmptext = tmptext.Substring(0,idx); - - // parse out the image height - idx = tmptext.LastIndexOf("\r\n"); - hgttxt = tmptext.Substring(idx+2,tmptext.Length-(idx+2)); - hgt = Convert.ToInt32(hgttxt,10); - hgttxt = hgt.ToString("x4"); - tmptext = tmptext.Substring(0,idx); - - // parse out the image file name and image date - idx = tmptext.IndexOf(" "); - text = tmptext.Substring(idx+1); - if (tmptext.StartsWith("\r\n")) - imgdateStr = tmptext.Substring(2,idx-2); // first 2 chars are "\r\n" - else - { - if(idx < 1) - imgdateStr=null; - else - imgdateStr = tmptext.Substring(0,idx); - } - if (imgdateStr == null|| imgdateStr=="") - imgdateInt = 0; - else - imgdateInt = Convert.ToInt32(imgdateStr,10); - - // write graphics file name - WriteString(text,false); - fhFST.Write(newline); - - // write dummy date (old FST file had only zeros! -// WriteString("00000000",false); - WriteString(imgdateInt.ToString("x8"),false); - fhFST.Write(newline); - - // write the image height - WriteString(hgttxt,false); - fhFST.Write(newline); - - //write the image width - WriteString(widtxt,true); - } - - - private ushort SaveROToFST(XmlNode RONode,ArrayList InUseList,string RtnValTmplate, string AccPageIDTplate) - { - ushort RtnVal; - uint startFST = (uint)fhFST.BaseStream.Position; - uint RORecID; - uint ParID; - byte nullbyte=0; - - VlnXmlElement elem; - elem = (VlnXmlElement) RONode; - -// string dummy = ""; // need for RODB_GetFIeldsInUse call, won't be used. -// ArrayList AvailList, InUseList; -// //Get the "In Use" field list -// AvailList = ROdatabase.RODB_GetFields(elem, (uint) RecordType.Schema); -// InUseList = ROdatabase.RODB_GetFieldsInUse(elem, AvailList,"FieldsInUse", ref dummy); - - //Write the RO's record ID - string RecIdStr = elem.GetAttribute("RecID"); - RORecID = System.Convert.ToUInt16(RecIdStr,16); - - fhFST.Write(RORecID); - -// **** Debug -// if (RecIdStr.Equals("000000a6")) -// nullbyte=0; -// *** - // Get the Accessory Page ID -// string AccPageIDTplate = elem.GetAccPageIDTemplate(); - string AccPageID = elem.GetAccPageIDString(AccPageIDTplate); - -// **** Debug -// if (AccPageID.Equals("S:1")) -// nullbyte=0; -// ***** - - //Write the parent ID - string ParIDstr = elem.GetAttribute("ParentID"); - ParID = System.Convert.ToUInt16(ParIDstr,16); - fhFST.Write(ParID); - - // not sure why, was in old FST code but no comment! - // I assume that it's some sort of separater - short none = -1; - fhFST.Write(none); - - //Get the RO Return value and return type -// string RtnValTmplate = elem.GetReturnValueTemplate(); - RtnVal = 0; - string tablename = elem.GetAttribute("Table"); -// if (RtnValTmplate.Equals("")) -// { -// int i; -// i =0; -// } - string cvttmp= CvtFldToUserFld(RtnValTmplate); - string RORtnVal = elem.GetReturnValue(ROdatabase,tablename,cvttmp,InUseList,ref RtnVal); - - // Write the field type to the FST - fhFST.Write(RtnVal); - - if (RtnVal == 8) // is this an Image (graphics) record? - WriteGraphicsReturnValue(RORtnVal); - else - WriteString(RORtnVal); - - // Write the Accessory Page ID - // Fix for Bug B2003-039. Added check for a NULL AccPageID - // If is null, then assign a blank string - - if (AccPageID != null) - AccPageID = AccPageID.Trim(); - else - AccPageID = " "; - WriteString(AccPageID); - - // Save the ID and offset entry for the current ID - IdsAndOffsets.Add(RORecID,startFST); - - // Save the RecID and Accessory Page id - IdsAndAccPgIds[AccPageID] = RORecID; - - - // Save the widest AccPageID width - int acclen = AccPageID.Length; - if (acclen > widestAcPgId) - widestAcPgId = (ushort)acclen; -// if(dtLast.AddSeconds(.3) < DateTime.Now) -// { - StatusWin.StatMsg = AccPageID; - StatusWin.PerformStep(); -// dtLast=DateTime.Now; -// } - return RtnVal; - } - - public void WriteString(string str) - { - WriteString(str,true); - } - - public void WriteString(string str,bool AddNull) - { - int n=str.Length; - if (AddNull) - n++; - byte [] b = new byte[n]; - for(int i =0; i < str.Length; i++) - { - b[i] = (byte)str[i]; - } - fhFST.Write(b,0,n); - } - - } -} diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Red_V_txt_NB_bur_1984.png b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Red_V_txt_NB_bur_1984.png deleted file mode 100644 index e8f05bdd72b5bdd745610f9d4a5cd760256db593..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37254 zcmXtgV|ZNO7w!a&ZQHhOyHR7CZDZR`W7}wK+r}?e8W9c;4g>-r%F0Nnfk0q&!1D+gDBw|1!TuHa2Ii_JEe5KYCinxqfOV45aRq_k z(f@scfikjifFDACmsOO6UWdm<=4WEka=-wANI)JiJKF&gVfVYppwbZN_yHN8#-n;w00bm^gF&-1fJ`?ca&J zKQyZ?aUKE>OIoal+n-P%f{z<|3ZHAC^Vf%g)t0Tn6D`9pAd1d6Ha0GMv6UKq*3%`e z9dh_E8M+W%rjeP2lKk@W2;QyDE-%u=v3OkksQ>OhK(kZpc*KSs!vb56!}vTe?~jwF zpXthbhCQDFfn5<#=EF&oKb_4e3^wZ_K=D0Z+`c}iwEIGh7Q2R@@3n{GO~I5O`F+O@ zDwLF>g&JbpMI*DNxkpum{<<}wxRHT)oyPE{exKKTRXQ*bd5+)KL7GhnxPj>i%El5c zbpC=B2=r1yMWb2Wf3eX52J(oAD5Iq-L0f+MJLp?19Vb>w3l%pbPI49q1+r|m57H%V z@ot!skWxUu$O;xa%_=G0Jy|&e12thY8(nQUs^=z%1ynJ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GIU`qq;fe<@crXMaW4G%~EnKR%w zu4A2;-`KJ6dvO|M5fM5gFoPMaGn=vDE1*rpAQHKN4z=0&(x{o-KX$X*EF=h5}k5{fjAtIJ9hkgJ4dUeEvZRj!e89LPP z&pcykj zF|`4KK!_o)@x~$}m`TJ4mANE%qul=Kj_HC((UQDw*UYD07*qoM6N<$f~Z($!2kdN diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Restore.ico b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Restore.ico deleted file mode 100644 index ddcdc8057c0de73ec89a4a4498b70eddac8ebfd1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 318 zcmbu3D-y#n3`FIb9>A!$Qxul#mBp-PxkI2yuHZ8jWlYq!GUx%ivR0p!G&W0E&e?<| zncWp}bsl)K8*EmBCrO(ds>>8hi5W2|Uaa?y?(xiB8IGw1)gRoiC`LOY8Lh2qjCLF^ pqWgHxiS0w=y|=6GMAd_9=z9aqvkca%`qW|RgqYV=?E}8^7rwk&Y777X diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Save.ico b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Save.ico deleted file mode 100644 index f7229620096289f6470aabce17d7299a0941ca7f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 318 zcmbVFArinK3=6l3IZ)G+licltm2>+NPeRVIq_wD}G^GhGKw^|qAe;%9!^uH37psn_?upIMd9 Ry;bYC+*SCGR3X~``~e1YNrC_X diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Zoom.ico b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/Zoom.ico deleted file mode 100644 index 486a5127d12d3af55301d8cdc0702b01e18978de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 318 zcmbtOD;C2r3{&147;DgQ;f`r&)LbdY2`ns1D%pi&vm+_;Coe!@)>@(X7T_Z#RN0Aw z7a6eNB=vGb-m+;HGh$u|L+_pa6$fkSMle+(`LAeC`Altia|#G+T$0^}pA@^MH+q|G ZgkEE&9!=_-56wCEWc5zSL;TKPaRbk?SS0`e diff --git a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/app.config b/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/app.config deleted file mode 100644 index bcd05449..00000000 --- a/PROMS/ReferencedObjectsOld/Exe/RefObj/ROEditor/app.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/AssemblyInfo.cs deleted file mode 100644 index 7e3b35a5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/AssemblyInfo.cs.bak deleted file mode 100644 index 6b2b0662..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/DBEncap.cs b/PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/DBEncap.cs deleted file mode 100644 index 0750be45..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/DBEncap.cs +++ /dev/null @@ -1,205 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: DBEncap.cs $ $Revision: 5 $ - * $Author: Kathy $ $Date: 12/10/02 2:24p $ - * - * $History: DBEncap.cs $ - * - * ***************** Version 5 ***************** - * User: Kathy Date: 12/10/02 Time: 2:24p - * Updated in $/LibSource/DBEncapsulation - * handle dbnull for sql server - * - * ***************** Version 4 ***************** - * User: Kathy Date: 10/09/02 Time: 12:36p - * Updated in $/LibSource/DBEncapsulation - * handle null in data - * - * ***************** Version 3 ***************** - * User: Jsj Date: 9/05/02 Time: 1:03p - * Updated in $/LibSource/DBEncapsulation - * added ExecuteNonQuery calls - * - * ***************** Version 2 ***************** - * User: Jsj Date: 9/05/02 Time: 11:31a - * Updated in $/LibSource/DBEncapsulation - * added Close functions - * - * ***************** Version 1 ***************** - * User: Jsj Date: 8/23/02 Time: 3:07p - * Created in $/LibSource/DBEncapsulation - *********************************************************************************************/ - -using System; -using System.Data; -using System.Data.OleDb; -using Microsoft.Data.Odbc; - -namespace DBEncapsulation -{ - /// - /// Summary description for DBEncapsulate: Encapsulate database interface methods & - /// classes. Will encapsulate OLE DB & ODBC connections, commands, readers & other - /// features as required. - /// - public class DBEncapsulate - { - public virtual void Connection(string strconnect) - { - } - public virtual void OpenConnection() - { - } - public virtual void CloseConnection() - { - } - public virtual void Command(string strCommand) - { - } - public virtual void CommandDispose() - { - } - public virtual bool Reader() - { - return false; - } - public virtual void ReaderClose() - { - } - public virtual bool Read() - { - return false; - } - public virtual string GetString(int num) - { - string tmp = "tmp"; - return (tmp); - } - public virtual int GetInt32(int num) - { - return (0); - } - public virtual void NonQuery() - { - } - } - public class OLEDB_DBEncap: DBEncapsulate - { - OleDbConnection myDatabaseConn; - OleDbCommand myCommand; - OleDbDataReader myReader; - public override void Connection(string strconnect) - { - myDatabaseConn = new OleDbConnection(strconnect); - } - public override void OpenConnection() - { - myDatabaseConn.Open(); - } - public override void CloseConnection() - { - myDatabaseConn.Close(); - } - public override void Command(string strCommand) - { - myCommand = new OleDbCommand(strCommand,myDatabaseConn); - } - public override void CommandDispose() - { - myCommand.Dispose(); - } - public override bool Reader() - { - myReader = myCommand.ExecuteReader(); - if (myReader == null) - return false; - else - return true; - } - public override void ReaderClose() - { - myReader.Close(); - } - public override bool Read() - { - return(myReader.Read()); - } - public override string GetString(int num) - { - if (myReader.IsDBNull(num) == false) - return(myReader.GetString(num)); - else - return null; - //if (myReader.GetString(num) == null) return null; - //return(myReader.GetString(num)); - } - public override int GetInt32(int num) - { - return(myReader.GetInt32(num)); - } - public override void NonQuery() - { - myCommand.ExecuteNonQuery(); - } - } - - public class ODBC_DBEncap: DBEncapsulate - { - OdbcConnection myDatabaseConn; - OdbcCommand myCommand; - OdbcDataReader myReader; - public override void Connection(string strconnect) - { - myDatabaseConn = new OdbcConnection(strconnect); - } - public override void OpenConnection() - { - myDatabaseConn.Open(); - } - public override void CloseConnection() - { - myDatabaseConn.Close(); - } - public override void Command(string strCommand) - { - myCommand = new OdbcCommand(strCommand,myDatabaseConn); - } - public override void CommandDispose() - { - myCommand.Dispose(); - } - public override bool Reader() - { - myReader = myCommand.ExecuteReader(); - if (myReader == null) - return false; - else - return true; - } - public override void ReaderClose() - { - myReader.Close(); - } - public override bool Read() - { - return(myReader.Read()); - } - public override string GetString(int num) - { - if (myReader.IsDBNull(num) == false) - return(myReader.GetString(num)); - else - return null; - } - public override int GetInt32(int num) - { - return(myReader.GetInt32(num)); - } - public override void NonQuery() - { - myCommand.ExecuteNonQuery(); - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/DBEncapsulation.csproj b/PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/DBEncapsulation.csproj deleted file mode 100644 index fefef114..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/DBEncapsulation.csproj +++ /dev/null @@ -1,106 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {6D44F537-879E-11D6-84B8-00A0CC271352} - Debug - AnyCPU - - - - - DBEncapsulation - - - JScript - Grid - IE50 - false - Library - DBEncapsulation - OnBuildSuccess - - - - - - - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - - - - Microsoft.Data.Odbc - C:\Program Files\Microsoft.Net\Odbc.Net\Microsoft.Data.Odbc.dll - - - System - - - System.Data - - - System.XML - - - - - Code - - - Code - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/DBEncapsulation.sln b/PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/DBEncapsulation.sln deleted file mode 100644 index b447aa2d..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/DBEncapsulation/DBEncapsulation.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DBEncapsulation", "DBEncapsulation.csproj", "{6D44F537-879E-11D6-84B8-00A0CC271352}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug.ActiveCfg = Debug|.NET - {6D44F537-879E-11D6-84B8-00A0CC271352}.Debug.Build.0 = Debug|.NET - {6D44F537-879E-11D6-84B8-00A0CC271352}.Release.ActiveCfg = Release|.NET - {6D44F537-879E-11D6-84B8-00A0CC271352}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/AssemblyInfo.cpp b/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/AssemblyInfo.cpp deleted file mode 100644 index c185863d..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/AssemblyInfo.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "stdafx.h" - -using namespace System::Reflection; -using namespace System::Runtime::CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly:AssemblyTitleAttribute("")]; -[assembly:AssemblyDescriptionAttribute("")]; -[assembly:AssemblyConfigurationAttribute("")]; -[assembly:AssemblyCompanyAttribute("")]; -[assembly:AssemblyProductAttribute("")]; -[assembly:AssemblyCopyrightAttribute("")]; -[assembly:AssemblyTrademarkAttribute("")]; -[assembly:AssemblyCultureAttribute("")]; - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the value or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly:AssemblyVersionAttribute("1.1.*")]; - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project directory. -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly:AssemblyDelaySignAttribute(false)]; -[assembly:AssemblyKeyFileAttribute("E:\\proms.net\\Public Key\\vlnkey.snk")]; -[assembly:AssemblyKeyNameAttribute("")]; - diff --git a/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/IniFileIO.cpp b/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/IniFileIO.cpp deleted file mode 100644 index 89b3d45d..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/IniFileIO.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/********************************************************************************************* - * Copyright 2003 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: IniFileIO.cpp $ $Revision: 4 $ - * $Author: Jsj $ $Date: 1/07/04 12:08p $ - * - * $History: IniFileIO.cpp $ - * - * ***************** Version 4 ***************** - * User: Jsj Date: 1/07/04 Time: 12:08p - * Updated in $/LibSource/IniFileIO - * was not returning found strings - * - * ***************** Version 3 ***************** - * User: Jsj Date: 12/16/03 Time: 11:44a - * Updated in $/LibSource/IniFileIO - * modified to all use in .net 1.0 and .net 1.1 - *********************************************************************************************/ -// This is the main DLL file. -#include "stdafx.h" -#include "IniFileIO.h" - -using namespace IniFileIO; - -String *INIFile::GetINIKeyValueStr(String *SectName, String *KeyName, String *DefaultValue, unsigned BufSize, String *IniFileName) -{ - unsigned rtval; - LPCTSTR tmpSectName; - LPCTSTR tmpKeyName; - LPCTSTR tmpDefaultValue; - LPSTR tmpReturnBuff; - LPCTSTR tmpIniFileName; - ValueString = new String(NULL,BufSize+1); - tmpSectName = static_cast(static_cast(Marshal::StringToCoTaskMemAnsi(SectName))); - tmpKeyName = static_cast(static_cast(Marshal::StringToCoTaskMemAnsi(KeyName))); - tmpDefaultValue = static_cast(static_cast(Marshal::StringToCoTaskMemAnsi(DefaultValue))); - tmpReturnBuff = static_cast(static_cast(Marshal::StringToCoTaskMemAnsi(ValueString))); - tmpIniFileName = static_cast(static_cast(Marshal::StringToCoTaskMemAnsi(IniFileName))); - - rtval = GetPrivateProfileString(tmpSectName,tmpKeyName,tmpDefaultValue,tmpReturnBuff,BufSize,tmpIniFileName); - ValueString = new String(tmpReturnBuff); - return ValueString; - -} - -bool INIFile::WriteINIKeyValueStr(String *SectName, String *KeyName, String *KeyValue, String *IniFileName) -{ - bool rtval; - - LPCTSTR tmpSectName; - LPCTSTR tmpKeyName; - LPCTSTR tmpKeyValue; - LPCTSTR tmpIniFileName; - tmpSectName = static_cast(static_cast(Marshal::StringToCoTaskMemAnsi(SectName))); - tmpKeyName = static_cast(static_cast(Marshal::StringToCoTaskMemAnsi(KeyName))); - tmpKeyValue = static_cast(static_cast(Marshal::StringToCoTaskMemAnsi(KeyValue))); - tmpIniFileName = static_cast(static_cast(Marshal::StringToCoTaskMemAnsi(IniFileName))); - - rtval = WritePrivateProfileString(tmpSectName,tmpKeyName,tmpKeyValue,tmpIniFileName); - - Marshal::FreeCoTaskMem(System::IntPtr((void*)tmpSectName)); - Marshal::FreeCoTaskMem(System::IntPtr((void*)tmpKeyName)); - Marshal::FreeCoTaskMem(System::IntPtr((void*)tmpKeyValue)); - Marshal::FreeCoTaskMem(System::IntPtr((void*)tmpIniFileName)); - return rtval; -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/IniFileIO.h b/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/IniFileIO.h deleted file mode 100644 index 8b19e06d..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/IniFileIO.h +++ /dev/null @@ -1,35 +0,0 @@ -/********************************************************************************************* - * Copyright 2003 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: IniFileIO.h $ $Revision: 3 $ - * $Author: Jsj $ $Date: 12/16/03 11:39a $ - * - * $History: IniFileIO.h $ - * - * ***************** Version 3 ***************** - * User: Jsj Date: 12/16/03 Time: 11:39a - * Updated in $/LibSource/IniFileIO - * modified to all use in .net 1.0 and .net 1.1 - *********************************************************************************************/ -// IniFileIO.h - -#pragma once -#using -#include -#include - -using namespace System; -using namespace System::Runtime::InteropServices; - -namespace IniFileIO -{ - public __gc class INIFile - { - public: - String *ValueString; - INIFile() {}; - String *GetINIKeyValueStr(String *SectName, String *KeyName, String *DefaultValue, unsigned BufSize, String *IniFileName); - bool WriteINIKeyValueStr(String *SectName, String *KeyName, String *KeyValue, String *IniFileName); - }; -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/IniFileIO.sln b/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/IniFileIO.sln deleted file mode 100644 index 3389e64f..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/IniFileIO.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IniFileIO", "IniFileIO.vcproj", "{FD05F903-0D2F-11D7-859A-D0745C000000}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {FD05F903-0D2F-11D7-859A-D0745C000000}.Debug.ActiveCfg = Debug|Win32 - {FD05F903-0D2F-11D7-859A-D0745C000000}.Debug.Build.0 = Debug|Win32 - {FD05F903-0D2F-11D7-859A-D0745C000000}.Release.ActiveCfg = Release|Win32 - {FD05F903-0D2F-11D7-859A-D0745C000000}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/IniFileIO.vcproj b/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/IniFileIO.vcproj deleted file mode 100644 index a45444e1..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/IniFileIO.vcproj +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/ReadMe.txt b/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/ReadMe.txt deleted file mode 100644 index e324b840..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/ReadMe.txt +++ /dev/null @@ -1,31 +0,0 @@ -======================================================================== - DYNAMIC LINK LIBRARY : IniFileIO Project Overview -======================================================================== - -AppWizard has created this IniFileIO DLL for you. - -This file contains a summary of what you will find in each of the files that -make up your IniFileIO application. - -IniFileIO.vcproj - This is the main project file for VC++ projects generated using an Application Wizard. - It contains information about the version of Visual C++ that generated the file, and - information about the platforms, configurations, and project features selected with the - Application Wizard. - -IniFileIO.cpp - This is the main DLL source file. - -IniFileIO.h - This file contains a class declaration. - -AssemblyInfo.cpp - Contains custom attributes for modifying assembly metadata. - -///////////////////////////////////////////////////////////////////////////// -Other notes: - -AppWizard uses "TODO:" to indicate parts of the source code you -should add to or customize. - -///////////////////////////////////////////////////////////////////////////// diff --git a/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/Stdafx.cpp b/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/Stdafx.cpp deleted file mode 100644 index 0fc75f1a..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/Stdafx.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// IniFileIO.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" diff --git a/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/Stdafx.h b/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/Stdafx.h deleted file mode 100644 index 459e5fc4..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/IniFileIO/Stdafx.h +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, -// but are changed infrequently - -#pragma once - -#using - diff --git a/PROMS/ReferencedObjectsOld/LibSource/Org.Mentalis.Files/IniReader.cs b/PROMS/ReferencedObjectsOld/LibSource/Org.Mentalis.Files/IniReader.cs deleted file mode 100644 index 12b5c705..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Org.Mentalis.Files/IniReader.cs +++ /dev/null @@ -1,428 +0,0 @@ -/* - IniReader class for C# - Version: 1.0 Date: 2002/04/24 -*/ -/* - Copyright © 2002, The KPD-Team - All rights reserved. - http://www.mentalis.org/ - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - - Neither the name of the KPD-Team, nor the names of its contributors - may be used to endorse or promote products derived from this - software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -using System; -using System.Text; -using System.Collections; -using System.Runtime.InteropServices; - -// The Org.Mentalis.Files contains a number of classes that read from or write to special files. -namespace Org.Mentalis.Files -{ - /// - /// The INIReader class can read keys from and write keys to an INI file. - /// - /// - /// This class uses several Win32 API functions to read from and write to INI files. It will not work on Linux or FreeBSD. - /// - public class IniReader - { - // API declarations - /// - /// The GetPrivateProfileInt function retrieves an integer associated with a key in the specified section of an initialization file. - /// - /// Pointer to a null-terminated string specifying the name of the section in the initialization file. - /// Pointer to the null-terminated string specifying the name of the key whose value is to be retrieved. This value is in the form of a string; the GetPrivateProfileInt function converts the string into an integer and returns the integer. - /// Specifies the default value to return if the key name cannot be found in the initialization file. - /// Pointer to a null-terminated string that specifies the name of the initialization file. If this parameter does not contain a full path to the file, the system searches for the file in the Windows directory. - /// The return value is the integer equivalent of the string following the specified key name in the specified initialization file. If the key is not found, the return value is the specified default value. If the value of the key is less than zero, the return value is zero. - [DllImport("KERNEL32.DLL", EntryPoint = "GetPrivateProfileIntA", CharSet = CharSet.Ansi)] - private static extern int GetPrivateProfileInt(string lpApplicationName, string lpKeyName, int nDefault, string lpFileName); - /// - /// The WritePrivateProfileString function copies a string into the specified section of an initialization file. - /// - /// Pointer to a null-terminated string containing the name of the section to which the string will be copied. If the section does not exist, it is created. The name of the section is case-independent; the string can be any combination of uppercase and lowercase letters. - /// Pointer to the null-terminated string containing the name of the key to be associated with a string. If the key does not exist in the specified section, it is created. If this parameter is NULL, the entire section, including all entries within the section, is deleted. - /// Pointer to a null-terminated string to be written to the file. If this parameter is NULL, the key pointed to by the lpKeyName parameter is deleted. - /// Pointer to a null-terminated string that specifies the name of the initialization file. - /// If the function successfully copies the string to the initialization file, the return value is nonzero; if the function fails, or if it flushes the cached version of the most recently accessed initialization file, the return value is zero. - [DllImport("KERNEL32.DLL", EntryPoint = "WritePrivateProfileStringA", CharSet = CharSet.Ansi)] - private static extern int WritePrivateProfileString(string lpApplicationName, string lpKeyName, string lpString, string lpFileName); - /// - /// The GetPrivateProfileString function retrieves a string from the specified section in an initialization file. - /// - /// Pointer to a null-terminated string that specifies the name of the section containing the key name. If this parameter is NULL, the GetPrivateProfileString function copies all section names in the file to the supplied buffer. - /// Pointer to the null-terminated string specifying the name of the key whose associated string is to be retrieved. If this parameter is NULL, all key names in the section specified by the lpAppName parameter are copied to the buffer specified by the lpReturnedString parameter. - /// Pointer to a null-terminated default string. If the lpKeyName key cannot be found in the initialization file, GetPrivateProfileString copies the default string to the lpReturnedString buffer. This parameter cannot be NULL.
Avoid specifying a default string with trailing blank characters. The function inserts a null character in the lpReturnedString buffer to strip any trailing blanks.
- /// Pointer to the buffer that receives the retrieved string. - /// Specifies the size, in TCHARs, of the buffer pointed to by the lpReturnedString parameter. - /// Pointer to a null-terminated string that specifies the name of the initialization file. If this parameter does not contain a full path to the file, the system searches for the file in the Windows directory. - /// The return value is the number of characters copied to the buffer, not including the terminating null character. - [DllImport("KERNEL32.DLL", EntryPoint = "GetPrivateProfileStringA", CharSet = CharSet.Ansi)] - private static extern int GetPrivateProfileString(string lpApplicationName, string lpKeyName, string lpDefault, StringBuilder lpReturnedString, int nSize, string lpFileName); - /// - /// The GetPrivateProfileSectionNames function retrieves the names of all sections in an initialization file. - /// - /// Pointer to a buffer that receives the section names associated with the named file. The buffer is filled with one or more null-terminated strings; the last string is followed by a second null character. - /// Specifies the size, in TCHARs, of the buffer pointed to by the lpszReturnBuffer parameter. - /// Pointer to a null-terminated string that specifies the name of the initialization file. If this parameter is NULL, the function searches the Win.ini file. If this parameter does not contain a full path to the file, the system searches for the file in the Windows directory. - /// The return value specifies the number of characters copied to the specified buffer, not including the terminating null character. If the buffer is not large enough to contain all the section names associated with the specified initialization file, the return value is equal to the length specified by nSize minus two. - [DllImport("KERNEL32.DLL", EntryPoint = "GetPrivateProfileSectionNamesA", CharSet = CharSet.Ansi)] - private static extern int GetPrivateProfileSectionNames(byte[] lpszReturnBuffer, int nSize, string lpFileName); - /// - /// The WritePrivateProfileSection function replaces the keys and values for the specified section in an initialization file. - /// - /// Pointer to a null-terminated string specifying the name of the section in which data is written. This section name is typically the name of the calling application. - /// Pointer to a buffer containing the new key names and associated values that are to be written to the named section. - /// Pointer to a null-terminated string containing the name of the initialization file. If this parameter does not contain a full path for the file, the function searches the Windows directory for the file. If the file does not exist and lpFileName does not contain a full path, the function creates the file in the Windows directory. The function does not create a file if lpFileName contains the full path and file name of a file that does not exist. - /// If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
- [DllImport("KERNEL32.DLL", EntryPoint = "WritePrivateProfileSectionA", CharSet = CharSet.Ansi)] - private static extern int WritePrivateProfileSection(string lpAppName, string lpString, string lpFileName); - /// Constructs a new IniReader instance. - /// Specifies the full path to the INI file (the file doesn't have to exist). - public IniReader(string file) - { - Filename = file; - } - /// Gets or sets the full path to the INI file. - /// A String representing the full path to the INI file. - public string Filename - { - get - { - return m_Filename; - } - set - { - m_Filename = value; - } - } - /// Gets or sets the section you're working in. (aka 'the active section') - /// A String representing the section you're working in. - public string Section - { - get - { - return m_Section; - } - set - { - m_Section = value; - } - } - /// Reads an Integer from the specified key of the specified section. - /// The section to search in. - /// The key from which to return the value. - /// The value to return if the specified key isn't found. - /// Returns the value of the specified section/key pair, or returns the default value if the specified section/key pair isn't found in the INI file. - public int ReadInteger(string section, string key, int defVal) - { - return GetPrivateProfileInt(section, key, defVal, Filename); - } - /// Reads an Integer from the specified key of the specified section. - /// The section to search in. - /// The key from which to return the value. - /// Returns the value of the specified section/key pair, or returns 0 if the specified section/key pair isn't found in the INI file. - public int ReadInteger(string section, string key) - { - return ReadInteger(section, key, 0); - } - /// Reads an Integer from the specified key of the active section. - /// The key from which to return the value. - /// The section to search in. - /// Returns the value of the specified Key, or returns the default value if the specified Key isn't found in the active section of the INI file. - public int ReadInteger(string key, int defVal) - { - return ReadInteger(Section, key, defVal); - } - /// Reads an Integer from the specified key of the active section. - /// The key from which to return the value. - /// Returns the value of the specified key, or returns 0 if the specified key isn't found in the active section of the INI file. - public int ReadInteger(string key) - { - return ReadInteger(key, 0); - } - /// Reads a String from the specified key of the specified section. - /// The section to search in. - /// The key from which to return the value. - /// The value to return if the specified key isn't found. - /// Returns the value of the specified section/key pair, or returns the default value if the specified section/key pair isn't found in the INI file. - public string ReadString(string section, string key, string defVal) - { - StringBuilder sb = new StringBuilder(MAX_ENTRY); - int Ret = GetPrivateProfileString(section, key, defVal, sb, MAX_ENTRY, Filename); - return sb.ToString(); - } - /// Reads a String from the specified key of the specified section. - /// The section to search in. - /// The key from which to return the value. - /// Returns the value of the specified section/key pair, or returns an empty String if the specified section/key pair isn't found in the INI file. - public string ReadString(string section, string key) - { - return ReadString(section, key, ""); - } - /// Reads a String from the specified key of the active section. - /// The key from which to return the value. - /// Returns the value of the specified key, or returns an empty String if the specified key isn't found in the active section of the INI file. - public string ReadString(string key) - { - return ReadString(Section, key); - } - /// Reads a Long from the specified key of the specified section. - /// The section to search in. - /// The key from which to return the value. - /// The value to return if the specified key isn't found. - /// Returns the value of the specified section/key pair, or returns the default value if the specified section/key pair isn't found in the INI file. - public long ReadLong(string section, string key, long defVal) - { - return long.Parse(ReadString(section, key, defVal.ToString())); - } - /// Reads a Long from the specified key of the specified section. - /// The section to search in. - /// The key from which to return the value. - /// Returns the value of the specified section/key pair, or returns 0 if the specified section/key pair isn't found in the INI file. - public long ReadLong(string section, string key) - { - return ReadLong(section, key, 0); - } - /// Reads a Long from the specified key of the active section. - /// The key from which to return the value. - /// The section to search in. - /// Returns the value of the specified key, or returns the default value if the specified key isn't found in the active section of the INI file. - public long ReadLong(string key, long defVal) - { - return ReadLong(Section, key, defVal); - } - /// Reads a Long from the specified key of the active section. - /// The key from which to return the value. - /// Returns the value of the specified Key, or returns 0 if the specified Key isn't found in the active section of the INI file. - public long ReadLong(string key) - { - return ReadLong(key, 0); - } - /// Reads a Byte array from the specified key of the specified section. - /// The section to search in. - /// The key from which to return the value. - /// Returns the value of the specified section/key pair, or returns null (Nothing in VB.NET) if the specified section/key pair isn't found in the INI file. - public byte[] ReadByteArray(string section, string key) - { - try - { - return Convert.FromBase64String(ReadString(section, key)); - } - catch { } - return null; - } - /// Reads a Byte array from the specified key of the active section. - /// The key from which to return the value. - /// Returns the value of the specified key, or returns null (Nothing in VB.NET) if the specified key pair isn't found in the active section of the INI file. - public byte[] ReadByteArray(string key) - { - return ReadByteArray(Section, key); - } - /// Reads a Boolean from the specified key of the specified section. - /// The section to search in. - /// The key from which to return the value. - /// The value to return if the specified key isn't found. - /// Returns the value of the specified section/key pair, or returns the default value if the specified section/key pair isn't found in the INI file. - public bool ReadBoolean(string section, string key, bool defVal) - { - return Boolean.Parse(ReadString(section, key, defVal.ToString())); - } - /// Reads a Boolean from the specified key of the specified section. - /// The section to search in. - /// The key from which to return the value. - /// Returns the value of the specified section/key pair, or returns false if the specified section/key pair isn't found in the INI file. - public bool ReadBoolean(string section, string key) - { - return ReadBoolean(section, key, false); - } - /// Reads a Boolean from the specified key of the specified section. - /// The key from which to return the value. - /// The value to return if the specified key isn't found. - /// Returns the value of the specified key pair, or returns the default value if the specified key isn't found in the active section of the INI file. - public bool ReadBoolean(string key, bool defVal) - { - return ReadBoolean(Section, key, defVal); - } - /// Reads a Boolean from the specified key of the specified section. - /// The key from which to return the value. - /// Returns the value of the specified key, or returns false if the specified key isn't found in the active section of the INI file. - public bool ReadBoolean(string key) - { - return ReadBoolean(Section, key); - } - /// Writes an Integer to the specified key in the specified section. - /// The section to write in. - /// The key to write to. - /// The value to write. - /// Returns true if the function succeeds, false otherwise. - public bool Write(string section, string key, int value) - { - return Write(section, key, value.ToString()); - } - /// Writes an Integer to the specified key in the active section. - /// The key to write to. - /// The value to write. - /// Returns true if the function succeeds, false otherwise. - public bool Write(string key, int value) - { - return Write(Section, key, value); - } - /// Writes a String to the specified key in the specified section. - /// Specifies the section to write in. - /// Specifies the key to write to. - /// Specifies the value to write. - /// Returns true if the function succeeds, false otherwise. - public bool Write(string section, string key, string value) - { - return (WritePrivateProfileString(section, key, value, Filename) != 0); - } - /// Writes a String to the specified key in the active section. - /// The key to write to. - /// The value to write. - /// Returns true if the function succeeds, false otherwise. - public bool Write(string key, string value) - { - return Write(Section, key, value); - } - /// Writes a Long to the specified key in the specified section. - /// The section to write in. - /// The key to write to. - /// The value to write. - /// Returns true if the function succeeds, false otherwise. - public bool Write(string section, string key, long value) - { - return Write(section, key, value.ToString()); - } - /// Writes a Long to the specified key in the active section. - /// The key to write to. - /// The value to write. - /// Returns true if the function succeeds, false otherwise. - public bool Write(string key, long value) - { - return Write(Section, key, value); - } - /// Writes a Byte array to the specified key in the specified section. - /// The section to write in. - /// The key to write to. - /// The value to write. - /// Returns true if the function succeeds, false otherwise. - public bool Write(string section, string key, byte[] value) - { - if (value == null) - return Write(section, key, (string)null); - else - return Write(section, key, value, 0, value.Length); - } - /// Writes a Byte array to the specified key in the active section. - /// The key to write to. - /// The value to write. - /// Returns true if the function succeeds, false otherwise. - public bool Write(string key, byte[] value) - { - return Write(Section, key, value); - } - /// Writes a Byte array to the specified key in the specified section. - /// The section to write in. - /// The key to write to. - /// The value to write. - /// An offset in value. - /// The number of elements of value to convert. - /// Returns true if the function succeeds, false otherwise. - public bool Write(string section, string key, byte[] value, int offset, int length) - { - if (value == null) - return Write(section, key, (string)null); - else - return Write(section, key, Convert.ToBase64String(value, offset, length)); - } - /// Writes a Boolean to the specified key in the specified section. - /// The section to write in. - /// The key to write to. - /// The value to write. - /// Returns true if the function succeeds, false otherwise. - public bool Write(string section, string key, bool value) - { - return Write(section, key, value.ToString()); - } - /// Writes a Boolean to the specified key in the active section. - /// The key to write to. - /// The value to write. - /// Returns true if the function succeeds, false otherwise. - public bool Write(string key, bool value) - { - return Write(Section, key, value); - } - /// Deletes a key from the specified section. - /// The section to delete from. - /// The key to delete. - /// Returns true if the function succeeds, false otherwise. - public bool DeleteKey(string section, string key) - { - return (WritePrivateProfileString(section, key, null, Filename) != 0); - } - /// Deletes a key from the active section. - /// The key to delete. - /// Returns true if the function succeeds, false otherwise. - public bool DeleteKey(string key) - { - return (WritePrivateProfileString(Section, key, null, Filename) != 0); - } - /// Deletes a section from an INI file. - /// The section to delete. - /// Returns true if the function succeeds, false otherwise. - public bool DeleteSection(string section) - { - return WritePrivateProfileSection(section, null, Filename) != 0; - } - /// Retrieves a list of all available sections in the INI file. - /// Returns an ArrayList with all available sections. - public ArrayList GetSectionNames() - { - try - { - byte[] buffer = new byte[MAX_ENTRY]; - GetPrivateProfileSectionNames(buffer, MAX_ENTRY, Filename); - string[] parts = Encoding.ASCII.GetString(buffer).Trim('\0').Split('\0'); - return new ArrayList(parts); - } - catch { } - return null; - } - //Private variables and constants - /// - /// Holds the full path to the INI file. - /// - private string m_Filename; - /// - /// Holds the active section name - /// - private string m_Section; - /// - /// The maximum number of bytes in a section buffer. - /// - private const int MAX_ENTRY = 32768; - } -} \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/Org.Mentalis.Files/Org.Mentalis.Files.csproj b/PROMS/ReferencedObjectsOld/LibSource/Org.Mentalis.Files/Org.Mentalis.Files.csproj deleted file mode 100644 index 7cc126de..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Org.Mentalis.Files/Org.Mentalis.Files.csproj +++ /dev/null @@ -1,47 +0,0 @@ - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04} - Library - Properties - Org.Mentalis.Files - Org.Mentalis.Files - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/Org.Mentalis.Files/Properties/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/Org.Mentalis.Files/Properties/AssemblyInfo.cs deleted file mode 100644 index 9b3fae73..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Org.Mentalis.Files/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Org.Mentalis.Files")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Org.Mentalis.Files")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("fd26053d-c25d-46ca-961c-7016c31e8b4b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/Org.Mentalis.Files/Properties/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/Org.Mentalis.Files/Properties/AssemblyInfo.cs.bak deleted file mode 100644 index 6e25ac0d..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Org.Mentalis.Files/Properties/AssemblyInfo.cs.bak +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Org.Mentalis.Files")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Org.Mentalis.Files")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("fd26053d-c25d-46ca-961c-7016c31e8b4b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/AssemblyInfo.cs deleted file mode 100644 index 7e3b35a5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/AssemblyInfo.cs.bak deleted file mode 100644 index 6b2b0662..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/RODBInterface.cs b/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/RODBInterface.cs deleted file mode 100644 index 88a34c93..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/RODBInterface.cs +++ /dev/null @@ -1,3047 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: RODBInterface.cs $ $Revision: 48 $ - * $Author: Kathy $ $Date: 9/06/05 11:25a $ - * - * $History: RODBInterface.cs $ - * - * ***************** Version 48 ***************** - * User: Kathy Date: 9/06/05 Time: 11:25a - * Updated in $/LibSource/RODBInterface - * B2005-035 - * - * ***************** Version 47 ***************** - * User: Jsj Date: 5/03/05 Time: 11:45a - * Updated in $/LibSource/RODBInterface - * - * ***************** Version 46 ***************** - * User: Kathy Date: 7/15/04 Time: 11:10a - * Updated in $/LibSource/RODBInterface - * Fix B2004-016 - * - * ***************** Version 45 ***************** - * User: Jsj Date: 5/19/04 Time: 11:11a - * Updated in $/LibSource/RODBInterface - * fixed typo in warning message - * - * ***************** Version 44 ***************** - * User: Jsj Date: 5/13/04 Time: 2:19p - * Updated in $/LibSource/RODBInterface - * RO FST will skip records that do not have a valid parent. - * - * ***************** Version 43 ***************** - * User: Jsj Date: 5/11/04 Time: 9:28a - * Updated in $/LibSource/RODBInterface - * We were getting multiple tree entries after creating the FST file. - * - * ***************** Version 42 ***************** - * User: Jsj Date: 4/08/04 Time: 9:42a - * Updated in $/LibSource/RODBInterface - * Optimized and added new read functions to speed up RO.FST file - * creation. - * - * ***************** Version 41 ***************** - * User: Jsj Date: 3/19/04 Time: 9:40a - * Updated in $/LibSource/RODBInterface - * bug fix, was using parent node's group definition instead of the - * current node's group definition - * B2004-008 - * - * ***************** Version 40 ***************** - * User: Jsj Date: 1/12/04 Time: 12:08p - * Updated in $/LibSource/RODBInterface - * changed SQL Server catalog name from"RO" to "VEPROMS RO" - * - * ***************** Version 39 ***************** - * User: Jsj Date: 1/07/04 Time: 2:17p - * Updated in $/LibSource/RODBInterface - * allow use of SQL Server - * - * ***************** Version 38 ***************** - * User: Kathy Date: 5/30/03 Time: 12:47p - * Updated in $/LibSource/RODBInterface - * B2003-040: flag inserted groups have no children for xml - * - * ***************** Version 37 ***************** - * User: Kathy Date: 5/21/03 Time: 12:44p - * Updated in $/LibSource/RODBInterface - * B2003-041: field name changes fixes. - * - * ***************** Version 36 ***************** - * User: Kathy Date: 5/07/03 Time: 1:57p - * Updated in $/LibSource/RODBInterface - * B2003-033 fix - * - * ***************** Version 35 ***************** - * User: Jsj Date: 4/14/03 Time: 2:59p - * Updated in $/LibSource/RODBInterface - * changes to help speed up RO FST file creation - * - * ***************** Version 34 ***************** - * User: Kathy Date: 4/04/03 Time: 9:39a - * Updated in $/LibSource/RODBInterface - * B2003-030: flag parent's HasChild attribute for new ros - * - * ***************** Version 33 ***************** - * User: Kathy Date: 3/13/03 Time: 1:17p - * Updated in $/LibSource/RODBInterface - * master different than local fieldname, use local - * - * ***************** Version 32 ***************** - * User: Kathy Date: 1/27/03 Time: 2:12p - * Updated in $/LibSource/RODBInterface - * test oledb - * - * ***************** Version 31 ***************** - * User: Kathy Date: 12/17/02 Time: 2:32p - * Updated in $/LibSource/RODBInterface - * new top group with apostrophe failed - * - * ***************** Version 30 ***************** - * User: Kathy Date: 12/17/02 Time: 11:05a - * Updated in $/LibSource/RODBInterface - * fixed bug on apostrophe in field def (schema string) - * - * ***************** Version 29 ***************** - * User: Kathy Date: 12/10/02 Time: 2:24p - * Updated in $/LibSource/RODBInterface - * fieldname special chars & various bug fixes - * - * ***************** Version 28 ***************** - * User: Kathy Date: 12/06/02 Time: 11:57a - * Updated in $/LibSource/RODBInterface - * mods for SQL Server - * - * ***************** Version 27 ***************** - * User: Kathy Date: 12/02/02 Time: 8:28a - * Updated in $/LibSource/RODBInterface - * fieldname replace chars - * - * ***************** Version 26 ***************** - * User: Kathy Date: 12/02/02 Time: 6:11a - * Updated in $/LibSource/RODBInterface - * Fix some bugs and add status bar on long ops - * - * ***************** Version 25 ***************** - * User: Jsj Date: 11/27/02 Time: 12:46p - * Updated in $/LibSource/RODBInterface - * modifications for RO.FST file creation - * - * ***************** Version 24 ***************** - * User: Kathy Date: 11/26/02 Time: 12:56p - * Updated in $/LibSource/RODBInterface - * fixed single quote crash in accpageid - * - * ***************** Version 23 ***************** - * User: Kathy Date: 11/11/02 Time: 7:15a - * Updated in $/LibSource/RODBInterface - * Added RODB_ReadRO to read an RO given a recid/table name - * - * ***************** Version 22 ***************** - * User: Kathy Date: 10/24/02 Time: 11:16a - * Updated in $/LibSource/RODBInterface - * delete hi-level group (table) - * - * ***************** Version 21 ***************** - * User: Kathy Date: 10/15/02 Time: 2:16p - * Updated in $/LibSource/RODBInterface - * minor bug fixes & new group (database, i.e. table level) - * - * ***************** Version 20 ***************** - * User: Kathy Date: 10/10/02 Time: 1:04p - * Updated in $/LibSource/RODBInterface - * xmltree=tree control - * - * ***************** Version 19 ***************** - * User: Kathy Date: 10/10/02 Time: 10:56a - * Updated in $/LibSource/RODBInterface - * console.writeline->Messagebox - * - * ***************** Version 18 ***************** - * User: Kathy Date: 10/10/02 Time: 10:00a - * Updated in $/LibSource/RODBInterface - * delete bug fix & accessory page id support - * - * ***************** Version 17 ***************** - * User: Kathy Date: 10/07/02 Time: 11:25a - * Updated in $/LibSource/RODBInterface - * image file saving of xml using xmltextwriter was missing sometext - * - * ***************** Version 16 ***************** - * User: Kathy Date: 10/02/02 Time: 1:41p - * Updated in $/LibSource/RODBInterface - * tie tree to insert/delete changes (round 1) - * - * ***************** Version 15 ***************** - * User: Jsj Date: 10/01/02 Time: 4:45p - * Updated in $/LibSource/RODBInterface - * hooks for passed in database path - * - * ***************** Version 14 ***************** - * User: Kathy Date: 9/27/02 Time: 1:22p - * Updated in $/LibSource/RODBInterface - * remove using vlnxml - * - * ***************** Version 13 ***************** - * User: Kathy Date: 9/27/02 Time: 1:18p - * Updated in $/LibSource/RODBInterface - * fix digit as first char in fieldname & recurse through tree adjusting - * for modified field names - * - * ***************** Version 12 ***************** - * User: Jsj Date: 9/26/02 Time: 11:13a - * Updated in $/LibSource/RODBInterface - * added VLNXML reference - * - * ***************** Version 11 ***************** - * User: Kathy Date: 9/25/02 Time: 9:55a - * Updated in $/LibSource/RODBInterface - * generate xml strings for writing to database by using xmltextwriter - * - * ***************** Version 10 ***************** - * User: Kathy Date: 9/19/02 Time: 10:02a - * Updated in $/LibSource/RODBInterface - * minor changes for schema and other bug fixes - * - * ***************** Version 9 ***************** - * User: Kathy Date: 9/11/02 Time: 1:14p - * Updated in $/LibSource/RODBInterface - * vlnxml - * - * ***************** Version 8 ***************** - * User: Kathy Date: 9/10/02 Time: 12:54p - * Updated in $/LibSource/RODBInterface - * menu titles - * - * ***************** Version 7 ***************** - * User: Kathy Date: 9/06/02 Time: 11:43a - * Updated in $/LibSource/RODBInterface - * datetimestamp - * - * ***************** Version 6 ***************** - * User: Kathy Date: 8/30/02 Time: 11:56a - * Updated in $/LibSource/RODBInterface - * new/update ro field records. - * - * ***************** Version 5 ***************** - * User: Kathy Date: 8/30/02 Time: 9:43a - * Updated in $/LibSource/RODBInterface - * compile - * - * ***************** Version 4 ***************** - * User: Jsj Date: 8/28/02 Time: 3:40p - * Updated in $/LibSource/RODBInterface - * added a create table function - * - * ***************** Version 3 ***************** - * User: Jsj Date: 8/28/02 Time: 3:03p - * Updated in $/LibSource/RODBInterface - * read connection strings from a text file - * - * ***************** Version 2 ***************** - * User: Kathy Date: 8/28/02 Time: 10:52a - * Updated in $/LibSource/RODBInterface - * development - *********************************************************************************************/ - - -using System; -using System.Collections; -using System.IO; -using System.Data; -using System.Xml; -using System.Xml.XPath; -using System.Xml.Schema; -using System.Text; -using System.Windows.Forms; -using DBEncapsulation; -using ROFields; -using VlnStatus; -//using IniFileIO; -using System.Collections.Specialized; -using Org.Mentalis.Files; -//using VlnProfiler; //don't forget to add VlnProfiler to the reference list - -namespace RODBInterface -{ - /// - /// Summary description for Class1 - /// - public enum RecordType: uint - { - Master=0, SubDatabase=1, Schema=2, Group=3, GroupSchema=4, RRO=5, SchemaStart=6, SchemaEnd=7 - } - - /// - /// The following class handles generation of sql strings to get/put requested parts of - /// XML RO Tree. And performs the database access using the VLN_DB class. - /// - public class RODB - { - DBEncapsulation.DBEncapsulate DBE; - DBEncapsulation.OLEDB_DBEncap DBE_OLEDB; -// DBEncapsulation.ODBC_DBEncap DBE_ODBC; - - private VlnXmlDocument ROXml; - private string schemastart; - private string schemaend; - private string lastTable=""; - private HybridDictionary dicFldTypes; - -// private string strAccOLEDBconn = ""; -// private string strSQLOLEDBconn = ""; -// private string strAccODBCconn = ""; -// private string strodbcConn = ""; - - private string strDatabaseConnectionCommand; - -// int dbConnectionType = 0; // we are only doing OLE-DB - int dbProviderType = 0; - string dbServerPath=""; - string dbServerUserName=""; - string dbServerPassword=""; - -// private enum CONNTYPE {OLEDB, ODBC}; - private enum DB_PROVIDER {ACCESS,SQL_SERVER,ORACLE}; - -// public RODB(int conntype, string connectstring) - public RODB(string RODirectoyPath) - { - // Setup the connection string - //if (RODirectoyPath.Equals("")) - // GetConnectionStringFromFile(); - //else - BuildConnectionString(RODirectoyPath); - - // Initialize the connection depending on OLE-DB or ODBC: -// conntype = 2; // ODBC: 1; // OLE-DB: 2 need to define this programmatically - //END OF TEMPORARY - - // Either use an OLE-DB or ODBC connection, depending on what was passed in. -//**** We are only doing OLE-DB -// if ( dbConnectionType == (int)CONNTYPE.ODBC) // ODBC -// { -// DBE_ODBC = new ODBC_DBEncap(); -// DBE = DBE_ODBC; -// } -// else // OLE-DB -// { - DBE_OLEDB = new OLEDB_DBEncap(); - DBE = DBE_OLEDB; -// } - - try - { -// DBE.Connection(strAccOLEDBconn); - //DBE.Connection(strodbcConn); - //SQL: -// DBE.Connection(strSQLOLEDBconn); - DBE.Connection(strDatabaseConnectionCommand); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Setup of OLEDB/ODBC"); - } - } - - -// public void GetConnectionStringFromFile() -// { -// /* This file should contain the connection strings in the followin order: -// * AccOLEDBconn, SQLOLEDBconn, AccODBCconn, odbcConn. -// */ -// // append "ConnectList.txt" to the path of the location of the exe being run -// // for example: VE-PROMS.NET\BIN or BIN\DEBUG -// // This set in Visual Studio .NET in the properties dialog of the project, select -// // Configuration Properties. You will see an option call Output Path. -// string FileName = Application.StartupPath + "\\ConnectList.txt"; -// -// if (!File.Exists(FileName)) -// { -// // File does not exist -// MessageBox.Show("Could not find ConnectList.txt file"); -// return; -// } -// -// /* -// * Open the text file for reading -// */ -// StreamReader sr = File.OpenText(FileName); -// -// /* -// * Connection string to MS-access use with oledb directly -// */ -// strAccOLEDBconn = sr.ReadLine(); -// -// /* -// * connection string to SQL-server use with oledb -// */ -// strSQLOLEDBconn = sr.ReadLine(); -// -// /* -// * connection string to for oledb to odbc dsn -// */ -// strAccODBCconn = sr.ReadLine(); -// -// /* -// * ODBC connection: -// * ACCESS: -// */ -// strodbcConn = sr.ReadLine(); -// -// sr.Close(); // close ConnectList.txt -// -// } - - private void GetDbServerInfo(string ROdir) - { -// string strConnectionType; - string strServerProvider; - string ROiniPath = ROdir + "\\ROAPP.INI"; - - //**** For now we are only doing OLE-DB - //**** - // Get the database connection type -// strConnectionType = TheIniFile.GetINIKeyValueStr("Database Server","Connection Type","OLEDB",10,ROiniPath); -// strConnectionType = strConnectionType.ToUpper(); -// if (strConnectionType.Equals("OLEDB")) -// dbConnectionType = (int)CONNTYPE.OLEDB; -// else if (strConnectionType.Equals("ODBC")) -// { -// dbConnectionType = (int)CONNTYPE.ODBC; -// dbODBC_DNS = TheIniFile.GetINIKeyValueStr("Database Server","DNS","",10,ROiniPath); -// } - - // Get the database Provider name - default to Access - IniReader in1 = new IniReader(ROiniPath); - strServerProvider = in1.ReadString("Database Server","Driver","ACCESS"); - strServerProvider = strServerProvider.ToUpper(); - if (strServerProvider.Equals("SQL SERVER")) - dbProviderType = (int)DB_PROVIDER.SQL_SERVER; - else if (strServerProvider.Equals("ORACLE")) - dbProviderType = (int)DB_PROVIDER.ORACLE; - else // default to ACCESS - dbProviderType = (int)DB_PROVIDER.ACCESS; - - // Get the database server path - dbServerPath = in1.ReadString("Database Server", "Path", ROdir); - dbServerUserName = in1.ReadString("Database Server", "UserID", ""); - dbServerPassword = in1.ReadString("Database Server", "Password", ""); - if (dbProviderType.Equals((int)DB_PROVIDER.ACCESS)) - { - if (dbServerUserName.Equals("")) - dbServerUserName = "Admin"; // default user name for Access - } - else if (dbServerUserName.Equals("") || (dbServerUserName.Length>0 && dbServerPassword.Equals(""))) - { - userpass pwdlg = new userpass(dbServerUserName); - // If using SQL Server or Oracle - // prompt for a user name and password. - pwdlg.Text = strServerProvider + pwdlg.Text; - if (pwdlg.ShowDialog() == DialogResult.OK) - { - dbServerUserName = pwdlg.uname; - dbServerPassword = pwdlg.pword; - } - else - { - dbServerUserName = ""; - dbServerPassword = ""; - } - } - } - - public void BuildConnectionString(string DataConnectionPath) - { - GetDbServerInfo(DataConnectionPath); - -// if (dbConnectionType.Equals(CONNTYPE.OLEDB)) -// { - if (dbProviderType.Equals((int)DB_PROVIDER.SQL_SERVER)) - { - /* - * Connect to SQL-server using OLEDB - */ - // !!!!! do we need the Workstation ID? if so, we need to pass this in too! - // - don't seem to need Workstation ID - jsj 1/6/04 - - // strSQLOLEDBconn = "Provider=SQLOLEDB;Persist Security Info=False;User ID=sa;Initial Catalog=RO;Data Source=DELL-W2K-SERVER\\SQL2000;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=KATHY;Use Encryption for Data=False;Tag with column collation when possible=False"; - - // strDatabaseConnectionCommand = "Provider=SQLOLEDB;Persist Security Info=False;User ID="+dbServerUserName+";Password="+dbServerPassword+";Initial Catalog=RO;Data Source=" + dbServerPath + ";Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False;Tag with column collation when possible=False"; - strDatabaseConnectionCommand = "Provider=SQLOLEDB;Persist Security Info=False;User ID="+dbServerUserName+";Password="+dbServerPassword+";Initial Catalog=VEPROMS RO;Data Source="+dbServerPath+";Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False;Tag with column collation when possible=False"; - } - else if (dbProviderType.Equals((int)DB_PROVIDER.ORACLE)) - { - // Don't know if this connect string will work or not on Oracle - // we need to test this with an Oracle Database Server - // Note that this is the same connection string used for SQL Server - // BUT the provider is different! - strDatabaseConnectionCommand = "Provider=MSDAORA;Persist Security Info=False;User ID="+dbServerUserName+";Password="+dbServerPassword+";Initial Catalog=VEPROMS RO;Data Source="+dbServerPath+";Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False;Tag with column collation when possible=False"; - } - else - { - /* - * Connect to MSAccess using OLEDB directly - */ - - // strAccOLEDBconn = "Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";User ID=Admin;Data Source=I:\\RO Design\\RO\\ROMaster.mdb;Mode=Share Deny None;Extended Properties=\"\";Jet OLEDB:System database=\"\";Jet OLEDB:Registry Path=\"\";Jet OLEDB:Database Password=\"\";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"; - - // strAccOLEDBconn = "Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";User ID=Admin;Data Source=" + DataConnectionPath +"\\ROMaster.mdb;Mode=Share Deny None;Extended Properties=\"\";Jet OLEDB:System database=\"\";Jet OLEDB:Registry Path=\"\";Jet OLEDB:Database Password=\"\";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"; - strDatabaseConnectionCommand = "Provider=Microsoft.Jet.OLEDB.4.0;Password=\"\";User ID=Admin;Data Source=" + DataConnectionPath +"\\ROMaster.mdb;Mode=Share Deny None;Extended Properties=\"\";Jet OLEDB:System database=\"\";Jet OLEDB:Registry Path=\"\";Jet OLEDB:Database Password=\"\";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password=\"\";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"; - } -// } -// else // ODBC connection -// { -// if (dbODBC_DNS.Length > 0) -// { -// -// /* -// * Connect to MSAccess using OLEDB and ODBC DSN -// */ -// -// // strAccODBCconn = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=Access for RO;Extended Properties=\"DSN=Access for RO;DBQ=I:\\RO Design\\RO\\ROMaster.mdb;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;\""; -// -// // strAccODBCconn = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=Access for RO;Extended Properties=\"DSN=Access for RO;DBQ=" + DataConnectionPath + "\\ROMaster.mdb;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;\""; -// strDatabaseConnectionCommand = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=Access for RO;Extended Properties=\"DSN=Access for RO;DBQ=" + DataConnectionPath + "\\ROMaster.mdb;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;\""; -// } -// -// /* -// * Connection to MSAccess using an ODBC connection -// */ -// // strodbcConn = "Driver={Microsoft Access Driver (*.mdb)};DBQ=i:\\Ro Design\\RO\\ROMaster.mdb"; -// strodbcConn = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" + DataConnectionPath + "\\ROMaster.mdb"; -// -// // Connection to SQL Server using an ODBC connection -// //strodbcConn = "Driver={SQL Server};Server=DELL-W2K-SERVER\\SQL2000;UID=sa;Database=ROMaster"; -// -// //SQL - DSN - worked: string strodbcConn = "DSN=SQL RO;UID=sa"; -// //Initial odbc tests on strodbcconn -// } - - } - - // get the next table name & update it to the next possible. - public string RODB_GetNextGroupTable() - { - // read record type of master for this table. This is where the highest recid is stored. - // Update the recid by 1, write it out and return the new recid. - string strGetNxt = "SELECT Info FROM ROMaster where RecID = '00000001' and RecType=" + (uint)RecordType.Master; - string rettable=null; - try - { - DBE.Command(strGetNxt); - DBE.Reader(); - if (DBE.Read()) - { - rettable = DBE.GetString(0); - string nxttable = rettable.Substring(2,6); - int ltbl = System.Convert.ToInt32(nxttable,10); - ltbl++; - nxttable = ltbl.ToString("d6"); // this format "d6" should pad left with zeros - string newstr = "RO" + nxttable; - DBE.ReaderClose(); - DBE.CommandDispose(); - string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now); - string strUpdate = "UPDATE ROMaster SET Info = '" + newstr + "'"; - strUpdate = strUpdate + ", ModDateTime = '" + dt + "' WHERE RecID = '00000001' and RecType=" + (uint)RecordType.Master; - DBE.Command(strUpdate); - DBE.Reader(); - DBE.ReaderClose(); - DBE.CommandDispose(); - return rettable; - } - - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Getting new record id"); - } - - return null; - } - - // get the next recid for this table & update it. - public string RODB_GetNextRecId(string table) - { - // read record type of master for this table. This is where the highest recid is stored. - // Update the recid by 1, write it out and return the new recid. - string strGetNxt = "SELECT Info FROM " + table + " where RecID = '00000000' and RecType=" + (uint)RecordType.Master; - - try - { - DBE.Command(strGetNxt); - DBE.Reader(); - if (DBE.Read()) - { - string RecID = DBE.GetString(0); - - int lrecid = System.Convert.ToInt32(RecID,16); - lrecid++; - RecID = lrecid.ToString("x"); - - // need an 8 char string so pad left with zero - string padstr = RecID.PadLeft(8,'0'); - DBE.ReaderClose(); - DBE.CommandDispose(); - string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now); - string strUpdate = "UPDATE " + table + " SET Info = '" + padstr + "'"; - strUpdate = strUpdate + ", ModDateTime = '" + dt + "' WHERE RecID = '00000000' and RecType=" + (uint)RecordType.Master; - DBE.Command(strUpdate); - DBE.Reader(); - DBE.ReaderClose(); - DBE.CommandDispose(); - return padstr; - } - - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Getting new record id"); - } - return null; - } - - public VlnXmlDocument RODB_GetRoot() - { - // Create an xmldoc and initialize it with a root node - ROXml = new VlnXmlDocument(); - XmlNode elem=ROXml.CreateNode(XmlNodeType.Element, "RO_Root", ""); - ROXml.AppendChild(elem); - return ROXml; - } - - // pass in root node. This will get Groups from Root node. This is a special case because - // the list of top level groups is off of the ROMaster database. - public bool RODB_GetRootGroups(VlnXmlElement root) - { - string table; - string group; - string title; - - // Get menu fields to display - try - { - DBE.OpenConnection(); - } - catch (Exception e) - { - MessageBox.Show(e.Message, "Could not open database connection"); -// MessageBox.Show(e.StackTrace,"Debug"); - return false; - } - - string strGetGroups = "SELECT RecID,Info FROM ROMaster where RecType = " + (uint) RecordType.SubDatabase; - strGetGroups += " ORDER BY RecID ASC"; - DBE.Command(strGetGroups); - DBE.Reader(); - - SortedList mySL = new SortedList(); - while(DBE.Read()) - { - // Parse info string, it has group name & table name. Store in a sorted - // list, sorting by Group Name. - string mrecid = DBE.GetString(0); - group = DBE.GetString(1); - mySL.Add(mrecid,group); - } - DBE.CommandDispose(); - DBE.ReaderClose(); - - // Now, for each group, i.e. table, make xml elements for the top level groups by - // reading in the Xml Element for the group from each table. - for ( int i = 0; i < mySL.Count; i++ ) - { - group = mySL.GetByIndex(i).ToString(); - int grnamindx = group.IndexOf("\t"); - if (grnamindx == -1) - {// no tab, default to RO000001 - table = "RO000001"; - title = group; - } - else - { - StringBuilder tablesb = new StringBuilder(70); - tablesb.Append(group); - tablesb.Remove(0,grnamindx+1); - table = tablesb.ToString(); - title = group.Substring(0,grnamindx); - } - strGetGroups = "SELECT RecID,Info FROM " + table + " where RecType = " + (uint) RecordType.Group; - strGetGroups = strGetGroups + " and ParentID = '00000000'"; - strGetGroups += " ORDER BY RecID ASC"; - try - { - DBE.Command(strGetGroups); - DBE.Reader(); - - if(DBE.Read()) - { - string RecID = DBE.GetString(0); - string Info = DBE.GetString(1); - XmlTextReader rdr = new XmlTextReader(Info, XmlNodeType.Element, null); - XmlNode nd = ROXml.ReadNode(rdr); - VlnXmlElement elem = (VlnXmlElement)nd; - root.AppendChild(elem); - elem.SetAttribute("RecID", RecID); - elem.SetAttribute("ParentID","00000000"); - elem.SetAttribute("Table", table); - elem.SetAttribute("MasterRecID", mySL.GetKey(i).ToString()); - //elem.SetAttribute("MenuTitle", elem.InnerText); - } - } - catch (Exception e) - { - MessageBox.Show(e.Message, "Error getting group data"); - // try to continue on with the next group - may be one missing table. - } - DBE.CommandDispose(); - DBE.ReaderClose(); - } - // get child count for each group. - XmlNode node = root.FirstChild; - while (node != null) - { - if (node is VlnXmlElement) - { - VlnXmlElement child = (VlnXmlElement) node; - //get child count for each table listed in innertext. - string strGetSubCount = "SELECT COUNT (RecID) as cnt FROM " + child.GetAttribute("Table") + " WHERE "; - strGetSubCount = strGetSubCount + "ParentID='" + child.GetAttribute("RecID") + "'"; - try - { - DBE.Command(strGetSubCount); - DBE.Reader(); - } - catch (Exception e) - { - MessageBox.Show(e.Message, "Error reading RO Data"); - return false; - } - if (DBE.Read()) - { - int cnt = DBE.GetInt32(0); - if (cnt>0) - child.SetAttribute("HasChild","True"); - else - child.SetAttribute("HasChild","False"); - child.SetAttribute("ChildLoaded","False"); - } - DBE.CommandDispose(); - DBE.ReaderClose(); - } - - node = node.NextSibling; - } - - // for the beginning and end schema element, go to the master & read it from there. Store these to be used - // by all of the databases. - - string strGetSchemaPiece; - schemastart = null; - strGetSchemaPiece = "SELECT Info From ROMaster where (ParentID='00000000' and RecType = " + (uint) RecordType.SchemaStart + ")"; - DBE.Command(strGetSchemaPiece); - DBE.Reader(); - if (DBE.Read()) - schemastart = DBE.GetString(0); - else - { - DBE.CommandDispose(); - DBE.ReaderClose(); - return false; - } - DBE.CommandDispose(); - DBE.ReaderClose(); - schemaend = null; - strGetSchemaPiece = "SELECT Info From ROMaster where (ParentID='00000000' and RecType = " + (uint) RecordType.SchemaEnd + ")"; - DBE.Command(strGetSchemaPiece); - DBE.Reader(); - if (DBE.Read()) - schemaend = DBE.GetString(0); - else - { - DBE.CommandDispose(); - DBE.ReaderClose(); - return false; - } - DBE.CommandDispose(); - DBE.ReaderClose(); - return true; - - } - - public bool RODB_DeleteGroup(XmlNode group, string tbname, string toprecid) - { - VlnXmlElement egroup = null; - string strDel; - strDel = "DELETE FROM ROMaster WHERE "; - - // delete table entry in ROMaster - if (group !=null) - { - egroup = (VlnXmlElement) group; - strDel = strDel + "RecID='" + egroup.GetAttribute("MasterRecID") + "'"; - } - else - strDel = strDel + "RecID='" + toprecid + "'"; - - try - { - DBE.Command(strDel); - DBE.Reader(); - DBE.Read(); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error When deleting SubGroup ROs."); - DBE.CommandDispose(); - DBE.ReaderClose(); - return false; - } - DBE.CommandDispose(); - DBE.ReaderClose(); - - // now remove the table. - if (egroup != null) - strDel = "DROP TABLE " + egroup.GetAttribute("Table"); - else - strDel = "DROP TABLE " + tbname; - try - { - DBE.Command(strDel); - DBE.Reader(); - DBE.Read(); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error When deleting SubGroup ROs."); - DBE.CommandDispose(); - DBE.ReaderClose(); - return false; - } - DBE.CommandDispose(); - DBE.ReaderClose(); - return true; - } - - // Delete from database either the group or RO from input node. - public bool RODB_DeleteRO(XmlNode group) - { - // delete from database and then delete from tree. delete group and all - // subgroups & ros beneath it. delete subgroups by calling this. - // note that if just an ro is passed in, it will only delete it. - XmlNode node = group.FirstChild; - VlnXmlElement child; - VlnXmlElement egroup = (VlnXmlElement) group; - string strDelSub; - if (group.Name == "vlnGroup") - { - while (node != null) - { - if (node is VlnXmlElement) - { - child = (VlnXmlElement) node; - // if this is a group, call this again. - if (child.Name == "vlnGroup") - { - bool success = RODB_DeleteRO(node); - if (success == false) - { - MessageBox.Show("error in RODB_DeleteGroup"); - return false; - } - } - - } - node = node.NextSibling; - } - - // delete all db records that have the ParentID = to this group RecID. - // (All subgroups should be processed from above recursion. - strDelSub = "DELETE FROM " + egroup.GetAttribute("Table") + " WHERE "; - strDelSub = strDelSub + "ParentID='" + egroup.GetAttribute("RecID") + "'"; - try - { - DBE.Command(strDelSub); - DBE.Reader(); - DBE.Read(); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error When deleting SubGroup ROs."); - DBE.CommandDispose(); - DBE.ReaderClose(); - return false; - } - DBE.CommandDispose(); - DBE.ReaderClose(); - } - - // now delete this ro or group, i.e. the one passed in. - strDelSub = "DELETE FROM " + egroup.GetAttribute("Table") + " WHERE "; - strDelSub = strDelSub + "RecID='" + egroup.GetAttribute("RecID") + "'"; - try - { - DBE.Command(strDelSub); - DBE.Reader(); - DBE.Read(); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error When deleting this RO."); - DBE.CommandDispose(); - DBE.ReaderClose(); - return false; - } - DBE.CommandDispose(); - DBE.ReaderClose(); - - return true; - } - - private string GenerateXmlString(XmlNode node, bool isgroup) - { - string retstr; - XmlTextWriter xmlTextWriter; - StringWriter strWriter = new StringWriter(); - xmlTextWriter = new XmlTextWriter(strWriter); - VlnXmlElement enode; - XmlNode kid; - kid = node.FirstChild; - enode = (VlnXmlElement) node; - - if (isgroup == true) - { - xmlTextWriter.WriteStartElement("vlnGroup"); - if (enode.HasAttribute("RetVal")) - { - xmlTextWriter.WriteStartAttribute("RetVal", null); - xmlTextWriter.WriteString(enode.GetAttribute("RetVal")); - xmlTextWriter.WriteEndAttribute(); - } - if (enode.HasAttribute("MenuItem")) - { - xmlTextWriter.WriteStartAttribute("MenuItem", null); - xmlTextWriter.WriteString(enode.GetAttribute("MenuItem")); - xmlTextWriter.WriteEndAttribute(); - } - if (enode.HasAttribute("FieldsInUse")) - { - xmlTextWriter.WriteStartAttribute("FieldsInUse", null); - xmlTextWriter.WriteString(enode.GetAttribute("FieldsInUse")); - xmlTextWriter.WriteEndAttribute(); - } - if (enode.HasAttribute("GroupMenuItem")) - { - xmlTextWriter.WriteStartAttribute("GroupMenuItem", null); - xmlTextWriter.WriteString(enode.GetAttribute("GroupMenuItem")); - xmlTextWriter.WriteEndAttribute(); - } - if (enode.HasAttribute("GroupFieldsInUse")) - { - xmlTextWriter.WriteStartAttribute("GroupFieldsInUse", null); - xmlTextWriter.WriteString(enode.GetAttribute("GroupFieldsInUse")); - xmlTextWriter.WriteEndAttribute(); - } - if (enode.HasAttribute("AccPageID")) - { - xmlTextWriter.WriteStartAttribute("AccPageID", null); - xmlTextWriter.WriteString(enode.GetAttribute("AccPageID")); - xmlTextWriter.WriteEndAttribute(); - } - if (enode.HasAttribute("AccPageIDPrefix")) - { - xmlTextWriter.WriteStartAttribute("AccPageIDPrefix", null); - xmlTextWriter.WriteString(enode.GetAttribute("AccPageIDPrefix")); - xmlTextWriter.WriteEndAttribute(); - } - xmlTextWriter.WriteStartAttribute("MenuTitle", null); - xmlTextWriter.WriteString(enode.GetAttribute("MenuTitle")); - xmlTextWriter.WriteEndAttribute(); - - while (kid != null) - { - if ((kid is XmlText) || (kid.ChildNodes.Count == 1 && kid.Name != "vlnGroup")) - kid.WriteTo(xmlTextWriter); - kid = kid.NextSibling; - } - } - else - { - xmlTextWriter.WriteStartElement(node.Name); - - xmlTextWriter.WriteStartAttribute("MenuTitle", null); - xmlTextWriter.WriteString(enode.GetAttribute("MenuTitle")); - xmlTextWriter.WriteEndAttribute(); - - while (kid != null) - { - kid.WriteTo(xmlTextWriter); - kid = kid.NextSibling; - } - } - - xmlTextWriter.WriteEndElement(); // vlnGroup or top of RO. - xmlTextWriter.Flush(); - xmlTextWriter.Close(); - - retstr = strWriter.ToString(); - - // replace the single quote because ODBC fails if it's in a string because - // the single quote represents the beg/end of string when sending string to - // ODBC. - retstr = retstr.Replace("\'","'"); - return(retstr); - } - - public bool RODB_WriteGroup(XmlNode group, VlnXmlElement master) - { - bool retval = true; - string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now); - string xmlstr = GenerateXmlString(group, true); - string strUpdate = "UPDATE " + master.GetAttribute("Table") + " SET Info = '" + xmlstr + "'"; - strUpdate = strUpdate + ", ModDateTime = '" + dt + "' WHERE RecID='" + master.GetAttribute("RecID") + "'"; - try - { - DBE.Command(strUpdate); - DBE.Reader(); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error on write group"); - retval = false; - } - DBE.ReaderClose(); - DBE.CommandDispose(); - return retval; - } - - public bool RODB_InsertGroup(VlnXmlElement group) - { - bool retval = true; - string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now); - string xmlstr = GenerateXmlString(group, true); - string strInsert = "INSERT INTO " + group.GetAttribute("Table") + "(RecID, RecType, ParentID, ModDateTime, Info) "; - strInsert = strInsert + " VALUES ('" + group.GetAttribute("RecID") + "'," + (uint) RecordType.Group + ",'"; - strInsert = strInsert + group.GetAttribute("ParentID") + "','" + dt + "','" + xmlstr + "');"; - try - { - DBE.Command(strInsert); - DBE.Reader(); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error on insert group"); - retval = false; - } - DBE.ReaderClose(); - DBE.CommandDispose(); - return retval; - } - - // add a new database table, add a record to master to point to it. return - // that record number. - public string RODB_AddNewTable(string TblName, string newgrpname) - { - bool retval = false; - // create the table. this is done by doing a select into the new table - // from the RoMaster because using the create table command didn't have - // a datatype that was compatible between sql & ms-access (for the memo - // field 'Info'). - string strMkTable = "SELECT * INTO " + TblName; - strMkTable = strMkTable + " FROM ROMaster WHERE RecID = '00000000';"; - - try - { - DBE.Command(strMkTable); - DBE.Reader(); - retval = true; - } - catch (Exception e) - { - MessageBox.Show(e.Message, "Error creating table."); - } - DBE.ReaderClose(); - DBE.CommandDispose(); - // return if error on table create. - if (retval == false) return null; - - // remove the first record. It was inserted just to have something to copy to - // create the table. (see previous comment) - - string strDel = "DELETE FROM " + TblName + " WHERE RecID = '00000000'"; - try - { - DBE.Command(strDel); - DBE.Reader(); - DBE.Read(); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error When deleting SubGroup ROs."); - DBE.CommandDispose(); - DBE.ReaderClose(); - return null; - } - DBE.CommandDispose(); - DBE.ReaderClose(); - - // now insert the first record - string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now); - - string strInsert = "INSERT INTO " + TblName + "( RecID, RecType, ParentID, ModDateTime, Info ) "; - strInsert = strInsert + " VALUES ('00000000', 0,'00000000','" + dt + "','00000001');"; - retval = false; - try - { - DBE.Command(strInsert); - DBE.Reader(); - retval=true; - } - catch (Exception e) - { - MessageBox.Show(e.Message, "Error creating table."); - } - DBE.ReaderClose(); - DBE.CommandDispose(); - - // return if error on insert of master record of new table, otherwise add - // this table reference to the master. - if (retval == false) return null; - string recid = RODB_GetNextRecId("ROMaster"); - string info = CvtUserFldToFld(newgrpname) + "\t" + TblName; - strInsert = "INSERT INTO ROMaster ( RecID, RecType, ParentID, ModDateTime, Info ) "; - strInsert = strInsert + " VALUES ('"+recid+"', 1,'00000001','" + dt + "','"+info+"');"; - retval = false; - try - { - DBE.Command(strInsert); - DBE.Reader(); - retval=true; - } - catch (Exception e) - { - MessageBox.Show(e.Message, "Error writing new table to master."); - } - DBE.ReaderClose(); - DBE.CommandDispose(); - if (retval == false) - return null; - else - return recid; - } - - // Copy over field definitions from the ROMaster to the input table. - public bool RODB_CopyFieldDefs(string fromtb, string totb, int type) - { - ArrayList retlist = new ArrayList(); - string strGetFields; - string Info; - string RecID; - string name; - uint ftype; - ROField rof; - bool success; - - // select all of the field definition records in this table. - strGetFields = "SELECT RecID, Info from ROMaster where RecType = 2"; - DBE.Command(strGetFields); - DBE.Reader(); - - while (DBE.Read()) - { - RecID = DBE.GetString(0); - Info = DBE.GetString(1); - // it's defined in the local table if the first character is "<" which starts - // the schema definition string. - - name = ParseEleName(Info); - if (name != null) - { - // what type of schema element? - rof = new ROField(name, RecID, null, 0); - ftype = rof.ParseFieldType(Info); - rof.SetFieldType(ftype); - retlist.Add((object) rof); - } - } - - DBE.ReaderClose(); - DBE.CommandDispose(); - - // using this list, add new records for field defintion references to the new - // table. - for (int i=0; i< retlist.Count; i++) - { - rof = (ROField) retlist[i]; - if (rof.GetFieldname != null) - { - string mrecid = rof.GetRecID; - string lrecid = RODB_GetNextRecId(totb); - StringBuilder strbld = new StringBuilder(); - strbld.Append(mrecid); - strbld.Append(" "); - string strtype = rof.GetFieldType.ToString(); - strbld.Append(strtype.PadLeft(3,'0')); - strbld.Append(" "); - if (strtype == "128") // append an 'a' for combo type - strbld.Append(rof.MakeFieldName(rof.GetFieldname)+"a"); - else - strbld.Append(rof.MakeFieldName(rof.GetFieldname)); - // add new field. - success = RODB_NewSchemaPiece(lrecid, "00000002", totb, strbld.ToString(), 2); - if (success == false) return false; - } - } - return true; - } - - - // This is simular to GetChildData() but this function reads in - // all the subgroups for the given node - // Note that this function is designed to be call for the - // root node (i.e. it gets all of group and RO data for a given - // database table) - public bool RODB_GetGroupAndSubgroups(VlnXmlElement node) - { - VlnStatusBar StatBar = new VlnStatusBar("Reading from the Database"); - string tablename = node.GetAttribute("Table"); - - string strGetChildData = "SELECT * FROM " + tablename; - strGetChildData = strGetChildData + " where (RecType = 3 or RecType = 5) AND ParentID <> '00000002' ORDER BY ParentID,RecID ASC"; - HybridDictionary dicGroups = new HybridDictionary(); - dicGroups.Add(node.GetAttribute("RecID").ToString(), node); - StatBar.BarMax = RODB_GetNumberOfGroupRecords(tablename); //get number of groups - StatBar.BarStepValue = 5; - StatBar.StatMsg = node.InnerText; - - DBE.Command(strGetChildData); - DBE.Reader(); - // skip the first record - it's the node that we passed in - if (!DBE.Read()) - { - DBE.ReaderClose(); - StatBar.PerformStep(1); - return false; - } - while (DBE.Read()) - { - string RecID = DBE.GetString(0); - int RecType = DBE.GetInt32(1); - string ParID = DBE.GetString(2); - string AccPageID = DBE.GetString(3); - string Info = DBE.GetString(5); - if (!ParID.Equals(node.GetAttribute("RecID"))) - { - if (!dicGroups.Contains(ParID)) - { - string strMBText = "The following record is being skipped. The parent for this RO is missing:\n\n RecID: " + RecID + "\n\n Table: " + tablename +"\n"; - MessageBox.Show(strMBText, "Warning - Orphan RO Record"); - continue; // skip - no parent for this node - } - node = (VlnXmlElement)dicGroups[ParID]; - node.SetAttribute("HasChild", "True"); - node.SetAttribute("ChildLoaded","True"); - } - else - { - node.SetAttribute("ChildLoaded","True"); - } - if (RecType == (uint) RecordType.Group) - { - VlnXmlElement elem; - StatBar.PerformStep(); - try - { - XmlTextReader rdr = new XmlTextReader(Info, XmlNodeType.Element, null); - XmlNode nd = ROXml.ReadNode(rdr); - elem = (VlnXmlElement)nd; - } - catch (Exception e) - { - MessageBox.Show(e.Message, "Error reading Xml Group From data"); - DBE.ReaderClose(); - return false; - } - - elem.SetAttribute("RecID", RecID); - elem.SetAttribute("ParentID",node.GetAttribute("RecID")); - elem.SetAttribute("Table", node.GetAttribute("Table")); - - if (!dicGroups.Contains(RecID)) - { - node.AppendChild(elem); - dicGroups.Add(RecID,elem); - } - - // The Parameter Display Data is stored along with the group. This data - // was migrated over so that the data was not lost, but there is no - // User Interface to get to it. So remove the xml elements from the - // group part of tree. All valid group data only has one sublevel of - // data defining the group name. - XmlNode grp = (XmlNode) elem; - XmlNode kid = grp.FirstChild; - XmlNode tmpkid; - while (kid != null) - { - tmpkid = kid.NextSibling; - if (kid is VlnXmlElement) - if (kid.ChildNodes.Count>1) grp.RemoveChild(kid); - kid = tmpkid; - } - } - // Store data in the VlnXmlElement as an RO - else if (RecType == (uint) RecordType.RRO) - { - //Create the reader. - XmlNode ro; - try - { - XmlTextReader roreader = new XmlTextReader(Info, XmlNodeType.Element, null); - ro = ROXml.ReadNode(roreader); - } - catch (Exception e) - { - MessageBox.Show(e.Message, "Error reading Xml RRO From data"); - DBE.ReaderClose(); - return false; - } - - VlnXmlElement elem = (VlnXmlElement) ro; - node.AppendChild(ro); - elem.SetAttribute("RecID", RecID); - elem.SetAttribute("ParentID",node.GetAttribute("RecID")); - elem.SetAttribute("Table", node.GetAttribute("Table")); - elem.SetAttribute("AccPageID", AccPageID); - } - } - DBE.ReaderClose(); - dicGroups = null; - StatBar.Dispose(); - return true; - } - - public bool RODB_GetChildData(VlnXmlElement node,bool CheckChildCount) - { - // get menu fields to display here. - string tablename = node.GetAttribute("Table"); - string strGetChildData = "SELECT RecID,RecType,AccPageID, Info FROM " + tablename + " where "; - strGetChildData = strGetChildData + "(RecType = " + (uint)RecordType.Group + " or RecType = "; - strGetChildData = strGetChildData + (uint)RecordType.RRO + ") and "; - strGetChildData = strGetChildData + "ParentID='" + node.GetAttribute("RecID") + "'"; - strGetChildData += " ORDER BY RecID ASC"; - //bool readit=false; - DBE.Command(strGetChildData); - DBE.Reader(); - while (DBE.Read()) - { - //get count for attribute element - string RecID = DBE.GetString(0); - int RecType = DBE.GetInt32(1); - string AccPageID = DBE.GetString(2); - string Info = DBE.GetString(3); - node.SetAttribute("HasChild", "True"); - // Store data in the VlnXmlElement as a subgroup - if (RecType == (uint) RecordType.Group) - { - VlnXmlElement elem; - try - { - XmlTextReader rdr = new XmlTextReader(Info, XmlNodeType.Element, null); - XmlNode nd = ROXml.ReadNode(rdr); - elem = (VlnXmlElement)nd; - } - catch (Exception e) - { - MessageBox.Show(e.Message, "Error reading Xml Group From data"); - DBE.ReaderClose(); - return false; - } - node.AppendChild(elem); - elem.SetAttribute("RecID", RecID); - elem.SetAttribute("ParentID",node.GetAttribute("RecID")); - elem.SetAttribute("Table", node.GetAttribute("Table")); - - // The Parameter Display Data is stored along with the group. This data - // was migrated over so that the data was not lost, but there is no - // User Interface to get to it. So remove the xml elements from the - // group part of tree. All valid group data only has one sublevel of - // data defining the group name. - XmlNode grp = (XmlNode) elem; - XmlNode kid = grp.FirstChild; - XmlNode tmpkid; - while (kid != null) - { - tmpkid = kid.NextSibling; - if (kid is VlnXmlElement) - if (kid.ChildNodes.Count>1) grp.RemoveChild(kid); - kid = tmpkid; - } - } - // Store data in the VlnXmlElement as an RO - else if (RecType == (uint) RecordType.RRO) - { - //Create the reader. - XmlNode ro; - try - { - XmlTextReader roreader = new XmlTextReader(Info, XmlNodeType.Element, null); - ro = ROXml.ReadNode(roreader); - } - catch (Exception e) - { - MessageBox.Show(e.Message, "Error reading Xml RRO From data"); - DBE.ReaderClose(); - return false; - } - - VlnXmlElement elem = (VlnXmlElement) ro; - node.AppendChild(ro); - elem.SetAttribute("RecID", RecID); - elem.SetAttribute("ParentID",node.GetAttribute("RecID")); - elem.SetAttribute("Table", node.GetAttribute("Table")); - elem.SetAttribute("AccPageID", AccPageID); - } - } - DBE.ReaderClose(); - - // get child count for each subgroup. - if(CheckChildCount) - { - //A different approach - Look for grandchildren and set the haschildren attribute - //Build a query to get a list of children with children - string strGetSubCount = "SELECT R1.ParentID,COUNT(*) AS CNT FROM " + tablename + " R1 " - + "INNER JOIN " + tablename + " R2 ON R1.ParentID = R2.RecID " - + "WHERE (R1.RecType = " + (uint)RecordType.Group + " or R1.RecType=" + (uint)RecordType.RRO + ") " - + "and R2.ParentID ='" + node.GetAttribute("RecID") + "' group by R1.ParentID;"; - try - { - DBE.Command(strGetSubCount); - DBE.Reader(); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error reading data"); - } - //Build a Dictionary of Children with Children from the query results - HybridDictionary dicChild = new HybridDictionary(); - while(DBE.Read()) - dicChild[DBE.GetString(0)]=DBE.GetInt32(1);//This adds the entry and sets the value - DBE.CommandDispose(); - DBE.ReaderClose(); - XmlNode child = node.FirstChild; - while (child != null) //Look at each child node - { - if (child is VlnXmlElement) - { - VlnXmlElement echild = (VlnXmlElement) child; - if (echild.Name == "vlnGroup") - { - //If the dictionary contains an entry, the child has children - echild.SetAttribute("HasChild",(dicChild.Contains(echild.GetAttribute("RecID")))?"True":"False"); - echild.SetAttribute("ChildLoaded", "False"); - } - } - child = child.NextSibling; - } - dicChild=null; - } - node.SetAttribute("ChildLoaded","True"); - return true; - } - -// public bool OLD_RODB_GetChildData(VlnXmlElement node,bool CheckChildCount) -// { -// Profiler.Start("GCD_1"); -// // get menu fields to display here. -// string tablename = node.GetAttribute("Table"); -// string strGetChildData = "SELECT RecID,RecType,AccPageID, Info FROM " + tablename + " where "; -// strGetChildData = strGetChildData + "(RecType = " + (uint)RecordType.Group + " or RecType = "; -// strGetChildData = strGetChildData + (uint)RecordType.RRO + ") and "; -// strGetChildData = strGetChildData + "ParentID='" + node.GetAttribute("RecID") + "'"; -// strGetChildData += " ORDER BY RecID ASC"; -// Profiler.End("GCD_1"); -// //bool readit=false; -// Profiler.Start("GCD_2"); -// DBE.Command(strGetChildData); -// Profiler.End("GCD_2"); -// Profiler.Start("GCD_3"); -// DBE.Reader(); -// Profiler.End("GCD_3"); -// Profiler.Start("GCD_4"); -// while (DBE.Read()) -// { -// //get count for attribute element -// string RecID = DBE.GetString(0); -// int RecType = DBE.GetInt32(1); -// string AccPageID = DBE.GetString(2); -// string Info = DBE.GetString(3); -// node.SetAttribute("HasChild", "True"); -// // Store data in the VlnXmlElement as a subgroup -// if (RecType == (uint) RecordType.Group) -// { -// VlnXmlElement elem; -// try -// { -// XmlTextReader rdr = new XmlTextReader(Info, XmlNodeType.Element, null); -// XmlNode nd = ROXml.ReadNode(rdr); -// elem = (VlnXmlElement)nd; -// } -// catch (Exception e) -// { -// MessageBox.Show(e.Message, "Error reading Xml Group From data"); -// DBE.ReaderClose(); -// return false; -// } -// node.AppendChild(elem); -// elem.SetAttribute("RecID", RecID); -// elem.SetAttribute("ParentID",node.GetAttribute("RecID")); -// elem.SetAttribute("Table", node.GetAttribute("Table")); -// -// // The Parameter Display Data is stored along with the group. This data -// // was migrated over so that the data was not lost, but there is no -// // User Interface to get to it. So remove the xml elements from the -// // group part of tree. All valid group data only has one sublevel of -// // data defining the group name. -// XmlNode grp = (XmlNode) elem; -// XmlNode kid = grp.FirstChild; -// XmlNode tmpkid; -// while (kid != null) -// { -// tmpkid = kid.NextSibling; -// if (kid is VlnXmlElement) -// if (kid.ChildNodes.Count>1) grp.RemoveChild(kid); -// kid = tmpkid; -// } -// } -// -// // Store data in the VlnXmlElement as an RO -// else if (RecType == (uint) RecordType.RRO) -// { -// //Create the reader. -// XmlNode ro; -// try -// { -// XmlTextReader roreader = new XmlTextReader(Info, XmlNodeType.Element, null); -// ro = ROXml.ReadNode(roreader); -// } -// catch (Exception e) -// { -// MessageBox.Show(e.Message, "Error reading Xml RRO From data"); -// DBE.ReaderClose(); -// return false; -// } -// -// -// VlnXmlElement elem = (VlnXmlElement) ro; -// node.AppendChild(ro); -// elem.SetAttribute("RecID", RecID); -// elem.SetAttribute("ParentID",node.GetAttribute("RecID")); -// elem.SetAttribute("Table", node.GetAttribute("Table")); -// elem.SetAttribute("AccPageID", AccPageID); -// } -// } -// Profiler.End("GCD_4"); -// Profiler.Start("GCD_5"); -// DBE.ReaderClose(); -// -// if (CheckChildCount) -// { -// // get child count for each subgroup. -// XmlNode child = node.FirstChild; -// // while (child != null && CheckChildCount) -// while (child != null) -// { -// if (child is VlnXmlElement) -// { -// VlnXmlElement echild = (VlnXmlElement) child; -// if (echild.Name == "vlnGroup") -// { -// //get child count for each table listed in innertext. -// string strGetSubCount = "SELECT COUNT(RecID) AS CNT FROM " + echild.GetAttribute("Table") + " WHERE "; -// strGetSubCount = strGetSubCount + "(RecType = " + (uint)RecordType.Group + " or RecType=" + (uint)RecordType.RRO + ")"; -// strGetSubCount = strGetSubCount + " and ParentID='" + echild.GetAttribute("RecID") + "'"; -// try -// { -// DBE.Command(strGetSubCount); -// DBE.Reader(); -// } -// catch (Exception e) -// { -// MessageBox.Show(e.Message,"Error reading data"); -// } -// if (DBE.Read()) -// { -// int cnt = DBE.GetInt32(0); -// if (cnt>0) -// echild.SetAttribute("HasChild","True"); -// else -// echild.SetAttribute("HasChild","False"); -// echild.SetAttribute("ChildLoaded", "False"); -// } -// DBE.CommandDispose(); -// DBE.ReaderClose(); -// } -// } -// child = child.NextSibling; -// } -// } -// node.SetAttribute("ChildLoaded","True"); -// Profiler.End("GCD_5"); -// return true; -// } - - public bool IsDuplicateAccPageID(VlnXmlElement ro,string newacc) - { - string strcheck, inacc=null; - bool isdup=false; - int indx = newacc.IndexOf("'"); - if (indx >= 0) - inacc=newacc.Insert(indx,"'"); - else - inacc=newacc; - strcheck = "SELECT Count(RecID) AS CNT FROM " + ro.GetAttribute("Table") + " WHERE AccPageID = '" + inacc + "'"; - - if (ro.HasAttribute("RecID")) // new ro's don't have recid defined yet before this test. - strcheck = strcheck + " AND (NOT RecID = '" + ro.GetAttribute("RecID") + "')"; - try - { - DBE.Command(strcheck); - DBE.Reader(); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error on check"); - return true; - } - if (DBE.Read()) - { - int cnt = DBE.GetInt32(0); - if (cnt>0) - isdup = true; - else - isdup = false; - } - DBE.CommandDispose(); - DBE.ReaderClose(); - return isdup; - } - - public VlnXmlElement RODB_ReadRO(string tbl, string recid) - { - VlnXmlElement retele = null; - string readstr = "SELECT ParentID, AccPageID, Info FROM " + tbl + " WHERE RecID = '" + recid + "'"; - try - { - DBE.Command(readstr); - DBE.Reader(); - - if (DBE.Read()) - { - string ParentID = DBE.GetString(0); - string AccPageID = DBE.GetString(1); - string Info = DBE.GetString(2); - // Store data in the VlnXmlElement - XmlTextReader rdr = new XmlTextReader(Info, XmlNodeType.Element, null); - XmlNode nd = ROXml.ReadNode(rdr); - retele = (VlnXmlElement)nd; - retele.SetAttribute("RecID", recid); - retele.SetAttribute("ParentID",ParentID); - retele.SetAttribute("Table", tbl); - if (retele.Name != "vlnGroup") retele.SetAttribute("AccPageID", AccPageID); - } - DBE.CommandDispose(); - DBE.ReaderClose(); - - // if this is a group, see if children. - if (retele.Name == "vlnGroup") - { - string strGetSubCount = "SELECT COUNT (RecID) as cnt FROM " + tbl + " WHERE "; - strGetSubCount = strGetSubCount + "ParentID='" + recid + "'"; - DBE.Command(strGetSubCount); - DBE.Reader(); - - if (DBE.Read()) - { - int cnt = DBE.GetInt32(0); - if (cnt>0) - retele.SetAttribute("HasChild","True"); - else - retele.SetAttribute("HasChild","False"); - retele.SetAttribute("ChildLoaded","False"); - } - DBE.CommandDispose(); - DBE.ReaderClose(); - } - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error on Read of RO"); - return null; - } - return retele; - } - - public bool RODB_WriteRO(VlnXmlElement ro) - { - bool success; - if (ro.Name == "vlnGroup") - { - success = RODB_WriteGroup(ro, ro); - return success; - } - else - { - string wraccid=null; - string accid = ro.GetAttribute("AccPageID"); - int quote = accid.IndexOf("'"); - if (quote>=0) - wraccid = accid.Insert(quote,"'"); - else - wraccid = accid; - string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now); - string xmlstr = GenerateXmlString(ro, false); - string strUpdate = "UPDATE " + ro.GetAttribute("Table") + " SET Info = '" + xmlstr + "'"; - strUpdate = strUpdate + ", ModDateTime = '" + dt + "', AccPageID = '" + wraccid + "' WHERE RecID='" + ro.GetAttribute("RecID") + "'"; - try - { - DBE.Command(strUpdate); - DBE.Reader(); - success = true; - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Database Write Error"); - success = false; - } - DBE.ReaderClose(); - DBE.CommandDispose(); - } - return success; - } - - public bool RODB_InsertRO(VlnXmlElement ro) - { - bool success=false; - string strInsert=null; - string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now); - VlnXmlElement parent = (VlnXmlElement)ro.ParentNode; - string lrecid = RODB_GetNextRecId(parent.GetAttribute("Table")); - ro.SetAttribute("Table",parent.GetAttribute("Table")); - ro.SetAttribute("RecID",lrecid); - ro.SetAttribute("ParentID",parent.GetAttribute("RecID")); - string haskids = parent.GetAttribute("HasChild"); - if (haskids == "False" || haskids=="") - { - parent.SetAttribute("HasChild","True"); - parent.SetAttribute("ChildLoaded", "True"); - } - string xmlstr = GenerateXmlString(ro, false); - string wraccid=null; - if (ro.HasAttribute("AccPageID")) - { - string accid = ro.GetAttribute("AccPageID"); - int quote = accid.IndexOf("'"); - if (quote>=0) - wraccid = accid.Insert(quote,"'"); - else - wraccid = accid; - } - if (ro.Name == "vlnGroup") - { - // add attribute to flag that this does not have xml children, i.e. any - // other subgroups or ros under it. - ro.SetAttribute("HasChild", "False"); - if (ro.HasAttribute("AccPageID")) - { - strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, AccPageID, Info ) "; - strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint) RecordType.Group + ",'" + ro.GetAttribute("ParentID"); - strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');"; - } - else - { - strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, ModDateTime, Info ) "; - strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint) RecordType.Group + ",'" + ro.GetAttribute("ParentID"); - strInsert = strInsert + "','" + dt + "','" + xmlstr + "');"; - } - - } - else - { - strInsert = "INSERT INTO " + parent.GetAttribute("Table") + "( RecID, RecType, ParentID, AccPageId, ModDateTime, Info ) "; - strInsert = strInsert + " VALUES ('" + ro.GetAttribute("RecID") + "'," + (uint) RecordType.RRO + ",'" + ro.GetAttribute("ParentID"); - strInsert = strInsert + "','" + wraccid + "','" + dt + "','" + xmlstr + "');"; - } - - try - { - DBE.Command(strInsert); - DBE.Reader(); - success=true; - } - catch (Exception e) - { - MessageBox.Show(e.Message, "Database Write Error"); - } - DBE.ReaderClose(); - DBE.CommandDispose(); - return success; - } - - private string ParseEleName(string info) - { - string elemname; - - // need to find element type too. - int issingle = info.IndexOf("Single"); - - int idx1 = info.IndexOf("element name="); - if (idx1 >0) - { - elemname=info.Substring(idx1+14,info.Length-idx1-14); - idx1 = elemname.IndexOf("\""); - elemname = CvtFldToUserFld(elemname.Substring(0,idx1)); - // if we have a choice element, remove the last character (it was added to the - // field names in order to allow for unique fields names for the choice items. - if (info.IndexOf("xsd:choice") > 0) - { - string trun = elemname.Remove((elemname.Length)-1,1); - return trun; - } - return elemname; - } - return null; - } - - - // Given an element to start at, get the fields in use. Pass in the element you're - // on, the available list for this group & a string representing 'FieldsInUse' or - // 'GroupFieldsInUse'. - public ArrayList RODB_GetFieldsInUse(VlnXmlElement elem, ArrayList avail, string strFieldsInUse, ref string origFieldsInUse, bool RemoveFromAvailList) - { - VlnXmlElement startelem = elem; - - // if doing groups, the fields in use is defined for the parent (except for the top node) - //if (useparent == true && elem.ParentNode.Name != "RO_Root") - // startelem = (VlnXmlElement) elem.ParentNode; - - // if this element doesn't have any fields in use, walk up the tree until - // we find them. - string FieldsInUse=""; - if (startelem.HasAttribute(strFieldsInUse) == false) - { - VlnXmlElement parent; - parent = (VlnXmlElement) startelem.ParentNode; - while (parent != null && FieldsInUse == "") - { - FieldsInUse = parent.GetAttribute(strFieldsInUse); - if (parent.Name != "RO_Root") - parent = (VlnXmlElement) parent.ParentNode; - else - parent = null; - } - } - else - FieldsInUse = startelem.GetAttribute(strFieldsInUse); - - origFieldsInUse = FieldsInUse; // make a copy to compare to later. - ArrayList inuse = new ArrayList(); - // if there are no fields in use (may be inserting a top group) - // return an empty list. - if (FieldsInUse=="") return inuse; - - // Go through the FieldsInUse list and move elements from the avail list - // to the inuse list - int strpos = 0; - string recid; - recid = FieldsInUse.Substring(strpos,8); - while (recid != null) - { - // find it in avail list. Remove it from there & add to inuse list - for(int i=0; i FieldsInUse.Length) - recid = null; - else - { - recid = FieldsInUse.Substring(strpos,8); - } - } - return inuse; - } - - private string CvtUserFldToFld(string fldname) - { - if (fldname.Length < 2) - return fldname; - // a digit cannot start an xml fieldname, prepend a "__" to it. - string tmp0; - if (char.IsDigit(fldname,0)) - tmp0 = "__" + fldname; - else - tmp0 = fldname; - // an xml fieldname cannot have a space, change it to a "__" - string tmpstr = tmp0.Replace(" ","__"); - int len = tmpstr.Length; - int cnt = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval; - - while (cnt < len) - { - char tmpchr = tmpstr[cnt]; - if(!char.IsLetterOrDigit(tmpchr)&& (OKpunch.IndexOf(tmpchr) == -1) ) - { - decval = tmpchr; - outstr += OKpunch + decval.ToString("D3"); - } - else - { - outstr += tmpchr.ToString(); - } - cnt++; - } - return outstr; - } - - private string CvtFldToUserFld(string fldname) - { - string tmpstr0; - if (fldname.Length < 2) return fldname; - // an xml element name cannot begin with a digit. we had prepended a "__" - if (fldname.Substring(0,2) == "__" && char.IsDigit(fldname,2)) - tmpstr0 = fldname.Substring(2,fldname.Length-2); - else - tmpstr0 = fldname; - // an xml element name cannot have a space, we converted to a "__" - string tmpstr = tmpstr0.Replace("__"," "); - int len = tmpstr.Length; - int cur = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval, indx; - if (tmpstr.Length <6) - indx = -1; - else - indx=tmpstr.IndexOf(OKpunch,cur); - string asc_spchar; - while (indx>=0) - { - outstr += tmpstr.Substring(cur,indx-cur); - asc_spchar = tmpstr.Substring(indx+3,3); - decval = System.Convert.ToInt16(asc_spchar,10); - outstr += System.Convert.ToChar(decval).ToString(); - cur = indx+6; - if (cur+6 > len) - indx = -1; - else - indx = tmpstr.IndexOf(OKpunch,cur); - } - if (cur= 0) // is this field being used? - { -// rof = new ROField(name, RecID, null, 0); - ftype |= GetFSTreturnType(System.Convert.ToUInt16(rof.ParseFieldType(Info)),tmpname,elem); -// ftype |= System.Convert.ToUInt16(rof.ParseFieldType(Info)); - } - } - } - else - { - // references master, but what we need is here: the field name and - // the the field type. Just parse this from the info field. - string parsename; - string strftype; - strftype = Info.Substring(9,3); - parsename = Info.Substring(13,Info.Length-13); - if (strftype.Equals("128")) // is it a combo type? - parsename = parsename.Substring(0,parsename.Length-1); - - if (FldsUsed.BinarySearch(parsename) >= 0) // is this field being used? - { - ftype |= GetFSTreturnType(System.Convert.ToUInt16(Info.Substring(9,3)),parsename,elem); -// ftype |= System.Convert.ToUInt16(Info.Substring(9,3)); - } - } - } - DBE.ReaderClose(); - DBE.CommandDispose(); - - return ftype; - } -***/ - - public ushort RODB_GetFieldType(VlnXmlElement elem, string TableName, string Fld) - { - string strGetFields; - string Info; - string RecID; - string name; - string tmpname; - ushort ftype = 0; - ROField rof; - if(TableName != lastTable) - { - lastTable=TableName; - dicFldTypes=new HybridDictionary(); - // select all of the field definition records in this table. - // strGetFields = "SELECT RecID, Info from " + elem.GetAttribute("Table"); - strGetFields = "SELECT RecID, Info from " + TableName; - strGetFields = strGetFields + " where RecType = 2"; // + rtype.ToString(); - DBE.Command(strGetFields); - DBE.Reader(); - - // NOTE !!!! - // This function does not handle Combo type fields (128). - while (DBE.Read())// && ftype == 0) - { - RecID = DBE.GetString(0); - 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)) - { - name = ParseEleName(Info); - if (name != null) - { - tmpname = CvtUserFldToFld(name); - //if (tmpname.Equals(Fld)) - //{ - rof = new ROField(name, RecID, null, 0); - // uint tmpfldtype = rof.ParseFieldType(Info); - ftype = GetFSTreturnType(System.Convert.ToUInt16(rof.ParseFieldType(Info)),tmpname,elem); - dicFldTypes[tmpname]=ftype; - //} - } - } - else - { - // references master, but what we need is here: the field name and - // the the field type. Just parse this from the info field. - string parsename; - // string strftype; - // strftype = Info.Substring(9,3); - parsename = Info.Substring(13,Info.Length-13); - //if (parsename.Equals(Fld)) - //{ - ftype = GetFSTreturnType(System.Convert.ToUInt16(Info.Substring(9,3)),parsename,elem); - dicFldTypes[parsename]=ftype; - //} - - } - - } - DBE.ReaderClose(); - DBE.CommandDispose(); - } - ftype = ((ushort) dicFldTypes[Fld]); - return ftype; - } - - - - // For the given element's table, get all of the RO fields defined in this table. - public ArrayList RODB_GetFields(VlnXmlElement elem, uint rtype) - { - ArrayList retlist = new ArrayList(); - string strGetFields; - string Info; - string RecID; - string name; - uint ftype; - ROField rof; - - // select all of the field definition records in this table. - strGetFields = "SELECT RecID, Info from " + elem.GetAttribute("Table"); - strGetFields = strGetFields + " where RecType = 2"; // + rtype.ToString(); - DBE.Command(strGetFields); - DBE.Reader(); - - while (DBE.Read()) - { - RecID = DBE.GetString(0); - 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)) - { - name = ParseEleName(Info); - if (name != null) - { - // what type of schema element? - rof = new ROField(name, RecID, null, 0); - ftype = rof.ParseFieldType(Info); - rof.SetFieldType(ftype); - retlist.Add((object) rof); - } - } - - else - { - // the recid points to a field definition (schema) in the master - use it to get - // the schema element from the master and copy it. - string parsename; - string masterrecid; - string strftype; - masterrecid = Info.Substring(0,8); - strftype = Info.Substring(9,3); - ftype = System.Convert.ToUInt32(Info.Substring(9,3)); - parsename = CvtFldToUserFld(Info.Substring(13,Info.Length-13)); - - // if we have a choice element, remove the last character (it was added to the - // field names in order to allow for unique fields names for the choice items. - if (ftype == (uint) FieldTypes.Combination) - { - string tparsename = parsename.Remove((parsename.Length)-1,1); // remove the choice string and the space - parsename = tparsename; - } - rof = new ROField(parsename, RecID, masterrecid, ftype); - retlist.Add((object) rof); - } - } - DBE.ReaderClose(); - DBE.CommandDispose(); - return retlist; - } - - public string RODB_GetSchemaPiece(string Recid, string table) - { - string strGetSchemaPiece; - string Info; - strGetSchemaPiece = "SELECT Info From " + table + " where (RecID = '" + Recid + "')"; - DBE.Command(strGetSchemaPiece); - DBE.Reader(); - if (DBE.Read()) - Info = DBE.GetString(0); - else - Info = null; - DBE.ReaderClose(); - DBE.CommandDispose(); - return Info.Replace("'","\'"); - } - - public bool RODB_NewSchemaPiece(string recid, string parentid, string table, string schpiece, uint rtype) - { - string strSchemaPiece; - bool success = true; - string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now); - strSchemaPiece = "INSERT INTO " + table + " (RecID, RecType, ParentID, ModDateTime, Info) VALUES ('"; - // B2004-016: at one point all fields are returned using a record type of 2 (Schema) - - // but the insertion code did not account for this when inserting a type of 4 (GroupSchema) - i.e. - // RecordType of 4 is no longer used, all fields (whether schema or group) are defined - // as RecordTYpe of 2. - //strSchemaPiece = strSchemaPiece + recid + "', " + rtype.ToString() + ", '" + parentid + "', '" + dt + "', '" + schpiece.Replace("\'","'") + "');"; - strSchemaPiece = strSchemaPiece + recid + "', 2, '" + parentid + "', '" + dt + "', '" + schpiece.Replace("\'","'") + "');"; - - DBE.Command(strSchemaPiece); - try - { - DBE.Command(strSchemaPiece); - DBE.Reader(); - } - catch (Exception e) - { - success = false; - MessageBox.Show(e.Message, "Database Write Error"); - } - DBE.ReaderClose(); - DBE.CommandDispose(); - return success; - } - - public bool RODB_WriteSchemaPiece(string Recid, string table, string schpiece) - { - string strWriteSchemaPiece; - bool success = true; - string dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now); - strWriteSchemaPiece = "UPDATE " + table + " SET " + table + ".Info = '" + schpiece.Replace("\'","'") + "'"; - strWriteSchemaPiece = strWriteSchemaPiece + ", ModDateTime = '" + dt + "' WHERE RecID = '" + Recid + "';"; - try - { - DBE.Command(strWriteSchemaPiece); - DBE.Reader(); - } - catch (Exception e) - { - success = false; - MessageBox.Show(e.Message, "Database Update Error"); - } - DBE.ReaderClose(); - DBE.CommandDispose(); - return success; - } - - // Create a new field record in master and reference in the current table. - // pass in current rodb object, the xml element creating and editlevel - // is a recordType of either Group (group field definitions) or rro for - // the ro definition. the string apd represents an append string which is - // appended to the fieldname for combo types, otherwise it's null - public bool RODB_NewFieldRecord(ROField myrof, VlnXmlElement myelem, string strschema, uint editlevel, string apd) - { - bool success; - // get a new record id for this and save it in the master table. - string mrecid = RODB_GetNextRecId("ROMaster"); - - // get recid in ROMaster for group, so that we can set the parent field. - // walk up the tree until we find a 'MasterRecID' attribute. - VlnXmlElement parent; - parent = myelem; - while (parent != null) - { - if (parent.HasAttribute("MasterRecID")) break; - parent = (VlnXmlElement) parent.ParentNode; - } - success = RODB_NewSchemaPiece(mrecid,parent.GetAttribute("MasterRecID"),"ROMaster", strschema, editlevel); - if (success != true) return false; - // also reference it from the local table. - string lrecid = RODB_GetNextRecId(myelem.GetAttribute("Table")); - myrof.SetRecID(lrecid); - myrof.SetMasterRecID(mrecid); - StringBuilder strbld = new StringBuilder(); - strbld.Append(mrecid); - strbld.Append(" "); - string strtype = myrof.GetFieldType.ToString(); - strbld.Append(strtype.PadLeft(3,'0')); - strbld.Append(" "); - strbld.Append(myrof.MakeFieldName(myrof.GetFieldname)); - if (apd != null) strbld.Append(apd); - // Need ParentID field, get by looking up xml tree to find parentID attribute = "00000000", then - // use this recid. - parent = myelem; - while (parent.GetAttribute("ParentID") != "00000000") - { - parent = (VlnXmlElement) parent.ParentNode; - } - success = RODB_NewSchemaPiece(lrecid,parent.GetAttribute("RecID"), myelem.GetAttribute("Table"), strbld.ToString(), editlevel); - return success; - } - - private string DoCmbFieldReplace(string repstring, string oname, string nname, string letter) - { - string cmboname, cmbnname; - cmboname = oname.Insert(oname.Length-1,letter); - cmbnname = nname.Insert(nname.Length-1,letter); - return (repstring.Replace(cmboname,cmbnname)); - } - - private bool RODB_ProcessRROFieldChange(VlnXmlElement child, string oldname, string newname, uint editlevel, - VlnStatusMessage StatMsgWindow, bool combofield) - { - - bool success; - string str; - string info; - string tinfo1, tinfo2, tinfo3, tinfo4; - string dt; - string onameOpen, nnameOpen, onameClose, nnameClose, onameComma, nnameComma; - string onameOpenX, nnameOpenX; - onameOpen = "<" + oldname + ">"; - nnameOpen = "<" + newname + ">"; - onameOpenX = "<" + oldname + ">"; - nnameOpenX = "<" + newname + ">"; - onameComma = "<" + oldname + ","; // if format in attribute - nnameComma = "<" + newname + ","; - onameClose = ""; - nnameClose = ""; - dt = string.Format("{0:yyyyMMddHHmmss}", System.DateTime.Now); - try - { - // first do the string replace for the group node. This will change any - // attributes which may have changed. - str = "SELECT Info From " + child.GetAttribute("Table") + " where (RecID = '" + child.GetAttribute("RecID") + "')"; - DBE.Command(str); - DBE.Reader(); - if (DBE.Read()) - info = DBE.GetString(0); - else - info = null; - DBE.ReaderClose(); - DBE.CommandDispose(); - - tinfo1 = info.Replace(onameOpen, nnameOpen); - tinfo2 = tinfo1.Replace(onameClose, nnameClose); - tinfo3 = tinfo2.Replace(onameComma, nnameComma); - tinfo4 = tinfo3.Replace(onameOpenX, nnameOpenX); - if (tinfo4 != info) - { - StatMsgWindow.StatusMessage = child.GetAttribute("MenuTitle"); - str = "UPDATE " + child.GetAttribute("Table") + " SET Info = '" + tinfo4 + "'"; - str = str + ", ModDateTime = '" + dt + "' WHERE RecID = '" + child.GetAttribute("RecID") + "';"; - DBE.Command(str); - DBE.Reader(); - DBE.ReaderClose(); - DBE.CommandDispose(); - if (child.Name == "vlnGroup"&&child.ParentNode.Name != "RO_Root") - { - XmlNodeList nodeList; - nodeList = child.SelectNodes(oldname); - foreach (XmlNode nod in nodeList) - { - XmlNode newnode = ROXml.CreateNode(XmlNodeType.Element, newname, ""); - newnode.InnerXml = nod.InnerXml; - child.ReplaceChild(newnode,nod); - } - } - // if at top, replace strings in attributes for xml node. Only needs done - // for top node because remainder are done in xml string replace for entire - // node and written to database, but XML tree is deleted from memory and - // reread in as needed. - if (child.ParentNode.Name == "RO_Root") - { - string tmp, tmp1; - tmp = child.GetAttribute("RetVal"); - if (tmp != null) - { - tmp1 = tmp.Replace(onameOpen, nnameOpen); - child.SetAttribute("RetVal", tmp1); - } - tmp = child.GetAttribute("MenuItem"); - if (tmp != null) - { - string conameOpen = "<" + oldname + ","; - string cnnameOpen = "<" + newname + ","; - tmp1 = tmp.Replace(onameOpen, nnameOpen); - string tmp2 = tmp1.Replace(conameOpen, cnnameOpen); - child.SetAttribute("MenuItem", tmp2); - } - tmp = child.GetAttribute("AccPageID"); - if (tmp != null) - { - tmp1 = tmp.Replace(onameOpen, nnameOpen); - child.SetAttribute("AccPageID", tmp1); - } - tmp = child.GetAttribute("GroupMenuItem"); - if (tmp != null) - { - tmp1 = tmp.Replace(onameOpen, nnameOpen); - child.SetAttribute("GroupMenuItem", tmp1); - } - - } - } - // if this was an RO field definition change, need to go through the XML for - // the ROs too. - if (editlevel == (uint) RecordType.Schema) - { - XmlNode chldnode = (XmlNode) child.FirstChild; - VlnXmlElement echild; - while (chldnode != null) - { - if (chldnode is VlnXmlElement) - { - echild = (VlnXmlElement) chldnode; - if (echild.Name != "vlnGroup") - { - // If this is a group defintion subtree it will only have one - // child, which is the text definition for the subgroup. Don't - // include these in the tree. - int levelCnt = chldnode.ChildNodes.Count; - string TheMenuTitle = echild.GetAttribute("MenuTitle"); - if ((levelCnt >= 1) && !TheMenuTitle.Equals("")) - { - // read record, do string replace in info & write record. Also, replace - // the xml node with a node with the new name. - str = "SELECT Info From " + echild.GetAttribute("Table") + " where (RecID = '" + echild.GetAttribute("RecID") + "')"; - DBE.Command(str); - DBE.Reader(); - if (DBE.Read()) - info = DBE.GetString(0); - else - info = null; - DBE.ReaderClose(); - DBE.CommandDispose(); - if (combofield==false) - { - tinfo1 = info.Replace(onameOpen,nnameOpen); - tinfo2 = tinfo1.Replace(onameClose, nnameClose); - XmlNodeList nodeList; - nodeList = echild.SelectNodes(oldname); - foreach (XmlNode nod in nodeList) - { - XmlNode newnode = ROXml.CreateNode(XmlNodeType.Element, newname, ""); - newnode.InnerXml = nod.InnerXml; - echild.ReplaceChild(newnode,nod); - } - } - else // need a,b,c,d yikes - { - string nma, nmb, nmc, nmd; - nma = DoCmbFieldReplace(info, onameOpen, nnameOpen, "a"); - nmb = DoCmbFieldReplace(nma, onameOpen, nnameOpen, "b"); - nmc = DoCmbFieldReplace(nmb, onameOpen, nnameOpen, "c"); - nmd = DoCmbFieldReplace(nmc, onameOpen, nnameOpen, "d"); - nma = DoCmbFieldReplace(nmd, onameClose, nnameClose, "a"); - nmb = DoCmbFieldReplace(nma, onameClose, nnameClose, "b"); - nmc = DoCmbFieldReplace(nmb, onameClose, nnameClose, "c"); - tinfo2 = DoCmbFieldReplace(nmc, onameClose, nnameClose, "d"); - // replace the combo nodes with the new name, do a-d in case there are more than - // one value field stored for this combo type - for (char tmplet = 'a';tmplet < 'e'; tmplet++) - { - XmlNodeList nodeList; - nodeList = echild.SelectNodes(oldname+tmplet.ToString()); - foreach (XmlNode nod in nodeList) - { - XmlNode newnode = ROXml.CreateNode(XmlNodeType.Element, newname+tmplet, ""); - newnode.InnerXml = nod.InnerXml; - echild.ReplaceChild(newnode,nod); - } - } - } - - StatMsgWindow.StatusMessage = echild.GetAttribute("MenuTitle"); - str = "UPDATE " + echild.GetAttribute("Table") + " SET Info = '" + tinfo2 + "'"; - str = str + ", ModDateTime = '" + dt + "' WHERE RecID = '" + echild.GetAttribute("RecID") + "';"; - DBE.Command(str); - DBE.Reader(); - DBE.ReaderClose(); - DBE.CommandDispose(); - - } - } - } - chldnode = chldnode.NextSibling; - } - } - return true; - } - catch (Exception e) - { - success = false; - MessageBox.Show(e.Message,"Database Update Error"); - } - return success; - } - - // RODB_UpdateNamesInROs: goes through subtree (top node is 'fld') and if this - // updated field is used (either in [Group]FieldsInUse or was used in parent, then - // 1) if group node, check for attributes using "" and if found, update - // to " - // 2) if group edit, modify this node's xml data with the new fieldname, - // otherwise, edit 'ROs' under this to replace with - // Input: VlnXmlElement fld: start processing at this node. - // string myrecid: local recid to be used for check to see if used (in FieldsInUse - // or GroupFieldsInUse. - // string oldname, newname - old and new field names - // string myrecid - local record storing field name - // uint editlevel - if editting groups, do check for for item 1 above in - // Group attributes, otherwise do in - // bool parentused - set to false from caller, this is recursive and will - // be set appropriately for recursive calls. - public bool RODB_UpdateFieldNames(VlnXmlElement fld, string myrecid, string oldname, - string newname, uint editlevel, bool parentused, VlnStatusMessage StatMsgWindow, bool combofield) - { - bool success; - bool useAtLevel = false; - XmlNode node; - VlnXmlElement child; - string fldinuse; - - if (editlevel == (uint)RecordType.Schema) - fldinuse = "FieldsInUse"; - else - fldinuse = "GroupFieldsInUse"; - - // Do the current level before walking through any children groups. - if (fld.Name == "vlnGroup") - { - if (fld.HasAttribute(fldinuse)) - { - // if recid not in here, don't process for this node. - string fiu = fld.GetAttribute(fldinuse); - if (fiu.IndexOf(myrecid) >= 0) useAtLevel = true; - } - if (useAtLevel==true || parentused==true) useAtLevel = true; - - if (useAtLevel == true) - { - string haskids, kidsloaded; - haskids = fld.GetAttribute("HasChild"); - kidsloaded = fld.GetAttribute("ChildLoaded"); - if (haskids == "True" && kidsloaded == "False" ) - { - success = RODB_GetChildData(fld,true); - if (success == false) return false; - fld.SetAttribute("ChildLoaded","True"); - } - parentused = true; // for kids of this group. - - success = RODB_ProcessRROFieldChange(fld, oldname, newname, editlevel, StatMsgWindow, combofield); - if (success==false) return false; - } - } - node = (XmlNode) fld.FirstChild; - while (node != null) - { - if (node is VlnXmlElement) - { - useAtLevel=false; - child = (VlnXmlElement) node; - - // If this is a group menu edit, process group nodes, by recursive - // call and then modify data on group record. - // For both, when hitting a group node, check that it either doesn't - // have 'FieldsInUse' or 'GroupFieldsInUse' or that if it does, - // this record id is in the list -> only process these, otherwise - // the field is not used. - if (child.Name == "vlnGroup") - { - // see if inuse for this one, either defined here or from parent. - if (child.HasAttribute(fldinuse)) - { - // if recid not in here, don't process for this node. Still - // need to check children because they may redefine fields in use. - string fiu = child.GetAttribute(fldinuse); - if (fiu.IndexOf(myrecid) >= 0) useAtLevel = true; - } - if (useAtLevel == false && parentused == true) useAtLevel = true; - - // update this record if it doesn't have it's own , then do kids - // of it. - success = RODB_UpdateFieldNames(child, myrecid, oldname, newname,editlevel,useAtLevel, StatMsgWindow, combofield); - - if (success == false) return false; - } - } - node = node.NextSibling; - } - // now update ROs at this level, only if RO mods (not group). - //if (parentused && editlevel==(uint)RecordType.Schema) - //{ - // success = RODB_ProcessRROFieldChange(fld, oldname, newname, editlevel); - // if (success==false) return false; - //} - return true; - } - - // check if the name entered is one used for setting up - // the new graphics or setpoint databases. - private bool RODB_CheckForStandardName(string oname) - { - string oldname = CvtFldToUserFld(oname); - if (oldname.CompareTo("Name") == 0) return true; - if (oldname.CompareTo("Image ID") == 0) return true; - if (oldname.CompareTo("Image") == 0) return true; - if (oldname.CompareTo("Setpoint ID") == 0) return true; - if (oldname.CompareTo("Setpoint Value") == 0) return true; - if (oldname.CompareTo("Associated System/Component") == 0) return true; - if (oldname.CompareTo("Applicability") == 0) return true; - if (oldname.CompareTo("Revision") == 0) return true; - if (oldname.CompareTo("Short Description") == 0) return true; - if (oldname.CompareTo("Description") == 0) return true; - if (oldname.CompareTo("Key Assumptions") == 0) return true; - if (oldname.CompareTo("Basis") == 0) return true; - if (oldname.CompareTo("References") == 0) return true; - if (oldname.CompareTo("Group") == 0) return true; - if (oldname.CompareTo("Parameter") == 0) return true; - return false; - } - - public bool RODB_UpdateFieldRecord(ROField myrof, VlnXmlElement myelem, string strschema, - string oldname, string newname, uint editlevel, bool combofield) - { - bool success=false; - // If this is a generic definition that was modified, i.e. from ROMaster, ask - // the user whether to update the generic field definition or make it local. - if (myrof.GetMasterRecID != null) - { - // if field is defined in the ROMaster, and we change the field name - - // first check if it is using one of the names used to define new - // setpoint or graphics databases. If so, make it a local change only! - - bool changegeneric = true; - if (oldname != newname) - { - // if this is one of the standard names - don't let them save it. - bool isused=RODB_CheckForStandardName(oldname); - if (isused == true) - { - MessageBox.Show("The field name is used to define new Setpoints or Graphics Database.\n The update will be for this local (database) group only.","Field name modification."); - changegeneric = false; - } - } - - // if standard name, from above check, don't ask user if it is generic - // or not. - if (changegeneric != false) - { - System.Windows.Forms.DialogResult result = MessageBox.Show ("Update Generic definition?", "Referenced Object Definition", - MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (result == DialogResult.No) changegeneric = false; - } - if (changegeneric == true) - { - success = RODB_WriteSchemaPiece(myrof.GetMasterRecID,"ROMaster", strschema); - if (success != true) return false; - // if change in fieldname, need to go through all of the databases to - // adjust for it. - if (oldname != newname) - { - VlnStatusMessage StatMsgWindow = new VlnStatusMessage("Status of RO Field Change"); - // get root xml element - // loop through each subgroup under root. - VlnXmlElement topgroup; - topgroup = (VlnXmlElement) ROXml.FirstChild.FirstChild; - string sqlstr, recid, tbl; - while (topgroup != null) - { - tbl = topgroup.GetAttribute("Table"); - // get the recid of this field definition from the current table. - sqlstr = "SELECT RecID FROM " + tbl; - sqlstr = sqlstr + " WHERE (((" + tbl + ".RecType) = 2) AND ((" + tbl + ".Info) like ('"; - sqlstr = sqlstr + myrof.GetMasterRecID + "%')));"; - DBE.Command(sqlstr); - DBE.Reader(); - if (DBE.Read()) - recid = DBE.GetString(0); - else - recid = null; - DBE.ReaderClose(); - DBE.CommandDispose(); - if (recid != null) - { - // update the local field definition record - StringBuilder strbld = new StringBuilder(); - strbld.Append(myrof.GetMasterRecID); - strbld.Append(" "); - string strtype = myrof.GetFieldType.ToString(); - strbld.Append(strtype.PadLeft(3,'0')); - strbld.Append(" "); - strbld.Append(myrof.MakeFieldName(myrof.GetFieldname)); - success = RODB_WriteSchemaPiece(recid,topgroup.GetAttribute("Table"), strbld.ToString()); - topgroup.SetAttribute("TreeNotData", "True"); - - // Update subelements too. - if (success == true) - success = RODB_UpdateFieldNames(topgroup, recid, oldname, newname, editlevel, false, StatMsgWindow, combofield); - topgroup = (VlnXmlElement) topgroup.NextSibling; - } - } - StatMsgWindow.Dispose(); - } - } - else // change local - { - // modify the current to have the definition local. - success=RODB_WriteSchemaPiece(myrof.GetRecID,myelem.GetAttribute("Table"), strschema); - // get top group node in tree. and from there process fields if - // there was a change in fieldname text - if (success == true && oldname != newname) - { - VlnStatusMessage StatMsgWindow = new VlnStatusMessage("Status of RO Field Change"); - // get top node - the one immediately below the RO_Root. - VlnXmlElement parent, startEle; - parent = myelem; - startEle = myelem; - while(parent.Name != "RO_Root") - { - startEle = parent; - parent = (VlnXmlElement) parent.ParentNode; - } - startEle.SetAttribute("TreeNotData", "True"); - success = RODB_UpdateFieldNames(startEle, myrof.GetRecID, oldname, newname, editlevel, false, StatMsgWindow, combofield); - StatMsgWindow.Dispose(); - } - } - } - else - { - success = RODB_WriteSchemaPiece(myrof.GetRecID,myelem.GetAttribute("Table"),strschema); - // changed the fieldname, change xml text. - if (success == true && oldname != newname) - { - VlnStatusMessage StatMsgWindow = new VlnStatusMessage("Status of RO Field Change"); - // get top node - the one immediately below the RO_Root. - VlnXmlElement parent, startEle; - parent = myelem; - startEle = myelem; - while(parent.Name != "RO_Root") - { - startEle = parent; - parent = (VlnXmlElement) parent.ParentNode; - } - startEle.SetAttribute("TreeNotData", "True"); - success = RODB_UpdateFieldNames(startEle, myrof.GetRecID, oldname, newname, editlevel, false, StatMsgWindow, combofield); - StatMsgWindow.Dispose(); - } - } - return success; - } - - public XmlSchema RODB_GetGroupSchema(VlnXmlElement elem) - { - XmlSchema myschema; - - VlnXmlElement parent; - string entireschema; - // if at top of tree, use this group schema information (fields in use). but if not, - // the parent node defines the schema for the subgroups. - if (elem.ParentNode.Name == "RO_Root") - parent = elem; - else - parent = elem; -// bug fix B2004-008 -// need to use the current node's group definition all the time -// parent = (VlnXmlElement) elem.ParentNode; - while (parent != null) - { - if (parent.HasAttribute("GroupFieldsInUse") == true) break; - - // if we've looped to the top, just set the parent to null. (B2004-015) - if (parent.ParentNode is VlnXmlElement) - parent = (VlnXmlElement) parent.ParentNode; - else - parent = null; - } - - if (parent == null) return null; - // The group schema never gets saved as an attribute. it's always read in, because - // it's not used as often as the ro schema. So for the Group Schema, we're looking - // for 'GroupFieldsInUse'. - // otherwise, read in schema definitions for those 'FieldsInUse'. - string strGetSchemaPiece; - entireschema = null; - string GroupFieldsInUse = parent.GetAttribute("GroupFieldsInUse"); - int strpos = 0; - string Info; - - // For each item in use, get its xmlschema text. If unique to this group, the definition - // exists local to this table. Otherwise, go back to the master. - string recid; - recid = GroupFieldsInUse.Substring(0,8); - while (recid != null) - { - strGetSchemaPiece = "SELECT Info From " + elem.GetAttribute("Table") + " where (RecID = '" + recid + "')"; - DBE.Command(strGetSchemaPiece); - DBE.Reader(); - if (DBE.Read()) - { - Info = DBE.GetString(0); - // if the info string has "<", i.e. an opening XML schema bracket, use - // this text as the field definition, otherwise, go to the master to get - // it. - if ("<" == Info.Substring(0,1)) - { - // use this field definition, else get from the master. - entireschema = entireschema + Info; - } - else - { - string recidpart = Info.Substring(0,8); - strGetSchemaPiece = "SELECT Info From RoMaster where (RecID = '" + recidpart + "')"; - DBE.ReaderClose(); - DBE.CommandDispose(); - DBE.Command(strGetSchemaPiece); - DBE.Reader(); - if (DBE.Read()) - { - Info = DBE.GetString(0); - entireschema = entireschema + Info; - } - } - DBE.ReaderClose(); - DBE.CommandDispose(); - strpos = strpos + 9; - if (strpos > GroupFieldsInUse.Length) - recid = null; - else - recid = GroupFieldsInUse.Substring(strpos,8); - } - DBE.ReaderClose(); - DBE.CommandDispose(); - } - entireschema = schemastart + entireschema + schemaend; - XmlTextReader schemareader = new XmlTextReader(entireschema,XmlNodeType.Element,null); - try - { - myschema = XmlSchema.Read(schemareader,null); - return myschema; - } - catch (Exception e) - { - MessageBox.Show(e.Message, "Schema Error"); - return null; - } - } - - public XmlSchema RODB_GetSchema(VlnXmlElement elem) - { - XmlSchema myschema; - - VlnXmlElement parent; - string entireschema; - XmlNode nparent; - nparent = elem; //.ParentNode; - if (nparent is VlnXmlDocument) - { - // at top already. use this one. - parent = elem; - } - else - { - parent = (VlnXmlElement) nparent; - while (parent != null) - { - if (parent.HasAttribute("Schema") == true) break; - if (parent.HasAttribute("FieldsInUse") == true) break; - parent = (VlnXmlElement) parent.ParentNode; - } - } - - // if the schema has already been read in, just use it from the schema attribute, - // otherwise, read in schema definitions for those 'FieldsInUse'. - if (parent.HasAttribute("Schema")) - { - entireschema = parent.GetAttribute("Schema"); - } - else - { - string strGetSchemaPiece; - entireschema = null; - string FieldsInUse = parent.GetAttribute("FieldsInUse"); - int strpos = 0; - string Info; - - // For each item in use, get its xmlschema text. If unique to this group, the definition - // exists local to this table. Otherwise, go back to the master. - string recid; - recid = FieldsInUse.Substring(0,8); - while (recid != null) - { - strGetSchemaPiece = "SELECT Info From " + elem.GetAttribute("Table") + " where (RecID = '" + recid + "')"; - DBE.Command(strGetSchemaPiece); - DBE.Reader(); - if (DBE.Read()) - { - Info = DBE.GetString(0); - // if the info string has "<", i.e. an opening XML schema bracket, use - // this text as the field definition, otherwise, go to the master to get - // it. - if ("<" == Info.Substring(0,1)) - { - // use this field definition, else get from the master. - entireschema = entireschema + Info; - } - else - { - string recidpart = Info.Substring(0,8); - string localfieldname = Info.Substring(13,Info.Length-13); - strGetSchemaPiece = "SELECT Info From RoMaster where (RecID = '" + recidpart + "')"; - DBE.ReaderClose(); - DBE.CommandDispose(); - DBE.Command(strGetSchemaPiece); - DBE.Reader(); - if (DBE.Read()) - { - // check if field name is same, if not, use local name. - string goodname; - Info = DBE.GetString(0); - int indx1 = Info.IndexOf("\""); - int indx2 = Info.IndexOf("\"",indx1+1); - string masterfieldname = Info.Substring(indx1+1,indx2-indx1-1); - if (localfieldname != masterfieldname) - goodname = Info.Replace(masterfieldname,localfieldname); - else - goodname = Info; - - entireschema = entireschema + goodname; - } - } - DBE.ReaderClose(); - DBE.CommandDispose(); - strpos = strpos + 9; - if (strpos > FieldsInUse.Length) - recid = null; - else - recid = FieldsInUse.Substring(strpos,8); - } - } - DBE.ReaderClose(); - DBE.CommandDispose(); - entireschema = schemastart + entireschema + schemaend; - } - - XmlTextReader schemareader = new XmlTextReader(entireschema,XmlNodeType.Element,null); - try - { - myschema = XmlSchema.Read(schemareader,null); - parent.SetAttribute("Schema",entireschema); - return myschema; - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Schema Read Error"); - return null; - } - } - - public int RODB_GetNumberOfROValueRecords(string tablename) - { - // get menu fields to display here. - string strGetRoCount = "SELECT COUNT(RecType) AS NumRecs FROM " + tablename; - strGetRoCount += " WHERE RecType = " + (uint)RecordType.RRO; - DBE.Command(strGetRoCount); - DBE.Reader(); - DBE.Read(); - int ROCnt = DBE.GetInt32(0); - DBE.ReaderClose(); - DBE.CommandDispose(); - return ROCnt; - } - - public int RODB_GetNumberOfGroupRecords(string tablename) - { - // get menu fields to display here. - string strGetGrpCount = "SELECT COUNT(RecType) AS NumRecs FROM " + tablename; - strGetGrpCount += " WHERE RecType = " + (uint)RecordType.Group; - DBE.Command(strGetGrpCount); - DBE.Reader(); - DBE.Read(); - int GrpCnt = DBE.GetInt32(0); - DBE.ReaderClose(); - DBE.CommandDispose(); - return GrpCnt; - } - - } -} - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/RODBInterface.csproj b/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/RODBInterface.csproj deleted file mode 100644 index 3cbeb7b5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/RODBInterface.csproj +++ /dev/null @@ -1,136 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {0C7825FD-AA05-11D6-84D1-00A0CC271352} - Debug - AnyCPU - - - - - RODBInterface - - - JScript - Grid - IE50 - false - Library - RODBInterface - OnBuildSuccess - - - - - - - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - - - - System - - - System.Data - - - System.Drawing - - - System.Windows.Forms - - - System.XML - - - - - Code - - - Code - - - Form - - - Code - - - userpass.cs - Designer - - - - - {6D44F537-879E-11D6-84B8-00A0CC271352} - DBEncapsulation - - - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04} - Org.Mentalis.Files - - - {0C782592-AA05-11D6-84D1-00A0CC271352} - ROFields - - - {551CB7B3-00B1-11D7-8590-482B59000000} - VlnStatus - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/RODBInterface.sln b/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/RODBInterface.sln deleted file mode 100644 index 4e840fae..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/RODBInterface.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RODBInterface", "RODBInterface.csproj", "{0C7825FD-AA05-11D6-84D1-00A0CC271352}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug.ActiveCfg = Debug|.NET - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Debug.Build.0 = Debug|.NET - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release.ActiveCfg = Release|.NET - {0C7825FD-AA05-11D6-84D1-00A0CC271352}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/VlnXml.cs b/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/VlnXml.cs deleted file mode 100644 index 3bf0084f..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/VlnXml.cs +++ /dev/null @@ -1,1213 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: VlnXml.cs $ $Revision: 23 $ - * $Author: Jsj $ $Date: 6/20/05 1:29p $ - * - * $History: VlnXml.cs $ - * - * ***************** Version 23 ***************** - * User: Jsj Date: 6/20/05 Time: 1:29p - * Updated in $/LibSource/RODBInterface - * added status message while reading ROs for Complete RO Report. - * - * ***************** Version 22 ***************** - * User: Jsj Date: 6/08/05 Time: 4:32p - * Updated in $/LibSource/RODBInterface - * Complete RO Report Bug fix B2001-001 - * - * ***************** Version 21 ***************** - * User: Jsj Date: 9/27/04 Time: 11:02a - * Updated in $/LibSource/RODBInterface - * upped release number - * - * ***************** Version 20 ***************** - * User: Kathy Date: 7/15/04 Time: 11:11a - * Updated in $/LibSource/RODBInterface - * Fix B2004-017 - * - * ***************** Version 19 ***************** - * User: Kathy Date: 5/06/04 Time: 9:52a - * Updated in $/LibSource/RODBInterface - * B2004-012 fix: skip process of param display data for RO Cmp Rpt - * - * ***************** Version 18 ***************** - * User: Jsj Date: 4/08/04 Time: 9:43a - * Updated in $/LibSource/RODBInterface - * Added and commented out calls to VlnProfiler - * - * ***************** Version 17 ***************** - * User: Jsj Date: 1/21/04 Time: 12:10p - * Updated in $/LibSource/RODBInterface - * added function to return current selected field type of multi type - * field - * - * ***************** Version 16 ***************** - * User: Kathy Date: 5/21/03 Time: 12:41p - * Updated in $/LibSource/RODBInterface - * B2003-035: process ro's with just one field - * - * ***************** Version 15 ***************** - * User: Jsj Date: 4/14/03 Time: 2:59p - * Updated in $/LibSource/RODBInterface - * changes resulting from speeding up RO FST creation - * - * ***************** Version 14 ***************** - * User: Kathy Date: 3/11/03 Time: 11:24a - * Updated in $/LibSource/RODBInterface - * allow extra text on accpageid template - * - * ***************** Version 13 ***************** - * User: Kathy Date: 12/17/02 Time: 12:53p - * Updated in $/LibSource/RODBInterface - * get image data by node for rofst creation - * - * ***************** Version 12 ***************** - * User: Kathy Date: 12/10/02 Time: 2:25p - * Updated in $/LibSource/RODBInterface - * fieldname special chars & various bugs - * - * ***************** Version 11 ***************** - * User: Kathy Date: 12/02/02 Time: 8:29a - * Updated in $/LibSource/RODBInterface - * fieldname replace chars - * - * ***************** Version 10 ***************** - * User: Jsj Date: 11/27/02 Time: 12:47p - * Updated in $/LibSource/RODBInterface - * modifications for RO.FST file creation - * - * ***************** Version 9 ***************** - * User: Kathy Date: 11/19/02 Time: 11:32a - * Updated in $/LibSource/RODBInterface - * fields within {} are not required - * - * ***************** Version 8 ***************** - * User: Kathy Date: 11/11/02 Time: 7:14a - * Updated in $/LibSource/RODBInterface - * Added complete report methods. - *********************************************************************************************/ -using System; -using System.Xml; -using System.Text; -using System.Collections; -using System.IO; -using System.Windows.Forms; -using ROFields; -using VlnStatus; -//using VlnProfiler; //don't forget to add VlnProfiler to the reference list - -namespace RODBInterface -{ - /// - /// Summary description for Class1. - /// - - public class VlnXmlDocument:XmlDocument - { - FileStream Rptfs; // for complete report of this document - BinaryWriter RptBW; - - public VlnXmlDocument():base() - { - } - - public override XmlElement CreateElement( string prefix, string localname, string nsURI) - { - VlnXmlElement elem = new VlnXmlElement(prefix, localname, nsURI, this); - return elem; - } - - public bool OpenTemp() - { - try - { - Rptfs = new FileStream("print.tmp", FileMode.Create); - // Create the writer for data. - RptBW = new BinaryWriter(Rptfs); - } - catch (Exception ) - { - return false; - } - return true; - } - - public void CloseTemp() - { - RptBW.Close(); - Rptfs.Close(); - } - - public void writeInt(short val) - { - RptBW.Write(val); - } - - public void writeText(string str) - { - short n = (short) str.Length; - writeInt(n); - // write out char by char. (Using rite - // of entire stirng caused special characters to be - // written as two bytes - which temp file reading code - int i; - for(i =0; i < str.Length; i++) - { - byte WrByte; - WrByte = (byte)str[i]; - RptBW.Write(WrByte); - } - } - - public void writeTextValue(string str) - { - writeInt(100); - writeText(str); - } - - public void writePlot(string str) - { - writeInt(101); - writeText(str); - } - - public void writeImage(string str) - { - writeInt(102); - writeText(str); - } - - public void pushHeader(string str) - { - writeInt(2); - writeText(str); - } - - public void popHeader() - { - writeInt(3); - } - - public void doHeader(ArrayList headers) - { - int spaces = -1; - short cnt = (short) headers.Count; - writeInt(255); - writeInt(1); - writeInt(cnt); - for (int i=0; i < cnt ;i++) - { - writeInt(0); - if (spaces>0) - { - string spc = new String(' ',2*(spaces-1)); - writeText(spc+headers[i].ToString()); - } - else - writeText(headers[i].ToString()); - spaces++; - } - } - - public void writeRROBegin() - { - writeInt(4); - } - - public void writeRROEnd() - { - writeInt(5); - } - - public void writeMultiBegin() - { - writeInt(103); - } - - public void writeMultiEnd() - { - writeInt(104); - } - } - - public class VlnXmlElement:XmlElement - { - public VlnXmlElement( string prefix, string localname, string nsURI, XmlDocument doc ):base( prefix,localname,nsURI, doc ) - { - } - - private string CvtUserFldToFld(string fldname) - { - if (fldname.Length < 2) - return fldname; - // a digit cannot start an xml fieldname, prepend a "__" to it. - string tmp0; - if (char.IsDigit(fldname,0)) - tmp0 = "__" + fldname; - else - tmp0 = fldname; - // an xml fieldname cannot have a space, change it to a "__" - string tmpstr = tmp0.Replace(" ","__"); - int len = tmpstr.Length; - int cnt = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval; - - while (cnt < len) - { - char tmpchr = tmpstr[cnt]; - if(!char.IsLetterOrDigit(tmpchr)&& (OKpunch.IndexOf(tmpchr) == -1) ) - { - decval = tmpchr; - outstr += OKpunch + decval.ToString("D3"); - } - else - { - outstr += tmpchr.ToString(); - } - cnt++; - } - return outstr; - } - - private string CvtFldToUserFld(string fldname) - { - string tmpstr0; - if (fldname.Length < 2) return fldname; - // an xml element name cannot begin with a digit. we had prepended a "__" - if (fldname.Substring(0,2) == "__" && char.IsDigit(fldname,2)) - tmpstr0 = fldname.Substring(2,fldname.Length-2); - else - tmpstr0 = fldname; - // an xml element name cannot have a space, we converted to a "__" - string tmpstr = tmpstr0.Replace("__"," "); - int len = tmpstr.Length; - int cur = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval, indx; - if (tmpstr.Length <6) - indx = -1; - else - indx=tmpstr.IndexOf(OKpunch,cur); - string asc_spchar; - while (indx>=0) - { - outstr += tmpstr.Substring(cur,indx-cur); - asc_spchar = tmpstr.Substring(indx+3,3); - decval = System.Convert.ToInt16(asc_spchar,10); - outstr += System.Convert.ToChar(decval).ToString(); - cur = indx+6; - if (cur+6 > len) - indx = -1; - else - indx = tmpstr.IndexOf(OKpunch,cur); - } - if (cur"); - if (left >= 0 && right > 0) - fld = newtmpl.Substring(left+1,right-left-1); - else - return null; - string usefld = CvtUserFldToFld(fld); - - XmlNode elmnode = (XmlNode) elm; - XmlNode nd = elmnode.SelectSingleNode(usefld); - // if not found it may be a combination, try this. - if (nd == null) - { - string tmp = usefld + "a"; - nd = elmnode.SelectSingleNode(tmp); - } - if (nd == null) - { - string tmp = usefld + "b"; - nd = elmnode.SelectSingleNode(tmp); - } - if (nd == null) - { - string tmp = usefld + "c"; - nd = elmnode.SelectSingleNode(tmp); - } - if (nd == null) - { - string tmp = usefld + "d"; - nd = elmnode.SelectSingleNode(tmp); - } - if(nd != null) - { - StringBuilder strbld = new StringBuilder(); - if (left > 0) strbld.Append(newtmpl.Substring(0,left)); - strbld.Append(nd.InnerText.ToString()); - if (right+1 0) strbld.Append(menuitm.Substring(0,left)); - - while (left != -1) - { - // get right bracket and then check for valid field & if commas with - // this, check for integer values. - right = menuitm.IndexOf(">",stindx); - string tmpd = menuitm.Substring(left+1,right-left-1); - // do comma parts now. - string inusename; - int comma1 = tmpd.IndexOf(","); - int frmt1=0, frmt2=0; - if (comma1 != -1) - { - // get any numbers for formatting & check for ints. - int comma2 = tmpd.IndexOf(",",comma1+1); - if (comma2 != -1) // two ints. - { - if (comma2-comma1 > 1) // first format field - not empty - { - string int1 = tmpd.Substring(comma1+1,comma2-comma1-1); - frmt1 = System.Convert.ToInt32(int1); - } - if (comma20) - strbld.Append(text.PadRight(frmt2,' ')); - else - strbld.Append(text); - } - else if (frmt1 != frmt2) - { - int cnt = 0; -// while (cnt < tmp.Length && tmp[cnt] <= '9' && tmp[cnt] >= '0') cnt++; // new RO logic -// int padcnt = (cnt>frmt1)?0:frmt1-cnt; - int padcnt = OldROFSTMenuLogic(text,frmt1,frmt2); // testing!!!!! - StringBuilder strtmp = new StringBuilder(); - cnt = 0; - while(cnt frmt2) // longer than the field length? - strtmp.Append(text.Substring(0,frmt2-cnt)); - else - strtmp.Append(text); - string tmpstr = strtmp.ToString(); - strbld.Append(tmpstr.PadRight(frmt2,' ')); - } - else - strbld.Append(text.PadLeft(frmt2,' ')); - } - } - stindx = right+1; - left = menuitm.IndexOf("<",left+1); - if (left != -1 && left > right+1) // append any plain text. - strbld.Append(menuitm.Substring(right+1,left-right-1)); - } - if (right+1='0') || str[idx] =='-' || str[idx]=='+')) - { - siznum++; - idx++; - } - if (siznum == 0) - { - newoff= siznum+(wid-slen)/2; - } - else if (((doff-siznum)+slen)> wid) - { - newoff = wid-siznum-slen; - } - tmpwid = wid; - while (tmpwid > 0 && siznum < newoff) - { - sps++; - siznum++; - tmpwid--; - } - return sps; - } - - - // for this (VlnXmlElement), get it's menu value template. This template is - // used to generate the menu titles. Pass in a string 'GroupMenuItem' or - // 'MenuItem' so that the group level or RRO level menu template is found. - // This walkds up the tree to find the attribute ('GroupMenuItem' or 'MenuItem') - // and returns it. - public string GetMenuValueTemplate(string menuitm) - { - VlnXmlElement parent; - string strmenuitm; - VlnXmlElement tmp; - if (menuitm == "GroupMenuItem") - { - // if at top of tree, use this top GroupMenuItem. but if not, - // the parent node defines the GroupMenuItem for the subgroups. - if (this.ParentNode.Name == "RO_Root") - { - tmp = (VlnXmlElement) this.ParentNode; - strmenuitm=tmp.GetAttribute(menuitm); - return(strmenuitm); - } - else - parent = (VlnXmlElement) this.ParentNode; - while (parent != null) - { - if (parent.HasAttribute(menuitm) == true) break; - if (parent.Name != "RO_Root") - parent = (VlnXmlElement) parent.ParentNode; - else - parent = null; - } - if (parent == null) return null; - strmenuitm = parent.GetAttribute(menuitm); - return strmenuitm; - } - - // Now just do 'MenuItem', which is for ROs - parent = (VlnXmlElement) this; - strmenuitm = parent.GetAttribute(menuitm); - while (parent != null && strmenuitm == "") - { - // walk up tree to get parent. - strmenuitm = parent.GetAttribute(menuitm); - parent = (VlnXmlElement) parent.ParentNode; - } - return strmenuitm; - } - - // for this (VlnXmlElement), get the Return Value template. - public string GetReturnValueTemplate() - { - VlnXmlElement parent; - VlnXmlElement tmp=null; - - // get to top node of the ROs & groups to get the return for this tree. - parent = (VlnXmlElement) this; - tmp = parent; - while((tmp.HasAttribute("RetVal") == false) && parent.Name != "RO_Root") - { - tmp = parent; - parent = (VlnXmlElement) parent.ParentNode; - } - if (tmp.HasAttribute("RetVal") == false) return null; - else return tmp.GetAttribute("RetVal"); - } - - /* - * return true if the field is a pre defined PROC.INI field name - */ - private bool IsProcIniDef(string fld) - { - bool rtnval = false; - string tmpstr = fld.ToUpper(); - - rtnval = (tmpstr.Equals("U") || - tmpstr.Equals("U-") || - tmpstr.Equals("P") || - tmpstr.Equals("P-") || - tmpstr.Equals("S") || - tmpstr.Equals("S-")); - - return rtnval; - } - - /* - * This function checks the given field name with the list of fields - * that are "in use" for the current group. - * If the field name is of one of the pre-defined PROC.INI RO fields - * treat that field name as plain text (i.e. NOT in use) - */ - private bool IsAInUseField(ArrayList InUseList, string fld) - { - bool rtnval = false; - int i; - - if (IsProcIniDef(fld)) // is this a pre-defined PROC.INI field? - return rtnval; //return false! - - string tmpstr = fld.Substring(0,1); - if (tmpstr.Equals("_")) - tmpstr = fld.Substring(1,fld.Length-1); - else - tmpstr = fld; - tmpstr = CvtFldToUserFld(fld); - for(i=0; rtnval == false && i 0) strbld.Append(RtnValTemplate.Substring(0,left)); - - while (left != -1) - { - // get right bracket and then check for valid field & if commas with - // this, check for integer values. - right = RtnValTemplate.IndexOf(">",stindx); - string inusename; - string substr = RtnValTemplate.Substring(left+1,right-left-1); - inusename = CvtUserFldToFld(substr); - - // get contents of field & append it onto the string builder. - XmlNode elmnode = (XmlNode) elm; - XmlNode nd = elmnode.SelectSingleNode(inusename); - // Check to see if the found field is a "Field In Use" - - if (IsAInUseField(InUseList,inusename)) - { - string text=""; - if (nd == null) - { - text = GetComboFieldValueAndType(elmnode,inusename,ref FldType,false); - if (text.Equals("")) - text = " "; - } - else - { -// Profiler.Start("Grv7"); - FldType = theDb.RODB_GetFieldType((VlnXmlElement)nd,TableName,inusename); -// Profiler.End("Grv7"); -// Profiler.Start("Grv8"); - // for an image, get the filename, height, width, otherwise just use - // data in the node. - if (FldType == 8) // for the '8' see RODBInterface - GetFSTreturntype - { - // get filename, length, width in that order, separated by newlines - XmlNode tmp = nd.SelectSingleNode("Image_Filename"); - if (tmp != null && tmp.InnerText != null) - text = tmp.InnerText + "\r\n"; - else - text = " \r\n"; - tmp = nd.SelectSingleNode("Image_Height"); - if (tmp != null && tmp.InnerText != null) - text = text + tmp.InnerText + "\r\n"; - else - text = text + " \r\n"; - tmp = nd.SelectSingleNode("Image_Width"); - if (tmp != null && tmp.InnerText != null) - text = text + tmp.InnerText + "\r\n"; - else - text = text + " \r\n"; - } - else - { - text = nd.InnerText; - } -// Profiler.End("Grv8"); - } - - ValueType |= FldType; - strbld.Append(text); - } - else - { - strbld.Append(RtnValTemplate.Substring(left,right-left+1)); - } - - stindx = right+1; - left = RtnValTemplate.IndexOf("<",left+1); - if (left != -1 && left > right+1) // append any plain text. - strbld.Append(RtnValTemplate.Substring(right+1,left-right-1)); - } - - right++; // move past the right bracket ('>') - if (right < RtnValTemplate.Length) - strbld.Append(RtnValTemplate.Substring(right,RtnValTemplate.Length-right)); - -// Bug fix: B2004-044 -// If the ValueType is zero, then it will not appear on the list of ROs in the -// procedure editor. - if (ValueType == 0) - ValueType = 1; - - RtnValStr = strbld.ToString(); - return RtnValStr; - } - - public string GetComboFieldValueAndType(XmlNode CurNode, string Fld, ref ushort FldTyp, bool ForMenu) - { - string RtnVal = ""; - XmlNode ChildNode = CurNode.FirstChild; - FldTyp = 0; - - while (ChildNode != null && FldTyp == 0) - { - if (ChildNode is VlnXmlElement) - { - string ChildName = ChildNode.Name.ToString(); - if (ChildName.StartsWith(Fld)) - { - char CmboChar = Convert.ToChar(ChildName.Substring(ChildName.Length-1,1)); - switch (CmboChar) - { - case 'a': // Fixed Text - case 'b': // Multi Line Text - FldTyp = 1; - RtnVal = ChildNode.InnerText; - break; - case 'c': // Table - FldTyp = 2; - if (ForMenu) - RtnVal = "(Table)"; - else - RtnVal = ChildNode.InnerText; - break; - case 'd': // X/Y Plot - FldTyp = 4; - if (ForMenu) - RtnVal = "(Graph)"; - else - RtnVal = ChildNode.InnerText; - break; - } - } - } - ChildNode = ChildNode.NextSibling; - } - return RtnVal; - } - - // For this (VlnXmlElement), get the list of used fields. Need to find the - // fields from the accessory page id template, the return value template - // and the menu title template or group title template (depends on if a - // group edit or a RRO edit. - public ArrayList GetRequiredFields() - { - ArrayList fldlist = new ArrayList(); - string accpagetmpl = GetAccPageIDTemplate(); - string retvaltmpl = null; - string menutmpl = null; - if (this.Name == "vlnGroup") - { - menutmpl = GetMenuValueTemplate("GroupMenuItem"); - } - else - { - menutmpl = GetMenuValueTemplate("MenuItem"); - retvaltmpl = GetReturnValueTemplate(); - } - // for each string, add its field names to the list. - // accessory page id's only have a field and only used for ROs. - if (this.Name != "vlnGroup" && accpagetmpl != null) - { - string fld = accpagetmpl.Substring(1,accpagetmpl.Length-2); - fldlist.Add(fld+"\tAccessory Page Value"); - } - // menutmpl's may have multiple fields. loop through them. - int left, right, stindx, comma, rdelim; - if (menutmpl != null) - { - left = menutmpl.IndexOf("<"); - right = 0; - stindx = 0; - comma = 0; - while (left != -1) - { - // get right bracket and then check for valid field & if commas with - // this, check for integer values. - right = menutmpl.IndexOf(">",stindx); - comma = menutmpl.IndexOf(",",stindx); - rdelim = (comma>-1 && comma>left && comma',stindx); - // first see if it is within it's own {} - if (stindxbrace -1) - { - rightbrace = retvaltmpl.IndexOf('}',stindxbrace); - if ((left>leftbrace&&leftleftbrace&&right -1) - xmldoc.writeImage(ind.InnerText.Substring(indx+1,ind.InnerText.Length-indx-1)); - else - xmldoc.writeImage(ind.InnerText); - // now do height & width?? - ind = this.SelectSingleNode("*/Image_Height"); - if (ind != null) - { - short iht = (short) System.Convert.ToInt16(ind.InnerText); - xmldoc.writeInt(iht); - } - else - xmldoc.writeInt(0); - ind = this.SelectSingleNode("*/Image_Width"); - if (ind != null) - { - short iht = (short) System.Convert.ToInt16(ind.InnerText); - xmldoc.writeInt(iht); - } - else - xmldoc.writeInt(0); - } - } - else - { - if (doingplot) - xmldoc.writePlot(end.InnerText); - else - xmldoc.writeTextValue(end.InnerText); - - } - } - xmldoc.popHeader(); - } - - } - xmldoc.writeRROEnd(); - } - return true; - } - - // ShowGroup processes the input group node for the complete report by - // using ShowGroupDetail to output data for the group and ShowRRO to - // output data for the RO - private bool ShowGroup(RODB myrodb, ArrayList headers, VlnStatusMessage showStat) - { - XmlNode chldnode; - - if (this.ParentNode.Name != "RO_Root") - { - /* Bug fix: B2001-001 - * Compete RO Report for All ROs was printing an extra - * page showing just a prameter field. This information - * was not always related to the RO Group being printed at - * this time. Turns out that we don't need to call the - * ShowGroupDetail() at this point, only need to save - * header informat. -jsj 6/8/2005 - * - ShowGroupDetail(myrodb); - */ - headers.Add(this.GetAttribute("MenuTitle")); - } - else - { - int bracket = this.InnerXml.IndexOf("<",0); - if (bracket>-1) - headers.Add(this.InnerXml.Substring(0,bracket)); - else - headers.Add(this.InnerXml); - } - string haskids, kidsloaded; - haskids = this.GetAttribute("HasChild"); - kidsloaded = this.GetAttribute("ChildLoaded"); - if (haskids == "True" && kidsloaded == "False" ) - { - myrodb.RODB_GetChildData(this,true); - this.SetAttribute("ChildLoaded", "True"); - } - - // go through all of the children for this node and put them out. - chldnode = (XmlNode) this.FirstChild; - - while (chldnode != null) - { - if (chldnode is VlnXmlElement) - { - VlnXmlElement elem = (VlnXmlElement) chldnode; -// showStat.StatusMessage = elem.InnerText; - - // if it's a group, recurse through it. - if (chldnode.Name == "vlnGroup") - { - elem.ShowGroup(myrodb, headers, showStat); - } - // do RO's too. - else - { - int levelcnt = chldnode.ChildNodes.Count; - bool isParDisData = chldnode.Name == "Parameter__Display__Data"; - string TheMenuTitle = elem.GetAttribute("MenuTitle"); - showStat.StatusMessage = TheMenuTitle; - if (!isParDisData && ((levelcnt > 1) || (levelcnt==1 && !TheMenuTitle.Equals("")))) - elem.ShowRRO(myrodb, headers); - } - } - chldnode = chldnode.NextSibling; - } - // remove this group from the headers. - headers.RemoveAt(headers.Count-1); - return true; - } - - // put this element, and if a group all it's subelements out to the 'print.tmp' - // file for complete reports. - public bool Show(RODB myrodb, ArrayList headers) - { - bool success; - VlnStatusMessage showStat = new VlnStatusMessage("Reading ROs"); - VlnXmlDocument xmldoc = (VlnXmlDocument) this.OwnerDocument; - success = xmldoc.OpenTemp(); - if (success==false) return false; - - // if this is the top node, i.e. with name "RO_Root", it is a complete report - // for all Ros, work from the root. - if (this.Name == "RO_Root") - { - // show each 'table' group under the top. - VlnXmlElement group = (VlnXmlElement) this.FirstChild; - VlnXmlElement tmpgroup; - while (group != null) - { - // Now get subgroups for each group. - myrodb.RODB_GetChildData(group,true); - group.ShowGroup(myrodb, headers, showStat); - tmpgroup = group; - group.RemoveAll(); - group = (VlnXmlElement) tmpgroup.NextSibling; - } - - } - // this is a particular RO or group of ROs. - else - { - if (this.Name == "vlnGroup") - ShowGroup(myrodb, headers, showStat); - else - ShowRRO(myrodb, headers); - } - showStat.Dispose(); - xmldoc.CloseTemp(); - return true; - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/userpass.cs b/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/userpass.cs deleted file mode 100644 index 4974cd2f..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/userpass.cs +++ /dev/null @@ -1,188 +0,0 @@ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - - -namespace RODBInterface -{ - /// - /// Summary description for userpass. - /// - public class userpass : System.Windows.Forms.Form - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private System.Windows.Forms.Label uidLbl; - private System.Windows.Forms.Label pwLbl; - private System.Windows.Forms.Button OKBtn; - internal System.Windows.Forms.Button CancelBtn; - private System.Windows.Forms.TextBox uidTxtBx; - private System.Windows.Forms.TextBox pwTxtBx; - - //public UidPw UIDPW - //{ - // get - // { - // UidPw up = new UidPw(); - // up.Password = this.pwTxtBx.Text; - // up.UserId = this.uidTxtBx.Text; - // return up; - // } - //} - - public string uname=null; - public string pword=null; - public userpass() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - // - // TODO: Add any constructor code after InitializeComponent call - // - } - - public userpass(string PassedInName) - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - // - // TODO: Add any constructor code after InitializeComponent call - // - uidTxtBx.Text = PassedInName; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.uidTxtBx = new System.Windows.Forms.TextBox(); - this.uidLbl = new System.Windows.Forms.Label(); - this.pwLbl = new System.Windows.Forms.Label(); - this.pwTxtBx = new System.Windows.Forms.TextBox(); - this.OKBtn = new System.Windows.Forms.Button(); - this.CancelBtn = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // uidTxtBx - // - this.uidTxtBx.Location = new System.Drawing.Point(8, 40); - this.uidTxtBx.Name = "uidTxtBx"; - this.uidTxtBx.Size = new System.Drawing.Size(134, 22); - this.uidTxtBx.TabIndex = 0; - this.uidTxtBx.Text = ""; - this.uidTxtBx.KeyUp += new System.Windows.Forms.KeyEventHandler(this.uidTxtBx_KeyUp); - // - // uidLbl - // - this.uidLbl.Location = new System.Drawing.Point(16, 16); - this.uidLbl.Name = "uidLbl"; - this.uidLbl.Size = new System.Drawing.Size(115, 18); - this.uidLbl.TabIndex = 1; - this.uidLbl.Text = "User ID"; - // - // pwLbl - // - this.pwLbl.Location = new System.Drawing.Point(184, 16); - this.pwLbl.Name = "pwLbl"; - this.pwLbl.Size = new System.Drawing.Size(86, 18); - this.pwLbl.TabIndex = 2; - this.pwLbl.Text = "Password"; - // - // pwTxtBx - // - this.pwTxtBx.AcceptsTab = true; - this.pwTxtBx.Location = new System.Drawing.Point(176, 40); - this.pwTxtBx.Name = "pwTxtBx"; - this.pwTxtBx.PasswordChar = '*'; - this.pwTxtBx.Size = new System.Drawing.Size(125, 22); - this.pwTxtBx.TabIndex = 3; - this.pwTxtBx.Text = ""; - this.pwTxtBx.KeyUp += new System.Windows.Forms.KeyEventHandler(this.pwTxtBx_KeyUp); - // - // OKBtn - // - this.OKBtn.DialogResult = System.Windows.Forms.DialogResult.OK; - this.OKBtn.Location = new System.Drawing.Point(336, 16); - this.OKBtn.Name = "OKBtn"; - this.OKBtn.Size = new System.Drawing.Size(96, 28); - this.OKBtn.TabIndex = 4; - this.OKBtn.Text = "OK"; - this.OKBtn.Click += new System.EventHandler(this.OKBtn_Click); - // - // CancelBtn - // - this.CancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.CancelBtn.Location = new System.Drawing.Point(336, 56); - this.CancelBtn.Name = "CancelBtn"; - this.CancelBtn.Size = new System.Drawing.Size(96, 28); - this.CancelBtn.TabIndex = 5; - this.CancelBtn.Text = "Cancel"; - // - // userpass - // - this.AccessibleRole = System.Windows.Forms.AccessibleRole.None; - this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); - this.ClientSize = new System.Drawing.Size(448, 96); - this.ControlBox = false; - this.Controls.Add(this.CancelBtn); - this.Controls.Add(this.OKBtn); - this.Controls.Add(this.pwTxtBx); - this.Controls.Add(this.uidTxtBx); - this.Controls.Add(this.pwLbl); - this.Controls.Add(this.uidLbl); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "userpass"; - this.Text = " Login"; - this.ResumeLayout(false); - - } - #endregion - - private void OKBtn_Click(object sender, System.EventArgs e) - { - uname = this.uidTxtBx.Text; - pword = this.pwTxtBx.Text; - } - - private void pwTxtBx_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) - { - // if key pressed was a return - treat as ok button. - if (e.KeyCode == Keys.Return) this.OKBtn.PerformClick(); - } - - private void uidTxtBx_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) - { - // if key pressed was a return - treat as ok button. - if (e.KeyCode == Keys.Return) this.OKBtn.PerformClick(); - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/userpass.resx b/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/userpass.resx deleted file mode 100644 index efce1a59..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/RODBInterface/userpass.resx +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Assembly - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - userpass - - - Private - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ROFST/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/ROFST/AssemblyInfo.cs deleted file mode 100644 index 7e3b35a5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ROFST/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/ROFST/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/ROFST/AssemblyInfo.cs.bak deleted file mode 100644 index 6b2b0662..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ROFST/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/ROFST/ROFST.cs b/PROMS/ReferencedObjectsOld/LibSource/ROFST/ROFST.cs deleted file mode 100644 index 09af50ab..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ROFST/ROFST.cs +++ /dev/null @@ -1,3073 +0,0 @@ -/********************************************************************************************* - * Copyright 2005 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ROFST.cs $ $Revision: 13 $ - * $Author: Kathy $ $Date: 8/31/05 11:32a $ - * - * $History: ROFST.cs $ - * - * ***************** Version 13 ***************** - * User: Kathy Date: 8/31/05 Time: 11:32a - * Updated in $/LibSource/ROFST - * B2005-032: new groups crashed when writing to ro.fst during approve - * sel. - * - * ***************** Version 12 ***************** - * User: Kathy Date: 8/16/05 Time: 2:52p - * Updated in $/LibSource/ROFST - * B2005-030: crash when writing ro.fst for new ro - * - * ***************** Version 11 ***************** - * User: Kathy Date: 6/21/05 Time: 1:36p - * Updated in $/LibSource/ROFST - * FindModROs for approve selected, crash on xyplot with missing end ">" - * - * ***************** Version 10 ***************** - * User: Jsj Date: 6/02/05 Time: 11:31a - * Updated in $/LibSource/ROFST - * fix for approving with conditional ROs - * - * ***************** Version 9 ***************** - * User: Jsj Date: 5/20/05 Time: 9:21a - * Updated in $/LibSource/ROFST - * fixed getro for cases when using unit specific info to process the RO - * return value. - * - * ***************** Version 8 ***************** - * User: Jsj Date: 5/17/05 Time: 11:48a - * Updated in $/LibSource/ROFST - * fixed approve graphic bug, added default graphic extension as part of - * ROFST class initialization, code cleanup - * - * ***************** Version 7 ***************** - * User: Kathy Date: 5/11/05 Time: 9:26a - * Updated in $/LibSource/ROFST - * add close method - * - * ***************** Version 6 ***************** - * User: Jsj Date: 4/07/05 Time: 11:15a - * Updated in $/LibSource/ROFST - * fixes - * - * ***************** Version 5 ***************** - * User: Jsj Date: 3/31/05 Time: 9:16a - * Updated in $/LibSource/ROFST - * - * ***************** Version 4 ***************** - * User: Jsj Date: 3/28/05 Time: 12:18p - * Updated in $/LibSource/ROFST - * - * ***************** Version 3 ***************** - * User: Jsj Date: 3/22/05 Time: 9:52a - * Updated in $/LibSource/ROFST - * March 22 2005 update for merge - * - * ***************** Version 2 ***************** - * User: Jsj Date: 3/14/05 Time: 1:36p - * Updated in $/LibSource/ROFST - * update - * - * ***************** Version 1 ***************** - * User: Jsj Date: 3/10/05 Time: 3:53p - * Created in $/LibSource/ROFST - * - * ***************** Version 1 ***************** - * User: Jsj Date: 3/10/05 Time: 3:49p - * Created in $/LibSource/ROFST/ROFST - * - *********************************************************************************************/ -using System; -using System.IO; -using System.Windows.Forms; -using System.Text; -using System.Collections; -using VlnStatus; -using Utils; - -/* - * This namespace is used in both VE-PROMS and the RO Editor programs. - */ -namespace ROFST_FILE -{ - /* - * Globally used functions amoung a few of the classes in this namespace - */ - public class ROProcessTools - { - // For now, have hooks to set and get the current - // procedure number along with the Maxium Procedure - // Number length. The 16-bit code used globals - // jsj - 6/2/2005 - - private static string PNumber = " "; // default to blank - private static int mxPrcLen = 30; // default to 30 chars - - static ROProcessTools() - { - } - - public static string ProcedureNumber - { - set { PNumber = value.ToString();} - get { return PNumber; } - } - - public static int MaxProcNumLen - { - set { mxPrcLen = (int)value;} - get { return mxPrcLen;} - } - - public static string UnitSpecific(string str, int len, int trm, int maxPrcNumLen) - { - // This routine retrieves the procedure number format from the - // current directory and uses it to adjust the procedure number - // in the specified string - string retvalu=""; - string asis="#"; - string pnum; - if( str == null || str.Length == 0 ) return null; - /* - * Bug fix: B2005-017 3/2/2005 - * Need to use the largest procedure number length that's in the - * SET.DFF file. "LargestNumber" is the largest length after the - * procedure number is replaced via the SET.INI file "replace" list. - * - if(len==0)len=LargestNumber; - */ - if(len==0)len=maxPrcNumLen; //LargestRawSetNumber - string mstr; - PrivateProfile proc_ini = new PrivateProfile("proc.ini"); - mstr = proc_ini.Attr("unit", "procedure number"); - if (mstr == null) mstr = asis; - pnum=mstr; - if(pnum.Equals(asis)) - { - retvalu=str; - } - else if (!pnum.Equals("") && pnum[0] == '!') - { - if (File.Exists("set.ini")) - { - string p = str; - string q, tonum; - StringBuilder rbldr = new StringBuilder(); - int newl, dw, cnt=0, lstr; - - p = p.TrimStart(" ".ToCharArray()); - lstr = p.Length; - if (len > lstr) len = lstr; - mstr = p.Substring(0,len); - mstr = mstr.TrimEnd(" \t\r\n".ToCharArray()); - /* debug - string debugstr = "|" + mstr + "|"; - */ - - PrivateProfile set_ini = new PrivateProfile("set.ini"); - - tonum = set_ini.Attr("replace", mstr); - if (tonum == null || tonum.Equals("")) tonum = mstr; - newl = tonum.Length; - dw = newl - (lstr); - - q = str; p = tonum; - int strptr=0; - for (strptr=0; str[strptr] == ' '; strptr++) - rbldr.Append(" ");//initial spaces - int pptr=0; - while (cnt < len) - { - if (tonum!=null && pptr < tonum.Length) - rbldr.Append(tonum[pptr++]); - else if (trm == 1) break; - else if (cnt < lstr) rbldr.Append(" "); - else break; - cnt++; - } - if (trm==0) - { - strptr+=len; - while (str!=null && strptr < str.Length) - rbldr.Append(str[strptr++]); - } - retvalu = rbldr.ToString(); - } - else - { - retvalu=str; - } - } - else - { - StringBuilder rbldr = new StringBuilder(); - // create pointers to use to transfer info - int pnumPtr = 0, strPtr=0, endStrPtr = str.Length-1; - string pad = ""; - // determine if the procedure number should be padded instead - if(str[0]==' ')pad=" "; - // copy from the procedure number definition to the pound symbol - if (!pnum.Equals("")) - { - while(pnumPtr < pnum.Length && pnum[pnumPtr] != '#') - { - rbldr.Append(((!pad.Equals(""))? pad : pnum[pnumPtr].ToString())); - pnumPtr++; - } - // skip the pound sign - if(pnumPtr < pnum.Length && pnum[pnumPtr]!=0)pnumPtr++; - } - // assuming that the procedure number occurs at the beginning of - // str, check to see where it ends - if(str.Length > len)endStrPtr=len-1; - // find the end of the procedure number - while(endStrPtr > strPtr && str[endStrPtr]==' ')endStrPtr--; - // copy the procedure number - while(strPtr <= endStrPtr)rbldr.Append(str[strPtr++]); - // copy the rest of the format - while(pnumPtr < pnum.Length) - { - rbldr.Append(((!pad.Equals(""))? pad : pnum[pnumPtr].ToString())); - pnumPtr++; - } - // copy the rest of the given string - while(strPtr < str.Length)rbldr.Append(str[strPtr++]); - retvalu = rbldr.ToString(); - } - return retvalu; - } - - public static int matchingBrace(string str) - { - int strptr = 0; - int level=1; - while(level > 0) - { - strptr++; - switch(str[strptr]) - { - case '{': - level++; - break; - case '}': - level--; - break; - } - } - return strptr; - } - - public static int nextDelimiter(string delim,string str,int l) - { - int nxtdelim = -1; - int strptr = 0; - while(l-- > 0 && (nxtdelim == -1)) - { - if (delim.IndexOf(str[strptr])>-1) - nxtdelim = strptr; - strptr++; - } - return nxtdelim; - } - - public static string getProfile(string grp, string nam) - { - return getProfile(grp,nam,0); - } - - public static string getProfile(string grp, string nam, int flag) - { - string buff=null; - if( grp==null ) return null; - PrivateProfile proc_ini = new PrivateProfile("proc.ini"); - buff = proc_ini.Attr(grp,nam); - if (buff == null) - buff = ""; - if(buff.Equals("")) - { - if (flag == 0) - buff = "<" + grp + "-" + nam + ">"; - else - return null; - } - return buff; - } - - public static string evaluate(string str,int len) - { - string retval=null; - string swhir = "PSU"; /* order inwhich to check */ - string pn; - if(str[1]=='-') - { - int swptr = swhir.IndexOf((str.ToUpper())[0]); - byte swchar = 0; - if( swptr > -1 ) swchar = (byte)swhir[swptr]; - - byte sav=(byte)str[len]; - str = str.Substring(0,len); - while ((swptr > -1) && (swhir[swptr] != 0) && retval == null) - { - if (swchar == 0) swchar = (byte)str[0]; - switch((char)swchar) - { - case 'U': - retval=getProfile("Unit",str.Substring(2),swhir[swptr]); - break; - case 'S': - retval=getProfile("Procedure Set",str.Substring(2),swhir[swptr]); - break; - case 'P': - pn = UnitSpecific(PNumber, 0, 1, mxPrcLen); - retval=getProfile(pn,str.Substring(2),swhir[swptr]); - break; - } - if (retval == null) - swchar= (byte)swhir[++swptr]; - } - StringBuilder sb1 = new StringBuilder(str); - sb1.Insert(len,sav); - str = sb1.ToString(); - } - else if(len==1 && (str.ToUpper())[0]=='U') - { - retval=getProfile("Unit","Number"); - } - else if(len==2 && str.ToUpper().StartsWith("ID")) - { - retval=getProfile("Unit","ID"); - } - if(retval == null) - { - retval=str.Substring(0,len+2>str.Length?str.Length:len+2); - } - return retval; - } - - } - - - /// - /// Summary description for ROFSTHeader. - /// - - public class FST_FileHeader - { - public int hSize; // size of header structure (record) - public short hYear;// year this header was designed (1993) - public byte hMonth;// month this header was designed (10) - public byte hDay;// day this header was designed (25) - public short hcYear;// FST file creation year - public byte hcMonth;// FST file creation month - public byte hcDay;// FST file creation day - public byte hcHour;// FST file creation hour - public byte hcMin;// FST file creation minute - public byte hcSec;// FST file creation seconds - public byte hcHund;// FST file creation hundredth seconds - public uint dboffset;// end of RO data, start of database list - - - // Constructors - // default constructor creates with zero'd out values - public FST_FileHeader() - { - hSize = 0; - hYear = 0; - hMonth = 0; - hDay = 0; - hcYear = 0; - hcMonth = 0; - hcDay = 0; - hcHour = 0; - hcMin = 0; - hcSec = 0; - hcHund = 0; - dboffset = 0; - } - - - // Constructor that initializes with pass in values - FST_FileHeader(int Size, short Year, byte Month, byte Day, short cYear, byte cMonth, - byte cDay, byte cHour, byte cMin, byte cSec, byte cHund, uint offset) - { - hSize = Size; - hYear = Year; - hMonth = Month; - hDay = Day; - hcYear = cYear; - hcMonth = cMonth; - hcDay = cDay; - hcHour = cHour; - hcMin = cMin; - hcSec = cSec; - hcHund = cHund; - dboffset = offset; - } - - - public void Read (BinaryReader br) - { - hSize = br.ReadInt32(); - hYear = br.ReadInt16(); - hMonth = br.ReadByte(); - hDay = br.ReadByte(); - hcYear = br.ReadInt16(); - hcMonth = br.ReadByte(); - hcDay = br.ReadByte(); - hcHour = br.ReadByte(); - hcMin = br.ReadByte(); - hcSec = br.ReadByte(); -// byte tbyte = br.ReadByte(); -// hcHund = (sbyte)tbyte; - hcHund = br.ReadByte(); - dboffset = br.ReadUInt32(); - - // return new FST_FileHeader(fSize,fYear,fMonth,fDay, - // fcYear,fcMonth,fcDay,fcHour,fcMin,fcSec,fcHund,fdboffset); - } - - - public void Write (BinaryWriter bw) - { - bw.Write(hSize); - bw.Write(hYear); - bw.Write(hMonth); - bw.Write(hDay); - bw.Write(hcYear); - bw.Write(hcMonth); - bw.Write(hcDay); - bw.Write(hcHour); - bw.Write(hcMin); - bw.Write(hcSec); - bw.Write(hcHund); - bw.Write(dboffset); - } - - - public int GetStructSize() - { - int rtval = 0; - - // You can only use sizeof() in unsafe compiles - // so we'll do it by hand... - // each number is the number of bytes - - rtval += 4; //sizeof(hSize); - rtval += 2; //sizeof(hYear); - rtval += 1; //sizeof(hMonth); - rtval += 1; //sizeof(hDay); - rtval += 2; //sizeof(hcYear); - rtval += 1; //sizeof(hcMonth); - rtval += 1; //sizeof(hcDay); - rtval += 1; //sizeof(hcHour); - rtval += 1; //sizeof(hcMin); - rtval += 1; //sizeof(hcSec); - rtval += 1; //sizeof(hcHund); - rtval += 4; //sizeof(dboffset); - - return rtval; - } - - - public void SetHeader(uint offset) - { - hSize = GetStructSize(); - hYear = 1993; - hMonth = 10; - hDay = 25; - DateTime dt = DateTime.Now; - hcYear = (short)dt.Year; - hcMonth = (byte)dt.Month; - hcDay = (byte)dt.Day; - hcHour = (byte)dt.Hour; - hcMin = (byte)dt.Minute; - hcSec = (byte)dt.Second; - hcHund = (byte)dt.Millisecond; - dboffset = offset; - } - } - - - public class ROFST_DbInfo - { - public ushort dbiID; // Number part of table name (RO000002 => 02) - public ushort dbiType; // database type (Setpoint,Graphics,User defined) - public ushort dbiAW; // length of widest AccPageID - public uint dbiGL; // FST file position of this group - public uint dbiIL; // FST file position of list of ROIDs - public uint dbiAL; // FST file position of list of AccPageIDs - public uint dbiEND; // FST file position of the end of this group - // !!! make sure to convert strings to char arrays when writing - public string dbiTitle; // database title - public string dbiAP; // AccPageID Prefix (ex. SP- ) - - - // Constructors - // default constructor creates with zero'd out values - public ROFST_DbInfo() - { - dbiID = 0; - dbiType = 0; - dbiAW = 0; - dbiGL = 0; - dbiIL = 0; - dbiAL = 0; - dbiEND = 0; - dbiTitle = ""; - dbiAP = ""; - } - - - // Constructor that initializes with pass in values - ROFST_DbInfo(ushort ID, ushort Type, ushort AW, uint GL, uint IL, uint AL, uint END, - string Title, string dbiAP) - { - dbiID = ID; - dbiType = Type; - dbiAW = AW; - dbiGL = GL; - dbiIL = IL; - dbiAL = AL; - dbiEND = END; - dbiTitle = Title; - dbiAP = dbiAP; - } - - - public void WriteUntAndShort(BinaryWriter bw) - { - bw.Write(dbiID); - bw.Write(dbiType); - bw.Write(dbiAW); - bw.Write(dbiGL); - bw.Write(dbiIL); - bw.Write(dbiAL); - bw.Write(dbiEND); - } - - - void WriteString(BinaryWriter bw, string str) - { - byte nullbyte = 0; - byte []wrBytes = new byte[str.Length + 1]; - int i; - for(i =0; i < str.Length; i++) - { -// byte WrByte; -// WrByte = (byte)str[i]; -// bw.Write(WrByte); - wrBytes[i] = (byte)str[i]; - } - wrBytes[i] = nullbyte; - bw.Write(wrBytes); -// bw.Write(nullbyte); - } - - - public void WriteStrings(BinaryWriter bw) - { - WriteString(bw,dbiTitle); - WriteString(bw,dbiAP); - } - - - public uint GetStructSize() - { - uint rtval = 0; - - // You can only use sizeof() in unsafe compiles - // so we'll do it by hand... - // each number is the number of bytes - - rtval += 2; //sizeof(dbiID); - rtval += 2; //sizeof(dbiType); - rtval += 2; //sizeof(dbiAW); - rtval += 4; //sizeof(dbiGL); - rtval += 4; //sizeof(dbiIL); - rtval += 4; //sizeof(dbiAL); - rtval += 4; //sizeof(dbiEND); - rtval += 4; //sizeof(uint); // to simulate the (char *) in the old code (16 datatypes) - rtval += 4; //sizeof(uint); // to simulate the (char *) in the old code (16 datatypes) - - return rtval; - } - - - public void Load(BinaryReader br) - { - ReadValues(br); - } - - // public void ReadStrings(BinaryReader br) - // { - // dbiTitle = ROFST_File.LoadString(br); - // dbiAP = ROFST_File.LoadString(br); - // } - - - public void ReadValues(BinaryReader br) - { - dbiID = br.ReadUInt16(); - dbiType = br.ReadUInt16(); - dbiAW = br.ReadUInt16(); - dbiGL = br.ReadUInt32(); - dbiIL = br.ReadUInt32(); - dbiAL = br.ReadUInt32(); - dbiEND = br.ReadUInt32(); - uint tmp = br.ReadUInt32(); - uint tmp1 = br.ReadUInt32(); - } - } - - - - // structure to hold information to add a new group - public struct AddGroup - { - public uint grp_id; - public uint grp_parid; - public string grp_name; - public short grp_type; - public short grp_stat; - public uint grp_offset; - public int grp_pargrpidx; - - - // These functions are needed to update values when - // referenced from the ArrayLists (allNewGrps) -// public void OR_grp_type(short val) -// { -// ushort gtype = (ushort)grp_type; -// gtype |= (ushort)val; -// grp_type = (short)gtype; -// } -// -// -// public void SET_grp_parid(uint val) -// { -// grp_parid = val; -// } -// -// -// public void SET_grp_pargrpidx(int val) -// { -// grp_pargrpidx = val; -// } -// -// -// public void SET_grp_stat(short val) -// { -// grp_stat = val; -// } -// -// -// public void SET_grp_offset(uint val) -// { -// grp_offset = val; -// } - } - - - // structure to hold information to add a new RO - public struct AddRO - { - public uint ro_id; - public uint ro_parid; - public string ro_num; - public string ro_desc; - public string ro_val; - public short ro_type; - public short ro_stat; - public int ro_offset; - public int ro_pargrpidx; // index into allNewGrps - - - // These functions are needed to update values when - // referenced from the ArrayLists (allNewRos) -// public void SET_ro_pargrpidx(int val) -// { -// ro_pargrpidx = val; -// } -// -// -// public void SET_ro_parid(uint val) -// { -// ro_parid = val; -// } -// -// -// public void SET_ro_stat(short val) -// { -// ro_stat = val; -// } -// -// -// public void SET_ro_offset(int val) -// { -// ro_offset = val; -// } - } - - - // structure to hold RO difference information - public struct DiffRO - { - public uint id; - public short type; - public string desc; - public string val; - public uint oldoff; // index into old RO.FST file (approved) - } - - - // RO update info arrays. - // one of these structures is created from each RO database - // (Setpoints, Graphics, User Defined, etc.) - public struct dbinew - { - public ArrayList aryAddedRO; - public ArrayList aryAddedGroup; - public ArrayList aryAddedDiff; - } - - - // structure to store file positions in the RO.FST file - public struct locinc - { - public uint maxloc; - public int inc; - } - - - /* - ** Structure of the graphics' values. - ** LocalGrfStats ( in ROFST_File class) is used to hold the current - ** values "locally" in memory - */ - public struct GrfStats - { - public string PixFileName; - public int PixFileTime; - public short PixFileHeight; - public short PixFileWidth; - - public void Clear() - { - PixFileName=""; - PixFileTime = 0; - PixFileHeight = 0; - PixFileWidth = 0; - } - - public void Load(string instr) - { - short DeciPerRow = 120; - short DeciPerCol = 60; - StringBuilder sb = new StringBuilder(); - int i=0; - bool nl = false; - /* - sscanf(retval,"%s\n%08lx\n%04x\n%04x",LocalGrfStats.PixFileName, - &LocalGrfStats.PixFileTime,&LocalGrfStats.PixFileHeight, - &LocalGrfStats.PixFileWidth); - LocalGrfStats.PixFileHeight *= DeciPerRow; - LocalGrfStats.PixFileWidth *= DeciPerCol; - */ - while (!nl && (instr[i]!= 0)) - { - if (instr[i]=='\n') - nl=true; - else - sb.Append(instr[i]); - i++; - } - if (nl) - { - PixFileName = sb.ToString(); - } - - nl = false; - sb.Remove(0,sb.Length); - while (!nl && (instr[i]!=0)) - { - if (instr[i]=='\n') - nl=true; - else - sb.Append(instr[i]); - i++; - } - PixFileTime = Convert.ToInt32(sb.ToString(),16); - - nl = false; - sb.Remove(0,sb.Length); - while (!nl && (instr[i]!=0)) - { - if (instr[i]=='\n') - nl=true; - else - sb.Append(instr[i]); - i++; - } - PixFileHeight = Convert.ToInt16(sb.ToString(),16); - PixFileHeight *= DeciPerRow; - - sb.Remove(0,sb.Length); - while ((i < instr.Length) && (instr[i]!=0)) - { - sb.Append(instr[i]); - i++; - } - PixFileWidth = Convert.ToInt16(sb.ToString(),16); - PixFileWidth *= DeciPerCol; - } - } - - - public class ROFST_File - { - public enum ROTypes - { - None=0, Text=1, Table=2, Plot=4, Figure=8 - }; - - private string [] UnitVariables = - { - "All of the following",// - "Number", // 1L; - 1, 2 etc. - "Other Number", // 2L; - 2, 1 etc. - "Text", // 3L; - One, Two etc. or Unit One, Unit Two - "Other Text", // 4L; - Two, One etc. or Unit Two, Unit One - "ID", // 5L; - 1Bw, 2Bw etc. - "Other ID", // 6L; - 2Bw, 1Bw etc. - "Name", // 7L; - Braidwood Unit 1 - "Other Name" // 8L; - Braidwood Unit 2 - }; - private uint NumUnitVariables =9; - - - private ArrayList [] allNewRos; // new ROs - private ArrayList [] allDifferences; // changed ROs - private ArrayList [] allNewGrps; // new Groups - private ArrayList allLocations; // positions in RO.FST - - - private int curTblIdx=0; // index into allxxxxx arraylists - private uint NewID = 0xFFFF0000; - private uint whereisgl = 0; - private ushort maxaw=0; - private ushort maxtype=0; - private int lastLocationIdx = 0; - - public BinaryReader brROFst; // file handle into RO.FST - public ArrayList DatabasesInfo; // Holds the current RO.FST data - public ArrayList dbiNewInfo; // will hold new RO.FST data - - public short numDatabases; // number of databases in RO.FST - public FST_FileHeader Header; - // public UserRunTime usrRunTime; - public string DirPath; - - public string DefaultGraphicFileExt = ""; - - // RO Graphics information - GrfStats LocalGrfStats; - - // constructor loads ro.fst databases - // public ROFST(string path, UserRunTime urt) - public ROFST_File(string path) - { - try - { - brROFst = new BinaryReader(File.Open(path,System.IO.FileMode.Open,System.IO.FileAccess.ReadWrite,FileShare.ReadWrite)); - } - catch (Exception e) - { - MessageBox.Show("Open "+path+"\n\n" + e.Message,"RO.FST Error"); - return; - } - DirPath = path; // path of RO.FST file - - // usrRunTime = urt; - - // Read the RO.FST header information - Header = new FST_FileHeader(); - Header.Read(brROFst); - brROFst.BaseStream.Seek(Header.dboffset,SeekOrigin.Begin); - uint howbig = brROFst.ReadUInt32(); - short howmany = brROFst.ReadInt16(); - - numDatabases = howmany; - // dbcount = numDatabases; - DatabasesInfo = new ArrayList(); - dbiNewInfo = new ArrayList(); - - // Load the database into the arrays - for (int i=0;i topid)return 0; // Beyond range - while (topr > botr+1) - { - guessr=botr+((topr-botr)*(id-botid))/(topid-botid); - - if (guessr==botr) guessr=botr+1; - else if (guessr==topr) guessr=topr-1; - - guess=start+guessr*siz; - brROFst.BaseStream.Seek(guess,SeekOrigin.Begin); - //getID(guess,&retval) - guessid=brROFst.ReadUInt32(); - - if(guessid==id) - { - break; // found, break out of while loop - } - else if(guessid < id) - { - botr=guessr; - botid=guessid; - } - else - { - topr=guessr; - topid=guessid; - } - } - if(guessid==id)retval=guess; // Any other record - return retval; - } - - private uint _getID(uint off,ref uint nxtoff) - { - uint retval = 0; - if (off > 0) - { - brROFst.BaseStream.Seek(off,SeekOrigin.Begin); - retval = brROFst.ReadUInt32(); - nxtoff = brROFst.ReadUInt32(); - } - return retval; - } - - // Find the location of an RO value in the RO.FST file - private uint toolsFindRO(uint id, uint start, uint end) - { - uint retval=0; - uint topid=0,botid=0,recs=0,siz=0; - siz=8; // c code:sizeof(topid)*2; - recs=(end-start)/siz; //c code: (end-start)>>3 - uint guessr,guess=0,guessid=0; - uint botr=0,topr=recs; - uint topoff =0, botoff=0; - //getID(end-siz,&topoff); - topid=_getID(end-siz,ref topoff); - if(id==topid)return topoff; // Last record - - //getID(start,&botoff); - botid=_getID(start,ref botoff); - if(id==botid)return botoff; // First record - - if(id < botid || id > topid)return 0; // Beyond range - while (topr > botr+1) - { - guessr=botr+((topr-botr)/2); - - if (guessr==botr) guessr++; - else if (guessr==topr) guessr--; - - //getID(guess,&retval) - guessid=_getID(start+guessr*siz,ref retval); - - if(guessid==id) - { - break; // found, break out of while loop - } - else if(guessid < id) - { - botr=guessr; - botid=guessid; - } - else - { - topr=guessr; - topid=guessid; - } - } - if (guessid == id) return retval; - return 0; - } - - - // return the type of the given RO - private ROTypes FindROType(uint rec, uint start, uint end) - { - short retval=0; - byte[] tbyte= new byte[100]; - uint fnd; - if((fnd=FindRO(rec,start,end))>0) - { - uint offset=brROFst.ReadUInt32(); - brROFst.BaseStream.Seek((long)offset,SeekOrigin.Begin); - uint guessid=brROFst.ReadUInt32(); - uint parid=brROFst.ReadUInt32(); - short count=brROFst.ReadInt16(); - retval=brROFst.ReadInt16(); // RO Type - } - return (ROTypes)retval; - } - - - // Get the RO Type from the ROID - public ROTypes GetROType(string ROID) - { - // break up ROID into table and record - ushort tbl = System.Convert.ToUInt16(ROID.Substring(0,4),16); - uint rec = System.Convert.ToUInt32(ROID.Substring(4,8),16); - ushort opt=0; - if (ROID.Length>12) opt = System.Convert.ToUInt16(ROID.Substring(8,ROID.Length-12),16); - if (tbl==0xFFFF) - return ROTypes.None; // 0xFFFF is ro from proc.ini file - int num=0; - for (int i=0; i < numDatabases && ((ROFST_DbInfo)DatabasesInfo[i]).dbiID!=tbl;i++) num++; - if (num < numDatabases) - { - return FindROType(rec,((ROFST_DbInfo)DatabasesInfo[num]).dbiIL,((ROFST_DbInfo)DatabasesInfo[num]).dbiAL); - } - return ROTypes.None; - } - - - private string FindROText(uint id, uint start,uint end) - { - string retval=null; - uint fnd; - if((fnd=FindRO(id,start,end))>0) - { - uint offset=brROFst.ReadUInt32(); - brROFst.BaseStream.Seek((long)offset,SeekOrigin.Begin); - uint guessid=brROFst.ReadUInt32(); - uint parid=brROFst.ReadUInt32(); - short count=brROFst.ReadInt16(); - ushort typ=brROFst.ReadUInt16(); - if (count<0)retval=GetAsciiString(brROFst); - } - return retval; - } - - - // return the RO defined in the PROC.INI file - // (master / slave logic) - private string roUnitValue(uint rec) - { - string buff=""; - PrivateProfile proc_ini = new PrivateProfile("proc.ini"); - for(int i=0; i < NumUnitVariables; i++) - { - if((i+1) == rec) - { - buff = proc_ini.Attr("Unit",UnitVariables[i+1]); - if (buff == null || buff.Equals("")) - buff = "{"+ UnitVariables[i+1] + "}"; - break; // break out of for loop - } - } - return buff; - } - - - // - // this function will take the ro text value and see if - // a macro has been used. If so it will perform the macro - // operation on the substring in the text value - // - // right now the only macro is @HSP(), where every space between - // the "(" and ")" will be replaced with a hardspace - // - public string processMacros(string rostring) - { - StringBuilder bldstr = new StringBuilder(); - int cptr = -1; - int stptr = 0; - if( rostring == null ) return rostring; - while( (cptr = rostring.IndexOf("@HSP(",stptr)) != -1 ) - { - bldstr.Append(rostring.Substring(0,cptr-stptr)); - int cptr2 = rostring.IndexOf(")",cptr); - if (cptr2 != -1) - { - int numspaces = cptr2 - cptr - 5; - for (int i=0; i< numspaces; i++) - bldstr.Append("\xFF"); - stptr = cptr2 + 1; - } - else - { - bldstr.Append(rostring.Substring(cptr,5)); - stptr += 5; - } - } - if (stptr < rostring.Length) - bldstr.Append(rostring.Substring(stptr)); - return bldstr.ToString(); - } - - - - private string processROString(string rostr, short menuitem) - { - string newstr=""; - strList2 strlst2 = new strList2(rostr); - strList strlst = new strList(strlst2.toText()); - newstr = strlst.toText((int)menuitem); - - newstr = newstr.Replace("\\n","\n"); - newstr = processMacros(newstr); - return newstr; - } - - - public string GetRO(string ROID) - { - return _GetRO(ROID,1); - } - - public string GetEntireRO(string ROID) - { - return _GetRO(ROID,0); - } - - public string GetRO(string ROID, string ProcNum) - { - ROProcessTools.ProcedureNumber = ProcNum; - return GetRO(ROID); - } - - public string GetEntireRO(string ROID, string ProcNum) - { - ROProcessTools.ProcedureNumber = ProcNum; - return GetEntireRO(ROID); - } - - // Get the RO value from the ROID - private string _GetRO(string ROID_in, short procopt) - { - string ROID = ROID_in; - if (ROID.Length == 12) - ROID = ROID + "0000"; - ushort tbl = System.Convert.ToUInt16(ROID.Substring(0,4),16); - uint rec = System.Convert.ToUInt32(ROID.Substring(4,8),16); - ushort opt=0; - // clear graphics info - LocalGrfStats.Clear(); - opt = System.Convert.ToUInt16(ROID.Substring(12,ROID.Length-12),16); - - if (tbl==0xFFFF) - return roUnitValue(rec); // RO in PROC.INI file - - int num=0; - for(int i=0; i < numDatabases && ((ROFST_DbInfo)DatabasesInfo[i]).dbiID!=tbl;i++) num++; - - string retval = null; - if(num < numDatabases) - { - retval=FindROText(rec,((ROFST_DbInfo)DatabasesInfo[num]).dbiIL,((ROFST_DbInfo)DatabasesInfo[num]).dbiAL); - } - if ((retval!=null&&retval!="") && (GetROType(ROID)==ROTypes.Figure)) - { - // load graphic stats - StringBuilder sbtmp = new StringBuilder(); - LocalGrfStats.Load(retval); - sbtmp.Append(LocalGrfStats.PixFileName); - sbtmp.Append("\n"); - sbtmp.Append(LocalGrfStats.PixFileTime.ToString("x8")); - sbtmp.Append("\n"); - sbtmp.Append(LocalGrfStats.PixFileHeight.ToString("x4")); - sbtmp.Append("\n"); - sbtmp.Append(LocalGrfStats.PixFileWidth.ToString("x4")); - retval = sbtmp.ToString(); - - } - if(retval!=null && retval.Length>0 && !(GetROType(ROID)==ROTypes.Figure)) - { - retval = retval.Replace("\r",""); - if (procopt!=0) - { - string newstr = processROString(retval,(short)opt); - if (newstr!=null && !newstr.Equals("")) - retval = newstr; - } - } - return retval; - } - - - // Get the RO's parent ID - private uint GetParent(uint rec, uint start,uint end,ref uint offset) - { - uint parid=0; - uint fnd; - if((fnd=FindRO(rec,start,end))>0) - { - offset=brROFst.ReadUInt32(); - brROFst.BaseStream.Seek((long)offset,SeekOrigin.Begin); - uint guessid=brROFst.ReadUInt32(); - parid=brROFst.ReadUInt32(); - } - return parid; - } - - - // Get the RO's parent ID from the ROID - public uint GetROParent(string ROID) - { - ushort tbl = Convert.ToUInt16(ROID.Substring(0,4),16); - uint rec = Convert.ToUInt32(ROID.Substring(4,8),16); - uint retval=0; - int indx=0; - for(int i=0; i < numDatabases && ((ROFST_DbInfo)DatabasesInfo[i]).dbiID!=tbl; i++) indx++; // position to the RO database - - if(indx < numDatabases) - { - uint offset=0; - retval=GetParent(rec,((ROFST_DbInfo)DatabasesInfo[indx]).dbiIL,((ROFST_DbInfo)DatabasesInfo[indx]).dbiAL,ref offset); - } - return retval; - } - - - // Get the group title - private string GetDescription(ushort tbl, uint rec) - { - string retval=null; - if(tbl==0xFFFF) - { - if(rec == 0) - { - retval="Unit Information"; - } - - else if (rec <= NumUnitVariables) - { - int irec = (int)rec; - retval=UnitVariables[irec]; - } - } - else - { - int indx=0; - for(int i=0; i < numDatabases && ((ROFST_DbInfo)DatabasesInfo[i]).dbiID!=tbl; i++) indx++; - - if(indx < numDatabases) - { - uint id; - brROFst.BaseStream.Seek(((ROFST_DbInfo)DatabasesInfo[indx]).dbiGL,SeekOrigin.Begin); - id = brROFst.ReadUInt32(); - - if((rec==0) || rec==id) - { - retval=((ROFST_DbInfo)DatabasesInfo[indx]).dbiTitle; - } - else - { - uint offset=0; - uint parid = this.GetParent(rec,((ROFST_DbInfo)DatabasesInfo[indx]).dbiIL,((ROFST_DbInfo)DatabasesInfo[indx]).dbiAL,ref offset); - if(parid!=0) - { - uint t1 = FindRO(parid,((ROFST_DbInfo)DatabasesInfo[indx]).dbiIL,((ROFST_DbInfo)DatabasesInfo[indx]).dbiAL); - t1 = brROFst.ReadUInt32(); - uint guessid; - brROFst.BaseStream.Seek(t1,SeekOrigin.Begin); - guessid = brROFst.ReadUInt32(); - parid = brROFst.ReadUInt32(); - short count; - count = brROFst.ReadInt16(); - for(int i=0; i < count && retval == null; i++) - { - uint off; - off=brROFst.ReadUInt32(); - ushort typ; - typ=brROFst.ReadUInt16(); - if(off==offset) - { - retval = GetAsciiString(brROFst); - } - else - { - SkipString(brROFst); - } - } - } - } - } - } - return retval; - } - - - // Get the group title by ROID - public string GetRODescription(string ROID) - { - ushort tbl = Convert.ToUInt16(ROID.Substring(0,4),16); - uint rec = Convert.ToUInt32(ROID.Substring(4,8),16); - return (GetDescription(tbl,rec)); - } - - - // get the Accessory Page ID - string FindROAccID(uint id, uint start, uint end) - { - // Returns allocated space - string retval=null; - if(FindRO(id,start,end)!=0) - { - uint offset = brROFst.ReadUInt32(); - brROFst.BaseStream.Seek(offset,SeekOrigin.Begin); - uint guessid = brROFst.ReadUInt32(); - uint parid = brROFst.ReadUInt32(); - short count = brROFst.ReadInt16(); - ushort ltyp = brROFst.ReadUInt16(); - SkipString(brROFst); - retval = GetAsciiString(brROFst); - } - return retval; - } - - - private string roUnitAccID(uint rec) - { - string rotbuf=""; - for(int i=0; i < NumUnitVariables; i++) - { - if((i+1L)==rec) - { - rotbuf = "U-"+UnitVariables[i+1]; - break; // break out of for loop - } - } - return rotbuf; - } - - - // Get accessory page ID via the table and record - // also include unit specs from ini file - private string GetAccID(ushort tbl, uint rec) - { - string retval=null; - - if (tbl==0xFFFF) - { - return roUnitAccID(rec); // PROC.INI ro - } - int indx=0; - for(int i=0; i < numDatabases && ((ROFST_DbInfo)DatabasesInfo[i]).dbiID!=tbl; i++)indx++; - - if(indx < numDatabases) - { - retval=FindROAccID(rec,((ROFST_DbInfo)DatabasesInfo[indx]).dbiIL,((ROFST_DbInfo)DatabasesInfo[indx]).dbiAL); - if (retval == null) - retval=""; // RO not found, has ? in procedures - else - retval = ((ROFST_DbInfo)DatabasesInfo[indx]).dbiAP + "-" + retval; - } - return retval; - } - - - // Get the accessory page ID from the ROID - // includes unit specs from ini file - public string RoidToAccId(string ROID) - { - ushort tbl = Convert.ToUInt16(ROID.Substring(0,4),16); - uint rec = Convert.ToUInt32(ROID.Substring(4,8),16); - if(tbl != 0) - return GetAccID(tbl,rec); - return null; - } - - - // Get the accessory page ID - private string GetAppID(ushort tbl) - { - string retval = null; - if (tbl==0xFFFF) - { - return "U"; // PROC.INI ro - } - int indx=0; - for(int i=0; i < numDatabases && ((ROFST_DbInfo)DatabasesInfo[i]).dbiID!=tbl; i++) indx++; - - if(indx < numDatabases) - return ((ROFST_DbInfo)DatabasesInfo[indx]).dbiAP; - return retval; - } - - - // Get the accessory page ID from the ROID - public string GetROAppID(string ROID) - { - ushort tbl = Convert.ToUInt16(ROID.Substring(0,4),16); - uint rec = Convert.ToUInt32(ROID.Substring(4,8),16); - return GetAppID(tbl); - } - - - public uint FindROFromTblRec(ushort tbl, uint id) - { - if(tbl==0xFFFF) - { - //PROC.INI ro - if (id < NumUnitVariables) return 1; - return 0; - } - int indx=0; - for(int i=0; i < numDatabases && ((ROFST_DbInfo)DatabasesInfo[i]).dbiID!=tbl;i++) indx++; - if (indx==numDatabases) return 0; - return FindRO(id,((ROFST_DbInfo)DatabasesInfo[indx]).dbiIL,((ROFST_DbInfo)DatabasesInfo[indx]).dbiAL); - } - - - public bool ROExists(string ROID) - { - ushort tbl = Convert.ToUInt16(ROID.Substring(0,4),16); - uint rec = Convert.ToUInt32(ROID.Substring(4,8),16); - uint off = FindROFromTblRec(tbl,rec); - return (off!=0); - } - - - public static void SkipString(BinaryReader br) - { - byte []input = {0}; - do - { - try - { - input[0] = br.ReadByte(); - } - catch (System.IO.EndOfStreamException) - { - input[0] = 0; - } - }while (input[0] != 0); - return; - } - - - public static string GetAsciiString(BinaryReader br, int len) - { - StringBuilder inpstr = new StringBuilder(); - byte input = 0; - int cnt = 0; - do - { - try - { - input = br.ReadByte(); - inpstr.Append(Convert.ToChar(input)); - } - catch (System.IO.EndOfStreamException) - { - input = 0; - while (cnt < len) - { - inpstr.Append(Convert.ToChar(input)); - cnt++; - } - } - cnt++; - }while (cnt < len); - - return (inpstr.ToString()); - } - - - public static string GetAsciiString(BinaryReader br) - { - StringBuilder inpstr = new StringBuilder(); - byte input = 0; - do - { - try - { - input = br.ReadByte(); - if (input > 0) - { - inpstr.Append(Convert.ToChar(input)); - } - } - catch (System.IO.EndOfStreamException) - { - input = 0; - } - }while (input != 0); - return (inpstr.ToString()); - } - - - // return the index into the the DatabasesInfo array - private short GetTable(ushort tblid) - { - short found = -1; - for(short i = 0; (i < numDatabases) && (found == -1); i++) - { - if (tblid == ((ROFST_DbInfo)DatabasesInfo[i]).dbiID) - found = i; - } - - if (found == -1) - { - // add a new item to the list - found = numDatabases; - ROFST_DbInfo tmpDbInfo = new ROFST_DbInfo(); - tmpDbInfo.dbiID = tblid; - DatabasesInfo.Add(tmpDbInfo); - dbinew dbinewItem; - dbinewItem = new dbinew(); - dbiNewInfo.Add(dbinewItem); - numDatabases++; - } - return found; - } - - - // Add a new RO record to the arraylist of allNewRos - private int AddNewRO(uint id,string num,string desc,string val,short type,uint grpn) - { - int rtval; - AddRO tmpAddRO = new AddRO(); - tmpAddRO.ro_id = id; - tmpAddRO.ro_num = num; - tmpAddRO.ro_desc = desc; - tmpAddRO.ro_val = val; - tmpAddRO.ro_type = type; - tmpAddRO.ro_parid = grpn; - (allNewRos[curTblIdx]).Add(tmpAddRO); - rtval = (allNewRos[curTblIdx]).Count -1; - return rtval; - } - - - private int AddNewRO(string num,string desc,string val,short type,uint grpn) - { - return AddNewRO(NewID++, num, desc, val, type, grpn); - } - - - // Add a new Group record to the arraylist of allNewGrps - private int AddNewGroup(uint id,string grpname,short type) - { - int rtval; - AddGroup tmpAddGroup = new AddGroup(); - tmpAddGroup.grp_id = id; - tmpAddGroup.grp_name = grpname; - tmpAddGroup.grp_type = type; - (allNewGrps[curTblIdx]).Add(tmpAddGroup); - rtval = (allNewGrps[curTblIdx]).Count -1; - return rtval; - } - - - private int AddNewGroup(string grpname,short type) - { - return AddNewGroup(NewID++,grpname,type); - } - - - // Return the index into the allNewGrps arraylist - private int FindNewGroup(uint rec) - { - int rtval = -1; - for (int i=0; i < (allNewGrps[curTblIdx]).Count && rtval == -1; i++) - { - if (((AddGroup)(allNewGrps[curTblIdx])[i]).grp_id == rec) - rtval = i; - } - return rtval; - } - - - private int connectToNewGroupfRO(int lastaddROIDX,uint rec,uint parid,string desc) - { - int newgrpIDX; - // position to the correct RO group - if((newgrpIDX=FindNewGroup(rec))== -1) - { - // group not found, add a new one - newgrpIDX=AddNewGroup(rec,desc,0); - } - //update parent info - AddRO taddro = (AddRO)(allNewRos[curTblIdx][lastaddROIDX]); - taddro.ro_pargrpidx = newgrpIDX; - taddro.ro_parid = rec; - allNewRos[curTblIdx].RemoveAt(lastaddROIDX); - allNewRos[curTblIdx].Insert(lastaddROIDX,taddro); - - //update group info - AddGroup taddgroup = (AddGroup)(allNewGrps[curTblIdx][newgrpIDX]); - taddgroup.grp_type |= ((AddRO)(allNewRos[curTblIdx])[lastaddROIDX]).ro_type; - taddgroup.grp_parid = parid; - allNewGrps[curTblIdx].RemoveAt(newgrpIDX); - allNewGrps[curTblIdx].Insert(newgrpIDX,taddgroup); - return newgrpIDX; - } - - - private int connectToNewGroup(int lastaddgrpIDX,uint rec,uint parid,string desc) - { - // update group info - int newgrpIDX; - // position to the correct RO group - if((newgrpIDX=FindNewGroup(rec))== -1) - { - // group not found, add a new one - newgrpIDX=AddNewGroup(rec,desc,0); - } - AddGroup taddgroup = (AddGroup)(allNewGrps[curTblIdx][lastaddgrpIDX]); - taddgroup.grp_pargrpidx = newgrpIDX; - taddgroup.grp_parid = rec; - allNewGrps[curTblIdx].RemoveAt(lastaddgrpIDX); - allNewGrps[curTblIdx].Insert(lastaddgrpIDX,taddgroup); - - taddgroup = (AddGroup)(allNewGrps[curTblIdx][newgrpIDX]); - taddgroup.grp_type |= ((AddGroup)(allNewGrps[curTblIdx])[lastaddgrpIDX]).grp_type; - taddgroup.grp_parid = parid; - allNewGrps[curTblIdx].RemoveAt(newgrpIDX); - allNewGrps[curTblIdx].Insert(newgrpIDX,taddgroup); - return newgrpIDX; - } - - - private void addDifference(uint id,string val,string desc,short type,uint offset) - { - DiffRO tmpDiff = new DiffRO(); - tmpDiff.id=id; - tmpDiff.type=type; - tmpDiff.desc=desc; - tmpDiff.val=val; - tmpDiff.oldoff=offset; - allDifferences[curTblIdx].Add(tmpDiff); - } - - - private short ReadShort(BinaryReader br) - { - short rtnval = -1; - try - { - rtnval = br.ReadInt16(); - } - catch (Exception) - { - rtnval = -1; - } - return rtnval; - } - -/* - * Read in the ROFST Update file. Put the changes in array lists - * to that will be used to organize and merge the differences into - * the target RO.FST file (usually in the Approved directory). For - * array lists, use the number of databases from the working draft - * (there may be new databases created since last approval) - */ - public void processAppUpdFile(string sAppUpdFile, short nDB) - { - BinaryReader brAppUpd; - string num, desc, val; - short typ, inch; - uint rec; - ushort tbl; - uint parid; - int LastAddedROIDX=-1, LastAddedGrpIDX=-1; - curTblIdx = 0; // initialize Current Table Index - allNewRos = (ArrayList [])new ArrayList[nDB]; - allNewGrps = (ArrayList [])new ArrayList[nDB]; - allDifferences = (ArrayList [])new ArrayList[nDB]; - allLocations = new ArrayList(); - - for (int i=0; i wid) - { - doff=(ushort)(wid-siznum-l); - } - while(wid > 0 && siznum < doff) - { // add spaces if necessary for alignment - buff.Append(' '); - siznum++; - wid--; - } - } - idx = 0; - while(wid > 0) - { // output the value or spaces to the specified width - if (idx < str.Length && str[idx] != 0 && str[idx] != '\n') - buff.Append(str[idx]); - else - buff.Append(" "); - wid--; - idx++; - } - } - - - private string getMenuString(short type,string val,string desc) - { - StringBuilder buff = new StringBuilder(); - switch(type) - { - case 1: - placeText(buff,5,17,val); - buff.Append(" "); - break; - case 2: - placeText(buff,5,17,"(Table)"); - buff.Append(" "); - break; - case 4: - placeText(buff,5,17,"(Graph)"); - buff.Append(" "); - break; - } - buff.Append(desc); - return buff.ToString(); - } - - - public void WriteString(BinaryWriter NewFSTFile, string str,bool AddNull) - { - int n=str.Length; - if (AddNull) - n++; - byte [] b = new byte[n]; - for(int i =0; i < str.Length; i++) - { - b[i] = (byte)str[i]; - } - NewFSTFile.Write(b,0,n); - } - - - public uint saveNewMenuEntries(BinaryWriter NewFSTFile,uint id) - { - long start=NewFSTFile.Seek(0,System.IO.SeekOrigin.Current); - int numNewRos = (allNewRos[curTblIdx]).Count; - int cntNewRos = 0; - while (cntNewRos < numNewRos) - { - // Skip to the one to be saved - while ((cntNewRos < numNewRos) && - (((AddRO)(allNewRos[curTblIdx])[cntNewRos]).ro_stat != 1) && - ((AddRO)(allNewRos[curTblIdx])[cntNewRos]).ro_parid != id) - cntNewRos++; - // If one exists, save it and skip to the next one - if (cntNewRos < numNewRos) - { - AddRO taddro = (AddRO)(allNewRos[curTblIdx][cntNewRos]); - taddro.ro_stat = 2; - allNewRos[curTblIdx].RemoveAt(cntNewRos); - allNewRos[curTblIdx].Insert(cntNewRos,taddro); - // Save the offset - NewFSTFile.Write(((AddRO)(allNewRos[curTblIdx])[cntNewRos]).ro_offset); - // Save the type - NewFSTFile.Write(((AddRO)(allNewRos[curTblIdx])[cntNewRos]).ro_type); - // Get the menu string - string mnustr = getMenuString(((AddRO)(allNewRos[curTblIdx])[cntNewRos]).ro_type,((AddRO)(allNewRos[curTblIdx])[cntNewRos]).ro_val,((AddRO)(allNewRos[curTblIdx])[cntNewRos]).ro_desc); - // Save menu entry - WriteString(NewFSTFile,mnustr,true); - cntNewRos++; - } - } - int cntNewGrps = 0; - int numNewGrps = (allNewGrps[curTblIdx]).Count; - while (cntNewGrps < numNewGrps) - { - // Skip to the one to be saved - while ((cntNewGrps < numNewGrps) && - (((AddGroup)(allNewGrps[curTblIdx])[cntNewGrps]).grp_stat != 1 || - ((AddGroup)(allNewGrps[curTblIdx])[cntNewGrps]).grp_parid != id)) - cntNewGrps++; - // If one exists, save it and skip to the next one - if(cntNewGrps < numNewGrps) - { - // Change stat to menu entry saved - AddGroup taddgroup = (AddGroup)(allNewGrps[curTblIdx][cntNewGrps]); - taddgroup.grp_stat = 2; - allNewGrps[curTblIdx].RemoveAt(cntNewGrps); - allNewGrps[curTblIdx].Insert(cntNewGrps,taddgroup); - // Save the offset - NewFSTFile.Write(((AddGroup)(allNewGrps[curTblIdx])[cntNewGrps]).grp_offset); - // Save the type - NewFSTFile.Write(((AddGroup)(allNewGrps[curTblIdx])[cntNewGrps]).grp_type); - // Save menu entry - WriteString(NewFSTFile,((AddGroup)(allNewGrps[curTblIdx])[cntNewGrps]).grp_name,true); - cntNewGrps++; - } - } - return ((uint)((NewFSTFile.Seek(0,System.IO.SeekOrigin.Current)) - start)); - } - - - - public void AddLocation(uint location,int inc) - { - int t_inc = ((locinc)allLocations[lastLocationIdx]).inc; - if (location == ((locinc)allLocations[lastLocationIdx]).maxloc) - { - // update the current record - // - need to remove current item, then insert new item. - locinc tmploc = (locinc)(allLocations[lastLocationIdx]); - tmploc.inc += inc; - allLocations.RemoveAt(lastLocationIdx); - allLocations.Insert(lastLocationIdx,tmploc); - } - else - { - locinc tmploc = (locinc)(allLocations[lastLocationIdx]); - locinc newloc = new locinc(); - // new item gets last item's maxloc - newloc.maxloc = tmploc.maxloc; - newloc.inc = tmploc.inc + inc; - // update the current record - // - need to remove current item, then insert new item. - tmploc.maxloc = location; //update maxloc - allLocations.RemoveAt(lastLocationIdx); - allLocations.Insert(lastLocationIdx,tmploc); - // append the new item - allLocations.Add(newloc); - lastLocationIdx++; - } - } - - - public short saveAdditions(BinaryWriter NewFSTFile,uint parid,uint start) - { - // Initialize count of added entries - short count = 0; - // Initialize count of added bytes - int bytes = 0; - - int numgroups = (allNewGrps[curTblIdx]).Count; - int grpcnt = 0; - while (grpcnt < numgroups) - { - if (((AddGroup)(allNewGrps[curTblIdx])[grpcnt]).grp_stat == 0 && ((AddGroup)(allNewGrps[curTblIdx])[grpcnt]).grp_parid == parid) - { - // Save new group - // Change stat to inprogress - AddGroup taddgroup = (AddGroup)(allNewGrps[curTblIdx][grpcnt]); - taddgroup.grp_stat = 99; - allNewGrps[curTblIdx].RemoveAt(grpcnt); - allNewGrps[curTblIdx].Insert(grpcnt,taddgroup); - count++; - // Save any children - short howmany = saveAdditions(NewFSTFile,((AddGroup)(allNewGrps[curTblIdx])[grpcnt]).grp_id,start); - - // Remember the offset - taddgroup = (AddGroup)(allNewGrps[curTblIdx][grpcnt]); - taddgroup.grp_offset = (uint)NewFSTFile.Seek(0,System.IO.SeekOrigin.Current); // ftell(ofile) - allNewGrps[curTblIdx].RemoveAt(grpcnt); - allNewGrps[curTblIdx].Insert(grpcnt,taddgroup); - - // Save ID - if (((AddGroup)(allNewGrps[curTblIdx])[grpcnt]).grp_parid == 0) - { - whereisgl = (uint)NewFSTFile.Seek(0,System.IO.SeekOrigin.Current); - } - NewFSTFile.Write(((AddGroup)(allNewGrps[curTblIdx])[grpcnt]).grp_id); - // Save the Parent ID - NewFSTFile.Write(((AddGroup)(allNewGrps[curTblIdx])[grpcnt]).grp_parid); - // save howmany - NewFSTFile.Write(howmany); - // save children - saveNewMenuEntries(NewFSTFile,((AddGroup)(allNewGrps[curTblIdx])[grpcnt]).grp_id); - taddgroup = (AddGroup)(allNewGrps[curTblIdx][grpcnt]); - taddgroup.grp_stat = 1; - allNewGrps[curTblIdx].RemoveAt(grpcnt); - allNewGrps[curTblIdx].Insert(grpcnt,taddgroup); - bytes += (int)(NewFSTFile.Seek(0,System.IO.SeekOrigin.Current) - ((AddGroup)(allNewGrps[curTblIdx])[grpcnt]).grp_offset); - } - grpcnt++; - } - // Second check new ROs - int rocnt = 0; - int numros = (allNewRos[curTblIdx]).Count; - while (rocnt < numros) - { - // save new RO - if (((AddRO)(allNewRos[curTblIdx])[rocnt]).ro_stat == 0 && - ((AddRO)(allNewRos[curTblIdx])[rocnt]).ro_parid == parid) - { - // change the stat - AddRO taddro = (AddRO)(allNewRos[curTblIdx][rocnt]); - taddro.ro_stat = 1; - // Increment count - count++; - taddro.ro_offset = (int)NewFSTFile.Seek(0,System.IO.SeekOrigin.Current); - allNewRos[curTblIdx].RemoveAt(rocnt); - allNewRos[curTblIdx].Insert(rocnt,taddro); - // Save the ID - NewFSTFile.Write(((AddRO)(allNewRos[curTblIdx])[rocnt]).ro_id); - // Save the Parent ID - NewFSTFile.Write(((AddRO)(allNewRos[curTblIdx])[rocnt]).ro_parid); - // Save -1 - NewFSTFile.Write((short)-1); - // Save type - NewFSTFile.Write(((AddRO)(allNewRos[curTblIdx])[rocnt]).ro_type); - maxtype |= (ushort)((AddRO)(allNewRos[curTblIdx])[rocnt]).ro_type; - // Save value - WriteString(NewFSTFile,((AddRO)(allNewRos[curTblIdx])[rocnt]).ro_val,true); - // Save accid - short aw = (short)((AddRO)(allNewRos[curTblIdx])[rocnt]).ro_num.Length; - if (aw > maxaw) maxaw = (ushort)aw; - WriteString(NewFSTFile,((AddRO)(allNewRos[curTblIdx])[rocnt]).ro_num,true); - // Calculate the number of extra bytes output - bytes+=(int)(NewFSTFile.Seek(0,System.IO.SeekOrigin.Current) - ((AddRO)(allNewRos[curTblIdx])[rocnt]).ro_offset); - } - rocnt++; - } - // Adjust the location information - if (bytes != 0 && start > 0) - AddLocation(start - 1,bytes); - return count; - } - - - // was a difference flagged for this RO - // - check via saved offsets into the RO.fST file - public int isDifferent(uint off) - { - int allDiffCnt = 0; - int NumAllDiff = (allDifferences[curTblIdx]).Count; - while (allDiffCnt < NumAllDiff) - { - if (((DiffRO)(allDifferences[curTblIdx])[allDiffCnt]).oldoff == off) - return allDiffCnt; - allDiffCnt++; - } - return -1; - } - - - - public uint newLocation(uint oldlocation) - { - int idx = 0; - while (oldlocation > ((locinc)allLocations[idx]).maxloc) idx++; - return oldlocation + (uint)((locinc)allLocations[idx]).inc; - } - - - public void processGroupRecords(BinaryWriter NewFSTFile,uint end) - { - uint start; - while ((start=(uint)brROFst.BaseStream.Seek(0,System.IO.SeekOrigin.Current)) < end) - { - // Read ID - uint id = brROFst.ReadUInt32(); - // Read Parent ID - uint parid = brROFst.ReadUInt32(); - // Read How Many - short howmany = brROFst.ReadInt16(); - // Check of additions and write them - short howmanyplus = howmany; - if (howmany >= 0) - howmanyplus += saveAdditions(NewFSTFile,id,start); - if (parid == 0) - whereisgl = (uint)NewFSTFile.Seek(0,System.IO.SeekOrigin.Current); // ftell(ofile) - // Write ID - NewFSTFile.Write(id); - // Write Parent ID - NewFSTFile.Write(parid); - // Write howmany - NewFSTFile.Write(howmanyplus); - // If group - read and write menu list - int starti = (int)brROFst.BaseStream.Seek(0,System.IO.SeekOrigin.Current); // ftell(rofstfile) - int starto = (int)NewFSTFile.Seek(0,System.IO.SeekOrigin.Current); // ftell(ofile) - if (howmanyplus >= 0) - { - // for orignal entries - for (int i=0;i howmany) - { - saveNewMenuEntries(NewFSTFile,id); - } - } - else - { - // if RO - read RO record - // Read type - short type = brROFst.ReadInt16(); - // Read value - string val = GetAsciiString(brROFst); - // Read accid - string num = GetAsciiString(brROFst); - // check if changed - int thisdiff = isDifferent(start); - if (thisdiff != -1) - { - type = ((DiffRO)(allDifferences[curTblIdx])[thisdiff]).type; - val = ((DiffRO)(allDifferences[curTblIdx])[thisdiff]).val; - } - // Save type - NewFSTFile.Write(type); - // Save value - WriteString(NewFSTFile,val,true); - // Save accid - WriteString(NewFSTFile,num,true); - } - int originalSize = (int)brROFst.BaseStream.Seek(0,System.IO.SeekOrigin.Current) - starti; - int copySize = (int)NewFSTFile.Seek(0,System.IO.SeekOrigin.Current) - starto; - if (copySize != originalSize) - AddLocation(start,copySize - originalSize); - } - if (end == 0) - { - maxtype = 0; - maxaw = 0; - saveAdditions(NewFSTFile,0,0); - } - } - - - public int getROAccLess(string minnum) - { - int romin = -1; - int roptr = 0; - int numroptr = (allNewRos[curTblIdx]).Count; - while (roptr < numroptr) - { - // skip processed entries - while ((roptr < numroptr) && - ((AddRO)(allNewRos[curTblIdx])[roptr]).ro_stat == 4) roptr++; - if ((roptr < numroptr)) - { - // Look for "smallest" - if ((minnum==null)|| - ((AddRO)(allNewRos[curTblIdx])[roptr]).ro_num.CompareTo(minnum) < 0) - { - romin = roptr; - minnum = ((AddRO)(allNewRos[curTblIdx])[roptr]).ro_num; - } - roptr++; - } - } - return romin; - } - - - public void putFixed(BinaryWriter NewFstFile, string str, short len) - { - int n=len; //str.Length; - int strlen = str.Length; - byte [] b = new byte[len]; - // write a fixed length of a string. - for (int i =0; n > 0; i++) - { - if (i < strlen) - b[i] = (byte)str[i]; - else - b[i] = (byte)0; // pad with NULLs if smaller than "len" - n--; - } - NewFstFile.Write(b,0,len); - } - - - public void processAccIdRecords(BinaryWriter NewFSTFile,uint end,short len) - { - int extra = 0; - int roptr = 0; - while (brROFst.BaseStream.Seek(0,System.IO.SeekOrigin.Current) < end) - { - // Read ID - uint id = brROFst.ReadUInt32(); - // Read accID - string num = GetAsciiString(brROFst,len); - // Check other accIDs in new records and save - while ((roptr = getROAccLess(num)) != -1) - { - extra+=(len + 4); //sizeof(ulong 16bit)+len - NewFSTFile.Write(((AddRO)(allNewRos[curTblIdx])[roptr]).ro_id); - putFixed(NewFSTFile,((AddRO)(allNewRos[curTblIdx])[roptr]).ro_num,len); - AddRO taddro = (AddRO)(allNewRos[curTblIdx][roptr]); - taddro.ro_stat = 4; - allNewRos[curTblIdx].RemoveAt(roptr); - allNewRos[curTblIdx].Insert(roptr,taddro); - } - // Write ID - NewFSTFile.Write(id); - // Write accID - putFixed(NewFSTFile,num,len); - } - // Save remaining RO info - while ((roptr = getROAccLess(null))!=-1) - { - extra += (len+4); //sizeof(ulong 16bit)+len - NewFSTFile.Write(((AddRO)(allNewRos[curTblIdx])[roptr]).ro_id); - putFixed(NewFSTFile,((AddRO)(allNewRos[curTblIdx])[roptr]).ro_num,len); - AddRO taddro = (AddRO)(allNewRos[curTblIdx][roptr]); - taddro.ro_stat = 4; - allNewRos[curTblIdx].RemoveAt(roptr); - allNewRos[curTblIdx].Insert(roptr,taddro); - } - if (extra > 0) - AddLocation(end-1,extra); - } - - - public void nextIDandOffset(ref uint nxtid, ref uint nxtoff) - { - int roptr = 0, romin = -1; - int numroptr = (allNewRos[curTblIdx]).Count; - int grpptr = 0, grpmin = -1; - int numgrpptr = (allNewGrps[curTblIdx]).Count; - - while (roptr < numroptr) - { - if (((AddRO)(allNewRos[curTblIdx])[roptr]).ro_id > nxtid && - (romin == -1 || ((AddRO)(allNewRos[curTblIdx])[roptr]).ro_id < ((AddRO)(allNewRos[curTblIdx])[romin]).ro_id)) - romin = roptr; - roptr++; - } - - while (grpptr < numgrpptr) - { - if (((AddGroup)(allNewGrps[curTblIdx])[grpptr]).grp_id > nxtid && - (grpmin == -1 || ((AddGroup)(allNewGrps[curTblIdx])[grpptr]).grp_id < ((AddGroup)(allNewGrps[curTblIdx])[grpmin]).grp_id)) - grpmin = grpptr; - grpptr++; - } - if (grpmin != -1) - { - if ((romin != -1) && ((AddRO)(allNewRos[curTblIdx])[romin]).ro_id < ((AddGroup)(allNewGrps[curTblIdx])[grpmin]).grp_id) - { - AddRO taddro = (AddRO)(allNewRos[curTblIdx][romin]); - taddro.ro_stat = 3; - allNewRos[curTblIdx].RemoveAt(romin); - allNewRos[curTblIdx].Insert(romin,taddro); - nxtid = ((AddRO)(allNewRos[curTblIdx])[romin]).ro_id; - nxtoff = (uint)((AddRO)(allNewRos[curTblIdx])[romin]).ro_offset; - } - else - { - AddGroup taddgroup = (AddGroup)(allNewGrps[curTblIdx][grpmin]); - taddgroup.grp_stat = 3; - allNewGrps[curTblIdx].RemoveAt(grpmin); - allNewGrps[curTblIdx].Insert(grpmin,taddgroup); - nxtid = ((AddGroup)(allNewGrps[curTblIdx])[grpmin]).grp_id; - nxtoff = ((AddGroup)(allNewGrps[curTblIdx])[grpmin]).grp_offset; - } - } - else - { - if (romin != -1) - { - AddRO taddro = (AddRO)(allNewRos[curTblIdx][romin]); - taddro.ro_stat = 3; - allNewRos[curTblIdx].RemoveAt(romin); - allNewRos[curTblIdx].Insert(romin,taddro); - nxtid = ((AddRO)(allNewRos[curTblIdx])[romin]).ro_id; - nxtoff = (uint)((AddRO)(allNewRos[curTblIdx])[romin]).ro_offset; - } - else - { - nxtid = 0; - nxtoff = 0; - } - } - } - - - public void processIdRecords(BinaryWriter NewFstFile,uint end) - { - int extra = 0; - uint nxtid =0, nxtoff=0; - nextIDandOffset(ref nxtid,ref nxtoff); - while (brROFst.BaseStream.Seek(0,System.IO.SeekOrigin.Current) < end) - { - // Read ID - uint id = brROFst.ReadUInt32(); - // Look for new entries that precede ID - while (nxtid != 0 && nxtid < id) - { - extra += 8; // sizeof(ulong 16bit) * 2 - NewFstFile.Write(nxtid); - NewFstFile.Write(nxtoff); - nextIDandOffset(ref nxtid,ref nxtoff); // passed by reference - } - // Write ID - NewFstFile.Write(id); - // Read Offset - uint off = brROFst.ReadUInt32(); - // Write new offset - NewFstFile.Write(newLocation(off)); - } - // Save new RO entries and Group entries - while (nxtid != 0) - { - extra += 8; // sizeof(ulong 16bit)*2 - NewFstFile.Write(nxtid); - NewFstFile.Write(nxtoff); - nextIDandOffset(ref nxtid,ref nxtoff); // passed by reference - } - if (extra != 0) - AddLocation(end-1,extra); - } - - - /* - * Merge the changes into the RO.FST file (usually Approved directory) - */ - public void CreateMergedFSTFile(string NewFStName) - { - BinaryWriter NewFSTFile=null; - - // Open a new FST file for writing - try - { - NewFSTFile = new BinaryWriter(File.Open(NewFStName,System.IO.FileMode.Create,System.IO.FileAccess.ReadWrite,FileShare.None)); - } - catch (Exception e) - { - MessageBox.Show("Error Opening "+NewFStName +"\n\n" + e.Message,"Approval Error"); - } - - // Write the RO.FST header - Header.Write(NewFSTFile); - - // Position the old FST file past the header - brROFst.BaseStream.Seek(Header.GetStructSize(),System.IO.SeekOrigin.Begin); - - // Loop through each database - for (short i=0; i < numDatabases; i++) - { - // Set the current table index used to access the allNewRos, - // allNewGrps, and allDifferences arrays - curTblIdx = i; - - // Loop through the Group and RO records - // Update the RO Group information - processGroupRecords(NewFSTFile,((ROFST_DbInfo)DatabasesInfo[i]).dbiIL); - if (((ROFST_DbInfo)DatabasesInfo[i]).dbiAW == 0) - ((ROFST_DbInfo)DatabasesInfo[i]).dbiAW = maxaw; - - if (((ROFST_DbInfo)DatabasesInfo[i]).dbiType == 0) - ((ROFST_DbInfo)DatabasesInfo[i]).dbiType = maxtype; - - ((ROFST_DbInfo)DatabasesInfo[i]).dbiGL = whereisgl; - ((ROFST_DbInfo)DatabasesInfo[i]).dbiIL = (uint)NewFSTFile.Seek(0,System.IO.SeekOrigin.Current); - - // Loop through the ID list - processIdRecords(NewFSTFile,((ROFST_DbInfo)DatabasesInfo[i]).dbiAL); - ((ROFST_DbInfo)DatabasesInfo[i]).dbiAL = (uint)NewFSTFile.Seek(0,System.IO.SeekOrigin.Current); - // Loop through the accid list - processAccIdRecords(NewFSTFile,((ROFST_DbInfo)DatabasesInfo[i]).dbiEND,(short)((ROFST_DbInfo)DatabasesInfo[i]).dbiAW); - ((ROFST_DbInfo)DatabasesInfo[i]).dbiEND = (uint)NewFSTFile.Seek(0,System.IO.SeekOrigin.Current); - } - // Save the Database info - uint lngbuf = 0; - // Save the current location in the new fst file - uint dblength = (uint)NewFSTFile.Seek(0,System.IO.SeekOrigin.Current); - NewFSTFile.Write(lngbuf); - NewFSTFile.Write(numDatabases); - uint lngval; - ROFST_DbInfo tmpdbinfo = new ROFST_DbInfo(); - lngval = (uint)(tmpdbinfo.GetStructSize() * numDatabases); - for (int i=0;i 0 && match == null) - { - int end = ROProcessTools.matchingBrace(opt); - int eq = opt.IndexOf('='); - int len = end + 1; // +1 to include the '}' - int li = eq-1; - int ld = len-li-3; // One for '{', '=' and '}' - if (def == null || eq == 1) - { - def = opt.Substring(eq+1,ld); - deflen = ld; - } - if (ls == li && stat.StartsWith(opt.Substring(1,li))) - { - match = opt.Substring(eq+1,ld); - matchlen = ld; - } - opt = opt.Substring(len); - lo -= len; - } - // if match process option - or process default - if (match == null) - { - match = def; - matchlen = deflen; - } - Process(match,matchlen); - } - - public void processBrace(string str, int l, ref int nfnd) - { - int nxt = ROProcessTools.nextDelimiter("{=",str,l); // -1 means not found - if(nxt == -1) // varUse - { - strList found = null; - found = vList.lookFor(str,l); - if (found != null) - Add(new seVarUse(found)); - else - nfnd = 1; - } - else - { - if (str[nxt] == '{') // conditonal or menu - { - if(nxt==0) - { // menu - mList.Process(str,l,vList); - Add(new seMenuUse(mList)); - } - else - { // conditional - processCondition(str, str.Substring(nxt), nxt, l -nxt); - } - } - else - { // must be variable definiton - vList.Add(str, str.Substring(nxt+1), nxt, l - nxt - 1, mList); - } - } - } - - public void Process (string str, int len) - { - int nxtDlm = -1; // -1 = not found - while (len > 0) - { - nxtDlm = ROProcessTools.nextDelimiter("{",str,len); - if (nxtDlm == -1) - { - // add entire string as is - Add(new seText(str,len)); - //str = str.Substring(len); don't think we need to do this - len = 0; - } - else - { - int cnt = 0; - if (nxtDlm > 0) - { - // add preceeding text - Add(new seText(str,nxtDlm)); - str = str.Substring(nxtDlm); - len-=nxtDlm; - } - // add text group by delimiter, including - // the delimiters - nxtDlm = ROProcessTools.matchingBrace(str)+1; - cnt = nxtDlm; - int nfnd = 0; - processBrace(str.Substring(1),cnt-2,ref nfnd); - if (nfnd > 0) - { - Add(new seText(str,cnt)); - } - // position to next delimiter grouping - len -= cnt; - str = str.Substring(nxtDlm); - } - } - } - - public string toText(int mi) - { - StringBuilder bldstr = new StringBuilder(); - for (int i=0; i < aryStrEntry.Count; i++) - { - bldstr.Append(((strEntry)aryStrEntry[i]).toText(mi)); - } - return bldstr.ToString(); - } - - public int getLength(int mi) - { - int rtnval = 0; - for (int i=0; i < aryStrEntry.Count; i++) - { - rtnval += (((strEntry)aryStrEntry[i]).getLength(mi)); - } - return rtnval; - } - - public int menuCount() - { - return mList.getCount(); - } - - public string getIds(ref int cnt) - { - // return a string of the IDs - return mList.getIds(ref cnt); - } - } - - - - public class strList2 - { - - private ArrayList aryStrEntry; - - public strList2(string str) - { - int l=str.Length; - if (aryStrEntry == null) - aryStrEntry = new ArrayList(); - while(l > 0) - { - int ptr=ROProcessTools.nextDelimiter("<",str,l); - int cptr = (ptr==-1)?-1:ROProcessTools.nextDelimiter(">",str.Substring(ptr,str.Length - ptr),str.Length-ptr); - if(ptr == -1 || (ptr>-1 && cptr == -1)) - { - Add(new seText(str,l)); - l=0; - } - else - { - int cnt = ptr; //(int)(ptr-str); - if(cnt > 0) - { - Add(new seText(str,cnt)); - l-=cnt; - str = str.Substring(ptr); // str=ptr - } - ptr=ROProcessTools.nextDelimiter(">",str,l)+1; - cnt = ptr;//(int)(ptr-str); - string tmpstr = str.Substring(1); - Add(new seUser(tmpstr,cnt-2)); - l-=cnt; - str = str.Substring(ptr);//str=ptr; - } - } - } - - public void Add (strEntry se) - { - aryStrEntry.Add(se); - } - - public string toText() - { - StringBuilder bldstr = new StringBuilder(); - for (int i=0; i < aryStrEntry.Count; i++) - { - bldstr.Append(((strEntry)aryStrEntry[i]).toText(0)); - } - return bldstr.ToString(); - } - } - - public class varEntry - { - string Name; - int Len; - strList Definition; - - public varEntry(string InName, string InDef, int lenInName, int lenInDef, varList vlist, menuList mlist) - { - Definition = new strList(InDef,lenInDef,vlist,mlist); - Name = InName.Substring(0,lenInName); - Len = lenInName; - } - - public strList lookFor(string nam, int l) - { - string tname = nam.Substring(0,l); - if (l == Len && (Name.CompareTo(tname)==0)) - return Definition; // found - return null; // not found - } - } - - public class varList - { - ArrayList varEntryAry; - - public varList() - { - varEntryAry = new ArrayList(); - } - - public void Add(string InName, string InDef, int lenInName, int lenInDef, menuList mlist) - { - varEntry tmpEntry = new varEntry(InName,InDef,lenInName,lenInDef,null,mlist); - varEntryAry.Add(tmpEntry); - } - - public strList lookFor(string str, int len) - { - strList rtnval = null; - for (int i = 0; (rtnval == null) && (i < varEntryAry.Count); i++) - { - rtnval = ((varEntry)varEntryAry[i]).lookFor(str,len); - } - return rtnval; - } - } - - public class seVarUse : strEntry - { - strList Def; - - public seVarUse(strList d) - { - Def = d; - } - - - public override string toText(int mi) - { - return Def.toText(mi); - } - - public override int getLength(int mi) - { - return Def.getLength(mi); - } - } - - public class menuEntry - { - byte id; - strList definition; - - public menuEntry(string idptr,string def,int li,int ld,varList vlst) - { - definition = new strList(def, ld, vlst,null); - // save the id - if(li != 0) - id=(byte)idptr[0]; - else - id=0; - } - - public int getLength(int mi) - { - if(mi==(int)id || mi==-1) - return definition.getLength(mi); - else - return 0; - } - - public virtual string toText(int mi) - { - if (mi == id || mi==-1) - return definition.toText(mi); - else - return ""; - } - - public string getID() - { - string rtnstr = id.ToString(); - return rtnstr; - } - - public int getCount() - { - return 1; - } - } - - - public class menuList : strEntry - { - ArrayList aryMenuList; - - public menuList() - { - aryMenuList = new ArrayList(); - } - - public void Add(menuEntry MnuEntry) - { - aryMenuList.Add(MnuEntry); - } - - private int _getLength(int mi) - { - int lcnt = aryMenuList.Count; - int rtnval =0; - - for (int i=0; i < lcnt; i++) - { - rtnval += (((menuEntry)aryMenuList[i])).getLength(mi); - } - return rtnval; - } - - private int _getLenAndLookat(int mi, ref int lookat) - { - int len =0; - lookat = mi; - - if (aryMenuList.Count > 0) - { - len=_getLength(lookat); - if (len ==0) - { - lookat = 0; - len = _getLength(lookat); - } - if (len == 0) - { - lookat = -1; - len = _getLength(lookat); - } - } - - return len; - } - - public override int getLength(int mi) - { - int lookat=0; - return _getLenAndLookat(mi,ref lookat); - } - - public override string toText(int mi) - { - StringBuilder rtnstr = new StringBuilder(); - int lookat=0; - - int len = _getLenAndLookat(mi,ref lookat); - if (aryMenuList.Count > 0) - { - for (int i = 0; i< aryMenuList.Count; i++) - { - string roval = ((menuEntry)aryMenuList[i]).toText(lookat); - if (lookat == -1) - { - // For Approve Individual, show all possible RO - // values (for conditional RO's) - // We may need to add a flag here later on when - // this logic is used in the Procedure Editor. - if (i > 0 && !roval.Equals("")) - rtnstr.Append("\n"); - } - rtnstr.Append(roval); - } - } - return rtnstr.ToString(); - } - - public string getIds(ref int cnt) - { - StringBuilder rtnstr = new StringBuilder(); - cnt = getCount(); - int arycnt = aryMenuList.Count; - - for (int i=0; i 0); - } - } - - public class seMenuUse : strEntry - { - menuList ml; - - public seMenuUse(menuList m) - { - ml=m; - } - - public override string toText(int mi) - { - return ml.toText(mi); - } - - public override int getLength(int mi) - { - return ml.getLength(mi); - } - } - -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ROFST/ROFST.csproj b/PROMS/ReferencedObjectsOld/LibSource/ROFST/ROFST.csproj deleted file mode 100644 index 3edab4c1..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ROFST/ROFST.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {134D8938-9CDC-4712-9444-D5DCC6638AB6} - Debug - AnyCPU - - - - - ROFST - - - JScript - Grid - IE50 - false - Library - ROFST - OnBuildSuccess - - - - - - - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE;Upgrade2005; - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - - - - System - - - System.Data - - - System.Windows.Forms - - - System.XML - - - - - Code - - - Code - - - - - {680054D3-49C4-40E7-92A5-67B97DCE6308} - Utils - - - {551CB7B3-00B1-11D7-8590-482B59000000} - VlnStatus - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ROFST/ROFST.sln b/PROMS/ReferencedObjectsOld/LibSource/ROFST/ROFST.sln deleted file mode 100644 index b88433f4..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ROFST/ROFST.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ROFST", "ROFST.csproj", "{134D8938-9CDC-4712-9444-D5DCC6638AB6}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {134D8938-9CDC-4712-9444-D5DCC6638AB6}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/ROField/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/ROField/AssemblyInfo.cs deleted file mode 100644 index 7e3b35a5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ROField/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/ROField/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/ROField/AssemblyInfo.cs.bak deleted file mode 100644 index 6b2b0662..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ROField/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/ROField/ROField.cs b/PROMS/ReferencedObjectsOld/LibSource/ROField/ROField.cs deleted file mode 100644 index 7d577c9b..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ROField/ROField.cs +++ /dev/null @@ -1,301 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ROField.cs $ $Revision: 11 $ - * $Author: Kathy $ $Date: 4/04/03 9:41a $ - * - * $History: ROField.cs $ - * - * ***************** Version 11 ***************** - * User: Kathy Date: 4/04/03 Time: 9:41a - * Updated in $/LibSource/ROFields - * B2003-030: get correct field type for new image - * - * ***************** Version 10 ***************** - * User: Kathy Date: 12/10/02 Time: 2:27p - * Updated in $/LibSource/ROFields - * fieldname special chars - * - * ***************** Version 9 ***************** - * User: Kathy Date: 12/02/02 Time: 8:30a - * Updated in $/LibSource/ROFields - * fieldname replace chars - * - * ***************** Version 8 ***************** - * User: Kathy Date: 11/11/02 Time: 7:14a - * Updated in $/LibSource/ROFields - * image field type should be 32 not 20 - * - * ***************** Version 7 ***************** - * User: Kathy Date: 10/15/02 Time: 2:17p - * Updated in $/LibSource/ROFields - * combo field number - * - * ***************** Version 6 ***************** - * User: Kathy Date: 9/27/02 Time: 1:11p - * Updated in $/LibSource/ROFields - * fix digit as first char in fieldname - * - * ***************** Version 5 ***************** - * User: Kathy Date: 9/25/02 Time: 2:31p - * Updated in $/LibSource/ROFields - * multitxt->variable - * - * ***************** Version 4 ***************** - * User: Kathy Date: 9/03/02 Time: 2:53p - * Updated in $/LibSource/ROFields - * missing " on image field def. - * - * ***************** Version 3 ***************** - * User: Kathy Date: 8/30/02 Time: 11:56a - * Updated in $/LibSource/ROFields - * image - * - * ***************** Version 2 ***************** - * User: Kathy Date: 8/28/02 Time: 10:59a - * Updated in $/LibSource/ROFields - * development - *********************************************************************************************/ - -using System; -using System.Text; - -namespace ROFields -{ - public enum FieldTypes: uint - { - Nil=0, SingleTxt=1, VariableTxt=2, FrmtSingleTxt=4, XYPlot=8, Table=10, Image=32, - MultiTxt=40, Combination=128, MultiFld=100 - } - - /// - /// Summary description for ROField: This class contains RO Field information. Each ROField - /// contains: - /// string fieldname - the name of the field - /// string recid - its database record id (used to interface to the database - null if - /// not created yet. - /// string masterrecID - its record id in the master if appropriate. - /// uint fieldtype - the field type as defined in the enum FieldTypes (listed above) - /// - public class ROField - { - string fieldname; - string recID; - string masterrecID; - uint fldtype; - - // constuctor - public ROField(string fname, string rID, string mrID, uint fieldtype) - { - fieldname = fname; - recID = rID; - masterrecID = mrID; - fldtype = fieldtype; - } - public string GetFieldname { get {return fieldname;}} - public string GetRecID { get {return recID;}} - public string GetMasterRecID { get {return masterrecID;}} - public uint GetFieldType{ get {return fldtype;}} - public void SetFieldname(string name) {fieldname = name;} - public void SetRecID(string recid) {recID = recid;} - public void SetMasterRecID(string mrecid) {masterrecID = mrecid;} - public void SetFieldType(uint ftype) {fldtype = ftype;} - - // Given a schema string, determine which RO Field type it is. - public uint ParseFieldType(string info) - { - int indx; - // formatted single line text has 'pattern' in schema definition) - indx = info.IndexOf("xsd:pattern"); - if (indx >= 0) return (uint) FieldTypes.FrmtSingleTxt; - - // Combination field has 'choice' in schema definition - indx = info.IndexOf("xsd:choice"); - if (indx >= 0) return (uint) FieldTypes.Combination; - - // image - search for 'Image_Height', in case Image is in the string from some other mechanism - indx = info.IndexOf("Image_Height"); - if (indx >=0) return (uint) FieldTypes.Image; - - // single line text has 'normalizedString' (pattern does too, but - // it would be eliminated above. - indx = info.IndexOf("xsd:normalizedString"); - if (indx >=0) return (uint) FieldTypes.SingleTxt; - - // now look for all of the multi-line fields: multi text, table, & XY Plot - indx = info.IndexOf("xsd:string"); - if (indx <0) indx = info.IndexOf("xsd:String"); - if (indx >=0) - { - int indxspecific; - indxspecific = info.IndexOf("Variable"); - if (indxspecific >= 0) return (uint) FieldTypes.VariableTxt; - indxspecific = info.IndexOf("Table"); - if (indxspecific >= 0) return (uint) FieldTypes.Table; - indxspecific = info.IndexOf("XYPlot"); - if (indxspecific >= 0) return (uint) FieldTypes.XYPlot; - } - - // indx = info.IndexOf("Image"); - // if (indx >=0) return (uint) FieldTypes.Image; - - return 1000; - } - - // Creates a string representing the schema for this field. note that the input - // fieldname will override that which is stored for this ROField (for editting - // purposes). - public string MakeFieldName(string fldname) - { - if (fldname.Length < 2) - return fldname; - // a digit cannot start an xml fieldname, prepend a "__" to it. - string tmp0; - if (char.IsDigit(fldname,0)) - tmp0 = "__" + fldname; - else - tmp0 = fldname; - // an xml fieldname cannot have a space, change it to a "__" - string tmpstr = tmp0.Replace(" ","__"); - int len = tmpstr.Length; - int cnt = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval; - - while (cnt < len) - { - char tmpchr = tmpstr[cnt]; - if(!char.IsLetterOrDigit(tmpchr)&& (OKpunch.IndexOf(tmpchr) == -1) ) - { - decval = tmpchr; - outstr += OKpunch + decval.ToString("D3"); - } - else - { - outstr += tmpchr.ToString(); - } - cnt++; - } - return outstr; - } - - public string MakeSchemaString(string fieldname, string width, string pattern) - { - uint ftype = this.GetFieldType; - StringBuilder strbld = new StringBuilder(); - strbld.Append("\n"); - if (ftype == (uint)FieldTypes.VariableTxt || ftype == (uint)FieldTypes.Table || ftype == (uint)FieldTypes.XYPlot) - { - strbld.Append("\n"); - if (ftype == (uint)FieldTypes.VariableTxt) - strbld.Append("Variable"); - else if (ftype == (uint)FieldTypes.Table) - strbld.Append("Table"); - else - strbld.Append("XYPlot"); - strbld.Append("\n"); - } - strbld.Append("\n\n\n\n"); - if (ftype == (uint)FieldTypes.FrmtSingleTxt) - { - strbld.Append("\n"); - } - strbld.Append("\n\n"); - return (strbld.ToString()); - } - - public string MakeComboSchemaString(string fieldname, bool fixd, string fixdwid, bool multi, string multiwid, - bool table, string tablewid, bool xyplot, string xyplotwid) - { - StringBuilder strbld = new StringBuilder(); - strbld.Append("\n"); - if (fixd == true) - { - strbld.Append("\n"); - strbld.Append("\n\n\n\n\n\n"); - } - if (multi == true) - { - strbld.Append("\n"); - strbld.Append("\n\nVariable\n"); - strbld.Append("\n\n\n"); - strbld.Append("\n\n\n\n\n"); - } - if (table == true) - { - strbld.Append("\n"); - strbld.Append("\n\nTable\n"); - strbld.Append("\n\n\n"); - strbld.Append("\n\n\n\n"); - } - if (xyplot == true) - { - strbld.Append("\n"); - strbld.Append("\n\nXYPlot\n"); - strbld.Append("\n\n\n"); - strbld.Append("\n\n\n\n"); - } - strbld.Append(""); - return (strbld.ToString()); - } - - public string MakeImageSchemaString(string fieldname) - { - StringBuilder strbld = new StringBuilder(); - strbld.Append("\n\n"); - strbld.Append("\n"); - strbld.Append("\n\n"); - strbld.Append("VLN_FINDFILE\n"); - strbld.Append("\n\n"); - strbld.Append("\n\n"); - strbld.Append("\n\n"); - strbld.Append("\n\n"); - strbld.Append("Lines (6 lines per inch)\n"); - strbld.Append("\n\n"); - strbld.Append("\n\n\n"); - strbld.Append("\n\n"); - strbld.Append("\n\n"); - strbld.Append("Characters (12 chars. Per inch)\n"); - strbld.Append("\n\n"); - strbld.Append("\n\n\n"); - strbld.Append("\n\n\n"); - return(strbld.ToString()); - } - - } - -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ROField/ROFields.csproj b/PROMS/ReferencedObjectsOld/LibSource/ROField/ROFields.csproj deleted file mode 100644 index 21c0b83e..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ROField/ROFields.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {0C782592-AA05-11D6-84D1-00A0CC271352} - Debug - AnyCPU - - - - - ROField - - - JScript - Grid - IE50 - false - Library - ROField - OnBuildSuccess - - - - - - - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - - - - System - - - System.Data - - - System.XML - - - - - Code - - - Code - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ROField/ROFields.sln b/PROMS/ReferencedObjectsOld/LibSource/ROField/ROFields.sln deleted file mode 100644 index 19f36f2a..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ROField/ROFields.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ROFields", "ROFields.csproj", "{0C782592-AA05-11D6-84D1-00A0CC271352}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug.ActiveCfg = Debug|.NET - {0C782592-AA05-11D6-84D1-00A0CC271352}.Debug.Build.0 = Debug|.NET - {0C782592-AA05-11D6-84D1-00A0CC271352}.Release.ActiveCfg = Release|.NET - {0C782592-AA05-11D6-84D1-00A0CC271352}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/About.cs b/PROMS/ReferencedObjectsOld/LibSource/Utils/About.cs deleted file mode 100644 index 702da814..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/About.cs +++ /dev/null @@ -1,268 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: About.cs $ $Revision: 5 $ - * $Author: Jsj $ $Date: 1/02/08 1:38p $ - * - * $History: About.cs $ - * - * ***************** Version 5 ***************** - * User: Jsj Date: 1/02/08 Time: 1:38p - * Updated in $/LibSource/Utils - * upped copyright to 2008 - * - * ***************** Version 4 ***************** - * User: Jsj Date: 1/02/07 Time: 1:53p - * Updated in $/LibSource/Utils - * uppped copyright to 2007 - * - * ***************** Version 3 ***************** - * User: Jsj Date: 7/18/06 Time: 11:40a - * Updated in $/LibSource/Utils - * turned off Microsoft Solution Provider logo. - * - * ***************** Version 2 ***************** - * User: Jsj Date: 1/03/06 Time: 9:08a - * Updated in $/LibSource/Utils - * upped copyright to year 2005 - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:34a - * Created in $/LibSource/Utils - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace Utils -{ - /// - /// Summary description for About. - /// - public class AboutDlg : System.Windows.Forms.Form - { - private System.Windows.Forms.Button btnHlpAbtOK; - private System.Windows.Forms.Label CopyrightMessage; - private System.Windows.Forms.PictureBox pictureBox2; - private System.Windows.Forms.Label lblProgName; - private System.Windows.Forms.Label lblVerRelNums; - private System.Windows.Forms.Label lblSerialNumber; - private System.Windows.Forms.Label lblSerialNumTitle; - private System.Windows.Forms.Label lblUserID; - private System.Windows.Forms.LinkLabel VolianWebLink; - private System.Windows.Forms.Label lblLicenseTab; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public AboutDlg(string ProgName, string SerialNoStr, string SnTitleTab, string SerialNoTitle, string VerRel, string cpyrght, string UIDstr) - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - CopyrightMessage.Text = cpyrght; - this.lblProgName.Text = ProgName; - lblVerRelNums.Text = VerRel; - lblSerialNumber.Text = SerialNoStr; - lblSerialNumTitle.Text = SerialNoTitle; - lblUserID.Text = UIDstr; - lblLicenseTab.Text = SnTitleTab; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(AboutDlg)); - this.btnHlpAbtOK = new System.Windows.Forms.Button(); - this.lblProgName = new System.Windows.Forms.Label(); - this.lblVerRelNums = new System.Windows.Forms.Label(); - this.lblSerialNumber = new System.Windows.Forms.Label(); - this.CopyrightMessage = new System.Windows.Forms.Label(); - this.lblUserID = new System.Windows.Forms.Label(); - this.pictureBox2 = new System.Windows.Forms.PictureBox(); - this.lblSerialNumTitle = new System.Windows.Forms.Label(); - this.VolianWebLink = new System.Windows.Forms.LinkLabel(); - this.lblLicenseTab = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // btnHlpAbtOK - // - this.btnHlpAbtOK.BackColor = System.Drawing.Color.YellowGreen; - this.btnHlpAbtOK.Font = new System.Drawing.Font("Tahoma", 10.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnHlpAbtOK.Location = new System.Drawing.Point(144, 160); - this.btnHlpAbtOK.Name = "btnHlpAbtOK"; - this.btnHlpAbtOK.Size = new System.Drawing.Size(96, 32); - this.btnHlpAbtOK.TabIndex = 0; - this.btnHlpAbtOK.Text = "OK"; - this.btnHlpAbtOK.Click += new System.EventHandler(this.btnHlpAbtOK_Click); - // - // lblProgName - // - this.lblProgName.BackColor = System.Drawing.Color.Transparent; - this.lblProgName.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblProgName.Location = new System.Drawing.Point(8, 8); - this.lblProgName.Name = "lblProgName"; - this.lblProgName.Size = new System.Drawing.Size(360, 19); - this.lblProgName.TabIndex = 1; - this.lblProgName.Text = "Program Name"; - this.lblProgName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // lblVerRelNums - // - this.lblVerRelNums.BackColor = System.Drawing.Color.Transparent; - this.lblVerRelNums.Font = new System.Drawing.Font("Arial", 10.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblVerRelNums.Location = new System.Drawing.Point(8, 40); - this.lblVerRelNums.Name = "lblVerRelNums"; - this.lblVerRelNums.Size = new System.Drawing.Size(352, 24); - this.lblVerRelNums.TabIndex = 2; - this.lblVerRelNums.Text = "Version 0 Release 0"; - this.lblVerRelNums.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // lblSerialNumber - // - this.lblSerialNumber.BackColor = System.Drawing.Color.Transparent; - this.lblSerialNumber.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblSerialNumber.Location = new System.Drawing.Point(8, 72); - this.lblSerialNumber.Name = "lblSerialNumber"; - this.lblSerialNumber.Size = new System.Drawing.Size(360, 16); - this.lblSerialNumber.TabIndex = 3; - this.lblSerialNumber.Text = "Serial Number: xx"; - this.lblSerialNumber.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // CopyrightMessage - // - this.CopyrightMessage.BackColor = System.Drawing.Color.Transparent; - this.CopyrightMessage.Font = new System.Drawing.Font("Arial", 6F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.CopyrightMessage.Location = new System.Drawing.Point(8, 192); - this.CopyrightMessage.Name = "CopyrightMessage"; - this.CopyrightMessage.Size = new System.Drawing.Size(232, 16); - this.CopyrightMessage.TabIndex = 4; - this.CopyrightMessage.Text = " Copyright C 1988 - 2008 All Rights Reserved"; - this.CopyrightMessage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // lblUserID - // - this.lblUserID.BackColor = System.Drawing.Color.Transparent; - this.lblUserID.Font = new System.Drawing.Font("Arial", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblUserID.Location = new System.Drawing.Point(8, 136); - this.lblUserID.Name = "lblUserID"; - this.lblUserID.Size = new System.Drawing.Size(360, 16); - this.lblUserID.TabIndex = 6; - this.lblUserID.Text = "User ID: xxxxx"; - this.lblUserID.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // pictureBox2 - // - this.pictureBox2.Enabled = false; - this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image"))); - this.pictureBox2.Location = new System.Drawing.Point(272, 160); - this.pictureBox2.Name = "pictureBox2"; - this.pictureBox2.Size = new System.Drawing.Size(69, 32); - this.pictureBox2.TabIndex = 7; - this.pictureBox2.TabStop = false; - this.pictureBox2.Visible = false; - // - // lblSerialNumTitle - // - this.lblSerialNumTitle.BackColor = System.Drawing.Color.Transparent; - this.lblSerialNumTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblSerialNumTitle.Location = new System.Drawing.Point(112, 96); - this.lblSerialNumTitle.Name = "lblSerialNumTitle"; - this.lblSerialNumTitle.Size = new System.Drawing.Size(256, 32); - this.lblSerialNumTitle.TabIndex = 8; - this.lblSerialNumTitle.Text = "Serial Number Title"; - // - // VolianWebLink - // - this.VolianWebLink.Location = new System.Drawing.Point(248, 192); - this.VolianWebLink.Name = "VolianWebLink"; - this.VolianWebLink.Size = new System.Drawing.Size(112, 16); - this.VolianWebLink.TabIndex = 9; - this.VolianWebLink.TabStop = true; - this.VolianWebLink.Text = "Volian Enterprises Inc."; - this.VolianWebLink.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.VolianWebLink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); - // - // lblLicenseTab - // - this.lblLicenseTab.BackColor = System.Drawing.Color.Transparent; - this.lblLicenseTab.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblLicenseTab.Location = new System.Drawing.Point(8, 96); - this.lblLicenseTab.Name = "lblLicenseTab"; - this.lblLicenseTab.Size = new System.Drawing.Size(104, 24); - this.lblLicenseTab.TabIndex = 10; - this.lblLicenseTab.Text = "Licenced To:"; - // - // AboutDlg - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 12); - this.BackColor = System.Drawing.SystemColors.GrayText; - this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage"))); - this.ClientSize = new System.Drawing.Size(370, 209); - this.Controls.Add(this.lblLicenseTab); - this.Controls.Add(this.VolianWebLink); - this.Controls.Add(this.lblSerialNumTitle); - this.Controls.Add(this.pictureBox2); - this.Controls.Add(this.lblUserID); - this.Controls.Add(this.CopyrightMessage); - this.Controls.Add(this.lblSerialNumber); - this.Controls.Add(this.lblVerRelNums); - this.Controls.Add(this.lblProgName); - this.Controls.Add(this.btnHlpAbtOK); - this.Font = new System.Drawing.Font("Microsoft Sans Serif", 6F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "AboutDlg"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "About"; - this.Load += new System.EventHandler(this.AboutDlg_Load); - this.ResumeLayout(false); - - } - #endregion - - private void btnHlpAbtOK_Click(object sender, System.EventArgs e) - { - this.Close(); - } - - private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) - { - System.Diagnostics.Process.Start("www.volian.com"); - } - - private void AboutDlg_Load(object sender, System.EventArgs e) - { - - } - - - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/About.resx b/PROMS/ReferencedObjectsOld/LibSource/Utils/About.resx deleted file mode 100644 index 5362d584..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/About.resx +++ /dev/null @@ -1,4144 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - - R0lGODlhRgAgAPcAAACK/wCN/wCP/wCT/wCR/xCZ/6ja/7jh//b7//j8/wCX/wCU/wCZ/wGZ/wKW/wKZ - /wOa/wSZ/waX/weZ/web/wec/wmc/wma/wud/wyc/w2e/w+d/w+f/xSe/xWh/xii/xuk/x2j/x2k/x6l - /yGm/ySn/yWo/yin/ymp/y2q/zCs/zGr/zOt/zar/zmu/zuw/0O0/0Wy/0a0/0iy/0i1/0i2/0u3/023 - /0+4/1G5/1O6/1W7/1a7/1e8/1i8/1q9/12+/2C//2XB/2rD/2/F/3HE/3HG/3PF/3TH/3bI/3nJ/37L - /3/M/4DL/4DM/4LN/4XO/4fP/4rO/4rQ/43R/4/R/5HT/5bV/5rV/5vX/5zX/57Y/6DY/6Xb/6nc/6rd - /63e/6/f/7Lg/7Th/7fi/7ji/7rj/7zk/77l/8Hm/8Pn/8bo/9Hs/9Pt/9Xu/9jv/9vw/+Hz/+Lz/+b1 - /+n2/+z3/+74//D5//P6//r9/wSb/wWc/wue/zav/0Cz/2PB/3LH/4PO/43S/47S/5LU/5jW/6La/6fc - /7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4eCUCDODxpJEDIenjAm3MYaacBjmpBptjMGCHAkH4aMUgU8g5 - gIs+4imQnkQyGeWTgwyCYpRliImQDI0U9MWohxD0hSWUnGqqGwTdoapAX3R7YdCmA436BRqmvsrhrrz2 - 6isABAQr7LDEFmvsscgmayyJvjbr7LPQDsQDBwf1ES2GdAiEggUyWlLIFQ9AkgezBLBgSR4BXMvQCAqQ - CMcXhOxgUBcExAGHuhmtaIhAebBpCR8CIYAvQw8MJEC2VAaAxEBxCBBGjQNHrFFAADs= - - - - False - - - Private - - - Private - - - Private - - - Private - - - False - - - False - - - Private - - - Private - - - True - - - (Default) - - - False - - - False - - - 8, 8 - - - AboutDlg - - - True - - - 80 - - - True - - - Private - - - - Qk0OjAMAAAAAADYAAAAoAAAAcgEAANEAAAABABgAAAAAAAAAAAASCwAAEgsAAAAAAAAAAAAApaWlpaWl - pqampqanpqanpqanpaWlpaWlpKSko6Oko6Oko6OkpaWlpqanpqanpqanpqampaWlo6Okpqanpqanpqan - paWmo6Oko6Oko6Oko6Oko6OkoqKjoaGhoqKio6Oko6OkpKSlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWm - pqanpqanpqanpaWmpaWlpaWlpaWlpaWlo6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Ok - o6OkoqKjoqKjo6Oko6Oko6OkpKSlpKSlpaWkoKCplZW0jo65j4+5j4+6kpK1kZG1jIy5jY24jY25jY27 - kpK1mpqtoKCno6OjoqKioqKioaGhoaGfnZ2jk5OwjY24hITDgoLEhITFhYXHhYXHhYXHjIy/jY2+jIzA - k5O4oaGqpKSloqKjoaGhoaGhoqKjoqKjoqKjnZ2okJC2i4u6ioq6iIi8iYm8iYm8ioq7ioq9jo64kpKy - lJSxmZmpoKCioaGhoaGhoaGhoaGhoaGhnp6nmJiuj4+4ioq+ioq7ioq8hITEg4PFg4PFgoLGhYXDjo65 - mZmnoKChoqKhoqKioqKioqKioqKjlZWwjIy6i4u8iIi+g4PGg4PFg4PFhobChobCioq9k5OzlZWwmpqn - oKCioaGhoaGhoaGhoaGhoKChlJSvjY24iIi+gYHFgoLEgoLEgYHDgYHCgIDCf3/Bf3/BgYHCgoLDgoLF - goLFg4PGhITEkJC3n5+mpKSgoKCklpaviYm+g4PFgoLFgYHFgoK+iIiyjY2uiIi5iYm8iYm8iYm9jIy7 - lJSym5uso6Okmpquioq/goLIg4PFg4PFgYHEhYW8h4e3hIS7gIDDgYHEgoLEg4PFg4PGioq9mJiroqKg - oqKgnJynlJSwkJC0kZGzkZGzkZGyioq3goLAgYHEgoLEg4PFhYXFiorAlpayn5+noqKloqKmpKSlmJiw - iYnChITHhYXFhYXEg4PFgYHCf3/ChIS9iIi4h4e7g4PChYXEg4PGjIy7m5uqpKSgoaGjlJSyh4fCg4PG - hITFgoLFgYHDgIDChoa4hoa2h4e4iYm6i4u6j4+6j4+6jY28l5eyoqKmpaWlpKSlnJyslJSzkZG1jo63 - iYm7iYm6iIi5h4e2g4O8gYHCg4PChYXEioq+j4+7kJC8kpK4nJyupKSlmpqymZmzmpqylJS3iYm/hITC - gYHCgYHCgYHDgYHEgoLEg4PCjo65jo65jY26kZG2m5urpKSjo6Oko6OkpaWmpqanpqanpqanpaWlpaWl - paWlpaWlpaWlpaWlpaWlo6Oko6Oko6Oko6Oko6OkpaWlpqanpqanpqanpqampaWlpaWlpaWlpaWlpaWl - paWlpKSlo6OkoqKio6OkpKSlpaWlpaWlpaWlpaWlpqanpqanpqanpqampaWlpaWlpaWlpaWlpaWlpKSl - o6OkpaWlpaWlpaWlpaWlpaWlpaWlpaWlIACmpqelpaWlpaWlpaampqempqempqelpaWlpaWkpKWjo6Sj - o6Sjo6SlpaWmpqampqempqempqelpaWjo6Slpaampqempqelpaajo6Sjo6Sjo6Sjo6Sjo6Sjo6KhoaGi - oqKjo6Sjo6SkpKSlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWmpqempqempqempqalpaWlpaWlpaWlpaWk - pKSjo6Sjo6Sjo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YaGxI2N - upqarKGhop+fpKCgpJ6epJWVrYqKu4ODwYCAwoCAwYCAwoODwoiIvIuLuomJv5aWsZ6eqZycq56eqaSk - paCgqJqarZaWs4+Pu4iIwomJwIeHvoiIuYWFuoGBwYGBxYGBxIODxYODxoSExI2NuZycqaKiopycqJOT - so6OuY2Nuo6Ot4yMtomJuIeHt4WFtoaGt4qKuY2NuZCQupCQupSUt5aWt5ycsaenpaWlpaSkpJ2drJGR - uYmJv4qKvImJu4SEvoCAwICAwYGBwYODwoaGw4yMvZKSuZWVuJaWuJubsqSkp6SkpZqar4+PvIeHxYSE - yIWFx4SExYKCw39/xIODwImJu4qKu4yMvIyMvIqKvpOTs6CgpKOjoaKio6OjpKOjpKOjpKWlpqamp6am - p6ampqampaSkpKSkpKWlpaWlpaWlpaSkpaOjpKOjpKOjpKOjpKSkpKampaamp6amp6amp6ampqWlpaWl - paWlpaWlpaWlpaSkpKOjpKOjpKOjpKOjpKSkpKWlpaWlpaWlpaWlpqamp6amp6amp6amp6WlpaWlpaWl - paWlpaOjo6KioqSkpaWlpaWlpaWlpaWlpaWlpSAApqanpqanpqanpaWlpaWlpqampqanpqanpqampqal - paWlpKSlpKSlpKSkpaWlpqampqampqanpqanpqampKSkpKSlpaWmpqanp6eopaWmpaWmpaWmpaWmpaWm - o6OkoqKioaGhoaGioqKko6OkpKSlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpqampqanpqanpqanpqampaWl - paWlpaWlpaWlpKSlo6Oko6Oko6Oko6Oko6Oko6Oko6OkoqKjo6Ojo6Oko6Oko6Oko6Oko6Oko6Oko6Oj - np6pmpqvlZW0iorAhITHhYXHhITHg4PDhoa+ioq6jo60mJionp6loaGko6Ojo6Oko6Oko6OkpaWhnp6o - j4+5goLGg4PFhITFg4PGhITEiYm/jIy8i4u+iorAj4+7m5uvpKSmpaWmpaWmpaWmpaWmpKSlo6Oinp6l - k5Ozjo65ioq+iYm+ioq8iIi9hobBg4PFgoLGhYXEi4u8lZWvoKCioaGhoaGhoaGhoaGhoqKgoKCilJSw - kJC2jIy6iIi+hITCgYHFg4PFhITGg4PGhYXDjo65m5uqoqKfoaGhoaGhoKCgoKCgoaGgoaGimJisj4+4 - hobDgoLHg4PFg4PFgoLEg4PFg4PGhITEi4u7lpauoqKhoqKhoqKioqKioqKhoKChnJymlpatjY23hYXB - gYHGgYHFgoLFgYHDgYHDgIDCf3/Bf3/Bf3/Bf3/Bf3/DgoLBiIi8i4u6jIy7kpK0nZ2poqKjoaGknp6n - m5uol5esk5Owj4+zioq4hoa6hYW4h4e6iYm8jIy7jo67jo67jo68jY28kpK2oKCknJyqkZG4j4+5jY28 - iYnBg4PFgYHFgIDCf3/CgoLDhYXDhYXEhYXFhITGiIjClpaxoqKjo6OgoKCim5uokpKxiIi9gYHEgYHD - gIDCgIDChITAiIi9iIi/jo66lpaymJiwmZmunp6ppKSlpKSlmpquk5O2j4+7jIy9i4u8i4u4hoa7gYHA - f3/DgYHDgYHEg4PFhITFgoLIiIjAmJitpKSgoqKim5upmZmsmJiulJSyj4+2iYm5hoa4hYW3iIi3jIy4 - jo65j4+8j4+9kZG7k5O5m5uxqKimpqampqaloqKmlZW1i4vAjY28i4u5hoa8gYG+gIDAgYHCgoLCioq+ - kJC3k5O1k5O4lJS5l5e2nZ2vpqamm5uuioq/g4PHhITGhYXGg4PFgYHEgYG/hoa5ioq3iYm7h4fBh4fB - hobDjIy7mZmuoKCjoqKio6Ojo6OjoqKjo6OkpaWmpqanpqanpqanpaWlpKSkpKSkpaWlpaWlpaWlpaWl - o6Olo6Oko6Oko6OkpKSkpaWlpqanpqanpqanpqampaWlpaWlpaWlpaWlpKSko6Oko6Oko6Oko6Oko6Ok - pKSlpaWlpaWlpaWlpqampqampqampqampaWlpaWlpaWlpaWlpKSkoqKjoqKjo6OkpaWlpaWlpaWlpaWl - IACmpqempqempqempqelpaalpaWmpqampqempqempqelpaalpaWlpaWlpaWlpaWlpaWlpaWmpqampqam - pqelpaWjo6SkpKWlpaalpaal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4eHuoaGuYWFt4eHuImJu4yMvY6Ovo6OvZCQu46OvJqar6CgppeXr4qK - v4SExYWFxIODxYGBxIGBwoGBwIGBwYKCxIODxYSExYiIwIyMvI6Ou5qarKOjpKGhpJWVroiIvYKCw4KC - wIGBwIKCv4KCvoKCvoWFv4qKvYuLvouLvoyMvo6Ou5WVs6KipqSkpKGhppeXso2NvYyMvouLv4ODxYGB - xICAwn9/wX9/wYGBwoODxYODxImJv4yMvI+PuJubqaKiop+fpZaWr42NuYmJvouLvIuLvYqKuomJtIqK - tIuLuYuLvIyMvY2NvY2NvoyMv5KSuaCgrKamp6enp6OjqZycrJWVsY+PuIiIvIODwoGBwoGBvoWFuIyM - touLvYqKv4qKv4qKv4qKv5GRuqCgraWlp6WlqJubsYuLv4SExYWFwoKCwYaGuIaGtoKCvX9/wn9/w4GB - w4KCxIODxYODxoiIwJaWsaKio6KioqKioqKioqKioqKioqKio6Wlpqamp6amp6ampqSkpaOjpKWlpaWl - paWlpaWlpaWlpaOjpKOjpKOjpKOjpKSkpKWlpqamp6amp6amp6WlpqWlpaWlpaWlpaWlpaOjpKOjpKOj - pKOjpKOjpKOjpKWlpaWlpaWlpaWlpaWlpaOjpKWlpaWlpaWlpaWlpaWlpaWlpaOjpKOjpKOjpKSkpKWl - paWlpSAApqanpqanpqanpqanpqanpqanpaWlpaWlpqampqanpqanpqanpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaWlpaWlpaWlpaWlpaWlpaWloqKioqKipKSjpqampqanpqanpqanpKSlo6Oko6Oko6Oko6Oko6Ok - o6OkpKSlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWmpqanpqanpqanpaWmpaWlpaWlpaWlpaWlpaWlpaWl - pKSlo6Oko6Oko6Oko6OkoqKioaGhoaGhoqKioqKin5+klpawiYnAg4PHhITFhITGhITGiYnAjIy+i4u9 - ioq8ioq5kZGwnZ2ioKCen5+foKCgoaGhoqKin5+nmJivk5O0kpK2kZG4j4+4ioq6iIi7ioq9ioq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oqKjo6OkpKSkpKSkpKSkpKSkpKSlpaWnpqanpqampqam - paWlpaWlpaWlpKSlpKSlpaWlpaWlpaWlpKSlo6Oko6Oko6Oko6Oko6OkpKSkpaWlpqanpqanpqanpqam - paWlpaWlpaWlpaWlpKSlo6Oko6OkpaWlpqampqampqampaWlpKSlo6Oko6Oko6Oko6Oko6OkpKSkpaWl - paWlpaWlpKSlpKSlIACjo6Sjo6Sjo6SlpaWmpqampqempqempqempqempqempqalpaWlpaWlpaWkpKSk - pKSlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWkpKSjo6OkpKSlpaWmpqempqempqem - pqelpaajo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6SkpKWlpaWlpaWlpaWlpaWlpaWkpKWjo6Sjo6SkpKWl - paWlpaWlpaWlpaWlpaWlpaWlpaWkpKWjo6WioqOioqKfn6aUlLCPj7aKir6FhcWDg8eFhcSIiL+Li7qM - jLqLi72OjruZma+lpaKjo6SioqSioqGgoJ+fn56enqGRkbCOjrSMjLWIiLqDg8GBgcWCgsWDg8WEhMSG - hsGJib6QkLWcnKWhoaGioqKioqOioqOioqOioqOhoaWioqWdnayTk7aKisKEhMiFhcaDg8WDg8WEhMWF - hcSFhcOKir6Xl6+hoaSioqCfn5+fn5+fn5+fn6CYmKuPj7iKir2Li7yHh8CDg8SDg8SCgsaDg8SJibmS - krGVla6bm6igoKOhoaChoaGhoaKjo6SlpaOioqSXl7CJib+Dg8aEhMSDg8WCgsaGhsSKisGJicKIiMSR - kbidnaykpKakpKWjo6ShoaGgoKCfn6Kbm6mTk7GNjbiLi7yIiMCDg8WBgcaBgcWBgcWBgcV/f8WIiLmO - jq2Li66FhbiCgr19fcJ+fsKAgMKCgsSDg8aCgseGhsKJib6SkrScnKmhoaSioqKfn6SdnaaUlLGRkbWR - kbOMjLWLi7OIiLSGhriHh7qJibuJibyJib6NjbySkreenqyjo6ednayamq6WlrOUlLKOjraIiLmGhriD - g7yAgMF/f8SCgsKIiLyPj7eSkrWRkbecnK2jo6SioqWXl6+MjL2Li76Li72KiryKiruIiLmGhreGhriI - iLqKirqJibuKiruOjraTk7OXl7GgoKekpKKjo6OenqaXl66QkLaLi7qJibyJibqJibiIiLiIiLqJibuL - i7uOjrqUlLWcnKygoKehoaKhoaOcnKmYmK2ZmauXl66MjLiJibqIiLiGhriGhruHh7yGhsCNjbuUlLWV - lbKVlbOWlrSjo6empqSmpqWmpqaioqyUlLmMjMCIiMODg8SAgMOBgcKBgcGAgMKEhMCJibyMjLqLi72M - jLyWlrOioqampqGfn6qSkrmKisKMjMGNjcGJicKGhsGEhL6Dg7qGhraIiLeJibmJibyMjLqVla6jo56i - oqCioqOlpaWmpqampqampqalpaWmpqampqempqempqempqalpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWk - pKWkpKWkpKWkpKWkpKWjo6Sjo6SlpaWmpqempqempqempqalpaWlpaWlpaWlpaWkpKWkpKWlpaampqem - pqempqempqalpaWkpKWjo6Sjo6Sjo6Sjo6Sjo6SkpKWkpKWkpKWkpKWjo6QgAKSkpKOjpKOjpKOjpKWl - paampqampqampqampqamp6amp6WlpaWlpaWlpaSkpKOjpKSkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaWlpaWlpaWlpaWlpaOjpKSkpaampqamp6amp6amp6amp6SkpaOjpKOjpKOjpKSkpKSkpKSkpKOj - pKOjpKOjpKSkpaWlpaWlpaWlpaWlpaWlpaSkpKOjpKSkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaOj - op+fpJiYq5KSsoyMu4WFxIODxoSExYWFw4iIvoiIv4iIvomJvo+PupubrqSko6OjpKOjpKKio6KioaCg - oJmZpY6Os46Os4mJuYSEw4ODxoODxIODxYSExIaGwYqKvY+Pt5eXrqCgoqCgoKGhoaKio6Kio6Kio6Ki - o5+fpZ+fpZmZrYuLvoGByoSExoSExIODxYODxIODxYODxYeHwZCQtp2dp6KioqKioqGhoaCgoJ+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aFhceEhMiKisKMjL6Pj7icnKiioqOjo6GenqeVla+NjbeHh7uHh7mFhbiFhbiFhbmGhrmHh7mI - iLyIiL2Tk7CZmaqZma2amq2dna2Pj7yMjMCHh8ODg8aDg8WBgcKGhrmIiLiJibqKiryMjLqRkbSQkLSX - l6+fn6akpKKioqWdnamXl7COjruLi76Li7yKirqIiLmFhbaGhriPj7WTk7OTk7SWlrGZma2enqafn6Si - oqOgoKeWlrKRkbiPj7iQkLiMjLqIiLuHh7iGhreHh7iHh7iKiruMjL2MjL2Njb6Li8CYmLKioqajo6Ke - nqaYmK+NjbuLi7yIiL+EhMGCgr6CgryIiLmJibmKiruMjLuNjbmOjrmPj7mcnKyioqWkpKSjo6agoKig - oKigoKmfn6mTk7WJib2IiLiGhreHh7iIiLiKiruLi7yLi7uLi7uKiryWlq6hoaWkpKOfn6eZma2UlLWT - k7WUlLOOjraIiLuIiLmFhbaGhraDg8CDg8aEhMeFhceGhsWTk7igoKikpKOjo6Sjo6Smpqempqempqel - paalpaWlpaWmpqempqempqelpaalpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWkpKWj - o6Sjo6SlpaWmpqempqempqempqalpaWlpaWlpaWlpaWlpaWlpaWlpaWmpqempqempqelpaalpaWlpaWj - o6Sjo6Sjo6Sjo6Sjo6OioqKioqIgAKWlpaWlpaWlpaWlpaWlpaWlpaOjpKWlpqamp6amp6ampqWlpaWl - paWlpaWlpaWlpaWlpaWlpaOjpKWlpaWlpaampqamp6amp6amp6OjpKSkpaWlpaWlpaWlpaWlpaWlpaWl - paSkpKSkpKWlpqamp6amp6amp6ampqSkpKOjpKWlpaWlpaamp6amp6amp6ampqWlpaOjpKOjpKOjpKOj - pKOjpKOjpKOjpKOjpKOjpKSkpaWlpaWlpaWlpaWlpaampKKiqJubr5KSt4yMvYuLvIWFw4KCxoODxYOD - xYODxYODxYKCxoyMu5ubqaKin6GhoaOjpKOjpKOjpKOjo52dqZCQuISExYKCxYODxIOD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lpaamp6amp6amp6ampqWlpaWlpaOjpKOjpKOjpKOjpKOjpKKioiAApqanpqan - pqanpqanpqanpqanpaWlo6OlpaWmpqanpqanpqanpaWlpaWlpaWlpaWlpaWlpaWlpaWlo6OkpKSlpaWl - paWmpqanpqanpaWmo6OkpKSkpaWlpaWlpaWlpaWlpaWlpaWlpKSlo6OkpaWlpqanpqanpqanpaWmo6Ok - o6OkpaWlpaWlpqampqanpqanpqanpKSlpaWlpaWlpaWlpKSkoqKjoqKjo6Oko6Oko6OkpKSkpaWlpaWl - paWlp6ejnp6skpK4j4+8jo68h4fDhYXGhITGhITGhITGg4PFgoLGjY26l5eun5+loqKgoaGhoaGio6Ok - pKSjo6OknJyqk5O0jIy9i4u8hobCg4PGhITFhITFhYXFhobEkJC6mpqvoaGnpKSkoqKioaGhoaGhoaGh - oaGgoKCgmZmljIy2ioq9jIy9iYnAhITGg4PEhITFhITGhITGh4fEkZG4np6oo6OjoqKhoaGhoaGho6Oh - oaGjlpavjY27iYm9iIi8iIi8iIi8ioq+jo69jY2/j4+7lpaxnJynoaGjoqKioqKhoKCgn5+en5+goKCk - oaGilpatiYm+goLHgoLGg4PFhITFg4PEgoLFhITDiIi9jo61nZ2noaGioqKjpKSlpKSlpKSloaGom5uu - kZG4h4fDg4PIg4PGgYHFgYHDgYHDgYHDgoLChYW/j4+ynJymnp6jmpqnlJSvjo61h4e7hoa7hoa5goK8 - f3/AgIDCgYHDhYXChYXChYXGh4fFj4+7nZ2so6Oko6Oin5+nkpK1iIjAioq+iYm8iIi7h4e2g4O6gIDB - gYHDgoLEg4PGjY26mJitnp6loKCjn5+mlpawkJC5kJC6jo67iYm+iIi5hoa3h4e1hYW8goLEgoLGg4PG - goLHiIi/lpawoKClo6OioaGklpaylJS0lJS1kpK2kZG2kJC0jo6yjY2uj4+tkpKukpKzj4+8jo67jY29 - kpK3nJyppKSfn5+lk5O0k5O1k5O1k5OykJC0ioq6h4e5h4e5h4e5iIi5iYm5iYm7jY28kpK3mpqwo6On - p6ejoaGok5O0h4fBhYXChYXDhYW+hoa3hoa3hoa3iIi1i4u1i4u3j4+0mpqpnp6loaGmoKCmoaGlpKSj - oqKlnp6pn5+omZmulJSzjo63iIi6iYm5hYW2h4e4iYm7ioq9jIy/jY2/jo69lJS3mpqyn5+po6OgoaGi - lZWwjY25iYm7iYm7ioq5h4e5gYG/gIDBgYHCgoLEgoLGhYXEk5O2mZmxmpqwoKCqpaWko6Oko6OkpKSl - paWmpqanpqanpqanpaWlpaWlpqampqanpqanpqanpaWlpaWlpaWlpaWlpaWlpKSlo6Oko6Oko6OkpaWm - pqanpqanpqanpqanpaWlpaWlpqampqanpqanpqanpaWlpaWlpaWlpKSlo6OkpaWlpaWlpqampqanpqan - pqanpaWlpaWlpKSko6Oko6Oko6Oko6OkIAClpaampqempqempqempqempqempqakpKSkpKSlpaampqem - pqempqalpaWlpaWlpaWlpaWlpaWlpaWkpKWkpKSlpaSlpaWlpaampqempqempqekpKWkpKSlpaWlpaWl - paWlpaWlpaWkpKWjo6SkpKSmpqampqempqempqelpaWkpKSkpKSlpaWlpaalpaempqempqempqalpaWl - paWlpaWlpaWkpKSioqOioqOjo6Sjo6Sjo6SkpKSkpKSlpaWnp6ShoamUlLaLi8KHh8WEhMaFhceFhceF - hceEhMeDg8aKiryXl6+goKaioqKioqKhoaGhoaGioqGioqSdnamVlbKQkLmOjruHh8CFhcSEhMaEhMaF - hcaEhMeKir+YmLChoaekpKWkpKWjo6ShoaKhoaGhoaGhoaGdnaaRkbOJibiIiLuKirqJibqGhr+Dg8WE - hMWDg8eFhcaNjbyZma6ioqWjo6SioqOhoaKhoaGioqCgoKSSkrSRkbaOjriIiL6EhMGEhMCHh8OHh8OK - isCRkbqYmLKenqmioqGioqKioqKioqKgoKCfn56enqGbm6aQkLKHh7yGhr2Ghr6EhMWEhMWDg8aFhcOK - ir2Pj7eTk66enqGhoaCioqGjo6OkpKWkpKWgoKmbm66QkLqJicGJicGJicGIiL+Dg8KCgsKBgcOBgcOI - iLuVlaqdnaCiop6amqiTk7CSkrKMjLiKirmEhL1/f8J+fsOAgMGCgsCFhcGEhMOHh8KOjr2Xl7Sfn6uk - pKWjo6OdnaiTk7SOjrmPj7eKir2Li7qGhryAgMB/f8KBgcKCgsSBgceNjbqVlbGWlq+YmK2cnKmgoKag - oKWZma2Pj7mJibyJibmHh7aDg7qAgMGAgMOBgcSDg8aIiMGLi7+Njb2WlrKhoaWhoaSYmK6VlbOUlLSU - lLWUlLSTk7KRkbCPj6qIiLWFhbyGhr+GhsOMjL6Li7+QkLmcnKulpaCgoKOWlq6Wlq6UlLCPj7WLi7qI - iLyIiLmHh7mIiLmJibqJibuJibyLi7uSkrWZma+ioqinp6OioqeXl7GOjrqKir6Hh72IiLqIiLiGhriI - iLSIiLaJibiJibqLi7mRkbOcnKibm6iamqyfn6ikpKOioqWcnKqYmK+Xl7OTk7eNjbqJibuJibqGhraG - hriIiLuLi7yLi7+IiMSIiMSHh8aRkb6fn62mpqKfn6ORkbKOjraOjrSNjbSIiLqCgsCAgMJ/f8GAgMGA - gMSDg8SIiL2OjrmQkLmTk7ifn62np6OkpKWjo6Sjo6Sjo6SlpaampqempqempqalpaWlpaampqempqem - pqempqalpaWlpaWlpaWlpaWlpaWkpKWkpKWjo6Sjo6SlpaampqempqempqempqalpaWlpaWlpaampqem - pqempqalpaWlpaWlpaWkpKWkpKSlpaWlpaampqempqempqempqalpaWkpKWjo6Sjo6Sjo6SlpaUgAKWl - paampqamp6amp6amp6amp6amp6ampqWlpaSkpKWlpqamp6amp6ampqWlpaWlpaWlpaWlpaWlpaWlpaOj - pKSkpKWlpaWlpaampqamp6amp6WlpqSkpKSkpKWlpaWlpaWlpaWlpaWlpaSkpKOjpKSkpKampaamp6am - p6amp6ampqSkpKSkpKWlpaamp6amp6amp6amp6ampqWlpaWlpaWlpaWlpaSkpKKio6OjpKOjpKOjpKOj - pKOjpKWlpKSkpZ+fqZaWs4uLvoiIwoODxYSEx4WFx4SEyYWFyI2NvZeXsZ6epqKioaKioaKioqKioqGh - oaKioJubqJSUs4+PuIuLvIeHwYKCxISExYWFxYSEx4WFx4mJwo2NvJiYrqKipaWlpKSkpaSkpaOjpKKi - o6KioJ+fpJaWr4yMu4uLuYuLt4uLuImJu4aGwISExoODxoaGxI6OuZqaraKipaSko6OjpKOjpKKipKGh - oqKioKGho5OTspGRtoqKvYSExYGBxoGBxYODx4KCyImJwZOTt52draKip6SkpKKioqKioqKioqKioZ+f - oZmZpY+PsYmJuomJuYmJuIaGv4SExYODxoSExIqKvpGRtpeXr5ycqKCgn6Cgn6GhoaGhoaOjo6Skpp+f - qpWVtI6OvYyMvo2NvY2NvomJwYSEwoGBw4KCw4mJupSUq5ycoZ6enqGhnJmZqZCQtY6Oto2NuIyMuIaG - vYSEvYODvYGBwISEwIWFwoiIwYuLvo+PvJOTuJmZsKWlpaWlpKGhppubq5SUs46OuYyMvIiIv4ODxIGB - xIGBwoGBwoGBxImJvJGRtJKSs5GRtZOTspqaqqGhoqOjopmZrpCQt46OuImJuoSEvH9/wX9/w4GBxIKC - xIiIwIyMvIyMvo2NvZWVtJ+fqKOjpKCgpJaWsZKStpKStZOTtZKSspKSsImJtoKCwH5+xYCAw4aGv4uL - vIyMvY2NvJiYsKOjpKKio56epJ+fopWVrIqKuIeHvYiIu4iIuYiIuYiIuYmJuomJvImJvIqKu5CQtJiY - rKKipqeno6Skpp6eq5iYsY2Nu4mJvIiIuoiIuYmJtoiItoeHuIiIuomJvImJvYqKu5KSs5OTtJWVs52d - qqWlo6OjpKCgppiYsJGRuYyMvouLvouLu4mJuoaGuIaGuImJuoqKvYeHwoSExoODyIqKw5OTup+fr6en - paOjppWVrpKSsI+PsYmJuIKCwYCAw4GBwn9/wX5+woCAwIWFu4qKuIqKvY6OupSUtZ6erKWlpaWlpaSk - paSkpaSkpKSkpKWlpqamp6amp6ampqWlpaWlpaamp6amp6amp6ampqWlpaWlpaWlpaWlpaWlpaWlpaSk - paOjpKSkpaamp6amp6amp6amp6ampqWlpaWlpaampqamp6amp6ampqampaWlpaWlpaSkpKSkpKWlpaam - pqampqamp6amp6ampqWlpaSkpKOjpKOjpKSkpSAApaWlpaWlpqalpqanpqanpqanpqanpqanpqanpKSl - o6OkpaWmpqanpqanpaWmpaWlpaWlpKSlpKSlpKSlo6Oko6OkpKSlpaWlpaWlpqampqanpqanpaWmpKSl - pKSkpKSlpKSlpKSlpqalpqampKSlpKSlpaWlpqalpqanpqanpqanpqamo6OkpaWmpqanpqanpqanpqan - pqanpaWmpaWlpaWlpaWlpaWlo6OkoqKjoqKjo6Oko6Oko6OkoqKknZ2olpawj4+2i4u7iYnAgoLFg4PG - hITHhYXGjo69mpqwnZ2toqKlo6OioqKioqKioqKioaGhoqKgmpqokJC1iYm8hoa+goLFg4PEhITFhITG - hYXGiIjCjo67j4+6m5uto6OkpKSkpKSlpKSlpKSlo6OlpKShnZ2mkZG0jo62jo63jY22i4u8hobDgoLH - hITFhobCjo67mJivoaGkpaWio6Oko6Oko6Oko6Oko6OjoqKgnZ2kkZG1ioq/g4PFgoLGg4PFg4PFg4PG - hITGh4fDk5O3oaGpp6ejpaWlo6OjoqKioqKioqKin5+mk5OviYm6iYm6iIi6hITAgoLGg4PGhYXEi4u9 - kJC3lpawnZ2ooaGioqKioKCfn5+foKCgoqKhoaGkmZmwjY29jIy/jY28jIy9iYnBhITFg4PEgoLCiIi6 - lJSrnZ2fn5+dnp6en5+cmpqkk5Oxjo63j4+2jIy5i4u5iYm5hYW8goLBg4PCg4PEjIy/jo6+jY2+kJC7 - lZW1oqKopaWlpqajoqKllZWxiYnAiYnAhITFg4PGgoLDgIDCgIDCg4O/jo6zkJC0kJC1lJSxmZmtnJyp - oaGhnJyolZWxkZG0jo63hYW/f3/Df3/Cf3/CgoLDh4fBjIy8i4u9jo66lpaznZ2roqKnpKSlpKSilJSx - kJC1kpK0k5O0k5O0jY25goLCgIDEgYHBhYW9i4u5ioq6jIy8i4u/kZG4nZ2qo6Oko6OioaGilZWtjIy2 - i4u3ioq3iIi5iIi5h4e5h4e5iYm6iYm8ioq7kJCxlZWsnJyoo6OlpaWloqKonJyvkZG5jY27jIy4jIy3 - i4u3h4e6hoa5iIi6iYm7iYm8iIi+iIi+h4fBjo64m5urpKSjo6OkpKSjoKCnk5O0jY27i4u7iYm7iYm6 - hYW4hoa3h4e6hYXAg4PEhITEiYnAlZW1nZ2voKCspaWopqann5+qlJSviYm6goLCgIDEgYHCgYHCgIDC - gIDAhIS5iIi2i4u5j4+5lJS0l5ewnJyro6OnpaWlpaWlpaWlpaWlpKSko6OlpaWmpqanpqanpaWmpaWl - paWlpqampqanpqanpaWmpaWlpaWlpaWlpaWlpaWlpaWlpKSko6Oko6OlpaWmpqanpqanpqanpqanpaWm - paWlpqampqampqanpqampaWlpaWlpaWlo6Oko6OlpaWlpaWlpqampqanpqanpaWmpKSlo6Oko6Oko6Ok - IAClpaWlpaWlpaWlpaampqempqempqempqempqempqakpKSjo6SlpaampqempqempqakpKSjo6Sjo6Sj - o6Sjo6Sjo6SkpKSlpaWlpaWlpaWmpqampqempqelpaajo6Sjo6Sjo6SkpKSmpqampqempqempqelpaWl - paWlpaampqempqempqelpaWlpaWlpaampqempqempqempqempqempqalpaWlpaWlpaWlpaWjo6SioqOi - oqOjo6Sjo6ScnKqXl7CPj7eLi7uHh7+CgsaDg8WDg8WCgsaLi76YmLGbm66cnK6jo6ejo6OioqKioqKi - oqKioqKhoaGdnaaRkbGFhb6CgsWEhMWDg8WEhMWEhMWHh8KOjruQkLmVlbShoaimpqSkpKWjo6SkpKWk - pKWkpKWkpKSbm6qQkLSRkbKNjbeJibyFhcODg8aEhMWFhcSLi72QkLeWlrCenqejo6Gjo6Sjo6Sjo6Sj - o6SkpKSfn6eUlK+IiL6Dg8WCgsaDg8WDg8WDg8WEhMSHh8GHh8OPj7qenqumpqSlpaWlpaWjo6OioqKj - o6GenqaSkrSLi7mJibqDg8CAgMWCgsSFhcOKiryQkLaTk7OYmK2fn6WioqKioqKhoaGfn5+goKCioqCg - oKOTk7OOjrqMjL2Li72IiMCDg8WDg8ODg8OJibuUlKydnaCfn52enp6enp6fn52cnKCWlqiSkrGQkLSK - irqKiruHh7+CgsOBgcKBgcOCgsWKisCNjb6SkrqXl7SWlrSbm6+jo6empqSioqeWlrKJib+Dg8aEhMWD - g8SBgcOBgcKCgr+IiLmIiLuIiLyNjbeUlLCXl66Xl66goKWcnKeUlK6MjLeFhb+AgMSAgMJ/f8F/f8GF - hb2MjLqLi7yLi72SkrWXl7CenqqkpKSkpKWlpaSWlrCRkbWSkrSSkrSPj7qDg8eBgcOBgcCGhruKireJ - ibmJibqKirqNjbuPj7qXl7Cjo6Ojo6Samq2SkrKQkLKRka+Pj7KJibmHh7mHh7mIiLqIiLqIiLuKiruQ - kLSPj7ORkbKZmayioqWlpaWfn6uYmLKWlrSUlLOOjraIiLyIiLqFhbiHh7mJibqHh76Dg8eDg8aDg8aL - i76YmK6ioqOjo6Sjo6SkpKOgoKaZma2Pj7aIiLyIiLqFhbiFhbiBgb6AgMKCgsKGhsCSkrWVlbOenqyj - o6ikpKimpqempqiXl7OGhsF/f8aBgcKBgcKBgcKAgMCFhbiIiLaIiLuKir2RkbeRkbiVlbScnKyjo6Wl - paWlpaWlpaWlpaWlpaWkpKWjo6SlpaampqempqelpaalpaWlpaWmpqempqempqelpaalpaWlpaWlpaWl - paWlpaWlpaWkpKWjo6Sjo6SmpqempqempqempqempqalpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWj - o6SkpKSlpaWlpaWmpqempqempqekpKWjo6Sjo6Sjo6QgAKWlpaWlpaWlpaWlpaWlpqamp6amp6amp6am - p6amp6ampqWlpaOjpKWlpqamp6amp6ampqWlpaOjpKOjpKOjpKOjpKOjpKOjpKWlpaWlpaWlpaampqam - p6amp6amp6OjpKOjpKOjpKSkpKWlpqamp6amp6amp6WlpqWlpaWlpqamp6amp6amp6WlpqWlpaWlpqam - p6amp6amp6amp6amp6ampqWlpaWlpaWlpaWlpaSkpKKio6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am - p6amp6ampqWlpaWlpaWlpaWlpaSkpKSkpKWlpaWlpaWlpaWlpaWlpaWlpaSkpaOjpKOjpKamp6amp6am - p6amp6amp6WlpaWlpaWlpaWlpaSkpaOjpKWlpaWlpaWlpaSkpKSkpKWlpaWlpaWlpaWlpaSkpKOjpKOj - pKOjpCAApaWlpaWlpaWlpaWlpaWlpaWlpqanpqanpqanpqanpqanpqanpaWlo6OkpaWmpqanpqanpqan - paWlo6Oko6Oko6Oko6Oko6Oko6OkpaWlpaWlpaWlpaWmpqanpqanpqanpKSlo6Oko6Oko6OkpaWlpqan - pqanpqanpqampaWlpaWlpaWlpaWlpaWlpKSko6OkpaWlpqanpqanpqanpqanpqanpqanpaWlpaWlpaWl - paWlpKSkoqKjoKCkm5uskZG3iIjChITGhITGhITFg4PFgoLFh4e+jIy5jo65kpK2n5+qpKSlpaWlpaWl - o6OkoqKjoKCkmpqrl5evkJC2hobAhITIhYXHhITIiorBjo67kJC3lpaxmZmsoKCnpKSlpKSlpKSlpKSl - pKSlo6OkoqKmnZ2slZW0jo67i4u9iYm8ioq8h4fChITGhYXFhYXFh4fCkpK2m5uqoKCko6OjoqKjoqKi - o6OjoaGlmJivi4u+g4PHhITGgoLFgYHEgoLFhYXGhobEhobEhITGjo65nZ2qpqakpKSlpKSlpaWlpaWl - pqakoqKll5esi4u6hITCgoLEgYHFhYXBjIy3kpKxlZWvlJSvmZmtn5+mo6OioqKjoqKjoqKioqKioqKh - n5+il5eokZGwi4u4iYm6ioq8i4u9i4u9i4u8ioq9kpKzmpqonp6hn5+enp6enp6en5+dl5eojIy2iIi6 - iYm5ioq4hITAgYHDgYHDgIDCgYHBh4e7j4+zk5OzlJS1lJS2lZW2mJiyn5+rpaWlo6OmmJiyi4vAhITG - goLGgYHDgoK+hIS6hIS6hoa9jIy8h4fChITFhYXEhYXEhobAlJSxmJiujY26g4PFgYHGgYHFgYHFhoa9 - h4e3h4e3iYm4ioq7hITDhITEhITFiIjBk5O0n5+opKSlpaWkm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qOjpKSkpKWlpaWlpaWlpaWlpqWlpqampqWlpqOjpKOjpKOj - pKSkpKampaamp6amp6amp6ampqWlpaWlpaWlpaWlpaSkpaOjpKSkpKampqamp6amp6amp6amp6amp6Wl - paWlpaWlpaampKSkppaWs4uLvYWFxYSExoSExYSExYODxYSExISExYSExIeHwJCQtJycpaGhoqSkpKWl - paWlpaWlpaSkppubrpqaq5ubqZeXro2NuYaGwoSExoWFx4SEyIODyoeHxJSUtKGhpaKio6Kio6Kio6Oj - pKSkpaSkpaOjppycrZGRuYuLv4yMvo2NvYiIwoWFxYODx4SExYeHwYqKvpWVs5ubq6GhpaOjoqKio6Ki - o6Kio6Kiop+fpZWVsoqKv4mJwImJwIiIwoWFwoODwIODwIaGwpCQupiYr56eqKKipaOjpKOjpKSkpaSk - paamo5+fqpCQu4SEyIODyISExYSExYSExYODxoODxoaGvoeHvY6OtpqaqaGhoaGhoaKioqKio6Kio6Oj - oqKio5qaqpCQtYmJu4mJuIeHvYSEw4ODxoSEx4iIwY6OupWVsJ2dpqGhoaGhoaCgoJ+fn5+fnZuboJOT - q4qKuIODwICAxICAw4CAwX9/wX9/wYGBvYaGtoaGuYyMuJKStZSUtJSUtpSUt5SUtp6eq6ampKOjppyc - rJWVs4+PuYmJvIWFvYWFuoaGt4ODvYGBwoODxIWFxImJwoyMv4yMvo+PupubqpycqJOTs4+PuJCQtpCQ - tI6OtoyMt4eHuoKCwICAw4GBxIKCxIKCxYSExYyMvZmZrqGhpaSkop2drJSUtpKSuJGRtouLvImJvIeH - u4WFuoiIt46OspOTspSUs5iYsJiYsJWVspiYraCgpaOjpKKipZeXsoyMvYmJvYiIu4iIuoeHuIWFtoWF - t4iIuoqKu4uLvIuLvYyMuZOTspubqqCgoqGhoZ2dp5CQuImJwIyMvYyMvYaGwoGBw39/w4CAv4WFuoqK - uYqKuYqKvIqKvomJv5CQt52dqKKio6Kio6GhpaCgp56eqpqarpWVso+Pt4mJuIeHtoaGuYSEv4SEv4SE - wIuLupCQ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impqrjIy8goLGgIDIgYHHgYHEhYW7iYm2 - hoa8gYHCgYHEg4PEgoLFiIjAlZWxoKClpKSioKCnk5O1k5O2lJSzkJC1ioq5iIi5h4e4h4e4iIi3hoa9 - goLEgoLGgoLGgoLHjIy7nZ2opKSfoqKipKSko6OkpKSlpaWlpaWlpaWlpaWlpaWlo6OkpKSlpaWlpaWl - paWlpaWlo6OkoqKjoqKio6OjpKSkpaWlpaWmpaWmpqampaWmo6OkoqKioqKioqKio6Ojo6Oko6OkpaWl - paWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpKSko6Oko6Oko6OkIACjo6Sjo6SioqSioqKioqKioqKlpaWl - paampqempqempqempqalpaWlpaWlpaWjo6OioqKkpKSkpKWkpKWjo6Sjo6SkpKWmpqampqampqakpKSk - pKSlpaWlpaWlpaWlpaWlpaWlpaWlpaempqempqempqempqempqempqWlpaWlpaWlpaWlpaWlpaWjo6Oi - oqKioqKioqOjo6Sjo6Sjo6OioqWdnauWlrGQkLaIiL+EhMSDg8aDg8aEhMWDg8eIiMCOjrmSkrWZma2g - oKGgoKChoaGhoaGhoaGgoKKcnKaYmK2QkLeIiMGEhMWBgcSCgsWEhMSHh8CPj7mZmbSgoK6lpaimpqal - paalpaWlpaWlpaWlpaWkpKSdnaeTk7OJib6CgsOBgcOBgcOBgcOCgsODg8aEhMWKir6RkbaXl6+goKWj - o6KioqOioqOioqOkpKOhoaaYmK+Pj7mLi72Li72KiryHh76Hh8GKisCSkrecnK2cnKqhoaGioqGjo6Sj - o6Sjo6SioqOiop+dnaGXl6iTk7COjreFhcGDg8WDg8aDg8eGhsWLi7+NjbySkrWYmK6enqWioqGioqOi - oqOioqOkpKCgoKWTk7SJib+Li72Li72IiMGHh8KGhsOJib+RkbSVla+Xl6ydnaehoaOioqKioqKioqKj - o6GYmKyOjraKirqKiruFhcCCgsSDg8WCgsWDg8SIiMGMjL2UlLSgoKejo6GamquRkbaSkrKPj7OLi7eJ - ibiIiLeGhriDg7+BgcOCg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no6Ojnp6om5uslJS0iIjCgYHJg4PFgYHEgIDEgoK/jIy0k5OukJC1jY25 - j4+6jY29kpK4np6spaWln5+qnZ2rmpqrkpK1ioq9iYm6hoa4hoa3iIi5iYm6ioq7i4u/ioq/iorAiorA - kpK2np6po6OhoaGhn5+kl5etkZG1jo65ioq9iIi/gYHEgIDCgIDCgYHBhYW8ioq4iYm7lZW0l5eylpaz - m5uto6OioqKjl5evj4+4jY28i4u9iYm7hoa9f3/Bf3/CgYHCgYHDgoLEgoLEhITDgYHGiYm9mZmrpKSh - pKSlpKSkpKSko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6OkoqKjo6Oj - o6OkpKSkpKSkpKSkpKSko6OkoqKjoqKioqKioqKioqKio6Ojo6OkpKSlpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaWlpaWlpKSkIACjo6SlpaWlpaWlpaWlpaWlpaWmpqempqempqelpaalpaWmpqempqempqelpaal - paWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWjo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6SlpaWlpaWlpaWkpKSi - oqKkpKSmpqempqempqempqempqempqelpaWkpKWlpaWlpaWlpaWlpaWjo6ShoaGioqCenqeVlbKMjL2D - g8eEhMaEhMaEhMaEhMaGhsSNjbyPj7mUlLOVlbGamqujo6GioqKioqKioqKiop+cnKSQkLSFhcODg8aD - g8WEhMSIiL+Li7uLi7qRkbGXl6uZmauenqakpKCjo6SmpqempqempqempqelpaWkpKWgoKqTk7eIiMOE - hMeEhMWDg8WDg8KBgcGIiLmOjrOTk62ZmaednaOioqKioqKioqKioqKioqKioqOenqiRkbWMjL2MjL2M - jL2MjL2Li7yKiryPj7eTk7KVlbGXl6+enqmioqWkpKSioqKhoaGioqKioqWXl7CQkLmHh8KBgcaCgsOD - g8SEhMSMjL6OjryNjb2Njb2Rkbienqqjo6WlpaWjo6WioqOhoaGioqOVlbCMjLyJib6Hh7+Bg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4u8jIy8iIjCg4PHhITGhITGjo67l5evn5+lo6OhoqKioqKioqKioqKioKCkoKCnoKCqmJixjo68hobE - hITHhITGhITFhYXEjIy6lpasnp6joaGioaGkoqKjoqKjo6OinZ2llpaukJC3iYm/hITFhITFg4PGiIjB - jIy8i4u9i4u9jY27lpavnp6in5+dnp6eoaGhoqKioqKioqKknp6qlJS0i4u+i4u8ioq5hIS/gIDEgIDC - f3/Bf3/Bf3/Bf3/DhYW/jIy7jIy9jY2+k5O4m5uvnp6roaGppaWkoqKklZWyjIy8ioq+jIy9iYm+gYHD - gIDBf3/Bf3/Cg4O+iYm6h4fBh4fBhYXDjo63mpqpl5esioq7ioq7ioq7iYm7ioq5h4e7gYHBgYHBgYHC - goLGiIjBi4u6jIy6lZWxm5uqo6Olo6OmnZ2rlZWzi4u8hITDgYHDgIDBgIDBgIDBgYHCg4PDiYm/jIy8 - jIy+jY28lZW0oqKlo6OioqKimpqrjIy8goLGgoLFgYHEgYHDgIDDgIDBg4O9iYm6h4e/hobBiIjCiorD - j4+8nJyupKSmpKSlmpqujY29hITGhITFg4PFgoLFgIDCf3/BgIDBgYHCgoLEgoLEgoLEgoLFh4fAlZWx - oqKlpKSkpqajnp6rlJS3lJS1jo65ioq6hIS/gIDCgIDBgYHBgYHCg4PEhITFg4PGhobDjY27kJC4m5uq - oqKjpKSgn5+okZG5hITGhITGhITHhobAiIi3hIS4gYHCgoLEgoLGhobCj4+6lpazmpquoKCppKSlpKSl - o6Olo6OkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpqanpqanpqanpqampaWlpaWlo6OkpaWlpaWlpaWlpaWl - paWlo6Oko6Oko6Oko6OkpKSkpaWlpaWlpaWlpKSko6Oko6Oko6Oko6OkpaWlpaWlpaWlpKSlo6Oko6Ok - IACmpqempqelpaalpaWlpaWlpaWjo6Sjo6SkpKWlpaWlpaWlpaWlpaWjo6SkpKSmpqampqempqempqem - pqempqempqempqalpaWlpaWlpaWlpaWlpaWkpKWjo6SlpaWlp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pqKi - oqKioqKioqGhoZycpZSUr42NuYeHwYODxoKCxoKCxYGBxIGBxYSEw46OupqarZ+fqKSko6SkpKKipKKi - o6Kio6Kio52dpZiYqY+PsoiIuoeHu4eHu4eHu4KCwn9/xX9/xICAwIKCu4WFuIWFt4WFt4KCvYCAwoKC - woSExISExYSExoSExomJwJaWs6SkpqWlpZubr5OTt5KSuJGRt4yMuoWFv4CAw39/w39/wn9/w4ODwYqK - vIuLvYiIwY6OuZubqZycp5KSso6OuI6OuYyMuIqKuYqKt4SEuICAwYKCxYSExoSExoWFxoWFxoqKwZiY - s6KipaSkoKCgpJOTsoyMvIuLvYyMu42NuYyMt4iIt4eHtoeHt4iIuoqKvIqKvYuLvYuLwJWVt6GhrKen - paOjpZycrJeXsZOTsZGRsY2Nt4WFvoCAwYGBwoGBw4SExIiIwYuLvYyMvYuLvpaWsaCgqKampKOjp52d - rZqasZSUt4yMv4aGw4SEwYSEv4KCvoiIuomJuomJvIqKvZCQt5ubq5+fpqCgpaGho6KioJ2do5KSsYyM - uIyMuYuLuYyMtouLtImJtoeHtoiIuImJuYmJuoqKu46OuJubq5qarJiYrp6eqKOjopycqY6OuYaGw4WF - w4aGw4eHv4mJt4eHuoeHtYyMspCQs5KStpKSt5KSt5WVs5qaraCgpqSko6OjpKSkpaSkpaSkpaOjpKOj - pKSkpaWlpaWlpaWlpaWlpaWlpaWlpaampqamp6amp6amp6amp6WlpqSkpaSkpaWlpaWlpaWlpaWlpaWl - paWlpaSkpKOjpKKio6KioqKioqSkpKWlpaWlpaWlpKOjpKOjpKSkpSAApqanpqanpqanpqanpqanpqan - pqanpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlo6Oko6Oko6OkoqKjoqKipKSlpqanpqan - pqanpaWmpaWlpaWlo6Oko6Oko6OkoqKjoqKioqKioqKioqKio6OjpKSlpqampqanpqanpqanp6enpaWo - mZmvjIy6ioq+i4u9i4u9jIy8iIjBg4PGgoLEgoLEg4PEjIy7mp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Ym/ - i4u/k5O1mpqtoaGmpKSjo6Oko6Oko6Oko6Oko6Oko6OkpKSkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpqan - pqanpqanpqanpqanpqano6OkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpKSko6Oko6OjoqKioqKipaWlpaWl - paWlpKSlo6Oko6OkIACmpqempqempqempqempqempqempqempqelpaalpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaWlpaWlpaWjo6Sjo6Sjo6Sjo6Sjo6Sjo6SmpqempqempqempqalpaWlpaWjo6Sjo6Sjo6Sjo6Oi - oqKioqKioqKioqKioqOkpKSlpaampqempqenp6aioquUlLaJib+Li72Li72MjLyGhsKDg8aDg8WDg8WC - gsSLi7eSkq+cnKejo6GioqKioqKgoKChoZ+dnaKXl6mSkq+Pj7KJibmIiLyKir2MjL+MjL+MjL+MjL+T - k7mYmLGfn6ikpKOjo6SioqKioqKhoaGioqCfn6OWlq+Jib2EhMODg8ODg8KCgsKBgcSDg8aDg8aCgseE - hMWNjbybm6yjo6Sjo6Sjo6SioqOioqKioqOgoKWamquQkLiHh8OEhMaFhcWEhMSKir6Li72Li76SkrWd - naehoaChoaGioqOkpKWlpaWlpaWlpaWgoKqbm6+NjbyEhMSCgsWDg8WEhMWDg8aJib+Li72QkLednaei - oqKioqOioqOioqOjo6SkpKWkpKWfn6mRkbeLi72IiMCDg8aEhMWEhMWEhMWEhMWDg8aIiMKWlrOjo6ak - pKSjo6Sjo6OhoaOcnKiVlbCIiL6Dg8WBgcWBgcSBgcSBgcKBgcKLi7aQkLCTk66bm6iioqWjo6Sjo6Sj - o6Sjo6Sjo6SioqObm6uVlbKKir2EhMKEhMKCgsSCgsSBgcSCgsKKireRkayPj62OjqyDg7uAgMCBgb+B - gcCCgsKEhMSEhMWIiMKKisCJicGMjL6Zma+kpKalpaShoamWlrSJicKEhMiDg8eCgsZ/f8OAgL+Dg7qG - hreHh7mHh7uQkLWamquenqadnaeioqKdnaaWlq6Pj7aHh72AgMOAgMGAgMGAgMKCgsSDg8WFhcSMjL2N - jb6KisCUlLahoaijo6SdnaednaaamqaUlKyNjbWJibmIiLeGhreGhreGhreIiLiJibqKiruPj7iQkLmW - lrWhoaylpaicnLGUlLSOjruHh8OCgsaBgcOAgMF/f8GDg7uCgr6BgcSCgsaEhMSNjb6Ojr6Tk7mfn6yl - paOenqeZmbGZmbGamrGXl7GOjrWGhrqFhbiGhrmIiLqKirqKiruLi7yLi7yLi7yWlq+goKWjo6KioqOh - oaKZmaiSkrCRkbKOjraJibyJibqIiLmCgr2BgcGBgcOBgcSEhMSKir2RkbiXl7Gfn6ikpKKhoaaSkrSM - jLuKiryKiryJibyKiriOjrCGhrWGhraFhb+Dg8aEhMWEhMWLi7+YmLGhoaakpKOjo6Sjo6SlpaWlpaWl - paWkpKWjo6Sjo6SlpaWlpaWlpaWlpaWlpaWlpaWlpaWmpqempqempqempqempqempqejo6SkpKWlpaWl - paWlpaWlpaWlpaWlpaWkpKSjo6Sjo6SioqKioqKkpKSlpaWlpaWlpaWlpaUgAKOjpKWlpqamp6amp6am - p6amp6amp6amp6amp6ampqWlpaWlpaWlpaWlpaWlpaSkpKOjpKWlpaWlpaWlpaSkpKOjpKOjpKOjpKOj - pKOjpKWlpqamp6amp6amp6WlpaWlpaSkpKOjpKOjpKOjpKKioqKioqKioqKioqKio6SkpKWlpaamp6en - p6Kiq5mZspGRt4yMuIuLu4aGwoSExYSExYODxoWFw46OuJOTsJiYp56eoaKioaKioqKioqKiop+fopeX - qZOTrZGRr4mJuYODwoODxISExYeHwoyMvo2NvpOTuJmZsaGhqaWlpKOjpKOjpKOjpKKioqKioqOjn56e - pJCQtYSExIKCxIODw4ODw4KCxIGBxYKCxYODxoGByIWFw5OTtKCgp6OjpKOjpKOjpKOjpKKipJ+fppmZ - rY6OuouLvYyMvIiIwIKCxoKCxIKCxYmJv5CQt5GRtZaWr6OjoaGhoaGhoaKio6SkpKSkpqCgqpqar46O - voaGxYSExoSExYODxYSExYODx4iIwY+PuZeXsJ6ep6KioqKioqKio6Kio6Kio6Ojo6WlpZ+fqpKSuIiI - woWFxYSExYODxISExISExYSExYODxoeHwZaWsqOjpqWlpaOjpKSko6CgppWVsYeHv4ODxYKCxoGBxYGB - xIKCw4GBw4aGvY2NtI+PsJKSrJubpaGhoqOjpKOjpKOjpKOjpKKipZ2dqpiYroqKvoSExISExIKCxYKC - xIKCxIGBxoSEwIuLtJKSrJCQroODvYGBv4GBv4CAwICAwYGBwYODxIiIwYqKwIqKwIqKwI2NvZWVtKKi - p6amo52drY+PvYSEx4SExoSExoKCxYKCwYSEu4WFtoaGtoiIuI+Ps5KSsJKSs5WVsZycqKKioqOjoZ6e - pJKSsYaGv4CAw4CAwYCAwYCAwYGBxIaGw4yMvYaGxIaGxISEx42NvpycrqampKKipJ2dqZWVro2NtYmJ - uYiIuIaGt4aGt4aGt4aGt4aGuIiIt4yMtY6OtpSUs5SUs5ycrqiopqOjqpeXtomJwoSExoODxoGBxH9/ - wYWFuIGBvoCAwoCAwoKCxIODxYWFxISEx46OvZ+frKeno6KippmZrJmZrJubq5eXro6OtYiIu4aGuIaG - t4iIuIqKuoqKuoqKuoyMu4uLvJaWr5+fpaKio6OjoqGhpJOTspCQs5CQsYyMtYmJuomJuYODv39/wYCA - woKCw4KCxYODxYSExISExY2NvJycq6WloaKippeXsY+PuI6OuI6Ot4+PtY+PsomJuIaGtYODvYKCxIKC - xYODxYODxYWFxIyMvJiYr6GhpaSkpKWlpaamp6amp6amp6ampqSkpaOjpKOjpKWlpaWlpaWlpaWlpaWl - paWlpaWlpaampqamp6amp6amp6amp6amp6SkpaSkpKWlpaWlpaWlpaWlpaWlpaWlpaSkpaOjpKOjpKKi - oqKioqSkpKWlpaWlpaWlpSAAoqKio6OkpaWmpqanpqanpqanpqanpqanpqanpKSlo6OkpaWlpaWlpaWl - paWlpaWlo6Olo6OkpaWlpaWlpaWlpKSlo6Oko6Oko6OkpKSkpaWmpqanpqanpqanpqanpaWlpaWlpKSk - o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JmZrpycqJ6epaKin5mZqYuLuISEwIWFwISEwYaGvIODvoCAv4GBvoSE - v4iIv4yMvY2Nvo6Ovo2NvZCQuZqaraGhpaKioqCgop6epZmZqpKSs4eHvYWFvYODvISEuIaGtoeHuIqK - uoqKuomJvoiIwYeHwoqKv5aWr6CgoqGhoZiYrIyMu4WFxISExoODxYKCxYGBwoGBwYCAw4KCxIeHv46O - t5KSspSUsZqaq6OjoKOjoqOjpKOjpKOjpKSkpKWlpaWlpaWlpaWlpqWlp6amp6amp6amp6WlpaWlpaWl - paWlpaWlpaSkpaSkpaSkpaSkpaOjpKOjpKOjpKOjpKOjpKOjpKSkpaWlpqWlpqWlpqWlpaWlpaWlp6am - p6ampyAApKSlo6Oko6Oko6Oko6Oko6OkpKSlpaWlpaWlpaWlpKSko6Oko6OkpKSlpKSkpKSko6OkoqKj - oqKjoqKjo6Oko6Oko6Oko6OkpKSlpqampqanpqanpqanpqampKSko6OkpKSlpqanpqanpqanpqanpqan - pqanpqamn5+slJS2j4+3j4+1kJC1kpK1jo67h4fEhITGhITHhITGj4+4n5+opqajpKSlpKSlo6Oko6Ok - paWinp6pkZG4jY29i4u/h4fChYXDhYXDhobEhITGhITGhITFjY24mZmmn5+cnp6en5+foKCgoaGho6Oj - pKSjo6OkmpqujIy9hobDhITFgoLGgoLGgoLFhobCioq+jo66k5O0mJisnp6loqKjoqKjoqKjoqKjoKCh - m5ugjo6zhoa/g4PDg4PEgoLEg4PFg4PFg4PGiYnAkpK1l5evmZmsnZ2koKCgoaGgoaGhoaGhoaGhnp6j - k5OvkZGxkJCxi4u3hITAgoLEgoLEgYHFhITCiYm9kZG3nZ2roaGmo6Oko6OkoqKioaGhoaGgoqKimpqs - i4u8hITFh4fDh4fDjIy9jY24kZGzk5Oxk5OwlZWrlpapnp6koqKjoqKjoqKjoaGio6OflJSui4u5iIi9 - hobAhITFhITFhobDiIi+jIy5lJSynZ2qn5+po6OmpKSlpKSlo6Oko6OkoqKkl5evi4u9g4PGgoLH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WlpaWmpqempqempqempqakpKSj - o6Sjo6Sjo6ShoaWdnaqbm66Zma+Tk7WHh8KEhMOEhMWIiMCMjLyNjbuTk7SgoKakpKSkpKWkpKWkpKWi - oqKlpaOenquSkriIiMOEhMaDg8WCgsWCgsSBgcWEhMKKiryLi72Skraenqijo6KioqOioqOioqOhoaGg - oJ+enp6enp2cnJ6VlaiLi7qKiryKiruKiruKiruJibqJibqJibuTk7GdnaWhoaGhoaGioqOioqOioqOj - o6Gfn6WTk7SHh8KDg8WDg8WDg8WDg8WDg8WEhMaFhcaKisGOjryYmLCjo6SkpKWjo6SioqOioqKjo6Gg - oKKYmKeSkq6Li7aEhL+CgsODg8OGhsOKir2Kir2OjriUlLCamqafn5+goKCgoKChoaGjo6OkpKSioqWb - m62UlLSTk7SOjriKiruJib2EhMOEhMOEhMSFhcOJib6SkrOdnaahoaGhoaGioqGfn6GXl6mNjbmFhcSF - hcSEhMWDg8WDg8WDg8WDg8WHh7yJibqNjbiYmKyioqChoaGhoaGioqOkpKSioqaZmbCMjL6Li7+MjL2G - hsGBgcaDg8aDg8aEhMiIiMONjb2Tk7ebm66jo6KioqKioqKioqOkpKWkpKWkpKWkpKWioqWdnaqRkbaI - iL2IiLuCgsKBgcJ/f8GAgMKCgsSDg8WEhMWDg8WJicCRkbSamqmioqalpaWbm66Njb+Hh8SHh8GGhsCI - iLqFhbmLi6+NjbGHh72Dg8SEhMSEhMSEhMWHh8OQkLmcnKuenqiQkLSKiruIiLuHh7mFhbmFhbiFhbaC - gsCCgsWEhMWEhMWEhMaEhMaQkLifn6empqGgoKeWlrGQkLiQkLeRkbeNjbmJibuGhryBgb+CgsKDg8SH - h8CMjLuOjrmOjrmOjrqTk7Ofn6eioqWZma6UlLSVlbOSkrOQkLKOjrCNja2Li62GhrWGhreIiLiJibuM - jLqTk7eSkreXl7GhoaahoaWYmK6RkbSQkLSQkLKLi7eIiLmHh7eFhbiBgcCCgsGAgMOHh7+NjbyMjL6O - jryamrCjo6empqSlpaW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xYODx4eHw5GRt56eqaKioqKioJeXqoiIuoGBw4ODwYODwYGBwoGBwYCAwYCAw4GBw4GBw4OD - w4SEw4mJv5CQupqasKampKWlpaampJ+fqZqarZubrJqarpOTtYuLuoODwX9/w39/wYGBwoKCxIqKv4qK - v4+Pu5eXs56eq6WlpaampJycrJeXsJmZrpaWsouLvoODxIGBw4CAwYCAwoKCxIODxYSExYSExYODxoeH - wpKStZ6eqKOjpKWlpaWlpaWlpaWlpaWlpaWlpaOjpKSkpKampqamp6amp6amp6Wlpaampqamp6amp6am - p6WlpaWlpaWlpaWlpaSkpaOjpKOjpKOjpKWlpqamp6amp6amp6ampyAAoqKioqKioqKjpKSkpaWmpqan - pqanpqanpaWmpaWlpKSlo6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6OkpKSlpKSl - pKSlpKSlpKSlpKSloqKjo6Oin5+llJSxiYm/hITFg4PEg4PEg4PFg4PFgoLGg4PEioq6j4+1m5uloKCf - oaGgoaGhoaGhoaGhoaGhoKCjnZ2olZWyiYm/hYXEhYXFhYXGhYXGhITHh4fEkZG1mZmsnp6koaGhoaGh - oaGhn5+fnZ2dnp6eoaGgm5upjo65hYXFhITGhITHiIjBi4u8i4u8jIy9jY27lpaxn5+no6OioqKioqKi - oqKio6OkpKSkoqKlmpqsjY25hobAhYXBg4PEgoLFgoLFhYXDjIy+jIy+i4vAkpK1nZ2moaGhoaGhoaGh - oqKio6OjoqKlnZ2qlpayk5O1kZG3jY27ioq8ioq7i4u8i4u8j4+3k5OwmJipnp6joKCgoKCgoKCgoKCg - oKCgoqKioaGmmpqsj4+6jY29iYnBhITEg4PDgoLEgIDGioq5k5Oyl5evnZ2noqKioaGhoKCgoaGgoaGj - mZmujY28jY28iIjChITFg4PGhYXEiYm7i4u8ioq+kJC4mJiun5+noqKioaGhoaGhoaGhoqKgoaGinZ2o - l5eviYm+hobChYXChoa/ioq8jIy9kJC4kZG5lpa0n5+qpaWlpaWlpaWlpKS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moqKjl5evkJC2jo64jo63jIy4 - iYm6iYm4h4e2iIi3ioq6jY29jY2+jo69lZW1mpqwoKCrpaWloqKknJyolZWxkpK0jY24iYm8ioq6h4e5 - g4O8goK+hIS+h4e9ioq7iIi/iIi+hYXCj4+4n5+opaWlnZ2sl5eyjo66ioq9iYm7iYm5iIi4hYW5goK+ - gYHBg4PCiYm+k5Oym5uqmpqqmZmrnp6no6OioqKjnJyoj4+1jY26jo65j4+3jo64gYHFgYHCgYHBgYHC - hoa/jo62kpKwmJiqn5+koqKko6Olo6OkoaGmlJS1kpK1jo64h4fAgoLGgYHDgYHCgIDChoa8h4e/goLH - g4PGhYXGiorAlpa0oqKopqakpaWlpaWlpaWlpKSko6Oko6Oko6Oko6OkpaWlpaWlpqampqanpqanpqan - pqanpaWmpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlo6OkIAClpaWlpaWkpKWioqOioqKioqKjo6Sj - o6Sjo6Sjo6Sjo6Sjo6Sjo6SioqKioqKioqSjo6SkpKWkpKWkpKWjo6Sjo6Sjo6Sjo6Sjo6Sfn6afn6Wa - mqiQkLOIiL+Jib6Dg8SDg8WDg8WCgsWEhMKNjbmYmKugoKKioqChoaGgoKCenp6goKCdnaaXl66QkLeL - i7yKirqLi7yGhsOFhceGhseGhseHh8aNjb6amrChoaSioqChoaGhoaGhoaGhoaGioqCdnaWamqmamquR - kbWMjLyJibyJibuJibuJibuJibyKir2Jib+Tk7SenqiioqOioqOhoaGioqOioqOjo6KgoKSXl6uKiruJ - ibuKiryKiryKiryLi7yKirqQkLKSkq+Xl6qenqOioqGioqKioqKioqKgoKCgoKCdnaiQkLaLi7yLi76L - i7uHh7+EhMaFhcWFhcaKisGQkLqbm6ykpKGioqOioqOioqOhoaKhoaChoaGbm6eNjbWCgsGAgMSBgcSD - g8WFhcWFhcWEhMaJicCRkbeYmK6enqeioqOhoaGhoaGfn6CenqCenqKZmamTk7CMjLmJibyJibyJibuK - iruRkbWTk7WVlbSbm62hoaajo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KCgoaGhoqKgn5+jl5eslpaukZGyioq6iIi+h4fBhITFhITFhITFhITGhITE - ioq5mJipoqKioqKjoqKjoqKioqKioKCmlpayjIy8iIjBhobDhYXChoa/ioq7iYm7iYm7i4u5jY24j4+0 - mZmooKChoqKgoqKioqKjoqKjn5+lm5uqkZG1iIjBg4PGg4PGhITGgoLFhITBh4e8ioq5kJCzmZmon5+h - oqKioqKjoqKjoqKjnp6mkZGxh4e+hYXChITDg4PEg4PEhITFhITFhobEiYm/jo63lZWsn5+gn5+foKCg - oKCgoaGgoKCinJymnZ2lmJirkpKyi4u7hobDhITHhITHhobGi4vBiorAjY29mZmwo6OjpKSjpaWlpqan - pqanpqanpaWmpaWlpaWlpaWlpaWlpKSko6OkpaWlpqampqanpqanpqanpaWmpaWlpKSkpKSkpKSkpaWl - pqampqampaWmpKSlpKSkpKSlpKSkpaWlpaWlpaWlpaWmpaWmpaWmpaWmnZ2slZWzkpKzjY22hIS/gYHC - gYHBf3/Bf3/BgIDCgYHEg4PFh4fCjY26lZWwmZmsnJypo6Oho6Oinp6nm5uqlJSxiIi9gIDEgYHCf3/C - gYHAh4e8ioq6iYm8jY24lJSvmZmpnZ2moaGjoaGinJyompqslZWwkpKwkJCvjIyvjIytjo6sjY2viIi5 - hITAhYXAhYXAjY23lpatoaGknp6nlpavmZmtmJisjo64hITCgIDFgIDDgIDBgYHCg4PEhITGg4PIhYXG - jo67mZmxn5+oo6OlpKSinp6nkZG1h4fBhobAhIS/hoa7iYm1ioqxjY2ujY2sjY2yjY24j4+6j4+7j4+6 - mZmwoaGmpqahn5+plJS0k5O0kZG4iYm9hYW/g4O9g4O8goLAgYHEgoLGgYHHhYXCjY25lJSznJytpaWm - pqalpqakoKCok5O0j4+4jY26ioq8hITAf3/Df3/Bf3/BgYHBgYHCg4PCh4fAjIy9kpK3oaGppqakqKii - oKCqlJS2kpK5i4u+hobChITBgoLCgIDDgIDCg4O/i4u3kZGylZWxlZWxlJSyk5OynZ2oo6OlpKSlpKS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OjpKOjpKGhopqaqo+PuIeHwoWFxIaGwoSExYSExYSExYSE - xYiIwpCQuJqaq6GhpaKio6KioqKio6OjpKSkpaWlpZqaroyMuoODwoGBxYKCxIKCxYSExoSExoSEx4aG - xY2NvpqasJ+fqKGhoqGhoKGhoaKioqKio6Ojop2dqJWVso6OuouLvYeHvYCAxIKCxYODxYODxYWFwoyM - upKSs5ycpaKioKKioqKioqKioqKioqKiopqaqY+PtomJvomJvYeHv4KCxYGBxoKCxIGBw4KCwYiIu5GR - rZubo5+fn5+fn5+fn5+fn5qapJWVrI6OtImJuYiIuomJu4eHvYiIvomJv4yMvJKStZiYr52dqaKipKOj - oqKioqKioqGhoaKin5ubp5CQt4mJv4eHwYKCxYODxYODxYSExYaGw4iIwYyMv5WVuJubsaSkqaiopqam - p6WlpqOjpKSkpaWlpqWlpqWlpqSkpaSkpaOjpKOjpKOjpKOjpKOjpKOjpKSkpaSkpaSkpaSkpaSkpaWl - paOjpKSkpaWlpaampaampqamp6amp6Wlpqamp6amp6amp6amp6WlpqOjpKOjpaWlpaWlpaWlpaWlpaWl - paWlpaSkpZ2drJSUtZCQuo2NvoeHxIODxYGBwoGBwYCAwYGBwoGBxISExYmJwI6Ou5OTuqGhrKamqKen - pqWlo5+fpZWVsImJvYODxYGBxICAwYCAwYODvoqKu4yMvYyMvpGRuJaWspaWtJeXsp6eqJiYrZGRtImJ - vYGBx4KCxIGBwoCAwYCAwYCAwYWFvo2Nt5KStJiYr5ubraCgqaampKSkpaKiqJmZrpSUrpOTsI6Ot4mJ - vIiIuoaGuIaGuYODv4GBxYODxIODxYyMvJOTs5iYrp6eqqWlpKSkpZaWsoyMvoSExoKCyYODx4KCxISE - wIaGuIaGuIaGu4eHvYSEw4WFxIODx4yMvJubqaOjoqCgqpycr5OTuY2NvouLu4iIu4KCv4CAwYGBwoGB - w4GBxISEwIqKt4+PtJGRtJycqaKioqGho6Kio6Ojo5ycqY6OuIqKvoyMvIyMuo+Pt4uLuIaGuIaGuYeH -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Dg8WEhMOKiruU - lKuZmaKcnJ6enp6goJ+enqCZmaWUlKySkq+NjbaJibyLi72Li72Li72Kir6Pj7iSkrOTk7Obm6uioqWj - o6Sjo6Sjo6SioqKhoaOcnKmOjreFhcGBgcSBgcSDg8WDg8WEhMWEhMWDg8aGhsKQkLacnKekpKWmpqam - pqempqempqempqempqempqempqempqempqelpaWlpaWlpaWkpKSjo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6Sj - o6Sjo6Sjo6Sjo6SkpKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaampqempqempqempqakpKSjo6SlpaWl - paWlpaWlpaWnp6SgoKmPj7mEhMWEhMWEhMWEhMSDg8SBgcOAgMGAgMOHh76MjLuQkLeTk7OUlLKenqmg - oKqlpaikpKmbm7CUlLaLi72Li72KiruHh7mFhbiFhbiHh7mEhMKDg8WEhMaEhMeGhsWRkbmgoKmfn6mT - k7WGhsGDg8aDg8SDg8SBgcSDg72Li7WTk7OUlLaVlbiVlbiUlLiYmLSgoKulpaWlpaWfn6qXl7OTk7WS - krGQkLKKiriCgsGAgMKCgsKDg8WFhcSLi7uKiryUlLKfn6ajo6KioqOkpKWYmLCKisCEhMeFhcWGhsOK - iryKirqCgr+AgMKBgcOCgsSCgsSCgsSJib6MjLuUlLKgoKWioqOcnKmWlrOVlbeSkrqKisKDg8WBgcOB - gcKCgsKIiL+MjLyLi7yLi72Li76JicCSkreenqijo6GioqOdnamcnKqbm6qZmaiWlquJibmFhbuFhbqD - g76CgsSFhcaGhseJicWJicWGhsaLi76amq6kpKWenqudnayenqyamrCRkbmMjL6KiruIiLiHh7iIiLmK - iruLi72Li7yQkLeRkbWbm6ulpaKjo6SkpKWkpKWkpKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWkpKWjo6Sl - paWlpaWlpaWlpaWlpaWlpaWjo6QgAKOjpKWlpaWlpaWlpqamp6amp6amp6WlpaSkpKOjpKOjo6KioqKi - oqKioqGhopycppWVr5GRtZGRtIeHwIWFw4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caEhMeGhsWMjL6Xl7KioqSioqOkpKWkpKWkpKWkpKWf - n6qRkbiJib+CgsOBgcSCgsOCgsSEhMaEhMaDg8eEhMaJicCSkrSfn6OhoaGhoaGhoaGhoaGhoaKdnaaX - l6uRkbONjbmHh8GBgceDg8aEhMWFhcWHh8GIiMGKir2Tk7Gfn6KgoKCfn5+dnZ2dnZyenpycnKGTk66J - ibyDg8SDg8eFhcaEhMeHh8SRkbuYmLWamrKenqykpKOioqKioqKioqOkpKOhoaaUlLSLi72IiMCJicCH - h8KCgsWCgsSEhMWDg8aFhcWOjryamq+hoaWjo6OioqKioqKioqOkpKWmpqampqempqempqempqempqem - pqempqempqempqalpaWlpaWlpaWkpKWjo6SkpKSlpaWlpaWlpaWkpKWjo6Sjo6Sjo6Sjo6Sjo6SkpKSl - paWlpaWlpaWlpaWlpaWlpaWlpaWlpaampqempqempqelpaajo6SkpKSkpKSlpaSlpaWhoamYmLKQkLmO - jriNjbWOjrONjbOHh7eIiLeGhr2EhMSCgsaDg8WIiMCRkbWfn6Wjo6KioqWioqienqyRkbmLi72KiruH - h7uBgb9+fsJ/f8GBgcOCgsSGhsKMjL6Pj7qVlbSamq6ioqaenquVlbSUlLSTk7ORkbGQkLGQkK2MjLGG - hryEhMCFhcKKir+Njb6Njb6Pj72Xl7akpKilpaelpaagoKmTk7eGhsWEhMeBgcaEhL+GhrmHh7qIiLyJ - ib6MjL2MjL2Kir6Pj7ednaejo6Ojo6Kbm6uOjriFhcGDg8OBgceAgMSAgMN/f8OCgsCIiLuLi7iFhb6G - hr+EhMKKiruZmaqioqGjo6OYmK6Li7yEhMSEhMSFhcKHh72IiLmHh7aFhbqFhcCEhMOEhMSKir6VlbGc - nKifn6aioqajo6SkpKKdnamPj7mHh8OJicCIiL+Hh76EhMGBgcGCgsCFhcCGhsGLi8CQkL2Tk7qUlLmW - lredna+kpKWioqWfn6mZma+SkrSOjraIiLqGhrmFhbiHh7WKirOLi7iKiryKir+NjbySkraZma+goKik - pKWjo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KhoaGhoZ+dnaSWlqyOjrSIiLuCgsOCgsWDg8WG - hsGLi7uKiryLi72MjLyWlq+hoaSkpKSjo6Sjo6SioqKhoaOenqaWlq+MjL2MjL2MjL2Hh8ODg8aDg8SF - hcKMjLuNjb2RkbqenqyoqKKlpaWlpaWkpKWioqSkpKKgoKiSkriGhsWFhcaEhMWCgsWCgsWCgsWCgsWD - g8KDg8SMjL2cnKylpaGjo6Sjo6SioqOioqGgoKKYmKyMjLqNjbiNjbmPj7WNjbWHh72FhcKFhcKGhsOF - hcSNjbubm6qjo6KioqKioqKioqKfn6KYmKiMjLaAgMSAgMOCgsSEhMWHh8KOjrqSkrSUlLWUlLWYmK+h - oamnp6empqempqempqakpKOhoaKZmayNjbuMjL2EhMWEhMeFhcaFhceFhceFhcaKisCRkbaZmayfn6ak - pKSlpaWlpaWlpaWkpKWjo6Sjo6Sjo6Sjo6SkpKWlpaWlpaampqempqempqempqempqempqempqelpaWl - paWlpaWlpaWkpKSjo6WmpqempqempqempqakpKSjo6Sjo6Sjo6Sjo6SlpaampqempqempqempqelpaWl - paWlpaWlpaampqempqempqekpKWjo6Sjo6SioqWdnaydnayenquUlLaKir+IiL+CgsSAgMGBgcGGhruO - jrONjbWDg8SEhMOCgsWMjLqcnKmjo6GhoaOioqKXl6+Jib+BgcSAgMKAgMGAgMCAgMGAgMKBgcSFhcKO - jruUlLWcnKyenqmioqSioqWcnK2cnK2VlbWIiMKCgsaCgsKDg76GhraIiLmIiLqIiLyLi7uQkLeVlbSd - na+lpailpamdnbCXl7WUlLeOjryJicGGhr+Dg7yEhLqHh7iJibqJibyJibyJib6NjbqWlrCdnaihoaKi - oqGjo6Kjo6ChoaKXl6uNjbeIiLmGhreDg7yAgMSCgsODg8OJibyPj7WRkbORkbKYmKqgoKOhoaCXl6yR - kbWSkrKQkLKKireCgr2AgL6Bgb2BgcGBgcWCgseBgcmIiMGMjL2Pj7uWlrGioqOjo6SlpaKcnKyQkLmJ - ib+GhsKGhsKGhsGDg8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h4fCg4PH - hITGg4PFiIi9iYm8iYm8kZG0nJyloKCgn5+fn5+foKCgoqKhoKCim5uolpavkJC2h4fAgoLGhITGhITG - hITGhITGiYm/jIy8jY28k5OzoKCmo6OjpaWmpqanpqanpaWnnp6qmZmui4u+g4PGg4PEg4PEg4PFg4PF - goLGh4fBjIy7jo63lZWvoKCioaGgoaGho6OjpaWlpaWloKCqk5O1hobAgYHEgoLEg4PFg4PFiIi/jIy7 - jo66jo65j4+4lZWyoKCmo6OioqKjoqKhoKCimZmpj4+3hYXDg4PGhITFhITFhITFg4PEh4e+jo61kpKv - k5OsmpqmoaGipKSkpKSlpKSlpKSloaGlm5uqkZG2h4fChITGhITEg4PFhITFhITFhITGhobHjY3Ampqy - oKCspKSnpaWlpaWmpqanpqanpqanpqanpaWmpaWlpKSlo6OkpaWlpqanpqanpqanpqampaWlpaWlpaWl - pKSko6OkpKSkpaWlpaWlpaWlpKSko6Oko6Oko6Oko6OkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpqanpqan - pqanpqampaWlo6OkpaWlpqampqanpqanpqanpqanpqanpqanpqampaWlpaWlpaWlpKSkoKCmlJSyi4u9 - i4u9i4u9ioq6iYm5hoa3hoa3iYm6iYm6iYm6iYm7jIy6jY27j4+7lpayoqKlpKSjnZ2nlJSvkJCzjY2z - gYHDgIDCf3/ChIS8jIyzkJCwkpK0jY27jIy8jIy9jo66lJSxnZ2omJivj4+6i4u/i4u+iYm/goLEgIDD - f3/Cf3/CgYHEg4PFhITFhITGg4PIjY29np6spqakoqKmoaGlm5uqmpqrm5upmJiskJCxjY2vjY2vkJCv - jo62iYnAh4fGh4fFhobGkZG7oKCspqajo6OloqKkm5uqk5OwkJCxjY20hoa9gYHDgIDBgYHCgYHFhYXC - j4+3mpqpmZmqmJiqnp6lo6OhoKClmpqtmpqsmZmqmZmolJStj4+wjIyvgYG9gYHBgoLEg4PFg4PGhITE - jIy7l5etn5+ko6Ojo6Oko6Oko6OkoKCkl5eujIy4h4e6hoa4hoa3hYW5h4e7iYm9i4u9jIy9jIy9jIy+ - kJC3nJyopaWhoqKlmpqtjo68jY29h4fDg4PHgoLFgYHChoa3iIi3g4O+gYHCgoLDhITDi4u9l5euoKCk - o6OioqKjoqKjo6Oko6OkpKSlpaWlpaWlpaWmpaWmpaWmo6OkpKSkpaWlpaWlpaWlIACjo6Sjo6Sjo6Sj - o6Sjo6OioqKioqKkpKOfn6eWlrGRkbiRkbiNjbyFhcODg8WDg8WCgsaFhcSRkbaYmK2cnKmgoKakpKSl - paWlpaWlpaWnp6OdnayQkLiLi7uKiruKiruEhMGBgcWBgcWBgcWBgcWGhr+OjreSkrObm6ulpaOlpaWl - paWlpaWkpKWjo6OhoaKenqaZmayPj7mGhsKDg8WDg8aEhMWIiL2IiL2IiL6GhsCLi7qZmamhoaGgoKCf - n5+fn5+goJ+fn6SVlbCQkLaIiMGDg8WEhMaFhceFhceEhMiKisCNjb2NjbuRkbSZmayhoaOjo6Sjo6Sk - pKWnp6elpaiZmbOKisCEhMaFhcaEhMWCgsWCgsWBgceHh8GMjL2Li72OjriamqigoKKhoaGhoaGhoaGj - o6Kmpqabm6+MjL6EhMWCgsWBgcaDg8WIiL+KiryKiryKir2Li72Ojrmbm6qhoaSioqOioqOjo6KgoKST - k7KFhcKBgceCgseFhcOKiruJibyKiruJibyNjbeTk6+ZmaeenqCgoKChoaKjo6SlpaWjo6adnauXl6+R - kbWIiMCDg8eCgsSBgcODg8WEhMWDg8eGhsSSkrigoKylpaelpaalpaalpaWlpaWmpqempqempqempqem - pqalpaWlpaWjo6SlpaWmpqampqempqempqelpaWlpaWlpaWkpKSjo6Sjo6SlpaWlpaWlpaWkpKSjo6Sj - o6Sjo6Sjo6SlpaWlpaWlpaWlpaWlpaWlpaWlpaWmpqampqempqempqelpaWjo6SkpKSmpqampqempqem - pqempqempqekpKWjo6SlpaWlpaWlpaWlpaKZma2Pj7eRkbWRkbSRkbOLi7iHh7iHh7iHh7mJibqJibmE - hMGDg8SDg8WHh8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uZiYrpmZrJeXsJycrKSko6OjpKOjpKKioqKi - oqOjo6OjpKOjpKWlpaWlpaWlpaWlpaWlpaSkpCAApaWlpKSkoqKjoqKjoqKjoqKjoKClm5uqlZWwjo64 - ioq9ioq7ioq9hITFg4PGg4PGhobDj4+4nJyooaGioqKioqKjoqKjoqKjoaGhoKCklZWyjY29iYnCg4PH - hYXGhITGhITGhITGhITGh4fDk5O3n5+qoqKkoqKhoaGhoaGhoaGhoaGho6Ohnp6mm5uqmZmtkpK2jIy9 - jIy9ioq+iIi/iIi+iYm/i4u8jIy6kpKznJynoqKgoaGhoKCgoaGhoqKgnZ2llZWujo63h4e+g4PDg4PD - hYXEhYXGhYXHhITHiorAkpK4mpqwoqKopqakpaWlpKSlpKSlo6OjoaGjnJypk5OzjIy+hobEhITGhITG - hITGg4PFhobFi4u/k5O3mpqun5+loqKgoqKioqKjoqKjo6Ojn5+mlJSviYm9i4u8ioq7iYm6ioq7i4u9 - jIy9jIy+i4u/jo68mZmwo6OkoqKioaGhoaGho6Ogm5upjo64iYm/ioq+hITFg4PGhYXFhYXFhYXFhITG - hYXGjo67mpqqoaGfoKCgoaGhoaGhoaGhoaGhnp6il5eokZGvhoa/hITFhITFg4PGhobEjo67jo66kpK3 - mJixoaGppKSjoaGhoqKioqKjo6OkpaWmpaWmpaWmpaWmpaWmpaWlpqampqanpqanpqanpqanpqamo6Oj - oqKio6OkpaWlpqanpqanpqanpqampaWlo6Oko6Oko6Oko6OkpKSkpaWlpaWlpaWlo6OkpKSlpaWlpaWl - paWlo6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6Oko6OkpaWlpqampqanpqanpqanpqan - paWlo6OkpaWko6OmnJysl5ezlJSzjo67hITCf3/EgYHCgIDBgYHCiYm8i4u6ioq7ioq9jIy8lJSym5ur - oaGjoqKjmJivjIy9jIy9jY28hobDgoLEgYHBgYG/iIi4ioq8i4u+jIy+jo68kZG5kJC6l5eznZ2smZmv - j4+5ioq+jIy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aWlpaWlpaWlpaWlpaSkpKOjpKSkpKWlpaWlpaampJubsIuLwYODyISExYODxYKCw4GBwoGB - woGBwoGBw4GBw4KCxYmJwJSUtZ2dqqKipKKipJqaqpWVso+PuoeHwoODxoSExYGBw4CAwYGBw4ODxYOD - xYODxYODxYqKvouLv5aWtaGhqZycro6OvIWFxYODxoKCxICAwn9/wX9/wYGBwoGBxIeHwY+PuZKStZGR - tpKSt5eXsaKip6OjppeXsomJv4ODxYKCxIGBw4CAw4ODwIiIt4yMsYiIuIqKvYuLvYuLvo6OvJaWs52d - q6Kio6CgpJqarJSUsZWVsJWVsYyMt4eHuoaGuYWFuIWFuIeHuYmJuomJuoqKvZCQvJqasqCgrKWlpqSk - p52dr5iYtZmZs5SUtoaGw4GBxYCAw4CAwoGBwoKCxIiIwYeHw4aGxIWFxYiIwpWVs6KipqSko6OjpJ+f - p5iYr5OTto+PuY2Nu4aGwoGBxYCAwX9/wYCAwYGBxIeHwI2NvI2NvY6OvJSUtaKiqKWlop+fpZWVsYuL - vYyMvIuLu4qKuoiIt4SEun9/woCAwYCAwoCAxIWFv4qKvIyMvpaWt6Skqaenpqamp6amp6amp6amp6am - p6WlpaWlpqamp6amp6ampyAApaWmpqaloqKnlpayioq/hITFg4PEg4PEg4PEhITDhobChobChobDj4+4 - nJyooqKhoqKjo6OkpKSlpKSlpaWkoaGlmJirkpKykpK0i4u8hYXDg4PGhITFhYXEh4fCioq+kJC4nZ2r - pKSjo6Oko6OkpaWlpaWlpaWlpqako6Olmpqtjo67jY28h4fBg4PGg4PGhITGg4PHi4u9jo65jo65lZWv - oKChoaGhoaGhoqKioqKioaGjnZ2olpaujo62jIy4h4e+goLEgoLEgYHEgoLEgoLDgYHEioq8mJisoaGh - oqKioqKioqKioaGioaGgoqKinZ2rl5exkJC5jIy9ioq9ioq+ioq+ioq+ioq9iIi+jY23mpqnoKCgoaGh - oqKio6Ojo6Oko6Okn5+nkJC2jIy7jY27ioq/hITFhITFhITFgoLIi4u8lJSv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pKOjpKOj - o6KioqKioqSkpKWlpaWlpaWlpaWlpaWlpaWlpaWlpaampqamp6amp6ampqampaSkpKSkpKWlpaWlpaWl - paSkpaOjpaOjpKOjpKSkpKWlpaWlpaWlpaWlpaSkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaSkpaOjpKSko5qarY2Nu4aGxISExoSEx4SExYKCw4CAwoCAwoGBw4GBw4GBwoaGvIiIuI+PtJub - rKSko6OjpJmZr5SUtJWVsJCQs4ODwYCAxICAw39/w4KCwYmJvo2NvYyMvY2NvYyMvo+PupiYr6Cgp52d - ro+PvYmJxIaGw4aGwYaGv4eHuoiIt4aGu4SEwYSExIaGw4mJv4+PuJGRtZubq6SkpKOjpp2drJeXs5SU - s5WVspGRsomJt4ODwH9/wn9/woKCv4eHu4uLu4qKvYuLvo2NvZmZr6OjpqSkpJqaq42NuouLvYyMvYqK - voSEwYCAw35+woCAw4GBxISExoWFyIWFxomJwo+Pu5qasaWlpqGhq5GRvIWFyISEyISEyIODyISExIWF - voODvIKCwYKCw4KCxoaGxYyMwI6OvJCQup2dqqOjpKSko6OjpJycqo6OuoSExYODx4KCxoCAxYGBwYOD - uoKCuoCAwYKCxYODxYODxYWFxI6OupycrKOjpaWlpKKippycrJWVsYmJvIGBw4CAxIGBwn9/wX9/wYCA - woGBxYWFxIiIwo2NvZycraSkpqWlpaamp6amp6amp6amp6amp6amp6amp6amp6WlpqWlpiAAoaGml5e0 - iIjEg4PJhYXHhYXGhYXEhYXChYXDhYXDiIi9kZGznJynoaGjoqKioqKioqKioaGhoqKio6OjmZmvkpK3 - jY29hobFhITHhYXIhYXIhobHjIzBlJS3lpawnJyqoaGkoqKioqKjo6Oko6Oko6Oko6Ojo6OlmZmxjIy/ - iIjDhITIhITHgoLGgoLDiYm/jY28jIy+jY27kpK2nZ2ppKSgoqKioqKioaGhoaGhoKCimpqpj4+2h4fB - goLGgoLGgoLFhITFhITFg4PGhobCjY25lJSwnJyno6OgoKCg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KCp - pqajoaGolpazjY29g4PFgIDGgYHEgIDCf3/Bf3/BgIDDhYXCioq/jo67lZW0n5+ppaWkpqakpaWlpqan - pqanpqanpqanpqanpqanpqanpqanpaWmIACXl62NjbyGhsaEhMiFhceFhceFhcOFhcKFhcKIiL2QkLSY - mKmdnaKhoaKioqKioqKioqKioqKgoKKenqaUlLKLi7+FhcaEhMeEhMaFhceEhMmJicORkbuVlbeZmbKg - oKiioqSioqOioqOioqOjo6Sjo6SkpKOhoaWZma+Li76CgsiEhMaEhMaDg8SHh76Li7qKir2NjbuTk7Wb - m62hoaajo6OioqKioqKioqKioqGhoaKXl6yJibyEhMSDg8WDg8WEhMWEhMWEhMWHh8KPj7iVlbKbm6mf - n6KhoaGhoaGgoKChoaGioqCfn6SYmKyTk7SSkrSLi7uJibyKiruHh7+EhMOFhcOEhMSQkLabm6qfn6Wi - oqGhoaGhoaGgoKChoZ+enqKTk6+IiMGDg8eDg8eDg8aDg8aFhcGKirmKiriOjrSVla+enqekpKGioqOh - oaKhoZ+bm6aSkrCNjbeJibyKiruJibyFhcODg8aDg8WEhMSMjLyQkLeXl66fn6Sjo5+hoaGioqKioqKj - o6GgoKSbm6uSkrSJibyFhcCFhcWFhcaFhcWEhMWEhMWEhMSEhMOPj7ednaijo6ChoaGhoaGioqKjo6Ok - pKSjo6Sjo6Sjo6SkpKWlpaampqempqempqejo6WkpKWlpaWlpaWlpaWlpaWjo6SkpKWlpaWlpaWkpKWj - o6Sjo6Sjo6SioqOioqKjo6OkpKSlpaWlpaWlpaWlpaWlpaWlpaWkpKSlpaampqempqempqalpaWlpaWl - paWlpaWlpaWlpaWlpaWlpaWjo6Sjo6SkpKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaWlpaWlpaWlpaWjo6SioqWenqmUlLSIiMCCgsaDg8WBgcSBgcKAgMF/f8GBgcOCgsGHh7uRka6Z - maKenp2goKGioqSlpaKfn6iWlrOTk7eSkrWKirqIiLmGhraHh7iIiLuJibyKir6Kir2QkLqTk7ebm6+l - paSjo6KenqWcnKibm6qUlLKLi7uGhr2BgcCAgL+Cgr+Ghr2MjLiSkrSUlLKcnKqcnKmfn6aioqOdnamY - mK6VlbOMjLyDg8N/f8SAgMCBgb6FhbqHh7uIiL2IiL2IiL2Jib6Hh8GTk7ShoaelpaSfn6qSkriKir2F - hcKCgsWAgMWAgMN/f8KAgMGBgcODg8aFhcaJicONjb6Njb6Tk7egoKqmpqOjo6acnK+Pj7yOjruOjriG - hrx/f8KAgMKAgMGBgcCGhruEhL+BgceEhMiIiMSRkbqenqukpKOkpKOioqScnKqPj7qNjbyOjrqMjLqH - h75/f8OAgMGBgcKBgcKDg8OEhMSFhcSFhcSKir6YmLGkpKWhoaiSkreEhMaDg8aCgsWCgsWBgcOAgMKA - gMKBgcGIiLyKiruRkbaenqiioqWjo6ejo6ekpKampqampqempqempqempqempqempqempqempqcgAJGR - toeHwoSExoWFxoWFxoaGxYWFw4SExIeHwI6Ot5SUr5iYq52do6CgoaKioqKioqKioqGho52dp5WVroqK - vYSExoSExoSExoSExoWFx4SEx4mJwo6Ov4+PvpWVuKGhqqOjpaOjo6Kio6Kio6Kio6OjpKKipZycqpaW - sY6OuoSExoWFxYWFxYiIvYmJuImJuouLuZKStJqaraKipaSko6OjpKOjpKKioqKioqOjop2dppOTsYyM - uouLuoSEw4ODxYSExYSExYeHwo+Pt5WVsZmZq6CgpaOjoaGhoaGhoaGhoaCgoKGhoJ6epJaWrZGRtZCQ - toyMu4uLvYiIwoSExoWFxISEwoiIvpWVsKCgpKSkoKKioqKioqGhoaGhoaGhn5ubpoyMtoODw4ODw4OD - w4KCxIaGwIuLuYqKuo2Nt4yMtpCQspubqaOjoqKio6Kio6OjoJiYqYyMt4mJvIqKu4mJvIODxIODxoSE - xYSExYSExYKCxoiIv5aWr6CgpKKioaGhoaGhoaKioqOjoaCgpZmZrJGRtoiIwoWFxIWFxYWFxYWFxYWF - xYSExYaGwouLvJeXrqGho6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a5hoa3hYW4gIDAgIDCgIDEhoa+k5OxkpKzlJS1mpqwoqKopaWko6OjoKClkpK0kZG2j4+5 - iYnBhITFgoLDgYHBgIDAgIDAgYHAgoLBg4PChYXDhITGjY27nJyqpaWho6Onlpa0h4fEhITHhYXGg4PF - goLCiIi5hoa4i4uwlZWqmpqpmpqqmpqqm5usmpqtoKCopqakpaWlpaWlpqanpqanpqanpqanpqanpqan - IACMjLuIiL+FhcKEhMSEhMWEhMWEhMWDg8eFhcOOjreamqmhoaGhoaGhoaGhoaGhoaGioqGfn6aSkrSL - i7yKir2Hh8GCgsWDg8SEhMWEhMaIiMKNjb6UlLeenq2lpaimpqempqempqakpKSjo6SioqOioqKdnamW - lrCQkLiMjL2Li72Li72MjL2Li76OjrqTk7SSkrORkbGdnaKioqGjo6Sjo6Sjo6Sjo6Sjo6OamqyPj7iK - ir2Li7yKiruKir2Kir2Kir+OjruTk7OTk7OSkrSenqajo6GioqKioqKioqKhoaGioqCfn6KXl6uOjrSK - irqNjbyIiMKGhsWGhsWHh8SKisKKisKSkrSZmaefn6GioqGioqKioqKioqKhoaOWlq+MjLqMjLmNjbeQ - kLONjbeHh7+Dg8SEhMOEhMOFhcGOjrabm6agoJ6fn6ChoaKioqOenqeWlrCPj7eJibyDg8OCgsODg8WC - gsWCgsWCgsWDg8aGhsSSkrSenqSjo6CioqKioqKioqKioqCbm6eRkbWIiMKEhMWFhcSEhMWEhMWEhMWE - hMWHh8ONjbuTk7eamrGioqmmpqWlpaWjo6OioqKioqKioqKioqOkpKSlpaWlpaWlpaWlpaWkpKSjo6Sl - paWmpqempqempqekpKWjo6SlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWkpKSjo6Sjo6SlpaWl - paWlpaWlpaWlpaWlpaWlpaWkpKSioqKioqOkpKWmpqempqempqelpaWlpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaWkpKWjo6SlpaWlpaWlpaWlpaWlpaampqempqempqelpaalpaWlpaWlpaWlpaWlpaWmpqShoaeU - lLKIiMGEhMWDg8WCgsSAgMWAgMGGhraOjq2Pj66QkK+NjbSLi7iLi7mMjLeYmKidnZ2amqOZmaebm6WY - mKmMjLmHh72EhL2Dg72EhLyJibuJibuKiruHh7+GhsKGhsSKisCYmLCfn6iUlLaLi76Li72Li7yKiruI - iLiIiLWEhLyBgcKCgsOEhMSKiryKiryKir6Tk7Sfn6aioqOZmayamqyUlLCOjreHh72BgcKBgcKAgMGB - gcGCgsOCgsWDg8WJib2RkbKTk7GXl6yenqWjo6Ofn6eTk7aHh8OEhMeEhMaCgsSBgcJ/f8KFhb2JibqN - jbqMjL+GhsaGhsWEhMePj7yfn6ulpaWenqqcnKiamquamqqVla6NjbWGhrmAgL9/f8F/f8OEhL+KirmM - jLmLi7uLi7yXl7Kjo6enp6SlpaShoaWTk7OMjLuLi7yHh8CCgsWCgsOBgcGBgcCBgcCBgcCCgsGDg8KD - g8OHh7+Rkbabm6uioqOhoaWUlLSMjL+Li8GLi8CJib+Hh72IiLqMjK+KirOKireMjLiOjreVlbGamqqd - naienqihoaempqWlpaWlpaWmpqampqempqempqempqcgAIeHwYWFw4SExYSExYSExYSExYODxoaGw5CQ - t5ubqaGhoaGhoaGhoaGhoaGhoaGhoaGhoZycppGRto2NuomJwIODw4GBw4ODxYODxoeHwYyMvZWVtZ6e - rKSkpqampaamp6amp6amp6WlpqOjpaKipKOjop6epZKSsoqKvIqKvYqKu4qKvIuLvY6Ou5GRuJKSt5GR - t5SUsZ6eoqCgn6Kio6OjpKOjpKOjpJ+fqZKSt4uLvYqKvIqKu4yMu4eHwYaGwoWFw4mJvo+Pt5CQt5OT - s5+fpqOjoaKioqKioqKioqKioZ6eo5eXq4+PtYqKuomJuoaGwoSExoSEx4eHxYuLwY2Nv5KSup2drKCg - pKCgoKCgoKGhoaKioqKioqCgpJeXrpGRtJOTsZCQso+Pt4mJv4SExYODx4ODxoODxYiIwJOTr52doqGh - n6CgoJ+fn6CgpJaWsJCQuYqKvoSExIODx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aGhoaGhoaGhoaGgnp6i - kpKziYm+g4PEgYHEgoLDhITEh4fAjY25lJSympqsoaGnp6ekpaWlpaWmpqanpqanpqanpqalpaWkoKCm - lpawjIy6iYm9ioq8ioq8ioq8jIy+j4+8j4+7jY29jo65mpqtoaGjoaGgoKCgoqKio6Oko6OknZ2pj4+5 - ioq/jIy8ioq8h4fBgoLGgoLGgoLGhITFiIjAj4+5mZmsoKCjo6OhoqKioqKioqKioqKil5etjY23ioq6 - iYm8hITBgoLGg4PGhITGh4fFiIjEiIjDlJS1oqKopaWko6OioKCgoKCgoqKioqKinZ2ompqsmJiulJSx - j4+2h4fBhITGhITGhITFhYXEioq+k5OznJymoKCgoKCgoKCgn5+fnp6hkpKyiYnAhITGg4PGhITFgoLF - gYHEgoLFgYHGhITDjY24mZmpoKCkoqKioqKhoaGhoaGhoqKinZ2olJSzioq9hYXBh4e/iIi/iYm/iorA - iorAi4u+jIy9jIy+mpqupKSlpqakpaWmpaWmpaWmpKSloqKkoqKioqKjo6OkpKSkpaWlpaWlpaWlpaWl - paWlpKSkpKSkpqampqanp6eop6eopaWmpKSkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaWlpaWlpaWlpaWlpaWlpaWlpqampqaopqaopqampaWmpaWmpqanpqanpqampqalpaWlpaWlpaWl - paWlpaWlpaWlpaWlpaWlpKSkpKSkpaWlpaWlpaWlpaWlpaWmpqanpqanpqanpqampaWlpaWlpaWlpaWl - paWhnJyojo66hYXEhobDhobEjIy4jIyyhIS7f3/Ef3/Cf3/Eg4PBhYXAiIi+kJCynp6joaGfoaGdm5uh - j4+vhIS+hIS+hYW9hoa8hoa5hoa3h4e4hYW8hITBhITChYXAioq8k5OznJyqoqKkmpquj4+7jIy/jIy9 - jIy8iIjAgYHEf3/EgYG/hoa7i4u5i4u6jY28jIy9kZG3mpqsn5+mo6OimZmti4u+g4PHgYHHgYHDgIDC - f3/Cf3/CgoLAh4e8ioq6ioq7ioq8ioq/kpK3nJysoaGmoqKimJiviorAhYXGhobEh4fDiIjAioq6iYm3 - hoa6hITBg4PGhITGiIjCj4+7j4+7mJiypKSmpqalpqalmpqtkJC3i4u9iYm/hobBhYW+g4O8hoa4iYm5 - iYm7ioq7i4u7i4u9j4+2lpauoKCopqakpqalo6OonZ2qnJypmZmrkJC1hobAhYW+goLAgIDBgYHBhYXB - ioq+jIy6iYm9j4+1mJisn5+loqKjmZmrkJC3jY26jo65kJC2kZGyjIyzh4e3h4e3hoa6hYW/hobBh4fB - jY26kpK1mZmsoKClpKSkpKSkpaWlpaWlpaWmpaWmpaWmpqamIACEhMWEhMWEhMWEhMaEhMaIiMGOjriT - k7KXl66enqajo6GhoaGhoaGhoaGhoaGioqCioqCdnaWPj7WDg8KBgcSDg8SCgsaDg8SLi7uRkbOXl62X - l66cnKulpaOlpaWlpaWmpqampqempqempqejo6ibm62NjbyKir6Li7uKiruMjLyMjL2Njb2Njb6MjL+O - jryVlbSgoKajo6OioqKgoKCgoKChoaKioqSenqmUlLWOjryLi76GhsGCgsaDg8WDg8WDg8aEhMaHh8CU - lLOfn6SioqKioqKioqKioqKioqKhoaOXl6+QkLaLi7uFhcKCgsaDg8WEhMSFhcSEhMaFhcaMjL+VlbWj - o6empqSkpKWioqOgoKCgoKCdnaaamqyYmK6VlbGOjrmHh8CCgsaDg8aEhMWFhcSJib+QkLednaiioqKh - oaCgoKCgoKChoaCdnaKUlK2KiruFhcSDg8aDg8WCgsWCgsWCgsWCgsWFhcKPj7abm6ehoaGioqGioqKi - oqKhoaGioqGcnKqWlrCTk7KRkbSOjreMjLyNjbyNjbyMjLyLi72Njb2UlLaenqmjo6WlpaWlpaWlpaal - paalpaakpKWjo6SioqOkpKSlpaWlpaWlpaWlpaWlpaWlpaWlpaWkpKSkpKSlpaWlpaalpaalpaajo6Sk - pKWkpKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWmpqam - pqempq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CwICAw4KCxIOD - xYODxYiIvomJv4uLvZWVsaCgpaOjpKOjpKSkpaWlpaWlpaWlpaOjpCAAhITFhYXGhITHiYnCjY28i4u+ - i4u+j4+4nJyno6OgoqKioqKioqKioaGhoqKgnp6kk5OwiIi+iIi9hITEg4PGg4PFh4fBjo65k5OzlJSz - lJSzmJitnp6lo6OioqKjpaWlpaWlpaWlpqalpaWooKCsmpqzlZW3j4+7jIy9iIjAg4PGg4PGg4PGiYm/ - lZWzoaGop6elpaWlo6Oko6Oko6OjoqKioaGgn5+gk5OxjIy8hYXCgYHFgoLEgoLFg4PEg4PFiIjAj4+4 - mJiuo6OgoqKioqKioqKioqKioqKioaGjmpqqkpKwhobAgIDHg4PEhITGhYXFhYXFhITFi4u9lZWympqu - oqKopaWlpaWlpaWlpaWlpaWloqKjm5umlJStjIy0hYW+gYHFgoLCgoLCg4PBh4e9jo64lJSym5urn5+m - oqKioqKioqKhoKCimZmnk5OvjY23hITBgIDFgoLDg4PEhITFhITFg4PGhobBkZGznZ2loaGhoaGhoaGh - oqKioqKioqKioKClmpqpmZmrlZWwjo65ioq/i4u9jIy9jIy9jIy+kJC5mZmuoKCno6Oko6Oko6OkpKSk - paWlpaWlpaWmpaWmpaWmpKSlo6Oko6OkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpqampqanpqanpqan - o6OkoqKioqKjpaWmpqanpqanpqanpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaWlpaWmpqanpqanpqanpaWlpKSko6Oko6Oko6Oko6OkpaWlpqampqanpqanpqanpaWlpaWlpaWl - pKSlo6Oko6Oko6OkpaWlpaWlpqampqanpqanpqanpaWlpKSkoqKjo6OhoKCkl5eskJCxhYXBgYHEgoLC - gYHCgIDBf3/Bf3/Bhoa8ioq6iYm8iYm8ioq7lZWunp6joKCfnJyjlparj4+xioq0iIi3hIS8gIC+gYG9 - gYG9gYHBgYHEgYHGiIi/lJSylJSyk5OzoK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SkpKWlpaWlpaWlpaSkpKKio52dqZSUsoWFwoKCxoODxYODxYODxYODxYKCx4eHv4+P - tZaWrpycqaKioqKioqKioqKioqKioqGho5ubqo+PuYeHwYODxIKCxYKCxYKCxYODxYODx4iIwZCQuJiY - r52dqKKio6OjpKSkpaWlpaampKWlpZ+fq5iYs5OTtI2Nt4mJuomJuYmJuYmJuYuLto+Ps5OTr5iYqZ6e - pKKioqKioqKioqKioqGhopycp5KSsYWFwYKCxYODxIODxIODxISExYSExYODxYuLupmZqaKioKGhoaGh - oaGhoaKioJ+fo5mZqZmZrJqaq5eXr4uLvISExoeHxIaGxYaGxoqKwIyMvZCQt5ubraKipKOjpKOjpKOj - pKOjpKOjpKWlpaWlpaWlpaWlpqWlpqWlpqWlpqOjpKOjpKSkpaWlpaWlpaWlpaWlpaWlpaWlpaampqam - p6amp6amp6amp6SkpaSkpKampqamp6amp6amp6amp6WlpqWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaWlpaWlpaSkpKOjpKWlpaamp6amp6amp6ampqWlpaWlpaWlpaOjpKOjpKOjpKSkpaamp6amp6am - p6WlpqWlpaWlpaWlpaOjpKOjpKOjpKSkpaWlpaWlpaamp6amp6amp6ampqWlpKCgppKSsoaGwoGBxYGB - xYGBxYCAxYCAwoaGu4aGtoODvoSExIaGxYaGxYaGxYiIw5KSt5+fpqGhoZeXqpCQs5GRsouLtoWFu4KC - v4CAwH9/wX9/woSEvIiIuoqKu4qKu42NupeXrp6eppqaq5WVspWVsJWVsY2Nu4aGwoKCxIGBwoCAwoGB - w4eHvIyMu4mJvoeHwYaGwomJwJaWsKKipaSkpJycq5OTso6OtImJuomJuIKCvX9/wX9/wYCAwoCAw4SE - vZCQspeXrJiYrZiYrZmZrqSkpaCgqZ6eq5mZr5GRs4+PsIuLt4ODvYCAwYCAwYGBwYGBwoODxImJvYmJ - u42NuZqar6ampKWlpZ2drZaWtJWVtpSUuI6OvYmJwIODwn9/wX9/wYCAwoKCxISExYWFxYmJw5SUtqCg - qKamo6SkpaKioqKioZubqJOTsI+PtIqKuYODv4GBwoCAwoCAwYGBwYGBwoKCxYeHvomJu4qKvI6OuZaW - sKKioqGhoZ2dpZSUsYmJvoSExIKCxIGBw4CAwn9/wYCAwYGBwoKCxIKCxoiIwIqKvZCQt52dqaGhpKKi - oqOjo6OjpKOjpKOjpKOjpCAAhobEhYXGhYXGhITGhYXGi4vBlpa0oKCpo6Oko6Ojo6OioqKhoaGhoaGj - l5euioq+g4PGg4PGgoLEhITFhITFhITGg4PGhITFiYm/k5OynJyooaGjoqKjoqKjoqKioaGhoaGipKSi - oqKmmpqxj4+8iorChobGhYXHhITHhYXEioq9jo64jIy7kJC0m5upo6OioqKjpKSkpaWlpqalpKSmn5+p - mJiwjY27ioq9hYXCgoLFg4PFg4PFgoLGh4e/iIi9jY24mJisoqKhoqKioqKioqKioqKioqKinJyokJC2 - iIi/hITEgYHEgYHEgoLFgoLFgoLFgYHHi4u/mJixoKCooqKjoqKjoqKjo6OkpaWkpKSmnZ2tl5ezl5e1 - kpK5jIy6iYm6iYm5iYm5jIy2jo60jo61j4+zlpaqn5+goqKioqKio6OhoqKinZ2nl5eulJSxh4fAgYHF - goLDgoLDg4PEhITEhYXEi4u7lZWvnZ2loqKgoaGhoaGhoaGhoaGhnZ2kmJirmZmql5esi4u6hITEgoLG - g4PFhYXGhITHi4vAk5O2m5usoqKlo6Oko6Oko6Oko6Oko6Oko6OkpKSkpaWlpaWlpaWlpaWlpaWmpaWm - pKSmo6Oko6OkpaWkpaWlpaWlpaWlpaWlo6OkpKSlpqanpqanpqanpqanpaWmpaWlpaWlpaWmpqanpqan - pqanpqanpqampaWlpaWlpaWlpaWlpKSkpKSkpaWlpaWlpaWlpaWlpaWlpaWlpKSlo6OkpaWmpqanpqan - pqanpqampaWlpaWlpKSlo6Oko6Oko6OkpKSlpqanpqanpqampqalpaWlpaWlpKSlo6Oko6Oko6OkpKSk - paWlpaWmpqanpqanpqanpqaloqKmmpqrk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g8SEhMSGhsKIiL+UlLGenqWhoaKhoaGh - oaGhoaGhoaGgoKGcnKWYmKqWlqyLi7mDg8OCgsWDg8SCgsSEhMWEhMeOjr6dna+lpaWlpaSjo6Sjo6Sj - o6Sjo6Sjo6Sjo6Sjo6SkpKSlpaWlpaWlpaWlpaWlpaWlpaakpKWjo6Sjo6SkpKSlpaWlpaWlpaWkpKSk - pKSlpaWmpqampqempqempqempqempqalpaWlpaampqempqempqempqempqalpaWlpaWlpaWkpKSjo6Sk - pKSlpaWlpaWlpaWlpaWlpaWlpaWkpKSlpaWlpaampqempqempqempqalpaWlpaWlpaWjo6SioqOjo6Sk - pKampqempqempqempqalpaWlpaWioqOioqOioqSjo6SkpKSlpaWlpaampqempqempqelpaahoaWfn6aR - kbOMjLaOjrONjbSJibmEhL6BgcGBgcOCgsWDg8WGhsOLi7+QkLmYmLGgoKmjo6ShoaWVla6Hh72CgsSB - gcWAgMWBgcKEhL2FhbeHh7mKirqJibyGhr+Ghr+FhcGRkbWdnaehoaOamquNjbyHh8CGhsCGhr6Fhb6F - hbuHh7eHh72FhcCFhcKHh8GLi72RkbeVlbOfn6ijo6ShoaWenqmXl7CLi7yBgcSAgMV/f8OAgMCEhLqK - iraMjLqMjLmOjriTk7Kbm6igoKOioqGjo6Knp6OgoKuQkLqHh8OCgsWBgcOAgMGAgMGBgcOCgsSEhMaI - iMSJicOGhsSJib+VlbGhoaampqOdna2QkLuJicKHh8KFhcOFhb2BgcB+fsGAgMGBgcOCgseMjL6UlLaZ - mbGYmLKamrCmpqSkpKWjo6WkpKCcnKaMjLuBgciDg8SCgsOCgsKAgMKAgMGFhbyKirmLi7uLi72NjbqO - jriQkLaenqiioqKhoaKZmaqOjraEhMGCgsSBgcOAgMJ/f8F/f8KBgcKGhr+Li7yMjL2MjL2Li76QkLef - n6WioqKioqKioqKioqSjo6Sjo6QgAISExYSExYWFxIqKv5OTtpubraGhp6SkpaWlpaWlpaSkpKOjpKGh - pZWVsI6Ot4uLvIeHwIGBxYKCxIKCxIKCxYSExImJv5KStZubp6GhoaKioaKio6Kio6Kio6Kio6Kio6Ki - oZ2dppOTsomJv4SExoSExoeHw4SEw4GBxIGBxIGBxoKCxZCQtZ+fpKOjn6GhoaKioqKio6KipKSkpKSk - ppubsY2Nv4mJwIWFxYSExoSExYODxYSExImJv42NuZKSspmZqZ+fo6GhoaGhoaKioqKioqOjoJ6ep4+P - t4ODxIODxYKCxYGBxIGBw4GBxIKCxYWFw4uLuY+PtZqaq6WloqOjpKOjpKKio6KioqCgpZycqpiYspKS - uIyMvYyMv4uLvYiIu4mJuYyMtoyMt4qKuI6OtJeXqJ6enp+fn5+fn6Cgn5+fo5mZq5KSs46OuYmJwIWF - xISExYWFxYWFxYaGw4qKvouLvJWVr5+fo6Kin6GhoaGhoaGhoaGhoaCgopubppWVrYuLuYKCxYGBxYKC - xIKCxIGBxIKCxYGBx46OvKCgqqioo6WlpaSkpKOjpKOjpKOjpKOjpKOjpKOjpKOjpKSkpaWlpaWlpaWl - paWlpaWlpaWlpaSkpKOjpKOjpKSkpaWlpaWlpaWlpaWlpaSkpKSkpKampqamp6amp6amp6amp6WlpqWl - paampqamp6amp6amp6amp6WlpqWlpaWlpaWlpKOjpKOjpKSkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl - paampqamp6amp6amp6WlpqWlpaWlpaSkpKKio6Kio6Kio6Skpaamp6amp6amp6WlpqSkpKKioqKioqKi - pKKipKOjpKSkpaWlpaampqampqamp6ampqSkpKamopubrJSUr5KSsIyMtoSEvYCAwoGBwoGBw4ODxYWF - womJvouLvZCQuZGRuJeXsqGhqKOjpZeXr4mJvYSEwYSEwYWFwoWFwIiIuIWFuIeHt4iIuoSEwIKCxYKC - xIODw4iIvZeXrZ2dp5OTs4mJv4uLuouLuYuLuImJuIeHuISEuoSEwIWFwYeHwIqKvpCQuJeXr5qaq52d - qaKipKGhppiYrpCQuIyMvYeHwoSEwYODwISEu4mJs4uLtomJuomJvIiIvo6Ot5qaqZ6epqCgpaGhoqWl - op+fq4+PvIODyIWFxoSExYKCw4GBwYGBwYGBw4ODxYSEx4SEx4SEx4uLv5eXr6KipKSko56eqZCQuIiI - woqKv4mJvoeHvIKCv39/wX5+woCAwoiIvZGRt5KSt5CQupCQupiYs6ampKSkpaSkpaWlo56ep4+PtoWF - xIODxYODxYKCxYCAwoODu4eHt4iIuYqKu4uLvIuLvYmJvouLu5iYraGho6OjoqCgpJaWrYiIvYKCxoGB - xYCAwn9/wn9/wYSEvIqKuIuLu4yMvYyMvoyMvpGRuJycqaKioqKioaKioqKioqOjo6OjpCAAh4fDhobE - i4u/kZG4lpa0mpqwoaGnpaWlpaWlpaWlpaWko6Okn5+pkJC3ioq+hYXDgYHHgoLFgoLEgoLDgoLDiIi9 - kJC1l5eunJynoaGioqKioqKioqKioqKjoqKjoqKjoqKkl5eviYm9hITEhobBhobBioq+hYXBgYHFgoLE - hYXBjIy2mJiqoKCioqKgoaGhoaGhoqKioqKjpKSioaGnlpa1iYnChITHhITGhITFhITFhITGhITHg4PH - kJC4mJisoKCioqKfoaGhoaGhoaGhoqKipKSgnZ2ojY26goLGg4PFgoLFgYHEgYHDgYHDhITBi4u5kZGy - lJSvnJynpKSho6Oko6Oko6OkpKSin5+mlpawjo64i4u8i4u9i4u9ioq8iIi6iIi5iYm4iYm5ioq5jo6z - l5eooKCdn5+fn5+fn5+dnZ2hmZmpkZG0iYm/hITFhYXEhYXEhYXEhobDiIjBioq+jIy8l5euoKCioqKg - oaGhoaGhoaGhoqKgnZ2llJSwi4u6gYHFgYHDgYHDgYHDgYHDgYHDgYHEg4PEjY27nZ2rpqajpaWlpaWl - o6Oko6Oko6Oko6Oko6Oko6Oko6Oko6OkpKSlpaWlpaWlpaWlpaWlpaWlpaWlpKSlo6Oko6OkpaWlpaWl - paWlpaWlpKSlo6OkpKSlpqanpqanpqanpqanpqanpaWlpaWlpqampqanpqanpqanpqanpaWlpaWlpaWl - pKSlo6Oko6OkpKSlpaWlpaWlpaWlpaWl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p6ampqam - pqampqampqWlpaWlpaOjpKOjpKSkpaWlpqamp6amp6amp6amp6amp6amp6ampqWlpaWlpaWlpqamp6am - p6amp6ampqWlpaSkpaOjpaOjpKOjpKOjpKOjpKOjpKOjpKOjpKOjpKOjpKOjpKSkpKWlpKWlpaWlpqam - p6amp6ampqWlpaOjpKSkpKampqamp6amp6amp6WlpaOjpKOjpKOjpKSkpKWlpaWlpaWlpaWlpaSkpKOj - pKOjpKOjo6KioqKioqKioqKio6OjpKOjpKOjpKOjpKOjpKOjpKOjpKSkpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaGhqZqar5GRuImJwIODxYGBxICAw39/wYWFu4SEvoWFwIWFw4eHwo2NuJubqqGho6SkoJ2dqI+P - uYWFxIiIwISExIGBxIGBwoCAwX9/wYGBwoGBw4GBxYaGv46OtZaWrpmZq5ubqpaWsY+Puo2NvY2NvIuL - u4aGv4KCwYGBwIGBwIGBw4GBw4KCxYaGwI6OuJGRt5eXsaWlo6SkpaKippmZr5GRtpCQtY+PtoWFwoCA - w4GBwYCAwoCAw4GBxYKCxoSExIeHw4iIwo+Pup2drKWlpZycrpubr5iYsY6OuYeHwYiIwIeHvoWFvYWF - uYeHt4mJuYqKvIyMvpGRvJmZtZ2dsKGhq6WlpZ+fpZ2dp52dp5ubqJSUsImJvISEwIGBwoCAwYGBwoKC - xISEw4uLvpSUtZaWspubraKip6Sko6Kio5+fppOTr5CQsZCQsY2NtYiIu4SEwYGBw4CAw4KCxISExoWF - xYuLwI2Nvo+PvJGRuJiYrqSkpKSkpJ2dqZOTsouLu4WFwoCAxICAw39/wn5+w4KCv4mJu46Ou46OvY+P - vZCQvZOTupycsKWlp6ampyAAoKCmoqKkoqKjoqKjoqKioqKin5+lmZmqkpKzjY27i4u/h4fChITGhITF - hITFg4PGg4PFiYm+lJSynp6noqKjoqKioqKioaGhoaGhoaGio6OhoaGknJypmJivk5O2kZG3kpK2kJC3 - jY25i4u8i4u8kJC4mJivnZ2noKCioaGhoaGho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6OnoqKjoqKhnZ2mj4+0goLDgIDEgYHCgIDBgIDCgYHEg4PEh4fBjIy9i4vAkJC6m5uuo6Olo6Oko6Oi - l5eukJCzjY20iYm4hITAgYHEgYHCgYHBgIDDg4PDiYm/iYnBiYnDh4fFjIzAl5exoqKjo6OknJyrlpay - j4+4iIi+hYW/hYW+hIS8g4O8hoa5i4u5jY29jY29i4vAi4vBiorCk5O6oaGrp6enIACjo6KioqOioqOi - oqOioqKioqKenqeXl66OjreJib6GhsKDg8aDg8WEhMWDg8aEhMWMjL2WlrCfn6eioqKioqKioqOioqOh - oaKhoaGhoaGgoKKamqeVla6SkrOPj7iPj7iPj7mNjbqMjLuNjbmQkLaVlbKamquhoaWjo6KhoaKhoaGh - oaGhoaGhoaGYmK6MjLyKir2Li7uKir+EhMSCgsaEhMWEhMaHh8GPj7eVla6dnaWkpKKkpKSlpaWlpaWm - pqSkpKednayXl7CQkLeJib2Dg8SCgsSCgsSCgsWCgsWFhcGNjbWVla2dnaejo6KioqOioqOioqKkpKGg - oKSWlq+MjLuHh76CgsGCgsSCgsaDg8aHh8KPj7qSkraVlbOZmayenqOgoJ+goKCgoKCenqKcnKeYmK+R - kbiIiMKDg8aDg8WEhMWEhMWEhMWGhsOLi76Tk7KcnKihoaOioqKioqKhoaChoaGkpKGdnauPj7yGhsSH - h8KHh8OLi76Li7uKiryNjb2QkLmWlrGcnKqgoKWjo6Ojo6SkpKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWm - pqampqempqempqempqekpKWlpaWlpaWlpaWlpaWlpaWmpqampqempqempqempqempqempqelpaalpaWl - paWlpaWmpqampqalpaalpaWlpaWlpaWkpKSjo6Sjo6Sjo6Sjo6Sjo6SkpKWlpaWlpaWkpKSkpKSkpKSl - paWlpaWmpqampqempqempqelpaWjo6SkpKSmpqampqampqempqelpaWkpKSjo6Sjo6SkpKWkpKWkpKWk - pKWjo6Sjo6Sjo6OioqKioqKioqOioqOioqOjo6Ojo6Ojo6Sjo6Sjo6Slp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kZG0jo63 - iYm6iIi6iIi2hoa5hIS/hYW+iYm9k5Oym5upnJyonZ2ooaGmpaWlnp6snZ2unJytkpK1hITDgIDGf3/D - gIC+hYW5iIi4iYm5ioq7i4u6jY23jIy3j4+0mpqooqKimZmskZG2kJC4kZG2jo65hYXBgYHEfn7Df3/A - hYW6ioq2ioq3jo60jo62kJC2mpqrpaWgo6Ojo6OkpKSjm5usjo65iIi/i4u8i4u7h4e/goLCgIDEgoLC - hoa+i4u7i4u8i4u8jIy7kJC2mJivo6OkpaWinJyskpK3jY28iYm/g4PFgYHCf3/BgIDBgYHCgoLBh4e+ - IACGhsaFhcWCgsOAgMOCgsWEhMaFhcONjbyZma2hoaOioqGhoaGhoaGhoaGhoaGhoaCenqSXl66RkbaP - j7mMjLuKirqJibmJibqKirqKirmPj7SWlq2amqicnKWhoaGhoaGioqKioqKioqKhoaOdnaeVlbCKir2D - g8WCgsaDg8WDg8aEhMOMjLqRkbSVlbGbm6qioqGioqKgoKCfn5+fn5+hoaCgoKKWlq2KirmEhMCEhMGH - h8GJicGNjb2MjL6Njb2SkriZmbCenqeioqGioqKioqKioqKioqKjo6KioqSZma+SkraMjL2FhcWCgseD - g8aCgsWDg8WDg8WCgsaHh76UlK2goKChoaCioqKjo6GgoKWamqyZma2QkLaGhsKDg8aEhMKGhr6MjLyL - i7yLi7yKir6NjbqXl62ioqGhoaGhoaGhoaGioqCgoKOZmauWlq6VlbKTk7SOjrqGhsGDg8SFhcWHh8SM - jL+UlLecnK+hoaijo6Ojo6Sjo6Sjo6WkpKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWkpKSjo6Sj - o6SkpKSmpqampqempqempqempqalpaWlpaWlpaWlpaWlpaWlpaWlpaWkpKSjo6Sjo6SkpKWlpaWlpaWl - paWkpKSjo6SkpKWlpaWlpaWlpaWlpaWkpKSjo6Sjo6WkpKWlpaWlpaWmpqampqempqempqempqelpaal - paWkpKSkpKSkpKWlpaWlpaWlpaWlpaWlpaWlp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ouLvomJwZGRtZycpaGhn6GhoaGhoaKioqOjoaKiopycqZGRs4mJuYSE - wYGBxIGBxYaGw42Nu5CQt4+Pt42NuZCQuJubrqamo6SkpaSkpaSkpaSkop6eppOTso6OuIyMu4qKvoeH - woODxYGBxIGBw4GBw4CAxouLvJqaqqOjoaKioqGhoaGhoaGhoZaWrYqKuomJvYiIvoODxIODxYODxIKC - xIKCxYGBxoqKupOTsJ2dpqKioqKioqKioqKioqKioqOjoJubqJCQtJGRs5KSso2NuIqKu4qKu4qKvIuL - vYuLvYyMu5WVrp6epKGhpKOjpaWlpqWlpqWlpqSkpaOjpKOjpKOjpKSkpaWlpqamp6amp6amp6WlpaWl - paWlpaWlpaWlpaWlpaWlpaWlpaampqamp6amp6amp6amp6amp6WlpaWlpaWlpaWlpaWlpaamp6amp6am - p6amp6WlpqSkpaOjpKWlpaWlpaWlpaSkpaOjpKOjpKWlpaWlpaWlpaWlpaWlpaOjpKKioqKio6SkpaWl - paWlpaamp6amp6amp6WlpqWlpaWlpaWlpaOjpKSkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaSkpaOjpKOj - pKWlpaWlpaampqamp6amp6amp6amp6amp6amp6amp6amp6amp6amp6WlpaWlpaWlpaWlpaWlpaWlpaWl - paOjpKSkpKWlpaWlpaWlpaOjpKOjpKOjpKOjpKOjpKOjpKKioqKioqKioqKioqKioqGho5mZq5mZrJqa - qpWVrI2Ns4eHuoaGuoWFuYeHuYWFvoODxYODyIKCyIWFxYSExo6OuZ2dqKOjopycqZGRtoiIwYODxIKC - xIKCxIGBw4CAwYCAwX9/w4ODwIiIu4qKuZCQspiYqpycp5qarJeXspiYsJiYr4yMvIqKv4iIvoODv39/ - wYCAwoKCxIKCxoiIwIyMuoyMupOTs6CgpaSkoZ+fppWVsYqKvoSExYKCx4GByIaGwImJt4aGt4ODwYGB - woODxISExoWFw4yMu5SUsJubqKKioqGhpJaWsYyMuo6OuIyMu4eHwoKCxICAxICAw4GBxYCAxoqKuJaW - rZyc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KSlo6OkpKSkpaWlpaWlpKSlo6Oko6Oko6Ok - oqKjoqKjoqKioqKioqKioqKioqKioqKin5+km5upl5etkJC0iYm5iYm5h4e5h4e2goK8gYHDgYHGgYHG - hITEhobFh4fEjY27mpqspKShoKClkZG1hYXEgoLHg4PEgoLEgoLEgYHCf3/Cg4O/iYm7iYm6ioq6kJCy - mZmpmZmonJyonZ2pmpqvmJiykJC6i4u+hobBgYHCgIDCgIDCgoLEg4PFhYXEh4fBjIy6mJisoqKjpKSh - o6OimpqrjY27iIjAh4e9h4e+ioq5h4e4gIC/gYHCgYHDgoLFg4PGh4fCkJC3lpaumpqooaGio6OhmZms - j4+5jIy8hobDg4PFgYHFgYHEf3/EgIDEioq3kZGvlJStlpatl5eumpqwn5+ro6OopqajnJyrkpKxkpKs - j4+wg4O/f3/Efn7Dfn7BgIDBgYHCgoLDhITEiYm/kpK3m5uvoaGopKSlpKSlpKSim5upkpKylJSylZWx - kZG2iIi+gYHDf3/Df3/BgYHCgIDFhobBiYm+jIy7kZG2lZWzn5+ppKSinp6nk5O0i4u9iIi/iIi/h4e+ - hoa7hoa4hYW5goK/IACIiMCMjL6Njb2MjL+Njb2WlrSlpaWlpaSioqKgoKCgoKCioqKioqOhoaWXl6+P - j7mLi76GhsGCgsWCgsSCgsSAgMWCgsOLi7iVla2hoaKjo6GioqKioqKioqKhoaGhoaCenqKSkrGJib2J - ib2JibqKirmLi7qJib6GhsKGhsOJicCPj7mYmKyfn6WioqOioqGgoKCgoKChoaCgoKSYmK2NjbqEhMOC - gsaCgsWDg8OEhMODg8WCgsaCgsaCgseLi72amquioqKjo6OkpKWkpKWkpKWkpKaenquUlLONjbmMjLuJ - ib6FhcODg8aDg8WCgsWDg8SDg8KNjbObm6Sjo6CioqKioqKioqKfn6SXl62MjLqDg8OAgMaBgcWAgMSA - gMSCgsOIiL2OjrWWlqybm6Ofn5+hoaGioqKioqKioqKjo6GioqKcnKeVla+OjreKiryKiruKiruKir2L - i72MjL2MjL2RkbmdnaykpKSkpKOioqOioqOkpKWlpaalpaalpaakpKWjo6Sjo6Sjo6SkpKWmpqempqem - pqempqalpaWlpaWlpaWlpaWlpaWlpaWlpaWmpqWmpqempqempqempqempqempqempqWlpaWlpaWlpaWm - pqampqempqempqempqempqakpKSkpKSlpaWlpaWlpaWkpKWjo6SkpKWlpaWlpaWlpaWkpKWkpKWjo6Oj - o6Ojo6SkpKWlpaWmpqampqampqampqalpaWlpaWlpaWkpKSkpKSkpKSkpKWkpKWjo6SkpKWlpaWlpaWl - paWlpaWlpaWlpaWlpaWmpqWmpqampqempqempqempqempqempqempqempqempqempqalpaWlpaWlpaWl - paWlpaWlpaWkpKSkpKSkpKSlpaWlpaWkpKWjo6WioqOioqKioqKioqKioqKioqKioqKioqKioqKjo6Gc - nKmQkLaJib6Jib6JibqJibiEhLx/f8F+fsSBgcSDg8OFhcOIiMKOjruUlLWbm6yjo6KhoaSYmK6Li76E - hMWDg8WDg8WCgsSAgMOCgr6Hh7mJibqKiruPj7WUlK+Xl6yXl6ybm6ednaeUlLOQkLmLi72GhsGCgsWA - gMSAgMKAgMGCgsSEhMWCgsiFhcSSkrSdnaahoaOgoKSioqOenqiRkbWOjrqMjLmMjLiHh7qBgcB/f8KB - gcGBgcOCgsWDg8aGhsSJicCMjLuSkrOdnaajo5+cnKiNjbqFhcSCgseBgceAgMd/f8eAgMGIiLWSkq6K - irmJib2Kir2Jib6Li7+QkLqbm6+lpaahoaqXl7CRkbCLi7aBgcKAgMOAgMF/f8F/f8GBgcKBgcSBgcmJ - icCRkbaUlLWYmLKjo6akpKWmpqSenqmUlLCSkrGPj7WHh7+CgsSBgcOAgMF/f8GAgMOEhMCJibuMjLuN - jbmQkLaRkbeWlrKhoaehoaSamqqUlLCNjbWKirmIiLqGhrmEhLqBgb+BgcMgAIWFw4qKv42NvY2NvZGR - uZmZsaSkpqampaSkpKGhoaCgoKCgoKKiop2dp5CQt4qKwIeHwoKCxoODxIODxIKCxYSEwoyMuZaWrpmZ - qKCgoqKioaKioqKioqKioqGhoaKioJycppCQs4uLuY2NuYuLu4mJvYSExYKCx4ODxoaGwo2NupmZrZ+f - paKio6Kio6Kio6GhoqCgoKGhn6CgopaWr4iIwIKCx4SExYSExYSExISExIODxYODxYODxYWFwpKStJ+f - paSkoKKioqOjo6SkpaSkpJ6eq5WVtZKSt5KStYqKvoSExYODxoODxYODxYODxYaGwoyMuZaWqZ2dn6Cg - n6GhoaKioqCgpZiYrouLu4KCxYGBxoGBxYGBxYODwYODwYSEv4iIuoiIvJOTrpycpKCgn6GhoKGhoaKi - oqKioqGho5ycqJWVsI+PuIqKvIuLvIuLvIqKu4qKu4qKvYyMvZGRuJ2dq6WlpaampaWlpaSkpaKioqKi - o6OjpKWlpqWlpqWlpqSkpaOjpKOjpKOjpKSkpaWlpqamp6amp6WlpqWlpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaampqamp6amp6amp6amp6amp6WlpqWlpaWlpaWlpaampqamp6amp6amp6amp6ampqSkpKOjpKSk - paWlpaWlpaSkpKOjpKOjpaSkpaWlpaWlpaWlpaWlpaWlpKOjpKOjpKSkpaWlpaWlpaWlpaWlpaWlpaWl - paWlpaWlpaWlpKOjpKOjpKOjpKOjpKOjpKSkpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaampqamp6am - p6amp6amp6amp6amp6amp6amp6amp6Wlp6WlpqWlpaWlpaWlpaWlpaWlpaSkpaOjpKSkpaWlpaWlpaWl - paOjpKKio6KioqKioqKioqKioqKioqKioqKioqKiop+fppOTso+PuI+Pt4uLuoaGvYCAxH5+w4CAwoKC - woWFwYeHwo6Ou5OTtpaWspmZrZ+fp6Kio56eppOTs4eHwYODx4ODxoKCxYSEwYaGuYeHt4mJuI+PtZOT - sI+PtY+Pto2Nt5KSsJiYq5GRtIiIv4WFwoGBxICAxIGBxIGBw4CAwYGBwoKCxoWFxIyMu5SUs5mZrZiY - rpiYrZ+fpaCgppaWsJCQt42NvIqKvYODwn9/w4CAwYCAwYGBwoK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ibyIiL2Ghr6Fhb6GhryOjrSZmaWfn6CgoKCgoKCg - oKCgoKCioqCYmK2OjrmLi72Li7yLi72Njb6Njb6Njb6MjL+QkLeamqibm6qhoaWjo6OkpKSlpaWlpaWl - paWjo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6OioqKjo6SmpqempqempqempqalpaWlpaWjo6Sj - o6SkpKWlpaWlpaWlpaWmpqempqempqempqempqempqelpaWlpaWlpaWlpaWlpaampqempqempqempqem - pqakpKSjo6SlpaWlpaWlpaWkpKWjo6Sjo6SlpaWmpqempqempqempqalpaWjo6Sjo6SkpKWlpaWlpaWl - paWlpaWlpaWlpaWkpKSjo6Sjo6Sjo6Sjo6Sjo6Sjo6Sjo6SkpKSlpaWlpaWlpaWlpaWlpaWlpaWlpaWl - paWmpqempqempqempqempqempqempqempqempqempqempqelpaWlpaWlpaWlpaWlpaWlpaWlpaWjo6Sk - pKWlpaWlpaWlpaWjo6SioqOioqOioqOioqOioqKioqKioqKioqKioqKjo6GgoKSXl66Li72GhsKDg8KC - gsCEhL2Li7ePj7SGhsKEhMaDg8eKisCZma+kpKOkpKOXl6+NjbqKir6Li72KiryJibqJibmGhriGhreG - hruEhL+FhcGFhcKHh7+RkbKcnKWbm6aPj7eFhcOCgsaDg8WCgsSCgsSBgcOAgMOHh72MjLuNjb6MjL6M - jL6Li7+QkLqcnKukpKCgoKSYmK6MjLuFhcSEhMaDg8WCgsOBgcKAgMGBgcKCgsOEhMWEhMaFhcSRkbef - n6ajo6GioqGfn6OYmKuSkrKRkbGRkbGRka+KirZ/f8N/f8GAgMODg8aFhcaEhMeHh8SVlbWamq2hoaam - pqKgoKqRkbqFhcaFhcSDg8SBgcSBgcOAgMKBgcCPj7CRkbCRkbOWlq+bm6ubm6qioqOkpKSkpKWlpaSg - oKmSkriFhcWDg8WCgsWBgcSDg7+IiLeHh7mDg8KDg8WEhMaHh8SQkLucnK6enqydnauhoaahoaaVlbKJ - icCJib6FhcOCg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- - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/AboutBckgnd_370x209.bmp b/PROMS/ReferencedObjectsOld/LibSource/Utils/AboutBckgnd_370x209.bmp deleted file mode 100644 index 21c5ce4934637654487494f3581db020d9fd8918..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 232464 zcmb5%NtPT(5+-QWt7UEa^{S3gC#VC|zAw}JOacKQFwgT4Km-PYBsc*e2+qVvGHX{i z>Q8<#Q#bbrFthy`92V}TrfRApzx*O9s{X(Jpa1LZe?3&M|LNcV@bCZqFNY5OAOHWC zL;u}-zy9z4cIZ(3n_rLf`m|n8`shy{J$m%;;dJ<9eCs-Y`f7aQ%W-9&Jb3VMZ*T8` z|8j>%kNTGT-LI(_=5lP7;Ub*hfjr++?u`q%U4 zf4F@4`PHk>Zr%EPcekrcoq4-=@5#-ZUthTJ!|Bt%<@#Ta9eaQD=m*Ev)*r`@zw<1& zZavxE)vML9^XuWYYu}zd`_q{-znnbz+tH(cbdl}tw+@wFx$?pVw{I)BR-^k|z50#E zRO-kPRlIi`Ir8qvk++8rzy0KsHxB1pTROqFn(>GBT)g<|{{2rM>D}E&*ROwb>XaJm z+uY%|lP8~_JNNa;lRx%TpE~vH*|R@iz54vloi7d0?b~0UKK=XF)?eMiBS+pJKmN;! z6R(aP`}y!;^;QG&)gPLD^XAhB4|W}Q?>@PD_1lXVzq@qlMULmEPrusQdOfZ`e*DAf z)32{ze}4b|lLrrsh~_=MdGp&-r`{erX5b88-PW^w@`+D=J$dqn6DNK?dh~5R|3eG! z+%c59dwUNx^~8y{dD4EUce-MG`-koA?@yfg;nXRe{1aJnoICf+jT_I^MO;;P_wJWh zuWH`Q^XFfkI`y+Fb;5}g-yc2ti+Z~*!+PPu&lfNLa{2NPckh0!)a~2PZ{2#~{pwYv zem{2Xt&4Mv-gs-!9p}#dbm`LfckVnbjf|+5I<9N$P@Fy)8ZlqLslOZ7YmX}lm3QaM z*Qlr!fB99HT7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S4Y?8|9+0;~bL6F-L`OZMni~D1 zweB$GF(9*}@RYd*@1o4D#ZnOy3?(csom8R$ZTp%*PL*ZG=q z8!qn42mVMhpFH`i*hPmpga68C9tY_)Sq64(ul!(6Y|axgO`U zj?7L4Eq}T>zW-e3tYY8aXPtjtjJ-&+e^cySH}_w6=ubB1@ej&Ee$etpO{^H2?yJ&s zYM4P>9QjBLlyVaZ85=c0UY03yB_n-IE408-cv6_WoDYEt$t7&&s6M@U|9ykfGBYKG z1cZA3!+T<$9ie>m)gwy%lgq+&8ahS!94E$3Ye+IIr`v>BK#Sl+GG>}n$0bkB0=8tV z8;$T?kYi)N`u_K$_sZ;&US%p@ChzcTxI(5H31w8p_<-;)+dPYBWITpHE`q{bYb&if zn+sj8z~sNaziVxH7z(I05>GPjZ6n@R{}7CUE5wIG#Ci{NYQV{}z%3ZFzU?%_FqKZ; zU)?!93|iuw&~gllUMlrycB^IoFK@hI+KZL1B!aNtOXng5iZ8gr7c9lfteIY$v8O6x z!Vh|b$$1vJ316A5^k}ASX~pN==GuJY9N3RWnz5%m>GILKS=GvVQv5re*=F|bsvwyV zk(*CZfeL6*Vl54*Y5*cNPS%{<9~p5#T^8<6}E*h{r~V=47(4KKClS{?whn3oT&=HYablilW~?Yu$MOX-?R` z{~yo-J|FqG`CeH+mw0sN(&hGwF3H%epF&DO0yD2)nE83z9`lm-Xfiu=!p5&>WJV5g z%?AI1D@HVg3YcmJ9^N1gat9157%oJKfY4Yf?vITMve3*3yt?Q?0f6Z7ymA}v%ps)w4-H2y9h;eC)< zKB7i=F)HXH+7K7X5C~D1uvY-9SxM(BC4|VxPKy`RghLn-uTV=msN_|1%PFz01~;?x WoJ|%e-)ce)6vu^{UFPzG&;I~+FTO1R diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/Utils/AssemblyInfo.cs deleted file mode 100644 index 7e3b35a5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/Utils/AssemblyInfo.cs.bak deleted file mode 100644 index a9833df8..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/AssemblyInfo.cs.bak +++ /dev/null @@ -1,57 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/CurSet.cs b/PROMS/ReferencedObjectsOld/LibSource/Utils/CurSet.cs deleted file mode 100644 index 801663ac..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/CurSet.cs +++ /dev/null @@ -1,185 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: CurSet.cs $ $Revision: 2 $ - * $Author: Jsj $ $Date: 5/17/05 11:51a $ - * - * $History: CurSet.cs $ - * - * ***************** Version 2 ***************** - * User: Jsj Date: 5/17/05 Time: 11:51a - * Updated in $/LibSource/Utils - * cleanup - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:34a - * Created in $/LibSource/Utils - *********************************************************************************************/ - -using System; -using System.IO; -using System.Collections; -using System.Text; -using System.Windows.Forms; - -namespace Utils -{ - /// - /// Summary description for CurSet. - /// - public class CurSet - { - public string PathName; - public string DefaultDestFName; //[MAXPATH] - public string DefaultPlantFmt; //[10]; - public string DefaultPrinter; //[4]; - public ArrayList DefaultUserCBMsg; //[2][10]; - public string DefaultUserFmt; //[3]; - public ArrayList DefPenColors; //[8] - public short DefaultChangeBars; - public short DefaultDestination; - public short DefaultOriginals; - public short DefaultPagination; - public short DefaultPaperMacro; - public short DefaultPlotterType,DefaultPlotterPort,DefaultCIEType; - public short DontPrintStatusTree; - public short DisableDuplexPrinting; - - private string[] SettingFiles={"..\\procs\\curset.dat", "~curset.dat"}; - - public CurSet(string pname) - { - PathName = pname; - - } - - public bool Create(UserRunTime usrRT) - { - // find file to copy from procs or system. - bool found = false; - int i=0; - while(found==false) - { - if (File.Exists(usrRT.ExeAdjust(SettingFiles[i])) == true) - found=true; - else - i++; - } - if (found==false) return false; - File.Copy(usrRT.ExeAdjust(SettingFiles[i]),"curset.dat"); - PathName = "curset.dat"; - return true; - } - - private string ReadTheString(BinaryReader bw, int maxlen) - { - StringBuilder retStr = new StringBuilder(maxlen+1); - // read a series of characters until a null is found. - char ac; - bool done = false; - while(done==false) - { - ac = bw.ReadChar(); - if (ac=='\0') - done=true; - else - retStr.Append(ac); - } - return retStr.ToString(); - } - - public bool Read() - { - BinaryReader br; - ArrayList DefaultUserCBMsg = new ArrayList(2); - ArrayList DefPenColors = new ArrayList(8); - FileStream fs; - FileInfo fi = new FileInfo(PathName); - try - { - fs = fi.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite ); - br = new BinaryReader(fs,System.Text.ASCIIEncoding.ASCII); - } - catch (Exception e) - { - MessageBox.Show(e.ToString(),"CURSET.DAT Error"); - return false; - } - - try - { - DefaultDestination=br.ReadSByte(); - DefaultChangeBars= br.ReadSByte(); - DefaultOriginals=br.ReadSByte(); - DefaultPagination=br.ReadSByte(); - DefaultPrinter = ReadTheString(br,4); - DefaultPlantFmt = ReadTheString(br,10); - DefaultDestFName = ReadTheString(br,128); - DefaultPlotterType = br.ReadSByte(); - DefaultPlotterPort = br.ReadSByte(); - DefaultCIEType = br.ReadSByte(); - short tmp; - for (int i=0;i<8;i++) - { - tmp = br.ReadSByte(); - DefPenColors.Add(tmp); - } - - DefaultPaperMacro = br.ReadSByte(); - string stmp; - stmp = ReadTheString(br,10); - DefaultUserCBMsg.Add(stmp); - stmp = ReadTheString(br,10); - DefaultUserCBMsg.Add(stmp); - DontPrintStatusTree = br.ReadSByte(); - DefaultUserFmt = ReadTheString(br,10); - DisableDuplexPrinting = br.ReadSByte(); - br.Close(); - } - catch(Exception e) - { - if(br!=null) br.Close(); - } - fs.Close(); - return true; - } - - public bool Save(string filename) - { - // may be a different pathname, if so, change it. - if (filename.ToUpper() != PathName.ToUpper()) PathName = filename; - - FileStream fs = new FileStream(PathName, FileMode.Create); - BinaryWriter w = new BinaryWriter(fs); - - w.Write(DefaultDestination); - w.Write(DefaultChangeBars); - w.Write(DefaultOriginals); - w.Write(DefaultPagination); - w.Write(DefaultPrinter); - w.Write(DefaultPlantFmt); - w.Write(DefaultDestFName); - w.Write(DefaultPlotterType); - w.Write(DefaultPlotterPort); - w.Write(DefaultCIEType); - w.Write((short)DefPenColors[0]); - w.Write((short)DefPenColors[1]); - w.Write((short)DefPenColors[2]); - w.Write((short)DefPenColors[3]); - w.Write((short)DefPenColors[4]); - w.Write((short)DefPenColors[5]); - w.Write((short)DefPenColors[6]); - w.Write((short)DefPenColors[7]); - w.Write(DefaultPaperMacro); - w.Write((string)DefaultUserCBMsg[0]); - w.Write((string)DefaultUserCBMsg[1]); - w.Write(DontPrintStatusTree); - w.Write(DefaultUserFmt); - w.Write(DisableDuplexPrinting); - w.Close(); - fs.Close(); - return true; - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/DTI.cs b/PROMS/ReferencedObjectsOld/LibSource/Utils/DTI.cs deleted file mode 100644 index c979ef93..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/DTI.cs +++ /dev/null @@ -1,139 +0,0 @@ -/********************************************************************************************* - * Copyright 2005 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: DTI.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 3/08/05 1:46p $ - * - * $History: DTI.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:46p - * Created in $/LibSource/Utils - * Approval - *********************************************************************************************/ -using System; -using System.Text; - - -namespace Utils -{ - /// - /// Summary description for DTI. - /// - public class DTI - { - public static string DateTimeInit; - public static string SetDateTimeInit; - public static string Initials; // set from the user's run time. - - public static string CurDate(string delim) - { - DateTime dt = DateTime.Today; - - StringBuilder sdt = new StringBuilder(11); - if (delim == null || delim == "") delim = "-"; - sdt.Append(dt.Month.ToString("D2")); - sdt.Append(delim); - sdt.Append(dt.Day.ToString("D2")); - sdt.Append(delim); - sdt.Append(dt.Year.ToString("D2")); - return sdt.ToString(); - } - - public static string CurTime() - { - DateTime dt = DateTime.Now; - StringBuilder sdt = new StringBuilder(11); - sdt.Append(dt.Hour.ToString("D2")); - sdt.Append(":"); - sdt.Append(dt.Minute.ToString("D2")); - sdt.Append(":"); - sdt.Append(dt.Second.ToString("D2")); - return sdt.ToString(); - } - - // ovrride == 0 default, don't do anything different - // ovrride == 1 means simply override "super" - // ovrride == 2 means force a reset of the DTI - public static void UpdateDateTimeInit(int ovrride) - { - StringBuilder ldti = new StringBuilder(19); - if (ovrride != 2 && (ovrride!=0 || Initials!="super")) - { - string tptr = CurDate(null); - ldti = new StringBuilder(12); - ldti.Insert(0,tptr.Substring(6,4)); - ldti.Insert(4,tptr.Substring(0,2)); - ldti.Insert(6,tptr.Substring(3,2)); - ldti.Insert(8,CurTime().Substring(0,5)); - ldti.Insert(13,Initials.PadRight(5,' ').Substring(0,5)); - } - else - ldti.Insert(0,DTI.SetDateTimeInit); - - // for dbase, replace spaces with '0' in date/time part & shift any non-number - // in first time field back to end of time field (?not sure why - this was - // done in 16-bit code. - for (int i=0;i<13&&ldti[i]!=0;i++) if (ldti[i]==' ') ldti[i]='0'; - char c = ldti[10]; - if (!Char.IsDigit(c)) - { - ldti[10]=ldti[11]; - ldti[11]=ldti[12]; - ldti[12]=c; - } - - if (ldti.ToString().Substring(0,8).Equals("19800101")) - { - ldti.Insert(0,SetDateTimeInit.Substring(0,13)); - } - DateTimeInit = ldti.ToString(); - } - - // MakeDate is passed a date in the form of YYYYMMDD and translates it - // into MM/DD/YY (if ShortYear is true) or MM/DD/YYYY. condense - // removes any leading ' ' or 0 in month or day. - public static string MakeDate(string src, bool condense, bool ShortYear) - { - int[] DateOffset={4,5,47,6,7,47,2,3}; // 47 = '/' - StringBuilder datebuff = new StringBuilder(12); - for (int i=0; i - /// Summary description for DirSpace. - /// - public class DirSpace - { - static DirSpace() - { - } - - [DllImport("kernel32.dll", CharSet=CharSet.Auto, SetLastError=true)] - public static extern bool GetDiskFreeSpaceEx( - [MarshalAs(UnmanagedType.LPTStr)] string lpDirectoryName, - ref long lpFreeBytesAvailable, - ref long lpTotalNumberOfBytes, - ref long lpTotalNumberOfFreeBytes); - - public static long Free() - { - string curdir = Environment.CurrentDirectory; - long freeBytes = new long(); - long totalFreeBytes = new long(); - long totalBytes = new long(); - - bool x = GetDiskFreeSpaceEx(curdir, ref freeBytes, ref totalFreeBytes, ref - totalBytes); - return totalFreeBytes; - } - - private static long DirSize(DirectoryInfo d) - { - long Size = 0; - // Add file sizes. - FileInfo[] fis = d.GetFiles(); - foreach (FileInfo fi in fis) - { - Size += fi.Length; - } - // Add subdirectory sizes. - DirectoryInfo[] dis = d.GetDirectories(); - foreach (DirectoryInfo di in dis) - { - Size += DirSize(di); - } - return(Size); - } - - public static long Get(string TheDirectory) - { - DirectoryInfo d = new DirectoryInfo(TheDirectory); - return DirSize(d); - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/FmtFiles.cs b/PROMS/ReferencedObjectsOld/LibSource/Utils/FmtFiles.cs deleted file mode 100644 index 3a19b53a..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/FmtFiles.cs +++ /dev/null @@ -1,75 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: FmtFiles.cs $ $Revision: 2 $ - * $Author: Jsj $ $Date: 5/17/05 11:51a $ - * - * $History: FmtFiles.cs $ - * - * ***************** Version 2 ***************** - * User: Jsj Date: 5/17/05 Time: 11:51a - * Updated in $/LibSource/Utils - * cleanup - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:34a - * Created in $/LibSource/Utils - *********************************************************************************************/ - -using System; -using System.IO; -using System.Windows.Forms; - -namespace Utils -{ - /// - /// Summary description for FmtFiles. - /// - public class FmtFile - { - public string FmtFileName; - public FmtFile(string fname) - { - if (fname.IndexOf(".fmt",0) > -1) - FmtFileName = fname; - else - FmtFileName = fname + ".fmt"; - } - - public string GetFormatTitle(UserRunTime usrRT) - { - string fmtpath = usrRT.syspath + "\\format\\" + FmtFileName; - FileStream fs; - FileInfo fi = new FileInfo(fmtpath); - try - { - fs = fi.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite ); - } - catch (Exception e) - { - MessageBox.Show(e.ToString(),"Format File Read Error"); - return null; - } - - BinaryReader bw = new BinaryReader(fs,System.Text.ASCIIEncoding.ASCII); - - ushort len; - len = bw.ReadUInt16(); - string retTitle = null; - if (len > 1) - retTitle = new string(bw.ReadChars(len-1)); // -1: remove the null - else - retTitle = "Format not found"; - - return retTitle; - } - } - - public class DocFile - { - public DocFile() - { - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/MenuXML.cs b/PROMS/ReferencedObjectsOld/LibSource/Utils/MenuXML.cs deleted file mode 100644 index f2e8ca95..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/MenuXML.cs +++ /dev/null @@ -1,58 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: MenuXML.cs $ $Revision: 2 $ - * $Author: Jsj $ $Date: 5/17/05 11:52a $ - * - * $History: MenuXML.cs $ - * - * ***************** Version 2 ***************** - * User: Jsj Date: 5/17/05 Time: 11:52a - * Updated in $/LibSource/Utils - * cleanup - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:34a - * Created in $/LibSource/Utils - *********************************************************************************************/ - -using System; -using System.Xml; -using System.IO; -using System.Windows.Forms; - -namespace Utils -{ - /// - /// This class reads in an xml menu file, as input and creates an XmlDocument from it. - /// - public class MenuXML - { - private string menuFileName; - private XmlDocument xmlDoc; - public MenuXML(string fn) - { - menuFileName = fn; - try - { - xmlDoc = new XmlDocument(); - XmlTextReader reader = new XmlTextReader(fn); - xmlDoc.Load(reader); - reader.Close(); - } - catch (Exception e) - { - MessageBox.Show(e.Message.ToString(),"XML Menu Error"); - - } - - } - - public XmlDocument GetXmlDoc() - { - return xmlDoc; - } - - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/PrivateProfile.cs b/PROMS/ReferencedObjectsOld/LibSource/Utils/PrivateProfile.cs deleted file mode 100644 index a6994172..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/PrivateProfile.cs +++ /dev/null @@ -1,256 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: PrivateProfile.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 7/27/04 8:34a $ - * - * $History: PrivateProfile.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:34a - * Created in $/LibSource/Utils - *********************************************************************************************/ - -using System; -using System.IO; -using System.Xml; -namespace Utils -{ - /// - /// PrivateProfile opens a private profile string and stores it's contents in an xml document. - /// - public class PrivateProfile - { - private string ppName; - private XmlDocument ppXml; - private XmlNode AddNode(XmlNode xParent, string sName, string sValue ) - { - XmlNode nd; - // Add a node - nd=xParent.OwnerDocument.CreateNode(System.Xml.XmlNodeType.Element,sName,""); - xParent.AppendChild(nd); - nd.Value=sValue; - return nd; - } - private XmlNode AddNode(XmlNode xParent, string sName) - { - XmlNode nd; - // Add a node - nd=xParent.OwnerDocument.CreateNode(System.Xml.XmlNodeType.Element,sName,""); - xParent.AppendChild(nd); - return nd; - } - private void AddAttribute(XmlNode xParent, string sName, string sValue ) - { - XmlNode xa=xParent.Attributes.GetNamedItem(sName); - // bug fix. 09/15/03 - // If there was a space after an equal sign, that space character - // was becomming part of the value string (reading the user.CFG file). - // This was giving us a "Must have semi-colon" error message. - // We now strip spaces before and after any Attribute that is written. - sValue = sValue.Trim(' '); - - // Add an attribute - if(sValue=="") - { - if(xa != null) - { - xParent.Attributes.RemoveNamedItem(sName); - } - } - else - { - if(xa == null) - { - xa = xParent.OwnerDocument.CreateNode(System.Xml.XmlNodeType.Attribute ,sName,""); - xParent.Attributes.SetNamedItem(xa); - } - xa.Value=sValue; - } - - } - private XmlNode AddSection(XmlNode xParent, string sSection ) - { - // Add a section [name] - XmlNode nd =AddNode(xParent,"section"); - AddAttribute(nd,"name",sSection.Substring(1,sSection.IndexOf("]")-1)); - return nd; - } - private XmlNode AddSection_UC(XmlNode xParent, string sSection ) - { - // Add a section [name] - string name_uc = sSection.Substring(1,sSection.IndexOf("]")-1).ToUpper() + "__UC"; - XmlNode nd =AddNode(xParent,"sectionUC"); - AddAttribute(nd,"name",name_uc); - return nd; - } - private void AddComment(XmlNode xParent, string sComment) - { - - if(xParent.ChildNodes.Count > 0) - { - XmlNode ndlast=xParent.ChildNodes.Item(xParent.ChildNodes.Count-1); - if(ndlast.Name=="comment") - { - XmlNode xa = ndlast.Attributes.GetNamedItem("text"); - xa.Value=xa.Value + "\r\n" + sComment; - return; - } - } - // Add a comment text - XmlNode nd =AddNode(xParent,"comment"); - AddAttribute(nd,"text",sComment); - } - private void AddLine(XmlNode xParent, string sLine) - { - // Add a comment text - XmlNode nd =AddNode(xParent,"line"); - AddAttribute(nd,"text",sLine); - } - private void AddParam(XmlNode xParent, string sParam) - { - int i = sParam.IndexOf("="); - // add a param name=value - string sName=sParam.Substring(0,i); - string sValue=sParam.Substring(i+1); - XmlNode nd =AddNode(xParent,"param"); - sName = sName.Trim(' '); - AddAttribute(nd,"name",sName); - AddAttribute(nd,"value",sValue); -// AddAttribute(nd,"srchname",sName.ToUpper()+"__UC"); -// AddAttribute(nd,"value",sValue); - } - private void AddParam_UC(XmlNode xParent, string sParam) - { - int i = sParam.IndexOf("="); - // add a param name=value - string sName=sParam.Substring(0,i); - string sValue=sParam.Substring(i+1); - XmlNode nd =AddNode(xParent,"paramUC"); - sName = sName.Trim(' '); - AddAttribute(nd,"name",sName.ToUpper()+"__UC"); - AddAttribute(nd,"value",sValue); - } - private void LoadXML() - { - string sLine; - ppXml.LoadXml("");// initialize ppXml - XmlNode xmlTop=ppXml.DocumentElement; - XmlNode xmlNd=ppXml.DocumentElement; - XmlNode xmlNd_UC=ppXml.DocumentElement; - StreamReader myReader = new StreamReader(ppName);// Open file - while( (sLine = myReader.ReadLine())!= null)// read line-by-line - { - // add structure - if(sLine.Length > 0) - { - switch (sLine.Substring(0,1)) - { - case "[": - xmlNd=AddSection(xmlTop, sLine); - xmlNd_UC=AddSection_UC(xmlTop, sLine); - break; - case ";": - AddComment(xmlNd, sLine); - break; - default: - if(sLine.IndexOf("=") >= 0) - { - AddParam(xmlNd, sLine); - AddParam_UC(xmlNd_UC, sLine); - } - else - { - AddLine(xmlNd, sLine); - } - break; - } - } - } - myReader.Close(); - // close file - } - public PrivateProfile(string sFileName) - { - ppName=sFileName; // Store file name - ppXml= new XmlDocument();// Allocate XML - LoadXML();// Load XML - } - ~PrivateProfile() - { - // Clean-up - // - } - public string PrettyNode(XmlNode nd,int level) - { - string retval=""; - string prefix=new string(' ',level*2); - if(nd.ChildNodes.Count > 0) - { - retval = prefix + "<" + nd.Name; - for(int i=0;i"; - for(int i=0;i"; - } - else - { - retval = prefix + "<" + nd.Name; - for(int i=0;i"; - } - return retval; - } - public string PrettyXML() - { - return PrettyNode(ppXml.DocumentElement,0); - } - public XmlDocument XML() - { - // return XML Document - return ppXml; - } - public override string ToString() - { - // return string - return ""; - } - public void Save() - { - SaveAs(ppName); - } - public void SaveAs(string sName) - { - } - public string Attr(string sPath) - { - string retval=""; - XmlNode xn = ppXml.SelectSingleNode(sPath); - if(xn != null) - { - string quots = xn.Value; - if (quots.Substring(0,1)=="\"" && quots.Substring(quots.Length-1,1)=="\"") - retval = quots.Substring(1,quots.Length-2); - else - retval=xn.Value; - } - return retval; - } - - public string Attr(string sSection, string sParameter) - { - string findstr = "/ini/sectionUC[@name='" + sSection.ToUpper() + "__UC']/paramUC[@name='" + sParameter.ToUpper() + "__UC']/@value"; - return Attr(findstr); - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/Security.cs b/PROMS/ReferencedObjectsOld/LibSource/Utils/Security.cs deleted file mode 100644 index 30942424..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/Security.cs +++ /dev/null @@ -1,622 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: Security.cs $ $Revision: 4 $ - * $Author: Jsj $ $Date: 5/17/05 11:52a $ - * - * $History: Security.cs $ - * - * ***************** Version 4 ***************** - * User: Jsj Date: 5/17/05 Time: 11:52a - * Updated in $/LibSource/Utils - * cleanup - * - * ***************** Version 3 ***************** - * User: Kathy Date: 1/24/05 Time: 2:44p - * Updated in $/LibSource/Utils - * B2005-004 fixes - * - * ***************** Version 2 ***************** - * User: Kathy Date: 1/14/05 Time: 10:38a - * Updated in $/LibSource/Utils - * B2004-061: fix security options - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:34a - * Created in $/LibSource/Utils - *********************************************************************************************/ - -using System; -using System.IO; -using System.Collections; -using System.Windows.Forms; -using System.Text; - -namespace Utils -{ - /// - /// Summary description for Security. - /// - public class Security - { - public const long VIEW =0x00000001L; - public const long PRINT =0x00000002L; - public const long PRINTDRAFT =0x00000004L; - public const long PRINTCHANGES =0x00000008L; - public const long EDIT =0x00000010L; - public const long SEARCH =0x00000020L; - public const long STANDARDSTEPS =0x00000040L; - public const long APPROVE =0x00000080L; - public const long APPROVESINGLE =0x00000100L; - public const long LIBRARYDOCS =0x00000200L; - public const long ADDMODDEL =0x00000400L; - public const long CLEAN =0x00000800L; - public const long LOCKPROC =0x00001000L; - public const long LOCKSET =0x00000001L; - public const long UCF =0x00000002L; - public const long LOCKSYSTEM =0x00000001L; - public const long DOCMAINT =0x00000002L; - public const long ROEDITOR =0x00000004L; - public const long SYSADMIN =0x00000008L; - - public const int SUPERUSER =1000; - public const long SUPERACCESS =0xFFFFFFFFL; - - // the following four flags are system security options, - // read in for the user from the security file (vesam.opt) - private bool BlockAccessFlag=false; - public bool PermissionToManageFlag=false; - public bool SystemAdminFlag=false; - public bool PermissionToLockFlag=false; - -// private string optFileName; - private int numsets = 0; - private long uoptions; // user options - private Int16 blockAccess = 0; - private long oldpos; - public int userid = -1; -// private int plantid = -1; -// private int procid = -1; - private string ident; - public string initials; - private const string samoptname = "vesam.opt"; - public string optfilename; - private ArrayList psets; // - public FileStream fs; - public BinaryReader bw; - public bool isDemoMode=false; - - public Security(string pathname) - { - if (File.Exists(pathname + "\\" + samoptname) == false) - { - MessageBox.Show("Could not locate the Security Options file:\n\n" + pathname+"\\"+samoptname,"Security Access Error"); - optfilename = null; - return; - } - optfilename = pathname + "\\" + samoptname; - psets = new ArrayList(); - } - - public bool OpenFile() - { - try - { - fs = new FileStream(optfilename,FileMode.Open,FileAccess.Read,FileShare.Read,1,false); - bw = new BinaryReader(fs); - return true; - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Security File"); - return false; - } - } - - public void CloseFile() - { - bw.Close(); - fs.Close(); - bw=null; - fs=null; - } - - public int CheckUserId(string Name, string Pass) - { - // check for default superuser username/password. - if ((Name=="vlnmsp") && (Pass=="575")) - { - userid = SUPERUSER; - ident = "vlnmsp"; - initials = Name; - return userid; - } - - if (bw==null) - { - bool op; - if ((op = OpenFile()) == false) return -1; - } - byte x; - // read past some header stuff. - for (int jj=0;jj<16;jj++) - x=bw.ReadByte(); - long nxtUs; - uint nmUser; - nxtUs=bw.ReadUInt32(); - nmUser=bw.ReadUInt16(); - - int uid, tmp; - string fName, fPass; - for (int i = 0; i < nmUser; i++) - { - fs.Seek((long)nxtUs,SeekOrigin.Begin); - nxtUs=bw.ReadUInt32(); - uid = bw.ReadUInt16(); - tmp = bw.ReadUInt16(); - byte [] test = new byte[10]; - test = bw.ReadBytes(10); - fName = Encoding.ASCII.GetString(test,0,10); - int indx = fName.IndexOf("\0"); - string fNameTrim = fName.Substring(0,indx); - if (fNameTrim == Name) - { - test = bw.ReadBytes(10); - fPass = Encoding.ASCII.GetString(test,0,10); - indx = fPass.IndexOf("\0"); - string fPassTrim = fPass.Substring(0,indx); - if (fPassTrim == Pass) - { - userid = uid; - ident = Name; - initials = Name; - break; - } - } - } - CloseFile(); - - return userid; - } - - public void SetUserSystemRights() - { - BlockAccessFlag=BlockAccess(); - long userAccessFlags=GetUserSecurity(); - PermissionToManageFlag=(userAccessFlags&Security.DOCMAINT)==0?false:true; - PermissionToLockFlag=(userAccessFlags&Security.LOCKSYSTEM)==0?false:true; - SystemAdminFlag=(userAccessFlags&Security.SYSADMIN)==0?false:true; - } - - public void LoadUserSecurity() - { - // - // get the system level security options for this user here - // - bool op = OpenFile(); - if (op==false) return; - - if( userid == 1000 ) - { // super user priviledge - uoptions = 0xFFFFFFFFL; - SetUserSystemRights(); - CloseFile(); - return; - } - - fs.Seek(32,SeekOrigin.Begin); - blockAccess=bw.ReadInt16(); - - fs.Seek(0,SeekOrigin.Begin); - byte x; - // read past some header stuff. - for (int jj=0;jj<16;jj++) - x=bw.ReadByte(); - - long nxtUs; - uint nmUser; - nxtUs=bw.ReadUInt32(); - nmUser=bw.ReadUInt16(); - - int uid; - for (int i = 0; i < nmUser; i++) - { - oldpos = nxtUs; - fs.Seek((long)nxtUs,SeekOrigin.Begin); - nxtUs=bw.ReadUInt32(); - uid = bw.ReadUInt16(); - if (uid == userid) - { - string junk = new string (bw.ReadChars(22)); - uoptions=bw.ReadUInt16(); - break; - } - } - SetUserSystemRights(); - CloseFile(); - } - - public void SetUpDemoMode() - { - userid=Security.SUPERUSER; // super user so that demo data can be anywhere (doesn't check vesamp.opt) - ident="demo"; - initials="demo"; - isDemoMode = true; - } - public int GetPlantSecurityIndex(string Location) - { - for (int i=0;ipsets.Count-1)return false; - SecurityPlantSets sps = (SecurityPlantSets) psets[idx]; - return sps.HasSecurity; - } - - public bool ProcSetHasSecurity(int idx, string procset) - { - if (userid == SUPERUSER) return true; - if (idx<0 || idx>psets.Count-1)return false; - SecurityPlantSets sps = (SecurityPlantSets) psets[idx]; - return sps.ProcSetHasSecurity(procset); - } - - public long GetPlantSecurity(int idx) - { - if(userid == SUPERUSER ) return SUPERACCESS; - if (idx<0 || idx>psets.Count-1) return 0L; - SecurityPlantSets sps = (SecurityPlantSets) psets[idx]; - return (sps.GetSecurity()); - } - - public bool AnyOptionsSet(int idx) - { - if(userid==SUPERUSER) return true; - if (idx<0 || idx>psets.Count-1) return false; - SecurityPlantSets sps = (SecurityPlantSets) psets[idx]; - return sps.AnyOptionsSet(); - } - - public long GetUserSecurity() - { - if(userid == SUPERUSER) return SUPERACCESS; - return(uoptions); - } - - public bool BlockAccess() - { - if (userid == SUPERUSER) return false; - if(blockAccess!=0) return true; - return false; - } - - public bool IsAllowed(long mask) - { - if(userid == SUPERUSER) return true; - return (uoptions&mask) != 0; - } - - public bool IsAllowed(string plantpath, string procpath, long mask) - { - bool retval = false; - if(userid == SUPERUSER) return true; - for(int i=0; i0) - procs = new ArrayList(numopts); - else - procs = null; - for(int i=0;i - /// Summary description for SerialNo. - /// - public class SerialNo - { - private string sernofile; - public int SerialNum; - private string SerialNumTitle; - private static byte sum =0xcf;// used in serial number code (nextchar) - - public enum SN_Flags - { - SN_NETWORK_ON =0x0001, - SN_BACKGROUND_ON =0x0002, - SN_DEVIATION_ON =0x0004, - SN_CHECKLISTEXPORT_ON =0x0008, - SN_REVISIONFUNCTION_ON =0x0010, - SN_ONLYAPPROVEONCE_ON =0x0020, - SN_BGEPLANTWIDEOPT_ON =0x0040, - SN_REVISESTRIPPC_ON =0x0080, - SN_PROCCOMMENT_ON =0x0400, - SN_REMOVECHGID_ON =0x0800, - SN_OPTIONALACCEDIT_ON =0x1000, - SN_TEMPCHANGE_ON =0X2000, - SN_VOLIANONLY_ON =0x8000 - }; - - public SN_Flags[] SerialNumberOptionsByPlant= - { - /* 0 Volian Enterprises, Inc. */ (SN_Flags)0xFFFF, - /* 1 Entergy Nuclear Northeast - Indian Point Unit 2 */ SN_Flags.SN_BACKGROUND_ON|SN_Flags.SN_NETWORK_ON, - /* 2 Virginia Power - Surry (1A) */ SN_Flags.SN_NETWORK_ON, - /* 3 Virginia Power - North Anna */ SN_Flags.SN_DEVIATION_ON|SN_Flags.SN_NETWORK_ON, - /* 4 Northern States Power - Prairie Island */ SN_Flags.SN_DEVIATION_ON, - /* 5 American Electric Power - D. C. Cook - AOPs */ SN_Flags.SN_NETWORK_ON|SN_Flags.SN_BACKGROUND_ON, - /* 6 Wisconsin Electric Power - Point Beach */ SN_Flags.SN_NETWORK_ON|SN_Flags.SN_BACKGROUND_ON, - /* 7 Rochester Gas and Electric Corp. - Ginna */ SN_Flags.SN_BACKGROUND_ON, - /* 8 TUEC - Comanche Peak */ 0, - /* 9 Entergy Nuclear Northeast - Indian Point Unit 3 */ SN_Flags.SN_BACKGROUND_ON|SN_Flags.SN_NETWORK_ON, - /*10 Maine Yankee Atomic Power Company - Maine Yankee */ 0, - /*11 Yankee Atomic Electric - Yankee Rowe */ 0, - /*12 Wisconsin Public Service Corp.- Kewaunee */ SN_Flags.SN_NETWORK_ON|SN_Flags.SN_BACKGROUND_ON, - /*13 Wisconsin Public Service Corp.- Kewaunee Operating Procedures*/ SN_Flags.SN_NETWORK_ON|SN_Flags.SN_BACKGROUND_ON, - /*14 South Carolina Gas and Electric - V.C. Summer */ 0, - /*15 Louisiana Power and Light - Waterford */ 0, - /*16 Pacific Gas and Electric - Diablo Canyon */ SN_Flags.SN_OPTIONALACCEDIT_ON, - /*17 Southern California Edison - San Onofre */ 0, - /*18 Carolina Power and Light - Robinson */ SN_Flags.SN_NETWORK_ON,/*|SN_BACKGROUND_ON|SN_DEVIATION_ON, */ - /*19 Arkansas Nuclear One - Unit 1 */ 0, - /*20 Arkansas Nuclear One - Unit 2 */ SN_Flags.SN_NETWORK_ON|SN_Flags.SN_ONLYAPPROVEONCE_ON|SN_Flags.SN_REVISIONFUNCTION_ON|SN_Flags.SN_REVISESTRIPPC_ON|SN_Flags.SN_PROCCOMMENT_ON, - /*21 Southern Nuclear Operating Company - Vogtle */ SN_Flags.SN_BACKGROUND_ON|SN_Flags.SN_DEVIATION_ON, - /*22 Florida Power and Light - Turkey Point (Unit 3) */ SN_Flags.SN_NETWORK_ON|SN_Flags.SN_DEVIATION_ON|SN_Flags.SN_BACKGROUND_ON, - /*23 Houston Lighting & Power Company - South Texas */ SN_Flags.SN_NETWORK_ON|SN_Flags.SN_BACKGROUND_ON, - /*24 Carolina Power & Light - Shearon Harris */ 0, - /*25 Virginia Power - EPIP */ SN_Flags.SN_NETWORK_ON, - /*26 Wolf Creek Nuclear Operating Corp. - Wolf Creek */ SN_Flags.SN_NETWORK_ON|SN_Flags.SN_BACKGROUND_ON|SN_Flags.SN_OPTIONALACCEDIT_ON|SN_Flags.SN_TEMPCHANGE_ON|SN_Flags.SN_CHECKLISTEXPORT_ON, - /*27 Duke Power - Catawba */ SN_Flags.SN_NETWORK_ON|SN_Flags.SN_BACKGROUND_ON|SN_Flags.SN_DEVIATION_ON, - /*28 Duke Power - McGuire */ SN_Flags.SN_NETWORK_ON|SN_Flags.SN_BACKGROUND_ON|SN_Flags.SN_DEVIATION_ON, - /*29 Exelon Nuclear - Braidwood */ SN_Flags.SN_NETWORK_ON | SN_Flags.SN_BACKGROUND_ON | SN_Flags.SN_DEVIATION_ON, - /*30 Exelon Nuclear - Byron */ SN_Flags.SN_NETWORK_ON | SN_Flags.SN_BACKGROUND_ON | SN_Flags.SN_DEVIATION_ON, - /*31 Virginia Power - Innsbrook */ SN_Flags.SN_NETWORK_ON, - /*32 Constellation Energy Group - Calvert Cliffs */ SN_Flags.SN_NETWORK_ON|SN_Flags.SN_REVISIONFUNCTION_ON|SN_Flags.SN_ONLYAPPROVEONCE_ON|SN_Flags.SN_BGEPLANTWIDEOPT_ON|SN_Flags.SN_OPTIONALACCEDIT_ON|SN_Flags.SN_REMOVECHGID_ON, - /*33 American Electric Power - D. C. Cook - EOPs */ SN_Flags.SN_NETWORK_ON|SN_Flags.SN_BACKGROUND_ON, - /*34 American Electric Power - D. C. Cook - Training */ 0, - /*35 North Atlantic Energy Service Corp. - Seabrook Nuclear Plant */ SN_Flags.SN_TEMPCHANGE_ON, - /*36 Entergy - River Bend Nuclear Station */ SN_Flags.SN_NETWORK_ON|SN_Flags.SN_REVISIONFUNCTION_ON, - /*37 Southern Nuclear Operating Company - Farley Nuclear Plant */ SN_Flags.SN_NETWORK_ON|SN_Flags.SN_BACKGROUND_ON|SN_Flags.SN_DEVIATION_ON, - /*38 AmerenUE - Callaway Plant */ SN_Flags.SN_NETWORK_ON|SN_Flags.SN_BACKGROUND_ON - }; - - public SerialNo(string isernofile,string ucfgpath, UserRunTime usrRT, bool DemoMode) - { - sernofile = isernofile; - PrivateProfile ppCfg; - string sn; -// byte xor=0xCF; - ppCfg = new PrivateProfile(ucfgpath); - // sn=ppCfg.Attr("/ini/section[@name='override']/param[@name='SN']/@value"); - sn=ppCfg.Attr("override","SN"); - if (sn!=null && sn!="") - { - int indx = 0; - if ((indx = sn.IndexOf(";",0,sn.Length))>0) - SerialNum=System.Convert.ToInt32(sn.Substring(0,indx)); - else - SerialNum=System.Convert.ToInt32(sn); - if (SerialNum>SerialNumberOptionsByPlant.Length) - { - MessageBox.Show("Serial number in " + ucfgpath + " is invalid. Demo mode will be used","VE-PROMS"); - SerialNum=-1; - } - SerialNumTitle="Override"; - return; - } - - ppCfg=null; - SerialNum = -1; - if (DemoMode || !File.Exists(usrRT.ExeAdjust(sernofile))) - { - // no serial number file, put into demo mode. - SerialNumTitle = "Demo Mode"; - // MessageBox.Show("No Serial Number. Defaulting to Working Demo Mode.\n\nTo purchase VE-PROMS, contact Volian Enterorices Inc.\n\nPhone: (724) 335-3744\n\nEmail: VEPROMS@VOLIAN.COM\n\nSerial Number Warning"); - if (DemoMode) - { - MessageBox.Show("Thank you for trying our VE-PROMS Working Demo.\n\n"+ - "To purchase VE-PROMS, contact Volian Enterprises, Inc.\n\n"+ - "Phone: (724) 335-3744\n\n"+ - "Email: VolianEnterprises@volian.com", - "VE-PROMS Working Demo"); - } - else - { - MessageBox.Show("No Serial Number. Defaulting to Working Demo Mode.\n\n"+ - "To purchase VE-PROMS, contact Volian Enterprises, Inc.\n\n"+ - "Phone: (724) 335-3744\n\n"+ - "Email: VolianEnterprises@volian.com", - "Serial Number Warning"); - } - return; - } - - // open file & read in serial number - int i; - byte j; - FileStream fssn = null; - BinaryReader brsn = null; - byte xor=0xCF; -// sum=0xcf; - try - { - fssn = new FileStream(usrRT.ExeAdjust(sernofile),FileMode.Open,FileAccess.Read,FileShare.ReadWrite); - brsn = new BinaryReader(fssn); - int length = (int)fssn.Length-1024; - for (i=0;i<1024;i++) - { - j = nextchar(brsn); - xor ^= (byte)j; - if (j==0xCF) - { - if (SerialNum != -1) return; - SerialNum=i; - } - } - if (SerialNum == -1) - { - SerialNumTitle = "Demo Mode"; -// MessageBox.Show("No Serial Number. Defaulting to Working Demo Mode.\n\nTo purchase VE-PROMS, contact Volian Enterorices Inc.\n\nPhone: (724) 335-3744\n\nEmail: VEPROMS@VOLIAN.COM\n\nSerial Number Warning","VE-PROMS"); - MessageBox.Show("No Serial Number. Defaulting to Working Demo Mode.\n\n"+ - "To purchase VE-PROMS, contact Volian Enterprises, Inc.\n\n"+ - "Phone: (724) 335-3744\n\n"+ - "Email: VolianEnterprises@volian.com", - "Serial Number Warning"); - return; - } - // Just read past this byte. At this point we already - // have a serial number. We now just want to get the - // description text (usually plant/utility name) associated - // with the serial number. - j = nextchar(brsn); -// -// This was always failing. Could not find a reason why. Appears that -// the Exclusive OR arithmatic is a little different in .NET. The -// nextchar() funtion seems to be returning the correct values. -// -// if (j!=xor) -// { -// if (brsn!=null) brsn.Close(); -// if (fssn!=null) fssn.Close(); -// return; -// } - char [] title = new char[length]; - i=0; - while((--length) > 0 && (j=nextchar(brsn))!=0xFF) - { - title[i++] = (char)j; - } - SerialNumTitle = new string(title); - // remove the serial number at the beginning of the title - // - we didn't need to do this - jsj 7/18/2006 -// SerialNumTitle = SerialNumTitle.Substring(SerialNumTitle.IndexOf(' ')+1); - } - catch(Exception e) - { - MessageBox.Show(e.Message,"Serial Number Error"); - return; - } - if (brsn!=null) brsn.Close(); - if (fssn!=null) fssn.Close(); - } - - private byte nextchar(BinaryReader br) - { - byte retval = 0xFF; // unsigned -1 - try - { - byte nxt; - retval = br.ReadByte(); - if(retval != 0xFF) - { - nxt=retval; - retval=(byte)((nxt-sum) & 0xFF); - sum=(byte)(((nxt<<1) & 0xFE) | ((nxt>>7) & 0x1)); - } - } - catch(Exception e) - { -// MessageBox.Show(e.Message); - return retval; - } - - return retval; - } - - public uint GetSNOption(uint a) - { - if (SerialNum == -1) - return 0; - else - return ((uint)SerialNumberOptionsByPlant[SerialNum]&(uint)a); - } - - public string SerialNumberString - { - get - { - string rtnstr = ""; - if (SerialNum == -1) // demo - rtnstr = "Thank you for trying VE-PROMS"; - else - rtnstr = "Serial Number: " + SerialNum.ToString(); - - return rtnstr; - } - } - - public string SerialNumberTitleString - { - get - { - return SerialNumTitle; - } - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/ShrtNm.cs b/PROMS/ReferencedObjectsOld/LibSource/Utils/ShrtNm.cs deleted file mode 100644 index 44c83100..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/ShrtNm.cs +++ /dev/null @@ -1,51 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ShrtNm.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 7/27/04 8:34a $ - * - * $History: ShrtNm.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:34a - * Created in $/LibSource/Utils - *********************************************************************************************/ - -using System; -using System.Text; -using System.Runtime.InteropServices; -using System.ComponentModel; - -namespace Utils -{ - /// - /// Summary description for ShrtNm. - /// - public class ShortName - { - [DllImport("kernel32.dll", SetLastError=true, CharSet=CharSet.Auto)] - [return:MarshalAs(UnmanagedType.U4)] - public static extern int GetShortPathName( - [MarshalAs(UnmanagedType.LPTStr)] string lpszLongPath, - [MarshalAs(UnmanagedType.LPTStr)] StringBuilder lpszShortPath, - [MarshalAs(UnmanagedType.U4)] int cchBuffer); - - private string _LongFileName; - private StringBuilder _ShortFileName; - - public ShortName(string longname) - { - _LongFileName = longname; - _ShortFileName = new StringBuilder(256); - int len = GetShortPathName(_LongFileName,_ShortFileName,256); - if (len==256) _ShortFileName=null; - if (len==0) _ShortFileName.Append(longname); - } - - [Description("FileName")]public string ShortFileName - { - get{return _ShortFileName.ToString();} - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/SymbDlg.cs b/PROMS/ReferencedObjectsOld/LibSource/Utils/SymbDlg.cs deleted file mode 100644 index 716f7e24..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/SymbDlg.cs +++ /dev/null @@ -1,214 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: SymbDlg.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 7/27/04 8:34a $ - * - * $History: SymbDlg.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:34a - * Created in $/LibSource/Utils - *********************************************************************************************/ - -using System; -using System.Text; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace Utils -{ - /// - /// Summary description for SymbDlg. - /// - public class SymbDlg : System.Windows.Forms.Form - { - private System.Windows.Forms.TabControl tbctlSymbol; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private ListBox symlistbox; - public SymbolListB SymList1; - public string ReturnText; - private int NumItems; - private System.Windows.Forms.TextBox tbValue; - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button btnCancel; - public GridItem gridItem; - private string[] SymbolFonts = {"VESymb","Courier New","VolianDraw"}; - - public SymbDlg(SymbolListB symb, GridItem grditm) - { - // - // Required for Windows Form Designer support - // - ReturnText=null; - gridItem = grditm; - - SymList1 = symb; - NumItems = symb.SymbolListStrings.Length; - InitializeComponent(); - - DoListTabPage(); - DoGridTabPage(); - - if (gridItem!=null) - { - tbValue.Text = (string) gridItem.Value; - tbValue.Visible = true; - } - else - tbValue.Visible = false; - } - - private void DoGridTabPage() - { - //TabPage gridTabPage = new TabPage("Grid"); - //tbctlSymbol.TabPages.Add(gridTabPage); - } - - private void symlistbox_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) - { - // Set the DrawMode property to draw fixed sized items. - symlistbox.DrawMode = DrawMode.OwnerDrawFixed; - - // Draw the background of the ListBox control for each item. - e.DrawBackground(); - // Create a new Brush and initialize to a Black colored brush by default. - Brush myBrush = Brushes.Black; - Font fontVESymb = new Font(SymbolFonts[SymList1.SymbolList[e.Index].CharacterSet],e.Font.SizeInPoints); - Font fontregular = new Font("Courier New",e.Font.SizeInPoints); - float x; - // Draw the current item text based on the current Font and the custom brush settings. - e.Graphics.DrawString(SymList1.SymbolList[e.Index].CharacterCode,fontVESymb,myBrush,e.Bounds.Left,e.Bounds.Top); - x=e.Graphics.MeasureString(SymList1.SymbolList[e.Index].CharacterCode,fontVESymb).Width; - e.Graphics.DrawString(SymList1.SymbolListStrings[e.Index],fontregular,myBrush,e.Bounds.Left+x,e.Bounds.Top); - e.DrawFocusRectangle(); - } - - private void DoListTabPage() - { - TabPage listTabPage = new TabPage("List"); - tbctlSymbol.TabPages.Add(listTabPage); - symlistbox = new ListBox(); - symlistbox.Height = 200; - symlistbox.Width = 400; - listTabPage.Controls.Add(symlistbox); - symlistbox.DrawItem += new DrawItemEventHandler(symlistbox_DrawItem); - symlistbox.DoubleClick += new EventHandler(symlistbox_DoubleClick); - symlistbox.DrawMode = DrawMode.OwnerDrawFixed; - // add dummy items, these will be resolved when displayed. - for(int i=0; i - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(SymbDlg)); - this.tbctlSymbol = new System.Windows.Forms.TabControl(); - this.tbValue = new System.Windows.Forms.TextBox(); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // tbctlSymbol - // - this.tbctlSymbol.Location = new System.Drawing.Point(8, 0); - this.tbctlSymbol.Name = "tbctlSymbol"; - this.tbctlSymbol.SelectedIndex = 0; - this.tbctlSymbol.Size = new System.Drawing.Size(464, 264); - this.tbctlSymbol.TabIndex = 0; - // - // tbValue - // - this.tbValue.Location = new System.Drawing.Point(8, 280); - this.tbValue.Name = "tbValue"; - this.tbValue.Size = new System.Drawing.Size(504, 20); - this.tbValue.TabIndex = 1; - this.tbValue.Text = ""; - // - // btnOK - // - this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnOK.Location = new System.Drawing.Point(72, 320); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(104, 24); - this.btnOK.TabIndex = 2; - this.btnOK.Text = "Save Text"; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnCancel.Location = new System.Drawing.Point(208, 320); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(72, 23); - this.btnCancel.TabIndex = 3; - this.btnCancel.Text = "Cancel"; - // - // SymbDlg - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(672, 350); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnOK); - this.Controls.Add(this.tbValue); - this.Controls.Add(this.tbctlSymbol); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "SymbDlg"; - this.Text = "Symbol"; - this.ResumeLayout(false); - - } - #endregion - - private void btnOK_Click(object sender, System.EventArgs e) - { - ReturnText = tbValue.Text; - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/SymbDlg.resx b/PROMS/ReferencedObjectsOld/LibSource/Utils/SymbDlg.resx deleted file mode 100644 index d350e478..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/SymbDlg.resx +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - False - - - True - - - Private - - - Private - - - 8, 8 - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - SymbDlg - - - Private - - - - AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx - dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx - F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3 - d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx - dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3 - F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX - cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3 - F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX - cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/SymbLst.cs b/PROMS/ReferencedObjectsOld/LibSource/Utils/SymbLst.cs deleted file mode 100644 index ef3a92ab..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/SymbLst.cs +++ /dev/null @@ -1,142 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: SymbLst.cs $ $Revision: 2 $ - * $Author: Kathy $ $Date: 11/15/04 10:54a $ - * - * $History: SymbLst.cs $ - * - * ***************** Version 2 ***************** - * User: Kathy Date: 11/15/04 Time: 10:54a - * Updated in $/LibSource/Utils - * B2004-057: crash on scroll fixed & rest of PSI/Title symbols added - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:34a - * Created in $/LibSource/Utils - *********************************************************************************************/ - -using System; - -namespace Utils -{ - /// - /// Summary description for SymbLst. - /// - /// - public class SymbolListItem - { - public string CharacterCode; - public byte Translation; - public short CharacterSet; - public SymbolListItem(string cc, byte trans, short cs) - { - CharacterCode = cc; - Translation = trans; - CharacterSet = cs; - } - } - public class SymbolListB - { - public string[] SymbolListStrings; - public SymbolListItem[] SymbolList; - public SymbolListB() - { - } - } - - public class SymbolListSteps : SymbolListB // for steps - { - - public SymbolListSteps() - { - SymbolListStrings = new string[] - { - "Degree", - "Delta", - "Greater Than or Equal To", - "Less Than Or Equal To", - "Plus or Minus", - "Sigma", - "Gamma", - "One Half", - "ACCUM Character", - "Solid Bullet", - "Approximatly Equal", - "Similar or Equal", - "Division Symbol", - "Square Root", - "Rho", - "PI", - "Micro", - "Lower Case Delta", - "Lower Case Sigma", - "One Fourth", - "Distinguished Zero", - "Average Disintegration Energy", - "Grave", - "Vertical Line", - "Epsilon", - "Theta", - "Dot in Oval", - "Tau", - "Hard Space", - "Diamond", - "Turn On Bold", - "Turn Off Bold", - "Turn On Underline", - "Turn Off Underline", - "Turn On Italics", - "Turn Off Italics", - "Turn On Superscript", - "Turn Off Superscript", - "Turn On Subscript", - "Turn Off Subscript" - }; - - SymbolList = new SymbolListItem[] { - new SymbolListItem("\xB0",0xF8,0), /* ø - Degree */ - new SymbolListItem("\x44",0x7F,0), /*  - Delta */ - new SymbolListItem("\xB3",0xF2,0), /* ò - Greater Than or Equal */ - new SymbolListItem("\xA3",0xF3,0), /* ó - Less Than or Equal */ - new SymbolListItem("\xB1",0xF1,0), /* ñ - Plus or Minus */ - new SymbolListItem("\x53",0xE4,0), /* ä - Sigma */ - new SymbolListItem("\x67",0xE7,0), /* ç - (Printed as a Gamma) */ - new SymbolListItem("\xBD",0xAB,1), /* « - One Half */ - new SymbolListItem("\xFE",0xFE,0), /* þ - ACCUM Character */ - new SymbolListItem("\xB7",0x07,0), /*  - Solid Bullet */ - new SymbolListItem("\xBB",0xF7,0), /* Similar */ - new SymbolListItem("\x40",0xF0,0), /* ÷ - Approximately equal */ - new SymbolListItem("\xB8",0xF6,0), /* ö - Division symbol */ - new SymbolListItem("\xD6",0xFB,0), /* û - Square Root */ - new SymbolListItem("\x72",0xE2,0), /* â - (Printed as a rho) */ - new SymbolListItem("\x70",0xE3,0), /* ã - (Printed as pi) */ - new SymbolListItem("\x6D",0xE6,0), /* æ - micro */ - new SymbolListItem("\x64",0xEB,0), /* ë - Lower Case Delta */ - new SymbolListItem("\x73",0xE5,0), /* å - Lower Case Sigma */ - new SymbolListItem("\xBC",0xAC,1), /* ¬ - One Fourth */ - new SymbolListItem("\xC6",0xED,0), /* í - Distinguished Zero */ - new SymbolListItem("\x9F",0x90,0), // Average Deintegration Energy - new SymbolListItem("\xEC",0x8D,1), // Grave - new SymbolListItem("\xBD",0xB3,0), // Vertical Bar - new SymbolListItem("\x65",0xEE,0), // Epsilon - new SymbolListItem("\x71",0xE9,0), // Theta - new SymbolListItem("\x9E",0xEC,0), // Dot With Oval - new SymbolListItem("\x74",0xA8,0), // Tau - new SymbolListItem("\xA0",0xFF,1), // Hard Space - new SymbolListItem("\xA8",0xA9,0), // Diamond - new SymbolListItem("\xD5",0xD5,1), // Bold on - new SymbolListItem("\xD6",0xD6,1), // Bold off - new SymbolListItem("\xAE",0xAE,1), // Underline on - new SymbolListItem("\xAF",0xAF,1), // Underline off - new SymbolListItem("\xB2",0xB2,1), // Italics on - new SymbolListItem("\xDD",0xDD,1), // Italics off - new SymbolListItem("\xC6",0xC6,1), // Superscript on - new SymbolListItem("\xC7",0xC7,1), // Superscript off - new SymbolListItem("\xD1",0xD1,1), // Subscript on - new SymbolListItem("\xA6",0xA6,1) // Subscript off - }; - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/UsrRunTime.cs b/PROMS/ReferencedObjectsOld/LibSource/Utils/UsrRunTime.cs deleted file mode 100644 index 29f06624..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/UsrRunTime.cs +++ /dev/null @@ -1,624 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: UsrRunTime.cs $ $Revision: 9 $ - * $Author: Jsj $ $Date: 10/31/07 10:11a $ - * - * $History: UsrRunTime.cs $ - * - * ***************** Version 9 ***************** - * User: Jsj Date: 10/31/07 Time: 10:11a - * Updated in $/LibSource/Utils - * Bug fix to ExeAdjust() - * - * ***************** Version 8 ***************** - * User: Jsj Date: 7/21/06 Time: 2:57p - * Updated in $/LibSource/Utils - * added comment of logic that might be needed in future. - * - * ***************** Version 7 ***************** - * User: Jsj Date: 5/17/05 Time: 11:54a - * Updated in $/LibSource/Utils - * cleanup - * - * ***************** Version 6 ***************** - * User: Kathy Date: 4/21/05 Time: 10:17a - * Updated in $/LibSource/Utils - * issingleuser - * - * ***************** Version 5 ***************** - * User: Kathy Date: 4/12/05 Time: 1:00p - * Updated in $/LibSource/Utils - * B2004-050: single user needed network info - * - * ***************** Version 4 ***************** - * User: Kathy Date: 1/24/05 Time: 2:44p - * Updated in $/LibSource/Utils - * B2005-004 fixes - * - * ***************** Version 3 ***************** - * User: Kathy Date: 1/10/05 Time: 12:57p - * Updated in $/LibSource/Utils - * B2004-063 fix - * - * ***************** Version 2 ***************** - * User: Jsj Date: 11/12/04 Time: 10:32a - * Updated in $/LibSource/Utils - * Save the user's TEMP dir path ExeAjust() handles TEMP dir and Data Dir - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:34a - * Created in $/LibSource/Utils - *********************************************************************************************/ - -using System; -using System.IO; -using System.Windows.Forms; -using System.Text; -using Org.Mentalis.Files; - -namespace Utils -{ - public enum UserCStatus - { - PRINACTIVE=0, PRACTIVE=1 // process record is NOT active, active respectively - }; - - public class UserData - { - public byte UserStatus; - public string UserNetworkID; - public string UserName; - public string UserPhone1; - public string UserPhone2; - public string UserLoc1; - public string UserLoc2; - public string UserShell; // 1 - vfw; 2 - browser; 3 - 32-bit browser - public string UserProcess; - - // the first constructor loads data from a user's cfg file - public UserData(string ucfgpath) - { - if (File.Exists(ucfgpath)==false) return; - // create an xml node from the [User Data] in the cfg file & transfer - // to this. Note that the UserNetworkID is not set until the serial - // number is read to determine whether in multi-user-mode (B2004-050) - PrivateProfile ppUserData = new PrivateProfile(ucfgpath); - UserName=ppUserData.Attr("User Data","UserName"); - UserPhone1=ppUserData.Attr("User Data","UserPhone1"); - UserPhone2=ppUserData.Attr("User Data","UserPhone2"); - UserLoc1=ppUserData.Attr("User Data","UserLoc1"); - UserLoc2=ppUserData.Attr("User Data","UserLoc2"); - char tmp = '\x03'; - UserShell = tmp.ToString(); // 1 - vfw; 2 - browser; 3 - 32-bit browser - UserProcess=""; - ppUserData=null; - } - - public void SetNetworkID(string ucfgpath, bool inmultiuser) - { - // create an xml node from the [User Data] in the cfg file & transfer - // to this. - PrivateProfile ppUserData = new PrivateProfile(ucfgpath); - UserNetworkID=ppUserData.Attr("User Data","UserNetworkID"); - if (inmultiuser && (UserNetworkID == "" || UserNetworkID==null)) - { - MessageBox.Show("Invalid UserNetworkID from " + ucfgpath +", set before reexecuting VE-PROMS.","VE-PROMS Error"); - Environment.Exit(-1); - } - ppUserData=null; - } - // the next constructor gets the input 'nth' record from the dat file (dat file is - // passed in via a FileStream - public UserData(FileStream dfs, int n) - { - // seek to the position as defined by n. - long skpos = (long)(n * 140); // 140 is the size of the record from old proms. - dfs.Seek(skpos,SeekOrigin.Begin); - byte [] test = new byte[140]; - dfs.Read(test,0,140); - UserStatus = test[0]; - string tmp = Encoding.ASCII.GetString(test,0,140); - UserNetworkID = tmp.Substring(1,9).Replace('\0',' ').Trim(); - UserName = tmp.Substring(10,31).Replace('\0',' ').Trim(); - UserPhone1 = tmp.Substring(41,16).Replace('\0',' ').Trim(); - UserPhone2 = tmp.Substring(57,16).Replace('\0',' ').Trim(); - UserLoc1 = tmp.Substring(73,31).Replace('\0',' ').Trim(); - UserLoc2 = tmp.Substring(104,31).Replace('\0',' ').Trim(); - UserShell = tmp.Substring(135,2).Replace('\0',' ').Trim(); - UserProcess = tmp.Substring(137,3).Replace('\0',' ').Trim(); - } - - // write this user data out to the filestream at the current position in file - // defined in dfs - public void Write(FileStream dfs) - { - dfs.WriteByte(UserStatus); - byte[] btmp = Encoding.ASCII.GetBytes(UserNetworkID.PadRight(9,'\0')); - dfs.Write(btmp,0,9); - btmp = Encoding.ASCII.GetBytes(UserName.PadRight(31,'\0')); - dfs.Write(btmp,0,31); - btmp = Encoding.ASCII.GetBytes(UserPhone1.PadRight(16,'\0')); - dfs.Write(btmp,0,16); - btmp = Encoding.ASCII.GetBytes(UserPhone2.PadRight(16,'\0')); - dfs.Write(btmp,0,16); - btmp = Encoding.ASCII.GetBytes(UserLoc1.PadRight(31,'\0')); - dfs.Write(btmp,0,31); - btmp = Encoding.ASCII.GetBytes(UserLoc2.PadRight(31,'\0')); - dfs.Write(btmp,0,31); - btmp = Encoding.ASCII.GetBytes(UserShell.PadRight(2,'\0')); - dfs.Write(btmp,0,2); - btmp = Encoding.ASCII.GetBytes(UserProcess.PadRight(3,'\0')); - dfs.Write(btmp,0,3); - } - }; - - /// - /// Summary description for UserRunTime. This class contains all pertinent information - /// for the runtime for this instance of the program, including cfg, paths, menu file, - /// security, serial number, options, etc. - /// - public class UserRunTime - { - public string exepath; - public string syspath; - public string netsyspath; - public string TempDirPath; - - public string ucfgpath; // user config file name - public string appcfgpath; // app config file name - - public Security sec; - public SerialNo SerialNumber; - public string OptionsFile; - public string initials; // user login name - public string UserID; // cfg name and/or login - public MenuXML menuwinXML; - public MenuXML menuwin2XML; - public string myUserNetworkID; - public UserData myUserData; - public bool InMultiUserMode; - - // make some form properties here, such as color. - make need it's own class, - // - public UserRunTime() - { - menuwin2XML = null; - SetExeName(); - // load in xml list of plants. Then do exist tests to see if they - // exist on the datapath. - menuwinXML = new MenuXML(syspath + "\\menuwin.xml"); - } - - public void SetSecurity(Security isec) - { - // set the user's run time security settings. also, flag whether this user is - // running in multi user mode (just so we don't have to keep making this check - // later) - sec = isec; - // Do this separate (SetUserMode()) to remove interdependent logic path between - // security(vesam), user CFG file, and the serial number -// InMultiUserMode = (SerialNumber.GetSNOption((uint)Utils.SerialNo.SN_Flags.SN_NETWORK_ON)>0)?true:false; - } - - public void SetUserMode() - { - if (SerialNumber.SerialNum != -1) - InMultiUserMode = (SerialNumber.GetSNOption((uint)Utils.SerialNo.SN_Flags.SN_NETWORK_ON)>0)?true:false; - if (InMultiUserMode) myUserData.SetNetworkID(ucfgpath, InMultiUserMode); - } - - private bool IsSingleUserMode() - { - // Need to do: - // This needs to check if a lock is currently set as well - // - jsj 7/20/06 - return !InMultiUserMode; - } - - // Adjust the input file with the required pathname as follows: - // '~': (system path) i.e. c:\VE-PROMS - // '@': (executable path) i.e. c:\VE-PROMS\BIN - // '\342': current data directory i.e. c:\VEHPR1B\PROCS - // '\347': resolve for single user mode, append tempdir onto data dir i.e. TEMPS\JOHN____.D00 - public string ExeAdjust(string str) - { - if (exepath==null)SetExeName(); - - // This logic will allow me to combine the use of our special - // tokens. For example, I needed a user temp directory in the - // VE-PROMS root for the Search Across Procedure Sets option: - // "~\374results" --> C:\VE-PROMS\TEMPS\JOHN____.D00\RESUTLS - - StringBuilder exebuff = new StringBuilder(); - StringBuilder exetkn = new StringBuilder(str); - string exetkn_str = exetkn.ToString(); - int pos = 0; - char[] tchar = "~@\xE7\xE2".ToCharArray(); - /** Bug Fix: B2007-015 - * If a short file/directory name contained a ~ character, it was - * being processed, when it should not have. - * i.e. we were getting the current directory, then looping back up - * and searching the directory string (finding a ~ char) - * - * I added logic to use a starting position in the IndexOfAny() function - * so that we can skip past the portions already processes. - */ - while ((pos=exetkn_str.IndexOfAny(tchar,pos))>-1) - { - char[] chr; - string curdir = Directory.GetCurrentDirectory(); // for use with '\xE2' - chr = new char[exetkn_str.Length]; - chr = exetkn_str.ToCharArray(); - exetkn.Remove(pos,1); - - switch (chr[0]) - { - case '~': exetkn.Insert(pos,syspath+"\\"); // i.e. c:\VE-PROMS - pos += syspath.Length +1; - break; - case '@': exetkn.Insert(pos,exepath+"\\"); // i.e. c:\VE-PROMS\BIN - pos += exepath.Length + 1; - break; - case '\xE2': // case '\342': - exetkn.Insert(pos,curdir+"\\"); // i.e. c:\VEHPR1B\PROCS - pos += curdir.Length + 1; - break; - case '\xE7': // case '\347': - if (!IsSingleUserMode()&& TempDirPath!=null) - { - exetkn.Insert(pos,TempDirPath+"\\"); // i.e. TEMPS\JOHN____.D00 - pos += TempDirPath.Length + 1; - } - break; - } - exetkn_str = exetkn.ToString(); - } - return exetkn.ToString(); - } - - private void SetExeName() - { - ShortName sname = new ShortName(System.Environment.CommandLine); - string cmdlinepath = sname.ShortFileName; - string upbuff = cmdlinepath.ToUpper(); - string tmp = upbuff.Substring(1,upbuff.LastIndexOf("\\")-1); - int idx = tmp.IndexOf("VE-PROMS.NET"); - if (idx > 0) - { - exepath = tmp.Substring(0,idx+8) + tmp.Substring(idx+12); - syspath = exepath.Substring(0,exepath.IndexOf("\\BIN")); - netsyspath = syspath + ".NET"; - } - else - { - exepath = tmp; - syspath = exepath.Substring(0,exepath.IndexOf("\\BIN")); - netsyspath = syspath + ".NET"; - } - } - - public void SetAppConfig(string pth) - { - appcfgpath = pth; - } - - public bool SetUserConfig() - { - bool Rtnval = true; - PrivateProfile Veproms_ini = new PrivateProfile(ExeAdjust("~veproms.ini")); - // Find the UserId (not the number, he name/initials) - if (UserID==null || UserID.Equals("")) - { - // see if it's defined via an environment variable - UserID = System.Environment.GetEnvironmentVariable("userid"); - if (UserID == null) - { - // Check the VEPROMS.INI file -// UserID = Veproms_ini.Attr("/ini/section[@name='veconfig']/param[@name='userid']/@value"); - UserID = Veproms_ini.Attr("veconfig","userid"); - } - if (UserID == null || UserID.Equals("")) - { - if (sec.initials != null && !sec.initials.Equals("")) - { - // default to the user's login name - UserID = sec.initials; - } - else - { - // default to VEPROMS.CFG - UserID = "VEPROMS"; - } - } - } - // Fing the VECONFIG path - ucfgpath=System.Environment.GetEnvironmentVariable("veconfig"); - // If VECONFIG environment variable not set then check the - // VEPROMS.INI file for VECONFIG settings. - if (ucfgpath == null || ucfgpath.Equals("")) - { -// ucfgpath = Veproms_ini.Attr("/ini/section[@name='veconfig']/param[@name='file']/@value"); - ucfgpath = Veproms_ini.Attr("veconfig","file"); - if (ucfgpath==null || ucfgpath.Equals("")) - { - // still no path, use default cfg file path - ucfgpath = ExeAdjust("~CONFIG"); - } - } - - if (ucfgpath != null) - { - string tmp_UID=""; - // See it the VECONFIG path includes a CFG file name. - // if no CFG file name, then build one based on userid - bool atroot = ucfgpath.EndsWith(":\\"); - if (!atroot) - { - if (ucfgpath.EndsWith("\\")) - { - // trim the ending backslash - ucfgpath = ucfgpath.Substring(0,ucfgpath.Length-1); - } - } - //See if we need to build a CFG file name - if (atroot || Directory.Exists(ucfgpath)) - { - // use the no more than the first 8 chars of the userid - tmp_UID = (UserID.Length > 8)?UserID.Substring(0,8) : UserID; - - // Build the CFG file name and append to the VECONFIG path - ucfgpath = ucfgpath + "\\" + tmp_UID + ".CFG"; - } - } - if (File.Exists(ucfgpath)) - myUserData = new UserData(ucfgpath); - else - { - // error - cfg file does not exist - Rtnval = false; - MessageBox.Show("Configuration file:\n\n" + ucfgpath + "\n\nDoes not exist","Missing CFG file"); - } - return Rtnval; - } - - public void FreeMenuWinXML() - { - menuwinXML=null; - } - public void LoadMenuWin2() - { - if (menuwin2XML == null) - menuwin2XML = new MenuXML(syspath + "\\menuwin2.xml"); - // menuwin2XML = new MenuXML("e:\\ve-proms\\menuwin2.xml"); - } - public void FreeMenuWin2XML() - { - menuwin2XML=null; - } - - // The following methods update the cfg file (delete item, add item & mod) - //public bool DeletePathFromCfg(string delpth) - //{ - // IniReader in1 = new IniReader(ucfgpath); - // string curpath = in1.ReadString("Menu","DataPath",""); - // string modpath = curpath.Replace(delpth,""); - // inifile.WriteINIKeyValueStr("Menu","DataPath",modpath,ucfgpath); - // return true; - //} - - //public void AddPathToCfg(string pth) - //{ - // string newpath=null; - // INIFile inifile = new INIFile(); - // string curpath = inifile.GetINIKeyValueStr("Menu","DataPath","",132,ucfgpath); - // string tmp = curpath.TrimEnd(" \t".ToCharArray()); - // // If none exists, just add that entered, if it ends with ';', don't add another - // if (tmp==null||tmp=="") - // newpath = pth; - // else if (tmp.Substring(tmp.Length-1,1)==";") - // newpath = tmp + pth; - // else - // newpath = tmp+";"+pth; - // inifile.WriteINIKeyValueStr("Menu","DataPath",newpath,ucfgpath); - //} - - //public void ModTitleToCfg(string oldtitle, string newtitle) - //{ - // INIFile inifile = new INIFile(); - // string curpath = inifile.GetINIKeyValueStr("Menu","DataPath","",132,ucfgpath); - // string newpath=curpath.Replace(oldtitle,newtitle); - // inifile.WriteINIKeyValueStr("Menu","DataPath",newpath,ucfgpath); - //} - - // Check if plant (defined by location) is in the menuwin file. Return 0 if not, - // 1 if in file and -1 if error reading file. - public int IsInMenuWin(string location) - { - // see if this plant is already in the file, check menuwin - // and if there, assume in both. - try - { - // Create an instance of StreamReader to read from a file. - // The using statement also closes the StreamReader. - using (StreamReader sr = new StreamReader(syspath+"\\menuwin")) - { - string line; - while ((line = sr.ReadLine()) != null) - { - int indx; - indx = line.ToUpper().IndexOf(location.ToUpper()); - if (indx>-1) - { - sr.Close(); - return 1; - } - } - } - } - catch (Exception e) - { - // Let the user know what went wrong. - Console.WriteLine("Could not test " + e.Message + " for plant existence in menuwin file"); - return -1; - } - return 0; - } - - public bool AddToMenuWin(string title,string location) - { - int inmenufile = IsInMenuWin(location); - if (inmenufile==-1)return false; // error checking for it - if (inmenufile==1)return true; // already there. - - // make backup files in case of failure. - FileInfo menuwinbak = new FileInfo(syspath+"\\menuwin"); - menuwinbak.CopyTo(syspath+"\\menuwin.BAK",true); - menuwinbak=null; - - // add the title and location to the menuwin menuwin.xml files. - // menuwin first. - FileStream fs = new FileStream(syspath+"\\menuwin", - FileMode.Open, FileAccess.ReadWrite, FileShare.None); - - // if the file couldn't open, give an error. - if (fs == null) - { - MessageBox.Show("Could not add plant to menuwin file.","VE-PROMS"); - menuwinbak = new FileInfo(syspath+"\\menuwin.BAK"); - menuwinbak.Delete(); - return false; - } - // go to last character of file & see if we have a /r/n. There - // needs to be a single newline between plants in the menuwin file - // or an error will occur. - fs.Seek(-2,SeekOrigin.End); - StreamReader tmpReader = new StreamReader(fs); - int tmpi1 = tmpReader.Peek(); - bool hasnewline=false; - if (tmpi1==0xD)hasnewline=true; - fs.Seek(0,SeekOrigin.End); - - StreamWriter swFromFileStream = new StreamWriter(fs); - if (hasnewline) - swFromFileStream.Write(title); - else - swFromFileStream.Write("\r\n"+title); - string tmpl = "\r\n{t}" + location + " menu ~menu1a\r\n"; - swFromFileStream.Write(tmpl); - swFromFileStream.Flush(); - swFromFileStream.Close(); - fs.Close(); - - // now add menuwin.xml text, add this before the end tags for - // system attach & menuwin (i.e. that's the seek part of this - // subtracting from end of file the number of characters for - // these two tags. - // make backup files in case of failure. - FileInfo menuwinxbak = new FileInfo(syspath+"\\menuwin"); - menuwinxbak.CopyTo(syspath+"\\menuwinx.BAK",true); - menuwinxbak=null; - - fs = new FileStream(syspath+"\\menuwin.xml", - FileMode.Open, FileAccess.Write, FileShare.None); - if (fs == null) - { - MessageBox.Show("Could not add plant to menuwin.xml file.","VE-PROMS"); - //delete menuwin & rename the bak file. - menuwinbak = new FileInfo(syspath+"\\menuwin"); - menuwinbak.Delete(); - menuwinbak = null; - menuwinbak = new FileInfo(syspath+"\\menuwin.BAK"); - menuwinbak.CopyTo(syspath+"\\menuwin"); - menuwinbak.Delete(); - menuwinxbak = new FileInfo(syspath+"\\menuwinx.BAK"); - menuwinxbak.Delete(); - return false; - } - long flen = fs.Length; - fs.SetLength(flen-27); //remove tags. - fs.Seek(0,SeekOrigin.End); - swFromFileStream = new StreamWriter(fs); - swFromFileStream.Write("\r\n"); - swFromFileStream.Write(title); - swFromFileStream.Write("\r\n{t}"); - swFromFileStream.Write(location); - swFromFileStream.Write(" menu menu1a\r\n\r\n"); - swFromFileStream.Write("\r\n"); - - swFromFileStream.Flush(); - swFromFileStream.Close(); - fs.Close(); - menuwinbak = new FileInfo(syspath+"\\menuwin.BAK"); - menuwinbak.Delete(); - menuwinxbak = new FileInfo(syspath+"\\menuwinx.BAK"); - menuwinxbak.Delete(); - // reload so that the new plant node gets added to the xml tree. - menuwinXML = null; - menuwinXML = new MenuXML(syspath + "\\menuwin.xml"); - MessageBox.Show("Please send \\ve-proms\\menuwin & \\ve-proms\\menuwin.xml files to Volian.","VE-PROMS"); - return true; - } - - public bool ModMenuWin(string newtitle, string oldtitle) - { - // replace the oldtitle with the new in both the menuwin file - // and the menuwin.xml file. - FileInfo menuwinbak = new FileInfo(syspath+"\\menuwin"); - menuwinbak.CopyTo(syspath+"\\menuwin.BAK",true); - menuwinbak=null; - - // read the whole file, replace the plant title string & save the file. - StreamReader sr = File.OpenText(syspath+"\\menuwin"); - string input; - if ((input=sr.ReadToEnd())!=null) - { - sr.Close(); - string output = input.Replace(oldtitle,newtitle); - StreamWriter sw = new StreamWriter(syspath+"\\menuwin",false); - sw.Write(output); - sw.Close(); - } - else - { - sr.Close(); - MessageBox.Show("Could not update menuwin file with new plant title","VE-PROMS"); - menuwinbak = new FileInfo(syspath+"\\menuwin.BAK"); - menuwinbak.CopyTo(syspath+"\\menuwin",true); - menuwinbak.Delete(); - return false; - } - - // now do the xml file. - menuwinbak = new FileInfo(syspath+"\\menuwin.xml"); - menuwinbak.CopyTo(syspath+"\\menuwinx.BAK",true); - menuwinbak=null; - - // read the whole file, replace the plant title string & save the file. - sr = File.OpenText(syspath+"\\menuwin.xml"); - if ((input=sr.ReadToEnd())!=null) - { - sr.Close(); - string output = input.Replace(oldtitle,newtitle); - StreamWriter sw = new StreamWriter(syspath+"\\menuwin.xml",false); - sw.Write(output); - sw.Close(); - } - else - { - sr.Close(); - MessageBox.Show("Could not update menuwin.xml file with new plant title","VE-PROMS"); - menuwinbak = new FileInfo(syspath+"\\menuwin.BAK"); - menuwinbak.CopyTo(syspath+"\\menuwin",true); - menuwinbak.Delete(); - menuwinbak = new FileInfo(syspath+"\\menuwinx.BAK"); - menuwinbak.CopyTo(syspath+"\\menuwin.xml",true); - menuwinbak.Delete(); - return false; - } - - return true; - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/Utils.csproj b/PROMS/ReferencedObjectsOld/LibSource/Utils/Utils.csproj deleted file mode 100644 index 0912123e..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/Utils.csproj +++ /dev/null @@ -1,207 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {680054D3-49C4-40E7-92A5-67B97DCE6308} - Debug - AnyCPU - - - - - Utils - - - JScript - Grid - IE50 - false - Library - Utils - OnBuildSuccess - - - - - 0.0 - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - - - - dznet - f:\DynaZip Max\Redist\dznet.dll - hklm\dn\dynazip for .net - - - System - - - System.Data - - - System.Drawing - - - System.Windows.Forms - - - System.XML - - - - - Form - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Form - - - Code - - - Code - - - Code - - - Code - - - Form - - - About.cs - - - SymbDlg.cs - - - ZipFuncsDlg.cs - - - - - - False - .NET Framework 2.0 %28x86%29 - true - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - - - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04} - Org.Mentalis.Files - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/Utils.sln b/PROMS/ReferencedObjectsOld/LibSource/Utils/Utils.sln deleted file mode 100644 index b1e9e435..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/Utils.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Utils", "Utils.csproj", "{680054D3-49C4-40E7-92A5-67B97DCE6308}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Debug|Any CPU.Build.0 = Debug|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Release|Any CPU.ActiveCfg = Release|Any CPU - {680054D3-49C4-40E7-92A5-67B97DCE6308}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/VEdt.cs b/PROMS/ReferencedObjectsOld/LibSource/Utils/VEdt.cs deleted file mode 100644 index ad55ff69..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/VEdt.cs +++ /dev/null @@ -1,98 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: VEdt.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 7/27/04 8:35a $ - * - * $History: VEdt.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:35a - * Created in $/LibSource/Utils - *********************************************************************************************/ - -using System; - -namespace Utils -{ - /// - /// Summary description for VEdt. - /// - public class VEDateTime - { - public DateTime dt; - public string dtstr; - - public VEDateTime(long tm) - { - System.Globalization.CultureInfo info = - new System.Globalization.CultureInfo("en-US", false); - - System.Globalization.Calendar calendar = info.Calendar; - - - // do some conversion so that proms will be able to use this - // date/time. Proms had it in seconds since 00:00:00 1/1/1970. - // .NET has it in ticks since 00:00:00 1/1/1 - DateTime promsdt = new DateTime(1970,1,1,0,0,0,0); // Jan 1, 1970 - - // - // Get the offset time between this time zone and UTC (GMT) time. - // Convert the offset to seconds. - // Subtract the offset from the UTC time gotten for Jan 1, 1970 - ThisTimeZone TZ = new ThisTimeZone(); - TimeSpan TimeZoneSpan = TZ.GetUtcOffset(promsdt); // Time Zone offset from UTC - long TimeZoneAdj = Math.Abs(TimeZoneSpan.Ticks / 10000000); // convert to seconds - DateTime cnv = promsdt.AddSeconds(tm-TimeZoneAdj); - dtstr = cnv.ToLongDateString() + " " + cnv.ToLongTimeString(); - } - } - /* - * TimeZone is an Abstract Class. You need to inherit the TimeZone Class - * and overload a couple of it's functions in order to use it. - * - called in CalculatePromsDate() above. - */ - public class ThisTimeZone : TimeZone - { - private TimeZone curTZ; - public TimeSpan SpanTZ; - - public ThisTimeZone() - { - curTZ = CurrentTimeZone; // local timezone - } - - // get the UTC (GMT) value for the given date/time - public override TimeSpan GetUtcOffset(DateTime ForThisDate) - { - SpanTZ = curTZ.GetUtcOffset(ForThisDate); - return SpanTZ; - } - - // Name of the local Daylight savings time zone - public override string DaylightName - { - get - { - return curTZ.DaylightName; - } - } - - // Name of the local standard time zone - public override string StandardName - { - get - { - return curTZ.StandardName; - } - } - - // Get the start and end dates for daylight savings - public override System.Globalization.DaylightTime GetDaylightChanges(int year) - { - return curTZ.GetDaylightChanges(year); - } - } -} - diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/ZipFuncs.cs b/PROMS/ReferencedObjectsOld/LibSource/Utils/ZipFuncs.cs deleted file mode 100644 index ebfac433..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/ZipFuncs.cs +++ /dev/null @@ -1,647 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ZipFuncs.cs $ $Revision: 2 $ - * $Author: Kathy $ $Date: 8/10/04 9:12a $ - * - * $History: ZipFuncs.cs $ - * - * ***************** Version 2 ***************** - * User: Kathy Date: 8/10/04 Time: 9:12a - * Updated in $/LibSource/Utils - * force copy for backup of zip file on checks (was crashing) - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:35a - * Created in $/LibSource/Utils - *********************************************************************************************/ - -using System; -using System.Text; -using System.IO; -using System.Runtime.InteropServices; -using System.Collections.Specialized; - -namespace Utils -{ - /// - /// Zip and UnZip functions. - /// - public class ZipFuncs - { - [DllImport("Kernel32.DLL")] public static extern uint GetDriveType(char[] lpRootPathName); - private CDZipNET dzip; - private CDUnZipNET duzip; - - private string _strZipPathAndFile; // full path and zip file name - private bool _CancelZip; - - private bool _zipOnRemovable; // i.e. floppy disk - - private int _ArchiveType; // Full or Partial - - private string _strZipFileExcludeList; // what not to zip - - private string _strComment; // user's zip comment - private string _strFilesToArchive; // what to zip up - - private string _strArcTitle; // user's archive title - - private string _strDestPath; // place to unzip to - - //#define DRIVE_UNKNOWN 0 - //#define DRIVE_NO_ROOT_DIR 1 - //#define DRIVE_REMOVABLE 2 - //#define DRIVE_FIXED 3 - //#define DRIVE_REMOTE 4 - //#define DRIVE_CDROM 5 - //#define DRIVE_RAMDISK 6 - - private enum DriveType - { - DRIVE_UNKNOWN=0, - DRIVE_NO_ROOT_DIR, - DRIVE_REMOVABLE, - DRIVE_FIXED, - DRIVE_REMOTE, - DRIVE_CDROM, - DRIVE_RAMDISK - } - - private enum ZipTypes - { - Full=0, - Partial=1 - } - - // Contstructor for an existing Zip file - public ZipFuncs(string iZipFile) - { - _strZipPathAndFile = iZipFile; - SetupDestinationPath(); - _CancelZip = false; - // populate local variables with Zip file's - // Title, Archive type, and Comment - GetZipCommentInformation(); - } - - // Constructor for a new Zip file - public ZipFuncs() - { - _strZipPathAndFile = ""; - _CancelZip = false; - } - - //public properties - public string strArcTitle - { - get { return _strArcTitle; } - set {_strArcTitle = value.ToString(); } - } - - public string strZipPathAndFile - { - get { return _strZipPathAndFile;} - set - { - _strZipPathAndFile = value.ToString(); - SetupDestinationPath(); - // populate local variables with Zip file's - // Title, Archive type, and Comment - GetZipCommentInformation(); - } - } - - public string strUnZipDestPath - { - get { return _strDestPath; } - set - { - _strDestPath = value.ToString(); - } - } - - public bool CancelZip - { - get { return _CancelZip;} - set { _CancelZip = value; } - } - - public bool zipOnRemovable - { - get { return _zipOnRemovable;} - set { _zipOnRemovable = value;} - } - - public int ArchiveType - { - get { return _ArchiveType;} - set { _ArchiveType = value; } - } - - public string strFilesToArchive - { - get { return _strFilesToArchive; } - set { _strFilesToArchive = value.ToString(); } - } - - public string strZipFileExcludeList - { - get { return _strZipFileExcludeList; } - set { _strZipFileExcludeList = value.ToString(); } - } - - public string strComment - { - get {return _strComment;} - set - { -// if (value == null) -// _strComment = ""; -// else - _strComment = (value == null)?"":value.ToString(); - } - } - - public bool CreateNewZipFile() - { - return _GenerateZipFile(true); - } - - public bool UpdateZipFile() - { - return _GenerateZipFile(false); - } - - - private bool _GenerateZipFile(bool NewFileFile) - { - StringBuilder cmntTxt = new StringBuilder(); - bool rtnval; - ZipFuncsDlg zpDlg = new ZipFuncsDlg(); - - dzip = new CDZipNET(); - _CancelZip = false; - _zipOnRemovable = IsARemovableDisk(); - - // Setup DynaZip - - // build comment field text - cmntTxt.Append(_strArcTitle); - cmntTxt.Append("\n"); - if (_ArchiveType == (int)ZipFuncs.ZipTypes.Partial) - { - // Do not recurse the sub directories when doing a partial archive - cmntTxt.Append("PARTIAL\n"); - dzip.RecurseFlag = false; - } - else - { - cmntTxt.Append("FULL\n"); - dzip.RecurseFlag = true; - } - cmntTxt.Append(_strComment); - dzip.AddCommentFlag = true; - dzip.Comment = cmntTxt.ToString(); // zip file comment string - - // CompressionFactors 10 - 19 are not compatable with older zip programs - // (i.e WinZip 7.0) - dzip.CompressionFactor = 9; // maxium compression - dzip.ExcludeFollowingFlag = true; - dzip.ExcludeFollowing = _strZipFileExcludeList; - dzip.ItemList = _strFilesToArchive; - dzip.LargeZIPFilesFlag = true; - dzip.ZIPFile = _strZipPathAndFile; // zip file name with full path - - // Is the target zip path on a removable dirve? - if (_zipOnRemovable) - { - dzip.MultiVolumeControl = CDZipNET.MULTIVOLCONTROL.MV_USEMULTI; - } - else - { - dzip.MultiVolumeControl = CDZipNET.MULTIVOLCONTROL.MV_NONE; - } - - // setup status bars - dzip.MajorStatusFlag = true; - dzip.MinorStatusFlag = true; - dzip.ZipMajorStatus += new CDZipNET.OnZipMajorStatus(zpDlg.ZipMajorStatus_event); - dzip.ZipMinorStatus += new CDZipNET.OnZipMinorStatus(zpDlg.ZipMinorStatus_event); - _CancelZip = false; - - zpDlg.Show(); - - // Do the Zip function - if (!NewFileFile) - dzip.ActionDZ = CDZipNET.DZACTION.ZIP_UPDATE; //update existing zip file - else - dzip.ActionDZ = CDZipNET.DZACTION.ZIP_ADD; // create new zip file - - rtnval = (zpDlg.DialogResult == System.Windows.Forms.DialogResult.OK); - zpDlg.Dispose(); - - // check for errors during the zip function. - if (rtnval) - rtnval = CheckZipErrorCode(); - - // if we are zipping to a different location than the current procedure - // set directory, we always want to return false so that this newly - // created zip file is not placed in the VE-PROMS tree. - if (_zipOnRemovable || ZipFileNotInCurrentDirectory()) - rtnval = false; - - return rtnval; - } - - // If there is a problem with the Zip file header, try to fix it. - private bool FixZipFile() - { - bool rtnval; - string ZipFileName = _strZipPathAndFile; - string backupName = ZipFileName.Substring(0,ZipFileName.LastIndexOf(".")) + ".bku"; - _CancelZip = false; - // save a copy of the zip file - File.Copy(ZipFileName,backupName,true); - dzip.FixFlag = true; - dzip.ActionDZ = CDZipNET.DZACTION.ZIP_UPDATE; - if (dzip.ErrorCode == CDZipNET.ZIPRESPONSE.ZE_FORM ) - { - dzip.FixFlag = false; - dzip.FixHarderFlag = true; - dzip.ActionDZ = CDZipNET.DZACTION.ZIP_UPDATE; - dzip.FixHarderFlag = false; - } - rtnval = (dzip.ErrorCode == 0); // 0 = success - - if (!rtnval) - { - // not successful, so restore from the backup file - File.Copy(backupName,ZipFileName,true); - } - File.Delete(backupName); // delete the backup file - return rtnval; - } - - private bool CheckZipErrorCode() - { - bool rtnval; - - switch (dzip.ErrorCode) - { - case CDZipNET.ZIPRESPONSE.ZE_OK: // ZE_OK - rtnval = true; - break; - case CDZipNET.ZIPRESPONSE.ZE_FORM: // ZE_FORM - case CDZipNET.ZIPRESPONSE.ZE_TEST: // ZE_TEST - // Internal organization of ZIP file is dammaged. - // Try using the Fix function - // note that you cannot do the fix on removable media - if (!zipOnRemovable) - rtnval = FixZipFile(); - else - rtnval = false; - break; - case CDZipNET.ZIPRESPONSE.ZE_ABORT: // ZE_ABORT - rtnval = false; - break; - default: - rtnval = false; - break; - } - return rtnval; - } - - // If there is a problem with the Zip file header, try to fix it. - private bool FixUnZipFile() - { - bool rtnval; - string ZipFileName = _strZipPathAndFile; - string backupName = ZipFileName.Substring(0,ZipFileName.LastIndexOf(".")) + ".bku"; - _CancelZip = false; - dzip = new CDZipNET(); - dzip.ZIPFile = duzip.ZIPFile; - // save a copy of the zip file - File.Copy(ZipFileName,backupName,true); - dzip.FixFlag = true; - dzip.ActionDZ = CDZipNET.DZACTION.ZIP_UPDATE; - if (dzip.ErrorCode == CDZipNET.ZIPRESPONSE.ZE_FORM) - { - dzip.FixFlag = false; - dzip.FixHarderFlag = true; - dzip.ActionDZ = CDZipNET.DZACTION.ZIP_UPDATE; - dzip.FixHarderFlag = false; - } - rtnval = (dzip.ErrorCode == CDZipNET.ZIPRESPONSE.ZE_OK); // 0 = success - dzip.Dispose(); - - if (!rtnval) - { - // not successful, so restore from the backup file - File.Copy(backupName,ZipFileName,true); - } - File.Delete(backupName); // delete the backup file - return rtnval; - } - - private bool CheckUnZipErrorCode() - { - bool rtnval; - switch (duzip.ErrorCode) - { - case CDUnZipNET.UNZIPRESPONSE.UE_OK: // UE_OK - rtnval = true; - break; - case CDUnZipNET.UNZIPRESPONSE.UE_STRUCT: // UE_STRUCT - // Internal organization of ZIP file is dammaged. - // Try using the Fix function - rtnval = FixUnZipFile(); - break; - case CDUnZipNET.UNZIPRESPONSE.UE_ABORT: // UE_ABORT - case CDUnZipNET.UNZIPRESPONSE.UE_CANCEL: // UE_CANCEL - rtnval = false; - break; - default: - rtnval = false; - break; - } - return rtnval; - } - - public bool AddZipCommentInformation() - { - StringBuilder cmntTxt = new StringBuilder(); - dzip = new CDZipNET(); - _CancelZip = false; - // Save the current attributes of the zip file, update zip file - // and then restore attributes - // - the zip file might be readonly - System.IO.FileAttributes saveAttribs = File.GetAttributes(_strZipPathAndFile); - File.SetAttributes(_strZipPathAndFile,FileAttributes.Normal); - // add comment - cmntTxt.Append(_strArcTitle); - cmntTxt.Append("\n"); - if (_ArchiveType == (int)ZipTypes.Partial) - cmntTxt.Append("PARTIAL\n"); - else - cmntTxt.Append("FULL\n"); - cmntTxt.Append(_strComment); - dzip.AddCommentFlag = true; - dzip.Comment = cmntTxt.ToString(); - dzip.ZIPFile = _strZipPathAndFile; // zip file name with full path - dzip.ActionDZ = CDZipNET.DZACTION.ZIP_ADD; - File.SetAttributes(_strZipPathAndFile,saveAttribs); - return CheckZipErrorCode(); - } - - public bool GetZipCommentInformation() - { - int x; - string ZipComment; - string strArcType; - _CancelZip = false; - if (!(File.Exists(_strZipPathAndFile))) - return false; // !!! no zip file - duzip = new CDUnZipNET(); - duzip.ZIPFile = _strZipPathAndFile; // zip file name with full path - duzip.ActionDZ = CDUnZipNET.DUZACTION.UNZIP_GETCOMMENTSIZE; - if (!CheckUnZipErrorCode()) - return false; // error - if (duzip.ReturnCount <= 0) - return false; // no comment informat - duzip.ActionDZ = CDUnZipNET.DUZACTION.UNZIP_GETCOMMENT; - ZipComment = duzip.ReturnString; - x = ZipComment.IndexOf("\n"); - if (x < 0) return false; // nothing in comment - _strArcTitle = ZipComment.Substring(0,x); - ZipComment = ZipComment.Substring(x+1); - x = ZipComment.IndexOf("\n"); - if (x > 0) - { - strArcType = ZipComment.Substring(0,x); - if (strArcType.Equals("FULL")) - _ArchiveType = (int)ZipTypes.Full; - else - _ArchiveType = (int)ZipTypes.Partial; - _strComment = ZipComment.Substring(x+1); - } - else - { - // at this point, default to a full archive - _ArchiveType = (int)ZipTypes.Full; - // default to path and filename for the comment - _strComment = _strZipPathAndFile; - } - return true; - } - - private bool IsARemovableDisk() - { - uint DrvType; - string tmp = _strZipPathAndFile.Substring(0,2); - DrvType = GetDriveType(tmp.ToCharArray()); - return (DrvType.Equals((uint)DriveType.DRIVE_REMOVABLE)); - } - - private bool ZipFileNotInCurrentDirectory() - { - string curdir = Directory.GetCurrentDirectory(); - string tmpstr = _strZipPathAndFile.ToUpper(); - if (tmpstr.EndsWith(".ZIP")) - tmpstr = tmpstr.Substring(0,tmpstr.LastIndexOf(".")); - return tmpstr.Equals(curdir); - } - - public bool UnzipFromZipFile() - { - return _UnzipFromZipFile(true); // unzip from the archive - } - - public bool TestTheZipFile() - { - return _UnzipFromZipFile(false); // test the archive - } - - private bool _UnzipFromZipFile(bool ExtractFiles) - { - StringBuilder cmntTxt = new StringBuilder(); - bool rtnval; - ZipFuncsDlg zpDlg = new ZipFuncsDlg(); - // StringBuilder cmntTxt = new StringBuilder(); - // VEO_Archive arc = (VEO_Archive) _CurObj; - duzip = new CDUnZipNET(); - _zipOnRemovable = IsARemovableDisk(); - - // Setup DynaZip - - // zip file name with full path - duzip.ZIPFile = _strZipPathAndFile; - - //root of drive letter -// duzip.Destination = Path.GetPathRoot(_strZipPathAndFile); - duzip.Destination = _strDestPath; - - // what files to get from the zip file - duzip.Filespec = "*.*"; // get all files - - //Replace - this combination of flags results in unzipping all files whether - // they were changed or not. - duzip.FreshenFlag = false; - duzip.UpdateFlag = false; - - // Make a reference to a single byte to avoid null access - duzip.MemoryBlock = new Byte[1]; - - // true = Overwrite non-read only files without asking - duzip.OverwriteFlag = true; - - // true = proceed to unzip by traversing into folders - duzip.RecurseFlag = true; - - duzip.UnzipSubOptions = CDUnZipNET.UNZIPSUBOPTION.USO_NONE; - - // set this option to allow the overwriting of ReadOnly Files. - // this option only has meaning when the OverwriteFlag property - // is set to true - duzip.UnzipSubOptions |= CDUnZipNET.UNZIPSUBOPTION.USO_OVERWRITE_RO; - - // allow the MinorCancel event to respond to cancel requests - duzip.UnzipSubOptions |= CDUnZipNET.UNZIPSUBOPTION.USO_MINORCANCEL; - - // debug -// duzip.DiagnosticFlag = true; -// duzip.UnzipSubOptions |= CDUnZipNET.UNZIPSUBOPTION.USO_LOGZIPRESULTS; - - // setup status bars - duzip.MajorStatusFlag = true; - duzip.MinorStatusFlag = true; - duzip.MessageCallbackFlag = true; - duzip.UnZipMajorStatus += new CDUnZipNET.OnUnZipMajorStatus(zpDlg.ZipMajorStatus_event); - duzip.UnZipMinorStatus += new CDUnZipNET.OnUnZipMinorStatus(zpDlg.ZipMinorStatus_event); - - _CancelZip = false; - - zpDlg.Show(); // display the status dialog - - if (!ExtractFiles) - duzip.TestFlag = true; // don't extract, only test each item in zip file - - // Do the UnZip function - duzip.ActionDZ = CDUnZipNET.DUZACTION.UNZIP_EXTRACT; - rtnval = (zpDlg.DialogResult == System.Windows.Forms.DialogResult.OK); - zpDlg.Dispose(); - - // check for errors during the unzip function. - if (!CheckUnZipErrorCode()) - return false; // error - if (duzip.ReturnCount <= 0) - return false; // nothing unzipped - - return rtnval; - } - - public StringCollection ZipFileContents() - { - StringCollection ZipFileList = new StringCollection(); - StringBuilder cmntTxt = new StringBuilder(); - duzip = new CDUnZipNET(); - _zipOnRemovable = false; - - // Setup DynaZip - - // zip file name with full path - duzip.ZIPFile = _strZipPathAndFile; - - // what files to get from the zip file - duzip.Filespec = "*.*"; // get all files - - //Replace - this combination of flags results in unzipping all files whether - // they were changed or not. - duzip.FreshenFlag = false; - duzip.UpdateFlag = false; - - // Make a reference to a single byte to avoid null access - duzip.MemoryBlock = new Byte[1]; - - _CancelZip = false; - - // Do the UnZip function - duzip.ActionDZ = CDUnZipNET.DUZACTION.UNZIP_COUNTALLZIPMEMBERS; - int numItems = duzip.ReturnCount; - string str_tmpDate; - string str_tmpFileName; - for (int i=0;i 0) - { - // Adjust the destination path based on the full or partial - // path in the zip file - char [] trmchar = {'\\'}; - duzip.ActionDZ = CDUnZipNET.DUZACTION.UNZIP_GETNEXTNAMEDZIPINFO; - str_tmpFileName = duzip.zi_FileName; - // trim off the file name - str_tmpFileName = str_tmpFileName.ToUpper(); - str_tmpFileName = str_tmpFileName.Substring(0,str_tmpFileName.LastIndexOf("PROC.INI")); - // trim off any backslash - str_tmpFileName = str_tmpFileName.TrimEnd(trmchar); - str_tmpFileName = str_tmpFileName.ToUpper(); - if (str_tmpFileName.Length > 0) - { - if (strDestPath.LastIndexOf(str_tmpFileName) > 0) - strDestPath = strDestPath.Substring(0,strDestPath.Length - str_tmpFileName.Length); - } - } - _strDestPath = strDestPath; - return; - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/ZipFuncsDlg.cs b/PROMS/ReferencedObjectsOld/LibSource/Utils/ZipFuncsDlg.cs deleted file mode 100644 index 5ad12d67..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/ZipFuncsDlg.cs +++ /dev/null @@ -1,164 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ZipFuncsDlg.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 7/27/04 8:35a $ - * - * $History: ZipFuncsDlg.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:35a - * Created in $/LibSource/Utils - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - - -namespace Utils -{ - /// - /// Dialog used to display the zip/unzip function status - /// - public class ZipFuncsDlg : System.Windows.Forms.Form - { - private System.Windows.Forms.ProgressBar progressBar1; - private System.Windows.Forms.ProgressBar progressBar2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Button button1; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - private bool _CancelZip; - - public ZipFuncsDlg() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - _CancelZip = false; - this.DialogResult = System.Windows.Forms.DialogResult.OK; - } - - - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.progressBar1 = new System.Windows.Forms.ProgressBar(); - this.progressBar2 = new System.Windows.Forms.ProgressBar(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.button1 = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // progressBar1 - // - this.progressBar1.Location = new System.Drawing.Point(16, 40); - this.progressBar1.Name = "progressBar1"; - this.progressBar1.Size = new System.Drawing.Size(360, 23); - this.progressBar1.TabIndex = 0; - // - // progressBar2 - // - this.progressBar2.Location = new System.Drawing.Point(16, 104); - this.progressBar2.Name = "progressBar2"; - this.progressBar2.Size = new System.Drawing.Size(360, 23); - this.progressBar2.TabIndex = 1; - // - // label1 - // - this.label1.Location = new System.Drawing.Point(24, 16); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(352, 16); - this.label1.TabIndex = 2; - this.label1.Text = "label1"; - // - // label2 - // - this.label2.Location = new System.Drawing.Point(16, 80); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(360, 16); - this.label2.TabIndex = 3; - this.label2.Text = "label2"; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(144, 144); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(104, 32); - this.button1.TabIndex = 4; - this.button1.Text = "Cancel"; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // ZipFuncs - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(400, 190); - this.Controls.Add(this.button1); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.Controls.Add(this.progressBar2); - this.Controls.Add(this.progressBar1); - this.Name = "ZipFuncs"; - this.Text = "ZipFuncs"; - this.ResumeLayout(false); - - } - #endregion - - private void button1_Click(object sender, System.EventArgs e) - { - _CancelZip = true; - this.DialogResult = System.Windows.Forms.DialogResult.Cancel; - } - - public void ZipMajorStatus_event(String lpstrItem, int percent, ref int rc) - { - progressBar1.Value = percent; - label1.Text = lpstrItem; - - if (_CancelZip) - rc = 1; - else - rc = 0; - } - - public void ZipMinorStatus_event(String lpstrItem, int percent, ref int rc) - { - progressBar2.Value = percent; - label2.Text = lpstrItem; - - if (_CancelZip) - rc = 1; - else - rc = 0; - } - - - - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/Utils/ZipFuncsDlg.resx b/PROMS/ReferencedObjectsOld/LibSource/Utils/ZipFuncsDlg.resx deleted file mode 100644 index 66e08b20..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/Utils/ZipFuncsDlg.resx +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - ZipFuncs - - - 80 - - - True - - - Private - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/AssemblyInfo.cs deleted file mode 100644 index 7e3b35a5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/AssemblyInfo.cs.bak deleted file mode 100644 index 6b2b0662..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/VlnProfiler.cs b/PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/VlnProfiler.cs deleted file mode 100644 index b8ac2fa7..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/VlnProfiler.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Specialized; - -namespace VlnProfiler -{ - /// - /// Summary description for Profiler. - /// - public class Profiler - { - static HybridDictionary dicTiming; - static HybridDictionary dicDuration; - - static Profiler() - { - Reset(); - } - - public static void Reset() - { - dicTiming = new HybridDictionary(); - dicTiming[" Total"]=DateTime.Now; - dicDuration = new HybridDictionary(); - } - - public static void Start(string sName) - { - dicTiming[sName]=DateTime.Now; - } - - public static void End(string sName) - { - if( dicDuration.Contains(sName)) - dicDuration[sName]=((TimeSpan) dicDuration[sName]) + (DateTime.Now - ((DateTime) dicTiming[sName])); - else - dicDuration[sName]=DateTime.Now - ((DateTime) dicTiming[sName]); - } - - public static string ToString(string Format) - { - string str=""; - string sep=""; - if(Format.IndexOf("%")>=0) - { - double ttl = Convert.ToDouble(((TimeSpan) (DateTime.Now - ((DateTime) dicTiming[" Total"]))).Ticks); - double ttlOther=ttl; - foreach(string strKey in dicDuration.Keys) - { - ttlOther-=((TimeSpan) dicDuration[strKey]).Ticks; - double dt = Convert.ToDouble(((TimeSpan) dicDuration[strKey]).Ticks)/ttl; - //TODO: If Percent - Convert to Percent of Total - str+=sep+dt.ToString(Format) + " " + strKey; - sep="\r\n"; - } - ttlOther = ttlOther/ttl; - str+=sep+ttlOther.ToString(Format) + " Other"; - } - else - { - foreach(string strKey in dicDuration.Keys) - { - str+=sep+((TimeSpan)dicDuration[strKey]).ToString(/*Format*/) + " " + strKey; - sep="\r\n"; - } - } - str+=sep + "".PadRight(20,'-'); - str+=sep + ((TimeSpan) (DateTime.Now - ((DateTime) dicTiming[" Total"]))).ToString(/*Format*/) + " Total"; - return str; - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/VlnProfiler.csproj b/PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/VlnProfiler.csproj deleted file mode 100644 index ec4d19d2..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/VlnProfiler.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC} - Debug - AnyCPU - - - - - VlnProfiler - - - JScript - Grid - IE50 - false - Library - VlnProfiler - OnBuildSuccess - - - - - - - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - - - - System - - - System.Data - - - System.XML - - - - - Code - - - Code - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/VlnProfiler.sln b/PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/VlnProfiler.sln deleted file mode 100644 index 1ef8eb3e..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnProfiler/VlnProfiler.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VlnProfiler", "VlnProfiler.csproj", "{38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Debug.ActiveCfg = Release|.NET - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Debug.Build.0 = Release|.NET - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Release.ActiveCfg = Release|.NET - {38044313-1E5E-4F20-A9E7-3CBDDDCADCDC}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/AssemblyInfo.cs deleted file mode 100644 index 7e3b35a5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/AssemblyInfo.cs.bak deleted file mode 100644 index 6b2b0662..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/SpinnerFrm.cs b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/SpinnerFrm.cs deleted file mode 100644 index ee5d0fcd..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/SpinnerFrm.cs +++ /dev/null @@ -1,164 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: SpinnerFrm.cs $ $Revision: 2 $ - * $Author: Kathy $ $Date: 7/26/04 1:20p $ - * - * $History: SpinnerFrm.cs $ - * - * ***************** Version 2 ***************** - * User: Kathy Date: 7/26/04 Time: 1:20p - * Updated in $/LibSource/VlnStatus - * doevents for cancel button click - * - * ***************** Version 1 ***************** - * User: Kathy Date: 5/11/04 Time: 9:56a - * Created in $/LibSource/VlnStatus - * volian spinner control - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace VlnStatus -{ - /// - /// Create a status window with a progress bar - /// - public class SpinnerFrm : System.Windows.Forms.Form - { - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Label lblMsg; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private System.Windows.Forms.ProgressBar progressBar1; - - private bool abortFlag; - public SpinnerFrm(bool ab, bool canCancel) - { - abortFlag = ab; - // - // Required for Windows Form Designer support - // - InitializeComponent(); - if (!canCancel) this.btnCancel.Visible=false; - - this.progressBar1.Minimum=0; - this.progressBar1.Maximum=100; - this.progressBar1.Value=1; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.lblMsg = new System.Windows.Forms.Label(); - this.btnCancel = new System.Windows.Forms.Button(); - this.progressBar1 = new System.Windows.Forms.ProgressBar(); - this.SuspendLayout(); - // - // lblMsg - // - this.lblMsg.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.lblMsg.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblMsg.Location = new System.Drawing.Point(16, 16); - this.lblMsg.Name = "lblMsg"; - this.lblMsg.Size = new System.Drawing.Size(288, 48); - this.lblMsg.TabIndex = 2; - this.lblMsg.Tag = "msg1"; - this.lblMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // btnCancel - // - this.btnCancel.Location = new System.Drawing.Point(128, 112); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(64, 24); - this.btnCancel.TabIndex = 3; - this.btnCancel.Text = "Cancel"; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // progressBar1 - // - this.progressBar1.Location = new System.Drawing.Point(16, 72); - this.progressBar1.Name = "progressBar1"; - this.progressBar1.Size = new System.Drawing.Size(288, 24); - this.progressBar1.TabIndex = 4; - // - // SpinnerFrm - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(318, 149); - this.ControlBox = false; - this.Controls.Add(this.progressBar1); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.lblMsg); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "SpinnerFrm"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "VE-PROMS"; - this.TopMost = true; - this.ResumeLayout(false); - - } - #endregion - - - public void UpdateSpin() - { - if (this.progressBar1.Value==this.progressBar1.Maximum) this.progressBar1.Value=0; - this.progressBar1.Value=this.progressBar1.Value++; - this.progressBar1.PerformStep(); - System.Windows.Forms.Application.DoEvents(); - } - - public void UpdateSpinMsg(string txt) - { - this.lblMsg.Text = txt; - this.lblMsg.Refresh(); - this.Refresh(); - } - - private void btnCancel_Click(object sender, System.EventArgs e) - { - if( abortFlag ) - { - string message = "Are you sure you want to Cancel?"; - string caption = "Network Update"; - MessageBoxButtons buttons = MessageBoxButtons.YesNo; - DialogResult result; - result = MessageBox.Show(this, message, caption, buttons); - - if(result == DialogResult.Yes) - { - Environment.Exit(-1); - } - } - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/SpinnerFrm.resx b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/SpinnerFrm.resx deleted file mode 100644 index 22c1b6ad..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/SpinnerFrm.resx +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - SpinnerFrm - - - Private - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/StatusBarFrm.cs b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/StatusBarFrm.cs deleted file mode 100644 index 6828458b..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/StatusBarFrm.cs +++ /dev/null @@ -1,232 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: StatusBarFrm.cs $ $Revision: 3 $ - * $Author: Jsj $ $Date: 4/08/04 9:50a $ - * - * $History: StatusBarFrm.cs $ - * - * ***************** Version 3 ***************** - * User: Jsj Date: 4/08/04 Time: 9:50a - * Updated in $/LibSource/VlnStatus - * added profile code and try to optimize - * - * ***************** Version 2 ***************** - * User: Jsj Date: 11/26/02 Time: 3:38p - * Updated in $/LibSource/VlnStatus - * Added overbounds check - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -//using ROProfiler; //don't forget to add VlnProfiler to the reference list - -namespace VlnStatus -{ - /// - /// Create a status window with a progress bar - /// - public class StatusBarFrm : System.Windows.Forms.Form - { - private System.Windows.Forms.ProgressBar progressBar1; - private System.Windows.Forms.Label lblBar; - private System.Windows.Forms.Label StatMsg; -// private string strLblLast=""; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public StatusBarFrm() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - Text = "Status"; - } - - public StatusBarFrm(string StatusBoxTitle) - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - Text = StatusBoxTitle; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.progressBar1 = new System.Windows.Forms.ProgressBar(); - this.lblBar = new System.Windows.Forms.Label(); - this.StatMsg = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // progressBar1 - // - this.progressBar1.Location = new System.Drawing.Point(29, 83); - this.progressBar1.Name = "progressBar1"; - this.progressBar1.Size = new System.Drawing.Size(297, 27); - this.progressBar1.TabIndex = 0; - // - // lblBar - // - this.lblBar.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblBar.Location = new System.Drawing.Point(29, 136); - this.lblBar.Name = "lblBar"; - this.lblBar.Size = new System.Drawing.Size(297, 16); - this.lblBar.TabIndex = 1; - this.lblBar.Text = "% Complete"; - this.lblBar.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // StatMsg - // - this.StatMsg.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.StatMsg.Location = new System.Drawing.Point(29, 18); - this.StatMsg.Name = "StatMsg"; - this.StatMsg.Size = new System.Drawing.Size(307, 56); - this.StatMsg.TabIndex = 2; - this.StatMsg.Text = "Progress Bar"; - this.StatMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // StatusBarFrm - // - this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); - this.ClientSize = new System.Drawing.Size(350, 171); - this.ControlBox = false; - this.Controls.Add(this.StatMsg); - this.Controls.Add(this.lblBar); - this.Controls.Add(this.progressBar1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "StatusBarFrm"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Status"; - this.TopMost = true; - this.Load += new System.EventHandler(this.StatusBarFrm_Load); - this.ResumeLayout(false); - - } - #endregion - - private void StatusBarFrm_Load(object sender, System.EventArgs e) - { - - } - - public int Value - { - get - { - return progressBar1.Value; - } - set - { - if (value >= progressBar1.Maximum) - progressBar1.Value = progressBar1.Maximum; - else - progressBar1.Value = value; - UpateLabel(); - } - } - - public int Maximum - { - get - { - return progressBar1.Maximum; - } - set - { - progressBar1.Maximum = value; - } - } - - public int Step - { - get - { - return progressBar1.Step; - } - set - { - progressBar1.Step = value; - } - } - - public void PerformStep() - { - progressBar1.PerformStep(); - } - - private void UpateLabel() - { - lblBar.Text = (Math.Round((decimal)(progressBar1.Value * 100) / progressBar1.Maximum)).ToString(); - lblBar.Text += "% Complete"; -// if( lblBar.Text != strLblLast) -// { -// Profiler.Start("UpdateLabel"); - lblBar.Refresh(); -// lblBar.Update(); -// Profiler.End("UpdateLabel"); -// } -// strLblLast = lblBar.Text; - } - - public string StatusMessage - { - get - { - return StatMsg.Text; - } - set - { - StatMsg.Text = value; -// Profiler.Start("StatusMessage"); - StatMsg.Refresh(); -// StatMsg.Update(); -// Profiler.End("StatusMessage"); - } - } - - public string StatusBoxTitle - { - get - { - return Text; - } - set - { - Text = value; - } - } - - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/StatusBarFrm.resx b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/StatusBarFrm.resx deleted file mode 100644 index 63f8de01..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/StatusBarFrm.resx +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - StatusBarFrm - - - True - - - Private - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/StatusMessageFrm.cs b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/StatusMessageFrm.cs deleted file mode 100644 index 9dbf8d70..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/StatusMessageFrm.cs +++ /dev/null @@ -1,140 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: StatusMessageFrm.cs $ $Revision: 3 $ - * $Author: Jsj $ $Date: 5/11/04 9:30a $ - * - * $History: StatusMessageFrm.cs $ - * - * ***************** Version 3 ***************** - * User: Jsj Date: 5/11/04 Time: 9:30a - * Updated in $/LibSource/VlnStatus - * - * ***************** Version 2 ***************** - * User: Jsj Date: 11/26/02 Time: 3:38p - * Updated in $/LibSource/VlnStatus - * Added overbounds check - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace VlnStatus -{ - /// - /// Create status message window. - /// - public class StatusMessageFrm : System.Windows.Forms.Form - { - private System.Windows.Forms.Label lblStatMsg; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public StatusMessageFrm() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - } - - public StatusMessageFrm(string StatTitle) - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - Text = StatTitle; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.lblStatMsg = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // lblStatMsg - // - this.lblStatMsg.Location = new System.Drawing.Point(19, 20); - this.lblStatMsg.Name = "lblStatMsg"; - this.lblStatMsg.Size = new System.Drawing.Size(420, 81); - this.lblStatMsg.TabIndex = 0; - this.lblStatMsg.Text = "Put Satus Message Here"; - this.lblStatMsg.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // StatusMessageFrm - // - this.AutoScaleBaseSize = new System.Drawing.Size(7, 19); - this.ClientSize = new System.Drawing.Size(457, 117); - this.ControlBox = false; - this.Controls.Add(this.lblStatMsg); - this.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "StatusMessageFrm"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Status"; - this.TopMost = true; - this.Load += new System.EventHandler(this.StatusMessageFrm_Load); - this.ResumeLayout(false); - - } - #endregion - - private void StatusMessageFrm_Load(object sender, System.EventArgs e) - { - - } - - public string StatusMessage - { - get - { - return lblStatMsg.Text; - } - set - { - lblStatMsg.Text = value; - lblStatMsg.Refresh(); - } - } - - public string StatusBoxTitle - { - get - { - return Text; - } - set - { - Text = value; - } - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/StatusMessageFrm.resx b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/StatusMessageFrm.resx deleted file mode 100644 index 7edd5b3c..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/StatusMessageFrm.resx +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - StatusMessageFrm - - - True - - - 80 - - - True - - - Private - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/App.ico b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/App.ico deleted file mode 100644 index 3a5525fd794f7a7c5c8e6187f470ea3af38cd2b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1078 zcmeHHJr05}7=1t!Hp3A*8IHkVf+j?-!eHY14Gtcw1Eb*_9>Bq^zETJ@GKj{_2j4$w zo9}xCh!8{T3=X##Skq>ikMjsvB|y%crWBM2iW(4pI}c%z6%lW!=~4v77#3{z!dmB1 z__&l)-{KUYR+|8|;wB^R|9ET$J@(@=#rd^=)qs85?vAy(PSF5CyNkus435LVkZ$rj zNw|JG-P7^hF<(;#o*Vk}5R#e|^13tBbQkeF?djULtvqyxd3<{9 diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/AssemblyInfo.cs deleted file mode 100644 index 7e3b35a5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/AssemblyInfo.cs.bak deleted file mode 100644 index 2cef92ab..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/Form1.cs b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/Form1.cs deleted file mode 100644 index 3c097662..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/Form1.cs +++ /dev/null @@ -1,191 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: Form1.cs $ $Revision: 5 $ - * $Author: Kathy $ $Date: 7/27/04 11:06a $ - * - * $History: Form1.cs $ - * - * ***************** Version 5 ***************** - * User: Kathy Date: 7/27/04 Time: 11:06a - * Updated in $/LibSource/VlnStatus/Test - * add spinner test - * - * ***************** Version 4 ***************** - * User: Jsj Date: 11/26/02 Time: 4:25p - * Updated in $/LibSource/VlnStatus/Test - * updated test - * - * ***************** Version 3 ***************** - * User: Jsj Date: 11/26/02 Time: 3:37p - * Updated in $/LibSource/VlnStatus/Test - * added header - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Data; -using VlnStatus; - -namespace Test -{ - /// - /// Test the status windows. - /// - public class Form1 : System.Windows.Forms.Form - { - private System.Windows.Forms.Button btnTest; - private System.Windows.Forms.Button btnStatMsg; - private System.Windows.Forms.Button btnSpinner; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public Form1() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.btnTest = new System.Windows.Forms.Button(); - this.btnStatMsg = new System.Windows.Forms.Button(); - this.btnSpinner = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // btnTest - // - this.btnTest.Location = new System.Drawing.Point(208, 64); - this.btnTest.Name = "btnTest"; - this.btnTest.Size = new System.Drawing.Size(120, 23); - this.btnTest.TabIndex = 0; - this.btnTest.Text = "Test Status Bar"; - this.btnTest.Click += new System.EventHandler(this.btnTest_Click); - // - // btnStatMsg - // - this.btnStatMsg.Location = new System.Drawing.Point(32, 64); - this.btnStatMsg.Name = "btnStatMsg"; - this.btnStatMsg.Size = new System.Drawing.Size(144, 23); - this.btnStatMsg.TabIndex = 1; - this.btnStatMsg.Text = "Test Status Message"; - this.btnStatMsg.Click += new System.EventHandler(this.btnStatMsg_Click); - // - // btnSpinner - // - this.btnSpinner.Location = new System.Drawing.Point(360, 64); - this.btnSpinner.Name = "btnSpinner"; - this.btnSpinner.Size = new System.Drawing.Size(104, 24); - this.btnSpinner.TabIndex = 2; - this.btnSpinner.Text = "Test Spinner"; - this.btnSpinner.Click += new System.EventHandler(this.btnSpinner_Click); - // - // Form1 - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(504, 149); - this.Controls.Add(this.btnSpinner); - this.Controls.Add(this.btnStatMsg); - this.Controls.Add(this.btnTest); - this.Name = "Form1"; - this.Text = "Form1"; - this.ResumeLayout(false); - - } - #endregion - - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.Run(new Form1()); - } - - private void btnTest_Click(object sender, System.EventArgs e) - { - int j=0, cnt = 2000; - string StatStr = "Processing j= "; - string NewStatBoxTitle = "Status left to do: "; -// VlnStatusBar StatWindow = new VlnStatusBar(); // defaults to a title of "Status" - VlnStatusBar StatWindow = new VlnStatusBar("Test Status Bar Window"); - StatWindow.BarMax = 2000; - StatWindow.BarStepValue = 1; - StatWindow.BarValue = 0; - - - for (j=1; j <= 2000; j++) - { - StatWindow.StatMsg = StatStr + j.ToString(); - // can also change the status box title on the fly - StatWindow.StatusBoxTitle = NewStatBoxTitle + cnt.ToString(); -// StatWindow.PerformStep(j); - StatWindow.PerformStep(); - for (int k=0; k<5000; k++); - cnt--; - } - StatWindow.Dispose(); - } - - private void btnStatMsg_Click(object sender, System.EventArgs e) - { - int j=0, cnt =2000; - string StatStr = "Processing j= "; - string NewStatBoxTitle = "Status left to do: "; -// VlnStatusMessage StatMsgWindow = new VlnStatusMessage(); // defaults to a title of "Status" - VlnStatusMessage StatMsgWindow = new VlnStatusMessage("Test Status Message Window"); - - for (j=1; j<= 2000; j++) - { - StatMsgWindow.StatusMessage = StatStr + j.ToString(); - // can also change the status box title on the fly - StatMsgWindow.StatusBoxTitle = NewStatBoxTitle + cnt.ToString(); - for (int k=0; k < 5000; k++); - cnt--; - } - StatMsgWindow.Dispose(); - } - - private void btnSpinner_Click(object sender, System.EventArgs e) - { - int cnt = 0; - VlnSpinner spin = new VlnSpinner(2,25,"- Getting Lock Info for ","filename",true,true,true); - while(spin.SpinnerWait(cnt>1000)) - { - cnt++; - } - spin.Dispose(); - - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/Form1.resx b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/Form1.resx deleted file mode 100644 index bfbf6cad..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/Form1.resx +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - Form1 - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - Private - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/Test.csproj b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/Test.csproj deleted file mode 100644 index 046e43ea..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/Test/Test.csproj +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnSpinner.cs b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnSpinner.cs deleted file mode 100644 index bf9aed39..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnSpinner.cs +++ /dev/null @@ -1,167 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: VlnSpinner.cs $ $Revision: 2 $ - * $Author: Kathy $ $Date: 7/26/04 1:21p $ - * - * $History: VlnSpinner.cs $ - * - * ***************** Version 2 ***************** - * User: Kathy Date: 7/26/04 Time: 1:21p - * Updated in $/LibSource/VlnStatus - * add comment - * - * ***************** Version 1 ***************** - * User: Kathy Date: 5/11/04 Time: 9:56a - * Created in $/LibSource/VlnStatus - * volian spinner control - *********************************************************************************************/ - -using System; -using System.Diagnostics; -using System.Text; - -namespace VlnStatus -{ - /* - ** The following values are taken by the Spinner class constructor: - ** - ** spindelay - is the number of seconds to wait before putting - ** up the message and spinner. - ** - ** spinfreq - is the minimum delay time in milliseconds before - ** returning to the caller. - ** - ** spinmsg1 - is a caller message put up with the spinner - ** spinmsg2 - is a second caller message concatenated to spinmsg1 - ** both spinmsg1 and spinmsg2 may be NULL for no messages. - ** - ** AbortFlag - is a flag. If non-zero takes a DB_Exit(255) - ** if the user hits the Esc key while spinning. - ** can be defaulted. - ** - ** - ** SpinnerWait puts up a delayed message with a spinner. - ** - ** AutoTermFlag - spinner returns 0 if this value is non-zero - ** or Esc was pressed and AbortFlag not set. - ** A 1 is returned if AutoTermFlag is zero. - ** - ** The purpose of this function is to generate interruptable/abortable - ** while or do-while loops in code which is waiting for an event to - ** occur. Below is a simple example: - ** - ** { Spinner spin(2,25,"- Waiting for ", filename, 1); - ** while( spin.SpinnerWait( stat(filename,&temp) || temp.st_size ) {;} - ** } - ** - ** This loop returns zero if filename does not exist, or if it does - ** exist and has a non-zero length, otherwise it waits at least - ** 25 milliseconds, and returns 1 so that the predicate test - ** stat(filename,&temp) || temp.st_size - ** is tested again. If the loop continues for 2 seconds, a message - ** and spinner is posted. If the user presses the Esc key, DB_Exit(255) - ** is taken. - ** - ** Note, that the SpinnerWait function will close the message window - ** when the Spinner class object goes out of scope, as the desctructor - ** handles the window closures. Note also, that a new instance of the - ** object must be generated with each use. - */ - public class VlnSpinner - { - SpinnerFrm spinFrm; - private int spinstart; - private int spindelay; - private int spinfreq; - private string spinmsg1; - private string spinmsg2; - private bool abortflag; - private bool canCancel; - private string msgprefix; - private bool firstspin; - private bool firstpass; - - public VlnSpinner(int sd, int sf, string sm1, string sm2, bool af, bool prefix, bool showCancel) - { - spindelay=sd; - spinfreq=sf; - spinmsg1=sm1; - spinmsg2=sm2; - abortflag=af; - canCancel = showCancel; - firstpass=true; - firstspin=true; - - spinFrm = null; - if(prefix) - msgprefix="Database File in Use by another user \n"; - else - msgprefix=" "; - } - - public void Dispose() - { - if(spinFrm!=null) spinFrm.Dispose(); - } - - public bool SpinnerWait(bool AutoTermFlag) - { - if( !AutoTermFlag ) - { - if( firstpass ) - { - // Tick is equal to 100 nanoseconds. - // nanosecond is 1 billionth of a second. - spinstart = (int)(DateTime.Now.Ticks/10000000) + spindelay; - firstpass = false; - } - if( !firstspin ) - { - SpinnerTick(); - TickTock(spinfreq); - } - else - { - if(spinstart <= (int)(DateTime.Now.Ticks/10000000)) SpinnerTick(); - TickTock(spinfreq); - } - } - return (!AutoTermFlag); - } - private void TickTock(int spinfreq) - { - long cur = DateTime.Now.Ticks; - long getto = cur+(spinfreq*100); - while (cur <= getto) - cur = DateTime.Now.Ticks; - } - - private void SpinMessage(string msg1,string msg2,string msg3,int len) - { - StringBuilder buff = new StringBuilder(80); - buff.Append(msg1); - if (msg2!=null)buff.Append(msg2); - if (msg3!=null)buff.Append(msg3); - spinFrm.UpdateSpinMsg(buff.ToString()); - } - - private void SpinnerTick() - { - int windowcol; - if(firstspin) - { - windowcol=msgprefix.Length+2; - if(spinmsg1!=null) windowcol+=spinmsg1.Length; - if(spinmsg2!=null) windowcol+=spinmsg2.Length; - spinFrm = new SpinnerFrm(abortflag, canCancel); - spinFrm.Show(); - SpinMessage(msgprefix,spinmsg1,spinmsg2,windowcol+1); - firstspin = false; - } - spinFrm.UpdateSpin(); - } - } -} - diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnStatus.csproj b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnStatus.csproj deleted file mode 100644 index e1347c8e..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnStatus.csproj +++ /dev/null @@ -1,125 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {551CB7B3-00B1-11D7-8590-482B59000000} - Debug - AnyCPU - - - - - VlnStatus - - - JScript - Grid - IE50 - false - Library - VlnStatus - OnBuildSuccess - - - - - - - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - - - - System - - - System.Data - - - System.Drawing - - - System.Windows.Forms - - - System.XML - - - - - Code - - - Form - - - Form - - - Code - - - Code - - - StatusBarFrm.cs - Designer - - - StatusMessageFrm.cs - Designer - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnStatus.sln b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnStatus.sln deleted file mode 100644 index c32ea981..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnStatus.sln +++ /dev/null @@ -1,28 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VlnStatus", "VlnStatus.csproj", "{551CB7B3-00B1-11D7-8590-482B59000000}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{551CB7BA-00B1-11D7-8590-482B59000000}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {551CB7B3-00B1-11D7-8590-482B59000000}.Debug.ActiveCfg = Debug|.NET - {551CB7B3-00B1-11D7-8590-482B59000000}.Debug.Build.0 = Debug|.NET - {551CB7B3-00B1-11D7-8590-482B59000000}.Release.ActiveCfg = Release|.NET - {551CB7B3-00B1-11D7-8590-482B59000000}.Release.Build.0 = Release|.NET - {551CB7BA-00B1-11D7-8590-482B59000000}.Debug.ActiveCfg = Debug|.NET - {551CB7BA-00B1-11D7-8590-482B59000000}.Release.ActiveCfg = Release|.NET - {551CB7BA-00B1-11D7-8590-482B59000000}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnStatusBar.cs b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnStatusBar.cs deleted file mode 100644 index a7a4e2cd..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnStatusBar.cs +++ /dev/null @@ -1,148 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: VlnStatusBar.cs $ $Revision: 4 $ - * $Author: Jsj $ $Date: 11/26/02 4:25p $ - * - * $History: VlnStatusBar.cs $ - * - * ***************** Version 4 ***************** - * User: Jsj Date: 11/26/02 Time: 4:25p - * Updated in $/LibSource/VlnStatus - * fixed problem with counter - * - * ***************** Version 3 ***************** - * User: Jsj Date: 11/26/02 Time: 3:38p - * Updated in $/LibSource/VlnStatus - * Added overbounds check - *********************************************************************************************/ -using System; - -namespace VlnStatus -{ - /// - /// Creates a Status Window with a progression bar control. - /// - /// This class has two constructors. One allows you to pass in the title - /// of the Status Box. The Other provides a default title of "Status". - /// The Status Box Title can also be set/changed via the StatusBoxTitle - /// property. - /// - /// - /// - public class VlnStatusBar - { - StatusBarFrm StatBar; - private int Cnt; - - // Create a status window with the default title of "Status" - public VlnStatusBar() - { - StatBar = new StatusBarFrm(); - StatBar.Show(); - } - - // Create a status window with the passed in title - public VlnStatusBar(string Title) - { - StatBar = new StatusBarFrm(Title); - StatBar.Show(); - } - - // Increament the the status bar by the passed in value. - public void PerformStep(int val) - { -// StatBar.Value = val; -// Cnt = val; - BarValue = val; - StatBar.PerformStep(); - } - - // Increament the the status bar by one - public void PerformStep() - { -// StatBar.Value = StatBar.Value + 1; - Cnt++; - BarValue = Cnt; - StatBar.PerformStep(); - } - - // This property gets or sets the current status bar value. - public int BarValue - { - get - { - return StatBar.Value; - } - set - { - StatBar.Value = value; - Cnt = value; - } - } - - // This property sets or gets the maximum value that the - // BarValue property can be. i.e. when BarValue reaches this - // number, the status bar is completely displayed. - public int BarMax - { - get - { - return StatBar.Maximum; - } - set - { - StatBar.Maximum = value; - } - } - - // This property sets or gets the increamenting value used to - // move the status bar. For example, if set to 5, each tick of - // the status bar represents a value of 5. - public int BarStepValue - { - get - { - return StatBar.Step; - } - set - { - StatBar.Step = value; - } - } - - // This property sets or gets the message above the status bar. - public string StatMsg - { - get - { - return StatBar.StatusMessage; - } - set - { - StatBar.StatusMessage = value; - } - } - - // This property sets or gets the Status Window Title - public string StatusBoxTitle - { - get - { - return StatBar.StatusBoxTitle; - } - set - { - StatBar.StatusBoxTitle = value; - } - } - - public void Dispose() - { - StatBar.Dispose(); - } - - } -} - diff --git a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnStatusMessage.cs b/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnStatusMessage.cs deleted file mode 100644 index e0221ee8..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/VlnStatus/VlnStatusMessage.cs +++ /dev/null @@ -1,79 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: VlnStatusMessage.cs $ $Revision: 3 $ - * $Author: Jsj $ $Date: 11/26/02 3:38p $ - * - * $History: VlnStatusMessage.cs $ - * - * ***************** Version 3 ***************** - * User: Jsj Date: 11/26/02 Time: 3:38p - * Updated in $/LibSource/VlnStatus - * Added overbounds check - *********************************************************************************************/ - -using System; - -namespace VlnStatus -{ - /// - /// Creates a Status Window to display a status message. - /// - /// This class has two constructors. One allows you to pass in the title - /// of the Status Box. The Other provides a default title of "Status". - /// The Status Box Title can also be set/changed via the StatusBoxTitle - /// property. - /// - /// - public class VlnStatusMessage - { - StatusMessageFrm StatusMessageBox; - - // Create a status window with the default title of "Status" - public VlnStatusMessage() - { - StatusMessageBox = new StatusMessageFrm(); - StatusMessageBox.Show(); - } - - // Create a status window with the passed in title. - public VlnStatusMessage(string StatusBoxTitle) - { - StatusMessageBox = new StatusMessageFrm(StatusBoxTitle); - StatusMessageBox.Show(); - } - - // This property gets or sets the current status message - public string StatusMessage - { - get - { - return StatusMessageBox.StatusMessage; - } - set - { - StatusMessageBox.StatusMessage = value; - } - } - - // This property gets or sets the status box title - public string StatusBoxTitle - { - get - { - return StatusMessageBox.StatusBoxTitle; - } - set - { - StatusMessageBox.StatusBoxTitle = value; - } - } - - public void Dispose() - { - StatusMessageBox.Dispose(); - } - - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/CvtFont/CvtFont.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/CvtFont/CvtFont.cs deleted file mode 100644 index 83d9cc00..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/CvtFont/CvtFont.cs +++ /dev/null @@ -1,175 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Xml; - -namespace CvtFont -{ - // - - public static class CvtFont - { - private static string [] OldNames = { - "ELITE", - "PICA", - "LN_PRN", - "CONDENSE", - "SANSERIF", - "PICA12", - "PROPORTIONAL", - "PROPT12", - "HVLPT18", - "HVLPT25", - "SPECIALCHARS", - "PT14", - "SANSERIF14", - "SANSERIF17", - "HVLPT12", - "NARRATOR", - "MEDUPUNIVERS", - "LGUPMED16", - "PROPT10", - "LG1275HP4SI", - "HVLPT10", - "HVLPT8", - "HVLPT14", - "SANSERIF25", - "EYECHART", - "TIMES11", - "SANSCOND", - "BIGSCRIPT" - }; - private static string[] NewXML = { - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - }; - private static string[] NewFamily = { - "Prestige Elite Tall", - "Courier New", - "Times New Roman", - "Times New Roman", - "Letter Gothic", - "Courier New", - "Arial", - "Arial", - "Times New Roman", - "Times New Roman", - "VolianDraw XXXXXX", - "Letter Gothic", - "Arial", - "Arial", - "Times New Roman", - "Gothic Ultra", - "NA", - "Letter Gothic Tall", - "Arial", - "Letter Gothic Tall", - "Times New Roman", - "Times New Roman", - "Times New Roman", - "Arial", - "Gothic Ultra", - "Times New Roman", - "Letter Gothic", - "VolianScript" - }; - private static int[] NewSize = { - 10, - 12, - 7, - 7, - 10, - 12, - 18, - 11, - 18, - 25, - 12, - 12, - 14, - 17, - 12, - 12, - 0, - 7, - 0, - 10, - 10, - 8, - 14, - 25, - 14, - 11, - 7, - 32 - }; - - - private static Dictionary OldToNewStrings=null; - public static string ConvertToString(string oldstr) - { - if (OldToNewStrings == null) InitializeDictionary(); - return OldToNewStrings[oldstr]; - } - - public static string ConvertToFamily(string oldstr) - { - int i = 0; - foreach (string str in OldNames) - { - if (str == oldstr) return NewFamily[i]; - i++; - } - return null; - } - public static int ConvertToSize(string oldstr) - { - int i = 0; - foreach (string str in OldNames) - { - if (str == oldstr) return NewSize[i]; - i++; - } - return -1; - } - //public static XmlElement ConvertToXML(string oldstr) - //{ - // if (OldToNewStrings == null) InitializeDictionary(); - // XmlElement xml = new XmlElement(); - // xml.InnerXml = OldToNewStrings[oldstr]; - // return xml; - //} - private static void InitializeDictionary() - { - int i = 0; - foreach (string str in OldNames) - OldToNewStrings.Add(str, NewXML[i]); - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/CvtFont/CvtFont.csproj b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/CvtFont/CvtFont.csproj deleted file mode 100644 index 2b2c96fe..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/CvtFont/CvtFont.csproj +++ /dev/null @@ -1,47 +0,0 @@ - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {652EB5F6-18DD-4F22-9C0B-62EB46613C4D} - Library - Properties - CvtFont - CvtFont - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/CvtFont/Properties/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/CvtFont/Properties/AssemblyInfo.cs deleted file mode 100644 index 06df2886..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/CvtFont/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CvtFont")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Volian Enterprises, Inc.")] -[assembly: AssemblyProduct("CvtFont")] -[assembly: AssemblyCopyright("Copyright © Volian Enterprises, Inc. 2006")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d2266793-0f12-4f71-bbd4-0a1617554b27")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/AssemblyInfo.cpp b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/AssemblyInfo.cpp deleted file mode 100644 index b4591321..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/AssemblyInfo.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "stdafx.h" - -using namespace System::Reflection; -using namespace System::Runtime::CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly:AssemblyTitleAttribute("")]; -[assembly:AssemblyDescriptionAttribute("")]; -[assembly:AssemblyConfigurationAttribute("")]; -[assembly:AssemblyCompanyAttribute("")]; -[assembly:AssemblyProductAttribute("")]; -[assembly:AssemblyCopyrightAttribute("")]; -[assembly:AssemblyTrademarkAttribute("")]; -[assembly:AssemblyCultureAttribute("")]; - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the value or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly:AssemblyVersionAttribute("1.0.*")]; - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project directory. -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly:AssemblyDelaySignAttribute(false)]; -[assembly:AssemblyKeyFileAttribute("E:\\proms.net\\Public Key\\vlnkey.snk")]; -[assembly:AssemblyKeyNameAttribute("")]; - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/DirectoryAndFileAPI.cpp b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/DirectoryAndFileAPI.cpp deleted file mode 100644 index 49a084e9..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/DirectoryAndFileAPI.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// This is the main DLL file. - -#include "stdafx.h" - -#include "DirectoryAndFileAPI.h" - -using namespace DirectoryAndFileAPI; - -char *DirAndFileFuncts::StringToCharStr(String *InStr) -{ - int len = (InStr->get_Length)(); - char *rtnstr = new char [len+1]; - ZeroMemory(rtnstr,len+1); - for (int i=0; iget_Chars)(i); - return rtnstr; -} - -String *DirAndFileFuncts::GetLongName(String *NameIn) -{ - char *tmpNameIn; - char *tmpNameOut; - char *fnPtr = NULL; - int rtnval; - - tmpNameIn = StringToCharStr(NameIn); - - tmpNameOut = new char[1]; - memset(tmpNameOut,0,1); - - // This will get the buffer size we need - rtnval = GetFullPathName(tmpNameIn,1,tmpNameOut,&fnPtr); - - if (rtnval > 1) - { - delete tmpNameOut; - tmpNameOut = new char[rtnval+1]; - memset(tmpNameOut,0,rtnval+1); - rtnval = GetFullPathName(tmpNameIn,rtnval,tmpNameOut,&fnPtr); - } - - NameOut = new String(tmpNameOut); - return NameOut; -} - -String *DirAndFileFuncts::GetShortName(String *NameIn) -{ - char *tmpNameIn; - char *tmpNameOut; - int rtnval; - - tmpNameIn = StringToCharStr(NameIn); - - tmpNameOut = new char[1]; - memset(tmpNameOut,0,1); - - rtnval = GetShortPathName(tmpNameIn,tmpNameOut,1); - - if (rtnval > 1) - { - delete tmpNameOut; - tmpNameOut = new char[rtnval+1]; - memset(tmpNameOut,0,rtnval+1); - rtnval = GetShortPathName(tmpNameIn,tmpNameOut,rtnval); - } - - NameOut = new String(tmpNameOut); - return NameOut; -} \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/DirectoryAndFileAPI.h b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/DirectoryAndFileAPI.h deleted file mode 100644 index 3977fffa..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/DirectoryAndFileAPI.h +++ /dev/null @@ -1,24 +0,0 @@ -// DirectoryAndFileAPI.h - -#pragma once - -#include -#include -#include - -using namespace System; - -namespace DirectoryAndFileAPI -{ - public __gc class DirAndFileFuncts - { - public: - String *NameOut; - DirAndFileFuncts() {}; - // TODO: Add your methods for this class here. - String *GetLongName(String *NameIn); - String *GetShortName(String *NameIn); - private: - char *StringToCharStr(String *InStr); - }; -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/DirectoryAndFileAPI.sln b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/DirectoryAndFileAPI.sln deleted file mode 100644 index f662efe8..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/DirectoryAndFileAPI.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 7.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DirectoryAndFileAPI", "DirectoryAndFileAPI.vcproj", "{A20EE163-393A-11D7-85C8-92B997000000}" -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - ConfigName.0 = Debug - ConfigName.1 = Release - EndGlobalSection - GlobalSection(ProjectDependencies) = postSolution - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {A20EE163-393A-11D7-85C8-92B997000000}.Debug.ActiveCfg = Debug|Win32 - {A20EE163-393A-11D7-85C8-92B997000000}.Debug.Build.0 = Debug|Win32 - {A20EE163-393A-11D7-85C8-92B997000000}.Release.ActiveCfg = Release|Win32 - {A20EE163-393A-11D7-85C8-92B997000000}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/DirectoryAndFileAPI.vcproj b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/DirectoryAndFileAPI.vcproj deleted file mode 100644 index 904ea938..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/DirectoryAndFileAPI.vcproj +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/ReadMe.txt b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/ReadMe.txt deleted file mode 100644 index 6ec15bfe..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/ReadMe.txt +++ /dev/null @@ -1,31 +0,0 @@ -======================================================================== - DYNAMIC LINK LIBRARY : DirectoryAndFileAPI Project Overview -======================================================================== - -AppWizard has created this DirectoryAndFileAPI DLL for you. - -This file contains a summary of what you will find in each of the files that -make up your DirectoryAndFileAPI application. - -DirectoryAndFileAPI.vcproj - This is the main project file for VC++ projects generated using an Application Wizard. - It contains information about the version of Visual C++ that generated the file, and - information about the platforms, configurations, and project features selected with the - Application Wizard. - -DirectoryAndFileAPI.cpp - This is the main DLL source file. - -DirectoryAndFileAPI.h - This file contains a class declaration. - -AssemblyInfo.cpp - Contains custom attributes for modifying assembly metadata. - -///////////////////////////////////////////////////////////////////////////// -Other notes: - -AppWizard uses "TODO:" to indicate parts of the source code you -should add to or customize. - -///////////////////////////////////////////////////////////////////////////// diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/Stdafx.cpp b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/Stdafx.cpp deleted file mode 100644 index 39ee6e67..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/Stdafx.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// DirectoryAndFileAPI.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/Stdafx.h b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/Stdafx.h deleted file mode 100644 index 459e5fc4..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/DirectoryAndFileAPI/Stdafx.h +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, -// but are changed infrequently - -#pragma once - -#using - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/AssemblyInfo.cs deleted file mode 100644 index c713863a..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/AssemblyInfo.cs.bak deleted file mode 100644 index 9f89a328..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/FMTformat.csproj b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/FMTformat.csproj deleted file mode 100644 index c39c855f..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/FMTformat.csproj +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/FMTformat.sln b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/FMTformat.sln deleted file mode 100644 index 1e962598..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/FMTformat.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FMTformat", "FMTformat.csproj", "{6A525742-00CA-450B-ABE7-F52991AEA0F7}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {6A525742-00CA-450B-ABE7-F52991AEA0F7}.Debug.ActiveCfg = Debug|.NET - {6A525742-00CA-450B-ABE7-F52991AEA0F7}.Debug.Build.0 = Debug|.NET - {6A525742-00CA-450B-ABE7-F52991AEA0F7}.Release.ActiveCfg = Release|.NET - {6A525742-00CA-450B-ABE7-F52991AEA0F7}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/FmtFileVars.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/FmtFileVars.cs deleted file mode 100644 index 82c24c8c..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/FMTformat/FmtFileVars.cs +++ /dev/null @@ -1,2169 +0,0 @@ -using System; -using System.IO; -using System.Text; -using System.Collections; -using System.Windows.Forms; -using System.Runtime.Serialization.Formatters.Binary; // read in struct -using System.Xml; -using System.Xml.Serialization; - - -public class fmtDefineAndEnums -{ - // values for AccessableTypes - public static ushort ADDING_CAUTION = 1; - public static ushort ADDING_NOTE = 2; - public static ushort ADDING_RNO = 4; - public static ushort ADDING_SUB = 8; - public static ushort ADDING_TABLE = 16; - public static ushort ADDING_NEXT = 32; - public static ushort ADDING_PREV = 64; - - /* Fonts: index into fonts[NFONTS] array */ - - public static uint ELITE = 0; - public static uint PICA = 1; - public static uint LN_PRN = 2; - public static uint CONDENSE = 3; - public static uint SANSERIF = 4; - public static uint PICA12 = 5; - public static uint PROPORTIONAL = 6; - public static uint PROPT12 = 7; - public static uint HVLPT18 = 8; - public static uint HVLPT25 = 9; - public static uint SPECIALCHARS = 10; - public static uint PT14 = 11; - public static uint SANSERIF14 = 12; - public static uint SANSERIF17 = 13; - public static uint HVLPT12 = 14; - public static uint NARRATOR = 15; - public static uint MEDUPUNIVERS = 16; - public static uint LGUPMED16 = 17; - public static uint PROPT10 = 18; - public static uint LG1275HP4SI = 19; - public static uint HVLPT10 = 20; - public static uint HVLPT8 = 21; - public static uint HVLPT14 = 22; - public static uint SANSERIF25 = 23; - public static uint EYECHART = 24; - public static uint TIMES11 = 25; - public static uint SANSCOND = 26; - - /* text styles */ - public static uint UNDERLINE = 64; - public static uint BOLD = 128; - public static uint LANDSCAPE = 256; - public static uint ITALICS = 512; - public static uint BOXED = 1024; - public static uint BOXELEMENT = 0x00000800; - public static uint TBCENTERED = 4096; - public static uint RTCHECKOFF = 8192; - public static uint LTCHECKOFF = 16384; - public static uint BIGSCRIPT = 32768; - public static uint HLTEXTHL = 65536; - public static uint RTCHECKOFFWITHASTERISK = 131072; /* 0x00020000L */ - public static uint DB_UNDERLINE = 262144; - public static uint COLDOTS = 524288; /* 0x00080000L */ - public static uint MMBOLD = 1048576; - public static uint RIGHTJUSTIFY = 2097152; - public static uint SUBSCRIPT = 4194304; - public static uint SUPERSCRIPT = 8388608; - public static uint PAGELISTITEM = 16777216; /* 0x01000000L */ - public static uint PRINTONTOPOFLINE = 33554432; /* 0x02000000L */ - public static uint HORZCENTER = 67108864; /* 0x04000000L */ - public static uint CIRCLESTRING2 = 0x08000000; - public static uint ALIGNWITHUP1 = 0x10000000; - public static uint ALIGNWSECNUM = 0x20000000; - public static uint MATCHCOLUMNMODE = 0x40000000; - public static uint KEEPRNOSUBSTYLE = 0x80000000; - - /* Replace Words Defines */ - public static ushort REPLACESIZE = 60; // Arrays size for ReplaceWords, **ReplaceWith, - // and ReplaceFlags - public static uint REPLEVERYTHING = 0x0000007F; // Turns on the Replace function for - // all classes of structure types - /*Highest 4 bits are OFF by Default*/ - /*REPLBKGD also OFF by default*/ - /*REPLHLSSETPNT also OFF by default*/ - /*REPLDIFFUNIT also OFF by default*/ - /*REPLTOC also OFF by default*/ - /*REPLPLACKEEP also OFF by default*/ - - public static uint REPLHIGH = 0x0001; //Do ReplaceWords in HIGH LEVEL STEPS - public static uint REPLRNO = 0x0002; //Do ReplaceWords in RNOS - public static uint REPLCAUTION = 0x0004; //Do ReplaceWords in CAUTIONS - public static uint REPLNOTE = 0x0008; //Do ReplaceWords in NOTES - public static uint REPLTABLE = 0x0010; //Do ReplaceWords in TABLES - public static uint REPLSUBSTEP = 0x0020; //Do ReplaceWords in SUBSTEPS - public static uint REPLATTACH = 0x0040; //Do ReplaceWords in ATTACHMENTS - public static uint REPLBKGD = 0x0080; //Do ReplaceWords in BACKGROUNDS - - public static uint REPLDIFFUNIT = 0x0100; //Do ReplaceWords ONLY for different UNIT # - public static uint REPLTOC = 0x0200; //Do in auto table-of-contents - public static uint REPLSTATTREE = 0x0400; - public static uint REPLHLSSETPNT = 0x0800; //Do ReplaceWords in HighLevelStep SETPoiNTs - - /*These bits are used for classes which - **are normally OFF, currently these - **are SETPOINTS and TRANSITIONS*/ - public static uint REPLTRAN = 0x1000; //Do ReplaceWords in TRANSITIONS - public static uint REPLSETPOINT = 0x2000; //Do ReplaceWords in SETPOINTS - - - /* Case Sensitivity Flags - default is off (Case Sensitive Replace)*/ - public static uint REPLCASEINSENS = 0x0000C000; //Do ReplaceWords for all words that - //match, regardless of case, and - //replace with the ReplaceWith string - //as is - - /* Setting either of the following flags individually replaces the ReplaceWord - ** occurrance with the original matched text surrounded by any special - ** characters in the ReplaceWith string*/ - public static uint REPLCASEINSENSFIRST = 0x4000; //Do ReplaceWords for all words that - // exactly match the ReplaceWord, except - // the case of the first character may - // be different - - public static uint REPLCASEINSENSALL = 0x8000; //Do ReplaceWords for all words that - //match the ReplaceWord, regardless of - //case - - public static uint REPLPARTIALS = 0x10000; // Do replace even on partial matches - public static uint REPLPLACKEEP = 0x20000; // Do replace in PlaceKeepers - public static uint REPLINSECTITLE = 0x40000; // replace words in section titles - - /* - ** Max number of substep type groups allowed to be made. - ** for use with TypeGroups - */ - public static short MAXTYPEGROUPS = 10; - public static short ENDGROUP = 99; - public static short MAXENHANCEDTYPES = 20; - - public static short MAXTRANS = 15; /* Max # of format defined transitions */ - - public static short MAXSECLEVELS = 10; - - public static short MAXMATCHPROCNUM = 10; - public static short MAXBOXES = 24; - public static short NUMBOXCHARS = 12; - public static short MAXTABS = 20; - -} - -[Serializable] -public struct FormatFlags -{ - public ushort XtraFlag_0; - public ushort XtraFlag_1; - public ushort XtraFlag_2; - public ushort XtraFlag_3; - public ushort XtraFlag_4; - public ushort XtraFlag_5; - public ushort XtraFlag_6; - public ushort XtraFlag_7; - public ushort XtraFlag_8; - public ushort XtraFlag_9; - public ushort XtraFlag_10; - public ushort XtraFlag_11; - public ushort XtraFlag_12; - public ushort XtraFlag_13; - public ushort XtraFlag_14; - public ushort XtraFlag_15; - public ushort XtraFlag_16; - public ushort XtraFlag_17; - public ushort VEAIRFlag; // VEAIRFlag - public ushort PurchaseOptions; // PurchaseOption -} - -[Serializable] -//public struct MaxRNOColumns -public struct ColunmShortValues -{ - public short OneColumn; - public short TwoColumn; - public short ThreeColumn; -} - -[Serializable] -public struct EditPrintShortValues -{ - public short Edit; - public short Print; -} - -[Serializable] -public struct AlternateRNOWidth -{ - public short FirstColumn; - public short SecondColumn; -} - -[Serializable] -public struct EditPrintStr -{ -// public string ForEdit; -// public string ForPrint; - public Txt ForEdit; - public Txt ForPrint; -} - - -[Serializable] -public struct SeqTab -{ - // Array of 9 substep levels (0-8) - // starting ASCII location for sequential substep tabs - //(0 = numbers, ` = lower case letters, @ = upper case letters) - // The sequence is recycled beyond the defined ones. -// public byte []SeqStart = new byte[9]; - public byte SeqStart; - - // LeftJustSeqTab - // - left justify the tab derived from SeqTab - // (pad tab on the right side with blanks) -// public short []LeftJustSeqTab = new short[9]; - public short LeftJustSeqTab; - - // SeqTab - the ". ", ") ", etc. that follows the sequential - // substep number/letter -// public string []SeqSubStpTabFmt = new string[9]; -// public string SeqSubStpTabFmt; // sequential substep tab format - public Txt SeqSubStpTabFmt; // sequential substep tab format - - // // PreSeqTab - text to pre-append to the substep's SeqTab - // // ex: "(" or "[" - // // [9] levels of seqtab - // // [2] modes: [0] = edit screen, [1] = printed page - // public string [,]PreSeqSubStp = new string[9,2]; -// public EditPrintStr []PreSeqSubStepTab = new EditPrintStr[9]; - public EditPrintStr PreSeqSubStepTab; - - // // PostSeqTab - (ATA format only) - // // - append this text to end of the substep's SeqTab - // // [9] levels of seqtab - // // [2] modes: [0] = edit screen, [1] = printed page - // public string [,]PostSeqSubStp = new string[9,2]; -// public EditPrintStr []PostSeqSubStepTab = new EditPrintStr[9]; - public EditPrintStr PostSeqSubStepTab; -} - -[Serializable] -public struct WidSTable -{ - public EditPrintShortValues OneColumn; - public EditPrintShortValues TwoColumns; - public EditPrintShortValues ThreeColumns; -} - -[Serializable] -public struct fmtTab -{ - public uint TbStyle; // TBStyle (font type) - font - public bool AlignWithParent; // AlignWithParentTab - public EditPrintStr TabFmt; // TBIdent [0]-screen [1]-Print - public EditPrintStr RNOTabFmt; // RNOTBIdent -// public string AltPrintTabFmt; // AltPrintTBIdent - public Txt AltPrintTabFmt; // AltPrintTBIdent -} - -//[Serializable] -public struct NCStr -{ - // [XmlElement] - public Txt ForEdit; - public Txt ForPrint; -} - - -//[Serializable] -//public struct ChkOffItem -//{ -//[XmlElement] -// public string []Item; -//} - -//public struct VerId -//{ -// [System.Xml.Serialization.XmlAttribute] -// public string Text; -//} - -public struct ChkOffSytle -{ - [System.Xml.Serialization.XmlAttribute] - public uint Style; -} - -public struct Txt -{ -// [System.Xml.Serialization.XmlAttribute] - [XmlAttribute] - public string Text; -} - -[Serializable] - public struct fmtChkOff - { - static int MAXCHECKOFFS = 18; - public int maxcheckoffs - { - get { return MAXCHECKOFFS;} - } - - static int MAXCHKHEADINGS = 5; - public int MaxCheckoffHeadings - { - get {return MAXCHKHEADINGS;} - } - - // RightCheckOffBox - // [0]AER - // [1]RNO - // [2]Commitment for Braidwood - // [3] (no supporting code) tied to value of TwoCheckOffspublic -// public short [] CheckoffBoxPosition;// = new int[4]; - public short AERCheckoffBoxPosition; - public short RNOCheckoffBoxPosition; - public short CommitmentMarkPosition; - public short UserSelectedCheckoffPosition; - - // RightCheckOffChars - public byte [] ChkOffScreenNotation;// = new byte[MAXCHECKOFFS]; - - //CheckOffWidAdjust - public byte []WidthAdjustment;// = new byte[MAXCHECKOFFS]; - - // CheckOffHeadStyle -font -// public uint []ChkOffHeaderStyle;// = new uint[MAXCHKHEADINGS]; - public ChkOffSytle []ChkOffHeaderStyle; - - // UseCheckoffIn - public int UseCheckOffsInTheseSections; - - //CheckOffAdjustment (not sure why we need this) - public byte PosAdjustment; - - //RightCheckOffPrompts -// [XmlElement] -// public string [] ChkOffMenuItems;// = new string[MAXCHECKOFFS]; -// [XmlArrayAttribute("MenuItems")] -// public ChkOffItem ChkOffMenuItems; - public Txt []ChkOffMenuItems; - - //CheckOffHeadings - [XmlArrayAttribute("Headings")] -// public string [] ChkOffHeadings;// = new string[MAXCHKHEADINGS]; -// public ChkOffItem []ChkOffHeadings; - public Txt []ChkOffHeadings; - } - - [Serializable] - public struct fmtChgBar - { - public short ChgBarType; // ChangeBarMessage - public short FixedChangeColumn; - public byte FixAERChangeColumn; - public uint ChgBarStyle; // ChangeBarStyle (this is set to font) -// public string ChgBar; // SpecialChangeBar or default to vertical line draw char - public Txt ChgBar; // SpecialChangeBar or default to vertical line draw char - } - - [Serializable] - public struct fmtBox - { - static int NUMBOXCHARS = 12; - public int NumBoxChars - { - get {return NUMBOXCHARS;} - } - - public enum BoxPiece {BXURC, BXHorz, BXULC, BXVert, BXMLS, BXMRS, BXLRC, BXLLC, BXMID, BXLHorz, BXUMID, BXLMID} - - public short BoxStart; //BXStart - public short BoxEnd; // BXEnd - public short BoxTextStart; //BXTxtStart - public short BoxTextWidth; //BXTxtWidth - public short BoxHeight; //BXHeight - public short BoxTabPos; //BXTabPos - public uint BoxStyle; //BXStyle - font - public byte BoxTextRowAdj; //BXTxtRowAdj -// public string []BoxChar;// = new string[NUMBOXCHARS]; // BXChar - index with -// // BoxPiece value - // BXChar - index with BoxPiece value - public Txt []BoxChar;// = new string[NUMBOXCHARS]; - } - - // Current Format design has one of these for each step type - [Serializable] - public struct fmtStep - { - public uint TextStyle; // STStyle (fonts) - public ushort Color; // Att (color on screen) - public short BlankLinesAfter; // STExtralines (# of blank lines after this piece) - public short BxInfoIdx; // STBoxindex; - public short TabIndex; // STTabsindex - public short PrintPosAdjust; // PrintPosAdjust - public ushort AccessableTypes; // AcTable - public short BlankLineAfterGroupOf; // EveryNLines (blank line after group of x items) - public bool UpperCaseTrans; // AlwaysUpperCase (upper case transitions) - public bool PageBreakAtTypeChange; // PageBreakAtTypechange - public bool AlignWithParentTab; //AlignWithParentTab - public short ChkOffGroups; //RtCheckOffGroups - public short WidthOverride; // StepTypeWidthOverride (overide default width) - public byte []VertPos;// = new Byte[15]; // VertPos (used for valves and checklist formats) - public short ColOverride; // StepTypeColOverride (override default col positon) -// public string SeparatorText; // Sep (used for OR step types for example) - public Txt SeparatorText; // Sep (used for OR step types for example) -// public string PrefixText; // StepPrefix - public Txt PrefixText; // StepPrefix -// public string SuffixText; // StepSuppfix - public Txt SuffixText; // StepSuppfix - // UnderlineTheseChar - print will underline these - // characters along with the normal characters -// public string UnderlineThese; - public Txt UnderlineThese; - } - - [Serializable] - public struct RplWord - { - // Used to specify which step types are affected - // by ReplaceWords and ReplaceWith. - public uint ReplaceFlag; - - // List of words/phrases to replace -// public string ReplaceWord; - public Txt ReplaceWord; - - // List of replacement words/phrases -// public string ReplaceWith; - public Txt ReplaceWith; - } - - [Serializable] - public struct TrnsDef // used to override default transition definitions - { - public byte TransType; // the true transition type of format defined transitions -// public string TransFmt; // format string for this transition type -// public string TransMenu; // Menu string for this transition type - public Txt TransFmt; // format string for this transition type - public Txt TransMenu; // Menu string for this transition type - } - - [Serializable] - public struct SectLevSettings - { - // Position of the sub (meta) section number on printed page - public byte SecNumPositionAdj; - - // Sub (meta) Section Title position on printed page - public byte SecTitlePositionAdj; - - // Override ColS and assign HLS a column position based on meta - // section level. Overrides automatic indentation supplied by - // the TieTabToLevel logic - public byte ColSByLevel; - - // Adjust the placement of meta sections in the table of contents - public byte TofCPositionAdj; - - // Adjust the WidS value (print mode) based on the step level - public byte WidSAdjByLevel; - } - - [Serializable] - public struct PrcDescript - { - // Mask to determine which procedures print procedure descriptor text -// public string MatchProcNumber; - public Txt MatchProcNumber; - - // Procedure descriptor text for procs matching the cooresponding - // MatchProcNumber mask. This is then put into the page list via the - // token -// public string ProcDescriptor; - public Txt ProcDescriptor; - - // 2nd procedure descriptor text put into the page list via the -// public string ProcDescriptor2; - public Txt ProcDescriptor2; - } - - - [Serializable] -// public struct CautNoteTypesOverride -public struct MenuItem - { - public short TextTypeValue; // Caution or Note type -// public string TextType; // menu entry corresponding to text type - public Txt TextType; // menu entry corresponding to text type - } - - -[Serializable] -public struct AutoTableOfContents -{ - // Auto Table of Contents formatting - public byte SecNumPos; // position of section number on TOC page - public byte SecTitlePos; // position of section title on TOC page - public byte SecTitleLen; // max length of section title (before it is wrapped) - public byte PageNumPos; // position of page number of the corresponding section - public byte SpaceChar; // charcter used from end of title to page number (ex "...") - public byte LineSpacing; // number of blank lines between TOC entries - public byte Font; // Font to used -} - - - - -[Serializable] -public class FmtFileVars : fmtDefineAndEnums - { - public string Title; // format title - - public int MaxNumBoxes - { - get {return MAXBOXES;} - } - - public int MaxTabs - { - get {return MAXTABS;} - } - - static int NUMStepTextTypes = 47; - public int NumStepSubStepTypes - { - get {return NUMStepTextTypes;} - } - - // Arrays size for ReplaceWords, **ReplaceWith, and ReplaceFlags - public int MaxReplaceItems - { - get { return REPLACESIZE;} - } - - public int MaxSectionLevels - { - get { return MAXSECLEVELS;} - } - - public int MaxTypeGroups - { - get {return MAXTYPEGROUPS;} - } - - public int MaxEnhancedTypes - { - get {return MAXENHANCEDTYPES;} - } - - // Max # of format defined transitions - public int MaxTrans - { - get {return MAXTRANS;} - } - - - enum StepTextTYPES - { - STANDARD, HIGH, IMMEDIATE, AND, OR, CAUTION, NOTE, TABLE, CONTINUOUS, AERTABLE, - EQUIPMENTLIST, TITLE, PAGENUMBER, EQUIPMENTWBLANK, PROCNUMBER, REVNUMBER, - ACCPAGES, LOSSOFAC, EXPLICITAND, CAUTION1, CAUTION2, NOTE1, NOTE2, PARAGRAPH, - DEFAULT, NOTE3, CAUTION3, NOTE4, CAUTION4, EQUIPMENTOPT, EQUIPMENTOPTWBLANK, - NOTE5, BORDERLESSAERTABLE, BORDERLESSTABLE, IMPLICITOR, FIGURE, AERFIGURE, - BORDERLESSFIGURE, BORDERLESSAERFIGURE, RNOTYPE, HIGH5, TITLEWITHTEXTRIGHT, - TITLEWITHTEXTBELOW, CONTACSEQUENTIAL, CONTACAND, CONTACOR, CONTACPARAGRAPH - } // a.k.a. STRUCTDEFTYPES in 16bit code - -// public ushort []XtraFlag = new ushort[18]; // XtraFlag[0-17] -// public ushort VEAIRFlag; // VEAIRFlag -// public ushort PurchaseOptions; // PurchaseOption - - public FormatFlags FmtFlags; // XtraFlag[0-17], VEAIRFlag, PurchaseOption - public bool Emode; // default edit mode (0=insert, 1=overstrike) - public short TopRow; // Top Row On Sreen - this is always set to Zero in p_refresh() - public bool DoPrintDriverAdjustments; // DoPrnDrvrAdjust - - public uint TopOfPageThingStyle; // TopOfPageThingStyle - public short TopOfPageThingCol; // TopOfPageThingCol - - public uint ModifiedTextSytle; // ModifiedText - public uint SeparatorStyle; // SeparatorStyle - - /* SeparatorLocation - Location of separator: - ** 0 - left, 1 - right, - ** 2+ - positions in the middle */ - public short SeparatorLocation; - - public short LastLineToStartStep; // LastLineToStartStep - public bool LineDrawingOption; // LineDrawingOption - always set to one (true) - - public short HLSTextStartPos; // ColS - public short HLSTextStartPosScrnAdj; // ColSScreenAdj - public short RNOTextStartPosScrnAdj; // ScrnSdjRNOText - - public short CautNoteTextStart; // ColT - - public short DefaultHLSTextPos; // ColAbs - If not tab, set ptr->Column to this value - - public short CautNoteTextWidth; // WidT - - public short NumColumns; // Pmode - number of columns - ActualPMode - - public short DefaultNumRNOColumns; //MaxRNO - this should be defined at a section level - - // MaxRNOTable[3] - // Number of RNO columns for sigle, two, and tree column step section formats -// public short []MaxRNOTable = new short[3]; - public ColunmShortValues MaxRNOTable; - - // ColRTable - // - starting position of RNO column this should be defined at a section level -// public short []StartRNOPosition = new short[3]; - public ColunmShortValues StartRNOPosition; - -// // WidSTable - width of HLS [0] - edit [1] - print -// public short [,]HLSwidth = new short[3,2]; - // Array of 3 - for each column mode -// public WidsSTable []HLSwidth = new EditPrintShortValues[3]; - public WidSTable HLSwidth; - - // ColRScreen - adjustment to starting of RNO column on screen - public ColunmShortValues StartRNOPosScrnAdj; - - //AdjRNOCol - adjust position of RNO column - public short RNOPositionAdj; - - // Change Bar Type and Format settings - public fmtChgBar ChangeBarSettings; - - // Number representing the font used in the Summary Of Changes report - public uint ChangeSummaryStyle; - - // TitleLength - Max length of title before it is split - public short TitleWidthBeforeSplitting; - - //CoverTitleLenth - Max length of title before it is split - public short CoverPgTitleWidthBeforeSplit; - - public fmtChkOff CheckOffSettings; // check off settings - - // EndMessagePos - this should be defined at a section level - // overrides the default (calculated) center position of - // the procedure step section's End Message but only if - // a Non-Proportional Font is being used for the End Message - public short EndMessageCenterPos; - - // Array of 9 substep levels (0-8) - // starting ASCII location for sequential substep tabs - //(0 = numbers, ` = lower case letters, @ = upper case letters) - // The sequence is recycled beyond the defined ones. -// public byte []SeqStart = new byte[9]; - - // Starting ASCII location for High Level Steps - // This will override the use default use of numbers for - // the High Level Step Tab (ex. setting to @ = upper case letters) - public byte HighSeqStart; - - // Character used in the ReplaceWith string to start - // an indent for text on following lines (IP2, PACA, PAC, SCE formats) - public byte IndentToken; - - // Column for step header use in Vogtle for the immediate action - // step type - public short ImmStepHdrCol; - // Style for the header - public uint ImmStepHdrStyle; - - // if NOT zero: - // [0] will be the width of the first RNO column, - // [1] the width of the second. - // - KEW OP format -// public short []RNOWidthAlt = new short[2]; - public AlternateRNOWidth RNOWidthAlt; - - // High Level Step Width OVerRiDe: - // when not zero, specify the width of the HLSs, - // overriding the value of WidSTable - // - KEW OP format - public short HLSWidthOVRD; - - // Set to the column format (1,2,3) for which PageList items - // in the range -99 to -1 will be printed with the section - // - either on the line at which the section begins, - // or if the section is being continued from a previous page, - // at the row given by the absolute value of PGrow. - public short SecColHdrforActPmode; - - // Style variables to be applied to section headers and numbering - // that are enabled by the ShowSectionTitles flag - public uint SectionNumberingStyle; - - // Style variables to be applied to section headers and numbering - //that are enabled by the ShowSectionTitles flag - public uint SectionHeaderStyle; - - // Style variables to be applied to section headers and numbering - // that are enabled by the ShowSectionTitles flag - public short SectionNumPos; - public byte SectionNumJust; - public short SectionHeaderPos; - public byte SectionHeaderJust; - public short SectionTitleLength; - - // Indicates which substep types will NOT be influenced by the - // print flag DontPaginateOnFirstSubStep3X. - // Each bit position maps to the substep menu position where - // 0x01 is sequential, 0x02 is the AND, 0x04 is the OR, etc. - public short SubPaginationWght; - - // Adjust the column position by this much of the substeps to the - // right of the TITLEWITHTEXTRIGHT substep type - public short TextTitleAdjustment; - -// // Automatic Table of Contents format settings - public AutoTableOfContents AutoTOC; - - // style used with VertPos - used for valve lineups and checklists formats - public uint VertStyle; - - // column position of centered table on printed page - public byte []TableCenterPos = new byte[3]; - - // LeftJustSeqTab - // - left justify the tab derived from SeqTab - // (pad tab on the right side with blanks) -// public short []LeftJustSeqTab = new short[9]; - - // Specify the number of HLS's that will appear on the HLS choice menu. - // Ex. if set to 2, only the first two HLS menu choices will appear - public byte NumberOfHighLevelSteps; - - // show only this many sub step types in the sub step menu - public short NumberOfSubStepTypes; - - // set to the "Old to New Conversion" setting (ex: A1) of the Continuous - // Action Summary section set up in the Doc Style format file - public uint AutoContActSummarySection; - - // IdentB - default bullet -// public string DefaultBullet; - public Txt DefaultBullet; - - // SeqTab - the ". ", ") ", etc. that follows the sequential - // substep number/letter -// public string []SeqSubStpTabFmt = new string[9]; - - // procedure descriptor text (use in PageList) - public PrcDescript []ProcDescriptors = new PrcDescript[10]; - - // For version id text, DRAFT, APPROVED, TEMPORARY, etc. - // Used for pagelist token -// public string []VersionIdText = new string[5]; -// public VerId []VersionIDText = new VerId[5]; - public Txt []VersionIDText = new Txt[5]; - - // String to apprear before and after the procedure title in a transition. - // ex. quotes around the title -// public string DelimiterForTransitionTitle; - public Txt DelimiterForTransitionTitle; - - // In transitions, delimit step number from substep letter, (ex 2.a vs 2a) -// public string StepSubstepDelimeter; - public Txt StepSubstepDelimeter; - - // Used in Through Transitions: 3a through 3c. - // others: 3a. Thru 3c, 3a THROUGH 3c -// public string ThroughString; - public Txt ThroughString; - - // char in proc number to flag suffix should be used - // - WPB, WPBA formats -// public string ProcedureSuffixFlags; - public Txt ProcedureSuffixFlags; - - // text that will appear next to procedure number - // used by in Page List - // - WPB, WPBA formats -// public string []ProcedureSuffix = new string[10]; - public Txt []ProcedureSuffix = new Txt[10]; - - // Text that appears at the top of the first page of the procedure steps -// public string TopOfPageThing; - public Txt TopOfPageThing; - -// // PreSeqTab - text to pre-append to the substep's SeqTab -// // ex: "(" or "[" -// // [9] levels of seqtab -// // [2] modes: [0] = edit screen, [1] = printed page -// public string [,]PreSeqSubStp = new string[9,2]; -// public EditPrintStr []PreSeqSubStepTab = new EditPrintStr[9]; -// -// // PostSeqTab - (ATA format only) -// // - append this text to end of the substep's SeqTab -// // [9] levels of seqtab -// // [2] modes: [0] = edit screen, [1] = printed page -// public string [,]PostSeqSubStp = new string[9,2]; -// public EditPrintStr []PostSeqSubStepTab = new EditPrintStr[9]; - - // Printed below the last RNO in each step - // ex: "---------------------------" -// public string RNOSepString; - public Txt RNOSepString; - - // Terminate underline if matches one of defined strings -// public string []UnderlineTerminate = new string[10]; - public Txt []UnderlineTerminate = new Txt[10]; - - // printed before and after a group of Immediate actionsteps -// public string []ImmStepHdr = new string[2]; - public Txt []ImmStepHdr = new Txt[2]; - - // override menu of HLS types (descriptions only) -// public string []AlternateStepTypes = new string[5]; - public Txt []AlternateStepTypes = new Txt[5]; - - // override menu of substep types (descriptions) -// public string []AlternateSubTypes = new string[16]; - public Txt []AlternateSubTypes = new Txt[16]; - -// // Holds the string "OBSERVE NOTE|CAUTION PRIOR TO STEP X" -// public string [,]ObserveNCString = new string[4,2]; -// public EditPrintStr []ObserveNCString = new EditPrintStr[4]; - public NCStr []ObserveNCString = new NCStr[4]; - -// public string PSInfFile; // Proc Specific Information file - public Txt PSInfFile; // Proc Specific Information file - - // String to appear on the line following the high Level step text -// public string HLStpSeparatorString; - public Txt HLStpSeparatorString; - - // String to appear on the line following the high level RNO step text -// public string HLRNOStpSeparatorString; - public Txt HLRNOStpSeparatorString; - - // Used to tell the pagination logic how far up the lines array to process - // while looking for a place to break. The default will divide the max lines - // out by "2" to get the lower limit value. -// public string LowerLimitDivisor; - public Txt LowerLimitDivisor; - - // used with Enhance Documents, this will be used for the step number when - // the user manually creates a new high level Enhanced Document step. -// public string NonLinkedStepNumber; - public Txt NonLinkedStepNumber; - - // used with Enhanced Documents, this will be used for the caution or note - // tab when the user manually creates a new Enhanced Caution or Note -// public string NonLinkedCautNoteNumber; - public Txt NonLinkedCautNoteNumber; - - // Name of directory for BG documents that print in duplex - // - Point Beach -// public string DuplexBGDirectory; - public Txt DuplexBGDirectory; - - // Name of directory for Dev Documents that print in duplex - // - Point Beach -// public string DuplexDDDirectory; - public Txt DuplexDDDirectory; - - // used with Enhanced Deviations, this will be used - // when the user does not link to an ERG step. -// public string NonLinkedRNONumber; - public Txt NonLinkedRNONumber; - -// // Format variables based on STRUCTDEFTYPES (step types) - public fmtStep []StepDefinitions = new fmtStep[NUMStepTextTypes]; -// -// // Define Note/Caution boxes - public fmtBox []BoxInfo = new fmtBox[MAXBOXES]; -// -// // Define Step/substep tabs - public fmtTab []TabInfo = new fmtTab[MAXTABS]; - -// // Define override of default Note/Caution type menu -// public CautNoteTypesOverride []CautNoteMenuOverride = new CautNoteTypesOverride[10]; - public MenuItem []CautNoteMenuOverride = new MenuItem[10]; - - // SeqTab definitions (substep tabs) - public SeqTab []SeqTabInfo = new SeqTab[9]; - -// // Define Replace Words list - public RplWord []ReplaceWordList = new RplWord[REPLACESIZE]; -// -// // Override of default transition definitions - public TrnsDef []TransDefs = new TrnsDef[MAXTRANS]; -// -// // Section related format settings - public SectLevSettings []SectionLevelSettings = new SectLevSettings[MAXSECLEVELS]; -} - -namespace procedureformat -{ - public class fmtFormat - { - /// - /// The FMT file variable settings - /// - private BinaryReader brFmt; - private string fmtName; - private byte []AllStrings; - - public fmtFormat(string nm) - { - fmtName = nm; - LoadFMTFile(nm); - } - private string GetStringFromAllStrings(int idx) - { - StringBuilder sb = new StringBuilder(); - while (AllStrings[idx] != 0) - { - sb.Append(Convert.ToChar(AllStrings[idx])); - idx++; - } -// return sb.ToString(); - return GetXMLElementText(sb.ToString()); - } - - private string GetXMLElementText(string instr) - { - string rtnstr; - XmlTextWriter xmlWriter; - StringWriter strWriter = new StringWriter(); - xmlWriter = new XmlTextWriter(strWriter); - xmlWriter.WriteString(instr); - xmlWriter.Flush(); - xmlWriter.Close(); - rtnstr = strWriter.ToString(); - - // Replace the single quote because ODBC fails if it's in a string. - // The single quote represents the beg/end of a string when the string - // is sent to ODBC. - // *** COMMENT OUT FOR NOW - NOT SURE IF WE NEED TO DO THIS - //rtnstr = rtnstr.Replace("\'","'"); - - return rtnstr; - } - - private string GetAsciiStringUntilNull(BinaryReader br) - { - StringBuilder inpstr = new StringBuilder(); - byte input = 0; - int cnt = 0; - bool stillread = true; - do - { - try - { - input = br.ReadByte(); - if (input==0) stillread=false; - inpstr.Append(Convert.ToChar(input)); - } - catch (System.IO.EndOfStreamException) - { - stillread=false; - } - cnt++; - }while (stillread); - - return (inpstr.ToString()); - } - - private string GetAsciiString(BinaryReader br, int len) - { - StringBuilder inpstr = new StringBuilder(); - byte input = 0; - int cnt = 0; - do - { - try - { - input = br.ReadByte(); - inpstr.Append(Convert.ToChar(input)); - } - catch (System.IO.EndOfStreamException) - { - input = 0; - while (cnt < len) - { - inpstr.Append(Convert.ToChar(input)); - cnt++; - } - } - cnt++; - }while (cnt < len); - - return (inpstr.ToString()); - } - - public void LoadFMTFile(string fname) - { - FmtFileVars FmtVars = new FmtFileVars(); - string str = null; - - // read in title. - brFmt = new BinaryReader(File.Open(fname,System.IO.FileMode.Open,System.IO.FileAccess.ReadWrite,FileShare.ReadWrite)); - short len = brFmt.ReadInt16(); - string tstr = GetAsciiString(brFmt,len); - char []nulls = {Convert.ToChar(0)}; - FmtVars.Title = tstr.TrimEnd(nulls); - - // read in struct name/def name/page file name - // - ignore these. - for (int i=0;i<3;i++) - { - len = brFmt.ReadInt16(); - str = GetAsciiString(brFmt,len); - } - - // Get the number of Int's, Long's, Char's (bytes) - // - This is the number of bytes to the character strings part - // of the format file. - short numIntsLongsBytes = brFmt.ReadInt16(); - - // Read in all the Int, Long, and Char variable values - // for the FMT files. Get the order of the format variables - // from the FORMAT.STR file in the 16-bit code (\PROMSNT\FORMAT) - // and maps the old 16-bit variables with the 32-bit structures and classes - -// short BytesReadIn = 0; - - // the first format value is a place holder, read and ignore it. - byte skip_byte; - ushort skip_short; - uint skip_int; - - // FirstChar - skip_byte = brFmt.ReadByte(); - - // XtraFlag[18] -// for (int i=0; i < 18; i++) -// FmtVars.XtraFlag[i] = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_0 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_1 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_2 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_3 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_4 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_5 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_6 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_7 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_8 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_9 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_10 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_11 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_12 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_13 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_14 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_15 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_16 = brFmt.ReadUInt16(); - FmtVars.FmtFlags.XtraFlag_17 = brFmt.ReadUInt16(); - - // VEAIRFlag -// FmtVars.VEAIRFlag = brFmt.ReadUInt16(); - FmtVars.FmtFlags.VEAIRFlag = brFmt.ReadUInt16(); - - // PurchaseOption -// FmtVars.PurchaseOptions = brFmt.ReadUInt16(); - FmtVars.FmtFlags.PurchaseOptions = brFmt.ReadUInt16(); - - // EMode - skip_short = brFmt.ReadUInt16(); - FmtVars.Emode = (skip_short == 1); - - // TopRow - FmtVars.TopRow = brFmt.ReadInt16(); - - // Appendlines (ANO, V.C. Summer) - skip_short = brFmt.ReadUInt16(); - - // DoPrnDrvrAdjusts - skip_short = brFmt.ReadUInt16(); - FmtVars.DoPrintDriverAdjustments = (skip_short == 1); - - // STStyle[STRUCTDEFTYPES] - for (int i=0; i < FmtVars.NumStepSubStepTypes; i++) - FmtVars.StepDefinitions[i].TextStyle = brFmt.ReadUInt32(); - - // Att[STRUCTDEFTYPES] (atribute) - for (int i=0;i 0) -// FmtVars.BoxInfo[i].BoxChar[j] = GetStringFromAllStrings(offset-1); -// FmtVars.BoxInfo[i].BoxChar[j].Item = GetStringFromAllStrings(offset-1); - FmtVars.BoxInfo[i].BoxChar[j].Text = GetStringFromAllStrings(offset-1); - } - } - - // TBIdent[MAXTABS][2] - for (int i=0; i < FmtVars.MaxTabs; i++) - { - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.TabInfo[i].TabFmt.ForEdit = GetStringFromAllStrings(offset-1); -// FmtVars.TabInfo[i].TabFmt.ForEdit.Item = GetStringFromAllStrings(offset-1); - FmtVars.TabInfo[i].TabFmt.ForEdit.Text = GetStringFromAllStrings(offset-1); - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.TabInfo[i].TabFmt.ForPrint = GetStringFromAllStrings(offset-1); -// FmtVars.TabInfo[i].TabFmt.ForPrint.Item = GetStringFromAllStrings(offset-1); - FmtVars.TabInfo[i].TabFmt.ForPrint.Text = GetStringFromAllStrings(offset-1); - } -// for (int j=0; j < 2; j++) -// { -// offset = brFmt.ReadInt16(); -// if (offset > 0) -// FmtVars.TabInfo[i].TabFmt[j] = GetStringFromAllStrings(offset-1); -// } - - // Sep[STRUCTDEFTYPES] - for (int i=0;i 0) -// FmtVars.StepDefinitions[i].SeparatorText = GetStringFromAllStrings(offset-1); -// FmtVars.StepDefinitions[i].SeparatorText.Item = GetStringFromAllStrings(offset-1); - FmtVars.StepDefinitions[i].SeparatorText.Text = GetStringFromAllStrings(offset-1); - } - - // StepPrefix[STRUCTDEFTYPES] - for (int i=0;i 0) -// FmtVars.StepDefinitions[i].PrefixText = GetStringFromAllStrings(offset-1); -// FmtVars.StepDefinitions[i].PrefixText.Item = GetStringFromAllStrings(offset-1); - FmtVars.StepDefinitions[i].PrefixText.Text = GetStringFromAllStrings(offset-1); - } - - // StepSuffix[STRUCTDEFTYPES] - for (int i=0;i 0) -// FmtVars.StepDefinitions[i].SuffixText = GetStringFromAllStrings(offset-1); -// FmtVars.StepDefinitions[i].SuffixText.Item = GetStringFromAllStrings(offset-1); - FmtVars.StepDefinitions[i].SuffixText.Text = GetStringFromAllStrings(offset-1); - } - - // IdentB - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.DefaultBullet = GetStringFromAllStrings(offset-1); - FmtVars.DefaultBullet.Text = GetStringFromAllStrings(offset-1); - - // SeqTab[9] - for (int i=0; i<9; i++) - { - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.SeqSubStpTabFmt[i] = GetStringFromAllStrings(offset-1); -// FmtVars.SeqTabInfo[i].SeqSubStpTabFmt = GetStringFromAllStrings(offset-1); -// FmtVars.SeqTabInfo[i].SeqSubStpTabFmt.Item = GetStringFromAllStrings(offset-1); - FmtVars.SeqTabInfo[i].SeqSubStpTabFmt.Text = GetStringFromAllStrings(offset-1); - } - - // ReplaceWord[REPLACESIZE] - for (int i=0;i 0) -// FmtVars.ReplaceWordList[i].ReplaceWord = GetStringFromAllStrings(offset-1); -// FmtVars.ReplaceWordList[i].ReplaceWord.Item = GetStringFromAllStrings(offset-1); - FmtVars.ReplaceWordList[i].ReplaceWord.Text = GetStringFromAllStrings(offset-1); - } - - // ReplaceWith[REPLACESIZE] - for (int i=0;i 0) -// FmtVars.ReplaceWordList[i].ReplaceWith = GetStringFromAllStrings(offset-1); -// FmtVars.ReplaceWordList[i].ReplaceWith.Item = GetStringFromAllStrings(offset-1); - FmtVars.ReplaceWordList[i].ReplaceWith.Text = GetStringFromAllStrings(offset-1); - } - - // MatchProcNumber[10] - for (int i=0;i<10;i++) - { - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.ProcDescriptors[i].MatchProcNumber = GetStringFromAllStrings(offset-1); -// FmtVars.ProcDescriptors[i].MatchProcNumber.Item = GetStringFromAllStrings(offset-1); - FmtVars.ProcDescriptors[i].MatchProcNumber.Text = GetStringFromAllStrings(offset-1); - } - - // ProcDescriptor[10] - for (int i=0;i<10;i++) - { - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.ProcDescriptors[i].ProcDescriptor = GetStringFromAllStrings(offset-1); -// FmtVars.ProcDescriptors[i].ProcDescriptor.Item = GetStringFromAllStrings(offset-1); - FmtVars.ProcDescriptors[i].ProcDescriptor.Text = GetStringFromAllStrings(offset-1); - } - - // ProcDescriptor2[10] - for (int i=0;i<10;i++) - { - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.ProcDescriptors[i].ProcDescriptor2 = GetStringFromAllStrings(offset-1); -// FmtVars.ProcDescriptors[i].ProcDescriptor2.Item = GetStringFromAllStrings(offset-1); - FmtVars.ProcDescriptors[i].ProcDescriptor2.Text = GetStringFromAllStrings(offset-1); - } - - // VersionIdText[5] - for (int i=0; i<5; i++) - { - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.VersionIdText[i] = GetStringFromAllStrings(offset-1); - FmtVars.VersionIDText[i].Text = GetStringFromAllStrings(offset-1); -// FmtVars.VersionIDText[i].Item = GetStringFromAllStrings(offset-1); - } - - // DelimiterForTransitionTitle - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.DelimiterForTransitionTitle = GetStringFromAllStrings(offset-1); - FmtVars.DelimiterForTransitionTitle.Text = GetStringFromAllStrings(offset-1); - - // SetpSubstepDelimeter - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.StepSubstepDelimeter = GetStringFromAllStrings(offset-1); - FmtVars.StepSubstepDelimeter.Text = GetStringFromAllStrings(offset-1); - - //ThroughString - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.ThroughString = GetStringFromAllStrings(offset-1); -// FmtVars.ThroughString.Item = GetStringFromAllStrings(offset-1); - FmtVars.ThroughString.Text = GetStringFromAllStrings(offset-1); - - // ProcedureSuffixFlags - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.ProcedureSuffixFlags = GetStringFromAllStrings(offset-1); - FmtVars.ProcedureSuffixFlags.Text = GetStringFromAllStrings(offset-1); - - // ProcedureSuffix[10] - for (int i=0;i<10;i++) - { - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.ProcedureSuffix[i] = GetStringFromAllStrings(offset-1); -// FmtVars.ProcedureSuffix[i].Item = GetStringFromAllStrings(offset-1); - FmtVars.ProcedureSuffix[i].Text = GetStringFromAllStrings(offset-1); - } - - // PlantDnLoad - skip_short = brFmt.ReadUInt16(); - - // TopOfPageThing - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.TopOfPageThing = GetStringFromAllStrings(offset-1); - FmtVars.TopOfPageThing.Text = GetStringFromAllStrings(offset-1); - - // XTitle[3][10] - for (int i=0; i < 30; i++) - skip_short= brFmt.ReadUInt16(); - - // TextType[10] - for(int i=0;i<10;i++) - { - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.CautNoteMenuOverride[i].TextType = GetStringFromAllStrings(offset-1); -// FmtVars.CautNoteMenuOverride[i].TextType.Item = GetStringFromAllStrings(offset-1); - FmtVars.CautNoteMenuOverride[i].TextType.Text = GetStringFromAllStrings(offset-1); - } - - // SectionsToPrint[10] - for (int i=0; i < 10; i++) - skip_short = brFmt.ReadUInt16(); - - // SectionsNumberMask[10] - for (int i=0; i < 10; i++) - skip_short = brFmt.ReadUInt16(); - - // SectionsToPrintTitle[10] - for (int i=0; i < 10; i++) - skip_short = brFmt.ReadUInt16(); - - // DocumentTitleExtensions[10] - for (int i=0; i < 10; i++) - skip_short = brFmt.ReadUInt16(); - - // DocumentFixFileExtensions[10] - for (int i=0; i < 10; i++) - skip_short = brFmt.ReadUInt16(); - - // PreSeqTab[9][2] - for (int i =0; i < 9; i++) - { - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.PreSeqSubStepTab[i].ForEdit = GetStringFromAllStrings(offset-1); -// FmtVars.SeqTabInfo[i].PreSeqSubStepTab.ForEdit = GetStringFromAllStrings(offset-1); -// FmtVars.SeqTabInfo[i].PreSeqSubStepTab.ForEdit.Item = GetStringFromAllStrings(offset-1); - FmtVars.SeqTabInfo[i].PreSeqSubStepTab.ForEdit.Text = GetStringFromAllStrings(offset-1); - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.PreSeqSubStepTab[i].ForPrint = GetStringFromAllStrings(offset-1); -// FmtVars.SeqTabInfo[i].PreSeqSubStepTab.ForPrint = GetStringFromAllStrings(offset-1); -// FmtVars.SeqTabInfo[i].PreSeqSubStepTab.ForPrint.Item = GetStringFromAllStrings(offset-1); - FmtVars.SeqTabInfo[i].PreSeqSubStepTab.ForPrint.Text = GetStringFromAllStrings(offset-1); - } - -// for (int j=0; j < 2; j++) -// { -// offset = brFmt.ReadInt16(); -// if (offset > 0) -// FmtVars.PreSeqSubStp[i,j] = GetStringFromAllStrings(offset-1); -// } - - // PostSeqTab[9][2] - for (int i =0; i<9;i++) - { - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.PostSeqSubStepTab[i].ForEdit = GetStringFromAllStrings(offset-1); -// FmtVars.SeqTabInfo[i].PostSeqSubStepTab.ForEdit = GetStringFromAllStrings(offset-1); -// FmtVars.SeqTabInfo[i].PostSeqSubStepTab.ForEdit.Item = GetStringFromAllStrings(offset-1); - FmtVars.SeqTabInfo[i].PostSeqSubStepTab.ForEdit.Text = GetStringFromAllStrings(offset-1); - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.PostSeqSubStepTab[i].ForPrint = GetStringFromAllStrings(offset-1); -// FmtVars.SeqTabInfo[i].PostSeqSubStepTab.ForPrint = GetStringFromAllStrings(offset-1); -// FmtVars.SeqTabInfo[i].PostSeqSubStepTab.ForPrint.Item = GetStringFromAllStrings(offset-1); - FmtVars.SeqTabInfo[i].PostSeqSubStepTab.ForPrint.Text = GetStringFromAllStrings(offset-1); - } -// for (int j=0; j < 2; j++) -// { -// offset = brFmt.ReadInt16(); -// if (offset > 0) -// FmtVars.PostSeqSubStp[i,j] = GetStringFromAllStrings(offset-1); -// } - - // RNOSepString - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.RNOSepString = GetStringFromAllStrings(offset-1); - FmtVars.RNOSepString.Text = GetStringFromAllStrings(offset-1); - - // UnderlineTerminate[10] - for (int i=0; i < 10; i++) - { - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.UnderlineTerminate[i] = GetStringFromAllStrings(offset-1); -// FmtVars.UnderlineTerminate[i].Item = GetStringFromAllStrings(offset-1); - FmtVars.UnderlineTerminate[i].Text = GetStringFromAllStrings(offset-1); - } - - // ImmStepHdr[2] - for (int i=0; i < 2; i++) - { - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.ImmStepHdr[i] = GetStringFromAllStrings(offset-1); -// FmtVars.ImmStepHdr[i].Item = GetStringFromAllStrings(offset-1); - FmtVars.ImmStepHdr[i].Text = GetStringFromAllStrings(offset-1); - } - - // AlternateStepTypes[5] - for (int i=0; i < 5; i++) - { - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.AlternateStepTypes[i] = GetStringFromAllStrings(offset-1); -// FmtVars.AlternateStepTypes[i].Item = GetStringFromAllStrings(offset-1); - FmtVars.AlternateStepTypes[i].Text = GetStringFromAllStrings(offset-1); - } - - // AlternateSubTypes[16] - for (int i=0; i < 16; i++) - { - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.AlternateSubTypes[i] = GetStringFromAllStrings(offset-1); -// FmtVars.AlternateSubTypes[i].Item = GetStringFromAllStrings(offset-1); - FmtVars.AlternateSubTypes[i].Text = GetStringFromAllStrings(offset-1); - } - - // SpecialChangeBar - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.ChangeBarSettings.ChgBar = GetStringFromAllStrings(offset-1); -// FmtVars.ChangeBarSettings.ChgBar.Item = GetStringFromAllStrings(offset-1); - FmtVars.ChangeBarSettings.ChgBar.Text = GetStringFromAllStrings(offset-1); - - // ImperfectStructureSeparator - skip_short = brFmt.ReadUInt16(); - - // ObserveNCString[4][2] - for (int i=0; i < 4; i++) - { - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.ObserveNCString[i].ForEdit = GetStringFromAllStrings(offset-1); -// FmtVars.ObserveNCString[i].ForEdit.Item = GetStringFromAllStrings(offset-1); -// FmtVars.ObserveNCString[i].ForEdit.Text = GetStringFromAllStrings(offset-1); - FmtVars.ObserveNCString[i].ForEdit.Text = GetStringFromAllStrings(offset-1); - if (offset > 0) -// FmtVars.ObserveNCString[i].ForPrint = GetStringFromAllStrings(offset-1); -// FmtVars.ObserveNCString[i].ForPrint.Item = GetStringFromAllStrings(offset-1); -// FmtVars.ObserveNCString[i].ForPrint.Text = GetStringFromAllStrings(offset-1); - FmtVars.ObserveNCString[i].ForPrint.Text = GetStringFromAllStrings(offset-1); - } -// for (int j=0; j < 2; j++) -// { -// offset = brFmt.ReadInt16(); -// if (offset > 0) -// FmtVars.ObserveNCString[i,j] = GetStringFromAllStrings(offset-1); -// } - - //UnderlineTheseChar - for (int i=0;i0) -// FmtVars.StepDefinitions[i].UnderlineThese = GetStringFromAllStrings(offset-1); -// FmtVars.StepDefinitions[i].UnderlineThese.Item = GetStringFromAllStrings(offset-1); - FmtVars.StepDefinitions[i].UnderlineThese.Text = GetStringFromAllStrings(offset-1); - } - - // SubScriptTheseChar - skip_short = brFmt.ReadUInt16(); - - // RightCheckoffPrompts[MAXCHECKOFFS] -// FmtVars.CheckOffSettings.ChkOffMenuItems = new string[FmtVars.CheckOffSettings.maxcheckoffs]; -// FmtVars.CheckOffSettings.ChkOffMenuItems = new ChkOffItem[FmtVars.CheckOffSettings.maxcheckoffs]; -// FmtVars.CheckOffSettings.ChkOffMenuItems.Item = new string[FmtVars.CheckOffSettings.maxcheckoffs]; - FmtVars.CheckOffSettings.ChkOffMenuItems = new Txt[FmtVars.CheckOffSettings.maxcheckoffs]; - for (int i=0; i < FmtVars.CheckOffSettings.maxcheckoffs; i++) - { - offset = brFmt.ReadInt16(); - if (offset > 0) - { -// FmtVars.CheckOffSettings.ChkOffMenuItems[i] = GetStringFromAllStrings(offset-1); -// FmtVars.CheckOffSettings.ChkOffMenuItems[i].Item = GetStringFromAllStrings(offset-1); - FmtVars.CheckOffSettings.ChkOffMenuItems[i].Text = GetStringFromAllStrings(offset-1); - } - } - - // CheckOffHeadings[MAXCHKHEADINGS] -// FmtVars.CheckOffSettings.ChkOffHeadings = new string[FmtVars.CheckOffSettings.MaxCheckoffHeadings]; -// FmtVars.CheckOffSettings.ChkOffHeadings = new ChkOffItem[FmtVars.CheckOffSettings.MaxCheckoffHeadings]; - FmtVars.CheckOffSettings.ChkOffHeadings = new Txt[FmtVars.CheckOffSettings.MaxCheckoffHeadings]; - for (int i=0; i < FmtVars.CheckOffSettings.MaxCheckoffHeadings; i++) - { - offset = brFmt.ReadInt16(); - if (offset >0) - { -// FmtVars.CheckOffSettings.ChkOffHeadings[i] = GetStringFromAllStrings(offset-1); -// FmtVars.CheckOffSettings.ChkOffHeadings[i].Item = GetStringFromAllStrings(offset-1); - FmtVars.CheckOffSettings.ChkOffHeadings[i].Text = GetStringFromAllStrings(offset-1); - } - } - - // WindEditFile - skip_short = brFmt.ReadUInt16(); - - // PSInfFile - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.PSInfFile = GetStringFromAllStrings(offset-1); - FmtVars.PSInfFile.Text = GetStringFromAllStrings(offset-1); - - // RNOPreSeqTab[9][2] - for (int i=0;i<9;i++) - for (int j=0; j<2; j++) - skip_short = brFmt.ReadUInt16(); - - // HLStpSeparatorString - offset = brFmt.ReadInt16(); - if (offset >0) -// FmtVars.HLStpSeparatorString = GetStringFromAllStrings(offset-1); - FmtVars.HLStpSeparatorString.Text = GetStringFromAllStrings(offset-1); - - // HLRNOStpSeparatorString - offset = brFmt.ReadInt16(); - if (offset >0) -// FmtVars.HLRNOStpSeparatorString = GetStringFromAllStrings(offset-1); - FmtVars.HLRNOStpSeparatorString.Text = GetStringFromAllStrings(offset-1); - - // RNOTBIdent[MAXTABS][2] - for (int i=0;i 0) -// FmtVars.TabInfo[i].RNOTabFmt.ForEdit = GetStringFromAllStrings(offset-1); -// FmtVars.TabInfo[i].RNOTabFmt.ForEdit.Item = GetStringFromAllStrings(offset-1); - FmtVars.TabInfo[i].RNOTabFmt.ForEdit.Text = GetStringFromAllStrings(offset-1); - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.TabInfo[i].RNOTabFmt.ForPrint = GetStringFromAllStrings(offset-1); -// FmtVars.TabInfo[i].RNOTabFmt.ForPrint.Item = GetStringFromAllStrings(offset-1); - FmtVars.TabInfo[i].RNOTabFmt.ForPrint.Text = GetStringFromAllStrings(offset-1); - } -// for (int j=0;j<2;j++) -// { -// offset = brFmt.ReadInt16(); -// if (offset > 0) -// FmtVars.TabInfo[i].RNOTabFmt[j] = GetStringFromAllStrings(offset-1); -// } - - // LowserLimitDivisor - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.LowerLimitDivisor=GetStringFromAllStrings(offset-1); - FmtVars.LowerLimitDivisor.Text=GetStringFromAllStrings(offset-1); - - // TransFmt[MAXTRANS] - for (int i=0;i 0) -// FmtVars.TransDefs[i].TransFmt = GetStringFromAllStrings(offset-1); -// FmtVars.TransDefs[i].TransFmt.Item = GetStringFromAllStrings(offset-1); - FmtVars.TransDefs[i].TransFmt.Text = GetStringFromAllStrings(offset-1); - } - - // TransMenu[MAXTRANS] - for (int i=0;i 0) -// FmtVars.TransDefs[i].TransMenu = GetStringFromAllStrings(offset-1); -// FmtVars.TransDefs[i].TransMenu.Item = GetStringFromAllStrings(offset-1); - FmtVars.TransDefs[i].TransMenu.Text = GetStringFromAllStrings(offset-1); - } - - // OutsideTransFmt[MAXTRANS] - for (int i=0;i 0) -// FmtVars.NonLinkedStepNumber = GetStringFromAllStrings(offset-1); - FmtVars.NonLinkedStepNumber.Text = GetStringFromAllStrings(offset-1); - - // BldLstFile - skip_short = brFmt.ReadUInt16(); - - // AltPrintTBIdent[MAXTABS] - for (int i=0;i 0) -// FmtVars.TabInfo[i].AltPrintTabFmt = GetStringFromAllStrings(offset-1); -// FmtVars.TabInfo[i].AltPrintTabFmt.Item = GetStringFromAllStrings(offset-1); - FmtVars.TabInfo[i].AltPrintTabFmt.Text = GetStringFromAllStrings(offset-1); - } - - // NonLinkedCautNoteNumber - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.NonLinkedCautNoteNumber = GetStringFromAllStrings(offset-1); - FmtVars.NonLinkedCautNoteNumber.Text = GetStringFromAllStrings(offset-1); - - // F_DuplexBGDirectory - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.DuplexBGDirectory = GetStringFromAllStrings(offset-1); - FmtVars.DuplexBGDirectory.Text = GetStringFromAllStrings(offset-1); - - // F_DuplexDDDirectory - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.DuplexDDDirectory = GetStringFromAllStrings(offset-1); - FmtVars.DuplexDDDirectory.Text = GetStringFromAllStrings(offset-1); - - // NonLinkedRNONumber - offset = brFmt.ReadInt16(); - if (offset > 0) -// FmtVars.NonLinkedRNONumber = GetStringFromAllStrings(offset-1); - FmtVars.NonLinkedRNONumber.Text = GetStringFromAllStrings(offset-1); - - - -/***********************************************/ - - brFmt.Close(); - - // Now try to xml it.... - string XMLFileName = "C:\\" + fname.Substring(fname.LastIndexOf("\\")+1) + ".XML"; - XmlSerializer serializer = new XmlSerializer(typeof(FmtFileVars)); - TextWriter writer = new StreamWriter(XMLFileName); - - serializer.Serialize(writer, FmtVars); - writer.Close(); - MessageBox.Show(XMLFileName,"Created XML File:"); - } - } - -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/ArcData.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/ArcData.cs deleted file mode 100644 index 9ca71c38..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/ArcData.cs +++ /dev/null @@ -1,143 +0,0 @@ -/********************************************************************************************* - * Copyright 2005 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ArcData.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 3/08/05 1:44p $ - * - * $History: ArcData.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:44p - * Created in $/LibSource/GUI_Utils - * Approval - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:40p - * Created in $/LibSource/GUI_Utils/GUI_Utils - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:33p - * Created in $/LibSource/GUI_Utils/GUI_Utils - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:32p - * Created in $/LibSource/GUI_Utils/GUI_Utils - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:30p - * Created in $/GUI_Utils/GUI_Utils - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:16p - * Created in $/EXE/GUI_Utils - * Approval - *********************************************************************************************/ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace GUI_Utils -{ - /// - /// Summary description for ArcData. - /// - public class ArcData : System.Windows.Forms.Form - { - private System.Windows.Forms.Label lblPrompt; - private System.Windows.Forms.Button btnYes; - private System.Windows.Forms.Button btnNo; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public ArcData(string Caption, string Message) - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - this.Text = Caption; - this.lblPrompt.Text = Message; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ArcData)); - this.lblPrompt = new System.Windows.Forms.Label(); - this.btnYes = new System.Windows.Forms.Button(); - this.btnNo = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // lblPrompt - // - this.lblPrompt.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblPrompt.Location = new System.Drawing.Point(40, 16); - this.lblPrompt.Name = "lblPrompt"; - this.lblPrompt.Size = new System.Drawing.Size(224, 56); - this.lblPrompt.TabIndex = 0; - this.lblPrompt.Text = "Do you want to save the current data to an archive file before proceeding with th" + - "e Approval or Revise?"; - // - // btnYes - // - this.btnYes.DialogResult = System.Windows.Forms.DialogResult.Yes; - this.btnYes.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnYes.Location = new System.Drawing.Point(56, 88); - this.btnYes.Name = "btnYes"; - this.btnYes.Size = new System.Drawing.Size(80, 24); - this.btnYes.TabIndex = 1; - this.btnYes.Text = "Yes"; - // - // btnNo - // - this.btnNo.DialogResult = System.Windows.Forms.DialogResult.No; - this.btnNo.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnNo.Location = new System.Drawing.Point(176, 88); - this.btnNo.Name = "btnNo"; - this.btnNo.Size = new System.Drawing.Size(72, 24); - this.btnNo.TabIndex = 2; - this.btnNo.Text = "No"; - // - // ArcData - // - this.AutoScale = false; - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(292, 126); - this.Controls.Add(this.btnNo); - this.Controls.Add(this.btnYes); - this.Controls.Add(this.lblPrompt); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "ArcData"; - this.Text = "Archive Data"; - this.ResumeLayout(false); - - } - #endregion - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/ArcData.resx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/ArcData.resx deleted file mode 100644 index 89da3327..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/ArcData.resx +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - ArcData - - - True - - - Private - - - - AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx - dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx - F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3 - d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx - dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3 - F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX - cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3 - F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX - cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/AssemblyInfo.cs deleted file mode 100644 index 7e3b35a5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/AssemblyInfo.cs.bak deleted file mode 100644 index 2531b7f9..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")] -[assembly: AssemblyKeyName("")] \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/GUI_Utils.csproj b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/GUI_Utils.csproj deleted file mode 100644 index 93d8eba0..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/GUI_Utils.csproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/GUI_Utils.sln b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/GUI_Utils.sln deleted file mode 100644 index 6429ae93..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/GUI_Utils.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GUI_Utils", "GUI_Utils.csproj", "{0D980CD1-0EFF-4E46-8501-E9DF31A41AC3}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {0D980CD1-0EFF-4E46-8501-E9DF31A41AC3}.Debug.ActiveCfg = Debug|.NET - {0D980CD1-0EFF-4E46-8501-E9DF31A41AC3}.Debug.Build.0 = Debug|.NET - {0D980CD1-0EFF-4E46-8501-E9DF31A41AC3}.Release.ActiveCfg = Release|.NET - {0D980CD1-0EFF-4E46-8501-E9DF31A41AC3}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/ReadWord.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/ReadWord.cs deleted file mode 100644 index 81a94399..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/ReadWord.cs +++ /dev/null @@ -1,161 +0,0 @@ -/********************************************************************************************* - * Copyright 2005 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ReadWord.cs $ $Revision: 2 $ - * $Author: Jsj $ $Date: 5/17/05 11:45a $ - * - * $History: ReadWord.cs $ - * - * ***************** Version 2 ***************** - * User: Jsj Date: 5/17/05 Time: 11:45a - * Updated in $/LibSource/GUI_Utils - * position in center of screen - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:45p - * Created in $/LibSource/GUI_Utils - * Approval - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:40p - * Created in $/LibSource/GUI_Utils/GUI_Utils - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:33p - * Created in $/LibSource/GUI_Utils/GUI_Utils - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:32p - * Created in $/LibSource/GUI_Utils/GUI_Utils - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:30p - * Created in $/GUI_Utils/GUI_Utils - *********************************************************************************************/ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace GUI_Utils -{ - /// - /// Summary description for ReadWord. - /// - public class frmReadWord : System.Windows.Forms.Form - { - private System.Windows.Forms.TextBox tbInput; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Label lblInput; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public frmReadWord(string inpText,string caption) - { - InitializeComponent(); - this.lblInput.Text = caption; - this.tbInput.Text = inpText; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmReadWord)); - this.lblInput = new System.Windows.Forms.Label(); - this.tbInput = new System.Windows.Forms.TextBox(); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // lblInput - // - this.lblInput.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblInput.Location = new System.Drawing.Point(19, 9); - this.lblInput.Name = "lblInput"; - this.lblInput.Size = new System.Drawing.Size(451, 28); - this.lblInput.TabIndex = 0; - // - // tbInput - // - this.tbInput.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.tbInput.Location = new System.Drawing.Point(10, 46); - this.tbInput.Name = "tbInput"; - this.tbInput.Size = new System.Drawing.Size(460, 24); - this.tbInput.TabIndex = 1; - this.tbInput.Text = "textBox1"; - // - // btnOK - // - this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnOK.Location = new System.Drawing.Point(125, 92); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(96, 28); - this.btnOK.TabIndex = 2; - this.btnOK.Text = "OK"; - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnCancel.Location = new System.Drawing.Point(259, 92); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.RightToLeft = System.Windows.Forms.RightToLeft.Yes; - this.btnCancel.Size = new System.Drawing.Size(96, 28); - this.btnCancel.TabIndex = 3; - this.btnCancel.Text = "Cancel"; - // - // frmReadWord - // - this.AutoScale = false; - this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); - this.ClientSize = new System.Drawing.Size(489, 136); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnOK); - this.Controls.Add(this.tbInput); - this.Controls.Add(this.lblInput); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "frmReadWord"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "VE-PROMS"; - this.TopMost = true; - this.ResumeLayout(false); - - } - #endregion - - public string ReadWordText - { - get - { - return this.tbInput.Text; - } - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/ReadWord.resx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/ReadWord.resx deleted file mode 100644 index 77760ad0..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/ReadWord.resx +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - frmReadWord - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - Private - - - - AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx - dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx - F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3 - d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx - dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3 - F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX - cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3 - F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX - cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/TreeViewMultiSelect.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/TreeViewMultiSelect.cs deleted file mode 100644 index 4a53a138..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/TreeViewMultiSelect.cs +++ /dev/null @@ -1,439 +0,0 @@ -/********************************************************************************************* - * Copyright 2005 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: TreeViewMultiSelect.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 3/08/05 1:45p $ - * - * $History: TreeViewMultiSelect.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:45p - * Created in $/LibSource/GUI_Utils - * Approval - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:40p - * Created in $/LibSource/GUI_Utils/GUI_Utils - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:33p - * Created in $/LibSource/GUI_Utils/GUI_Utils - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:32p - * Created in $/LibSource/GUI_Utils/GUI_Utils - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:30p - * Created in $/GUI_Utils/GUI_Utils - *********************************************************************************************/ -using System; -using System.Collections; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Windows.Forms; - -namespace MultiSelectTreeView -{ - /// - /// Summary description for MultiSelectTreeView. - /// The MultiSelectTreeView inherits from System.Windows.Forms.TreeView to - /// allow user to select multiple nodes. - /// The underlying comctl32 TreeView doesn't support multiple selection. - /// Hence this MultiSelectTreeView listens for the BeforeSelect && AfterSelect - /// events to dynamically change the BackColor of the individual treenodes to - /// denote selection. - /// It then adds the TreeNode to the internal arraylist of currently - /// selectedNodes after validation checks. - /// - /// The MultiSelectTreeView supports - /// 1) Select + Control will add the current node to list of SelectedNodes - /// 2) Select + Shift will add the current node and all the nodes between the two - /// (if the start node and end node is at the same level) - /// 3) Control + A when the MultiSelectTreeView has focus will select all Nodes. - /// - /// - /// - public class MultiSelectTreeView : System.Windows.Forms.TreeView - { - /// - /// This is private member which caches the last treenode user clicked - /// - private TreeNode lastNode; - private TreeNode ParentNode; - private int SelectNodes_ImageId; - - /// - /// This is private member stores the list of SelectedNodes - /// - private ArrayList selectedNodes; - - /// - /// This is private member which caches the first treenode user clicked - /// - private TreeNode firstNode; - - /// - /// The constructor which initialises the MultiSelectTreeView. - /// - public MultiSelectTreeView(int imgid) - { - SelectNodes_ImageId=imgid; - selectedNodes = new ArrayList(); - } - - /// - /// The constructor which initialises the MultiSelectTreeView. - /// - [ - Category("Selection"), - Description("Gets or sets the selected nodes as ArrayList") - ] - public ArrayList SelectedNodes - { - get - { - return selectedNodes; - } - set - { - DeselectNodes(); - selectedNodes.Clear(); - selectedNodes = value; - SelectNodes(); - } - } - - #region overrides - /// - /// If the user has pressed "Control+A" keys then select all nodes. - /// - /// - protected override void OnKeyUp(KeyEventArgs e) - { - base.OnKeyDown (e); - bool Pressed = (e.Control && ((e.KeyData & Keys.A) == Keys.A)); - if (Pressed) - { - // SelectAllNodes(this.Nodes); //we won't allow selection of all. - } - } - - /// - /// This Function starts the multiple selection. - /// - /// - protected override void OnBeforeSelect(TreeViewCancelEventArgs e) - { - base.OnBeforeSelect(e); - - //if (e.Node.SelectedImageIndex!=SelectNodes_ImageId)return; - //if (selectedNodes.Count>1 && e.Node.Parent != ParentNode) return; - //ParentNode=e.Node.Parent; - - //Check for the current keys press.. - bool isControlPressed = (ModifierKeys==Keys.Control); - bool isShiftPressed = (ModifierKeys==Keys.Shift); - bool isRightMouse = (Control.MouseButtons==MouseButtons.Right); - - if (isRightMouse)return; - - //If control is pressed and the selectedNodes contains current Node - //Deselect that node... - //Remove from the selectedNodes Collection... - if (isControlPressed && selectedNodes.Contains(e.Node)) - { - DeselectNodes(); - selectedNodes.Remove( e.Node ); - SelectNodes(); - //MultiSelectTreeView has handled this event .... - //Windows.Forms.TreeView should eat this event. - e.Cancel = true; - return; - } - - - //else (if Shift key is pressed) - //Start the multiselection ... - //Since Shift is pressed we would "SELECT" - ///all nodes from first node - to last node - lastNode = e.Node; - - //If Shift not pressed... - //Remember this Node to be the Start Node .. in case user presses Shift to - //select multiple nodes. - if (!isShiftPressed&&!isControlPressed&&(e.Node.ImageIndex==this.SelectNodes_ImageId)) - firstNode = e.Node; - } - - /// - /// This function ends the multi selection. Also adds and removes the node to - /// the selectedNodes depending upon the keys pressed. - /// - /// - protected override void OnAfterSelect(TreeViewEventArgs e) - { - base.OnAfterSelect(e); - //if (e.Node.SelectedImageIndex!=SelectNodes_ImageId)return; - //if (selectedNodes.Count>1 && e.Node.Parent != ParentNode) return; - ParentNode=e.Node.Parent; - //Check for the current keys press.. - bool isControlPressed = (ModifierKeys==Keys.Control); - bool isShiftPressed = (ModifierKeys==Keys.Shift); - bool isRightMouse = (Control.MouseButtons==MouseButtons.Right); - - if (isRightMouse)return; - if (isControlPressed) - { - if ((!selectedNodes.Contains(e.Node ))&& (e.Node.SelectedImageIndex==SelectNodes_ImageId) && (selectedNodes.Count==0 || e.Node.Parent == ParentNode)) - { - //This is a new Node, so add it to the list. - selectedNodes.Add(e.Node); - ParentNode = e.Node.Parent; - SelectNodes(); - } - else if (selectedNodes.Contains(e.Node)) - { - //If control is pressed and the selectedNodes contains current Node - //Deselect that node... - //Remove from the selectedNodes Collection... - DeselectNodes(); - selectedNodes.Remove( e.Node ); - if (selectedNodes.Count==0)ParentNode=null; - SelectNodes(); - } - else - { - //If control is pressed and this is not at the level of multi - // select, clear selectetdNodes. - if (selectedNodes!=null && selectedNodes.Count>0) - { - DeselectNodes(); - selectedNodes.Clear(); - ParentNode=null; - } - selectedNodes.Add( e.Node ); - } - } - else - { - // SHIFT is pressed - - if (isShiftPressed && e.Node.SelectedImageIndex==SelectNodes_ImageId) - { - if (firstNode==null) - firstNode=e.Node; - else - { - //Start Looking for the start and end nodes to select all the nodes between them. - TreeNode uppernode = firstNode; - TreeNode bottomnode = e.Node; - //Check Parenting Upper ---> Bottom - //Is Upper Node parent (direct or indirect) of Bottom Node - bool bParent = CheckIfParent(uppernode, bottomnode); - if (!bParent) - { - //Check Parenting the other way round - bParent = CheckIfParent(bottomnode, uppernode); - if (bParent) // SWAPPING - { - TreeNode temp = uppernode; - uppernode = bottomnode; - bottomnode = temp; - } - } - if (bParent) - { - TreeNode n = bottomnode; - while ( n != uppernode.Parent) - { - if ( !selectedNodes.Contains( n ) ) - selectedNodes.Add( n ); - n = n.Parent; - } - } - // Parenting Fails ... but check if the NODES are on the same LEVEL. - else - { - if ( (uppernode.Parent==null && bottomnode.Parent==null) || (uppernode.Parent!=null && uppernode.Parent.Nodes.Contains( bottomnode )) ) // are they siblings ? - { - int nIndexUpper = uppernode.Index; - int nIndexBottom = bottomnode.Index; - //Need to SWAP if the order is reversed... - if (nIndexBottom < nIndexUpper) - { - TreeNode temp = uppernode; - uppernode = bottomnode; - bottomnode = temp; - nIndexUpper = uppernode.Index; - nIndexBottom = bottomnode.Index; - } - - TreeNode n = uppernode; - selectedNodes.Clear(); - while (nIndexUpper < nIndexBottom) - { - //Add all the nodes if nodes not present in the current - //SelectedNodes list... - - if (!selectedNodes.Contains( n )) - { - selectedNodes.Add(n); - SelectAllNodesInNode(n.Nodes, n); - } - n = n.NextNode; - nIndexUpper++; - } - //Add the Last Node. - selectedNodes.Add(n); - } - else - { - if ( !selectedNodes.Contains( uppernode ) ) selectedNodes.Add( uppernode ); - if ( !selectedNodes.Contains( bottomnode ) )selectedNodes.Add( bottomnode ); - } - } - ParentNode = e.Node.Parent; - SelectNodes(); - //Reset the firstNode counter for subsequent "SHIFT" keys. - firstNode = e.Node; - } - } - else - { - // If Normal selection then add this to SelectedNodes Collection. - if (selectedNodes!=null && selectedNodes.Count>0) - { - DeselectNodes(); - selectedNodes.Clear(); - } - selectedNodes.Add( e.Node ); - } - } - } - - /// - /// Overriden OnLostFocus to mimic TreeView's behavior of de-selecting nodes. - /// - /// - protected override void OnLostFocus(EventArgs e) - { - base.OnLostFocus (e); - DeselectNodes(); - } - - /// - /// Overriden OnGotFocus to mimic TreeView's behavior of selecting nodes. - /// - /// - protected override void OnGotFocus(EventArgs e) - { - base.OnGotFocus (e); - SelectNodes(); - } - - - - #endregion overrides - - /// - /// Private function to check the parenting of the two nodes passed. - /// - /// - /// - /// - private bool CheckIfParent(TreeNode parentNode, TreeNode childNode) - { - if (parentNode == childNode) - return true; - - TreeNode node = childNode; - bool parentFound = false; - while (!parentFound && node != null) - { - node = node.Parent; - parentFound = (node == parentNode); - } - return parentFound; - } - - /// - /// This function provides the user feedback that the node is selected - /// Basically the BackColor and the ForeColor is changed for all - /// the nodes in the selectedNodes collection. - /// - private void SelectNodes() - { - foreach ( TreeNode n in selectedNodes ) - { - n.BackColor = SystemColors.Highlight; - n.ForeColor = SystemColors.HighlightText; - } - } - - /// - /// This function provides the user feedback that the node is de-selected - /// Basically the BackColor and the ForeColor is changed for all - /// the nodes in the selectedNodes collection. - /// - private void DeselectNodes() - { - if (selectedNodes.Count==0) return; - - TreeNode node = (TreeNode) selectedNodes[0]; - if (node.TreeView==null) return; // on dispose, at end of program - - Color backColor = node.TreeView.BackColor; - Color foreColor= node.TreeView.ForeColor; - - foreach ( TreeNode n in selectedNodes ) - { - n.BackColor = backColor; - n.ForeColor = foreColor; - } - - } - - /// - /// This function selects all the Nodes in the MultiSelectTreeView.. - /// - private void SelectAllNodes(TreeNodeCollection nodes) - { - foreach (TreeNode n in this.Nodes) - { - selectedNodes.Add(n); - if (n.Nodes.Count > 1) - { - SelectAllNodesInNode(n.Nodes, n); - } - - } - SelectNodes(); - } - - /// - /// Recursive function selects all the Nodes in the MultiSelectTreeView's Node - /// - private void SelectAllNodesInNode(TreeNodeCollection nodes, TreeNode node) - { - foreach (TreeNode n in node.Nodes) - { - selectedNodes.Add(n); - if (n.Nodes.Count > 1) - { - SelectAllNodesInNode(n.Nodes, n); - } - } - SelectNodes(); - } - - public bool MultiSelectActive() - { - if (selectedNodes.Count>1)return true; - return false; - } - - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/TreeViewMultiSelect.resx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/TreeViewMultiSelect.resx deleted file mode 100644 index 3f337e08..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/GUI_Utils/TreeViewMultiSelect.resx +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.0.0.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/AssemblyInfo.cs deleted file mode 100644 index 7e3b35a5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/AssemblyInfo.cs.bak deleted file mode 100644 index 6b2b0662..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/EopToErgRelations.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/EopToErgRelations.cs deleted file mode 100644 index fe463197..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/EopToErgRelations.cs +++ /dev/null @@ -1,249 +0,0 @@ -/********************************************************************************************* - * Copyright 2003 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: EopToErgRelations.cs $ $Revision: 1 $ - * $Author: Jsj $ $Date: 11/12/04 10:33a $ - * - * $History: EopToErgRelations.cs $ - * - * ***************** Version 1 ***************** - * User: Jsj Date: 11/12/04 Time: 10:33a - * Created in $/LibSource/VDB - * Class to support translation table maintenance. - *********************************************************************************************/ -using System; -using System.IO; -using System.Collections; -using VDB; - -namespace VDB_Set -{ - /// - /// Support for the maintenance of the EOP ot ERG translation table - /// (TRANSL.TBL) which holds the relationships between the EOPs and ERGs - /// - public class EopToErgRelations - { - static string RelationshipFile = "TRANSL.TBL"; - private ArrayList _aryTransTable = null; - - public ArrayList aryTransTable - { - get - { - return _aryTransTable; - } - - set - { - _aryTransTable = value; - } - } - - public EopToErgRelations() - { - _aryTransTable = new ArrayList(); - ReadTranslationTableFile(); - } - - private void ReadTranslationTableFile() - { - string inbuf; - TransFileRecord TranTblRec; - - if (!File.Exists(RelationshipFile)) - return; // file not there to read - StreamReader sr = new StreamReader(RelationshipFile); - while ((inbuf = sr.ReadLine()) != null) - { - TranTblRec = new TransFileRecord(inbuf); - _aryTransTable.Add(TranTblRec); - } - sr.Close(); - } - - public void WriteTranslationTableFile() - { - StreamWriter sw = new StreamWriter(RelationshipFile,false); - foreach (TransFileRecord tfr in _aryTransTable) - { - sw.Write(tfr.StringForFile()); - } - sw.Close(); - } - - // Add to the end of the passed in list either info from the read-in - // translation file (TRANSL.TBL) or a new (empty) record. - public void AddToTranslationList(SetRecordObj SetRecObj, ArrayList NewList) - { - bool found = false; - for (int i = 0; !found && i < _aryTransTable.Count; i++) - { - TransFileRecord tfr = (TransFileRecord)_aryTransTable[i]; - string tfrUpper = tfr.EOPFile.ToUpper(); - string NewUpper = SetRecObj.DatabaseTable.ToUpper(); - - if (tfrUpper.Equals(NewUpper)) - { - NewList.Add(tfr); - found=true; - } - } - if (!found) - { - TransFileRecord newrec = new TransFileRecord(); - newrec.EOPFile = SetRecObj.DatabaseTable; - NewList.Add(newrec); - } - } - - // Assign the ERG information (passed in as RecObj) to the currently - // slected EOP - public bool ChangeTranslationListItem(int EOPidx, object RecObj) - { - bool changedFlag = false; - SetRecordObj SetRecObj = (SetRecordObj)RecObj; - TransFileRecord tfr = (TransFileRecord)_aryTransTable[EOPidx]; - if (tfr.ERGFile == null || - !tfr.ERGFile.Equals(SetRecObj.DatabaseTable) || - !tfr.ERGProcNum.Equals(SetRecObj.ProcNumber)) - { - changedFlag = true; - tfr.ERGFile = SetRecObj.DatabaseTable; - tfr.ERGProcNum = SetRecObj.ProcNumber; - _aryTransTable[EOPidx] = tfr; - } - return changedFlag; - } - - // For a given procecure number, find the position in the translation - // table list. - public int FindEOPInList(String EopFileName) - { - bool found = false; - int rtval = -1; - int cnt = _aryTransTable.Count; - TransFileRecord tfr; - string uEopFileName = EopFileName.ToUpper(); - - for (int i = 0; !found && i < cnt; i++) - { - tfr = (TransFileRecord)_aryTransTable[i]; - string uListEopName = tfr.EOPFile.ToString().ToUpper(); - - if (uListEopName.Equals(uEopFileName)) - { - rtval = i; - found = true; - } - } - return rtval; - } - - // For a given position in the Translation table, get the corresponding - // position in the ERGList array - public int FindInERGList(int idx, ArrayList ERGList) - { - int rtval = 0; - bool found = false; - TransFileRecord tfr = (TransFileRecord)_aryTransTable[idx]; - if (tfr.ERGFile == null) - return 0; // return not selected - string uERGFileName = tfr.ERGFile.ToUpper(); - SetRecordObj SetRec; - string uErgListFName; - int cnt = ERGList.Count; - - for (int i=0; !found && i < cnt; i++) - { - SetRec = (SetRecordObj)ERGList[i]; - uErgListFName = SetRec.DatabaseTable.ToUpper(); - if (uErgListFName.Equals(uERGFileName)) - { - rtval = i; - found = true; - } - } - return rtval; - } - } - - // This class is used to hold the information of a record in the - // Translation table (TRANSL.TBL) - class TransFileRecord - { - private string _EOPFile; - private string _ERGFile; - private string _ERGProcNum; - - public string EOPFile - { - get - { - return _EOPFile; - } - set - { - _EOPFile = value; - } - } - - public string ERGFile - { - get - { - return _ERGFile; - } - set - { - _ERGFile = value; - } - } - - public string ERGProcNum - { - get - { - return _ERGProcNum; - } - set - { - _ERGProcNum = value; - } - } - - public TransFileRecord() - { - _EOPFile = null; - _ERGFile = null; - _ERGProcNum = null; - } - - // "inbuf" is a line read from the TRANSL.TBL file. - // parse out the the EOP's database file name, the ERG's - // database file name, and the ERG's procedure number - public TransFileRecord(string inbuf) - { - int stidx, len; - stidx = 0; - len = inbuf.IndexOf(","); - _EOPFile = inbuf.Substring(stidx,len); - stidx = len+1; - len = inbuf.IndexOf(",",stidx) - stidx; - _ERGFile = inbuf.Substring(stidx,len); - stidx = stidx + len +1; - _ERGProcNum = inbuf.Substring(stidx); - } - - // Create a string of the EOP database name, ERG database name, and - // ERG procedure number for saving in the TRANSL.TBL file - public string StringForFile() - { - string outbuf; - outbuf = _EOPFile + "," + _ERGFile + "," + _ERGProcNum + "\n"; - return outbuf; - } - } - -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/ProcedureSelectionList.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/ProcedureSelectionList.cs deleted file mode 100644 index 310f0925..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/ProcedureSelectionList.cs +++ /dev/null @@ -1,193 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ProcedureSelectionList.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 7/27/04 8:39a $ - * - * $History: ProcedureSelectionList.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:39a - * Created in $/LibSource/VDB - *********************************************************************************************/ - -using System; -using System.Data; -using System.Drawing; -using System.Collections; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Windows.Forms; -using System.Text; -using VDB; - -namespace VDB_Set -{ - /// - /// Summary description for ProcedureSelectionList. - /// - public class ProcedureSelectionList : System.Windows.Forms.Form - { - private System.Windows.Forms.CheckedListBox checkedListBox1; - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button btnCancel; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public ProcedureSelectionList() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - // Changes the selection mode from double-click to single click. - checkedListBox1.CheckOnClick = true; - } - - public void Add(DataRow rw) - { - SetRecordObj SetRec = new SetRecordObj(rw); - checkedListBox1.Items.Add(SetRec); - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.checkedListBox1 = new System.Windows.Forms.CheckedListBox(); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // checkedListBox1 - // - this.checkedListBox1.Location = new System.Drawing.Point(16, 8); - this.checkedListBox1.Name = "checkedListBox1"; - this.checkedListBox1.Size = new System.Drawing.Size(528, 274); - this.checkedListBox1.TabIndex = 0; - // - // btnOK - // - this.btnOK.Location = new System.Drawing.Point(136, 296); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(80, 32); - this.btnOK.TabIndex = 1; - this.btnOK.Text = "OK"; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // btnCancel - // - this.btnCancel.Location = new System.Drawing.Point(272, 296); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(96, 32); - this.btnCancel.TabIndex = 2; - this.btnCancel.Text = "Cancel"; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // ProcedureSelectionList - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(560, 342); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnOK); - this.Controls.Add(this.checkedListBox1); - this.Name = "ProcedureSelectionList"; - this.Text = "Select Procedures"; - this.Load += new System.EventHandler(this.ProcedureSelectionList_Load); - this.ResumeLayout(false); - - } - #endregion - - private void ProcedureSelectionList_Load(object sender, System.EventArgs e) - { - - } - - public StringCollection GetListOfSelectedProcs_Files() - { - StringCollection RtnStrings = new StringCollection(); - - for (int i=0; i< checkedListBox1.CheckedItems.Count; i++) - { - SetRecordObj tmpObj = (SetRecordObj)checkedListBox1.CheckedItems[i]; - RtnStrings.Add(tmpObj.DatabaseTable); - } - - return RtnStrings; - } - - private void btnOK_Click(object sender, System.EventArgs e) - { - DialogResult=DialogResult.OK; - this.Close(); - } - - private void btnCancel_Click(object sender, System.EventArgs e) - { - DialogResult=DialogResult.Cancel; - this.Close(); - } - - } - - public class SetRecordObj - { - public string ProcTitle; - public string ProcNumber; - public string RECID; - public string DatabaseTable; - public string Format; - public string ApprvDate; - public string ApprvTime; - public string Initials; - - public DataRow ProcSetRow; - - public SetRecordObj(DataRow Rw) - { - ProcSetRow = Rw; - ProcTitle = ProcSetRow.ItemArray[0].ToString(); - ProcNumber = ProcSetRow.ItemArray[1].ToString(); - Format = ProcSetRow.ItemArray[2].ToString(); - DatabaseTable = ProcSetRow.ItemArray[4].ToString(); - RECID = ProcSetRow.ItemArray[5].ToString(); - ApprvDate = ProcSetRow.ItemArray[7].ToString(); - ApprvTime = ProcSetRow.ItemArray[8].ToString(); - Initials = ProcSetRow.ItemArray[9].ToString(); - } - - public override string ToString() - { - StringBuilder rtnStr = new StringBuilder(); - - rtnStr.Append(ProcNumber); - rtnStr.Append(" "); - rtnStr.Append(ProcTitle); - return rtnStr.ToString(); - } - - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/ProcedureSelectionList.resx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/ProcedureSelectionList.resx deleted file mode 100644 index b074ca45..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/ProcedureSelectionList.resx +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - ProcedureSelectionList - - - True - - - 80 - - - True - - - Private - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/VDB.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/VDB.cs deleted file mode 100644 index 73fc9b66..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/VDB.cs +++ /dev/null @@ -1,868 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: VDB.cs $ $Revision: 9 $ - * $Author: Kathy $ $Date: 8/16/05 2:53p $ - * - * $History: VDB.cs $ - * - * ***************** Version 9 ***************** - * User: Kathy Date: 8/16/05 Time: 2:53p - * Updated in $/LibSource/VDB - * B2005-030: error if missing ndx - * - * ***************** Version 8 ***************** - * User: Kathy Date: 5/19/05 Time: 11:05a - * Updated in $/LibSource/VDB - * speed up approve - * - * ***************** Version 7 ***************** - * User: Jsj Date: 5/17/05 Time: 11:54a - * Updated in $/LibSource/VDB - * cleanup - * - * ***************** Version 6 ***************** - * User: Kathy Date: 5/11/05 Time: 9:28a - * Updated in $/LibSource/VDB - * add selectinto method - * - * ***************** Version 5 ***************** - * User: Kathy Date: 4/21/05 Time: 10:18a - * Updated in $/LibSource/VDB - * if dbt is < 512, make it 512 - * - * ***************** Version 4 ***************** - * User: Kathy Date: 3/08/05 Time: 1:47p - * Updated in $/LibSource/VDB - * Approval - * - * ***************** Version 3 ***************** - * User: Jsj Date: 8/20/04 Time: 4:44p - * Updated in $/LibSource/VDB - * backed out previous change - * - * ***************** Version 2 ***************** - * User: Jsj Date: 8/20/04 Time: 1:14p - * Updated in $/LibSource/VDB - * Added logic to handle a single quote in a string that is in an SQL - * statement. - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:40a - * Created in $/LibSource/VDB - *********************************************************************************************/ - -using System; -using System.Data; -using System.Data.OleDb; -using System.Collections.Specialized; -using System.IO; -using System.Windows.Forms; -using System.Text; -using VDB_ConnType; - -namespace VDB -{ - /// - /// This the base class for a VE-PROMS database (table) - /// The vdbDBConnType class allows us to setup a default database type (ex dBase) - /// and gives us a cential place to add logic that would allow the end user select - /// the type of database (engine) to use via a configuration file (for example). - /// The virtual functions requires the class, that inherits this base class, - /// to define the SQL statements needed for its database operations. - /// - public abstract class VDB_Base - { - private vdb_DBConnType databaseType; - // made this public so that abstract functions that define SQL statements - // can check the type of database (if needed). - public int databaseTypeValue; - private OleDbConnection dbConn; - - private string strDBPath = ""; //database directory path - private string strDBFile = ""; // database file name with extension - private string strDBTable = ""; // database file name without extension - private string strSelectCommand; - private string[] DBExtensions={"DBF","DBT"}; - - public VDB_Base(string strPath) - { - ParsePathAndFile(strPath); - databaseType = new vdb_DBConnType(); // currently defaults to dBase - databaseTypeValue = databaseType.dbType; - - // check if dbt is at least 512, if not append 508 bytes. This is to fix - // a problem where dbts were created with only 4 bytes in the 16-bit code. - if ( isdBaseFile() && File.Exists(strDBTable+".dbt") ) - { - FileInfo fi = new FileInfo(strDBTable + ".dbt"); - if (fi.Length<512) - { - FileStream fs = new FileStream(strDBTable+".dbt",FileMode.Open,FileAccess.Write,FileShare.ReadWrite); - BinaryWriter bw = new BinaryWriter(fs); - bw.Seek(0,SeekOrigin.End); - byte []wrBytes = new byte[512-fi.Length]; - for (int i=0; i<512-fi.Length; i++) wrBytes[i]=0; - wrBytes[4]=0x02; - bw.Write(wrBytes); - bw.Close(); - } - fi = null; - } - dbConn = new OleDbConnection(databaseType.ConnectionString(strDBPath,"")); - - // if needed, create an INF file with index file names listed or if - // index file(s) don't exist, create them (B2005-030) - if ( isdBaseFile() && File.Exists(strDBFile)) - CheckIndxAndINF(); - } - - private void ParsePathAndFile(string strInPath) - { - // do we have a file name with the path? - if (File.Exists(strInPath)) - { - // Get the Path - int lastSlash = strInPath.LastIndexOf("\\"); - if (lastSlash > 0) - { - strDBPath = strInPath.Substring(0,lastSlash); - lastSlash++; // move past slash - } - else // current directory path - { - strDBPath = ".\\"; - lastSlash=0; - } - - // Get the file (with extension) - strDBFile = strInPath.Substring(lastSlash); - - //Get the file (without extension) - strDBTable = strDBFile; - int lastDot = strDBFile.LastIndexOf("."); - if (lastDot >0 ) // trim off the extension - strDBTable = strDBFile.Substring(0,lastDot); - } - else // no file name, just a path to database directory - { - strDBPath = strInPath; - if (strDBPath.Length == 0) // empty string for path - strDBPath = ".\\"; // current directory path - strDBFile = ""; - strDBTable = ""; - } - - } - - - public string DBPath //database directory path - { - get - { - return strDBPath; - } - - set - { - strDBPath = value.ToString(); - } - } - public string DBFile // database file name with extension - { - get - { - return strDBFile; - } - // I don't think was want to set the file name -// set -// { -// strDBFile = value.ToString(); -// } - } - - public string DBTable // also dBase file name without extension - { - get - { - return strDBTable; - } - set - { - string tmp = value.ToString(); - // If a path was passed in inore it. The connection already - // has a path associated with it and we don't want to get it angry. - int j = tmp.LastIndexOf("\\"); - if ((j>0) && tmp[j] == '\\') - tmp = tmp.Substring(j+1); - - tmp = tmp.ToUpper(); - // if there is a file extension, chop it off but save it to assign - // to the strDBFile property - j = tmp.LastIndexOf("."); - if ((j>0) && tmp[j] == '.') // got an extension - { - strDBFile = tmp; - strDBTable = tmp.Substring(0,j); - } - else // no extension, assign the table name - { - strDBTable = tmp; - // if we're connected to dBase, then Tables are Files, - // So create a strDBFile by added .DBF to the table name - if (isdBaseFile()) - strDBFile = tmp + ".DBF"; - } - - // We assigned the strDBTable (DBTable property) with a table name. - // Now we need to make sure there is a corresponding INF file - // for dBase index file information. - CreateINF(); - } - } - -/*** - // To have single quote in a sql command string, you need to - // represent it as '' (two single quotes) - private string FixSingleQuotes(string sqlcmd) - { - string tmpstr1 = "(,= "; - string tmpstr2 = "), "; - string rtnstr = ""; - int idx = 0; - int st = 0; - bool twoquotes; - int len = sqlcmd.Length; - - while ((idx = sqlcmd.IndexOf("'",st)) >= 0) - { - twoquotes = true; - // is there a "(", comma , "=", or a space before the quote? - // if so then we do not want to add another quote - // because it part of the sql command, not the string - if (idx > 0 && (tmpstr1.IndexOf(sqlcmd[idx-1]) >= 0)) - twoquotes = false; - - // is there a ")", comma, or a space after the quote? - // if so then we do not want to add another quote - // because it part of the sql command, not the string - if (twoquotes) - if (idx > 0 && (idx == len) || (tmpstr2.IndexOf(sqlcmd[idx+1]) >= 0)) - twoquotes = false; - - // If there is already a second quote, then increment idx past - // it and set twoqotes to false. - if (twoquotes) - { - if (sqlcmd[idx+1] == '\'') - { - idx++; // second quote already there - twoquotes = false; - } - } - - rtnstr += sqlcmd.Substring(st,(idx-st)+1); - - if (twoquotes) - { - rtnstr += "'"; // add a second quote - } - twoquotes = false; - idx++; - st = idx; - } - rtnstr += sqlcmd.Substring(st); - - return rtnstr; - } -***/ - // Process a list of SQL commands. If an error occures, return 1 - private int ProcessSQLCommands (OleDbCommand cmdSQL,StringCollection strColl) - { - int errs =0; - foreach (string sqlcmd in strColl) - { - try - { -/*** - string fixedSqlCmd = FixSingleQuotes(sqlcmd); - cmdSQL.CommandText = fixedSqlCmd; //sqlcmd; -***/ - cmdSQL.CommandText = sqlcmd; - cmdSQL.ExecuteNonQuery(); - } - catch (Exception err) - { - errs = 1; - MessageBox.Show(err.Message.ToString(),"ProcessSQLCommands Error"); - } - } - return errs; - } - - //memo strings of greater than 255 where getting truncated and needed a separate - // reader. - public string GetMemo(string RecId) - { - string retstr=null; - OleDbCommand cmd=null; - OleDbDataReader dr = null; - StringBuilder tmp = new StringBuilder(); - tmp.Append("SELECT [TEXTM] FROM ["); - tmp.Append(DBTable); - tmp.Append("] WHERE RECID = '"); - tmp.Append(RecId); - tmp.Append("'"); - try - { - dbConn.Open(); - cmd = new OleDbCommand(tmp.ToString(),dbConn); - dr = cmd.ExecuteReader(); - if (dr.Read())retstr = dr.GetString(0); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"VDB Error"); - retstr = null; - } - if (dr !=null) dr.Close(); - if (cmd != null) cmd.Dispose(); - dbConn.Close(); - return retstr; - } - - // The default SQL statement will get all of the records in a database - // This should be suitable for all of our database, but just in case - // it can be overloaded. - public virtual string DefaultSelectCommand() - { - StringBuilder tmp = new StringBuilder(); - tmp.Append("SELECT * FROM ["); - tmp.Append(strDBTable); - tmp.Append("]"); - return tmp.ToString(); - } - - // return and set the SELECT statement used to get a DataSet (DB_Data) - public string SelectCmd - { - get - { - return strSelectCommand; - } - set - { - strSelectCommand = value.ToString(); - } - - } - - public System.Data.DataSet DB_Data - { - // return a DataSet containing the database (table) records - get - { - dbConn.Open(); - // if a select command was not created, then use the default - // select all command - if (strSelectCommand == null || strSelectCommand.Equals("")) - strSelectCommand = DefaultSelectCommand(); - - OleDbDataAdapter da =new OleDbDataAdapter(strSelectCommand,dbConn); - DataSet ds = new DataSet(); - try - { - da.Fill(ds); - } - catch (Exception err) - { - MessageBox.Show(err.Message.ToString(),"VDB Error"); - ds = null; // return null if error getting dataset - } - dbConn.Close(); - return ds; - } - - // update the database (table) with the changes made to the DataSet - set - { - // pass in a dataset, update the changed/added/deleted records - int err = 0; - StringCollection CommandList = new StringCollection(); - // Open a database connection - dbConn.Open(); - - // Setup for a series of database transactions - System.Data.OleDb.OleDbCommand cmdSQL = new OleDbCommand(); - System.Data.OleDb.OleDbTransaction dbTransAct; -// dbTransAct = dbConn.BeginTransaction(IsolationLevel.Serializable); - dbTransAct = dbConn.BeginTransaction(); - cmdSQL.Connection = dbConn; - cmdSQL.Transaction = dbTransAct; - - // Get only the new, modified, and deleted dataset rows - DataSet dsChanges = value.GetChanges(); - - // Get the database Table (the database file in dBase terms) - DataTable tbl = dsChanges.Tables[0]; - - // Spin through the changed rows (in the DataSet) and add - // the proper SQL command to the list of commands - foreach (DataRow row in tbl.Rows) - { - switch (row.RowState) - { - case DataRowState.Modified: - CommandList.Add(GetRecUpdateStr(tbl,row)); - break; - - case DataRowState.Added: - CommandList.Add(GetRecInsertStr(tbl,row)); - break; - - case DataRowState.Deleted: - CommandList.Add(RecDeleteStr(tbl,row)); - break; - - default: - // Ignore the DataRowState.Detached - // and the DataRowState.Unchanged - break; - } - } - - // Process the list of SQL commands - err = ProcessSQLCommands(cmdSQL,CommandList); - - // If no errors in the database transactions, - // commit the changes in both the database - // and the dataset. - if (err == 0) - { - dbTransAct.Commit(); - value.AcceptChanges(); - } - else - { - // If there was an error then roll back the changes - dbTransAct.Rollback(); - } - dbConn.Close(); - } - } - - public bool ProcessACommand(string cmd) - { - // open a connection and setup for the database command - dbConn.Open(); - System.Data.OleDb.OleDbCommand cmdSQL = new OleDbCommand(); - System.Data.OleDb.OleDbTransaction dbTransAct; - dbTransAct = dbConn.BeginTransaction(); - try - { - cmdSQL.Connection = dbConn; - cmdSQL.Transaction = dbTransAct; - cmdSQL.CommandText = cmd; - cmdSQL.ExecuteNonQuery(); - dbTransAct.Commit(); - dbConn.Close(); - } - catch (Exception e) - { - dbTransAct.Rollback(); - dbConn.Close(); - MessageBox.Show(e.Message,"Error writing to database"); - return false; - } - return true; - } - - // Create a function that returns an SQL statement to use for updating - // existing records in a database - public abstract string GetRecUpdateStr(DataTable tbl,DataRow row); - - // Create a function that returns an SQL statement to use for inserting - // records in a database - public abstract string GetRecInsertStr(DataTable tbl,DataRow row); - - // Create a function that returns an SQL statement to use for deleting - // existing records in a database - public abstract string RecDeleteStr(DataTable tbl,DataRow row); - - // Create a function that returns a list of SQL commands that will create - // a new table - public abstract StringCollection CreateTableStatements(string strTblName); - - // Create a function that returns a list of SQL commands that selects from - // given table into another table. (Used for copying to approved/tmpchg). - public virtual StringCollection SelectIntoStatements(string destdb){return null;} - - // Create a function that returns a list of SQL commands that will create - // the index files needed for this database file. - public virtual StringCollection CreateIndexFilesStatements(){return null;} - - // Create a function that returns a list of SQL commands that will create - // the first (empty) record. - public virtual StringCollection CreateFirstRecordStatement(string strTblName) - { - StringCollection rtnStrColl = new StringCollection(); - // Default to no "first record" (a.k.a record zero) - // Return an empty set of SQL commands - return rtnStrColl; - } - - // Override this function if post processing is needed after creating - // a table. - public virtual int PostCreateTableFunction() - { - return 0; - } - - public int CreateTable(string strTlbName) - { - int errs =0; - dbConn.Open(); - - // Setup for a series of database transactions - System.Data.OleDb.OleDbCommand cmdSQL = new OleDbCommand(); - System.Data.OleDb.OleDbTransaction dbTransAct; -// dbTransAct = dbConn.BeginTransaction(IsolationLevel.Serializable); - dbTransAct = dbConn.BeginTransaction(); - cmdSQL.Connection = dbConn; - cmdSQL.Transaction = dbTransAct; - - // Process the list of SQL commands - // NOTE: if you create an associated INF file (for dBase indexes) - // before calling ProcessSQLCommands(), the INF file will be - // deleted (by the database engine) when the Create Table - // SQL command is run. - errs = ProcessSQLCommands(cmdSQL,CreateTableStatements(strTlbName)); - - // The PostCreateTableFunction() function should: - // - call CreateINF()if using dBase files with indexes - // - create the first "blank" record if required - if (errs == 0) - errs = PostCreateTableFunction(); - // Create the first record - if (errs == 0) - errs = ProcessSQLCommands(cmdSQL,CreateFirstRecordStatement(strTlbName)); - - dbConn.Close(); - return errs; - } - - // Just a pass through, update string is passed in. - public bool UpdateUsing(string updstr) - { - return (ProcessACommand(updstr)); - } - - // Select data from the current table into a new table, where the new table - // is the parameter destfile which includes the pathname to the database - // file. - public int SelectIntoNewTable(string destfile) - { - int errs=0; - dbConn.Open(); - - // Setup for a series of database transactions - System.Data.OleDb.OleDbCommand cmdSQL = new OleDbCommand(); - System.Data.OleDb.OleDbTransaction dbTransAct; - dbTransAct = dbConn.BeginTransaction(); - cmdSQL.Connection = dbConn; - cmdSQL.Transaction = dbTransAct; - - // Process the list of SQL commands, selectinto has no where clause. - // It only requires that the destination database file be included. - errs = ProcessSQLCommands(cmdSQL,SelectIntoStatements(destfile)); - - dbConn.Close(); - return errs; - } - - // make statement to insert into (an existing table). If table specific - // commands are needed, move this to the specific table code. - public StringCollection InsertIntoStatements(string destdb, string WhereStr) - { - StringCollection rtnStrColl = new StringCollection(); - StringBuilder str = new StringBuilder(); - - str.Append("INSERT INTO "); - str.Append(DBTable); - str.Append(" IN '"); - str.Append(destdb.Substring(0,destdb.LastIndexOf('\\'))); - str.Append("' 'dBase III;' SELECT * FROM "); - str.Append(DBTable); - - if (WhereStr.Length > 0) // Was a WHERE clause passed in? - { - // Add " WHERE " to the beginning if it is not already there - string tmpstr = WhereStr.ToUpper(); - if (tmpstr[0] != ' ') - { - str.Append(" "); - if (!tmpstr.StartsWith("WHERE ")) - str.Append("WHERE "); - } - else if (!tmpstr.StartsWith(" WHERE ")) - str.Append(" WHERE"); - // add the passed in WHERE clause - str.Append(WhereStr); - } - rtnStrColl.Add(str.ToString()); - return rtnStrColl; - } - - public int InsertInto(string destfile, string WhereStr) - { - int errs=0; - dbConn.Open(); - - // Setup for a series of database transactions - System.Data.OleDb.OleDbCommand cmdSQL = new OleDbCommand(); - System.Data.OleDb.OleDbTransaction dbTransAct; - dbTransAct = dbConn.BeginTransaction(); - cmdSQL.Connection = dbConn; - cmdSQL.Transaction = dbTransAct; - - // Process the list of SQL commands, selectinto has no where clause, but - // requires that the index file be created ("",true arguments) - errs = ProcessSQLCommands(cmdSQL,InsertIntoStatements(destfile,WhereStr)); - dbConn.Close(); - return errs; - } - - // make statement to delete records based on input criteria. If table specific - // commands are needed, move this to the specific table code. - public StringCollection DeleteSelectedStr(string whereclause) - { - StringCollection rtnStrColl = new StringCollection(); - StringBuilder deleteStr = new StringBuilder(); - deleteStr.Append("DELETE FROM ["); - deleteStr.Append(DBTable); - deleteStr.Append("]"); - - // Add the WHERE clause - deleteStr.Append(" WHERE "); - deleteStr.Append(whereclause); - rtnStrColl.Add(deleteStr.ToString()); - return rtnStrColl; - } - - // Delete selected records based on criteria from WhereStr parameter. - public int DeleteSelected(string WhereStr) - { - int errs=0; - dbConn.Open(); - - System.Data.OleDb.OleDbCommand cmdSQL = new OleDbCommand(); - System.Data.OleDb.OleDbTransaction dbTransAct; - dbTransAct = dbConn.BeginTransaction(); - cmdSQL.Connection = dbConn; - cmdSQL.Transaction = dbTransAct; - - // Process the list of SQL commands - errs = ProcessSQLCommands(cmdSQL,DeleteSelectedStr(WhereStr)); - - dbConn.Close(); - return errs; - } - - public abstract StringCollection DeleteTableStatements(string strTblName); - - // Override this function if post processing is needed after removing - // a table. - public int PostDeleteTableFunction() - { - return 0; - } - - public virtual int DeleteTable(string strTblName) - { - int errs =0; - dbConn.Open(); - - // Setup for a series of database transactions - System.Data.OleDb.OleDbCommand cmdSQL = new OleDbCommand(); - System.Data.OleDb.OleDbTransaction dbTransAct; -// dbTransAct = dbConn.BeginTransaction(IsolationLevel.Serializable); - dbTransAct = dbConn.BeginTransaction(); - cmdSQL.Connection = dbConn; - cmdSQL.Transaction = dbTransAct; - - // Process the list of SQL commands - errs = ProcessSQLCommands(cmdSQL,DeleteTableStatements(strTblName)); - - // do any needed post processing - if (errs == 0) - errs = PostDeleteTableFunction(); - - if (errs == 0) // no errors - { - strDBTable = ""; - if (databaseTypeValue.Equals(vdb_DBConnType.DBTypes.DBaseIII)) - { - strDBFile = ""; - } - } - dbConn.Close(); - return errs; - } - - // Override this function to create a text file with the same name as the - // dBase file, except give it an extension of INF instead of DBF. - // Inside this text file should be the index file names associated - // with the dBasefile. (each file name should be on its own line) - // Example, for USAGERO.DBF you should create a USAGERO.INF and inside - // the INF file should be: - // NDX1=USAGERO.NDX - // NDX2=USAGROID.NDX - // - // If the dBase does not use an index file, then there is no need to - // override this virtual funtion. - public virtual int CreateINF() - { - return 0; - } - - public bool isdBaseFile() - { - return databaseTypeValue == (int)vdb_DBConnType.DBTypes.DBaseIII; - } - public virtual string GetCreateIndx1String() - { - return null; - } - public virtual string GetCreateIndx2String() - { - return null; - } - public virtual bool IndexFilesExist() - { - return true; - } - - public virtual void DeleteIndexFiles() - { - } - - // use this to clean up/create index & INF Files. The INF files are used to - // define which index files are used for the given database file. However, if file - // names are listed in the INF file and the NDX file does not exist, an error was - // given - so be sure that the index files exist too. Note that the INF file - // must be created after the NDX file, because an error occurs if creating an NDX - // file when an INF file exists. This was done to fix B2005-030. - public bool CheckIndxAndINF() - { - try - { - if (!IndexFilesExist()) - { - string cwd = Directory.GetCurrentDirectory(); - Directory.SetCurrentDirectory(DBPath); - // if more than one index file exists for a dbf, then delete (in case - // one of them did exist) - DeleteIndexFiles(); - // CreateIndexFiles creates the NDX and also INF. - CreateIndexFiles(); - Directory.SetCurrentDirectory(cwd); - } - else - CreateINF(); // CreateINF creates a new copy (overwrites any existing) - } - catch (Exception e) - { - MessageBox.Show("Could not set up index files " + e.Message,"Check For Indexes"); - return false; - } - return true; - } - - public virtual int CreateIndexFiles() - { - int errs =0; - dbConn.Open(); - - // Setup for a series of database transactions - System.Data.OleDb.OleDbCommand cmdSQL = new OleDbCommand(); - System.Data.OleDb.OleDbTransaction dbTransAct; - dbTransAct = dbConn.BeginTransaction(); - cmdSQL.Connection = dbConn; - cmdSQL.Transaction = dbTransAct; - - // if dbase, delete the inf file. If it exists, an error occurs when - // creating the index. - if (File.Exists(strDBTable+".INF")) File.Delete(strDBTable+".INF"); - // Process the list of SQL commands - errs = ProcessSQLCommands(cmdSQL,CreateIndexFilesStatements()); - dbConn.Close(); - if (errs==0 && isdBaseFile()) CreateINF(); - return errs; - } - - public void Pack() - { - // the database was not getting 'packed' on a delete, i.e. the deleted - // records were still visible in the 16-bit codes. We'll pack here by - // selecting into a temp db & renaming files. - - // first see if there is an index, i.e. GetCreateIndxString will return - // a string if an index file is needed. If so, we know that we'll have - // to create the index(es) & also create an INF file. - string createindx = GetCreateIndx1String(); - - string origname = this.DBTable; - string newtbname=null; - try - { - if (this.DBTable.Length==8) - newtbname = "z" + this.DBTable.Substring(1,7); - else - newtbname = "z" + this.DBTable; - - string sqlcmd = "select * into [" + newtbname + "] from [" + origname + "];"; - - // Setup for a series of database transactions - dbConn = new OleDbConnection(databaseType.ConnectionString(strDBPath,"")); - dbConn.Open(); - System.Data.OleDb.OleDbCommand cmdSQL = new OleDbCommand(sqlcmd,dbConn); - cmdSQL.ExecuteNonQuery(); - dbConn.Close(); - - // delete original & rename (dbf, dbt), then make new index file & INF - // file, if they exist. - foreach(string str in DBExtensions) - { - string orig = strDBPath+"\\"+origname + "." + str; - if (File.Exists(orig)) - { - File.Delete(orig); - string newnm = strDBPath + "\\" + newtbname + "." + str; - File.Move(newnm,orig); - } - } - if (createindx!=null) - { - // delete the index files... - DeleteIndexFiles(); - dbConn.Open(); - cmdSQL = new OleDbCommand(createindx,dbConn); - cmdSQL.ExecuteNonQuery(); - createindx = GetCreateIndx2String(); - if (createindx!=null) - { - cmdSQL.CommandText = createindx; - cmdSQL.ExecuteNonQuery(); - } - dbConn.Close(); - CreateINF(); - } - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Could not pack database, use data integrity checker on procedure"); - } - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/VDB.csproj b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/VDB.csproj deleted file mode 100644 index 78d0dba5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/VDB.csproj +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/VDB.sln b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/VDB.sln deleted file mode 100644 index 004e0724..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/VDB.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VDB", "VDB.csproj", "{F6AB1684-FC39-47E8-BEF1-A71EE4082206}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {F6AB1684-FC39-47E8-BEF1-A71EE4082206}.Debug.ActiveCfg = Debug|.NET - {F6AB1684-FC39-47E8-BEF1-A71EE4082206}.Debug.Build.0 = Debug|.NET - {F6AB1684-FC39-47E8-BEF1-A71EE4082206}.Release.ActiveCfg = Release|.NET - {F6AB1684-FC39-47E8-BEF1-A71EE4082206}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdbConnType.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdbConnType.cs deleted file mode 100644 index 72ba21ce..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdbConnType.cs +++ /dev/null @@ -1,66 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: vdbConnType.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 7/27/04 8:40a $ - * - * $History: vdbConnType.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:40a - * Created in $/LibSource/VDB - *********************************************************************************************/ - -using System; -using System.Text; - -namespace VDB_ConnType -{ - /// - /// This currently defaults to dBase, but logic can be added to - /// select other database types. - /// - public class vdb_DBConnType - { - public enum DBTypes {DBaseIII, Access}; // list of database types - private int CurrentDbType; // current database type - - public vdb_DBConnType() - { - CurrentDbType = (int)DBTypes.DBaseIII; - } - - public int dbType - { - get - { - return CurrentDbType; - } - } - - // The "database" parameter is here for future use of Access (part of the - // Data Source string) and for Sequel (the Initial Catalog) settings. - // for a dBase connection, we only need the "dbpath" parameter. - public string ConnectionString(string dbpath, string database) - { - StringBuilder tmp = new StringBuilder(); - - switch (CurrentDbType) - { - case (int)DBTypes.DBaseIII: - tmp.Append("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="); - tmp.Append(dbpath); - tmp.Append(";Extended Properties=dBase III;Persist Security Info=False"); - break; - case (int)DBTypes.Access: - // build the connect string for an Access database - break; - default: - break; - - } - return tmp.ToString(); - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_Proc.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_Proc.cs deleted file mode 100644 index 28c1b5a7..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_Proc.cs +++ /dev/null @@ -1,553 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: vdb_Proc.cs $ $Revision: 11 $ - * $Author: Kathy $ $Date: 9/23/05 8:33a $ - * - * $History: vdb_Proc.cs $ - * - * ***************** Version 11 ***************** - * User: Kathy Date: 9/23/05 Time: 8:33a - * Updated in $/LibSource/VDB - * Fix B2005-043 - cannot select into for files with a '-' (dash). - * - * ***************** Version 10 ***************** - * User: Jsj Date: 9/16/05 Time: 9:54a - * Updated in $/LibSource/VDB - * handle dbase NDX file names that begin with a number. SQL statement - * could not create a NDX file that begins with a number. - * - * ***************** Version 9 ***************** - * User: Kathy Date: 8/16/05 Time: 2:53p - * Updated in $/LibSource/VDB - * B2005-030: error if missing ndx - * - * ***************** Version 8 ***************** - * User: Kathy Date: 7/28/05 Time: 2:06p - * Updated in $/LibSource/VDB - * for mod proc number, select into correct destination file - * - * ***************** Version 7 ***************** - * User: Kathy Date: 5/19/05 Time: 11:05a - * Updated in $/LibSource/VDB - * speed up approve - * - * ***************** Version 6 ***************** - * User: Jsj Date: 5/17/05 Time: 9:39a - * Updated in $/LibSource/VDB - * - * ***************** Version 5 ***************** - * User: Kathy Date: 5/11/05 Time: 9:28a - * Updated in $/LibSource/VDB - * add selectinto support - * - * ***************** Version 4 ***************** - * User: Kathy Date: 4/21/05 Time: 10:19a - * Updated in $/LibSource/VDB - * always write inf file - * - * ***************** Version 3 ***************** - * User: Kathy Date: 3/08/05 Time: 1:47p - * Updated in $/LibSource/VDB - * Approval - * - * ***************** Version 2 ***************** - * User: Jsj Date: 8/23/04 Time: 10:12a - * Updated in $/LibSource/VDB - * Fixed replace of single quote - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:40a - * Created in $/LibSource/VDB - *********************************************************************************************/ - -using System; -using System.Data; -using System.Text; -using System.Collections.Specialized; -using System.IO; -using System.Windows.Forms; -using VDB; - -namespace VDB_Proc -{ - /// - /// Summary description for vdb_Proc. - /// - public class vdb_Proc:VDB_Base - { - public enum SortTypes {NotSorted,StepSeqTypeSort,RECIDsort}; // list of sorting types - public string ProcNDX = ""; - public string TmpNDXFileName = ""; - - public vdb_Proc(String strPath):base(strPath) - { - } - - public string ProcGetTextFromMemo(string RecId) - { - return GetMemo(RecId); - } - - // Build a SQL statement. Optionally sort and filter the select statement. - private void BuildSelectCommand(int SortingType,string WhereStr) - { - StringBuilder tmp = new StringBuilder(); - tmp.Append("SELECT [STEP], [SEQUENCE], [TEXT], [TEXTM], [TYPE], [DATE], [TIME], [INITIALS], [RECID] FROM ["); - tmp.Append(DBTable); - tmp.Append("]"); - - if (WhereStr.Length > 0) // Was a WHERE clause passed in? - { - // Add " WHERE " to the beginning if it is not already there - string tmpstr = WhereStr.ToUpper(); - if (tmpstr[0] != ' ') - { - tmp.Append(" "); - if (!tmpstr.StartsWith("WHERE ")) - tmp.Append("WHERE "); - } - else if (!tmpstr.StartsWith(" WHERE ")) - tmp.Append(" WHERE"); - // add the passed in WHERE clause - tmp.Append(tmpstr); - } - - switch (SortingType) - { - case 0: //NotSorted - break; - case 1: // StepSeqTypeSort - sorted by STEP+SEQUENCE+TYPE - tmp.Append(" GROUP BY [STEP],[SEQUENCE],[TYPE],[TEXT],[TEXTM],[DATE],[TIME],[INITIALS],[RECID]"); - break; - case 2: // RECIDsort - sorted by RECID - tmp.Append(" GROUP BY [RECID],[STEP],[SEQUENCE],[TYPE],[TEXT],[TEXTM],[DATE],[TIME],[INITIALS]"); - break; - } - - SelectCmd = tmp.ToString(); - } - -#if Upgrade2005_Print - // Build a SQL statement for record count on select. - private void BuildCountCommand(string WhereStr) - { - StringBuilder tmp = new StringBuilder(); - tmp.Append("SELECT COUNT(*) FROM ["); - tmp.Append(DBTable); - tmp.Append("]"); - - if (WhereStr.Length > 0) // Was a WHERE clause passed in? - { - // Add " WHERE " to the beginning if it is not already there - string tmpstr = WhereStr.ToUpper(); - if (tmpstr[0] != ' ') - { - tmp.Append(" "); - if (!tmpstr.StartsWith("WHERE ")) - tmp.Append("WHERE "); - } - else if (!tmpstr.StartsWith(" WHERE ")) - tmp.Append(" WHERE"); - // add the passed in WHERE clause - tmp.Append(tmpstr); - } - - SelectCmd = tmp.ToString(); - } -#endif - private void BuildNDXFileNames() - { - ProcNDX = DBTable; - } - - - // Build the SQL command needed to update a row in the Procedure file - public override string GetRecUpdateStr(DataTable tbl,DataRow row) - { - int j = 0; - bool FirstOne = true; - StringBuilder updateStr = new StringBuilder(); - StringBuilder LikeRecID = new StringBuilder(); - bool NullEntry = false; - - updateStr.Append("UPDATE ["); - updateStr.Append(DBTable); - updateStr.Append("] SET"); - - foreach (DataColumn col in tbl.Columns) - { - bool isString = (col.DataType == Type.GetType("System.String")); - if (col.ColumnName.Equals("STEP") && row.ItemArray[j].ToString().Equals("")) - { - NullEntry = true; - j++; - continue; - } - if (col.ColumnName.Equals("RECID")) - { - LikeRecID.Append("___"); // ignore the first 3 positions - LikeRecID.Append(row.ItemArray[j].ToString(),3,5); - } - if (FirstOne) - { - updateStr.Append(" ["); - FirstOne = false; - } - else - updateStr.Append(", ["); - updateStr.Append(col.ColumnName); - updateStr.Append("]="); - - if (row.ItemArray[j].ToString().Equals("")) - { - updateStr.Append("NULL"); - } - else if (isString) - { - String tmpstr = row.ItemArray[j].ToString(); - updateStr.Append("'"); - tmpstr = tmpstr.Replace("'","''"); - updateStr.Append(tmpstr); - updateStr.Append("'"); - } - else if (col.DataType == Type.GetType("System.DateTime")) - { - int jj; - String tmpstr = row.ItemArray[j].ToString(); - updateStr.Append("'"); - jj=tmpstr.IndexOf(" "); - if (jj<0) jj = tmpstr.Length; - updateStr.Append(tmpstr.Substring(0,jj)); - updateStr.Append("'"); - } - j++; - } - if (NullEntry) - { - // So that we can change the RECID number on the first entry - updateStr.Append(" WHERE [STEP] IS NULL"); - } - else - { - updateStr.Append(" WHERE [RECID] LIKE '"); - updateStr.Append(LikeRecID.ToString()); - updateStr.Append("'"); - } - return updateStr.ToString(); - } - - - // Build the SQL command needed to insert a row in the Procedure file - public override string GetRecInsertStr(DataTable tbl,DataRow row) - { - int j = 0; - StringBuilder insrtStr = new StringBuilder(); - StringBuilder valueStr = new StringBuilder(); - - insrtStr.Append("INSERT INTO ["); - insrtStr.Append(DBTable); - insrtStr.Append("] ("); - - valueStr.Append(" VALUES ("); - - foreach (DataColumn col in tbl.Columns) - { - bool isString = (col.DataType == Type.GetType("System.String")); - insrtStr.Append("["); - insrtStr.Append(col.ColumnName); - insrtStr.Append("],"); - - if (row.ItemArray[j].ToString().Equals("")) - { - valueStr.Append("NULL"); - } - else if (isString) - { - String tmpstr = row.ItemArray[j].ToString(); - tmpstr = tmpstr.Replace("'","''"); - valueStr.Append("'"); - valueStr.Append(tmpstr); - valueStr.Append("'"); - } - else if (col.DataType == Type.GetType("System.DateTime")) - { - int jj; - String tmpstr = row.ItemArray[j].ToString(); - valueStr.Append("'"); - jj = tmpstr.IndexOf(" "); - if (jj<0) jj=tmpstr.Length; - valueStr.Append(tmpstr.Substring(0,jj)); - valueStr.Append("'"); - } - else - { - valueStr.Append(row.ItemArray[j].ToString()); - } - valueStr.Append(","); - j++; - } - - insrtStr = insrtStr.Replace(',',')',insrtStr.Length-1,1); - valueStr = valueStr.Replace(',',')',valueStr.Length-1,1); - insrtStr.Append(valueStr.ToString()); - - return insrtStr.ToString(); - } - - // Build the SQL command needed to delete a row in the Procedure file - public override string RecDeleteStr(DataTable tbl,DataRow row) - { - int j = 0; - String RecIDStr = ""; - String StepStr = ""; - String SeqStr = ""; - StringBuilder deleteStr = new StringBuilder(); - - deleteStr.Append("DELETE FROM ["); - deleteStr.Append(DBTable); - deleteStr.Append("] WHERE "); - - row.RejectChanges(); - foreach (DataColumn col in tbl.Columns) - { - if (col.ColumnName.Equals("STEP")) - { - StepStr = row.ItemArray[j].ToString(); - } - else if (col.ColumnName.Equals("SEQUENCE")) - { - SeqStr = row.ItemArray[j].ToString(); - } - else if (col.ColumnName.Equals("RECID")) - { - RecIDStr = row.ItemArray[j].ToString(); - } - j++; - } - // we might want to change this to delete via only the RECID - // but that could be risky if we have duplicate RECIDs - deleteStr.Append("[STEP] = '"); - deleteStr.Append(StepStr); - deleteStr.Append("' AND [SEQUENCE] = '"); - deleteStr.Append(SeqStr); - deleteStr.Append("' AND [RECID] = '"); - deleteStr.Append(RecIDStr); - deleteStr.Append("'"); - - return deleteStr.ToString(); - - } - - public override string GetCreateIndx1String() - { - StringBuilder index1Str = new StringBuilder(); - // Make a temporary index file name if dBase filename - // for any procedure. (those that start with a number - // or had a dash were having a problem here - see - // B2005-040 & 043). - TmpNDXFileName = "ndxtmp"; - index1Str.Append("CREATE INDEX ["); - index1Str.Append(TmpNDXFileName); - index1Str.Append("] ON ["); - index1Str.Append(DBTable); - index1Str.Append("] ([STEP],[SEQUENCE],[TYPE])"); - return (index1Str.ToString()); - } - - public override bool IndexFilesExist() - { - if (ProcNDX == "") BuildNDXFileNames(); - if(File.Exists(DBPath+"\\"+ProcNDX+".NDX")) return true; - return false; - } - - public override void DeleteIndexFiles() - { - if(File.Exists(DBPath+"\\"+ProcNDX+".NDX")) File.Delete(DBPath+"\\"+ProcNDX+".NDX"); - } - - // Build a list of SQL commands needed to create a new Procedure table (file) - // and add the first row - public override StringCollection CreateTableStatements(string strTblName) - { - StringCollection rtnStrColl = new StringCollection(); - StringBuilder createStr = new StringBuilder(); - - if (strTblName.Length > 0) // was a table name passd in? - { - DBTable = strTblName; // this will create the INI file for dBase - } - - if (DBTable.Equals("")) - { - MessageBox.Show("Trying to Create a new Table without a Name","Create Table Error"); - return rtnStrColl; - } - - // Build the command that creates a new SET table (file) - createStr.Append("CREATE TABLE ["); - createStr.Append(DBTable); - createStr.Append("] "); - createStr.Append("([STEP] Char(2), [SEQUENCE] Char(10), [TEXT] Char(100), "); - createStr.Append("[TEXTM] TEXT, [TYPE] Char(2), [DATE] Date, [TIME] Char(5), "); - createStr.Append("INITIALS Char(5), [RECID] Char(8))"); - - rtnStrColl.Add(createStr.ToString()); // add create table - - // If we are using dBase files, create the index files too - - if (isdBaseFile()) - { - // Build the command that creates the index file - - rtnStrColl.Add(GetCreateIndx1String()); // add create index - } - return rtnStrColl; - } - - // Build a list of SQL commands needed to create the first row (a.k.a record zero) - public override StringCollection CreateFirstRecordStatement(string strTblName) - { - StringCollection rtnStrColl = new StringCollection(); - StringBuilder firstRecStr = new StringBuilder(); - - // Build the command that adds the first (blank) record - // with the RECID initialize to 00000001 - firstRecStr.Append("INSERT INTO ["); - firstRecStr.Append(DBTable); - firstRecStr.Append("] ([RECID]) VALUES ('00000001')"); - - rtnStrColl.Add(firstRecStr.ToString()); // add insert first record - return rtnStrColl; - } - - // make statement to select into a new table. Table must not exist and - // can include a path to the table. - public override StringCollection SelectIntoStatements(string destdb) - { - StringCollection rtnStrColl = new StringCollection(); - StringBuilder str = new StringBuilder(); - str.Append("SELECT * INTO ["); - str.Append(destdb.Substring(destdb.LastIndexOf('\\')+1,destdb.Length-destdb.LastIndexOf('\\')-1)); - str.Append("] IN '"); - str.Append(destdb.Substring(0,destdb.LastIndexOf('\\'))); - str.Append("' 'dBase III;' from ["); - str.Append(DBTable); - str.Append("]"); - rtnStrColl.Add(str.ToString()); - return rtnStrColl; - } - - // After the table is created, create the associated INF file - public override int PostCreateTableFunction() - { - CreateINF(); // should already be created - return 0; - } - - // This will be called from CreateTableStatements() - // and this is called if the table name is assigned to the DBTable property - public override int CreateINF() - { - // if we are using dBase files, create an INF file containing - // a list of the associated NDX files. - if (isdBaseFile()) - { - StreamWriter infFile; - string infFileStr; - StringBuilder tmp = new StringBuilder(); - - // build the ndx file names (w/o extensions) - BuildNDXFileNames(); - - //build INF file name - tmp.Append(DBPath); - tmp.Append("\\"); - tmp.Append(DBTable); - tmp.Append(".INF"); - - infFileStr = tmp.ToString(); - - // always recreate it. Some plants' data had invalid files - // and it was felt that it would be quicker to recreate always - // rather than read and check. - infFile = new StreamWriter(infFileStr,false); - infFile.Write("NDX1="); - infFile.Write(ProcNDX); - infFile.Write(".NDX\r\n"); - infFile.Close(); - - // a temp index file name was always used to create the index - // because unusual file names, such as those beginning with - // a number or those with a '-' caused an error to occur - // during ndx file creation. This fixes, B2005-040 & B2005-043. - if (TmpNDXFileName.Length > 0) - { - File.Copy(TmpNDXFileName+".NDX",ProcNDX+".NDX"); - File.Delete(TmpNDXFileName+".NDX"); - TmpNDXFileName = ""; - } - } - return 0; - } - - public override StringCollection CreateIndexFilesStatements() - { - if (isdBaseFile()) - { - StringCollection rtnStrColl = new StringCollection(); - string indx1 = GetCreateIndx1String(); - rtnStrColl.Add(indx1); - return rtnStrColl; - } - return null; - } - - // return a list of SQL commands that will drop (delete) a database table (file) - public override StringCollection DeleteTableStatements(string strTblName) - { - StringCollection rtnStrColl = new StringCollection(); - StringBuilder DropTableStr = new StringBuilder(); - - DropTableStr.Append("Drop Table ["); - DropTableStr.Append(DBTable); - DropTableStr.Append("]"); - - rtnStrColl.Add(DropTableStr.ToString()); - return rtnStrColl; - } - - // return a dataset of procedure records, not sorted - public System.Data.DataSet GetNotSorted(string WhereStr) - { - BuildSelectCommand((int)SortTypes.NotSorted,WhereStr); - return DB_Data; - } - - // return a dataset of procedure records, sorted by the [STEP] field - public System.Data.DataSet GetSortedByStepSeqType(string WhereStr) - { - BuildSelectCommand((int)SortTypes.StepSeqTypeSort,WhereStr); - return DB_Data; - } - - // return a dataset of procedure records, sorted by the [RECID] field - public System.Data.DataSet GetSortedByRECID(string WhereStr) - { - BuildSelectCommand((int)SortTypes.RECIDsort,WhereStr); - return DB_Data; - } - -#if Upgrade2005_Print - // return integer count of selected records only - public int GetCount(string WhereStr) - { - BuildCountCommand(WhereStr); - DataSet ds = DB_Data; - return ds.Tables[0].Rows.Count; - } -#endif - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_ROUsage.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_ROUsage.cs deleted file mode 100644 index 6637ea6d..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_ROUsage.cs +++ /dev/null @@ -1,478 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: vdb_ROUsage.cs $ $Revision: 6 $ - * $Author: Kathy $ $Date: 5/01/06 11:17a $ - * - * $History: vdb_ROUsage.cs $ - * - * ***************** Version 6 ***************** - * User: Kathy Date: 5/01/06 Time: 11:17a - * Updated in $/LibSource/VDB - * Fix B2006-018: single quote in proc number causes problem on data - * request - * - * ***************** Version 5 ***************** - * User: Kathy Date: 8/16/05 Time: 2:54p - * Updated in $/LibSource/VDB - * B2005-030: error if missing ndx - * - * ***************** Version 4 ***************** - * User: Kathy Date: 4/21/05 Time: 10:19a - * Updated in $/LibSource/VDB - * always write inf file & remove upgrade2005 define - * - * ***************** Version 3 ***************** - * User: Kathy Date: 3/08/05 Time: 1:48p - * Updated in $/LibSource/VDB - * Approval - * - * ***************** Version 2 ***************** - * User: Jsj Date: 8/23/04 Time: 10:12a - * Updated in $/LibSource/VDB - * Fixed replace of single quote - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:40a - * Created in $/LibSource/VDB - *********************************************************************************************/ - -using System; -using System.Data; -using System.Text; -using System.Collections.Specialized; -using System.IO; -using System.Windows.Forms; -using VDB; -using VDB_ConnType; - -namespace VDB_ROUsage -{ - /// - /// Open, Create, Delete, Update functions for RO Usage files (tables) - /// - public class vdb_ROUsage:VDB_Base - { - public enum SortTypes {NotSorted,ProcSort,ROIDsort}; // list of sorting types - - public string UsageROndx = ""; - public string UsagROIDndx = ""; - - public vdb_ROUsage(String strPath):base(strPath) - { - // if no table (file name) specified, then default to USAGERO (USAGERO.DBF) - if (DBTable.Equals("")) - DBTable = "USAGERO"; - } - - // Build a SQL statement. Optionally sort and filter the select statement. - private void BuildSelectCommand(int SortingType,string WhereStr) - { - StringBuilder tmp = new StringBuilder(); - tmp.Append("SELECT [NUMBER], [SEQUENCE], [INSTANCE], [ROID] FROM ["); - tmp.Append(DBTable); - tmp.Append("]"); - - if (WhereStr.Length > 0) // Was a WHERE clause passed in? - { - // Add " WHERE " to the beginning if it is not already there - string tmpstr = WhereStr; //.ToUpper(); - - if (tmpstr[0] != ' ') - { - tmp.Append(" "); - if (!tmpstr.StartsWith("WHERE ")) - tmp.Append("WHERE "); - } - else if (!tmpstr.StartsWith(" WHERE ")) - tmp.Append(" WHERE"); - // add the passed in WHERE clause - tmp.Append(tmpstr); - } - - switch (SortingType) - { - case 0: //NotSorted - break; - case 1: // ProcSort - sorted by procedure number - tmp.Append(" GROUP BY [NUMBER],[SEQUENCE],[INSTANCE],[ROID]"); - break; - case 2: // ROIDsort - sorted by ROID - tmp.Append(" GROUP BY [ROID],[NUMBER],[SEQUENCE],[INSTANCE]"); - break; - } - - SelectCmd = tmp.ToString(); - } - - - private void BuildNDXFileNames() - { - UsageROndx = DBTable; - UsagROIDndx = DBTable.Substring(0,4)+"ROID"; - } - - - // Build the SQL command needed to update a row in the USAGERO file - public override string GetRecUpdateStr(DataTable tbl,DataRow row) - { - int j = 0; - bool FirstOne = true; - StringBuilder updateStr = new StringBuilder(); - string strNumber = ""; - string strSequence = ""; - string strInstance = ""; - - updateStr.Append("UPDATE ["); - updateStr.Append(DBTable); - updateStr.Append("] SET"); - - foreach (DataColumn col in tbl.Columns) - { - bool isString = (col.DataType == Type.GetType("System.String")); - - if (col.ColumnName.Equals("NUMBER")) - { - strNumber = row.ItemArray[j].ToString(); - strNumber = strNumber.Replace("'","''"); - } - else if (col.ColumnName.Equals("SEQUENCE")) - { - strSequence = row.ItemArray[j].ToString(); - strSequence = strSequence.Replace("'","''"); - } - else if (col.ColumnName.Equals("INSTANCE")) - { - strInstance = row.ItemArray[j].ToString(); - strInstance = strInstance.Replace("'","''"); - } - - if (FirstOne) - { - updateStr.Append(" ["); - FirstOne = false; - } - else - updateStr.Append(", ["); - - updateStr.Append(col.ColumnName); - updateStr.Append("]="); - - if (row.ItemArray[j].ToString().Equals("")) - { - updateStr.Append("NULL"); - } - else if (isString) - { - String tmpstr = row.ItemArray[j].ToString(); - updateStr.Append("'"); - tmpstr = tmpstr.Replace("'","''"); - updateStr.Append(tmpstr); - updateStr.Append("'"); - } - j++; - } - // Add the WHERE clause - updateStr.Append(" WHERE [NUMBER] = '"); - updateStr.Append(strNumber.ToString()); - updateStr.Append("' AND [SEQUENCE] = '"); - updateStr.Append(strSequence.ToString()); - updateStr.Append("' AND [INSTANCE] = '"); - updateStr.Append(strInstance.ToString()); - updateStr.Append("'"); - return updateStr.ToString(); - } - - - // Build the SQL command needed to insert a row in the USAGERO file - public override string GetRecInsertStr(DataTable tbl,DataRow row) - { - int j = 0; - StringBuilder insrtStr = new StringBuilder(); - StringBuilder valueStr = new StringBuilder(); - - insrtStr.Append("INSERT INTO ["); - insrtStr.Append(DBTable); - insrtStr.Append("] ("); - - valueStr.Append(" VALUES ("); - - foreach (DataColumn col in tbl.Columns) - { - bool isString = (col.DataType == Type.GetType("System.String")); - insrtStr.Append("["); - insrtStr.Append(col.ColumnName); - insrtStr.Append("],"); - - if (row.ItemArray[j].ToString().Equals("")) - { - valueStr.Append("NULL"); - } - else if (isString) - { - String tmpstr = row.ItemArray[j].ToString(); - tmpstr = tmpstr.Replace("'","''"); - valueStr.Append("'"); - valueStr.Append(tmpstr); - valueStr.Append("'"); - } - else - { - valueStr.Append(row.ItemArray[j].ToString()); - } - valueStr.Append(","); - j++; - } - - insrtStr = insrtStr.Replace(',',')',insrtStr.Length-1,1); - valueStr = valueStr.Replace(',',')',valueStr.Length-1,1); - insrtStr.Append(valueStr.ToString()); - - return insrtStr.ToString(); - } - - // Build the SQL command needed to delete a row in the USAGERO file - public override string RecDeleteStr(DataTable tbl,DataRow row) - { - int j = 0; - string strNumber = ""; - string strSequence = ""; - string strInstance = ""; - StringBuilder deleteStr = new StringBuilder(); - - deleteStr.Append("DELETE FROM ["); - deleteStr.Append(DBTable); - deleteStr.Append("]"); - - row.RejectChanges(); - foreach (DataColumn col in tbl.Columns) - { - if (col.ColumnName.Equals("NUMBER")) - { - strNumber = row.ItemArray[j].ToString(); - strNumber = strNumber.Replace("'","''"); - } - else if (col.ColumnName.Equals("SEQUENCE")) - { - strSequence = row.ItemArray[j].ToString(); - strSequence = strSequence.Replace("'","''"); - } - else if (col.ColumnName.Equals("INSTANCE")) - { - strInstance = row.ItemArray[j].ToString(); - strInstance = strInstance.Replace("'","''"); - } - j++; - } - // Add the WHERE clause - deleteStr.Append(" WHERE [NUMBER] = '"); - deleteStr.Append(strNumber.ToString()); - deleteStr.Append("' AND [SEQUENCE] = '"); - deleteStr.Append(strSequence.ToString()); - deleteStr.Append("' AND [INSTANCE] = '"); - deleteStr.Append(strInstance.ToString()); - deleteStr.Append("'"); - - return deleteStr.ToString(); - - } - - public override string GetCreateIndx1String() - { - StringBuilder index1Str = new StringBuilder(); - index1Str.Append("CREATE INDEX ["); - index1Str.Append(UsageROndx); - index1Str.Append("] ON "); - index1Str.Append(DBTable); - index1Str.Append(".DBF ([NUMBER],[SEQUENCE],[INSTANCE])"); - return (index1Str.ToString()); - } - - public override string GetCreateIndx2String() - { - StringBuilder index2Str = new StringBuilder(); - index2Str.Append("CREATE INDEX ["); - index2Str.Append(UsagROIDndx); - index2Str.Append("] ON "); - index2Str.Append(DBTable); - index2Str.Append(".DBF ([ROID])"); - return (index2Str.ToString()); - } - - public override bool IndexFilesExist() - { - if (UsageROndx==""||UsagROIDndx=="") BuildNDXFileNames(); - if(!File.Exists(DBPath+"\\"+UsageROndx+".NDX") || !File.Exists(DBPath+"\\"+UsagROIDndx+".NDX")) return false; - return true; - } - - public override void DeleteIndexFiles() - { - if(File.Exists(DBPath+"\\"+UsageROndx+".NDX")) File.Delete(DBPath+"\\"+UsageROndx+".NDX"); - if(File.Exists(DBPath+"\\"+UsagROIDndx+".NDX")) File.Delete(DBPath+"\\"+UsagROIDndx+".NDX"); - if(File.Exists(DBPath+"\\"+DBTable+".INF")) File.Delete(DBPath+"\\"+DBTable+".INF"); - } - - public override StringCollection CreateIndexFilesStatements() - { - if (isdBaseFile()) - { - StringCollection rtnStrColl = new StringCollection(); - string indx1 = GetCreateIndx1String(); - rtnStrColl.Add(indx1); - string indx2 = GetCreateIndx2String(); - rtnStrColl.Add(indx2); - return rtnStrColl; - } - return null; - } - - // Build a list of SQL commands needed to create a new USAGERO table (file) - // and add the first row - public override StringCollection CreateTableStatements(string strTblName) - { - StringCollection rtnStrColl = new StringCollection(); - StringBuilder createStr = new StringBuilder(); - //StringBuilder index1Str = new StringBuilder(); - //StringBuilder index2Str = new StringBuilder(); - - if (strTblName.Length > 0) // was a table name passd in? - { - DBTable = strTblName; - } - - if (DBTable.Equals("")) - { - MessageBox.Show("Trying to Create a new Table without a Name","Create Table Error"); - return rtnStrColl; - } - - // Build the command that creates a new SET table (file) - createStr.Append("CREATE TABLE ["); - createStr.Append(DBTable); - createStr.Append("] "); - createStr.Append("([NUMBER] Char(20), [SEQUENCE] Char(12), "); - createStr.Append("[INSTANCE] Char(1), [ROID] Char(16))"); - - rtnStrColl.Add(createStr.ToString()); // add create table - - if (isdBaseFile()) - { - // build the ndx file names (w/o extensions) -// BuildNDXFileNames(); - - // Build the command that creates the first index file - - - rtnStrColl.Add(GetCreateIndx1String()); // add create 1st index - - // Build the commmand that creates the second index file - string tmp = DBTable; - - - rtnStrColl.Add(GetCreateIndx2String()); // add create 2nd index - } - - return rtnStrColl; - } - - // After the table is created, create the associated INF file - public override int PostCreateTableFunction() - { - CreateINF(); // should already be created - return 0; - } - - // This is called in the class constructor and - // if the table name is assigned to the DBTable property - public override int CreateINF() - { - // if we are using dBase files, create an INF file containing - // a list of the associated NDX files. - if (isdBaseFile()) - { - StreamWriter infFile; - string infFileStr; - StringBuilder tmp = new StringBuilder(); - - // build the ndx file names (w/o extensions) - BuildNDXFileNames(); - - //build INF file name - tmp.Append(DBPath); - tmp.Append("\\"); - tmp.Append(DBTable); - tmp.Append(".INF"); - - infFileStr = tmp.ToString(); - - // if the INF file does not already exist create it - //if (!File.Exists(infFileStr)) - //{ - // always recreate it. Some plants' data had invalid files - // and it was felt that it would be quicker to recreate always - // rather than - infFile = new StreamWriter(infFileStr,false); - infFile.Write("NDX1="); - infFile.Write(UsageROndx); // USAGERO.NDX - infFile.Write(".NDX\r\n"); - infFile.Write("NDX2="); - infFile.Write(UsagROIDndx); //USAGROID.NDX - infFile.Write(".NDX\r\n"); - infFile.Close(); - //} - } - return 0; - } - - // return a list of SQL commands that will drop (delete) a database table (file) - public override StringCollection DeleteTableStatements(string strTblName) - { - StringCollection rtnStrColl = new StringCollection(); - StringBuilder DropTableStr = new StringBuilder(); - - DropTableStr.Append("Drop Table ["); - DropTableStr.Append(DBTable); - DropTableStr.Append("]"); - - rtnStrColl.Add(DropTableStr.ToString()); - return rtnStrColl; - } - - // return a dataset of RO Usage records, not sorted - public System.Data.DataSet GetNotSorted(string WhereStr) - { - BuildSelectCommand((int)SortTypes.NotSorted,WhereStr); - return DB_Data; - } - - // return a dataset of RO Usage records, sorted by the [NUMBER] field - public System.Data.DataSet GetSortedByProc(string WhereStr) - { - BuildSelectCommand((int)SortTypes.ProcSort,WhereStr); - return DB_Data; - } - - // return a dataset of RO Usage records, sorted by the [ROID] field - public System.Data.DataSet GetSortedByROID(string WhereStr) - { - BuildSelectCommand((int)SortTypes.ROIDsort,WhereStr); - return DB_Data; - } - - public void UpdateProcNumber(string oldnum, string newnum) - { - // Change fromnumber first, then tonumber - StringBuilder updateStr = new StringBuilder(); - updateStr.Append("UPDATE ["); - updateStr.Append(DBTable); - updateStr.Append("] SET [NUMBER] = '"); - updateStr.Append(newnum.Replace("'","''")); - updateStr.Append("' WHERE [NUMBER] = '"); - updateStr.Append(oldnum.Replace("'","''")); - updateStr.Append("'"); - ProcessACommand(updateStr.ToString()); - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_Set.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_Set.cs deleted file mode 100644 index 05ade40e..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_Set.cs +++ /dev/null @@ -1,283 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: vdb_Set.cs $ $Revision: 2 $ - * $Author: Jsj $ $Date: 8/23/04 10:12a $ - * - * $History: vdb_Set.cs $ - * - * ***************** Version 2 ***************** - * User: Jsj Date: 8/23/04 Time: 10:12a - * Updated in $/LibSource/VDB - * Fixed replace of single quote - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:40a - * Created in $/LibSource/VDB - *********************************************************************************************/ - -using System; -using System.Data; -using System.Text; -using System.Collections.Specialized; -using System.Windows.Forms; -using VDB; - -namespace VDB_Set -{ - /// - /// Open, Create, Delete, Update functions for SET files (tables) - /// - public class vdb_Set:VDB_Base - { - public vdb_Set(String strPath):base(strPath) - { - // if no table (file name) specified, then default to SET (SET.DBF) - if (DBTable.Equals("")) - DBTable = "SET"; - } - - // Build the SQL command needed to update a row in the SET file - public override string GetRecUpdateStr(DataTable tbl,DataRow row) - { - int j = 0; - bool FirstOne = true; - StringBuilder updateStr = new StringBuilder(); - StringBuilder LikeRecID = new StringBuilder(); - bool NullEntry = false; - - updateStr.Append("UPDATE ["); - updateStr.Append(DBTable); - updateStr.Append("] SET"); - - foreach (DataColumn col in tbl.Columns) - { - bool isString = (col.DataType == Type.GetType("System.String")); - if (col.ColumnName.Equals("ENTRY") && row.ItemArray[j].ToString().Equals("")) - { - NullEntry = true; - j++; - continue; - } - if (col.ColumnName.Equals("RECID")) - { - LikeRecID.Append("___"); // ignore the first 3 positions - LikeRecID.Append(row.ItemArray[j].ToString(),3,5); - } - if (FirstOne) - { - updateStr.Append(" ["); - FirstOne = false; - } - else - updateStr.Append(", ["); - updateStr.Append(col.ColumnName); - updateStr.Append("]="); - - if (row.ItemArray[j].ToString().Equals("")) - { - updateStr.Append("NULL"); - } - else if (isString) - { - String tmpstr = row.ItemArray[j].ToString(); - updateStr.Append("'"); - tmpstr = tmpstr.Replace("'","''"); - updateStr.Append(tmpstr); - updateStr.Append("'"); - } - else if (col.DataType == Type.GetType("System.DateTime")) - { - int jj; - String tmpstr = row.ItemArray[j].ToString(); - updateStr.Append("'"); - jj=tmpstr.IndexOf(" "); - if (jj<0) jj = tmpstr.Length; - updateStr.Append(tmpstr.Substring(0,jj)); - updateStr.Append("'"); - } - j++; - } - if (NullEntry) - { - // So that we can change the RECID number on the first entry - updateStr.Append(" WHERE [ENTRY] IS NULL"); - } - else - { - updateStr.Append(" WHERE [RECID] LIKE '"); - updateStr.Append(LikeRecID.ToString()); - updateStr.Append("' AND [ENTRY] IS NOT NULL"); - } - return updateStr.ToString(); - } - - - // Build the SQL command needed to insert a row in the SET file - public override string GetRecInsertStr(DataTable tbl,DataRow row) - { - int j = 0; - StringBuilder insrtStr = new StringBuilder(); - StringBuilder valueStr = new StringBuilder(); - - insrtStr.Append("INSERT INTO ["); - insrtStr.Append(DBTable); - insrtStr.Append("] ("); - - valueStr.Append(" VALUES ("); - - foreach (DataColumn col in tbl.Columns) - { - bool isString = (col.DataType == Type.GetType("System.String")); - insrtStr.Append("["); - insrtStr.Append(col.ColumnName); - insrtStr.Append("],"); - - if (row.ItemArray[j].ToString().Equals("")) - { - valueStr.Append("NULL"); - } - else if (isString) - { - String tmpstr = row.ItemArray[j].ToString(); - tmpstr = tmpstr.Replace("'","''"); - valueStr.Append("'"); - valueStr.Append(tmpstr); - valueStr.Append("'"); - } - else if (col.DataType == Type.GetType("System.DateTime")) - { - int jj; - String tmpstr = row.ItemArray[j].ToString(); - valueStr.Append("'"); - jj = tmpstr.IndexOf(" "); - if (jj<0) jj=tmpstr.Length; - valueStr.Append(tmpstr.Substring(0,jj)); - valueStr.Append("'"); - } - else - { - valueStr.Append(row.ItemArray[j].ToString()); - } - valueStr.Append(","); - j++; - } - - insrtStr = insrtStr.Replace(',',')',insrtStr.Length-1,1); - valueStr = valueStr.Replace(',',')',valueStr.Length-1,1); - insrtStr.Append(valueStr.ToString()); - - return insrtStr.ToString(); - } - - // Build the SQL command needed to delete a row in the SET file - public override string RecDeleteStr(DataTable tbl,DataRow row) - { - int j = 0; - String RecIDStr = ""; - String NumberStr = ""; - StringBuilder deleteStr = new StringBuilder(); - - deleteStr.Append("DELETE FROM ["); - deleteStr.Append(DBTable); - deleteStr.Append("] WHERE "); - - row.RejectChanges(); - foreach (DataColumn col in tbl.Columns) - { - if (col.ColumnName.Equals("NUMBER")) - { - NumberStr = row.ItemArray[j].ToString(); - NumberStr = NumberStr.Replace("'","''"); - } - else if (col.ColumnName.Equals("RECID")) - { - RecIDStr = row.ItemArray[j].ToString(); - } - j++; - } - deleteStr.Append("[NUMBER] = '"); - deleteStr.Append(NumberStr); - deleteStr.Append("' AND [RECID] = '"); - deleteStr.Append(RecIDStr); - deleteStr.Append("' AND [ENTRY] IS NOT NULL"); - - return deleteStr.ToString(); - - } - - // Build a list of SQL commands needed to create a new SET table (file) - // and add the first row - public override StringCollection CreateTableStatements(string strTblName) - { - StringCollection rtnStrColl = new StringCollection(); - StringBuilder createStr = new StringBuilder(); -// StringBuilder firstRecStr = new StringBuilder(); - - if (strTblName.Length > 0) // was a table name passd in? - { - DBTable = strTblName; - } - - if (DBTable.Equals("")) - { - MessageBox.Show("Trying to Create a new Table without a Name","Create Table Error"); - return rtnStrColl; - } - - // Build the command that creates a new SET table (file) - createStr.Append("CREATE TABLE ["); - createStr.Append(DBTable); - createStr.Append("] "); - createStr.Append("([TITLE] Char(250), [NUMBER] Char(20), [FORMAT] Char(1), "); - createStr.Append("[SUBDIR] Char(1), [ENTRY] Char(30), [RECID] Char(8), "); - createStr.Append("[PROCCODE] Char(1), [DATE] Date, [TIME] Char(5), "); - createStr.Append("INITIALS Char(5), SERIES Char(100))"); - -// // Build the command that adds the first (blank) record -// // with the RECID initialize to 00000001 -// firstRecStr.Append("INSERT INTO ["); -// firstRecStr.Append(DBTable); -// firstRecStr.Append("] ([RECID]) VALUES ('00000001')"); - - rtnStrColl.Add(createStr.ToString()); // add create table -// rtnStrColl.Add(firstRecStr.ToString()); // add inserst first record - - return rtnStrColl; - } - - // Build a list of SQL commands needed to create the first data row - public override StringCollection CreateFirstRecordStatement(string strTblName) - { - StringCollection rtnStrColl = new StringCollection(); - StringBuilder firstRecStr = new StringBuilder(); - - // Build the command that adds the first (blank) record - // with the RECID initialize to 00000001 - firstRecStr.Append("INSERT INTO ["); - firstRecStr.Append(DBTable); - firstRecStr.Append("] ([RECID]) VALUES ('00000001')"); - - rtnStrColl.Add(firstRecStr.ToString()); // add inserst first record - - return rtnStrColl; - } - - // return a list of SQL commands that will drop (delete) a database table (file) - public override StringCollection DeleteTableStatements(string strTblName) - { - StringCollection rtnStrColl = new StringCollection(); - StringBuilder DropTableStr = new StringBuilder(); - - DropTableStr.Append("Drop Table ["); - DropTableStr.Append(DBTable); - DropTableStr.Append("]"); - - rtnStrColl.Add(DropTableStr.ToString()); - return rtnStrColl; - } - - } - -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_SetExt.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_SetExt.cs deleted file mode 100644 index cb7d335a..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_SetExt.cs +++ /dev/null @@ -1,255 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: vdb_SetExt.cs $ $Revision: 2 $ - * $Author: Jsj $ $Date: 8/23/04 10:12a $ - * - * $History: vdb_SetExt.cs $ - * - * ***************** Version 2 ***************** - * User: Jsj Date: 8/23/04 Time: 10:12a - * Updated in $/LibSource/VDB - * Fixed replace of single quote - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:40a - * Created in $/LibSource/VDB - *********************************************************************************************/ - -using System; -using System.Data; -using System.Text; -using System.Collections.Specialized; -using System.Windows.Forms; -using VDB; - -namespace VDB_SetExt -{ - /// - /// Open, Create, Delete, Update functions for SETEXT files (tables) - /// (set extension) - /// - public class vdb_SetExt:VDB_Base - { - public vdb_SetExt(String strPath):base(strPath) - { - // if no table (file name) specified, then default to SETEXT (SET.DBF) - if (DBTable.Equals("")) - DBTable = "SETEXT"; - } - - // Build a SQL statement for selecting the data. The select for the set extension - // datta is much more involved because the date field for the approved date needs - // calculated/formatted. - public override string DefaultSelectCommand() - { - StringBuilder tmp = new StringBuilder(); - tmp.Append("select t3.COMMENT, t3.REV, t3.PC, t3.RECID,format(ApprovedDate,'m/d/yyyy hh:nn:ss') "); - tmp.Append(" as ApprovedDate from(select COMMENT, REV, PC, RECID,iif(MyDate=DateValue('1/1/1970'),null,MyDate) "); - tmp.Append(" as ApprovedDate from (select COMMENT, REV, PC, RECID, dateadd(\"S\",(((asc(mid(tdstamp,4,1))*256)+asc(mid(tdstamp,3,1)) )"); - tmp.Append("*256+asc(mid(tdstamp,2,1)) )*256+asc(mid(tdstamp,1,1)),datevalue('1/1/1970')) as MyDate "); - tmp.Append(" from (select COMMENT, REV, PC, RECID,iif(isnull(tdstamp),chr(0)+chr(0)+chr(0)+chr(0),left(tdstamp+chr(0)+chr(0)+chr(0)+chr(0),4)) as tdstamp from setext)t1)t2)t3 "); - SelectCmd = tmp.ToString(); - return SelectCmd; - } - - // Build the SQL command needed to update a row in the SETEXT file - public override string GetRecUpdateStr(DataTable tbl,DataRow row) - { - int j = 0; - StringBuilder updateStr = new StringBuilder(); - StringBuilder LikeRecID = new StringBuilder(); - - updateStr.Append("UPDATE ["); - updateStr.Append(DBTable); - updateStr.Append("] SET"); - - foreach (DataColumn col in tbl.Columns) - { - bool isString = (col.DataType == Type.GetType("System.String")); - if (col.ColumnName.ToUpper().Equals("RECID")) - { - LikeRecID.Append("___"); // ignore the first 3 positions - LikeRecID.Append(row.ItemArray[j].ToString(),3,5); - } - //only comment is updated (at least for initial 32bit veproms - // browser. This may need modified if it is used later - if (col.ColumnName.ToUpper().Equals("COMMENT")) - { - updateStr.Append(" ["); - updateStr.Append(col.ColumnName); - updateStr.Append("]="); - - if (row.ItemArray[j].ToString().Equals("")) - { - updateStr.Append("NULL"); - } - else if (isString) - { - String tmpstr = row.ItemArray[j].ToString(); - updateStr.Append("'"); - tmpstr = tmpstr.Replace("'","''"); - updateStr.Append(tmpstr); - updateStr.Append("'"); - } - else - { - updateStr.Append(row.ItemArray[j].ToString()); - } - } - j++; - } - updateStr.Append(" WHERE [RECID] LIKE '"); - updateStr.Append(LikeRecID.ToString()); - updateStr.Append("'"); - return updateStr.ToString(); - } - - - // Build the SQL command needed to insert a row in the SET file - public override string GetRecInsertStr(DataTable tbl,DataRow row) - { - int j = 0; - StringBuilder insrtStr = new StringBuilder(); - StringBuilder valueStr = new StringBuilder(); - - insrtStr.Append("INSERT INTO ["); - insrtStr.Append(DBTable); - insrtStr.Append("] ("); - - valueStr.Append(" VALUES ("); - - foreach (DataColumn col in tbl.Columns) - { - // the select statement was modified to handle the tdstamp field (which - // is a calculated date). This needs to be handled on insert, i.e. the - // fieldname. - bool isString = (col.DataType == Type.GetType("System.String")); - bool isApprovedDate = col.ColumnName.ToUpper().Equals("APPROVEDDATE"); - insrtStr.Append("["); - if(!isApprovedDate) - insrtStr.Append(col.ColumnName); - else - insrtStr.Append("TDSTAMP"); - insrtStr.Append("],"); - - if (row.ItemArray[j].ToString().Equals("")) - { - valueStr.Append("NULL"); - } - else if (isString) - { - String tmpstr = row.ItemArray[j].ToString(); - tmpstr = tmpstr.Replace("'","''"); - valueStr.Append("'"); - valueStr.Append(tmpstr); - valueStr.Append("'"); - } - else - { - valueStr.Append(row.ItemArray[j].ToString()); - } - valueStr.Append(","); - j++; - } - - insrtStr = insrtStr.Replace(',',')',insrtStr.Length-1,1); - valueStr = valueStr.Replace(',',')',valueStr.Length-1,1); - insrtStr.Append(valueStr.ToString()); - - return insrtStr.ToString(); - } - - // Build the SQL command needed to delete a row in the SET file - public override string RecDeleteStr(DataTable tbl,DataRow row) - { - int j = 0; - String RecIDStr = ""; - StringBuilder deleteStr = new StringBuilder(); - - deleteStr.Append("DELETE FROM ["); - deleteStr.Append(DBTable); - deleteStr.Append("] WHERE "); - - row.RejectChanges(); - foreach (DataColumn col in tbl.Columns) - { - if (col.ColumnName.Equals("RECID")) - { - RecIDStr = row.ItemArray[j].ToString(); - } - j++; - } - deleteStr.Append("[RECID] = '"); - deleteStr.Append(RecIDStr); - deleteStr.Append("'"); - - return deleteStr.ToString(); - - } - - // Build a list of SQL commands needed to create a new SET table (file) - // and add the first row - public override StringCollection CreateTableStatements(string strTblName) - { - StringCollection rtnStrColl = new StringCollection(); - StringBuilder createStr = new StringBuilder(); - - if (strTblName.Length > 0) // was a table name passd in? - { - DBTable = strTblName; - } - - if (DBTable.Equals("")) - { - MessageBox.Show("Trying to Create a new Table without a Name","Create Table Error"); - return rtnStrColl; - } - - // Build the command that creates a new SET table (file) - createStr.Append("CREATE TABLE ["); - createStr.Append(DBTable); - createStr.Append("] "); - createStr.Append("([COMMENT] Char(250), [REV] Char(30), [PC] Char(10), "); - createStr.Append("[RECID] Char(8), [TDSTAMP] Int)"); - - rtnStrColl.Add(createStr.ToString()); // add create table - - return rtnStrColl; - } - - // Build a list of SQL commands needed to create the first data row - public override StringCollection CreateFirstRecordStatement(string strTblName) - { - StringCollection rtnStrColl = new StringCollection(); - StringBuilder firstRecStr = new StringBuilder(); - - // Build the command that adds the first (blank) record - // with the RECID initialize to 00000001 - firstRecStr.Append("INSERT INTO ["); - firstRecStr.Append(DBTable); - firstRecStr.Append("] ([RECID]) VALUES ('00000001')"); - - rtnStrColl.Add(firstRecStr.ToString()); // add inserst first record - - return rtnStrColl; - } - - // return a list of SQL commands that will drop (delete) a database table (file) - public override StringCollection DeleteTableStatements(string strTblName) - { - StringCollection rtnStrColl = new StringCollection(); - StringBuilder DropTableStr = new StringBuilder(); - - DropTableStr.Append("Drop Table ["); - DropTableStr.Append(DBTable); - DropTableStr.Append("]"); - - rtnStrColl.Add(DropTableStr.ToString()); - return rtnStrColl; - } - - } - -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_TransUsage.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_TransUsage.cs deleted file mode 100644 index b55e760e..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VDB/vdb_TransUsage.cs +++ /dev/null @@ -1,495 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: vdb_TransUsage.cs $ $Revision: 7 $ - * $Author: Kathy $ $Date: 5/01/06 11:17a $ - * - * $History: vdb_TransUsage.cs $ - * - * ***************** Version 7 ***************** - * User: Kathy Date: 5/01/06 Time: 11:17a - * Updated in $/LibSource/VDB - * Fix B2006-018: single quote in proc number causes problem on data - * request - * - * ***************** Version 6 ***************** - * User: Kathy Date: 8/16/05 Time: 2:54p - * Updated in $/LibSource/VDB - * B2005-030: error if missing ndx - * - * ***************** Version 5 ***************** - * User: Kathy Date: 4/21/05 Time: 10:20a - * Updated in $/LibSource/VDB - * always write inf file - * - * ***************** Version 4 ***************** - * User: Kathy Date: 3/08/05 Time: 1:48p - * Updated in $/LibSource/VDB - * Approval - * - * ***************** Version 3 ***************** - * User: Jsj Date: 8/30/04 Time: 12:16p - * Updated in $/LibSource/VDB - * upper cased WHERE string did not find mixed cased database items, now - * use the WHERE string as it is passed in. - * - * ***************** Version 2 ***************** - * User: Jsj Date: 8/23/04 Time: 10:13a - * Updated in $/LibSource/VDB - * Fixed replace of single quote - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:40a - * Created in $/LibSource/VDB - *********************************************************************************************/ - -using System; -using System.Data; -using System.Text; -using System.Collections.Specialized; -using System.IO; -using System.Windows.Forms; -using VDB; -using VDB_ConnType; - -namespace VDB_TransUsage -{ - /// - /// Open, Create, Delete, Update functions for Transition Usage files (tables) - /// - public class vdb_TransUsage:VDB_Base - { - public enum SortTypes {NotSorted,FromSort,ToSort}; // list of sorting types - - public string TransFromNDX = ""; - public string TransToNDX = ""; - - public vdb_TransUsage(String strPath):base(strPath) - { - // if no table (file name) specified, then default to TRAN (TRAN.DBF) - if (DBTable.Equals("")) - DBTable = "TRAN"; - } - - // Build a SQL statement. Optionally sort and filter the select statement. - private void BuildSelectCommand(int SortingType,string WhereStr) - { - StringBuilder tmp = new StringBuilder(); - tmp.Append("SELECT [FROMNUMBER],[FROMSEQUEN],[FROMINSTAN],[TYPE],"); - tmp.Append("[TONUMBER],[TOSEQUENCE],[TOINSTANCE],[DTI],[OLDTO] FROM ["); - tmp.Append(DBTable); - tmp.Append("]"); - - if (WhereStr.Length > 0) // Was a WHERE clause passed in? - { - // Add " WHERE " to the beginning if it is not already there - string tmpstr = WhereStr.ToUpper(); - if (tmpstr[0] != ' ') - { - tmp.Append(" "); - if (!tmpstr.StartsWith("WHERE ")) - tmp.Append("WHERE "); - } - else if (!tmpstr.StartsWith(" WHERE ")) - tmp.Append(" WHERE"); - // add the passed in WHERE clause -// When the WhereStr was upper cased, procedure numbers with mixed and/or lower -// cased letters would not be found. Therefore, use the WhereStr exactly as it -// was sent in. -// tmp.Append(tmpstr); - tmp.Append(WhereStr); - } - - switch (SortingType) - { - case 0: //NotSorted - break; - case 1: // FromSort - sorted by FROMNUMBER - tmp.Append(" GROUP BY [FROMNUMBER],[FROMSEQUEN],[FROMINSTAN],[TYPE],"); - tmp.Append("[TONUMBER],[TOSEQUENCE],[TOINSTANCE],[DTI],[OLDTO]"); - break; - case 2: // Tosort - sorted by TONUMBER - tmp.Append(" GROUP BY [TONUMBER],[TOSEQUENCE],[TOINSTANCE],"); - tmp.Append("[FROMNUMBER],[FROMSEQUEN],[FROMINSTAN],[TYPE],[DTI],[OLDTO]"); - break; - } - SelectCmd = tmp.ToString(); - } - - - private void BuildNDXFileNames() - { - TransFromNDX = DBTable +"FROM"; - TransToNDX = DBTable + "TO"; - } - - - // Build the SQL command needed to update a row in the TRAN file - public override string GetRecUpdateStr(DataTable tbl,DataRow row) - { - int j = 0; - bool FirstOne = true; - StringBuilder updateStr = new StringBuilder(); - string strNumber = ""; - string strSequence = ""; - string strInstance = ""; - - updateStr.Append("UPDATE ["); - updateStr.Append(DBTable); - updateStr.Append("] SET"); - - foreach (DataColumn col in tbl.Columns) - { - bool isString = (col.DataType == Type.GetType("System.String")); - - if (col.ColumnName.Equals("FROMNUMBER")) - { - strNumber = row.ItemArray[j].ToString(); - strNumber = strNumber.Replace("'","''"); - } - else if (col.ColumnName.Equals("FROMSEQUEN")) - { - strSequence = row.ItemArray[j].ToString(); - strSequence = strSequence.Replace("'","''"); - } - else if (col.ColumnName.Equals("FROMINSTAN")) - { - strInstance = row.ItemArray[j].ToString(); - strInstance = strInstance.Replace("'","''"); - } - - if (FirstOne) - { - updateStr.Append(" ["); - FirstOne = false; - } - else - updateStr.Append(", ["); - - updateStr.Append(col.ColumnName); - updateStr.Append("]="); - - if (row.ItemArray[j].ToString().Equals("")) - { - updateStr.Append("NULL"); - } - else if (isString) - { - String tmpstr = row.ItemArray[j].ToString(); - updateStr.Append("'"); - tmpstr = tmpstr.Replace("'","''"); - updateStr.Append(tmpstr); - updateStr.Append("'"); - } - j++; - } - // Add the WHERE clause - updateStr.Append(" WHERE [FROMNUMBER] = '"); - updateStr.Append(strNumber.ToString()); - updateStr.Append("' AND [FROMSEQUEN] = '"); - updateStr.Append(strSequence.ToString()); - updateStr.Append("' AND [FROMINSTAN] = '"); - updateStr.Append(strInstance.ToString()); - updateStr.Append("'"); - return updateStr.ToString(); - } - - - // Build the SQL command needed to insert a row in the TRAN file - public override string GetRecInsertStr(DataTable tbl,DataRow row) - { - int j = 0; - StringBuilder insrtStr = new StringBuilder(); - StringBuilder valueStr = new StringBuilder(); - - insrtStr.Append("INSERT INTO ["); - insrtStr.Append(DBTable); - insrtStr.Append("] ("); - - valueStr.Append(" VALUES ("); - - foreach (DataColumn col in tbl.Columns) - { - bool isString = (col.DataType == Type.GetType("System.String")); - insrtStr.Append("["); - insrtStr.Append(col.ColumnName); - insrtStr.Append("],"); - - if (row.ItemArray[j].ToString().Equals("")) - { - valueStr.Append("NULL"); - } - else if (isString) - { - String tmpstr = row.ItemArray[j].ToString(); - tmpstr = tmpstr.Replace("'","''"); - valueStr.Append("'"); - valueStr.Append(tmpstr); - valueStr.Append("'"); - } - else - { - valueStr.Append(row.ItemArray[j].ToString()); - } - valueStr.Append(","); - j++; - } - - insrtStr = insrtStr.Replace(',',')',insrtStr.Length-1,1); - valueStr = valueStr.Replace(',',')',valueStr.Length-1,1); - insrtStr.Append(valueStr.ToString()); - - return insrtStr.ToString(); - } - - // Build the SQL command needed to delete a row in the TRAN file - public override string RecDeleteStr(DataTable tbl,DataRow row) - { - int j = 0; - string strNumber = ""; - string strSequence = ""; - string strInstance = ""; - StringBuilder deleteStr = new StringBuilder(); - - deleteStr.Append("DELETE FROM ["); - deleteStr.Append(DBTable); - deleteStr.Append("]"); - - row.RejectChanges(); - foreach (DataColumn col in tbl.Columns) - { - if (col.ColumnName.Equals("FROMNUMBER")) - { - strNumber = row.ItemArray[j].ToString(); - strNumber = strNumber.Replace("'","''"); - } - else if (col.ColumnName.Equals("FROMSEQUEN")) - { - strSequence = row.ItemArray[j].ToString(); - strSequence = strSequence.Replace("'","''"); - } - else if (col.ColumnName.Equals("FROMINSTAN")) - { - strInstance = row.ItemArray[j].ToString(); - strInstance = strInstance.Replace("'","''"); - } - j++; - } - // Add the WHERE clause - deleteStr.Append(" WHERE [FROMNUMBER] = '"); - deleteStr.Append(strNumber.ToString()); - deleteStr.Append("' AND [FROMSEQUEN] = '"); - deleteStr.Append(strSequence.ToString()); - deleteStr.Append("' AND [FROMINSTAN] = '"); - deleteStr.Append(strInstance.ToString()); - deleteStr.Append("'"); - - return deleteStr.ToString(); - - } - - public override string GetCreateIndx1String() - { - StringBuilder index1Str = new StringBuilder(); - index1Str.Append("CREATE INDEX ["); - index1Str.Append(TransFromNDX); - index1Str.Append("] ON "); - index1Str.Append(DBTable); - index1Str.Append(".DBF ([FROMNUMBER],[FROMSEQUEN],[FROMINSTAN])"); - return (index1Str.ToString()); - } - - public override string GetCreateIndx2String() - { - StringBuilder index2Str = new StringBuilder(); - index2Str.Append("CREATE INDEX ["); - index2Str.Append(TransToNDX); - index2Str.Append("] ON "); - index2Str.Append(DBTable); - index2Str.Append(".DBF ([TONUMBER], [TOSEQUENCE])"); - return (index2Str.ToString()); - } - - public override bool IndexFilesExist() - { - if (TransFromNDX==""||TransToNDX=="")BuildNDXFileNames(); - if(!File.Exists(DBPath+"\\"+TransFromNDX+".NDX") || !File.Exists(DBPath+"\\"+TransToNDX+".NDX")) return false; - return true; - } - public override void DeleteIndexFiles() - { - if(File.Exists(DBPath+"\\"+TransFromNDX+".NDX")) File.Delete(DBPath+"\\"+TransFromNDX+".NDX"); - if(File.Exists(DBPath+"\\"+TransToNDX+".NDX")) File.Delete(DBPath+"\\"+TransToNDX+".NDX"); - if(File.Exists(DBPath+"\\"+DBTable+".INF")) File.Delete(DBPath+"\\"+DBTable+".INF"); - } - - public override StringCollection CreateIndexFilesStatements() - { - if (isdBaseFile()) - { - StringCollection rtnStrColl = new StringCollection(); - string indx1 = GetCreateIndx1String(); - rtnStrColl.Add(indx1); - string indx2 = GetCreateIndx2String(); - rtnStrColl.Add(indx2); - return rtnStrColl; - } - return null; - } - - // Build a list of SQL commands needed to create a new TRAN table (file) - // and add the first row - public override StringCollection CreateTableStatements(string strTblName) - { - StringCollection rtnStrColl = new StringCollection(); - StringBuilder createStr = new StringBuilder(); - //StringBuilder index1Str = new StringBuilder(); - //StringBuilder index2Str = new StringBuilder(); - - if (strTblName.Length > 0) // was a table name passd in? - { - DBTable = strTblName; - } - - if (DBTable.Equals("")) - { - MessageBox.Show("Trying to Create a new Table without a Name","Create Table Error"); - return rtnStrColl; - } - - // Build the command that creates a new SET table (file) - createStr.Append("CREATE TABLE ["); - createStr.Append(DBTable); - createStr.Append("] "); - createStr.Append("([FROMNUMBER] Char(20), [FROMSEQUEN] Char(12), "); - createStr.Append("[FROMINSTAN] Char(1), [TYPE] Char(1),"); - createStr.Append("[TONUMBER] Char(20), [TOSEQUENCE] Char(12), "); - createStr.Append("[TOINSTANCE] Char(2), [DTI] Char(18), [OLDTO] Char(32))"); - - rtnStrColl.Add(createStr.ToString()); // add create table - - if (isdBaseFile()) - { - // Build the command that creates the first index file - rtnStrColl.Add(GetCreateIndx1String()); // add create 1st index - - // Build the commmand that creates the second index file - //string tmp = DBTable; - - rtnStrColl.Add(GetCreateIndx2String()); // add create 2nd index - } - - return rtnStrColl; - } - - // After the table is created, create the associated INF file - public override int PostCreateTableFunction() - { - CreateINF(); // should already be created - return 0; - } - - // This will be called from CreateTableStatements() - // and this is called if the table name is assigned to the DBTable property - public override int CreateINF() - { - // if we are using dBase files, create an INF file containing - // a list of the associated NDX files. - if (isdBaseFile()) - { - StreamWriter infFile; - string infFileStr; - StringBuilder tmp = new StringBuilder(); - - // build the ndx file names (w/o extensions) - BuildNDXFileNames(); - - //build INF file name - tmp.Append(DBPath); - tmp.Append("\\"); - tmp.Append(DBTable); - tmp.Append(".INF"); - - infFileStr = tmp.ToString(); - - // if the INF file does not already exist create it - //if (!File.Exists(infFileStr)) - //{ - // always recreate it. Some plants' data had invalid files - // and it was felt that it would be quicker to recreate always - // rather than - infFile = new StreamWriter(infFileStr,false); - infFile.Write("NDX1="); - infFile.Write(TransFromNDX); // TRANFROM.NDX - infFile.Write(".NDX\r\n"); - infFile.Write("NDX2="); - infFile.Write(TransToNDX); //TRANTO.NDX - infFile.Write(".NDX\r\n"); - infFile.Close(); - //} - } - return 0; - } - - // return a list of SQL commands that will drop (delete) a database table (file) - public override StringCollection DeleteTableStatements(string strTblName) - { - StringCollection rtnStrColl = new StringCollection(); - StringBuilder DropTableStr = new StringBuilder(); - - DropTableStr.Append("Drop Table ["); - DropTableStr.Append(DBTable); - DropTableStr.Append("]"); - - rtnStrColl.Add(DropTableStr.ToString()); - return rtnStrColl; - } - - // return a dataset of Transition Usage records, not sorted - public System.Data.DataSet GetNotSorted(string WhereStr) - { - BuildSelectCommand((int)SortTypes.NotSorted,WhereStr); - return DB_Data; - } - - // return a dataset or Transition Usage records, sorted by the [FROMNUMBER] field - public System.Data.DataSet GetSortedByFromTrans(string WhereStr) - { - BuildSelectCommand((int)SortTypes.FromSort,WhereStr); - return DB_Data; - } - - // return a dataset or Transition Usage records, sorted by the [TONUMBER] field - public System.Data.DataSet GetSortedByToTrans(string WhereStr) - { - BuildSelectCommand((int)SortTypes.ToSort,WhereStr); - return DB_Data; - } - - public void UpdateProcNumber(string oldnum, string newnum) - { - // Change fromnumber first, then tonumber - StringBuilder updateStr = new StringBuilder(); - updateStr.Append("UPDATE ["); - updateStr.Append(DBTable); - updateStr.Append("] SET [FROMNUMBER] = '"); - updateStr.Append(newnum.Replace("'","''")); - updateStr.Append("' WHERE [FROMNUMBER] = '"); - updateStr.Append(oldnum.Replace("'","''")); - updateStr.Append("'"); - ProcessACommand(updateStr.ToString()); - - // now to... - updateStr.Remove(0,updateStr.Length); - updateStr.Append("UPDATE ["); - updateStr.Append(DBTable); - updateStr.Append("] SET [TONUMBER] = '"); - updateStr.Append(newnum.Replace("'","''")); - updateStr.Append("' WHERE [TONUMBER] = '"); - updateStr.Append(oldnum.Replace("'","''")); - updateStr.Append("'"); - ProcessACommand(updateStr.ToString()); - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/AssemblyInfo.cs deleted file mode 100644 index 7e3b35a5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/AssemblyInfo.cs.bak deleted file mode 100644 index 6b2b0662..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/VEMessage.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/VEMessage.cs deleted file mode 100644 index 2737993d..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/VEMessage.cs +++ /dev/null @@ -1,113 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: VEMessage.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 7/27/04 8:24a $ - * - * $History: VEMessage.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:24a - * Created in $/LibSource/VEMessage - *********************************************************************************************/ -using System; -using System.Collections.Specialized; -using System.Runtime.InteropServices; -using System.Windows.Forms; - -namespace VEMessageNS -{ - // messages for communication between this app & vfw. - public enum MessageOps - { - WM_USER = 0x0400, - MSG_COMMAND_TERMINATE = WM_USER + 200 + 4, - POSQUERY = WM_USER+0x015, //21, - POSUPDATE = WM_USER+0x016, //22, - GETANSWER = WM_USER+0x017, //23, - RQSTATTACH = WM_USER+0x018, //24, - RQSTFILEOFFSET = WM_USER+0x19, //25, - RQSTFILEMODE = WM_USER+0x01a, //26, - RQSTFILEOWNER = WM_USER+0x01b, //27, - RQSTFILESEEK = WM_USER+0x01c, //28, - RQSTFILECLOSE = WM_USER+0x01d, //29, - RQSTFILEOPEN = WM_USER+0x01e, //30, - RQSTFILEREAD = WM_USER+0x01f, //31, - RQSTFILEWRITE = WM_USER+0x020, //32, - RQSTPROCESSRECORD = WM_USER+0x021, //33, - GETPROCESSREC = WM_USER+0x022, //34, - SETLOCKBYUSER = WM_USER+0x023, // 35 - }; - - - public class Win32 - { - [DllImport("wow32.dll")] - public static extern Int16 WOWHandle16(IntPtr x, int xx); - } - - public class VEMessage - { - public HybridDictionary dicMessage; - static int m_Handle_16bit; - static IntPtr m_Handle_vfw; - public VEMessage() - { - dicMessage = new HybridDictionary(); - dicMessage.Add(0x415,MessageOps.POSQUERY); - dicMessage.Add(0x416,MessageOps.POSUPDATE); - dicMessage.Add(0x417,MessageOps.GETANSWER); - dicMessage.Add(0x418,MessageOps.RQSTATTACH); - dicMessage.Add(0x419,MessageOps.RQSTFILEOFFSET); - dicMessage.Add(0x41a,MessageOps.RQSTFILEMODE); - dicMessage.Add(0x41b,MessageOps.RQSTFILEOWNER); - dicMessage.Add(0x41c,MessageOps.RQSTFILESEEK); - dicMessage.Add(0x41d,MessageOps.RQSTFILECLOSE); - dicMessage.Add(0x41e,MessageOps.RQSTFILEOPEN); - dicMessage.Add(0x41f,MessageOps.RQSTFILEREAD); - dicMessage.Add(0x420,MessageOps.RQSTFILEWRITE); - dicMessage.Add(0x421,MessageOps.RQSTPROCESSRECORD); - dicMessage.Add(0x422,MessageOps.GETPROCESSREC); - dicMessage.Add(0x423,MessageOps.SETLOCKBYUSER); - } - - public bool Exists(int msg) - { - return(dicMessage.Contains(msg)); - } - public static int Handle_16bit - { - set - { - m_Handle_16bit=value; - } - get - { - return m_Handle_16bit; - } - } - - public static IntPtr Handle_Vfw - { - set - { - m_Handle_vfw=value; - } - get - { - return m_Handle_vfw; - } - } - - public int GetMessageOp(int m) - { - return ((int) dicMessage[m]); - } - - public void SetReceiveHandle(Message m) - { - Handle_Vfw = m.WParam; - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/VEMessage.csproj b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/VEMessage.csproj deleted file mode 100644 index fbcb9aeb..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/VEMessage.csproj +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/VEMessage.sln b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/VEMessage.sln deleted file mode 100644 index b8efca13..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEMessage/VEMessage.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VEMessage", "VEMessage.csproj", "{D6084F16-AF86-4D6D-B53B-13BCA7B90CA0}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {D6084F16-AF86-4D6D-B53B-13BCA7B90CA0}.Debug.ActiveCfg = Debug|.NET - {D6084F16-AF86-4D6D-B53B-13BCA7B90CA0}.Debug.Build.0 = Debug|.NET - {D6084F16-AF86-4D6D-B53B-13BCA7B90CA0}.Release.ActiveCfg = Release|.NET - {D6084F16-AF86-4D6D-B53B-13BCA7B90CA0}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/AssemblyInfo.cs deleted file mode 100644 index cb6b7eb5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/AssemblyInfo.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/AssemblyInfo.cs.bak deleted file mode 100644 index 143d8339..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/AssemblyInfo.cs.bak +++ /dev/null @@ -1,59 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")] -[assembly: AssemblyKeyName("")] - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockDlg.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockDlg.cs deleted file mode 100644 index 76a2d654..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockDlg.cs +++ /dev/null @@ -1,147 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: LockDlg.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 7/27/04 8:44a $ - * - * $History: LockDlg.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:44a - * Created in $/LibSource/VENetwork - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace VENetwork -{ - /// - /// Summary description for LockDlg. - /// - public class LockDlg : System.Windows.Forms.Form - { - private System.Windows.Forms.TextBox tbLockReason; - private System.Windows.Forms.Label lblLckMsg; - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button Cancel; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - private string [] LckTypes = {"SYSTEM", "PLANT", "PROCEDURE"}; - - private VELock vlk; - public LockDlg(VELock alock) - { - vlk = alock; - // - // Required for Windows Form Designer support - // - InitializeComponent(); - this.lblLckMsg.Text = "Please enter PURPOSE and estimated DURATION of " + LckTypes[(int)vlk.LockType-1] + " Lock: "; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(LockDlg)); - this.tbLockReason = new System.Windows.Forms.TextBox(); - this.lblLckMsg = new System.Windows.Forms.Label(); - this.btnOK = new System.Windows.Forms.Button(); - this.Cancel = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // tbLockReason - // - this.tbLockReason.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.tbLockReason.Location = new System.Drawing.Point(8, 40); - this.tbLockReason.Name = "tbLockReason"; - this.tbLockReason.Size = new System.Drawing.Size(328, 21); - this.tbLockReason.TabIndex = 0; - this.tbLockReason.Text = ""; - this.tbLockReason.KeyUp += new System.Windows.Forms.KeyEventHandler(this.tbLockReason_KeyUp); - // - // lblLckMsg - // - this.lblLckMsg.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblLckMsg.Location = new System.Drawing.Point(0, 0); - this.lblLckMsg.Name = "lblLckMsg"; - this.lblLckMsg.Size = new System.Drawing.Size(280, 32); - this.lblLckMsg.TabIndex = 1; - this.lblLckMsg.Text = "Please enter PURPOSE and estimated DURATION of Lock: "; - // - // btnOK - // - this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnOK.Location = new System.Drawing.Point(176, 72); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(64, 24); - this.btnOK.TabIndex = 2; - this.btnOK.Text = "OK"; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // Cancel - // - this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.Cancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.Cancel.Location = new System.Drawing.Point(264, 72); - this.Cancel.Name = "Cancel"; - this.Cancel.Size = new System.Drawing.Size(64, 24); - this.Cancel.TabIndex = 3; - this.Cancel.Text = "Cancel"; - // - // LockDlg - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(376, 102); - this.Controls.Add(this.Cancel); - this.Controls.Add(this.btnOK); - this.Controls.Add(this.lblLckMsg); - this.Controls.Add(this.tbLockReason); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "LockDlg"; - this.Text = "VE-Proms Lock Purpose"; - this.ResumeLayout(false); - - } - #endregion - - private void btnOK_Click(object sender, System.EventArgs e) - { - vlk.Why = this.tbLockReason.Text; - vlk.WhyDT = System.DateTime.Now; - } - - private void tbLockReason_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e) - { - // if key pressed was a return - treat as ok button. - if (e.KeyCode == Keys.Return) this.btnOK.PerformClick(); - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockDlg.resx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockDlg.resx deleted file mode 100644 index 834afb22..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockDlg.resx +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - Private - - - LockDlg - - - - AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx - dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx - F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3 - d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx - dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3 - F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX - cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3 - F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX - cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockInfoDlg.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockInfoDlg.cs deleted file mode 100644 index f9a22f90..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockInfoDlg.cs +++ /dev/null @@ -1,231 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: LockInfoDlg.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 7/27/04 8:44a $ - * - * $History: LockInfoDlg.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:44a - * Created in $/LibSource/VENetwork - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace VENetwork -{ - /// - /// Summary description for Form1. - /// - public class LockInfoDlg : System.Windows.Forms.Form - { - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.TextBox tbUserName; - private System.Windows.Forms.TextBox tbLoc; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.TextBox tbPhone1; - private System.Windows.Forms.TextBox tbWhy; - private System.Windows.Forms.TextBox tbWhyDT; - private System.Windows.Forms.TextBox tbPhone2; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private string [] SLockTypes = {"System", "Plant", "Procedure Set"}; - public LockInfoDlg(VELock lck) - { - InitializeComponent(); - this.tbUserName.Text = lck.UserName; - this.tbPhone1.Text = lck.Phone1; - this.tbPhone2.Text = lck.Phone2; - this.tbLoc.Text = lck.Loc1 + " - " + lck.Loc2; - this.tbWhy.Text = lck.Why; - this.tbWhyDT.Text = lck.WhyDT.ToShortDateString() + " " + lck.WhyDT.ToShortTimeString(); - this.Text = SLockTypes[(int)lck.LockType-1] + " Lock"; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(LockInfoDlg)); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.tbUserName = new System.Windows.Forms.TextBox(); - this.tbLoc = new System.Windows.Forms.TextBox(); - this.tbPhone1 = new System.Windows.Forms.TextBox(); - this.tbWhy = new System.Windows.Forms.TextBox(); - this.tbWhyDT = new System.Windows.Forms.TextBox(); - this.button1 = new System.Windows.Forms.Button(); - this.tbPhone2 = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // label1 - // - this.label1.Location = new System.Drawing.Point(0, 8); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(80, 16); - this.label1.TabIndex = 0; - this.label1.Text = "Locked by:"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // label2 - // - this.label2.Location = new System.Drawing.Point(8, 40); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(72, 16); - this.label2.TabIndex = 1; - this.label2.Text = "Location:"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // label3 - // - this.label3.Location = new System.Drawing.Point(0, 72); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(80, 16); - this.label3.TabIndex = 2; - this.label3.Text = "Phone:"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // label4 - // - this.label4.Location = new System.Drawing.Point(0, 136); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(80, 16); - this.label4.TabIndex = 3; - this.label4.Text = "Information:"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // label5 - // - this.label5.Location = new System.Drawing.Point(0, 168); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(80, 16); - this.label5.TabIndex = 4; - this.label5.Text = "Lock Created:"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // tbUserName - // - this.tbUserName.BackColor = System.Drawing.SystemColors.Control; - this.tbUserName.Location = new System.Drawing.Point(96, 8); - this.tbUserName.Name = "tbUserName"; - this.tbUserName.ReadOnly = true; - this.tbUserName.Size = new System.Drawing.Size(304, 20); - this.tbUserName.TabIndex = 5; - this.tbUserName.Text = ""; - // - // tbLoc - // - this.tbLoc.BackColor = System.Drawing.SystemColors.Control; - this.tbLoc.Location = new System.Drawing.Point(96, 40); - this.tbLoc.Name = "tbLoc"; - this.tbLoc.ReadOnly = true; - this.tbLoc.Size = new System.Drawing.Size(304, 20); - this.tbLoc.TabIndex = 6; - this.tbLoc.Text = ""; - // - // tbPhone1 - // - this.tbPhone1.BackColor = System.Drawing.SystemColors.Control; - this.tbPhone1.Location = new System.Drawing.Point(96, 72); - this.tbPhone1.Name = "tbPhone1"; - this.tbPhone1.ReadOnly = true; - this.tbPhone1.Size = new System.Drawing.Size(168, 20); - this.tbPhone1.TabIndex = 7; - this.tbPhone1.Text = ""; - // - // tbWhy - // - this.tbWhy.BackColor = System.Drawing.SystemColors.Control; - this.tbWhy.Location = new System.Drawing.Point(96, 136); - this.tbWhy.Name = "tbWhy"; - this.tbWhy.ReadOnly = true; - this.tbWhy.Size = new System.Drawing.Size(304, 20); - this.tbWhy.TabIndex = 8; - this.tbWhy.Text = ""; - // - // tbWhyDT - // - this.tbWhyDT.BackColor = System.Drawing.SystemColors.Control; - this.tbWhyDT.Location = new System.Drawing.Point(96, 168); - this.tbWhyDT.Name = "tbWhyDT"; - this.tbWhyDT.ReadOnly = true; - this.tbWhyDT.Size = new System.Drawing.Size(208, 20); - this.tbWhyDT.TabIndex = 9; - this.tbWhyDT.Text = ""; - // - // button1 - // - this.button1.DialogResult = System.Windows.Forms.DialogResult.OK; - this.button1.Location = new System.Drawing.Point(168, 200); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(72, 24); - this.button1.TabIndex = 10; - this.button1.Text = "OK"; - // - // tbPhone2 - // - this.tbPhone2.Location = new System.Drawing.Point(96, 104); - this.tbPhone2.Name = "tbPhone2"; - this.tbPhone2.ReadOnly = true; - this.tbPhone2.Size = new System.Drawing.Size(168, 20); - this.tbPhone2.TabIndex = 0; - this.tbPhone2.Text = ""; - // - // LockInfoDlg - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(424, 230); - this.Controls.Add(this.tbPhone2); - this.Controls.Add(this.button1); - this.Controls.Add(this.tbWhyDT); - this.Controls.Add(this.tbWhy); - this.Controls.Add(this.tbPhone1); - this.Controls.Add(this.tbLoc); - this.Controls.Add(this.tbUserName); - this.Controls.Add(this.label5); - this.Controls.Add(this.label4); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "LockInfoDlg"; - this.Text = "Form1"; - this.ResumeLayout(false); - - } - #endregion - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockInfoDlg.resx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockInfoDlg.resx deleted file mode 100644 index 9434a2c0..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockInfoDlg.resx +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - False - - - LockInfoDlg - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - Private - - - - AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx - dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx - F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3 - d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx - dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3 - F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX - cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3 - F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX - cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockRlsDlg.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockRlsDlg.cs deleted file mode 100644 index 5ff40d4a..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockRlsDlg.cs +++ /dev/null @@ -1,202 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: LockRlsDlg.cs $ $Revision: 2 $ - * $Author: Jsj $ $Date: 8/17/04 12:54p $ - * - * $History: LockRlsDlg.cs $ - * - * ***************** Version 2 ***************** - * User: Jsj Date: 8/17/04 Time: 12:54p - * Updated in $/LibSource/VENetwork - * Needed to assign an Icon to the form. It was bombing with a resource - * error otherwise. - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:44a - * Created in $/LibSource/VENetwork - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace VENetwork -{ - /// - /// Allows user to Release Locks on exit. - /// - public class LockRlsDlg : System.Windows.Forms.Form - { - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.CheckBox cbSystem; - private System.Windows.Forms.CheckBox cbPlant; - private System.Windows.Forms.CheckBox cbProcSet; - private System.ComponentModel.Container components = null; - private VELock LSystem; - private VELock LPlant; - private VELock LProcSet; - - public LockRlsDlg(VELock lsys, VELock lplt, VELock lps) - { - LSystem = lsys; - LPlant = lplt; - LProcSet = lps; - - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - // Set checkboxes depending on whether a lock exists. Note - // that the input locks will be null if not locked by this user. - if (lsys != null) - cbSystem.Checked = true; - else - cbSystem.Enabled = false; - - if (lplt != null) - { - cbPlant.Text = lplt.Path.Substring(0,lplt.Path.LastIndexOf("\\")); - cbPlant.Checked = true; - } - else - cbPlant.Enabled = false; - if (lps != null) - { - cbProcSet.Text = lps.Path.Substring(0,lps.Path.LastIndexOf("\\")); - cbProcSet.Checked = true; - } - else - cbProcSet.Enabled = false; - - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(LockRlsDlg)); - this.label1 = new System.Windows.Forms.Label(); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.cbSystem = new System.Windows.Forms.CheckBox(); - this.cbPlant = new System.Windows.Forms.CheckBox(); - this.cbProcSet = new System.Windows.Forms.CheckBox(); - this.SuspendLayout(); - // - // label1 - // - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.label1.Location = new System.Drawing.Point(29, 9); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(451, 56); - this.label1.TabIndex = 0; - this.label1.Text = "The Following Locks Have Been Detected. Please Click The Appropriate Box To Rele" + - "ase The Lock."; - // - // btnOK - // - this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnOK.Location = new System.Drawing.Point(173, 194); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(77, 28); - this.btnOK.TabIndex = 1; - this.btnOK.Text = "OK"; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnCancel.Location = new System.Drawing.Point(288, 194); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(77, 28); - this.btnCancel.TabIndex = 2; - this.btnCancel.Text = "Cancel"; - // - // cbSystem - // - this.cbSystem.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.cbSystem.Location = new System.Drawing.Point(86, 74); - this.cbSystem.Name = "cbSystem"; - this.cbSystem.Size = new System.Drawing.Size(375, 28); - this.cbSystem.TabIndex = 3; - this.cbSystem.Text = "System"; - // - // cbPlant - // - this.cbPlant.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.cbPlant.Location = new System.Drawing.Point(86, 111); - this.cbPlant.Name = "cbPlant"; - this.cbPlant.Size = new System.Drawing.Size(375, 27); - this.cbPlant.TabIndex = 4; - this.cbPlant.Text = "Plant"; - // - // cbProcSet - // - this.cbProcSet.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.cbProcSet.Location = new System.Drawing.Point(86, 148); - this.cbProcSet.Name = "cbProcSet"; - this.cbProcSet.Size = new System.Drawing.Size(375, 27); - this.cbProcSet.TabIndex = 5; - this.cbProcSet.Text = "Data"; - // - // LockRlsDlg - // - this.AccessibleRole = System.Windows.Forms.AccessibleRole.TitleBar; - this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); - this.ClientSize = new System.Drawing.Size(537, 228); - this.Controls.Add(this.cbProcSet); - this.Controls.Add(this.cbPlant); - this.Controls.Add(this.cbSystem); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnOK); - this.Controls.Add(this.label1); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "LockRlsDlg"; - this.Text = "Release Locks"; - this.ResumeLayout(false); - - } - #endregion - - private void btnOK_Click(object sender, System.EventArgs e) - { - // unlock any where the check was removed (kind of backwards but duplicates - // functionality from vfw. - if (this.cbSystem.Visible && this.cbSystem.Enabled && !this.cbSystem.Checked) - LSystem.UnLock(false); - if (this.cbPlant.Visible && this.cbPlant.Enabled && !this.cbPlant.Checked) - LPlant.UnLock(false); - if (this.cbProcSet.Visible && this.cbProcSet.Enabled && !this.cbProcSet.Checked) - LProcSet.UnLock(false); - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockRlsDlg.resx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockRlsDlg.resx deleted file mode 100644 index cd6d2117..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/LockRlsDlg.resx +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - LockRlsDlg - - - True - - - 80 - - - True - - - Private - - - - AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx - dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx - F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3 - d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx - dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3 - F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX - cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3 - F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX - cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/MonUsrDlg.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/MonUsrDlg.cs deleted file mode 100644 index f2179b42..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/MonUsrDlg.cs +++ /dev/null @@ -1,122 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: MonUsrDlg.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 7/27/04 8:44a $ - * - * $History: MonUsrDlg.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:44a - * Created in $/LibSource/VENetwork - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using Utils; - -namespace VENetwork -{ - /// - /// Summary description for MonUsrDlg. - /// - public class MonUsrDlg : System.Windows.Forms.Form - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private System.Windows.Forms.ListView lvUsers; - private System.Windows.Forms.Button button1; - private string [] SLockTypes = {"System", "Plant", "Procedure Set"}; - public MonUsrDlg(ArrayList usr, int ilb) - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - this.Text = SLockTypes[ilb] + " : Monitor Users"; - DoListView(usr); - } - - private void DoListView(ArrayList usrlst) - { - ListViewItem item=null; - lvUsers.Columns.Add("User Network ID",100, HorizontalAlignment.Left); - lvUsers.Columns.Add("User Phone",100, HorizontalAlignment.Left); - lvUsers.Columns.Add("User Name",200, HorizontalAlignment.Left); - - for (int i=0; i - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(MonUsrDlg)); - this.lvUsers = new System.Windows.Forms.ListView(); - this.button1 = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // lvUsers - // - this.lvUsers.Location = new System.Drawing.Point(0, 0); - this.lvUsers.Name = "lvUsers"; - this.lvUsers.Size = new System.Drawing.Size(400, 224); - this.lvUsers.TabIndex = 0; - this.lvUsers.View = System.Windows.Forms.View.Details; - // - // button1 - // - this.button1.DialogResult = System.Windows.Forms.DialogResult.OK; - this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.button1.Location = new System.Drawing.Point(176, 232); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(64, 24); - this.button1.TabIndex = 1; - this.button1.Text = "OK"; - // - // MonUsrDlg - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(400, 266); - this.Controls.Add(this.button1); - this.Controls.Add(this.lvUsers); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "MonUsrDlg"; - this.Text = "Monitor Users"; - this.ResumeLayout(false); - - } - #endregion - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/MonUsrDlg.resx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/MonUsrDlg.resx deleted file mode 100644 index 464ccbca..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/MonUsrDlg.resx +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - MonUsrDlg - - - Private - - - - AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx - dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx - F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3 - d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx - dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3 - F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX - cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3 - F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX - cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/VEConn.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/VEConn.cs deleted file mode 100644 index 243d21c2..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/VEConn.cs +++ /dev/null @@ -1,576 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: VEConn.cs $ $Revision: 3 $ - * $Author: Kathy $ $Date: 1/31/05 11:04a $ - * - * $History: VEConn.cs $ - * - * ***************** Version 3 ***************** - * User: Kathy Date: 1/31/05 Time: 11:04a - * Updated in $/LibSource/VENetwork - * Fix B2005-005 (connection & delete directory errors) - * - * ***************** Version 2 ***************** - * User: Jsj Date: 11/12/04 Time: 10:34a - * Updated in $/LibSource/VENetwork - * Save user's Temp dir path - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:44a - * Created in $/LibSource/VENetwork - *********************************************************************************************/ - -using System; -using System.IO; -using System.Collections; -using System.Windows; -using System.Windows.Forms; -using System.ComponentModel; -using System.Text; -using Utils; -using VlnStatus; - -namespace VENetwork -{ - // The following enum is used to set/check the mode for which the dat file connection - // was made (i.e. when the file was opened. - // NWModes: - // exclusive, hold, write - public enum NWModes {XCLUDMODE=1, HOLDMODE=2, WRITMODE=3}; - - // This class manages the connection options for multi-user support, i.e. creation, - // connecting to and removing dat files at the system, plant and procedure set levels. - public class VEConnection - { - private VELock m_Lock; - private string m_Path; - private string CurDir; - private long m_Position; - - private NWModes m_Mode; - private FileStream datFs; - private UserRunTime usrRunTime; - const int ProcessRecLen = 140; - private VETempFile TempFile; - - public VEConnection(VELock ilck, UserRunTime iusrRT) - { - TempFile = null; - datFs = null; - m_Mode = 0; - m_Lock = ilck; - usrRunTime = iusrRT; - SetUserTempDirPath(); - if (m_Lock.LockType == LockTypes.None) return; - string tmp_path = ilck.Path; - CurDir = tmp_path.Substring(0,tmp_path.LastIndexOf("\\")+1); // save directory - // path is same as lock file except extension is dat not lck. - m_Path = tmp_path.Substring(0,tmp_path.Length-3) + "dat"; - } - - ~ VEConnection() - { - // update the record as inactive & close the file (this gets called on - // exit of the program, rather than changing active data in the tree view). - Exit(); - } - - public int GetVfwMode() - { - //given the current mode, get the required filemode to send back to - // vfw. The values were taken from Borland include file - // define BASEMODE (O_NOINHERIT|O_NOCRITERR) - // 0x80 0x2000 - // define XCLUDMODE (BASEMODE|O_COMMIT|O_CREAT|O_DENYALL|O_RDWR) - // 0x4000 0x0100 0x10 0x4 - // define HOLDMODE (BASEMODE|O_DENYNONE|O_RDONLY) - // 0x40 0x1 - // define WRITMODE (BASEMODE|O_COMMIT|O_DENYWRITE|O_RDWR) - // 0x4000 0x20 0x4 - int BASEMODE = 0x80|0x2000; - if(m_Mode==NWModes.HOLDMODE) - return (BASEMODE|0x40|0x1); - else if (m_Mode==NWModes.XCLUDMODE) - return (BASEMODE|0x4000|0x0100|0x10|0x4); - else if (m_Mode==NWModes.WRITMODE) - return (BASEMODE|0x4000|0x20|0x4); - else - return (0); - } - - // if file open is done from vfw, need to open file using that mode, - // get mode from input. - public NWModes GetModeFromVfwMode(int vfwMode) - { - int BASEMODE = 0x80|0x2000; - if (vfwMode==(BASEMODE|0x40|0x1)) - return NWModes.HOLDMODE; - else if (vfwMode==(BASEMODE|0x4000|0x0100|0x10|0x4)) - return NWModes.XCLUDMODE; - else if (vfwMode==(BASEMODE|0x4000|0x20|0x4)) - return NWModes.WRITMODE; - return (NWModes) 0; - } - - [Description("File offset")]public long FileOffset - { - get{return m_Position;} - } - - // reads the dat file for this level, and creates a list of ACTIVE users, i.e. - // those users whose record's status is set to active. - public ArrayList GetUsers() - { - ArrayList retval = new ArrayList(); - if (datFs!=null) - { - // read records in the .dat file and see if any are active. - long howbig = datFs.Length; - int howmany = (int)(howbig/ProcessRecLen) - 1; // the first record is a dummy - for (int rec=1;rec<=howmany;rec++) - { - UserData usrd = new UserData(datFs, rec); - if (usrd.UserStatus==(byte)Utils.UserCStatus.PRACTIVE) - retval.Add(usrd); - else - usrd = null; - } - } - return retval; - } - - // display the monitor users dialog - public void MonitorUsers(int lbstr) - { - ArrayList al = GetUsers(); - // temporarily do separate dialog. eventually, this will be a pane with a list - // on the main window - MonUsrDlg dlg = new MonUsrDlg(al,lbstr); - dlg.ShowDialog(); - } - - // determines whether there are active users, other than myself, currently in this - // level of data - public bool HasActiveUsers() - { - int cntactive=0; - // read records in the .dat file and see if any are active. - long howbig = datFs.Length; - int howmany = (int)(howbig/ProcessRecLen) - 1; // the first record is a dummy - for (int rec=1;rec<=howmany;rec++) - { - UserData usrd = new UserData(datFs, rec); - // if active record and it does not match my user name, there is another - // user in. return true. - if (usrd.UserStatus==(byte)Utils.UserCStatus.PRACTIVE) - { - cntactive++; - if (usrd.UserName.ToUpper()!=usrRunTime.myUserData.UserName.ToUpper())return true; - } - } - // if there is more than one active user that is current user, i.e. multiple - // sessions, return true - if (cntactive>1)return true; - return false; - } - - // This method will attempt to open the *process.dat file in a read/write mode so - // that a process record can be added. - private bool OpenRW() - { - bool retval=true; - VlnSpinner spn=null; - try - { - spn = new VlnSpinner(2,50,"- Opening Process File ",m_Path,true,true,false); - datFs=null; - while(spn.SpinnerWait(datFs!=null)) - { - datFs = new FileStream(m_Path,FileMode.Open,FileAccess.ReadWrite,FileShare.Read); - } - // take this chance to do some cleanup in the procedure set directory - if (m_Lock.LockType == LockTypes.ProcSet) DoProcCleanup(); - datFs.Seek(0L,SeekOrigin.End); - m_Position = datFs.Position; - usrRunTime.myUserData.UserStatus= (byte)Utils.UserCStatus.PRACTIVE; - usrRunTime.myUserData.Write(datFs); - m_Mode=NWModes.WRITMODE; - datFs.Flush(); - } - catch (Exception e) - { - //MessageBox.Show(e.Message,"Error on connecting to data - no lock"); - retval = false; - } - spn.Dispose(); - return retval; - } - - // used upon expand/select an item in tree - open the connection to the - // the dat file. The reenter flag is used when the user is already in at this - // level, but a change in lock state may have occurred. - public bool Enter(bool reenter) - { - // for locktype.none, this level has no lock - so just say that - // enter succeeded. - if (m_Lock.LockType == LockTypes.None) return true; - - bool attchtemp = false; - bool success=false; - - VlnSpinner spin = new VlnSpinner(2,10,"- Connecting to Data ",m_Path,true,true,false); - while( spin.SpinnerWait( false ) ) // spin until break or return - { - // if not reenter refresh the lock. if reenter, the locking logic refreshed - // the lock. - if (!reenter)m_Lock.Refresh(); - - // if it's locked, see if it is locked by me and make sure there isn't an - // active connection by another user or by myself from another window or network - // process - if (m_Lock.LockStatus == Status.Locked || m_Lock.LockStatus == Status.LockPending) - { - // if this is a procedure set lock, also check that the correct temp - // file is attached, i.e. the one that is from the locking process. - if(m_Lock.LockType==LockTypes.ProcSet) - { - if (TempFile==null)TempFile = new VETempFile(this.CurDir); - attchtemp=TempFile.AttachSpecificTemp(usrRunTime.myUserData.UserNetworkID,m_Lock.UserProcess); //usrRunTime.myUserData.UserProcess); - // if failed to connect, but a lock was pending, reset the lock type to - // locked by other. - if(m_Lock.LockStatus == Status.LockPending && !attchtemp) m_Lock.LockStatus = Status.LockedByOther; - } - if (m_Lock.LockType != LockTypes.ProcSet || attchtemp) - { - // try to get exclusive access to it (if I don't already have it) - // first step is to exit from current connect - if (m_Mode !=0 && m_Mode != NWModes.XCLUDMODE) Exit(); - - // try to establish a new exclusive connection. If a new exclusive connection - // cannot be made, then a connection must exist from another process (either myself, - // or another user if pending lock). - // If I'm other user, this should be treated like a nolock for me, i.e. I can - // view data but not modify it. - if (m_Mode == 0) - { - try - { - datFs = new FileStream(m_Path,FileMode.Create,FileAccess.ReadWrite,FileShare.None); - if(m_Lock.LockType == LockTypes.ProcSet) - { // these files are only used at the procedure set level - DeleteFiles("*.own",0); // Cleanup ownership files - DeleteFiles("*.wrq",0); // Cleanup write request files - } - usrRunTime.myUserData.UserProcess=m_Lock.UserProcess; - // truncate file - datFs.SetLength(0L); - m_Mode=NWModes.XCLUDMODE; - // write out a dummy record with the status set to inactive. - usrRunTime.myUserData.UserStatus= (byte)Utils.UserCStatus.PRINACTIVE; - usrRunTime.myUserData.Write(datFs); - m_Position = datFs.Position; - usrRunTime.myUserData.UserStatus= (byte)Utils.UserCStatus.PRACTIVE; - usrRunTime.myUserData.Write(datFs); - success=true; - m_Lock.LockStatus = Status.Locked; // in case it was pending - datFs.Flush(); - break; - } - // if an ioexception occurs, the connect is open either by me - // or another user. Open a non-exlusive connection. - catch (IOException) - { - // if open by another user, reopen as it was. Else return for - // view only mode. - spin.Dispose(); - bool opn = OpenRW(); - if (!opn) - { - m_Lock.LockStatus = Status.LockedByOther; - return false; - } - datFs.Close(); - datFs = new FileStream(m_Path,FileMode.Open,FileAccess.Read,FileShare.ReadWrite); - success=true; - m_Mode=NWModes.HOLDMODE; - break; - } - catch (Exception e) - { - spin.Dispose(); - m_Lock.LockStatus = Status.LockedByOther; - MessageBox.Show(e.Message, "Connecting to data failed - lock exists."); - return false; - } - } - else - { - m_Lock.LockStatus = Status.Locked; - success=true; - break; // already connected. - } - } - else - { - success = false; - break; - } - } - - // Handle case where there is no lock or the current user is the lock owner, - // but they're already connected from another run (either windows session or - // network session) - if (m_Lock.LockStatus == Status.NoLock) - { - // check if already connected, i.e. a filestream exists, or that I'm not - // changing modes (the mode change occurs when going from locked to unlocked) - if (datFs != null && this.m_Mode!=NWModes.XCLUDMODE) - { - success=true; - break; - } - else - { - // if at the procedure set level, need to connect to a temp directory - // as well. - usrRunTime.myUserData.UserProcess=""; - if(m_Lock.LockType==LockTypes.ProcSet && TempFile==null) - { - TempFile = new VETempFile(this.CurDir); - bool got_tmp = TempFile.FindAvailableTempDir(usrRunTime.myUserData.UserNetworkID); - if (got_tmp==false) - { - TempFile = null; - spin.Dispose(); - return false; - } - usrRunTime.myUserData.UserProcess=TempFile.TempNum; - } - // try to get exclusive access to dat file (see following commentary) - try - { - // if this was open with exclusive, exit (this would be the - // case where an unlock occurred. - if (reenter || m_Mode == NWModes.XCLUDMODE) Exit(); - - // if can't get exclusive, an exception is thrown. just continue - // on from there, i.e. the file is being used. - // if we get exclusive access, cleanup the procset directory (if - // this is a procset level enter) and then clean out the dat file - datFs = new FileStream(m_Path,FileMode.Create,FileAccess.ReadWrite,FileShare.None); - if(m_Lock.LockType == LockTypes.ProcSet) - { // these files are only used at the procedure set level - DeleteFiles("*.own",0); // Cleanup ownership files - DeleteFiles("*.wrq",0); // Cleanup write request files - } - - // truncate file - datFs.SetLength(0L); - m_Mode=NWModes.XCLUDMODE; - // write out a dummy record with the status set to inactive. - usrRunTime.myUserData.UserStatus= (byte)Utils.UserCStatus.PRINACTIVE; - usrRunTime.myUserData.Write(datFs); - datFs.Close(); - } - - // if it is an IOException, it means the user could not get exclusive access, - // just continue on, opening with read/write access to add process record - // and then reopen in hold mode. - catch (IOException) - { - } - - // Catch a real error. - catch (Exception e) - { - MessageBox.Show(e.Message, "connect->enter failed"); - spin.Dispose(); - return false; - } - - // Attempt to open the file in Read/write mode to add an active process record - bool opn = OpenRW(); - if (!opn)return false; - - // now close the process file & open in hold mode. - datFs.Close(); - datFs = new FileStream(m_Path,FileMode.Open,FileAccess.Read,FileShare.ReadWrite); - success=true; - m_Mode=NWModes.HOLDMODE; - break; - } - } - if (m_Lock.LockStatus == Status.LockedByOther) - { - success = false; - if (datFs!=null)Exit(); - break; - } - } - spin.Dispose(); // end of spinnerwait while loop - - // if successful connection & at the procedure set level, write out number - // of bytes to the temp directory file (temps\userid_.p##) to flag which - // connection this is associated with. Also, if this is a reenter (locked state change) - // then the tempfile is already the correct length, don't write out bytes. - if (success==true && m_Lock.LockType==LockTypes.ProcSet && TempFile!=null && !reenter) - { - TempFile.WriteBytes((int)(m_Position/140)); - } - SetUserTempDirPath(); - return success; - } - - // if len is !0, try to delete files of the specified length. - // zero length files are normally in transition and will be - // deleted by their owners. - public void DeleteFiles(string tmp, int len) - { - DirectoryInfo di = new DirectoryInfo(Directory.GetCurrentDirectory()); - FileInfo [] fis = di.GetFiles(tmp); - foreach (FileInfo fi in fis) - { - if (len==0 || len==fi.Length) fi.Delete(); - } - } - - // cleanup temp files and active record flags in the dat files. - private void DoProcCleanup() - { - // read records in the .dat file and do check for those that are active. - long howbig = datFs.Length; - int howmany = (int)(howbig/ProcessRecLen); - for (int rec=1;rec - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/VENetwork.sln b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/VENetwork.sln deleted file mode 100644 index 72f727b3..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/VENetwork.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VENetwork", "VENetwork.csproj", "{01986CD0-4C52-4592-881D-0502FCF55A46}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {01986CD0-4C52-4592-881D-0502FCF55A46}.Debug.ActiveCfg = Debug|.NET - {01986CD0-4C52-4592-881D-0502FCF55A46}.Debug.Build.0 = Debug|.NET - {01986CD0-4C52-4592-881D-0502FCF55A46}.Release.ActiveCfg = Release|.NET - {01986CD0-4C52-4592-881D-0502FCF55A46}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/VETempFile.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/VETempFile.cs deleted file mode 100644 index 8f5ca56e..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VENetwork/VETempFile.cs +++ /dev/null @@ -1,199 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: VETempFile.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 7/27/04 8:45a $ - * - * $History: VETempFile.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:45a - * Created in $/LibSource/VENetwork - *********************************************************************************************/ - -using System; -using System.IO; -using System.Windows.Forms; - - -namespace VENetwork -{ - // this class manages the temps directory for multi-user support in ve-proms. - // The temps directory is used to handle a user's temporary files in support of - // printing, etc. - public class VETempFile - { - public string TemporaryDirectoryName; - private string TemporaryFileName; - public string TempNum; - FileStream tmpFs; - private string CurrentDir; - - public VETempFile(string cd) - { - CurrentDir = cd; - tmpFs=null; - } - - ~ VETempFile() - { - CloseTempProc(); - } - - // Converts the userid, num & PorD (characters 'P' or 'D') into a file- - // name to be used for temporary file support. This creates the file- - // name. The userid is extended to 8 characters with '_'s. - public string MakeTempName(string userid, string num, char PorD) - { - // first, make the temp directory, i.e. temps, if it doesn't - // exist. - DirectoryInfo di = new DirectoryInfo(CurrentDir + "temps"); - if (!di.Exists) di.Create(); - string tmpuid = userid.PadRight(8,'_'); - string tpath = "temps" + "\\" + tmpuid + "." + PorD.ToString() + num; - return tpath; - } - - // This method truncates the temp file (user___.P##) and then closes it. - public void CloseTempProc() - { - if(tmpFs!=null) - { - try - { - // if called from a destructor, the file may have been closed - reopen - // it if we can't write - if (tmpFs.CanWrite==false) - { - tmpFs=null; - tmpFs = new FileStream(TemporaryFileName,FileMode.OpenOrCreate,FileAccess.ReadWrite,FileShare.None); - } - tmpFs.Seek(0L,SeekOrigin.Begin); - tmpFs.SetLength(0L); // truncate the file - tmpFs.Close(); - tmpFs=null; - TemporaryDirectoryName=null; - } - catch (Exception e) - { - MessageBox.Show(e.Message,this.TemporaryDirectoryName); - } - } - } - - // make all subdirectories, if not exist - private void MakeAllNecessaryDirectories(string path) - { - if (Directory.Exists(CurrentDir + path)) return; - - // Create the directory, and any subdirectories - DirectoryInfo di = Directory.CreateDirectory(CurrentDir + path); - } - - // sets class variables based on input. - private void SetUpTempDir(string userid, string num) - { - string TempPath = MakeTempName(userid,num,'D'); - MakeAllNecessaryDirectories(TempPath); - TemporaryDirectoryName = TempPath + "\\"; - } - - // This method attempts to attach to the specified temp file. - // Userid and num are combined to create a process name and - // TempPathDirectory. If the file is successfully opened and - // a connection is established, a byte count matching the process - // number is written to the file and the file is held open. (This - // byte count is actually written in the connection logic, - // veconn.cs, after a connection is successfully made.) - public bool AttachSpecificTemp(string userid, string num) - { - // if already open, close. - CloseTempProc(); - string pname = CurrentDir + MakeTempName(userid,num,'P'); - - // check to see if this user can use the file, i.e. open - // exclusively. - try - { - tmpFs = new FileStream(pname,FileMode.OpenOrCreate,FileAccess.ReadWrite,FileShare.None); - } - catch - { - return false; - } - TemporaryFileName = pname; - TempNum = num; - SetUpTempDir(userid,num); - return true; - } - - // if len is !0, try to delete files of the specified length. - // zero length files are normally in transition and will be - // deleted by their owners. - public void DeleteFiles(string tmp, int len) - { - DirectoryInfo di = new DirectoryInfo(Directory.GetCurrentDirectory()); - FileInfo [] fis = di.GetFiles(tmp); - foreach (FileInfo fi in fis) - { - if (len==0 || len==fi.Length) fi.Delete(); - } - } - - // find the next available temp directory for a given userid. - public bool FindAvailableTempDir(string userid) - { - // first look for existing temp files for this user to see if any - // can be used. - int i; - string ptmp = MakeTempName(userid,"*",'P'); // create a template - - // check to see if any exist. - DirectoryInfo di = new DirectoryInfo(CurrentDir); - FileInfo [] fis = di.GetFiles(ptmp); - for (i=0;i0) - { - // this was left from a reboot or something. - // delete ownership and wrq files of the - // specified size. Check to see if it is - // consistent with the process file first. - DeleteFiles("*.own",(int)fi.Length); - DeleteFiles("*.wrq",(int)fi.Length); - } - return true; - } - } - fis = null; - - // Couldn't use an existing one, find a new one. - for (i=0;i<99;i++) - if (AttachSpecificTemp(userid,i.ToString("d2"))) return true; - - // if the user got this far, something's wrong - report error & exit. - MessageBox.Show("Too many temporary process files for user.","VE-PROMS error"); - return false; - } - - // this method writes out the requested number of bytes to the file. - public void WriteBytes(int num) - { - if (tmpFs != null) - { - while (num>0) - { - tmpFs.WriteByte((byte)'x'); - num--; - } - tmpFs.Flush(); - - } - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ARProperties.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ARProperties.cs deleted file mode 100644 index ff842961..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ARProperties.cs +++ /dev/null @@ -1,549 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ARProperties.cs $ $Revision: 2 $ - * $Author: Jsj $ $Date: 8/20/04 4:45p $ - * - * $History: ARProperties.cs $ - * - * ***************** Version 2 ***************** - * User: Jsj Date: 8/20/04 Time: 4:45p - * Updated in $/LibSource/VEObject - * fixed cancel of archive selected procedures - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:52a - * Created in $/LibSource/VEObject - *********************************************************************************************/ - -using System; -using System.IO; -using System.Drawing; -using System.Collections; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Windows.Forms; -using System.Text; -using System.Data; -using VDB_Set; -using Utils; - - -namespace VEObject -{ - /// - /// NOTE: cmbType (the combo box that contains the document types) must match - /// the order of document types given in the ArchiveTypeOptions for this dialog - /// to work correctly - /// - - - public class ARProperties : System.Windows.Forms.Form - { - private System.Windows.Forms.PropertyGrid myPropertyGrid; - private System.Windows.Forms.ComboBox cmbType; - private System.Windows.Forms.Label lblType; - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Button btnApply; - private VEO_Base _ParentObj; - private VEO_Base _CurObj; - private bool isnew; - private bool glbCancel; - private bool zipInCurProcSet; - private bool hasInvalidEntry; - private string strCurZipPath; - private string strZipFileName; - private string strFilesToArchive; - private string strZipFileExcludeList; - private string strProcSetDir; - - private ZipFuncs ZipFile; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public ARProperties(Object parent, Object curobj) - { - // - // Required for Windows Form Designer support - // - _ParentObj = (VEO_Base) parent; - _CurObj = (VEO_Base) curobj; - VEO_Archive tmpArc = (VEO_Archive)curobj; - if (tmpArc.isnew == true) - isnew=true; - else - isnew=false; - - InitializeComponent(); - this.myPropertyGrid.SelectedObject=curobj; - strCurZipPath = _ParentObj._Location; - strProcSetDir = _ParentObj._Location; - // If new, combo box should have 'Full' - this.cmbType.Visible=false; - this.btnApply.Enabled=false; - glbCancel = false; - zipInCurProcSet = true; - if (isnew == true) - { - this.btnApply.Visible = false; - SetupNewFileName(); - ZipFile = new ZipFuncs(); - // Since this a new Zip File, don't assign ZipFile with the path/name, - // Title, or Comment. These values can be changed prior to the - // actual creation of the Zip file. - } - else - { - VEO_Archive arc = (VEO_Archive)curobj; - ZipFile = new ZipFuncs(arc._Location); - GetCommentInformation(); - this.cmbType.SelectedIndex = (int) arc._ArchiveType; - } - } - - private void SetupNewFileName() - { - int i=0; - StringBuilder newname = new StringBuilder(); - - VEO_Archive arc = (VEO_Archive) _CurObj; - // The old VE-PROMS logic would create SOURCE.ZIP for - // the first archive, then ARCH_xxx.ZIP for the rest. - // Now we will just create ARCH_xxx.ZIP - while(i==0 || arc.Exists(strCurZipPath + "\\" + newname.ToString())) - { - newname.Remove(0,newname.Length); - newname.Append("ARCH_"); - newname.Append(i.ToString("d3")); - newname.Append(".ZIP"); - i++; - } - strZipFileName = newname.ToString(); - _CurObj._Location = strCurZipPath + "\\" + strZipFileName; - _CurObj._Title = "New Archive " + newname.ToString(); - this.myPropertyGrid.SelectedObject=_CurObj; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ARProperties)); - this.myPropertyGrid = new System.Windows.Forms.PropertyGrid(); - this.cmbType = new System.Windows.Forms.ComboBox(); - this.lblType = new System.Windows.Forms.Label(); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.btnApply = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // myPropertyGrid - // - this.myPropertyGrid.CommandsVisibleIfAvailable = true; - this.myPropertyGrid.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.myPropertyGrid.HelpVisible = false; - this.myPropertyGrid.LargeButtons = false; - this.myPropertyGrid.LineColor = System.Drawing.SystemColors.ScrollBar; - this.myPropertyGrid.Location = new System.Drawing.Point(0, 48); - this.myPropertyGrid.Name = "myPropertyGrid"; - this.myPropertyGrid.Size = new System.Drawing.Size(736, 112); - this.myPropertyGrid.TabIndex = 2; - this.myPropertyGrid.Text = "Properties"; - this.myPropertyGrid.ToolbarVisible = false; - this.myPropertyGrid.ViewBackColor = System.Drawing.SystemColors.Window; - this.myPropertyGrid.ViewForeColor = System.Drawing.SystemColors.WindowText; - this.myPropertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.myPropertyGrid_PropertyValueChanged); - // - // cmbType - // - this.cmbType.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.cmbType.Items.AddRange(new object[] { - "Full", - "Partial"}); - this.cmbType.Location = new System.Drawing.Point(104, 0); - this.cmbType.Name = "cmbType"; - this.cmbType.Size = new System.Drawing.Size(208, 24); - this.cmbType.TabIndex = 3; - this.cmbType.SelectedIndexChanged += new System.EventHandler(this.cmbType_SelectedIndexChanged); - // - // lblType - // - this.lblType.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblType.Location = new System.Drawing.Point(0, 0); - this.lblType.Name = "lblType"; - this.lblType.Size = new System.Drawing.Size(96, 24); - this.lblType.TabIndex = 4; - this.lblType.Text = "Archive Type:"; - this.lblType.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // btnOK - // - this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnOK.Location = new System.Drawing.Point(432, 200); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(64, 24); - this.btnOK.TabIndex = 8; - this.btnOK.Text = "OK"; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnCancel.Location = new System.Drawing.Point(512, 200); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(64, 24); - this.btnCancel.TabIndex = 9; - this.btnCancel.Text = "Cancel"; - this.btnCancel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // btnApply - // - this.btnApply.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnApply.Location = new System.Drawing.Point(592, 200); - this.btnApply.Name = "btnApply"; - this.btnApply.Size = new System.Drawing.Size(56, 24); - this.btnApply.TabIndex = 10; - this.btnApply.Text = "Apply"; - this.btnApply.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnApply.Click += new System.EventHandler(this.btnApply_Click); - // - // ARProperties - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.CausesValidation = false; - this.ClientSize = new System.Drawing.Size(736, 246); - this.Controls.Add(this.btnApply); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnOK); - this.Controls.Add(this.lblType); - this.Controls.Add(this.cmbType); - this.Controls.Add(this.myPropertyGrid); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "ARProperties"; - this.Text = "Archive Properties"; - this.ResumeLayout(false); - - } - #endregion - - private void cmbType_SelectedIndexChanged(object sender, System.EventArgs e) - { - } - - // save was clicked, use the objects save methods. - private void btnOK_Click(object sender, System.EventArgs e) - { - btnApply_Click(sender,e); - if (hasInvalidEntry) - { - DialogResult = DialogResult.None; - return; // keep the dialog open - } - if (!glbCancel) - DialogResult=DialogResult.OK; - else - DialogResult=DialogResult.Cancel; - this.Close(); - } - - // Apply changes - private void btnApply_Click(object sender, System.EventArgs e) - { - bool success = true; - - if (!ValidatePropertyEntries()) // check the entry fields - { - return; // has invalid data in a property field - } - - if (isnew) - { - if(_ParentObj==null) - { - DialogResult=DialogResult.Cancel; - return; - } - // generate new zip file - success = GenerateArchiveFile(); - if (success) - { - // save the property values - success=_CurObj.Write(); - } - } - else // update existing ZipFile's Comment Field - { - success=_CurObj.Write(); - if (success) - success = AddCommentInformation(); - } - // if not successful with the archive, set the cancel - // flag so that a false tree item does not appear. - // Note that when archiving outside of the current directory, - // (for example to a floppy disk), success is set to false to - // prevent a false tree item. - glbCancel = !success; - - btnApply.Enabled=false; - } - - - private bool SelectProcsToArchive() - { - StringCollection SelectedFilesToArchive; - bool isfirst = true; - bool rtnval = false; - ProcedureSelectionList ProcList = new ProcedureSelectionList(); - vdb_Set vdbSet=new vdb_Set(strProcSetDir + "\\SET.DBF"); - // Loop thru the procset (process like a dataset) - DataTable tbl = vdbSet.DB_Data.Tables[0]; - foreach (DataRow row in tbl.Rows) - { - // skip the first one (it's always a "blank" record) - if (isfirst) - isfirst = false; - else - { - ProcList.Add(row); - } - } - - if (ProcList.ShowDialog() == DialogResult.OK) - { - StringBuilder tmpstr = new StringBuilder(); - string strZipPath = "\"" + strProcSetDir + "\\"; - // get list of procedures to archive - // Note that there is no file extension in this list of dBase files - SelectedFilesToArchive = ProcList.GetListOfSelectedProcs_Files(); - for(int j=0; j 0) - rtnval = true; - } - - return rtnval; - } - - - // This function generates a new zip file - private bool GenerateArchiveFile() - { - bool rtnval = true; - StringBuilder cmntTxt = new StringBuilder(); - VEO_Archive arc = (VEO_Archive) _CurObj; - this.glbCancel = false; - if (arc._ArchiveType == VEO_Base.ArchiveTypeOptions.Partial) - { - // get list of selected procedures to archive - rtnval = SelectProcsToArchive(); - } - else - { - // Archive entire procedure directory - strFilesToArchive = "\"" + strProcSetDir + "\\*.*\""; - } - - if (rtnval) - { - strZipFileExcludeList = "\"" + strProcSetDir + "\\Approved\\*.*\" \"" + strProcSetDir + "\\Temps\\*.*\" *.zip process.dat ?process.dat *.lck"; - // Setup DynaZip - - ZipFile.strZipPathAndFile = arc.Location; - ZipFile.strZipFileExcludeList = strZipFileExcludeList; - ZipFile.strFilesToArchive = strFilesToArchive; - ZipFile.strArcTitle = arc.Description; - ZipFile.strComment = arc.Comment; - ZipFile.ArchiveType = (int)arc._ArchiveType; - - this.Enabled = false; - rtnval = ZipFile.CreateNewZipFile(); - this.Enabled = true; - } - - return rtnval; - } - - private bool AddCommentInformation() - { - VEO_Archive arc = (VEO_Archive) _CurObj; - // add comment - ZipFile.strArcTitle = arc.Description; - ZipFile.ArchiveType = (int)arc._ArchiveType; - ZipFile.strComment = arc.Comment; - return ZipFile.AddZipCommentInformation(); - } - - private void GetCommentInformation() - { - this.glbCancel = false; - VEO_Archive arc = (VEO_Archive) _CurObj; - if (ZipFile.strArcTitle == null) - arc.Description = arc._Title; - else - arc.Description = ZipFile.strArcTitle; - arc.Comment = ZipFile.strComment; - if (ZipFile.ArchiveType == (int)VEO_Base.ArchiveTypeOptions.Full) - arc.ArchiveType = VEO_Base.ArchiveTypeOptions.Full; - else - arc.ArchiveType = VEO_Base.ArchiveTypeOptions.Partial; - arc.Write(); - return; - } - - private void myPropertyGrid_PropertyValueChanged(object s, System.Windows.Forms.PropertyValueChangedEventArgs e) - { - btnApply.Enabled = true; - } - - private void btnCancel_Click(object sender, System.EventArgs e) - { - this.glbCancel = true; - } - - /* - * Check the property fields for invalid entries - * If an invalid entry is found, display a message and - * return to the property dialog - */ - private bool ValidatePropertyEntries() - { - VEO_Archive arc = (VEO_Archive) _CurObj; - hasInvalidEntry = false; - - // Check the zip file path and filename - if (!IsAValidZipFileLocation()) - { - hasInvalidEntry = true; - return false; // data in fields are not valid - } - - if (zipInCurProcSet && (arc.Description == null || arc.Description.Equals(""))) - { - // put in a default title - arc.Description = "Archive: " + strZipFileName; - } - - return (true); // data in fields are valid - } - - /* - * Check the zip file name and path. - * Display message box to notify user of invalid entry. - * Assign local strArchive variables accordingly. - */ - private bool IsAValidZipFileLocation() - { - string strArchiveLocation; - string strCurDirSave; - - VEO_Archive arc = (VEO_Archive) _CurObj; - strArchiveLocation = arc._Location; - - // Check for a cleared out location field - if (arc._Location == null || arc._Location.Equals("")) - { - MessageBox.Show("Need to Enter the Archive Location and File Name","Archive Error"); - return false; - } - - string strTmp = strArchiveLocation.ToUpper(); - // Check for a zip extension - if (!strTmp.EndsWith(".ZIP")) - { - MessageBox.Show("Need to enter the Archive File Name","Archive Error"); - return false; - } - - // make sure the current working directory is the current procedure set - strCurDirSave = Directory.GetCurrentDirectory(); - Directory.SetCurrentDirectory(strProcSetDir); - - // Get the full path based on the user entry - strArchiveLocation = Path.GetFullPath(strArchiveLocation); - if (!strArchiveLocation.Equals(arc._Location)) - { - if (strArchiveLocation == null || strArchiveLocation.Equals("")) - { - MessageBox.Show("Invalid Archive File Name or File Path","Archive Error"); - // reset the current working directory - Directory.SetCurrentDirectory(strCurDirSave); - return false; - } - - arc._Location = strArchiveLocation; - } - - // parse out the file name - strZipFileName = Path.GetFileName(strArchiveLocation); - - // parse out the path - strCurZipPath = strArchiveLocation.Substring(0,strArchiveLocation.LastIndexOf(strZipFileName)-1); - - // If the zip file path is not the same as the current working directory - // then flag the fact we are creating a zip file outside the procedure directory. - zipInCurProcSet = Directory.Equals(Directory.GetCurrentDirectory(),strCurZipPath); - - // reset the current working directory - Directory.SetCurrentDirectory(strCurDirSave); - - return true; - } - - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ARProperties.resx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ARProperties.resx deleted file mode 100644 index 7d57c36f..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ARProperties.resx +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - ARProperties - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - Private - - - - AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx - dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx - F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3 - d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx - dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3 - F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX - cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3 - F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX - cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/AppConflict.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/AppConflict.cs deleted file mode 100644 index 156ee900..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/AppConflict.cs +++ /dev/null @@ -1,293 +0,0 @@ -/********************************************************************************************* - * Copyright 2005 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: AppConflict.cs $ $Revision: 4 $ - * $Author: Kathy $ $Date: 8/16/05 2:55p $ - * - * $History: AppConflict.cs $ - * - * ***************** Version 4 ***************** - * User: Kathy Date: 8/16/05 Time: 2:55p - * Updated in $/LibSource/VEObject - * B2005-030: error if missing ndx - * - * ***************** Version 3 ***************** - * User: Jsj Date: 6/02/05 Time: 11:32a - * Updated in $/LibSource/VEObject - * fix for approving with conditional ROs - * - * ***************** Version 2 ***************** - * User: Kathy Date: 3/22/05 Time: 10:01a - * Updated in $/LibSource/VEObject - * Add procnum to transition message - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:50p - * Created in $/LibSource/VEObject - * Approval - *********************************************************************************************/ -using System; -using System.Text; -using System.Collections.Specialized; - -namespace VEObject -{ - /// - /// Summary description for AppConflict. - /// - - public enum AppConflictTypes - { - RO=0, Trans=1, LibDoc=2 - }; - - public class AppConflict - { - public AppConflictTypes CType; - public string ProcNum; - public string SeqNum; - public VEO_DummySet DummySet; - - public AppConflict() - { - - } - public string GetLocStr(string pnum, string snum) - { - string locstr=null; - string secnumtitle = DummySet.GetSectionNumAndTitle(pnum,snum); - if (snum.Length>1) - { - char tmp = System.Convert.ToChar(snum.Substring(1,1)); - string stpnum = System.Convert.ToString(tmp-'0'); - locstr = secnumtitle + " Step " + stpnum; - } - else - locstr = secnumtitle; - return locstr; - } - public virtual StringCollection GetStrForDlg() - { - return null; - } - public virtual string GetStrForEdit() - { - return null; - } - } - - public class AppROConflict : AppConflict - { - public string ROID; - public string AccID; - public bool IsImage; - public string Val1, Val2; - - public AppROConflict(VEO_DummySet ds, string rid, string pnum, string snum, bool image, string v1, string v2) - { - CType = AppConflictTypes.RO; - ROID = rid; - DummySet = ds; - ProcNum = pnum; - SeqNum = snum; - IsImage=image; - Val1=v1; //if image, this will contain image file path - Val2=v2; - if (Val1==null) Val1=" not defined "; - if (Val2==null) Val2=" not defined "; - } - - public override string GetStrForEdit() - { - // For ROs: - // reference line is trimmed to 100 chars & consists of... - // 12 chars - sequence number where RO is used - // 20 chars - procedure number where RO is used - // 88 chars - menu item text, i.e. what's shown on dialog. - - StringBuilder sb = new StringBuilder(125); - sb.Append(SeqNum.PadRight(12,' ')); - sb.Append(ProcNum.PadRight(20,' ')); - string locstr = GetLocStr(ProcNum,SeqNum); - string tmp=null; - if (IsImage) - tmp = "RO: Image File Difference: " + Val1.Replace("\n"," ") + " used in " + locstr; - else - tmp = "RO: New Value = " + Val1.Replace("\n"," ") + " Old Value = " + Val2.Replace("\n"," ") + " used in " + locstr; - int len = tmp.Length; - if (len==88) - sb.Append(tmp); - else if (len > 88) - sb.Append(tmp.Substring(0,88)); - else - sb.Append(tmp.PadRight(88,' ')); - return sb.ToString(); - } - - public override StringCollection GetStrForDlg() - { - StringCollection retstrs = new StringCollection(); - StringBuilder sb = new StringBuilder(); - string retstr; - string locstr = GetLocStr(ProcNum,SeqNum); - if (IsImage) - { - sb.Append(" RO Image File Difference At: "); - sb.Append(locstr); - retstrs.Add(sb.ToString()); - sb.Remove(0,sb.Length); - sb.Append(" RO Value: "); - sb.Append(Val1); - retstrs.Add(sb.ToString()); - } - else - { - int nlptr = -1; - int idx = 0; - sb.Append(" RO Difference At: "); - sb.Append(locstr); - retstrs.Add(sb.ToString()); - sb.Remove(0,sb.Length); - sb.Append(" New Value = "); - nlptr = Val1.IndexOf("\n"); - while (nlptr > -1) - { - sb.Append(Val1.Substring(idx,nlptr-idx)); - retstrs.Add(sb.ToString()); - sb.Remove(0,sb.Length); - idx = nlptr+1; - nlptr = Val1.IndexOf("\n",idx); - sb.Append(" "); - } - sb.Append(Val1.Substring(idx)); - retstrs.Add(sb.ToString()); - sb.Remove(0,sb.Length); - sb.Append(" Old Value = "); - idx = 0; - nlptr = Val2.IndexOf("\n"); - while (nlptr > -1) - { - sb.Append(Val2.Substring(idx,nlptr-idx)); - retstrs.Add(sb.ToString()); - sb.Remove(0,sb.Length); - idx = nlptr+1; - nlptr = Val2.IndexOf("\n",idx); - sb.Append(" "); - } - sb.Append(Val2.Substring(idx)); - retstrs.Add(sb.ToString()); - } - return retstrs; - } - } - - public class AppTransConflict : AppConflict - { - public string ToNum; - public string ToSeq; - public string OldTo; - - public AppTransConflict(VEO_DummySet ds, string pnum, string snum, string tpnum, string tsnum, string old) - { - CType = AppConflictTypes.Trans; - DummySet = ds; - ProcNum = pnum; - SeqNum = snum; - ToNum=tpnum; - ToSeq=tsnum; - OldTo = old; - } - - public override StringCollection GetStrForDlg() - { - StringCollection retstrs = new StringCollection(); - StringBuilder sb = new StringBuilder(); - sb.Append(" Transition: From = "); - sb.Append(ProcNum); - sb.Append(" "); - sb.Append(GetLocStr(ProcNum,SeqNum)); - retstrs.Add(sb.ToString()); - sb.Remove(0,sb.Length); - sb.Append(" To = "); - sb.Append(ToNum); - sb.Append(" "); - sb.Append(GetLocStr(ToNum,ToSeq)); - retstrs.Add(sb.ToString()); - return retstrs; - } - - public override string GetStrForEdit() - { - // For Trans: - // reference line is trimmed to 100 chars & consists of... - // 12 chars - sequence number where Tran is used - // 20 chars - procedure number where Tran is used - // 88 chars - menu item text, i.e. what's shown on dialog. - - StringBuilder sb = new StringBuilder(125); - sb.Append(SeqNum.PadRight(12,' ')); - sb.Append(ProcNum.PadRight(20,' ')); - string tmp = "Transition: To = " + " " + GetLocStr(ToNum,ToSeq); - - int len = tmp.Length; - if (len==88) - sb.Append(tmp); - else if (len > 88) - sb.Append(tmp.Substring(0,88)); - else - sb.Append(tmp.PadRight(88,' ')); - return sb.ToString(); - } - } - - public class AppLibDocConflict : AppConflict - { - public string LibDocName; - public AppLibDocConflict(VEO_DummySet ds, string pnum, string seq, string Lname) - { - CType = AppConflictTypes.LibDoc; - DummySet = ds; - ProcNum = pnum; - SeqNum = seq; - LibDocName = Lname; - } - - - public override StringCollection GetStrForDlg() - { - StringCollection retstrs = new StringCollection(); - StringBuilder sb = new StringBuilder(); - sb.Append(" Library Doc = "); - sb.Append(LibDocName); - sb.Append(" used in "); - sb.Append(GetLocStr(ProcNum,SeqNum)); - retstrs.Add(sb.ToString()); - return retstrs; - } - - public override string GetStrForEdit() - { - // For libdoc: - // reference line is trimmed to 100 chars & consists of... - // 12 chars - sequence number where LibDoc is used - // 20 chars - procedure number where LibDoc is used - // 88 chars - menu item text, i.e. what's shown on dialog. - - StringBuilder sb = new StringBuilder(125); - sb.Append(SeqNum.PadRight(12,' ')); - sb.Append(ProcNum.PadRight(20,' ')); - string tmp = "Library Document: File Name = " + LibDocName + " used in " + GetLocStr(ProcNum,SeqNum); - - int len = tmp.Length; - if (len==88) - sb.Append(tmp); - else if (len > 88) - sb.Append(tmp.Substring(0,88)); - else - sb.Append(tmp.PadRight(88,' ')); - return sb.ToString(); - } - } - -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/AppIndItm.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/AppIndItm.cs deleted file mode 100644 index d9482117..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/AppIndItm.cs +++ /dev/null @@ -1,76 +0,0 @@ -/********************************************************************************************* - * Copyright 2005 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: AppIndItm.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 3/08/05 1:50p $ - * - * $History: AppIndItm.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:50p - * Created in $/LibSource/VEObject - * Approval - *********************************************************************************************/ -using System; -using System.Collections; - -namespace VEObject -{ - /// - /// Summary description for AppIndItm. - /// - public class AppIndItem - { - public VEO_Proc Proc; - public ArrayList ConflictList; - public bool Checked; - - public AppIndItem(VEO_Proc prc) - { - Checked=false; - Proc = prc; - ConflictList = new ArrayList(); - } - - public void AddConflict(AppConflict aconflct) - { - ConflictList.Add(aconflct); - } - - - } - - public class ModLibDoc - { - public string LibFile; - public int status; - public int DocPages; - - public ModLibDoc(string file, int stat) - { - LibFile = file; - status=stat; - DocPages=0; - } - - } - public class ModRO - { - public string roid; - public bool IsImage; - public string Val1; - public string Val2; - public bool IsUsed; - - public ModRO(string r, bool im, string v1, string v2) - { - roid = r; - IsImage = im; - Val1 = v1; - Val2 = v2; - IsUsed=false; - } - } - -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ApproveDlg.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ApproveDlg.cs deleted file mode 100644 index bdf7742b..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ApproveDlg.cs +++ /dev/null @@ -1,235 +0,0 @@ -/********************************************************************************************* - * Copyright 2005 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ApproveDlg.cs $ $Revision: 2 $ - * $Author: Jsj $ $Date: 5/17/05 11:55a $ - * - * $History: ApproveDlg.cs $ - * - * ***************** Version 2 ***************** - * User: Jsj Date: 5/17/05 Time: 11:55a - * Updated in $/LibSource/VEObject - * cleanup - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:50p - * Created in $/LibSource/VEObject - * Approval - *********************************************************************************************/ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using Utils; - -namespace VEObject -{ - /// - /// Summary description for ApproveDlg. - /// - public class ApproveDlg : System.Windows.Forms.Form - { - private System.Windows.Forms.TextBox tbApprovalDate; - private System.Windows.Forms.Label lblDate; - private System.Windows.Forms.GroupBox grpCB; - private System.Windows.Forms.RadioButton rbWDKeep; - private System.Windows.Forms.RadioButton rbWDRemove; - private System.Windows.Forms.CheckBox cbZipApp; - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.CheckBox cbTmpChg; - - public ApprovalOptions ApprovalOptions - { - get - { - ApprovalOptions ao = new ApprovalOptions(); - ao.ApproveDate = this.tbApprovalDate.Text; - ao.ChangeBarsWD = this.rbWDKeep.Checked; - ao.DoZip = this.cbZipApp.Checked; - return ao; - } - } - - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public ApproveDlg() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - this.tbApprovalDate.Text = DTI.MakeDate(DTI.DateTimeInit,false,false); - this.rbWDRemove.Checked = true; - this.cbZipApp.Checked = true; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ApproveDlg)); - this.tbApprovalDate = new System.Windows.Forms.TextBox(); - this.lblDate = new System.Windows.Forms.Label(); - this.grpCB = new System.Windows.Forms.GroupBox(); - this.rbWDRemove = new System.Windows.Forms.RadioButton(); - this.rbWDKeep = new System.Windows.Forms.RadioButton(); - this.cbZipApp = new System.Windows.Forms.CheckBox(); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.cbTmpChg = new System.Windows.Forms.CheckBox(); - this.grpCB.SuspendLayout(); - this.SuspendLayout(); - // - // tbApprovalDate - // - this.tbApprovalDate.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.tbApprovalDate.Location = new System.Drawing.Point(221, 9); - this.tbApprovalDate.Name = "tbApprovalDate"; - this.tbApprovalDate.Size = new System.Drawing.Size(249, 24); - this.tbApprovalDate.TabIndex = 3; - this.tbApprovalDate.Text = ""; - // - // lblDate - // - this.lblDate.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblDate.Location = new System.Drawing.Point(19, 18); - this.lblDate.Name = "lblDate"; - this.lblDate.Size = new System.Drawing.Size(183, 19); - this.lblDate.TabIndex = 2; - this.lblDate.Text = "Approval Date:"; - // - // grpCB - // - this.grpCB.Controls.Add(this.rbWDRemove); - this.grpCB.Controls.Add(this.rbWDKeep); - this.grpCB.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.grpCB.Location = new System.Drawing.Point(10, 65); - this.grpCB.Name = "grpCB"; - this.grpCB.Size = new System.Drawing.Size(268, 64); - this.grpCB.TabIndex = 4; - this.grpCB.TabStop = false; - this.grpCB.Text = "Change Bars In Working Draft"; - // - // rbWDRemove - // - this.rbWDRemove.Location = new System.Drawing.Point(154, 28); - this.rbWDRemove.Name = "rbWDRemove"; - this.rbWDRemove.Size = new System.Drawing.Size(86, 27); - this.rbWDRemove.TabIndex = 1; - this.rbWDRemove.Text = "Remove"; - // - // rbWDKeep - // - this.rbWDKeep.Location = new System.Drawing.Point(29, 28); - this.rbWDKeep.Name = "rbWDKeep"; - this.rbWDKeep.Size = new System.Drawing.Size(77, 27); - this.rbWDKeep.TabIndex = 0; - this.rbWDKeep.Text = "Keep"; - // - // cbZipApp - // - this.cbZipApp.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.cbZipApp.Location = new System.Drawing.Point(19, 194); - this.cbZipApp.Name = "cbZipApp"; - this.cbZipApp.Size = new System.Drawing.Size(269, 28); - this.cbZipApp.TabIndex = 6; - this.cbZipApp.Text = "Archive Data Before Approval?"; - // - // btnOK - // - this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnOK.Location = new System.Drawing.Point(96, 240); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(182, 28); - this.btnOK.TabIndex = 7; - this.btnOK.Text = "Continue with Approval"; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnCancel.Location = new System.Drawing.Point(307, 240); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(183, 28); - this.btnCancel.TabIndex = 8; - this.btnCancel.Text = "Cancel Approval"; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // cbTmpChg - // - this.cbTmpChg.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.cbTmpChg.Location = new System.Drawing.Point(19, 157); - this.cbTmpChg.Name = "cbTmpChg"; - this.cbTmpChg.Size = new System.Drawing.Size(317, 28); - this.cbTmpChg.TabIndex = 9; - this.cbTmpChg.Text = "Create A Temporary Change Version?"; - // - // ApproveDlg - // - this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); - this.ClientSize = new System.Drawing.Size(604, 293); - this.Controls.Add(this.cbTmpChg); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnOK); - this.Controls.Add(this.cbZipApp); - this.Controls.Add(this.grpCB); - this.Controls.Add(this.tbApprovalDate); - this.Controls.Add(this.lblDate); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "ApproveDlg"; - this.Text = "Approval Properties"; - this.grpCB.ResumeLayout(false); - this.ResumeLayout(false); - - } - #endregion - - private void btnOK_Click(object sender, System.EventArgs e) - { - - } - - private void btnCancel_Click(object sender, System.EventArgs e) - { - - } - } - public class ApprovalOptions - { - //public string ApproveNameRev; - public string Type; - public string ApproveDate; - public bool ChangeBarsWD; - public bool ChangeBarsApp; - public bool DoZip; - } - -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ApproveDlg.resx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ApproveDlg.resx deleted file mode 100644 index 12b78b5c..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ApproveDlg.resx +++ /dev/null @@ -1,237 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - Private - - - 8, 8 - - - True - - - False - - - True - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - ApproveDlg - - - True - - - 80 - - - True - - - Private - - - - AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx - dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx - F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3 - d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx - dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3 - F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX - cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3 - F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX - cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ApproveSelDlg.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ApproveSelDlg.cs deleted file mode 100644 index f448bfa7..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ApproveSelDlg.cs +++ /dev/null @@ -1,615 +0,0 @@ -/********************************************************************************************* - * Copyright 2005 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ApproveSelDlg.cs $ $Revision: 9 $ - * $Author: Jsj $ $Date: 4/16/07 12:05p $ - * - * $History: ApproveSelDlg.cs $ - * - * ***************** Version 9 ***************** - * User: Jsj Date: 4/16/07 Time: 12:05p - * Updated in $/LibSource/VEObject - * Clear Button needed to clear flag in Modified Lib Doc List - * - * ***************** Version 8 ***************** - * User: Jsj Date: 7/21/06 Time: 2:57p - * Updated in $/LibSource/VEObject - * remove duplicates from dependency list - * - * ***************** Version 7 ***************** - * User: Kathy Date: 6/21/05 Time: 7:25a - * Updated in $/LibSource/VEObject - * cleanup/bug fixes - * - * ***************** Version 6 ***************** - * User: Jsj Date: 6/02/05 Time: 11:33a - * Updated in $/LibSource/VEObject - * fix for approving with conditional ROs - * - * ***************** Version 5 ***************** - * User: Jsj Date: 5/17/05 Time: 11:56a - * Updated in $/LibSource/VEObject - * cleanup - * - * ***************** Version 4 ***************** - * User: Kathy Date: 4/21/05 Time: 10:21a - * Updated in $/LibSource/VEObject - * print all lines for long line in report - * - * ***************** Version 3 ***************** - * User: Kathy Date: 4/12/05 Time: 1:01p - * Updated in $/LibSource/VEObject - * - * ***************** Version 2 ***************** - * User: Kathy Date: 3/22/05 Time: 10:02a - * Updated in $/LibSource/VEObject - * log file & edit conflict - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:50p - * Created in $/LibSource/VEObject - * Approval - *********************************************************************************************/ -using System; -using System.Drawing; -using System.Drawing.Printing; -using System.Collections; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Windows.Forms; -using System.IO; -using VlnStatus; -using Utils; - -namespace VEObject -{ - /// - /// Summary description for ApproveSelDlg. - /// - public class ApproveSelDlg : System.Windows.Forms.Form - { - private System.Windows.Forms.ListBox listAvail; - private System.Windows.Forms.ListBox listSelect; - private System.Windows.Forms.Label lblAvail; - private System.Windows.Forms.Label lblSelected; - private System.Windows.Forms.Button btnSelect; - private System.Windows.Forms.Button btnClear; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Button btnApprove; - private System.Windows.Forms.Button btnResolve; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Button btnRpt; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - private VEO_DummySet CurDSet; - private ArrayList AppItems; - private ArrayList ModROs; - private System.Windows.Forms.ListBox listDepend; - private ArrayList ModLibDocs; - - public ApproveSelDlg(ArrayList items, VEO_ProcSet curset, ArrayList mros, ArrayList mlibdocs) - { - InitializeComponent(); - - // procedures are stored off dummyset, which is children[1] always - CurDSet = (VEO_DummySet) curset.Children[1]; - - AppItems = items; - ModROs = mros; - ModLibDocs = mlibdocs; - - SetUpAvailSelectLists(); - VlnStatusMessage StatMsgWin = new VlnStatusMessage("Looking for Dependencies..."); - StatMsgWin.StatusMessage = "Populating Dependency List"; - PopulateDependList(); - PopulateLogFile(); - StatMsgWin.Dispose(); - } - - private void SetUpAvailSelectLists() - { - // add the list of procs to the selected list and - // see if there are any more selections made. - foreach (object obj in AppItems) - { - AppIndItem apitm = (AppIndItem) obj; - string UnitSpecPrcNum = ROFST_FILE.ROProcessTools.UnitSpecific(apitm.Proc._Prcnum,0,0,CurDSet.LargestNumber); - listSelect.Items.Add(UnitSpecPrcNum); - } - int cnt=0; - while (cnt < CurDSet.Children.Count) - { - VEO_Proc prc = (VEO_Proc) CurDSet.Children[cnt]; - string pnum = ROFST_FILE.ROProcessTools.UnitSpecific(prc._Prcnum,0,0,CurDSet.LargestNumber); - if (!listSelect.Items.Contains(pnum)) listAvail.Items.Add(pnum); - cnt++; - } - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ApproveSelDlg)); - this.listAvail = new System.Windows.Forms.ListBox(); - this.listSelect = new System.Windows.Forms.ListBox(); - this.lblAvail = new System.Windows.Forms.Label(); - this.lblSelected = new System.Windows.Forms.Label(); - this.btnSelect = new System.Windows.Forms.Button(); - this.btnClear = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.btnApprove = new System.Windows.Forms.Button(); - this.btnResolve = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.btnRpt = new System.Windows.Forms.Button(); - this.listDepend = new System.Windows.Forms.ListBox(); - this.SuspendLayout(); - // - // listAvail - // - this.listAvail.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.listAvail.ItemHeight = 20; - this.listAvail.Location = new System.Drawing.Point(29, 28); - this.listAvail.Name = "listAvail"; - this.listAvail.Size = new System.Drawing.Size(345, 184); - this.listAvail.TabIndex = 0; - // - // listSelect - // - this.listSelect.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.listSelect.ItemHeight = 20; - this.listSelect.Location = new System.Drawing.Point(509, 28); - this.listSelect.Name = "listSelect"; - this.listSelect.Size = new System.Drawing.Size(355, 184); - this.listSelect.TabIndex = 1; - // - // lblAvail - // - this.lblAvail.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblAvail.Location = new System.Drawing.Point(29, 8); - this.lblAvail.Name = "lblAvail"; - this.lblAvail.Size = new System.Drawing.Size(221, 16); - this.lblAvail.TabIndex = 2; - this.lblAvail.Text = "Available Procedures"; - this.lblAvail.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // lblSelected - // - this.lblSelected.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblSelected.Location = new System.Drawing.Point(509, 8); - this.lblSelected.Name = "lblSelected"; - this.lblSelected.Size = new System.Drawing.Size(249, 16); - this.lblSelected.TabIndex = 3; - this.lblSelected.Text = "Selected Procedures"; - this.lblSelected.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // btnSelect - // - this.btnSelect.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnSelect.Location = new System.Drawing.Point(384, 32); - this.btnSelect.Name = "btnSelect"; - this.btnSelect.Size = new System.Drawing.Size(120, 40); - this.btnSelect.TabIndex = 4; - this.btnSelect.Text = "Select"; - this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click); - // - // btnClear - // - this.btnClear.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnClear.Location = new System.Drawing.Point(384, 96); - this.btnClear.Name = "btnClear"; - this.btnClear.Size = new System.Drawing.Size(120, 40); - this.btnClear.TabIndex = 5; - this.btnClear.Text = "Clear"; - this.btnClear.Click += new System.EventHandler(this.btnClear_Click); - // - // label1 - // - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.label1.Location = new System.Drawing.Point(29, 216); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(187, 18); - this.label1.TabIndex = 7; - this.label1.Text = "Dependencies Report"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // btnApprove - // - this.btnApprove.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnApprove.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnApprove.Location = new System.Drawing.Point(56, 616); - this.btnApprove.Name = "btnApprove"; - this.btnApprove.Size = new System.Drawing.Size(216, 32); - this.btnApprove.TabIndex = 8; - this.btnApprove.Text = "Continue With Approval"; - // - // btnResolve - // - this.btnResolve.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnResolve.Location = new System.Drawing.Point(360, 616); - this.btnResolve.Name = "btnResolve"; - this.btnResolve.Size = new System.Drawing.Size(200, 32); - this.btnResolve.TabIndex = 9; - this.btnResolve.Text = "Edit Dependencies"; - this.btnResolve.Click += new System.EventHandler(this.btnResolve_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnCancel.Location = new System.Drawing.Point(648, 616); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(192, 32); - this.btnCancel.TabIndex = 10; - this.btnCancel.Text = "Cancel"; - // - // btnRpt - // - this.btnRpt.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnRpt.Location = new System.Drawing.Point(384, 160); - this.btnRpt.Name = "btnRpt"; - this.btnRpt.Size = new System.Drawing.Size(120, 46); - this.btnRpt.TabIndex = 11; - this.btnRpt.Text = "Print Report"; - this.btnRpt.Click += new System.EventHandler(this.btnRpt_Click); - // - // listDepend - // - this.listDepend.Font = new System.Drawing.Font("Courier New", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.listDepend.HorizontalScrollbar = true; - this.listDepend.ItemHeight = 16; - this.listDepend.Location = new System.Drawing.Point(29, 240); - this.listDepend.Name = "listDepend"; - this.listDepend.SelectionMode = System.Windows.Forms.SelectionMode.None; - this.listDepend.Size = new System.Drawing.Size(835, 356); - this.listDepend.TabIndex = 12; - // - // ApproveSelDlg - // - this.AutoScale = false; - this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); - this.AutoScroll = true; - this.ClientSize = new System.Drawing.Size(871, 662); - this.Controls.Add(this.listDepend); - this.Controls.Add(this.btnRpt); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnResolve); - this.Controls.Add(this.btnApprove); - this.Controls.Add(this.label1); - this.Controls.Add(this.btnClear); - this.Controls.Add(this.btnSelect); - this.Controls.Add(this.lblSelected); - this.Controls.Add(this.lblAvail); - this.Controls.Add(this.listSelect); - this.Controls.Add(this.listAvail); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "ApproveSelDlg"; - this.Text = "Approve Selected Procedures"; - this.ResumeLayout(false); - - } - #endregion - - // if user presses Clear button, clear the selected items list, and - // reset the available to all in procedure set. - private void btnClear_Click(object sender, System.EventArgs e) - { - // reset both lists and will reset available from procedures in set. - listSelect.Items.Clear(); - listAvail.Items.Clear(); - AppItems.Clear(); // no procedures to approve. - SetUpAvailSelectLists(); - listDepend.Items.Clear(); - // Bug Fix: B2007-010 - // If you don't clear the DocPages, then if you re-select - // the same procedure to approve, it will think that - // the library document check was already done - thus - // no depenencies the second time around. - foreach (ModLibDoc ml in ModLibDocs) ml.DocPages = 0; - } - - private bool PopulateEditList() - { - bool hascon = false; - if (AppItems.Count<=0) - { - MessageBox.Show("No conflicts exist","Approve Selected"); - return hascon; - } - VlnStatusMessage StatMsgWin = new VlnStatusMessage("Conflict Resolution..."); - StatMsgWin.StatusMessage = "Populating Edit List"; - - // Create the reference file - use apprcon as filename - // get first item in list & use this as the procedure number. - AppIndItem apitm = (AppIndItem) AppItems[0]; - string pnum = apitm.Proc._Prcnum; - RefList rl = new RefList(pnum,"apprcon",CurDSet.usrRunTime); - rl.Create(); - ArrayList tarry = new ArrayList(); - foreach (object obj in AppItems) - { - apitm = (AppIndItem) obj; - foreach (AppConflict ac in apitm.ConflictList) - { - hascon = true; - string strForEdit; - strForEdit = ac.GetStrForEdit(); - if (!tarry.Contains(strForEdit)) - { - rl.WriteRefLine(strForEdit); - tarry.Add(strForEdit); - } -// rl.WriteRefLine(ac.GetStrForEdit()); - } - } - rl.WriteTotalNumRefs(); - rl.CloseFile(); - StatMsgWin.Dispose(); - if (!hascon) - { - MessageBox.Show("No conflicts exist - cannot edit.","Approve Selected"); - apitm = (AppIndItem) AppItems[0]; - // note that if the following is entered as a single string (rather than - // two strings concatenated) the argument passing changes the string and - // exeadjust does not work correctly - keep as two separate strings. - string fl = apitm.Proc.usrRunTime.ExeAdjust("\xE7" + "apprcon"); - if (File.Exists(fl))File.Delete(fl); - return false; - } - return true; - } - - private void PopulateDependList() - { - listDepend.Items.Clear(); - bool doblank = false; - foreach (object obj in AppItems) - { - AppIndItem apitm = (AppIndItem) obj; - if (doblank) // don't add a blank line the first time. - listDepend.Items.Add(" "); - else - doblank=true; - - listDepend.Items.Add("Dependencies in : " + ROFST_FILE.ROProcessTools.UnitSpecific(apitm.Proc._Prcnum,0,0,CurDSet.LargestNumber)); - if (apitm.ConflictList.Count==0) - listDepend.Items.Add(" None"); - else - { - foreach (AppConflict ac in apitm.ConflictList) - { - StringCollection sc = ac.GetStrForDlg(); - foreach (string tmpstr in sc) - { - listDepend.Items.Add(tmpstr); - } -// listDepend.Items.Add(ac.GetStrForDlg()); - } - } - } - } - private void PopulateLogFile() - { - using (StreamWriter sw = new StreamWriter("Approval.log", true)) - { - sw.Write("APPROVE SELECTED: Conflicts found on "); - sw.Write(DateTime.Now); - sw.WriteLine(" performed by " + DTI.Initials); - foreach (object obj in AppItems) - { - AppIndItem apitm = (AppIndItem) obj; - sw.WriteLine(" Dependencies in : " + ROFST_FILE.ROProcessTools.UnitSpecific(apitm.Proc._Prcnum,0,0,CurDSet.LargestNumber)); - if (apitm.ConflictList.Count==0) - sw.WriteLine(" None"); - else - { - foreach (AppConflict ac in apitm.ConflictList) - { - sw.WriteLine(ac.GetStrForDlg()); - } - } - sw.WriteLine(" "); - } - sw.WriteLine(" "); - } - } - - private void btnSelect_Click(object sender, System.EventArgs e) - { - if (listAvail.SelectedIndex<0) - { - MessageBox.Show("You must select an item in the list."); - return; - } - string prc_sel = (string) listAvail.Items[listAvail.SelectedIndex]; - VEO_ProcSet ps = (VEO_ProcSet) CurDSet.parentObj; - - // find the proc object & add it to the arraylist of procedures to process. Then - // do the individual processing on it. - foreach (Object obj in CurDSet.Children) - { - VEO_Proc prc = (VEO_Proc) obj; - string tst = ROFST_FILE.ROProcessTools.UnitSpecific(prc._Prcnum,0,0,CurDSet.LargestNumber); - if (tst==prc_sel) - { - AppIndItem aii= new AppIndItem(prc); - AppItems.Add(aii); - ps.ProcessInd(AppItems, AppItems.Count-1, ModROs, ModLibDocs); - break; - } - } - int indx=0; - VlnStatusMessage StatMsgWin = null; - while (indx>=0) - { - - AppIndItem CurItem = (AppIndItem) AppItems[indx]; - if (!CurItem.Checked) - { - if (StatMsgWin==null)StatMsgWin = new VlnStatusMessage("Looking for Dependencies..."); - StatMsgWin.StatusMessage = "Checking " + CurItem.Proc._Prcnum; - ps.ProcessInd(AppItems, indx, ModROs, ModLibDocs); - CurItem.Checked=true; - } - indx = -1; - for (int i=0;iev.MarginBounds.Width&&line.Length>85) - { - // going backwards from 85 chars, find a space to use as the line - // breaking point. - int indx = line.LastIndexOf(" ",84,85); - string sline = line.Substring(0,indx); - yPos = topMargin + (count * printFont.GetHeight(ev.Graphics)); - ev.Graphics.DrawString (sline, printFont, Brushes.Black, - leftMargin, yPos, new StringFormat()); - count++; - line = " " + line.Substring(indx,line.Length-indx); - } - yPos = topMargin + (count * printFont.GetHeight(ev.Graphics)); - ev.Graphics.DrawString (line, printFont, Brushes.Black, - leftMargin, yPos, new StringFormat()); - count++; - CurLine++; - } - - // If more lines exist, print another page. - if (CurLine - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - ApproveSelDlg - - - True - - - 80 - - - True - - - Private - - - - AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx - dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx - F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3 - d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx - dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3 - F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX - cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3 - F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX - cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Archive.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Archive.cs deleted file mode 100644 index 47be5ac2..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Archive.cs +++ /dev/null @@ -1,406 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: Archive.cs $ $Revision: 3 $ - * $Author: Kathy $ $Date: 1/31/05 11:05a $ - * - * $History: Archive.cs $ - * - * ***************** Version 3 ***************** - * User: Kathy Date: 1/31/05 Time: 11:05a - * Updated in $/LibSource/VEObject - * Fix B2005-005 - this just fixed empty icon usage - * - * ***************** Version 2 ***************** - * User: Kathy Date: 1/24/05 Time: 2:45p - * Updated in $/LibSource/VEObject - * B2005-004 fixes - icon clean-up - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:52a - * Created in $/LibSource/VEObject - *********************************************************************************************/ - -using System; -using System.Windows.Forms; -using System.Windows.Forms.Design; -using System.ComponentModel; -using System.IO; -using System.Text; -using Utils; -using System.Collections.Specialized; - -namespace VEObject -{ - /// - /// Archive Object. - /// - public class VEO_Archive: VEO_Base - { - public bool isnew; - - // These three strings are stored in the Zip file's - // comment field - private String tmpArchiveTitle; - private String _Comment; - public ArchiveTypeOptions _ArchiveType; - - private String tmpComment; - - private bool _ReadOnly; - private bool oldReadOnly; - private bool NeedToGetReadOnly; - - private bool changeReadOnly; - private bool changeComment; - private bool changeArchiveTitle; - - public VEO_Archive(string ipath, VEO_DummyZip dz) - { - iconStates = new int[5] {0,0,0,0,0}; - _Location = ipath; // full path to the Zip file - VEObjectType = (int)VEObjectTypesDefs.Archive; - changeReadOnly = false; - changeComment = false; - changeArchiveTitle = false; - NeedToGetReadOnly = true; - isnew = IsThisANewArchive(ipath); - if (isnew) - { - _Title = "New Archive"; - _Comment = "Created: " + System.DateTime.Now.ToString(); - } - else // get the title and comment from the Zip file - { - GetInfoFromZipComment(); - } - LoadLockInfo(); - icon = iconStates[(int)Lock.LockStatus]; - parentObj = dz; - usrRunTime = dz.usrRunTime; - } - - // Read in the Title, Archive Type, and Comment from the Zip file's - // comment field. - private void GetInfoFromZipComment() - { - string tmpstr; - ZipFuncs ZipInfo = new ZipFuncs(_Location); - // just opening the zip file like this will read the zip's comment field - if (ZipInfo.strArcTitle != null) - tmpstr = ZipInfo.strArcTitle.Trim(); - else - tmpstr = ""; - // if the title is blank, then use the zip file name as the title - if (tmpstr.Length == 0) - this._Title = _Location.Substring(_Location.LastIndexOf("\\")+1); - else - this._Title = tmpstr; - _Comment = ZipInfo.strComment; - if (ZipInfo.ArchiveType == (int)VEO_Base.ArchiveTypeOptions.Full) - _ArchiveType = VEO_Base.ArchiveTypeOptions.Full; - else - _ArchiveType = VEO_Base.ArchiveTypeOptions.Partial; - } - - private bool IsThisANewArchive(string arcPath) - { - string tmpstr = arcPath.ToUpper(); - return (!tmpstr.EndsWith(".ZIP") || !File.Exists(tmpstr)); - } - - private string ParseOutZipPath() - { - string zpath = _Location.Substring(0,_Location.LastIndexOf("\\")); - return zpath; - } - - // Gets and Sets for the Property Page - [Description("Location"),Category("Archive"),ReadOnly(true)] - public string Location - { - get{return _Location;} - - //note: we don't allow them to change the zip file name or path. - } - - - [Description("Archive Title"),Category("Archive")]public string Description - { - get - { - if (!changeArchiveTitle) - return _Title; - else - return tmpArchiveTitle; - } - set - { - changeArchiveTitle = true; - tmpArchiveTitle = value; - } - } - - [Description("Archive Type"),Category("Archive"),ReadOnly(true)]public ArchiveTypeOptions ArchiveType - { - get - { - return _ArchiveType; - } - set - { - _ArchiveType=value; - } - } - - [Description("Comment"),Category("Archive")]public string Comment - { get - { - if (!changeComment) - return _Comment; - else - return tmpComment; - } - set - { - changeComment = true; - tmpComment = value; - } - } - - [Description("ReadOnly"),Category("Archive")]public bool ReadOnlyArchiveFile - { - get - { - if (!changeReadOnly && NeedToGetReadOnly) - { - FileAttributes attrib = File.GetAttributes(_Location); - _ReadOnly = (attrib & FileAttributes.ReadOnly) == FileAttributes.ReadOnly; - NeedToGetReadOnly = false; - } - return _ReadOnly; - } - set - { - if (!changeReadOnly) // only save previous value once - oldReadOnly = _ReadOnly; - changeReadOnly = true; - _ReadOnly = value; - } - } - - // When the Save Button is pressed on the Property page, this function - // is called. - public override bool Write() - { - if (changeReadOnly) - { - changeReadOnly = false; - NeedToGetReadOnly = true; - FileAttributes attrib = File.GetAttributes(_Location); - if (_ReadOnly != ((attrib & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)) - attrib ^= FileAttributes.ReadOnly; //toggle - File.SetAttributes(_Location,attrib); - } - - if (changeComment) - { - changeComment = false; - _Comment = tmpComment; - } - - if (changeArchiveTitle) - { - changeArchiveTitle = false; - _Title = tmpArchiveTitle; - } - - return true; - } - - // When the Cancel Button on the Property Page is pressed, - // this function is called. - public override void CancelWrite() - { - if (changeReadOnly) - { - _ReadOnly = oldReadOnly; - } - changeArchiveTitle = false; - changeComment = false; - changeReadOnly = false; - NeedToGetReadOnly = true; - } - - public override bool Read(bool dummy) - { - //load archive file list - return true; - } - - public override void AddToTree(TreeNode parentnd) - { - } - - public override bool Expand(TreeNode parentnd) - { - return true; - } - - public override bool PropertiesDlg(Object parent) - { - ARProperties propdlg = new ARProperties(parent, this); - if (propdlg.ShowDialog() == DialogResult.OK) return true; - return false; - } - - public bool Exists(string dname) - { - if(dname==null||dname=="") return false; - - string archname=null; - // see if this is a pathname, it needs to be for the Exists check. - if (dname.IndexOf("\\") < 0) // it's not a path, prepend the path - archname = _Location + "\\" + dname; - else - archname = dname; - - return File.Exists(archname); - } - - public override bool mnuAllowNew() - { - return false; - } - - public override bool mnuAllowDelete() - { -// VEO_DummyArchive ds = (VEO_DummyArchive) this.parentObj; -// VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; -// if (ps.isApproved == true) return false; -// if (amILockedByMe()==false) return false; -// if ((ps.accessFlags&Security.DOCMAINT)==Security.DOCMAINT) return true; - return true; - } - - public override bool mnuAllowUpdateArch() - { - if (amILockedByMe()==false) return false; - return true; - } - - public override bool mnuAllowExtractArch() - { - if (amILockedByMe()==false) return false; - return true; - } - - public override bool mnuAllowTestArchive() - { - return true; - } - - public override void DoListView(ListView veoListView) - { - ZipFuncs ZipInfo = new ZipFuncs(_Location); - ListViewItem item=null; - veoListView.Columns.Add("Date/Time", 150, HorizontalAlignment.Left); - veoListView.Columns.Add("File", 450, HorizontalAlignment.Left); - StringCollection ZipFileList; -// veoListView.Sorting = SortOrder.Ascending; - - ZipFileList = ZipInfo.ZipFileContents(); - - for (int i=0; i< ZipFileList.Count; i++) - { - string tmpstr = ZipFileList[i].ToString(); - int subIdx = tmpstr.IndexOf('!'); - item = new ListViewItem(tmpstr.Substring(0,subIdx)); - item.SubItems.Add(tmpstr.Substring(subIdx+1)); - item.Tag = this; - veoListView.Items.Add(item); - } - AllowListViewSort = true; - } - - public override bool Delete() - { - if ((File.GetAttributes(_Location) & System.IO.FileAttributes.ReadOnly) == System.IO.FileAttributes.ReadOnly) - File.SetAttributes(_Location,System.IO.FileAttributes.Normal); - File.Delete(_Location); - // if this is the last zip, then change parent's icon to empty - VEO_DummyZip zip = (VEO_DummyZip) this.parentObj; - if (zip.Children.Count==1) zip.IsEmpty=true; // just this one. - return true; - } - } - - // This class is used when creating a new archive - public class VEO_ArchiveN: VEO_Archive - { - public VEO_ArchiveN(string ipath, VEO_DummyZip dz) - : base(ipath, dz) - { - } - - [Description("Location"),Category("Archive"),ReadOnly(false),EditorAttribute(typeof(PropSaveFileAsDlg), typeof(System.Drawing.Design.UITypeEditor))] - public new string Location - { - get{return _Location;} - - set - { - _Location=value.ToString(); - } - } - - [Description("Archive Type"),Category("Archive"),ReadOnly(false)]public new ArchiveTypeOptions ArchiveType - { - get - { - return _ArchiveType; - } - set - { - _ArchiveType=value; - } - } - } - - /* - * Setup a class that will display the SaveFileAs dialog from the property dialog - * when the "..." is pressed. - */ - public class PropSaveFileAsDlg : System.Drawing.Design.UITypeEditor - { - public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context) - { - return System.Drawing.Design.UITypeEditorEditStyle.Modal; - } - - public override object EditValue( - System.ComponentModel.ITypeDescriptorContext context, - System.IServiceProvider provider, object value) - { - SaveFileDialog saveFileDialog1 = new SaveFileDialog(); - saveFileDialog1.AddExtension = true; - saveFileDialog1.CheckPathExists = true; - saveFileDialog1.DefaultExt = ".zip"; - saveFileDialog1.Filter = "ZIP Files|*.zip|All Files|*.*||"; - saveFileDialog1.DereferenceLinks = true; - saveFileDialog1.OverwritePrompt = true; - saveFileDialog1.Title = "Archive Location and Name"; - saveFileDialog1.FileName = value.ToString(); - saveFileDialog1.ShowDialog(); - - return saveFileDialog1.FileName; - } - - public override bool GetPaintValueSupported( - System.ComponentModel.ITypeDescriptorContext context) - { - return false; - } - } - } diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/AssemblyInfo.cs deleted file mode 100644 index 7e3b35a5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/AssemblyInfo.cs.bak deleted file mode 100644 index 6b2b0662..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/DataPath.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/DataPath.cs deleted file mode 100644 index de8b4e08..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/DataPath.cs +++ /dev/null @@ -1,421 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: DataPath.cs $ $Revision: 5 $ - * $Author: Jsj $ $Date: 3/06/07 1:26p $ - * - * $History: DataPath.cs $ - * - * ***************** Version 5 ***************** - * User: Jsj Date: 3/06/07 Time: 1:26p - * Updated in $/LibSource/VEObject - * check for a null Location. - * - * ***************** Version 4 ***************** - * User: Kathy Date: 1/24/05 Time: 2:45p - * Updated in $/LibSource/VEObject - * B2005-004 fixes - * - * ***************** Version 3 ***************** - * User: Kathy Date: 1/19/05 Time: 11:59a - * Updated in $/LibSource/VEObject - * Fix B2005-003 - missing plant security setting - * - * ***************** Version 2 ***************** - * User: Kathy Date: 1/14/05 Time: 10:38a - * Updated in $/LibSource/VEObject - * B2004-061: fix security options - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:53a - * Created in $/LibSource/VEObject - *********************************************************************************************/ - -using System; -using System.Windows.Forms; -using System.Collections; -using System.Xml; -using System.IO; -using System.ComponentModel; -using Utils; - -namespace VEObject -{ - /// - /// This defines the DataPath class, which handles the datapath information - /// which tells the program where to search for veproms data. A datapath is of - /// the form "[path],[title];" for example G:\,GDRIVE; - /// Its children are vedata directories as found in the menuwin.xml file. - /// These vedata directories represent plant data. - /// - public class VEO_DataPath : VEO_Base - { - protected string tmpTitle; - protected string tmpLocation; - protected bool changeLocation; - protected bool changeTitle; - private string PrevDirectory; - - public VEO_DataPath(UserRunTime iusrRunTime, string ititle, string iloc) - { - iconStates = new int[5] {6,21,8,22,7}; - _Title = ititle; - _Location = iloc; - usrRunTime = iusrRunTime; - changeTitle=false; - changeLocation=false; - isNew=false; - LoadLockInfo(); - icon = iconStates[(int)Lock.LockStatus]; - } - - // the following properties are used in the properties dialog for modification - // of 'property' data. - [Description("Location"),Category("Data Path"),ReadOnly(true)]public string Location - { - get{return _Location;} - set - { - ShortName sname = new ShortName(value); - _Location=sname.ShortFileName; - sname = null; - } - } - - [Description("Title"),Category("Data Path")]public string Title - { - get - { - if (!changeTitle) - return _Title; - else - return tmpTitle; - } - set - { - changeTitle=true; - tmpTitle=value; - } - } - - public override void Restore() - { - changeTitle = false; - } - - // Make a new child, which is a plant node. - public override Object MakeNewChild() - { - VEO_Plant pl = new VEO_PlantN(usrRunTime,null,null); - return (Object) pl; - - } - - // 'Open' positions in the datapath directory (for creation of plant - // directories (store the previous directory, to position out of this - // directory on end). - public override bool Open() - { - if (Directory.Exists(_Location) == false) return false; - isOpen = true; - PrevDirectory = Directory.GetCurrentDirectory(); - if(_Location!=null)Directory.SetCurrentDirectory(_Location); - return true; - } - - // Close clears any multi-user settings for the system level - public override bool Close() - { - if (!isOpen)return false; - isOpen = false; - Directory.SetCurrentDirectory(PrevDirectory); - return true; - } - - // Save the new plant & add to children if it succeeds. - public override bool SaveChild(Object obj) - { - VEO_Plant plnt = (VEO_Plant)obj; - bool succeed = plnt.SaveNew(this._Location); - - if (succeed == true) - { - plnt._Location = this._Location + plnt._Location; - plnt.parentObj = this; - } - return succeed; - } - - public override bool Delete() - { - // concatenate title/loc so that it can be removed from the datapath string - string delpth = _Location + "," + _Title + ";"; - bool success = usrRunTime.DeletePathFromCfg(delpth); - return success; - } - - // for this data path, read in which plants are available, and add to - // the list. - public override bool Read(bool dummy) - { - ArrayList tmpChildren = new ArrayList(); - - // using the . do exist tests to see if they exist on this datapath. - XmlDocument xmldoc = usrRunTime.menuwinXML.GetXmlDoc(); - - XmlElement top = (XmlElement) xmldoc.FirstChild; - XmlElement sys = (XmlElement) top.SelectSingleNode("SystemAttach"); - XmlElement ele = (XmlElement) sys.SelectSingleNode("Plant"); - while (ele != null) - { - // get plants and test for existence with the location for - // this datapath. If exists, add it to the PlantList. - - //get the TemplateName & if there is a {t} replace the {t} - // with this datapath's path. - - XmlElement tn = (XmlElement) ele.SelectSingleNode("TemplateName"); - if (tn != null) - { - string templatename = tn.InnerText; - if (templatename.IndexOf("{t}",0) != -1) - { - string tpath = templatename.Replace("{t}",this.Location); - string path = tpath.Substring(0,tpath.IndexOf(" menu")); - DirectoryInfo source = new DirectoryInfo(path.Replace("/","//")); - if (source.Exists) - { - XmlElement etitle = (XmlElement) ele.SelectSingleNode("MenuName"); - VEO_Plant plnt = new VEO_Plant(usrRunTime, etitle.InnerText,path); - plnt.parentObj = this; - tmpChildren.Add(plnt); - } - - } - } - ele = (XmlElement) ele.NextSibling; - } - Security lsec = usrRunTime.sec; - if (lsec.OpenFile()==true) - { - for(int i=0;i - /// This module defines the DataRoot class, which is the root of all - /// data that is accessible to this user. (i.e. it is the container - /// for all data within the datapath). Applications accessing the database - /// should create a DataRoot. - /// - public class VEO_DataRoot : VEO_Base - { - protected string tmpLocation; - protected bool changeLocation; - - public VEO_DataRoot(UserRunTime iusrRunTime) - { - VEObjectType=(int)VEObjectTypesDefs.System; - iconStates = new int[5] {6,21,8,22,7}; - _Title = "VE-PROMS Data "+iusrRunTime.ucfgpath; - _Location = iusrRunTime.ucfgpath; - changeLocation = false; - usrRunTime = iusrRunTime; - isNew=false; - LoadLockInfo(); - icon = iconStates[(int)Lock.LockStatus]; - } - - public override void LoadLockInfo() - { - Lock = new VELock(usrRunTime.syspath, usrRunTime.myUserData, usrRunTime.InMultiUserMode?VENetwork.LockTypes.System:VENetwork.LockTypes.None); - } - - // The following properties are used in the 'Properties' dialog. This set is used - // for modify. - [Description("Title"),Category("VE-PROMS Data Paths (CFG File)"),ReadOnly(true)]public string Title - { - get{return _Title;} - set{_Title=value;} - } - - //[Description("Location"),Category("VE-PROMS Data Paths (CFG File)"),EditorAttribute(typeof(DataRootFileDlg), typeof(System.Drawing.Design.UITypeEditor))]public string Location - [Description("Location"),Category("VE-PROMS Data Paths (CFG File)"),ReadOnly(true)]public string Location - { - get - { - if (!changeLocation) - return _Location; - else - return tmpLocation; - } - set - { - FileInfo fi = new FileInfo(value); - if (!fi.Exists) - { - MessageBox.Show("The file that was specified does not exist."); - return; - } - changeLocation = true; - tmpLocation=value; - } - } - - public override bool Open() - { - isOpen = true; - // check current multi-user status - if (Connection!=null)Connection.Enter(false); - return true; - } - - // Close clears any multi-user settings for the system level - public override bool Close() - { - isOpen = false; - if (Connection!=null)Connection.Exit(); - return true; - } - - public override void Restore() - { - changeLocation = false; - } - - public override bool mnuAllowDelete() - { - return false; - } - - public override bool mnuAllowLckDB() - { - if (usrRunTime.InMultiUserMode && usrRunTime.sec.PermissionToLockFlag&&Lock.LockStatus==VENetwork.Status.NoLock) return true; - return false; - } - - public override bool mnuAllowNew() - { -// if (usrRunTime.InMultiUserMode && Lock.LockStatus==VENetwork.Status.LockedByOther)return false; - // B2007-005 - // Standardize the need for a lock. Prevent NEW button on first tree node - // if a lock is not set - if (amILockedByMe()==false) return false; - return true; - } - - public override bool mnuAllowUnlckDB() - { - if (usrRunTime.InMultiUserMode && usrRunTime.sec.PermissionToLockFlag&&(Lock.LockStatus==VENetwork.Status.Locked|| - Lock.LockStatus==VENetwork.Status.LockPending)) return true; - return false; - } - - // Add a Data Path. Private method used below. - private void AddDataPath(string entry) - { - int comma; - string tmp; - string loc; - string title; - - comma = entry.IndexOf(","); - tmp=entry.Substring(0,comma); - loc=tmp.Trim(); - //Make sure datapath has an ending backslash - if (!(loc.EndsWith("\\"))) - loc = loc + "\\"; - - tmp=entry.Substring(comma+1,entry.Length-comma-2); // -2, don't copy ";" - title=tmp.Trim(); - - VEO_DataPath dp = new VEO_DataPath(usrRunTime,title,loc); - dp.parentObj = (VEO_Base) this; - Children.Add(dp); - } - - // Get the datapath list. If in demo mode, use sample list; otherwise read in - // from the user's cfg file. - public override bool Read(bool dummy) - { - PrivateProfile ppCfg; - string dpath; - string entry; - int semi; - int strtindx=0; - int netpth; - - if (usrRunTime.sec.isDemoMode) - { - dpath = usrRunTime.syspath + "\\samples\\,Demo Data;"; - } - else - { - // for this data root, read in the datapath. If a user's cfg exists - // use that data. Otherwise, use the menuwin2.xml data which is part - // of the user's run time. - ppCfg = new PrivateProfile(usrRunTime.ucfgpath); -// dpath=ppCfg.Attr("/ini/section[@name='Menu']/param[@name='DataPath']/@value"); - dpath=ppCfg.Attr("Menu","DataPath"); - if (dpath==null || dpath=="")return false; - } - semi=dpath.IndexOf(";",strtindx); - if (semi == -1) - { - MessageBox.Show("Must have semi-colon in datapath"); - Environment.Exit(-1); - } - while (semi !=-1) - { - entry = dpath.Substring(strtindx,semi-strtindx+1); - netpth = entry.IndexOf("////",0); - if (netpth != -1) - //if(GetNetTempDisk()) AddDataPath(entry); - MessageBox.Show("Need to support network temp disk"); - else - AddDataPath(entry); - - if (semi+1>dpath.Length) - strtindx=-1; - else - { - strtindx=semi+1; - semi=dpath.IndexOf(";",strtindx); - } - } - - return true; - } - - // use the change to the cfg file. - public override bool Write() - { - // check for cfg file existence - FileInfo fi = new FileInfo(Location); - if (fi.Exists) - { - if(changeLocation)_Location=tmpLocation; - changeLocation=false; - this._Title = "VE-PROMS Data " + Location; - usrRunTime.ucfgpath = Location; - return true; - } - else - { - MessageBox.Show("The file that was specified does not exist."); - return false; - } - } - - // add a new datapath - public override Object MakeNewChild() - { - VEO_DataPathN dp = new VEO_DataPathN(usrRunTime,null,null); - return dp; - } - - // check that the directory input by the user exists. If so, add the - // directory & title to the cfg file. - public override bool SaveChild(Object obj) - { - VEO_DataPathN dp = (VEO_DataPathN) obj; - // B2007-005 - // If the user didn't enter a location, then show an error message - //and don't continue with the save. - if (dp.Location == null || dp.Location.Length == 0) - { - MessageBox.Show("No data path Location specified.","Error"); - return false; - } - dp.SaveFields(); - // Check for existance of directory if it doesn't exist give message - // and return; - string pth = dp._Location; - DirectoryInfo di = new DirectoryInfo(pth); - if (di.Exists == false) - { - try - { - di.Create(); - } - catch - { - MessageBox.Show("Directory for data path doesn't exist, and could not be created."); - } - return false; - } - - string newcfgpth = dp._Location+","+dp._Title+";"; - usrRunTime.AddPathToCfg(newcfgpth); - return true; - } - - public override void DoListView(ListView veoListView) - { - ListViewItem item=null; - veoListView.Columns.Add("Location", 120, HorizontalAlignment.Left); - veoListView.Columns.Add("Title", 300, HorizontalAlignment.Left); - - for (int i=0; i - /// NOTE: cmbType (the combo box that contains the document types) must match - /// the order of document types given in the ProcTypeOptions for this dialog - /// to work correctly - /// - public class LDProperties : System.Windows.Forms.Form - { - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Button btnApply; - private VEO_Base _ParentObj; - private VEO_Base _CurObj; - private bool isnew; - private System.Windows.Forms.TabControl tabControl1; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private System.Windows.Forms.TabPage tbPageUsage; - private System.Windows.Forms.PropertyGrid myPropertyGrid; - private System.Windows.Forms.TabPage tbGeneral; - private System.Windows.Forms.Label lblUsage; - private System.Windows.Forms.ListBox lbUsage; - private bool canedit; - - public LDProperties(Object parent, Object curobj) - { - // - // Required for Windows Form Designer support - // - _ParentObj = (VEO_Base) parent; - _CurObj = (VEO_Base) curobj; - VEO_LibDoc ld = (VEO_LibDoc) curobj; - if (ld.isNew == true) - isnew=true; - else - isnew=false; - - InitializeComponent(); - - this.myPropertyGrid.SelectedObject=curobj; - if (isnew == true) - { - this.tabControl1.TabPages.Remove(this.tbPageUsage); - canedit=true; - } - else - { - if (this.tabControl1.TabPages.Contains(this.tbPageUsage)==false) - this.tabControl1.TabPages.Add(this.tbPageUsage); - ld.GetUsages(); - foreach (string usg in ld.usages) - { - this.lbUsage.Items.Add(usg); - } - } - - if((_CurObj.canEdit()==false)&&!isnew) - { - canedit=false; - this.myPropertyGrid.Enabled=false; - } - else if (!isnew) - { - canedit=true; - this.myPropertyGrid.Enabled=true; - } - this.lblUsage.Text = "'" + ld.Title + "' is used in..."; - btnApply.Enabled = false; - // make apply button visible if modify - this.btnApply.Visible = !isnew; - } - - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(LDProperties)); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.btnApply = new System.Windows.Forms.Button(); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tbGeneral = new System.Windows.Forms.TabPage(); - this.myPropertyGrid = new System.Windows.Forms.PropertyGrid(); - this.tbPageUsage = new System.Windows.Forms.TabPage(); - this.lblUsage = new System.Windows.Forms.Label(); - this.lbUsage = new System.Windows.Forms.ListBox(); - this.tabControl1.SuspendLayout(); - this.tbGeneral.SuspendLayout(); - this.tbPageUsage.SuspendLayout(); - this.SuspendLayout(); - // - // btnOK - // - this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnOK.Location = new System.Drawing.Point(424, 296); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(64, 24); - this.btnOK.TabIndex = 8; - this.btnOK.Text = "OK"; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnCancel.Location = new System.Drawing.Point(504, 296); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(64, 24); - this.btnCancel.TabIndex = 9; - this.btnCancel.Text = "Cancel"; - this.btnCancel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // btnApply - // - this.btnApply.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnApply.Location = new System.Drawing.Point(584, 296); - this.btnApply.Name = "btnApply"; - this.btnApply.Size = new System.Drawing.Size(56, 24); - this.btnApply.TabIndex = 10; - this.btnApply.Text = "Apply"; - this.btnApply.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnApply.Click += new System.EventHandler(this.btnApply_Click); - // - // tabControl1 - // - this.tabControl1.Controls.Add(this.tbGeneral); - this.tabControl1.Controls.Add(this.tbPageUsage); - this.tabControl1.Location = new System.Drawing.Point(0, 0); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(784, 280); - this.tabControl1.TabIndex = 17; - // - // tbGeneral - // - this.tbGeneral.Controls.Add(this.myPropertyGrid); - this.tbGeneral.Location = new System.Drawing.Point(4, 22); - this.tbGeneral.Name = "tbGeneral"; - this.tbGeneral.Size = new System.Drawing.Size(776, 254); - this.tbGeneral.TabIndex = 0; - this.tbGeneral.Text = "General"; - // - // myPropertyGrid - // - this.myPropertyGrid.CommandsVisibleIfAvailable = true; - this.myPropertyGrid.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.myPropertyGrid.HelpVisible = false; - this.myPropertyGrid.LargeButtons = false; - this.myPropertyGrid.LineColor = System.Drawing.SystemColors.ScrollBar; - this.myPropertyGrid.Location = new System.Drawing.Point(8, 39); - this.myPropertyGrid.Name = "myPropertyGrid"; - this.myPropertyGrid.Size = new System.Drawing.Size(736, 94); - this.myPropertyGrid.TabIndex = 16; - this.myPropertyGrid.Text = "Properties"; - this.myPropertyGrid.ToolbarVisible = false; - this.myPropertyGrid.ViewBackColor = System.Drawing.SystemColors.Window; - this.myPropertyGrid.ViewForeColor = System.Drawing.SystemColors.WindowText; - this.myPropertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.myPropertyGrid_PropertyValueChanged); - // - // tbPageUsage - // - this.tbPageUsage.Controls.Add(this.lblUsage); - this.tbPageUsage.Controls.Add(this.lbUsage); - this.tbPageUsage.Location = new System.Drawing.Point(4, 22); - this.tbPageUsage.Name = "tbPageUsage"; - this.tbPageUsage.Size = new System.Drawing.Size(776, 254); - this.tbPageUsage.TabIndex = 1; - this.tbPageUsage.Text = "Usages"; - // - // lblUsage - // - this.lblUsage.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblUsage.Location = new System.Drawing.Point(16, 8); - this.lblUsage.Name = "lblUsage"; - this.lblUsage.Size = new System.Drawing.Size(624, 24); - this.lblUsage.TabIndex = 22; - // - // lbUsage - // - this.lbUsage.Location = new System.Drawing.Point(16, 40); - this.lbUsage.Name = "lbUsage"; - this.lbUsage.Size = new System.Drawing.Size(624, 199); - this.lbUsage.TabIndex = 21; - // - // LDProperties - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(768, 326); - this.Controls.Add(this.tabControl1); - this.Controls.Add(this.btnApply); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnOK); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "LDProperties"; - this.Text = "Library Document Properties"; - this.tabControl1.ResumeLayout(false); - this.tbGeneral.ResumeLayout(false); - this.tbPageUsage.ResumeLayout(false); - this.ResumeLayout(false); - - } - #endregion - - - // save was clicked, use the objects save methods. - private bool saveclick() - { - bool success = true; - - if (isnew) - { - if(_ParentObj==null) - { - DialogResult=DialogResult.Cancel; - return true; - } - - success=_ParentObj.SaveChild(_CurObj); - } - else - { - success=_CurObj.Write(); - } - return success; - - } - // save was clicked, use the objects save methods. - private void btnOK_Click(object sender, System.EventArgs e) - { - bool success = true; - if(canedit)success = saveclick(); - if (success==true) - { - DialogResult = DialogResult.OK; - this.Close(); - } - } - - private void btnApply_Click(object sender, System.EventArgs e) - { - if(canedit)return; - bool success = saveclick(); - if(success==true)btnApply.Enabled=false; - Refresh(); - } - - private void btnCancel_Click(object sender, System.EventArgs e) - { - if(!canedit)return; - _CurObj.Restore(); - } - - private void myPropertyGrid_PropertyValueChanged(object s, System.Windows.Forms.PropertyValueChangedEventArgs e) - { - btnApply.Enabled = true; - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/LDProperties.resx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/LDProperties.resx deleted file mode 100644 index debd8295..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/LDProperties.resx +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - True - - - False - - - True - - - Private - - - Private - - - 8, 8 - - - True - - - False - - - True - - - Private - - - Private - - - 8, 8 - - - False - - - Private - - - Private - - - False - - - True - - - True - - - Private - - - Private - - - 8, 8 - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - False - - - (Default) - - - False - - - LDProperties - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - Private - - - - AAABAAEA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ectsOld/LibSource/ZZZNotUsed/VEObject/LibDoc.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/LibDoc.cs deleted file mode 100644 index 9ce3b52b..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/LibDoc.cs +++ /dev/null @@ -1,403 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: LibDoc.cs $ $Revision: 6 $ - * $Author: Kathy $ $Date: 5/31/06 9:47a $ - * - * $History: LibDoc.cs $ - * - * ***************** Version 6 ***************** - * User: Kathy Date: 5/31/06 Time: 9:47a - * Updated in $/LibSource/VEObject - * Fixed B2006-023 - library document usages, duplicates and missing - * procedure titles - * - * ***************** Version 5 ***************** - * User: Kathy Date: 2/08/06 Time: 10:22a - * Updated in $/LibSource/VEObject - * Fix B2006-004 - usages not found - * - * ***************** Version 4 ***************** - * User: Kathy Date: 5/31/05 Time: 12:42p - * Updated in $/LibSource/VEObject - * crash on save if no comment - * - * ***************** Version 3 ***************** - * User: Kathy Date: 5/25/05 Time: 10:32a - * Updated in $/LibSource/VEObject - * Allow edits for tmpchg - * - * ***************** Version 2 ***************** - * User: Kathy Date: 1/31/05 Time: 11:05a - * Updated in $/LibSource/VEObject - * Fix B2005-005 - this just fixed empty icon usage - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:53a - * Created in $/LibSource/VEObject - *********************************************************************************************/ - -using System; -using System.IO; -using System.Windows.Forms; -using System.ComponentModel; -using System.Collections; -using System.Data; -using VDB_TransUsage; -using Utils; - -namespace VEObject -{ - /// - /// Summary description for LibDoc. - /// - public class VEO_LibDoc : VEO_Base - { - string _Comment; - public ArrayList usages; - public string ldname; - private string tmpRtfFileName; - protected bool changeTitle; - protected bool changeComment; - protected string tmpTitle; - protected string tmpComment; - - public VEO_LibDoc(string ipath, VEO_DummyLibDoc ld, bool inew) - { - iconStates = new int[5] {15,15,15,15,15}; - string loctitle=null; - string loccomment=null; - _Location = ipath; - VEObjectType = (int)VEObjectTypesDefs.LibraryDoc; - parentObj = ld; - usages = new ArrayList(); - isNew = inew; - // use the path to open the file & read the title & comment - FileInfo fi = new FileInfo(ipath); - FileStream fs=null; - fs = fi.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite ); - BinaryReader br = new BinaryReader(fs,System.Text.ASCIIEncoding.ASCII); - int cntPage = br.ReadInt16(); - if(cntPage != -1) - { // Not End of File - int nchar = br.ReadInt16(); - string tmp = new string(br.ReadChars(nchar)); - loctitle = tmp.Substring(0,tmp.Length-1); // remove null at end. - nchar = br.ReadInt16(); - if (nchar>0) - { - tmp = new String(br.ReadChars(nchar)); - loccomment = tmp.Substring(0,tmp.Length-1); // remove null at end. - } - } - br.Close(); - fs.Close(); - if (loctitle!=null) - _Title = loctitle; - else - _Title=ipath; - _Comment = loccomment; - VEO_Base tmp1 = (VEO_Base) ld.parentObj; - usrRunTime = tmp1.usrRunTime; - string pthnm = this._Location.Substring(0,_Location.ToUpper().IndexOf(".LIB")); - ldname = pthnm.Substring(_Location.LastIndexOf("\\")+1,8); - LoadLockInfo(); - icon = iconStates[(int) Lock.LockStatus]; - } - - [Description("Location"),Category("Library Document"),ReadOnly(true)]public string Location - { - get{return _Location;} - set{_Location=value;} - } - - [Description("Title"),Category("Library Document")]public string Title - { - get - { - if(!changeTitle) - return _Title; - else - return tmpTitle; - } - set - { - changeTitle=true; - tmpTitle=value; - } - } - - [Description("Comment"),Category("Library Document")]public string Comment - { - get - { - if(!changeComment) - return _Comment; - else - return tmpComment; - } - set - { - changeComment=true; - tmpComment=value; - } - } - - public override bool PropertiesDlg(Object parent) - { - LDProperties propdlg = new LDProperties(parent, this); - if (propdlg.ShowDialog() == DialogResult.OK) return true; - - // for New libdoc, a file was created in order for dialog to work, - // remove it on cancel. - if (this.isNew && File.Exists(_Location)) File.Delete(_Location); - return false; - } - - public void GetUsages() - { - usages.Clear(); - VEO_DummyLibDoc dl = (VEO_DummyLibDoc) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) dl.parentObj; - string pth = ps._curDirectory+"\\"+ps.Location+"\\tran.dbf"; - vdb_TransUsage transusg = new vdb_TransUsage(pth); - DataSet ds = transusg.GetSortedByToTrans("[TONUMBER] = \'"+ldname.ToUpper() + "\' OR [TONUMBER] = \'" + ldname.ToLower()+"\'"); - VEO_DummySet dset = (VEO_DummySet) ps.Children[1]; - if (ds.Tables[0].Rows.Count !=0) - { - foreach(DataRow dr in ds.Tables[0].Rows) - { - string usg = dr["FROMNUMBER"].ToString(); - string titl = null; - if (dset.Children.Count==0) dset.Read(false); - foreach(Object obj in dset.Children) - { - VEO_Proc prc = (VEO_Proc) obj; - if (usg == prc._Prcnum) - { - titl = prc._Title; - break; - } - } - usages.Add(usg + " " + titl); - } - } - transusg = null; - } - - public override bool SaveNew(string dummy) - { - // since the file was created before creating this object, use the 'Write' method - // to save it. - bool success = Write(); - isNew=false; - // the parent icon cannot be empty. - VEO_DummyLibDoc ld = (VEO_DummyLibDoc) parentObj; - ld.icon = ld.iconStates[0]; - ld.IsEmpty=false; - return success; - } - - public override bool Write() - { - string origfile=null; - if (isNew||changeTitle||changeComment) - { - try - { - // rename file extension to bak & rewrite it. - origfile = _Location.Substring(0,_Location.Length-3) + "BAK"; - File.Delete(origfile); - File.Move(_Location,origfile); - - FileStream chgfile = new FileStream(_Location, FileMode.Create); - BinaryWriter bw = new BinaryWriter(chgfile,System.Text.Encoding.ASCII); - - // Write out header to the new file - short j=0; - bw.Seek(0,SeekOrigin.Begin); - bw.Write(j); // temporary page count value (reset on pagination) - j=(short)(Title.Length+1); - bw.Write(j); - char [] xbuf = new char[Title.Length]; - xbuf = Title.ToCharArray(); - bw.Write(xbuf); - bw.Write((byte)0); // add null for end of string - - j=0; - if (Comment != null) j=(short)(Comment.Length+1); - bw.Write(j); - if(j>0) - { - xbuf = new char[Comment.Length]; - xbuf = Comment.ToCharArray(); - bw.Write(xbuf); - bw.Write((byte)0); - } - - // Now open the original file for reading data, get past the header info - // first. - FileStream oldfile = new FileStream(origfile, FileMode.Open, FileAccess.Read); - BinaryReader br = new BinaryReader(oldfile,System.Text.ASCIIEncoding.ASCII); - int cntPage = br.ReadInt16(); - if(cntPage != -1) - { // Not End of File - int nchar = br.ReadInt16(); - string tmp = new string(br.ReadChars(nchar)); - nchar = br.ReadInt16(); - if (nchar>0)tmp = new String(br.ReadChars(nchar)); - } - - byte ac; - bool done = false; - while(done==false) - { - if (br.PeekChar() >0) - { - ac = br.ReadByte(); - bw.Write(ac); - } - else - done=true; - } - br.Close(); - bw.Close(); - oldfile.Close(); - chgfile.Close(); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error on library document save."); - if (origfile!=null) - { - File.Delete(_Location); - File.Move(origfile,_Location); - } - return false; - } - if(origfile!=null)File.Delete(origfile); - if(changeComment) - { - _Comment=tmpComment; - changeComment=false; - } - if(changeTitle) - { - _Title=tmpTitle; - changeTitle=false; - } - } - return true; - } - - private bool canDelete() - { - if (usages.Count == 0) GetUsages(); - if (usages.Count > 0) - { - MessageBox.Show("Cannot delete library document, it is used."); - return false; - } - return true; - } - public override bool Delete() - { - // first see if the library document can be deleted (if it is used, it cannot - // be deleted. - if (canDelete()==false) return false; - File.Delete(_Location); - // if this is the only library document. then set the parents, icon to empty - VEO_DummyLibDoc ld = (VEO_DummyLibDoc) this.parentObj; - if (ld.Children.Count==1) IsEmpty=true; // just this one. - return true; - } - - public string GetContentsFile() - { - return tmpRtfFileName; - } - - public void ClearContentsFile() - { - if(tmpRtfFileName!=null)File.Delete(tmpRtfFileName); - tmpRtfFileName=null; - } - - public bool ReadContentsFile() - { - try - { - // Open the file for reading data, get past the header info first. - FileStream ldfile = new FileStream(_Location, FileMode.Open, FileAccess.Read); - BinaryReader br = new BinaryReader(ldfile,System.Text.ASCIIEncoding.ASCII); - tmpRtfFileName = Path.GetTempFileName(); - FileStream tmpfile = new FileStream(tmpRtfFileName, FileMode.Create); - BinaryWriter bw = new BinaryWriter(tmpfile,System.Text.Encoding.ASCII); - - int cntPage = br.ReadInt16(); - if(cntPage != -1) - { - int nchar = br.ReadInt16(); - string tmp = new string(br.ReadChars(nchar)); - nchar = br.ReadInt16(); - if (nchar>0)tmp = new String(br.ReadChars(nchar)); - } - byte ac; - bool done = false; - while(done==false) - { - if (br.PeekChar() >0) - { - ac = br.ReadByte(); - bw.Write(ac); - } - else - done=true; - } - br.Close(); - ldfile.Close(); - bw.Close(); - tmpfile.Close(); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error reading Library Document"); - return false; - } - return true; - } - - public override void AddToTree(TreeNode parentnd) - { - } - - public override bool Expand(TreeNode parentnd) - { - return true; - } - - public override bool mnuAllowNew() - { - return false; - } - - public override bool mnuAllowDelete() - { - return AllowMods(); - } - public override bool canEdit() - { - return AllowMods(); - } - private bool AllowMods() - { - VEO_DummyLibDoc ds = (VEO_DummyLibDoc) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - if (ps.isApproved == true) return false; - if (amILockedByMe()==false) return false; - if ((ps.accessFlags&Security.LIBRARYDOCS)==Security.LIBRARYDOCS) return true; - return false; - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/PSProperties.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/PSProperties.cs deleted file mode 100644 index 9f78a3f8..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/PSProperties.cs +++ /dev/null @@ -1,1281 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: PSProperties.cs $ $Revision: 16 $ - * $Author: Jsj $ $Date: 1/08/08 11:37a $ - * - * $History: PSProperties.cs $ - * - * ***************** Version 16 ***************** - * User: Jsj Date: 1/08/08 Time: 11:37a - * Updated in $/LibSource/VEObject - * B2008-001 fixed Enum selection problem when creating new Deviation Set - * (for NSP) - * - * ***************** Version 15 ***************** - * User: Jsj Date: 5/15/07 Time: 9:41a - * Updated in $/LibSource/VEObject - * Allow edit of a Slave Set's title. - * - * ***************** Version 14 ***************** - * User: Jsj Date: 10/20/06 Time: 9:35a - * Updated in $/LibSource/VEObject - * Combo box setup and pre select item fix - * - * ***************** Version 13 ***************** - * User: Kathy Date: 6/27/05 Time: 11:35a - * Updated in $/LibSource/VEObject - * Proc.ini & Set.ini readonly rather than enabled property for edit mode - * - * ***************** Version 12 ***************** - * User: Jsj Date: 6/10/05 Time: 9:46a - * Updated in $/LibSource/VEObject - * disable parent list (backgrounds, deviations, slaves) if a lock is NOT - * set. - * - * ***************** Version 11 ***************** - * User: Kathy Date: 5/25/05 Time: 10:32a - * Updated in $/LibSource/VEObject - * Allow edits for tmpchg - * - * ***************** Version 10 ***************** - * User: Jsj Date: 5/12/05 Time: 11:52a - * Updated in $/LibSource/VEObject - * fixed unhandled exception problem when changing enhanced doc parent - * - * ***************** Version 9 ***************** - * User: Jsj Date: 5/06/05 Time: 12:08p - * Updated in $/LibSource/VEObject - * bug fix setting creating new enhanced document set (setting up) - * - * ***************** Version 8 ***************** - * User: Kathy Date: 4/21/05 Time: 10:24a - * Updated in $/LibSource/VEObject - * remove upgrade2005 define - * - * ***************** Version 7 ***************** - * User: Jsj Date: 4/15/05 Time: 9:47a - * Updated in $/LibSource/VEObject - * bug fix B2005-021, parent and erg selection wasn't sticking when - * changed for backgrounds, deviations, and slaves - * - * ***************** Version 6 ***************** - * User: Jsj Date: 4/08/05 Time: 10:56a - * Updated in $/LibSource/VEObject - * added tab for SET.INI - * - * ***************** Version 5 ***************** - * User: Kathy Date: 3/22/05 Time: 10:10a - * Updated in $/LibSource/VEObject - * approve: change bar removal checkbox - * - * ***************** Version 4 ***************** - * User: Kathy Date: 2/10/05 Time: 12:36p - * Updated in $/LibSource/VEObject - * B2005-012: No apply button for new - * - * ***************** Version 3 ***************** - * User: Kathy Date: 1/10/05 Time: 1:01p - * Updated in $/LibSource/VEObject - * B2004-062: allow new set PROCS & PROCS2 - * - * ***************** Version 2 ***************** - * User: Jsj Date: 11/12/04 Time: 10:35a - * Updated in $/LibSource/VEObject - * Logic to support EOP to ERG relationships - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:53a - * Created in $/LibSource/VEObject - *********************************************************************************************/ - -using System; -using System.IO; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Text; -using System.Data; -using Utils; -using VDB_Set; -using IniFileIO; - - -namespace VEObject -{ - /// - /// NOTE: cmbType (the combo box that contains the document types) must match - /// the order of document types given in the ProcTypeOptions for this dialog - /// to work correctly - /// - public class PSProperties : System.Windows.Forms.Form - { - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Button btnApply; - private VEO_Base _ParentObj; - private VEO_Base _CurObj; - private ArrayList ERGPaths; // map to titles in cmbGuildLink; - private ArrayList ParentPaths; // map to titles in cmbPLink; - private ArrayList EopErgRelations; // translation table array - private ArrayList ERGinfoList; // ERG SET file info - private EopToErgRelations RelationshipTbl; // translation file class - private bool isnew; - private System.Windows.Forms.Button btnCurSet; - private System.Windows.Forms.Label lblGdLink; - private System.Windows.Forms.ComboBox cmbGuideLink; - private System.Windows.Forms.Label lblPLink; - private System.Windows.Forms.ComboBox cmbPLink; - private System.Windows.Forms.Label lblType; - private System.Windows.Forms.ComboBox cmbType; - private System.Windows.Forms.PropertyGrid myPropertyGrid; - private System.Windows.Forms.TabPage tbGeneral; - private System.Windows.Forms.TabPage tbPageAdvanced; - private System.Windows.Forms.TextBox tbIniText; - private System.Windows.Forms.Label lblIniFile; - private System.Windows.Forms.Label lblExtraRev; - private System.Windows.Forms.TextBox tbExtraRev; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private bool changeProcIniFile; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.ListBox lbEopRelateList; - private System.Windows.Forms.ComboBox cbErgRelateList; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.TabPage tbERG_Relate; - private bool canedit; - private bool blnDontCallChange; // change EOP/ERG relation? - private static bool AlreadySetup; - private System.Windows.Forms.CheckBox cbChgBarApp; - private System.Windows.Forms.Label lblSetINI; - private System.Windows.Forms.TabPage tbpgSetINI; - private bool changeSetIniFile; - private System.Windows.Forms.TextBox tbSetIniText; - private System.Windows.Forms.TabControl tabControl1; - private bool blnNeedToWriteEopErgTable; // write the translation table? - - public PSProperties(Object parent, Object curobj) - { - // - // Required for Windows Form Designer support - // - _ParentObj = (VEO_Base) parent; - _CurObj = (VEO_Base) curobj; - VEO_ProcSet tmpPS = (VEO_ProcSet)curobj; - if (tmpPS.isNew == true) - isnew=true; - else - isnew=false; - - changeProcIniFile=false; - changeSetIniFile=false; - AlreadySetup=false; - blnNeedToWriteEopErgTable=false; - InitializeComponent(); - - this.cmbType.Items.Add("Standard"); - this.cmbType.Items.Add("Slave"); - if (!isnew || (isnew&&_CurObj.usrRunTime.SerialNumber.GetSNOption((uint)Utils.SerialNo.SN_Flags.SN_BACKGROUND_ON)>0)) - this.cmbType.Items.Add("Background"); - if (!isnew || (isnew&&_CurObj.usrRunTime.SerialNumber.GetSNOption((uint)Utils.SerialNo.SN_Flags.SN_DEVIATION_ON)>0)) - this.cmbType.Items.Add("Deviation"); - - this.myPropertyGrid.SelectedObject=curobj; - ERGPaths = new ArrayList(); - ParentPaths = new ArrayList(); - if(tmpPS.hasExtraRevNumber) - { - this.lblExtraRev.Visible = true; - this.tbExtraRev.Visible = true; - } - else - { - this.lblExtraRev.Visible = false; - this.tbExtraRev.Visible = false; - } - - // If new, combo box should have 'Standard' & neither link combo boxes - // are visible. - VEO_ProcSet ps = (VEO_ProcSet)curobj; - - if (isnew == true) - { - this.cmbType.Enabled = true; - // setting selectedindex will set up the new file names too. - this.cmbType.SelectedIndex = (int)VEObject.ProcTypeOptions.Standard; - this.cmbGuideLink.Visible = false; - this.cmbPLink.Visible = false; - this.lblGdLink.Visible = false; - this.lblPLink.Visible = false; - this.btnCurSet.Visible = false; - //this.btnEditIni.Visible = false; NOTE - on note, make advanced tab invisible - lblIniFile.Text = ps._curDirectory + "\\" + ps._Location + "\\proc.ini"; - } - else - { - this.btnCurSet.Visible = true; - //this.btnEditIni.Visible = true; see above comment - this.cmbType.Enabled = false; - // if this isn't a new object, set up the data for type, i.e. - // standard, background & deviation. If it's background or deviation, - // then need to set links to. - - this.cmbType.SelectedIndex = (int) ps._ProcType; - this.lblPLink.Visible = ps._ProcType != VEObject.ProcTypeOptions.Standard; - this.cmbPLink.Visible = ps._ProcType != VEObject.ProcTypeOptions.Standard; - this.cmbPLink.Enabled = (ps._ProcType != VEObject.ProcTypeOptions.Slave && _CurObj.canEdit()); - this.lblGdLink.Visible = ps._ProcType.Equals(VEObject.ProcTypeOptions.Deviation); - this.cmbGuideLink.Visible = ps._ProcType.Equals(VEObject.ProcTypeOptions.Deviation); - if (ps.hasExtraRevNumber) this.tbExtraRev.Text = ps.ExtraRevNumber; - if (ps._ProcType != VEObject.ProcTypeOptions.Standard) SetupComboBoxes(ps._ProcType); - // setup PROC.INI tab - lblIniFile.Text = ps._curDirectory + "\\" + ps._Location + "\\proc.ini"; - if (File.Exists(lblIniFile.Text)) - { - // if proc.ini exists, read it into the text - // box. - StreamReader sr = new StreamReader(lblIniFile.Text); - this.tbIniText.Text = sr.ReadToEnd(); - sr.Close(); - } - // setup SET.INI tab - lblSetINI.Text = ps._curDirectory + "\\" + ps._Location + "\\set.ini"; - if (File.Exists(lblSetINI.Text)) - { - // if set.ini exists, read it into the text - // box. - StreamReader sr = new StreamReader(lblSetINI.Text); - this.tbSetIniText.Text = sr.ReadToEnd(); - sr.Close(); - } - // set this after the text is set because it was getting called when the ini file - // was read. - this.tbIniText.TextChanged += new System.EventHandler(this.tbIniText_TextChanged); - this.tbSetIniText.TextChanged += new System.EventHandler(this.tbSetIniText_TextChanged); - this.cbChgBarApp.Checked=ps.tmpRmChgBarOnApp; - } - if((_CurObj.canEdit()==false)&&!isnew) - { - canedit=false; - this.myPropertyGrid.Enabled=false; - this.tbIniText.ReadOnly=true; - this.tbSetIniText.ReadOnly=true; - this.tbExtraRev.Enabled=false; - this.cbChgBarApp.Enabled=false; - } - else - { - canedit=true; -// Bug fix: B2007-012 -// Could not edit a Slave set's title when a lock was set. -// -// if (ps!=null && ((!ps.isTempChange && ps.isApproved) || ps._ProcType == VEObject.ProcTypeOptions.Slave)) - if (ps!=null && (!ps.isTempChange && ps.isApproved) ) - this.myPropertyGrid.Enabled=false; - else - this.myPropertyGrid.Enabled=true; - if (ps.isApproved||ps.isTempChange) this.cbChgBarApp.Visible=false; - this.tbIniText.ReadOnly=false; - this.tbSetIniText.ReadOnly=false; - this.tbExtraRev.Enabled=true; - } - btnApply.Enabled = false; - // make apply button visible if modify - this.btnApply.Visible = !isnew; - } - - private void SetupComboBoxes(VEObject.ProcTypeOptions setType) - { - if (AlreadySetup) return; - AlreadySetup = true; - if (setType==VEObject.ProcTypeOptions.Standard) return; - // for all of the 'standard' procedure sets in this parent plant directory, - // add to Parent combo box. - VEO_ProcSet ps = (VEO_ProcSet) _CurObj; - string parLink = null; - if (!isnew) parLink = ps.parentLink; // this is current, make active in cmbbox - - int parindx=0; // which combo box item matches the parent set. - bool first = true; - int cntproc=0; - int len = _ParentObj.Children.Count; - for (int i = 0; i-1) - { - DirectoryInfo direct = new DirectoryInfo(parLink); - expand_dir = direct.Name; - } - if (parLink != null && tmppth.ToUpper()==expand_dir.ToUpper()) - { - parLink=null; - parindx = cntproc+1; - } - ParentPaths.Add(tmppth); - cntproc++; - } - } - if (this.cmbPLink.Items.Count<1) - { // could not find any doc sets suitable for linking - this.cmbPLink.Items.Add("No Linkable Document Sets Found"); - this.cmbPLink.Enabled=false; // make read only - this.cmbPLink.SelectedIndex = 0; - } - else - this.cmbPLink.SelectedIndex = parindx; - - if (!isnew) - { - if (parLink != null) - { - this.cmbPLink.Items.RemoveAt(0); - this.cmbPLink.Items.Insert(0,"NOT FOUND: " + parLink); -// this.cmbPLink.Items.Add("NOT FOUND: " + parLink); -// this.cmbPLink.SelectedIndex = this.cmbPLink.Items.Count -1; - } -// jsj allow user to change selected parent if a lock is set -//jsj this.cmbPLink.Enabled = false; - this.cmbPLink.Enabled = _CurObj.canEdit(); - } - - string gdLink = null; - int devindx=0; - if (!isnew /*&& setType==VEObject.ProcTypeOptions.Deviation*/) - { - gdLink = ps.GetGuideLink(); - if (gdLink != null) - gdLink = Path.GetFullPath(gdLink); // get path selected - else - return; //no erg path set, no relationship tab - } - - VEO_Plant plnt = (VEO_Plant) ps.parentObj; - VEO_DataPath dp = (VEO_DataPath) plnt.parentObj; - int numitems = dp.Children.Count; - - VEO_Plant cplnt; - for(int i=0;i-1 || uloc.IndexOf("\\VELP")>-1 - || uloc.IndexOf("\\VEREV")>-1) - { - bool didread=false; - if (cplnt.Children.Count==0) - { - cplnt.Read(false); - didread=true; - } - // loop through the list of procedure set directories, - // but only list the working draft. - first = true; - for (int j=0; j-1)||(gps._Location.IndexOf(".SL")>-1)) - this.cmbGuideLink.Items.Add(gps._Title); - else - this.cmbGuideLink.Items.Add(cplnt._Title); - if (gdLink != null && gdLink.ToUpper() == gps._curDirectory.ToUpper() + "\\" + gps._Location.ToUpper()) - { - gdLink = null; - // bug fix B2006-044 - // we were pre-selecting the wrong ERG -// devindx = j+1; - devindx = this.cmbGuideLink.Items.Count - 1; - } - - ERGPaths.Add(gps._curDirectory+ "\\" + gps._Location); - } - } - if(didread) cplnt.Children.Clear(); - } - } - if (this.cmbGuideLink.Items.Count<1) - { // no Generic Guidline (ERGs) data found - this.cmbGuideLink.Items.Add("Generic Guidelines Not Found"); - this.cmbGuideLink.Enabled = false; - this.cmbGuideLink.SelectedIndex = 0; - } - else - this.cmbGuideLink.SelectedIndex = devindx; - if (!isnew) - { - if (gdLink != null) - { - this.cmbGuideLink.Items.Add("NOT FOUND: "+gdLink); - } -// jsj allow user to change ERG selection -// jsj this.cmbGuideLink.Enabled = false; - this.cmbGuideLink.Enabled = _CurObj.canEdit(); - } - // Read in the Translastion table file (TRANSL.TBL) and setup - // the relationship dialog boxes. - jsj - SetupRelationshipTab(); - } - - private string GetNextSlaveDirExtension(string strMasterPrefix) - { - int slvNum = 1; - string slExt = ".sl" + slvNum.ToString("D"); - string SlaveDir = strMasterPrefix + slExt; - - while (Directory.Exists(SlaveDir)) - { - slvNum++; - string OLDslExt = slExt; - slExt = ".sl" + slvNum.ToString("D"); - SlaveDir = SlaveDir.Replace(OLDslExt,slExt); - } - return SlaveDir; - } - - private void SetupNewFileName() - { - int i=0; - bool skipSlaveExt = true; - StringBuilder newname = new StringBuilder(); - string MstrDir = ""; - - VEO_ProcSet ps = (VEO_ProcSet) _CurObj; - - if (this.cmbType.SelectedIndex == (int)VEObject.ProcTypeOptions.Slave) - { - MstrDir = (string) this.ParentPaths[this.cmbPLink.SelectedIndex]; - if (MstrDir.Equals("Null")) - { - MstrDir = "** SELECT A PARENT SET TO BE THE MASTER **"; - } - else - { - MstrDir = MstrDir.ToLower(); - int idx = MstrDir.LastIndexOf(".prc"); - if (idx > 0) - { - MstrDir = MstrDir.Substring(0,idx); - } - idx = MstrDir.LastIndexOf('\\'); - if (idx > 0) - MstrDir = MstrDir.Substring(idx+1); - skipSlaveExt = false; - } - newname.Append(MstrDir); - } - - bool do_procs=false; - while(i==0 || Directory.Exists(newname.ToString())) - { - newname.Remove(0,newname.Length); - // if there is no procs directory & the user is making a standard - // procedure set, default to Procs (B20054-062) - if ((this.cmbType.Text=="Standard")&&(!Directory.Exists("Procs"))) - { - newname.Append("PROCS"); - do_procs=true; - } - else if (MstrDir.Equals("")) - { - newname.Append("PROC"); - newname.Append(i.ToString("")); - } - if (!do_procs) - { - if (this.cmbType.Text == "Background") - newname.Append(".BCK"); - else if (this.cmbType.Text == "Deviation") - newname.Append(".DVT"); - else if (this.cmbType.SelectedIndex == (int)VEObject.ProcTypeOptions.Slave) - { - if (!skipSlaveExt) - newname.Append(GetNextSlaveDirExtension(MstrDir)); // .SLx - else - newname.Append(MstrDir); - } - else - newname.Append(".PRC"); - } - i++; - } - ps.Location = newname.ToString(); - lblIniFile.Text = ps._curDirectory + "\\" + ps._Location + "\\proc.ini"; - this.myPropertyGrid.SelectedObject=_CurObj; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(PSProperties)); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.btnApply = new System.Windows.Forms.Button(); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tbGeneral = new System.Windows.Forms.TabPage(); - this.cbChgBarApp = new System.Windows.Forms.CheckBox(); - this.tbExtraRev = new System.Windows.Forms.TextBox(); - this.lblExtraRev = new System.Windows.Forms.Label(); - this.btnCurSet = new System.Windows.Forms.Button(); - this.lblGdLink = new System.Windows.Forms.Label(); - this.cmbGuideLink = new System.Windows.Forms.ComboBox(); - this.lblPLink = new System.Windows.Forms.Label(); - this.cmbPLink = new System.Windows.Forms.ComboBox(); - this.lblType = new System.Windows.Forms.Label(); - this.cmbType = new System.Windows.Forms.ComboBox(); - this.myPropertyGrid = new System.Windows.Forms.PropertyGrid(); - this.tbPageAdvanced = new System.Windows.Forms.TabPage(); - this.lblIniFile = new System.Windows.Forms.Label(); - this.tbIniText = new System.Windows.Forms.TextBox(); - this.tbpgSetINI = new System.Windows.Forms.TabPage(); - this.lblSetINI = new System.Windows.Forms.Label(); - this.tbSetIniText = new System.Windows.Forms.TextBox(); - this.tbERG_Relate = new System.Windows.Forms.TabPage(); - this.label2 = new System.Windows.Forms.Label(); - this.cbErgRelateList = new System.Windows.Forms.ComboBox(); - this.lbEopRelateList = new System.Windows.Forms.ListBox(); - this.label1 = new System.Windows.Forms.Label(); - this.tabControl1.SuspendLayout(); - this.tbGeneral.SuspendLayout(); - this.tbPageAdvanced.SuspendLayout(); - this.tbpgSetINI.SuspendLayout(); - this.tbERG_Relate.SuspendLayout(); - this.SuspendLayout(); - // - // btnOK - // - this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnOK.Location = new System.Drawing.Point(509, 342); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(77, 27); - this.btnOK.TabIndex = 8; - this.btnOK.Text = "OK"; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnCancel.Location = new System.Drawing.Point(605, 342); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(77, 27); - this.btnCancel.TabIndex = 9; - this.btnCancel.Text = "Cancel"; - this.btnCancel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // btnApply - // - this.btnApply.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnApply.Location = new System.Drawing.Point(701, 342); - this.btnApply.Name = "btnApply"; - this.btnApply.Size = new System.Drawing.Size(67, 27); - this.btnApply.TabIndex = 10; - this.btnApply.Text = "Apply"; - this.btnApply.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnApply.Click += new System.EventHandler(this.btnApply_Click); - // - // tabControl1 - // - this.tabControl1.Controls.Add(this.tbGeneral); - this.tabControl1.Controls.Add(this.tbPageAdvanced); - this.tabControl1.Controls.Add(this.tbpgSetINI); - this.tabControl1.Controls.Add(this.tbERG_Relate); - this.tabControl1.Location = new System.Drawing.Point(0, 0); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(941, 323); - this.tabControl1.TabIndex = 17; - this.tabControl1.VisibleChanged += new System.EventHandler(this.tabControl1_VisibleChanged); - // - // tbGeneral - // - this.tbGeneral.Controls.Add(this.cbChgBarApp); - this.tbGeneral.Controls.Add(this.tbExtraRev); - this.tbGeneral.Controls.Add(this.lblExtraRev); - this.tbGeneral.Controls.Add(this.btnCurSet); - this.tbGeneral.Controls.Add(this.lblGdLink); - this.tbGeneral.Controls.Add(this.cmbGuideLink); - this.tbGeneral.Controls.Add(this.lblPLink); - this.tbGeneral.Controls.Add(this.cmbPLink); - this.tbGeneral.Controls.Add(this.lblType); - this.tbGeneral.Controls.Add(this.cmbType); - this.tbGeneral.Controls.Add(this.myPropertyGrid); - this.tbGeneral.Location = new System.Drawing.Point(4, 25); - this.tbGeneral.Name = "tbGeneral"; - this.tbGeneral.Size = new System.Drawing.Size(933, 294); - this.tbGeneral.TabIndex = 0; - this.tbGeneral.Text = "General"; - // - // cbChgBarApp - // - this.cbChgBarApp.Checked = true; - this.cbChgBarApp.CheckState = System.Windows.Forms.CheckState.Checked; - this.cbChgBarApp.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.cbChgBarApp.Location = new System.Drawing.Point(432, 9); - this.cbChgBarApp.Name = "cbChgBarApp"; - this.cbChgBarApp.Size = new System.Drawing.Size(298, 28); - this.cbChgBarApp.TabIndex = 26; - this.cbChgBarApp.Text = "Remove Change Bars on Approval"; - this.cbChgBarApp.CheckedChanged += new System.EventHandler(this.cbChgBarApp_CheckedChanged); - // - // tbExtraRev - // - this.tbExtraRev.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.tbExtraRev.Location = new System.Drawing.Point(182, 249); - this.tbExtraRev.MaxLength = 249; - this.tbExtraRev.Name = "tbExtraRev"; - this.tbExtraRev.Size = new System.Drawing.Size(538, 24); - this.tbExtraRev.TabIndex = 25; - this.tbExtraRev.Text = ""; - this.tbExtraRev.TextChanged += new System.EventHandler(this.tbExtraRev_TextChanged); - // - // lblExtraRev - // - this.lblExtraRev.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblExtraRev.Location = new System.Drawing.Point(10, 249); - this.lblExtraRev.Name = "lblExtraRev"; - this.lblExtraRev.Size = new System.Drawing.Size(153, 28); - this.lblExtraRev.TabIndex = 24; - this.lblExtraRev.Text = "Extra Rev Number"; - this.lblExtraRev.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // btnCurSet - // - this.btnCurSet.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnCurSet.Location = new System.Drawing.Point(730, 185); - this.btnCurSet.Name = "btnCurSet"; - this.btnCurSet.Size = new System.Drawing.Size(134, 46); - this.btnCurSet.TabIndex = 23; - this.btnCurSet.Text = "Change Default Settings"; - this.btnCurSet.Click += new System.EventHandler(this.btnCurSet_Click); - // - // lblGdLink - // - this.lblGdLink.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblGdLink.Location = new System.Drawing.Point(10, 211); - this.lblGdLink.Name = "lblGdLink"; - this.lblGdLink.Size = new System.Drawing.Size(124, 28); - this.lblGdLink.TabIndex = 22; - this.lblGdLink.Text = "Guideline Set:"; - this.lblGdLink.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // cmbGuideLink - // - this.cmbGuideLink.Location = new System.Drawing.Point(134, 211); - this.cmbGuideLink.Name = "cmbGuideLink"; - this.cmbGuideLink.Size = new System.Drawing.Size(442, 24); - this.cmbGuideLink.TabIndex = 21; - this.cmbGuideLink.SelectedIndexChanged += new System.EventHandler(this.cmbGuideLink_SelectedIndexChanged); - // - // lblPLink - // - this.lblPLink.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblPLink.Location = new System.Drawing.Point(19, 175); - this.lblPLink.Name = "lblPLink"; - this.lblPLink.Size = new System.Drawing.Size(106, 28); - this.lblPLink.TabIndex = 20; - this.lblPLink.Text = "Parent Set:"; - this.lblPLink.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // cmbPLink - // - this.cmbPLink.Location = new System.Drawing.Point(134, 174); - this.cmbPLink.Name = "cmbPLink"; - this.cmbPLink.Size = new System.Drawing.Size(442, 24); - this.cmbPLink.TabIndex = 19; - this.cmbPLink.SelectedIndexChanged += new System.EventHandler(this.cmbPLink_SelectedIndexChanged); - // - // lblType - // - this.lblType.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblType.Location = new System.Drawing.Point(10, 8); - this.lblType.Name = "lblType"; - this.lblType.Size = new System.Drawing.Size(57, 28); - this.lblType.TabIndex = 18; - this.lblType.Text = "Type:"; - this.lblType.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // cmbType - // - this.cmbType.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.cmbType.Location = new System.Drawing.Point(86, 8); - this.cmbType.Name = "cmbType"; - this.cmbType.Size = new System.Drawing.Size(250, 28); - this.cmbType.TabIndex = 17; - this.cmbType.SelectedIndexChanged += new System.EventHandler(this.cmbType_SelectedIndexChanged); - // - // myPropertyGrid - // - this.myPropertyGrid.CommandsVisibleIfAvailable = true; - this.myPropertyGrid.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.myPropertyGrid.HelpVisible = false; - this.myPropertyGrid.LargeButtons = false; - this.myPropertyGrid.LineColor = System.Drawing.SystemColors.ScrollBar; - this.myPropertyGrid.Location = new System.Drawing.Point(10, 45); - this.myPropertyGrid.Name = "myPropertyGrid"; - this.myPropertyGrid.Size = new System.Drawing.Size(883, 108); - this.myPropertyGrid.TabIndex = 16; - this.myPropertyGrid.Text = "Properties"; - this.myPropertyGrid.ToolbarVisible = false; - this.myPropertyGrid.ViewBackColor = System.Drawing.SystemColors.Window; - this.myPropertyGrid.ViewForeColor = System.Drawing.SystemColors.WindowText; - this.myPropertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.myPropertyGrid_PropertyValueChanged); - // - // tbPageAdvanced - // - this.tbPageAdvanced.Controls.Add(this.lblIniFile); - this.tbPageAdvanced.Controls.Add(this.tbIniText); - this.tbPageAdvanced.Location = new System.Drawing.Point(4, 25); - this.tbPageAdvanced.Name = "tbPageAdvanced"; - this.tbPageAdvanced.Size = new System.Drawing.Size(933, 294); - this.tbPageAdvanced.TabIndex = 1; - this.tbPageAdvanced.Text = "PROC.INI"; - // - // lblIniFile - // - this.lblIniFile.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblIniFile.Location = new System.Drawing.Point(19, 0); - this.lblIniFile.Name = "lblIniFile"; - this.lblIniFile.Size = new System.Drawing.Size(720, 18); - this.lblIniFile.TabIndex = 20; - // - // tbIniText - // - this.tbIniText.Location = new System.Drawing.Point(32, 32); - this.tbIniText.Multiline = true; - this.tbIniText.Name = "tbIniText"; - this.tbIniText.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.tbIniText.Size = new System.Drawing.Size(720, 212); - this.tbIniText.TabIndex = 19; - this.tbIniText.Text = ""; - // - // tbpgSetINI - // - this.tbpgSetINI.Controls.Add(this.lblSetINI); - this.tbpgSetINI.Controls.Add(this.tbSetIniText); - this.tbpgSetINI.Location = new System.Drawing.Point(4, 25); - this.tbpgSetINI.Name = "tbpgSetINI"; - this.tbpgSetINI.Size = new System.Drawing.Size(933, 294); - this.tbpgSetINI.TabIndex = 3; - this.tbpgSetINI.Text = "SET.INI"; - // - // lblSetINI - // - this.lblSetINI.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblSetINI.Location = new System.Drawing.Point(24, 0); - this.lblSetINI.Name = "lblSetINI"; - this.lblSetINI.Size = new System.Drawing.Size(720, 18); - this.lblSetINI.TabIndex = 21; - // - // tbSetIniText - // - this.tbSetIniText.Location = new System.Drawing.Point(32, 32); - this.tbSetIniText.Multiline = true; - this.tbSetIniText.Name = "tbSetIniText"; - this.tbSetIniText.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.tbSetIniText.Size = new System.Drawing.Size(720, 212); - this.tbSetIniText.TabIndex = 20; - this.tbSetIniText.Text = ""; - // - // tbERG_Relate - // - this.tbERG_Relate.Controls.Add(this.label2); - this.tbERG_Relate.Controls.Add(this.cbErgRelateList); - this.tbERG_Relate.Controls.Add(this.lbEopRelateList); - this.tbERG_Relate.Controls.Add(this.label1); - this.tbERG_Relate.Location = new System.Drawing.Point(4, 25); - this.tbERG_Relate.Name = "tbERG_Relate"; - this.tbERG_Relate.Size = new System.Drawing.Size(933, 294); - this.tbERG_Relate.TabIndex = 2; - this.tbERG_Relate.Text = "ERG Relationships"; - // - // label2 - // - this.label2.Location = new System.Drawing.Point(0, 144); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(840, 24); - this.label2.TabIndex = 3; - this.label2.Text = "ERG List"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // cbErgRelateList - // - this.cbErgRelateList.Location = new System.Drawing.Point(0, 168); - this.cbErgRelateList.MaxDropDownItems = 5; - this.cbErgRelateList.Name = "cbErgRelateList"; - this.cbErgRelateList.Size = new System.Drawing.Size(840, 24); - this.cbErgRelateList.TabIndex = 2; - this.cbErgRelateList.Text = "comboBox1"; - this.cbErgRelateList.SelectedIndexChanged += new System.EventHandler(this.cbErgRelateList_SelectedIndexChanged); - // - // lbEopRelateList - // - this.lbEopRelateList.ItemHeight = 16; - this.lbEopRelateList.Location = new System.Drawing.Point(0, 24); - this.lbEopRelateList.Name = "lbEopRelateList"; - this.lbEopRelateList.Size = new System.Drawing.Size(840, 100); - this.lbEopRelateList.TabIndex = 1; - this.lbEopRelateList.SelectedIndexChanged += new System.EventHandler(this.lbEopRelateList_SelectedIndexChanged); - // - // label1 - // - this.label1.Location = new System.Drawing.Point(0, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(840, 24); - this.label1.TabIndex = 0; - this.label1.Text = "EOP List"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // PSProperties - // - this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); - this.ClientSize = new System.Drawing.Size(920, 374); - this.Controls.Add(this.tabControl1); - this.Controls.Add(this.btnApply); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnOK); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "PSProperties"; - this.Text = "Procedure Set Properties"; - this.tabControl1.ResumeLayout(false); - this.tbGeneral.ResumeLayout(false); - this.tbPageAdvanced.ResumeLayout(false); - this.tbpgSetINI.ResumeLayout(false); - this.tbERG_Relate.ResumeLayout(false); - this.ResumeLayout(false); - - } - #endregion - - private void cmbType_SelectedIndexChanged(object sender, System.EventArgs e) - { - VEO_ProcSet ps = (VEO_ProcSet) _CurObj; - - // bug fix B2008-001 - // find the value of the selected item -// ps._ProcType = (VEObject.ProcTypeOptions)this.cmbType.SelectedIndex; - ps._ProcType = (VEObject.ProcTypeOptions)Enum.Parse(typeof(VEObject.ProcTypeOptions),this.cmbType.SelectedItem.ToString()); - - // check whether other combo boxes should be shown, i.e. standard doesn't - // show any, background & deviation show some. - - // standard first. -// if (this.cmbType.SelectedIndex == (int)VEObject.ProcTypeOptions.Standard) - if (this.cmbType.SelectedItem.Equals("Standard")) - { - this.cmbGuideLink.Visible = false; - this.cmbPLink.Visible = false; - this.lblGdLink.Visible = false; - this.lblPLink.Visible = false; -// 05/11/05 //jsj remove translation table tab -// this.tabControl1.Controls.Remove(tbERG_Relate); -// this.tabControl1.SelectedIndex = 0; - // return; - } - else - { - - // Otherwise setup combo boxes for linked docs. - this.lblPLink.Visible = true; - this.cmbPLink.Visible = true; - this.lblGdLink.Visible = this.cmbType.Text.Equals("Deviation"); - this.cmbGuideLink.Visible = this.cmbType.Text.Equals("Deviation"); - if (this.cmbType.SelectedIndex != (int)VEObject.ProcTypeOptions.Standard && this.cmbPLink.Items.Count<1) - SetupComboBoxes((VEObject.ProcTypeOptions)this.cmbType.SelectedIndex); -// if (this.cmbGuideLink.Visible) -// this.tabControl1.Controls.Add(tbERG_Relate); - } - // now handle the file name. - if (isnew) SetupNewFileName(); - } - - // save was clicked, use the objects save methods. - private bool saveclick() - { - bool success = true; - VEO_ProcSet ps = (VEO_ProcSet) _CurObj; - - // Get the procedure set type (standard, slave, backgrounds, devitaions) - - // bug fix B2008-001 - // find the value of the selected item - // ps._ProcType = (VEObject.ProcTypeOptions)this.cmbType.SelectedIndex; - ps._ProcType = (VEObject.ProcTypeOptions)Enum.Parse(typeof(VEObject.ProcTypeOptions),this.cmbType.SelectedItem.ToString()); - -// if (isnew) -// { - if(_ParentObj==null) - { - DialogResult=DialogResult.Cancel; - return true; - } - - - // If deviations, get path to ERGs - if (ps._ProcType == VEObject.ProcTypeOptions.Deviation && - (this.cmbGuideLink.Items.Count > 0) && - (this.cmbGuideLink.Items[0].ToString() != "Generic Guidelines Not Found")) - { - ps.guideLink = (string) ERGPaths[this.cmbGuideLink.SelectedIndex]; - ps.SetGuideLink(ps.guideLink); - } - - // If Slave, Backgrounds, or ERGs - get the parent (associated procedure set) path - if (this.cmbPLink.Items.Count > 0 && ps._ProcType != VEObject.ProcTypeOptions.Standard) - { - string selparent = (string) ParentPaths[this.cmbPLink.SelectedIndex]; - bool blnSelectParentChanged; - if (ps.parentLink == null) - blnSelectParentChanged = true; - else - blnSelectParentChanged = !ps.parentLink.ToUpper().Equals(selparent.ToUpper()); - if (blnSelectParentChanged) - ps.parentLink = selparent; - - if (ps.parentLink.Equals("Null")) - { - MessageBox.Show("You need to select a parent procedure set.","Need more information..."); - success = false; - ps.parentLink = null; - } - else - ps.SetParentLink(ps.parentLink, ps._ProcType,blnSelectParentChanged); - } - if (isnew) - { - // Now actually create the new procedure set - if (success) - { - VEO_ProcSetN psn = (VEO_ProcSetN) _CurObj; - psn.SaveFields(); - success=_ParentObj.SaveChild(_CurObj); - } - } - else - { -// VEO_ProcSet ps = (VEO_ProcSet) _CurObj; - if (ps.hasExtraRevNumber) ps.ExtraRevNumber=this.tbExtraRev.Text; - success=_CurObj.Write(); - } - - // check for change of ini file text.... and write out. - // NOTE: When a new Slave procedure set is created, we copy the PROC.INI - // file from the master set (as a default). The following code will - // overwrite this with what the used had entered in the Advanced tab. -// if (success && changeProcIniFile) - if (success) - { - if (changeSetIniFile) - { - //write ini file text box data into set.ini (streamwriter creates - // file if it doesn't exist) - StreamWriter sw = new StreamWriter(lblSetINI.Text,false); - sw.Write(this.tbSetIniText.Text); - sw.Close(); - changeSetIniFile=false; - } - if (changeProcIniFile) - { - //write ini file text box data into proc.ini (streamwriter creates - // file if it doesn't exist) - StreamWriter sw = new StreamWriter(lblIniFile.Text,false); - sw.Write(this.tbIniText.Text); - sw.Close(); - changeProcIniFile=false; - } -// else if (ps._ProcType == VEObject.ProcTypeOptions.Slave) - else if (ps.blnCopiedProcINI) - { - // VE-PROMS automatically created a PROC.INI for the slave. - // Ask the user to check the information on the PROC.INI tab - // for both the Master and Slave procedure sets. - string strMessage = "VE-PROMS had automatically created a PROC.INI file in this\nSlave Procedure Set. Please verify and change (if needed)\nthe Applicability settings in both the Master and Slave sets.\nThis is done from the PROC.INI tab on the properties dialog."; - - MessageBox.Show(strMessage,"F.Y.I."); - } - } - ps.blnCopiedProcINI = false; - - if (blnNeedToWriteEopErgTable) - { - RelationshipTbl.WriteTranslationTableFile(); - blnNeedToWriteEopErgTable = false; - } - - return success; - - } - // save was clicked, use the objects save methods. - private void btnOK_Click(object sender, System.EventArgs e) - { - bool success = true; - if(canedit)success = saveclick(); - if (success==true) - { - DialogResult = DialogResult.OK; - this.Close(); - } - } - - private void btnApply_Click(object sender, System.EventArgs e) - { - if(!canedit)return; - bool success = saveclick(); - if(success==true)btnApply.Enabled=false; - Refresh(); - } - - private void btnCurSet_Click(object sender, System.EventArgs e) - { - bool success; -//jsj if(!canedit)return; - VEO_ProcSet ps = (VEO_ProcSet) this._CurObj; - success=ps.ChgDefSettings(); - if (success) - { - this.myPropertyGrid.SelectedObject=this._CurObj; - } - - } - - private void btnCancel_Click(object sender, System.EventArgs e) - { - if(!canedit)return; - VEO_ProcSet ps = (VEO_ProcSet) _CurObj; - ps.Restore(); - } - - private void myPropertyGrid_PropertyValueChanged(object s, System.Windows.Forms.PropertyValueChangedEventArgs e) - { - btnApply.Enabled = true; - // CurrentGridItem = this.myPropertyGrid.SelectedGridItem; - } - - private void cmbPLink_SelectedIndexChanged(object sender, System.EventArgs e) - { - if (this.cmbType.SelectedIndex == (int)VEObject.ProcTypeOptions.Slave) - { - // VEO_ProcSet ps = (VEO_ProcSet) sender; - // ps.parentLink = (string) ParentPaths[this.cmbPLink.SelectedIndex]; - if (this.isnew) - SetupNewFileName(); - } - else if (this.cmbType.SelectedIndex == (int)VEObject.ProcTypeOptions.Deviation) - { - SetupRelationshipTab(); - } - btnApply.Enabled = true; - } - - private void cmbGuideLink_SelectedIndexChanged(object sender, System.EventArgs e) - { - if (this.cmbType.SelectedIndex == (int)VEObject.ProcTypeOptions.Deviation) - SetupRelationshipTab(); - btnApply.Enabled = true; - } - - private void tbExtraRev_TextChanged(object sender, System.EventArgs e) - { - btnApply.Enabled = true; - } - - private void tbIniText_TextChanged(object sender, System.EventArgs e) - { - btnApply.Enabled = true; - changeProcIniFile=true; - } - - private void tbSetIniText_TextChanged(object sender, System.EventArgs e) - { - btnApply.Enabled = true; - changeSetIniFile=true; - } - - - // set up the list boxes with the current list of EOPs and - // list of ERG procedures - private void SetupRelationshipTab() - { - bool isfirst = true; - if (this.cmbPLink.SelectedIndex < 0 || this.cmbGuideLink.SelectedIndex < 0) return; // EOP or ERG path not set yet, just return - string strPathToParentEOPs = (string) this.ParentPaths[this.cmbPLink.SelectedIndex]; - if (strPathToParentEOPs.Equals("Null")) return; // EOP path not yet selected - if (ERGPaths.Count == 0) return; // No ERG Paths - string strPathToERGs = (string) ERGPaths[this.cmbGuideLink.SelectedIndex]; - - // Read in existing translation table - RelationshipTbl = new EopToErgRelations(); - - EopErgRelations = new ArrayList(); - ERGinfoList = new ArrayList(); - lbEopRelateList.Items.Clear(); - - if (strPathToParentEOPs.Equals("Null")) - { - lbEopRelateList.Items.Add("Parent Set Not Selected"); - } - else - { - // populate the EOP list box - // EopErgRelations (Array) contains a list of procedures in - // the parent's SET file with the latest ERG relation - // information gotten from the translation table (TRANSL.TBL). - // Creating the list in this way will account for added and - // deleted procedures. - vdb_Set vdbSet=new vdb_Set(strPathToParentEOPs + "\\SET.DBF"); - // Loop thru the procset - DataTable tbl = vdbSet.DB_Data.Tables[0]; - foreach (DataRow row in tbl.Rows) - { - // skip the first one (it's always a "blank" record) - if (isfirst) - isfirst = false; - else - { - SetRecordObj SetRec = new SetRecordObj(row); - lbEopRelateList.Items.Add(SetRec); - RelationshipTbl.AddToTranslationList(SetRec,EopErgRelations); - } - } - // replace the read-in relation list with the updated list - // this new list will reflect the current list of procedures - // in the SET file. - RelationshipTbl.aryTransTable.Clear(); - RelationshipTbl.aryTransTable = EopErgRelations; - } - - cbErgRelateList.Items.Clear(); - if (strPathToERGs.Equals("Null")) - { - cbErgRelateList.Items.Add("Guideline Set Not Selected"); - } - else - { - // populate the ERG dropdown box - // and create a list (array) of the ERG information - vdb_Set vdbERGset=new vdb_Set(strPathToERGs + "\\SET.DBF"); - DataTable tbl = vdbERGset.DB_Data.Tables[0]; - isfirst=true; - ERGinfoList.Clear(); - // Loop thru the ERG set - foreach (DataRow row in tbl.Rows) - { - SetRecordObj SetRec = new SetRecordObj(row); - if (isfirst) - { - isfirst = false; - cbErgRelateList.Items.Add("Not Selected"); - } - else - { - cbErgRelateList.Items.Add(SetRec); - } - ERGinfoList.Add(SetRec); - } - } - // position both list boxes - lbEopRelateList.SelectedIndex = 0; - if (strPathToERGs.Equals("Null")) - { - cbErgRelateList.SelectedIndex = 0; - cbErgRelateList.Enabled = _CurObj.canEdit(); - } - else - { - - cbErgRelateList.SelectedIndex = RelationshipTbl.FindInERGList(0,ERGinfoList); - cbErgRelateList.Enabled = _CurObj.canEdit(); - } - } - - private void lbEopRelateList_SelectedIndexChanged(object sender, System.EventArgs e) - { - blnDontCallChange = true; // we're just positioning, not saving selection - if (ERGinfoList.Count > 0) - cbErgRelateList.SelectedIndex = RelationshipTbl.FindInERGList(lbEopRelateList.SelectedIndex,ERGinfoList); - } - - private void cbErgRelateList_SelectedIndexChanged(object sender, System.EventArgs e) - { - if (blnDontCallChange) - { - blnDontCallChange = false; - return; - } - if (RelationshipTbl.ChangeTranslationListItem(lbEopRelateList.SelectedIndex,ERGinfoList[cbErgRelateList.SelectedIndex])) - { - btnApply.Enabled = true; - blnNeedToWriteEopErgTable = true; // there are changes to be saved - } - } - - private void cbChgBarApp_CheckedChanged(object sender, System.EventArgs e) - { - // store changed value in temp variable. Will be written to file when user - // chooses to write changes (ok/apply button). - VEO_ProcSet ps = (VEO_ProcSet)_CurObj; - ps.tmpRmChgBarOnApp=cbChgBarApp.Checked; - btnApply.Enabled = true; - } - - private void tabControl1_VisibleChanged(object sender, System.EventArgs e) - { - if (this.cmbGuideLink.Visible) - this.tabControl1.Controls.Add(tbERG_Relate); - else - { - //jsj remove translation table tab - this.tabControl1.Controls.Remove(tbERG_Relate); - this.tabControl1.SelectedIndex = 0; - } - } - - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/PSProperties.resx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/PSProperties.resx deleted file mode 100644 index 49554264..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/PSProperties.resx +++ /dev/null @@ -1,435 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - True - - - False - - - True - - - Private - - - Private - - - 8, 8 - - - False - - - True - - - True - - - Private - - - Private - - - 8, 8 - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - True - - - True - - - Private - - - Private - - - 8, 8 - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - False - - - True - - - True - - - Private - - - Private - - - 8, 8 - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - True - - - True - - - Private - - - Private - - - False - - - 8, 8 - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - PSProperties - - - True - - - 80 - - - True - - - Private - - - - AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx - dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx - F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3 - d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx - dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3 - F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX - cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3 - F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX - cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Plant.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Plant.cs deleted file mode 100644 index 4698a404..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Plant.cs +++ /dev/null @@ -1,701 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: Plant.cs $ $Revision: 10 $ - * $Author: Jsj $ $Date: 10/20/06 9:34a $ - * - * $History: Plant.cs $ - * - * ***************** Version 10 ***************** - * User: Jsj Date: 10/20/06 Time: 9:34a - * Updated in $/LibSource/VEObject - * long name fix - * - * ***************** Version 9 ***************** - * User: Jsj Date: 9/26/06 Time: 9:38a - * Updated in $/LibSource/VEObject - * check for a siingle quote in directory name - * - * ***************** Version 8 ***************** - * User: Kathy Date: 6/06/05 Time: 12:35p - * Updated in $/LibSource/VEObject - * Allow lock set even if system lock set - * - * ***************** Version 7 ***************** - * User: Kathy Date: 4/12/05 Time: 1:01p - * Updated in $/LibSource/VEObject - * - * ***************** Version 6 ***************** - * User: Kathy Date: 2/02/05 Time: 10:13a - * Updated in $/LibSource/VEObject - * B2005-006: fix missing proc sets under plant - * - * ***************** Version 5 ***************** - * User: Kathy Date: 1/31/05 Time: 11:06a - * Updated in $/LibSource/VEObject - * Fix B2005-005 (connection & delete directory errors). also, fix icon - * usage & security for new - * - * ***************** Version 4 ***************** - * User: Kathy Date: 1/24/05 Time: 2:45p - * Updated in $/LibSource/VEObject - * B2005-004 fixes - * - * ***************** Version 3 ***************** - * User: Kathy Date: 1/14/05 Time: 10:38a - * Updated in $/LibSource/VEObject - * B2004-061: Fix security optoins - * - * ***************** Version 2 ***************** - * User: Kathy Date: 1/10/05 Time: 12:58p - * Updated in $/LibSource/VEObject - * B2004-063 fix - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:53a - * Created in $/LibSource/VEObject - *********************************************************************************************/ - -using System; -using System.Collections; -using System.Text; -using System.Windows.Forms; -using System.IO; -using System.Xml; -using System.ComponentModel; -using Utils; -using VENetwork; - -namespace VEObject -{ - /// - /// This defines the VEO_Plant class which handles plant data. This contains - /// support for the vexxx layer. - /// - public class VEO_Plant : VEO_Base - { - public long accessFlags; - protected string tmpTitle; - protected string tmpLocation; - protected bool changeLocation; - protected bool changeTitle; - private string PrevDirectory; - public VEO_Plant(UserRunTime iusrRunTime, string ititle, string ipath) - { - // iconStates are the imagelist indexes for the tree view (imglist1) - // the states are Nolock, LockedByMe, LockedByOther, LockPending, Empty. - iconStates = new int[5] {3,21,5,22,4}; - _Title = ititle; - _Location = ipath; - usrRunTime = iusrRunTime; - changeLocation=false; - changeTitle=false; - IsEmpty=false; - VEObjectType=(int)VEObjectTypesDefs.Plant; - isNew=false; - LoadLockInfo(); - icon = iconStates[(int)Lock.LockStatus]; - if (Lock.LockStatus != VENetwork.Status.LockedByOther) - { - if (ipath != null) - { - string[] dirs = new string[40]; - dirs = Directory.GetDirectories(ipath); - if (dirs.Length == 0) - { - IsEmpty=true; - //only reset the icon to empty if there is no lock icon. - //if a lock, show the lock icon - if (Lock.LockStatus == VENetwork.Status.NoLock) icon = iconStates[(int)VEO_IconStates.Empty]; - } - } - } - } - - public override void LoadLockInfo() - { - Lock = new VELock(_Location, usrRunTime.myUserData, usrRunTime.InMultiUserMode?VENetwork.LockTypes.Plant:VENetwork.LockTypes.None); - } - - // Properties used for modify of 'Properties' from File menu. - [Description("Location"),Category("Plant"),ReadOnly(true)]public string Location - { - get{return _Location;} - set{_Location=value;} - } - - [Description("Title"),Category("Plant")]public string Title - { - get - { - if (!changeTitle) - return _Title; - else - return tmpTitle; - } - set - { - changeTitle=true; - tmpTitle=value; - } - } - - // The open method checks for multi-user settings at the plant level. It - // also positions into the plant directory. - public override bool Open() - { - isOpen = true; - PrevDirectory = Directory.GetCurrentDirectory(); - if(_Location!=null)Directory.SetCurrentDirectory(_Location); - if (Connection!=null)Connection.Enter(false); - return true; - } - - // The close method resets, if necessary from any multi-user settings and - // positions back to the datapath directory (which is a level above the - // current level) - public override bool Close() - { - if (!isOpen)return false; - isOpen=false; - if (Connection!=null)Connection.Exit(); - Directory.SetCurrentDirectory(".."); - return true; - } - - public override void Restore() - { - changeTitle=false; - } - - public override bool Delete() - { - DialogResult result = MessageBox.Show("Are you sure you want to delete the entire plant directory " + this._Location,"Confirm Delete Again",MessageBoxButtons.YesNoCancel); - if (result == DialogResult.Yes) - { - // delete the entire directory - if (Directory.Exists(this._Location)) - { - if(isOpen)Close(); - try - { - Directory.Delete(this._Location,true); - } - catch (Exception e) - { - MessageBox.Show("Could not delete directory - manually delete " + this._Location + ". Cause: " + e.Message); - } - if (Directory.Exists(this._Location)) - { - MessageBox.Show("Unable to delete the plant directory."); - return false; - } - return true; - } - } - return false; - } - - private void CreateProcSet(string dirpath, XmlElement nm, string dirname, long flags) - { - // see if there is a title file in the directory and use - // it if there is, otherwise use menuname & if there's no menu - // name, use the directory name. - VEO_ProcSet procset = null; - string titlepath = dirpath + "\\" + "Title"; - FileInfo fi = new FileInfo(titlepath); - if (File.Exists(titlepath)) - { - StreamReader myReader = new StreamReader(titlepath); - titlepath = myReader.ReadLine(); - myReader.Close(); - procset = new VEO_ProcSet(usrRunTime, titlepath.Trim(), dirpath, flags); - } - else - { - if (nm != null) - procset = new VEO_ProcSet(usrRunTime, nm.InnerText, dirpath, flags); - else - { - string tmpdirnm = dirname; - int indx=0; - // if this is temp change directory, tack on text to recognize it - if ((indx=dirpath.ToUpper().IndexOf("TMPCHG"))>-1) - tmpdirnm = dirname + " - Temporary Change Version"; - // if this is approved, tack on Current Approved Version to the title - else if ((indx=dirpath.ToUpper().IndexOf("APPROVED"))>-1) - tmpdirnm = dirname + " - Current Approved Version"; - procset = new VEO_ProcSet(usrRunTime, tmpdirnm, dirpath,flags); - } - } - procset.parentObj = this; - Children.Add(procset); - } - - // private method, used below, to add a directory to the child list - // (list contains proc sets) - private bool ProcessDirName(XmlElement par, string dirname, int plntsecindx) - { - XmlNodeList nodeList = par.SelectNodes("ProcFile"); - if (nodeList == null) return false; - - foreach (XmlNode dirnd in nodeList) - { - XmlElement dele=(XmlElement)dirnd; - string dirpath = _Location + "\\" + dirname; - if (File.Exists(dirpath+"\\"+dirnd.InnerText)) - { - // - // see if there's an exception or a requirement, i.e. use - // the Working Draft if there's no proc2 directory (Except) - // or use the Working Draft Unit 1 if there's a proc2 - // directory (Require) - bool excpt = false; - bool req = true; - string path1=null; - XmlElement except = (XmlElement) par.SelectSingleNode("Exception"); - if (except != null) - { - // if this exception directory exists, don't add this to - // the set. - - path1 = dirpath + "\\" + except.InnerText; - if (Directory.Exists(path1)) excpt = true; - } - XmlElement require = (XmlElement) par.SelectSingleNode("Require"); - if (require != null) - { - // if this require directory exists, add this to set only - // if this exists. - path1 = dirpath + "\\" + require.InnerText; - if (Directory.Exists(path1) == false) req = false; - } - if (excpt == false && req == true) - { - XmlElement nm = (XmlElement) par.SelectSingleNode("MenuName"); - long flags=0L; - // bug fix B2006-045 - // need to convert long folder/file names to short (8.3) - ShortName sname = new ShortName(dirpath); - bool hasSec = usrRunTime.sec.ProcSetHasSecurity(plntsecindx, Path.GetFileName(sname.ShortFileName)); -// bool hasSec = usrRunTime.sec.ProcSetHasSecurity(plntsecindx, dirname); - if (this.usrRunTime.sec==null) flags=Security.SUPERACCESS; - else if (hasSec) flags = usrRunTime.sec.GetProcSecurity(sname.ShortFileName); - // else if (hasSec) flags = usrRunTime.sec.GetProcSecurity(dirpath); - - if((hasSec && flags!=0L) || (!hasSec&&!usrRunTime.sec.BlockAccess())) - { - CreateProcSet(dirpath, nm, dirname, flags); - return true; - } - } - } - } - return false; - } - - // This method processes through the SubDirSearch xmlelement tree in - // menuwin2.xml to see if the input procedure set directory has valid - // procedure set subdirectories. Arguments are: - // subtop is xmlelement for the SubDirSearch in menuwin2.xml, dir is actual - // procset directory name (for example, procs, proc000.dvt, etc) and - // dname is the name to be used for the directory name in the menuwin2.xml - // file under the SubDirSearch xmlelement tree (for example, procs, *.dvt, etc) - private bool ProcessSubDir(XmlElement subtop, string dri, string dname, int plntsecindx) - { - XmlNodeList nodeList; - string xp = "descendant::ProcSet[Dir = \'" + dname + "\']"; - - try - { - nodeList = subtop.SelectNodes(xp); - // for each possible subdirectory for this directory, see if it - // exists. - foreach (XmlNode subdirname in nodeList) - { - XmlElement subdele=(XmlElement)subdirname; - XmlNodeList FnodeList = subdirname.SelectNodes("ProcFile"); - // see if the files listed exist, if so, add them to the - // plant procset list. - foreach (XmlNode dirnd in FnodeList) - { - XmlElement dele=(XmlElement)dirnd; - string dirpath = _Location + "\\" + dri; - if (File.Exists(dirpath+"\\"+dirnd.InnerText)) - { - XmlElement nm = (XmlElement) subdirname.SelectSingleNode("MenuName"); - string subdir = dirnd.InnerText.Substring(0,dirnd.InnerText.LastIndexOf("\\")); - - long flags=0L; - bool hasSec = usrRunTime.sec.ProcSetHasSecurity(plntsecindx, dri+"\\"+subdir); - if (this.usrRunTime.sec==null) flags=Security.SUPERACCESS; - else if (hasSec) flags = usrRunTime.sec.GetProcSecurity(dirpath + "\\" + subdir); - - if((hasSec && flags!=0L) || (!hasSec&&!usrRunTime.sec.BlockAccess())) - CreateProcSet(dirpath+"\\"+subdir, nm, dri, flags); - } - break; // out of file check foreach - } - } - } - catch (Exception e) - { - MessageBox.Show(e.Message); - return false; - } - - return true; - } - - // Using the menuwin2.xml file, read in child list by seeing which - // directories (proc sets) are contained in this vexxx directory. - public override bool Read(bool ChkForChldOnly) - { - bool didone; - Cursor.Current = Cursors.WaitCursor; - - // using the . Then do exist tests to see if they - // exist on this datapath. - usrRunTime.LoadMenuWin2(); - XmlDocument xmldoc = usrRunTime.menuwin2XML.GetXmlDoc(); - - XmlElement top = (XmlElement) xmldoc.FirstChild; - XmlElement sys = (XmlElement) top.SelectSingleNode("PlantAttach"); - XmlElement subtop = (XmlElement) top.SelectSingleNode("SubDirSearch"); - - DirectoryInfo cur = new DirectoryInfo(_Location); - DirectoryInfo[] diArr = cur.GetDirectories(); - int plntsecindx = usrRunTime.sec.GetPlantSecurityIndex(_Location); - - foreach (DirectoryInfo dri in diArr) - { - XmlNodeList nodeList; - string dname = null; - int indx; - if ((indx=dri.Name.IndexOf("."))>-1) - { - //must be *.prc, *.bck, *.dvt, *.sl? - if (indx+4<=dri.Name.Length) - { - dname = "*." + dri.Name.Substring(indx+1,3).ToLower(); - if (dname.StartsWith("*.sl")) - dname = dname.Substring(0,4) + "?"; - } - else - dname = null; - } - else if ((indx=dri.Name.IndexOf("'"))>-1) - { - // bug fix B2006-047 - // if not a .PRC folder, then we get an error looking up - // the directory name in XML (if it has an ' in the name) - dname = null; - } - else - { - dname = dri.Name.ToLower(); - } - - - if (dname!=null) - { - string xp = "descendant::ProcSet[Dir = \'" + dname + "\']"; - - try - { - nodeList = sys.SelectNodes(xp); - foreach (XmlNode dirname in nodeList) - { - XmlElement dele=(XmlElement)dirname; - didone = ProcessDirName(dele, dri.Name, plntsecindx); - if (Children.Count > 0 && ChkForChldOnly) - { - Cursor.Current = Cursors.Default; - return true; - } - // if a directory was found, see if any - // subdirectories exist that need added too. - bool didsub = false; - if (didone) didsub = ProcessSubDir(subtop, dri.Name, dname, plntsecindx); - } - } - catch (Exception e) - { - MessageBox.Show(e.Message.ToString()); - Cursor.Current = Cursors.Default; - return false; - } - } - } - // if no children, change icon to empty (unless it has a lock icon) - if (Children.Count <=0 && Lock.LockStatus == VENetwork.Status.NoLock) icon = iconStates[(int)VEO_IconStates.Empty]; - Cursor.Current = Cursors.Default; - return true; - } - - // write out change (modification of title for plant) for plant to - // the menuwin.xml file - public override bool Write() - { - - string newtitle=null; - if (changeTitle) - { - newtitle = tmpTitle; - bool success = usrRunTime.ModMenuWin(newtitle, this._Title); - if (success==false) - { - MessageBox.Show("Could not modify title for the plant."); - return false; - } - MessageBox.Show("Please send \\ve-proms\\menuwin & \\ve-proms\\menuwin.xml files to Volian."); - _Title=newtitle; - changeTitle=false; - } - return true; - } - - // create a new proc set object (child for this plant) - public override Object MakeNewChild() - { - if (!isOpen)Open(); - VEO_ProcSet ps = new VEO_ProcSetN(usrRunTime,null,_Location); - return ps; - } - - // save a new proc set (child for this plant) - public override bool SaveChild(Object obj) - { - VEO_ProcSetN ps = (VEO_ProcSetN) obj; - - // check for valid child - bool valid = ps.IsValid(); - if (valid == false) return false; - - valid = ps.SaveNew("dummy"); - if (valid == true) - { - // add this item to this plants list of children. - Children.Add((VEO_ProcSet)obj); - ps.parentObj=this; - ps._Location = this._Location + "\\" + ps._Location; - ps.icon=iconStates[0]; - // if this plant's icon is 'empty', change it to either lock (if locked), - // or to not empty. - icon = iconStates[(int)Lock.LockStatus]; - IsEmpty=false; - } - return valid; - } - - // save a new plant directory - public override bool SaveNew(string pth) - { - - // check for non-empty data. - - if (tmpLocation == null || tmpLocation == "" || tmpTitle == null || tmpTitle == "") - { - MessageBox.Show("Need to fill in all data."); - return false; - } - // for this new plant, make the directory and write out - // to the menuwin & menuwin.xml files. - - // if using the file browser dialog, the drive may be included, if so - // check that the directory matches the datapath. - int slash = tmpLocation.LastIndexOf("\\"); - if (slash>0) - { - string drvtmp = tmpLocation.Substring(0,slash+1); - ShortName sname = new ShortName(drvtmp); - string drv=sname.ShortFileName; - sname = null; - if (drv.ToUpper() != pth.ToUpper()) - { - MessageBox.Show("Invalid path, directory must match datapath"); - return false; - } - // remove the drive part of the path, it's added back later. - tmpLocation = tmpLocation.Substring(slash+1,tmpLocation.Length-(slash+1)); - } - - // check for ve* - if (tmpLocation.Substring(0,2).ToUpper() != "VE") - { - MessageBox.Show("First two characters must be 'VE' for new plant directory name."); - return false; - } - - // also check that the name is not greater than 8 characters (an old 16-bit hangover) - if (tmpLocation.Length>8) - { - MessageBox.Show("Directory/plant name must be 8 characters or less."); - return false; - } - - // make path to new directory & check for existence. - string curpath=null; - curpath = pth + "\\" + this.tmpLocation; - DirectoryInfo cur = new DirectoryInfo(curpath); - - if (cur.Exists ) - { - DirectoryInfo[] di = cur.GetDirectories("*"); - FileInfo[] fi = cur.GetFiles("*"); - if (di.Length>0 || fi.Length>0) - { - MessageBox.Show("The plant directory you specified already exists & has contents. Enter a different name."); - return false; - } - } - // if the directory exists & it is already in the menu file, it didn't succeed - // in adding the new item. - if (cur.Exists && (usrRunTime.IsInMenuWin(this.tmpLocation)!=0)) - { - MessageBox.Show("The plant directory you specified already exists and the plant name exists in the menu files."); - return false; - } - try - { - if (cur.Exists == false)cur.Create(); - } - catch (Exception e) - { - MessageBox.Show("Error creating directory: " + e.Message); - return false; - } - - // now add to end of menuwin & menuwin.xml. - bool success = usrRunTime.AddToMenuWin(this.tmpTitle,this.tmpLocation); - if (success==false) - { - MessageBox.Show("Could not add directory to ve-proms menuing files. Could not create plant directory."); - cur.Delete(); - return false; - } - MessageBox.Show("The VE-PROMS Security Access Module (VESAM) may need to be used to set permissions to access the new plant."); - _Title=tmpTitle; - _Location=tmpLocation; - changeTitle=false; - changeLocation=false; - // set a security flag for this. Cases could be that there is no security in vesam, - // that it has security in vesam, though it didn't exist for this user until now, - // or the user could be super user. - accessFlags=0L; - int idx = usrRunTime.sec.GetPlantSecurityIndex(curpath); - accessFlags = usrRunTime.sec.GetPlantSecurity(idx); - return true; - } - - public override void DoListView(ListView veoListView) - { - ListViewItem item=null; - veoListView.Columns.Add("Location", 120, HorizontalAlignment.Left); - veoListView.Columns.Add("Title", 300, HorizontalAlignment.Left); - - for (int i=0; i - /// Summary description for PrcProperties. - /// - public class PrcProperties : System.Windows.Forms.Form - { - private System.Windows.Forms.TabPage generalTPage; - private System.Windows.Forms.Button btnOK; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Button btnApply; - private System.Windows.Forms.TabControl tabCtlProc; - private PropertyGrid genPropertyGrid; - private PropertyGrid extPropertyGrid; - private VEO_Base ParentObj; - private VEO_Base ProcObj; - private VEO_Base ProcExtObj; - private bool isnew; - private bool dosuffix; - private System.Windows.Forms.TabPage ExtTPage; - public GridItem CurrentGridItem; - private System.Windows.Forms.Label lblSuffix; - private System.Windows.Forms.ComboBox cmbSuffix; - private bool canedit; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public PrcProperties(Object par, Object prc, Object ext) - { - ParentObj = (VEO_Base) par; - ProcObj = (VEO_Base) prc; - ProcExtObj = (VEO_Base) ext; - if(ProcObj.isNew) - isnew=true; - else - isnew=false; - - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - this.genPropertyGrid.SelectedObject=prc; - if (ext != null) - { - this.extPropertyGrid.SelectedObject=ext; - if (this.tabCtlProc.TabPages.Count<2)this.tabCtlProc.TabPages.Add(ExtTPage); - } - else - this.tabCtlProc.TabPages.Remove(ExtTPage); - - // make apply button visible if modify - this.btnApply.Visible = !isnew; - - // if the parent has suffixes as part of format, then - // turn visibility on to the suffix combo box & label, and - // add each character to the suffix combo box & set current - // value. - - VEO_ProcSet ps = (VEO_ProcSet) ParentObj.parentObj; - if (ps.SuffixFlags != null && ps.SuffixFlags != "") - { - dosuffix=true; - this.lblSuffix.Visible=true; - this.cmbSuffix.Visible=true; - this.cmbSuffix.Items.Add("blank"); - for (int i=0; i - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(PrcProperties)); - this.tabCtlProc = new System.Windows.Forms.TabControl(); - this.generalTPage = new System.Windows.Forms.TabPage(); - this.genPropertyGrid = new System.Windows.Forms.PropertyGrid(); - this.ExtTPage = new System.Windows.Forms.TabPage(); - this.extPropertyGrid = new System.Windows.Forms.PropertyGrid(); - this.btnOK = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.btnApply = new System.Windows.Forms.Button(); - this.cmbSuffix = new System.Windows.Forms.ComboBox(); - this.lblSuffix = new System.Windows.Forms.Label(); - this.tabCtlProc.SuspendLayout(); - this.generalTPage.SuspendLayout(); - this.ExtTPage.SuspendLayout(); - this.SuspendLayout(); - // - // tabCtlProc - // - this.tabCtlProc.Controls.Add(this.generalTPage); - this.tabCtlProc.Controls.Add(this.ExtTPage); - this.tabCtlProc.Location = new System.Drawing.Point(0, 0); - this.tabCtlProc.Name = "tabCtlProc"; - this.tabCtlProc.SelectedIndex = 0; - this.tabCtlProc.Size = new System.Drawing.Size(704, 192); - this.tabCtlProc.TabIndex = 0; - // - // generalTPage - // - this.generalTPage.Controls.Add(this.genPropertyGrid); - this.generalTPage.Location = new System.Drawing.Point(4, 22); - this.generalTPage.Name = "generalTPage"; - this.generalTPage.Size = new System.Drawing.Size(696, 166); - this.generalTPage.TabIndex = 0; - this.generalTPage.Text = "General"; - // - // genPropertyGrid - // - this.genPropertyGrid.CommandsVisibleIfAvailable = true; - this.genPropertyGrid.Dock = System.Windows.Forms.DockStyle.Top; - this.genPropertyGrid.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.genPropertyGrid.HelpVisible = false; - this.genPropertyGrid.LargeButtons = false; - this.genPropertyGrid.LineColor = System.Drawing.SystemColors.ScrollBar; - this.genPropertyGrid.Location = new System.Drawing.Point(0, 0); - this.genPropertyGrid.Name = "genPropertyGrid"; - this.genPropertyGrid.PropertySort = System.Windows.Forms.PropertySort.Categorized; - this.genPropertyGrid.Size = new System.Drawing.Size(696, 416); - this.genPropertyGrid.TabIndex = 1; - this.genPropertyGrid.Text = "Properties"; - this.genPropertyGrid.ToolbarVisible = false; - this.genPropertyGrid.ViewBackColor = System.Drawing.SystemColors.Window; - this.genPropertyGrid.ViewForeColor = System.Drawing.SystemColors.WindowText; - this.genPropertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.genPropertyGrid_PropertyValueChanged); - // - // ExtTPage - // - this.ExtTPage.Controls.Add(this.extPropertyGrid); - this.ExtTPage.Location = new System.Drawing.Point(4, 22); - this.ExtTPage.Name = "ExtTPage"; - this.ExtTPage.Size = new System.Drawing.Size(696, 166); - this.ExtTPage.TabIndex = 1; - this.ExtTPage.Text = "Extended"; - // - // extPropertyGrid - // - this.extPropertyGrid.CommandsVisibleIfAvailable = true; - this.extPropertyGrid.Dock = System.Windows.Forms.DockStyle.Top; - this.extPropertyGrid.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.extPropertyGrid.HelpVisible = false; - this.extPropertyGrid.LargeButtons = false; - this.extPropertyGrid.LineColor = System.Drawing.SystemColors.ScrollBar; - this.extPropertyGrid.Location = new System.Drawing.Point(0, 0); - this.extPropertyGrid.Name = "extPropertyGrid"; - this.extPropertyGrid.PropertySort = System.Windows.Forms.PropertySort.Categorized; - this.extPropertyGrid.Size = new System.Drawing.Size(696, 416); - this.extPropertyGrid.TabIndex = 0; - this.extPropertyGrid.Text = "PropertyGrid"; - this.extPropertyGrid.ToolbarVisible = false; - this.extPropertyGrid.ViewBackColor = System.Drawing.SystemColors.Window; - this.extPropertyGrid.ViewForeColor = System.Drawing.SystemColors.WindowText; - this.extPropertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.extPropertyGrid_PropertyValueChanged); - // - // btnOK - // - this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnOK.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnOK.Location = new System.Drawing.Point(400, 264); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(88, 32); - this.btnOK.TabIndex = 1; - this.btnOK.Text = "OK"; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnCancel.Location = new System.Drawing.Point(504, 264); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(88, 32); - this.btnCancel.TabIndex = 2; - this.btnCancel.Text = "Cancel"; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // btnApply - // - this.btnApply.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnApply.Location = new System.Drawing.Point(608, 264); - this.btnApply.Name = "btnApply"; - this.btnApply.Size = new System.Drawing.Size(88, 32); - this.btnApply.TabIndex = 3; - this.btnApply.Text = "Apply"; - this.btnApply.Click += new System.EventHandler(this.btnApply_Click); - // - // cmbSuffix - // - this.cmbSuffix.Location = new System.Drawing.Point(72, 216); - this.cmbSuffix.Name = "cmbSuffix"; - this.cmbSuffix.Size = new System.Drawing.Size(56, 21); - this.cmbSuffix.TabIndex = 4; - this.cmbSuffix.Text = "comboBox1"; - this.cmbSuffix.SelectedIndexChanged += new System.EventHandler(this.cmbSuffix_SelectedIndexChanged); - // - // lblSuffix - // - this.lblSuffix.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.lblSuffix.Location = new System.Drawing.Point(16, 216); - this.lblSuffix.Name = "lblSuffix"; - this.lblSuffix.Size = new System.Drawing.Size(48, 16); - this.lblSuffix.TabIndex = 5; - this.lblSuffix.Text = "Suffix:"; - // - // PrcProperties - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(720, 318); - this.Controls.Add(this.lblSuffix); - this.Controls.Add(this.cmbSuffix); - this.Controls.Add(this.btnApply); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnOK); - this.Controls.Add(this.tabCtlProc); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "PrcProperties"; - this.Text = "Procedure Properties"; - this.tabCtlProc.ResumeLayout(false); - this.generalTPage.ResumeLayout(false); - this.ExtTPage.ResumeLayout(false); - this.ResumeLayout(false); - - } - #endregion - private void genPropertyGrid_Click(object sender, System.EventArgs e) - { - CurrentGridItem = this.genPropertyGrid.SelectedGridItem; - } - - private void extPropertyGrid_Click(object sender, System.EventArgs e) - { - CurrentGridItem = this.extPropertyGrid.SelectedGridItem; - } - - private void genPropertyGrid_PropertyValueChanged(object s, System.Windows.Forms.PropertyValueChangedEventArgs e) - { - btnApply.Enabled = true; - CurrentGridItem = this.genPropertyGrid.SelectedGridItem; - } - - private void extPropertyGrid_PropertyValueChanged(object s, System.Windows.Forms.PropertyValueChangedEventArgs e) - { - btnApply.Enabled = true; - CurrentGridItem = this.extPropertyGrid.SelectedGridItem; - } - - // save data for use by ok and apply button clicks - private bool saveclick() - { - bool success = true; - - // save the suffix if using it. Note that this was done - // as a separate combo box since fields cannot be removed - // from the property grid at run time. - if (dosuffix) - { - VEO_Proc prc = (VEO_Proc)ProcObj; - if (cmbSuffix.SelectedIndex == 0) - prc._ProcCode = null; - else - prc._ProcCode = cmbSuffix.SelectedItem.ToString(); - } - - if (isnew) - { - if(ParentObj==null) - { - DialogResult=DialogResult.Cancel; - return success; - } - success=ParentObj.SaveChild(ProcObj); - } - else - { - success=ProcObj.Write(); - } - return success; - } - - // save was clicked, use the objects save methods. - private void btnOK_Click(object sender, System.EventArgs e) - { - bool success = true; - if(canedit)success = saveclick(); - if (success==true) - { - DialogResult = DialogResult.OK; - this.Close(); - } - } - - private void btnApply_Click(object sender, System.EventArgs e) - { - if(canedit)return; - bool success = saveclick(); - if(success==true)btnApply.Enabled=false; - Refresh(); - } - - private void btnCancel_Click(object sender, System.EventArgs e) - { - if(!canedit)return; - ProcObj.Restore(); - } - - private void cmbSuffix_SelectedIndexChanged(object sender, System.EventArgs e) - { - btnApply.Enabled=true; - } - - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/PrcProperties.resx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/PrcProperties.resx deleted file mode 100644 index 402a88ab..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/PrcProperties.resx +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - False - - - True - - - Private - - - Private - - - 8, 8 - - - False - - - True - - - True - - - Private - - - Private - - - 8, 8 - - - False - - - Private - - - Private - - - False - - - True - - - True - - - Private - - - Private - - - 8, 8 - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - PrcProperties - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - True - - - Private - - - - AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx - dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx - F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3 - d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx - dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3 - F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX - cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3 - F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX - cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Proc.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Proc.cs deleted file mode 100644 index 8d275987..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Proc.cs +++ /dev/null @@ -1,1587 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: Proc.cs $ $Revision: 26 $ - * $Author: Jsj $ $Date: 9/25/06 2:08p $ - * - * $History: Proc.cs $ - * - * ***************** Version 26 ***************** - * User: Jsj Date: 9/25/06 Time: 2:08p - * Updated in $/LibSource/VEObject - * allow user to move a procedure in the approved list - * - * ***************** Version 25 ***************** - * User: Jsj Date: 8/30/06 Time: 10:04a - * Updated in $/LibSource/VEObject - * Added Multi Procedure Data Checker - * - * ***************** Version 24 ***************** - * User: Kathy Date: 5/01/06 Time: 11:17a - * Updated in $/LibSource/VEObject - * Fix B2006-018: single quote in proc number causes problem on data - * request - * - * ***************** Version 23 ***************** - * User: Kathy Date: 2/23/06 Time: 10:52a - * Updated in $/LibSource/VEObject - * Fix B2006-006, use actual database field for column mode in set file - * during approve selected. Also, don't crash on saving of column mode - * from procedure properties if value was null - * - * ***************** Version 22 ***************** - * User: Kathy Date: 8/16/05 Time: 2:56p - * Updated in $/LibSource/VEObject - * B2005-030: error if missing ndx - * - * ***************** Version 21 ***************** - * User: Kathy Date: 7/28/05 Time: 2:08p - * Updated in $/LibSource/VEObject - * for mod proc number, copy data into/from correct file number for - * approve ind - * - * ***************** Version 20 ***************** - * User: Kathy Date: 7/18/05 Time: 10:55a - * Updated in $/LibSource/VEObject - * Lib doc transition reference may be upper or lower case - * - * ***************** Version 19 ***************** - * User: Kathy Date: 6/21/05 Time: 7:25a - * Updated in $/LibSource/VEObject - * clear variable for edit from approve - * - * ***************** Version 18 ***************** - * User: Kathy Date: 5/25/05 Time: 10:32a - * Updated in $/LibSource/VEObject - * Allow edits for tmpchg - * - * ***************** Version 17 ***************** - * User: Kathy Date: 5/19/05 Time: 11:07a - * Updated in $/LibSource/VEObject - * speed up approve - * - * ***************** Version 16 ***************** - * User: Kathy Date: 5/11/05 Time: 9:29a - * Updated in $/LibSource/VEObject - * approve all selectinto - * - * ***************** Version 15 ***************** - * User: Kathy Date: 4/26/05 Time: 10:23a - * Updated in $/LibSource/VEObject - * Check for dbnull on dates - * - * ***************** Version 14 ***************** - * User: Kathy Date: 4/21/05 Time: 10:22a - * Updated in $/LibSource/VEObject - * remove upgrade2005 define - * - * ***************** Version 13 ***************** - * User: Jsj Date: 4/15/05 Time: 9:44a - * Updated in $/LibSource/VEObject - * added check to see if proc number exists in set file before adding to - * dependency list - * - * ***************** Version 12 ***************** - * User: Jsj Date: 4/08/05 Time: 10:55a - * Updated in $/LibSource/VEObject - * comment about enabling slave proc number/title changes - * - * ***************** Version 11 ***************** - * User: Jsj Date: 4/07/05 Time: 11:17a - * Updated in $/LibSource/VEObject - * Unit Specific call - * - * ***************** Version 10 ***************** - * User: Kathy Date: 3/22/05 Time: 10:03a - * Updated in $/LibSource/VEObject - * Remove chgbar - * - * ***************** Version 9 ***************** - * User: Kathy Date: 3/08/05 Time: 1:50p - * Updated in $/LibSource/VEObject - * Approval - * - * ***************** Version 8 ***************** - * User: Kathy Date: 1/31/05 Time: 11:06a - * Updated in $/LibSource/VEObject - * Fix B2005-005 (connection & delete directory errors). also, fix icon - * - * ***************** Version 7 ***************** - * User: Kathy Date: 11/12/04 Time: 8:43a - * Updated in $/LibSource/VEObject - * B2004-056: no date update on set file record when procedure data change - * - * ***************** Version 6 ***************** - * User: Jsj Date: 8/20/04 Time: 9:02a - * Updated in $/LibSource/VEObject - * Disable the main form when we spawn off to VFW.EXE so the user cannot - * select a different tree node while we are bringing up the procedure - * editor. - * - * ***************** Version 5 ***************** - * User: Jsj Date: 8/19/04 Time: 11:37a - * Updated in $/LibSource/VEObject - * fixed typo in transition usage message displayed when trying to delete - * a procedure - * - * ***************** Version 4 ***************** - * User: Jsj Date: 8/16/04 Time: 4:23p - * Updated in $/LibSource/VEObject - * RECID not incremented inserting new procdure - * - * ***************** Version 3 ***************** - * User: Kathy Date: 8/10/04 Time: 3:42p - * Updated in $/LibSource/VEObject - * duplicate file names on new proc & proc has wrong rec ids on new - * - * ***************** Version 2 ***************** - * User: Kathy Date: 8/04/04 Time: 11:12a - * Updated in $/LibSource/VEObject - * stop two vfw sessions from spawning on quick 2 double clicks - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:53a - * Created in $/LibSource/VEObject - *********************************************************************************************/ - -using System; -using System.Windows.Forms; -using System.ComponentModel; -using System.Diagnostics; -using System.Text; -using System.Data; -using System.IO; -using System.Messaging; -using System.Runtime.InteropServices; -using System.Collections; -using Utils; -using VDB; -using VDB_Proc; -using VDB_Set; -using VDB_TransUsage; -using VDB_ROUsage; -using VEMessageNS; -using ROFST_FILE; - -namespace VEObject -{ - /// - /// VEO_Proc support procedure functionality - /// - public class VEO_Proc: VEO_Base - { - public VEO_ProcExt procExt; - public string origDate; - public string origTime; - public string _Prcnum; - public string recid; - public ProcColumnOptions _ProcColumn; - public string _ProcCode; - public string origProcCode; - public DataRow pdatarow; // row from set file. - private string[] DBExtensions={"DBF","DBT","NDX","SCR","FIX","APL","PGN","TCX","LLF","RTF","INF"}; - private bool[] AppExtensions={false,false,false,false,true,false,true,false,false,false,true}; - public string _ModInfo; - protected string tmpTitle; - protected string tmpProcNum; - protected ProcColumnOptions tmpProcCol; - protected bool changeProcNum; - protected bool changeTitle; - protected bool changeProcCol; - private string PrevDirectory; - private Process myProcess; - private Form mainForm; - private bool activeEdit; // flag that vfw is currently being brought up - don't do twice, if delay - - public VEO_Proc(string ilocaltitle, string ipath, string iprcnum, string irecid, VEO_Base.ProcColumnOptions format, string iprccode, DataRow dr, VEO_DummySet dset, bool inew) - { - activeEdit=false; - iconStates = new int[5] {26,26,26,26,26}; - procExt=null; - _Title = ilocaltitle; - _Location = ipath; - _Prcnum = iprcnum; - _ProcCode = iprccode; - origProcCode = _ProcCode; - _ProcColumn=(VEO_Base.ProcColumnOptions)format; - recid = irecid; - pdatarow = dr; - parentObj = dset; - - usrRunTime = dset.usrRunTime; - if(!inew) - { - if (dr["DATE"] is System.DBNull) - { - origDate = null; - origTime = null; - } - else - { - origDate = dr["DATE"].ToString().PadRight(8,' '); - origTime = dr["TIME"].ToString().PadRight(5,' '); - } - SetModString(dr["INITIALS"].ToString(),origDate,origTime); - DTI.SetDateTimeInit=origDate+origTime+dr["INITIALS"].ToString().PadRight(5,' '); - } - isNew = inew; - changeProcNum=false; - changeTitle=false; - changeProcCol=false; - VEObjectType = (int)VEObjectTypesDefs.Procedure; - LoadLockInfo(); - icon = iconStates[(int) Lock.LockStatus]; - } - - [Description("FileName"),Category("Procedure"),ReadOnly(true)]public string File_Name - { - get{return _Location;} - set{_Location=value;} - } - - [Description("Modification Information"),Category("Procedure"),ReadOnly(true)]public string Modification_Information - { - get{return _ModInfo;} - set{_ModInfo=value;} - } - - [Description("Procedure Number"),Category("Procedure"),EditorAttribute(typeof(VESymbDlg), typeof(System.Drawing.Design.UITypeEditor))]public string Procedure_Number - { - get - { - if(!changeProcNum) - return _Prcnum; - else - return tmpProcNum; - } - set - { - changeProcNum=true; - tmpProcNum=value; - } - } - - [Description("Procedure Title"),Category("Procedure"),EditorAttribute(typeof(VESymbDlg), typeof(System.Drawing.Design.UITypeEditor))]public string Title - { - get - { - if (!changeTitle) - return _Title; - else - return tmpTitle; - } - set - { - changeTitle=true; - tmpTitle=value; - } - } - - [Description("Format"),Category("Procedure")]public ProcColumnOptions Procedure_Column - { - get - { - if(!changeProcCol) - return _ProcColumn; - else - return tmpProcCol; - } - set - { - changeProcCol=true; - tmpProcCol=value; - } - } - - private void SetModString(string person, string sdt, string tm) - { - string outtm=null; - string outdt=null; - DateTime dt; - if (tm!=null && tm!="")outtm=tm.Substring(0,2)+":"+tm.Substring(2,2); - if (sdt !=null && sdt != "") - { - dt = System.Convert.ToDateTime(sdt); - outdt = dt.ToShortDateString(); - } - _ModInfo = person + " " + outdt + " " + outtm; - } - - private bool IsInSet(string fname) - { - VEO_DummySet ds = (VEO_DummySet) parentObj; - VEO_Proc prc = null; - foreach (Object chld in ds.Children) - { - prc = (VEO_Proc)chld; - if (prc._Location == fname)return true; - } - return false; - } - private void SetUpNewFileName() - { - int i=0; - StringBuilder newname = new StringBuilder(); - if(!isOpen) Open(); - while(i==0 || (File.Exists(newname.ToString())||IsInSet(newname.ToString()))) - { - newname.Remove(0,newname.Length); - newname.Append("PROC"); - string tmp = i.ToString(); - newname.Append(i.ToString("d3")); - newname.Append(".dbf"); - i++; - } - this._Location = newname.ToString().Substring(0,7); - } - - public override bool PropertiesDlg(Object parent) - { - bool retval = false; - PrcProperties propdlg; - if (isNew) SetUpNewFileName(); - propdlg = new PrcProperties(parent, this, procExt); - if (propdlg.ShowDialog() == DialogResult.OK) - { - SetModString(pdatarow["INITIALS"].ToString(),pdatarow["DATE"].ToString(),pdatarow["TIME"].ToString()); - retval=true; - } - else this.Restore(); - propdlg = null; - return retval; - } - - public override void Restore() - { - changeProcNum=false; - changeTitle=false; - changeProcCol=false; - } - - public override string GetTreeNodeText() - { - VEO_DummySet dset = (VEO_DummySet) this.parentObj; - string UnitSpecPrcNum = ROFST_FILE.ROProcessTools.UnitSpecific(Procedure_Number,0,0,dset.LargestNumber); -// return Procedure_Number + " " + Title; - return UnitSpecPrcNum + " " + Title; - } - - public override bool Open() - { - isOpen = true; - PrevDirectory = Directory.GetCurrentDirectory(); - VEO_DummySet ps = (VEO_DummySet) this.parentObj; - Directory.SetCurrentDirectory(ps._Location); - return true; - } - - // The close method resets, if necessary from any multi-user settings and - // positions back to the datapath directory (which is a level above the - // current level) - public override bool Close() - { - isOpen = false; - Directory.SetCurrentDirectory(PrevDirectory); - return true; - } - - -#if Upgrade2005_Print - public override bool Read(bool ChkForChldOnly) - { - VEO_DummySet ds = (VEO_DummySet) parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - string pth = ps._curDirectory + "\\" + ps._Location + "\\" + this._Location + ".dbf"; - if (ChkForChldOnly) - { - try - { -// vdb_Proc dbprc = new vdb_Proc(pth); -// int cnt = dbprc.GetCount("WHERE [SEQUENCE] like ' %'"); -// if (cnt>0) -// { - VEO_Section sct = new VEO_Section("XX", "XXXX", "TEMP", "XX", "0XXXXXXX"); //, this, true); - this.Children.Add(sct); -// } - } - catch (Exception e) - { - MessageBox.Show("Could not get count of sections " + e.Message); - return false; - } - - } - else - { - try - { - vdb_Proc dbprc = new vdb_Proc(pth); - DataSet sectset = dbprc.GetSortedByStepSeqType("WHERE [SEQUENCE] like ' %'"); - /* see if in order, assuming they are because of get sorted query.. */ - foreach (DataRow row in sectset.Tables[0].Rows) - { - // get properties of section & then create a section. - string Step = row["STEP"].ToString(); - string Sequence = row["SEQUENCE"].ToString(); - string Txt = row["TEXT"].ToString(); - string Type = row["TYPE"].ToString(); - string RecID = row["RECID"].ToString(); - VEO_Section sct = new VEO_Section(Step, Sequence, Txt, Type, RecID, this, false); - Children.Add(sct); - } - } - catch (Exception e) - { - MessageBox.Show("Error reading sections for " + this._Prcnum + ", " + e.Message); - return false; - } - } -#else - public override bool Read(bool dummy) - { - //load procs from set.dbf -#endif - return true; - } - - public override bool EditNode() - { - if(!isOpen) Open(); - if (!activeEdit) - { - ExecVfw(null); - activeEdit=true; - } - return true; - } - - public void ExecVfw(string appendarg) - { - StringBuilder sb = new StringBuilder(); - sb.Append("/c start /separate /w "); - sb.Append(this.usrRunTime.ExeAdjust("@vfw.exe")); - sb.Append(" /u-"); - sb.Append(this.usrRunTime.UserID); //user login/initials - sb.Append(" -o"); - sb.Append(this.usrRunTime.sec.userid.ToString()); - sb.Append(" -i"); // do initials - sb.Append(this.usrRunTime.sec.initials); - sb.Append(" -s\""); - sb.Append(this.usrRunTime.syspath); - sb.Append("\\vesam.opt\" -w"); - sb.Append(System.Convert.ToString(VEMessage.Handle_16bit,16)); - if (appendarg !=null && appendarg=="t") - sb.Append(" -t"); - else if (appendarg !=null && appendarg=="a") - sb.Append(" -a"); - - sb.Append(" -new"); - - // execute vfw using cmd because process was not creating the vfw process in - // its own memory space, i.e. only one copy of vfw came up even if two browsers - // tried to spawn it. - myProcess = new Process(); - myProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; - myProcess.StartInfo.FileName = "cmd"; - myProcess.StartInfo.Arguments = sb.ToString(); - myProcess.StartInfo.UseShellExecute = true; - myProcess.EnableRaisingEvents = true; - myProcess.Exited += new System.EventHandler(MyExitFunc); - // When vfw exits, 'MyExitFunc' method gets called from the above eventhandler - // where form is made visible again & locking/connecting is checked. - - try - { - IntPtr handle = - System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle; - mainForm = (Form)Form.FromHandle(handle); - mainForm.Enabled = false; - - myProcess.Start(); - } - catch (Win32Exception e) - { - MessageBox.Show(e.Message + ". Error on load of vfw."); - } - } - - private void MyExitFunc(object sender, System.EventArgs e) - { - mainForm.Visible = true; - mainForm.Enabled = true; - TreeView tv = null; - foreach (Control ctl in mainForm.Controls) - { - if (ctl is TreeView) tv = (TreeView)ctl; - } - if (tv != null) tv.Focus(); - VEO_DummySet ds = (VEO_DummySet) parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - // enter the connection (reenter). This will check for changes in locking, etc. - ps.Connection.Enter(false); - if (ps.Lock.LockStatus==VENetwork.Status.LockPending) ps.Lock.LockStatus=VENetwork.Status.Locked; - ps.icon = ps.iconStates[(int)ps.Lock.LockStatus]; - ps.treeNode.ImageIndex = ps.icon; - ps.treeNode.SelectedImageIndex = ps.icon; - mainForm = null; - activeEdit=false; - ps.AppSelForEdit=null; - } - - // see if the procedure can be deleted... - private bool canDelete() - { - // check for transitions to this procedure. If they exist, make - // up a search result list & use vfw to resolve. - VEO_DummySet pds = (VEO_DummySet) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) pds.parentObj; - string pth = ps._curDirectory+"\\"+ps.Location+"\\tran.dbf"; - vdb_TransUsage transusg = new vdb_TransUsage(pth); - DataSet ds = transusg.GetSortedByToTrans("[TONUMBER] = \'"+this._Prcnum.Replace("'","''")+"\'"); - if (ds.Tables[0].Rows.Count !=0) - { - bool is_ext=false; - foreach(DataRow dr in ds.Tables[0].Rows) - { - if (dr["FROMNUMBER"].ToString() != this._Prcnum) - { - is_ext=true; - break; - } - } - if (is_ext) - { - MessageBox.Show("Delete Operation failed!\n\nYou need to remove transition references to this procedure.\n\nThe procedure editor will now display with a list of the transition locations."); - ExecVfw("t"); - return false; - } - } - return true; - } - - public override bool Delete() - { - if (!isOpen) Open(); - // first see if the procedure can be deleted (if the procedure has - // transitions to it, it cannot be deleted). If so, do it. - if (canDelete()==false) return false; - - VEO_DummySet pds = (VEO_DummySet) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) pds.parentObj; - - //Remove the transitions 'from' in the usage file. - string pth = ps._curDirectory+"\\"+ps.Location+"\\tran.dbf"; - vdb_TransUsage transusg = new vdb_TransUsage(pth); - DataSet ds = transusg.GetSortedByFromTrans("[FROMNUMBER] = \'"+this._Prcnum.Replace("'","''")+"\'"); - int ndr = ds.Tables[0].Rows.Count; - foreach (DataRow dr in ds.Tables[0].Rows) dr.Delete(); - // if deleted any, need to save data & pack database - if (ndr>0) - { - transusg.DB_Data = ds.Tables[0].DataSet; - transusg.Pack(); - } - - // now, do the same for RO references - pth = ps._curDirectory+"\\"+ps.Location+"\\usagero.dbf"; - vdb_ROUsage rousg = new vdb_ROUsage(pth); - ds = rousg.GetSortedByProc("[NUMBER] = \'"+this._Prcnum.Replace("'","''")+"\'"); - ndr = ds.Tables[0].Rows.Count; - foreach (DataRow dr in ds.Tables[0].Rows)dr.Delete(); - if (ndr>0) - { - rousg.DB_Data = ds.Tables[0].DataSet; - rousg.Pack(); - } - - // remove procedure files & related rtffiles - foreach(string str in DBExtensions) - { - // status update function - count); - string filename = pds._Location + "\\" + this._Location + "." + str; - if (File.Exists(filename)) File.Delete(filename); - } - RemoveAccessoryFiles(this._Location,"wpfiles"); - RemoveAccessoryFiles(this._Location,"rtffiles"); - - // delete the record if the above goes ok. - pdatarow.Delete(); - VEO_DummySet dset = (VEO_DummySet) this.parentObj; - dset.vdbSet.DB_Data = pdatarow.Table.DataSet; - - // if there was a set extension record. Delete it too. - if(ps.hasExtensions) - { - procExt.drow.Delete(); - dset.vdbSetExt.DB_Data = procExt.drow.Table.DataSet; - procExt=null; - } - - // if parent dummy set only has this child, set its icon to empty - if (dset.Children.Count<=1) IsEmpty = true; - - // Note that the database is not getting packed - so pack it, and - // then re-read in the data for the procs (from the parent node). - int whichone=0; - for (int i=0;iptlength?ptlength:tmpTitle.Length); - pdatarow["TITLE"] = tmpTitle; - _Title = tmpTitle; - changeTitle=false; - dchange=true; - if (tmpTitle.Length+1 > dset.LargestTitleForMenu) - { - dset.LargestTitleForMenu = tmpTitle.Length+1; - dchnglarge=true; - } - } - if (changeProcNum && (string)pdatarow["NUMBER"]!=tmpProcNum) - { - if(tmpProcNum.Length>20) tmpProcNum= tmpProcNum.Substring(0,20); - oldnumber=_Prcnum; - newnumber=tmpProcNum; - pdatarow["NUMBER"] = tmpProcNum; - _Prcnum = tmpProcNum; - dchange=true; - if (tmpProcNum.Length+1 > dset.LargestNumber) - { - dset.LargestNumber = tmpProcNum.Length+1; - dchnglarge=true; - } - if ((tmpProcNum.Substring(0,1)!=" ") && tmpProcNum.Length+1>dset.LargestNumberForMenu) - { - dset.LargestNumberForMenu = tmpProcNum.Length+1; - dchnglarge= true; - } - } - - int itmpcol = (int)Procedure_Column+1; - string stmpcol=itmpcol.ToString(); - // check that the internal temporary column wasn't set to a default value of 2, - // this is set when the FORMAT field = null or 0. The Browser (and original DMAS) - // did not look at the format file value PMODE, as it should, to determine - // the default. This cannot be fixed at this time because during the format files - // are not read/parsed to get the value of PMODE. - bool deflt = (pdatarow["FORMAT"] is System.DBNull || (string)pdatarow["FORMAT"]=="0")&&stmpcol=="2"; - bool datadiff=false; - if (pdatarow["FORMAT"] is System.DBNull) - { - if (stmpcol!="2") datadiff=true; - } - else - datadiff = (string)pdatarow["FORMAT"]!=stmpcol; - - if (changeProcCol && datadiff && !deflt) - { - pdatarow["FORMAT"] = stmpcol; - _ProcColumn=Procedure_Column; - changeProcCol=false; - dchange=true; - } - - if(origProcCode != _ProcCode) - { - pdatarow["PROCCODE"] = _ProcCode; - dchange=true; - } - if(dchange) - { - try - { - // modify the first record if the largest string length changed. - if (dchnglarge) - { - DataRow recidrow = pdatarow.Table.Rows[0]; - string padstr1 = dset.LargestNumber.ToString("d2").PadLeft(2,'0'); - string padstr2 = dset.LargestNumberForMenu.ToString("d2").PadLeft(2,'0'); - string padstr3 = dset.LargestTitleForMenu.ToString("d2").PadLeft(2,'0'); - recidrow["NUMBER"] = padstr1 + " " + padstr2 + " " + padstr3; - } - dset.vdbSet.DB_Data = pdatarow.Table.DataSet; - } - catch (Exception e) - { - MessageBox.Show(e.Message); - return false; - } - } - // see if this has a setext to save.... - - if (pset.hasExtensions) - { - bool ret = this.procExt.Write(dset); - if (!ret) return false; - } - - // if the procedure number was changed, then need to update usage files - // with the new procnumber - if (changeProcNum && (newnumber != oldnumber)) - { - //Remove the transitions 'from' in the usage file. - string pth = pset._curDirectory+"\\"+pset.Location+"\\tran.dbf"; - vdb_TransUsage transusg = new vdb_TransUsage(pth); - transusg.UpdateProcNumber(oldnumber,newnumber); - transusg=null; - - pth = pset._curDirectory+"\\"+pset.Location+"\\usagero.dbf"; - vdb_ROUsage rousage = new vdb_ROUsage(pth); - rousage.UpdateProcNumber(oldnumber,newnumber); - rousage=null; - changeProcNum=false; - } - return true; - } - - - // Make an initial dummy step. - static void CreateInitStep(vdb_Proc prc) - { - // update the recid - DataTable tbl = prc.DB_Data.Tables[0]; - DataRow recidrow = tbl.Rows[0]; - string tmprecid = recidrow["RECID"].ToString(); - int irecid = System.Convert.ToInt32(tmprecid.Substring(2,6)); - irecid++; - tmprecid = tmprecid.Substring(0,2)+irecid.ToString("d6"); - recidrow["RECID"]=tmprecid; - - // add the new row for the first section - DataRow pdatarow = tbl.NewRow(); - pdatarow["RECID"] = "00000002"; - pdatarow["STEP"] = "A1"; - pdatarow["SEQUENCE"] = "S"; - pdatarow["TEXT"] = "Dummy Step"; - pdatarow["TYPE"] = "01"; - DateTime tm = System.DateTime.Now; - pdatarow["DATE"] = tm.ToString("MM/dd/yyyy"); - pdatarow["TIME"] = tm.ToString("HHmm") + ":"; - tbl.Rows.Add(pdatarow); - prc.DB_Data = pdatarow.Table.DataSet; - } - - // Make an initial procedure step section. - static void CreateInitSection(vdb_Proc prc) - { - // update the recid - DataTable tbl = prc.DB_Data.Tables[0]; - DataRow recidrow = tbl.Rows[0]; - string tmprecid = recidrow["RECID"].ToString(); - int irecid = System.Convert.ToInt32(tmprecid.Substring(2,6)); - irecid++; - tmprecid = tmprecid.Substring(0,2)+irecid.ToString("d6"); - recidrow["RECID"]=tmprecid; - - // add the new row for the first section - DataRow pdatarow = tbl.NewRow(); - pdatarow["RECID"] = "00000001"; - pdatarow["STEP"] = "A0"; - pdatarow["SEQUENCE"] = " 1X"; - pdatarow["TEXT"] = "Procedure Steps"; - pdatarow["TYPE"] = "01"; - DateTime tm = System.DateTime.Now; - pdatarow["DATE"] = tm.ToString("MM/dd/yyyy"); - pdatarow["TIME"] = tm.ToString("HHmm") + ":"; - tbl.Rows.Add(pdatarow); - prc.DB_Data = pdatarow.Table.DataSet; //save the changed dataset info - } - - // Create a new procedure. - public override bool SaveNew(string dummy) - { - try - { - VEO_DummySet ds = (VEO_DummySet) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - // check for a valid name. - // create the new procedure file, create the initial section & initial step. - vdb_Proc newprc = new vdb_Proc(""); - newprc.CreateTable(this._Location); - CreateInitSection(newprc); // Make procedure section - CreateInitStep(newprc); // Add a dummy step - - // Add the record to the set file. - DataTable pdatatable = ds.vdbSet.DB_Data.Tables[0]; - DataRow recidrow = pdatatable.Rows[0]; - string currecid = recidrow["RECID"].ToString(); - string tmprecid = currecid; - int irecid = System.Convert.ToInt32(tmprecid.Substring(2,6)); - irecid++; - tmprecid = tmprecid.Substring(0,2)+irecid.ToString("d6"); - recidrow["RECID"]=tmprecid; - pdatarow = pdatatable.NewRow(); - - // check whether to trim the number & title. - if (Procedure_Number.Length>20)Procedure_Number=Procedure_Number.Substring(0,20); - if (Title.Length>78)Title=Title.Substring(0,78); - pdatarow["RECID"] = currecid; - pdatarow["TITLE"] = Title; - pdatarow["NUMBER"] = Procedure_Number; - int itmpcol = (int)Procedure_Column+1; - pdatarow["FORMAT"] = itmpcol.ToString(); - pdatarow["ENTRY"] = _Location; - DateTime tm = System.DateTime.Now; - pdatarow["DATE"] = tm.ToString("MM/dd/yyyy"); - pdatarow["TIME"] = tm.ToString("HHmm") + ":"; - pdatarow["PROCCODE"] = _ProcCode; - pdatatable.Rows.Add(pdatarow); - - // See if this proc's data changes the largest numbers stored - // in the first record. - bool chg = false; - if (Procedure_Number.Length+1 > ds.LargestNumber) - { - chg=true; - ds.LargestNumber = Procedure_Number.Length+1; - } - if ((Procedure_Number.Substring(0,1)!=" ") && (Procedure_Number.Length+1>ds.LargestNumberForMenu)) - { - chg=true; - ds.LargestNumberForMenu = Procedure_Number.Length+1; - } - if (Title.Length+1 > ds.LargestTitleForMenu) - { - chg=true; - ds.LargestTitleForMenu = Title.Length+1; - } - if (chg) - { - string padstr1 = ds.LargestNumber.ToString("d2").PadLeft(2,'0'); - string padstr2 = ds.LargestNumberForMenu.ToString("d2").PadLeft(2,'0'); - string padstr3 = ds.LargestTitleForMenu.ToString("d2").PadLeft(2,'0'); - recidrow["NUMBER"] = padstr1 + " " + padstr2 + " " + padstr3; - } - ds.vdbSet.DB_Data = pdatarow.Table.DataSet; - _Title=Title; - _Prcnum=Procedure_Number; - _ProcColumn=Procedure_Column; - changeTitle=false; - changeProcCol=false; - changeProcNum=false; - - if (ps.hasExtensions) this.procExt.SaveNew(this, tmprecid); - isNew=false; - ds.icon = ds.iconStates[0]; // in case it was empty - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Could not perform database functions required to add procedure."); - return false; - } - return true; - } - - public override bool updateROValues() - { - // update the ro values for this procset, so get parent's (dummy set), parent - VEO_DummySet ds = (VEO_DummySet) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - return ps.updateROValues(); - } - - public override void CleanTransitionsAndROsUsages(int clntype,string ProcName) - { - // clean, send this procname to procedure set to spawn the clean - VEO_DummySet ds = (VEO_DummySet) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - ps.CleanTransitionsAndROsUsages(clntype,this._Prcnum); - } - - public override void ApproveProcedures(int aptype, ArrayList procs) - { - VEO_DummySet ds = (VEO_DummySet) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - if (aptype == 0) - ps.ApproveProcedures(aptype,null); - else if (procs.Count>0) - ps.ApproveProcedures(aptype,procs); - else - { - ArrayList prcs = new ArrayList(); - prcs.Add(this); - ps.ApproveProcedures(aptype,prcs); - } - } - - public override void DataIntegrityCheck(string ProcName) - { - // send this procname to procedure set to spawn the DataCheck - VEO_DummySet ds = (VEO_DummySet) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - ps.DataIntegrityCheck(this._Prcnum); - } - - private void MoveFixFile(string apname, string appath, VEO_ProcSet ps) - { - string[] FxExt = {".FIX",".FX1",".FX2",".FX3",".FX4",".FX5",".FX6",".FX7",".FX8"}; - string apvname = (apname==null || apname == "")?_Location:apname; - foreach (string str in FxExt) - ps.CopyAnyFileToApproved(_Location+str,apvname+str,appath); - } - - private void FixProcDateAndTime(string apname, VEO_ProcSet ps) - { - string[] extensions = {".dbf",".dbt",".ndx"}; - string appath = null; - string wd = null; - string apvname = (apname==null||apname=="")?_Location:apname; - foreach (string str in extensions) - { - appath = ps.GetApprovedDirectory("\\") + apvname + str; - wd = _Location + str; - FileInfo fi_app = new FileInfo(appath); - FileInfo fi_wd = new FileInfo(wd); - fi_app.LastWriteTime = fi_wd.LastWriteTime; - File.Copy(appath, wd, true); - fi_app = new FileInfo(appath); - fi_wd = new FileInfo(wd); - fi_app.LastWriteTime = fi_wd.LastWriteTime; - fi_wd.LastWriteTime = fi_app.LastWriteTime; - } - } - - public void Copy(string srcdir, string destdir, string prcnum, string prcfile) - { - VEO_DummySet ds = (VEO_DummySet) parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - // if there is a new procedure to add for a modified proc number, - // prcfile will not == the _Location. Use it instead. - string loc=null; - if (prcfile != _Location) - loc = prcfile; - else - loc = _Location; - string destfile = destdir + "\\" + loc; - string srcfile = (srcdir==null)? _Location: srcdir + "\\" + _Location; - - if (!File.Exists(srcfile+".dbf")) return; - if (File.Exists(destfile+".dbf")) File.Delete(destfile+".dbf"); - if (File.Exists(destfile+".ndx")) File.Delete(destfile+".ndx"); - if (File.Exists(destfile+".dbt")) File.Delete(destfile+".dbt"); - - vdb_Proc dbprc = null; - try - { - dbprc = new vdb_Proc(srcfile+".dbf"); - // Use SelectIntoNewTable to create the table & copy it over using - // sql select * into ... Then just make an instance of the table, this - // will set up indexes and inf files as necessary. - dbprc.SelectIntoNewTable(srcdir+"\\"+destfile); - string cwd = Directory.GetCurrentDirectory(); - Directory.SetCurrentDirectory(destdir); - vdb_Proc apprc = new vdb_Proc(loc+".dbf"); - Directory.SetCurrentDirectory(cwd); - apprc=null; - } - catch (Exception e) - { - MessageBox.Show("Could not copy " + _Location + " to approved." + e.Message); - return; - } - - // now copy over rtf files by finding the procedure records that are attachments. - DataSet accset=null; - try - { - accset = dbprc.GetSortedByStepSeqType("WHERE [SEQUENCE] like ' %'"); - } - catch (Exception e) - { - MessageBox.Show("Could not copy over accessory page files " + this._Prcnum + ", " + e.Message); - return; - } - string rtfsrcdir = srcdir + "\\rtffiles\\" + this._Location + ".A"; - string rtfdestdir = destdir + "\\rtffiles\\" + prcfile + ".A"; - foreach (DataRow dr in accset.Tables[0].Rows) - { - bool accpage = (char.IsLetter(dr["STEP"].ToString()[1]))?true:false; - if (accpage) - { - string stpno = (string) dr["STEP"].ToString(); - char accsect = stpno[0]; - string tmpext = (accsect-'@').ToString("D2"); - if (File.Exists(rtfsrcdir+tmpext)) - File.Copy(rtfsrcdir+tmpext,rtfdestdir+tmpext,true); - } - } - - for (int i=0;iptlength?ptlength:_Title.Length); - foundRow["NUMBER"] = _Prcnum; - foundRow["ENTRY"]= _Location==ApProcFile?_Location:ApProcFile; - - foundRow["FORMAT"] = pdatarow["FORMAT"]; // if modified, pdatarow has current - foundRow["PROCCODE"] = _ProcCode; - - // if removing change bars, update the working draft date/time stamp - // for this procedure. - if (ps.RmChgBarOnApp) - { - ps.UpdateSetDTI(false,pdatarow); - ds.vdbSet.DB_Data = pdatarow.Table.DataSet; - } - - vdbSet.DB_Data = foundRow.Table.DataSet; // write it out - - // now make sure we update the largestnumber data in the set header - - recidrow = pdatarow.Table.Rows[0]; - string tmplarge = recidrow["NUMBER"].ToString(); - if (tmplarge == null || tmplarge == "") tmplarge = "00000000"; - bool update=false; - if (ds.LargestNumber != System.Convert.ToInt32(tmplarge.Substring(0,2))) - { - update=true; - tmplarge = ds.LargestNumber.ToString("d2").PadLeft(2,'0') + tmplarge.Substring(2,tmplarge.Length-2); - } - if (ds.LargestNumberForMenu != System.Convert.ToInt32(tmplarge.Substring(3,2))) - { - update = true; - tmplarge = tmplarge.Substring(0,3) + ds.LargestNumberForMenu.ToString("d2").PadLeft(2,'0') + tmplarge.Substring(5,tmplarge.Length-5); - } - if (ds.LargestTitleForMenu != System.Convert.ToInt32(tmplarge.Substring(6,2))) - { - update = true; - tmplarge = tmplarge.Substring(0,6) + ds.LargestTitleForMenu.ToString("d2").PadLeft(2,'0'); - } - if (update) - { - recidrow["NUMBER"] = tmplarge; - vdbSet.DB_Data = recidrow.Table.DataSet; // write it out - } - } - - // pass in approved path & approved procedure number, i.e. original procedure - // number - if the proc number is modified, this stores original otherwise - // it is the current proc number. (if this is a new procedure then ApProcNum=null. - public void FixTransitionReferences(string ApprovedPath, string ApProcNum) - { - string appath=ApprovedPath+"\\tran.dbf"; - VEO_DummySet ds = (VEO_DummySet) parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - try - { - vdb_TransUsage atransusg = new vdb_TransUsage(appath); - // if this procedure existed before this approval, then remove transitions-from - // approved version (they'll be added back later). - if (ApProcNum != null) - { - DataSet adset = atransusg.GetSortedByFromTrans("[FROMNUMBER] = \'"+ApProcNum.Replace("'","''")+"\'"); - int ndr = adset.Tables[0].Rows.Count; - if (ndr > 0) - { - int errs = atransusg.DeleteSelected("[FROMNUMBER] = \'"+ApProcNum.Replace("'","''")+"\'"); - if (errs>0) - { - MessageBox.Show("Error resolving transition records"); - return; - } - atransusg.Pack(); - } - - // if there was a change in procedure number, then update the transitions-to in - // the approved version. - if (ApProcNum!=_Prcnum) - { - adset.Clear(); - adset = atransusg.GetSortedByToTrans("[TONUMBER] = \'"+ApProcNum.Replace("'","''")+"\'"); - ndr = adset.Tables[0].Rows.Count; - foreach (DataRow dr in adset.Tables[0].Rows) dr["TONUMBER"]=_Prcnum; - if (ndr>0) atransusg.DB_Data = adset.Tables[0].DataSet; - } - adset.Clear(); - adset=null; - } - - // now update the approved transitions from data based on data in the working - // draft. - vdb_TransUsage transusg = new vdb_TransUsage(ps._curDirectory+"\\"+ps.Location+"\\tran.dbf"); - DataSet wdset = transusg.GetSortedByFromTrans("[FROMNUMBER] = \'"+_Prcnum.Replace("'","''")+"\'"); - if (wdset.Tables[0].Rows.Count>0) - { - int errs = transusg.InsertInto(ps._curDirectory+"\\"+ps.Location+"\\"+appath,"[FROMNUMBER] = \'"+_Prcnum.Replace("'","''")+"\'"); - if (errs>0) - { - MessageBox.Show("Error resolving transition records"); - return; - } - - // Now update the working draft 'OLDTO' field to contain the current - // working draft 'TONUMBER'+'TOSEQUENCE' fields. - StringBuilder qry = new StringBuilder(); - qry.Append("UPDATE TRAN SET TRAN.OLDTO = [TONUMBER] & Space(20-Len([TONUMBER])) & [TOSEQUENCE] & Space(12-Len([TOSEQUENCE])) "); - qry.Append("WHERE (tran.FROMNUMBER=\'"); - qry.Append(_Prcnum.Replace("'","''")); - qry.Append("\' AND tran.TOSEQUENCE IS NOT NULL)"); - - // This one handles the libdocs (their TOSEQUENCE is null). - bool success = transusg.UpdateUsing(qry.ToString()); - if (!success) MessageBox.Show("Error When Updating Transition history"); - qry.Length=0; - qry.Append("UPDATE TRAN SET TRAN.OLDTO = [TONUMBER] & Space(20-Len([TONUMBER])+12) "); - qry.Append("WHERE (tran.FROMNUMBER=\'"); - qry.Append(_Prcnum.Replace("'","''")); - qry.Append("\' AND tran.TOSEQUENCE IS NULL)"); - success = transusg.UpdateUsing(qry.ToString()); - if (!success) MessageBox.Show("Error When Updating Transition history"); - } - wdset.Dispose(); - transusg=null; - atransusg=null; - } - catch (Exception e) - { - MessageBox.Show("Could not approve transition usages for " + _Prcnum + ", "+e.Message); - } - } - - -#if Upgrade2005_Print -#else - public override void AddToTree(TreeNode parentnd) - { - } - public override bool Expand(TreeNode parentnd) - { - return true; - } -#endif - public override bool mnuAllowUpdRO() - { - VEO_DummySet ds = (VEO_DummySet) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - if (ps.isApproved||ps.IsEmpty||ps.isTempChange) return false; - return (amILockedByMe()); - } - - public override bool mnuAllowClean() - { - VEO_DummySet ds = (VEO_DummySet) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - if (ps.isApproved||ps.IsEmpty) return false; - if (amILockedByMe()==false) return false; - if ((ps.accessFlags&Security.CLEAN)==Security.CLEAN) return true; - return false; - } - - public override bool mnuAllowDataCheck() - { - VEO_DummySet ds = (VEO_DummySet) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - if (ps.isApproved||ps.IsEmpty) return false; - if (amILockedByMe()==false) return false; - if ((ps.accessFlags&Security.CLEAN)==Security.CLEAN) return true; - return false; - } - - public override bool mnuAllowChgDef() - { - VEO_DummySet ds = (VEO_DummySet) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - if (ps.IsEmpty) return false; - return(amILockedByMe()); - } - - public override bool mnuAllowNew() - { - return false; - } - - public override bool mnuAllowApprove() - { - VEO_DummySet ds = (VEO_DummySet) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - if (amILockedByMe()==false) return false; - if ((ps.isApproved == false) && (ps.isTempChange==false)) return true; - return false; - } - - public override bool mnuAllowApproveSel() - { - VEO_DummySet ds = (VEO_DummySet) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - if (ps.isApproved || ps.IsEmpty || ps.isTempChange) return false; - if (amILockedByMe()==false) return false; - if (ps.isSetApproved && ((ps.accessFlags&Security.APPROVESINGLE)==Security.APPROVESINGLE)) return true; - return false; - } - - public override bool mnuAllowApproveAll() - { - bool allowit=false; - bool allowonlyonce=false; - VEO_DummySet ds = (VEO_DummySet) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - if (ps.isApproved || ps.IsEmpty || ps.isTempChange) return false; // cannot approve an approved set - if (amILockedByMe()==false) return false; - if ((ps.accessFlags&Security.APPROVE)==Security.APPROVE) allowit = true; - // also check if there is a serial number option which allows only one - // approve-all, i.e. if an approved version exists, cannot approve all. - if (usrRunTime.SerialNumber.GetSNOption((uint)Utils.SerialNo.SN_Flags.SN_ONLYAPPROVEONCE_ON)>0) - allowonlyonce=true; - if (allowonlyonce && ps.isSetApproved) return false; - if (allowit) return true; - return false; - } - - // the following method is used by various other methods to determine whether modifications - // can be made to the procedure. - private bool AllowMods() - { - VEO_DummySet ds = (VEO_DummySet) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - if (ps.isApproved == true) return false; - if (amILockedByMe()==false) return false; -// Right now we are allowing the slave's procedure number and title be changed -// - but it will be wiped out when/if the master's set file changes. -// - If we want to NOT allow changes to the slave's procedure number and title -// then uncomment the following line. - jsj 04/08/05 -// if (ps._ProcType == ProcTypeOptions.Slave) return false; - if ((ps.accessFlags&Security.ADDMODDEL)==Security.ADDMODDEL) return true; - return false; - } - public override bool mnuAllowDelete() - { - return AllowMods(); - } - public override bool canEdit() - { - return AllowMods(); - } - - // determine whether drag/drop can occur. - public override bool canDoDragDrop() - { - // allow user to change order in approved set list - // return AllowMods(); - VEO_DummySet ds = (VEO_DummySet) this.parentObj; - VEO_ProcSet ps = (VEO_ProcSet) ds.parentObj; - if (amILockedByMe()==false) return false; - if (ps._ProcType == ProcTypeOptions.Slave) return false; - if ((ps.accessFlags&Security.ADDMODDEL)==Security.ADDMODDEL) return true; - return false; - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ProcExt.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ProcExt.cs deleted file mode 100644 index 0a338fa4..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ProcExt.cs +++ /dev/null @@ -1,218 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ProcExt.cs $ $Revision: 3 $ - * $Author: Kathy $ $Date: 4/21/05 10:22a $ - * - * $History: ProcExt.cs $ - * - * ***************** Version 3 ***************** - * User: Kathy Date: 4/21/05 Time: 10:22a - * Updated in $/LibSource/VEObject - * remove upgrade2005 define - * - * ***************** Version 2 ***************** - * User: Kathy Date: 3/08/05 Time: 1:51p - * Updated in $/LibSource/VEObject - * Approval - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:53a - * Created in $/LibSource/VEObject - *********************************************************************************************/ - -using System; -using System.Collections; -using System.Text; -using System.IO; -using System.Windows.Forms; -using System.Data; -using System.ComponentModel; -using System.Diagnostics; -using Utils; -using VDB; - -namespace VEObject -{ - /// - /// VEO_ProcExt support procedure set functionality. - /// - public class VEO_ProcExt : VEO_Base - { - public string latestRev; // 30 char long - public string latestPC; // 10 char long - public string recID; // 8 char long - public string approvalTD; - private string tmpComment; - private bool changeComment; - private string _Comment; - public DataRow drow; - - public VEO_ProcExt(string comment, string rev, string pc, string recid, string std, DataRow row) - { - changeComment=false; - _Comment = comment; - latestRev = rev; - latestPC = pc; - recID = recid; - approvalTD = std; - drow = row; - if (std==null || std=="") - approvalTD = "Not Approved"; - else - { - DateTime dtx = System.Convert.ToDateTime(std); - ThisTimeZone TZ = new ThisTimeZone(); - TimeSpan TimeZoneSpan = TZ.GetUtcOffset(dtx); // Time Zone offset from UTC - long TimeZoneAdj = Math.Abs(TimeZoneSpan.Ticks / 10000000); // convert to seconds - DateTime cnv = dtx.AddSeconds(-TimeZoneAdj); - approvalTD = cnv.ToLongDateString() + " " + cnv.ToLongTimeString(); - } - } - - [Description("Approved"),Category("Procedure Extension"),ReadOnly(true)]public string Approved - { - get{return approvalTD;} - } - - [Description("Revision"),Category("Procedure Extension"),ReadOnly(true)]public string Revision - { - get{return latestRev;} - } - - [Description("Change ID"),Category("Procedure Extension"),ReadOnly(true)]public string ChangeID - { - get{return latestPC;} - } - [Description("Comment"),Category("Procedure Extension")]public string Comment - { - get - { - if (!changeComment) - return _Comment; - else - return tmpComment; - } - set - { - changeComment=true; - tmpComment=value; - } - } - - public override void Restore() - { - changeComment=false; - } - - public bool SaveNew(VEO_Proc prc, string srecid) - { - try - { - VEO_DummySet ds = (VEO_DummySet) prc.parentObj; - - // Add the record to the setext file. - DataTable pdatatable = ds.vdbSetExt.DB_Data.Tables[0]; - DataRow recidrow = pdatatable.Rows[0]; - recidrow["RECID"]=srecid; - DataRow pdatarow = pdatatable.NewRow(); - recID = srecid; - pdatarow["RECID"] = srecid; - pdatarow["COMMENT"] = Comment; - pdatarow["REV"] = System.DBNull.Value; - pdatarow["PC"] = System.DBNull.Value; - - pdatatable.Rows.Add(pdatarow); - ds.vdbSetExt.DB_Data = pdatarow.Table.DataSet; - _Comment=Comment; - changeComment=false; - drow=pdatarow; - prc.procExt = this; - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Could not perform database functions required to add procedure."); - return false; - } - return true; - } - - public override bool Read(bool dummy) - { - return true; - } - - public bool Write(VEO_DummySet dset) - { - bool dchange=false; - VEO_ProcSet pset = (VEO_ProcSet) dset.parentObj; - if (changeComment) - { - if((drow["COMMENT"]==System.DBNull.Value && tmpComment!=null) ||((string)drow["COMMENT"]!=tmpComment)) - { - drow["COMMENT"] = tmpComment; - _Comment = tmpComment; - changeComment=false; - dchange=true; - } - } - if(dchange) - { - try - { - dset.vdbSetExt.DB_Data = drow.Table.DataSet; - } - catch (Exception e) - { - MessageBox.Show(e.Message); - return false; - } - } - return true; - } - - public void SetProcApprovedDate(string dbname, string ApprovedPath) - { - MessageBox.Show("Set Extention setting of approval date is not implemented yet"); - - - /* - * string apprfilepath = ApprovedPath + "\\" + dbname + ".dbf"; - DateTime dt = File.GetLastWriteTime(apprfilepath); - - //C - CODE.... - //get the approved file date/time stamp - if ( getftime(apprfile, &ft) == -1) - { - Zfree(&buff); - close(apprfile); - return; - } - close(apprfile); - // assign the file date/time to the Date and Time structures - dt.da_year = ft.ft_year + 1980; - dt.da_mon = (char)ft.ft_month; - dt.da_day = (char)ft.ft_day; - tm.ti_hour = (char)ft.ft_hour; - tm.ti_min = (char)ft.ft_min; - tm.ti_sec = (char)ft.ft_tsec << 1; - - // getdate(&dt); - // gettime(&tm); - (void) VDB_GetSetExtRecord(SetExtfd,rec,(char *)buff); - buff->approvalTD=dostounix(&dt,&tm); - NWSetMode(NWExclusive); - - if (!VDB_LockSetFile(SetExtfd)) - return; - (void) VDB_UpdateSetExtRecord(SetExtfd,rec,(char *)buff); - NWResetMode(); - VDB_UnLockSetFile(SetExtfd); - Zfree(&buff); - - return; - */ - } - } -} \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ProcSet.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ProcSet.cs deleted file mode 100644 index fd852ab1..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/ProcSet.cs +++ /dev/null @@ -1,4582 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ProcSet.cs $ $Revision: 45 $ - * $Author: Jsj $ $Date: 11/09/06 11:33a $ - * - * $History: ProcSet.cs $ - * - * ***************** Version 45 ***************** - * User: Jsj Date: 11/09/06 Time: 11:33a - * Updated in $/LibSource/VEObject - * skip empty library document files - * - * ***************** Version 44 ***************** - * User: Jsj Date: 10/06/06 Time: 11:21a - * Updated in $/LibSource/VEObject - * fixed logic in creating a new Enhanced Document set and in updating an - * Enhanced Document SET file. - * - * ***************** Version 43 ***************** - * User: Jsj Date: 8/30/06 Time: 10:04a - * Updated in $/LibSource/VEObject - * Added Multi Procedure Data Checker - * - * ***************** Version 42 ***************** - * User: Jsj Date: 7/21/06 Time: 2:58p - * Updated in $/LibSource/VEObject - * fixed Unhandled Exception error - * - * ***************** Version 41 ***************** - * User: Jsj Date: 7/06/06 Time: 2:08p - * Updated in $/LibSource/VEObject - * Fixed enhanced document set creation bug. The link files where being - * put in the wrong place. - * - * ***************** Version 40 ***************** - * User: Kathy Date: 6/15/06 Time: 8:59a - * Updated in $/LibSource/VEObject - * B2006-024 fix: check for exclusive connection before approval & lock - * during approval - * - * ***************** Version 39 ***************** - * User: Kathy Date: 5/01/06 Time: 11:18a - * Updated in $/LibSource/VEObject - * Fix B2006-018: single quote in proc number causes problem on data - * request - * - * ***************** Version 38 ***************** - * User: Jsj Date: 9/20/05 Time: 2:48p - * Updated in $/LibSource/VEObject - * ContAct.INI logic for approve and master/slave, also Proc.INI logic for - * approve - * - * ***************** Version 37 ***************** - * User: Kathy Date: 9/20/05 Time: 1:17p - * Updated in $/LibSource/VEObject - * Copy lib docs - initialize a variable - * - * ***************** Version 36 ***************** - * User: Jsj Date: 9/16/05 Time: 9:55a - * Updated in $/LibSource/VEObject - * Additional approval checks for RO Usage, RO directory existance, and - * date of RO.FST file - * - * ***************** Version 35 ***************** - * User: Kathy Date: 9/06/05 Time: 11:25a - * Updated in $/LibSource/VEObject - * B2005-032 (use largest numDatabases for app ind write ro.fst) - * - * ***************** Version 34 ***************** - * User: Kathy Date: 8/31/05 Time: 11:33a - * Updated in $/LibSource/VEObject - * B2005-032: new groups crashed when writing to ro.fst during approve - * sel. - * - * ***************** Version 33 ***************** - * User: Kathy Date: 8/16/05 Time: 2:56p - * Updated in $/LibSource/VEObject - * B2005-030: error if missing ndx - * - * ***************** Version 32 ***************** - * User: Kathy Date: 7/26/05 Time: 2:07p - * Updated in $/LibSource/VEObject - * Improve error message on updatesetdti if bad largestnumber data - * - * ***************** Version 31 ***************** - * User: Jsj Date: 7/15/05 Time: 4:06p - * Updated in $/LibSource/VEObject - * added check for empty RO usage - * - * ***************** Version 30 ***************** - * User: Kathy Date: 7/11/05 Time: 8:02a - * Updated in $/LibSource/VEObject - * Fix status message - * - * ***************** Version 29 ***************** - * User: Kathy Date: 7/07/05 Time: 1:49p - * Updated in $/LibSource/VEObject - * Fix Approve All Remove Change Bars from WD caption - * - * ***************** Version 28 ***************** - * User: Kathy Date: 6/21/05 Time: 7:26a - * Updated in $/LibSource/VEObject - * update ro from procedures & minor fixes - * - * ***************** Version 27 ***************** - * User: Jsj Date: 6/16/05 Time: 2:46p - * Updated in $/LibSource/VEObject - * Check for valid RO path before doing an approval - * - * ***************** Version 26 ***************** - * User: Kathy Date: 6/06/05 Time: 12:35p - * Updated in $/LibSource/VEObject - * Allow lock to be set, even if plant or system lock exists - * - * ***************** Version 25 ***************** - * User: Jsj Date: 6/02/05 Time: 11:35a - * Updated in $/LibSource/VEObject - * fix for approving with conditional ROs - * - * ***************** Version 24 ***************** - * User: Kathy Date: 5/31/05 Time: 12:42p - * Updated in $/LibSource/VEObject - * ? in vfw for ro values if approve selected before vfw - * - * ***************** Version 23 ***************** - * User: Kathy Date: 5/25/05 Time: 10:32a - * Updated in $/LibSource/VEObject - * Allow edits for tmpchg - * - * ***************** Version 22 ***************** - * User: Kathy Date: 5/20/05 Time: 10:23a - * Updated in $/LibSource/VEObject - * explicit close of ro.fst - * - * ***************** Version 21 ***************** - * User: Jsj Date: 5/20/05 Time: 9:22a - * Updated in $/LibSource/VEObject - * get the non-processed ro return value for saving in the RO.FST file - * - * ***************** Version 20 ***************** - * User: Kathy Date: 5/19/05 Time: 11:07a - * Updated in $/LibSource/VEObject - * missed updating oldto transition field on approve all - * - * ***************** Version 19 ***************** - * User: Jsj Date: 5/17/05 Time: 11:58a - * Updated in $/LibSource/VEObject - * Approve Graphic fix, cleanup - * - * ***************** Version 18 ***************** - * User: Jsj Date: 5/12/05 Time: 11:52a - * Updated in $/LibSource/VEObject - * fixed logic dealing with PROC.INI parent (master) identification and - * the EOP.LNK parent identification - * - * ***************** Version 17 ***************** - * User: Kathy Date: 5/11/05 Time: 9:29a - * Updated in $/LibSource/VEObject - * bug fixes/mods for approval testing - * - * ***************** Version 16 ***************** - * User: Jsj Date: 5/06/05 Time: 12:08p - * Updated in $/LibSource/VEObject - * bug fix setting creating new enhanced document set (setting up) - * - * ***************** Version 15 ***************** - * User: Kathy Date: 4/21/05 Time: 10:23a - * Updated in $/LibSource/VEObject - * remove upgrade2005 define & cleanup - * - * ***************** Version 14 ***************** - * User: Jsj Date: 4/15/05 Time: 9:46a - * Updated in $/LibSource/VEObject - * Bug fix B2005-021, parent and erg selections (backgrounds, deviations, - * slaves) was not sticking when changed. - * - * ***************** Version 13 ***************** - * User: Kathy Date: 4/12/05 Time: 1:04p - * Updated in $/LibSource/VEObject - * B2005-008: C2005-001: B2005-020. - * - * ***************** Version 12 ***************** - * User: Jsj Date: 3/31/05 Time: 9:17a - * Updated in $/LibSource/VEObject - * - * ***************** Version 11 ***************** - * User: Jsj Date: 3/28/05 Time: 12:17p - * Updated in $/LibSource/VEObject - * - * ***************** Version 10 ***************** - * User: Kathy Date: 3/22/05 Time: 10:09a - * Updated in $/LibSource/VEObject - * approve: remove chg bar/log file - * - * ***************** Version 9 ***************** - * User: Jsj Date: 3/14/05 Time: 1:37p - * Updated in $/LibSource/VEObject - * - * ***************** Version 8 ***************** - * User: Jsj Date: 3/10/05 Time: 4:01p - * Updated in $/LibSource/VEObject - * hooks to use the new rofst file namespace - * - * ***************** Version 7 ***************** - * User: Kathy Date: 3/08/05 Time: 1:51p - * Updated in $/LibSource/VEObject - * Approval - * - * ***************** Version 6 ***************** - * User: Kathy Date: 1/31/05 Time: 11:06a - * Updated in $/LibSource/VEObject - * Fix B2005-005 (connection & delete directory errors). also, fix icon - * - * ***************** Version 5 ***************** - * User: Kathy Date: 1/24/05 Time: 2:45p - * Updated in $/LibSource/VEObject - * B2005-004 fixes - * - * ***************** Version 4 ***************** - * User: Kathy Date: 1/10/05 Time: 1:07p - * Updated in $/LibSource/VEObject - * B2004-062: Allow new sets name of PROCS & PROCS2, and other fixes - * - * ***************** Version 3 ***************** - * User: Jsj Date: 11/12/04 Time: 10:35a - * Updated in $/LibSource/VEObject - * Change Default Settings fix - * - * ***************** Version 2 ***************** - * User: Kathy Date: 10/25/04 Time: 10:25a - * Updated in $/LibSource/VEObject - * Fix B2004-049 and don't load link info if only checking for child data - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:53a - * Created in $/LibSource/VEObject - *********************************************************************************************/ - -using System; -using System.Collections; -using System.Text; -using System.IO; -using System.Windows.Forms; -using System.Data; -using System.ComponentModel; -using System.Diagnostics; - -using Utils; -using GUI_Utils; -using VlnStatus; -using VDB_Proc; -using VENetwork; -using VDB; -using VDB_Set; -using VDB_SetExt; -using VDB_TransUsage; -using VDB_ROUsage; -using IniFileIO; - -namespace VEObject -{ - /// - /// VEO_ProcSet support procedure set functionality. - /// - public class VEO_ProcSet : VEO_Base - { - public bool isArchived; - public bool isApproved; // flags that this is an approved set - public bool isSetApproved; // flags set that has an approved subdirectory - public bool isTempChange; // flags that this is a temporary change set, - // i.e. tmpchg subdirectory in an approved dir - public bool hasLibDocs; - public bool setExists; - public bool hasExtensions; // has setextension (proccomment) option - public bool cfg_load; // flags whether cfg settings have been loaded yet - public ProcTypeOptions _ProcType; - public string parentLink; - public string guideLink; - public string ROPath; - public string _curDirectory; - public string _formatTitle; - private PSProperties propdlg; - public string ErrorOnPSName; - protected string tmpTitle; - protected string tmpLocation; - protected bool changeLocation; - protected bool changeTitle; - private string[] LinkFiles={"\\BCK.LNK","\\DVT.LNK","\\ERG.LNK"}; - private string PrevDirectory; - public string SuffixFlags; - public string ExtraRevNumber; - public string origExtraRevNumber; // check against for saving - public bool hasExtraRevNumber; - public long accessFlags; - public bool blnCopiedProcINI; - public string DateTimeInit; - public bool HasRevision; // flags that serial number includes approval revising function - public bool UseLongProcTitles; - // flag whether to remove change bars during approval (set on procset properties & - // value saved in proc.ini). Default is true. - public bool RmChgBarOnApp; - public bool tmpRmChgBarOnApp; - // the following should contain one of the procs to approve for approve selected, in case - // of edit conflicts at the set or 'Procedures' level. - public VEO_Proc AppSelForEdit; - - public VEO_ProcSet(UserRunTime iusrRunTime, string ititle, string ipath, long acFlags) - { - isTempChange=false; - isApproved=false; - accessFlags=acFlags; - ErrorOnPSName=null; - ExtraRevNumber=null; - origExtraRevNumber=null; - usrRunTime = iusrRunTime; - cfg_load = false; - hasExtensions = usrRunTime.SerialNumber.GetSNOption((uint)Utils.SerialNo.SN_Flags.SN_PROCCOMMENT_ON)>0; - hasExtraRevNumber=false; - SuffixFlags=null; - blnCopiedProcINI = false; - AppSelForEdit = null; - if (ititle==null) - { - _curDirectory = ipath; - isNew=true; - _Title = "New Procedure Set"; - _Location = ""; - } - else - { - int indx1, indx2; - if (((indx1=ipath.IndexOf("\\approved"))>-1) || ((indx2=ipath.IndexOf("\\APPROVED"))>-1)) - isApproved=true; - - isSetApproved=false; - if(!isApproved) // see if this set has associated approved version - { - string apname = ipath + "\\approved\\set.dbf"; - isSetApproved = File.Exists(apname); - } - changeLocation=false; - changeTitle=false; - isNew=false; - string tmpstr = ipath.ToLower(); - int indxd; - int indxb; - int indxs; - indxd = tmpstr.IndexOf(".dvt"); - indxb = tmpstr.IndexOf(".bck"); - indxs = tmpstr.IndexOf(".sl"); - if (indxd > -1) - _ProcType=ProcTypeOptions.Deviation; - else if (indxb > -1) - _ProcType=ProcTypeOptions.Background; - else if (indxs > -1) - _ProcType=ProcTypeOptions.Slave; - else - _ProcType = ProcTypeOptions.Standard; - - string tmploc=ipath; - - int lstslash = tmploc.LastIndexOf("\\"); - if (lstslash < 0) lstslash = 0; - _curDirectory = tmploc.Substring(0,lstslash==0?tmploc.Length:lstslash); - _Location = tmploc.Substring(lstslash+1,tmploc.Length-lstslash-1); - _Title = ititle; - - VEObjectType = (int)VEObjectTypesDefs.ProcedureSet; - isTempChange = (_Location.ToUpper().IndexOf("TMPCHG",0,_Location.Length)>-1); - if (isTempChange) isApproved=false; - } - UseLongProcTitles=false; - RmChgBarOnApp=true; - FileInfo fi = new FileInfo(_curDirectory+"\\"+_Location+"\\PROC.INI"); - if (fi.Exists) - { - PrivateProfile ppCfg; - ppCfg = new PrivateProfile(_curDirectory+"\\"+_Location+"\\PROC.INI"); - string pptmp=ppCfg.Attr("Set Options","UseLongProcTitles"); - if (pptmp.ToUpper() == "TRUE") UseLongProcTitles=true; - pptmp = ppCfg.Attr("Set Options","RemoveChangeBarOnApproval"); - if (pptmp.ToUpper() == "FALSE") RmChgBarOnApp=false; - } - tmpRmChgBarOnApp=RmChgBarOnApp; - LoadLockInfo(); - if (isTempChange) - iconStates = new int[5] {23,23,25,23,24}; - else if (isApproved) - iconStates = new int[5] {18,18,20,18,19}; - else - iconStates = new int[5] {12,21,14,22,13}; - icon = iconStates[(int)Lock.LockStatus]; - } - - // Return true/false if the "masterdir" setting in the PROC.INI file - // matches the current directory name. Also set "mpath" to the - // "masterdir" value - public bool InMaster(ref string mpath) - { - PrivateProfile procINI; - string iniMasterDir; - procINI = new PrivateProfile(_curDirectory+"\\"+_Location+"\\PROC.INI"); - iniMasterDir=procINI.Attr("Applicability","masterdir"); - if (mpath != null) - mpath = iniMasterDir; - return (iniMasterDir.ToUpper()).Equals(_Location.ToUpper()); - } - - public string GetMasterFromProcINI() - { - string rtnstr=""; - InMaster(ref rtnstr); - return rtnstr; - } - - public override void LoadLockInfo() - { - Lock = new VELock(_curDirectory+"\\"+_Location, usrRunTime.myUserData, usrRunTime.InMultiUserMode?VENetwork.LockTypes.ProcSet:VENetwork.LockTypes.None); - } - - [Description("Location"),Category("Procedure Set"),ReadOnly(true)]public string Location - { - get{return _Location;} - set{_Location=value;} - } - - [Description("Current Directory"),Category("Procedure Set"),ReadOnly(true)]public string CurDirectory - { - get{return _curDirectory;} - set{_curDirectory=value;} - } - - [Description("Title"),Category("Procedure Set"),EditorAttribute(typeof(VESymbDlg), typeof(System.Drawing.Design.UITypeEditor))]public string Title - { - get - { - if (!changeTitle) - return _Title; - else - return tmpTitle; - } - set - { - changeTitle=true; - tmpTitle=value; - } - } - [Description("Format Title"),Category("Procedure Set"),ReadOnly(true)]public string FormatTitle - { - get{return _formatTitle;} - set{_formatTitle=value;} - } - - public override void Restore() - { - changeLocation=false; - changeTitle=false; - tmpRmChgBarOnApp=RmChgBarOnApp; - if(hasExtraRevNumber)ExtraRevNumber=origExtraRevNumber; - } - - public override bool Open() - { - if(_Location!=null) - { - isOpen = true; - if (Directory.GetCurrentDirectory() == _curDirectory+"\\"+_Location) - PrevDirectory = _curDirectory; - else - PrevDirectory = Directory.GetCurrentDirectory(); - Directory.SetCurrentDirectory(_curDirectory+"\\"+_Location); - } - return true; - } - - // The close method resets, if necessary from any multi-user settings and - // positions back to the parent directory (which is a level above the - // current level) - public override bool Close() - { - if (!isOpen)return false; - isOpen = false; - if (Connection !=null)Connection.Exit(); - Directory.SetCurrentDirectory(".."); - return true; - } - - public string GetFormatTitle() - { - if (isNew) - { - _formatTitle = "No format selected"; - return _formatTitle; - } - - // get curset pathname, i.e. whether single or multi user. - // for now, hardcode. - CurSet cs = new CurSet(this._curDirectory+"\\"+this._Location+"\\curset.dat"); - cs.Read(); - FmtFile ff = new FmtFile(cs.DefaultPlantFmt+".fmt"); - _formatTitle = ff.GetFormatTitle(usrRunTime); - return _formatTitle; - } - - public string GetParentLink() - { - if((_ProcType==ProcTypeOptions.Deviation || _ProcType==ProcTypeOptions.Background) - && parentLink==null) - { - string tmpPath = _curDirectory + "\\" + _Location + "\\eop.lnk"; - string line; - try - { - StreamReader sr = new StreamReader(tmpPath); - line = sr.ReadLine(); - sr.Close(); - parentLink=line; - } - catch (Exception) - { - parentLink=null; - } - } - else if (_ProcType==ProcTypeOptions.Slave) - { - parentLink = GetMasterFromProcINI(); - if (parentLink.Equals("")) - parentLink = null; - } - - if (parentLink != null) - { - if (parentLink[1] != ':') - { - // build full path - string CurDirSave = Directory.GetCurrentDirectory(); - if (parentLink.StartsWith(".") || - parentLink.StartsWith("\\")) - Directory.SetCurrentDirectory(_curDirectory + "\\" + _Location); - else - Directory.SetCurrentDirectory(_curDirectory); - Directory.SetCurrentDirectory(parentLink); - parentLink = Directory.GetCurrentDirectory(); - Directory.SetCurrentDirectory(CurDirSave); - } - } - return parentLink; - } - - public string GetGuideLink() - { - if(_ProcType==ProcTypeOptions.Deviation && guideLink==null) - { - string tmpPath = _curDirectory + "\\" + _Location + "\\erg.lnk"; - string line; - try - { - StreamReader sr = new StreamReader(tmpPath); - line = sr.ReadLine(); - sr.Close(); - guideLink=line; - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error Finding ERG Path"); - guideLink=null; - } - } - return guideLink; - } - - public bool CheckParentLink(string EOPSet, ProcTypeOptions linktype) - { - // Setup path to the linked EOP directory, if it's already set, don't allow change - string tmpPath = EOPSet + LinkFiles[(linktype==ProcTypeOptions.Background?0:1)]; - FileInfo fi = new FileInfo(tmpPath); - if (fi.Exists == true && !isNew) return (false); - return (true); - } - - public bool SetParentLink(string EOPSet, ProcTypeOptions linktype) - { - return SetParentLink(EOPSet,linktype,false); - } - - public bool SetParentLink(string EOPSet, ProcTypeOptions linktype, bool SelectionChange) - { - string enhSet=_curDirectory + "\\" + _Location; - // If Slave procedure set, then update the PROC.INI with the - // path to the master procedure set - if (linktype == ProcTypeOptions.Slave) - { - INIFile prcini = new INIFile(); - prcini.WriteINIKeyValueStr("Applicability","masterdir",EOPSet,"proc.ini"); - } - else - { - // Setup path to the linked EOP directory, if it's already set, don't allow change - string tmpPath = EOPSet + LinkFiles[(linktype==ProcTypeOptions.Background?0:1)]; - FileInfo fi = new FileInfo(tmpPath); - if (fi.Exists == true && !SelectionChange) return (false); - - tmpPath = enhSet + "\\EOP.LNK"; - DirectoryInfo di = new DirectoryInfo(enhSet); - if (di.Exists == false) return false; - // tmpPath = _Location + "\\eop.lnk"; - // currently in the directory -// fi = new FileInfo("eop.lnk"); - fi = new FileInfo(tmpPath); - if (fi.Exists) - fi.Delete(); - try - { -// StreamWriter sw = new StreamWriter("eop.lnk"); - StreamWriter sw = new StreamWriter(tmpPath); - sw.WriteLine(EOPSet); - sw.Close(); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error Creating EOP.LNK"); - return false; - } - - // Establish link file in EOP directory for use by "LinkTo" -// string enhSet=_curDirectory + "\\" + _Location; - tmpPath = EOPSet + LinkFiles[(linktype==ProcTypeOptions.Background?0:1)]; - try - { - StreamWriter sw = new StreamWriter(tmpPath); - sw.WriteLine(enhSet); - sw.Close(); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error Creating Background or Deviation LinkTO File"); - return false; - } - } - return (true); - } - - public bool SetGuideLink(string ERGSet) //,bool full) - { - string enhSet=_curDirectory + "\\" + _Location; - if (ERGSet == null || ERGSet=="") return false; - //string tmpPath = _Location + "\\erg.lnk"; - // Delete existing link file and write a new one. -// FileInfo fi = new FileInfo("erg.lnk"); - string tmpPath = enhSet + "\\erg.lnk"; -// FileInfo fi = new FileInfo("erg.lnk"); - DirectoryInfo di = new DirectoryInfo(enhSet); - if (di.Exists == false) return false; - FileInfo fi = new FileInfo(tmpPath); - if (fi.Exists) - fi.Delete(); - try - { -// StreamWriter sw = new StreamWriter("erg.lnk"); - StreamWriter sw = new StreamWriter(tmpPath); - sw.WriteLine(ERGSet); - sw.Close(); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error Creating ERG.LNK File"); - return false; - } - - return true; - } - - public bool Exists(string dname) - { - if(dname==null||dname=="") return false; - - string pname=null; - // see if this is a pathname, it needs to be for the Exists check. - if (dname.IndexOf("\\") < 0) // it's not a path, prepend the path - pname = _curDirectory + "\\" + dname; - else - pname = dname; - - // loop through all subdirectories to see if this one exists. - VEO_Plant plnt = (VEO_Plant) parentObj; - int numsets = plnt.Children.Count; - for (int i=0;i" argument - if (!amILockedByMe()) - { - string UserTempDir = usrRunTime.TempDirPath; - if (UserTempDir != null) - myProcess.StartInfo.Arguments = " -dir" + Directory.GetCurrentDirectory() + "\\" + UserTempDir; - } - - myProcess.Start(); - myProcess.WaitForExit(); - - // reset the format title. - GetFormatTitle(); - return true; - } - - public bool IsValid() - { - // name validity is checked in dialog. - // check for none-empty data. - if (_Location == null || _Location == "" || _Title == null || _Title == "") - { - MessageBox.Show("Need to fill in all data.", "General Error"); - return false; - } - - // check for correct linkage if this is a background or deviation. - if (this._ProcType == VEObject.ProcTypeOptions.Background || - this._ProcType == VEObject.ProcTypeOptions.Deviation) - { - // is the parent link already linked to a different document, if so. - // can't do another. - bool lnk = CheckParentLink(this.parentLink,this._ProcType); - if (!lnk) - { - MessageBox.Show("This document has a link already","General Error"); - return false; - } - } - return true; - } - - public bool CheckForValidPSName(string newdname) - { - bool rtnval = true; - ErrorOnPSName = null; - // get the new name for the procset & check that it ends with - // the correct extension & does not already exist. - // be sure the name doesn't exist. - string newpath = _curDirectory + "\\" + newdname; - if (Directory.Exists(newpath) == true) - { - ErrorOnPSName = "Location name for this set already exists."; - rtnval = false; - } - - // if standard type & procs - it's a valid name - if (rtnval && (this._ProcType==VEObject.ProcTypeOptions.Standard&&newdname.ToUpper() == "PROCS"))return true; - if (rtnval && (this._ProcType==VEObject.ProcTypeOptions.Standard&&newdname.ToUpper() == "PROCS2")) return true; - - if (rtnval && newdname.IndexOf(".") <0) - { - ErrorOnPSName = "Location (directory) name must have an extension."; - rtnval = false; - } - - if (rtnval) - { - int idx = newdname.LastIndexOf('.'); - string ext = ""; - - if (idx > 0) - { - ext = newdname.Substring(idx+1); - ext = ext.ToUpper(); - } - - if (this._ProcType == VEObject.ProcTypeOptions.Standard) - { - if (!ext.Equals("PRC")) - { - ErrorOnPSName = "Standard procedure set location (directory) must end in .PRC"; - rtnval = false; - } - } - else if (this._ProcType == VEObject.ProcTypeOptions.Background) - { - if (!ext.Equals("BCK")) - { - ErrorOnPSName = "Background procedure set location (directory) must end in .BCK"; - rtnval = false; - } - } - else if (this._ProcType == VEObject.ProcTypeOptions.Deviation) - { - if (!ext.Equals("DVT")) - { - ErrorOnPSName = "Deviation procedure set location (directory) must end in .DVT"; - rtnval = false; - } - } - else if (this._ProcType == VEObject.ProcTypeOptions.Slave) - { - if (ext.Length != 3 || !((ext.Substring(0,2)).Equals("SL")) || !System.Char.IsDigit(ext[2])) - { - ErrorOnPSName = "Slave procedure set location (directory) must end in .SL#\n\n Where # is a number from 1 to 9."; - rtnval = false; - } - } - } - - if (!rtnval) - { - MessageBox.Show(ErrorOnPSName,"Check Directory Name..."); - } - return rtnval; - } - - // write out the TITLE file. - private void WriteTextLineToFile(string fname, string title) - { - StreamWriter myWriter = new StreamWriter(fname,false); //overwrite if exist - myWriter.Write(title); - myWriter.Close(); - } - - private void WriteExtraRevNumber() - { - vdb_Set vdbSet=new vdb_Set(_curDirectory+"\\"+_Location+"\\set.dbf"); - DataRow rw = vdbSet.DB_Data.Tables[0].Rows[0]; - rw["TITLE"] = ExtraRevNumber; - vdbSet.DB_Data = rw.Table.DataSet; - vdbSet=null; - } - - public override bool Write() - { - // only write out title. - if (changeTitle) _Title=tmpTitle; - changeTitle=false; - if (RmChgBarOnApp!=tmpRmChgBarOnApp) // flags change. - { - RmChgBarOnApp = tmpRmChgBarOnApp; - INIFile inifile = new INIFile(); - if (RmChgBarOnApp) - inifile.WriteINIKeyValueStr("Set Options","RemoveChangeBarOnApproval","TRUE",_curDirectory+"\\"+_Location+"\\PROC.INI"); - else - inifile.WriteINIKeyValueStr("Set Options","RemoveChangeBarOnApproval","FALSE",_curDirectory+"\\"+_Location+"\\PROC.INI"); - inifile = null; - } - string pathTitle = _curDirectory + "\\" + _Location + "\\TITLE"; - WriteTextLineToFile(pathTitle,_Title); - - // check if hasExtraRevNumber, and if changed, write it to set file. - if (this.hasExtraRevNumber&&(origExtraRevNumber!=ExtraRevNumber)) - WriteExtraRevNumber(); - return true; - } - - static bool AddApplicabilityToMaster(string masterpath) - { - bool bUpdateSlavePROCINI = false; - INIFile ProcINIfile = new INIFile(); - string MasterName, MasterProcFile; - string rtnbuf = ""; - MasterName = masterpath.Substring(masterpath.LastIndexOf('\\')+1); - MasterProcFile = masterpath + "\\PROC.INI"; - rtnbuf = ProcINIfile.GetINIKeyValueStr("Applicability","masterdir","",15,MasterProcFile); - // If Applicability section not yet there, add it - if (rtnbuf.Equals("")) - { - ProcINIfile.WriteINIKeyValueStr("Applicability","masterdir",MasterName,MasterProcFile); - } - rtnbuf = ProcINIfile.GetINIKeyValueStr("Unit","Number","",15,MasterProcFile); - // If Unit section not yet there, add it - if (rtnbuf.Equals("")) - { - ProcINIfile.WriteINIKeyValueStr("Unit","Number","1,2",MasterProcFile); - ProcINIfile.WriteINIKeyValueStr("Unit","Name","Unit 1,Unit 2",MasterProcFile); - ProcINIfile.WriteINIKeyValueStr("Unit","Other Number","2,1",MasterProcFile); - ProcINIfile.WriteINIKeyValueStr("Unit","Other Name","Unit 2,Unit 1",MasterProcFile); - bUpdateSlavePROCINI = true; - } - return bUpdateSlavePROCINI; - } - - static void AddApplicabilityToSlave(string slavepath) - { - INIFile ProcINIfile = new INIFile(); - string SlaveProcFile; - SlaveProcFile = slavepath + "\\PROC.INI"; - // Preset to Slave one - ProcINIfile.WriteINIKeyValueStr("Unit","Number","1",SlaveProcFile); - ProcINIfile.WriteINIKeyValueStr("Unit","Name","Unit 1",SlaveProcFile); - ProcINIfile.WriteINIKeyValueStr("Unit","Other Number","2",SlaveProcFile); - ProcINIfile.WriteINIKeyValueStr("Unit","Other Name","Unit 2",SlaveProcFile); - } - - - // Create a new procedure set. - public override bool SaveNew(string dummy) - { - - // Determine the type of set. Validity of links has already been - // checked. - VEObject.ProcTypeOptions type = this._ProcType; - - // make the directory - string dname = _curDirectory + "\\" + Location; - DirectoryInfo di = new DirectoryInfo(dname); - if (di.Exists) - { - MessageBox.Show("Directory already exists, cannot create this set.","General Error"); - return false; - } - Cursor.Current = Cursors.WaitCursor; - di.Create(); - string prevdir = Directory.GetCurrentDirectory(); - Directory.SetCurrentDirectory(dname); - - // do database files now - vdb_Set newset = new vdb_Set(dname); - - // if a slave set, copy files from master set - if (type == VEObject.ProcTypeOptions.Slave) - { - CopyFileFrom(parentLink,"set.dbf"); - // Add Applicability section to Master's PROC.INI file if that - // information does not yet exist - bool UpdateSlaveUnits = AddApplicabilityToMaster(parentLink); - // Copy needed files from the master set - - // Note that if user manually entered data in the Advanced tab - // (for PROC.INI information, that info will be used instead - // of what is being copied from the master procedure set - CopyFileFrom(parentLink,"proc.ini"); - // If the master uses Automatic Continuous Action Summary sections - // copy the CONTACT.INI file - CopyFileFrom(parentLink,"ContAct.ini"); - blnCopiedProcINI = true; - if (UpdateSlaveUnits) - AddApplicabilityToSlave(this.CurDirectory + "\\" + this.Location); - - CopyFileFrom(parentLink,"curset.dat"); - CopyFileFrom(parentLink,"Tran.dbf"); - CopyFileFrom(parentLink,"Tranfrom.ndx"); - CopyFileFrom(parentLink,"Tranto.ndx"); - CopyFileFrom(parentLink,"Usagero.dbf"); - CopyFileFrom(parentLink,"Usagero.ndx"); - CopyFileFrom(parentLink,"Usagroid.ndx"); - } - // Bug fix: B2006-042 - // copy the SET.DBF file from the parent EOP set into the Enhanced - // Document folder - else if (type == VEObject.ProcTypeOptions.Deviation || type == VEObject.ProcTypeOptions.Background) - { - CopyFileFrom(parentLink,"set.dbf"); - } - else - { - newset.CreateTable("set"); - } - - // do the SET Ext stuff - if(hasExtensions) - { - vdb_SetExt newsetext = new vdb_SetExt(dname); - newsetext.CreateTable("setext"); - } - - // title file - WriteTextLineToFile("TITLE",Title); - - if (type != VEObject.ProcTypeOptions.Slave) - { - // trans & Ro usage files - vdb_TransUsage newtranusage = new vdb_TransUsage(dname); - newtranusage.CreateTable("TRAN"); - vdb_ROUsage newrousage = new vdb_ROUsage(dname); - newrousage.CreateTable("USAGERO"); - } - - // if this set has an extra rev number, write it out in first record, TITLE field. - if (this.hasExtraRevNumber&&(ExtraRevNumber!=null&&ExtraRevNumber!=""))WriteExtraRevNumber(); - - if (type != VEObject.ProcTypeOptions.Slave) - { - // create the PROC.INI file. - FileInfo fi = new FileInfo("PROC.INI"); - FileStream fs = fi.Create(); - fs.Close(); - - // create the current settings file (which sets the format) - CurSet curset = new CurSet(""); // create will set name. - bool success=curset.Create(usrRunTime); - if (success==false) - MessageBox.Show("Could not create a current settings file.","General Error"); - else - curset.Read(); - - if (type == VEObject.ProcTypeOptions.Background) curset.DefaultPlantFmt = "EBCK"; - else if (type == VEObject.ProcTypeOptions.Deviation)curset.DefaultPlantFmt = "ESFDEV"; - - success = ChgDefSettings(); - - // Set up the links if this is a deviation or background. - if (type != VEObject.ProcTypeOptions.Standard) success = SetParentLink(parentLink,type); - success = SetGuideLink(guideLink); - } // end not slave set - - // set up the RO directory path. If it's an enhanced document directory, - // copy the RO.FST file from the parent (EOP.LNK), otherwise, get user - // profile info. - if (type == VEObject.ProcTypeOptions.Standard) - { - if(getROPath()!=null) - { - updateROValues(); - setROPath(ROPath,dname); - } - } - else // slave or enhanced doc, copy RO.FST from parent. - CopyFileFrom(parentLink,"ro.fst"); - - // if the not Removing change bars (as set on the properties page) then - // save this to the proc.ini file. Default is TRUE, so don't bother unless - // it was set to FALSE. - if (!RmChgBarOnApp) - { - INIFile inifile = new INIFile(); - inifile.WriteINIKeyValueStr("Set Options","RemoveChangeBarOnApproval","FALSE",_curDirectory+"\\"+_Location+"\\PROC.INI"); - inifile=null; - } - tmpRmChgBarOnApp=RmChgBarOnApp; // used for mods on propery page. - - // add the dummy nodes for zip files, procedures & lib docs. - VEO_DummyZip zp = new VEO_DummyZip(usrRunTime, "Zip Files", dname); - zp.parentObj=this; - Children.Add(zp); - zp.IsEmpty = true; - zp.icon = zp.iconStates[(int)VEO_IconStates.Empty]; - VEO_DummySet prc = new VEO_DummySet(usrRunTime, "Procedures",dname); - prc.parentObj=this; - prc.vdbSet = newset; - Children.Add(prc); - prc.icon = prc.iconStates[(int)VEO_IconStates.Empty]; - prc.IsEmpty = true; - VEO_DummyLibDoc ld = new VEO_DummyLibDoc(usrRunTime, "Library Documents",dname); - ld.parentObj=this; - Children.Add(ld); - ld.icon = ld.iconStates[(int)VEO_IconStates.Empty]; - ld.IsEmpty = true; - _Title=Title; - _Location=Location; - changeTitle=false; - changeLocation=false; - Cursor.Current = Cursors.Default; - icon = iconStates[(int)VEO_IconStates.Normal]; - - // set a security flag for this. Cases could be that there is no security in vesam, - // that it has security in vesam, though it didn't exist for this user until now, - // or the user could be super user. - accessFlags=0L; - int plntsecindx = usrRunTime.sec.GetPlantSecurityIndex(_curDirectory); - bool hasSec = usrRunTime.sec.ProcSetHasSecurity(plntsecindx, dname); - if (hasSec) accessFlags = usrRunTime.sec.GetProcSecurity(dname); - - // reset directory after adding the new procedure set directory. - if (prevdir != Directory.GetCurrentDirectory()) Directory.SetCurrentDirectory(prevdir); - MessageBox.Show("The VE-PROMS Security Access Module (VESAM) may need to be used to set permissions to access the new procedure set.","VE-PROMS Security Note"); - return true; - } - - private string getROPath() - { - return getROPath(true); - } - - private string getROPath(bool domessage) - { - PrivateProfile ppCfg; - string ropath; - if (this.ROPath!=null) return ROPath; - - ppCfg = new PrivateProfile("PROC.INI"); - ropath=ppCfg.Attr("RO Defaults","ROPATH"); - if (ropath == null || ropath == "") ropath = "..\\RO"; - if (Directory.Exists(ropath)) - { - ROPath = ropath; - return ROPath; - } - // did not find a valid RO Path. Start with the current directory, - // back up a level at a time to see if an RO Directory could be found. - - StringBuilder testPath = new StringBuilder(); - testPath.Append(_curDirectory); - int slash = testPath.ToString().LastIndexOf("\\"); - while (slash > -1) - { - testPath.Remove(slash,testPath.Length-slash); - testPath.Append("\\RO"); - if (Directory.Exists(testPath.ToString())) - { - ROPath=testPath.ToString(); - break; - } - testPath.Remove(slash,3); // remove appended \RO - slash = testPath.ToString().LastIndexOf("\\"); - } - // if an RO directory not found, display an information message - if(ROPath==null && domessage)MessageBox.Show("No Referenced Object Database could be found.","Referenced Objects Path Error"); - return ROPath; - } - - private bool setROPath(string pth, string dstpth) - { - INIFile inifile = new INIFile(); - if (dstpth != null) // add destination path to PROC.INI file. - { - StringBuilder DestPath = new StringBuilder(132); - DestPath.Append(dstpth); - DestPath.Append("\\PROC.INI"); - inifile.WriteINIKeyValueStr("RO Defaults","ROPATH",pth,DestPath.ToString()); - } - else - inifile.WriteINIKeyValueStr("RO Defaults","ROPATH",pth,"PROC.INI"); - ROPath = pth; - return true; - } - - private void CopyFileFrom(string from, string filename) - { - string frmfile; - if (from == null) return; - - // create path to ro.fst in from directory. - // current working directory is the enhanced doc directory - frmfile = from + "\\" + filename; - - if (File.Exists(frmfile) == true) - File.Copy(frmfile,filename,true); - } - - public override bool updateROValues() - { - bool status = false; - - if (ROPath != null) // clear it to find correct path. - ROPath = null; - - // check PROC.INI for ROPath. - if (getROPath() != null) - { - string ROFstFile = ROPath + "\\Ro.fst"; - string ROFstFileLocal = "Ro.fst"; - if (File.Exists(ROFstFile) != true) - { - MessageBox.Show("Ro.fst does not exist. Create from the ROEditor.","RO.FST File Error"); - status = false; - } - else - { - // check to see if the fst file should be updated, i.e. the one - // in the RO directory is more recent. - FileInfo fstfile = new FileInfo(ROFstFile); - FileInfo fstfilelocal = new FileInfo(ROFstFileLocal); - bool cpy = true; - if (fstfilelocal.Exists == false) - cpy = true; - else if (fstfilelocal.LastWriteTime >fstfile.LastWriteTime) - { - System.Windows.Forms.DialogResult rslt; - rslt = MessageBox.Show("The Ro.fst in this procedure set is newer compared to the RO directory.\n\nCopy from the RO directory?","VE-PROMS",MessageBoxButtons.YesNo); - if (rslt == DialogResult.No) cpy = false; - } - else if (fstfilelocal.LastWriteTime == fstfile.LastWriteTime) - { - MessageBox.Show("Referenced Object values are current.","VE-PROMS"); - cpy = false; - } - if (cpy == true) - { - File.Copy(ROFstFile,ROFstFileLocal,true); - MessageBox.Show("Referenced Object values have been updated.","VE-PROMS"); - } - if (File.Exists("ro.fst") == false) - { - MessageBox.Show("Referenced Object Values were not successfully updated.","VE-PROMS Error"); - status = false; - } - else - status = true; - } - } - return status; - } - - /* - ** This function will from all of the backup files created from the - ** Clean Referenced Objects And Transition Usages function (VECLEAN) - */ - public void RestoreUsageAndProcFilesFromBadVECLEAN() - { - string[] FromStr = {"*.DBO","*.NDO","*.DTO"}; - string[] ToStr = {".DBF",".NDX",".DBT"}; - for (int i=0; i< 3; i++) - { - string[] dbfiles = Directory.GetFiles(FromStr[i]); - foreach (string dbfile in dbfiles) - { - string oldname = dbfile; - int indx = dbfile.IndexOf("."); - if (indx>-1) - { - string nname = dbfile.Substring(0,indx); - string newname = nname + ToStr[i]; - File.Delete(newname); - File.Move(oldname,newname); - } - } - } - } - - public void CheckForFailedCleanFunction() - { - // check for failed clean by looking for DBO and NDO files - if( File.Exists("*.dbo") || File.Exists("*.ndo") || File.Exists("*.dto")) - { - MessageBox.Show("An error has occurred running the clean function.\nThe database files will be restored from the backup.", - "VE-PROMS",MessageBoxButtons.OK); - RestoreUsageAndProcFilesFromBadVECLEAN(); // retores from the DBO and NDO backup files - } - } - - public override void CleanTransitionsAndROsUsages(int clntype,string ProcName) - { - bool wasOpen = isOpen; - //change directory before doing the Clean function - if(!isOpen)Open(); - StringBuilder buf = new StringBuilder(); - buf.Append("CLEAN -NOPASS"); - - // if clntype is 2, then we are doing the Clean Selected (single) function - if (clntype == 2) - { - buf.Append(" SELECT"); - // if a procedure number was passed in, append to clean command - if (ProcName != null || ProcName != "")buf.Append(" \""+ProcName+"\""); - } - // create a process & wait until it exits. - Process myProcess = new Process(); - myProcess.StartInfo.FileName = this.usrRunTime.ExeAdjust("@Wapprv.exe"); - myProcess.StartInfo.Arguments = buf.ToString(); - myProcess.Start(); - myProcess.WaitForExit(); - - // check for failed clean by looking for DBO and NDO files - CheckForFailedCleanFunction(); - - if(!wasOpen)Close(); - } - - public override void DataIntegrityCheck(string ProcName) - { - bool wasOpen = isOpen; - //change directory before doing the DataCheck function - if(!isOpen)Open(); - StringBuilder buf = new StringBuilder(); - buf.Append("DATACHK -NOPASS"); - buf.Append(" SELECT"); - // if a procedure number was passed in, append to DataCheck command - if (ProcName != null || ProcName != "")buf.Append(" \""+ProcName+"\""); - // create a process & wait until it exits. - Process myProcess = new Process(); - myProcess.StartInfo.FileName = this.usrRunTime.ExeAdjust("@Wapprv.exe"); - myProcess.StartInfo.Arguments = buf.ToString(); - myProcess.Start(); - myProcess.WaitForExit(); - if(!wasOpen)Close(); - } - - - private bool SetupDateTimeStamp() - { - string newdate=null; - string tempinit = DTI.Initials; - if (tempinit == "super") DTI.Initials=" "; - DTI.UpdateDateTimeInit(0); - DTI.Initials=tempinit; - bool goodfmt = false; - while (!goodfmt) - { - frmReadWord rwdlg = new frmReadWord(DTI.MakeDate(DTI.DateTimeInit,false,false),"Enter Revision Date:"); - rwdlg.ShowDialog(); - if (rwdlg.DialogResult == DialogResult.OK) - { - newdate = rwdlg.ReadWordText; - goodfmt= - Char.IsDigit(newdate[0]) && - Char.IsDigit(newdate[1]) && - ((newdate[2]=='/') || (newdate[2]=='-')) && - Char.IsDigit(newdate[3]) && - Char.IsDigit(newdate[4]) && - ((newdate[5]=='/') || (newdate[5]=='-')) && - Char.IsDigit(newdate[6]) && - Char.IsDigit(newdate[7]) && - Char.IsDigit(newdate[8]) && - Char.IsDigit(newdate[9]); - } - else - return false; - } - - // note that from above validity check, the year must be 4 chars... - // reset datetimeinit to have the input date - if (newdate!=null) - { - // use temp variable, can't write to index of DateTimeInit - StringBuilder tmpdt = new StringBuilder(DTI.DateTimeInit); - for (int i=0;i<4;i++) tmpdt[i]=newdate[i+6]; - for (int i=3;i<5;i++) tmpdt[i+3]=newdate[i]; - for (int i=0;i<2;i++) tmpdt[i+4]=newdate[i]; - DTI.DateTimeInit = tmpdt.ToString(); - } - return true; - } - - public void CopyAnyFileToApproved(string name, string ApproveName, string ApprovedPath) - { - if (!File.Exists(name)) return; - - string ApprovedFileName=null; - int lindx = name.LastIndexOf("//"); - if(lindx<0)lindx=0; - string justname = name.Substring(lindx<0?0:lindx,name.Length-lindx); - string apname = (ApproveName==null)?justname:ApproveName; - if (ApprovedPath==null) - ApprovedFileName = GetApprovedDirectory("\\") + apname; - else - ApprovedFileName = ApprovedPath+"\\"+apname; - File.Copy(name,ApprovedFileName,true); - } - - public string GetApprovedDirectory(string ExtraData) - { - int indx; - string curdir = System.Environment.CurrentDirectory; - if ((indx = curdir.LastIndexOf("\\")) >= 0) - { - string tmp = curdir.Substring(indx,curdir.Length-indx); - if (tmp.ToUpper().Equals("TMPCHG"))return (".."+ExtraData); - } - return("APPROVED"+ExtraData); - } - - public void UpdateSetDTI(bool doAll, DataRow dr) // do single - figure out what to pass in - { - if(doAll) - { - // Loop thru the procset and update the date/time/init info - VEO_DummySet ds = (VEO_DummySet) Children[1]; - DataTable tbl = ds.vdbSet.DB_Data.Tables[0]; - bool isfirst = true; - string dtstr = DTI.MakeDate(DTI.DateTimeInit,false,true).Substring(0,8); - string tmstr = DTI.DateTimeInit.Substring(8,5); - foreach (DataRow row in tbl.Rows) - { - if (isfirst) - isfirst = false; - else - { - row["DATE"]=dtstr; - row["TIME"]=tmstr; - row["INITIALS"]=" "; // approve all clears the init field - } - } - ds.vdbSet.DB_Data = tbl.DataSet; - } - else - { - // only set it, it gets written by caller. - dr["DATE"]=DTI.MakeDate(DTI.DateTimeInit,false,true).Substring(0,8); - dr["TIME"]=DTI.DateTimeInit.Substring(8,5); - dr["INITIALS"]=DTI.DateTimeInit.Substring(13,5); - } - } - - private void MakeApprovedProcs(VlnStatusMessage StatMsgWindow) - { - string aprdir = GetApprovedDirectory(""); - if (aprdir.Equals("APPROVED")&&(!Directory.Exists(aprdir))) Directory.CreateDirectory(aprdir); - - CopyAnyFileToApproved("set.dbf",null,null); - if (usrRunTime.SerialNumber.GetSNOption((uint)Utils.SerialNo.SN_Flags.SN_PROCCOMMENT_ON)>0 && File.Exists("setext.dbf")) - { - /*if (ApprovedPath==null || ApprovedPath =="") - apprfilepath=GetApprovedDirectory("\\"),dbname,".DBF",NULL); - else - strcmb(apprfilepath,BuildPath(ApprovedPath,"\\"),dbname,".DBF",NULL); - * - * for(j=0;j0) - { - rtfdir = GetApprovedDirectory("\\RTFFILES"); - if (!Directory.Exists(rtfdir)) Directory.CreateDirectory(rtfdir); - } - - // for all procedures, copy all of the files over.... - VEO_DummySet ds = (VEO_DummySet) this.Children[1]; - if (ds.Children.Count==0) ds.Read(false); - - foreach (object oproc in ds.Children) - { - VEO_Proc proc = (VEO_Proc) oproc; - if (File.Exists(_curDirectory+"\\"+_Location+"\\"+proc._Location+".dbf")) - { - StatMsgWindow.StatusMessage = "Approving " + proc._Prcnum; - proc.Copy(_curDirectory+"\\"+_Location,aprdir,proc._Prcnum,proc._Location); - } - } - - DTI.SetDateTimeInit=DTI.DateTimeInit; - StatMsgWindow.StatusMessage = "Copying support files"; -// we don't use Password.Dat anymore - VESAM handles the password stuff. -// CopyAnyFileToApproved("password.dat",null,null); - if (File.Exists("datapage.fm1")) CopyAnyFileToApproved("datapage.fm1",null,null); - if (File.Exists("curset.dat") && !File.Exists(GetApprovedDirectory("\\curset.dat"))) - CopyAnyFileToApproved("curset.dat",null,null); - CopyAnyFileToApproved("proc.ini",null,null); - CopyAnyFileToApproved("set.ini",null,null); - VEO_DummyLibDoc lds = (VEO_DummyLibDoc) Children[2]; - if (lds.Children.Count>0) - { - StatMsgWindow.StatusMessage = "Copying library documents"; - lds.Approve(_curDirectory+"\\"+_Location,aprdir); - } - // If they are using Automatic Continuous Action Summary Sections - // copy the the ini file over to the approved as well. - if (File.Exists("ContAct.INI")) - CopyAnyFileToApproved("ContAct.INI",null,null); - } - - private void MoveOutsideTransitions(VlnStatusMessage StatMsgWindow) - { - StatMsgWindow.StatusMessage = "Saving Approved Outside Transition Data"; - - // old code did a pack, but these files don't have database support, just copy - // them over. - CopyAnyFileToApproved("xtsetid.dbf",null,null); - CopyAnyFileToApproved("xtsetid.ndx",null,null); - CopyAnyFileToApproved("xtprocid.dbf",null,null); - CopyAnyFileToApproved("xtpidset.ndx",null,null); - CopyAnyFileToApproved("xtpidsnp.ndx",null,null); - } - - private void MoveTransitions(VlnStatusMessage StatMsgWindow) - { - StatMsgWindow.StatusMessage = "Approving transition usage files"; - vdb_TransUsage transusg = new vdb_TransUsage(_curDirectory+"\\"+_Location+"\\tran.dbf"); - transusg.Pack(); - transusg = null; // close the transusage connection - CopyAnyFileToApproved("tran.dbf",null,null); - CopyAnyFileToApproved("tranfrom.ndx",null,null); - CopyAnyFileToApproved("tranto.ndx",null,null); - - // Now cleanup the 'OLDTO' fields, i.e. make them = TranTo field, i.e. - // working draft 'TONUMBER'+'TOSEQUENCE' fields. The first query if for non-libdocs. - // The second does libdocs. - transusg = new vdb_TransUsage(_curDirectory+"\\"+_Location+"\\tran.dbf"); - StringBuilder qry = new StringBuilder(); - qry.Append("UPDATE TRAN SET TRAN.OLDTO = [TONUMBER] & Space(20-Len([TONUMBER])) & [TOSEQUENCE] & Space(12-Len([TOSEQUENCE])) "); - qry.Append("WHERE tran.TOSEQUENCE IS NOT NULL"); - bool success = transusg.UpdateUsing(qry.ToString()); - if (!success) MessageBox.Show("Error When Updating Old Transition To fields","Approve All"); - qry.Length=0; - qry.Append("UPDATE TRAN SET TRAN.OLDTO = [TONUMBER] & Space(20-Len([TONUMBER])) "); - qry.Append("WHERE tran.TOSEQUENCE IS NULL"); - success = transusg.UpdateUsing(qry.ToString()); - if (!success) MessageBox.Show("Error When Updating Old Transition To fields for library documents","Approve All"); - transusg=null; - } - - private void MoveROs(VlnStatusMessage StatMsgWindow) - { - StatMsgWindow.StatusMessage = "Approving referenced object usage files"; - vdb_ROUsage rousg = new vdb_ROUsage(_curDirectory+"\\"+_Location+"\\usagero.dbf"); - rousg.Pack(); - rousg = null; - this.CopyAnyFileToApproved("usagero.dbf",null,null); - this.CopyAnyFileToApproved("usagero.ndx",null,null); - this.CopyAnyFileToApproved("usagroid.ndx",null,null); - this.CopyAnyFileToApproved("ro.fst",null,null); - } - - public void MoveUserFormats(VlnStatusMessage StatMsgWindow) - { - CurSet cs = new CurSet(_curDirectory+"\\"+_Location+"\\curset.dat"); - cs.Read(); - FmtFile ff = new FmtFile(cs.DefaultPlantFmt+".fmt"); - string [] sfis = Directory.GetFiles(".\\",cs.DefaultPlantFmt+".*"); - if (sfis.Length>0)StatMsgWindow.StatusMessage = "Approving user format files"; - foreach (string sfi in sfis) - { - FileInfo fi = new FileInfo(sfi); - fi.CopyTo(this.GetApprovedDirectory("\\"+fi.Name),true); - } - } - - private void UpdateGraphicFiles(VlnStatusMessage StatMsgWindow) - { - StatMsgWindow.StatusMessage = "Approving graphic files from RO directory"; -// ROFST ro = new ROFST(Directory.GetCurrentDirectory() + "\\ro.fst", usrRunTime); - ROFST ro = new ROFST(Directory.GetCurrentDirectory() + "\\ro.fst"); - ro.CopyImagesToApproved(this.GetApprovedDirectory(null),StatMsgWindow); - ro.Close(); - } - - private void CopyTempChgFiles(string from, string to, string fpattern) - { - DirectoryInfo difrom = new DirectoryInfo(from); - DirectoryInfo dito = new DirectoryInfo(to); - if (!dito.Exists) dito.Create(); - FileInfo[] fis = difrom.GetFiles(fpattern); - foreach (FileInfo fi in fis) - { - if (fi.Extension.ToUpper()!="PIX"&&fi.Name.ToUpper()!="B4APRVAL.ZIP") - { - fi.CopyTo(to+"\\"+fi.Name,true); - // if this is title file, then the version text should state - // 'Temporary Change Version' (either append or change the - // 'Current Approved Version'). - if (fi.Name.ToUpper()=="TITLE") - { - StreamReader myReader = new StreamReader(to+"\\"+fi.Name); - string chgtitle = myReader.ReadLine(); - myReader.Close(); - int indx = chgtitle.IndexOf(" - Current Approved Version"); - if (indx>-1) - WriteTextLineToFile(to+"\\"+fi.Name,chgtitle.Substring(0,indx) + " - Temporary Change Version"); - else - WriteTextLineToFile(to+"\\"+fi.Name,chgtitle + " - Temporary Change Version"); - } - FileInfo fi_tmpchg = new FileInfo(to+"\\"+fi.Name); - fi_tmpchg.LastWriteTime = fi.LastWriteTime; - } - } - } - - private void CopyTempChg(VlnStatusMessage StatMsgWindow) - { - if (usrRunTime.SerialNumber.GetSNOption((uint)Utils.SerialNo.SN_Flags.SN_TEMPCHANGE_ON)>0) - { - StatMsgWindow.StatusMessage = "Updating the Temporary change directory ..."; - - CopyTempChgFiles("approved","approved\\tmpchg","*.*"); - if (Directory.Exists("rtffiles")) - CopyTempChgFiles("approved\\rtffiles","approved\\tmpchg\\rtffiles","*.*"); - } - } - private void UpdateProcedureSetTitleFile(string ApprvPath) - { - if (File.Exists("Title")) - { - string appath = null; - if (ApprvPath == null || ApprvPath=="") - appath = GetApprovedDirectory("\\Title"); - else - appath = ApprvPath+"\\Title"; - File.Copy("Title",appath,true); - - // Tack on Current Approved Version to the title in the approved directory - StreamReader myReader = new StreamReader(appath); - string chgtitle = myReader.ReadLine(); - myReader.Close(); - WriteTextLineToFile(appath,chgtitle + " - Current Approved Version"); - } - } - - private void ZipThis(string path, string ZipName) - { - CDZipNET dz = new CDZipNET(); - dz.ZIPFile = path + "\\" + ZipName + ".zip"; - - StringBuilder sb = new StringBuilder(); - - // Zip up the RTFFILES directory if it exists - string RTFFilesPath = path + "\\RTFFILES"; - if (Directory.Exists(RTFFilesPath)) - { - sb.Append(path); - sb.Append("\\*.* "); - sb.Append(path); - sb.Append("\\RTFFILES\\*.*"); - } - else - { - sb.Append(path); - sb.Append("\\*.*"); - } - - dz.RecurseFlag = false; - dz.ItemList = sb.ToString(); - dz.CompressionFactor = 9; // maxium compression - dz.ExcludeFollowingFlag = true; - dz.ExcludeFollowing = "*.lck process.dat"; - dz.ActionDZ = CDZipNET.DZACTION.ZIP_ADD; - } - - // this can be used to archiving of clean or approval. Approval zips approval - // and tmpchg directories if they exist. - private void Archive(string ZipName, bool approving) - { - // get the path to the working draft directory - string cwd = Directory.GetCurrentDirectory(); - - VlnStatusMessage StatMsgWindow = new VlnStatusMessage("File Archival"); - - // zip the working draft directory - StatMsgWindow.StatusMessage = "Zipping " + cwd; - ZipThis(cwd, ZipName); - - if (approving && Directory.Exists("Approved")) - { - string CurApPath = cwd + "\\APPROVED"; - // Zip the Approved directory - StatMsgWindow.StatusMessage = "Zipping " + CurApPath; - ZipThis(CurApPath, ZipName); - - // Zip the Temporary Change directory - if (Directory.Exists("Approved\\TMPCHG")) - { - string TchgPath = CurApPath+"\\TMPCHG"; - StatMsgWindow.StatusMessage = "Zipping " + TchgPath; - ZipThis(TchgPath, ZipName); - } - } - StatMsgWindow.Dispose(); - } - - private bool NewOrModifiedGraphicFile(string Afname,string Wfname, string defExt) - { - bool rtnval = false; - StringBuilder Agr_pathname = new StringBuilder(Afname.Length+5); - StringBuilder Wgr_pathname = new StringBuilder(Wfname.Length+5); - Agr_pathname.Append(Afname); - Wgr_pathname.Append(Wfname); - // if the file has an extension, just use it, otherwise use - // the passed in default extension. Note that the default - // extension is automatically set up when the RO.FST file - // is read into the ROFST class - if ((Afname.Length<4) || Afname[Afname.Length-4] != '.') - { - if (defExt[0] != '.') Agr_pathname.Append("."); - Agr_pathname.Append(defExt); - } - if ((Wfname.Length<4) || Wfname[Wfname.Length-4] != '.') - { - if (defExt[0] != '.') Wgr_pathname.Append("."); - Wgr_pathname.Append(defExt); - } - string AgrName = Agr_pathname.ToString(); - string WgrName = Wgr_pathname.ToString(); - rtnval = (!File.Exists(AgrName)); - if (!rtnval) - { - // The graphic file exists in Approved directory. - // See if the RO directory has a newer graphics file. - rtnval = (File.GetLastWriteTime(WgrName) > File.GetLastWriteTime(AgrName)); - } - return rtnval; - } - -// private bool GraphicsFileNotInApproved(string fname, string defExt) -// { -// StringBuilder gr_pathname = new StringBuilder(fname.Length + 5); -// gr_pathname.Append(fname); -//// // if the file has an extension, just use it, otherwise get default -//// // extension. This is in veproms.ini or default to .tif. -//// int indx = fname.LastIndexOf("."); -//// if (indx<0) -// -// // if the file has an extension, just use it, otherwise use -// // the passed in default extension. Note that the default -// // extension is automatically set up when the RO.FST file -// // is read into the ROFST class -// if ((fname.Length<4) || fname[fname.Length-4] != '.') -// { -//// PrivateProfile pINI; -//// string fExt; -//// pINI = new PrivateProfile(usrRunTime.ExeAdjust("~veproms.ini")); -//// fExt=pINI.Attr("Graphics","defaultext"); -//// if (fExt == null||fExt=="") fExt=".TIF"; -//// pINI=null; -//// if (fExt.Substring(0,1)!=".") gr_pathname.Append("."); -//// gr_pathname.Append(fExt); -// if (defExt[0] != '.') gr_pathname.Append("."); -// gr_pathname.Append(defExt); -// } -// return (!File.Exists(gr_pathname.ToString())); -// } -// - // Verify we have a valid RO directory path - private bool CheckROPathForApprove() - { - bool rtnval = true; - StringBuilder sbWarning = new StringBuilder(); - - // If Referenced Objects are being used, - // then see if the RO directory exists B2005-038 - - vdb_ROUsage rousg=null; - DataSet ROUsageDataSet=null; - // Open the RO Usage file in the working draft and see if there - // are any records in it. - try - { - rousg = new vdb_ROUsage(_curDirectory+"\\"+_Location+"\\usagero.dbf"); - ROUsageDataSet = rousg.GetSortedByROID(""); - } - catch (Exception e) - { - MessageBox.Show("Could not read RO Usages, cannot approve. " + e.Message,"Approval Error"); - rousg=null; - ROUsageDataSet=null; - return false; // don't allow approval - } - DataTable roTbl = ROUsageDataSet.Tables[0]; - rtnval = (roTbl.Rows.Count > 0); - rousg=null; - ROUsageDataSet=null; - - if (!rtnval) - return true; // ROs are not used, no need to check for RO directory - - // At this point we know that we use RO's so now check to see if - // the RO directory exists - - return CheckROpathAndFST(); - } - - // This function is called after we verify that Referenced Objects are being - // used in the working draft (there are records in the ROUSAGE.DBF file) - private bool CheckROpathAndFST() - { - bool rtnval = true; - bool wdROfstExists; - bool doWarning; - StringBuilder sbMsg = new StringBuilder(); - string rpath = this.getROPath(false); - if (rpath == null || rpath == "") - { - // Cannot find an RO Directory - sbMsg.Append("Cannot find the Referenced Objects folder: "); - sbMsg.Append(rpath); - sbMsg.Append("\n\nReferenced Object usages cannot be validated without access to the RO database folder."); - sbMsg.Append("\n\n * Verify the RO Path in the PROC.INI file."); - sbMsg.Append("\n\n * Verify the RO folder does exist."); - MessageBox.Show(sbMsg.ToString(),"Check Referenced Objects Settings"); - return false; // cancel approval - } - - // Check to see if RO.FST file exists in working draft - wdROfstExists = File.Exists(_curDirectory+"\\"+_Location+"\\ro.fst"); - - // Check to see if the RO.FST file in the working draft is older or newer - // than the one in the RO directory - if (wdROfstExists) - { - DateTime WdDateTime = File.GetLastWriteTime(_curDirectory+"\\"+_Location+"\\ro.fst"); - DateTime RoDateTime = File.GetLastWriteTime(rpath + "\\ro.fst"); - switch (DateTime.Compare(WdDateTime,RoDateTime)) - { - case 1: - doWarning = true; - sbMsg.Append("The Working Draft RO.FST file is Newer than the one last generated"); - sbMsg.Append("\nfrom the RO database."); - break; - case -1: - doWarning = true; - sbMsg.Append("The Working Draft RO.FST file is Older than the one last generated"); - sbMsg.Append("\nfrom the RO database."); - break; - default: - doWarning = false; - break; - } - if (doWarning) - { - sbMsg.Append("\n\nPlease verify that \""); - sbMsg.Append(rpath); - sbMsg.Append("\" is the correct RO database folder and"); - sbMsg.Append("\ncheck to see if the RO.FST needs updated in the Working Draft."); - sbMsg.Append("\n\n\n\nDo You Want To Continue With The Approval Anyway?"); - DialogResult yn = MessageBox.Show(sbMsg.ToString(),"Check Referenced Objects Settings",MessageBoxButtons.YesNo); - rtnval = yn.Equals(DialogResult.Yes); - return rtnval; - } - } - if (!wdROfstExists) - { - //if the working draft does not have a RO.FST file, don't allow approve - sbMsg.Append("The working draft does not have an RO.FST file."); - sbMsg.Append("\n\nReferenced Object usages cannot be validated."); - sbMsg.Append("\n\n * Verify the RO Path in the PROC.INI file."); - sbMsg.Append("\n\n * Run the Update Referenced Objects tool"); - MessageBox.Show(sbMsg.ToString(),"Check Referenced Objects Settings"); - return false; // cancel approval - } - - return true; // fell through the checks, assume it's O.K. to continue - } - - // FindModifiedROs determines which ROs, if any, are different between the working - // draft & the approved version of the ro.fst files. It only looks at those ROs - // that are used in the working draft version of the document, i.e. it compares - // the ro.fst data for those ROs listed in the usage file. - private bool FindModifiedROs(ArrayList ModROs, VlnStatusMessage StatMsgWindow) - { - vdb_ROUsage rousg=null; - DataSet ROUsageDataSet=null; - //Loop through all of the usages. - try - { - rousg = new vdb_ROUsage(_curDirectory+"\\"+_Location+"\\usagero.dbf"); - ROUsageDataSet = rousg.GetSortedByROID(""); - } - catch (Exception e) - { - MessageBox.Show("Could not read RO Usages, cannot approve. " + e.Message,"Approval Error"); - rousg=null; - ROUsageDataSet=null; - return false; - } - DataTable roTbl = ROUsageDataSet.Tables[0]; - if (roTbl.Rows.Count == 0) - return true; // no data -// if (roTbl.Rows.Count>0) StatMsgWindow.StatusMessage = "Finding Modified Referenced Objects"; - - // See if the RO.FST file exists in the working draft. At this point - // we have established that ROs are being used and there should be a - // RO.FST file in the working draft. Also see if the RO folder exists. - // It's needed to check changes to graphic files. - // B2005-038 - if (!CheckROpathAndFST()) return false; - - // Open the RO.FST files so that we can compare ro values - - ROFST WD_ROfst = new ROFST(_curDirectory+"\\"+_Location+"\\ro.fst"); - ROFST App_ROfst = new ROFST(_curDirectory+"\\"+_Location+"\\approved\\ro.fst"); - - string lastROID = null; - VlnStatusBar FndModROsStatWindow = new VlnStatusBar("Processing ROs"); - FndModROsStatWindow.BarMax = roTbl.Rows.Count; - FndModROsStatWindow.BarStepValue = 1; - FndModROsStatWindow.BarValue = 0; - FndModROsStatWindow.StatMsg = "Finding Modified Referenced Objects"; - foreach (DataRow row in roTbl.Rows) - { - FndModROsStatWindow.PerformStep(); - string thisROID = row["ROID"].ToString(); - // we want to always have "0000" at the end of the ROID - // so that we get all possible return options for - // conditional RO's - thisROID = thisROID.Substring(0,12)+"0000"; - // byte ff = 0xff; - // string instance = row["INSTANCE"].ToString(); - // if(System.Char.IsWhiteSpace(instance[0])) - if(thisROID==null || thisROID=="" || System.Char.IsWhiteSpace(thisROID[0])) - { - continue; - } - if (thisROID != lastROID) - { - lastROID = thisROID; - string usagePnum = row["NUMBER"].ToString(); - string wd_val = WD_ROfst.GetRO(thisROID,usagePnum); - string a_val = App_ROfst.GetRO(thisROID,usagePnum); - ROFST.ROTypes rotype = WD_ROfst.GetROType(thisROID); - if (rotype == ROFST.ROTypes.Figure) // image - { - int nline = wd_val.IndexOf("\n"); - if (nline>0) - { - string gr_fname = this._curDirectory + "\\" + this._Location + "\\" + GetApprovedDirectory("\\") + wd_val.Substring(0,nline); - string wd_fname = this.getROPath() + "\\" + wd_val.Substring(0,nline); - if (wd_val!=a_val || NewOrModifiedGraphicFile(gr_fname,wd_fname,WD_ROfst.DefaultGraphicFileExt)) - // if (wd_val!=a_val || GraphicsFileNotInApproved(gr_fname,WD_ROfst.DefaultGraphicFileExt)) - { - ModRO mro = new ModRO(thisROID,true,gr_fname,null); - ModROs.Add(mro); - } - } - } - else - { - if (wd_val != a_val) - { - ModRO mro = null; - if (rotype == ROFST.ROTypes.Table) - mro = new ModRO(thisROID, false, "TABLE", "TABLE"); - else - mro = new ModRO(thisROID, false, wd_val, a_val); - ModROs.Add(mro); - } - } - - } - } - FndModROsStatWindow.Dispose(); - rousg=null; - ROUsageDataSet=null; - WD_ROfst.Close(); - App_ROfst.Close(); - return true; - } - - // determine if the input library document has any Modified Ro references - private bool RoRef(string libname, ArrayList ModROs, ArrayList al) - { - int roref=0; - int i = libname.IndexOf("."); - string fname; - if (i>0) - fname = libname.Substring(0,i); - else - fname = libname; - - if ((roref=Usages.CheckRoReferences(this, _curDirectory+"\\"+_Location, al, ModROs, fname))<=0) - { - return false; - } - return true; - } - - // Determine, based on date/time stamp, whether the Library Document - // file was modified between the working draft & approved. - private void LookForModifiedLibraryDoc(ArrayList ModLibDocs, ArrayList ModROs, ArrayList al, string libname) - { - // Use status codes for later file copying of library documents. - // Stat 0 - No Change - // Stat 1 - Copy working draft file to approved - // Stat 2 - Copy RTFFILES file to approved - // Stat 3 - Copy working draft file to approved and RTF - int stat=0; - DateTime wd=DateTime.Now; // default to now, but reset if file exists. - DateTime wd_rtfdir=DateTime.Now; - DateTime ap=DateTime.Now; - DateTime ap_rtfdir=DateTime.Now; - - if (File.Exists(libname))wd = File.GetLastWriteTime(libname); - if (File.Exists("RTFFILES\\"+libname))wd_rtfdir = File.GetLastWriteTime("RTFFILES\\"+libname); - - string apdir = GetApprovedDirectory(""); - if (File.Exists(apdir+"\\"+libname))ap = File.GetLastWriteTime(apdir+"\\"+libname); - if (File.Exists(apdir+"\\RTFFILES\\"+libname))ap_rtfdir = File.GetLastWriteTime(apdir+"\\RTFFILES\\"+libname); - - // now see if there are any referenced objects in this library document - // that have a modified RO - if so, copy those too. - bool roStat = RoRef(libname, ModROs, al); - - // if approved directory has RTFFILES subdirectory with this libdoc... - if (File.Exists(apdir+"\\RTFFILES\\"+libname)) - { - // if working draft has RTFFiles subdirectory with this libdoc - if (File.Exists("RTFFILES\\"+libname)) - { - // if working draft is newer or contains a modified RO - if (roStat || (wd_rtfdir>ap_rtfdir)) - stat=2; - } - else // if working draft does NOT have libdoc file - stat = 3; - } - // the approved directory does not have RTFFILES directory, but has the - // library document in the APPROVED directory. - else if (File.Exists(apdir+"\\"+libname)) - { - // if the working draft has the library document in the RTFFILES directory - if (File.Exists("RTFFILES\\"+libname)) - { - // if working draft library document is newer or contains modified ro - if (roStat || (wd_rtfdir > ap)) - stat=2; - // if the working draft version is newer or contains a modified RO - } - else - { - if (roStat || (File.Exists(libname) && wd>ap)) stat = 1; - } - } - // else there is no library document in approved at all, add it. - else - { - if (File.Exists("RTFFILES\\"+libname)) - stat=2; - else - stat=1; - } - if (stat!=0) - { - // see if filename is in the list. If not add it, otherwise it's a duplicate. - for (int i=0;i 0) - { - App_ROfst.processAppUpdFile(AppUpdtmp,WD_ROfst.numDatabases>App_ROfst.numDatabases?WD_ROfst.numDatabases:App_ROfst.numDatabases); - App_ROfst.CreateMergedFSTFile(NewFST); - if (File.Exists(NewFST)) - { - string ROFST = this.GetApprovedDirectory("\\RO.FST"); - string ROFSTbck = this.GetApprovedDirectory("\\RO.BAK"); - File.Copy(ROFST,ROFSTbck,true); - File.Copy(NewFST,ROFST,true); - File.Delete(NewFST); - } - } - if (File.Exists(AppUpdtmp))File.Delete(AppUpdtmp); - WD_ROfst.Close(); - App_ROfst.Close(); - } - - private bool SetupProcessInd(ArrayList ModROs, ArrayList ModLibDocs, ArrayList al, VlnStatusMessage StatMsgWindow) - { - bool success; - success = FindModifiedROs(ModROs, StatMsgWindow); - if (!success)return false; - success = FindModifiedLibDocs(ModLibDocs, ModROs, al, StatMsgWindow); - if (!success) return false; - return true; - } - - public bool ProcessInd(ArrayList al, int indx, ArrayList ModROs, ArrayList ModLibDocs) - { - bool success=true; - // process the procedure in the list at 'indx'. First mark it as checked. Then - // see if it has any RO References that have changed & if so, add any other - // procedures to the list that use the changed ROs. Then do the same for - // library documents & transitions (to/from). - AppIndItem appitm = (AppIndItem) al[indx]; - - if ( ModROs.Count>0) - { - int roref = Usages.CheckRoReferences(this, _curDirectory+"\\"+_Location, al, ModROs,appitm.Proc._Prcnum); - success=roref>-1; - } - if (!success) return false; - - if (ModLibDocs.Count>0)success = appitm.Proc.CheckLibraryDocReferences(al, indx, ModLibDocs, ModROs); - if (!success)return false; - success=appitm.Proc.CheckTransitionReferences(al); - return success; - } - - private bool ApproveInd(ArrayList Procs) - { - string tempinit = DTI.Initials; - if (tempinit == "super") DTI.Initials=" "; - DTI.UpdateDateTimeInit(0); - DTI.Initials=tempinit; - - // Don't allow approval unless we have a valid path to the RO directory -/** - BUG FIX B2005-038 - if (!CheckROPathForApprove()) - done in FindModifiedROs() new - return false; -**/ - VlnStatusMessage StatMsgWindow = new VlnStatusMessage("Approving Selected Procedures"); - StatMsgWindow.StatusMessage = "Preparing for Approval"; - - // if children are not loaded, load them here... - VEO_DummySet ds = (VEO_DummySet) this.Children[1]; - if (ds.Children.Count==0) ds.Read(false); - - // find dependencies for those initially selected. - ArrayList ModROs = new ArrayList(); - ArrayList ModLibDocs = new ArrayList(); - ArrayList AppProcess = new ArrayList(); - if (!SetupProcessInd(ModROs,ModLibDocs,AppProcess,StatMsgWindow)) - { - StatMsgWindow.Dispose(); - return false; - } - - // The selected procedures in the passed in list should be put in the - // processing list of AppIndItems. Then for each item in this list, - // check to see if conflicts require other procedures to be approved. - // If a conflict is found, it is added the list of conflicts for the item - // and the procedure found with the conflict is added to the AppIndItems - // list, so that it getes checked too. After all items in the AppIndItems - // list are processed, bring up the dialog with the list of procedures that - // must be approved. Allow the user to add other procedures, to resolve/edit - // conflicts, etc. - - StatMsgWindow.StatusMessage = "Looking for Dependencies..."; - foreach (Object obj in Procs) - { - AppIndItem aii= new AppIndItem((VEO_Proc)obj); - AppProcess.Add(aii); - } - - // while there are items in the list to check, keep looking - // for conflicts. Assume that there is at least one item in the - // list that hasn't been checked or it wouldn't have gotten to here. - int indx=0; - if (AppProcess.Count<1) indx=-1; - while (indx>=0) - { - AppIndItem CurItem = (AppIndItem) AppProcess[indx]; - StatMsgWindow.StatusMessage = "Checking " + CurItem.Proc._Prcnum; - ProcessInd(AppProcess, indx, ModROs, ModLibDocs); - CurItem.Checked=true; - indx = -1; - for (int i=0;i0) - { - string rtfdir = ApprovedPath + "\\RTFFILES"; - if (!Directory.Exists(rtfdir)) Directory.CreateDirectory(rtfdir); - } - fis=null; - } - string appath=null; - if (ApprovedPath==null||ApprovedPath=="") - appath = GetApprovedDirectory(""); - else - appath = ApprovedPath + ""; - - // If the PROC.INI file in the working draft is newer or older than the - // approved, ask the user if this file should be copied to the approved. - INIfileApproveCheck("PROC.INI",appath,"Proc.ini"); - - // If the Continuous Action Summary ini (CONTACT.INI) file in the working - // draft is newer or older than the approved, ask the user if this file - // should be copied to the approved. - INIfileApproveCheck("CONTACT.INI",appath,"Continuous Action Summary ini"); - - // See if this set has long procedure titles. This was a format flag, but - // format flags are temporarily being stored in the proc.ini file. This is - // used in the UpdateSetFile method, but just read it once & reuse. - using (StreamWriter sw = new StreamWriter("Approval.log", true)) - { - sw.Write("APPROVE SELECTED: Approving selected procedures on "); - sw.Write(DateTime.Now); - sw.WriteLine(" performed by " + DTI.Initials); - sw.WriteLine(" "); - foreach (AppIndItem ai in AppProcess) - { - StatMsgWindow.StatusMessage = "Approving Procedure to " + appath + "\\" +ai.Proc._Prcnum; - // For the procedure number, see if it exists in the approved set. If - // not, there is either a new procedure or a modified procedure number. - // Both cases require a new procedure database fileset to be created. - string ApProcFile = null; - string ApProcNum = null; - ai.Proc.GetApProcNumAndFile(appath, ref ApProcFile, ref ApProcNum); - sw.WriteLine(" Approved " + ApProcNum); - ai.Proc.Copy(Directory.GetCurrentDirectory(), appath, ApProcNum, ApProcFile); - ai.Proc.UpdateSetFile(appath, ApProcNum, ApProcFile); - StatMsgWindow.StatusMessage = "Fixing Transition References for "+ai.Proc._Prcnum; - ai.Proc.FixTransitionReferences(appath, ApProcNum); - StatMsgWindow.StatusMessage = "Fixing RO Usages for "+ai.Proc._Prcnum; - Usages.FixROUsages(Directory.GetCurrentDirectory(), appath, ApProcNum, ai.Proc._Prcnum); - } - sw.WriteLine(" "); - } - UpdateProcedureSetTitleFile(ApprovedPath); - } - - private void CopyLibDocToApproved(string fname, string ApprovedPath, int stat) - { - string buff=fname; - if (stat==2) - { - // Create approved rtf directory. - if (!Directory.Exists(ApprovedPath+"\\RTFFILES"))Directory.CreateDirectory(ApprovedPath+"\\RTFFILES"); - // create rtf files name - buff = "RTFFILES\\" + fname; - } - else if (stat==3) - { - // approved rtf version. - if (Exists(ApprovedPath+"\\RTFFILES\\"+fname))File.Delete(ApprovedPath+"\\RTFFILES\\"+fname); - buff=fname; - } - CopyAnyFileToApproved(buff, null, ApprovedPath); - } - - private void MoveChangedDocuments(string ApprovedPath, ArrayList ModLibDocs, VlnStatusMessage StatMsgWindow) - { - int cnt = ModLibDocs.Count; - for (int i = ModLibDocs.Count;i>0;i--) - { - ModLibDoc ld = (ModLibDoc) ModLibDocs[i-1]; - if (ld.DocPages!=0) - { - StatMsgWindow.StatusMessage = "Moving Library Document "+ld.LibFile; - CopyLibDocToApproved(ld.LibFile,ApprovedPath,ld.status); - string lbname = ld.LibFile.Substring(0,8); // don't need extension, i.e. .LIB - Usages.FixROUsages(Directory.GetCurrentDirectory(), ApprovedPath, lbname, lbname); - } - } - } - - public void DoTheApproval(ArrayList AppProcess, ArrayList ModROs, ArrayList ModLibDocs) - { - bool hasTempChange = (Directory.Exists("APPROVED\\TMPCHG") && - (usrRunTime.SerialNumber.GetSNOption((uint)Utils.SerialNo.SN_Flags.SN_TEMPCHANGE_ON)>0) - && (GetApprovedDirectory("")=="APPROVED")); - string ApprovedPath = GetApprovedDirectory(""); - VlnStatusMessage StatMsgWindow = new VlnStatusMessage("Do The Approval"); - MoveApprovedProcedures(AppProcess, ApprovedPath, StatMsgWindow); - if (hasTempChange) MoveApprovedProcedures(AppProcess, "APPROVED\\TMPCHG", StatMsgWindow); - - SaveModifiedROs(ApprovedPath, ModROs, StatMsgWindow); - if (hasTempChange) SaveModifiedROs("APPROVED\\TMPCHG", ModROs, StatMsgWindow); - - MoveChangedDocuments(ApprovedPath, ModLibDocs, StatMsgWindow); - if (hasTempChange) MoveChangedDocuments("APPROVED\\TMPCHG", ModLibDocs, StatMsgWindow); - - // If the temporary change directory does not exist and not in the - // temporary change directory, create the temporary change directory - // and copy the files to it from the approved directory - if (ApprovedPath == "APPROVED" && hasTempChange && !Directory.Exists("APPROVED\\TMPCHG")) CopyTempChg(StatMsgWindow); - StatMsgWindow.Dispose(); - MessageBox.Show("Procedure(s) has been approved.","Approval Complete"); - } - - private void ApproveAll() - { - bool approveflag = false; - - string tempinit = DTI.Initials; - if (tempinit == "super") DTI.Initials=" "; - DTI.UpdateDateTimeInit(0); - DTI.Initials=tempinit; - - // Don't allow approval unless we have a valid path to the RO directory - if (!CheckROPathForApprove()) - return; - - DialogResult rslt = MessageBox.Show("About to Approve All of the Procedures in This Set. Continue With The Approval?","Approve All Procedures",MessageBoxButtons.YesNo); - if (rslt == DialogResult.No) return; - - rslt = MessageBox.Show("Do you want to save the current data to an archive file before proceeding with the Approval?","Archive Data",MessageBoxButtons.YesNo); - if (rslt == DialogResult.Yes) - { - string tmp = "B4APRVAL" + DateTime.Now.ToString("s").Replace(":","-"); - Archive(tmp,true); - } - - if (RmChgBarOnApp) - { - rslt = MessageBox.Show("Remove Change Bars from Working Draft?","Approve All Procedures",MessageBoxButtons.YesNo); - if (rslt==DialogResult.No) RmChgBarOnApp=tmpRmChgBarOnApp=false; - } - else - { - rslt = MessageBox.Show("Keep Change Bars in Working Draft?","Approve All Procedures",MessageBoxButtons.YesNo); - if (rslt==DialogResult.No) RmChgBarOnApp=tmpRmChgBarOnApp=true; - } - - if (!RmChgBarOnApp || SetupDateTimeStamp()) - { - long spfree = DirSpace.Free(); - if( File.Exists(GetApprovedDirectory("\\set.dbf")) && (spfree > 200000L) ) - approveflag = true; - - long tmp = DirSpace.Get(Environment.CurrentDirectory); - if( !approveflag && !(spfree > DirSpace.Get(Environment.CurrentDirectory)) ) - { - MessageBox.Show("Insufficient Disk Space for Approval!","General Approval Error"); - return; - } - - VlnStatusMessage StatMsgWindow = new VlnStatusMessage("Approving All Procedures"); - StatMsgWindow.StatusMessage = "Preparing for Approval"; - - using (StreamWriter sw = new StreamWriter("Approval.log", true)) - { - sw.Write("APPROVE ALL: on "); - sw.Write(DateTime.Now); - sw.WriteLine(" performed by " + DTI.Initials); - sw.WriteLine(" "); - } - - MakeApprovedProcs(StatMsgWindow); - if(File.Exists("xtsetid.dbf"))MoveOutsideTransitions(StatMsgWindow); - MoveTransitions(StatMsgWindow); - MoveROs(StatMsgWindow); - UpdateGraphicFiles(StatMsgWindow); - MoveUserFormats(StatMsgWindow); - UpdateProcedureSetTitleFile(null); - CopyTempChg(StatMsgWindow); - StatMsgWindow.Dispose(); - MessageBox.Show("Procedure Set has been approved.","Approval Complete"); - } - } - - public override void ApproveProcedures(int ApproveType, ArrayList procs) - { - // before doing anything - verify that no one is 'connected' to the - // approved directory. do this by getting approved directory & - // using its object, see if there is an open connection. Make a lock - // in the approved set. If this cannot be done - then can't approve. - bool needtoUnlock = false; - bool needtoDisConnect = false; - VEO_ProcSet lckapp=null; - if (isSetApproved && usrRunTime.InMultiUserMode) - { - bool proceed = true; - VEO_ProcSet ps = null; - VEO_Plant pl = (VEO_Plant) this.parentObj; - for (int i=0; i< pl.Children.Count; i++) - { - VEO_ProcSet aps = (VEO_ProcSet) pl.Children[i]; - string dir = aps._curDirectory.ToUpper()+"\\"+aps._Location.ToUpper(); - if (dir==_curDirectory.ToUpper()+"\\"+_Location.ToUpper()+"\\APPROVED") - { - ps = aps; - break; - } - } - if (ps!=null) - { - // if there are active users in the approved directory approval - // cannot continue, put up message and return. Otherwise lock - // the approved directory. - if (ps.Connection == null) - { - needtoDisConnect=true; - ps.LoadLockInfo(); - ps.Connection = new VEConnection(ps.Lock, ps.usrRunTime); - if (ps.Lock.LockStatus==VENetwork.Status.LockedByOther)proceed=false; - } - if (proceed)ps.Connection.Enter(false); - if (proceed && ps.Connection.HasActiveUsers())proceed=false; - if (proceed && !ps.amILockedByMe()) - { - bool success = ps.Lock.CreateLock(ps.Connection, false); - if (!success) - proceed=false; - else - { - needtoUnlock=true; - lckapp = ps; - } - } - } - if (ps==null||!proceed) - { - MessageBox.Show("Could not connect/lock the associated approval directory.\n Either another user is viewing the data or has a lock on the data.","VE-PROMS"); - if (ps != null) ps.Connection.MonitorUsers((int)ps.Lock.LockType-1); - ps.Connection.Exit(); - if (needtoDisConnect)ps.Connection=null; - return; - } - } - bool wasOpen = isOpen; - // change directory before doing functions - if (!isOpen)Open(); - switch (ApproveType) - { - case 0: // approve the entire set - ApproveAll(); - break; - case 1: - ApproveInd(procs); - break; - } - if(!wasOpen)Close(); - if (needtoUnlock)lckapp.Lock.UnLock(false); -// if (needtoDisConnect) -// Bug Fix: B2006-033 -// Had a lock at VEplant level, thus lckapp was never set - if (needtoDisConnect && lckapp != null) - { - lckapp.Connection.Exit(); - lckapp.Connection=null; - } - } - - public override bool Delete() - { - try - { - bool tst=false; - if ((tst=Open())!=true) return false; - // if this is an enhanced document, remove the bck.lnk or dvt.lnk - // and erg.lnk for dev, files in the parentLink directory. - if (_ProcType == VEObject.ProcTypeOptions.Background || - _ProcType == VEObject.ProcTypeOptions.Deviation) - { - if (parentLink==null) // load in the link. - GetParentLink(); - string lnk = parentLink; - if (lnk != null || lnk != "") - { - string dellnk; - if(this._ProcType != VEObject.ProcTypeOptions.Background) - dellnk = lnk+"\\DVT.LNK"; - else - dellnk = lnk+"\\BCK.LNK"; - File.Delete(dellnk); - } - string tmppath = CurDirectory+"\\"+_Location+"\\eop.lnk"; - if (File.Exists(tmppath)) File.Delete(tmppath); - if (_ProcType == VEObject.ProcTypeOptions.Deviation) - { - if (guideLink==null) GetGuideLink(); - tmppath = this.CurDirectory+"\\"+_Location+"\\ERG.LNK"; - File.Delete(tmppath); - - } - } - - // Now delete the document directory. Close first, which closes - // any open multi-user connections. - Close(); - this.Children.Clear(); - string cwd = Directory.GetCurrentDirectory(); - Directory.Delete(CurDirectory+"\\"+_Location,true); - } - catch (Exception e) - { -// string cwd = Directory.GetCurrentDirectory(); - MessageBox.Show(e.Message,"Error Deleting"); - DirectoryInfo di = new DirectoryInfo(CurDirectory+"\\"+_Location); - di.Delete(true); - return false; - } - if (Directory.Exists(CurDirectory+"\\"+_Location)) return false; - VEO_Plant plnt = (VEO_Plant) parentObj; - if (plnt.Children.Count <=1) - { - plnt.icon = plnt.iconStates[(int)VEO_IconStates.Empty]; - plnt.IsEmpty=true; - } - return true; - } - - public override bool Read(bool ChkForChldOnly) - { - if (Lock.LockStatus == VENetwork.Status.LockedByOther) return false; - string path = _curDirectory + "\\" + _Location; - // for each procset, get its contents, i.e. zip files, whether there's - // a set.dbf (shows that there ar]e procedure files), - StringBuilder fname = new StringBuilder(); - fname.Append(path); - fname.Append("\\SOURCE.ZIP"); - FileInfo source = new FileInfo(fname.ToString()); - if (source.Exists) isArchived=true; - VEO_DummyZip zp = new VEO_DummyZip(usrRunTime,"Zip Files", _curDirectory+"\\"+_Location); - zp.parentObj=this; - Children.Add(zp); - // if !isArchived, check for any other zip files, or make the icon empty - DirectoryInfo di = new DirectoryInfo(path); - FileInfo [] fi = di.GetFiles("*.ZIP"); - if (fi.Length<=0) - { - zp.IsEmpty = true; - zp.icon=zp.iconStates[(int)VEO_IconStates.Empty]; - } - di = null; - fi = null; - - // now check for procedures in the set - fname.Remove(fname.Length-11,11); - fname.Append("\\SET.DBF"); - source = new FileInfo(fname.ToString()); - if (source.Exists) - { - IsEmpty=false; - setExists = true; - if (this.hasExtraRevNumber) - { - vdb_Set vdbSet=new vdb_Set(_curDirectory+"\\"+_Location+"\\set.dbf"); - DataRow rw = vdbSet.DB_Data.Tables[0].Rows[0]; - ExtraRevNumber = rw["TITLE"].ToString(); - origExtraRevNumber=ExtraRevNumber; - vdbSet=null; - } - } - else - IsEmpty=true; - VEO_DummySet prc = new VEO_DummySet(usrRunTime,"Procedures",_curDirectory+"\\"+_Location); - if (IsEmpty) prc.icon = prc.iconStates[(int)VEO_IconStates.Empty]; - prc.parentObj=this; - // Update Enhanced and Slave Set files - if (!ChkForChldOnly) prc.SyncSetFile(); - - // Update the Slave's Continue Actions Summary ini (ContAct.INI) file - if (!ChkForChldOnly) prc.UpdateContActINI(); - - Children.Add(prc); - - // check both rtffiles & procs directory for library documents - di = new DirectoryInfo(path+"\\RTFFILES"); - if (di.Exists) - { - FileInfo[] fiArr = di.GetFiles("DOC_*.LIB"); - if (fiArr.Length>0) hasLibDocs = true; - - } - if (!hasLibDocs) - { - di = new DirectoryInfo(path); - FileInfo[] fiArr = di.GetFiles("DOC_*.LIB"); - if (fiArr.Length>0) hasLibDocs = true; - } - - VEO_DummyLibDoc ld = new VEO_DummyLibDoc(usrRunTime,"Library Documents",_curDirectory+"\\"+_Location); - ld.parentObj=this; - if (!hasLibDocs) - { - ld.icon = ld.iconStates[(int)VEO_IconStates.Empty]; - ld.IsEmpty=true; - } - Children.Add(ld); - - return true; - } - - public override bool CollapseSibling() - { - if (!usrRunTime.InMultiUserMode) return false; - return true; - } - - public override bool mnuAllowLckDB() - { - if (!usrRunTime.InMultiUserMode) return false; - //if (amILockedByMe()) return false; // if I'm already locked, don't allow it - if ((accessFlags&Security.LOCKPROC)==Security.LOCKPROC && Lock.LockStatus==VENetwork.Status.NoLock) return true; - return false; - } - - public override bool mnuAllowUnlckDB() - { - if (!usrRunTime.InMultiUserMode) return false; - if ((accessFlags&Security.LOCKPROC)==Security.LOCKPROC&&(Lock.LockStatus==VENetwork.Status.Locked|| - Lock.LockStatus==VENetwork.Status.LockPending)) return true; - return false; - } - - public override bool mnuAllowUpdRO() - { - if (isApproved||IsEmpty||isTempChange) return false; - if (amILockedByMe()==false) return false; - return true; - } - - public override bool mnuAllowClean() - { - if (isApproved||IsEmpty) return false; - if (Lock.LockStatus!=VENetwork.Status.Locked)return false; - if (amILockedByMe()==false) return false; - if ((accessFlags&Security.CLEAN)==Security.CLEAN) return true; - return false; - } - - public override bool mnuAllowDataCheck() - { - if (isApproved||IsEmpty) return false; - if (Lock.LockStatus!=VENetwork.Status.Locked)return false; - if (amILockedByMe()==false) return false; - if ((accessFlags&Security.CLEAN)==Security.CLEAN) return true; - return false; - } - - public override bool mnuAllowChgDef() - { - if(IsEmpty) return false; - if (amILockedByMe()==false) return false; - return true; - } - - public override bool mnuAllowApprove() - { - if (isApproved || IsEmpty || isTempChange) return false; - if (amILockedByMe()==false) return false; - return true; - } - - public override bool mnuAllowApproveAll() - { - bool allowit=false; - bool allowonlyonce=false; - if (isApproved || IsEmpty || isTempChange) return false; - if (amILockedByMe()==false) return false; - if ((accessFlags&Security.APPROVE)==Security.APPROVE) allowit = true; - // also check if there is a serial number option which allows only one - // approve-all, i.e. if an approved version exists, cannot approve all. - if (usrRunTime.SerialNumber.GetSNOption((uint)Utils.SerialNo.SN_Flags.SN_ONLYAPPROVEONCE_ON)>0) - allowonlyonce=true; - if (allowonlyonce && this.isSetApproved) return false; - if (allowit) return true; - return false; - } - - public override bool mnuAllowApproveSel() - { - if (isApproved || IsEmpty || isTempChange) return false; - if (amILockedByMe()==false) return false; - if (isSetApproved && ((accessFlags&Security.APPROVESINGLE)==Security.APPROVESINGLE)) return true; - return false; - } - - public override bool mnuAllowNew() - { - return false; - } - - public override bool mnuAllowDelete() - { - if (amILockedByMe()==false) return false; - if(usrRunTime.sec.PermissionToManageFlag) return true; - return false; - } - public override bool canEdit() - { - if (amILockedByMe()==false) return false; - if(usrRunTime.sec.PermissionToManageFlag) return true; - return false; - } - - public override void DoListView(ListView veoListView) - { - ListViewItem item=null; - veoListView.Columns.Add("Type", 120, HorizontalAlignment.Left); - - for (int i=0; i= 10)) break; - // get the largest values from the first record's number field - if (isfirst) - { - isfirst = false; - string nm = row["NUMBER"].ToString(); - if (nm != null && nm !="") - { - try - { - LargestNumber = System.Convert.ToInt32(nm.Substring(0,2)); - LargestNumberForMenu=System.Convert.ToInt32(nm.Substring(3,2)); - LargestTitleForMenu=System.Convert.ToInt32(nm.Substring(6,2)); - } - catch (Exception) - { - MessageBox.Show("Invalid data in procedure set.dbf file. Contact Volian!", "set.dbf Error"); - return false; - } - } - } - else - { - string mytitle = row["TITLE"].ToString(); - string mynum = row["NUMBER"].ToString(); - string mypth = row["ENTRY"].ToString(); - string recid = row["RECID"].ToString(); - string tmpcol = row["FORMAT"].ToString(); - string proccode = row["PROCCODE"].ToString(); - int itmpcol; - if (tmpcol==null||tmpcol=="") - itmpcol=1; - else - { - try - { - itmpcol = System.Convert.ToInt32(tmpcol)-1; - } - catch - { - itmpcol = 1; - } - } - if (itmpcol < 0) itmpcol = 1; // if 0 in database, default to 2 col - VEO_Base.ProcColumnOptions format = (VEO_Base.ProcColumnOptions) itmpcol; - - VEO_Proc prc = new VEO_Proc(mytitle,mypth,mynum,recid,format,proccode,row,this,false); - Children.Add(prc); - } - } - - if (ps.hasExtensions) - { - // if not new and we have extensions, check for a setext file. if it doesn't - // exist, notify user & set the flag to false. Just return, if we got to - // this point, no errors were caught. - string setextname = ps._curDirectory+"\\"+ps._Location+"\\setext.dbf"; - if (!isNew) - { - FileInfo fi = new FileInfo(setextname); - if (fi.Exists == false) - { - MessageBox.Show("Procedure comment file (setext.dbf) does not exist.\nThis data will not be available.","Set Extension Error"); - ps.hasExtensions=false; - return true; - } - } - - // the numeric data of the set extension file was not read correctly (an underlying - // driver problem. So, change the data type from numeric (N) to character (C) - // in the file at the 171th byte in the file, if it hasn't been changed. - - try - { - FileStream fs = new FileStream(setextname,FileMode.Open,FileAccess.ReadWrite,FileShare.ReadWrite); - fs.Seek(171,SeekOrigin.Begin); - int by = fs.ReadByte(); - if ((byte)by != (byte)'C') // rewrite it. - { - fs.Seek(171,SeekOrigin.Begin); - fs.WriteByte((byte)'C'); - } - fs.Close(); - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Set Extension Error"); - } - - int chldindx=0; - isfirst=true; - - vdbSetExt=new vdb_SetExt(_Location+"\\setext.dbf"); - // Loop thru the procset (process like a dataset) - tbl = vdbSetExt.DB_Data.Tables[0]; - foreach (DataRow row in tbl.Rows) - { - // if in demo mode, only allow 10 procedures in set - if (usrRunTime.sec.isDemoMode && (chldindx >= 10)) break; - // skip the first one - if (isfirst) - isfirst = false; - else - { - VEO_Proc prc = (VEO_Proc) Children[chldindx]; - - string comment = row["COMMENT"].ToString(); - string rev = row["REV"].ToString(); - string pc = row["PC"].ToString(); - string recid = row["RECID"].ToString(); - string std = row["APPROVEDDATE"].ToString(); - prc.procExt = new VEO_ProcExt(comment, rev, pc, recid, std, row); - chldindx++; - } - } - } - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error reading procedure set"); - return false; - } - return true; - } - - ~ VEO_DummySet() - { - if (vdbtmpSet!=null)vdbtmpSet.Clear(); - vdbtmpSet=null; - vdbSet=null; - vdbSetExt= null; - } - - // This method clears the vdbset, and vdbsetext if used, and reloads from - // database. It then sync's up the datarows to the dummyset's children. - // It is used for moving procedures within the set & on the pack operation. - // Both of these required rewriting of a new database file. - private bool ReLoadRows(int skip) - { - VEO_ProcSet ps = (VEO_ProcSet) parentObj; - try - { - // now reopen a vdbset & vdbsetext & reassign the datarows. - this.vdbSet = null; - this.vdbSetExt = null; - vdbSet=new vdb_Set(_Location+"\\set.dbf"); - // Loop thru the procset (process like a dataset) - DataTable tbl = vdbSet.DB_Data.Tables[0]; - int rec = 1; - for (int i=0;i=11, first - // record is not a procedure) - if (usrRunTime.sec.isDemoMode && (rec >= 11)) break; - - // if not skipping this child (on a delete), sync the database - // row eith the internal proc row - if (skip<0||i!=skip) - { - VEO_Proc prc = (VEO_Proc) Children[i]; - prc.pdatarow = tbl.Rows[rec]; // first table row is blank - rec++; - } - } - if (ps.hasExtensions) - { - this.vdbSetExt=null; - vdbSetExt=new vdb_SetExt(_Location+"\\setext.dbf"); - // Loop thru the procset extensions file - DataTable xtbl = vdbSetExt.DB_Data.Tables[0]; - rec=1; - for (int i=0;i= 11)) break; - if (skip<0||i!=skip) - { - VEO_Proc prc = (VEO_Proc) Children[i]; - VEO_ProcExt pe = prc.procExt; - pe.drow = xtbl.Rows[rec]; - rec++; - } - } - } - return true; - } - catch (Exception e) - { - MessageBox.Show(e.Message, "Problem saving procedure data"); - return false; - } - } - - // When a procedure has been moved within the set, save the new order. - public bool SaveOrder() - { - int rowcount; - VEO_ProcSet ps = (VEO_ProcSet) this.parentObj; - if(!ps.isOpen)ps.Open(); - string tempName = ps._curDirectory + "\\" + ps.Location + "\\NEWSET.DBF"; - if (File.Exists(tempName))File.Delete(tempName); - string name = ps._curDirectory + "\\" + ps.Location + "\\SET.DBF"; - string tempNameEx = null; - string nameEx = null; - if(ps.hasExtensions) - { - tempNameEx = ps._curDirectory + "\\" + ps.Location + "\\NEWEXT.DBF"; - if (File.Exists(tempNameEx))File.Delete(tempNameEx); - nameEx = ps._curDirectory + "\\" + ps.Location + "\\SETEXT.DBF"; - } - - // do set database files now - try - { - vdb_Set newset = new vdb_Set(ps._curDirectory + "\\" + ps.Location); - newset.CreateTable("newset"); - DataTable pdatatable = newset.DB_Data.Tables[0]; - DataTable origtable = vdbSet.DB_Data.Tables[0]; - DataRow recidrow = pdatatable.Rows[0]; - DataRow firstrow = origtable.Rows[0]; - recidrow.ItemArray=firstrow.ItemArray; - rowcount = 1; - foreach (VEO_Proc prc in Children) - { - DataRow pdatarow = pdatatable.NewRow(); - DataRow curold = prc.pdatarow; - pdatarow.ItemArray=curold.ItemArray; - rowcount++; - pdatatable.Rows.Add(pdatarow); - prc.pdatarow = pdatarow; - } - newset.DB_Data = recidrow.Table.DataSet; - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error Saving Procedure Set Order"); - if (File.Exists(tempName))File.Delete(tempName); - if (File.Exists(tempNameEx))File.Delete(tempNameEx); - return false; - } - - // if has setextensions, do the setext file now. - if (ps.hasExtensions) - { - try - { - vdb_SetExt newext = new vdb_SetExt(ps._curDirectory + "\\" + ps.Location); - newext.CreateTable("newext"); - DataTable exttbl = newext.DB_Data.Tables[0]; - DataRow firstdelrow = exttbl.Rows[0]; - // first row was made with a recid of 0001. We want to use the - // first row from the original setext file. - firstdelrow.Delete(); - DataRow firstrow = exttbl.NewRow(); - DataRow orig = vdbSetExt.DB_Data.Tables[0].Rows[0]; - firstrow.ItemArray = orig.ItemArray; - exttbl.Rows.Add(firstrow); - rowcount=1; - foreach (VEO_Proc prc in Children) - { - DataRow pdatarow = exttbl.NewRow(); - DataRow origr = prc.procExt.drow; - pdatarow.ItemArray=origr.ItemArray; - exttbl.Rows.Add(pdatarow); - rowcount++; - prc.procExt.drow = pdatarow; - } - newext.DB_Data = firstrow.Table.DataSet; - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error Saving Procedure Set Order"); - if (File.Exists(tempName))File.Delete(tempName); - if (File.Exists(tempNameEx))File.Delete(tempNameEx); - return false; - } - } - - // rename files & then reload the data (to sync up with internal tree) - File.Delete(name); - File.Move(tempName,name); - if (ps.hasExtensions) - { - File.Delete(nameEx); - File.Move(tempNameEx,nameEx); - } - return (ReLoadRows(-1)); - } - - // back this database, pass in an integer to show the i'th child which was removed - // so that this one is sync'd back up in the reload code. - public bool PackDB(int i) - { - //call the database method for this dataset to pack. It will close the dataset - //and will require a reopen of dataset. - this.vdbSet.Pack(); - VEO_ProcSet ps = (VEO_ProcSet) this.parentObj; - if (ps.hasExtensions) this.vdbSetExt.Pack(); - return (ReLoadRows(i)); - } - - // create a new document object (procedure child for this set) - public override Object MakeNewChild() - { - // if in demo mode, only allow 10 procedures in set - if (usrRunTime.sec.isDemoMode && (Children.Count >= 10)) - { - MessageBox.Show("No more than 10 procedures while in Demo Mode.", "VE-PROMS Demo"); - return null; - } - // for this 'dummy' procedure list node, loop through its - // children to get a unique procnumber. - int i=0; - bool newdc = false; - string newdoc=null; - while(!newdc) - { - if (i==0) - newdoc = "NewDoc"; - else - newdoc = "NewDoc"+(i-1).ToString(); - bool inlist = false; - foreach (VEO_Proc chld in this.Children) - { - if (chld.Procedure_Number == newdoc) - { - inlist=true; - break; - } - } - if(inlist)i++; - else newdc=true; - } - - // now get a unique file name - VEO_Proc prc = new VEO_Proc("New Document",this._Location,newdoc,null,VEO_Base.ProcColumnOptions.TwoColumn, null, null, this, true); - VEO_ProcSet ps = (VEO_ProcSet) parentObj; - if (ps.hasExtensions) - { - prc.procExt = new VEO_ProcExt(null, null, null, null, null, null); - } - return prc; - } - - public override bool SaveChild(Object obj) - { - VEO_Proc proc = (VEO_Proc)obj; - bool succeed = proc.SaveNew(null); - - if (succeed == true) proc.parentObj = this; - return succeed; - } - - public override void DoListView(ListView veoListView) - { - ListViewItem item=null; - veoListView.Columns.Add("ProcNumber", 120, HorizontalAlignment.Left); - veoListView.Columns.Add("Title", 200, HorizontalAlignment.Left); - veoListView.Columns.Add("ProcColumn", 100, HorizontalAlignment.Left); - veoListView.Columns.Add("ModInfo", 150, HorizontalAlignment.Left); - veoListView.Columns.Add("Location", 100, HorizontalAlignment.Left); - - for (int i=0; i0)) - { - // Enhanced Background Documents - if (File.Exists(_Location+"\\SET.DBF")) - UpdateEnhancedSetFile(); - else - { - // no set file, copy from EOPs -// VEO_ProcSet ps = (VEO_ProcSet) this.parentObj; - File.Copy(ps.GetParentLink()+"\\SET.DBF",_Location+"\\SET.DBF"); - } - } -// else if (LOC.EndsWith(".DVT") && - else if (!ps.isApproved && !ps.isTempChange && ps._ProcType.Equals(VEObject.ProcTypeOptions.Deviation) && - (usrRunTime.SerialNumber.GetSNOption((uint)Utils.SerialNo.SN_Flags.SN_DEVIATION_ON)>0)) - { - // Enhanced Deviation Documents - if (File.Exists(_Location+"\\SET.DBF")) - UpdateEnhancedSetFile(); - else - { - // no set file, copy from EOPs -// VEO_ProcSet ps = (VEO_ProcSet) this.parentObj; - File.Copy(ps.GetParentLink()+"\\SET.DBF",_Location+"\\SET.DBF"); - } - } -// else if (LOC.IndexOf(".SL") > 0) - else if (!ps.isApproved && !ps.isTempChange && ps._ProcType.Equals(VEObject.ProcTypeOptions.Slave)) - { - // Slave Procedure Set - UpdateSlaveSetFile(); - } - else - return; // not a enhanced or slave set - - } - - private void UpdateEnhancedSetFile() - { - VEO_ProcSet ps = (VEO_ProcSet) parentObj; - int EnhIdx=1,PrcIdx=1,TmpIdx; -// int EnhExtIdx=0; - int EnhCnt=0, PrcCnt=0, NewCnt=0; -// int EnhExtCnt=0, NewEnhExtCnt=0; - int LargestRecID = 0; - bool NeedToIncLargestRecID = false; - string strEnhRecID, strPrcRecID, strLargestRecID,strNewRecID; -// string NewEnhExtRecID; - int EnhRecID, PrcRecID, NewRecID; - DataRow EnhRow, PrcRow, NewRow; -// DataRow EnhExtRow; - string ParentPath = ps.GetParentLink(); - if (!Directory.Exists(ParentPath)) - { - string cwd = Directory.GetCurrentDirectory(); - MessageBox.Show("Cannot update enhanced set " + ParentPath + ". It does not exist. Check your lnk file setting.", "Enhanced Document Error"); - return; - } - - // compare the date/times of the two set files - DateTime bcksetdt = File.GetLastWriteTimeUtc(_Location+"\\set.dbf"); - DateTime eopsetdt = File.GetLastWriteTimeUtc(ParentPath+"\\set.dbf"); -// if ( bcksetdt.ToUniversalTime() >= eopsetdt.ToUniversalTime()) - if (bcksetdt >= eopsetdt) - return; // Enhanced Set file is up to date - - ArrayList EnhSetList = new ArrayList(); - ArrayList PrcSetList = new ArrayList(); - ArrayList NewEnhSetList = new ArrayList(); - // Array Lists for Set Extension databases -// ArrayList EnhSetExtList = new ArrayList(); -// ArrayList NewEnhSetExtList = new ArrayList(); - - // populate the array lists - EnhCnt = PopulateSetArrayList(_Location,EnhSetList); - PrcCnt = PopulateSetArrayList(ParentPath,PrcSetList); -// if (ps.hasExtensions) -// EnhExtCnt = PopulateSetExtArrayList(_Location,EnhSetExtList); - - // copy the first record from the Enhanced Set file - // - we might modify this later - EnhRow = (DataRow)EnhSetList[0]; - strEnhRecID = EnhRow["RECID"].ToString(); - EnhRecID = Convert.ToInt32(strEnhRecID.Substring(2)); - NewCnt = AddToArrayList(NewEnhSetList,EnhRow,NewCnt,strEnhRecID); - strLargestRecID = strEnhRecID; - LargestRecID = EnhRecID; -// if (ps.hasExtensions) -// { -// // copy the first record from the setext -// EnhExtRow = (DataRow)EnhSetExtList[0]; -// NewEnhExtRecID = EnhExtRow["RECID"].ToString(); -// NewEnhExtCnt = AddToArrayList(NewEnhSetExtList,EnhExtRow,NewEnhExtCnt,NewEnhExtRecID); -// } - - while (EnhIdx < EnhCnt && PrcIdx < PrcCnt) - { - EnhRow = (DataRow)EnhSetList[EnhIdx]; - PrcRow = (DataRow)PrcSetList[PrcIdx]; - strEnhRecID = EnhRow["RECID"].ToString(); - strPrcRecID = PrcRow["RECID"].ToString(); - EnhRecID = Convert.ToInt32(strEnhRecID.Substring(2)); - PrcRecID = Convert.ToInt32(strPrcRecID.Substring(2)); - - if (!(EnhRecID == PrcRecID)) - { - if ((InThisArrayList(strEnhRecID,PrcSetList,PrcIdx,PrcCnt)) == -1) - { - // The EOP probable was deleted. Keep the Background - // procedure around in case user needs to copy info - // from it. - if (EnhRecID > LargestRecID) - { - strLargestRecID = strEnhRecID; - LargestRecID = EnhRecID; - NeedToIncLargestRecID = true; - } - NewCnt = AddToArrayList(NewEnhSetList,EnhRow,NewCnt,strEnhRecID); - } - } - // Copy the Date, Time, and Initials from the old Enhanced Set file - TmpIdx = InThisArrayList(strPrcRecID,EnhSetList,1,EnhCnt); - if (TmpIdx > -1) - { - DataRow TmpRow = (DataRow)EnhSetList[TmpIdx]; - PrcRow["DATE"] = TmpRow["DATE"]; - PrcRow["TIME"] = TmpRow["TIME"]; - PrcRow["INITIALS"] = TmpRow["INITIALS"]; - } - if (PrcRecID > LargestRecID) - { - strLargestRecID = strPrcRecID; - LargestRecID = PrcRecID; - NeedToIncLargestRecID = true; - } - NewCnt = AddToArrayList(NewEnhSetList,PrcRow,NewCnt,strPrcRecID); -// if (ps.hasExtensions) -// { -// // Add Set Extension info. -// EnhExtIdx = InThisArrayList(strEnhRecID,EnhSetExtList,1,EnhExtCnt); -// if (EnhExtIdx > -1) -// { -// EnhExtRow = (DataRow)EnhSetExtList[EnhExtIdx]; -// NewEnhExtRecID = EnhExtRow["RECID"].ToString(); -// NewEnhExtCnt = AddToArrayList(NewEnhSetExtList,EnhExtRow,NewEnhExtCnt,NewEnhExtRecID); -// } -// } - - EnhIdx++; - PrcIdx++; - } - // add any BCK Records that are remaining - while (EnhIdx < EnhCnt) - { - EnhRow = (DataRow)EnhSetList[EnhIdx]; - strEnhRecID = EnhRow["RECID"].ToString(); - EnhRecID = Convert.ToInt32(strEnhRecID.Substring(2)); - if (EnhRecID > LargestRecID) - { - strLargestRecID = strEnhRecID; - LargestRecID = EnhRecID; - NeedToIncLargestRecID = true; - } - NewCnt = AddToArrayList(NewEnhSetList,EnhRow,NewCnt,strEnhRecID); - EnhIdx++; -// if (ps.hasExtensions) -// { -// // Add Set Extension info. -// EnhExtIdx = InThisArrayList(strEnhRecID,EnhSetExtList,1,EnhExtCnt); -// if (EnhExtIdx > -1) -// { -// EnhExtRow = (DataRow)EnhSetExtList[EnhExtIdx]; -// NewEnhExtRecID = EnhExtRow["RECID"].ToString(); -// NewEnhExtCnt = AddToArrayList(NewEnhSetExtList,EnhExtRow,NewEnhExtCnt,NewEnhExtRecID); -// } -// } - } - // add any PRC Records that are remaining - while (PrcIdx < PrcCnt) - { - PrcRow = (DataRow)PrcSetList[PrcIdx]; - strPrcRecID = PrcRow["RECID"].ToString(); - PrcRecID = Convert.ToInt32(strPrcRecID.Substring(2)); - if (PrcRecID > LargestRecID) - { - strLargestRecID = strPrcRecID; - LargestRecID = PrcRecID; - NeedToIncLargestRecID = true; - } - // Copy the Date, Time, and Initials from the old Enhanced Set file - TmpIdx = InThisArrayList(strPrcRecID,EnhSetList,1,EnhCnt); - if (TmpIdx > -1) - { - DataRow TmpRow = (DataRow)EnhSetList[TmpIdx]; - PrcRow["DATE"] = TmpRow["DATE"]; - PrcRow["TIME"] = TmpRow["TIME"]; - PrcRow["INITIALS"] = TmpRow["INITIALS"]; - } - NewCnt = AddToArrayList(NewEnhSetList,PrcRow,NewCnt,strPrcRecID); - PrcIdx++; -// if (ps.hasExtensions) -// { -// // Add Set Extension info. -// EnhExtIdx = InThisArrayList(strPrcRecID,EnhSetExtList,1,EnhExtCnt); -// if (EnhExtIdx > -1) -// { -// EnhExtRow = (DataRow)EnhSetExtList[EnhExtIdx]; -// NewEnhExtRecID = EnhExtRow["RECID"].ToString(); -// NewEnhExtCnt = AddToArrayList(NewEnhSetExtList,EnhExtRow,NewEnhExtCnt,NewEnhExtRecID); -// } -// } - } - // Update Record zero's RECID if needed - NewRow = (DataRow)NewEnhSetList[0]; - strNewRecID = NewRow["RECID"].ToString(); - NewRecID = Convert.ToInt32(strNewRecID.Substring(2)); - if (LargestRecID > NewRecID) - { - if (NeedToIncLargestRecID) LargestRecID++; - strLargestRecID = strLargestRecID.Substring(0,2)+LargestRecID.ToString("d6"); - NewRow["RECID"] = strLargestRecID; - NewEnhSetList[0] = NewRow; -// if (ps.hasExtensions) -// { -// EnhExtRow = (DataRow)EnhSetExtList[0]; -// EnhExtRow["RECID"] = strLargestRecID; -// EnhSetExtList[0] = EnhExtRow; -// } - } - - // Write out new SET.DBF file -// WriteUpdatedSetFile(_Location,NewEnhSetList,EnhSetExtList,ps.hasExtensions); - WriteUpdatedSetFile(_Location,NewEnhSetList,null,false); - } - - static int PopulateSetArrayList(string Loc,ArrayList AryLst) - { - int cnt =0; - string SetFilePath = Loc+"\\set.dbf"; - if (File.Exists(SetFilePath)) - { - try - { - vdb_Set TheSetFile = new vdb_Set(SetFilePath); - // Loop thru the procset (process like a dataset) - DataTable tbl = TheSetFile.DB_Data.Tables[0]; - foreach (DataRow row in tbl.Rows) - { - AryLst.Add(row); - cnt++; - } - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error populating Set Array Lists"); - return 0; - } - } - - return cnt; - } - - static int PopulateSetExtArrayList(string Loc,ArrayList AryLst) - { - int cnt =0; - string SetExtPath = Loc+"\\setext.dbf"; - if (File.Exists(SetExtPath)) - { - try - { - vdb_SetExt TheSetExtFile = new vdb_SetExt(SetExtPath); - // Loop thru the procset (process like a dataset) - DataTable tbl = TheSetExtFile.DB_Data.Tables[0]; - foreach (DataRow row in tbl.Rows) - { - AryLst.Add(row); - cnt++; - } - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error populating SetExt Array Lists"); - return 0; - } - } - - return cnt; - } - - - static int AddToArrayList(ArrayList AryLst,DataRow RowToAdd, int cnt, string AddRecID) - { - bool found=false; - // Bug fix: B2006-043 - // skip the first record (record zero) - int i=1; //0; - while (!found && (i= 0) - { - extTbl.Rows.Add((DataRow)ExtAryLst[ExtAryLstIdx]); - } - else - { - // Create empty set extension record - DataRow newdatarow = extTbl.NewRow(); - newdatarow["RECID"] = AryLstRecID; - newdatarow["COMMENT"] = System.DBNull.Value; // (Comment!=null)&&(Comment!="")?Comment:System.DBNull.Value; - newdatarow["REV"] = System.DBNull.Value; - newdatarow["PC"] = System.DBNull.Value; - newdatarow["TDSTAMP"] = System.DBNull.Value; - extTbl.Rows.Add(newdatarow); - } - } - } - TheSetFile.DB_Data = tbl.DataSet; - if (hasextensions) - { - TheSetExtFile.DB_Data = extTbl.DataSet; - } - } - catch (Exception e) - { - MessageBox.Show(e.Message,"Error writing Enhanced Procedures' Set File"); - return; - } - return; - } - - void UpdateSlaveSetFile() - { - VEO_ProcSet ps = (VEO_ProcSet) parentObj; - bool updateDTS = true; - string MasterDir = ""; - string PathToMaster = ""; - string PathToSlave = ps._curDirectory + "\\" + ps._Location; - - // InMaster() will return the MasterSetPath -// if (InApproved() || InMaster(MasterDir)) return; - if (ps.isApproved || ps.InMaster(ref MasterDir)) return; - - // For Updating the SET.DBF file in Slave procedure sets... - // If the user had approved the slave procedure set: - // - don't copy the Date/Time field from the master - // Else - // - copy the Date/Time field from the master - if (File.Exists(PathToSlave + "\\APPROVED\\SET.DBF")) - updateDTS = false; - - PathToMaster = ps.CurDirectory + "\\" + MasterDir; - - if (SlaveSetFileUpToDate(PathToMaster,PathToSlave)) - return; // Set file is up to date - - ArrayList SlaveSetList = new ArrayList(); - ArrayList MasterSetList = new ArrayList(); - ArrayList NewSlaveSetList = new ArrayList(); - - int SlaveIdx = 0, MasterIdx = 0; //, NewSlaveIdx=0; - int SlaveCnt, MasterCnt; //, NewCnt; - - DataRow SlaveRow, MasterRow; //, NewRow; - - string strMasterRecID; //,strSlaveRecID,strNewRecID; - - SlaveCnt = PopulateSetArrayList(PathToSlave,SlaveSetList); - MasterCnt = PopulateSetArrayList(PathToMaster,MasterSetList); - -// if (ps.hasExtensions) -// SlvExtCnt = PopulateSetExtArrayList(PathToSlave,SlvSetExtList); - - // Update the first record - MasterRow = (DataRow)MasterSetList[0]; - strMasterRecID = MasterRow["RECID"].ToString(); - - if ((InThisArrayList(strMasterRecID,SlaveSetList,0,SlaveCnt)) == 0) - { - //Update the first record - SlaveRow = (DataRow)SlaveSetList[0]; - string MasterNumberField = MasterRow["NUMBER"].ToString(); - string SlaveNumberField = SlaveRow["NUMBER"].ToString(); - SlaveRow["NUMBER"] = MasterNumberField; - NewSlaveSetList.Add(SlaveRow); - } - else - { - //Copy first record from master - NewSlaveSetList.Add(MasterRow); - } - - for(MasterIdx = 1; MasterIdx < MasterCnt; MasterIdx++) - { - MasterRow = (DataRow)MasterSetList[MasterIdx]; - strMasterRecID = MasterRow["RECID"].ToString(); - SlaveIdx = InThisArrayList(strMasterRecID,SlaveSetList,1,SlaveCnt); - if (SlaveIdx > -1) - { - // Update Slave set record - SlaveRow = (DataRow)SlaveSetList[SlaveIdx]; - SlaveRow["TITLE"] = MasterRow["TITLE"]; - SlaveRow["NUMBER"] = MasterRow["NUMBER"]; - SlaveRow["FORMAT"] = MasterRow["FORMAT"]; - if (updateDTS) - { - SlaveRow["DATE"] = MasterRow["DATE"]; - SlaveRow["TIME"] = MasterRow["TIME"]; - } - NewSlaveSetList.Add(SlaveRow); - // remove this item from the Slave list - SlaveSetList.RemoveAt(SlaveIdx); - SlaveCnt--; - } - else - { - // save new entry - NewSlaveSetList.Add(MasterRow); - } - } - // remove the deleted slave procedures - for (SlaveIdx=1; SlaveIdx < SlaveCnt; SlaveIdx++) - { - SlaveRow = (DataRow)SlaveSetList[SlaveIdx]; - string filename = SlaveRow["ENTRY"].ToString(); - // Remove the data files for this procedure - RemoveProcedureFiles(PathToSlave,filename); - // Remove the transitions references - vdb_TransUsage Tusage = new vdb_TransUsage(PathToSlave); - string procnum = SlaveRow["NUMBER"].ToString(); - string WhereStr = "WHERE [FROMNUMBER] = \'" + procnum.Replace("'","''") + "\' OR [TONUMBER] = \'"+ procnum.Replace("'","''") + "\'"; -// string WhereStr = "WHERE [FROMNUMBER] = \'" + procnum + "\'"; - DataSet TransDataSet = Tusage.GetNotSorted(WhereStr); - DataTable tbl = TransDataSet.Tables[0]; - int numrows = tbl.Rows.Count; - foreach (DataRow row in tbl.Rows) - { - row.Delete(); - } - // remove the deleted Trans Usage records - if (tbl.Rows.Count > 0) - Tusage.DB_Data = tbl.DataSet; - - // Remove the RO references - vdb_ROUsage ROusage = new vdb_ROUsage(PathToSlave); - WhereStr = "WHERE NUMBER = '" + procnum.Replace("'","''") + "'"; - DataSet RODataSet = ROusage.GetNotSorted(WhereStr); - DataTable roTbl = RODataSet.Tables[0]; - foreach (DataRow row in roTbl.Rows) - { - row.Delete(); - } - // remove the deleted RO usage records - if (roTbl.Rows.Count >0) - ROusage.DB_Data = roTbl.DataSet; - } - // Write the new SET.DBF file - WriteUpdatedSetFile(PathToSlave,NewSlaveSetList,null,false); - } - - static bool SlaveSetFileUpToDate(string MasterPath, string SlavePath) - { - bool rtnval = true; - string MasterSetFile = MasterPath+"\\set.dbf"; - string SlaveSetFile = SlavePath+"\\set.dbf"; - - if (File.Exists(MasterSetFile)) - { - if (File.Exists(SlaveSetFile)) - { - rtnval = (File.GetLastWriteTimeUtc(MasterSetFile) <= - File.GetLastWriteTimeUtc(SlaveSetFile)); - } - else - rtnval = false; - } - - return rtnval; - } - - static void RemoveProcedureFiles(string SlavePath, string FileName) - { - FileInfo[] fiArr; - DirectoryInfo cur = new DirectoryInfo(SlavePath); - // check for RTFFILES directory, skip this part if it doesn't exist. - DirectoryInfo tstrtf = new DirectoryInfo(SlavePath+"\\RTFFILES"); - if (tstrtf.Exists) - { - fiArr = tstrtf.GetFiles(FileName+".*"); - - // print out the names of the directories - foreach (FileInfo fi in fiArr) - { - fi.Delete(); - } - } - fiArr = cur.GetFiles(FileName+".*"); - foreach (FileInfo fi in fiArr) - { - fi.Delete(); - } - } - - public VEO_Proc GetProcFromNum(string procnum) - { - foreach (Object obj in Children) - { - VEO_Proc prc = (VEO_Proc) obj; - if (prc._Prcnum.ToUpper() == procnum.ToUpper()) - return prc; - } - return null; //not found - } - - public string GetSectionNumAndTitle(string procnum, string stp) - { - // get to the list of procedures and find the procedure for the input - // procedure number. - string retstr = null; - VEO_Proc prc = GetProcFromNum(procnum); - vdb_Proc dbprc=null; - // using the database name, do a select to get the section number & title. - try - { - dbprc = new vdb_Proc(prc._Location+".dbf"); - string wherestr = "STEP LIKE '" + stp.Substring(0,1) + "%' AND SEQUENCE LIKE ' %'"; - DataSet accSet = dbprc.GetNotSorted(wherestr); - DataTable tbl = accSet.Tables[0]; - if (tbl.Rows.Count<1) return null; - DataRow dr = tbl.Rows[0]; - string txt = dr["TEXT"].ToString(); - string title = txt.Substring(0,(txt.LengthSECTITLEBUFSZ+15) - { - int len = (txt.Length-85 0) - { - // create the lib doc to get it's title, then loop through those - // that already are in the list to see if this title is already - // there. - VEO_LibDoc tmp = new VEO_LibDoc(fi.FullName, this, false); - bool inlist = false; - foreach (Object obj in Children) - { - VEO_LibDoc ld = (VEO_LibDoc) obj; - //create the lib doc to get it's title, but only add it to the - // children list if it's unique. - if (ld._Title == tmp._Title) - { - inlist = true; - break; - } - } - if (inlist == false) Children.Add(tmp); - } - } - if (Children.Count==0)IsEmpty=true; - return true; - } - - public override Object MakeNewChild() - { - string comment = null; - VEO_LibDoc ld = null; - int MAXLIBDOCS=10000; - VEO_ProcSet ps = (VEO_ProcSet) parentObj; - ps.Open(); - - // now get a unique file name - OpenFileDialog openFileDialog1 = new OpenFileDialog(); - - openFileDialog1.InitialDirectory = Directory.GetCurrentDirectory(); - openFileDialog1.Filter = "rtf files (*.rtf)|*.rtf|All files (*.*)|*.*" ; - openFileDialog1.FilterIndex = 0 ; - openFileDialog1.RestoreDirectory = true ; - - string rtffile=null; - if(openFileDialog1.ShowDialog() == DialogResult.OK) - { - rtffile = openFileDialog1.FileName; - //currentpath = rtffile.Substring(0,rtffile.LastIndexOf("\\")); - - // first open & read to verify that it is an rtf file. - StreamReader myReader = new StreamReader(rtffile);// Open file - - int nbytes; - char [] tbuf = new char[17]; - - if((nbytes = myReader.Read(tbuf,0,16))<11) // read some - { - myReader.Close(); - MessageBox.Show("File must be an RTF file","Library Document Error"); - } - else - { - myReader.Close(); - string str = new string(tbuf); - if (str.IndexOf("{\\rtf1\\ansi",0)<0) - { - MessageBox.Show("File must be an RTF file","Library Document Error"); - return null; - } - } - - // Make a unique title name - int i=0; - bool used=true; - string newlibtitle = null; - while(used) - { - newlibtitle = "NewLibDoc" + i.ToString(); - bool found=false; - foreach (Object obj in Children) - { - VEO_LibDoc lld = (VEO_LibDoc) obj; - if (lld._Title == newlibtitle) - { - found=true; - break; - } - } - if(!found) - used=false; - else - i++; - } - comment = "New Library Document"; - - // if the 'RTFFILES directory doesn't exist, create it here. - if (Directory.Exists("RTFFILES")!=true) Directory.CreateDirectory("RTFFILES"); - - // now find a unique file name. - i=0; - string buf1 = "DOC_" + i.ToString("D4") + ".lib"; - string buf2 = "RTFFILES\\DOC_" + i.ToString("D4") + ".lib"; - bool fexists=true; - while(fexists) - { - if ((File.Exists(buf1) || File.Exists(buf2)) && i0) - { - xbuf = new char[comment.Length]; - xbuf = comment.ToCharArray(); - bw.Write(xbuf); - bw.Write((byte)0); - } - - //now append the selected file to the new lib file - FileStream fsorig = new FileStream(rtffile,FileMode.Open,FileAccess.Read); - using (BinaryReader br = new BinaryReader(fsorig,Encoding.ASCII)) - { - byte ac; - bool done = false; - while(done==false) - { - if (br.PeekChar() >0) - { - ac = br.ReadByte(); - bw.Write(ac); - } - else - done=true; - } - } - bw.Close(); - fsorig.Close(); - fsnew.Close(); - - if (!File.Exists(pthname)) - { - MessageBox.Show("Could not create rtf file","Library Document Error"); - return null; - } - - ld = new VEO_LibDoc(Directory.GetCurrentDirectory() + "\\"+pthname,this,true); - } - - return ld; - } - - public void Approve(string src, string dst) - { - string[] fis = Directory.GetFiles(src,"DOC_*.LIB"); - foreach (string sfi in fis) - { - FileInfo fi = new FileInfo(sfi); - if (!File.Exists(dst+"\\"+fi.Name)) fi.CopyTo(dst+"\\"+fi.Name,true); - } - string rtfsrc = src + "\\rtffiles\\"; - string rtfdst = dst + "\\rtffiles\\"; - fis = Directory.GetFiles(rtfsrc,"DOC_*.LIB"); - foreach (string sfi in fis) - { - FileInfo fi = new FileInfo(sfi); - fi.CopyTo(rtfdst+"\\"+fi.Name,true); - } - } - - public override bool SaveChild(Object obj) - { - VEO_LibDoc ld = (VEO_LibDoc)obj; - bool succeed = ld.SaveNew(null); - - if (succeed == true) ld.parentObj = this; - return succeed; - } - - public override void DoListView(ListView veoListView) - { - ListViewItem item=null; - veoListView.Columns.Add("Location", 120, HorizontalAlignment.Left); - veoListView.Columns.Add("Title", 300, HorizontalAlignment.Left); - - for (int i=0; i - /// This class provides the 'Properties' dialog box. It includes a property - /// grid which uses Property data from caller to list items in the grid. - /// - public class Properties : System.Windows.Forms.Form - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private System.Windows.Forms.PropertyGrid myPropertyGrid; - private System.Windows.Forms.Panel panel1; - private VEO_Base _ParentObj; - private VEO_Base _CurObj; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.Button btnSave; - private System.Windows.Forms.Button btnApply; - private bool isnew; - public GridItem CurrentGridItem; - private bool canedit; - - public Properties(Object par, Object obj) - { - _ParentObj = (VEO_Base) par; - _CurObj = (VEO_Base) obj; - if(_CurObj.isNew) - isnew=true; - else - isnew=false; - - // - // Required for Windows Form Designer support - // - InitializeComponent(); - this.btnApply.Enabled=false; - if((_CurObj.canEdit()==false)&&!isnew) - this.myPropertyGrid.Enabled=false; - else - this.myPropertyGrid.Enabled=true; - - this.myPropertyGrid.SelectedObject=obj; - canedit=this.myPropertyGrid.Enabled; - - // make apply button visible if modify - this.btnApply.Visible = !isnew; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Properties)); - this.myPropertyGrid = new System.Windows.Forms.PropertyGrid(); - this.panel1 = new System.Windows.Forms.Panel(); - this.btnApply = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.btnSave = new System.Windows.Forms.Button(); - this.panel1.SuspendLayout(); - this.SuspendLayout(); - // - // myPropertyGrid - // - this.myPropertyGrid.CommandsVisibleIfAvailable = true; - this.myPropertyGrid.Dock = System.Windows.Forms.DockStyle.Top; - this.myPropertyGrid.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.myPropertyGrid.HelpVisible = false; - this.myPropertyGrid.LargeButtons = false; - this.myPropertyGrid.LineColor = System.Drawing.SystemColors.ScrollBar; - this.myPropertyGrid.Location = new System.Drawing.Point(0, 0); - this.myPropertyGrid.Name = "myPropertyGrid"; - this.myPropertyGrid.PropertySort = System.Windows.Forms.PropertySort.Categorized; - this.myPropertyGrid.Size = new System.Drawing.Size(704, 416); - this.myPropertyGrid.TabIndex = 1; - this.myPropertyGrid.Text = "Properties"; - this.myPropertyGrid.ToolbarVisible = false; - this.myPropertyGrid.ViewBackColor = System.Drawing.SystemColors.Window; - this.myPropertyGrid.ViewForeColor = System.Drawing.SystemColors.WindowText; - this.myPropertyGrid.Click += new System.EventHandler(this.myPropertyGrid_Click); - this.myPropertyGrid.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.myPropertyGrid_PropertyValueChanged); - this.myPropertyGrid.DoubleClick += new System.EventHandler(this.myPropertyGrid_Click); - // - // panel1 - // - this.panel1.Controls.Add(this.btnApply); - this.panel1.Controls.Add(this.btnCancel); - this.panel1.Controls.Add(this.btnSave); - this.panel1.Location = new System.Drawing.Point(0, 128); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(704, 96); - this.panel1.TabIndex = 2; - // - // btnApply - // - this.btnApply.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnApply.Location = new System.Drawing.Point(200, 8); - this.btnApply.Name = "btnApply"; - this.btnApply.Size = new System.Drawing.Size(64, 24); - this.btnApply.TabIndex = 2; - this.btnApply.Text = "Apply"; - this.btnApply.Click += new System.EventHandler(this.btnApply_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnCancel.Location = new System.Drawing.Point(112, 8); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(64, 24); - this.btnCancel.TabIndex = 1; - this.btnCancel.Text = "Cancel"; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // btnSave - // - this.btnSave.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnSave.Location = new System.Drawing.Point(24, 8); - this.btnSave.Name = "btnSave"; - this.btnSave.Size = new System.Drawing.Size(64, 24); - this.btnSave.TabIndex = 0; - this.btnSave.Text = "OK"; - this.btnSave.Click += new System.EventHandler(this.btnOK_Click); - // - // Properties - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(704, 190); - this.Controls.Add(this.panel1); - this.Controls.Add(this.myPropertyGrid); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "Properties"; - this.Text = "Properties"; - this.panel1.ResumeLayout(false); - this.ResumeLayout(false); - - } - #endregion - - private void myPropertyGrid_Click(object sender, System.EventArgs e) - { - CurrentGridItem = this.myPropertyGrid.SelectedGridItem; - } - - private void myPropertyGrid_PropertyValueChanged(object s, System.Windows.Forms.PropertyValueChangedEventArgs e) - { - btnApply.Enabled = true; - CurrentGridItem = this.myPropertyGrid.SelectedGridItem; - } - - // save data for use by ok and apply button clicks - private bool saveclick() - { - bool success = true; - - if (isnew) - { - if(_ParentObj==null) - { - DialogResult=DialogResult.Cancel; - return success; - } - success=_ParentObj.SaveChild(_CurObj); - } - else - { - success=_CurObj.Write(); - } - return success; - } - - // save was clicked, use the objects save methods. - private void btnOK_Click(object sender, System.EventArgs e) - { - bool success = true; - if (canedit) success = saveclick(); - if (success==true) - { - DialogResult = DialogResult.OK; - this.Close(); - } - } - - private void btnApply_Click(object sender, System.EventArgs e) - { - if(!canedit)return; - bool success = saveclick(); - if(success==true)btnApply.Enabled=false; - this.myPropertyGrid.Refresh(); - } - - private void btnCancel_Click(object sender, System.EventArgs e) - { - if(!canedit)return; - _CurObj.Restore(); - } - - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Properties.resx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Properties.resx deleted file mode 100644 index 34fba6ad..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/Properties.resx +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - False - - - True - - - Private - - - 8, 8 - - - True - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - Properties - - - 80 - - - True - - - Private - - - - AAABAAEAICAQAAAAAADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAgAIAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAADAAADAAAAAwMAAwAAAAMAAwADAwAAAwMDAAICAgAAAAP8AAP8AAAD//wD/AAAA/wD/AP// - AAD///8AiIiIiIiIiIiIiIiIiIiIiPF3F3F3F3F3F3d3d3d3d3jxdxdxdxdxdxd3d3d3d3d49xdxdxdx - dxdxd3d3d3d3ePcXcXcXcXcXcXd3d3d3d3jxcXcXcXcXcXcXd3d3d3d48XF3F3F3F3F3F3d3d3d3ePdx - F3F3F3F3F3F3d3d3d3j3cRdxdxdxdxdxd3d3d3d49xdxdxdxdxdxdxd3d3d3ePcXcXcXcXcXcXcXd3d3 - d3jxdxcXcXcXcXcXcXd3d3d48XcXF3F3F3F3F3F3d3d3ePdxdxF3F3F3F3F3F3d3d3j3cXcRdxdxdxdx - dxd3d3d49xdxdxdxdxdxdxdxd3d3ePcXcXcXcXcXcXcXcXd3d3jxdxdxcXcXcXcXcXcXd3d48XcXcXF3 - F3F3F3F3F3d3ePdxdxd3F3F3F3F3F3F3d3j3cXcXdxdxdxdxdxdxd3d49xdxd3dxdxdxdxdxdxd3ePcX - cXd3cXcXcXcXcXcXd3jxdxd3d3cXcXcXcXcXcXd48XcXd3d3F3F3F3F3F3F3ePdxd3d3d3F3F3F3F3F3 - F3j3cXd3d3dxdxdxdxdxdxd49xd3d3d3dxdxdxdxdxdxePcXd3d3d3cXcXcXcXcXcXjxd3d3d3d3cXcX - cXcXcXcY8Xd3d3d3d3F3F3F3F3F3GP////////////////////gAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/RO.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/RO.cs deleted file mode 100644 index 3f7a12bc..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/RO.cs +++ /dev/null @@ -1,436 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: RO.cs $ $Revision: 6 $ - * $Author: Kathy $ $Date: 5/02/06 9:46a $ - * - * $History: RO.cs $ - * - * ***************** Version 6 ***************** - * User: Kathy Date: 5/02/06 Time: 9:46a - * Updated in $/LibSource/VEObject - * B2006-018: ro usages for procnums with single quote - * - * ***************** Version 5 ***************** - * User: Jsj Date: 6/02/05 Time: 11:36a - * Updated in $/LibSource/VEObject - * fix for approving with conditional ROs and code cleanup - * - * ***************** Version 4 ***************** - * User: Kathy Date: 5/19/05 Time: 11:08a - * Updated in $/LibSource/VEObject - * speed up approve - * - * ***************** Version 3 ***************** - * User: Jsj Date: 5/17/05 Time: 12:00p - * Updated in $/LibSource/VEObject - * Approve graphic fix - * - * ***************** Version 2 ***************** - * User: Jsj Date: 3/10/05 Time: 4:02p - * Updated in $/LibSource/VEObject - * hooks to new namespace for RO FST file - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:51p - * Created in $/LibSource/VEObject - * Approval - *********************************************************************************************/ -using System; -using System.IO; -using System.Data; -using System.Windows.Forms; -using System.Collections; -using Utils; -using ROFST_FILE; -using VDB_ROUsage; -using VlnStatus; - -namespace VEObject -{ - /// - /// Summary description for ROFST. Provides support/interface to/from RO.fst file. - /// - public class ROFST : ROFST_File - { - // constructor loads ro.fst databases - public ROFST(string path):base(path) - { - } - - - ~ ROFST() - { - } - - public void CopyImagesToApproved(string appdir, VlnStatusMessage StatMsgWindow) - { - for(int i=0;i0) return true; - return false; - } - - private void CopyROFile(string fname, string ApprovedDir) - { - PrivateProfile ropathINI = new PrivateProfile("PROC.INI"); - string ropath = ropathINI.Attr("RO Defaults","ROPATH"); - if (ropath == null || ropath == "") ropath = "..\\RO"; - string src = ropath + "\\" + fname; - string dst = ApprovedDir + "\\" + fname; - if (File.Exists(src)) - { - File.Copy(src,dst,true); - FileInfo fi_src = new FileInfo(src); - FileInfo fi_dst = new FileInfo(dst); - fi_dst.LastWriteTime = fi_src.LastWriteTime; - } - else - MessageBox.Show("Could not copy " + src); - } - - private long CalculatePromsDate(DateTime imgdate) - { - /* - * do some conversion so that comparison can be made on date/time - * stored on image data from ro.fst to a datetime from .net. - * Proms had it in seconds since 00:00:00 1/1/1970. - * .NET has it in ticks since 00:00:00 1/1/1 - */ - DateTime promsdt = new DateTime(1970,1,1,0,0,0); // Jan 1, 1970 - // Convert the promsdt to UTC (GMT) - DateTime promsdtU = promsdt.ToUniversalTime(); - long promsdtU_num = promsdtU.Ticks / 10000000; - - // Convert the image file datetime to UTC - DateTime imgdateU = imgdate.ToUniversalTime(); - long imgdateu_num = imgdateU.Ticks / 10000000; - - /** - * Get the time adjustment for the current Time Zone with respect - * to the coordinated universal time (UTC) - a.k.a. Greenwich mean time (GMT). - * The time gotten for the Jan 1, 1970 is in UTC time, the imgdate time is - * in EST. - * - * Get the offset time between this time zone and UTC (GMT) time. - * Convert the offset to seconds. - * Subtract the offset from the UTC time gotten for Jan 1, 1970 - */ - ThisTimeZone TZ = new ThisTimeZone(); - TimeSpan TimeZoneSpan = TZ.GetUtcOffset(promsdt); // Time Zone offset from UTC - long TimeZoneAdj = Math.Abs(TimeZoneSpan.Ticks / 10000000); // convert to seconds - - /* - * The file date/time and the Jan 1, 1970 adjustment date are in UTC. - * Subtract the "Jan 1, 1970" date/time from the file date/time - * the add the Time Zone offset to place the date/time value into - * local time. - */ - long lsec = (imgdateu_num - promsdtU_num) + TimeZoneAdj; - return lsec; - } - - - - public void ApproveGraphicsFile(string fstRec, string appdir, VlnStatusMessage StatMsgWindow) - { - long dt; - // position to Graphics file name - int nlindx = fstRec.IndexOf("\n"); - - // Graphics file name - string fbuf = fstRec.Substring(0,nlindx); - - // Grpahics file date/time (stored in RO.FST) - dt = System.Convert.ToInt32(fstRec.Substring(nlindx+1,8),16); - - // Add the graphics file extension if needed - int indx = fbuf.IndexOf("."); - if (indx<0 || (fbuf.Length>indx+1 && fbuf[indx+1]=='\\')) - { - if (DefaultGraphicFileExt[0] != '.') fbuf = fbuf + "."; - fbuf = fbuf + DefaultGraphicFileExt; - } - - // if file doesn't exist in approved - // or if it is more recent than approved, - // copy it to approved. - string appfbuf = appdir + "\\" + fbuf; - FileInfo app_fi = new FileInfo(fbuf); - if (!File.Exists(appfbuf) || (CalculatePromsDate(app_fi.LastWriteTime)!=dt)) - { - if (StatMsgWindow !=null) StatMsgWindow.StatusMessage = "Updating graphic " + fbuf; - CopyROFile(fbuf,appdir); - } - } - - private void ProcessGroupsForImages(string appdir, string tmp,uint x1,string ttl,BinaryReader br, - uint start, short level, ushort tblid, VlnStatusMessage StatMsgWindow) - { - uint id, parid; - short howmany; - long wasAt = br.BaseStream.Position; - br.BaseStream.Seek((long) start, SeekOrigin.Begin); - id = br.ReadUInt32(); - parid = br.ReadUInt32(); - howmany = br.ReadInt16(); - if (howmany <= 0 && (ttl!=null && ttl!="") && wasused(tblid,id)) - { - byte bt = br.ReadByte(); // skip type - bt = br.ReadByte(); - - // Read the Graphics File ROFST record - string dtl = ROFST.GetAsciiString(br); - // Approve the Graphics file - ApproveGraphicsFile(dtl, appdir, StatMsgWindow); - } - - // if count in howmany is greater than zero, this must be a group - // recursively call this to find ros. - if (howmany>0) - { - if (level>=0) - { - string [] title = new string [howmany]; - UInt32 [] offset = new UInt32 [howmany]; - UInt16 [] type = new UInt16 [howmany]; - for (int i=0; i0) - ProcessGroupsForImages(appdir,null,type[i],title[i],br,offset[i],System.Convert.ToInt16(level+1),tblid,StatMsgWindow); - } - } - } - br.BaseStream.Seek(wasAt,SeekOrigin.Begin); - } - } - - public class Usages - { - static Usages() - { - - } - - public static int CheckRoReferences(VEO_ProcSet ps, string path, ArrayList al, ArrayList ModROs, string keystr) - { - // get usage records for the input string 'keystr' and then check to - // see if the RO is in the input Modified list. - // If keystr is a lib-doc (i.e. starts with "DOC") then just return the - // whether there is modified ro in here. - // If keystr is a procedure num, check to see if other procedures use this - // modified RO and add them to the list of items to approve (al). - - // -1 flags failure on return. Otherwise, return count of those found. - int retval=0; - vdb_ROUsage rousg=null; - DataSet dataset=null; - string us_path = path + "\\usagero.dbf"; - try - { - rousg = new vdb_ROUsage(us_path); - dataset = rousg.GetSortedByProc("[NUMBER] = \'"+keystr.Replace("'","''")+"\'"); - } - catch (Exception e) - { - MessageBox.Show("Could not get RO usages for this item " + keystr + ", " + e.Message); - return -1; - } - foreach (DataRow dr in dataset.Tables[0].Rows) - { - // if we find an RO that's in the ModROs list, then here's where - // we see if it's used by other procedures too. - string roid = dr["ROID"].ToString(); - if (roid.Length == 12) - roid = roid + "0000"; - else if (!roid.EndsWith("0000")) - roid = roid.Substring(0,12) + "0000"; - - ModRO wasModRO = null; - foreach (ModRO mro in ModROs) - { - string tmpROID = mro.roid; - if (tmpROID.Length == 12) - tmpROID = tmpROID + "0000"; - if (tmpROID.Equals(roid)) - { - mro.roid = tmpROID; - wasModRO = mro; - mro.IsUsed = true; - break; - } - } - - // if just checking if the library document has any modified ROs, then - // just return (return with a number greater than 0 to flag that it had - // modified ROs. Doc is only passed in as the keystr when checking for - // modified library documents. - if (keystr.Substring(0,3).ToUpper()=="DOC") - { - if (wasModRO != null) return 1; - return 0; - } - // if this was a procedure, then we'll see if other procedures use this. - if (wasModRO != null) - { - us_path = path + "\\approved\\usagero.dbf"; - rousg = null; - rousg = new vdb_ROUsage(us_path); - DataSet dataset_prc = null; - string keyroid = roid.Substring(0,12)+"%"; - try - { - dataset_prc = rousg.GetSortedByROID("[ROID] LIKE \'"+keyroid+"\'"); - //dataset_prc = rousg.GetSortedByROID("[ROID] = \'"+roid+"\'"); - } - catch (Exception e) - { - MessageBox.Show("Could not get procedures using modified RO " + roid + ", " + e.Message); - return -1; - } - foreach (DataRow drroid in dataset_prc.Tables[0].Rows) - { - // first see if this prpc is already in list of procedures to approve - // if so, don't add it, but check to be sure this ro is in the conflict - // list. - bool inlist = false; - AppIndItem cur=null; - foreach (object obal in al) - { - AppIndItem aiiobj = (AppIndItem) obal; - if (aiiobj.Proc._Prcnum == (string)drroid["NUMBER"]) - { - cur=aiiobj; - inlist=true; - break; - } - } - if (!inlist) - { - VEO_DummySet ds = (VEO_DummySet) ps.Children[1]; - // find the procedure object to add it the the approve list - foreach (object ob in ds.Children) - { - VEO_Proc pr = (VEO_Proc) ob; - if (pr._Prcnum == (string) drroid["NUMBER"]) - { - cur = new AppIndItem(pr); - al.Add(cur); - retval++; - break; - } - } - if (cur==null) - { - retval++; - cur = new AppIndItem(null); - } - } - - // is this ROID already in the conflict list. - inlist = false; - foreach (AppConflict aco in cur.ConflictList) - { - if (aco.CType == AppConflictTypes.RO) - { - AppROConflict raco = (AppROConflict) aco; - if (raco.ROID == roid) - { - inlist=true; - break; - } - } - } - - if (!inlist) - { - string val1 = (drroid["NUMBER"]==System.DBNull.Value)?null:(string)drroid["NUMBER"]; - string val2 = (drroid["SEQUENCE"]==System.DBNull.Value)?null:(string)drroid["SEQUENCE"]; - AppROConflict roc = new AppROConflict((VEO_DummySet)ps.Children[1],roid, val1, val2,wasModRO.IsImage,wasModRO.Val1,wasModRO.Val2); - cur.AddConflict(roc); - } - } - } - } - return retval; - } - - // For approve individual, update the approved version with the ro usages for the - // procedure or library defined by input 'WdNum'. 'ApNum' is the procedure number if - // this is a procedure - if libdoc this will be same as 'WdNum', in case of change - // in procedure number. - public static void FixROUsages(string WdPath, string ApprovedPath, string ApNum, string WdNum) - { - string appath=ApprovedPath+"\\usagero.dbf"; - try - { - vdb_ROUsage arousg = new vdb_ROUsage(appath); - - // remove ro usages from the approved ro usage file. ApNum will be null - // if this is a new procedure - in this case we don't need to remove anything - // from the approved usages file. - if (ApNum != null) - { - DataSet adset = arousg.GetSortedByProc("[NUMBER]=\'"+ApNum.Replace("'","''")+"\'"); - int ndr = adset.Tables[0].Rows.Count; - if (ndr>0) - { - int errs = arousg.DeleteSelected("[NUMBER]=\'"+ApNum.Replace("'","''")+"\'"); - if (errs>0) - { - MessageBox.Show("Error resolving transition records"); - return; - } - arousg.Pack(); - } - adset=null; - } - // now update the approved ro usages from data based on data in the working - // draft. - vdb_ROUsage rousg = new vdb_ROUsage(WdPath+"\\usagero.dbf"); - DataSet wdset = rousg.GetSortedByProc("[NUMBER] = \'"+WdNum.Replace("'","''")+"\'"); - if (wdset.Tables[0].Rows.Count>0) - { - int errs = rousg.InsertInto(WdPath+"\\"+ApprovedPath+"\\usagero.dbf","[NUMBER] = \'"+WdNum.Replace("'","''")+"\'"); - if (errs>0) - { - MessageBox.Show("Error resolving RO usage records."); - return; - } - } - wdset.Dispose(); - rousg=null; - arousg=null; - } - catch (Exception e) - { - MessageBox.Show("Could not approve ro usages for " + WdNum + ", "+e.Message); - return; - } - } - } - -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/RefList.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/RefList.cs deleted file mode 100644 index 9db801dd..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/RefList.cs +++ /dev/null @@ -1,121 +0,0 @@ -/********************************************************************************************* - * Copyright 2005 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: RefList.cs $ $Revision: 3 $ - * $Author: Jsj $ $Date: 7/21/06 2:59p $ - * - * $History: RefList.cs $ - * - * ***************** Version 3 ***************** - * User: Jsj Date: 7/21/06 Time: 2:59p - * Updated in $/LibSource/VEObject - * The File for Edit Depenencies was being created in the wrong place for - * VFW to find. - * - * ***************** Version 2 ***************** - * User: Kathy Date: 3/22/05 Time: 10:11a - * Updated in $/LibSource/VEObject - * clean up code - * - * ***************** Version 1 ***************** - * User: Kathy Date: 3/08/05 Time: 1:51p - * Created in $/LibSource/VEObject - * Approval - *********************************************************************************************/ -using System; -using System.IO; -using System.Text; -using System.Windows.Forms; -using Utils; - - -namespace VEObject -{ - /// - /// Summary description for RefList. - /// - /// The RefList class creates, reads, writes, and deletes a file - /// of the 'input' name to hold procedure numbers/sequence numbers that - /// represent dependencies that need to be addressed (i.e. removed) by - /// the user in the editor. This is either for resolving approve selected - /// conflicts or deleting a procedure with transitions. (actual current use is - /// for approve selected conflicts). - /// The contents of this file is read in and listed via the TranRefsDlg in vfw - /// for now, i.e. as long as vfw is the editor. - /// The 'input' file is created in the user's Temp directory when in multi-user - /// mode or in the procedure directory when a lock is set or when in single user \ - /// mode. - /// - public class RefList - { - private string FileName; - private string FromProcNum; - private FileStream FSRef; - private BinaryWriter BWRef; - private UserRunTime usrRunTime; - private long HeaderOffset; - private Int16 NumRefs; - - public RefList(string frmProcNum, string fname, UserRunTime urt) - { - FileName = fname; - usrRunTime=urt; - FromProcNum=frmProcNum; - NumRefs=0; - BWRef = null; - } - - public bool Create() - { - try - { -// Bug fix B2006-034 -// Note that ExeAdjust() needs to check for a lock set. -// When a lock is set, the xE7 char would act like the xE2 char in -// the ExeAdjust() function. -// This bug fix is taking advantage of the fact that lock must be set -// at the time the approval code reaches this logic. -// -// FSRef = new FileStream(usrRunTime.ExeAdjust("\xE7" + FileName),FileMode.Create,FileAccess.Write,FileShare.ReadWrite); - FSRef = new FileStream(usrRunTime.ExeAdjust("\xE2" + FileName),FileMode.Create,FileAccess.Write,FileShare.ReadWrite); - BWRef = new BinaryWriter(FSRef); - BWRef.Write(NumRefs); // Temporary holding for number of references - Int16 len = (Int16)FromProcNum.Length; - BWRef.Write(len); - byte[] btmp = Encoding.ASCII.GetBytes(FromProcNum); - BWRef.Write(btmp,0,len); - HeaderOffset = FSRef.Length; - } - catch (Exception e) - { - MessageBox.Show(e.Message); - return false; - } - return true; - } - - public void CloseFile() - { - if (BWRef != null) BWRef.Close(); - FSRef=null; - BWRef=null; - NumRefs=0; - HeaderOffset=0; - } - - public void WriteTotalNumRefs() - { - FSRef.Seek(0,System.IO.SeekOrigin.Begin); - BWRef.Write(NumRefs); - FSRef.Seek(0,System.IO.SeekOrigin.End); - } - - public void WriteRefLine(string refline) - { - byte[] btmp = Encoding.ASCII.GetBytes(refline); - BWRef.Write(btmp,0,100); - NumRefs++; - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/VEObject.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/VEObject.cs deleted file mode 100644 index 74a594f8..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/VEObject.cs +++ /dev/null @@ -1,810 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: VEObject.cs $ $Revision: 9 $ - * $Author: Jsj $ $Date: 8/30/06 10:04a $ - * - * $History: VEObject.cs $ - * - * ***************** Version 9 ***************** - * User: Jsj Date: 8/30/06 Time: 10:04a - * Updated in $/LibSource/VEObject - * Added Multi Procedure Data Checker - * - * ***************** Version 8 ***************** - * User: Kathy Date: 6/21/05 Time: 7:27a - * Updated in $/LibSource/VEObject - * edit for approve if from procset/procedures node - * - * ***************** Version 7 ***************** - * User: Kathy Date: 5/11/05 Time: 9:29a - * Updated in $/LibSource/VEObject - * approve menu from procedures tree node - * - * ***************** Version 6 ***************** - * User: Kathy Date: 4/21/05 Time: 10:24a - * Updated in $/LibSource/VEObject - * remove upgrade2005 define - * - * ***************** Version 5 ***************** - * User: Kathy Date: 3/22/05 Time: 10:14a - * Updated in $/LibSource/VEObject - * approve: remove revise menu enable - * - * ***************** Version 4 ***************** - * User: Kathy Date: 2/03/05 Time: 11:20a - * Updated in $/LibSource/VEObject - * Change 'DUMMY' node to 'TEMP' node (just in case user sees it) - * - * ***************** Version 3 ***************** - * User: Kathy Date: 1/31/05 Time: 11:06a - * Updated in $/LibSource/VEObject - * Fix B2005-005 (connection & delete directory errors). also, fix icon - * - * ***************** Version 2 ***************** - * User: Kathy Date: 10/25/04 Time: 10:24a - * Updated in $/LibSource/VEObject - * Fix B2004-049 - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:53a - * Created in $/LibSource/VEObject - *********************************************************************************************/ - -using System; -using System.Text; -using System.Collections; -using System.Windows.Forms; -using System.Runtime.InteropServices; -using Utils; -using VENetwork; -using VEMessageNS; - -namespace VEObject -{ - /// - /// VEObject namespace provides classes for the Volian Enterprises Objects DataRoot, DataPath, - /// Plant, Procedure Set, Procedures, Library Documents and Archives. - /// - /// This file has the base class, VEO_Base, which all other objects inherits from. - /// - - public enum VEObjectTypesDefs - { - Generic = 0, ProcedureSet = 1, Procedure = 2, Archive = 3, LibraryDoc =4, System = 5, Plant = 6, DummySet = 7 - }; - - public enum VEO_IconStates - { - Normal=0, LckByMe=1, LckByOther=2, LckPending=3, Empty=4 - }; - public enum ProcTypeOptions - { -// Standard=0, Background=1, Deviation=2, Slave=3 - Standard=0, Slave=1, Background=2, Deviation=3 - }; - public class VEO_Base - { - public int [] iconStates; - public int icon; - public string _Title; - public string _Location; - public ArrayList Children; - public Object parentObj; - public UserRunTime usrRunTime; - public bool isOpen; - private bool Expanded; - public bool IsEmpty; - public int VEObjectType; - public bool isNew; - public bool AllowListViewSort; - public VELock Lock; - public VEConnection Connection; - public TreeNode treeNode; - - public enum ProcColumnOptions - { - OneColumn=0, TwoColumn=1, ThreeColumn=2 - }; - public enum ArchiveTypeOptions - { - Full=0, Partial=1 - }; - - // constructor - public VEO_Base() - { - Expanded = false; - isOpen = false; - AllowListViewSort = false; - Children = new ArrayList(); - VEObjectType = (int)VEObjectTypesDefs.Generic; - } - - ~ VEO_Base() - { - if (Connection!=null) Connection.Exit(); - } - - public virtual void LoadLockInfo() - { - Lock = new VELock(_Location, usrRunTime==null?null:usrRunTime.myUserData, VENetwork.LockTypes.None); - } - - public virtual bool mnuAllowDelete() - { - return true; - } - - public virtual bool mnuAllowApprove() - { - return false; - } - - public virtual bool mnuAllowApproveSel() - { - return false; - } - - public virtual bool mnuAllowApproveAll() - { - return false; - } - - public virtual bool mnuAllowProperties() - { - return true; - } - - public virtual bool mnuAllowNew() - { - return true; - } - - public virtual bool mnuAllowUpdRO() - { - return false; - } - - public virtual bool mnuAllowClean() - { - return false; - } - - public virtual bool mnuAllowDataCheck() - { - return false; - } - - public virtual bool mnuAllowChgDef() - { - return false; - } - - public virtual bool mnuAllowUpdateArch() - { - return false; - } - - public virtual bool mnuAllowTestArchive() - { - return false; - } - - public virtual bool mnuAllowExtractArch() - { - return false; - } - public virtual bool mnuAllowLckDB() - { - return false; - } - public virtual bool mnuAllowUnlckDB() - { - return false; - } - public virtual bool mnuAllowMonUsr() - { - if (usrRunTime.InMultiUserMode && !(Lock.LockType==VENetwork.LockTypes.None) && - !(Lock.LockStatus==VENetwork.Status.LockedByOther)) return true; - return false; - } - public virtual bool canEdit() - { - return true; - } - // used to flag whether all siblings of a node should be collapsed before expanding the - // node. This is needed for multi-user support for the plant & procedure set levels so - // that a user does not have open connections all over the tree. - public virtual bool CollapseSibling() - { - return false; - } - public virtual bool amILockedByMe() - { - // if not a newtork serial number, treat it as anything is locked. - if (!usrRunTime.InMultiUserMode)return true; - VEO_Base obj = this; - while (obj!=null) - { - if (obj.Lock.LockStatus == VENetwork.Status.Locked) return true; - obj = (VEO_Base) obj.parentObj; - } - return false; - } - public virtual bool isProcSet() - { - return false; - } - - public virtual bool isArchiveSet() - { - return false; - } - - public virtual bool updateROValues() - { - return false; - } - - public virtual void CleanTransitionsAndROsUsages(int clntype,string ProcName) - { - return; - } - - public virtual void ApproveProcedures(int ApproveType, ArrayList prcs) - { - return; - } - - public virtual void DataIntegrityCheck(string ProcName) - { - return; - } - - // Add TreeNodes to the input TreeNode parent. - public virtual void AddToTree(TreeNode parentnd) - { - for(int i=0; i0) veo.Children.Clear(); - if (nd.Nodes.Count>0) nd.Nodes.Clear(); - veo.Read(false); - veo.AddToTree(nd); - } - - // if the object can have a lock at this level, but it currently doesnot - // have a lock, if it has children add a temp node to the treeview. This - // is done so that if this becomes expanded, the lock is checked again. - else if (veo.Lock.LockStatus!=VENetwork.Status.LockedByOther) - { - veo.Read(true); - if (veo.Children.Count>0) - { - veo.Children.Clear(); - TreeNode dmy = new TreeNode("TEMP"); - nd.Nodes.Add(dmy); - } - } - - // if multi-user serial number, may have to reset lock status icon. - if (usrRunTime.InMultiUserMode) - { - // if no lock & emtpy, show empty. Otherwise, show lock icon - if (IsEmpty && veo.Lock.LockStatus==VENetwork.Status.NoLock) - veo.icon = veo.iconStates[(int)VEO_IconStates.Empty]; - else - veo.icon = veo.iconStates[(int)veo.Lock.LockStatus]; - nd.ImageIndex = veo.icon; - nd.SelectedImageIndex = veo.icon; - } - } - - // When the user collapses the treenode, also, do some object cleanup. - // This removes children, exits connections for all sub-tree children - // and also refreshes locks, updates icons based on lock changes and - // load in children at the current node level. - public void Collapse(TreeNode nd, TreeViewAction act, bool dorefresh,bool closeconn) - { - Expanded=false; - Children.Clear(); - if (Connection != null && closeconn) Connection.Exit(); - - // if this is the actual node that was collapsed, then refresh at this level, - // i.e. refresh the lock, update the icon (in case of lock status change) - // and load children (may make into temp child if necessary) - if (act == TreeViewAction.Collapse||dorefresh) { - RefreshTreeNode(nd); - // need to exit again because refresh tree node opens the connection - // to determine locking status. - if (Connection != null && closeconn) Connection.Exit(); - } - } - - // Expand the TreeNode. This makes a new/reenters connection at the level, sets up - // icons for the level, enters it by loading its children (if it successfully - // entered it, i.e. it's not locked. - public virtual bool Expand(TreeNode mytreend) - { - if (Connection==null) - Connection = new VEConnection(Lock, usrRunTime); - // Enter the connection, i.e. refresh the lock & then see if can get into the - // data level. - bool canenter = Connection.Enter(false); - // update icons (in case of lock status change) - if (usrRunTime.InMultiUserMode) - { - // if no lock & emtpy, show empty. Otherwise, show lock icon - if (IsEmpty && Lock.LockStatus==VENetwork.Status.NoLock) - icon = iconStates[(int)VEO_IconStates.Empty]; - else - icon = iconStates[(int)Lock.LockStatus]; - mytreend.ImageIndex = icon; - mytreend.SelectedImageIndex = icon; - } - // if user cannot enter, it must be locked. Return a false. - if (canenter==false) - { - Collapse(mytreend,TreeViewAction.Unknown,true,false); - mytreend.Nodes.Clear(); - mytreend.TreeView.Refresh(); - return false; - } - if (Expanded) return true; - Expanded = true; - - // load the children. First check for either no children (in case this was locked on - // load, and then subsequently unlocked before the selection or check for a 'TEMP' - // node. If it exists, remove it. Then if this has a lock type of none, load it's - // children. Otherwise, load a temp child under each child. The temp child is - // used because when the user actually expands this node, a recheck of the lock - // status is needed and a change may have occurred (another user may have added, - // deleted or modified children by the time this is entered). - TreeNode frstchld = mytreend.FirstNode; - if (frstchld==null || frstchld.Text == "TEMP") - { - mytreend.Nodes.Clear(); - Read(false); - AddToTree(mytreend); - } - VEO_Base veo; - for (int i=0; i0) - { - veo.Children.Clear(); - TreeNode dmy = new TreeNode("TEMP"); - mytreend.Nodes[i].Nodes.Add(dmy); - } - } - } - return true; - } - - public virtual void LockedDlg() - { - } - - // virtual read - public virtual bool Read(bool dummy) - { - return true; - } - - // virtual write - public virtual bool Write() - { - return false; - } - - public virtual bool Open() - { - return false; - } - - public virtual bool Close() - { - return false; - } - - // virtual cancel write (save) - public virtual void CancelWrite() - { - } - - public virtual bool Delete() - { - return true; - } - - // make a new plain vanilla object (this is really a virtual. - public virtual Object MakeNewChild() - { - return (new Object()); - } - - public virtual Object Copy() - { - return this; //default to returning self - } - - public virtual Object AddNewChild() - { - VEO_Base newobj = (VEO_Base) this.MakeNewChild(); - if (newobj==null) return null; // something happened, just return - newobj.parentObj = (VEO_Base) this; - newobj.isNew=true; - bool prpchg = newobj.PropertiesDlg(this); - if (prpchg == true) - { - // Copy is used so that a VEO-object is created that has editable - // (versus new) properties. When the object is 'new' many fields - // are editable that should not be editable when not new (this is - // mainly an issue with the property grid, since the ReadOnly - // setting can only be done at compile/build time - it CANNOT be - // done at run-time. So when a new object is created, if it's - // successful, it's copied to an object which is edit (not new) - // for the treeview & any further operations. - VEO_Base cpyobj = (VEO_Base) newobj.Copy(); - Children.Add(cpyobj); // add the new one to the children - if(newobj!=cpyobj)Children.Remove(newobj); - cpyobj.Read(false); // read any child data - return cpyobj; - } - else - return null; - } - - public virtual string GetTreeNodeText() - { - return _Title; - } - - public virtual bool SaveChild(Object obj) - { - return false; - } - - // virtual SaveNew - public virtual bool SaveNew(string pth) - { - return false; - } - - public virtual void DoListView(ListView veoListView) - { - return; - } - - public virtual void DoWizzard() - { - return; - } - - // Comunication between this object & vfw - struct COPYDATASTRUCT - { - public IntPtr dwData; - public int cbData; - public IntPtr lpData; - } - const int WM_COPYDATA = 0x004A; - - // sending side - [DllImport("user32.dll")] - static extern bool SendMessage( - IntPtr hWnd, - UInt32 Msg, - UInt32 wParam, - ref COPYDATASTRUCT lParam); - - public struct RqstAttachMsg - { - public Int16 level; - public Int16 flag; - public Int32 longval; - } - - public struct AnswerMsg - { - public Int16 done; - public Int16 intAnswer; - public Int32 longAnswer; - } - - public struct PRecordMsg - { - public Int16 done; - public Int16 cnt; - [MarshalAs(UnmanagedType.ByValTStr,SizeConst=140)] public String buff; - } - - [StructLayout(LayoutKind.Sequential)] - public struct PosUpdateStr - { - [MarshalAs(UnmanagedType.ByValTStr,SizeConst=16)] public String sender; - [MarshalAs(UnmanagedType.ByValTStr,SizeConst=80)] public String directory; - public Int32 docnumindx; - public Int32 recID; - } - - private VEO_Base GetObjectAtLevel(int level) - { - try - { - VEO_Base veo = this; - while (veo != null) - { - if (level == 2 && veo.VEObjectType == (int)VEObjectTypesDefs.ProcedureSet) - return veo; - else if (level == 1 && veo.VEObjectType == (int)VEObjectTypesDefs.Plant) - return veo; - else if (level == 0 && veo.VEObjectType == (int)VEObjectTypesDefs.System) - return veo; - veo = (VEO_Base)veo.parentObj; - } - } - catch (Exception e) - { - MessageBox.Show(e.Message.ToString()); - } - return null; - } - - private bool ReturnProcRecord(VEO_Base veo,Int16 size, IntPtr vfwhndl) - { - bool success=true; - COPYDATASTRUCT cds = new COPYDATASTRUCT(); - PRecordMsg prmsg; - prmsg.done = 1; - - byte [] bt = new byte[size+4]; - prmsg.cnt = veo.Connection.GetProcRecBuff(size, ref bt); - if (prmsg.cnt != size) - { - MessageBox.Show("Could not read multi-user connection information"); - return false; - } - prmsg.buff = Encoding.ASCII.GetString(bt,0,size); - IntPtr p = Marshal.AllocHGlobal(size+4); - Marshal.StructureToPtr(prmsg,p,true); - - cds.dwData = (IntPtr)VEMessageNS.MessageOps.GETPROCESSREC; - // the following would be 'size+4', however marshalling requires space to be - // a multiple of 8 - cds.cbData = 160; - cds.lpData = p; - try - { - SendMessage(vfwhndl,WM_COPYDATA,(UInt32)8, ref cds); - } - catch (Exception e) - { - MessageBox.Show(e.Message.ToString()); - success=false; - } - Marshal.FreeHGlobal(p); - return success; - } - - private bool Reply(Int16 done, Int16 intAnswer, Int32 longAnswer, IntPtr vfwhndl) - { - bool success=true; - COPYDATASTRUCT cds = new COPYDATASTRUCT(); - AnswerMsg ans; - ans.done = done; - ans.intAnswer = intAnswer; - ans.longAnswer = longAnswer; - - IntPtr p=Marshal.AllocHGlobal(8); - Marshal.StructureToPtr(ans,p,true); - - cds.dwData = (IntPtr)VEMessageNS.MessageOps.GETANSWER; - cds.cbData = 8; - cds.lpData = p; - try - { - SendMessage(vfwhndl,WM_COPYDATA,(UInt32)8, ref cds); - } - catch (Exception e) - { - MessageBox.Show(e.Message.ToString()); - success=false; - } - Marshal.FreeHGlobal(p); - return success; - } - - public virtual void ProcessMessage(Message m, IntPtr vfwhndl) - { - VEO_Base veo = null; - bool success=false; - - if (m.Msg==(int)VEMessageNS.MessageOps.POSQUERY) - { - // POSQUERY is only called to get initial procedure - make the main - // form invisible when this request is made. Wait until now so that - // the main form is visible until vfw window is just about to be - // made visible. - IntPtr handle = - System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle; - Form mainForm = (Form)Form.FromHandle(handle); - mainForm.Visible = false; - - COPYDATASTRUCT cds = new COPYDATASTRUCT(); - PosUpdateStr pu; - pu.sender = "NEWBROWSER"; - VEO_Proc prc = null; - if (!(this is VEO_Proc)) - { - // get to a proc, this is either a set or 'procedures' node - // from an approve selected. - VEO_ProcSet ps = null; - if (this is VEO_ProcSet) - ps = (VEO_ProcSet) this; - else if (this is VEO_DummySet) - ps = (VEO_ProcSet) this.parentObj; - else - { - MessageBox.Show("Error finding procedure for edit","VE-PROMS"); - return; - } - prc=ps.AppSelForEdit; - } - else - prc = (VEO_Proc) this; - VEO_DummySet ds = (VEO_DummySet) prc.parentObj; - pu.directory = ds._Location; - pu.docnumindx = ds.Children.IndexOf(prc); - pu.recID = System.Convert.ToInt32(prc.recid,10); - - IntPtr p=Marshal.AllocHGlobal(130); - Marshal.StructureToPtr(pu,p,true); - - cds.dwData = (IntPtr)VEMessageNS.MessageOps.POSUPDATE; - cds.cbData = 130; - cds.lpData = p; - try - { - SendMessage(vfwhndl,WM_COPYDATA,(UInt32)8, ref cds); - } - catch (Exception e) - { - MessageBox.Show(e.Message.ToString()); - } - Marshal.FreeHGlobal(p); - } - else if (m.Msg==WM_COPYDATA) - { - bool reply = true; - Int16 int1=0, int2=0; - int int3=0; - int lvl = 0; - COPYDATASTRUCT cds = (COPYDATASTRUCT) m.GetLParam(typeof(COPYDATASTRUCT)); - int tmpmsg = (int)cds.dwData; - VEMessageNS.MessageOps msg = (VEMessageNS.MessageOps) tmpmsg; - RqstAttachMsg ramsg = (RqstAttachMsg)Marshal.PtrToStructure(cds.lpData,typeof(RqstAttachMsg)); - // get level veobject associated with this request, i.e. system, plant, or procset - // and then connect at level - lvl = ramsg.level; - try - { - veo = GetObjectAtLevel(lvl); - switch (msg) - { - case VEMessageNS.MessageOps.RQSTATTACH: - success = veo.Connection.Enter(false); - int2 = (short)(success?1:0); - break; - case VEMessageNS.MessageOps.RQSTFILEOFFSET: - if (ramsg.flag==0) - int3 = (int)veo.Connection.FileOffset; - //else - // MessageBox.Show("Set file offset" + ramsg.longval.ToString()); - break; - case VEMessageNS.MessageOps.RQSTFILEMODE: - int2 = (short) veo.Connection.GetVfwMode(); - break; - case VEMessageNS.MessageOps.RQSTFILEOWNER: - int2 = 1; - break; - case VEMessageNS.MessageOps.RQSTFILESEEK: - int3 = (int)veo.Connection.Seek(ramsg.longval, ramsg.flag); - break; - case VEMessageNS.MessageOps.RQSTFILECLOSE: //used in lock/unlock - veo.Connection.Close(); - break; - case VEMessageNS.MessageOps.RQSTFILEOPEN: //used in lock/unlock - int2 = (short) veo.Connection.Open(ramsg.flag); - break; - // RQSTFILEREAD - not used in vfw <-> browser communication - case VEMessageNS.MessageOps.RQSTFILEREAD: - MessageBox.Show("RqstFileRead"); - break; - case VEMessageNS.MessageOps.RQSTFILEWRITE: //used in lock/unlock - MessageBox.Show("RqstFileWrite"); - break; - case VEMessageNS.MessageOps.RQSTPROCESSRECORD: - reply=false; - success=ReturnProcRecord(veo,ramsg.flag,vfwhndl); - break; - case VEMessageNS.MessageOps.SETLOCKBYUSER: //do set lock yet. - if (ramsg.flag >= 0) - { - if (ramsg.flag==0) - veo.Lock.LockStatus=VENetwork.Status.NoLock; - else - veo.Lock.LockStatus=VENetwork.Status.Locked; - } - int2 = (Int16)((veo.Lock.LockStatus==VENetwork.Status.Locked)?1:0); - break; - } - if (reply) success = Reply(int1,int2,int3,vfwhndl); - } - catch (Exception e) - { - MessageBox.Show(e.Message); - } - } - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/VEObject.csproj b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/VEObject.csproj deleted file mode 100644 index 76ad01e3..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/VEObject.csproj +++ /dev/null @@ -1,298 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/VEObject.sln b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/VEObject.sln deleted file mode 100644 index f4348455..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VEObject/VEObject.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VEObject", "VEObject.csproj", "{9EB41ACC-03B1-4349-86F6-F9165AD77B57}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {9EB41ACC-03B1-4349-86F6-F9165AD77B57}.Debug.ActiveCfg = Debug|.NET - {9EB41ACC-03B1-4349-86F6-F9165AD77B57}.Debug.Build.0 = Debug|.NET - {9EB41ACC-03B1-4349-86F6-F9165AD77B57}.Release.ActiveCfg = Release|.NET - {9EB41ACC-03B1-4349-86F6-F9165AD77B57}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/AssemblyInfo.cs deleted file mode 100644 index c713863a..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/AssemblyInfo.cs.bak deleted file mode 100644 index 9f89a328..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/App.ico b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/App.ico deleted file mode 100644 index 3a5525fd794f7a7c5c8e6187f470ea3af38cd2b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1078 zcmeHHJr05}7=1t!Hp3A*8IHkVf+j?-!eHY14Gtcw1Eb*_9>Bq^zETJ@GKj{_2j4$w zo9}xCh!8{T3=X##Skq>ikMjsvB|y%crWBM2iW(4pI}c%z6%lW!=~4v77#3{z!dmB1 z__&l)-{KUYR+|8|;wB^R|9ET$J@(@=#rd^=)qs85?vAy(PSF5CyNkus435LVkZ$rj zNw|JG-P7^hF<(;#o*Vk}5R#e|^13tBbQkeF?djULtvqyxd3<{9 diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/AssemblyInfo.cs deleted file mode 100644 index c713863a..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/AssemblyInfo.cs.bak deleted file mode 100644 index 4e8fc68e..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/AssemblyInfo.cs.bak +++ /dev/null @@ -1,56 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/Form1.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/Form1.cs deleted file mode 100644 index b3876a6c..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/Form1.cs +++ /dev/null @@ -1,227 +0,0 @@ -/********************************************************************************************* - * Copyright 2005 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: Form1.cs $ $Revision: 1 $ - * $Author: Kathy $ $Date: 12/06/05 12:06p $ - * - * $History: Form1.cs $ - * - * ***************** Version 1 ***************** - * User: Kathy Date: 12/06/05 Time: 12:06p - * Created in $/LibSource/VG/Test - * - * ***************** Version 1 ***************** - * User: Kathy Date: 12/06/05 Time: 12:01p - * Created in $/LibSource/VG.root/VG/Test - *********************************************************************************************/ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Data; -using System.Xml; -using System.IO; -using VG; -using C1.C1Pdf; - -namespace TestVG -{ - /// - /// Summary description for Form1. - /// - public class Form1 : System.Windows.Forms.Form - { - private System.Windows.Forms.Button button1; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private System.Windows.Forms.ListBox listBox1; - private System.Windows.Forms.Button button2; - private int ConvertToTwips = 1440; - public Form1() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - // - // TODO: Add any constructor code after InitializeComponent call - // - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.button1 = new System.Windows.Forms.Button(); - this.listBox1 = new System.Windows.Forms.ListBox(); - this.button2 = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // button1 - // - this.button1.Location = new System.Drawing.Point(24, 8); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(72, 32); - this.button1.TabIndex = 0; - this.button1.Text = "SVG To PDF"; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // listBox1 - // - this.listBox1.Location = new System.Drawing.Point(24, 72); - this.listBox1.Name = "listBox1"; - this.listBox1.Size = new System.Drawing.Size(584, 381); - this.listBox1.TabIndex = 1; - // - // button2 - // - this.button2.Location = new System.Drawing.Point(544, 8); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(56, 32); - this.button2.TabIndex = 2; - this.button2.Text = "Exit"; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // Form1 - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(752, 494); - this.Controls.Add(this.button2); - this.Controls.Add(this.listBox1); - this.Controls.Add(this.button1); - this.Name = "Form1"; - this.Text = "Form1"; - this.ResumeLayout(false); - - } - #endregion - - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.Run(new Form1()); - } - - private void button1_Click(object sender, System.EventArgs e) - { - listBox1.Items.Clear(); - DirectoryInfo di = new DirectoryInfo("E:\\proms.net\\genmac.xml"); - FileInfo[] fis = di.GetFiles("*.svg"); - foreach (FileInfo fi in fis) - { - this.listBox1.Items.Add(fi.Name); - //TestSvgToPdf("E:\\proms.net\\genmac.xml",fi.Name); - VG.Page pg = new Page(true, 0.5f * ConvertToTwips, 0.5f * ConvertToTwips); - XmlDocument xmldoc = new XmlDocument(); - XmlTextReader reader = new XmlTextReader("E:\\proms.net\\genmac.xml\\"+fi.Name); - xmldoc.Load(reader); - reader.Close(); - try - { - GeneratePDFForSVGFile(xmldoc, fi.Name, pg); - } - catch (Exception ex) - { - MessageBox.Show("Error processing: " + fi.Name, ex.Message); - } - } - MessageBox.Show("DONE generating PDF files from SVG"); - } - - private void GeneratePDFForSVGFile(XmlDocument xmldoc, string fname, VG.Page pg) - { - C1.C1Pdf.C1PdfDocument c1pdf = new C1.C1Pdf.C1PdfDocument(); - string rootname = fname.Substring(0,fname.Length-4); - // create a pdf file with a page for each macro (i.e. macro element in xml tree), - // put it into the pdf file. - XmlNode topnode = xmldoc.LastChild; - for (int i=0;i - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - False - - - Private - - - Private - - - Private - - - False - - - Private - - - False - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - Form1 - - - True - - - 80 - - - True - - - Private - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/Test.csproj b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/Test.csproj deleted file mode 100644 index e47a1e38..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/Test.csproj +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/Test.csproj.bak b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/Test.csproj.bak deleted file mode 100644 index 009eca3c..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/Test.csproj.bak +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/licenses.licx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/licenses.licx deleted file mode 100644 index 984ec9ad..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/Test/licenses.licx +++ /dev/null @@ -1 +0,0 @@ -C1.C1Pdf.C1PdfDocument, C1.C1Pdf, Version=1.1.20052.40, Culture=neutral, PublicKeyToken=bc8d9c59cf1b601f diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/VG.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/VG.cs deleted file mode 100644 index 38139d75..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/VG.cs +++ /dev/null @@ -1,365 +0,0 @@ -/********************************************************************************************* - * Copyright 2005 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: VG.cs $ $Revision: 2 $ - * $Author: Jsj $ $Date: 2/28/06 1:33p $ - * - * $History: VG.cs $ - * - * ***************** Version 2 ***************** - * User: Jsj Date: 2/28/06 Time: 1:33p - * Updated in $/LibSource/VG - * updated for X/Y Plots - * - * ***************** Version 1 ***************** - * User: Kathy Date: 12/06/05 Time: 12:06p - * Created in $/LibSource/VG - * - * ***************** Version 1 ***************** - * User: Kathy Date: 12/06/05 Time: 12:01p - * Created in $/LibSource/VG.root/VG - *********************************************************************************************/ -using System; -using System.Xml; -using System.Drawing; -using System.Text; -using C1.C1Pdf; - -namespace VG -{ - /// - /// VG is the class representing vector graphics. It provides objects for: - /// Line, Rectangle, Text, Ellipse, Bitmaps, etc. - /// VG provides constructors for these objects from coordinate system locations - /// (such as starting x,y ending x,y, etc), xml and svg. - /// VG provides output to PDF. (More can be added). - /// VG data is stored in TWIPS (1440 per inch) - /// - - // Temporary page class to store portrait/landscape, Left Margin, Vertical offset, etc - public class Page - { - public bool portrait=true; - public float LeftMargin=0f; - public float VertOffset=0f; - public Page(bool iport, float lm, float voff) - { - portrait=iport; - LeftMargin=lm; - VertOffset=voff; - } - } - - public class VG - { - // Values of vector graphics items are stored as twips (1440 twips in an inch) - public int cx; - public int cy; - public int dx; - public int dy; - public float lnwid; - public Page pg; - public bool MoveAbsolute; // TODO: Not sure what to do with this. - - public VG() - { - cx = 0; - cy = 0; - dx = 0; - dy = 0; - MoveAbsolute = false; - pg=null; - } - - public VG(int sx, int sy, int ex, int ey, bool ima, Page ipg) - { - cx = sx; - cy = sy; - dx = ex; - dy = ey; - MoveAbsolute = ima; - pg=ipg; - } - - public float ToPoints(float twip) - { - float r = ((float)twip) * 0.05f; - return r; - } - - public void UpdatePageInfo(Page pa) - { - pg.LeftMargin=pa.LeftMargin; - pg.portrait=pg.portrait; - pg.VertOffset=pg.VertOffset; - } - - public string AddRTFBUI(string origStr, string bold, string underline, string italics) - { - if (bold==""&&underline==""&&italics=="")return origStr; - StringBuilder sb = new StringBuilder(); - if (bold == "bold")sb.Append("{\\b"); - if (underline == "underline")sb.Append("{\\u"); - if (italics == "italics") sb.Append("{\\i"); - sb.Append(" "); - sb.Append(origStr); - if (bold == "bold")sb.Append("}"); - if (underline == "underline")sb.Append("}"); - if (italics == "italics") sb.Append("}"); - return sb.ToString(); - } - } - - public class VG_Line : VG - { - // Line is defined as starting & ending points. - public VG_Line(int sx, int sy, int ex, int ey, int w, Page ipg) - { - cx = sx; - cy = sy; - dx = ex; - dy = ey; - lnwid = w; - pg=ipg; - } - - public VG_Line(XmlElement svg, Page ipg) - { - cx = System.Convert.ToInt32(svg.GetAttribute("x1")); - cy = System.Convert.ToInt32(svg.GetAttribute("y1")); - dx = System.Convert.ToInt32(svg.GetAttribute("x2")); - dy = System.Convert.ToInt32(svg.GetAttribute("y2")); - lnwid = System.Convert.ToInt32(svg.GetAttribute("stroke-width")); - pg = ipg; - } - - public void ToPdf(C1PdfDocument c1pdf) - { - float startx = pg.portrait ? (cx + pg.LeftMargin): (pg.VertOffset + cy); - float starty = pg.portrait ? (cy + pg.VertOffset): (pg.LeftMargin - cx); - float endx = pg.portrait ? (dx + pg.LeftMargin): (pg.VertOffset + dy); - float endy = pg.portrait ? (dy + pg.VertOffset): (pg.LeftMargin - dx); - Pen pn = new Pen(Brushes.Black,ToPoints(lnwid)); - c1pdf.DrawLine(pn, ToPoints(startx), ToPoints(starty), ToPoints(endx), ToPoints(endy)); - } - - } - - public class VG_Rect : VG - { - // Rectangle is defined as starting point & length/width - public VG_Rect(int sx, int sy, int ex, int ey, int w, Page ipg) - { - cx = sx; - cy = sy; - dx = ex; - dy = ey; - lnwid = w; - pg = ipg; - } - - public VG_Rect(XmlElement svg, Page ipg) - { - cx = System.Convert.ToInt32(svg.GetAttribute("x")); - cy = System.Convert.ToInt32(svg.GetAttribute("y")); - dx = System.Convert.ToInt32(svg.GetAttribute("width")); - dy = System.Convert.ToInt32(svg.GetAttribute("height")); - lnwid = System.Convert.ToInt32(svg.GetAttribute("stroke-width")); - pg = ipg; - } - - public void ToPdf(C1PdfDocument c1pdf) - { - Pen pn = new Pen(Brushes.Black,ToPoints(lnwid)); - - float startx = pg.portrait ? (cx + pg.LeftMargin): (pg.VertOffset + cy) ; - float starty = pg.portrait ? (cy + pg.VertOffset): (pg.LeftMargin - cx); - float endx = pg.portrait ? dx: dy; - float endy = pg.portrait ? dy: dx; - RectangleF rc = new RectangleF(ToPoints(startx), ToPoints(starty), ToPoints(endx), ToPoints(endy)); - c1pdf.DrawRectangle(pn,rc); - } - } - - public class VG_Image : VG - { - private int Scale; - private string FileName; - - // Image is defined as starting point, scale factor (defaults to 1) & image file name - public VG_Image(int sx, int sy, int iscale, string fname) - { - cx = sx; - cy = sy; - Scale = 1; - FileName = fname; - } - - public VG_Image(XmlElement svg, Page ipg) - { - cx = System.Convert.ToInt32(svg.GetAttribute("x")); - cy = System.Convert.ToInt32(svg.GetAttribute("y")); - Scale=1; - if (svg.HasAttribute("scale")) Scale = System.Convert.ToInt32(svg.GetAttribute("scale")); - FileName = svg.GetAttribute("bname"); - pg = ipg; - } - - public void ToPdf(C1PdfDocument c1pdf) - { - Pen pn = new Pen(Brushes.Black,lnwid); - Bitmap bm = new Bitmap(FileName); - RectangleF rc = new RectangleF(); - rc.Height = ToPoints((bm.Height*Scale)*4.8f); - rc.Width = ToPoints((bm.Width*Scale)*4.8f); - rc.X = ToPoints(pg.LeftMargin+cx); - rc.Y = ToPoints(pg.VertOffset+cy); - c1pdf.DrawImage(bm, rc, ContentAlignment.MiddleCenter, ImageSizeModeEnum.Scale); - } - } - - public class VG_Ellipse : VG - { - // Ellipse (circle) is defined by a bounding rectangle specified by a coordinate pair, a width, and a height - public VG_Ellipse(int sx, int sy, int ex, int ey, int w, Page ipg) - { - cx = sx; - cy = sy; - dx = ex; - dy = ey; - lnwid = w; - pg = ipg; - } - - public VG_Ellipse(XmlElement svg, Page ipg) - { - cx = System.Convert.ToInt32(svg.GetAttribute("cx")); - cy = System.Convert.ToInt32(svg.GetAttribute("cy")); - dx = System.Convert.ToInt32(svg.GetAttribute("rx")); - dy = System.Convert.ToInt32(svg.GetAttribute("ry")); - lnwid = System.Convert.ToInt32(svg.GetAttribute("stroke-width")); - pg = ipg; - } - - public void ToPdf(C1PdfDocument c1pdf) - { - Pen pn = new Pen(Brushes.Black,ToPoints(lnwid)); - c1pdf.DrawEllipse(pn,ToPoints(pg.LeftMargin+cx), ToPoints(pg.VertOffset+cy), ToPoints(dx), ToPoints(dy)); - } - } - - public class VG_Text : VG - { - private string FontName; - private int FontSize; - private string Bold; - private string Underline; - private string Italics; - private string Text; - - // Text is defined by a starting location, attributes & the string - public VG_Text(int sx, int sy, int fs, string txt, string fn, string ibold, string iunder, string iitalics, Page ipg) - { - cx = sx; - cy = sy; - FontSize = fs; - FontName = fn; - Text = txt; - Bold = ibold; - Underline = iunder; - Italics = iitalics; - pg = ipg; - // TODO: The following were in the 16-bit code - we may need to use these, wait and see -// strokeWidth = stroke; -// strokeWidthBold = strokebold; -// ULOffset = UnderlineOffset; -// ULWidth = UnderlineWidth; - } - - public VG_Text(XmlElement svg, Page ipg) - { - cx = System.Convert.ToInt32(svg.GetAttribute("x")); - cy = System.Convert.ToInt32(svg.GetAttribute("y")); - FontSize = System.Convert.ToInt32(svg.GetAttribute("font-size")); - Bold = svg.GetAttribute("font-weight"); - Underline = svg.GetAttribute("text-decoration"); - Italics = svg.GetAttribute("font-style"); - FontName = svg.GetAttribute("font-family"); - Text = svg.InnerText; - pg = ipg; - } - - public void ToPdf(C1PdfDocument c1pdf) - { - Font myfont = new Font(FontName,FontSize); - RectangleF rc = new RectangleF(); - // the returned value from c1 pdf code is already in points, - // so need to convert the size. - rc.Size = c1pdf.MeasureStringRtf(Text,myfont,500); // TODO: 500 or pagewidth, or what - rc.X = ToPoints(pg.LeftMargin+cx); - rc.Y = ToPoints(pg.VertOffset+cy)-FontSize; - // add bold, underline & italics for entire object. - string rtfout = AddRTFBUI(Text,Bold,Underline,Italics); - c1pdf.DrawStringRtf(rtfout,myfont,Brushes.Black,rc); - } - } -public class VG_Arc : VG - { - public Single sweepAngle; - public Single startAngle; - public float stX,stY; - public float rWid,rHgt; -#if DEBUG - public static int iColor=0; - public Color [] myColors={Color.Red,Color.Orange,Color.Yellow,Color.Green,Color.Blue,Color.BlueViolet,Color.Violet}; -#endif - // Arc is defined by a bounding rectangle specified by a coordinate pair, a width, and a height - public VG_Arc(float sx, float sy, float width, float hight, float stAngle, float swpAngle, int w, Page ipg) - { - stX = sx; - stY = sy; - rWid = width; - rHgt = hight; - startAngle = stAngle; -// startAngle = 90; - sweepAngle = swpAngle; -// sweepAngle = -45; - lnwid = w; - pg = ipg; - } - -// public VG_Arc(XmlElement svg, Page ipg) -// { -// cx = System.Convert.ToInt32(svg.GetAttribute("cx")); -// cy = System.Convert.ToInt32(svg.GetAttribute("cy")); -// dx = System.Convert.ToInt32(svg.GetAttribute("rx")); -// dy = System.Convert.ToInt32(svg.GetAttribute("ry")); -// lnwid = System.Convert.ToInt32(svg.GetAttribute("stroke-width")); -// pg = ipg; -// } - - public void ToPdf(C1PdfDocument c1pdf) - { -// Pen pn = new Pen(Brushes.Black,ToPoints(lnwid)); -#if DEBUG - Pen pn = new Pen(myColors[iColor],ToPoints(lnwid)); - iColor=(iColor+1)%myColors.Length; -#else - Pen pn = new Pen(Color.Black,ToPoints(lnwid)); -#endif -// PointF startpt = new PointF(stX,stY); -// SizeF recsize = new SizeF(rWid,rHgt); -// RectangleF rc = new RectangleF(startpt,recsize); - float startx = pg.portrait ? (stX + pg.LeftMargin): (pg.VertOffset + stY); - float starty = pg.portrait ? (stY + pg.VertOffset): (pg.LeftMargin - stX); - RectangleF rc = new RectangleF(ToPoints(startx),ToPoints(starty),ToPoints(rWid),ToPoints(rHgt)); -// c1pdf.DrawRectangle(pn,rc); //debug - -// c1pdf.DrawArc(new Pen(Color.Black,ToPoints(lnwid)),new RectangleF(stX,stY,rWid,rHgt),startAngle,sweepAngle); - c1pdf.DrawArc(pn,rc,startAngle,sweepAngle); - // c1pdf.DrawArc(new Pen(Color.Black, 4),rc,startAngle,sweepAngle); - } - } -} - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/VG.csproj b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/VG.csproj deleted file mode 100644 index d8b04682..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/VG.csproj +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/VG.sln b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/VG.sln deleted file mode 100644 index 7d514755..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VG/VG.sln +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VG", "VG.csproj", "{52D74078-3822-410E-889B-464BD21AAB9E}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{12299365-FD7A-458A-B1E0-574933F7A647}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {52D74078-3822-410E-889B-464BD21AAB9E}.Debug.ActiveCfg = Debug|.NET - {52D74078-3822-410E-889B-464BD21AAB9E}.Debug.Build.0 = Debug|.NET - {52D74078-3822-410E-889B-464BD21AAB9E}.Release.ActiveCfg = Release|.NET - {52D74078-3822-410E-889B-464BD21AAB9E}.Release.Build.0 = Release|.NET - {12299365-FD7A-458A-B1E0-574933F7A647}.Debug.ActiveCfg = Debug|.NET - {12299365-FD7A-458A-B1E0-574933F7A647}.Debug.Build.0 = Debug|.NET - {12299365-FD7A-458A-B1E0-574933F7A647}.Release.ActiveCfg = Release|.NET - {12299365-FD7A-458A-B1E0-574933F7A647}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/AssemblyInfo.cs deleted file mode 100644 index 7e3b35a5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/AssemblyInfo.cs.bak deleted file mode 100644 index a9833df8..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/AssemblyInfo.cs.bak +++ /dev/null @@ -1,57 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/VerRelCpy.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/VerRelCpy.cs deleted file mode 100644 index ca6bc028..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/VerRelCpy.cs +++ /dev/null @@ -1,249 +0,0 @@ -/********************************************************************************************* - * Copyright 2004 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: VerRelCpy.cs $ $Revision: 36 $ - * $Author: Jsj $ $Date: 1/02/08 1:38p $ - * - * $History: VerRelCpy.cs $ - * - * ***************** Version 36 ***************** - * User: Jsj Date: 1/02/08 Time: 1:38p - * Updated in $/LibSource/VerRelCpyrght - * upped copyright to 2008 - * - * ***************** Version 35 ***************** - * User: Jsj Date: 12/05/07 Time: 1:43p - * Updated in $/LibSource/VerRelCpyrght - * upped to release 21 - * - * ***************** Version 34 ***************** - * User: Jsj Date: 10/25/07 Time: 2:56p - * Updated in $/LibSource/VerRelCpyrght - * upped to 20 - * - * ***************** Version 33 ***************** - * User: Jsj Date: 9/26/07 Time: 2:55p - * Updated in $/LibSource/VerRelCpyrght - * Upped - * - * ***************** Version 32 ***************** - * User: Jsj Date: 7/13/07 Time: 1:29p - * Updated in $/LibSource/VerRelCpyrght - * upped release to 18 - * - * ***************** Version 31 ***************** - * User: Jsj Date: 6/29/07 Time: 11:13a - * Updated in $/LibSource/VerRelCpyrght - * upped releaes to 17 - * - * ***************** Version 30 ***************** - * User: Jsj Date: 6/20/07 Time: 8:46a - * Updated in $/LibSource/VerRelCpyrght - * upped release number to 16 - * - * ***************** Version 29 ***************** - * User: Jsj Date: 6/01/07 Time: 9:26a - * Updated in $/LibSource/VerRelCpyrght - * upped to release 15 - * - * ***************** Version 28 ***************** - * User: Jsj Date: 3/02/07 Time: 8:30a - * Updated in $/LibSource/VerRelCpyrght - * upped to 14 - * - * ***************** Version 27 ***************** - * User: Jsj Date: 1/02/07 Time: 1:54p - * Updated in $/LibSource/VerRelCpyrght - * upped copyright to 2007 - * - * ***************** Version 26 ***************** - * User: Jsj Date: 12/12/06 Time: 2:03p - * Updated in $/LibSource/VerRelCpyrght - * uppded to 13 - * - * ***************** Version 25 ***************** - * User: Jsj Date: 11/30/06 Time: 8:22a - * Updated in $/LibSource/VerRelCpyrght - * upped to 12 - * - * ***************** Version 24 ***************** - * User: Jsj Date: 11/09/06 Time: 11:33a - * Updated in $/LibSource/VerRelCpyrght - * upped release number - * - * ***************** Version 23 ***************** - * User: Jsj Date: 9/12/06 Time: 2:30p - * Updated in $/LibSource/VerRelCpyrght - * upped release number - * - * ***************** Version 22 ***************** - * User: Jsj Date: 7/24/06 Time: 12:04p - * Updated in $/LibSource/VerRelCpyrght - * upped to release 9 - * - * ***************** Version 21 ***************** - * User: Jsj Date: 7/06/06 Time: 10:18a - * Updated in $/LibSource/VerRelCpyrght - * upped - * - * ***************** Version 20 ***************** - * User: Jsj Date: 5/26/06 Time: 12:28p - * Updated in $/LibSource/VerRelCpyrght - * back to 7 - * - * ***************** Version 19 ***************** - * User: Jsj Date: 5/26/06 Time: 11:25a - * Updated in $/LibSource/VerRelCpyrght - * upped to release 8 - * - * ***************** Version 18 ***************** - * User: Jsj Date: 5/16/06 Time: 12:45p - * Updated in $/LibSource/VerRelCpyrght - * upped release to 7 - * - * ***************** Version 17 ***************** - * User: Kathy Date: 5/01/06 Time: 11:16a - * Updated in $/LibSource/VerRelCpyrght - * upped release number - * - * ***************** Version 16 ***************** - * User: Jsj Date: 1/03/06 Time: 9:10a - * Updated in $/LibSource/VerRelCpyrght - * upped copyright to year 2005 and upped release number - * - * ***************** Version 15 ***************** - * User: Jsj Date: 12/12/05 Time: 11:06a - * Updated in $/LibSource/VerRelCpyrght - * upped - * - * ***************** Version 14 ***************** - * User: Kathy Date: 10/03/05 Time: 10:59a - * Updated in $/LibSource/VerRelCpyrght - * upped release number to 3 - * - * ***************** Version 13 ***************** - * User: Kathy Date: 9/06/05 Time: 11:24a - * Updated in $/LibSource/VerRelCpyrght - * Up release number - * - * ***************** Version 12 ***************** - * User: Jsj Date: 7/27/05 Time: 2:09p - * Updated in $/LibSource/VerRelCpyrght - * release one - * - * ***************** Version 11 ***************** - * User: Kathy Date: 4/21/05 Time: 10:25a - * Updated in $/LibSource/VerRelCpyrght - * update rev - * - * ***************** Version 10 ***************** - * User: Jsj Date: 4/12/05 Time: 8:46a - * Updated in $/LibSource/VerRelCpyrght - * uppded - * - * ***************** Version 9 ***************** - * User: Jsj Date: 3/30/05 Time: 11:15a - * Updated in $/LibSource/VerRelCpyrght - * upped - * - * ***************** Version 8 ***************** - * User: Jsj Date: 3/16/05 Time: 2:46p - * Updated in $/LibSource/VerRelCpyrght - * upped release to 7 - * - * ***************** Version 7 ***************** - * User: Kathy Date: 2/23/05 Time: 1:42p - * Updated in $/LibSource/VerRelCpyrght - * Upped release number - * - * ***************** Version 6 ***************** - * User: Jsj Date: 1/19/05 Time: 10:29a - * Updated in $/LibSource/VerRelCpyrght - * upped - * - * ***************** Version 5 ***************** - * User: Jsj Date: 1/13/05 Time: 9:30a - * Updated in $/LibSource/VerRelCpyrght - * changed copyright to 2005 - * - * ***************** Version 4 ***************** - * User: Jsj Date: 10/12/04 Time: 9:28a - * Updated in $/LibSource/VerRelCpyrght - * upped - * - * ***************** Version 3 ***************** - * User: Jsj Date: 9/27/04 Time: 11:07a - * Updated in $/LibSource/VerRelCpyrght - * upped release number - * - * ***************** Version 2 ***************** - * User: Jsj Date: 9/13/04 Time: 11:06a - * Updated in $/LibSource/VerRelCpyrght - * upped release number - * - * ***************** Version 1 ***************** - * User: Kathy Date: 7/27/04 Time: 8:54a - * Created in $/LibSource/VerRelCpyrght - *********************************************************************************************/ -using System; - -namespace VerRelCpyrght -{ - /// - /// Summary description for Class1. - /// - public class VersionAndCopyright - { - private static string _VersionNumber = "10"; - private static string _ReleaseNumber = "21"; - private static string _CopyrightYear = "2008"; - private static string _CopyrightMsg; - private static string _VersionRelMsg; - - static VersionAndCopyright() - { - _CopyrightMsg = string.Format("Copyright \x00A9 1988 - {0}. All Rights Reserved.",_CopyrightYear); - _VersionRelMsg = string.Format("Version {0} Release {1}",_VersionNumber,_ReleaseNumber); - } - - public static string VersionNumber - { - get - { - return _VersionNumber; - } - } - - public static string ReleaseNumber - { - get - { - return _ReleaseNumber; - } - } - - public static string CopyrightYear - { - get - { - return _CopyrightYear; - } - } - - public static string CopyrightMsg - { - get - { - return _CopyrightMsg; - } - } - public static string VersionRelMsg - { - get - { - return _VersionRelMsg; - } - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/VerRelCpyrght.csproj b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/VerRelCpyrght.csproj deleted file mode 100644 index 897a0e57..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/VerRelCpyrght.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/VerRelCpyrght.sln b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/VerRelCpyrght.sln deleted file mode 100644 index 19693e44..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VerRelCpyrght/VerRelCpyrght.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VerRelCpyrght", "VerRelCpyrght.csproj", "{B6489955-8814-4133-815D-C25F7782EC2C}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {B6489955-8814-4133-815D-C25F7782EC2C}.Debug.ActiveCfg = Debug|.NET - {B6489955-8814-4133-815D-C25F7782EC2C}.Debug.Build.0 = Debug|.NET - {B6489955-8814-4133-815D-C25F7782EC2C}.Release.ActiveCfg = Release|.NET - {B6489955-8814-4133-815D-C25F7782EC2C}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VlnXml/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VlnXml/AssemblyInfo.cs deleted file mode 100644 index c713863a..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VlnXml/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VlnXml/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VlnXml/AssemblyInfo.cs.bak deleted file mode 100644 index 3d857390..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VlnXml/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("E:\\proms.net\\Public Key\\vlnkey.snk")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VlnXml/VlnXml.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VlnXml/VlnXml.cs deleted file mode 100644 index 68705bcc..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VlnXml/VlnXml.cs +++ /dev/null @@ -1,211 +0,0 @@ -using System; -using System.Xml; -using System.Text; - -namespace VlnXml -{ - /// - /// Summary description for Class1. - /// - - public class VlnXmlDocument:XmlDocument - { - public VlnXmlDocument():base() - { - } - - public override XmlElement CreateElement( string prefix, string localname, string nsURI) - { - VlnXmlElement elem = new VlnXmlElement(prefix, localname, nsURI, this); - return elem; - } - - } - - public class VlnXmlElement:XmlElement - { - - public VlnXmlElement( string prefix, string localname, string nsURI, XmlDocument doc ):base( prefix,localname,nsURI, doc ) - { - } - - public string GetMenuString(string grpmenuitm, bool isgrp) - { - VlnXmlElement elm = this; - StringBuilder strbld = new StringBuilder(); - - bool usespecial; // flags need for (Table) or (Graph) - string strspecial=""; - - // use grpmenuitm, parse for field(s) and generate a string to return - int left = grpmenuitm.IndexOf("<"); - int right; - int stindx = 0; - if (left > 0) strbld.Append(grpmenuitm.Substring(0,left)); - - while (left != -1) - { - // get right bracket and then check for valid field & if commas with - // this, check for integer values. - right = grpmenuitm.IndexOf(">",stindx); - string substring = grpmenuitm.Substring(left+1,right-left-1); - // do comma parts now. - string inusename; - substring = substring.Replace(" ","_"); - int comma1 = substring.IndexOf(","); - int frmt1=0, frmt2=0; - if (comma1 != -1) - { - // get any numbers for formatting & check for ints. - int comma2 = substring.IndexOf(",",comma1+1); - if (comma2 != -1) // two ints. - { - if (comma2-comma1 > 1) // first format field - not empty - { - string int1 = substring.Substring(comma1+1,comma2-comma1-1); - frmt1 = System.Convert.ToInt32(int1); - } - if (comma20) - strbld.Append(text.PadRight(frmt2,' ')); - else - strbld.Append(text); - } - else if (frmt1 != frmt2) - { - char[] tmp = text.ToCharArray(); - int cnt = 0; - while (tmp[cnt] <= '9' && tmp[cnt] >= '0') cnt++; - int padcnt = (cnt>frmt1)?0:frmt1-cnt; - StringBuilder strtmp = new StringBuilder(); - cnt = 0; - while(cnt right+1) // append any plain text. - strbld.Append(grpmenuitm.Substring(right+1,left-right-1)); - } - return strbld.ToString(); - } - - public string GetMenuValueTemplate(string menuitm) - { - VlnXmlElement parent; - string grpmenuitm; - VlnXmlElement tmp; - if (menuitm == "GroupMenuItem") - { - // if at top of tree, use this top GroupMenuItem. but if not, - // the parent node defines the GroupMenuItem for the subgroups. - if (this.ParentNode.Name == "RO_Root") - { - tmp = (VlnXmlElement) this.ParentNode; - grpmenuitm=tmp.GetAttribute(menuitm); - return(grpmenuitm); - } - else - parent = (VlnXmlElement) this.ParentNode; - while (parent != null) - { - if (parent.HasAttribute(menuitm) == true) break; - parent = (VlnXmlElement) parent.ParentNode; - } - if (parent == null) return null; - grpmenuitm = parent.GetAttribute(menuitm); - return grpmenuitm; - } - - // Now just do 'MenuItem', which is for ROs - parent = (VlnXmlElement) this; - grpmenuitm = parent.GetAttribute(menuitm); - while (parent != null && grpmenuitm == "") - { - // walk up tree to get parent. - grpmenuitm = parent.GetAttribute(menuitm); - parent = (VlnXmlElement) parent.ParentNode; - } - return grpmenuitm; - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VlnXml/VlnXml.csproj b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VlnXml/VlnXml.csproj deleted file mode 100644 index 2a347558..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/VlnXml/VlnXml.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/AssemblyInfo.cpp b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/AssemblyInfo.cpp deleted file mode 100644 index c185863d..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/AssemblyInfo.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "stdafx.h" - -using namespace System::Reflection; -using namespace System::Runtime::CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly:AssemblyTitleAttribute("")]; -[assembly:AssemblyDescriptionAttribute("")]; -[assembly:AssemblyConfigurationAttribute("")]; -[assembly:AssemblyCompanyAttribute("")]; -[assembly:AssemblyProductAttribute("")]; -[assembly:AssemblyCopyrightAttribute("")]; -[assembly:AssemblyTrademarkAttribute("")]; -[assembly:AssemblyCultureAttribute("")]; - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the value or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly:AssemblyVersionAttribute("1.1.*")]; - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project directory. -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly:AssemblyDelaySignAttribute(false)]; -[assembly:AssemblyKeyFileAttribute("E:\\proms.net\\Public Key\\vlnkey.snk")]; -[assembly:AssemblyKeyNameAttribute("")]; - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/ReadMe.txt b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/ReadMe.txt deleted file mode 100644 index 3f31f750..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/ReadMe.txt +++ /dev/null @@ -1,31 +0,0 @@ -======================================================================== - DYNAMIC LINK LIBRARY : WinExeClass Project Overview -======================================================================== - -AppWizard has created this WinExeClass DLL for you. - -This file contains a summary of what you will find in each of the files that -make up your WinExeClass application. - -WinExeClass.vcproj - This is the main project file for VC++ projects generated using an Application Wizard. - It contains information about the version of Visual C++ that generated the file, and - information about the platforms, configurations, and project features selected with the - Application Wizard. - -WinExeClass.cpp - This is the main DLL source file. - -WinExeClass.h - This file contains a class declaration. - -AssemblyInfo.cpp - Contains custom attributes for modifying assembly metadata. - -///////////////////////////////////////////////////////////////////////////// -Other notes: - -AppWizard uses "TODO:" to indicate parts of the source code you -should add to or customize. - -///////////////////////////////////////////////////////////////////////////// diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/Stdafx.cpp b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/Stdafx.cpp deleted file mode 100644 index e63184df..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/Stdafx.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// stdafx.cpp : source file that includes just the standard includes -// WinExeClass.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/Stdafx.h b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/Stdafx.h deleted file mode 100644 index 459e5fc4..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/Stdafx.h +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, -// but are changed infrequently - -#pragma once - -#using - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/WinExeClass.cpp b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/WinExeClass.cpp deleted file mode 100644 index 4c81cffd..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/WinExeClass.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: WinExeClass.cpp $ $Revision: 3 $ - * $Author: Jsj $ $Date: 12/16/03 11:59a $ - * - * $History: WinExeClass.cpp $ - * - * ***************** Version 3 ***************** - * User: Jsj Date: 12/16/03 Time: 11:59a - * Updated in $/LibSource/WinExeClass - * modified to all use in .net 1.0 and .net 1.1 - * - * ***************** Version 2 ***************** - * User: Jsj Date: 1/06/03 Time: 9:52a - * Updated in $/LibSource/WinExeClass - * fixed problem of running a C# program - was returning to main process - * before completing spawned process - * - * ***************** Version 1 ***************** - * User: Jsj Date: 8/23/02 Time: 2:57p - * Created in $/LibSource/WinExeClass - *********************************************************************************************/ - -// This is the main DLL file. - -#include "stdafx.h" - -#include "WinExeClass.h" - -using namespace WinExeClass; - - // Spawn off another process and run the passed in program. - // Note that the documentation for WinExec() says that it's provided - // for 16-bit windows compatibility and that applications should use - // the CreateProcess function. So this class gives you access to - // either the WinExe() or the CreateProcess() functions, just in case - // one works better than the other for your current programming needs. - -bool CLWinExec::RunWinExe(char *prgName) -{ - bool RtnVal = false; - RtnVal = DoWinExe(prgName); - return RtnVal; -} - -bool CLWinExec::RunCreateProcess(char *prgName) -{ - bool RtnVal = false; - RtnVal = DoCreateProcess(prgName); - return RtnVal; -} - -bool CLWinExec::RunWinExe(String *prgName) -{ - USES_CONVERSION; - bool RtnVal = false; -// UINT hInst; - - // Grab the program name from the String class and place - // in a NUll terminated char array. - // Note that String uses unicode chars so not every character - // can be convert to the char array. But this works for - // what we currently need. - int len; - char *tmpstr; - len = (prgName->get_Length)(); - tmpstr = new char(len + 1); - ZeroMemory(tmpstr,len+1); - for (int i=0; i < len; i++) - tmpstr[i] = (prgName->get_Chars)(i); - - RtnVal = DoWinExe(tmpstr); - - return RtnVal; -} - - -bool CLWinExec::RunCreateProcess(String *prgName) -{ - USES_CONVERSION; - bool RtnVal = false; -// UINT hInst; - - // Grab the program name from the String class and place - // in a NUll terminated char array. - // Note that String uses unicode chars so not every character - // can be convert to the char array. But this works for - // what we currently need. - int len; - char tmpstr[256]; - len = (prgName->get_Length)(); -// tmpstr = new char[len + 1]; - ZeroMemory(tmpstr,len+1); - for (int i=0; i < len; i++) - tmpstr[i] = (prgName->get_Chars)(i); - - RtnVal = DoCreateProcess(tmpstr); - - return RtnVal; -} - - -bool CLWinExec::DoWinExe(char *prgName) -{ - bool RtnVal = false; - UINT hInst; - - hInst = WinExec(prgName,SW_NORMAL); - if (hInst > 31){ - RtnVal = true; - // Wait until child process exits. - WaitForSingleObject((HANDLE)hInst,INFINITE); - } - return RtnVal; -} - -bool CLWinExec::DoCreateProcess(char *prgName) -{ - bool RtnVal = false; - STARTUPINFO procIn; - PROCESS_INFORMATION procOut; - - ZeroMemory(&procIn,sizeof(procIn)); - ZeroMemory(&procOut,sizeof(procOut)); - - procIn.dwFlags = STARTF_FORCEOFFFEEDBACK; - procIn.cb = sizeof(STARTUPINFO); - -// if (CreateProcess(prgName,NULL,NULL,NULL,FALSE,CREATE_SEPARATE_WOW_VDM,NULL,NULL,&procIn,&procOut)) - if (CreateProcess(NULL,prgName,NULL,NULL,FALSE,0,NULL,NULL,&procIn,&procOut)) - { - RtnVal = true; // process completed normally - // Wait until child process exits. - WaitForSingleObject(procOut.hProcess,INFINITE); - // Close process and thread handles. - CloseHandle(procOut.hProcess); - CloseHandle(procOut.hThread); - } - return RtnVal; -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/WinExeClass.h b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/WinExeClass.h deleted file mode 100644 index 088588a6..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/WinExeClass.h +++ /dev/null @@ -1,44 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: WinExeClass.h $ $Revision: 2 $ - * $Author: Jsj $ $Date: 12/16/03 11:59a $ - * - * $History: WinExeClass.h $ - * - * ***************** Version 2 ***************** - * User: Jsj Date: 12/16/03 Time: 11:59a - * Updated in $/LibSource/WinExeClass - * modified to all use in .net 1.0 and .net 1.1 - * - * ***************** Version 1 ***************** - * User: Jsj Date: 8/23/02 Time: 2:57p - * Created in $/LibSource/WinExeClass - *********************************************************************************************/ - -// WinExeClass.h - -#pragma once -#include -#include - -using namespace System; - -namespace WinExeClass -{ - public __gc class CLWinExec - { - public: - // TODO: Add your methods for this class here. - CLWinExec(){}; - bool RunWinExe(char *prgName); - bool RunWinExe(String *prgName); - bool RunCreateProcess(char *prgName); - bool RunCreateProcess(String *prgName); - private: -// char *tmpstr; - bool DoWinExe(char *prgName); - bool DoCreateProcess(char *prgName); - }; -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/WinExeClass.sln b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/WinExeClass.sln deleted file mode 100644 index f359bd14..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/WinExeClass.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinExeClass", "WinExeClass.vcproj", "{3A668CA0-A3BC-11D6-8541-ACF0DF000000}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {3A668CA0-A3BC-11D6-8541-ACF0DF000000}.Debug.ActiveCfg = Debug|Win32 - {3A668CA0-A3BC-11D6-8541-ACF0DF000000}.Debug.Build.0 = Debug|Win32 - {3A668CA0-A3BC-11D6-8541-ACF0DF000000}.Release.ActiveCfg = Release|Win32 - {3A668CA0-A3BC-11D6-8541-ACF0DF000000}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/WinExeClass.vcproj b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/WinExeClass.vcproj deleted file mode 100644 index 51f51cc7..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/WinExeClass/WinExeClass.vcproj +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/AssemblyInfo.cs deleted file mode 100644 index c713863a..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/AssemblyInfo.cs.bak deleted file mode 100644 index 9f89a328..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/App.ico b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/App.ico deleted file mode 100644 index 3a5525fd794f7a7c5c8e6187f470ea3af38cd2b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1078 zcmeHHJr05}7=1t!Hp3A*8IHkVf+j?-!eHY14Gtcw1Eb*_9>Bq^zETJ@GKj{_2j4$w zo9}xCh!8{T3=X##Skq>ikMjsvB|y%crWBM2iW(4pI}c%z6%lW!=~4v77#3{z!dmB1 z__&l)-{KUYR+|8|;wB^R|9ET$J@(@=#rd^=)qs85?vAy(PSF5CyNkus435LVkZ$rj zNw|JG-P7^hF<(;#o*Vk}5R#e|^13tBbQkeF?djULtvqyxd3<{9 diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/AssemblyInfo.cs deleted file mode 100644 index c713863a..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/AssemblyInfo.cs.bak deleted file mode 100644 index 9f89a328..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/AssemblyInfo.cs.bak +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/Form1.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/Form1.cs deleted file mode 100644 index fa343e40..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/Form1.cs +++ /dev/null @@ -1,154 +0,0 @@ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; -using System.Data; -using System.IO; -using XYPlots; - -namespace Test_XYPlots -{ - /// - /// Summary description for Form1. - /// - public class Form1 : System.Windows.Forms.Form - { - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.OpenFileDialog openFileDialog1; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Button button2; - private System.Windows.Forms.Label label1; - private C1.C1Pdf.C1PdfDocument c1PdfDocument1; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - - public Form1() - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - - // - // TODO: Add any constructor code after InitializeComponent call - // - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if (components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.textBox1 = new System.Windows.Forms.TextBox(); - this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); - this.button1 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.c1PdfDocument1 = new C1.C1Pdf.C1PdfDocument(); - this.SuspendLayout(); - // - // textBox1 - // - this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.textBox1.Location = new System.Drawing.Point(16, 48); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(456, 24); - this.textBox1.TabIndex = 0; - this.textBox1.Text = "Path to XYPlot File"; - // - // button1 - // - this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.button1.Location = new System.Drawing.Point(480, 48); - this.button1.Name = "button1"; - this.button1.TabIndex = 1; - this.button1.Text = "Browse"; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // button2 - // - this.button2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.button2.Location = new System.Drawing.Point(208, 96); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(144, 48); - this.button2.TabIndex = 2; - this.button2.Text = "Run Run Run"; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // label1 - // - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.label1.Location = new System.Drawing.Point(16, 16); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(424, 23); - this.label1.TabIndex = 3; - this.label1.Text = "Enter the path and file name of the X/Y Plot text file:"; - // - // Form1 - // - this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); - this.ClientSize = new System.Drawing.Size(576, 168); - this.Controls.Add(this.label1); - this.Controls.Add(this.button2); - this.Controls.Add(this.button1); - this.Controls.Add(this.textBox1); - this.Name = "Form1"; - this.Text = "X/Y Plot Test"; - this.ResumeLayout(false); - - } - #endregion - - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.Run(new Form1()); - } - - private void button1_Click(object sender, System.EventArgs e) - { - openFileDialog1.ShowDialog(); - textBox1.Text = openFileDialog1.FileName; - } - - private void button2_Click(object sender, System.EventArgs e) - { - if (File.Exists(textBox1.Text)) - { - string XYPlotTextFile = textBox1.Text; - int extenIdx = textBox1.Text.LastIndexOf('.'); - if (extenIdx < 0) - extenIdx = textBox1.Text.Length; - string XYPlotPdfFile = textBox1.Text.Substring(0,extenIdx) + ".PDF"; - Cursor.Current = Cursors.AppStarting; - XYPlot plot = new XYPlot(XYPlotTextFile,XYPlotPdfFile); - Cursor.Current = Cursors.Arrow; - } - else - MessageBox.Show(textBox1.Text,"Could not find X/Y Plot text file:"); - } - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/Form1.resx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/Form1.resx deleted file mode 100644 index 1b83c9d0..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/Form1.resx +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Private - - - False - - - Private - - - Private - - - Private - - - 17, 17 - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - False - - - Private - - - Private - - - 162, 17 - - - Private - - - Private - - - False - - - (Default) - - - False - - - False - - - 8, 8 - - - True - - - 80 - - - Form1 - - - True - - - Private - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/Test XYPlots.csproj b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/Test XYPlots.csproj deleted file mode 100644 index c37cce4f..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/Test XYPlots.csproj +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/licenses.licx b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/licenses.licx deleted file mode 100644 index 984ec9ad..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/Test XYPlots/licenses.licx +++ /dev/null @@ -1 +0,0 @@ -C1.C1Pdf.C1PdfDocument, C1.C1Pdf, Version=1.1.20052.40, Culture=neutral, PublicKeyToken=bc8d9c59cf1b601f diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/XYPlots.cs b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/XYPlots.cs deleted file mode 100644 index 55bcd425..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/XYPlots.cs +++ /dev/null @@ -1,2226 +0,0 @@ -using System; -using System.Collections; -using System.IO; -using System.Windows.Forms; -using System.Text; -using System.Drawing; -using VG; -using C1.C1Pdf; - -namespace XYPlots -{ - /// - /// Summary description for XYPlot. - /// - public class XYPlot - { -// private int ConvertToTwips = 1440; - private double ConvertToTwips = 4.8; - - static long HP3_HPGL_COMPENSATEX = 1016L; /* OK, so you don't believe it */ - static long HP3_HPGL_COMPENSATEY = 1016L;/* OK, so you don't believe it */ - static long PRINTAPLOT_COMPENSATE = 1020L;/* but these resolve differently*/ - static int MAX_XY_STACK = 8; /* this is max of CIE cursor/font stack */ - - static int DPI = 1440; //300; - static int CWIDEDOTS = 120; //25; - static int CHIGHDOTS = 240; //50; - - static int STRAIGHT = 0; - static int CURVE = 1; - static int DASH = 2; - - static int X = 0; - static int Y = 1; - static int Dimensions = 2; - static int USER = 0; - static int PLOT = 1; - - static double PI=3.141592653; - static double Zero=0.0; - static double ANGLELIMIT=1.0; - - // !!!! NEED REAL SUPERSCRIPT ON/OFF TOKENS - static string []SuperScript = {"##","##"}; - static string []SubScript = {"~~","~~"}; - - FileStream XYPlotFile; - - int []SavedX; - int []SavedY; - int stack; - int HPGLMode; - long HP_FudgeX = HP3_HPGL_COMPENSATEX; - long HP_FudgeY = HP3_HPGL_COMPENSATEY; - - string GoodOldStringX; - string GoodOldStringY; - - - public int LinesUsed; - string valuestring; - string powerstring; - int GridOnFlag,Visible,ShadowFlag; - char[] type = new char[Dimensions]; - double FontPitch = 10.0; - double[] minimum = new double[Dimensions]; - double[] maximum = new double[Dimensions]; - double[] userunits = new double[Dimensions]; - int[] printerunits = new int[Dimensions]; - int[] Position = new int[Dimensions]; - double[,] Scale = new double[2,Dimensions]; - double[,] Offset = new double[2,Dimensions]; - double[] delta = new double[Dimensions]; - int[] cycles = new int[Dimensions]; - int[] onecycle = new int[Dimensions]; - int[] minor = new int[Dimensions]; - int[] spcminor = new int[Dimensions]; - string[] AxisTitles = new string[Dimensions]; - int[] AxisLabel = new int[Dimensions];// = {1,1}; /* 1 for YES(default), 0 for NO*/ - string LineBuff; - int CurPenWidth, DrawDirection, LineFlag, LineDiv; - int EndFlag = 0; - public string Buff; //[4096],*BuffPtr; - int BuffPtr = 0; - - //double (*f[2][2])(double); - - bool [,]doLOG10 = {{false,false},{false,false}}; - - struct point - { - public int[] xyValue; //new int[Dimensions]; - } - - struct BoxList - { - public int Shadow; - public string BoxText; - public point BoxMinimum; - public point BoxMaximum; - //BoxList *NextBox; - }; - ArrayList AllBoxes = new ArrayList(); - - struct ActiveBoxList - { - public ArrayList BoxPtr; - //ActiveBoxList *NextActiveBox; - }; - ArrayList AllActiveBoxes = new ArrayList(); - - class PointList - { - private point m_APoint; - private double m_slope; /* slope of tangent to circle at this point */ - public point APoint - { - get{return m_APoint;} - set{m_APoint=value;} - } - public double slope - { - get{return m_slope;} - set{m_slope=value;} - } - //PointList *NextPoint; - }; -// public ArrayList PointListArray = new ArrayList(); - - struct LineList - { - public int PlotType; - public int PlotDivisions; - // public PointList PlotPoint; - public ArrayList PlotPointsList; -// public LineList NextPlot; - }; - ArrayList AllPlots = new ArrayList(); - - int YLandScape=0; /* y axis title is horizontal */ - point YTitleOrigin; /* y axis title origin if vertical */ - - double FixAngle(double a1) - { - double retval; - int sign; - if(a1 < 0) - { - a1=-a1; - sign=-1; - } - else - sign=1; - retval=sign*Math.Floor(0.5+a1); - return(retval); - } - - double dsquare(int val) - { - double result; - result = (double)(val*val); - return( result ); - } - - double FMin(double f1,double f2) - { - return((f1>=f2)?f2:f1); - } - - double FMax(double f1,double f2) - { - return((f1>=f2)?f1:f2); - } - - double atan_deg(double x) - { - return( Math.Atan(x) * 180.0/PI ); - } - - double cos_deg(double x) - { - return( Math.Cos(x*PI/180.0) ); - } - - double tan_deg(double x) - { - return( Math.Tan(x*PI/180.0) ); - } - - double sin_deg(double x) - { - return( Math.Sin(x*PI/180.0) ); - } - - /* - ** the following function is pointed to by a function pointer - ** and is provided for compatibility with log10() function usage - */ - double linear(double x) - { - return(x); - } - - bool isWhiteSpace(char cptr) - { - bool rtnval = false; - if (!cptr.Equals(null)) - { - int idx = "\t\n\r\f ".IndexOf(cptr); - rtnval = (idx > -1); - } - return rtnval; - // return((c) ? strchr("\t\n\r\f ",c):NULL); - } - - // int NextPiece() - string NextPiece() - { - string rtnval; - // char *ptr; - int ptr; -// int buflen = Buff.Length; - while(BuffPtr >= 0 && Buff[BuffPtr] != 0 && isWhiteSpace(Buff[BuffPtr]))BuffPtr++; -// while(BuffPtr < buflen && Buff[BuffPtr] != 0 && isWhiteSpace(Buff[BuffPtr]))BuffPtr++; - ptr=BuffPtr; - while(BuffPtr >= 0 && Buff[BuffPtr] != 0 && !isWhiteSpace(Buff[BuffPtr]))BuffPtr++; -// while(BuffPtr < buflen && Buff[BuffPtr] != 0 && !isWhiteSpace(Buff[BuffPtr]))BuffPtr++; - if ( EndOfCommand() ) EndFlag=1; - - rtnval = Buff.Substring(ptr,BuffPtr-ptr); - BuffPtr++; - return rtnval; - } - - bool EndOfCommand() - { - int tmpPtr = BuffPtr; -// if (BuffPtr >= Buff.Length) -// return true; - while (!Buff[tmpPtr].Equals('\0') && Buff[tmpPtr].Equals(' ')) tmpPtr++; - if (!Buff[tmpPtr].Equals('\0') && !isWhiteSpace(Buff[tmpPtr])) - return false; - else if (Buff[tmpPtr] == '\r' || Buff[tmpPtr] == '\n' || Buff[tmpPtr] == '\0') - return true; - else - return false; - } - - bool LoadBuff(string FileName) - { - if (!File.Exists(FileName)) - { - // File does not exist, show error message - MessageBox.Show(String.Format("X/Y Plot File {0} Does Not Exist",FileName),"Error Opening X/Y Plot File"); - return false; - } - - // Open the X/Y Plot file - try - { - XYPlotFile = File.OpenRead(FileName); - } - catch (Exception e) - { - // cannot open the x/y plot file - MessageBox.Show(e.Message,String.Format("Error Opening {0} for Reading",FileName)); - return false; - } - - int blen = (int)XYPlotFile.Length; - int bread = 0; - - // initialize a byte array to read into - byte []bbuf = new byte[blen+1]; - for (int i=0; i\r\n<",ptr)) > 0) - { - // blank out ">" - Buff = Buff.Remove(ptr,1); - Buff = Buff.Insert(ptr," "); - // remove "<" - Buff = Buff.Remove(ptr+3,1); - // if command on next line is blank, - // combine with the previous line - if (Buff[ptr+3] == ' ') - Buff = Buff.Remove(ptr,3); - } - ptr = Buff.Length-5; -// if (Buff.EndsWith(">>\r\n")) - if (Buff.IndexOf(">>\r\n",ptr) > 0) - { - Buff = Buff.Remove(ptr,2); - Buff = Buff.Insert(ptr," "); -// Buff[ptr] = ' '; -// Buff[ptr+1] = ' '; - } - } - - void CloseGraph() - { - /* Send back number of lines used assuming 6 lines per inch */ - if( LinesUsed==0 ) - LinesUsed=(int)(1.5 * CHIGHDOTS); /* adjust for x axis tics */ - LinesUsed += printerunits[Y]; - LinesUsed = LinesUsed/CHIGHDOTS; - } - - void GetScaleInfo() - { - GridOnFlag=getint(); - userunits[X]=getdouble(); - userunits[Y]=getdouble(); -// f[USER][X]=linear; /* f is a function pointer */ -// f[USER][Y]=linear; /* linear is a function */ - printerunits[X]=(int)(DPI*userunits[X]); - printerunits[Y]=(int)(DPI*userunits[Y]); - minimum[X]=getdouble(); - maximum[X]=getdouble(); - minimum[Y]=getdouble(); - maximum[Y]=getdouble(); - type[X]=getchr(); - type[Y]=getchr(); - if(EndFlag == 0) delta[X]=getdouble(); - if(EndFlag == 0) delta[Y]=getdouble(); - if(EndFlag == 0) spcminor[X]=getint(); - if(EndFlag == 0) spcminor[Y]=getint(); - Offset[USER,X]=0; - Offset[USER,Y]=0; - Scale[USER,X]=DPI; - Scale[USER,Y]=DPI; - - /* - in the following if blocks, the array variable f is a function - pointer which is set to either the function linear or log10. - */ - /* X-axis function generation and scaling */ - if(type[X] != 'L') - { - // Linear - doLOG10[PLOT,X]=false; - LinearScale(X); - Scale[PLOT,X] = printerunits[X] / (maximum[X]- minimum[X]); - Offset[PLOT,X] =- Scale[PLOT,X] * minimum[X]; - } - else - { - // Log10 - doLOG10[PLOT,X]=true; - LogScale(X); - Scale[PLOT,X] = printerunits[X] / - (Math.Log10(maximum[X])- Math.Log10(minimum[X])); - Offset[PLOT,X] =- Scale[PLOT,X] * Math.Log10(minimum[X]); - } - - /* Y-axis function generation and scaling */ - if(type[Y] != 'L') - { - // Linear - doLOG10[PLOT,Y]=false; - LinearScale(Y); - Scale[PLOT,Y]=printerunits[Y]/ (maximum[Y] - minimum[Y]); - Offset[PLOT,Y] =- Scale[PLOT,Y] * minimum[Y]; - } - else - { - // Log10 - doLOG10[PLOT,Y]=true; - LogScale(Y); - Scale[PLOT,Y]=printerunits[Y]/ - (Math.Log10(maximum[Y]) - Math.Log10(minimum[Y])); - Offset[PLOT,Y] =- Scale[PLOT,Y] * Math.Log10(minimum[Y]); - } - } - - - void GetAxisTitle(int flag) - { - AxisTitles[flag]=GetString(); - } - - string stripSuperSub(string instr) - { - StringBuilder sb = new StringBuilder(instr); - sb.Replace(SuperScript[0],""); - sb.Replace(SuperScript[1],""); - sb.Replace(SubScript[0],""); - sb.Replace(SubScript[1],""); - return sb.ToString(); - } - - point DetermineBoxMax(BoxList boxptr) - { - - point newval = new point(); - newval.xyValue = new int[Dimensions]; - string tmp; - int pos = 0, prevPos = 0; - int nl = 0, xmax = 0, ilen = 0; - tmp = stripSuperSub(boxptr.BoxText); - while ((pos = tmp.IndexOf('\n',pos)) > -1) - { - ilen = pos - prevPos; // -1; this will fix an arythmatic bug - xmax = Math.Max(xmax,ilen); - prevPos = pos; - pos++; - nl++; - } - ilen = tmp.Substring(prevPos+1).Length; - xmax = Math.Max(xmax,ilen) + 2; -// nl += 2; - newval.xyValue[X] = boxptr.BoxMinimum.xyValue[X]+(xmax*CWIDEDOTS); - newval.xyValue[Y] = boxptr.BoxMinimum.xyValue[Y]-(nl*CHIGHDOTS)-(int)(30 * ConvertToTwips); -// newval.xyValue[Y] = boxptr.BoxMinimum.xyValue[Y]+(nl*CHIGHDOTS)-(int)(30 * ConvertToTwips); -// boxptr.BoxMaximum = newval; - return newval; - } - - - void GetBoxParameters() - { - BoxList NewBox = new BoxList(); -// point Origin = new point(); -// Origin.xyValue = new int[Dimensions]; - point Origin; - Origin = GetPair(USER); - string str = GetString(); - NewBox.BoxText = str; - NewBox.BoxMinimum = Origin; - NewBox.Shadow = ShadowFlag; - ShadowFlag = 0; - NewBox.BoxMaximum = DetermineBoxMax(NewBox); - // jsj - point minPoint = new point(); - minPoint.xyValue = new int[Dimensions]; - point maxPoint = new point(); - maxPoint.xyValue = new int[Dimensions]; - minPoint.xyValue[X] = Origin.xyValue[X]; - minPoint.xyValue[Y] = NewBox.BoxMaximum.xyValue[Y]; - maxPoint.xyValue[X] = NewBox.BoxMaximum.xyValue[X]; - maxPoint.xyValue[Y] = Origin.xyValue[Y]; - - NewBox.BoxMinimum = minPoint; - NewBox.BoxMaximum = maxPoint; - //jsj - AllBoxes.Add(NewBox); - } - - void GetLineParameters() - { - // PointList NewPlotData; - // int curptr, prevptr; - ArrayList PointListArray = new ArrayList(); - int pointcount; - pointcount = EndFlag = 0; - while (EndFlag == 0) - { - PointList pl = new PointList(); - pl.APoint = new point(); - //pl.APoint.xyValue = new int[Dimensions]; - pl.APoint = GetPair(PLOT); - pointcount++; - PointListArray.Add(pl); - } - if (LineFlag == CURVE && pointcount > 2) - CalculateSlopes(PointListArray); - else - LineFlag = STRAIGHT; -#if DEBUG - ShowPoints(PointListArray); -#endif - AddAPlot(PointListArray); - } -#if DEBUG - void ShowPoints(ArrayList al) - { - foreach(PointList pl in al) - { - Console.WriteLine("x={0},y={1},slope={2}",pl.APoint.xyValue[0],pl.APoint.xyValue[1], pl.slope); - } - } -#endif - double FindSlope(point first, point last) - { - double dx, dy, result; - dx = last.xyValue[X] - first.xyValue[X]; - dy = (last.xyValue[Y] - first.xyValue[Y]); -// dy = first.xyValue[Y] - last.xyValue[Y]; - if (dx == 0.0) - { - if (dy > 0) - result = Convert.ToDouble("1.E99"); - else - result = Convert.ToDouble("-1.E99"); - } - else - result = dy/dx; - return result; - } - - double FindEndSlope(point first, point last,double s1) - { - double result; - result = 2.0 * FindSlope (first,last) - s1; - if (result * s1 < 0.0) - result = 0.0; - return result; - } - - void CalculateSlopes(ArrayList PlAry) - { - PointList thispt, prevpt, firstpt; - long yval, y1, y3; - int PlAryIdx = 0; - int PlAryNumItems = PlAry.Count; - prevpt = (PointList) PlAry[PlAryIdx]; - PlAryIdx++; - thispt = (PointList) PlAry[PlAryIdx]; - while (PlAryIdx + 1 < PlAry.Count) - { - thispt.slope = Zero; - yval = thispt.APoint.xyValue[Y]; - y1 = prevpt.APoint.xyValue[Y]; - y3 = ((PointList)PlAry[PlAryIdx +1]).APoint.xyValue[Y]; - if ((yval-y1)*(y3-yval) > 0) -// if ((yval-y1)*(y3-yval) < 0) // jsj - thispt.slope = FindSlope(prevpt.APoint,((PointList)PlAry[PlAryIdx +1]).APoint); - prevpt = thispt; - PlAryIdx++; - thispt = (PointList)PlAry[PlAryIdx]; - } - firstpt = (PointList)PlAry[0]; - firstpt.slope = FindEndSlope(firstpt.APoint,((PointList)PlAry[1]).APoint,((PointList)PlAry[1]).slope); - - thispt.slope = FindEndSlope(thispt.APoint,prevpt.APoint,prevpt.slope); - } - - void AddAPlot(ArrayList ptr) - { - LineList NewLine = new LineList(); - NewLine.PlotType = LineFlag; - NewLine.PlotDivisions = LineDiv; - NewLine.PlotPointsList = ptr; - AllPlots.Insert(0,NewLine); - } - - void GenerateGrid(VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - AllActiveBoxes.Clear(); - SetPenDiameter(5); - Position[X]= 0; - Position[Y]= 0; // printerunits[Y]; - SavePosition(); - BoxRelative(printerunits[X],printerunits[Y],CurPenWidth,pg,pdf); - if(GridOnFlag == 0) Visible=0; - DrawDirection=Y; - DoGrid(X,pg,pdf); - DrawDirection=X; - DoGrid(Y,pg,pdf); - Visible=1; - RecallPosition(); - } - - void DoGrid(int flag,VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - if( type[flag] != 'L' ) - DoLinearGrid(flag,pg,pdf); - else - DoLogGrid(flag,pg,pdf); - } - - void DoLinearGrid(int flag,VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - int i,n,ns,subminor; -// int i,n,ns,x1,x2,y1,y2,subminor; - int ptval; - n = (int)(0.5 + (maximum[flag] - minimum[flag]) / delta[flag]); - ns = n * minor[flag]; - if ((minor[flag] % 2) != 0) - subminor = minor[flag]; - else - subminor = minor[flag] / 2; - for(i=0; i <= ns; i++) - { - SetPenDiameter((((i % minor[flag])!=0) ? (((i % subminor)!=0) ? 1 : 2) : 3)); - ptval = ((int)printerunits[flag]) * i / ns; - if (flag ==Y) - ptval = printerunits[Y] - ptval; - MoveAbsolute(((flag == X)? ptval : 0),((flag == Y)? ptval : 0)); -// MoveAbsolute(((flag == X)? ptval : 0),((flag == Y)? ptval : printerunits[Y])); - if(i % minor[flag] == 0) - WriteValue(flag,minimum[flag] + i * delta[flag] / minor[flag],false,pg,pdf); -// DrawGridLine(!flag,ptval); - DrawGridLine((flag==0)?1:0,ptval,pg,pdf); - } - } - - void DoLogGrid(int flag,VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - double showval; - int gs,ge,gd; - int i,ptval; -// int i,x1,x2,y1,y2,ptval; - showval =minimum[flag]; - for (i=0; i < cycles[flag]; i++) - { - gs = gd = 100; - ge = 1000; - ptval=((int)printerunits[flag]) * i / cycles[flag]; - if (flag ==Y) - ptval = printerunits[Y] - ptval; //jj - MoveAbsolute(((flag == X)? ptval : 0),((flag == Y)? ptval : 0)); - SetPenDiameter(3); - WriteValue(flag,showval,false,pg,pdf); - GenGrid(flag,gs,ge,gd,onecycle[flag],2,i * onecycle[flag],pg,pdf); - showval *= 10.0; - } - ptval=((int)printerunits[flag]) * i / cycles[flag]; - if (flag ==Y) - ptval = printerunits[Y] - ptval; //jj - MoveAbsolute(((flag == X)? ptval : 0),((flag == Y)? ptval : 0)); - SetPenDiameter(3); - WriteValue(flag,showval,false,pg,pdf); - } - - void WriteValue(int flag, double val, bool SubLogValue, VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - int size; - size=GenNumberString(val); - SavePosition(); - if (flag == X) - { - MoveRelative(0,-printerunits[Y]); -// DrawGridRelative(0,30,pg,pdf); -// DrawGridRelative(0,(int)(-30 * ConvertToTwips) - printerunits[Y],pg,pdf); - if (!SubLogValue) - DrawGridRelative(0,(int)(-30 * ConvertToTwips),pg,pdf); - // MoveRelative((int)((-150 * size / (int)FontPitch) * ConvertToTwips), (int)(60 * ConvertToTwips)); - MoveRelative((int)((-130 * size / (int)FontPitch) * ConvertToTwips), (int)(-60 * ConvertToTwips)); - if ((AxisLabel[0])!=0) - { - if (SubLogValue) - { - StringBuilder sb = new StringBuilder(); - sb.Append(SuperScript[0]); - sb.Append(valuestring); - sb.Append(SuperScript[1]); - valuestring = sb.ToString(); - MoveRelative(30,30); - } - GraphText(valuestring,pg,pdf); - } - } - else - { -// DrawGridRelative(-30,0,pg,pdf); - if (!SubLogValue) - DrawGridRelative((int)(-30 * ConvertToTwips),0,pg,pdf); -// MoveRelative((int)(-(15 + 300 * size / (int)FontPitch) * ConvertToTwips), (int) (15 * ConvertToTwips)); - MoveRelative((int)(-(15 + 300 * size / (int)FontPitch) * ConvertToTwips), (int) (-15 * ConvertToTwips)); - if((AxisLabel[1])!=0) - { - if (SubLogValue) - { - StringBuilder sb = new StringBuilder(); - sb.Append(SuperScript[0]); - sb.Append(valuestring); - sb.Append(SuperScript[1]); - valuestring = sb.ToString(); - MoveRelative(90,-90); //jj - } - GraphText(valuestring,pg,pdf); - } - } - RecallPosition(); - } - - int GenNumberString(double x) - { - int power,size,sign; - double mantissa; - if(x==0.0) return(savenumber(x)); - if(x<0.0) - { - x=-x; - sign=1; - } - else - sign=0; - mantissa=Math.Log10(x); - power=0; - while(mantissa < 0.999) - { - power--; - mantissa++; - } - while(mantissa >= 0.999) - { - power++; - mantissa--; - } - if(mantissa < 0) - mantissa=0; - if(power > -5 && power < 5) - size=savenumber(x); - else - { - size = savenumber(Math.Pow(10.0,mantissa)); - size += addpower(power); - if (valuestring.StartsWith("1x")) - { - size -= 2; - valuestring = valuestring.Remove(0,2); - } - } - if(sign != 0) - { - valuestring = "-" + valuestring; - size++; - } - return(size); - } - - int savenumber(double x) - { - // valuestring = x.ToString("F"); - valuestring = x.ToString("G"); - return valuestring.Length; - } - - int addpower(int i) - { - int tlen; - powerstring = string.Format("x10{0}{1}{2}",SuperScript[1],i.ToString(),SuperScript[2]); - valuestring = valuestring + powerstring; - tlen=SuperScript[0].Length + SuperScript[1].Length; - return(powerstring.Length - tlen); - } - - void DoAxisTitles(VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - int len,frommargin; -// int axismax,axismin; - string str; - // string []newstr = {"",""}; - - SavePosition(); - if((AxisTitles[X] != null) && (len=AxisTitles[X].Length) > 0 ) - { - frommargin=(int)((0.5 * (printerunits[X])) - (0.5 * (len * CWIDEDOTS))); -// MoveAbsolute(frommargin, -3 * CHIGHDOTS); - MoveAbsolute(frommargin, (3 * CHIGHDOTS) + printerunits[Y]); - PrintText(AxisTitles[X],pg,pdf); - LinesUsed += (3 * CHIGHDOTS); - // Zfree(&AxisTitles[X]); - AxisTitles[X] = null; - } - if((AxisTitles[Y] != null) && (len=AxisTitles[Y].Length) > 0) - { - if(YLandScape > 0) - { - int strIdx = 0; - // newstr[1] = null; - MoveTo(YTitleOrigin); - str = AxisTitles[Y]; - while(strIdx < str.Length) - { - // newstr[0] = *str; - // PrintText( newstr ); - PrintText (str[strIdx].ToString(),pg,pdf); - MoveRelative(0,-CHIGHDOTS); - strIdx ++; - // str++; - } - } - else - { -// MoveAbsolute(-3 * CWIDEDOTS, printerunits[Y] + CHIGHDOTS); - MoveAbsolute(-3 * CWIDEDOTS, - CHIGHDOTS); - PrintText(AxisTitles[Y],pg,pdf); - } - // Zfree(&AxisTitles[Y]); - AxisTitles[Y] = null; - } - RecallPosition(); - } - - void DoBoxes(VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - int dx,dy; - BoxList current; - string str; - //string nextstr; - SavePosition(); - int BoxIdx = 0; - SetPenDiameter(5); - while(BoxIdx < AllBoxes.Count) - { - current=(BoxList)AllBoxes[BoxIdx]; - MoveTo(current.BoxMinimum); - dx=current.BoxMaximum.xyValue[X] - current.BoxMinimum.xyValue[X]; -// dy=current.BoxMinimum.xyValue[Y] - current.BoxMaximum.xyValue[Y]; - dy=current.BoxMaximum.xyValue[Y] - current.BoxMinimum.xyValue[Y]; - if( current.Shadow != 2 ) BoxRelative(dx,dy,CurPenWidth,pg,pdf); - if( current.Shadow == 1 ) - { - int savePenWidth = CurPenWidth; - SavePosition(); - SetPenDiameter(10); - MoveRelative((int)(10 * ConvertToTwips),-(dy+(int)(5*ConvertToTwips))); - DrawRelative(dx,0,pg,pdf); -// BlockRelative(dx,(int)(10 * ConvertToTwips),pg,pdf); - MoveRelative(-(int)(3 * ConvertToTwips),-(int)(5*ConvertToTwips)); -// BlockRelative((int)(10 * ConvertToTwips),dy,pg,pdf); - DrawRelative(0,dy,pg,pdf); - CurPenWidth = savePenWidth; -// MoveRelative(dx + (int)(10 * ConvertToTwips),0); -// BlockRelative(-dx,(int)(10 * ConvertToTwips),pg,pdf); -// BlockRelative((int)(-10 * ConvertToTwips),dy + (int)(10 * ConvertToTwips),pg,pdf); - RecallPosition(); - } -//jj MoveRelative((CWIDEDOTS * (3/2)),dy + (CHIGHDOTS * (5/4))); - MoveRelative((CWIDEDOTS * (3/2)),-(CHIGHDOTS * (5/4))); - str=current.BoxText; - int stridx = 0; - while(stridx < str.Length) - { - string tstr = str; - int idx; - if ((idx = str.IndexOf("\n",stridx)) >= 0) - { - tstr = str.Substring(stridx,idx-stridx); - stridx = idx + 1; - } - // if( (nextstr=strchr(str,'\n')) != NULL ) *nextstr++=0; - PrintText(tstr,pg,pdf); - MoveRelative(0,-CHIGHDOTS); - // str=nextstr; - } - // current=current->NextBox; - BoxIdx++; - } - RecallPosition(); - } - - void DrawLines(VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - int PlotsIdx = 0; - PointList curpoint; - LineList current; - - SavePosition(); - // if( HPGL_Command[0] ) { - // if( UsePP ) { /* PRINTAPLOT third party software */ - // if( (PRT=fopen("HPGL.tmp","wb")) == NULL ) - // {fprintf(stderr,"Could not open HPGL.tmp");PRT=stdprn;return;} - // HP_FudgeX=PRINTAPLOT_COMPENSATE; - // HP_FudgeY=PRINTAPLOT_COMPENSATE; - // - // } else { /* standard HPGL */ - // PRT=stdprn; - // HP_FudgeX=HP3_HPGL_COMPENSATEX; - // HP_FudgeY=HP3_HPGL_COMPENSATEY; - // } - // HPGLMode=1; - // ANGLELIMIT=2.0; - // fprintf(PRT,HPGL_Command[0]); /* Initialization */ - // - // } else { /* All other printers */ - //PRT=stdprn; - //HPGLMode=0; - SetPenDiameter(8); - // } - - /* begin plotting the graph lines, which may be straight or curved */ - while(PlotsIdx < AllPlots.Count) - { - current=(LineList)AllPlots[PlotsIdx]; - int pntListIdx = 0; - LineDiv=current.PlotDivisions; - if( current.PlotType == STRAIGHT ) - { /* straight plot */ - curpoint=(PointList)current.PlotPointsList[pntListIdx]; - MoveTo(curpoint.APoint); - // while( (curpoint=curpoint->NextPoint) != 0 ) - while( ++pntListIdx < current.PlotPointsList.Count ) - { - curpoint = (PointList)current.PlotPointsList[pntListIdx]; - DrawLineTo(curpoint.APoint,pg,pdf); - } - } - else - { - DrawCurve(current,pg,pdf); /* curved plot */ - } - - /* HP printers seem to have a bug (or this code does) which */ - /* requires that each plot or curve be redrawn relative to the */ - /* origin, or plot offsetting occurs. */ - // if(HPGLMode && !UsePP) { - // Graphics(0); - // RecallPosition(); - // SavePosition(); - // Graphics(1); - // fprintf(PRT,HPGL_Command[0]); /* Initialization */ - // } - -// current=current.NextPlot; /* point to next curve */ - PlotsIdx++; -// if (PlotsIdx < AllPlots.Count) -// current=(LineList)AllPlots[PlotsIdx]; - } /* repeat for each plot (while) */ - - // if(HPGLMode) { - // fprintf(PRT,HPGL_Command[1]); /* Cleanup */ - // if( UsePP ) { fclose(PRT); PRT=stdprn; } - // } - RecallPosition(); - } - - point FindCenterOfArc( point StartPoint, double Slope1, point EndPoint, double Slope2) - { - point center = new point(); - double s1,s2; - int x1,y1,x2,y2; - - center.xyValue = new int[Dimensions]; - s1 = tan_deg(FixAngle(atan_deg(Slope1))); - s2=tan_deg(FixAngle(atan_deg(Slope2))); - x1=StartPoint.xyValue[X]; - y1=StartPoint.xyValue[Y]; - x2=EndPoint.xyValue[X]; - y2=EndPoint.xyValue[Y]; - center.xyValue[X]=(int)(((s2*s1)*(y2-y1)+(s1*x2)-(s2*x1))/(s1-s2)); - if(s1==0.0) - center.xyValue[Y] = (int)(y2-((center.xyValue[X]-x2)/s2)); - else - center.xyValue[Y] = (int)(y1-((center.xyValue[X]-x1)/s1)); - return(center); - } - - point FindModifiedCenter(double rprime,point PtOnArc, double ang) - { - point newcenter = new point(); - newcenter.xyValue = new int[Dimensions]; - newcenter.xyValue[X] = (int)(PtOnArc.xyValue[X] - rprime * cos_deg(ang)); - newcenter.xyValue[Y] = (int)(PtOnArc.xyValue[Y] - rprime * sin_deg(ang)); - return(newcenter); - } - - int AddMidPoint(ArrayList ptLstAry, int pt1Idx,int pt2Idx) - { - PointList midpt; - PointList pt1, pt2; - point pt; - double so; - int x1,y1,x2,y2; - pt1 = (PointList)ptLstAry[pt1Idx]; - pt2 = (PointList)ptLstAry[pt2Idx]; - x1=pt1.APoint.xyValue[X]; - y1=pt1.APoint.xyValue[Y]; - x2=pt2.APoint.xyValue[X]; - y2=pt2.APoint.xyValue[Y]; - midpt = new PointList(); - pt=new point(); - pt.xyValue = new int[Dimensions]; - so=FindSlope(pt1.APoint,pt2.APoint); - midpt.slope = (4.0 * so - pt1.slope - pt2.slope)/2.0; - pt.xyValue[X]=x1+(x2-x1)/2; - pt.xyValue[Y]=y1+(y2-y1)/2; - midpt.APoint=pt; - ptLstAry.Insert(pt1Idx+1,midpt); - //midpt->NextPoint=pt2; - return(pt1Idx+1); - } - - double FindTheta(point Endpoint, point Centerpoint) - { - double dy,dx,result; - dx = Endpoint.xyValue[X] - Centerpoint.xyValue[X]; - dy = Endpoint.xyValue[Y] - Centerpoint.xyValue[Y]; - result=90.0 - atan_deg((dy/dx)); - if( dx<0 ) result+=180.0; - return(result); - } - - double FindRadius(point Endpoint, point Centerpoint) - { - double dy,dx,r; -// double dy,dx,ddx,ddy,r; - dx = Centerpoint.xyValue[X] - Endpoint.xyValue[X]; - dy = Centerpoint.xyValue[Y] - Endpoint.xyValue[Y]; - r = Math.Sqrt(((dx*dx)+(dy*dy))); - return(r); - } - - - void DrawCurve(LineList linestart, VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - //PointList curpoint,pt2; - int pltptListIdx = -1; -// int debug = 1; //jj - //curpoint=(PointList)linestart.PlotPointsList[pltptListIdx]; - while( ++pltptListIdx < linestart.PlotPointsList.Count -1 ) - { - DoSubArcs(linestart.PlotPointsList,pltptListIdx,pg,pdf); -// pltptListIdx = linestart.PlotPointsList.Count * debug; // jj -// debug++; //jj - //DoSubArcs(curpoint); - //curpoint=(PointList)linestart.PlotPointsList[pltptListIdx]; - } - } - - double GetAngle(double s1) - { - double t1; - t1=atan_deg(s1); - return(t1); - } - - double GetAngleBetweenPoints(point pt1, point pt2) - { - double retval; - retval=GetAngle(FindSlope(pt1,pt2)); - if(pt2.xyValue[X] < pt1.xyValue[X]) - { - if(retval<0) - retval+=180; - else - retval-=180; - } - return(retval); - } - - double SpecialGetAngleBetweenPoints(point pt1,point pt2, double s1) - { - double retval; - if(s1==0.0) - { - if(pt1.xyValue[Y] < pt2.xyValue[Y]) - s1=Convert.ToDouble("1.E99"); - else - s1=Convert.ToDouble("-1.E99"); - } - else - s1 = -1/s1; - retval=GetAngle(s1); - if(pt2.xyValue[X] < pt1.xyValue[X]) - { - if(retval<0) - retval+=180; - else - retval-=180; - } - return(retval); - } - - double GetArcAngle(double s1, double s2) - { - double result,t1,t2; - t1=GetAngle(s1); - t2=GetAngle(s2); - result=t1-t2; - return(result); - } - - void DoSubArcs(ArrayList ptListAry,int aryIdx, VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - bool debug = false; //jsj - int x,y,x1,x2,y1,y2; - PointList pt1 = (PointList)ptListAry[aryIdx]; - PointList pt2 = (PointList)ptListAry[aryIdx+1]; -#if DEBUG - Console.WriteLine("pt1={0},{1},{2}",pt1.APoint.xyValue[0],pt1.APoint.xyValue[1],pt1.slope); - Console.WriteLine("pt2={0},{1},{2}",pt2.APoint.xyValue[0],pt2.APoint.xyValue[1],pt2.slope); -#endif - double theta,delta1,delta2,r1,r2,t1,t2,theta1,theta2,thetaa,t3,t4; - double c1,c2,s1,s2; -// point cp,cp1,cp2; - point cp1,cp2; - t3=FixAngle(GetAngle(pt1.slope)); - t4=FixAngle(GetAngle(pt2.slope)); - thetaa=GetAngleBetweenPoints(pt1.APoint,pt2.APoint); - if((t3-thetaa)*(t4-thetaa) >= 0.0) - { - double tprime; - tprime=FixAngle(thetaa); - if (Math.Abs(tprime-t3) < ANGLELIMIT ) - { - MoveTo(pt1.APoint); - DrawTo(pt2.APoint,pg,pdf); - return; - } - else - { - pt2=(PointList)ptListAry[AddMidPoint(ptListAry,aryIdx,aryIdx+1)]; - t4=FixAngle(GetAngle(pt2.slope)); - thetaa=GetAngleBetweenPoints(pt1.APoint,pt2.APoint); - } - } -// if (debug) //jsj -// return; - - if(thetaa < t3) - t1=t3+90; - else - t1=t3-90; - if(thetaa > t4) - t2=t4+90; - else - t2=t4-90; - theta=t2-t1; - theta1=FixAngle(thetaa-t3); - theta2=theta-theta1; - if(Math.Abs(theta1) < Math.Abs(theta2)) - { - if(Math.Abs(theta1) < ANGLELIMIT ) - { - theta1=0; - theta2=theta; - } - } - else if(Math.Abs(theta2) < Math.Abs(theta1)) - { - if(Math.Abs(theta2) < ANGLELIMIT ) - { - theta2=0; - theta1=theta; - } - } - x1=pt1.APoint.xyValue[X]; - y1=pt1.APoint.xyValue[Y]; - x2=pt2.APoint.xyValue[X]; - y2=pt2.APoint.xyValue[Y]; - s1=sin_deg(t1+180); - s2=sin_deg(t2+180); - c1=cos_deg(t1+180); - c2=cos_deg(t2+180); - if(s1 == 0.0) - { - r2=(x1-x2)/s2; - r1=(y2+r2*c2-y1)/c1; - } - else if(s2 == 0.0) - { - r1=(x2-x1)/s1; - r2=(y1+r1*c1-y2)/c2; - } - else if(c1 == 0.0) - { - r2=(y1-y2)/c2; - r1=(x2+r2*s2-x1)/s1; - } - else if(c2 == 0.0) - { - r1=(y2-y1)/c1; - r2=(x1+r1*s1-x2)/s2; - } - else - { - r2=(((x2-x1)/c1) - ((y2-y1)/s1)) / (s2/s1 - c2/c1); - r1=(y2-y1+r2*s2)/s1; - } - MoveTo(pt1.APoint); - if (debug) //jsj - { - DrawTo(pt2.APoint,pg,pdf); - return; - } - if(Math.Abs(theta1)>ANGLELIMIT && Math.Abs(theta2)>ANGLELIMIT) - { - delta1=(r2-r1)/( - (1.0-cos_deg(theta1)) + - (1.0-cos_deg(theta2))*sin_deg(theta1)/sin_deg(theta2)); - r1=Math.Floor(0.5+r1+delta1); - cp1=FindModifiedCenter(r1,pt1.APoint,t1); -// cp1 = FindCenterOfArc(pt1.APoint,pt1.slope,pt2.APoint,pt2.slope); // jj - x=(int)(cp1.xyValue[X]+r1*cos_deg(t1+theta1)); - y=(int)(cp1.xyValue[Y]+r1*sin_deg(t1+theta1)); - delta2=delta1*sin_deg(theta1)/sin_deg(theta2); -// x = pt2.APoint.xyValue[X]; //jj -// y = pt2.APoint.xyValue[Y]; //jj - r2=Math.Floor(0.5+r2-delta2); - cp2=FindModifiedCenter(r2,pt2.APoint,t2); -#if DEBUG - Console.WriteLine("DrawArc1"); -#endif - DrawArc(r1,t1,t1+theta1,cp1,x,y,pg,pdf); - MoveTo(pt2.APoint); - if(r2 > 15000) - { -#if DEBUG - Console.WriteLine("DrawAbs1 {0},{1}",x,y); -#endif - DrawAbsolute(x,y,pg,pdf); - } - else - { -#if DEBUG - Console.WriteLine("DrawArc2"); -#endif - DrawArc(r2,t2,t2-theta2,cp2,x,y,pg,pdf); - } -// // Zfree(&cp1); -// // Zfree(&cp2); - } - else if(Math.Abs(theta1)>ANGLELIMIT) - { - delta1=(r2-r1)/(1.0-cos_deg(theta1)); - r1=Math.Floor(0.5+r1+delta1); - cp1=FindModifiedCenter(r1,pt1.APoint,t1); -// cp1=FindCenterOfArc(pt1.APoint,pt1.slope,pt2.APoint,pt2.slope); //jj - x=(int)(cp1.xyValue[X]+r1*cos_deg(t1+theta1)); - y=(int)(cp1.xyValue[Y]+r1*sin_deg(t1+theta1)); - if(r1 > 15000) - { -#if DEBUG - Console.WriteLine("DrawAbs2"); -#endif - DrawAbsolute(x,y,pg,pdf); - } - else - { -#if DEBUG - Console.WriteLine("DrawArc3"); -#endif - DrawArc(r1,t1,t1+theta1,cp1,x,y,pg,pdf); - } - MoveAbsolute(x,y); -#if DEBUG - Console.WriteLine("DrawTo1"); -#endif - DrawTo(pt2.APoint,pg,pdf); -// x = pt2.APoint.xyValue[X]; //jj -// y = pt2.APoint.xyValue[Y]; //jj -#if DEBUG - Console.WriteLine("DrawArc4"); -#endif - DrawArc(r1,t1,t1+theta1,cp1,x,y,pg,pdf); - // Zfree(&cp1); - - } - else if(Math.Abs(theta2)>ANGLELIMIT) - { - delta2=(r2-r1)/(1.0-cos_deg(theta2)); - r2=Math.Floor(0.5+r2-delta2); - cp2=FindModifiedCenter(r2,pt2.APoint,t2); -// cp2=FindCenterOfArc(pt1.APoint,pt1.slope,pt2.APoint,pt2.slope); //jj - x=(int)(cp2.xyValue[X]+r2*cos_deg(t2-theta2)); - y=(int)(cp2.xyValue[Y]+r2*sin_deg(t2-theta2)); -#if DEBUG - Console.WriteLine("DrawAbs3"); -#endif - DrawAbsolute(x,y,pg,pdf); - MoveTo(pt2.APoint); - if(r2 > 15000) - { -#if DEBUG - Console.WriteLine("DrawAbs4"); -#endif - DrawAbsolute(x,y,pg,pdf); - } - else - { -#if DEBUG - Console.WriteLine("DrawArc5"); -#endif - DrawArc(r2,t2,t2-theta2,cp2,x,y,pg,pdf); - } -// x = pt2.APoint.xyValue[X]; //jj -// y = pt2.APoint.xyValue[Y]; //jj -#if DEBUG - Console.WriteLine("DrawArc6"); -#endif - DrawArc(r2,t2,t2-theta2,cp2,x,y,pg,pdf); - // Zfree(&cp2); - - } - else - { -#if DEBUG - Console.WriteLine("DrawTo2"); -#endif - DrawTo(pt2.APoint,pg,pdf); - pt2.slope=FindSlope(pt1.APoint,pt2.APoint); - } - return; - } - - void Graphics(int flag) - { - // if(graph_GraphicsStr[flag]) - // fprintf(stdprn,"%s",graph_GraphicsStr[flag]); - } - - void SetPenDiameter(int pd) - { - if ((pd * ConvertToTwips) != CurPenWidth) - { - CurPenWidth= (int)(pd * ConvertToTwips); - } - } - - void PrintStackError(string relation, int limit) - { - MessageBox.Show(String.Format("Position Stack Pointer {0} {1}",relation,limit.ToString()),"Print Stack Error"); - // printf("Position Stack Pointer %s %d",relation,limit); - // spc_exit(3); - } - - void SavePosition() - { - if(stack >= MAX_XY_STACK) PrintStackError(">=",MAX_XY_STACK); - SavedX[stack]=Position[X]; - SavedY[stack++]=Position[Y]; - } - - void RecallPosition() - { - if(stack <= 0) PrintStackError(" <",0); - Position[X]=SavedX[--stack]; - Position[Y]=SavedY[stack]; - } - - void MoveTo(point pnt) - { - MoveAbsolute(pnt.xyValue[X],pnt.xyValue[Y]); - } - - void DrawTo(point pnt, VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - DrawAbsolute(pnt.xyValue[X],pnt.xyValue[Y],pg,pdf); - } - - void MoveAbsolute(int ptx, int pty) - { - int x,y; - x=ptx-Position[X]; - y=Position[Y]-pty; - MoveRelative(x,y); - } - - void DrawAbsolute(int ptx,int pty, VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - int x,y; - x=ptx-Position[X]; - y=Position[Y]-pty; - DrawRelative(x,y,pg,pdf); - } - - void DrawGridAbsolute(int ptx,int pty,VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - int x,y; - x=ptx-Position[X]; - y=Position[Y]-pty; - DrawGridRelative(x,y,pg,pdf); - } - - void relval(string ptr,int i) - { - ptr = string.Format("+{0}",i.ToString()); - } - - long DotsToPlotterUnitsX(int x) - { - long retval; - retval = (long)((1.0*x*HP_FudgeX) / 300.0 + .5); - return( retval ); - } - - long DotsToPlotterUnitsY(int y) - { - long retval; - retval = (long)((1.0*y*HP_FudgeY) / 300.0 + .5); - return( retval ); - } - - void MoveRelative(int x,int y) - { - long xl,yl; - Position[X]+=x; - Position[Y]-=y; - } - - void DrawRelative(int x,int y,VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { -// long xl,yl; - if(Visible == 0) - MoveRelative(x,y); - else - { - int toX, toY; - toX = Position[X]+x; - toY = Position[Y]-y; -// toY = Position[Y]+y; - VG_Line RelLine = new VG_Line(Position[X],Position[Y],toX,toY,CurPenWidth,pg); -// VG_Line RelLine = new VG_Line(Position[X],Position[Y],x,-y,CurPenWidth,pg); - Position[X]+=x; - Position[Y]-=y; -// Position[Y]+=y; - RelLine.ToPdf(pdf); -// if(HPGLMode != 0) -// { -// xl=DotsToPlotterUnitsX(x); -// yl=DotsToPlotterUnitsY(y); -// // !!! OUTPUT DRAW RELATIVE COMMAND -// MessageBox.Show("!!! OUTPUT DRAW RELATIVE COMMAND 1","DrawRelative()"); -// // fprintf(PRT,HPGL_Command[3],-xl,yl); /* */ -// } -// else -// MessageBox.Show("!!! OUTPUT DRAW RELATIVE COMMAND 2","DrawRelative()"); -// // !!! OUTPUT DRAW RELATIVE COMMAND -// // fprintf(PRT,graph_DrawRelative,x,y); - } - } - - void DrawGridRelative(int x, int y,VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - if(Visible == 0) - MoveRelative(x,y); - else - { -/*** - if(StupidHP == 2) - { //StupidHP==5 is RTF driver - if(x==0) BlockRelative(PrevPen,y); - else if(y==0) BlockRelative(x,PrevPen); - MoveRelative(x,y); - - } - else -***/ - DrawRelative(x,y,pg,pdf); - } - } - - void MoveForArc(point pnt) - { - Position[X]+=pnt.xyValue[X]; - Position[Y]-=pnt.xyValue[Y]; - } - - void DrawArc(double radius,double Sangle,double Eangle,point cp,int x, int y, VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { -#if DEBUG - Console.WriteLine("r={0} sAngle={1} eAngle={2} cp={3},{4} x={5} y={6}",radius,Sangle,Eangle,cp.xyValue[0],cp.xyValue[1],x,y); -#endif - // double inc=2000.,r1; - int dx,dy; - long radchk; - radchk=(long)radius; -// if(radchk > 15000L) - if(radchk > 72000L) - { - DrawAbsolute(x,y,pg,pdf); - return; - } - dx = x - cp.xyValue[X]; //jj -// dx=cp.xyValue[X]-Position[X]; -// dy=cp.xyValue[Y]-Position[Y]; - dy=Math.Abs(cp.xyValue[Y]-Position[Y]); //jj - //r1=radius; - /* - ** for the HP series of printers we recalculate the the x and y positions - ** because of a rounding error that will propagate every time - ** an arc segment is drawn. This has the nasty effect of incorrectly - ** drawing curves. - */ -// if( HPGLMode != 0 ) -// { -// Position[X] += (int)((radius*cos_deg(Eangle) - radius*cos_deg(Sangle))); -// Position[Y] -= (int)((radius*sin_deg(Sangle) - radius*sin_deg(Eangle))); -// } -// Sangle=90-Sangle; -// Eangle=90-Eangle; -// Sangle=180-Sangle; //jj -// Eangle=180-Eangle; //jj - -// if(HPGLMode != 0) -// { -// long xl,yl; -// xl=DotsToPlotterUnitsX(dx); -// yl=DotsToPlotterUnitsY(dy); - // fprintf(PRT,HPGL_Command[4],-xl,-yl,(int)(Sangle-Eangle)); -// VG_Arc arc = new VG_Arc(cp.xyValue[X]-dx,cp.xyValue[Y]+dy,dx*2,dy*2,(float)Sangle,(float)(Sangle - Eangle),5,pg); -// VG_Arc arc = new VG_Arc(cp.xyValue[X]-dx,cp.xyValue[Y]-dy,dx*2,dy*2,(float)Sangle,(float)(Sangle - Eangle),CurPenWidth,pg); - radius=radius; - float x1=cp.xyValue[X]-(float)radius; - float y1=cp.xyValue[Y]-(float)radius; - float w1=(float) radius * 2; - VG_Arc arc = new VG_Arc(x1,y1,w1,w1,(float)Sangle,(float)(Eangle - Sangle),CurPenWidth,pg); - //VG_Arc arc = new VG_Arc(0,0,5000,5000,(float)Sangle,(float)(Eangle - Sangle),CurPenWidth,pg); -#if DEBUG - Console.WriteLine("arc {0},{1},{2},{3},{4},{5}",x1,y1,w1,w1,(float)Sangle,(float)(Eangle - Sangle)); -#endif - arc.ToPdf(pdf); -// MessageBox.Show("!!! HPGL_COMMAND[4]","DrawArc()"); -// } -// else -// { -// SavePosition(); -// if(dx>0) -// MessageBox.Show("!!! graph_MoveRelativeXPos","DrawArc()"); -// // fprintf(PRT,graph_MoveRelativeXPos,dx); -// else -// MessageBox.Show("!!! graph_MoveRelativeXNeg","DrawArc()"); -// // fprintf(PRT,graph_MoveRelativeXNeg,-dx); -// if(dy>0) -// MessageBox.Show("!!! graph_MoveRelativeYPos","DrawArc()"); -// // fprintf(PRT,graph_MoveRelativeYPos,dy); -// else -// MessageBox.Show("!!! graph_MoveRelativeYNeg","DrawArc()"); -// // fprintf(PRT,graph_MoveRelativeYNeg,-dy); -// MessageBox.Show("!!! graph_ArcFunction1","DrawArc()"); -// // fprintf(PRT,graph_ArcFunction1, -// // radius-4,(radius+4),FMin(Sangle,Eangle),FMax(Sangle,Eangle)); -// RecallPosition(); -// } - } - - void DrawGridLine(int flag,int val,VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - ActiveBoxList curbox; - int v1,v2; - int BoxesIdx = 0; - int BoxPtrIdx = 0; -// FindBoxesinArea(val, !flag); - FindBoxesinArea(val,(flag==0)?1:0); - v1=Position[flag]; - if (AllActiveBoxes.Count > 0) - { - curbox=(ActiveBoxList)AllActiveBoxes[BoxesIdx]; - while(BoxesIdx < AllActiveBoxes.Count) - { - int my_x, my_y; - v2=((BoxList)curbox.BoxPtr[BoxPtrIdx]).BoxMinimum.xyValue[flag]; - my_x = (flag==X)? ( (v2 < printerunits[flag])? v2 : printerunits[flag] ) - : val; - my_y = (flag==Y) ? - ( (v2 < printerunits[flag]) ? v2 : printerunits[flag] ) - : val; - DrawGridAbsolute(my_x,my_y,pg,pdf); - v1=((BoxList)curbox.BoxPtr[BoxPtrIdx]).BoxMaximum.xyValue[flag]; - while((BoxesIdx < AllActiveBoxes.Count) && (((BoxList)curbox.BoxPtr[BoxPtrIdx]).BoxMinimum.xyValue[flag] < v1)) - { - v1=(((BoxList)curbox.BoxPtr[BoxPtrIdx]).BoxMaximum.xyValue[flag]); - BoxesIdx++; - if (BoxesIdx < AllActiveBoxes.Count) - curbox=(ActiveBoxList)AllActiveBoxes[BoxesIdx]; - } - MoveAbsolute((flag==X?v1:val),(flag==Y?v1:val)); - } - } - v2=printerunits[flag]; - if (v1 < v2) DrawGridAbsolute((flag==X?v2:val),(flag==Y?v2:val),pg,pdf); - FreeActiveBoxes(); - } - - void LogScale(int flag) - { - double newminimum, newmaximum, maxlimit=maximum[flag]*.9; -// int i; - newminimum=1.0; - while(newminimum < minimum[flag])newminimum *= 10.0; - while(newminimum > minimum[flag])newminimum /= 10.0; - newmaximum=10.0 * newminimum; - cycles[flag]=1; - while( newmaximum < maxlimit ) - { - newmaximum *= 10.0; - cycles[flag]++; - } - onecycle[flag]=printerunits[flag]/cycles[flag]; - minimum[flag]=newminimum; - maximum[flag]=newmaximum; - } - - void LinearScale(int flag) - { - double mantissa,nx; - double newminimum, newmaximum; - int power=0; - if( spcminor[flag] == 0 ) - minor[flag]=10; - else - minor[flag]=spcminor[flag]; - if( delta[flag] == 0 ) - { - delta[flag]=maximum[flag]-minimum[flag]; - mantissa=Math.Log10(delta[flag]); - while(mantissa < 1.2) - { - mantissa++; - power--; - } - while(mantissa > 1.2) - { - mantissa--; - power++; - } - if(mantissa < 0)mantissa=0; - nx=Math.Pow(10.0,mantissa); - if(nx > 5.0) - { - delta[flag]=1.0; - } - else if(nx > 3.001) - { // allow for roundoff - delta[flag]=0.5; - } - else if(nx > 2.001) - { // allow for roundoff - delta[flag]=0.25; - } - else - { - delta[flag]=0.2; - if(spcminor[flag] == 0) minor[flag]=8; - } - while(power>0) - { - power--; - delta[flag] *= 10.0; - } - while(power<0) - { - power++; - delta[flag] /= 10.0; - } - } - if(GridOnFlag==0 || GridOnFlag==1) - minor[flag]=1; - else if(GridOnFlag==2) - minor[flag] /= 2; - newminimum=((int)(0.01+minimum[flag]/delta[flag])) * delta[flag]; - if(newminimum > minimum[flag]+(delta[flag] * 0.001)) - newminimum-=delta[flag]; - newmaximum=((int)(maximum[flag]/delta[flag])) * delta[flag]; - if(newmaximum < maximum[flag]-(delta[flag] * 0.001)) - newmaximum+=delta[flag]; - minimum[flag]=newminimum; - maximum[flag]=newmaximum; - } - - void err_exit(string msg,string msg2) - { - MessageBox.Show(msg + "\n" + msg2 + "\n\n This p=Process Will Terminate","\n## ERROR ## - "); - Environment.Exit(255); - } - - void FindBoxesinArea(int ptval,int flag) - { - BoxList cptr; - int BoxesIdx =0; - while (BoxesIdx < AllBoxes.Count) - { - cptr= (BoxList)AllBoxes[BoxesIdx]; - if ( cptr.BoxMinimum.xyValue[flag] <= ptval && - cptr.BoxMaximum.xyValue[flag] >= ptval ) - AddBoxToActiveList(cptr); - BoxesIdx++; - } - } - - void AddBoxToActiveList(BoxList bptr) - { - ActiveBoxList NewActiveBox = new ActiveBoxList(); - int prevboxIdx = -1; - ActiveBoxList cbox; - - NewActiveBox.BoxPtr = new ArrayList(); - NewActiveBox.BoxPtr.Add(bptr); - int AllActBoxIdx = 0; - if( AllActiveBoxes.Count > 0 ) - { - cbox = (ActiveBoxList)AllActiveBoxes[AllActBoxIdx]; - prevboxIdx = 0; - while ( AllActBoxIdx < AllActiveBoxes.Count && - (cbox.BoxPtr.Count > 0 && (bptr.BoxMinimum.xyValue[DrawDirection] > - ((BoxList)cbox.BoxPtr[AllActBoxIdx]).BoxMinimum.xyValue[DrawDirection])) ) - { - prevboxIdx=AllActBoxIdx; - AllActBoxIdx++; - if (AllActBoxIdx < AllActiveBoxes.Count) - cbox=(ActiveBoxList)AllActiveBoxes[AllActBoxIdx]; - else - prevboxIdx = -1; // will append to end of list - } - if (AllActBoxIdx < AllActiveBoxes.Count) - AllActiveBoxes.Insert(AllActBoxIdx,NewActiveBox); - } - if(prevboxIdx == -1) - AllActiveBoxes.Add(NewActiveBox); - - } - - void FreeActiveBoxes() - { - AllActiveBoxes.Clear(); - } - - void GenGrid(int flag,int ss,int ee,int dd,int w,int lw,int goffset,VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - int val,wn,valn; - double p2; -// double p2,size; - int n,dn,MinorGrid=0; - if((GridOnFlag * lw)<=1)return; - if (ee/ss == 10) MinorGrid=2; - n=ss; - p2=n; -// w = (int)(Math.Log10(ee/p2) / w); //jj - w = (int)(w / Math.Log10(ee/p2)); //jj -// w /= (int)Math.Log10(ee/p2); - val=(int)(Math.Log10(p2/ss)*w + goffset); - MoveAbsolute((flag==X?val:0),(flag==Y?val:0)); - DrawGridLine((flag==0)?1:0,val,pg,pdf); - if((GridOnFlag * lw) == 2)return; - SetPenDiameter(lw); - while(n < ee) - { - n+=dd; - p2=n; - valn=(int)(Math.Log10(p2/ss)*w + goffset); - wn=valn-val; - if(wn > DPI/20 && lw > 1) - { - if(wn > DPI*2/5)dn=dd/10; - else if(wn > DPI/5) dn=dd/5; - else dn=dd/2; - GenGrid(flag,n-dd,n,dn,wn,lw-1,val,pg,pdf); - wn=0; - } - val=valn; - if (flag ==Y) - val = printerunits[Y] - val; //jj - MoveAbsolute((flag==X?val:0),(flag==Y?val:0)); - if((MinorGrid != 0) && (MinorGrid < 10)) - { -// SavePosition(); -// double SaveFontPitch = FontPitch; //jj - // fprintf(PRT,graph_MinorMark[flag],MinorGrid++); -// if (flag == 0) -// MoveRelative((int)(15 * ConvertToTwips),(int)(60 * ConvertToTwips)); // these numbers are in dots -// else -// MoveRelative((int)(-30 * ConvertToTwips),(int)(9 * ConvertToTwips)); -// FontPitch = 5.0; //jj -// if (flag == 0) -// MoveRelative(0,160); // these numbers are in dots -//// MoveRelative(0,40); // these numbers are in dots -// else -// MoveRelative(-30,0); -// SavePosition(); -// if (flag == 0) -// MoveRelative(30,0); // these numbers are in dots -// else -// MoveRelative(0,0); - WriteValue(flag,MinorGrid++,true,pg,pdf); //these numbers are in dots - // FontPitch = SaveFontPitch; //jj -// RecallPosition(); - } - DrawGridLine((flag==0)?1:0,val,pg,pdf); - } - } - - void PrintText(string txt,VG.Page pg, C1.C1Pdf.C1PdfDocument pdf) - { - StringBuilder tstr = new StringBuilder(txt); -// int ptr,sptr; - int ptr; - SavePosition(); /* 'cause TEXT...,E screws up position! */ - ptr=0; -// sptr=0; - while (ptr < tstr.Length) -// while(ptr < txt.Length) - { - if ("`øòó".IndexOf(tstr[ptr]) >= 0) -// if("`øòó".IndexOf(txt[ptr]) >= 0 ) - { - string SpecialChar=""; -// int len = 0; - switch ( (byte)tstr[ptr]) -// switch ( (byte)txt[ptr] ) - { - case 0x60 : /* backquote */ - case 0xF8 : SpecialChar = "\u00B0"; /* degree symbol */ - break; - case 0xF2 : SpecialChar= "\u2265"; /* greaterthanequal */ - break; - case 0xF3 : SpecialChar= "\u2264"; /* lessthanequal */ - break; - } - tstr.Remove(ptr,1); - tstr.Insert(ptr,SpecialChar); - ptr++; -// len = txt.Substring(sptr,ptr-sptr).Length; -// GraphText( txt.Substring(sptr,ptr-sptr),pg,pdf); -// MoveRelative(len * CWIDEDOTS,0); -// sptr = ++ptr; -// GraphText(SpecialChar,pg,pdf); -// MoveRelative(CWIDEDOTS,0); - -// //!!! ADD CALLS TO OUTPUT THESE STRINGS -// MessageBox.Show("ADD CALLS TO OUTPUT SPECIAL CHARS","PrintText()"); -// // fprintf(PRT,graph_PrntStr[2]); -// // fprintf(PRT,"%c",GraphicChar&0x7F); -// // fprintf(PRT,graph_PrntStr[3]); - } - else - { - ptr++; - } - } - GraphText(tstr.ToString(),pg,pdf); -// if( ptr > sptr ) GraphText( txt.Substring(sptr,ptr-sptr),pg,pdf); - RecallPosition(); - } - - void FreeBoxList() - { - AllBoxes.Clear(); - } - - void FreeLineList() - { - AllPlots.Clear(); - } - -// void FreePointList(PointList ptr) -// { -// PointListArray.Clear(); -// // struct PointList *bptr,*nptr; -// // bptr=ptr; -// // while(bptr) -// // { -// // nptr=bptr->NextPoint; -// // Zfree(&bptr->APoint); -// // Zfree(&bptr); -// // bptr=nptr; -// // } -// } - - void Init_Graphic_Vars() - { - int i; - SavedX = new int[MAX_XY_STACK]; - SavedY = new int[MAX_XY_STACK]; - LinesUsed=0; /* Number lines used by graph, in dots */ - Visible=1; - ShadowFlag = 0; - // _setmem(valuestring,100,'\0'); - // _setmem(powerstring,100,'\0'); - CurPenWidth = 0; - DrawDirection = -1; - AxisTitles[X] = null; - AxisTitles[Y] = null; - AxisLabel[0] = 1; - AxisLabel[1] = 1; - EndFlag=0; - for (i=0;i -1) - { - // print text up to the superscript - tstr = txt.Substring(sidx,tidx-sidx); - drawText = new VG_Text(Xpos,Ypos,(int)FontPitch,tstr,"Letter Gothic","","","",pg); - drawText.ToPdf(pdf); - Xpos+= (CWIDEDOTS * tstr.Length); - tidx+= SuperScript[0].Length; - idx = tidx; - sidx = idx; - tidx = txt.IndexOf(SuperScript[1],idx); - if (tidx > 0) - { - // switch font pitch, move up some, and print the superscript text - tstr = txt.Substring(sidx,tidx - sidx); -// Xpos+= (CWIDEDOTS * tstr.Length); - Ypos -= (CHIGHDOTS / 2); // move up half a char heigth - drawText = new VG_Text(Xpos,Ypos,(int)(FontPitch/2),tstr,"Letter Gothic","","","",pg); - drawText.ToPdf(pdf); - Ypos += (CHIGHDOTS / 2); // move back down - Xpos += ((CWIDEDOTS/2) * tstr.Length); // positon half the width of the string - tidx += SuperScript[1].Length; - idx = tidx; - sidx = idx; - continue; // go back to beginning of while loop - } - } - else if ((tidx = txt.IndexOf(SubScript[0],idx)) > -1) - { - // print text up to the superscript - tstr = txt.Substring(sidx,tidx-sidx); - drawText = new VG_Text(Xpos,Ypos,(int)FontPitch,tstr,"Letter Gothic","","","",pg); - drawText.ToPdf(pdf); - Xpos+= (CWIDEDOTS * tstr.Length); - tidx+= SubScript[0].Length; - idx=tidx; - sidx = idx; - tidx = txt.IndexOf(SubScript[1],idx); - if (tidx > 0) - { - // switch font pitch, move up some, and print the superscript text - tstr = txt.Substring(sidx,tidx - sidx); -// Xpos+= (CWIDEDOTS * tstr.Length); -// Ypos += (CHIGHDOTS / 2); // move down half a char heigth - drawText = new VG_Text(Xpos,Ypos,(int)(FontPitch/2),tstr,"Letter Gothic","","","",pg); - drawText.ToPdf(pdf); -// Ypos -= (CHIGHDOTS / 2); // move back up - Xpos += ((CWIDEDOTS/2) * tstr.Length); // positon half the width of the string - tidx += SubScript[1].Length; - idx = tidx; - sidx = idx; - continue; // go back to beginning of while loop - } - } - else - { - idx++; - } - } // end while - - if (sidx < txt.Length) - { - tstr = txt.Substring(sidx); - drawText = new VG_Text(Xpos,Ypos,(int)FontPitch,tstr,"Letter Gothic","","","",pg); - drawText.ToPdf(pdf); - } - } - - -// public XYPlot() -// { -// // -// // TODO: Add constructor logic here -// // -// AxisLabel[0] = 1; -// AxisLabel[1] = 1; -// } - - public XYPlot(string fname, string PdfFileName) - { - char Command, PrevCommand = ' '; - Init_Graphic_Vars(); - LoadBuff(fname); - FixBuffIfNeeded(); - GetScaleInfo(); - - C1.C1Pdf.C1PdfDocument c1pdf = new C1.C1Pdf.C1PdfDocument(); - c1pdf.FontType = C1.C1Pdf.FontTypeEnum.Embedded; // embed fonts - - VG.Page pg = new Page(true,(float)(1440),(float)(1440)); - - while ((Command = char.ToUpper(getchr())) != '\0') - { - LineDiv = 0; - LineFlag = CURVE; - ShadowFlag = 0; - switch (Command) - { - case 'T': - ShadowFlag+=2; // 2 for no box - GetBoxParameters(); - break; - case 'W': - ShadowFlag++; // 1 for shadow box - GetBoxParameters(); - break; - case 'B': - GetBoxParameters(); // 0 for box - break; - case 'D': - LineDiv = getint(); - LineFlag = STRAIGHT; - GetLineParameters(); - break; - case 'L': - LineFlag = STRAIGHT; - GetLineParameters(); - break; - case 'C': - GetLineParameters(); - break; - case 'X': - GetAxisTitle(X); - break; - case 'Y': - GetAxisTitle(Y); - break; - case 'Z': - YLandScape = 1; - YTitleOrigin = GetPair(USER); - GetAxisTitle(Y); - break; - case 'A': - AxisLabel[0] = getint(); - AxisLabel[1] = getint(); - break; - default: - if (PrevCommand.Equals(null)) - MessageBox.Show("Check the first line of the X/Y Plot definition.","Unrecognized Graph Command"); - else - MessageBox.Show(string.Format("Problem with the X/Y Plot Command after {0}",PrevCommand.ToString()),"Unrecognized Graph Command"); - // sprintf(LineBuff,"Unrecognized Graph Command: '%c'",command); - // err_exit(LineBuff,0); - break; - } - PrevCommand = Command; - } - Graphics(1); - GenerateGrid(pg,c1pdf); - DoAxisTitles(pg,c1pdf); - DoBoxes(pg,c1pdf); - DrawLines(pg,c1pdf); - Graphics(0); - c1pdf.Save(PdfFileName); - FreeBoxList(); - FreeLineList(); - - CloseGraph(); -// return(LinesUsed); - } - } - -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/XYPlots.csproj b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/XYPlots.csproj deleted file mode 100644 index 28128396..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/XYPlots.csproj +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/XYPlots.sln b/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/XYPlots.sln deleted file mode 100644 index 53fe3202..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ZZZNotUsed/XYPlots/XYPlots.sln +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XYPlots", "XYPlots.csproj", "{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test XYPlots", "Test XYPlots\Test XYPlots.csproj", "{2BB292F1-507C-492F-AE66-CBEA54632B59}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Debug.ActiveCfg = Debug|.NET - {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Debug.Build.0 = Debug|.NET - {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Release.ActiveCfg = Release|.NET - {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Release.Build.0 = Release|.NET - {2BB292F1-507C-492F-AE66-CBEA54632B59}.Debug.ActiveCfg = Debug|.NET - {2BB292F1-507C-492F-AE66-CBEA54632B59}.Debug.Build.0 = Debug|.NET - {2BB292F1-507C-492F-AE66-CBEA54632B59}.Release.ActiveCfg = Release|.NET - {2BB292F1-507C-492F-AE66-CBEA54632B59}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/AssemblyInfo.cs b/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/AssemblyInfo.cs deleted file mode 100644 index 7e3b35a5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// diff --git a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/AssemblyInfo.cs.bak b/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/AssemblyInfo.cs.bak deleted file mode 100644 index a9833df8..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/AssemblyInfo.cs.bak +++ /dev/null @@ -1,57 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.1.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyName("")] diff --git a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ImageDialog.cs b/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ImageDialog.cs deleted file mode 100644 index 381a64c5..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ImageDialog.cs +++ /dev/null @@ -1,119 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ImageDialog.cs $ $Revision: 2 $ - * $Author: Kathy $ $Date: 1/08/03 10:24a $ - * - * $History: ImageDialog.cs $ - * - * ***************** Version 2 ***************** - * User: Kathy Date: 1/08/03 Time: 10:24a - * Updated in $/LibSource/ctlXMLEditLib - * added header - *********************************************************************************************/ -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace ctlXMLEditLib -{ - /// - /// Summary description for ViewImage - View Image pops up a dialog - /// which contains a display of the image file. - /// - public class ImageDialog : System.Windows.Forms.Form - { - private System.Windows.Forms.PictureBox roImage; - private System.Windows.Forms.Button btnClose; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - public ImageDialog(string filename) - { - // - // Required for Windows Form Designer support - // - InitializeComponent(); - Image.GetThumbnailImageAbort myCallback = - new Image.GetThumbnailImageAbort(ThumbnailCallback); - - Bitmap bm = new Bitmap(filename); - SizeF sizef = new SizeF(bm.Width/bm.HorizontalResolution, - bm.Height/bm.VerticalResolution); - // 504 & 384 is the size of the image window (roImage). - float fscale = Math.Min(504/sizef.Width,384/sizef.Height); - sizef.Width *= fscale; - sizef.Height *= fscale; - Image thmb = bm.GetThumbnailImage((int)sizef.Width, (int)sizef.Height, myCallback, IntPtr.Zero ); - - this.roImage.Image = thmb; - } - - public bool ThumbnailCallback() - { - return false; - } - - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.roImage = new System.Windows.Forms.PictureBox(); - this.btnClose = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // roImage - // - this.roImage.Location = new System.Drawing.Point(32, 8); - this.roImage.Name = "roImage"; - this.roImage.Size = new System.Drawing.Size(504, 384); - this.roImage.TabIndex = 0; - this.roImage.TabStop = false; - // - // btnClose - // - this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnClose.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); - this.btnClose.Location = new System.Drawing.Point(240, 432); - this.btnClose.Name = "btnClose"; - this.btnClose.Size = new System.Drawing.Size(112, 24); - this.btnClose.TabIndex = 1; - this.btnClose.Text = "Close"; - // - // ImageDialog - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(568, 477); - this.Controls.AddRange(new System.Windows.Forms.Control[] { - this.btnClose, - this.roImage}); - this.Name = "ImageDialog"; - this.Text = "View Image"; - this.ResumeLayout(false); - - } - #endregion - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ImageDialog.resx b/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ImageDialog.resx deleted file mode 100644 index a3863deb..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ImageDialog.resx +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ImageDialog - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ZoomDialog.cs b/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ZoomDialog.cs deleted file mode 100644 index c2f238c7..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ZoomDialog.cs +++ /dev/null @@ -1,151 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ZoomDialog.cs $ $Revision: 3 $ - * $Author: Kathy $ $Date: 12/06/02 11:56a $ - * - * $History: ZoomDialog.cs $ - * - * ***************** Version 3 ***************** - * User: Kathy Date: 12/06/02 Time: 11:56a - * Updated in $/LibSource/ctlXMLEditLib - * change font for zoom - * - * ***************** Version 2 ***************** - * User: Kathy Date: 11/04/02 Time: 1:38p - * Updated in $/LibSource/ctlXMLEditLib - * wasn't displaying text & make text fixed font for alignment - * - * ***************** Version 1 ***************** - * User: Jsj Date: 8/23/02 Time: 3:03p - * Created in $/LibSource/ctlXMLEditLib - *********************************************************************************************/ - -using System; -using System.Drawing; -using System.Collections; -using System.ComponentModel; -using System.Windows.Forms; - -namespace ctlXMLEditLib -{ - /// - /// Summary description for ZoomDialog. - /// - /// - - public class ZoomDialog : System.Windows.Forms.Form - { - private System.Windows.Forms.Button btnSave; - private System.Windows.Forms.Button btnCancel; - private System.Windows.Forms.TextBox tbZoom; - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private string edittext; - - public string ZoomText - { - get - { - return tbZoom.Text; - } - } - - public ZoomDialog(string zmtext) - { - // - // Required for Windows Form Designer support - // - edittext = zmtext; - InitializeComponent(); - tbZoom.Text = zmtext; - // - // TODO: Add any constructor code after InitializeComponent call - // - } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.tbZoom = new System.Windows.Forms.TextBox(); - this.btnSave = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // tbZoom - // - this.tbZoom.Font = new System.Drawing.Font("Letter Gothic", 8.249999F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tbZoom.Location = new System.Drawing.Point(24, 16); - this.tbZoom.Multiline = true; - this.tbZoom.Name = "tbZoom"; - this.tbZoom.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.tbZoom.Size = new System.Drawing.Size(576, 392); - this.tbZoom.TabIndex = 0; - // - // btnSave - // - this.btnSave.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnSave.Location = new System.Drawing.Point(80, 440); - this.btnSave.Name = "btnSave"; - this.btnSave.Size = new System.Drawing.Size(80, 32); - this.btnSave.TabIndex = 1; - this.btnSave.Text = "Save"; - this.btnSave.Click += new System.EventHandler(this.btnSave_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(192, 440); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(80, 32); - this.btnCancel.TabIndex = 2; - this.btnCancel.Text = "Cancel"; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // ZoomDialog - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(616, 485); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnSave); - this.Controls.Add(this.tbZoom); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Name = "ZoomDialog"; - this.Text = "Zoom"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - #endregion - private void btnSave_Click(object sender, System.EventArgs e) - { - this.Close(); - } - private void btnCancel_Click(object sender, System.EventArgs e) - { - this.Close(); - } - - } -} diff --git a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ZoomDialog.resx b/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ZoomDialog.resx deleted file mode 100644 index 19dc0dd8..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ZoomDialog.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ctlXMLEdit.cs b/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ctlXMLEdit.cs deleted file mode 100644 index 276ac97c..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ctlXMLEdit.cs +++ /dev/null @@ -1,1670 +0,0 @@ -/********************************************************************************************* - * Copyright 2002 - Volian Enterprises, Inc. All rights reserved. - * Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE - * ------------------------------------------------------------------------------ - * $Workfile: ctlXMLEdit.cs $ $Revision: 36 $ - * $Author: Jsj $ $Date: 7/06/06 9:32a $ - * - * $History: ctlXMLEdit.cs $ - * - * ***************** Version 36 ***************** - * User: Jsj Date: 7/06/06 Time: 9:32a - * Updated in $/LibSource/ctlXMLEditLib - * needed full path to read ROAPP.INI - * - * ***************** Version 35 ***************** - * User: Jsj Date: 5/03/05 Time: 11:44a - * Updated in $/LibSource/ctlXMLEditLib - * - * ***************** Version 34 ***************** - * User: Jsj Date: 7/02/03 Time: 9:26a - * Updated in $/LibSource/ctlXMLEditLib - * made messagebox calls modal by removing the parent window reference - * - * ***************** Version 33 ***************** - * User: Kathy Date: 6/11/03 Time: 2:01p - * Updated in $/LibSource/ctlXMLEditLib - * Bug fix B2003-045 (save date as part of graphic) - * - * ***************** Version 32 ***************** - * User: Kathy Date: 5/21/03 Time: 12:41p - * Updated in $/LibSource/ctlXMLEditLib - * B2003-036: save of group data to ro if both have a common field - * - * ***************** Version 31 ***************** - * User: Kathy Date: 2/07/03 Time: 11:19a - * Updated in $/LibSource/ctlXMLEditLib - * Error on pathname compares if long filename - * - * ***************** Version 30 ***************** - * User: Kathy Date: 2/03/03 Time: 10:36a - * Updated in $/LibSource/ctlXMLEditLib - * UI Improve - * - * ***************** Version 29 ***************** - * User: Kathy Date: 1/22/03 Time: 12:17p - * Updated in $/LibSource/ctlXMLEditLib - * duplicate/save as bug - * - * ***************** Version 28 ***************** - * User: Kathy Date: 1/15/03 Time: 1:56p - * Updated in $/LibSource/ctlXMLEditLib - * sizing of labels & form - * - * ***************** Version 27 ***************** - * User: Kathy Date: 1/08/03 Time: 10:05a - * Updated in $/LibSource/ctlXMLEditLib - * Add view image - * - * ***************** Version 26 ***************** - * User: Jsj Date: 1/06/03 Time: 11:29a - * Updated in $/LibSource/ctlXMLEditLib - * INI file logic - * - * ***************** Version 25 ***************** - * User: Jsj Date: 1/02/03 Time: 3:47p - * Updated in $/LibSource/ctlXMLEditLib - * Added logic to check INI files for default graphics file extension - * - * ***************** Version 24 ***************** - * User: Jsj Date: 12/17/02 Time: 4:51p - * Updated in $/LibSource/ctlXMLEditLib - * fixed date/time for graphic files - * - * ***************** Version 23 ***************** - * User: Kathy Date: 12/16/02 Time: 12:11p - * Updated in $/LibSource/ctlXMLEditLib - * once data is saved, don't flag it as changed - * - * ***************** Version 22 ***************** - * User: Kathy Date: 12/13/02 Time: 10:05a - * Updated in $/LibSource/ctlXMLEditLib - * bugs with combo (& more than one field with data) - * - * ***************** Version 21 ***************** - * User: Jsj Date: 12/10/02 Time: 3:35p - * Updated in $/LibSource/ctlXMLEditLib - * Default Graphic file extension fix - * - * ***************** Version 20 ***************** - * User: Kathy Date: 12/10/02 Time: 2:24p - * Updated in $/LibSource/ctlXMLEditLib - * fieldname special chars - * - * ***************** Version 19 ***************** - * User: Kathy Date: 12/02/02 Time: 8:28a - * Updated in $/LibSource/ctlXMLEditLib - * fieldname replace chars - * - * ***************** Version 18 ***************** - * User: Kathy Date: 11/26/02 Time: 11:08a - * Updated in $/LibSource/ctlXMLEditLib - * fix required bug on combo type & fix improve sizing - * - * ***************** Version 17 ***************** - * User: Kathy Date: 11/20/02 Time: 11:36a - * Updated in $/LibSource/ctlXMLEditLib - * zoom button moved on main form - * - * ***************** Version 16 ***************** - * User: Kathy Date: 11/19/02 Time: 11:33a - * Updated in $/LibSource/ctlXMLEditLib - * zoom tool tip & tab order - * - * ***************** Version 15 ***************** - * User: Kathy Date: 10/24/02 Time: 11:15a - * Updated in $/LibSource/ctlXMLEditLib - * some image file date (still needs fixed) - * - * ***************** Version 14 ***************** - * User: Kathy Date: 10/15/02 Time: 2:14p - * Updated in $/LibSource/ctlXMLEditLib - * required fields bug - * - * ***************** Version 13 ***************** - * User: Kathy Date: 10/11/02 Time: 11:35a - * Updated in $/LibSource/ctlXMLEditLib - * Required fields & restore data - * - * ***************** Version 12 ***************** - * User: Kathy Date: 10/10/02 Time: 10:43a - * Updated in $/LibSource/ctlXMLEditLib - * console.writeline->messagebox - * - * ***************** Version 11 ***************** - * User: Kathy Date: 10/07/02 Time: 11:26a - * Updated in $/LibSource/ctlXMLEditLib - * graphics image file support - * - * ***************** Version 10 ***************** - * User: Kathy Date: 9/27/02 Time: 1:12p - * Updated in $/LibSource/ctlXMLEditLib - * fix digit as first char in fieldname - * - * ***************** Version 9 ***************** - * User: Jsj Date: 9/26/02 Time: 12:12p - * Updated in $/LibSource/ctlXMLEditLib - * removed reference - * - * ***************** Version 8 ***************** - * User: Jsj Date: 9/26/02 Time: 11:09a - * Updated in $/LibSource/ctlXMLEditLib - * added reference to VLNXML - * - * ***************** Version 7 ***************** - * User: Kathy Date: 9/25/02 Time: 9:54a - * Updated in $/LibSource/ctlXMLEditLib - * remove xmlvln - * - * ***************** Version 6 ***************** - * User: Kathy Date: 9/19/02 Time: 9:59a - * Updated in $/LibSource/ctlXMLEditLib - * fix minor bugs - * - * ***************** Version 5 ***************** - * User: Kathy Date: 9/11/02 Time: 1:13p - * Updated in $/LibSource/ctlXMLEditLib - * vlnxml - * - * ***************** Version 4 ***************** - * User: Kathy Date: 9/10/02 Time: 12:17p - * Updated in $/LibSource/ctlXMLEditLib - * modify xpath expression to find field contents - * - * ***************** Version 3 ***************** - * User: Kathy Date: 9/05/02 Time: 12:41p - * Updated in $/LibSource/ctlXMLEditLib - * dev - * - * ***************** Version 2 ***************** - * User: Kathy Date: 8/30/02 Time: 9:42a - * Updated in $/LibSource/ctlXMLEditLib - * dev - * - * ***************** Version 1 ***************** - * User: Jsj Date: 8/23/02 Time: 3:02p - * Created in $/LibSource/ctlXMLEditLib - *********************************************************************************************/ - -using System; -using System.IO; -using System.Collections; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Windows.Forms; -using System.Drawing.Imaging; -using System.Runtime.InteropServices; -using System.Xml; -using System.Xml.Schema; -using System.Text; -using RODBInterface; -using Org.Mentalis.Files; -//using IniFileIO; - - - -namespace ctlXMLEditLib -{ - /// - /// This windows control takes an input XML Schema and displays windows controls for the - /// schema elements. - /// If XML is also passed in, it uses that for the data. - /// Methods supported are: - /// ctlXMLEdit(VlnXmlElement myelem, XmlSchema myschema) - /// Constructor - VlnXmlElement contains data for edit and contains top - /// - document node if creating new xml data. - /// - XmlSchema contains field definitions - /// bool SaveData - /// - saves data in windows into passed in VlnXmlElement. - /// - returns true if successful, false if failed. - /// - /// - /// - public class ctlXMLEdit : System.Windows.Forms.UserControl - { - /// - /// Required designer variable. - /// - private System.ComponentModel.Container components = null; - private Random random = new Random(); - private XmlSchema myXmlSchema; - private int screenx; - private int screeny; - private int tabindx; - private bool mysavexml; - private Hashtable myHT; - private bool dosaveflag; - private VlnXmlElement editelem; - private XmlDocument editdoc; - private TextBox zoomtextbox; - // the following is used for handling images. Note that if we want to have more - // than one image defined in an ro, this should be become a list. - private TextBox GraphicsFiletextbox; - private TextBox GraphicsWdtextbox; - private TextBox GraphicsHttextbox; - private System.Windows.Forms.Button btnFindFile; - private string GraphicsText; - private ToolTip zmtooltip; - private string DefaultGraphicFileExtension; - int MaxWidth; // largest textbox/groupbox width to size control. - int himage, wimage; - int hmin, hmax; - int wmin, wmax; - int MAXLT = 60; // make these defines - int MAXWT = 84; - int STDCPI = 12; - int STDLPI = 6; - int DPPL = (720/6); - int DPPC = (720/12); - int height, width; - - // use this struct to define attributes for the text box fields, storing - // the pattern, radio button association, required field flag, etc. - struct TextBoxAttrTag - { - - bool required; //whether the field is required - string req_msg; //message to print if required, but not set - string pattern; //pattern for validation - RadioButton radio; // if this text box has associated radio button - bool imagechild; //whether this field is a subchild of an image - string imagename; //if subchild of image, name of image parent (for save) - string imagedate; //if this was filename, save the date/time stamp - public TextBoxAttrTag(bool reqd, string ptn, RadioButton rd, bool img, - string imgname, string imgdate) - { - this.req_msg = null; - this.required = reqd; - this.pattern = ptn; - this.radio = rd; - this.imagechild = img; - this.imagename = imgname; - this.imagedate = imgdate; - } - public void SetPattern(string pattern) {this.pattern = pattern;} - public void SetRequired(bool req) {this.required = req;} - public void SetRequiredMessage(string ireq_msg) {this.req_msg = ireq_msg;} - public string GetPattern { get {return pattern;}} - public string GetRequiredMessage { get {return req_msg;}} - public bool GetRequired { get {return required;}} - public RadioButton GetRadio { get {return radio;}} - public bool GetImageChild { get {return imagechild;}} - public string GetImageName { get {return imagename;}} - public string GetImageDate { get {return imagedate;}} - public void SetImageDate(string imgdate) {this.imagedate = imgdate;} - } - - public ctlXMLEdit(VlnXmlElement myelem, XmlSchema myschema, ArrayList reqfields) - { - // This call is required by the Windows.Forms Form Designer. - InitializeComponent(); - zmtooltip = new ToolTip(); - myHT = new Hashtable(); - tabindx=0; - screenx=8; - screeny=10; - MaxWidth = 0; - mysavexml = false; - dosaveflag = false; - editelem = myelem; - editdoc = myelem.OwnerDocument; - myXmlSchema = myschema; - GraphicsText = null; - GraphicsFiletextbox = null; -// DefaultGraphicFileExtension = ".TIF"; // default graphics file extension - string ApplicationPath = Application.StartupPath; - string ROINI = Directory.GetCurrentDirectory()+ "\\ROAPP.INI"; - - // Get the default file extension for graphic files -// DefaultGraphicFileExtension = TheIniFile.GetINIKeyValueStr("ROApp","Extention","",5,"ROAPP.INI"); - // Bug fix: B2006-025 - // needed to pass the full path of ROAPP.INI - IniReader in1 = new IniReader(ROINI); - DefaultGraphicFileExtension = in1.ReadString("ROApp","Extention",""); - if (DefaultGraphicFileExtension.Equals("")) - { - string ApplPathUp = ApplicationPath.ToUpper(); - int idx = ApplPathUp.IndexOf("VE-PROMS.NET\\BIN"); - if (idx >= 0) - { - string PromsINI = ApplicationPath.Substring(0, idx); - PromsINI += "VE-PROMS\\VEPROMS.INI"; - IniReader in2 = new IniReader(PromsINI); - DefaultGraphicFileExtension = in2.ReadString("Graphics", "defaultext", ".TIF"); - } - else - DefaultGraphicFileExtension = ".TIF"; - } -// if (File.Exists(PromsINI)) -// DefaultGraphicFileExtension = TheIniFile.GetINIKeyValueStr("Graphics","defaultext",".TIF",5,PromsINI); -// if (File.Exists("ROAPP.INI")) -// DefaultGraphicFileExtension = TheIniFile.GetINIKeyValueStr("ROApp","Extention",".TIF",5,"ROAPP.INI"); - if (!DefaultGraphicFileExtension.StartsWith(".")) - DefaultGraphicFileExtension = "." + DefaultGraphicFileExtension; - - // Put out window fields based on schema fields. - DisplaySchemaControls(myXmlSchema); - - // Add field data to fields. - DisplayFieldContents((XmlNode) myelem); - - // Set required fields based on list. (can add message later). - SetRequiredFields(reqfields); - dosaveflag=true; - } - - // set the required fields tag on those fields which are included in the passed - // in required fields list. - private void DoSet(TextBox hwnd, string msg) - { - if (hwnd == null) return; - if (hwnd.Tag != null) - { - TextBoxAttrTag tag = (TextBoxAttrTag) hwnd.Tag; - tag.SetRequired(true); - tag.SetRequiredMessage(msg); - hwnd.Tag = tag; - } - } - - private void SetRequiredFields(ArrayList reqfields) - { - Object o; - TextBox hwnd; - string field, msg; - int indx; - foreach (string strfld in reqfields) - { - indx = strfld.IndexOf("\t"); // message is stored after field, tab delim - field = strfld.Substring(0,indx); - msg = strfld.Substring(indx,strfld.Length-indx); - - o = null; - o = myHT[field]; - if (o == null) - { - // there may be an a,b,c,d tacked on to represent combo types. - // try them. if we have a combo type, then set them all as required - // because the checker will only check the one that is visible. - o = myHT[field+"a"]; - if (o != null) // set all combo types required, the checker - { - DoSet((TextBox)o,msg); - DoSet((TextBox)myHT[field+"b"],msg); - DoSet((TextBox)myHT[field+"c"],msg); - DoSet((TextBox)myHT[field+"d"],msg); - } - } - else if (o != null) - { - hwnd = (TextBox) o; - if (hwnd.Tag != null) - { - TextBoxAttrTag tag = (TextBoxAttrTag) hwnd.Tag; - tag.SetRequired(true); - tag.SetRequiredMessage(msg); - hwnd.Tag = tag; - } - } - } - } - - // Given a parent XmlNode, walk through the child nodes & add the text for the - // node to the associated text box. - private void DisplayFieldContents(XmlNode node) - { - Object o; - TextBox hwnd; - XmlNode nd; - // if we have an image, check it for validity, i.e. file exists, etc.?? - foreach (string str in myHT.Keys) - { - o = myHT[str]; - hwnd = (TextBox) o; - nd = node.SelectSingleNode(str); - // if not found with just the string, search the tree. - if (nd==null)nd = node.SelectSingleNode("*/"+str); - if (nd != null) - { - hwnd.Text = nd.InnerText; // set the field's text from XML - - // check if this window has a button name as part of its tag. If - // so it's a combo type & the radio button/visibility may need to - // be reset. If this button is not checked (during setup), then - // check it. By setting it's Checked property to true, an event - // is thrown which causes the code to be run which turns off/on - // visibility of the text boxes. - if (hwnd.Tag != null) - { - TextBoxAttrTag tag = (TextBoxAttrTag) hwnd.Tag; - RadioButton radio; - radio = tag.GetRadio; - - if (radio != null ) - { - // Use a tag on the groupbox to know that the radio button - // was set - the first xml element in the group is the - // active one. - GroupBox gp = (GroupBox) radio.Parent; - if (gp.Tag == null && radio.Checked == false) - { - // see if this is the first member of the group in the - // xml node. - string nmgr = str.Substring(0,str.Length-1); - XmlNode grpnd = (XmlNode) editelem.FirstChild; - bool first = true; - while (grpnd != null) - { - if (grpnd.Name.Substring(0,grpnd.Name.Length-1) == nmgr) - { - if (grpnd.Name == str) - { - if (first) - { - radio.Checked = true; - radio.Parent.Tag = true; - } - break; - } - first = false; - } - grpnd = grpnd.NextSibling; - } - } - } - bool img; - img = tag.GetImageChild; - if (img==true && str == "Image_Filename") - { - int indx = hwnd.Text.IndexOf(" "); - if (indx>=0) - { - tag.SetImageDate(hwnd.Text.Substring(0,indx)); - hwnd.Tag = tag; - hwnd.Text = hwnd.Text.Substring(indx+1,hwnd.Text.Length-indx-1); - } - } - if (img==true && str == "Image_Width") - width = System.Convert.ToInt32(hwnd.Text); - if (img==true && str == "Image_Height") - height = System.Convert.ToInt32(hwnd.Text); - } - } - } - // if we're doing an image file & all data has been set, update the - // height/width data of the image. - if (GraphicsFiletextbox != null && GraphicsFiletextbox.Text != "") UpdateHtWd(); - } - public TextBox GetGraphicsFiletextbox() - { - return GraphicsFiletextbox; - } - public int GetMaxWidth() - { - // if MaxWidth is small, a scroll bar appears below the fields - // so make this a bit larger, so a scroll bar doesn't appear - if (MaxWidth<30) return MaxWidth+60; - return MaxWidth+30; - } - public int GetMaxLength() - { - return screeny+50; - } - public void SetNotSaved() - { - mysavexml = true; - } - /// - /// Clean up any resources being used. - /// - protected override void Dispose( bool disposing ) - { - zmtooltip.RemoveAll(); - if( disposing ) - { - if( components != null ) - components.Dispose(); - } - base.Dispose( disposing ); - } - - // RestoreData restores the data in the text boxes to be that which was originally - // sent into the control (ctlXMLEdit) - public void RestoreData() - { - dosaveflag=false; - mysavexml=false; - TextBox hwnd; - // first, clear out all of the text boxes. - - foreach (string str in myHT.Keys) - { - object o = myHT[str]; - hwnd = (TextBox) o; - hwnd.Text = ""; - TextBoxAttrTag tag = (TextBoxAttrTag) hwnd.Tag; - RadioButton radio; - radio = tag.GetRadio; - if (radio != null ) - { - GroupBox gp = (GroupBox) radio.Parent; - gp.Tag = null; - } - } - // Add field data to fields. - DisplayFieldContents((XmlNode) editelem); - dosaveflag=true; - } - - public bool DataChanged() - { - if (mysavexml) return true; - return false; - } - - // SaveData saves the data in the element which had been sent to the control. Return - // true if success, false if fail. - public bool SaveData() - { - - if (mysavexml) - { - TextBox hwnd; - TextBoxAttrTag tag; - string imgdate; - - //go thru the hash table to get textboxes. Find the ones that have text. - foreach (string str in myHT.Keys) - { - object o = myHT[str]; - hwnd = (TextBox) o; - imgdate = null; - - // if this is a required field and there is no text, put out an error - // message and get out of here. - if (hwnd.Tag != null) - { - tag = (TextBoxAttrTag) hwnd.Tag; - if (tag.GetRequired == true && hwnd.Visible == true && (hwnd.Text == null || hwnd.Text == "")) - { - string message = CvtFldToUserFld(str) + " must be entered because it is\nused to define the " + tag.GetRequiredMessage; - string caption = "Error on Save RO Data"; - MessageBoxButtons buttons = MessageBoxButtons.OK; - DialogResult result; - result = MessageBox.Show(message, caption, buttons); - return (false); - } - imgdate = tag.GetImageDate; - - } - - // find the element in the current element node. - // if text exists and the element exists, just reset the innertext. - // if text exists and it's a new element, add it. - // if the element is there and there's no text. delete it. - XmlNode elmnode = (XmlNode) editelem; - XmlNode nd = elmnode.SelectSingleNode(str); - if (nd == null) nd = elmnode.SelectSingleNode("*/"+str); - - // handle, element exists - but text removed first (delete element) - if ((hwnd.Text == null || hwnd.Text == "") && nd != null) - { - XmlNode parent = nd.ParentNode; - parent.RemoveChild(nd); - } - else - { - // found the node, just set text and text exists, just modify text. - if (nd != null) - { - if (str == "Image_Filename") - nd.InnerText = imgdate + " " + hwnd.Text; - else - nd.InnerText = hwnd.Text; - } - // node not here. Make a new element - else if (hwnd.Text != null && hwnd.Text != "") - { - // if this is part of an image, then be sure that the - // parent image node was created and if not, create it. - bool ischldimag = false; - if (hwnd.Tag != null) - { - tag = (TextBoxAttrTag) hwnd.Tag; - if (tag.GetImageChild == true) ischldimag = true; - } - if (ischldimag) - { - tag = (TextBoxAttrTag) hwnd.Tag; // yikes, compile errors - string imagnm = tag.GetImageName; - VlnXmlElement ielm; - VlnXmlElement newelem; - nd = elmnode.SelectSingleNode(imagnm); - if (nd == null) // make this image node. - { - newelem = (VlnXmlElement) editdoc.CreateElement(imagnm); - editelem.AppendChild((XmlNode) newelem); - ielm = newelem; - } - else - ielm = (VlnXmlElement) nd; - newelem = (VlnXmlElement) editdoc.CreateElement(str); - if (str == "Image_Filename") - newelem.InnerText = imgdate + " " + hwnd.Text; - else - newelem.InnerText = hwnd.Text; - ielm.AppendChild((XmlNode) newelem); - } - else - { - // just added at the current level - VlnXmlElement newelem = (VlnXmlElement) editdoc.CreateElement(str); - newelem.InnerText = hwnd.Text; - editelem.AppendChild((XmlNode) newelem); - nd = (XmlNode) newelem; - } - } - // check on order of combo types if this was one. Note that the 'active' - // type within the combo, i.e. text, variable, table or xyplot, must - // be the first one in xml tree (before the others) in order to be the - // active one as presented to user. This was done since more than one can have data. - if (hwnd.Tag != null) - { - tag = (TextBoxAttrTag) hwnd.Tag; - RadioButton rb = tag.GetRadio; - if (rb != null) - { - if (rb.Checked == true) - { - // this one needs to be before any others (of the same - // group type) in the xml childlist - just make it 1st. - XmlNode parent = nd.ParentNode; - parent.RemoveChild(nd); - parent.PrependChild(nd); - } - } - } - } - } - mysavexml=false; // data has been saved, don't allow it again. - return(true); - } - return (false); - } - - #region Component Designer generated code - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.btnFindFile = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // btnFindFile - // - this.btnFindFile.Location = new System.Drawing.Point(608, 8); - this.btnFindFile.Name = "btnFindFile"; - this.btnFindFile.Size = new System.Drawing.Size(96, 24); - this.btnFindFile.TabIndex = 1; - this.btnFindFile.Text = "Find File"; - this.btnFindFile.Visible = false; - this.btnFindFile.Click += new System.EventHandler(this.btnFindFile_click); - this.ResumeLayout(false); - - this.Controls.Add(btnFindFile); - - } - #endregion - - // Given a schema, display labels or radio buttons and their associated textboxes - // Radio button names are derived from removing the type from the element name. - private void DisplaySchemaControls(XmlSchema myXmlSchema) - { - // the first element is the group name, get past this to the data. This group - // name is a complex type, which is processed below. - bool first=true; - try - { - foreach(object item in myXmlSchema.Items) - { - if (item is XmlSchemaElement && first) - { - first=false; - } - - // in the RO schema (and any types derived from it), the fields are - // defined within the ComplexType. - if (item is XmlSchemaComplexType) - DisplayXmlSchemaComplexType((XmlSchemaComplexType)item); //complexType - } - } - catch(Exception e) - { - MessageBox.Show(e.ToString(),"Error displaying fields from schema"); - } - } - - - //XmlSchemaComplexType - private void DisplayXmlSchemaComplexType(XmlSchemaComplexType complexType) - { - if (complexType.ContentModel == null) - { - if (complexType.Particle != null) - DisplayXmlSchemaParticle(complexType.Particle); - } - } - - //XmlSchemaSimpleType processes a simple type schema element which contains a fields - // attributes such as patterns, maxLength and whether it is single (type is - // 'normalizedString') or a multiline text box(type is 'string'). Also, a radio - // button is passed in if this was called to handle an element within a combo type. - // This button is saved for a given text box so that initialization of these combo types can occur. - private string DisplayXmlSchemaSimpleType(XmlSchemaSimpleType simpleType, TextBox mytextbox, RadioButton radio, - bool img, string imgname) - { - // set up for text box tag, which stores whether field is required and - // if a pattern exists for validation. - string pattern = null; - string getannot=null; - if (simpleType.Annotation != null) - { - object item = simpleType.Annotation.Items[0]; - if (item is XmlSchemaDocumentation) - { - XmlSchemaDocumentation doc = (XmlSchemaDocumentation) item; - XmlNode[] node = (XmlNode[]) doc.Markup; - - getannot = node[0].InnerText; - if (getannot == "VLN_FINDFILE") - { - this.btnFindFile.Location = new System.Drawing.Point(mytextbox.Location.X+mytextbox.Width+50,mytextbox.Location.Y-(2*(int)mytextbox.Font.GetHeight())); - this.btnFindFile.Visible = true; - GraphicsFiletextbox = mytextbox; - GraphicsFiletextbox.LostFocus += new System.EventHandler(this.GraphicText_lostfocus); - getannot = null; - } - if (getannot!=null && getannot!="") - { - if (getannot.IndexOf("Lines")>=0) - { - GraphicsHttextbox = mytextbox; - mytextbox.LostFocus += new System.EventHandler(this.GraphicsHt_lostfocus); - } - if (getannot.IndexOf("Character")>=0) - { - GraphicsWdtextbox = mytextbox; - mytextbox.LostFocus += new System.EventHandler(this.GraphicsWd_lostfocus); - } - } - } - } - - - if (simpleType.Content is XmlSchemaSimpleTypeRestriction) - { - // A Schema Type Restriction is used to define single or multi-line boxes. - XmlSchemaSimpleTypeRestriction myRestrictions = (XmlSchemaSimpleTypeRestriction) simpleType.Content; - if (myRestrictions.BaseTypeName.Name == "normalizedString") - mytextbox.Multiline = false; - else - { - mytextbox.Multiline = true; - mytextbox.AcceptsReturn = true; - mytextbox.Height = (int) mytextbox.Font.GetHeight() * 4; - mytextbox.ScrollBars = ScrollBars.Vertical; - zmtooltip.SetToolTip(mytextbox, "Press Shift F2 To Zoom"); - } - - // Schema facets were used for maxlength & patterns, process these if found. - foreach(XmlSchemaFacet facet in myRestrictions.Facets) - { - if (facet is XmlSchemaMaxLengthFacet) - { - if (mytextbox.Multiline == false) - mytextbox.MaxLength = System.Convert.ToInt32(facet.Value); - // if the box is small, make the width a little bigger so maxlength text can fit. - int wd = System.Convert.ToInt32(facet.Value); - if (wd<5) wd++; - mytextbox.Width = (int) mytextbox.Font.SizeInPoints * wd; - MaxWidth = (mytextbox.Width>MaxWidth)?mytextbox.Width:MaxWidth; - } - else if (facet is XmlSchemaPatternFacet) - { - pattern = facet.Value; - } - } - } - - // Now setup a tag for the text box which will store attributes associated with it - // for seeing if it is a required field, checking a pattern or processing a radio box - // initialization. - if (mytextbox.Tag == null) - { - TextBoxAttrTag tag = new TextBoxAttrTag(false, pattern, radio, img, (img?imgname:null), null); - mytextbox.Tag = (object) tag; - } - return getannot; - } - - //XmlSchemaParticle's contain the individual schema elements which represent - // fields defined for this given RO group. It may also contain a schema 'choice' - // which was used to handle the combo type data type fields. - private void DisplayXmlSchemaParticle(XmlSchemaParticle particle) - { - if (particle is XmlSchemaElement) - DisplayXmlSchemaElement((XmlSchemaElement)particle); - else if (particle is XmlSchemaSequence) - { - foreach(XmlSchemaParticle particle1 in ((XmlSchemaSequence)particle).Items) - DisplayXmlSchemaParticle(particle1); - } - else if (particle is XmlSchemaChoice) - DisplayXmlSchemaChoice((XmlSchemaChoice) particle); - else - MessageBox.Show(particle.ToString(),"Not Implemented for this type"); - } - - // For a combo field, display the radio button & the text field. Select the first - // button. If data is also sent in during initialization of this control, i.e. - // edit versus new, the selected button will be changed during the XML file - // data load process. - // Return value (set as reference params): 'x' & 'y' size of the text field so that - // the caller can determine the max to set the group box x, y size value and know - // how far to move down on the screen. - private void DisplayXmlSchemaRadioAndTextBox(XmlSchemaElement element, GroupBox gbox, bool first, int x, int y, - int boxx, ref int retx, ref int rety) - { - int ysize; - RadioButton radio = new RadioButton(); - radio.Location = new System.Drawing.Point(x,20); - radio.Name = element.Name + element.SchemaTypeName.Name; - string tmp; - if (element.SchemaTypeName.Name.Length>1 && char.IsDigit(element.SchemaTypeName.Name,1)) - tmp = element.SchemaTypeName.Name.Substring(1,element.SchemaTypeName.Name.Length-1); - else - tmp = element.SchemaTypeName.Name; - radio.Text = CvtFldToUserFld(tmp); - //radio.Width = (int) radio.Font.SizeInPoints * radio.Text.Length + 20; // add 20 for button - - radio.TabIndex = 0; - ysize = (int) radio.Height; - - if (first) radio.Checked = true; - radio.CheckedChanged += new System.EventHandler(this.radiocheckchg); - gbox.Controls.Add(radio); - - TextBox tb = new TextBox(); - tb.Location = new Point(boxx+20, y+25); - if (!first) tb.Visible = false; - myHT.Add(element.Name,tb); - // add the textbox to the ctlxmledit control rather than groupbox - the - // groupbox is just to control the choices, the text box won't display if in - // the groupbox. - Controls.Add(tb); - tb.TextChanged += new System.EventHandler(this.textbox_change); - tb.GotFocus += new System.EventHandler(this.textbox_zoombtn); - tb.KeyDown += new KeyEventHandler(MyOnKeyDown); - gbox.Contains(tb); - // the following will set attributes on the text boxes such as maxlength, multiline, etc. - DisplayXmlSchemaSimpleType((XmlSchemaSimpleType)element.SchemaType, tb, radio,false,null); - rety = (ysize + 25 + tb.Height); - retx = tb.Width; - } - - //XmlSchemaChoice: processes the 'combo data type' which is represented by a - // a schema choice element. This is handled by a group box and using radio - // button/textbox pairs to represent each element within the choice. - private void DisplayXmlSchemaChoice(XmlSchemaChoice choice) - { - bool first = true; - int screenposx, screenposy; - int maxyfortext=0,maxxfortext=0; - GroupBox groupbox = new GroupBox(); - groupbox.SuspendLayout(); - groupbox.Location = new System.Drawing.Point(screenx,screeny); - XmlSchemaElement elem = (XmlSchemaElement) choice.Items[0]; - groupbox.Name = elem.Name; - groupbox.TabStop = false; - - // remove the last character of the name for the title of the group box. - string tstr = CvtFldToUserFld(elem.Name); - groupbox.Text = tstr.Remove((tstr.Length)-1,1); - screenposx = screenx+20; - screenposy = screeny+20; - - foreach (object o in choice.Items) - { - // put out a radio button/text box for each item in the choice. - int xmax=0, ymax=0; - DisplayXmlSchemaRadioAndTextBox((XmlSchemaElement) o,groupbox,first,screenposx,screenposy,screenx,ref xmax,ref ymax); - first = false; - maxyfortext = ymax>maxyfortext?ymax:maxyfortext; - maxxfortext = xmax>maxxfortext?xmax:maxxfortext; - screenposx = screenposx + 160; - } - - // get the widths of all children of this group box & use this to set the size - // of the groupbox. - int gritms = groupbox.Controls.Count; - screeny=screeny+maxyfortext+10; - MaxWidth = (maxxfortext+40>MaxWidth)?maxxfortext+40:MaxWidth; - groupbox.Size = new System.Drawing.Size(maxxfortext+40, maxyfortext+10); - Controls.Add(groupbox); - } - - private void DisplayXmlSchemaElement(XmlSchemaElement element) - { - // always add a label. - Label mylabel; - int sscreeny; - mylabel = new System.Windows.Forms.Label(); - mylabel.Location = new Point(screenx, screeny); - mylabel.Name = element.Name; - mylabel.Text = CvtFldToUserFld(element.Name); - mylabel.AutoSize = true; - Controls.Add(mylabel); - // add 3 onto screeny so that textbox is slightly below label. - screeny = screeny+mylabel.Height+3; - sscreeny = screeny; // save 'y' location in case of annotation. - if (element.SchemaType != null && element.SchemaType is XmlSchemaComplexType) - { - GraphicsText = element.Name; - DisplayXmlSchemaComplexType((XmlSchemaComplexType)element.SchemaType); - screeny+=30; - } - else - { - TextBox mytextbox; - mytextbox = new TextBox(); - mytextbox.Location = new Point(screenx, screeny); - myHT.Add(element.Name,mytextbox); - tabindx++; - Controls.Add(mytextbox); - screeny+=mytextbox.Height; - mytextbox.TextChanged += new System.EventHandler(this.textbox_change); - mytextbox.Validating += new System.ComponentModel.CancelEventHandler(this.textbox_Validating); - mytextbox.GotFocus += new System.EventHandler(this.textbox_zoombtn); - mytextbox.KeyDown += new KeyEventHandler(MyOnKeyDown); - - string labelAnnot; - bool imgchld = false; - if (element.Name == "Image_Filename" || element.Name == "Image_Height" || element.Name == "Image_Width") imgchld = true; - // Pass the textbox in to set attributes such as maxlength, multiline and pattern - labelAnnot = DisplayXmlSchemaSimpleType((XmlSchemaSimpleType)element.SchemaType,mytextbox, null,imgchld,GraphicsText); - if (labelAnnot != null) - { - Label annot; - annot = new System.Windows.Forms.Label(); - annot.Location = new Point(screenx+mytextbox.Width+10, sscreeny); - annot.Name = "annot" + screeny.ToString(); - annot.Text = labelAnnot; - annot.AutoSize = true; - Controls.Add(annot); - } - screeny+=mytextbox.Height; - } - } - - // the following is needed to load the control. - private void ctlXMLEdit_Load(object sender, System.EventArgs e) - { - - } - - // when data in a text box has changed, flag it (except for when this - // happens during loading of original data). This flag will be used - // later to know whether to save data. - private void textbox_change(object sender, System.EventArgs e) - { - if(dosaveflag)mysavexml = true; - } - - // radiocheckchg - called when a radio button is selected. This will set - // visibility for associated text box. - private void radiocheckchg(object sender, System.EventArgs e) - { - RadioButton btnsel = (RadioButton) sender; - TextBox assocbox; - string btntext, str; - - if(dosaveflag)mysavexml = true; - btntext = CvtUserFldToFld(btnsel.Text); - - // now get the actual textbox and set visibility depending - // on whether the box is checked, i.e. turned on(if checked, it should - // be set to visible) - - str = btnsel.Name.Replace(btntext,""); - object o = myHT[str]; - if (o == null) return; - assocbox = (TextBox) o; - // make the text box visible if checked, otherwise, invisible - assocbox.Visible = btnsel.Checked; - } - - // these two methods convert user input field names from/to xml tags. (xml tags - // cannot begin with digit, have spaces or other special chars. - private string CvtUserFldToFld(string fldname) - { - if (fldname.Length < 2) - return fldname; - // a digit cannot start an xml fieldname, prepend a "__" to it. - string tmp0; - if (char.IsDigit(fldname,0)) - tmp0 = "__" + fldname; - else - tmp0 = fldname; - // an xml fieldname cannot have a space, change it to a "__" - string tmpstr = tmp0.Replace(" ","__"); - int len = tmpstr.Length; - int cnt = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval; - - while (cnt < len) - { - char tmpchr = tmpstr[cnt]; - if(!char.IsLetterOrDigit(tmpchr)&& (OKpunch.IndexOf(tmpchr) == -1) ) - { - decval = tmpchr; - outstr += OKpunch + decval.ToString("D3"); - } - else - { - outstr += tmpchr.ToString(); - } - cnt++; - } - return outstr; - } - - private string CvtFldToUserFld(string fldname) - { - string tmpstr0; - if (fldname.Length < 2) return fldname; - // an xml element name cannot begin with a digit. we had prepended a "__" - if (fldname.Substring(0,2) == "__" && char.IsDigit(fldname,2)) - tmpstr0 = fldname.Substring(2,fldname.Length-2); - else - tmpstr0 = fldname; - // an xml element name cannot have a space, we converted to a "__" - string tmpstr = tmpstr0.Replace("__"," "); - int len = tmpstr.Length; - int cur = 0; - - // this is also our sequence that tells us the follow 3 digits is the ascii number (base 10) - // of the character we replaced. - string OKpunch = "-._"; - - string outstr = ""; - int decval, indx; - if (tmpstr.Length <6) - indx = -1; - else - indx=tmpstr.IndexOf(OKpunch,cur); - string asc_spchar; - while (indx>=0) - { - outstr += tmpstr.Substring(cur,indx-cur); - asc_spchar = tmpstr.Substring(indx+3,3); - decval = System.Convert.ToInt16(asc_spchar,10); - outstr += System.Convert.ToChar(decval).ToString(); - cur = indx+6; - if (cur+6 > len) - indx = -1; - else - indx = tmpstr.IndexOf(OKpunch,cur); - } - if (cur0) - lname = iname.Substring(slindx+1,iname.Length-slindx-1); - else - lname = iname; - // now check to see if this is a local file - to do this, check - // to see if either has a "~" which may signify a short filename. - // If so, compare the short file names (Note that comparing long - // filenames didn't work, i.e. the kernel routine did not return - // a long filename if a short one was sent in). - - // open an existing file, or create a new one - - FileInfo lfi = new FileInfo(lname); // local file & info - - if (lfi.Exists == false) // !exist, copy it & move on - { - // Copy the file to the local directory - ifi.CopyTo(lname); - // update fields on window.... - GraphicsFiletextbox.Text = lfi.Name; - TextBoxAttrTag tag = (TextBoxAttrTag) GraphicsFiletextbox.Tag; - tag.SetImageDate(CalculatePromsDate(ifi.LastWriteTime)); - GraphicsFiletextbox.Tag = tag; - UpdateHtWd(); - return true; - } - else // A local file exists by the same name - { - if (ifi.Exists == false) - { - MessageBox.Show("Input file doesn't exist.","Error"); - return false; - } - else - { - // first just check if these are really the same, just the - // user put a path in. - int same = 0; - if (ifi.DirectoryName.IndexOf("~")>=0 || lfi.DirectoryName.IndexOf("~")>=0) - { - - StringBuilder shortlname = new StringBuilder(257); - StringBuilder shortiname = new StringBuilder(257); - GetShortPathName(ifi.DirectoryName,shortiname,257); - GetShortPathName(lfi.DirectoryName,shortlname,257); - same = String.Compare(shortlname.ToString(),shortlname.ToString()); - } - if (same == 0) - { - TextBoxAttrTag tag = (TextBoxAttrTag) GraphicsFiletextbox.Tag; - tag.SetImageDate(CalculatePromsDate(lfi.LastWriteTime)); - GraphicsFiletextbox.Tag = tag; - return true; - } - else - { - // Is the file the same - size, date, time - // old code checked for both findfirst failures?? - string msg=null; - if (lfi.LastWriteTime > ifi.LastWriteTime) - msg = "A newer copy of t"; - else if (lfi.LastWriteTime < ifi.LastWriteTime) - msg = "An older copy of t"; - else if (lfi.Length != ifi.Length) - msg = "A different copy of t"; - msg = msg + "he selected file\nexists in the RO directory\n"; - msg = msg + "Do you want to replace it\n"; - msg = msg + "with the selected file?"; - MessageBoxButtons buttons = MessageBoxButtons.YesNoCancel; - DialogResult result; - result = MessageBox.Show( msg, "Graphics File Copy", buttons); - if (result == DialogResult.Yes) - { - lfi.Delete(); - ifi.CopyTo(lname,true); - // update dialog data & ht/wd - GraphicsFiletextbox.Text = lfi.Name; - TextBoxAttrTag tag = (TextBoxAttrTag) GraphicsFiletextbox.Tag; - tag.SetImageDate(CalculatePromsDate(lfi.LastWriteTime)); - GraphicsFiletextbox.Tag = tag; - UpdateHtWd(); - return true; - } - else if (result != DialogResult.No) // not yes or no. Cancel out. - return false; - } - } - } - } - return false; - } - - // if changed height, calculate associated width - private void GraphicsHt_lostfocus(object sender, System.EventArgs e) - { - TextBox ht = (TextBox) sender; - if (ht.Modified == true) - { - try - { - int newht= System.Convert.ToInt32(ht.Text); - setHtWdBasedUponHeight(newht); - } - catch (Exception ee) - { - MessageBox.Show("Invalid Height Input",ee.ToString()); - } - } - } - // if changed width, calculate associated height - private void GraphicsWd_lostfocus(object sender, System.EventArgs e) - { - TextBox wd = (TextBox) sender; - if (wd.Modified == true) - { - try - { - int newwd= System.Convert.ToInt32(wd.Text); - setHtWdBasedUponWidth(newwd); - } - catch (Exception ee) - { - MessageBox.Show("Invalid Width Input", ee.ToString()); - } - } - } - - private void setHtWdBasedUponHeight(int nuval) - { - int w,h; - if(himage!=0) - { - if(nuval==0)nuval=(himage+DPPL-1)/DPPL; - if(nuval > hmax)nuval=hmax; - else if(nuval < hmin)nuval=hmin; - h=nuval; - // The <<1, +1, and >>1 efectively round the result - // by multiplying by 2 performing the division adding - // 1 and dividing by 2 - w=(((h*STDCPI*wimage)<<1)/(himage*STDLPI)+1)>>1; - } - else - { - w=h=0; - } - GraphicsWdtextbox.Text = w.ToString(); - GraphicsHttextbox.Text = h.ToString(); - } - - private void setHtWdBasedUponWidth(int nuval) - { - int w,h; - if(himage!=0) - { - if(nuval==0)nuval=(wimage+DPPC-1)/DPPC; - if(nuval > wmax)nuval=wmax; - else if(nuval < wmin)nuval=wmin; - w=nuval; - // - // The <<1, +1, and >>1 efectively round the result - // by multiplying by 2 performing the division adding - // 1 and dividing by 2 - h=(((w*STDLPI*himage)<<1)/(wimage*STDCPI)+1)>>1; - } - else - { - w=h=0; - } - GraphicsWdtextbox.Text = w.ToString(); - GraphicsHttextbox.Text = h.ToString(); - } - - private void UpdateHtWd() - { - // copy the file local and also get it's width/height by reading the file. - Bitmap image; - - try - { - string dir = Directory.GetCurrentDirectory(); - string GraphicsFileName = GraphicsFiletextbox.Text; -// FileInfo fi = new FileInfo(GraphicsFiletextbox.Text); - if (GraphicsFileName.IndexOf('.') == -1) - GraphicsFileName += DefaultGraphicFileExtension; // default graphics file extension - FileInfo fi = new FileInfo(GraphicsFileName); - if (fi.Exists == false) - { - MessageBox.Show("Graphics File is missing","Error"); - wimage=himage=height=width=0; - return; - } - - image = new Bitmap(GraphicsFileName); - himage = image.Height; - wimage = image.Width; - hmax=MAXLT; // 60 Lines - int hmxw=STDLPI*MAXWT*himage/(wimage*STDCPI); - if(hmxw < hmax) - {// Size is limited to the width of the paper - hmax=hmxw; - wmax=MAXWT; - } - else - { - wmax=STDCPI*hmax*wimage/(himage*STDLPI); - } - hmin=1; - int hmnw=STDLPI*6*himage/(wimage*STDCPI); - if(hmnw > hmin) - {// Size is limited by the width of the graphic - hmin=hmnw; - wmin=6; - } - else - { - wmin=STDCPI*1*wimage/(himage*STDLPI); - } - setHtWdBasedUponHeight(height); - } - catch (Exception exx) - { - MessageBox.Show(exx.Message.ToString(),"error on processing of graphics file"); - } - } - - private void btnFindFile_click(object sender, System.EventArgs e) - { - bool done = false; - while (done == false) - { - OpenFileDialog openFileDialog1 = new OpenFileDialog(); - openFileDialog1.InitialDirectory = Directory.GetCurrentDirectory(); - openFileDialog1.Filter = - "Bitmap files (*.bmp)|*.bmp|Enhanced Windows metafiles (*.emf)|*.emf|Graphics Interchange Format (*.gif)|*.gif|Icons (*.ico)|*.ico|JPEG (*.jpg)|*.jpg|Portable Network Graphics (*.png)|*.png|TIFF (*.tif)|*.tif|Windows Metafile (*.wmf)|*.wmf" ; - openFileDialog1.FilterIndex = 7 ; - openFileDialog1.RestoreDirectory = true ; - openFileDialog1.CheckFileExists = true; -// try -// { - if(openFileDialog1.ShowDialog() != DialogResult.OK) - done = true; - else - { - string iname = openFileDialog1.FileName; - done = ValidGraphicsFile(iname); - if (done == true) - { - FileInfo fi = new FileInfo(iname); - GraphicsFiletextbox.Text = fi.Name; - UpdateHtWd(); - } - } -// } -// catch (Exception j) -// { -// MessageBox.Show(j.Message,"debug"); -// } - } - - } - } - - /* - * TimeZone is an Abstract Class. You need to inherit the TimeZone Class - * and overload a couple of it's functions in order to use it. - * - called in CalculatePromsDate() above. - */ - public class ThisTimeZone : TimeZone - { - private TimeZone curTZ; - public TimeSpan SpanTZ; - - public ThisTimeZone() - { - curTZ = CurrentTimeZone; // local timezone - } - - // get the UTC (GMT) value for the given date/time - public override TimeSpan GetUtcOffset(DateTime ForThisDate) - { - SpanTZ = curTZ.GetUtcOffset(ForThisDate); - return SpanTZ; - } - - // Name of the local Daylight savings time zone - public override string DaylightName - { - get - { - return curTZ.DaylightName; - } - } - - // Name of the local standard time zone - public override string StandardName - { - get - { - return curTZ.StandardName; - } - } - - // Get the start and end dates for daylight savings - public override System.Globalization.DaylightTime GetDaylightChanges(int year) - { - return curTZ.GetDaylightChanges(year); - } - } -} - diff --git a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ctlXMLEdit.resx b/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ctlXMLEdit.resx deleted file mode 100644 index 8b3cc379..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ctlXMLEdit.resx +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ctlXMLEdit - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ctlXMLEditLib.csproj b/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ctlXMLEditLib.csproj deleted file mode 100644 index c1a57aa9..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ctlXMLEditLib.csproj +++ /dev/null @@ -1,136 +0,0 @@ - - - Local - 8.0.50727 - 2.0 - {DECA8343-6351-11D6-8487-00A0CC271352} - Debug - AnyCPU - - - - - ctlXMLEditLib - - - JScript - Grid - IE50 - false - Library - ctlXMLEditLib - OnBuildSuccess - - - - - - - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - - - - System - - - System.Data - - - System.Drawing - - - System.Windows.Forms - - - System.XML - - - - - Code - - - UserControl - - - Form - - - Form - - - ctlXMLEdit.cs - Designer - - - ImageDialog.cs - Designer - - - ZoomDialog.cs - Designer - - - - - {A46428FC-1E35-4B8D-8B06-A1DF8BAC7A04} - Org.Mentalis.Files - - - {0C7825FD-AA05-11D6-84D1-00A0CC271352} - RODBInterface - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ctlXMLEditLib.sln b/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ctlXMLEditLib.sln deleted file mode 100644 index b7383a0a..00000000 --- a/PROMS/ReferencedObjectsOld/LibSource/ctlXMLEditLib/ctlXMLEditLib.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ctlXMLEditLib", "ctlXMLEditLib.csproj", "{DECA8343-6351-11D6-8487-00A0CC271352}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {DECA8343-6351-11D6-8487-00A0CC271352}.Debug.ActiveCfg = Debug|.NET - {DECA8343-6351-11D6-8487-00A0CC271352}.Debug.Build.0 = Debug|.NET - {DECA8343-6351-11D6-8487-00A0CC271352}.Release.ActiveCfg = Release|.NET - {DECA8343-6351-11D6-8487-00A0CC271352}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/PROMS/RoAccessToSql/RoAccessToSql.sln b/PROMS/RoAccessToSql/RoAccessToSql.sln deleted file mode 100644 index 1abeef3b..00000000 --- a/PROMS/RoAccessToSql/RoAccessToSql.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.32901.82 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RoAccessToSql", "RoAccessToSql.csproj", "{1EC96BDA-01E7-4153-A95D-6A4A36FA278E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1EC96BDA-01E7-4153-A95D-6A4A36FA278E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1EC96BDA-01E7-4153-A95D-6A4A36FA278E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1EC96BDA-01E7-4153-A95D-6A4A36FA278E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1EC96BDA-01E7-4153-A95D-6A4A36FA278E}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {066122E2-5ED5-4DD3-B04E-C2350F0818B1} - EndGlobalSection -EndGlobal diff --git a/PROMS/VEPROMS User Interface/App - Copy.config b/PROMS/VEPROMS User Interface/App - Copy.config deleted file mode 100644 index 16326062..00000000 --- a/PROMS/VEPROMS User Interface/App - Copy.config +++ /dev/null @@ -1,158 +0,0 @@ - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - - - 1 - - - 2 - - - 192, 255, 255 - - - True - - - False - - - Normal - - - True - - - False - - - False - - - True - - - - - - - - - 0.0 - - - C:\Development - - - - - False - - - 1 - - - - diff --git a/PROMS/VEPROMS User Interface/App.config.bak b/PROMS/VEPROMS User Interface/App.config.bak deleted file mode 100644 index 8dadd334..00000000 --- a/PROMS/VEPROMS User Interface/App.config.bak +++ /dev/null @@ -1,166 +0,0 @@ - - - -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - - - 1 - - - 2 - - - 192, 255, 255 - - - True - - - False - - - Normal - - - True - - - False - - - False - - - True - - - - - - - - - 0.0 - - - C:\Development - - - True - - - - - - - - - True - - - - - False - - - 1 - - - - diff --git a/PROMS/VEPROMS User Interface/DlgPrintProcedure.Designer.cs.bak b/PROMS/VEPROMS User Interface/DlgPrintProcedure.Designer.cs.bak deleted file mode 100644 index a0cb7950..00000000 --- a/PROMS/VEPROMS User Interface/DlgPrintProcedure.Designer.cs.bak +++ /dev/null @@ -1,1294 +0,0 @@ -namespace VEPROMS -{ - partial class DlgPrintProcedure - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DlgPrintProcedure)); - this.tabControl1 = new DevComponents.DotNetBar.TabControl(); - this.tabControlPanel3 = new DevComponents.DotNetBar.TabControlPanel(); - this.gpnlDebug = new DevComponents.DotNetBar.Controls.GroupPanel(); - this.cbxDebugText = new System.Windows.Forms.CheckBox(); - this.cbxDebugPagination = new System.Windows.Forms.CheckBox(); - this.grpDateSelector = new DevComponents.DotNetBar.Controls.GroupPanel(); - this.calDateSelector = new DevComponents.Editors.DateTimeAdv.MonthCalendarAdv(); - this.txbReviewDate = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.txbRevDate = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.txbPDFLocation = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.cbxOpenAfterCreate2 = new System.Windows.Forms.CheckBox(); - this.docVersionConfigBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.cbxOverwritePDF2 = new System.Windows.Forms.CheckBox(); - this.txbRevNum = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.lblReviewDate = new DevComponents.DotNetBar.LabelX(); - this.lblRevDate = new DevComponents.DotNetBar.LabelX(); - this.lblRevNum = new DevComponents.DotNetBar.LabelX(); - this.txbPDFName = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.lblPDFFileName = new DevComponents.DotNetBar.LabelX(); - this.lblPDFLoc = new DevComponents.DotNetBar.LabelX(); - this.tbGeneral = new DevComponents.DotNetBar.TabItem(this.components); - this.tabControlPanel2 = new DevComponents.DotNetBar.TabControlPanel(); - this.ppGpbxCBType = new DevComponents.DotNetBar.Controls.GroupPanel(); - this.rbCustom = new System.Windows.Forms.RadioButton(); - this.rbFormatDefault = new System.Windows.Forms.RadioButton(); - this.ppGpbxUserSpecCB = new DevComponents.DotNetBar.Controls.GroupPanel(); - this.ppGpbxUserSpecTxt = new DevComponents.DotNetBar.Controls.GroupPanel(); - this.label14 = new System.Windows.Forms.Label(); - this.ppTxbxChangeBarUserMsgTwo = new System.Windows.Forms.RichTextBox(); - this.label15 = new System.Windows.Forms.Label(); - this.ppTxbxChangeBarUserMsgOne = new System.Windows.Forms.RichTextBox(); - this.ppCmbxChgBarPos = new DevComponents.DotNetBar.Controls.ComboBoxEx(); - this.label12 = new System.Windows.Forms.Label(); - this.ppCmbxChgBarTxtType = new DevComponents.DotNetBar.Controls.ComboBoxEx(); - this.label13 = new System.Windows.Forms.Label(); - this.tbChangeBars = new DevComponents.DotNetBar.TabItem(this.components); - this.tabControlPanel1 = new DevComponents.DotNetBar.TabControlPanel(); - this.lblWatermarkS = new DevComponents.DotNetBar.LabelX(); - this.txbPdfLocationS = new DevComponents.DotNetBar.Controls.TextBoxX(); - this.btnPdfLocation = new DevComponents.DotNetBar.ButtonX(); - this.lblPdfLocS = new DevComponents.DotNetBar.LabelX(); - this.btnWaterMarkOff = new DevComponents.DotNetBar.ButtonX(); - this.btnChgBarOff = new DevComponents.DotNetBar.ButtonX(); - this.btnDuplxOff = new DevComponents.DotNetBar.ButtonX(); - this.lblAutoDuplexing = new DevComponents.DotNetBar.LabelX(); - this.btnDuplxOn = new DevComponents.DotNetBar.ButtonX(); - this.btnWaterMarkOn = new DevComponents.DotNetBar.ButtonX(); - this.cbxWaterMark = new DevComponents.DotNetBar.Controls.ComboBoxEx(); - this.lblChgBars = new DevComponents.DotNetBar.LabelX(); - this.btnChgBarOn = new DevComponents.DotNetBar.ButtonX(); - this.tbSettings = new DevComponents.DotNetBar.TabItem(this.components); - this.btnCreatePDF = new DevComponents.DotNetBar.ButtonX(); - this.btnCancel = new DevComponents.DotNetBar.ButtonX(); - this.DlgBrowseFolder = new System.Windows.Forms.FolderBrowserDialog(); - this.cbxDebug = new System.Windows.Forms.CheckBox(); - this.cbxOrPgBrk = new System.Windows.Forms.CheckBox(); - this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip(); - this.cbxCmpPRMSpfd = new System.Windows.Forms.CheckBox(); - this.cbxMultiunitPdfLocation = new DevComponents.DotNetBar.Controls.ComboBoxEx(); - this.lblMultiunitPdfLocation = new DevComponents.DotNetBar.LabelX(); - this.muLocNone = new DevComponents.Editors.ComboItem(); - this.muLocName = new DevComponents.Editors.ComboItem(); - this.muLocNumber = new DevComponents.Editors.ComboItem(); - this.muLocText = new DevComponents.Editors.ComboItem(); - this.muLocID = new DevComponents.Editors.ComboItem(); - this.pbPDFsStatus = new DevComponents.DotNetBar.Controls.ProgressBarX(); - ((System.ComponentModel.ISupportInitialize)(this.tabControl1)).BeginInit(); - this.tabControl1.SuspendLayout(); - this.tabControlPanel3.SuspendLayout(); - this.gpnlDebug.SuspendLayout(); - this.grpDateSelector.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.docVersionConfigBindingSource)).BeginInit(); - this.tabControlPanel2.SuspendLayout(); - this.ppGpbxCBType.SuspendLayout(); - this.ppGpbxUserSpecCB.SuspendLayout(); - this.ppGpbxUserSpecTxt.SuspendLayout(); - this.tabControlPanel1.SuspendLayout(); - this.SuspendLayout(); - // - // tabControl1 - // - this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tabControl1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(125)))), ((int)(((byte)(125)))), ((int)(((byte)(125))))); - this.tabControl1.CanReorderTabs = true; - this.tabControl1.Controls.Add(this.tabControlPanel1); - this.tabControl1.Controls.Add(this.tabControlPanel3); - this.tabControl1.Controls.Add(this.tabControlPanel2); - this.tabControl1.Location = new System.Drawing.Point(0, 0); - this.tabControl1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedTabFont = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold); - this.tabControl1.SelectedTabIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(502, 243); - this.tabControl1.Style = DevComponents.DotNetBar.eTabStripStyle.Office2007Document; - this.tabControl1.TabIndex = 0; - this.tabControl1.TabLayoutType = DevComponents.DotNetBar.eTabLayoutType.FixedWithNavigationBox; - this.tabControl1.Tabs.Add(this.tbGeneral); - this.tabControl1.Tabs.Add(this.tbSettings); - this.tabControl1.Tabs.Add(this.tbChangeBars); - this.tabControl1.Text = "tabControl1"; - // - // tabControlPanel3 - // - this.tabControlPanel3.AutoScroll = true; - this.tabControlPanel3.Controls.Add(this.pbPDFsStatus); - this.tabControlPanel3.Controls.Add(this.gpnlDebug); - this.tabControlPanel3.Controls.Add(this.grpDateSelector); - this.tabControlPanel3.Controls.Add(this.txbReviewDate); - this.tabControlPanel3.Controls.Add(this.txbRevDate); - this.tabControlPanel3.Controls.Add(this.txbPDFLocation); - this.tabControlPanel3.Controls.Add(this.cbxOpenAfterCreate2); - this.tabControlPanel3.Controls.Add(this.cbxOverwritePDF2); - this.tabControlPanel3.Controls.Add(this.txbRevNum); - this.tabControlPanel3.Controls.Add(this.lblReviewDate); - this.tabControlPanel3.Controls.Add(this.lblRevDate); - this.tabControlPanel3.Controls.Add(this.lblRevNum); - this.tabControlPanel3.Controls.Add(this.txbPDFName); - this.tabControlPanel3.Controls.Add(this.lblPDFFileName); - this.tabControlPanel3.Controls.Add(this.lblPDFLoc); - this.tabControlPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControlPanel3.Location = new System.Drawing.Point(0, 22); - this.tabControlPanel3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.tabControlPanel3.Name = "tabControlPanel3"; - this.tabControlPanel3.Padding = new System.Windows.Forms.Padding(1); - this.tabControlPanel3.Size = new System.Drawing.Size(502, 221); - this.tabControlPanel3.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); - this.tabControlPanel3.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); - this.tabControlPanel3.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tabControlPanel3.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); - this.tabControlPanel3.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tabControlPanel3.Style.GradientAngle = 90; - this.tabControlPanel3.TabIndex = 3; - this.tabControlPanel3.TabItem = this.tbGeneral; - // - // gpnlDebug - // - this.gpnlDebug.BackColor = System.Drawing.Color.Transparent; - this.gpnlDebug.CanvasColor = System.Drawing.SystemColors.Control; - this.gpnlDebug.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.gpnlDebug.Controls.Add(this.cbxDebugText); - this.gpnlDebug.Controls.Add(this.cbxDebugPagination); - this.gpnlDebug.Location = new System.Drawing.Point(385, 75); - this.gpnlDebug.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.gpnlDebug.Name = "gpnlDebug"; - this.gpnlDebug.Size = new System.Drawing.Size(90, 74); - // - // - // - this.gpnlDebug.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.gpnlDebug.Style.BackColorGradientAngle = 90; - this.gpnlDebug.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.gpnlDebug.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.gpnlDebug.Style.BorderBottomWidth = 1; - this.gpnlDebug.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.gpnlDebug.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.gpnlDebug.Style.BorderLeftWidth = 1; - this.gpnlDebug.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.gpnlDebug.Style.BorderRightWidth = 1; - this.gpnlDebug.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.gpnlDebug.Style.BorderTopWidth = 1; - this.gpnlDebug.Style.CornerDiameter = 4; - this.gpnlDebug.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.gpnlDebug.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; - this.gpnlDebug.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.gpnlDebug.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; - // - // - // - this.gpnlDebug.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.gpnlDebug.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.gpnlDebug.TabIndex = 86; - this.gpnlDebug.Text = "Debug"; - // - // cbxDebugText - // - this.cbxDebugText.AutoSize = true; - this.cbxDebugText.BackColor = System.Drawing.Color.Transparent; - this.cbxDebugText.Location = new System.Drawing.Point(8, 30); - this.cbxDebugText.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.cbxDebugText.Name = "cbxDebugText"; - this.cbxDebugText.Size = new System.Drawing.Size(47, 17); - this.cbxDebugText.TabIndex = 1; - this.cbxDebugText.Text = "Text"; - this.cbxDebugText.UseVisualStyleBackColor = false; - // - // cbxDebugPagination - // - this.cbxDebugPagination.AutoSize = true; - this.cbxDebugPagination.BackColor = System.Drawing.Color.Transparent; - this.cbxDebugPagination.Location = new System.Drawing.Point(9, 7); - this.cbxDebugPagination.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.cbxDebugPagination.Name = "cbxDebugPagination"; - this.cbxDebugPagination.Size = new System.Drawing.Size(76, 17); - this.cbxDebugPagination.TabIndex = 0; - this.cbxDebugPagination.Text = "Pagination"; - this.cbxDebugPagination.UseVisualStyleBackColor = false; - // - // grpDateSelector - // - this.grpDateSelector.BackColor = System.Drawing.Color.Transparent; - this.grpDateSelector.CanvasColor = System.Drawing.SystemColors.Control; - this.grpDateSelector.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.grpDateSelector.Controls.Add(this.calDateSelector); - this.grpDateSelector.Location = new System.Drawing.Point(210, 75); - this.grpDateSelector.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.grpDateSelector.Name = "grpDateSelector"; - this.grpDateSelector.Size = new System.Drawing.Size(150, 136); - // - // - // - this.grpDateSelector.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.grpDateSelector.Style.BackColorGradientAngle = 90; - this.grpDateSelector.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.grpDateSelector.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.grpDateSelector.Style.BorderBottomWidth = 1; - this.grpDateSelector.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.grpDateSelector.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.grpDateSelector.Style.BorderLeftWidth = 1; - this.grpDateSelector.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.grpDateSelector.Style.BorderRightWidth = 1; - this.grpDateSelector.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.grpDateSelector.Style.BorderTopWidth = 1; - this.grpDateSelector.Style.CornerDiameter = 4; - this.grpDateSelector.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.grpDateSelector.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; - this.grpDateSelector.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.grpDateSelector.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; - // - // - // - this.grpDateSelector.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.grpDateSelector.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.grpDateSelector.TabIndex = 85; - this.grpDateSelector.Text = "Select Revision Date"; - this.grpDateSelector.Visible = false; - // - // calDateSelector - // - this.calDateSelector.AnnuallyMarkedDates = new System.DateTime[0]; - this.calDateSelector.AutoSize = true; - // - // - // - this.calDateSelector.BackgroundStyle.BackColor = System.Drawing.SystemColors.Window; - this.calDateSelector.BackgroundStyle.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.calDateSelector.BackgroundStyle.BorderBottomWidth = 1; - this.calDateSelector.BackgroundStyle.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.calDateSelector.BackgroundStyle.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.calDateSelector.BackgroundStyle.BorderLeftWidth = 1; - this.calDateSelector.BackgroundStyle.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.calDateSelector.BackgroundStyle.BorderRightWidth = 1; - this.calDateSelector.BackgroundStyle.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.calDateSelector.BackgroundStyle.BorderTopWidth = 1; - this.calDateSelector.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.calDateSelector.CommandsBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.calDateSelector.ContainerControlProcessDialogKey = true; - this.calDateSelector.DisplayMonth = new System.DateTime(2010, 8, 1, 0, 0, 0, 0); - this.calDateSelector.Location = new System.Drawing.Point(10, 2); - this.calDateSelector.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.calDateSelector.MarkedDates = new System.DateTime[0]; - this.calDateSelector.MonthlyMarkedDates = new System.DateTime[0]; - this.calDateSelector.Name = "calDateSelector"; - // - // - // - this.calDateSelector.NavigationBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; - this.calDateSelector.NavigationBackgroundStyle.BackColorGradientAngle = 90; - this.calDateSelector.NavigationBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; - this.calDateSelector.NavigationBackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.calDateSelector.Size = new System.Drawing.Size(170, 131); - this.calDateSelector.TabIndex = 84; - this.calDateSelector.Text = "monthCalendarAdv1"; - this.calDateSelector.Visible = false; - this.calDateSelector.WeeklyMarkedDays = new System.DayOfWeek[0]; - this.calDateSelector.DateSelected += new System.Windows.Forms.DateRangeEventHandler(this.calDateSelector_DateSelected); - // - // txbReviewDate - // - // - // - // - this.txbReviewDate.Border.Class = "TextBoxBorder"; - this.txbReviewDate.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.txbReviewDate.Location = new System.Drawing.Point(102, 140); - this.txbReviewDate.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.txbReviewDate.Name = "txbReviewDate"; - this.txbReviewDate.Size = new System.Drawing.Size(91, 20); - this.txbReviewDate.TabIndex = 83; - this.txbReviewDate.Leave += new System.EventHandler(this.txbReviewDate_Leave); - this.txbReviewDate.Enter += new System.EventHandler(this.txbReviewDate_Enter); - // - // txbRevDate - // - // - // - // - this.txbRevDate.Border.Class = "TextBoxBorder"; - this.txbRevDate.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.txbRevDate.Location = new System.Drawing.Point(102, 107); - this.txbRevDate.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.txbRevDate.Name = "txbRevDate"; - this.txbRevDate.Size = new System.Drawing.Size(91, 20); - this.txbRevDate.TabIndex = 82; - this.txbRevDate.Leave += new System.EventHandler(this.txbRevDate_Leave); - this.txbRevDate.Enter += new System.EventHandler(this.txbRevDate_Enter); - // - // txbPDFLocation - // - this.txbPDFLocation.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - // - // - // - this.txbPDFLocation.Border.Class = "TextBoxBorder"; - this.txbPDFLocation.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.txbPDFLocation.Enabled = false; - this.txbPDFLocation.Location = new System.Drawing.Point(102, 8); - this.txbPDFLocation.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.txbPDFLocation.Name = "txbPDFLocation"; - this.txbPDFLocation.ShortcutsEnabled = false; - this.txbPDFLocation.Size = new System.Drawing.Size(388, 20); - this.txbPDFLocation.TabIndex = 81; - this.txbPDFLocation.WatermarkText = "PDF Location"; - this.txbPDFLocation.Leave += new System.EventHandler(this.txbPDFLocation_Leave); - // - // cbxOpenAfterCreate2 - // - this.cbxOpenAfterCreate2.AutoSize = true; - this.cbxOpenAfterCreate2.BackColor = System.Drawing.Color.Transparent; - this.cbxOpenAfterCreate2.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.docVersionConfigBindingSource, "Print_AlwaysViewPDFAfterCreate", true)); - this.cbxOpenAfterCreate2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cbxOpenAfterCreate2.Location = new System.Drawing.Point(12, 195); - this.cbxOpenAfterCreate2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.cbxOpenAfterCreate2.Name = "cbxOpenAfterCreate2"; - this.cbxOpenAfterCreate2.Size = new System.Drawing.Size(145, 19); - this.cbxOpenAfterCreate2.TabIndex = 80; - this.cbxOpenAfterCreate2.Text = "View PDF After Create"; - this.cbxOpenAfterCreate2.UseVisualStyleBackColor = false; - // - // docVersionConfigBindingSource - // - this.docVersionConfigBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.DocVersionConfig); - // - // cbxOverwritePDF2 - // - this.cbxOverwritePDF2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.cbxOverwritePDF2.AutoSize = true; - this.cbxOverwritePDF2.BackColor = System.Drawing.Color.Transparent; - this.cbxOverwritePDF2.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.docVersionConfigBindingSource, "Print_AlwaysOverwritePDF", true)); - this.cbxOverwritePDF2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cbxOverwritePDF2.ForeColor = System.Drawing.SystemColors.ControlText; - this.cbxOverwritePDF2.Location = new System.Drawing.Point(342, 39); - this.cbxOverwritePDF2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.cbxOverwritePDF2.Name = "cbxOverwritePDF2"; - this.cbxOverwritePDF2.Size = new System.Drawing.Size(127, 19); - this.cbxOverwritePDF2.TabIndex = 79; - this.cbxOverwritePDF2.Text = "Overwrite PDF File"; - this.cbxOverwritePDF2.UseVisualStyleBackColor = false; - // - // txbRevNum - // - // - // - // - this.txbRevNum.Border.Class = "TextBoxBorder"; - this.txbRevNum.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.txbRevNum.Location = new System.Drawing.Point(102, 75); - this.txbRevNum.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.txbRevNum.Name = "txbRevNum"; - this.txbRevNum.Size = new System.Drawing.Size(91, 20); - this.txbRevNum.TabIndex = 73; - this.txbRevNum.Leave += new System.EventHandler(this.txbRevNum_Leave); - // - // lblReviewDate - // - this.lblReviewDate.BackColor = System.Drawing.Color.Transparent; - // - // - // - this.lblReviewDate.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.lblReviewDate.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblReviewDate.Location = new System.Drawing.Point(7, 140); - this.lblReviewDate.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.lblReviewDate.Name = "lblReviewDate"; - this.lblReviewDate.Size = new System.Drawing.Size(86, 19); - this.lblReviewDate.TabIndex = 72; - this.lblReviewDate.Text = "Review Date"; - this.lblReviewDate.TextAlignment = System.Drawing.StringAlignment.Far; - // - // lblRevDate - // - this.lblRevDate.BackColor = System.Drawing.Color.Transparent; - // - // - // - this.lblRevDate.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.lblRevDate.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblRevDate.Location = new System.Drawing.Point(7, 107); - this.lblRevDate.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.lblRevDate.Name = "lblRevDate"; - this.lblRevDate.Size = new System.Drawing.Size(86, 19); - this.lblRevDate.TabIndex = 71; - this.lblRevDate.Text = "Revision Date"; - this.lblRevDate.TextAlignment = System.Drawing.StringAlignment.Far; - // - // lblRevNum - // - this.lblRevNum.BackColor = System.Drawing.Color.Transparent; - // - // - // - this.lblRevNum.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.lblRevNum.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblRevNum.Location = new System.Drawing.Point(7, 75); - this.lblRevNum.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.lblRevNum.Name = "lblRevNum"; - this.lblRevNum.Size = new System.Drawing.Size(86, 19); - this.lblRevNum.TabIndex = 70; - this.lblRevNum.Text = "Revision Number"; - this.lblRevNum.TextAlignment = System.Drawing.StringAlignment.Far; - // - // txbPDFName - // - this.txbPDFName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - // - // - // - this.txbPDFName.Border.Class = "TextBoxBorder"; - this.txbPDFName.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.txbPDFName.Location = new System.Drawing.Point(102, 39); - this.txbPDFName.Name = "txbPDFName"; - this.txbPDFName.Size = new System.Drawing.Size(197, 20); - this.txbPDFName.TabIndex = 8; - // - // lblPDFFileName - // - this.lblPDFFileName.BackColor = System.Drawing.Color.Transparent; - // - // - // - this.lblPDFFileName.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.lblPDFFileName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblPDFFileName.Location = new System.Drawing.Point(7, 34); - this.lblPDFFileName.Name = "lblPDFFileName"; - this.lblPDFFileName.Size = new System.Drawing.Size(86, 19); - this.lblPDFFileName.TabIndex = 7; - this.lblPDFFileName.Text = "PDF Name"; - this.lblPDFFileName.TextAlignment = System.Drawing.StringAlignment.Far; - // - // lblPDFLoc - // - this.lblPDFLoc.BackColor = System.Drawing.Color.Transparent; - // - // - // - this.lblPDFLoc.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.lblPDFLoc.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblPDFLoc.Location = new System.Drawing.Point(7, 3); - this.lblPDFLoc.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.lblPDFLoc.Name = "lblPDFLoc"; - this.lblPDFLoc.Size = new System.Drawing.Size(86, 19); - this.lblPDFLoc.TabIndex = 4; - this.lblPDFLoc.Text = "PDF Location"; - this.lblPDFLoc.TextAlignment = System.Drawing.StringAlignment.Far; - // - // tbGeneral - // - this.tbGeneral.AttachedControl = this.tabControlPanel3; - this.tbGeneral.Name = "tbGeneral"; - this.tbGeneral.Text = "General"; - // - // tabControlPanel2 - // - this.tabControlPanel2.Controls.Add(this.ppGpbxCBType); - this.tabControlPanel2.Controls.Add(this.ppGpbxUserSpecCB); - this.tabControlPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControlPanel2.Location = new System.Drawing.Point(0, 22); - this.tabControlPanel2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.tabControlPanel2.Name = "tabControlPanel2"; - this.tabControlPanel2.Padding = new System.Windows.Forms.Padding(1); - this.tabControlPanel2.Size = new System.Drawing.Size(502, 221); - this.tabControlPanel2.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); - this.tabControlPanel2.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); - this.tabControlPanel2.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tabControlPanel2.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); - this.tabControlPanel2.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tabControlPanel2.Style.GradientAngle = 90; - this.tabControlPanel2.TabIndex = 2; - this.tabControlPanel2.TabItem = this.tbChangeBars; - // - // ppGpbxCBType - // - this.ppGpbxCBType.BackColor = System.Drawing.Color.Transparent; - this.ppGpbxCBType.CanvasColor = System.Drawing.SystemColors.Control; - this.ppGpbxCBType.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.ppGpbxCBType.Controls.Add(this.rbCustom); - this.ppGpbxCBType.Controls.Add(this.rbFormatDefault); - this.ppGpbxCBType.Location = new System.Drawing.Point(41, 10); - this.ppGpbxCBType.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.ppGpbxCBType.Name = "ppGpbxCBType"; - this.ppGpbxCBType.Size = new System.Drawing.Size(426, 45); - // - // - // - this.ppGpbxCBType.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.ppGpbxCBType.Style.BackColorGradientAngle = 90; - this.ppGpbxCBType.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.ppGpbxCBType.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxCBType.Style.BorderBottomWidth = 1; - this.ppGpbxCBType.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.ppGpbxCBType.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxCBType.Style.BorderLeftWidth = 1; - this.ppGpbxCBType.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxCBType.Style.BorderRightWidth = 1; - this.ppGpbxCBType.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxCBType.Style.BorderTopWidth = 1; - this.ppGpbxCBType.Style.CornerDiameter = 4; - this.ppGpbxCBType.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.ppGpbxCBType.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; - this.ppGpbxCBType.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.ppGpbxCBType.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; - // - // - // - this.ppGpbxCBType.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ppGpbxCBType.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ppGpbxCBType.TabIndex = 54; - this.ppGpbxCBType.Text = "Type"; - // - // rbCustom - // - this.rbCustom.AutoSize = true; - this.rbCustom.Location = new System.Drawing.Point(197, 4); - this.rbCustom.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.rbCustom.Name = "rbCustom"; - this.rbCustom.Size = new System.Drawing.Size(143, 17); - this.rbCustom.TabIndex = 1; - this.rbCustom.TabStop = true; - this.rbCustom.Text = "Custom Change Bar Text"; - this.rbCustom.UseVisualStyleBackColor = true; - this.rbCustom.Click += new System.EventHandler(this.rbCustom_Click); - // - // rbFormatDefault - // - this.rbFormatDefault.AutoSize = true; - this.rbFormatDefault.Location = new System.Drawing.Point(26, 4); - this.rbFormatDefault.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.rbFormatDefault.Name = "rbFormatDefault"; - this.rbFormatDefault.Size = new System.Drawing.Size(94, 17); - this.rbFormatDefault.TabIndex = 0; - this.rbFormatDefault.TabStop = true; - this.rbFormatDefault.Text = "Format Default"; - this.rbFormatDefault.UseVisualStyleBackColor = true; - this.rbFormatDefault.Click += new System.EventHandler(this.rbFormatDefault_Click); - this.rbFormatDefault.CheckedChanged += new System.EventHandler(this.rbFormatDefault_CheckedChanged); - // - // ppGpbxUserSpecCB - // - this.ppGpbxUserSpecCB.BackColor = System.Drawing.Color.Transparent; - this.ppGpbxUserSpecCB.CanvasColor = System.Drawing.SystemColors.Control; - this.ppGpbxUserSpecCB.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.ppGpbxUserSpecCB.Controls.Add(this.ppGpbxUserSpecTxt); - this.ppGpbxUserSpecCB.Controls.Add(this.ppCmbxChgBarPos); - this.ppGpbxUserSpecCB.Controls.Add(this.label12); - this.ppGpbxUserSpecCB.Controls.Add(this.ppCmbxChgBarTxtType); - this.ppGpbxUserSpecCB.Controls.Add(this.label13); - this.ppGpbxUserSpecCB.Location = new System.Drawing.Point(41, 68); - this.ppGpbxUserSpecCB.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.ppGpbxUserSpecCB.Name = "ppGpbxUserSpecCB"; - this.ppGpbxUserSpecCB.Size = new System.Drawing.Size(426, 130); - // - // - // - this.ppGpbxUserSpecCB.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.ppGpbxUserSpecCB.Style.BackColorGradientAngle = 90; - this.ppGpbxUserSpecCB.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.ppGpbxUserSpecCB.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUserSpecCB.Style.BorderBottomWidth = 1; - this.ppGpbxUserSpecCB.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.ppGpbxUserSpecCB.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUserSpecCB.Style.BorderLeftWidth = 1; - this.ppGpbxUserSpecCB.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUserSpecCB.Style.BorderRightWidth = 1; - this.ppGpbxUserSpecCB.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUserSpecCB.Style.BorderTopWidth = 1; - this.ppGpbxUserSpecCB.Style.CornerDiameter = 4; - this.ppGpbxUserSpecCB.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.ppGpbxUserSpecCB.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; - this.ppGpbxUserSpecCB.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.ppGpbxUserSpecCB.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; - // - // - // - this.ppGpbxUserSpecCB.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ppGpbxUserSpecCB.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ppGpbxUserSpecCB.TabIndex = 53; - this.ppGpbxUserSpecCB.Text = "Custom Change Bar Text"; - // - // ppGpbxUserSpecTxt - // - this.ppGpbxUserSpecTxt.CanvasColor = System.Drawing.SystemColors.Control; - this.ppGpbxUserSpecTxt.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.ppGpbxUserSpecTxt.Controls.Add(this.label14); - this.ppGpbxUserSpecTxt.Controls.Add(this.ppTxbxChangeBarUserMsgTwo); - this.ppGpbxUserSpecTxt.Controls.Add(this.label15); - this.ppGpbxUserSpecTxt.Controls.Add(this.ppTxbxChangeBarUserMsgOne); - this.ppGpbxUserSpecTxt.Location = new System.Drawing.Point(242, 14); - this.ppGpbxUserSpecTxt.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.ppGpbxUserSpecTxt.Name = "ppGpbxUserSpecTxt"; - this.ppGpbxUserSpecTxt.Size = new System.Drawing.Size(158, 85); - // - // - // - this.ppGpbxUserSpecTxt.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.ppGpbxUserSpecTxt.Style.BackColorGradientAngle = 90; - this.ppGpbxUserSpecTxt.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.ppGpbxUserSpecTxt.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUserSpecTxt.Style.BorderBottomWidth = 1; - this.ppGpbxUserSpecTxt.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.ppGpbxUserSpecTxt.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUserSpecTxt.Style.BorderLeftWidth = 1; - this.ppGpbxUserSpecTxt.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUserSpecTxt.Style.BorderRightWidth = 1; - this.ppGpbxUserSpecTxt.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUserSpecTxt.Style.BorderTopWidth = 1; - this.ppGpbxUserSpecTxt.Style.CornerDiameter = 4; - this.ppGpbxUserSpecTxt.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.ppGpbxUserSpecTxt.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; - this.ppGpbxUserSpecTxt.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.ppGpbxUserSpecTxt.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; - // - // - // - this.ppGpbxUserSpecTxt.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ppGpbxUserSpecTxt.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ppGpbxUserSpecTxt.TabIndex = 51; - this.ppGpbxUserSpecTxt.Text = "Custom Change Bar Text"; - // - // label14 - // - this.label14.AutoSize = true; - this.label14.Location = new System.Drawing.Point(34, 11); - this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(48, 13); - this.label14.TabIndex = 4; - this.label14.Text = "Line one"; - // - // ppTxbxChangeBarUserMsgTwo - // - this.ppTxbxChangeBarUserMsgTwo.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.docVersionConfigBindingSource, "Print_UserCBMess2", true)); - this.ppTxbxChangeBarUserMsgTwo.Location = new System.Drawing.Point(89, 38); - this.ppTxbxChangeBarUserMsgTwo.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.ppTxbxChangeBarUserMsgTwo.Multiline = false; - this.ppTxbxChangeBarUserMsgTwo.Name = "ppTxbxChangeBarUserMsgTwo"; - this.ppTxbxChangeBarUserMsgTwo.Size = new System.Drawing.Size(44, 20); - this.ppTxbxChangeBarUserMsgTwo.TabIndex = 2; - this.ppTxbxChangeBarUserMsgTwo.Text = ""; - // - // label15 - // - this.label15.AutoSize = true; - this.label15.Location = new System.Drawing.Point(37, 41); - this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(47, 13); - this.label15.TabIndex = 5; - this.label15.Text = "Line two"; - // - // ppTxbxChangeBarUserMsgOne - // - this.ppTxbxChangeBarUserMsgOne.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.docVersionConfigBindingSource, "Print_UserCBMess1", true)); - this.ppTxbxChangeBarUserMsgOne.Location = new System.Drawing.Point(89, 9); - this.ppTxbxChangeBarUserMsgOne.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.ppTxbxChangeBarUserMsgOne.Multiline = false; - this.ppTxbxChangeBarUserMsgOne.Name = "ppTxbxChangeBarUserMsgOne"; - this.ppTxbxChangeBarUserMsgOne.Size = new System.Drawing.Size(44, 20); - this.ppTxbxChangeBarUserMsgOne.TabIndex = 1; - this.ppTxbxChangeBarUserMsgOne.Text = ""; - // - // ppCmbxChgBarPos - // - this.ppCmbxChgBarPos.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.docVersionConfigBindingSource, "Print_ChangeBarLoc", true)); - this.ppCmbxChgBarPos.DisplayMember = "Text"; - this.ppCmbxChgBarPos.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.ppCmbxChgBarPos.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.ppCmbxChgBarPos.FormattingEnabled = true; - this.ppCmbxChgBarPos.Location = new System.Drawing.Point(82, 80); - this.ppCmbxChgBarPos.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.ppCmbxChgBarPos.Name = "ppCmbxChgBarPos"; - this.ppCmbxChgBarPos.Size = new System.Drawing.Size(135, 21); - this.ppCmbxChgBarPos.TabIndex = 48; - this.ppCmbxChgBarPos.Visible = false; - this.ppCmbxChgBarPos.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppCmbxChgBarPos.WatermarkText = "select change bar position"; - // - // label12 - // - this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(34, 82); - this.label12.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(44, 13); - this.label12.TabIndex = 9; - this.label12.Text = "Position"; - this.label12.Visible = false; - // - // ppCmbxChgBarTxtType - // - this.ppCmbxChgBarTxtType.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.docVersionConfigBindingSource, "Print_ChangeBarText", true)); - this.ppCmbxChgBarTxtType.DisplayMember = "Text"; - this.ppCmbxChgBarTxtType.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.ppCmbxChgBarTxtType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.ppCmbxChgBarTxtType.FormattingEnabled = true; - this.ppCmbxChgBarTxtType.Location = new System.Drawing.Point(82, 40); - this.ppCmbxChgBarTxtType.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.ppCmbxChgBarTxtType.Name = "ppCmbxChgBarTxtType"; - this.ppCmbxChgBarTxtType.Size = new System.Drawing.Size(140, 21); - this.ppCmbxChgBarTxtType.TabIndex = 48; - this.ppCmbxChgBarTxtType.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppCmbxChgBarTxtType.WatermarkText = "select change bar text type"; - this.ppCmbxChgBarTxtType.SelectedIndexChanged += new System.EventHandler(this.ppCmbxChgBarTxtType_SelectedIndexChanged); - // - // label13 - // - this.label13.AutoSize = true; - this.label13.Location = new System.Drawing.Point(25, 41); - this.label13.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(55, 13); - this.label13.TabIndex = 8; - this.label13.Text = "Text Type"; - // - // tbChangeBars - // - this.tbChangeBars.AttachedControl = this.tabControlPanel2; - this.tbChangeBars.Name = "tbChangeBars"; - this.tbChangeBars.Text = "Change Bars"; - this.tbChangeBars.Visible = false; - // - // tabControlPanel1 - // - this.tabControlPanel1.Controls.Add(this.lblMultiunitPdfLocation); - this.tabControlPanel1.Controls.Add(this.cbxMultiunitPdfLocation); - this.tabControlPanel1.Controls.Add(this.lblWatermarkS); - this.tabControlPanel1.Controls.Add(this.txbPdfLocationS); - this.tabControlPanel1.Controls.Add(this.btnPdfLocation); - this.tabControlPanel1.Controls.Add(this.lblPdfLocS); - this.tabControlPanel1.Controls.Add(this.btnWaterMarkOff); - this.tabControlPanel1.Controls.Add(this.btnChgBarOff); - this.tabControlPanel1.Controls.Add(this.btnDuplxOff); - this.tabControlPanel1.Controls.Add(this.lblAutoDuplexing); - this.tabControlPanel1.Controls.Add(this.btnDuplxOn); - this.tabControlPanel1.Controls.Add(this.btnWaterMarkOn); - this.tabControlPanel1.Controls.Add(this.cbxWaterMark); - this.tabControlPanel1.Controls.Add(this.lblChgBars); - this.tabControlPanel1.Controls.Add(this.btnChgBarOn); - this.tabControlPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControlPanel1.Location = new System.Drawing.Point(0, 22); - this.tabControlPanel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.tabControlPanel1.Name = "tabControlPanel1"; - this.tabControlPanel1.Padding = new System.Windows.Forms.Padding(1); - this.tabControlPanel1.Size = new System.Drawing.Size(502, 221); - this.tabControlPanel1.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); - this.tabControlPanel1.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); - this.tabControlPanel1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tabControlPanel1.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); - this.tabControlPanel1.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tabControlPanel1.Style.GradientAngle = 90; - this.tabControlPanel1.TabIndex = 5; - this.tabControlPanel1.TabItem = this.tbSettings; - // - // lblWatermarkS - // - this.lblWatermarkS.BackColor = System.Drawing.Color.Transparent; - // - // - // - this.lblWatermarkS.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.lblWatermarkS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblWatermarkS.Location = new System.Drawing.Point(30, 84); - this.lblWatermarkS.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.lblWatermarkS.Name = "lblWatermarkS"; - this.lblWatermarkS.Size = new System.Drawing.Size(86, 19); - this.lblWatermarkS.TabIndex = 106; - this.lblWatermarkS.Text = "Watermark"; - this.lblWatermarkS.TextAlignment = System.Drawing.StringAlignment.Far; - // - // txbPdfLocationS - // - this.txbPdfLocationS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - // - // - // - this.txbPdfLocationS.Border.Class = "TextBoxBorder"; - this.txbPdfLocationS.Border.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.txbPdfLocationS.Location = new System.Drawing.Point(94, 3); - this.txbPdfLocationS.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.txbPdfLocationS.Name = "txbPdfLocationS"; - this.txbPdfLocationS.ShortcutsEnabled = false; - this.txbPdfLocationS.Size = new System.Drawing.Size(373, 20); - this.txbPdfLocationS.TabIndex = 98; - this.txbPdfLocationS.WatermarkText = "PDF Location"; - // - // btnPdfLocation - // - this.btnPdfLocation.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnPdfLocation.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnPdfLocation.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnPdfLocation.Image = ((System.Drawing.Image)(resources.GetObject("btnPdfLocation.Image"))); - this.btnPdfLocation.Location = new System.Drawing.Point(471, 3); - this.btnPdfLocation.Name = "btnPdfLocation"; - this.btnPdfLocation.Size = new System.Drawing.Size(20, 19); - this.btnPdfLocation.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnPdfLocation.TabIndex = 99; - this.btnPdfLocation.Click += new System.EventHandler(this.btnPdfLocation_Click); - // - // lblPdfLocS - // - this.lblPdfLocS.BackColor = System.Drawing.Color.Transparent; - // - // - // - this.lblPdfLocS.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.lblPdfLocS.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblPdfLocS.Location = new System.Drawing.Point(7, 3); - this.lblPdfLocS.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.lblPdfLocS.Name = "lblPdfLocS"; - this.lblPdfLocS.Size = new System.Drawing.Size(86, 19); - this.lblPdfLocS.TabIndex = 97; - this.lblPdfLocS.Text = "PDF Location"; - this.lblPdfLocS.TextAlignment = System.Drawing.StringAlignment.Far; - // - // btnWaterMarkOff - // - this.btnWaterMarkOff.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnWaterMarkOff.Checked = true; - this.btnWaterMarkOff.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnWaterMarkOff.Location = new System.Drawing.Point(164, 84); - this.btnWaterMarkOff.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.btnWaterMarkOff.Name = "btnWaterMarkOff"; - this.btnWaterMarkOff.Size = new System.Drawing.Size(34, 19); - this.btnWaterMarkOff.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnWaterMarkOff.TabIndex = 93; - this.btnWaterMarkOff.Text = "OFF"; - this.btnWaterMarkOff.Click += new System.EventHandler(this.btnAdvWaterMarkOff_Click); - // - // btnChgBarOff - // - this.btnChgBarOff.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnChgBarOff.Checked = true; - this.btnChgBarOff.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnChgBarOff.Location = new System.Drawing.Point(164, 58); - this.btnChgBarOff.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.btnChgBarOff.Name = "btnChgBarOff"; - this.btnChgBarOff.Size = new System.Drawing.Size(34, 19); - this.btnChgBarOff.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnChgBarOff.TabIndex = 92; - this.btnChgBarOff.Text = "OFF"; - this.btnChgBarOff.Click += new System.EventHandler(this.btnAvChgBarOff_Click); - // - // btnDuplxOff - // - this.btnDuplxOff.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnDuplxOff.Checked = true; - this.btnDuplxOff.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnDuplxOff.Location = new System.Drawing.Point(164, 111); - this.btnDuplxOff.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.btnDuplxOff.Name = "btnDuplxOff"; - this.btnDuplxOff.Size = new System.Drawing.Size(33, 19); - this.btnDuplxOff.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnDuplxOff.TabIndex = 91; - this.btnDuplxOff.Text = "OFF"; - this.btnDuplxOff.Click += new System.EventHandler(this.btnAdvDuplxOff_Click); - // - // lblAutoDuplexing - // - this.lblAutoDuplexing.BackColor = System.Drawing.Color.Transparent; - // - // - // - this.lblAutoDuplexing.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.lblAutoDuplexing.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblAutoDuplexing.Location = new System.Drawing.Point(30, 111); - this.lblAutoDuplexing.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.lblAutoDuplexing.Name = "lblAutoDuplexing"; - this.lblAutoDuplexing.Size = new System.Drawing.Size(86, 19); - this.lblAutoDuplexing.TabIndex = 90; - this.lblAutoDuplexing.Text = "Auto Duplexing"; - this.lblAutoDuplexing.TextAlignment = System.Drawing.StringAlignment.Far; - // - // btnDuplxOn - // - this.btnDuplxOn.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnDuplxOn.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnDuplxOn.Location = new System.Drawing.Point(123, 111); - this.btnDuplxOn.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.btnDuplxOn.Name = "btnDuplxOn"; - this.btnDuplxOn.Size = new System.Drawing.Size(34, 19); - this.btnDuplxOn.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnDuplxOn.TabIndex = 89; - this.btnDuplxOn.Text = "ON"; - this.btnDuplxOn.Click += new System.EventHandler(this.btnAdvDuplxOn_Click); - // - // btnWaterMarkOn - // - this.btnWaterMarkOn.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnWaterMarkOn.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnWaterMarkOn.Location = new System.Drawing.Point(123, 84); - this.btnWaterMarkOn.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.btnWaterMarkOn.Name = "btnWaterMarkOn"; - this.btnWaterMarkOn.Size = new System.Drawing.Size(34, 19); - this.btnWaterMarkOn.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnWaterMarkOn.TabIndex = 88; - this.btnWaterMarkOn.Text = "ON"; - this.btnWaterMarkOn.Click += new System.EventHandler(this.btnAdvWaterMarkOn_Click); - // - // cbxWaterMark - // - this.cbxWaterMark.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.docVersionConfigBindingSource, "Print_Watermark", true)); - this.cbxWaterMark.DisplayMember = "Text"; - this.cbxWaterMark.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.cbxWaterMark.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbxWaterMark.FormattingEnabled = true; - this.cbxWaterMark.Location = new System.Drawing.Point(202, 84); - this.cbxWaterMark.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.cbxWaterMark.Name = "cbxWaterMark"; - this.cbxWaterMark.Size = new System.Drawing.Size(138, 21); - this.cbxWaterMark.TabIndex = 87; - this.cbxWaterMark.Visible = false; - this.cbxWaterMark.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cbxWaterMark.WatermarkText = "select watermark option"; - // - // lblChgBars - // - this.lblChgBars.BackColor = System.Drawing.Color.Transparent; - // - // - // - this.lblChgBars.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.lblChgBars.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblChgBars.Location = new System.Drawing.Point(30, 58); - this.lblChgBars.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.lblChgBars.Name = "lblChgBars"; - this.lblChgBars.Size = new System.Drawing.Size(86, 19); - this.lblChgBars.TabIndex = 85; - this.lblChgBars.Text = "Change Bars"; - this.lblChgBars.TextAlignment = System.Drawing.StringAlignment.Far; - // - // btnChgBarOn - // - this.btnChgBarOn.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnChgBarOn.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnChgBarOn.Location = new System.Drawing.Point(123, 58); - this.btnChgBarOn.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.btnChgBarOn.Name = "btnChgBarOn"; - this.btnChgBarOn.Size = new System.Drawing.Size(34, 19); - this.btnChgBarOn.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnChgBarOn.TabIndex = 84; - this.btnChgBarOn.Text = "ON"; - this.btnChgBarOn.Click += new System.EventHandler(this.btnAvChgBarOn_Click); - // - // tbSettings - // - this.tbSettings.AttachedControl = this.tabControlPanel1; - this.tbSettings.Name = "tbSettings"; - this.tbSettings.Text = "Settings"; - this.tbSettings.Click += new System.EventHandler(this.tbSettings_Click); - // - // btnCreatePDF - // - this.btnCreatePDF.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnCreatePDF.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnCreatePDF.BackColor = System.Drawing.SystemColors.Control; - this.btnCreatePDF.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnCreatePDF.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnCreatePDF.Location = new System.Drawing.Point(15, 249); - this.btnCreatePDF.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.btnCreatePDF.Name = "btnCreatePDF"; - this.btnCreatePDF.Size = new System.Drawing.Size(114, 29); - this.btnCreatePDF.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnCreatePDF.TabIndex = 1; - this.btnCreatePDF.Text = "Create PDF"; - this.btnCreatePDF.Click += new System.EventHandler(this.btnCreatePDF_Click); - // - // btnCancel - // - this.btnCancel.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnCancel.BackColor = System.Drawing.SystemColors.Control; - this.btnCancel.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnCancel.Location = new System.Drawing.Point(401, 249); - this.btnCancel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(90, 29); - this.btnCancel.Style = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; - this.btnCancel.TabIndex = 2; - this.btnCancel.Text = "Cancel"; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // cbxDebug - // - this.cbxDebug.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.cbxDebug.AutoSize = true; - this.cbxDebug.BackColor = System.Drawing.Color.Transparent; - this.cbxDebug.Checked = true; - this.cbxDebug.CheckState = System.Windows.Forms.CheckState.Checked; - this.cbxDebug.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.docVersionConfigBindingSource, "Print_AlwaysOverwritePDF", true)); - this.cbxDebug.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cbxDebug.ForeColor = System.Drawing.SystemColors.ControlText; - this.cbxDebug.Location = new System.Drawing.Point(176, 366); - this.cbxDebug.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.cbxDebug.Name = "cbxDebug"; - this.cbxDebug.Size = new System.Drawing.Size(137, 22); - this.cbxDebug.TabIndex = 98; - this.cbxDebug.Text = "Compare PDF"; - this.cbxDebug.UseVisualStyleBackColor = false; - // - // cbxOrPgBrk - // - this.cbxOrPgBrk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.cbxOrPgBrk.AutoSize = true; - this.cbxOrPgBrk.BackColor = System.Drawing.Color.Transparent; - this.cbxOrPgBrk.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.docVersionConfigBindingSource, "Print_AlwaysOverwritePDF", true)); - this.cbxOrPgBrk.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cbxOrPgBrk.ForeColor = System.Drawing.SystemColors.ControlText; - this.cbxOrPgBrk.Location = new System.Drawing.Point(202, 260); - this.cbxOrPgBrk.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.cbxOrPgBrk.Name = "cbxOrPgBrk"; - this.cbxOrPgBrk.Size = new System.Drawing.Size(167, 19); - this.cbxOrPgBrk.TabIndex = 99; - this.cbxOrPgBrk.Text = "Use Original Page Breaks"; - this.cbxOrPgBrk.UseVisualStyleBackColor = false; - // - // superTooltip1 - // - this.superTooltip1.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F"; - // - // cbxCmpPRMSpfd - // - this.cbxCmpPRMSpfd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.cbxCmpPRMSpfd.AutoSize = true; - this.cbxCmpPRMSpfd.BackColor = System.Drawing.Color.Transparent; - this.cbxCmpPRMSpfd.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.docVersionConfigBindingSource, "Print_AlwaysOverwritePDF", true)); - this.cbxCmpPRMSpfd.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cbxCmpPRMSpfd.ForeColor = System.Drawing.SystemColors.ControlText; - this.cbxCmpPRMSpfd.Location = new System.Drawing.Point(142, 305); - this.cbxCmpPRMSpfd.Margin = new System.Windows.Forms.Padding(2); - this.cbxCmpPRMSpfd.Name = "cbxCmpPRMSpfd"; - this.cbxCmpPRMSpfd.Size = new System.Drawing.Size(165, 17); - this.cbxCmpPRMSpfd.TabIndex = 100; - this.cbxCmpPRMSpfd.Text = "PROMS PDF to PROMS PDF"; - this.cbxCmpPRMSpfd.UseVisualStyleBackColor = false; - this.cbxCmpPRMSpfd.Visible = false; - // - // cbxMultiunitPdfLocation - // - this.cbxMultiunitPdfLocation.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.docVersionConfigBindingSource, "Print_Watermark", true)); - this.cbxMultiunitPdfLocation.DisplayMember = "Text"; - this.cbxMultiunitPdfLocation.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.cbxMultiunitPdfLocation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbxMultiunitPdfLocation.FormattingEnabled = true; - this.cbxMultiunitPdfLocation.Items.AddRange(new object[] { - this.muLocNone, - this.muLocName, - this.muLocNumber, - this.muLocText, - this.muLocID}); - this.cbxMultiunitPdfLocation.Location = new System.Drawing.Point(164, 30); - this.cbxMultiunitPdfLocation.Margin = new System.Windows.Forms.Padding(2); - this.cbxMultiunitPdfLocation.Name = "cbxMultiunitPdfLocation"; - this.cbxMultiunitPdfLocation.Size = new System.Drawing.Size(298, 21); - this.cbxMultiunitPdfLocation.TabIndex = 107; - this.cbxMultiunitPdfLocation.Visible = false; - this.cbxMultiunitPdfLocation.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cbxMultiunitPdfLocation.WatermarkText = "select watermark option"; - // - // lblMultiunitPdfLocation - // - this.lblMultiunitPdfLocation.BackColor = System.Drawing.Color.Transparent; - // - this.pbPDFsStatus.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.pbPDFsStatus.Location = new System.Drawing.Point(7, 220); - this.pbPDFsStatus.Name = "pbPDFsStatus"; - this.pbPDFsStatus.Size = new System.Drawing.Size(539, 23); - this.pbPDFsStatus.TabIndex = 87; - this.pbPDFsStatus.Text = "Procedures Converted to PDF"; - this.pbPDFsStatus.Visible = false; - // - // - this.lblMultiunitPdfLocation.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.lblMultiunitPdfLocation.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblMultiunitPdfLocation.Location = new System.Drawing.Point(29, 30); - this.lblMultiunitPdfLocation.Margin = new System.Windows.Forms.Padding(2); - this.lblMultiunitPdfLocation.Name = "lblMultiunitPdfLocation"; - this.lblMultiunitPdfLocation.Size = new System.Drawing.Size(127, 19); - this.lblMultiunitPdfLocation.TabIndex = 108; - this.lblMultiunitPdfLocation.Text = "Multi Unit PDF Location"; - this.lblMultiunitPdfLocation.TextAlignment = System.Drawing.StringAlignment.Far; - this.lblMultiunitPdfLocation.Visible = false; - // - // muLocNone - // - this.muLocNone.Text = "None"; - // - // muLocName - // - this.muLocName.Text = "Unit Name"; - // - // muLocNumber - // - this.muLocNumber.Text = "Unit Number"; - // - // muLocText - // - this.muLocText.Text = "Unit Text"; - // - // muLocID - // - this.muLocID.Text = "Unit ID"; - // - // DlgPrintProcedure - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(506, 279); - this.Controls.Add(this.cbxCmpPRMSpfd); - this.Controls.Add(this.cbxOrPgBrk); - this.Controls.Add(this.cbxDebug); - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnCreatePDF); - this.Controls.Add(this.tabControl1); - this.DoubleBuffered = true; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "DlgPrintProcedure"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Create PDF"; - this.Load += new System.EventHandler(this.DlgPrintProcedure_Load); - this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.DlgPrintProcedure_FormClosed); - ((System.ComponentModel.ISupportInitialize)(this.tabControl1)).EndInit(); - this.tabControl1.ResumeLayout(false); - this.tabControlPanel3.ResumeLayout(false); - this.tabControlPanel3.PerformLayout(); - this.gpnlDebug.ResumeLayout(false); - this.gpnlDebug.PerformLayout(); - this.grpDateSelector.ResumeLayout(false); - this.grpDateSelector.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.docVersionConfigBindingSource)).EndInit(); - this.tabControlPanel2.ResumeLayout(false); - this.ppGpbxCBType.ResumeLayout(false); - this.ppGpbxCBType.PerformLayout(); - this.ppGpbxUserSpecCB.ResumeLayout(false); - this.ppGpbxUserSpecCB.PerformLayout(); - this.ppGpbxUserSpecTxt.ResumeLayout(false); - this.ppGpbxUserSpecTxt.PerformLayout(); - this.tabControlPanel1.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private DevComponents.DotNetBar.TabControl tabControl1; - private DevComponents.DotNetBar.ButtonX btnCreatePDF; - private DevComponents.DotNetBar.TabControlPanel tabControlPanel2; - private DevComponents.DotNetBar.TabItem tbChangeBars; - private DevComponents.DotNetBar.ButtonX btnCancel; - private DevComponents.DotNetBar.TabControlPanel tabControlPanel3; - private DevComponents.DotNetBar.TabItem tbGeneral; - private DevComponents.DotNetBar.LabelX lblPDFLoc; - private System.Windows.Forms.FolderBrowserDialog DlgBrowseFolder; - private DevComponents.DotNetBar.Controls.TextBoxX txbRevNum; - private DevComponents.DotNetBar.LabelX lblReviewDate; - private DevComponents.DotNetBar.LabelX lblRevDate; - private DevComponents.DotNetBar.LabelX lblRevNum; - private DevComponents.DotNetBar.Controls.TextBoxX txbPDFName; - private DevComponents.DotNetBar.LabelX lblPDFFileName; - private System.Windows.Forms.CheckBox cbxOverwritePDF2; - private System.Windows.Forms.CheckBox cbxOpenAfterCreate2; - private DevComponents.DotNetBar.TabControlPanel tabControlPanel1; - private DevComponents.DotNetBar.ButtonX btnWaterMarkOff; - private DevComponents.DotNetBar.ButtonX btnChgBarOff; - private DevComponents.DotNetBar.ButtonX btnDuplxOff; - private DevComponents.DotNetBar.LabelX lblAutoDuplexing; - private DevComponents.DotNetBar.ButtonX btnDuplxOn; - private DevComponents.DotNetBar.ButtonX btnWaterMarkOn; - private DevComponents.DotNetBar.Controls.ComboBoxEx cbxWaterMark; - private DevComponents.DotNetBar.LabelX lblChgBars; - private DevComponents.DotNetBar.ButtonX btnChgBarOn; - private DevComponents.DotNetBar.TabItem tbSettings; - private DevComponents.DotNetBar.Controls.GroupPanel ppGpbxUserSpecCB; - private DevComponents.DotNetBar.Controls.GroupPanel ppGpbxUserSpecTxt; - private System.Windows.Forms.Label label14; - private System.Windows.Forms.RichTextBox ppTxbxChangeBarUserMsgTwo; - private System.Windows.Forms.Label label15; - private System.Windows.Forms.RichTextBox ppTxbxChangeBarUserMsgOne; - private DevComponents.DotNetBar.Controls.ComboBoxEx ppCmbxChgBarPos; - private System.Windows.Forms.Label label12; - private DevComponents.DotNetBar.Controls.ComboBoxEx ppCmbxChgBarTxtType; - private System.Windows.Forms.BindingSource docVersionConfigBindingSource; - private DevComponents.DotNetBar.Controls.TextBoxX txbPDFLocation; - private System.Windows.Forms.CheckBox cbxDebug; - private DevComponents.DotNetBar.Controls.TextBoxX txbPdfLocationS; - private DevComponents.DotNetBar.ButtonX btnPdfLocation; - private DevComponents.DotNetBar.LabelX lblPdfLocS; - private DevComponents.DotNetBar.Controls.TextBoxX txbRevDate; - private DevComponents.DotNetBar.Controls.TextBoxX txbReviewDate; - private DevComponents.DotNetBar.LabelX lblWatermarkS; - private DevComponents.DotNetBar.Controls.GroupPanel ppGpbxCBType; - private System.Windows.Forms.RadioButton rbCustom; - private System.Windows.Forms.RadioButton rbFormatDefault; - private DevComponents.Editors.DateTimeAdv.MonthCalendarAdv calDateSelector; - private DevComponents.DotNetBar.Controls.GroupPanel grpDateSelector; - private System.Windows.Forms.Label label13; - private DevComponents.DotNetBar.Controls.GroupPanel gpnlDebug; - private System.Windows.Forms.CheckBox cbxDebugText; - private System.Windows.Forms.CheckBox cbxDebugPagination; - private System.Windows.Forms.CheckBox cbxOrPgBrk; - private DevComponents.DotNetBar.SuperTooltip superTooltip1; - private System.Windows.Forms.CheckBox cbxCmpPRMSpfd; - private DevComponents.DotNetBar.LabelX lblMultiunitPdfLocation; - private DevComponents.DotNetBar.Controls.ComboBoxEx cbxMultiunitPdfLocation; - private DevComponents.Editors.ComboItem muLocNone; - private DevComponents.Editors.ComboItem muLocName; - private DevComponents.Editors.ComboItem muLocNumber; - private DevComponents.Editors.ComboItem muLocText; - private DevComponents.Editors.ComboItem muLocID; - private DevComponents.DotNetBar.Controls.ProgressBarX pbPDFsStatus; - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs.bak b/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs.bak deleted file mode 100644 index 40669486..00000000 --- a/PROMS/VEPROMS User Interface/DlgPrintProcedure.cs.bak +++ /dev/null @@ -1,878 +0,0 @@ -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; -using VEPROMS.CSLA.Library; -using Volian.Print.Library; -//using Volian.Controls.Library; -using Volian.Base.Library; - -namespace VEPROMS -{ - public partial class DlgPrintProcedure : DevComponents.DotNetBar.Office2007Form - { - private SessionInfo _MySessionInfo; - public SessionInfo MySessionInfo - { - get { return _MySessionInfo; } - set { _MySessionInfo = value; } - } - private bool _Automatic; - public bool Automatic - { - get { return _Automatic; } - set { _Automatic = value; } - } - private void RunAutomatic() - { - cbxDebugPagination.Checked = true; - cbxDebugText.Checked = true; - Application.DoEvents(); - string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray()); - bool ranAuto = false; - foreach (string parameter in parameters) - { - if (parameter.ToUpper() == "/NT") - cbxDebugText.Checked = false; - else if (parameter.ToUpper() == "/NP") - cbxDebugPagination.Checked = false; - else if (parameter.ToUpper() == "/NC") - cbxDebug.Checked = false; - } - //PromsPrinter.tReset(); - CreatePDFs(); - //PromsPrinter.tShowResults(); - this.Close(); - } - private DocVersionInfo _DocVersionInfo = null; - private bool _AllProcedures; - private DocVersionConfig _DocVersionConfig; - public string RevNum - { - get { return txbRevNum.Text; } - set { txbRevNum.Text = value; } - } - public string RevNumAndDate - { - get - { - // the RevDate and Rev number are stored in the procedure config separtly as strings - // we put these two strings to gether to pass into the Print module. - // the Rev Number followed by a forward slash or backslash logic is from the 16-bit code - // and is treated as just string. - // Therefore we need to build a revison number string with a revdate appended to it but only - // if either the DoRevDate or the RevDateWithForwardSlash is true. otherwise we should use - // only the RevNumber. - if (RevDate == "" || - (RevNum.Contains("\\") || RevNum.Contains("/")) || - (!MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash && - !MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate)) - return RevNum; - if (MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash) - return RevNum + "\\" + RevDate; - else - return RevNum + "/" + RevDate; - } - } - public string ProcNum - { - get { return MyProcedure.DisplayNumber; } - } - public string PDFPath - { - get { return txbPDFLocation.Text; } - set { txbPDFLocation.Text = value; } - } - public string RevDate - { - get { return txbRevDate.Text; } - set { txbRevDate.Text = value; } - } - public string ReviewDate - { - get { return txbReviewDate.Text; } - set { txbReviewDate.Text = value; } - } - public string PDFPathSetting - { - get { return txbPdfLocationS.Text; } - set { txbPdfLocationS.Text = value; } - } - public DlgPrintProcedure(DocVersionInfo dvi, bool automatic) - { - _Automatic = automatic; - InitializeComponent(); - _AllProcedures = true; - _DocVersionConfig = dvi.DocVersionConfig; - _DocVersionInfo = dvi; - _MyProcedure = dvi.Procedures[0].MyProcedure; - btnCreatePDF.Text = "Create PDFs"; - HandleDocVersionSettings(); - PrepForAllOrOne(false); - // don't open all PDFs if doing All Procedures - //cbxOpenAfterCreate2.Checked = dvi.DocVersionConfig.Print_AlwaysViewPDFAfterCreate; - } - public DlgPrintProcedure(DocVersionInfo dvi) - { - _Automatic = false; - InitializeComponent(); - _AllProcedures = true; - _DocVersionConfig = dvi.DocVersionConfig; - _DocVersionInfo = dvi; - _MyProcedure = dvi.Procedures[0].MyProcedure; - btnCreatePDF.Text = "Create PDFs"; - HandleDocVersionSettings(); - PrepForAllOrOne(false); - // don't open all PDFs if doing All Procedures - //cbxOpenAfterCreate2.Checked = dvi.DocVersionConfig.Print_AlwaysViewPDFAfterCreate; - cbxBlankPgsForDuplex.Checked = dvi.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts; - } - private void PrepForAllOrOne(bool oneProcedure) - { - txbPDFName.Visible = lblPDFFileName.Visible = oneProcedure; - txbRevNum.Visible = lblRevNum.Visible = oneProcedure; - txbReviewDate.Visible = lblReviewDate.Visible = oneProcedure; - txbRevDate.Visible = lblRevDate.Visible = oneProcedure; - cbxOpenAfterCreate2.Visible = oneProcedure; - cbxOpenAfterCreate2.Checked = false; - cbxOverwritePDF2.Visible = oneProcedure; - cbxOverwritePDF2.Checked = true; - gpnlDebug.Visible = Volian.Base.Library.VlnSettings.DebugMode; - } - private string _UnitNumber; - public string UnitNumber - { - get { return _UnitNumber; } - set { _UnitNumber = value; } - } - private int _UnitIndex; - public int UnitIndex - { - get { return _UnitIndex; } - set { _UnitIndex = value; } - } - public DlgPrintProcedure(ProcedureInfo pi) - { - InitializeComponent(); - _AllProcedures = false; - _DocVersionConfig = pi.MyDocVersion.DocVersionConfig; - _MyProcedure = pi; - btnCreatePDF.Text = "Create PDF"; - HandleDocVersionSettings(); - PrepForAllOrOne(true); - cbxOpenAfterCreate2.Checked = pi.MyDocVersion.DocVersionConfig.Print_AlwaysViewPDFAfterCreate; - cbxBlankPgsForDuplex.Checked = pi.MyDocVersion.DocVersionConfig.Print_AddBlankPagesWhenUsingDuplexFoldouts; - } - /// - /// RHM 20120925 Added so that the dialog would center over the PROMS window - /// - /// - protected override void OnActivated(EventArgs e) - { - base.OnActivated(e); - if (Owner != null) - Location = new Point(Owner.Left + Owner.Width / 2 - Width / 2, Owner.Top + Owner.Height/2 - Height/2); - } - private void HandleDocVersionSettings() - { - - GetDocVersionSettings(); - - // set to a default PDF location if none was specified in the DocVersions property - if (txbPDFLocation.Text == null || txbPDFLocation.Text.Length == 0 || !Directory.Exists(txbPDFLocation.Text)) - txbPDFLocation.Text = VlnSettings.TemporaryFolder; - SetCompareVisibility(); - // if the default setting is 'SelectBeforePrinting', put up a message box to determine whether the user - // wants change bars. If not, 'Change Bar' on the Setting tab is 'OFF' and no Change bar tab. - // If yes, the Change bar tab is the selected tab. - if (_DocVersionConfig.Print_ChangeBar == PrintChangeBar.SelectBeforePrinting) - { - DialogResult dr = DialogResult.Yes; - if(!Automatic) - dr = MessageBox.Show("Do you want change bars?", "Change Bars", MessageBoxButtons.YesNo); - if (dr == DialogResult.Yes) - { - btnChgBarOn.PerformClick(); - if(!Automatic) tabControl1.SelectedTab = tbChangeBars; - rbFormatDefault.PerformClick(); - rbFormatDefault.Checked = true; // default to 'Format Default' - } - else - { - btnChgBarOff.PerformClick(); - } - } - } - - private void GetDocVersionSettings() - { - _DocVersionConfig.SaveChangesToDocVersionConfig = false; - _DocVersionConfig.ParentLookup = false; - // PDF Location - PDFPath = _DocVersionConfig.Print_PDFLocation; - // Overwrite PDF - cbxOverwritePDF2.Checked = _DocVersionConfig.Print_AlwaysOverwritePDF; - // Open PDF After Create - cbxOpenAfterCreate2.Checked = _DocVersionConfig.Print_AlwaysViewPDFAfterCreate; - // Changebars on/off - if (_DocVersionConfig.Print_ChangeBar == PrintChangeBar.Without) - btnChgBarOff.PerformClick(); - else - btnChgBarOn.PerformClick(); - // Watermark on/off - if (_DocVersionConfig.Print_Watermark == PrintWatermark.None) - btnWaterMarkOff.PerformClick(); - else - btnWaterMarkOn.PerformClick(); - // Auto Duplexing on/off - - if ((_MyProcedure.ActiveParent as DocVersionInfo).ActiveFormat.PlantFormat.FormatData.PrintData.AllowDuplex) - { - lblAutoDuplexing.Visible = true; - btnDuplxOff.Visible = true; - btnDuplxOn.Visible = true; - if (_DocVersionConfig.Print_DisableDuplex) - btnDuplxOff.PerformClick(); - else - btnDuplxOn.PerformClick(); - } - else - { - lblAutoDuplexing.Visible = false; - btnDuplxOff.Visible = false; - btnDuplxOn.Visible = false; - } - SetCompareVisibility(); - - // default to using OriginalPageBreaks (16bit page breaks) if App.config is set - // to true: - cbxOrPgBrk.Visible = VlnSettings.OriginalPageBreak && VlnSettings.DebugMode; - cbxOrPgBrk.Checked = false; - } - - private void SetCompareVisibility() - { - // default to print Debug info if App.config is set to debug mode - // This checkbox is now labeled as "Compare PDF" - // If the PDF location has a Compare folder or we are in Debug Mode - // then make the checkbox visible - string cmpfldr = txbPDFLocation.Text; - if (!cmpfldr.EndsWith("\\")) cmpfldr += "\\"; - cmpfldr += "Compare"; - cbxDebug.Visible = Directory.Exists(cmpfldr) || VlnSettings.DebugMode; - cbxDebug.Checked = VlnSettings.DebugMode; - } - - private void DlgPrintProcedure_Load(object sender, EventArgs e) - { - SetupForProcedure(); - _MyTimer = new Timer(); - _MyTimer.Tick += new EventHandler(_MyTimer_Tick); - _MyTimer.Interval = 100; - _MyTimer.Enabled = true; - btnCreatePDF.Select(); - } - - void _MyTimer_Tick(object sender, EventArgs e) - { - _MyTimer.Enabled = false; - BringToFront(); - if (Automatic) RunAutomatic(); - } - - private Timer _MyTimer; - private void SetupForProcedure() - { - string PDFFilePrefix = _DocVersionConfig.Print_PDFFilePrefix; - string PDFFileSuffix = _DocVersionConfig.Print_PDFFileSuffix; - if(_DocVersionInfo == null)this.Text = "Create PDF for " + ProcNum; - // get list of previous pdf files - // if no previous pdf file, then get path from frmVersionProperties - // dlgSelectFile.InitialDirectory = pdf path from frmVersionProperties - //cbxPDF.Text = string.Format(@"{0}\{1}.pdf", _PDFPath, _ProcNum); - // General 2 settings - //txbPDFLocation.Text = _PDFPath; - string PDFFileName = ""; - if (ProcNum == string.Empty) - //txbPDFName.Text = this.UnitNumber + ".pdf"; - PDFFileName = this.UnitNumber; - else - //txbPDFName.Text = string.Format("{0}.pdf", _MyProcedure.PDFNumber); - PDFFileName = string.Format("{0}", _MyProcedure.PDFNumber); - //if (txbPDFName.Text.StartsWith("*")) - // txbPDFName.Text = txbPDFName.Text.Replace("*", this.UnitNumber); - if ((PDFFileName ?? "") == "") PDFFileName = "NoProcNumber"; - if (PDFFileName.StartsWith("*")) - PDFFileName = PDFFileName.Replace("*", this.UnitNumber); - txbPDFName.Text = PDFFilePrefix + PDFFileName + PDFFileSuffix + ".pdf"; - ProcedureConfig pc = _MyProcedure.MyConfig as ProcedureConfig; - if(SelectedSlave > 0) pc.SelectedSlave = SelectedSlave; - if (pc != null) - { - RevNum = pc.Print_Rev; - RevDate = pc.Print_RevDate; //== null || pc.Print_RevDate=="" ? DateTime.Today : Convert.ToDateTime(pc.Print_RevDate); - ReviewDate = pc.Print_ReviewDate; // == null ? DateTime.Today : Convert.ToDateTime(pc.Print_ReviewDate); - //Now check the format flags to determine if/how the Rev string should be parsed. - // This will covert the old way (16-bit) of setting a RevDate (appending it to the RevNumber) - // to the new way saving the RevNumber and RevDate in there own config fields - if ((_MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate && RevNum.Contains("/")) - || (_MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash && RevNum.Contains("\\"))) - { - int indx = RevNum.IndexOf(_MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash ? '\\' : '/'); - pc.Print_RevDate = RevDate = RevNum.Substring(indx + 1); - pc.Print_Rev = RevNum = RevNum.Substring(0, indx); - // save the RevNumber and RevDate to the procedure's config. - using (Item itm = Item.Get(MyProcedure.ItemID)) - { - itm.MyContent.Config = MyProcedure.MyConfig.ToString(); - itm.Save(); - } - } - } - else - { - RevNum = "0"; - RevDate = DateTime.Today.ToShortDateString(); - ReviewDate = null; - } - cbxWaterMark.DataSource = EnumDetail.Details(); - cbxWaterMark.DisplayMember = "Description"; - cbxWaterMark.ValueMember = "EValue"; - PrintWatermark pw = _DocVersionConfig.Print_Watermark; // MyProcedure.ProcedureConfig.Print_Watermark; - cbxWaterMark.Text = pw.ToString(); - - //ppCmbxChgBarPos.DataSource = EnumDetail.Details(); - //ppCmbxChgBarPos.DisplayMember = "Description"; - //ppCmbxChgBarPos.ValueMember = "EValue"; - //ppCmbxChgBarPos.SelectedIndex = (int)MyProcedure.MyDocVersion.DocVersionConfig.Print_ChangeBarLoc; - - ppCmbxChgBarTxtType.DataSource = EnumDetail.Details(); - ppCmbxChgBarTxtType.DisplayMember = "Description"; - ppCmbxChgBarTxtType.ValueMember = "EValue"; - ppCmbxChgBarTxtType.SelectedIndex = (int)_DocVersionConfig.Print_ChangeBarText; - - ppTxbxChangeBarUserMsgOne.Text = _DocVersionConfig.Print_UserCBMess1; - ppTxbxChangeBarUserMsgTwo.Text = _DocVersionConfig.Print_UserCBMess2; - ppGpbxUserSpecTxt.Enabled = ppCmbxChgBarTxtType.SelectedIndex == (int)PrintChangeBarText.UserDef; - bool hasReviewDate = _MyProcedure.ActiveFormat.PlantFormat.HasPageListToken("{REVIEWDATE}"); - bool usesRevDate = _MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate || _MyProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash; - if (_MyProcedure.Sections != null) - { - foreach (SectionInfo mysection in _MyProcedure.Sections) - hasReviewDate |= mysection.ActiveFormat.PlantFormat.HasPageListToken("{REVIEWDATE}"); - } - // Only the New HLP format and the MYA format use this - // South Texas does not use their new HLP format and MYA (Main Yankee) has dropped us (they closed) - // thus there is no supporting code to print a Review Date - // thus setting "hasReviewDate" to false so the Review Date entry box does not appear on the print dialog - // - jsj 4/3/2013 - hasReviewDate = false; // jsj 4/3/2013 - lblReviewDate.Visible = txbReviewDate.Visible = !_AllProcedures && hasReviewDate; - lblRevDate.Visible = txbRevDate.Visible = !_AllProcedures && usesRevDate; - } - - private void btnCancel_Click(object sender, EventArgs e) - { - this.Close(); - } - - private void btnAvChgBarOn_Click(object sender, EventArgs e) - { - if (!btnChgBarOn.Checked) - { - btnChgBarOn.Checked = true; - btnChgBarOff.Checked = false; - tbChangeBars.Visible = true; - // to set which radio button (Format default or Custom) is checked, look at config data - switch (_DocVersionConfig.Print_ChangeBar) - { - case PrintChangeBar.WithUserSpecified: - rbCustom.Checked = true; - break; - case PrintChangeBar.SelectBeforePrinting: - case PrintChangeBar.WithDefault: - default: - rbFormatDefault.Checked = true; - break; - } - } - } - private void btnAvChgBarOff_Click(object sender, EventArgs e) - { - if (!btnChgBarOff.Checked) - { - btnChgBarOff.Checked = true; - btnChgBarOn.Checked = false; - tbChangeBars.Visible = false; - } - } - - private void btnAdvDuplxOn_Click(object sender, EventArgs e) - { - if (!btnDuplxOn.Checked) - { - btnDuplxOn.Checked = true; - btnDuplxOff.Checked = false; - } - } - - private void btnAdvDuplxOff_Click(object sender, EventArgs e) - { - if (!btnDuplxOff.Checked) - { - btnDuplxOff.Checked = true; ; - btnDuplxOn.Checked = false; - } - } - - private void btnAdvWaterMarkOn_Click(object sender, EventArgs e) - { - if (!btnWaterMarkOn.Checked) - { - btnWaterMarkOn.Checked = true; - btnWaterMarkOff.Checked = false; - cbxWaterMark.Visible = true; - } - } - - private void btnAdvWaterMarkOff_Click(object sender, EventArgs e) - { - if (!btnWaterMarkOff.Checked) - { - btnWaterMarkOff.Checked = true; - btnWaterMarkOn.Checked = false; - cbxWaterMark.Visible = false; - } - } - - private void txbPDFLocation_Leave(object sender, EventArgs e) - { - if (!Directory.Exists(PDFPath)) - { - string msg = string.Format("'{0}' does not exist. \n\nCreate it?", PDFPath); - DialogResult dr= MessageBox.Show(msg, "Folder Not Found", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (dr == DialogResult.Yes) - { - try - { - Directory.CreateDirectory(PDFPath); - } - catch (Exception ex) - { - MessageBox.Show(ex.Message, "Error trying to create folder", MessageBoxButtons.OK, MessageBoxIcon.Error); - PDFPath = _DocVersionConfig.Print_PDFLocation; - } - } - else - { - PDFPath = _DocVersionConfig.Print_PDFLocation; - } - } - } - - private void DlgPrintProcedure_FormClosed(object sender, FormClosedEventArgs e) - { - _DocVersionConfig.SaveChangesToDocVersionConfig = true; - //_DocVersionConfig.ParentLookup = true; - - ProcedureConfig pc = _MyProcedure.MyConfig as ProcedureConfig; - if (SelectedSlave > 0) pc.SelectedSlave = 0; - } - - private ProcedureInfo _MyProcedure; - - public ProcedureInfo MyProcedure - { - get { return _MyProcedure; } - set { _MyProcedure = value; } - } - private int _SelectedSlave = 0; - public int SelectedSlave - { - get { return _SelectedSlave; } - set - { - _SelectedSlave = value; - lblMultiunitPdfLocation.Visible = cbxMultiunitPdfLocation.Visible = (value > -1); - cbxMultiunitPdfLocation.SelectedIndex = 1; - } - } - private string _MultiunitPdfLocation = string.Empty; - private void CreatePDFs() - { - StringBuilder sb = new StringBuilder(); - if (MySessionInfo != null) - { - foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures) - { - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(myProc.ItemID, CheckOutType.Procedure, ref message)) - { - sb.AppendLine(message); - } - } - if (sb.Length > 0) - { - if (MessageBox.Show(sb.ToString() + Environment.NewLine + Environment.NewLine + "Do you want to continue to print all procedures?", "Procedures Already Checked Out", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) - return; - } - } - CreateDebugFiles(); - // If file exists, determine if overwrite checkbox allows overwrite, if not prompt. - - Volian.Print.Library.Rtf2Pdf.PdfDebug = true; - PrintWatermark pw = (btnWaterMarkOn.Checked) ? (PrintWatermark)cbxWaterMark.SelectedValue : PrintWatermark.None; - // Determine change bar settings. First get from config & then see if override from dialog. - // Also check that format allows override. - ChangeBarDefinition cbd = DetermineChangeBarSettings(); - int n = _DocVersionInfo.Procedures.Count; - int i = 0; - pbPDFsStatus.Maximum = n; - pbPDFsStatus.Visible = true; - this.Text = string.Format("Processing {0}", _DocVersionInfo.MyFolder.Name); - foreach (ProcedureInfo myProc in _DocVersionInfo.Procedures) - { - MyProcedure = myProc; - if (myProc.Sections != null) - { - // This is master/slave & a slave has been selected for printing (SelectedSlave > 0) - if (SelectedSlave > 0) - { - MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = SelectedSlave; - SetupForProcedure(); - pbPDFsStatus.TextVisible = true; - pbPDFsStatus.Text = string.Format("Creating PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n); - pbPDFsStatus.Value = i; -// this.Text = string.Format("Create PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n); - MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave); - string myPDFPath = GetMultiunitPDFPath(); - // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. - frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, myPDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50),cbxBlankPgsForDuplex.Checked); - frmStatus.CloseWhenDone = true; - Application.DoEvents(); - frmStatus.CancelStop = true; - frmStatus.ShowDialog(); - if (frmStatus.CancelPrinting) break; - } - // This is a master/slave for printing of all slaves (SelectedSave == 0) - else if (SelectedSlave == 0) - { - for (int k = 1; k <= MyProcedure.MyDocVersion.MultiUnitCount; k++) - { - MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = k; - SetupForProcedure(); - pbPDFsStatus.TextVisible = true; - pbPDFsStatus.Text = string.Format("Creating PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n); - pbPDFsStatus.Value = i; -// this.Text = string.Format("Create PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n); - MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave); - // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. - frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked); - frmStatus.CloseWhenDone = true; - Application.DoEvents(); - frmStatus.CancelStop = true; - frmStatus.ShowDialog(); - if (frmStatus.CancelPrinting) break; - } - } - // Not master/slave - else - { - SetupForProcedure(); - pbPDFsStatus.TextVisible = true; - pbPDFsStatus.Text = string.Format("Creating PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n); - pbPDFsStatus.Value = i; -// this.Text = string.Format("Create PDF for {0} ({1} of {2})", myProc.DisplayNumber, ++i, n); - // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. - if (MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier || MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseSpecificTransitionModifier) - MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave); - else - MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID); - frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked); - frmStatus.CloseWhenDone = true; - Application.DoEvents(); - frmStatus.CancelStop = true; - frmStatus.ShowDialog(); - if (frmStatus.CancelPrinting) break; - } - } - } - pbPDFsStatus.Visible = false; - if(!Automatic) - ShowDebugFiles(); - } - - private string GetMultiunitPDFPath() - { - string newPDFPath = string.Empty; - if (_MultiunitPdfLocation == "None") - newPDFPath = PDFPath; - if (_MultiunitPdfLocation == "Unit Name") - newPDFPath = PDFPath + @"\" + MyProcedure.MyDocVersion.DocVersionConfig.Unit_Name; - if (_MultiunitPdfLocation == "Unit Number") - newPDFPath = PDFPath + @"\" + MyProcedure.MyDocVersion.DocVersionConfig.Unit_Number; - if (_MultiunitPdfLocation == "Unit Text") - newPDFPath = PDFPath + @"\" + MyProcedure.MyDocVersion.DocVersionConfig.Unit_Text; - if (_MultiunitPdfLocation == "Unit ID") - newPDFPath = PDFPath + @"\" + MyProcedure.MyDocVersion.DocVersionConfig.Unit_ID; - if (newPDFPath == "") newPDFPath = Volian.Base.Library.VlnSettings.TemporaryFolder; - if (!Directory.Exists(newPDFPath)) - Directory.CreateDirectory(newPDFPath); - return newPDFPath; - } - private void CreateDebugFiles() - { - if (cbxDebugPagination.Checked) - Volian.Base.Library.DebugPagination.Open(PDFPath + "\\DebugPagination.txt"); // RHM 20120925 Corrected spelling - if (cbxDebugText.Checked) - Volian.Base.Library.DebugText.Open(PDFPath + "\\DebugText.txt"); - } - private void ShowDebugFiles() - { - if (cbxDebugPagination.Checked) - Volian.Base.Library.DebugPagination.Show(); - if (cbxDebugText.Checked) - Volian.Base.Library.DebugText.Show(); - } - private void CreatePDF() - { - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(MyProcedure.ItemID, CheckOutType.Procedure, ref message)) - { - if (MessageBox.Show(this, message + Environment.NewLine + Environment.NewLine + "Do you want to continue to print the procedure?", "Procedure Is Checked Out", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) - return; - } - CreateDebugFiles(); - // If file exists, determine if overwrite checkbox allows overwrite, if not prompt. - - Volian.Print.Library.Rtf2Pdf.PdfDebug = true; - PrintWatermark pw = (btnWaterMarkOn.Checked) ? (PrintWatermark)cbxWaterMark.SelectedValue : PrintWatermark.None; - // Determine change bar settings. First get from config & then see if override from dialog. - // Also check that format allows override. - ChangeBarDefinition cbd = DetermineChangeBarSettings(); - if (MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave > 0 || MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier || MyProcedure.ActiveFormat.PlantFormat.FormatData.TransData.UseSpecificTransitionModifier) - MyProcedure = ProcedureInfo.GetItemAndChildrenByUnit(MyProcedure.ItemID, 0, MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave); - else - MyProcedure = ProcedureInfo.GetItemAndChildren(MyProcedure.ItemID); - // RHM 20120925 Overlay the bottom of the dialog so that cancel button is covered. - frmPDFStatusForm frmStatus = new frmPDFStatusForm(MyProcedure, RevNumAndDate, pw.ToString(), cbxDebug.Checked, cbxOrPgBrk.Checked, cbxOpenAfterCreate2.Checked, cbxOverwritePDF2.Checked, PDFPath, cbd, txbPDFName.Text, new Point(Left, Bottom - 50), cbxBlankPgsForDuplex.Checked); - frmStatus.ShowDialog(); - MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = 0; - this.Close(); - ShowDebugFiles(); - } - - // Determine if any dialog selections for change bars have overridden the data - // supplied in the DocVconfig data or format file. Settings are location and text. - private ChangeBarDefinition DetermineChangeBarSettings() - { - ChangeBarDefinition cbd = new ChangeBarDefinition(); - - // if the dialog has 'without change bar' selected, then just set without and return - if (btnChgBarOff.Checked) - { - cbd.MyChangeBarType = PrintChangeBar.Without; - return cbd; - } - // Get settings from dialog because these are used to set the initial dialog values and - // any changes from user overrides the initial settings. - ChangeBarData changeBarData = MyProcedure.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData; - if (rbFormatDefault.Checked || _DocVersionConfig == null || _DocVersionConfig.Print_ChangeBar == PrintChangeBar.WithDefault) - { - cbd.MyChangeBarType = PrintChangeBar.WithDefault; - cbd.MyChangeBarText = changeBarData.ChangeBarMessage == "ChgID" ? PrintChangeBarText.ChgID : - changeBarData.ChangeBarMessage == "DateAndChgID" ? PrintChangeBarText.DateChgID : - changeBarData.ChangeBarMessage == "None" ? PrintChangeBarText.None : - changeBarData.ChangeBarMessage == "RevNum" ? PrintChangeBarText.RevNum : PrintChangeBarText.UserDef; - } - else if (rbCustom.Checked || _DocVersionConfig.Print_ChangeBar == PrintChangeBar.WithUserSpecified) - { - cbd.MyChangeBarLoc = _DocVersionConfig.Print_ChangeBarLoc; // (PrintChangeBarLoc)ppCmbxChgBarPos.SelectedIndex; - cbd.MyChangeBarText = (PrintChangeBarText)ppCmbxChgBarTxtType.SelectedIndex; - } - else - { - cbd.MyChangeBarLoc = _DocVersionConfig.Print_ChangeBarLoc; - cbd.MyChangeBarText = _DocVersionConfig.Print_ChangeBarText; - } - - // now figure out the location. - if (cbd.MyChangeBarType != PrintChangeBar.Without) - { - // if the format has the absolutefixedchangecolumn format flag, then always use the fixedchangecolumn from the - // format, otherwise, use the default column based on the selected location, stored in the base format. - cbd.MyChangeBarColumn = (changeBarData.AbsoluteFixedChangeColumn) ? - (int)changeBarData.FixedChangeColumn : - System.Convert.ToInt32(changeBarData.DefaultCBLoc.Split(" ,".ToCharArray())[System.Convert.ToInt32(cbd.MyChangeBarLoc)]); - //cbd.MyChangeBarColumn = (int)changeBarData.FixedChangeColumn; - if (cbd.MyChangeBarText == PrintChangeBarText.UserDef) - cbd.MyChangeBarMessage = _DocVersionConfig.Print_UserCBMess1 + @"\n" + _DocVersionConfig.Print_UserCBMess2; - - } - return cbd; - } - private void btnCreatePDF_Click(object sender, EventArgs e) - { - Rtf2iTextSharp.DoingComparison = cbxDebug.Checked; - if (_AllProcedures) - { - DateTime dtStart = DateTime.Now; - _MultiunitPdfLocation = cbxMultiunitPdfLocation.SelectedItem.ToString(); - PromsPrinter.ClearTransPageNumProblems(); - CreatePDFs(); - PromsPrinter.ReportTransPageNumProblems(); - if (VlnSettings.DebugMode) - { - MessageBox.Show(string.Format("{0} Minutes to Print All Procedures" - , TimeSpan.FromTicks(DateTime.Now.Ticks - dtStart.Ticks).TotalMinutes), - "Printing Duration", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - else // Production or Demo mode - { - MessageBox.Show("Completed Successfully", "Print All Procedures", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - this.Close(); - } - else - //Database.Reset("Before Print"); - CreatePDF(); - //Database.Reset("After Print"); - } - private bool _Initializing = false; - private void tbSettings_Click(object sender, EventArgs e) - { - // Fill in the settings from the config. This tab is used - // to update the settings for PdfLocation, RevNum, RevDate and ReviewDate - _Initializing = true; - txbPdfLocationS.Text = txbPDFLocation.Text; - _Initializing = false; - } - - - private void btnPdfLocation_Click(object sender, EventArgs e) - { - DlgBrowseFolder.SelectedPath = PDFPathSetting; - DialogResult drslt = DlgBrowseFolder.ShowDialog(); - if (drslt == DialogResult.OK) - { - //cbxPDFloc.Text = DlgBrowseFolder.SelectedPath; - txbPdfLocationS.Text = DlgBrowseFolder.SelectedPath; - txbPDFLocation.Text = txbPdfLocationS.Text; - //lblCurPDFLoc.Text = cbxPDFloc.Text; - //UpdateDropDown2(); - } - } - - private void rbFormatDefault_Click(object sender, EventArgs e) - { - SetCustomControls(false); - // Make Custom controls invisible - ppGpbxUserSpecCB.Visible = false; - } - - private void SetCustomControls(bool enabled) - { - ppCmbxChgBarPos.Enabled = enabled; - ppCmbxChgBarTxtType.Enabled = enabled; - ppTxbxChangeBarUserMsgOne.Enabled = enabled; - ppTxbxChangeBarUserMsgTwo.Enabled = enabled; - } - - private void rbCustom_Click(object sender, EventArgs e) - { - SetCustomControls(true); - // Make Custom controls visible - ppGpbxUserSpecCB.Visible = true; - } - - private void rbFormatDefault_CheckedChanged(object sender, EventArgs e) - { - SetCustomControls(false); - // Make Custom controls invisible - ppGpbxUserSpecCB.Visible = false; - } - - private void ppCmbxChgBarTxtType_SelectedIndexChanged(object sender, EventArgs e) - { - if (_Initializing) return; - ppGpbxUserSpecTxt.Enabled = ppCmbxChgBarTxtType.SelectedIndex == (int)PrintChangeBarText.UserDef; - } - private void txbRevDate_Enter(object sender, EventArgs e) - { - txbDate = txbRevDate; - grpDateSelector.Text = "Select Revision Date"; - grpDateSelector.Visible = calDateSelector.Visible = true; - - } - - private void txbRevDate_Leave(object sender, EventArgs e) - { - if (_Initializing) return; - txbDate = null; - grpDateSelector.Visible = calDateSelector.Visible = false; - // save the RevDate to the procedure's config. - ProcedureConfig pc = MyProcedure.MyConfig as ProcedureConfig; - if (pc == null) return; - pc.Print_RevDate = txbRevDate.Text; - using (Item itm = Item.Get(MyProcedure.ItemID)) - { - itm.MyContent.Config = MyProcedure.MyConfig.ToString(); - itm.Save(); - } - - } - - private void txbReviewDate_Leave(object sender, EventArgs e) - { - if (_Initializing) return; - txbDate = null; - grpDateSelector.Visible = calDateSelector.Visible = false; - // save the ReviewDate to the procedure's config. - ProcedureConfig pc = MyProcedure.MyConfig as ProcedureConfig; - if (pc == null) return; - pc.Print_ReviewDate = txbReviewDate.Text; - using (Item itm = Item.Get(MyProcedure.ItemID)) - { - itm.MyContent.Config = MyProcedure.MyConfig.ToString(); - itm.Save(); - // need to reset config to !dirty? - } - - } - private void txbReviewDate_Enter(object sender, EventArgs e) - { - txbDate = txbReviewDate; - grpDateSelector.Text = "Select Review Date"; - grpDateSelector.Visible = calDateSelector.Visible = true; - } - - private TextBox txbDate = null; - private void calDateSelector_DateSelected(object sender, DateRangeEventArgs e) - { - if (txbDate != null) - txbDate.Text = e.Start.ToShortDateString(); - } - - private void txbRevNum_Leave(object sender, EventArgs e) - { - if (_Initializing) return; - // save the RevNum to the procedure's config. - ProcedureConfig pc = MyProcedure.MyConfig as ProcedureConfig; - if (pc == null) return; - pc.Print_Rev = txbRevNum.Text; - using (Item itm = Item.Get(MyProcedure.ItemID)) - { - itm.MyContent.Config = MyProcedure.MyConfig.ToString(); - itm.Save(); - } - } - //private void cbxDebug_CheckedChanged(object sender, EventArgs e) - //{ - // cbxCmpPRMSpfd.Visible = cbxDebug.Checked; - //} - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/FindReplace.Designer.cs b/PROMS/VEPROMS User Interface/FindReplace.Designer.cs deleted file mode 100644 index e4acdb5e..00000000 --- a/PROMS/VEPROMS User Interface/FindReplace.Designer.cs +++ /dev/null @@ -1,381 +0,0 @@ -namespace VEPROMS -{ - partial class FindReplace - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FindReplace)); - this.btnFind = new DevComponents.DotNetBar.ButtonX(); - this.btnReplace = new DevComponents.DotNetBar.ButtonX(); - this.btnFndRplDone = new DevComponents.DotNetBar.ButtonX(); - this.btnFindNext = new DevComponents.DotNetBar.ButtonX(); - this.cmboReplaceText = new DevComponents.DotNetBar.Controls.ComboBoxEx(); - this.labelX2 = new DevComponents.DotNetBar.LabelX(); - this.cmboFindText = new DevComponents.DotNetBar.Controls.ComboBoxEx(); - this.labelX3 = new DevComponents.DotNetBar.LabelX(); - this.groupPanel1 = new DevComponents.DotNetBar.Controls.GroupPanel(); - this.cbFndInAllProcs = new DevComponents.DotNetBar.Controls.CheckBoxX(); - this.cbFndInProc = new DevComponents.DotNetBar.Controls.CheckBoxX(); - this.cbFndInSect = new DevComponents.DotNetBar.Controls.CheckBoxX(); - this.groupPanel2 = new DevComponents.DotNetBar.Controls.GroupPanel(); - this.cbRplNoPrmpt = new DevComponents.DotNetBar.Controls.CheckBoxX(); - this.cbPrmptRpl = new DevComponents.DotNetBar.Controls.CheckBoxX(); - this.cbDontReplace = new DevComponents.DotNetBar.Controls.CheckBoxX(); - this.btnRplFndNxt = new DevComponents.DotNetBar.ButtonX(); - this.panelEx1 = new DevComponents.DotNetBar.PanelEx(); - this.groupPanel1.SuspendLayout(); - this.groupPanel2.SuspendLayout(); - this.panelEx1.SuspendLayout(); - this.SuspendLayout(); - // - // btnFind - // - this.btnFind.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnFind.Location = new System.Drawing.Point(11, 223); - this.btnFind.Name = "btnFind"; - this.btnFind.Size = new System.Drawing.Size(83, 34); - this.btnFind.TabIndex = 0; - this.btnFind.Text = "Find"; - this.btnFind.Click += new System.EventHandler(this.btnFind_Click); - // - // btnReplace - // - this.btnReplace.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnReplace.Enabled = false; - this.btnReplace.Location = new System.Drawing.Point(251, 223); - this.btnReplace.Name = "btnReplace"; - this.btnReplace.Size = new System.Drawing.Size(75, 34); - this.btnReplace.TabIndex = 1; - this.btnReplace.Text = "Replace"; - this.btnReplace.Click += new System.EventHandler(this.btnReplace_Click); - // - // btnFndRplDone - // - this.btnFndRplDone.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnFndRplDone.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnFndRplDone.Location = new System.Drawing.Point(497, 222); - this.btnFndRplDone.Name = "btnFndRplDone"; - this.btnFndRplDone.Size = new System.Drawing.Size(75, 33); - this.btnFndRplDone.TabIndex = 2; - this.btnFndRplDone.Text = "Done"; - this.btnFndRplDone.Click += new System.EventHandler(this.btnFndRplDone_Click); - // - // btnFindNext - // - this.btnFindNext.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnFindNext.Location = new System.Drawing.Point(115, 223); - this.btnFindNext.Name = "btnFindNext"; - this.btnFindNext.Size = new System.Drawing.Size(75, 33); - this.btnFindNext.TabIndex = 3; - this.btnFindNext.Text = "Find Next"; - // - // cmboReplaceText - // - this.cmboReplaceText.DisplayMember = "Text"; - this.cmboReplaceText.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.cmboReplaceText.Enabled = false; - this.cmboReplaceText.FormattingEnabled = true; - this.cmboReplaceText.Location = new System.Drawing.Point(113, 58); - this.cmboReplaceText.Name = "cmboReplaceText"; - this.cmboReplaceText.Size = new System.Drawing.Size(445, 23); - this.cmboReplaceText.TabIndex = 7; - this.cmboReplaceText.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cmboReplaceText.WatermarkText = "Enter text to replace here"; - this.cmboReplaceText.SelectedIndexChanged += new System.EventHandler(this.cmboReplaceText_SelectedIndexChanged); - // - // labelX2 - // - this.labelX2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelX2.Location = new System.Drawing.Point(11, 53); - this.labelX2.Name = "labelX2"; - this.labelX2.Size = new System.Drawing.Size(105, 28); - this.labelX2.TabIndex = 6; - this.labelX2.Text = "Replace Text:"; - // - // cmboFindText - // - this.cmboFindText.DisplayMember = "Text"; - this.cmboFindText.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.cmboFindText.FormattingEnabled = true; - this.cmboFindText.Location = new System.Drawing.Point(113, 18); - this.cmboFindText.Name = "cmboFindText"; - this.cmboFindText.Size = new System.Drawing.Size(445, 23); - this.cmboFindText.TabIndex = 9; - this.cmboFindText.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cmboFindText.WatermarkText = "Enter text to find here"; - this.cmboFindText.SelectedIndexChanged += new System.EventHandler(this.cmboFindText_SelectedIndexChanged); - // - // labelX3 - // - this.labelX3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelX3.Location = new System.Drawing.Point(33, 15); - this.labelX3.Name = "labelX3"; - this.labelX3.Size = new System.Drawing.Size(74, 28); - this.labelX3.TabIndex = 8; - this.labelX3.Text = "Find Text: "; - // - // groupPanel1 - // - this.groupPanel1.CanvasColor = System.Drawing.SystemColors.Control; - this.groupPanel1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.groupPanel1.Controls.Add(this.cbFndInAllProcs); - this.groupPanel1.Controls.Add(this.cbFndInProc); - this.groupPanel1.Controls.Add(this.cbFndInSect); - this.groupPanel1.Location = new System.Drawing.Point(53, 100); - this.groupPanel1.Name = "groupPanel1"; - this.groupPanel1.Size = new System.Drawing.Size(185, 102); - // - // - // - this.groupPanel1.Style.BackColor2 = System.Drawing.Color.LightSteelBlue; - this.groupPanel1.Style.BackColorGradientAngle = 90; - this.groupPanel1.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.groupPanel1.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.groupPanel1.Style.BorderBottomWidth = 1; - this.groupPanel1.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.groupPanel1.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.groupPanel1.Style.BorderLeftWidth = 1; - this.groupPanel1.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.groupPanel1.Style.BorderRightWidth = 1; - this.groupPanel1.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.groupPanel1.Style.BorderTopWidth = 1; - this.groupPanel1.Style.CornerDiameter = 4; - this.groupPanel1.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.groupPanel1.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; - this.groupPanel1.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.groupPanel1.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; - this.groupPanel1.TabIndex = 10; - this.groupPanel1.Text = "Find Scope"; - // - // cbFndInAllProcs - // - this.cbFndInAllProcs.BackColor = System.Drawing.Color.Transparent; - this.cbFndInAllProcs.CheckBoxStyle = DevComponents.DotNetBar.eCheckBoxStyle.RadioButton; - this.cbFndInAllProcs.Location = new System.Drawing.Point(7, 49); - this.cbFndInAllProcs.Name = "cbFndInAllProcs"; - this.cbFndInAllProcs.Size = new System.Drawing.Size(169, 23); - this.cbFndInAllProcs.TabIndex = 2; - this.cbFndInAllProcs.Text = "All Procedures in This Set"; - // - // cbFndInProc - // - this.cbFndInProc.BackColor = System.Drawing.Color.Transparent; - this.cbFndInProc.CheckBoxStyle = DevComponents.DotNetBar.eCheckBoxStyle.RadioButton; - this.cbFndInProc.Location = new System.Drawing.Point(7, 26); - this.cbFndInProc.Name = "cbFndInProc"; - this.cbFndInProc.Size = new System.Drawing.Size(144, 23); - this.cbFndInProc.TabIndex = 1; - this.cbFndInProc.Text = "Only This Procedure"; - // - // cbFndInSect - // - this.cbFndInSect.BackColor = System.Drawing.Color.Transparent; - this.cbFndInSect.CheckBoxStyle = DevComponents.DotNetBar.eCheckBoxStyle.RadioButton; - this.cbFndInSect.Checked = true; - this.cbFndInSect.Location = new System.Drawing.Point(7, 3); - this.cbFndInSect.Name = "cbFndInSect"; - this.cbFndInSect.Size = new System.Drawing.Size(127, 23); - this.cbFndInSect.TabIndex = 0; - this.cbFndInSect.Text = "Only This Section"; - // - // groupPanel2 - // - this.groupPanel2.CanvasColor = System.Drawing.SystemColors.Control; - this.groupPanel2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.groupPanel2.Controls.Add(this.cbRplNoPrmpt); - this.groupPanel2.Controls.Add(this.cbPrmptRpl); - this.groupPanel2.Controls.Add(this.cbDontReplace); - this.groupPanel2.Location = new System.Drawing.Point(293, 100); - this.groupPanel2.Name = "groupPanel2"; - this.groupPanel2.Size = new System.Drawing.Size(200, 102); - // - // - // - this.groupPanel2.Style.BackColor2 = System.Drawing.Color.LightSteelBlue; - this.groupPanel2.Style.BackColorGradientAngle = 90; - this.groupPanel2.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.groupPanel2.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.groupPanel2.Style.BorderBottomWidth = 1; - this.groupPanel2.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.groupPanel2.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.groupPanel2.Style.BorderLeftWidth = 1; - this.groupPanel2.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.groupPanel2.Style.BorderRightWidth = 1; - this.groupPanel2.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.groupPanel2.Style.BorderTopWidth = 1; - this.groupPanel2.Style.CornerDiameter = 4; - this.groupPanel2.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.groupPanel2.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; - this.groupPanel2.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.groupPanel2.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; - this.groupPanel2.TabIndex = 11; - this.groupPanel2.Text = "Replace Options"; - // - // cbRplNoPrmpt - // - this.cbRplNoPrmpt.BackColor = System.Drawing.Color.Transparent; - this.cbRplNoPrmpt.CheckBoxStyle = DevComponents.DotNetBar.eCheckBoxStyle.RadioButton; - this.cbRplNoPrmpt.Location = new System.Drawing.Point(13, 49); - this.cbRplNoPrmpt.Name = "cbRplNoPrmpt"; - this.cbRplNoPrmpt.Size = new System.Drawing.Size(178, 23); - this.cbRplNoPrmpt.TabIndex = 2; - this.cbRplNoPrmpt.Text = "Replace Without Prompting"; - // - // cbPrmptRpl - // - this.cbPrmptRpl.BackColor = System.Drawing.Color.Transparent; - this.cbPrmptRpl.CheckBoxStyle = DevComponents.DotNetBar.eCheckBoxStyle.RadioButton; - this.cbPrmptRpl.Location = new System.Drawing.Point(13, 26); - this.cbPrmptRpl.Name = "cbPrmptRpl"; - this.cbPrmptRpl.Size = new System.Drawing.Size(169, 23); - this.cbPrmptRpl.TabIndex = 1; - this.cbPrmptRpl.Text = "Prompt For Each Replace"; - // - // cbDontReplace - // - this.cbDontReplace.BackColor = System.Drawing.Color.Transparent; - this.cbDontReplace.CheckBoxStyle = DevComponents.DotNetBar.eCheckBoxStyle.RadioButton; - this.cbDontReplace.Checked = true; - this.cbDontReplace.Location = new System.Drawing.Point(13, 3); - this.cbDontReplace.Name = "cbDontReplace"; - this.cbDontReplace.Size = new System.Drawing.Size(126, 23); - this.cbDontReplace.TabIndex = 0; - this.cbDontReplace.Text = "Don\'t Do Replace"; - this.cbDontReplace.CheckedChanged += new System.EventHandler(this.cbDontReplace_CheckedChanged); - // - // btnRplFndNxt - // - this.btnRplFndNxt.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnRplFndNxt.Enabled = false; - this.btnRplFndNxt.Location = new System.Drawing.Point(344, 222); - this.btnRplFndNxt.Name = "btnRplFndNxt"; - this.btnRplFndNxt.Size = new System.Drawing.Size(107, 34); - this.btnRplFndNxt.TabIndex = 12; - this.btnRplFndNxt.Text = "Replace And\r\nFind Next"; - // - // panelEx1 - // - this.panelEx1.CanvasColor = System.Drawing.SystemColors.Control; - this.panelEx1.ColorScheme.BarBackground = System.Drawing.Color.FromArgb(((int)(((byte)(205)))), ((int)(((byte)(208)))), ((int)(((byte)(213))))); - this.panelEx1.ColorScheme.BarBackground2 = System.Drawing.Color.FromArgb(((int)(((byte)(139)))), ((int)(((byte)(146)))), ((int)(((byte)(155))))); - this.panelEx1.ColorScheme.BarCaptionBackground = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(128)))), ((int)(((byte)(142))))); - this.panelEx1.ColorScheme.BarCaptionBackground2 = System.Drawing.Color.FromArgb(((int)(((byte)(76)))), ((int)(((byte)(83)))), ((int)(((byte)(92))))); - this.panelEx1.ColorScheme.BarCaptionInactiveBackground = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(241)))), ((int)(((byte)(242))))); - this.panelEx1.ColorScheme.BarCaptionInactiveBackground2 = System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(194)))), ((int)(((byte)(201))))); - this.panelEx1.ColorScheme.BarCaptionInactiveText = System.Drawing.Color.FromArgb(((int)(((byte)(55)))), ((int)(((byte)(60)))), ((int)(((byte)(67))))); - this.panelEx1.ColorScheme.BarDockedBorder = System.Drawing.Color.FromArgb(((int)(((byte)(76)))), ((int)(((byte)(83)))), ((int)(((byte)(92))))); - this.panelEx1.ColorScheme.BarFloatingBorder = System.Drawing.Color.FromArgb(((int)(((byte)(55)))), ((int)(((byte)(60)))), ((int)(((byte)(67))))); - this.panelEx1.ColorScheme.BarPopupBorder = System.Drawing.Color.FromArgb(((int)(((byte)(145)))), ((int)(((byte)(153)))), ((int)(((byte)(164))))); - this.panelEx1.ColorScheme.BarStripeColor = System.Drawing.Color.FromArgb(((int)(((byte)(55)))), ((int)(((byte)(60)))), ((int)(((byte)(67))))); - this.panelEx1.ColorScheme.CustomizeBackground = System.Drawing.Color.FromArgb(((int)(((byte)(178)))), ((int)(((byte)(183)))), ((int)(((byte)(191))))); - this.panelEx1.ColorScheme.CustomizeBackground2 = System.Drawing.Color.FromArgb(((int)(((byte)(81)))), ((int)(((byte)(88)))), ((int)(((byte)(98))))); - this.panelEx1.ColorScheme.DockSiteBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(83)))), ((int)(((byte)(83)))), ((int)(((byte)(83))))); - this.panelEx1.ColorScheme.ExplorerBarBackground = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(241)))), ((int)(((byte)(242))))); - this.panelEx1.ColorScheme.ExplorerBarBackground2 = System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(194)))), ((int)(((byte)(201))))); - this.panelEx1.ColorScheme.ItemCheckedBackground = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(211)))), ((int)(((byte)(106))))); - this.panelEx1.ColorScheme.ItemDesignTimeBorder = System.Drawing.Color.Black; - this.panelEx1.ColorScheme.ItemExpandedBackground = System.Drawing.Color.FromArgb(((int)(((byte)(145)))), ((int)(((byte)(153)))), ((int)(((byte)(164))))); - this.panelEx1.ColorScheme.ItemExpandedBackground2 = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(110)))), ((int)(((byte)(122))))); - this.panelEx1.ColorScheme.ItemExpandedBorder = System.Drawing.Color.FromArgb(((int)(((byte)(145)))), ((int)(((byte)(153)))), ((int)(((byte)(164))))); - this.panelEx1.ColorScheme.ItemSeparator = System.Drawing.Color.FromArgb(((int)(((byte)(225)))), ((int)(((byte)(145)))), ((int)(((byte)(153)))), ((int)(((byte)(164))))); - this.panelEx1.ColorScheme.ItemSeparatorShade = System.Drawing.Color.FromArgb(((int)(((byte)(180)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); - this.panelEx1.ColorScheme.MenuBarBackground = System.Drawing.Color.FromArgb(((int)(((byte)(83)))), ((int)(((byte)(83)))), ((int)(((byte)(83))))); - this.panelEx1.ColorScheme.MenuBorder = System.Drawing.Color.FromArgb(((int)(((byte)(145)))), ((int)(((byte)(153)))), ((int)(((byte)(164))))); - this.panelEx1.ColorScheme.MenuSide = System.Drawing.Color.FromArgb(((int)(((byte)(239)))), ((int)(((byte)(239)))), ((int)(((byte)(239))))); - this.panelEx1.ColorScheme.MenuUnusedSide = System.Drawing.Color.FromArgb(((int)(((byte)(233)))), ((int)(((byte)(233)))), ((int)(((byte)(233))))); - this.panelEx1.ColorScheme.PanelBackground = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(241)))), ((int)(((byte)(242))))); - this.panelEx1.ColorScheme.PanelBackground2 = System.Drawing.Color.FromArgb(((int)(((byte)(189)))), ((int)(((byte)(194)))), ((int)(((byte)(201))))); - this.panelEx1.ColorScheme.PanelBorder = System.Drawing.Color.FromArgb(((int)(((byte)(167)))), ((int)(((byte)(173)))), ((int)(((byte)(182))))); - this.panelEx1.ColorScheme.PanelText = System.Drawing.Color.Black; - this.panelEx1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.panelEx1.Controls.Add(this.labelX3); - this.panelEx1.Controls.Add(this.labelX2); - this.panelEx1.Controls.Add(this.groupPanel2); - this.panelEx1.Controls.Add(this.cmboReplaceText); - this.panelEx1.Controls.Add(this.groupPanel1); - this.panelEx1.Controls.Add(this.cmboFindText); - this.panelEx1.Location = new System.Drawing.Point(2, 2); - this.panelEx1.Name = "panelEx1"; - this.panelEx1.Size = new System.Drawing.Size(578, 215); - this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center; - this.panelEx1.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.panelEx1.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.panelEx1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.panelEx1.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.panelEx1.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.panelEx1.Style.GradientAngle = 90; - this.panelEx1.TabIndex = 13; - // - // FindReplace - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Gray; - this.CancelButton = this.btnFndRplDone; - this.ClientSize = new System.Drawing.Size(584, 260); - this.Controls.Add(this.panelEx1); - this.Controls.Add(this.btnRplFndNxt); - this.Controls.Add(this.btnFindNext); - this.Controls.Add(this.btnFndRplDone); - this.Controls.Add(this.btnReplace); - this.Controls.Add(this.btnFind); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "FindReplace"; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Find and Replace"; - this.TopMost = true; - this.groupPanel1.ResumeLayout(false); - this.groupPanel2.ResumeLayout(false); - this.panelEx1.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private DevComponents.DotNetBar.ButtonX btnFind; - private DevComponents.DotNetBar.ButtonX btnReplace; - private DevComponents.DotNetBar.ButtonX btnFndRplDone; - private DevComponents.DotNetBar.ButtonX btnFindNext; - private DevComponents.DotNetBar.Controls.ComboBoxEx cmboReplaceText; - private DevComponents.DotNetBar.LabelX labelX2; - private DevComponents.DotNetBar.Controls.ComboBoxEx cmboFindText; - private DevComponents.DotNetBar.LabelX labelX3; - private DevComponents.DotNetBar.Controls.GroupPanel groupPanel1; - private DevComponents.DotNetBar.Controls.CheckBoxX cbFndInSect; - private DevComponents.DotNetBar.Controls.CheckBoxX cbFndInAllProcs; - private DevComponents.DotNetBar.Controls.CheckBoxX cbFndInProc; - private DevComponents.DotNetBar.Controls.GroupPanel groupPanel2; - private DevComponents.DotNetBar.Controls.CheckBoxX cbRplNoPrmpt; - private DevComponents.DotNetBar.Controls.CheckBoxX cbPrmptRpl; - private DevComponents.DotNetBar.Controls.CheckBoxX cbDontReplace; - private DevComponents.DotNetBar.ButtonX btnRplFndNxt; - private DevComponents.DotNetBar.PanelEx panelEx1; - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/FindReplace.cs b/PROMS/VEPROMS User Interface/FindReplace.cs deleted file mode 100644 index 9b63e004..00000000 --- a/PROMS/VEPROMS User Interface/FindReplace.cs +++ /dev/null @@ -1,61 +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 VEPROMS -{ - public partial class FindReplace : DevComponents.DotNetBar.Office2007Form - { - bool _selectedReplStr = false; - bool _selectedFindStr = false; - - public FindReplace() - { - InitializeComponent(); - } - - private void cbDontReplace_CheckedChanged(object sender, EventArgs e) - { - cmboReplaceText.Enabled = !cbDontReplace.Checked; - btnReplace.Enabled = !cbDontReplace.Checked; - btnRplFndNxt.Enabled = !cbDontReplace.Checked; - } - - private void cmboReplaceText_SelectedIndexChanged(object sender, EventArgs e) - { - _selectedReplStr = true; - } - - private void btnReplace_Click(object sender, EventArgs e) - { - if (!_selectedReplStr) - cmboReplaceText.Items.Add(cmboReplaceText.Text); - else - _selectedReplStr = false; - } - - private void cmboFindText_SelectedIndexChanged(object sender, EventArgs e) - { - _selectedFindStr = true; - } - - private void btnFind_Click(object sender, EventArgs e) - { - if (!_selectedFindStr) - cmboFindText.Items.Add(cmboFindText.Text); - else - _selectedFindStr = false; - } - - private void btnFndRplDone_Click(object sender, EventArgs e) - { - this.Close(); - } - - - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/FindReplace.resx b/PROMS/VEPROMS User Interface/FindReplace.resx deleted file mode 100644 index 893dcc78..00000000 --- a/PROMS/VEPROMS User Interface/FindReplace.resx +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - AAABAAIAICAQAAAAAADoAgAAJgAAABAQEAAAAAAAKAEAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAAAIAC - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAICAgADAwMAAAAD/AAD/ - AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAA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AAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP// - AACH4QAAh+EAAIfhAACBgQAAgAEAAIABAACAAQAAgAEAAMGDAADhhwAA4YcAAOGHAAD//wAA//8AAA== - - - \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/UCFDetails.xsl b/PROMS/VEPROMS User Interface/UCFDetails.xsl deleted file mode 100644 index 8c2c3785..00000000 --- a/PROMS/VEPROMS User Interface/UCFDetails.xsl +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - -

User Control of Format Details

-

-

- - - - - - - - - -
- - - - - - - - - - - - - - -
FlagValue
-

- - - - - - - - - - - - - - - -
Check Off HeadingActive
- - - -
-

- - - - - - - - - - - - - - -
Check Off TypeActive
-

- - - - - - - - - - - -
Check Off X Offset Adjust (Inches)
- -
-

- - - - - - - - - - - - - - - - - - -
Replace WordReplace WithStateFlag
- - - Add - - - Modify - - - Delete - -
-

- - - - - - - - - - - - - - - - -
Step TypeFont
-

- - - - - - - - - - - - - - - - -
Document StylePage LengthLeft Margin
-
- - \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/UCFSummary.xsl b/PROMS/VEPROMS User Interface/UCFSummary.xsl deleted file mode 100644 index c390b319..00000000 --- a/PROMS/VEPROMS User Interface/UCFSummary.xsl +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - , - - - - - - \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/VEPROMS_UI.csproj.bak b/PROMS/VEPROMS User Interface/VEPROMS_UI.csproj.bak deleted file mode 100644 index 1f5a8b2c..00000000 --- a/PROMS/VEPROMS User Interface/VEPROMS_UI.csproj.bak +++ /dev/null @@ -1,617 +0,0 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {8D1C47B4-F302-4C5A-87CC-24FDC5529872} - WinExe - Properties - VEPROMS - VEPROMS - veproms.ico - SAK - SAK - SAK - SAK - v4.6.1 - - - - - 2.0 - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - x86 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - true - bin\Demo\ - DEBUG;TRACE - full - x86 - prompt - false - - - true - bin\Debug\ - DEBUG;TRACE - full - x86 - prompt - false - - - bin\debug\ - TRACE - true - pdbonly - x86 - prompt - false - - - true - bin\Demo\ - TRACE;DEMO - full - x86 - prompt - false - - - - ..\..\Proms3rdPartyLibraries\DSOFramer\AxInterop.DSOFramer.dll - - - - - False - ..\csla20cs-2.1.4-070223\csla20cs\csla20cs\Csla\bin\Debug\Csla.dll - - - True - - - ..\..\Proms3rdPartyLibraries\DSOFramer\Interop.DSOFramer.dll - True - - - False - ..\..\Proms3rdPartyLibraries\Ionic\Ionic.Zip.dll - - - False - ..\..\Proms3rdPartyLibraries\RtfConverter\bin\Debug\Itenso.Rtf.Interpreter.dll - - - False - ..\..\Proms3rdPartyLibraries\RtfConverter\bin\Debug\Itenso.Rtf.Parser.dll - - - ..\..\Log4Net\log4net-1.2.10\bin\net\2.0\debug\log4net.dll - - - - - True - - - - - - - - - - - False - ..\VEPROMS.CSLA.Library\bin\Debug\VEPROMS.CSLA.Library.dll - - - - - Form - - - AboutVEPROMS.cs - - - - Form - - - dlgApproveProcedure.cs - - - Form - - - dlgCheckedOutProcedure.cs - - - Form - - - DlgCloseTabsOrExit.cs - - - Form - - - dlgExportImport.cs - - - Form - - - dlgImpHowToHandleROs.cs - - - Form - - - dlgManageSecurity.cs - - - Form - - - dlgPhoneList.cs - - - Form - - - dlgPickROFolder.cs - - - Form - - - DlgPrintProcedure.cs - - - Form - - - dlgSetChangeBarStartDate.cs - - - Form - - - dlgTransitionReport.cs - - - Form - - - dlgUCFDetail.cs - - - Form - - - frmBatchRefresh.cs - - - Form - - - frmBatchRefreshCheckedOut.cs - - - Form - - - frmManageUser.cs - - - Form - - - frmPDFStatusForm.cs - - - Form - - - frmPSI.cs - - - Form - - - frmRODbProperties.cs - - - Form - - - frmSI.cs - - - Form - - - frmUCF.cs - - - Form - - - frmVEPROMS.cs - - - Form - - - frmFolderProperties.cs - - - Form - - - frmProcedureProperties.cs - - - Form - - - frmPropGrid.cs - - - Form - - - frmSectionProperties.cs - - - Form - - - frmSysOptions.cs - - - Form - - - frmVersionsProperties.cs - - - - Designer - AboutVEPROMS.cs - - - DlgCloseTabsOrExit.cs - - - dlgImpHowToHandleROs.cs - - - DlgPrintProcedure.cs - Designer - - - dlgSetChangeBarStartDate.cs - - - dlgUCFDetail.cs - - - frmPDFStatusForm.cs - Designer - - - Designer - frmPSI.cs - - - Designer - frmRODbProperties.cs - - - frmSI.cs - - - frmUCF.cs - - - Designer - frmVEPROMS.cs - - - frmFolderProperties.cs - Designer - - - frmProcedureProperties.cs - Designer - - - Designer - frmPropGrid.cs - - - frmSectionProperties.cs - Designer - - - Designer - frmSysOptions.cs - - - frmVersionsProperties.cs - Designer - - - - ResXFileCodeGenerator - Designer - Resources.Designer.cs - - - ShortcutLists.cs - Designer - - - VlnWeb.cs - Designer - - - PreserveNewest - Designer - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - Form - - - ShortcutLists.cs - - - Form - - - VlnWeb.cs - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - Always - - - Always - - - Always - - - Always - - - Always - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - dlgApproveProcedure.cs - Designer - PreserveNewest - - - dlgCheckedOutProcedure.cs - Designer - - - dlgExportImport.cs - Designer - - - dlgManageSecurity.cs - Designer - - - Designer - dlgPhoneList.cs - - - dlgPickROFolder.cs - Designer - - - dlgTransitionReport.cs - Designer - - - frmBatchRefresh.cs - Designer - - - frmBatchRefreshCheckedOut.cs - Designer - - - frmManageUser.cs - Designer - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - - PreserveNewest - - - - - {00020430-0000-0000-C000-000000000046} - 2 - 0 - 0 - primary - False - - - - - {b22ce5ad-288c-44cd-8a22-b3bcf77b7161} - FlexableMessageBox - - - {70F23722-19A3-4AC1-A900-55831C945786} - LBWordLibrary - - - {AEEE9FD1-6892-45E2-A67E-418C06D46FF9} - Volian.Base.Library - - - {8556527C-6615-487F-8AF7-22EBC3EF0268} - Volian.Controls.Library - - - {94830C07-6A3A-450E-9674-C9B4293A7726} - Volian.Print.Library - - - {62314B9C-DA84-4037-8B68-AA18C1F641F5} - Volian.Utils.Library - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - - - - cmd /c "$(ProjectDir)FixRev.bat" - - \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/VEPROMS_UI.sln b/PROMS/VEPROMS User Interface/VEPROMS_UI.sln deleted file mode 100644 index 92ea81ae..00000000 --- a/PROMS/VEPROMS User Interface/VEPROMS_UI.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VEPROMS_UI", "VEPROMS_UI.csproj", "{8D1C47B4-F302-4C5A-87CC-24FDC5529872}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x86 = Debug|x86 - Demo|Any CPU = Demo|Any CPU - Demo|x86 = Demo|x86 - Release|Any CPU = Release|Any CPU - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8D1C47B4-F302-4C5A-87CC-24FDC5529872}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8D1C47B4-F302-4C5A-87CC-24FDC5529872}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8D1C47B4-F302-4C5A-87CC-24FDC5529872}.Debug|x86.ActiveCfg = Debug|x86 - {8D1C47B4-F302-4C5A-87CC-24FDC5529872}.Debug|x86.Build.0 = Debug|x86 - {8D1C47B4-F302-4C5A-87CC-24FDC5529872}.Demo|Any CPU.ActiveCfg = Demo|Any CPU - {8D1C47B4-F302-4C5A-87CC-24FDC5529872}.Demo|Any CPU.Build.0 = Demo|Any CPU - {8D1C47B4-F302-4C5A-87CC-24FDC5529872}.Demo|x86.ActiveCfg = Demo|x86 - {8D1C47B4-F302-4C5A-87CC-24FDC5529872}.Demo|x86.Build.0 = Demo|x86 - {8D1C47B4-F302-4C5A-87CC-24FDC5529872}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8D1C47B4-F302-4C5A-87CC-24FDC5529872}.Release|Any CPU.Build.0 = Release|Any CPU - {8D1C47B4-F302-4C5A-87CC-24FDC5529872}.Release|x86.ActiveCfg = Release|x86 - {8D1C47B4-F302-4C5A-87CC-24FDC5529872}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection diff --git a/PROMS/VEPROMS User Interface/dlgChgId.Designer.cs b/PROMS/VEPROMS User Interface/dlgChgId.Designer.cs deleted file mode 100644 index a088fda1..00000000 --- a/PROMS/VEPROMS User Interface/dlgChgId.Designer.cs +++ /dev/null @@ -1,113 +0,0 @@ -namespace VEPROMS -{ - partial class dlgChgId - { - ///

- /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.label1 = new System.Windows.Forms.Label(); - this.tbChgId = new System.Windows.Forms.TextBox(); - this.btnOk = new System.Windows.Forms.Button(); - this.btnCancel = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(17, 12); - this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(160, 13); - this.label1.TabIndex = 0; - this.label1.Text = "Please enter your change bar ID"; - // - // tbChgId - // - this.tbChgId.Location = new System.Drawing.Point(41, 41); - this.tbChgId.Margin = new System.Windows.Forms.Padding(2); - this.tbChgId.Name = "tbChgId"; - this.tbChgId.Size = new System.Drawing.Size(97, 20); - this.tbChgId.TabIndex = 1; - // - // btnOk - // - this.btnOk.DialogResult = System.Windows.Forms.DialogResult.OK; - this.btnOk.Location = new System.Drawing.Point(25, 74); - this.btnOk.Margin = new System.Windows.Forms.Padding(2); - this.btnOk.Name = "btnOk"; - this.btnOk.Size = new System.Drawing.Size(46, 24); - this.btnOk.TabIndex = 2; - this.btnOk.Text = "OK"; - this.btnOk.UseVisualStyleBackColor = true; - this.btnOk.Click += new System.EventHandler(this.btnOk_Click); - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(103, 74); - this.btnCancel.Margin = new System.Windows.Forms.Padding(2); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(49, 24); - this.btnCancel.TabIndex = 3; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // dlgChgId - // - this.AcceptButton = this.btnOk; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(186, 113); - this.ControlBox = false; - this.Controls.Add(this.btnCancel); - this.Controls.Add(this.btnOk); - this.Controls.Add(this.tbChgId); - this.Controls.Add(this.label1); - this.Margin = new System.Windows.Forms.Padding(2); - this.MaximizeBox = false; - this.MaximumSize = new System.Drawing.Size(202, 152); - this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(202, 152); - this.Name = "dlgChgId"; - this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "PROMS Change Bar ID"; - this.TopMost = true; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox tbChgId; - private System.Windows.Forms.Button btnOk; - private System.Windows.Forms.Button btnCancel; - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/dlgChgId.cs b/PROMS/VEPROMS User Interface/dlgChgId.cs deleted file mode 100644 index 7367a2cd..00000000 --- a/PROMS/VEPROMS User Interface/dlgChgId.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using Volian.Controls.Library; - -namespace VEPROMS -{ - public partial class dlgChgId : Form - { - DisplayTabControl TabControl; - public dlgChgId(DisplayTabControl tc) - { - InitializeComponent(); - TabControl = tc; - tbChgId.Focus(); - } - - private void btnOk_Click(object sender, EventArgs e) - { - TabControl.ChgId = tbChgId.Text; - } - - private void btnCancel_Click(object sender, EventArgs e) - { - TabControl.ChgId = null; - } - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/dlgChgId.resx b/PROMS/VEPROMS User Interface/dlgChgId.resx deleted file mode 100644 index 19dc0dd8..00000000 --- a/PROMS/VEPROMS User Interface/dlgChgId.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/dlgExportImport.cs.bak b/PROMS/VEPROMS User Interface/dlgExportImport.cs.bak deleted file mode 100644 index 5e882fc0..00000000 --- a/PROMS/VEPROMS User Interface/dlgExportImport.cs.bak +++ /dev/null @@ -1,3988 +0,0 @@ -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.Base.Library; -using System.Xml; -using System.IO; -using Ionic.Zip; -using System.Text.RegularExpressions; - -namespace VEPROMS -{ - public partial class dlgExportImport : Form -{ - private bool _ConvertROsToTextDuringImport = false; - private bool _ConvertROsAndTransitionsToText = false; // set to true when Approval creates an Export file - private ItemInfo _ExternalTransitionItem = null; - public ItemInfo ExternalTransitionItem - { - get { return _ExternalTransitionItem; } - set { _ExternalTransitionItem = value; } - } - private Dictionary floatFoldout; - private Dictionary oldFormat; - private Dictionary newFormat; - private int oldRODbID; - private int newRODbID; - private FolderInfo _MyNewFolder; - public FolderInfo MyNewFolder - { - get { return _MyNewFolder; } - } - private ProcedureInfo _MyNewProcedure; - public ProcedureInfo MyNewProcedure - { - get { return _MyNewProcedure; } - set { _MyNewProcedure = value; } - } - private string PEIPath; - private string _MyMode; - private FolderInfo MyFolder = null; - private DocVersionInfo MyDocVersion = null; - private ProcedureInfo MyProcedure = null; - private XmlAttribute AddAttribute(XmlDocument xd, string name, string value) - { - XmlAttribute xa = xd.CreateAttribute(name); - xa.InnerText = value; - return xa; - } - public dlgExportImport(string mode, FolderInfo folderInfo) - { - _MyMode = mode; - MyFolder = folderInfo; - InitializeComponent(); - this.Text = mode + " Dialog for " + folderInfo.Name; - } - public dlgExportImport(string mode, DocVersionInfo docVersionInfo) - { - _MyMode = mode; - MyDocVersion = docVersionInfo; - InitializeComponent(); - this.Text = mode + " Dialog for " + docVersionInfo.Name + " of " + docVersionInfo.MyFolder.Name; - } - public dlgExportImport(string mode, ProcedureInfo procedureInfo) - { - _MyMode = mode; - MyProcedure = procedureInfo; - InitializeComponent(); - this.Text = mode + " Dialog for " + procedureInfo.DisplayNumber; - } - private void dlgExportImport_Load(object sender, EventArgs e) - { - PEIPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS\PEI_" + Database.VEPROMS_SqlConnection.Database; - if (!Directory.Exists(PEIPath)) - Directory.CreateDirectory(PEIPath); - if (_MyMode == "Import") - { - //If you try to import a procedure into an empty PROMS folder, the code was deleting the File System Folder including the import file. This happened during D.C. Cook training (12/3/2015). - //if (MyFolder != null && MyFolder.ChildFolderCount == 0 ) - //{ - // Directory.Delete(PEIPath, true); - // Directory.CreateDirectory(PEIPath); - //} - } - pnlExport.Dock = DockStyle.Fill; - pnlImport.Dock = DockStyle.Fill; - if (_MyMode.ToLower() == "export") - { - sfd.InitialDirectory = PEIPath; - pnlExport.BringToFront(); - } - else - { - ofd.InitialDirectory = PEIPath; - pnlImport.BringToFront(); - } - this.Height = this.Height / 2; - } - private void btnExport_Click(object sender, EventArgs e) - { - if (MyFolder != null) - { - //Database.SelectedDatabase - //sfd.FileName = string.Format("{0}.expx", MyFolder.Name); - sfd.FileName = string.Format("{0}-{1}.expx",Database.ActiveDatabase, MyFolder.Name); - if (sfd.ShowDialog(this) == DialogResult.OK) - { - if (sfd.FileName != string.Empty) - { - txtExport.Text = sfd.FileName; - if (File.Exists(txtExport.Text)) - File.Delete(txtExport.Text); - MyExpxZipFile = new ZipFile(txtExport.Text, Encoding.UTF8); - MyExpxZipFile.Save(); - } - } - } - else if (MyProcedure != null) - { - txtExport.Text = string.Format(@"{0}\{1}.pxml", PEIPath, MyProcedure.DisplayNumber.Replace("/", "_").Replace("\\","_")); - } - } - private void txtExport_TextChanged(object sender, EventArgs e) - { - btnDoExport.Enabled = txtExport.TextLength > 0; - if (btnDoExport.Enabled) - lblExportStatus.Text = "Ready To Perform Export"; - else - lblExportStatus.Text = "Awaiting Export File Name:"; - } - private XmlWriter MyWriter = null; - private ZipFile MyExpxZipFile = null; - private ZipFile MyImpxZipFile = null; - private DateTime MyStart; - private void btnDoExport_Click(object sender, EventArgs e) - { - btnExport.Enabled = false; - if (MyFolder != null) - { - this.Cursor = Cursors.WaitCursor; - MyStart = DateTime.Now; - btnDoExport.Enabled = false; - lblExportStatus.Text = "Performing Export"; - SaveExportData(); - //SaveExportDataWriter(); - - TimeSpan elapsed = DateTime.Now.Subtract(MyStart); - lblExportStatus.Text = "Export Completed in " + elapsed.ToString(); - this.Cursor = Cursors.Default; - } - else if (MyProcedure != null) - { - this.Cursor = Cursors.WaitCursor; - MyStart = DateTime.Now; - btnDoExport.Enabled = false; - lblExportStatus.Text = "Performing Export"; - pbExportProcedure.Maximum = 1; - XmlDocument xd = new XmlDocument(); - ExportItem(xd, MyProcedure, "procedure"); - xd.Save(txtExport.Text); - TimeSpan elapsed = DateTime.Now.Subtract(MyStart); - lblExportStatus.Text = "Export Completed in " + elapsed.ToString(); - this.Cursor = Cursors.Default; - } - btnCloseExport.Enabled = true; - } - private void SaveExportData() - { - XmlDocument xd = new XmlDocument(); - ExportFolder(xd, MyFolder, "folder"); - } - - // appears to not be used -jsj 4-29-2016 - //private void SaveExportDataWriter() - //{ - // XmlWriterSettings ws = new XmlWriterSettings(); - // ws.Indent = true; - // ws.NewLineHandling = NewLineHandling.Entitize; - // ws.CheckCharacters = false; - // MyWriter = XmlWriter.Create(txtExport.Text, ws); - // ExportFolder(MyFolder, "folder"); - // MyWriter.Close(); - //} - - private void btnDoImport_Click(object sender, EventArgs e) - { - bool isImported = false; - bool canceledPressed = false; - btnImport.Enabled = false; - this.Cursor = Cursors.WaitCursor; - MyStart = DateTime.Now; - btnDoImport.Enabled = false; - lblImportStatus.Text = "Performing Import"; - //LoadImportDataReader(); - if (MyFolder != null) // import a folder - a .expx file - { - TurnChangeManagerOff.Execute(); - LoadImportDataDocument(); - MyDocVersion = null; - isImported = true; - TurnChangeManagerOn.Execute(); - } - if (MyDocVersion != null) // import a procedure - a .pxml file - { - // compare the ROPath of MyDocVerion - // if no path set, display Pick RO Folder dialog - // if MyDocVersion ROPath is different than the import file ROPath, then ask user: - // - use MyDocVersion ROPath (warn resulting RO values may be be correct) - // * set oldRODbID to id in import file - // * set newRODbid to MyDocVersion rodbid - // - or convert ROs to text - TurnChangeManagerOff.Execute(); - XmlDocument xd = new XmlDocument(); - xd.Load(txtImport.Text); - pbImportProcedure.Maximum = 1; - string rofolderpath = xd.DocumentElement.Attributes.GetNamedItem("rofolderpath").InnerText; - int rodbid = int.Parse(xd.DocumentElement.Attributes.GetNamedItem("rodbid").InnerText); - int rofstid = int.Parse(xd.DocumentElement.Attributes.GetNamedItem("rofstid").InnerText); - if (MyDocVersion.DocVersionAssociationCount > 0) - { - // use current ROPath - MyRODb = RODb.GetJustRoDb(MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.RODbID); - // if the current RO Path and the import file RO Path are not the same - // then ask if we should import using the current workingdraft RO Path, convert the ROs to text, or cancel the import - if (MyRODb.FolderPath != rofolderpath) - { - dlgImpHowToHandleROs dlg = new dlgImpHowToHandleROs(); - dlg.ImportedROFolder = rofolderpath; - dlg.WorkingDraftROFolder = MyRODb.FolderPath; - dlg.ShowDialog(this); - if (dlg.CancelImport) - { - this.Cursor = Cursors.Default; - this.btnImport.Enabled = true; // allow user to select a different export file to import - this.btnDoImport.Enabled = true; // allow user to change mind and perform the import - return; - } - _ConvertROsToTextDuringImport = dlg.ConvertROsToText; - } - // this saves the old RO database ID and the current RO database ID so that we can change the RODBIDs in the RO links - newRODbID = MyRODb.RODbID; - oldRODbID = rodbid; - } - else - { - #region NeedToSelectROPath - // MyDocVersion does not have an RO database (ro folder path) assigned to it so we need to select an RO Path - List localROPaths = new List(); - RODbInfoList rolist = RODbInfoList.Get(); - foreach (RODbInfo dbi in rolist) - { - if (dbi.FolderPath == rofolderpath && dbi.RODbID == rodbid) - { - MyRODb = RODb.GetJustRoDb(rodbid); - oldRODbID = newRODbID = rodbid; - break; - } - // B2016-175 have the correct (matching) RO Path but the rodbid is different (procedure came from a different SQL database) - // We can use the RO Path but we need to change the rodbid in the RO links of the procedure we are importing - else if (dbi.FolderPath == rofolderpath && dbi.RODbID != rodbid) - { - MyRODb = RODb.GetByFolderPath(rofolderpath); - newRODbID = MyRODb.RODbID; - oldRODbID = rodbid; - break; - } - else - { - DirectoryInfo di = new DirectoryInfo(dbi.FolderPath); - if (di.Exists) - localROPaths.Add(dbi.FolderPath); - } - } - if (MyRODb == null) - { - if (localROPaths.Count == 0) - { - MessageBox.Show("There has been no RO folder defined for this database.\r\n\r\nIn order to import a procedure, you need to assign a RO folder path.\r\n\r\nImport process will terminate."); - this.Cursor = Cursors.Default; - return; - } - else - { - this.Cursor = Cursors.Default; - dlgPickROFolder dlg = new dlgPickROFolder(); - dlg.ImportedROFolder = rofolderpath; - dlg.LocalROFolders = localROPaths; - dlg.ShowDialog(this); - if ((dlg.SelectedROFolder ?? string.Empty) != string.Empty) // B2015-216 If the return value is null treat it like an empty string - { - MyRODb = RODb.GetByFolderPath(dlg.SelectedROFolder); - RODbInfo myRODBInfo = RODbInfo.Get(MyRODb.RODbID); - oldRODbID = newRODbID = MyRODb.RODbID; - ROFstInfo fstInfo = null; - foreach (ROFstInfo tmp in myRODBInfo.RODbROFsts) - if (fstInfo == null || tmp.ROFstID > fstInfo.ROFstID) - fstInfo = tmp; - using (DocVersion dv = MyDocVersion.Get()) - { - using (ROFst fst = fstInfo.Get()) - { - dv.DocVersionAssociations.Add(fst); - dv.Save(); - } - dv.Reset_DocVersionAssociations(); - MyDocVersion.RefreshDocVersionAssociations(); - } - } - else - { - MessageBox.Show("Since you did not pick an existing RO folder defined for this database, the import process will terminate."); - this.Close();// Close the Import Window - return; - } - } - } - #endregion - } // end - need to select RO Path - - // use resolvedProcNum to determine if procedure is 'unique', i.e. if the procedure number exists - // and user does not overwrite or copy, then the procedure should NOT be imported. Fix for B2016-045 - bool resolvedProcNum = true; - foreach (ProcedureInfo pi in MyDocVersion.Procedures) - { - // procedure numbers that contain a hyphen may have the hyphen represented as the unicode character - // '\u8209?' or the '-' character. If proc number is same except for hyphen representation, they - // should be considered the same procedure (fix for B2016-084) - string hyphenNum = pi.MyContent.Number == null ? "" : pi.MyContent.Number.Replace(@"\u8209?", "-").Replace("\u2011", "-").Replace("\u9586?","_").Replace("\u2572", @"\"); - string hyphenImpNum = xd.SelectSingleNode("procedure/content/@number").InnerText; - // bug fix C2015-044 - jsj - // - the cancel button would ignor the user's wishes and proceed with the import (overwriting the existing procedure) - // - also found that the message about overwriting or making a copy wasn't appearing because we where not converting the import procedure number - // - our standard unicode dash (\u8209?) before conparing the existing and imported - // - also found the Overrite and make a copy of messages looked too similar - fixed that as well. - //hyphenImpNum = hyphenImpNum == null ? "" : hyphenImpNum.Replace("\u8030?", "-"); -did not find any reason to have this \u8030? - note retested sourcesafe doc for B2016-084 without this logic and it was fine - hyphenImpNum = hyphenImpNum == null ? "" : hyphenImpNum.Replace(@"\u8209?", "-").Replace("\u2011", "-").Replace(@"\u9586?", @"\").Replace("\u2572", @"\"); - - if (hyphenNum == hyphenImpNum) - { - string msg = string.Format("The procedure you are importing{0}already exists in this procedure set.\n\nDo you want to OVERWRITE the existing procedure?", !hyphenImpNum.Equals("")?string.Format(" ({0}) ",hyphenImpNum):" "); - DialogResult dr = MessageBox.Show(this, msg, "Overwrite Existing Procedure", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Stop); - if (dr == DialogResult.Yes) - { - ImportProcedureOverwrite(xd, pi); - isImported = true; - break; - } - if (dr == DialogResult.No) - { - msg = string.Format("Do you want to import {0} as a COPY of the existing procedure?\n\nThis will prefix the procedure number with \"Copy of\"", !hyphenImpNum.Equals("") ? string.Format("({0})", hyphenImpNum) : "the procedure"); - dr = MessageBox.Show(this, msg , "Create Copy Of Existing Procedure", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Stop); - if (dr == DialogResult.Yes) - { - ImportProcedureCopy(xd); - isImported = true; - break; - } - else - resolvedProcNum = false; - } - if (dr == System.Windows.Forms.DialogResult.Cancel) - { - canceledPressed = true; - resolvedProcNum = false; - } - break; // user selected No or Cancel so break out of the foreach loop - } - } - if (!canceledPressed && !isImported && resolvedProcNum) - { - ImportProcedureNew(xd); - isImported = true; - } - TurnChangeManagerOn.Execute(); - if (isImported) - { - TimeSpan elapsed = DateTime.Now.Subtract(MyStart); - lblImportStatus.Text = "Import Completed in " + elapsed.ToString(); - } - else - { - btnImport.Enabled = true; - btnDoImport.Enabled = true; - } - } - this.Cursor = Cursors.Default; - btnCloseImport.Enabled = true; - if (isImported) - MessageBox.Show(string.Format("Finished Importing:\n\n{0}",txtImport.Text.Substring(txtImport.Text.LastIndexOf("\\")+1)),"Import",MessageBoxButtons.OK,MessageBoxIcon.Information); - if (canceledPressed) - { - MessageBox.Show(string.Format("Canceling the import of:\n\n{0}",txtImport.Text.Substring(txtImport.Text.LastIndexOf("\\")+1)),"Import",MessageBoxButtons.OK,MessageBoxIcon.Information); - btnCloseImport.PerformClick(); - } - } - private void ImportProcedureNew(XmlDocument xd) - { - //add imported procedure - floatFoldout = new Dictionary(); - oldFormat = new Dictionary(); - newFormat = new Dictionary(); - FormatInfoList fil = FormatInfoList.Get(); - foreach (FormatInfo fi in fil) - { - oldFormat.Add(fi.FormatID, fi.Name); - newFormat.Add(fi.Name, fi.FormatID); - } - Old2NewItem = new Dictionary(); - Old2NewContent = new Dictionary(); - Old2NewLibDoc = new Dictionary(); - PendingTransitions = new XmlDocument(); - XmlElement xe = PendingTransitions.CreateElement("transitions"); - PendingTransitions.AppendChild(xe); - string fn = PEIPath + @"\transitions.xml"; - PendingTransitions.Save(fn); - ProcedureInfo lastProcedure = null; - foreach (ProcedureInfo pi in MyDocVersion.Procedures) - lastProcedure = pi; - _MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure); - //update transitions - AddTransitions(PendingTransitions); - PendingTransitions.Save(fn); - FixFloatingFoldouts(); - //File.Delete(fn); - } - private void ImportProcedureCopy(XmlDocument xd) - { - floatFoldout = new Dictionary(); - oldFormat = new Dictionary(); - newFormat = new Dictionary(); - FormatInfoList fil = FormatInfoList.Get(); - foreach (FormatInfo fi in fil) - { - oldFormat.Add(fi.FormatID, fi.Name); - newFormat.Add(fi.Name, fi.FormatID); - } - Old2NewItem = new Dictionary(); - Old2NewContent = new Dictionary(); - Old2NewLibDoc = new Dictionary(); - PendingTransitions = new XmlDocument(); - XmlElement xe = PendingTransitions.CreateElement("transitions"); - PendingTransitions.AppendChild(xe); - string fn = PEIPath + @"\transitions.xml"; - PendingTransitions.Save(fn); - ProcedureInfo lastProcedure = null; - //determine count of existing procedures with same number - string number = xd.SelectSingleNode("procedure/content/@number").InnerText; - - // kbr - could replace '-' with unicode in number, here. - int count = 0; - foreach (ProcedureInfo pi in MyDocVersion.Procedures) - { - lastProcedure = pi; - if (pi.MyContent.Number.EndsWith(number)) - count++; - } - xd.SelectSingleNode("procedure/content/@number").InnerText = string.Format("Copy({0}) of {1}", count.ToString(), number); - //add imported procedure and copy count - _MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure); - //update transitions - AddTransitions(PendingTransitions); - FixFloatingFoldouts(); - File.Delete(fn); - } - private void ImportProcedureOverwrite(XmlDocument xd, ProcedureInfo pi) - { - floatFoldout = new Dictionary(); - oldFormat = new Dictionary(); - newFormat = new Dictionary(); - FormatInfoList fil = FormatInfoList.Get(); - foreach (FormatInfo fi in fil) - { - oldFormat.Add(fi.FormatID, fi.Name); - newFormat.Add(fi.Name, fi.FormatID); - } - Old2NewItem = new Dictionary(); - Old2NewContent = new Dictionary(); - Old2NewLibDoc = new Dictionary(); - PendingTransitions = new XmlDocument(); - XmlElement xe = PendingTransitions.CreateElement("transitions"); - PendingTransitions.AppendChild(xe); - string fn = PEIPath + @"\transitions.xml"; - PendingTransitions.Save(fn); - ProcedureInfo lastProcedure = null; - //delete old procedure - foreach (ProcedureInfo lp in MyDocVersion.Procedures) - lastProcedure = lp; - //delete opi - try - { - TurnChangeManagerOn.Execute(); // Import Turns off the Change Manager - Delete needs to have it on - Item.DeleteItemAndChildren(pi); - TurnChangeManagerOff.Execute(); // Assure that the Change Manager is off - } - catch(Exception ex) - { - ExternalTransitionItem = pi.HandleSqlExceptionOnDelete(ex); - File.Delete(fn); - TurnChangeManagerOff.Execute(); // Assure that the Change Manager is off - return; - } - //add imported procedure - _MyNewProcedure = AddProcedure(xd.DocumentElement, MyDocVersion, lastProcedure); - //update transitions - AddTransitions(PendingTransitions); - FixFloatingFoldouts(); - } - private void LoadImportDataDocument() - { - floatFoldout = new Dictionary(); - ZipEntry ze = MyExpxZipFile[0]; - string fn = PEIPath + @"\" + ze.FileName; - ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently); - XmlDocument xd = new XmlDocument(); - xd.Load(fn); - LoadFormats(xd); - Folder ff = AddFolder(Folder.Get(MyFolder.FolderID), xd); - if (ff == null) - { - MessageBox.Show("You can not import the same procedure set more than once", "Duplicate Import Error"); - return; - } - _MyNewFolder = FolderInfo.Get(ff.FolderID); - AddAnnotationTypes(xd); - DocVersionInfo dvi = AddDocVersion(ff, xd); - MyDocVersion = dvi; - xd = null; - lblImportStatus.Text = "Creating Procedures..."; - Application.DoEvents(); - ProcedureInfo pi = null; - pbImportProcedure.Value = 0; - pbImportProcedure.Maximum = MyExpxZipFile.Entries.Count - 1; - for (int i = 1; i < MyExpxZipFile.Entries.Count; i++) - { - ze = MyExpxZipFile[i]; - fn = PEIPath + @"\" + ze.FileName; - ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently); - xd = new XmlDocument(); - xd.Load(fn); - pi = AddProcedure(xd.DocumentElement, dvi, pi); - } - 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(); - } - private void FixSectionStart(ProcedureInfo pi) - { - Content c = Content.Get(pi.MyContent.ContentID); - XmlDocument xd = new XmlDocument(); - // If the config field is empty, add an empty xml node. - if (c.Config == "") c.Config = ""; - xd.LoadXml(c.Config); - XmlNode xn = xd.SelectSingleNode("Config/Procedure/@SectionStart"); - if (xn != null) - { - int iid = int.Parse(xn.InnerText); - if (Old2NewItem.ContainsKey(iid)) - iid = Old2NewItem[iid]; - else - { - int oldid = iid; - iid = pi.ItemID; - XmlAttribute xa = xd.CreateAttribute("ErrorSectionStart"); - xa.InnerText = oldid.ToString(); - XmlNode xp = xd.SelectSingleNode("Config/Procedure"); - xp.Attributes.SetNamedItem(xa); - } - xn.InnerText = iid.ToString(); - c.Config = xd.OuterXml; - c.Save(); - } - } - private void FixFloatingFoldouts() - { - foreach (int key in floatFoldout.Keys) - { - lblImportStatus.Text = "Updating Floating Foldouts"; - int cid = Old2NewContent[key]; - int iid = Old2NewItem[floatFoldout[key]]; - Content c = Content.Get(cid); - XmlDocument xd = new XmlDocument(); - xd.LoadXml(c.Config); - XmlNode xn = xd.SelectSingleNode("Config/Step/@FloatingFoldout"); - xn.InnerText = iid.ToString(); - c.Config = xd.OuterXml; - c.Save(); - } - } - - // note that his is only used when importing a folder - private void LoadFormats(XmlDocument xd) - { - oldFormat = new Dictionary(); - XmlNodeList nl = xd.SelectNodes("folder/formats/format"); - foreach (XmlNode nd in nl) - { - int formatid = int.Parse(nd.Attributes.GetNamedItem("formatid").InnerText); - string name = nd.Attributes.GetNamedItem("name").InnerText; - oldFormat.Add(formatid, name); - } - newFormat = new Dictionary(); - FormatInfoList fil = FormatInfoList.Get(); - foreach (FormatInfo fi in fil) - newFormat.Add(fi.Name, fi.FormatID); - } - - //jsj 4-29-2016 appears to not be used - //Dictionary dicParentItem = null; - //private void UpdateParentItem(int depth, ItemInfo ii) - //{ - // if (dicParentItem == null) dicParentItem = new Dictionary(); - // if (!dicParentItem.ContainsKey(depth)) dicParentItem.Add(depth, null); - // dicParentItem[depth] = ii; - //} - - //jsj 4-29-2016 appears to not be used - //Dictionary dicPreviousItem = null; - //private void UpdatePreviousItem(int depth, ItemInfo ii) - //{ - // if (dicPreviousItem == null) dicPreviousItem = new Dictionary(); - // if (!dicPreviousItem.ContainsKey(depth)) dicPreviousItem.Add(depth, null); - // dicPreviousItem[depth] = ii; - //} - - Dictionary dicItemDepth = null; - - // jsj 4-29-2016 appears to not be used - //private void UpdateItemDepth(int depth, int id) - //{ - // if (dicItemDepth == null) dicItemDepth = new Dictionary(); - // if (!dicItemDepth.ContainsKey(depth)) dicItemDepth.Add(depth, 0); - // dicItemDepth[depth] = id; - //} - // jsj 2016Feb17 - this appears to not be used - //private void LoadImportDataReader() - //{ - // int pCount = 0; - // int sCount = 0; - // Folder folder = null; - // DocVersion docversion = null; - // Dictionary dicRofst = null; - // Dictionary dicEntry = null; - // ROFst rofst = null; - // GetImportDataCounts(); - // pbImportProcedure.Maximum = MyCounts.Count; - // pbImportProcedure.Value = 0; - // Application.DoEvents(); - // FileStream fs = File.OpenRead(txtImport.Text); - // XmlReaderSettings rs = new XmlReaderSettings(); - // rs.CheckCharacters = false; - // XmlReader xr = XmlReader.Create(fs, rs); - // while (xr.Read()) - // { - // if (xr.IsStartElement()) - // { - // switch (xr.Name) - // { - // case "annotation": - // AddAnnotation(xr); - // break; - // //case "association": - // // break; - // case "content": - // { - // if (xr.Depth == 3) //content for procedure - // { - // ItemInfo ii = AddProcedure(xr, docversion, dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); - // UpdatePreviousItem(xr.Depth, ii); - // UpdateParentItem(xr.Depth, ii); - // } - // else - // { - - // int fromtype = dicItemDepth.ContainsKey(xr.Depth - 2) ? dicItemDepth[xr.Depth - 2] : 0; - // switch (fromtype) - // { - // case 2: - // { //sections - // ItemInfo ii = AddSection(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); - // UpdatePreviousItem(xr.Depth, ii); - // UpdateParentItem(xr.Depth, ii); - // break; - // } - // case 3: - // { //cautions - // ItemInfo ii = AddCaution(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); - // UpdatePreviousItem(xr.Depth, ii); - // UpdateParentItem(xr.Depth, ii); - // break; - // } - // case 4: - // { //notes - // ItemInfo ii = AddNote(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); - // UpdatePreviousItem(xr.Depth, ii); - // UpdateParentItem(xr.Depth, ii); - // break; - // } - // case 5: - // { //rnos - // ItemInfo ii = AddRNO(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); - // UpdatePreviousItem(xr.Depth, ii); - // UpdateParentItem(xr.Depth, ii); - // break; - // } - // case 6: - // { //steps - // ItemInfo ii = AddStep(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); - // UpdatePreviousItem(xr.Depth, ii); - // UpdateParentItem(xr.Depth, ii); - // break; - // } - // case 7: - // { //tables - // ItemInfo ii = AddTable(xr, dicParentItem[xr.Depth], dicPreviousItem[xr.Depth], dicItemDepth[xr.Depth]); - // UpdatePreviousItem(xr.Depth, ii); - // UpdateParentItem(xr.Depth, ii); - // break; - // } - // default: - // break; - // } - // } - // break; - // } - // case "document": - // AddDocument(xr, dicEntry); - // break; - // case "docversion": - // { - // docversion = AddDocVersion(folder, xr); - // UpdatePreviousItem(xr.Depth + 2, null); - // break; - // } - // case "entry": - // dicEntry = AddEntry(xr); - // break; - // case "folder": - // folder = AddFolder(Folder.Get(MyFolder.FolderID), xr); - // break; - // case "grid": - // AddGrid(xr); - // break; - // case "procedure": - // { - // UpdateItemDepth(xr.Depth + 1, int.Parse(xr.GetAttribute("itemid"))); - // pbImportProcedure.PerformStep(); - // lblImportProcedure.Text = string.Format("{0} of {1} Procedures", pbImportProcedure.Value.ToString(), pbImportProcedure.Maximum.ToString()); - // pCount++; - // pbImportSection.Maximum = MyCounts[pCount].Count; - // pbImportSection.Value = 0; - // sCount = 0; - // Application.DoEvents(); - // break; - // } - // case "section": - // { - // UpdateItemDepth(xr.Depth + 1, int.Parse(xr.GetAttribute("itemid"))); - // pbImportSection.PerformStep(); - // lblImportSection.Text = string.Format("{0} of {1} Sections", pbImportSection.Value.ToString(), pbImportSection.Maximum.ToString()); - // sCount++; - // pbImportStep.Maximum = MyCounts[pCount][sCount]; - // pbImportStep.Value = 0; - // Application.DoEvents(); - // break; - // } - // case "step": - // { - // UpdateItemDepth(xr.Depth + 1, int.Parse(xr.GetAttribute("itemid"))); - // if (xr.Depth == 8) - // { - // pbImportStep.PerformStep(); - // lblImportStep.Text = string.Format("{0} of {1} Steps", pbImportStep.Value.ToString(), pbImportStep.Maximum.ToString()); - // Application.DoEvents(); - // } - // break; - // } - // case "caution": - // case "note": - // case "rno": - // case "table": - // UpdateItemDepth(xr.Depth + 1, int.Parse(xr.GetAttribute("itemid"))); - // break; - // case "cautions": - // case "notes": - // case "rnos": - // case "sections": - // case "steps": - // case "tables": - // { - // UpdateItemDepth(xr.Depth, int.Parse(xr.GetAttribute("fromtype"))); - // UpdatePreviousItem(xr.Depth + 2, null); - // UpdateParentItem(xr.Depth + 2, dicParentItem[xr.Depth - 1]); - // break; - // } - // case "rodb": - // { - // MyRODb = AddRODb(xr); - // rofst = AddROFst(dicRofst); - // docversion.DocVersionAssociations.Add(rofst); - // docversion.Save(); - // break; - // } - // case "rofst": - // dicRofst = GetROFstData(xr); - // break; - // case "rousage": - // AddROUsage(xr); - // break; - // //case "transition": - // // break; - // default: - // break; - // } - // Console.WriteLine("{0} - {1}", xr.Name, xr.Depth.ToString()); - // } - // } - // pbImportProcedure.PerformStep(); - // Application.DoEvents(); - // fs.Close(); - // FixImportDataTransitions(); - // StoreItemContentIDs(); - // ResolveExternalTransitions(folder); - //} - - // This is called only when we are importing an entire folder. - // if there is a .impx file (a zip file generated from the last folder export file and based on location -folder name- of the export file you are importing), then it updates it with new values, - // else it will create a .impx file, and saves the id information listed below. - // This will create and save the ItemIDs (old and new), ContentIDs (old andnew), library document IDs (old and new), and pending transitions each in their own xml file - // the xml files are then added (or replaced) in the .impx file. - private void SaveTransitionAndItemContentIDs() - { - XmlDocument xd = new XmlDocument(); - XmlElement xe = xd.CreateElement("items"); - xd.AppendChild(xe); - string fn = PEIPath + @"\items.xml"; - foreach (int key in Old2NewItem.Keys) - { - xe = xd.CreateElement("item"); - xe.Attributes.SetNamedItem(AddAttribute(xd, "old", key.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xd, "new", Old2NewItem[key].ToString())); - xd.DocumentElement.AppendChild(xe); - } - xd.Save(fn); - ZipEntry ze = MyImpxZipFile["items.xml"]; - MyImpxZipFile.RemoveEntry(ze); - MyImpxZipFile.Save(); - MyImpxZipFile.AddFile(fn, ""); - MyImpxZipFile.Save(); - File.Delete(fn); - xd = new XmlDocument(); - xe = xd.CreateElement("contents"); - xd.AppendChild(xe); - fn = PEIPath + @"\contents.xml"; - foreach (int key in Old2NewContent.Keys) - { - xe = xd.CreateElement("content"); - xe.Attributes.SetNamedItem(AddAttribute(xd, "old", key.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xd, "new", Old2NewContent[key].ToString())); - xd.DocumentElement.AppendChild(xe); - } - xd.Save(fn); - ze = MyImpxZipFile["contents.xml"]; - MyImpxZipFile.RemoveEntry(ze); - MyImpxZipFile.Save(); - MyImpxZipFile.AddFile(fn, ""); - MyImpxZipFile.Save(); - File.Delete(fn); - xd = new XmlDocument(); - xe = xd.CreateElement("transitions"); - xd.AppendChild(xe); - fn = PEIPath + @"\transitions.xml"; - if (PendingTransitions != null && PendingTransitions.DocumentElement.HasChildNodes) - { - foreach (XmlNode nd in PendingTransitions.DocumentElement.ChildNodes) - { - if(nd.InnerText == "") - xd.DocumentElement.AppendChild(xd.ImportNode(nd, true)); - } - } - xd.Save(fn); - ze = MyImpxZipFile["transitions.xml"]; - MyImpxZipFile.RemoveEntry(ze); - MyImpxZipFile.Save(); - MyImpxZipFile.AddFile(fn, ""); - MyImpxZipFile.Save(); - File.Delete(fn); - } - // appears to not be used - jsj 4-28-2016 - //private void StoreItemContentIDs() - //{ - // XmlDocument xd = new XmlDocument(); - // string fn = PEIPath + @"\ExternalTransitions.xml"; - // xd.Load(fn); - // XmlElement xe = (XmlElement)xd.SelectSingleNode("externaltransitions/oldtonewitem"); - // foreach (int key in Old2NewItem.Keys) - // { - // XmlElement xee = xd.CreateElement("item"); - // XmlAttribute xa = AddAttribute(xd, "old", key.ToString()); - // xee.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "new", Old2NewItem[key].ToString()); - // xee.Attributes.SetNamedItem(xa); - // xe.AppendChild(xee); - // } - // xd.Save(fn); - // xe = (XmlElement)xd.SelectSingleNode("externaltransitions/oldtonewcontent"); - // foreach (int key in Old2NewContent.Keys) - // { - // XmlElement xee = xd.CreateElement("content"); - // XmlAttribute xa = AddAttribute(xd, "old", key.ToString()); - // xee.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "new", Old2NewContent[key].ToString()); - // xee.Attributes.SetNamedItem(xa); - // xe.AppendChild(xee); - // } - // xd.Save(fn); - //} - //private void ResolveExternalTransitions(Folder folder) - //{ - // XmlDocument xd = new XmlDocument(); - // string fn = PEIPath + @"\ExternalTransitions.xml"; - // xd.Load(fn); - // AddStoredItemContentIDs(xd); - // XmlNodeList nl = xd.SelectNodes("//transition[@folder!='']"); - // foreach (XmlNode nd in nl) - // { - // int transitionid = int.Parse(nd.Attributes.GetNamedItem("transitionid").InnerText); - // int fromid = int.Parse(nd.Attributes.GetNamedItem("fromid").InnerText); - // int toid = int.Parse(nd.Attributes.GetNamedItem("toid").InnerText); - // int rangeid = int.Parse(nd.Attributes.GetNamedItem("rangeid").InnerText); - // if (Old2NewContent.ContainsKey(fromid) && Old2NewItem.ContainsKey(toid) && Old2NewItem.ContainsKey(rangeid)) - // { - // int isrange = int.Parse(nd.Attributes.GetNamedItem("isrange").InnerText); - // int trantype = int.Parse(nd.Attributes.GetNamedItem("trantype").InnerText); - // string config = nd.Attributes.GetNamedItem("config").InnerText; - // string userid = nd.Attributes.GetNamedItem("userid").InnerText; - // DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - // string lookfor; - // if (isrange == 0) - // lookfor = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - // else - // lookfor = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - // fromid = Old2NewContent[fromid]; - // toid = Old2NewItem[toid]; - // rangeid = Old2NewItem[rangeid]; - // Content cc = Content.Get(fromid); - // Transition tt = Transition.MakeTransition(cc, Item.Get(toid), Item.Get(rangeid), isrange, trantype, config, dts, userid); - // transitionid = tt.TransitionID; - // string replacewith; - // if (isrange == 0) - // replacewith = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - // else - // replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - // cc.Text = cc.Text.Replace(lookfor, replacewith); - // cc.Save(); - // nd.Attributes.GetNamedItem("folder").InnerText = ""; - // } - // } - // xd.Save(fn); - //} - - // This is called only when we are importing an entire folder and there is a .impx file (a zip file) - // the name of the .impx file is based on the folder name containing the export file being imported - // This will read in the saved ItemIDs (old and new), ContentIDs (old andnew), library document IDs (old and new), and pending transitions - private void ReadTransitionAndItemContentIDs() - { - ZipEntry ze = MyImpxZipFile["items.xml"]; - ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently); - string fn = PEIPath + @"\items.xml"; - XmlDocument xd = new XmlDocument(); - xd.Load(fn); - XmlNodeList nl = xd.SelectNodes("//item"); - foreach (XmlNode nd in nl) - { - int oldid = int.Parse(nd.Attributes.GetNamedItem("old").InnerText); - int newid = int.Parse(nd.Attributes.GetNamedItem("new").InnerText); - //if (!Old2NewItem.ContainsKey(oldid)) - Old2NewItem.Add(oldid, newid); - } - File.Delete(fn); - ze = MyImpxZipFile["contents.xml"]; - ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently); - fn = PEIPath + @"\contents.xml"; - xd = new XmlDocument(); - xd.Load(fn); - nl = xd.SelectNodes("//content"); - foreach (XmlNode nd in nl) - { - int oldid = int.Parse(nd.Attributes.GetNamedItem("old").InnerText); - int newid = int.Parse(nd.Attributes.GetNamedItem("new").InnerText); - //if (!Old2NewContent.ContainsKey(oldid)) - Old2NewContent.Add(oldid, newid); - } - File.Delete(fn); - ze = MyImpxZipFile["libdocs.xml"]; - ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently); - fn = PEIPath + @"\libdocs.xml"; - xd = new XmlDocument(); - xd.Load(fn); - nl = xd.SelectNodes("//libdoc"); - foreach (XmlNode nd in nl) - { - int oldid = int.Parse(nd.Attributes.GetNamedItem("old").InnerText); - int newid = int.Parse(nd.Attributes.GetNamedItem("new").InnerText); - //if (!Old2NewContent.ContainsKey(oldid)) - Old2NewLibDoc.Add(oldid, newid); - } - File.Delete(fn); - ze = MyImpxZipFile["transitions.xml"]; - ze.Extract(PEIPath, ExtractExistingFileAction.OverwriteSilently); - fn = PEIPath + @"\transitions.xml"; - PendingTransitions.Load(fn); - File.Delete(fn); - } - // appears not to be used - jsj 4-28-2016 - //private void AddStoredItemContentIDs(XmlDocument xd) - //{ - // XmlNodeList nl = xd.SelectNodes("//item"); - // foreach (XmlNode nd in nl) - // { - // int oldid = int.Parse(nd.Attributes.GetNamedItem("old").InnerText); - // int newid = int.Parse(nd.Attributes.GetNamedItem("new").InnerText); - // if (!Old2NewItem.ContainsKey(oldid)) - // Old2NewItem.Add(oldid, newid); - // } - // nl = xd.SelectNodes("//content"); - // foreach (XmlNode nd in nl) - // { - // int oldid = int.Parse(nd.Attributes.GetNamedItem("old").InnerText); - // int newid = int.Parse(nd.Attributes.GetNamedItem("new").InnerText); - // if (!Old2NewContent.ContainsKey(oldid)) - // Old2NewContent.Add(oldid, newid); - // } - //} - - // appears not to be used - jsj 4-28-2016 - //private void FixImportDataTransitions() - //{ - // XmlDocument xd = new XmlDocument(); - // string fn = PEIPath + @"\ExternalTransitions.xml"; - // if (!File.Exists(fn)) - // { - // XmlElement xe = xd.CreateElement("externaltransitions"); - // XmlElement xee = xd.CreateElement("oldtonewitem"); - // xe.AppendChild(xee); - // xee = xd.CreateElement("oldtonewcontent"); - // xe.AppendChild(xee); - // xee = xd.CreateElement("transitions"); - // xe.AppendChild(xee); - // xd.AppendChild(xe); - // xd.Save(fn); - // } - // else - // { - // xd.Load(fn); - // } - // FileStream fs = File.OpenRead(txtImport.Text); - // XmlReaderSettings rs = new XmlReaderSettings(); - // rs.CheckCharacters = false; - // XmlReader xr = XmlReader.Create(fs, rs); - // while (xr.Read()) - // { - // if (xr.IsStartElement()) - // { - // switch (xr.Name) - // { - // case "transition": - // AddTransitions(xr); - // break; - // case "externaltransition": - // { - // AddExternalTransition(xr, xd); - // break; - // } - // default: - // break; - // } - // } - // } - // fs.Close(); - // xd.Save(fn); - //} - - // jsj 4-29-2016 appears to not be used - //private Dictionary> MyCounts = null; - //private Dictionary MySubCounts = null; - //private void GetImportDataCounts() - //{ - // int pCount = 0; - // int sCount = 0; - // int tCount = 0; - // MyCounts = new Dictionary>(); - // MySubCounts = new Dictionary(); - // FileStream fs = File.OpenRead(txtImport.Text); - // XmlReaderSettings rs = new XmlReaderSettings(); - // rs.CheckCharacters = false; - // XmlReader xr = XmlReader.Create(fs, rs); - // while (xr.Read()) - // { - // if (xr.IsStartElement()) - // { - // switch (xr.Name) - // { - // case "procedure": - // { - // if (pCount > 0) - // { - // MySubCounts.Add(sCount, tCount); - // MyCounts.Add(pCount, MySubCounts); - // sCount = 0; - // tCount = 0; - // MySubCounts = new Dictionary(); - // } - // pCount++; - // break; - // } - // case "section": - // { - // if (sCount > 0) - // { - // MySubCounts.Add(sCount, tCount); - // tCount = 0; - // } - // sCount++; - // break; - // } - // case "step": - // { - // if (xr.Depth == 8) - // tCount++; - // break; - // } - // default: - // break; - // } - // } - // } - // MySubCounts.Add(sCount, tCount); - // MyCounts.Add(pCount, MySubCounts); - // fs.Close(); - //} - - private void btnImport_Click(object sender, EventArgs e) - { - if (MyFolder != null) - { - if (ofd.ShowDialog(this) == DialogResult.OK) - { - if (ofd.FileName != string.Empty) - { - Old2NewItem = new Dictionary(); - Old2NewContent = new Dictionary(); - Old2NewLibDoc = new Dictionary(); - PendingTransitions = new XmlDocument(); - FileInfo fi = new FileInfo(ofd.FileName); - string dn; - if (fi.Name.IndexOf("-") > 0) - dn = fi.Name.Substring(0, fi.Name.IndexOf("-")); - else - dn = fi.Name.Substring(0,fi.Name.IndexOf(".")); - txtImport.Text = ofd.FileName; - ReadOptions ro = new ReadOptions(); - ro.Encoding = Encoding.UTF8; - MyExpxZipFile = ZipFile.Read(txtImport.Text, ro); - string fn = string.Format(@"{0}\{1}.impx", PEIPath, dn); - if (File.Exists(fn)) - { - MyImpxZipFile = ZipFile.Read(fn, ro); - ReadTransitionAndItemContentIDs(); - } - else - { - MyImpxZipFile = new ZipFile(fn, Encoding.UTF8); - //transitions - XmlElement xe = PendingTransitions.CreateElement("transitions"); - PendingTransitions.AppendChild(xe); - fn = PEIPath + @"\transitions.xml"; - PendingTransitions.Save(fn); - MyImpxZipFile.AddFile(fn, ""); - MyImpxZipFile.Save(); - File.Delete(fn); - //itemids - XmlDocument xd = new XmlDocument(); - xe = xd.CreateElement("items"); - xd.AppendChild(xe); - fn = PEIPath + @"\items.xml"; - xd.Save(fn); - MyImpxZipFile.AddFile(fn, ""); - MyImpxZipFile.Save(); - File.Delete(fn); - //contentids - xd = new XmlDocument(); - xe = xd.CreateElement("contents"); - xd.AppendChild(xe); - fn = PEIPath + @"\contents.xml"; - xd.Save(fn); - MyImpxZipFile.AddFile(fn, ""); - MyImpxZipFile.Save(); - File.Delete(fn); - //libdocids - xd = new XmlDocument(); - xe = xd.CreateElement("libdocs"); - xd.AppendChild(xe); - fn = PEIPath + @"\libdocs.xml"; - xd.Save(fn); - MyImpxZipFile.AddFile(fn, ""); - MyImpxZipFile.Save(); - File.Delete(fn); - } - } - } - } - if (MyDocVersion != null) - { - ofd.Filter = "PROMS Procedure Export Files|*.pxml"; - if (ofd.ShowDialog(this) == DialogResult.OK) - txtImport.Text = ofd.FileName; - } - } - private void txtImport_TextChanged(object sender, EventArgs e) - { - btnDoImport.Enabled = txtImport.TextLength > 0; - if (btnDoImport.Enabled) - lblImportStatus.Text = "Ready To Perform Import"; - else - lblImportStatus.Text = "Awaiting Import File Name:"; - } - #region Export for Merge - private string FromFolderName = string.Empty; - private void ExportFolder(XmlDocument xd, FolderInfo fi, string nodename) - { - /* - FolderID - ParentID - DBID - Name - Title - ShortName - FormatID - ManualOrder - Config - DTS - UsrID - */ - lblExportStatus.Text = "Exporting Folder..."; - Application.DoEvents(); - string formatFileName = (fi.MyFormat != null)? fi.MyFormat.Name:""; - FromFolderName = fi.Name; - XmlElement xe = xd.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xd, "folderid", fi.FolderID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xd, "parentid", fi.ParentID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xd, "dbid", fi.DBID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xd, "name", fi.Name)); - xe.Attributes.SetNamedItem(AddAttribute(xd, "title", fi.Title)); - xe.Attributes.SetNamedItem(AddAttribute(xd, "shortname", fi.ShortName)); - xe.Attributes.SetNamedItem(AddAttribute(xd, "formatid", fi.FormatID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xd, "manualorder", fi.ManualOrder.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xd, "config", fi.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xd, "dts", fi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xd, "usrid", fi.UsrID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xd, "formatfilename",formatFileName)); - xd.AppendChild(xe); - ExportAnnotationTypes(xe, "annotationtypes"); - ExportFormats(xe, "formats"); - if (fi.FolderDocVersionCount > 0) - foreach (DocVersionInfo dvi in fi.FolderDocVersions) - ExportDocVersion(xe, dvi, "docversion"); - } - private void ExportFormats(XmlElement xn, string nodename) - { - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - FormatInfoList fil = FormatInfoList.Get(); - foreach (FormatInfo fi in fil) - ExportFormat(xe, fi, "format"); - xn.AppendChild(xe); - } - private void ExportFormat(XmlElement xn, FormatInfo fi, string nodename) - { - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatid", fi.FormatID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "name", fi.Name)); - xn.AppendChild(xe); - } - private void ExportAnnotationTypes(XmlElement xn, string nodename) - { - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - AnnotationTypeInfoList atl = AnnotationTypeInfoList.Get(); - foreach (AnnotationTypeInfo ati in atl) - ExportAnnotationType(xe, ati, "annotationtype"); - xn.AppendChild(xe); - } - private void ExportAnnotationType(XmlElement xn, AnnotationTypeInfo ati, string nodename) - { - /* - TypeID - Name - Config - DTS - UserID - */ - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "typeid", ati.TypeID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "name", ati.Name)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", ati.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ati.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ati.UserID.ToString())); - xn.AppendChild(xe); - } - - // jsj 4-29-2016 appears to not be used - //private void ExportFolder(FolderInfo fi, string nodename) - //{ - // /* - // FolderID - // ParentID - // DBID - // Name - // Title - // ShortName - // FormatID - // ManualOrder - // Config - // DTS - // UsrID - // */ - // string formatFileName = (fi.MyFormat != null) ? fi.MyFormat.Name : ""; - // FromFolderName = fi.Name; - // MyWriter.WriteStartDocument(); - // MyWriter.WriteStartElement(nodename); - // MyWriter.WriteAttributeString("folderid", fi.FolderID.ToString()); - // MyWriter.WriteAttributeString("parentid", fi.ParentID.ToString()); - // MyWriter.WriteAttributeString("dbid", fi.DBID.ToString()); - // MyWriter.WriteAttributeString("name", fi.Name); - // MyWriter.WriteAttributeString("title", fi.Title); - // MyWriter.WriteAttributeString("shortname", fi.ShortName); - // MyWriter.WriteAttributeString("formatid", fi.FormatID.ToString()); - // MyWriter.WriteAttributeString("manualorder", fi.ManualOrder.ToString()); - // MyWriter.WriteAttributeString("config", fi.Config); - // MyWriter.WriteAttributeString("dts", fi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - // MyWriter.WriteAttributeString("usrid", fi.UsrID.ToString()); - // MyWriter.WriteAttributeString("formatfilename", formatFileName); - - // if (fi.FolderDocVersionCount > 0) - // foreach (DocVersionInfo dvi in fi.FolderDocVersions) - // ExportDocVersion(dvi, "docversion"); - // MyWriter.WriteEndElement(); - // MyWriter.WriteEndDocument(); - //} - private void ExportDocVersion(XmlElement xn, DocVersionInfo dvi, string nodename) - { - /* - VersionID - FolderID - VersionType - Name - Title - ItemID - FormatID - Config - DTS - UserID - */ - lblExportStatus.Text = "Exporting DocVersion..."; - Application.DoEvents(); - string formatFileName = (dvi.MyFormat != null) ? dvi.MyFormat.Name : ""; - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "versionid", dvi.VersionID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "folderid", dvi.FolderID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "versiontype", dvi.VersionType.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "name", dvi.Name)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "title", dvi.Title)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "itemid", dvi.ItemID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatid", dvi.FormatID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", dvi.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", dvi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", dvi.UserID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatfilename", formatFileName)); - xn.AppendChild(xe); - if (dvi.DocVersionAssociationCount > 0) - foreach (AssociationInfo ai in dvi.DocVersionAssociations) - ExportAssociation(xe, ai, "association"); - string fn = PEIPath + @"\folder.xml"; - xn.OwnerDocument.Save(fn); - MyExpxZipFile.AddFile(fn, "folder"); - MyExpxZipFile.Save(); - File.Delete(fn); - //here - lblExportStatus.Text = "Exporting Procedures..."; - Application.DoEvents(); - if (dvi.Procedures.Count > 0) - { - pbExportProcedure.Value = 0; - pbExportProcedure.Maximum = dvi.Procedures.Count; - lblExportProcedure.Text = pbExportProcedure.Maximum.ToString() + " Procedures"; - foreach (ItemInfo ii in dvi.Procedures) - { - XmlDocument xd = new XmlDocument(); - ExportItem(xd, ii, "procedure"); - fn = string.Format(@"{0}\proc{1}.xml", PEIPath, pbExportProcedure.Value.ToString().PadLeft(4, '0')); - xd.Save(fn); - MyExpxZipFile.AddFile(fn, "procedures"); - MyExpxZipFile.Save(); - File.Delete(fn); - xd = null; - } - } - } - private void ExportDocVersion(DocVersionInfo dvi, string nodename) - { - /* - VersionID - FolderID - VersionType - Name - Title - ItemID - FormatID - Config - DTS - UserID - */ - string formatFileName = (dvi.MyFormat != null) ? dvi.MyFormat.Name : ""; - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("versionid", dvi.VersionID.ToString()); - MyWriter.WriteAttributeString("folderid", dvi.FolderID.ToString()); - MyWriter.WriteAttributeString("versiontype", dvi.VersionType.ToString()); - MyWriter.WriteAttributeString("name", dvi.Name); - MyWriter.WriteAttributeString("title", dvi.Title); - MyWriter.WriteAttributeString("itemid", dvi.ItemID.ToString()); - MyWriter.WriteAttributeString("formatid", dvi.FormatID.ToString()); - MyWriter.WriteAttributeString("config", dvi.Config); - MyWriter.WriteAttributeString("dts", dvi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", dvi.UserID.ToString()); - MyWriter.WriteAttributeString("formatfilename", formatFileName); - if (dvi.DocVersionAssociationCount > 0) - foreach (AssociationInfo ai in dvi.DocVersionAssociations) - ExportAssociation(ai, "association"); - if (dvi.Procedures.Count > 0) - { - pbExportProcedure.Value = 0; - pbExportProcedure.Maximum = dvi.Procedures.Count; - lblExportProcedure.Text = pbExportProcedure.Maximum.ToString() + " Procedures"; - foreach (ItemInfo ii in dvi.Procedures) - { - ExportItem(ii, "procedure"); - } - } - MyWriter.WriteEndElement(); - } - private void ExportAssociation(XmlElement xn, AssociationInfo ai, string nodename) - { - /* - AssociationID - VersionID - ROFstID - Config - DTS - UserID - */ - lblExportStatus.Text = "Exporting Association..."; - Application.DoEvents(); - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "associationid", ai.AssociationID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "versionid", ai.VersionID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rofstid", ai.ROFstID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", ai.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ai.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ai.UserID.ToString())); - xn.AppendChild(xe); - ExportROFst(xe, ai.MyROFst, "rofst"); - } - private void ExportAssociation(AssociationInfo ai, string nodename) - { - /* - AssociationID - VersionID - ROFstID - Config - DTS - UserID - */ - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("associationid", ai.AssociationID.ToString()); - MyWriter.WriteAttributeString("versionid", ai.VersionID.ToString()); - MyWriter.WriteAttributeString("rofstid", ai.ROFstID.ToString()); - MyWriter.WriteAttributeString("config", ai.Config); - MyWriter.WriteAttributeString("dts", ai.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", ai.UserID.ToString()); - ExportROFst(ai.MyROFst, "rofst"); - MyWriter.WriteEndElement(); - } - private void ExportROFst(XmlElement xn, ROFstInfo fst, string nodename) - { - /* - ROFstID - RODbID - ROLookup - Config - DTS - UserID - */ - lblExportStatus.Text = "Exporting ROFst..."; - Application.DoEvents(); - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rofstid", fst.ROFstID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", fst.RODbID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rolookup", Convert.ToBase64String(fst.ROLookup))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", fst.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", fst.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", fst.UserID.ToString())); - xn.AppendChild(xe); - ExportFigures(xe, fst); - ExportRODb(xe, fst.MyRODb, "rodb"); - } - private void ExportROFst(ROFstInfo fst, string nodename) - { - /* - ROFstID - RODbID - ROLookup - Config - DTS - UserID - */ - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("rofstid", fst.ROFstID.ToString()); - MyWriter.WriteAttributeString("rodbid", fst.RODbID.ToString()); - MyWriter.WriteAttributeString("rolookup", Convert.ToBase64String(fst.ROLookup)); - MyWriter.WriteAttributeString("config", fst.Config); - MyWriter.WriteAttributeString("dts", fst.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", fst.UserID.ToString()); - ExportRODb(fst.MyRODb, "rodb"); - MyWriter.WriteEndElement(); - } - private void ExportFigures(XmlElement xn, ROFstInfo fst) - { - if (fst.ROFstFigureCount > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("figures"); - xn.AppendChild(xe); - foreach (FigureInfo figure in fst.ROFstFigures) - { - XmlElement xee = xn.OwnerDocument.CreateElement("figure"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "figureid", figure.FigureID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "rofstid", figure.ROFstID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "imageid", figure.ImageID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "config", figure.Config)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", figure.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", figure.UserID)); - xe.AppendChild(xee); - ExportROImage(xee, figure.MyROImage); - } - } - } - private void ExportROImage(XmlElement xn, ROImageInfo image) - { - XmlElement xe = xn.OwnerDocument.CreateElement("image"); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "imageid", image.ImageID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", image.RODbID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "filename", image.FileName)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "content", Convert.ToBase64String(image.Content))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", image.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", image.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", image.UserID)); - xn.AppendChild(xe); - } - private void ExportRODb(XmlElement xn, RODbInfo db, string nodename) - { - /* - RODbID - ROName - FolderPath - DBConnectionString - Config - DTS - UserID - */ - lblExportStatus.Text = "Exporting RODb..."; - Application.DoEvents(); - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", db.RODbID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "roname", db.ROName)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "folderpath", db.FolderPath)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dbconnectionstring", db.DBConnectionString)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", db.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", db.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", db.UserID.ToString())); - xn.AppendChild(xe); - } - private void ExportRODb(RODbInfo db, string nodename) - { - /* - RODbID - ROName - FolderPath - DBConnectionString - Config - DTS - UserID - */ - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("rodbid", db.RODbID.ToString()); - MyWriter.WriteAttributeString("roname", db.ROName); - MyWriter.WriteAttributeString("folderpath", db.FolderPath); - MyWriter.WriteAttributeString("dbconnectionstring", db.DBConnectionString); - MyWriter.WriteAttributeString("config", db.Config); - MyWriter.WriteAttributeString("dts", db.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", db.UserID.ToString()); - MyWriter.WriteEndElement(); - } - public void ExportItem(XmlDocument xd, ItemInfo ii, string nodename) - { - XmlElement xe = xd.CreateElement(nodename); - if (ii.IsProcedure) - { - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.RODbID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rofolderpath", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rofstid", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.ROFstID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rofstdts", ii.MyDocVersion.DocVersionAssociations[0].MyROFst.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - } - xd.AppendChild(xe); - ExportItem(xe, ii, nodename); - } - private void ExportItem(XmlElement xn, ItemInfo ii, string nodename) - { - /* - ItemID - PreviousID - ContentID - DTS - */ - XmlElement xe = null; - if (xn.Name == "procedure") - xe = xn; - else - { - xe = xn.OwnerDocument.CreateElement(nodename); - xn.AppendChild(xe); - } - if (ii.IsProcedure) - { - pbExportProcedure.PerformStep(); - lblExportProcedure.Text = string.Format("{0} of {1} Procedures", pbExportProcedure.Value.ToString(), pbExportProcedure.Maximum.ToString()); - TimeSpan elapsed = DateTime.Now.Subtract(MyStart); - lblExportTime.Text = "Elapsed Time: " + elapsed.ToString(); - Application.DoEvents(); - pbExportSection.Value = 0; - pbExportSection.Maximum = pbExportSection.Value; - pbExportStep.Value = 0; - pbExportStep.Maximum = pbExportStep.Value; - if(ii.Sections != null) - pbExportSection.Maximum = ii.Sections.Count; - else - { - pbExportSection.Maximum = 1; - pbExportSection.PerformStep(); - pbExportStep.Maximum = 1; - pbExportStep.PerformStep(); - lblExportSection.Text = "Sections"; - lblExportStep.Text = "Steps"; - Application.DoEvents(); - } - } - if (ii.IsSection && ii.ActiveParent.IsProcedure) - { - pbExportSection.PerformStep(); - lblExportSection.Text = string.Format("{0} of {1} Sections", pbExportSection.Value.ToString(), pbExportSection.Maximum.ToString()); - Application.DoEvents(); - pbExportStep.Value = 0; - pbExportStep.Maximum = pbExportStep.Value; - if (ii.Steps != null) - pbExportStep.Maximum = ii.Steps.Count; - else - { - pbExportStep.Maximum = 1; - pbExportStep.PerformStep(); - lblExportStep.Text = "Word Section Data"; - Application.DoEvents(); - } - } - if (ii.IsStep && ii.ActiveParent.IsSection && ii.ActiveParent.ActiveParent.IsProcedure) - { - pbExportStep.PerformStep(); - lblExportStep.Text = string.Format("{0} of {1} Steps", pbExportStep.Value.ToString(), pbExportStep.Maximum.ToString()); - Application.DoEvents(); - } - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "itemid", ii.ItemID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "previousid", ii.PreviousID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", ii.ContentID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ii.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - //item audits - ExportItemAudits(xe, ii); - ExportContent(xe, ii.MyContent, "content"); - if (ii.ItemAnnotationCount > 0) - foreach (AnnotationInfo ai in ii.ItemAnnotations) - ExportAnnotation(xe, ai, "annotation"); - } - private void ExportItemAudits(XmlElement xn, ItemInfo ii) - { - if (cbxExportAudits.Checked) - { - ItemAuditInfoList audits = ItemAuditInfoList.Get(ii.ItemID); - if (audits.Count > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("audits"); - foreach (ItemAuditInfo audit in audits) - { - if (audit.DeleteStatus == 0) - { - XmlElement xee = xn.OwnerDocument.CreateElement("audit"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "auditid", audit.AuditID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "contentid", audit.ContentID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "deletestatus", audit.DeleteStatus.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", audit.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "itemid", audit.ItemID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "previousid", audit.PreviousID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", audit.UserID)); - xe.AppendChild(xee); - } - } - xn.AppendChild(xe); - } - } - } - // used to save word sections with resolved ROs (export generated from Approve) - private Dictionary _DocReplace; - public Dictionary DocReplace - { - get { return _DocReplace; } - set - { - _DocReplace = value; - _ConvertROsAndTransitionsToText = (value != null); - } - } - private void ExportItem(ItemInfo ii, string nodename) - { - /* - ItemID - PreviousID - ContentID - DTS - */ - if (ii.IsProcedure) - { - pbExportProcedure.PerformStep(); - lblExportProcedure.Text = string.Format("{0} of {1} Procedures", pbExportProcedure.Value.ToString(), pbExportProcedure.Maximum.ToString()); - Application.DoEvents(); - pbExportSection.Value = 0; - pbExportStep.Value = 0; - pbExportSection.Maximum = ii.Sections.Count; - if (ii.Sections != null) - pbExportSection.Maximum = ii.Sections.Count; - else - { - pbExportSection.Maximum = 1; - pbExportSection.PerformStep(); - pbExportStep.Maximum = 1; - pbExportStep.PerformStep(); - lblExportSection.Text = "Sections"; - lblExportStep.Text = "Steps"; - Application.DoEvents(); - } - } - if (ii.IsSection) - { - pbExportSection.PerformStep(); - lblExportSection.Text = string.Format("{0} of {1} Sections", pbExportSection.Value.ToString(), pbExportSection.Maximum.ToString()); - Application.DoEvents(); - pbExportStep.Value = 0; - if (ii.Steps != null) - pbExportStep.Maximum = ii.Steps.Count; - else - { - pbExportStep.Maximum = 1; - pbExportStep.PerformStep(); - lblExportStep.Text = "Word Section Data"; - Application.DoEvents(); - } - } - if (ii.IsStep) - { - pbExportStep.PerformStep(); - lblExportStep.Text = string.Format("{0} of {1} Steps", pbExportStep.Value.ToString(), pbExportStep.Maximum.ToString()); - Application.DoEvents(); - } - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("itemid", ii.ItemID.ToString()); - MyWriter.WriteAttributeString("previousid", ii.PreviousID.ToString()); - MyWriter.WriteAttributeString("contentid", ii.ContentID.ToString()); - MyWriter.WriteAttributeString("dts", ii.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - ExportContent(ii.MyContent, "content"); - if (ii.ItemAnnotationCount > 0) - foreach (AnnotationInfo ai in ii.ItemAnnotations) - ExportAnnotation(ai, "annotation"); - MyWriter.WriteEndElement(); - } - private void ExportContent(XmlElement xn, ContentInfo ci, string nodename) - { - /* - ContentID - Number - Text - Type - FormatID - Config - DTS - UserID - */ - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - // strip the link information if we are convertingthe RO and Transitions to text - string ciText = (_ConvertROsAndTransitionsToText)?ItemInfo.StripLinks(ci.Text):ci.Text; - string formatFileName = (ci.MyFormat != null) ? ci.MyFormat.Name : ""; - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", ci.ContentID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "number", ci.Number)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "text", ciText)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "type", ci.Type.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatid", ci.FormatID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", ci.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ci.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ci.UserID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "formatfilename", formatFileName)); - //content audits - ExportContentAudits(xe, ci); - xn.AppendChild(xe); - if (ci.ContentTransitionCount > 0) - foreach (TransitionInfo ti in ci.ContentTransitions) - ExportTransition(xe, ti, "transition"); - if (ci.ContentRoUsageCount > 0) - foreach (RoUsageInfo ri in ci.ContentRoUsages) - ExportROUsage(xe, ri, "rousage"); - if (ci.ContentEntryCount > 0) - ExportEntry(xe, ci.MyEntry, "entry"); - if (ci.ContentGridCount > 0) - ExportGrid(xe, ci.MyGrid, "grid"); - if (ci.ContentPartCount > 0) - foreach (PartInfo pi in ci.ContentParts) - ExportPart(xe, pi, ((E_FromTypes)pi.FromType).ToString().ToLower()); - } - private void ExportContentAudits(XmlElement xn, ContentInfo ci) - { - if (cbxExportAudits.Checked) - { - ContentAuditInfoList audits = ContentAuditInfoList.Get(ci.ContentID); - if (audits.Count > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("audits"); - foreach (ContentAuditInfo audit in audits) - { - if (audit.DeleteStatus == 0) - { - XmlElement xee = xn.OwnerDocument.CreateElement("audit"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "auditid", audit.AuditID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "contentid", audit.ContentID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "number", audit.Number)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "text", audit.Text)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "type", audit.Type.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "formatid", audit.FormatID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "config", audit.Config)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", audit.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", audit.UserID)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "deletestatus", audit.DeleteStatus.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "actiondts", audit.ActionWhen.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.AppendChild(xee); - } - } - } - } - } - private void ExportContent(ContentInfo ci, string nodename) - { - /* - ContentID - Number - Text - Type - FormatID - Config - DTS - UserID - */ - // strip the link information if we are convertinga the ROs and Transitions to text - string ciText = (_ConvertROsAndTransitionsToText) ? ItemInfo.StripLinks(ci.Text) : ci.Text; - string formatFileName = (ci.MyFormat != null) ? ci.MyFormat.Name : ""; - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("contentid", ci.ContentID.ToString()); - MyWriter.WriteAttributeString("number", ci.Number); - MyWriter.WriteAttributeString("text", ciText); - MyWriter.WriteAttributeString("type", ci.Type.ToString()); - MyWriter.WriteAttributeString("formatid", ci.FormatID.ToString()); - MyWriter.WriteAttributeString("config", ci.Config); - MyWriter.WriteAttributeString("dts", ci.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", ci.UserID.ToString()); - MyWriter.WriteAttributeString("formatfilename", formatFileName); - if (ci.ContentTransitionCount > 0) - foreach (TransitionInfo ti in ci.ContentTransitions) - ExportTransition(ti, "transition"); - if (ci.ContentRoUsageCount > 0) - foreach (RoUsageInfo ri in ci.ContentRoUsages) - ExportROUsage(ri, "rousage"); - if (ci.ContentEntryCount > 0) - ExportEntry(ci.MyEntry, "entry"); - if (ci.ContentGridCount > 0) - ExportGrid(ci.MyGrid, "grid"); - if (ci.ContentPartCount > 0) - foreach (PartInfo pi in ci.ContentParts) - ExportPart(pi, ((E_FromTypes)pi.FromType).ToString().ToLower()); - MyWriter.WriteEndElement(); - } - private void ExportGrid(XmlElement xn, GridInfo gi, string nodename) - { - /* - ContentID - Data - Config - DTS - UserID - */ - string giData = gi.Data; - if (_ConvertROsAndTransitionsToText) - { - giData = giData.Replace("True", "False"); // converts a RO table to a unlinked regular table - giData = ItemInfo.StripLinks(giData); // this converts ROs and transitions to text - } - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", gi.ContentID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "data", giData)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", gi.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", gi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", gi.UserID.ToString())); - //grid audits - ExportGridAudits(xe, gi); - xn.AppendChild(xe); - } - private void ExportGridAudits(XmlElement xn, GridInfo gi) - { - if (cbxExportAudits.Checked) - { - GridAuditInfoList audits = GridAuditInfoList.Get(gi.ContentID); - if (audits.Count > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("audits"); - foreach (GridAuditInfo audit in audits) - { - if (audit.DeleteStatus == 0) - { - XmlElement xee = xn.OwnerDocument.CreateElement("audit"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "auditid", audit.AuditID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "contentid", audit.ContentID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "data", audit.Data)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "config", audit.Config)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", audit.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", audit.UserID)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "deletestatus", audit.DeleteStatus.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "contentauditid", audit.ContentAuditID.ToString())); - xe.AppendChild(xee); - - } - } - } - } - } - private void ExportGrid(GridInfo gi, string nodename) - { - /* - ContentID - Data - Config - DTS - UserID - */ - string giData = gi.Data; - if (_ConvertROsAndTransitionsToText) - { - giData = giData.Replace("IsRoTable>True", "IsRoTable>False"); // converts a RO table to regular table - giData = ItemInfo.StripLinks(giData); // converts ROs and Transitions to text - } - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("contentid", gi.ContentID.ToString()); - MyWriter.WriteAttributeString("data", giData); - MyWriter.WriteAttributeString("config", gi.Config); - MyWriter.WriteAttributeString("dts", gi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", gi.UserID.ToString()); - MyWriter.WriteEndElement(); - } - private void ExportEntry(XmlElement xn, EntryInfo ei, string nodename) - { - /* - ContentID - DocID - DTS - UserID - */ - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", ei.ContentID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "docid", ei.DocID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ei.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ei.UserID.ToString())); - //entry audits - ExportEntryAudits(xe, ei); - xn.AppendChild(xe); - ExportDocument(xe, ei.MyDocument, "document"); - } - private void ExportEntryAudits(XmlElement xn, EntryInfo ei) - { - if (cbxExportAudits.Checked) - { - EntryAuditInfoList audits = EntryAuditInfoList.Get(ei.ContentID); - if (audits.Count > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("audits"); - foreach (EntryAuditInfo audit in audits) - { - if (audit.DeleteStatus == 0) - { - XmlElement xee = xn.OwnerDocument.CreateElement("audit"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "auditid", audit.AuditID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "contentid", audit.ContentID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "docid", audit.DocID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", audit.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", audit.UserID)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "deletestatus", audit.DeleteStatus.ToString())); - xe.AppendChild(xee); - } - } - } - } - } - private void ExportEntry(EntryInfo ei, string nodename) - { - /* - ContentID - DocID - DTS - UserID - */ - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("contentid", ei.ContentID.ToString()); - MyWriter.WriteAttributeString("docid", ei.DocID.ToString()); - MyWriter.WriteAttributeString("dts", ei.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", ei.UserID.ToString()); - ExportDocument(ei.MyDocument, "document"); - MyWriter.WriteEndElement(); - } - private void ExportDocument(XmlElement xn, DocumentInfo di, string nodename) - { - /* - DocID - LibTitle - DocContent - DocAscii - Config - DTS - UserID - FileExtension - */ - byte[] buf = di.DocContent; - string libDocTitle = di.LibTitle; - if (DocReplace != null && DocReplace.ContainsKey(di.DocID) && _ConvertROsAndTransitionsToText) - { - buf = DocReplace[di.DocID]; - libDocTitle = null; // unlink the word section from the library document - } - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "docid", di.DocID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "libtitle", libDocTitle)); // di.LibTitle)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "doccontent", Convert.ToBase64String(buf))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "docascii", di.DocAscii)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", di.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", di.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", di.UserID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "fileextension", di.FileExtension)); - //document audits - ExportDocumentAudits(xe, di); - xn.AppendChild(xe); - } - private void ExportDocumentAudits(XmlElement xn, DocumentInfo di) - { - if (cbxExportAudits.Checked) - { - DocumentAuditInfoList audits = DocumentAuditInfoList.Get(di.DocID); - if (audits.Count > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("audits"); - foreach (DocumentAuditInfo audit in audits) - { - if (audit.DeleteStatus == 0) - { - XmlElement xee = xn.OwnerDocument.CreateElement("audit"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "auditid", audit.AuditID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "docid", audit.DocID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "libtitle", audit.LibTitle)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "doccontent",Convert.ToBase64String(audit.DocContent))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "docascii", audit.DocAscii)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "config", audit.Config)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", audit.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", audit.UserID)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "fileextension", audit.FileExtension)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "deletestatus", audit.DeleteStatus.ToString())); - xe.AppendChild(xee); - } - } - } - } - } - private void ExportDocument(DocumentInfo di, string nodename) - { - /* - DocID - LibTitle - DocContent - DocAscii - Config - DTS - UserID - FileExtension - */ - byte[] buf = di.DocContent; - string libDocTitle = di.LibTitle; - if (DocReplace != null && DocReplace.ContainsKey(di.DocID) && _ConvertROsAndTransitionsToText) - { - buf = DocReplace[di.DocID]; - libDocTitle = null; // unlink the word section from the library document - } - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("docid", di.DocID.ToString()); - MyWriter.WriteAttributeString("libtitle", libDocTitle);// di.LibTitle); - MyWriter.WriteAttributeString("doccontent", Convert.ToBase64String(buf)); - MyWriter.WriteAttributeString("docascii", di.DocAscii); - MyWriter.WriteAttributeString("config", di.Config); - MyWriter.WriteAttributeString("dts", di.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", di.UserID.ToString()); - MyWriter.WriteAttributeString("fileextension", di.FileExtension); - MyWriter.WriteEndElement(); - } - private void ExportROUsage(XmlElement xn, RoUsageInfo ri, string nodename) - { - /* - ROUsageID - ContentID - ROID - Config - DTS - UserID - RODbID - */ - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rousageid", ri.ROUsageID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", ri.ContentID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "roid", ri.ROID)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", ri.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ri.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ri.UserID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rodbid", ri.RODbID.ToString())); - //rousage audits - ExportROUsageAudits(xe, ri); - xn.AppendChild(xe); - } - private void ExportROUsageAudits(XmlElement xe, RoUsageInfo ri) - { - if (cbxExportAudits.Checked) - { - } - } - private void ExportROUsage(RoUsageInfo ri, string nodename) - { - /* - ROUsageID - ContentID - ROID - Config - DTS - UserID - RODbID - */ - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("rousageid", ri.ROUsageID.ToString()); - MyWriter.WriteAttributeString("contentid", ri.ContentID.ToString()); - MyWriter.WriteAttributeString("roid", ri.ROID); - MyWriter.WriteAttributeString("config", ri.Config); - MyWriter.WriteAttributeString("dts", ri.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", ri.UserID.ToString()); - MyWriter.WriteAttributeString("rodbid", ri.RODbID.ToString()); - MyWriter.WriteEndElement(); - } - private void ExportPart(XmlElement xn, PartInfo pi, string nodename) - { - /* - ContentID - FromType - ItemID - DTS - UserID - */ - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "contentid", pi.ContentID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "fromtype", pi.FromType.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "itemid", pi.ItemID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", pi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", pi.UserID.ToString())); - //part audits - ExportPartAudits(xe, pi); - xn.AppendChild(xe); - foreach (ItemInfo ii in pi.MyItems) - ExportItem(xe, ii, pi.PartType.ToString().ToLower()); - } - private void ExportPartAudits(XmlElement xn, PartInfo pi) - { - if (cbxExportAudits.Checked) - { - PartAuditInfoList audits = PartAuditInfoList.Get(pi.ContentID); - if (audits.Count > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("audits"); - foreach (PartAuditInfo audit in audits) - { - if (audit.DeleteStatus == 0) - { - XmlElement xee = xn.OwnerDocument.CreateElement("audit"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "auditid", audit.AuditID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "contentid", audit.ContentID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "fromtype", audit.FromType.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "itemid", audit.ItemID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", audit.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", audit.UserID)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "deletestatus", audit.DeleteStatus.ToString())); - xe.AppendChild(xee); - } - } - } - } - } - private void ExportPart(PartInfo pi, string nodename) - { - /* - ContentID - FromType - ItemID - DTS - UserID - */ - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("contentid", pi.ContentID.ToString()); - MyWriter.WriteAttributeString("fromtype", pi.FromType.ToString()); - MyWriter.WriteAttributeString("itemid", pi.ItemID.ToString()); - MyWriter.WriteAttributeString("dts", pi.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", pi.UserID.ToString()); - foreach (ItemInfo ii in pi.MyItems) - ExportItem(ii, pi.PartType.ToString().ToLower()); - MyWriter.WriteEndElement(); - } - private void ExportTransition(XmlElement xn, TransitionInfo ti, string nodename) - { - /* - TransitionID - FromID - ToID - RangeID - IsRange - TranType - Config - DTS - UserID - */ - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "transitionid", ti.TransitionID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "fromid", ti.FromID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "toid", ti.ToID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rangeid", ti.RangeID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "isrange", ti.IsRange.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "trantype", ti.TranType.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", ti.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ti.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ti.UserID.ToString())); - //transition audits - ExportTransitionAudits(xe, ti); - xn.AppendChild(xe); - } - private void ExportTransitionAudits(XmlElement xe, TransitionInfo ti) - { - if (cbxExportAudits.Checked) - { - } - } - private void ExportTransition(TransitionInfo ti, string nodename) - { - /* - TransitionID - FromID - ToID - RangeID - IsRange - TranType - Config - DTS - UserID - */ - string folder = string.Empty; - if (ti.MyItemToID.MyDocVersion != null && ti.MyItemToID.MyDocVersion.MyFolder.Name != MyFolder.Name) - { - nodename = "external" + nodename; - folder = ti.MyItemToID.MyDocVersion.MyFolder.Name; - } - else - { - nodename = "external" + nodename; - folder = "UNKNOWN"; - } - MyWriter.WriteStartElement(nodename); - if (folder != string.Empty) - MyWriter.WriteAttributeString("folder", folder); - MyWriter.WriteAttributeString("transitionid", ti.TransitionID.ToString()); - MyWriter.WriteAttributeString("fromid", ti.FromID.ToString()); - MyWriter.WriteAttributeString("toid", ti.ToID.ToString()); - MyWriter.WriteAttributeString("rangeid", ti.RangeID.ToString()); - MyWriter.WriteAttributeString("isrange", ti.IsRange.ToString()); - MyWriter.WriteAttributeString("trantype", ti.TranType.ToString()); - MyWriter.WriteAttributeString("config", ti.Config); - MyWriter.WriteAttributeString("dts", ti.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", ti.UserID.ToString()); - MyWriter.WriteEndElement(); - } - private void ExportAnnotation(XmlElement xn, AnnotationInfo ai, string nodename) - { - /* - AnnotationID - ItemID - TypeID - RtfText - SearchText - Config - DTS - UserID - */ - XmlElement xe = xn.OwnerDocument.CreateElement(nodename); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "annotationid", ai.AnnotationID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "itemid", ai.ItemID.ToString())); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "typeid", ai.TypeID.ToString())); - //if(ai.TypeID > 6) - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "typename", ai.MyAnnotationType.Name)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "rtftext", ai.RtfText)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "searchtext", ai.SearchText)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "config", ai.Config)); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "dts", ai.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.Attributes.SetNamedItem(AddAttribute(xe.OwnerDocument, "userid", ai.UserID.ToString())); - //annotation audits - ExportAnnotationAudits(xe, ai); - xn.AppendChild(xe); - } - private void ExportAnnotationAudits(XmlElement xn, AnnotationInfo ai) - { - if (cbxExportAudits.Checked) - { - AnnotationAuditInfoList audits = AnnotationAuditInfoList.GetByAnnotationID(ai.AnnotationID); - if (audits.Count > 0) - { - XmlElement xe = xn.OwnerDocument.CreateElement("audits"); - foreach (AnnotationAuditInfo audit in audits) - { - if (audit.DeleteStatus == 0) - { - XmlElement xee = xn.OwnerDocument.CreateElement("audit"); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "auditid", audit.AuditID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "annotationid", audit.AnnotationID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "itemid", audit.ItemID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "typeid", audit.TypeID.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "rtftext", audit.RtfText)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "searchtext", audit.SearchText)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "config", audit.Config)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "deletestatus", audit.DeleteStatus.ToString())); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "dts", audit.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "userid", audit.UserID)); - xee.Attributes.SetNamedItem(AddAttribute(xee.OwnerDocument, "actiondts", audit.ActionWhen.ToString("MM/dd/yyyy HH:mm:ss.fff"))); - xe.AppendChild(xee); - } - } - xn.AppendChild(xe); - } - } - } - private void ExportAnnotation(AnnotationInfo ai, string nodename) - { - /* - AnnotationID - ItemID - TypeID - RtfText - SearchText - Config - DTS - UserID - */ - MyWriter.WriteStartElement(nodename); - MyWriter.WriteAttributeString("annotationid", ai.AnnotationID.ToString()); - MyWriter.WriteAttributeString("itemid", ai.ItemID.ToString()); - MyWriter.WriteAttributeString("typeid", ai.TypeID.ToString()); - MyWriter.WriteAttributeString("rtftext", ai.RtfText); - MyWriter.WriteAttributeString("searchtext", ai.SearchText); - MyWriter.WriteAttributeString("config", ai.Config); - MyWriter.WriteAttributeString("dts", ai.DTS.ToString("MM/dd/yyyy HH:mm:ss.fff")); - MyWriter.WriteAttributeString("userid", ai.UserID.ToString()); - MyWriter.WriteEndElement(); - } - #endregion - #region Import for Merge - - // jsj 4-29-2016 appears to not be used - //private void AddExternalTransition(XmlReader xr, XmlDocument xd) - //{ - // XmlElement xe = xd.CreateElement("transition"); - // XmlAttribute xa = AddAttribute(xd, "folder", xr.GetAttribute("folder")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "transitionid", xr.GetAttribute("transitionid")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "fromid", xr.GetAttribute("fromid")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "toid", xr.GetAttribute("toid")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "rangeid", xr.GetAttribute("rangeid")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "isrange", xr.GetAttribute("isrange")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "trantype", xr.GetAttribute("trantype")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "config", xr.GetAttribute("config")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "userid", xr.GetAttribute("userid")); - // xe.Attributes.SetNamedItem(xa); - // xa = AddAttribute(xd, "dts", xr.GetAttribute("dts")); - // xe.Attributes.SetNamedItem(xa); - // xd.SelectSingleNode("externaltransitions/transitions").AppendChild(xe); - //} - - // jsj 4-29-2016 appears to not be used - //private void AddTransitions(XmlReader xr) - //{ - // int transitionid = int.Parse(xr.GetAttribute("transitionid")); - // int fromid = int.Parse(xr.GetAttribute("fromid")); - // int toid = int.Parse(xr.GetAttribute("toid")); - // int rangeid = int.Parse(xr.GetAttribute("rangeid")); - // int isrange = int.Parse(xr.GetAttribute("isrange")); - // int trantype = int.Parse(xr.GetAttribute("trantype")); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // string lookfor; - // if (isrange == 0) - // lookfor = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - // else - // lookfor = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - // fromid = Old2NewContent[fromid]; - // toid = Old2NewItem[toid]; - // rangeid = Old2NewItem[rangeid]; - // Content cc = Content.Get(fromid); - // Transition tt = Transition.MakeTransition(cc, Item.Get(toid), Item.Get(rangeid), isrange, trantype, config, dts, userid); - // transitionid = tt.TransitionID; - // string replacewith; - // if (isrange == 0) - // replacewith = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - // else - // replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - // cc.Text = cc.Text.Replace(lookfor, replacewith); - // cc.Save(); - //} - - private void AddTransitions(Content content, XmlNode xn) - { - /* - Content - Item - Item - int - int - string - dts - string - - - #Link:Transition:1 2 187 - type,id,toid - - #Link:TransitionRange:2 1 175 177 - type,id,toid,rangeid - */ - XmlNodeList nl = xn.SelectNodes("./transition"); - foreach (XmlNode nd in nl) - { - int toid = int.Parse(nd.Attributes.GetNamedItem("toid").InnerText); - int rangeid = int.Parse(nd.Attributes.GetNamedItem("rangeid").InnerText); - if (Old2NewItem.ContainsKey(toid) && Old2NewItem.ContainsKey(rangeid)) - { - int transitionid = int.Parse(nd.Attributes.GetNamedItem("transitionid").InnerText); - int isrange = int.Parse(nd.Attributes.GetNamedItem("isrange").InnerText); - int trantype = int.Parse(nd.Attributes.GetNamedItem("trantype").InnerText); - string config = nd.Attributes.GetNamedItem("config").InnerText; - string userid = nd.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - string lookfor; - if (isrange == 0) - lookfor = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - else - lookfor = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - //fromid = content.ContentID; - toid = Old2NewItem[toid]; - rangeid = Old2NewItem[rangeid]; - Transition tt = Transition.MakeTransition(content, Item.Get(toid), Item.Get(rangeid), isrange, trantype, config, dts, userid); - transitionid = tt.TransitionID; - string replacewith; - if (isrange == 0) - replacewith = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - else - replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - content.Text = content.Text.Replace(lookfor, replacewith); - content.FixTransitionText(TransitionInfo.Get(tt.TransitionID)); - content.Save(); - } - else - { - PendingTransitions.DocumentElement.AppendChild(PendingTransitions.ImportNode(nd, true)); - //save to holding pen - } - } - } - private void AddTransitions() - { - AddTransitions(PendingTransitions); - } - private void AddTransitions(XmlDocument xd) - { - /* - Content - Item - Item - int - int - string - dts - string - - - #Link:Transition:1 2 187 - type,id,toid - - #Link:TransitionRange:2 1 175 177 - type,id,toid,rangeid - */ - XmlNodeList nl = xd.SelectNodes("//transition"); - lblImportStatus.Text = string.Format("Updating {0} Tranistions", nl.Count.ToString()); - int cnt = 0; - foreach (XmlNode nd in nl) - { - int fromid = int.Parse(nd.Attributes.GetNamedItem("fromid").InnerText); - int toid = int.Parse(nd.Attributes.GetNamedItem("toid").InnerText); - int rangeid = int.Parse(nd.Attributes.GetNamedItem("rangeid").InnerText); - int trantype = int.Parse(nd.Attributes.GetNamedItem("trantype").InnerText); - { - if (Old2NewItem.ContainsKey(toid) && Old2NewItem.ContainsKey(rangeid)) //transition to new itemid (internal) - { - int transitionid = int.Parse(nd.Attributes.GetNamedItem("transitionid").InnerText); - int isrange = int.Parse(nd.Attributes.GetNamedItem("isrange").InnerText); - string config = nd.Attributes.GetNamedItem("config").InnerText; - string userid = nd.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - string lookfor; - if (isrange == 0) - lookfor = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - else - lookfor = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - fromid = Old2NewContent[fromid]; - toid = Old2NewItem[toid]; - rangeid = Old2NewItem[rangeid]; - Content cc = Content.Get(fromid); - Transition tt = Transition.MakeTransition(cc, Item.Get(toid), Item.Get(rangeid), isrange, trantype, config, dts, userid); - transitionid = tt.TransitionID; - string replacewith; - if (isrange == 0) - replacewith = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - else - replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - cc.Text = cc.Text.Replace(lookfor, replacewith); - bool forceConvertToText = false; - if (TransitionInfo.Get(tt.TransitionID).MyItemToID.ActiveSection != null) - { - SectionConfig sc = TransitionInfo.Get(tt.TransitionID).MyItemToID.ActiveSection.MyConfig as SectionConfig; - forceConvertToText = (sc.SubSection_Edit == "N"); - } - cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText); - cc.Save(); - nd.InnerText = "done"; - } - else //transition to existing itemid (external) - { - bool forceConvertToText = false; - int transitionid = int.Parse(nd.Attributes.GetNamedItem("transitionid").InnerText); - int isrange = int.Parse(nd.Attributes.GetNamedItem("isrange").InnerText); - string config = nd.Attributes.GetNamedItem("config").InnerText; - string userid = nd.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - string lookfor; - if (isrange == 0) - lookfor = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - else - lookfor = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - fromid = Old2NewContent[fromid]; - //toid = Old2NewItem[toid]; - //rangeid = Old2NewItem[rangeid]; - Content cc = Content.Get(fromid); - Transition tt = Transition.MakeTransition(cc, Item.Get(toid), Item.Get(rangeid), isrange, trantype, config, dts, userid); - if (tt.TransitionID < 0) - { - forceConvertToText = true; - cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText); - cc.Save(); - nd.InnerText = "done"; - } - else - { - transitionid = tt.TransitionID; - string replacewith; - if (isrange == 0) - replacewith = string.Format("#Link:Transition:{0} {1} {2}", trantype, transitionid, toid); - else - replacewith = string.Format("#Link:TransitionRange:{0} {1} {2} {3}", trantype, transitionid, toid, rangeid); - cc.Text = cc.Text.Replace(lookfor, replacewith); - if (TransitionInfo.Get(tt.TransitionID).MyItemToID.ActiveSection != null) - { - SectionConfig sc = TransitionInfo.Get(tt.TransitionID).MyItemToID.ActiveSection.MyConfig as SectionConfig; - forceConvertToText = (sc.SubSection_Edit == "N"); - } - if (!forceConvertToText) //check to see if external with internal format - { - TransitionInfo tran = TransitionInfo.Get(transitionid); - if (tran.MyContent.ContentItems[0].MyProcedure.ItemID != tran.MyItemToID.MyProcedure.ItemID) - if (!tran.MyContent.ContentItems[0].ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[tran.TranType].TransMenu.Contains("Proc")) - forceConvertToText = true; - } - if (!forceConvertToText) //check to see if external to different doc version - { - TransitionInfo tran = TransitionInfo.Get(transitionid); - if (tran.MyContent.ContentItems[0].MyDocVersion.VersionID != tran.MyItemToID.MyDocVersion.VersionID) - forceConvertToText = true; - } - cc.FixTransitionText(TransitionInfo.Get(tt.TransitionID), forceConvertToText); - cc.Save(); - nd.InnerText = "done"; - } - } - } - } - } - - private Dictionary Old2NewItem; - private Dictionary Old2NewContent; - private Dictionary Old2NewLibDoc; - private XmlDocument PendingTransitions; - private RODb MyRODb = null; - - // jsj 4-29-2016 appears to not be used - //private Folder AddFolder(Folder folder, XmlReader xr) - //{ - // Old2NewItem = new Dictionary(); - // Old2NewContent = new Dictionary(); - // Old2NewLibDoc = new Dictionary(); - // string title = xr.GetAttribute("title"); - // string name = xr.GetAttribute("name"); - // string shortname = xr.GetAttribute("shortname"); - // string usrid = xr.GetAttribute("usrid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // string formatid = xr.GetAttribute("formatid"); - // string formatfilename = xr.GetAttribute("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - // Format format = formatid == string.Empty ? null : OldToNewFormat(int.Parse(formatid),formatfilename); - // folder = Folder.MakeFolder(folder, folder.MyConnection, name, title, shortname, format, null, dts, usrid); - // //f.Save(); - // return folder; - //} - - private Folder AddFolder(Folder p, XmlDocument xd) - { - lblImportStatus.Text = "Creating Folder..."; - Application.DoEvents(); - string title = xd.DocumentElement.Attributes.GetNamedItem("title").InnerText; - string name = xd.DocumentElement.Attributes.GetNamedItem("name").InnerText; - string shortname = xd.DocumentElement.Attributes.GetNamedItem("shortname").InnerText; - string usrid = xd.DocumentElement.Attributes.GetNamedItem("usrid").InnerText; - DateTime dts = DateTime.Parse(xd.DocumentElement.Attributes.GetNamedItem("dts").InnerText); - string formatid = xd.DocumentElement.Attributes.GetNamedItem("formatid").InnerText; - XmlNode fnNode = xd.DocumentElement.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - Format format = formatid == string.Empty ? null : OldToNewFormat(int.Parse(formatid),formatfilename); - if (Folder.GetByParentID_Name(p.FolderID, name) != null) - return null; - Folder f = Folder.MakeFolder(p, p.MyConnection, name, title, shortname, format, null, dts, usrid); - return f; - } - private Format OldToNewFormat(int formatID, string formatFileName) - { - try - { - string formatName = formatFileName; // B2016-103, new export files include the format filename use that if it exists - if (formatFileName == string.Empty) - { - if (formatID >= oldFormat.Count) return null; // formatID not found, use default file name - formatName = oldFormat[formatID]; // for backwards compatibility with older export files - } - formatID = newFormat[formatName]; - return Format.Get(formatID); - } - catch - { - return null; // format not found return null to use default format - } - } - private DocVersion AddDocVersion(Folder f, XmlReader xr) - { - int versiontype = int.Parse(xr.GetAttribute("versiontype")); - string name = xr.GetAttribute("name"); - string config = xr.GetAttribute("config"); - string userid = xr.GetAttribute("userid"); - DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - string formatid = xr.GetAttribute("formatid"); - string formatfilename = xr.GetAttribute("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - Format format = formatid == string.Empty ? null : OldToNewFormat(int.Parse(formatid),formatfilename); - DocVersion dv = DocVersion.MakeDocVersion(f, versiontype, name, null, null, format, config, dts, userid); - return dv; - } - private void AddAnnotationTypes(XmlDocument xd) - { - XmlNodeList nl = xd.SelectNodes("folder/annotationtypes/annotationtype"); - foreach (XmlNode nd in nl) - { - AnnotationTypeInfo ati = AnnotationTypeInfo.GetByName(nd.Attributes.GetNamedItem("name").InnerText); - if (ati == null) - AnnotationType.MakeAnnotationType(nd.Attributes.GetNamedItem("name").InnerText, nd.Attributes.GetNamedItem("config").InnerText, DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText), nd.Attributes.GetNamedItem("userid").InnerText); - } - } - private DocVersionInfo AddDocVersion(Folder f, XmlDocument xd) - { - lblImportStatus.Text = "Creating DocVersion..."; - Application.DoEvents(); - XmlElement xe = (XmlElement)xd.SelectSingleNode("folder/docversion"); - int versiontype = int.Parse(xe.Attributes.GetNamedItem("versiontype").InnerText); - string name = xe.Attributes.GetNamedItem("name").InnerText; - string config = xe.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - string userid = xe.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xe.Attributes.GetNamedItem("dts").InnerText); - string formatid = xe.Attributes.GetNamedItem("formatid").InnerText; - XmlNode fnNode = xe.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - Format format = formatid == string.Empty ? null : OldToNewFormat(int.Parse(formatid),formatfilename); - DocVersion dv = DocVersion.MakeDocVersion(f, versiontype, name, null, null, format, config, dts, userid); - XmlNode xassoc = xe.SelectSingleNode("association"); - if (xassoc != null) - { - XmlNode xrofst = xassoc.SelectSingleNode("rofst"); - XmlNode xrodb = xrofst.SelectSingleNode("rodb"); - MyRODb = AddRODb(xrodb); - ROFst rofst = AddROFst(xrofst); - DocVersionAssociation dva = dv.DocVersionAssociations.Add(rofst); - dv.Save(); - } - return DocVersionInfo.Get(dv.VersionID); - } - - // jsj 4-29-2016 appears to not be used - //private Dictionary GetROFstData(XmlReader xr) - //{ - // Dictionary rv = new Dictionary(); - // rv.Add("rolookup", xr.GetAttribute("rolookup")); - // rv.Add("config", xr.GetAttribute("config")); - // rv.Add("userid", xr.GetAttribute("userid")); - // rv.Add("dts", xr.GetAttribute("dts")); - // return rv; - //} - - // jsj 4-29-2016 appears to not be used - //private ROFst AddROFst(Dictionary dic) - //{ - // byte[] rolookup = Convert.FromBase64String(dic["rolookup"]); - // string config = dic["config"]; - // string userid = dic["userid"]; - // DateTime dts = DateTime.Parse(dic["dts"]); - // ROFst rv = null; - // rv = ROFst.GetByRODbID_DTS(MyRODb.RODbID, dts); //MyRODb.DTS); - // if (rv == null) - // rv = ROFst.MakeROFst(MyRODb, rolookup, config, dts, userid); - // return rv; - //} - - private ROFst AddROFst(XmlNode xrofst) - { - lblImportStatus.Text = "Creating ROFst..."; - Application.DoEvents(); - byte[] rolookup = Convert.FromBase64String(xrofst.Attributes.GetNamedItem("rolookup").InnerText); - string config = xrofst.Attributes.GetNamedItem("config").InnerText; - string userid = xrofst.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xrofst.Attributes.GetNamedItem("dts").InnerText); - ROFst rv = null; - rv = ROFst.GetByRODbID_DTS(MyRODb.RODbID, dts); - // if the RO database is not found in the current data (does not have the same RODBid nor date/time stamp - // then spin through the list of RO databases and compare the FST information. - // If the RO FST information is the same, then use that current RO database when importing - if (rv == null) - { - RODbInfoList rodblst = RODbInfoList.Get(); - foreach (RODbInfo roinfo in rodblst) - { - rv = ROFst.GetByRODbID_DTS(roinfo.RODbID, dts); - if (rv != null && Same(rv.ROLookup,rolookup)) return rv; - } - rv = ROFst.MakeROFst(MyRODb, rolookup, config, dts, userid); - XmlNode xfigures = xrofst.SelectSingleNode("figures"); - if (xfigures != null) - AddFigures(xfigures, rv); - } - return rv; - } - - private bool Same(byte[] p, byte[] rolookup) - { - if (p.Length != rolookup.Length) return false; - for (int i = 0; i < p.Length; i++) - if (p[i] != rolookup[i]) return false; - return true; - } - - private void AddFigures(XmlNode xfigures, ROFst rofst) - { - foreach (XmlNode nd in xfigures.SelectNodes("figure")) - { - XmlNode image = nd.SelectSingleNode("image"); - int imageid = int.Parse(image.Attributes.GetNamedItem("imageid").InnerText); - ROImage roimage = ROImage.Get(imageid); - string config; - DateTime dts; - string userid; - if (roimage == null) - { - string filename = image.Attributes.GetNamedItem("filename").InnerText; - byte[] content = Convert.FromBase64String(image.Attributes.GetNamedItem("content").InnerText); - config = image.Attributes.GetNamedItem("config").InnerText; - dts = DateTime.Parse(image.Attributes.GetNamedItem("dts").InnerText); - userid = image.Attributes.GetNamedItem("userid").InnerText; - roimage = ROImage.MakeROImage(MyRODb, filename, content, config, dts, userid); - } - config = nd.Attributes.GetNamedItem("config").InnerText; - dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - userid = nd.Attributes.GetNamedItem("userid").InnerText; - Figure fig = Figure.MakeFigure(rofst, roimage, config, dts, userid); - } - } - - // jsj 4-29-2016 appears to not be used - //private RODb AddRODb(XmlReader xr) - //{ - // oldRODbID = int.Parse(xr.GetAttribute("rodbid")); - // string roname = xr.GetAttribute("roname"); - // string folderpath = xr.GetAttribute("folderpath"); - // string dbconnectionstring = xr.GetAttribute("dbconnectionstring"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // RODb rv = null; - // rv = RODb.GetByFolderPath(folderpath); - // if (rv == null) - // rv = RODb.MakeRODb(roname, folderpath, dbconnectionstring, config, dts, userid); - // newRODbID = rv.RODbID; - // return rv; - //} - - private RODb AddRODb(XmlNode xrodb) - { - lblImportStatus.Text = "Creating RODb..."; - Application.DoEvents(); - oldRODbID = int.Parse(xrodb.Attributes.GetNamedItem("rodbid").InnerText); - string roname = xrodb.Attributes.GetNamedItem("roname").InnerText; - string folderpath = xrodb.Attributes.GetNamedItem("folderpath").InnerText; - string dbconnectionstring = xrodb.Attributes.GetNamedItem("dbconnectionstring").InnerText; - string config = xrodb.Attributes.GetNamedItem("config").InnerText; - string userid = xrodb.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xrodb.Attributes.GetNamedItem("dts").InnerText); - RODb rv = null; - rv = RODb.GetByFolderPath(folderpath); - if (rv == null) - { - // create a list of the RO databases currently in the database - List roDbNameList = new List(); - RODbInfoList rolist = RODbInfoList.Get(); - foreach (RODbInfo rodbinfo in rolist) - { - if (!roDbNameList.Contains(rodbinfo.ROName)) - roDbNameList.Add(rodbinfo.ROName); - } - rolist.Dispose(); - int cnt = 0; - string roNameNew = roname; - // if the ROname we are importing is the same as one already in the database - // and the ROpaths are different, then rename the one we are importing - while (roDbNameList.Contains(roNameNew)) - roNameNew = string.Format("{0}_{1}",roname,(++cnt).ToString()); - rv = RODb.MakeRODb(roNameNew, folderpath, dbconnectionstring, config, dts, userid); - } - newRODbID = rv.RODbID; - return rv; - } - - // jsj 4-29-2016 appears to not be used - //private int GetProcedureData(XmlReader xr) - //{ - // return int.Parse(xr.GetAttribute("itemid")); - //} - - // jsj 4-29-2016 appears to not be used - //private ItemInfo AddProcedure(XmlReader xr, DocVersion dv, ItemInfo procInfo, int oldid) - //{ - // DocVersionInfo dvInfo = DocVersionInfo.Get(dv.VersionID); - // string number = xr.GetAttribute("number"); - // string text = xr.GetAttribute("text"); - // int proctype = int.Parse(xr.GetAttribute("type")); - // string formatid = xr.GetAttribute("formatid"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Procedure p = Procedure.MakeProcedure(dvInfo, procInfo, number, text, proctype); - // p.DTS = dts; - // p.UserID = userid; - // string formatfilename = xr.GetAttribute("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - // if (formatid != string.Empty) - // p.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid),formatfilename); - // p.MyContent.Config = config; - // p.MyContent.DTS = dts; - // p.MyContent.UserID = userid; - // p.Save(); - // Old2NewItem.Add(oldid, p.ItemID); - // Old2NewContent.Add(int.Parse(xr.GetAttribute("contentid")), p.MyContent.ContentID); - // procInfo = ProcedureInfo.Get(p.ItemID); - // return procInfo; - //} - private ProcedureInfo AddProcedure(XmlNode xn, DocVersionInfo dvInfo, ProcedureInfo procInfo) - { - pbImportProcedure.PerformStep(); - lblImportProcedure.Text = string.Format("{0} of {1} Procedures", pbImportProcedure.Value.ToString(), pbImportProcedure.Maximum.ToString()); - TimeSpan elapsed = DateTime.Now.Subtract(MyStart); - lblImportTime.Text = "Elapsed Time: " + elapsed.ToString(); - Application.DoEvents(); - XmlNode xc = xn.SelectSingleNode("content"); - string number = xc.Attributes.GetNamedItem("number").InnerText; - string text = xc.Attributes.GetNamedItem("text").InnerText; - int proctype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); - string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; - string config = xc.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - string userid = xc.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); - Procedure p = Procedure.MakeProcedure(dvInfo, procInfo, number, text, proctype); - p.DTS = dts; - p.UserID = userid; - // check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute) - XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode !=null)? fnNode.InnerText : ""; - if (formatid != string.Empty) - p.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid),formatfilename); - p.MyContent.Config = config; - p.MyContent.DTS = dts; - p.MyContent.UserID = userid; - p.Save(); - if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText))) - Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), p.ItemID); - if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText))) - Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), p.MyContent.ContentID); - if (xn.SelectNodes("annotation").Count > 0) - AddAnnotations(p.ItemID, xn); - if (xc.SelectNodes("rousage").Count > 0) - AddROUsages(p.MyContent, xc); - if (xc.SelectNodes("transition").Count > 0) - AddTransitions(p.MyContent, xc); - procInfo = ProcedureInfo.Get(p.ItemID); - if (xc.HasChildNodes) - AddParts(xc, procInfo); - FixSectionStart(procInfo); - return procInfo; - } - // jsj 2016Feb16 - This appears to not be used - //private void AddROUsage(XmlReader xr) - //{ - // int contentid = int.Parse(xr.GetAttribute("contentid")); - // contentid = Old2NewContent[contentid]; - // Content content = Content.Get(contentid); - // string rousageid = xr.GetAttribute("rousageid"); - // string roid = xr.GetAttribute("roid"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // RoUsage rou = RoUsage.MakeRoUsage(content, roid, config, dts, userid, MyRODb); - // rou.Save(); - // string lookFor = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rousageid, roid, oldRODbID.ToString()); - // string replaceWith = (cbxCvrtROsToText.Checked) ? "" : string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rou.ROUsageID.ToString(), roid, newRODbID.ToString()); - // if (lookFor != replaceWith) - // { - // content.Text = content.Text.Replace(lookFor, replaceWith); - // content.Save(); - // } - //} - private string GetMyPrefix(string text, int start, int lastIndex) - { - string defPrefix = text.Substring(start - 3, 3); - if (defPrefix != @"\v ") throw new Exception(string.Format("rtf string {0} does not match expected format", defPrefix)); - string txt = text.Substring(lastIndex, start - lastIndex - 3); - int lastSlash = txt.LastIndexOf(@"\"); - int lastSpace = txt.LastIndexOf(" "); - int lastCR = txt.LastIndexOf("\r"); - if (lastSpace < lastCR) - lastSpace = lastCR; - if (lastSlash <= lastSpace) //this will return "\v " - return defPrefix; - txt = txt.Substring(lastSlash); - if (txt.StartsWith(@"\'")) //this is a hex - return defPrefix; - if (Regex.IsMatch(txt, @"\\u[0-9].*")) //this is unicode - return defPrefix; - return @"\v"; - } - private string GetMySuffix(string text, int start) - { - string txt = text.Substring(start); - int firstSlashVeeZero = txt.IndexOf(@"\v0"); - if (firstSlashVeeZero == 0 && txt.Length > 3 && txt[3] == ' ') //"\v0 " - return text.Substring(start, 4); - return text.Substring(start, firstSlashVeeZero + 3); //everything upto \v0" - } - private void ConvertImportProcedureROsToText(Content content, XmlNode xn) - { - bool processATable = content.MyGrid != null; // content.Type == 20008; - string newvalue = ""; //value; - if (content.MyGrid != null) - Console.WriteLine("stop"); - foreach (XmlNode nd in xn.SelectNodes("rousage")) - { - string rousageid = nd.Attributes.GetNamedItem("rousageid").InnerText; - string roid = nd.Attributes.GetNamedItem("roid").InnerText; - - string findLink = @""; - MatchCollection ms = Regex.Matches(content.Text, findLink); - string lookFor = string.Format(@"^$", rousageid); - int lastIndex = 0; - string newText = content.Text; - foreach (Match mm in ms) - { - int offset = mm.Index; - Match m = Regex.Match(mm.Value, lookFor, RegexOptions.Singleline); - if (m != null && m.Groups.Count > 1) - { - string prefix = GetMyPrefix(content.Text, mm.Index, lastIndex); - string suffix = GetMySuffix(content.Text, mm.Index + mm.Length); - int myIndex = m.Groups[4].Index + mm.Index; - int myLength = m.Groups[4].Length; - if (m.Groups[3].Value != " ") - { - myIndex = m.Groups[3].Index + mm.Index; - myLength += m.Groups[3].Length; - } - string gg = newText.Substring(myIndex, myLength); - //retval = gg; - gg = gg.Replace("{", @"\{").Replace("}", @"\}"); - string part1 = newText.Substring(0, mm.Index); - string part2 = gg; - string part3 = newText.Substring(mm.Index + mm.Length); - //modify part1 based on prefix - if (prefix == @"\v ") - part1 = part1.Substring(0, part1.Length - 3); - else - part1 = part1.Substring(0, part1.Length - 3) + " "; - //modify part3 based on suffix - if (suffix == @"\v0 ") - part3 = part3.Substring(4); - else - part3 = suffix.Replace(@"\v0", "") + part3.Substring(suffix.Length); - if (gg.Contains(@"\u8209?")) - { - Match mmm = Regex.Match(gg, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)"); - if (mmm == null) - newvalue = newvalue.Replace(@"\u8209?", "-"); - else - newvalue = newvalue.Replace(@"\u8209?", m.Groups[1].Value + @"\u8209?" + m.Groups[3].Value); - } - if (gg.Contains(@"\u9586?")) - { - Match mmm = Regex.Match(gg, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)"); - if (mmm == null) - newvalue = newvalue.Replace(@"\u9586?", @"\\"); - else - newvalue = newvalue.Replace(@"\u9586?", m.Groups[1].Value + @"\u9586?" + m.Groups[3].Value); - } - content.Text = part1 + part2 + part3; - break; // Text has been processed - } - lastIndex = mm.Index + mm.Length; - } - } - if (content.MyGrid != null) - { - if (content.Text.StartsWith(@"\v ")) // if change in rotable data... - { - content.Text = newvalue; - //if (origROFstInfo != null) - //{ - // List retlist = origROFstInfo.OnROTableUpdate(this, new ROFstInfoROTableUpdateEventArgs(newvalue, MyGrid.Data)); - // if (MyGrid.Data != retlist[1]) - // { - // MyGrid.Data = retlist[1]; - // retval = Text; - // if (Text != retlist[0]) - // Text = retlist[0]; - // } - //} - } - //else - //{ - // // if it's an ro within a table, need to process into an flex grid to save the grid data: - // string findLinkXml = @"<START\].*?\[END>"; - // //string lookForXml = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID); - // string lookForXml = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])(.*?)(\\[^v'?{{}} \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>$", rousg.ROUsageID); - // MatchCollection msg = Regex.Matches(MyGrid.Data, findLinkXml); - // int nmsg = msg.Count; - // for (int i = nmsg - 1; i >= 0; i--) - // { - // Match mmg = msg[i]; - // int offset = 0; // crashed in substring line below if using mmg.Index; Set to 0 and it worked - KBR. - // Match mg = Regex.Match(mmg.Value, lookForXml);// Regex.Match(MyGrid.Data, lookForXml); - // if (mg != null && mg.Groups.Count > 1) - // { - // int myIndex = mg.Groups[4].Index + mmg.Index; - // int myLength = mg.Groups[4].Length; - // if (mg.Groups[3].Value != " ") - // { - // myIndex = mg.Groups[3].Index + mmg.Index; - // myLength += mg.Groups[3].Length; - // } - // string gg = MyGrid.Data.Substring(myIndex, myLength); - // if (newvalue.Contains(@"\u8209?")) - // { - // Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)"); - // if (m == null) - // newvalue = newvalue.Replace(@"\u8209?", "-"); - // else - // newvalue = newvalue.Replace(@"\u8209?", m.Groups[1].Value + @"\u8209?" + m.Groups[3].Value); - // } - // if (newvalue.Contains(@"\u9586?")) - // { - // Match m = Regex.Match(newvalue, @"(\\f[0-9]+)(\\u[0-9]{1,4}\?)(\\f[0-9]+ ?)"); - // if (m == null) - // newvalue = newvalue.Replace(@"\u9586?", @"\\"); - // else - // newvalue = newvalue.Replace(@"\u9586?", m.Groups[1].Value + @"\u9586?" + m.Groups[3].Value); - // } - // if (gg != newvalue) - // { - // MyGrid.Data = MyGrid.Data.Substring(0, myIndex) + newvalue + MyGrid.Data.Substring(myIndex + myLength); - // } - // //System.Text.RegularExpressions.Group g = mg.Groups[3]; - // //if (g.ToString() != newvalue) - // //{ - // // retval = g.Value; - // // MyGrid.Data = MyGrid.Data.Substring(0, offset + mmg.Index + g.Index) + newvalue + MyGrid.Data.Substring(offset + mmg.Index + g.Index + g.Length); - // //} - // } - // } - //} - } - content.Save(); - } - private void AddROUsages(Content content, XmlNode xn) - { - if (_ConvertROsToTextDuringImport) - { - ConvertImportProcedureROsToText(content, xn); - } - else - { - foreach (XmlNode nd in xn.SelectNodes("rousage")) - { - string rousageid = nd.Attributes.GetNamedItem("rousageid").InnerText; - string roid = nd.Attributes.GetNamedItem("roid").InnerText; - string config = nd.Attributes.GetNamedItem("config").InnerText; - string userid = nd.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - if (MyDocVersion.DocVersionAssociations == null) - MyDocVersion.RefreshDocVersionAssociations(); - ROFSTLookup lookup = MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(MyDocVersion); - string roval = lookup.GetRoValue(roid); - if (roval == "?") - { - RoUsageInfo roui = RoUsageInfo.Get(int.Parse(rousageid)); - } - else - { - RoUsage rou = RoUsage.MakeRoUsage(content, roid, config, dts, userid, MyRODb); - rou.Save(); - RoUsageInfo roui = RoUsageInfo.Get(rou.ROUsageID); - string lookFor = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rousageid, roid, oldRODbID.ToString()); - string replaceWith = string.Format("#Link:ReferencedObject:{0} {1} {2}[END>", rou.ROUsageID.ToString(), roid, newRODbID.ToString()); - if (lookFor != replaceWith) - { - content.Text = content.Text.Replace(lookFor, replaceWith); - content.FixContentText(roui, roval, 0, MyDocVersion.DocVersionAssociations[0].MyROFst); - } - } - //content.Save(); - } - content.Save(); - } - } - - // jsj 4-29-2016 appears to not be used - //private void AddAnnotation(XmlReader xr) - //{ - // int itemid = int.Parse(xr.GetAttribute("itemid")); - // itemid = Old2NewItem[itemid]; - // Item itm = Item.Get(itemid); - // int typeid = int.Parse(xr.GetAttribute("typeid")); - // string rtftext = xr.GetAttribute("rtftext"); - // string searchtext = xr.GetAttribute("searchtext"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Annotation ann = Annotation.MakeAnnotation(itm, AnnotationType.Get(typeid), rtftext, searchtext, config, dts, userid); - //} - - private void AddAnnotations(int itemID, XmlNode xn) - { - Item itm = Item.Get(itemID); - foreach (XmlNode nd in xn.SelectNodes("annotation")) - { - int typeid = int.Parse(nd.Attributes.GetNamedItem("typeid").InnerText); - string rtftext = nd.Attributes.GetNamedItem("rtftext").InnerText; - string searchtext = nd.Attributes.GetNamedItem("searchtext").InnerText; - string config = nd.Attributes.GetNamedItem("config").InnerText; - string userid = nd.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - AnnotationType annType = AnnotationType.GetByNameOrCreate(nd.Attributes.GetNamedItem("typename").InnerText); - Annotation ann = Annotation.MakeAnnotation(itm, annType, rtftext, searchtext, config, dts, userid); - ann.Save(); - } - } - private void AddParts(XmlNode myNode, ItemInfo parentInfo) - { - foreach (XmlNode xn in myNode.ChildNodes) - { - switch (xn.Name) - { - case "sections": - AddSections(xn, parentInfo); - break; - case "cautions": - AddCautions(xn, parentInfo); - break; - case "notes": - AddNotes(xn, parentInfo); - break; - case "rnos": - AddRNOs(xn, parentInfo); - break; - case "steps": - AddSteps(xn, parentInfo); - break; - case "tables": - AddTables(xn, parentInfo); - break; - case "entry": // this is word section max out the status bar - lblImportStep.Text = "Word Section Data"; - pbImportStep.Maximum = 1; - pbImportStep.PerformStep(); - break; - default: - break; - } - } - } - private void AddTables(XmlNode xn, ItemInfo parentInfo) - { - if (parentInfo.IsProcedure) - { - pbImportSection.Value = 0; - pbImportStep.Value = 0; - pbImportSection.Maximum = xn.ChildNodes.Count; - } - if (parentInfo.IsSection) - { - pbImportStep.Value = 0; - pbImportStep.Maximum = xn.ChildNodes.Count; - } - ItemInfo prevInfo = null; - foreach (XmlNode nd in xn.ChildNodes) - prevInfo = AddTable(nd, parentInfo, prevInfo); - } - // jsj 2016Feb16 - This appears to not be used - //private ItemInfo AddTable(XmlReader xr, ItemInfo parentInfo, ItemInfo prevInfo, int oldid) - //{ - // string number = xr.GetAttribute("number"); - // string text = xr.GetAttribute("text"); - // int steptype = int.Parse(xr.GetAttribute("type")); - // string formatid = xr.GetAttribute("formatid"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Step step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Table); - // step.DTS = dts; - // step.UserID = userid; - // if (formatid != string.Empty) - // step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid)); - // step.MyContent.Config = config; - // step.MyContent.DTS = dts; - // step.MyContent.UserID = userid; - // step.Save(); - // Old2NewItem.Add(oldid, step.ItemID); - // Old2NewContent.Add(int.Parse(xr.GetAttribute("contentid")), step.MyContent.ContentID); - // prevInfo = StepInfo.Get(step.ItemID); - // return prevInfo; - //} - private ItemInfo AddTable(XmlNode xn, ItemInfo parentInfo, ItemInfo prevInfo) - { - pbImportStep.PerformStep(); - lblImportStep.Text = string.Format("{0} of {1} Steps", pbImportStep.Value.ToString(), pbImportStep.Maximum.ToString()); - Application.DoEvents(); - XmlNode xc = xn.SelectSingleNode("content"); - Step step; - string number = xc.Attributes.GetNamedItem("number").InnerText; - string text = xc.Attributes.GetNamedItem("text").InnerText; - int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); - string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; - string config = xc.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); - CheckForFloatingFoldout(contentid, config); - string userid = xc.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); - using (step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Table)) - { - step.DTS = dts; - step.UserID = userid; - // check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute) - XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - if (formatid != string.Empty) - step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - step.MyContent.Config = config; - step.MyContent.DTS = dts; - step.MyContent.UserID = userid; - step.Save(); - if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText))) - Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), step.ItemID); - if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText))) - Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), step.MyContent.ContentID); - if (xc.SelectNodes("grid").Count > 0) - AddGrid(step.MyContent, xc); - if (xn.SelectNodes("annotation").Count > 0) - AddAnnotations(step.ItemID, xn); - if (xc.SelectNodes("rousage").Count > 0) - AddROUsages(step.MyContent, xc); - if (xc.SelectNodes("transition").Count > 0) - AddTransitions(step.MyContent, xc); - prevInfo = StepInfo.Get(step.ItemID); - if (xc.HasChildNodes) - AddParts(xc, prevInfo); - } - return prevInfo; - } - private void AddSteps(XmlNode xn, ItemInfo parentInfo) - { - if (parentInfo.IsProcedure) - { - pbImportSection.Value = 0; - pbImportStep.Value = 0; - pbImportSection.Maximum = xn.ChildNodes.Count; - } - if (parentInfo.IsSection) - { - pbImportStep.Value = 0; - pbImportStep.Maximum = xn.ChildNodes.Count; - } - ItemInfo prevInfo = null; - foreach (XmlNode nd in xn.ChildNodes) - prevInfo = AddStep(nd, parentInfo, prevInfo); - } - - // jsj 4-29-2016 appears to not be used - //private ItemInfo AddStep(XmlReader xr, ItemInfo parentInfo, ItemInfo prevInfo, int oldid) - //{ - // string number = xr.GetAttribute("number"); - // string text = xr.GetAttribute("text"); - // int steptype = int.Parse(xr.GetAttribute("type")); - // string formatid = xr.GetAttribute("formatid"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Step step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Step); - // step.DTS = dts; - // step.UserID = userid; - // string formatfilename = xr.GetAttribute("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - // if (formatid != string.Empty) - // step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid),formatfilename); - // step.MyContent.Config = config; - // step.MyContent.DTS = dts; - // step.MyContent.UserID = userid; - // step.Save(); - // Old2NewItem.Add(oldid, step.ItemID); - // Old2NewContent.Add(int.Parse(xr.GetAttribute("contentid")), step.MyContent.ContentID); - // prevInfo = StepInfo.Get(step.ItemID); - // return prevInfo; - //} - private ItemInfo AddStep(XmlNode xn, ItemInfo parentInfo, ItemInfo prevInfo) - { - pbImportStep.PerformStep(); - lblImportStep.Text = string.Format("{0} of {1} Steps", pbImportStep.Value.ToString(), pbImportStep.Maximum.ToString()); - Application.DoEvents(); - XmlNode xc = xn.SelectSingleNode("content"); - Step step; - string number = xc.Attributes.GetNamedItem("number").InnerText; - string text = xc.Attributes.GetNamedItem("text").InnerText; - int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); - string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; - string config = xc.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); - CheckForFloatingFoldout(contentid, config); - string userid = xc.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); - using (step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Step)) - { - step.DTS = dts; - step.UserID = userid; - // check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute) - XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - if (formatid != string.Empty) - step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - step.MyContent.Config = config; - step.MyContent.DTS = dts; - step.MyContent.UserID = userid; - step.Save(); - if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText))) - Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), step.ItemID); - if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText))) - Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), step.MyContent.ContentID); - if (xn.SelectNodes("annotation").Count > 0) - AddAnnotations(step.ItemID, xn); - if (xc.SelectNodes("rousage").Count > 0) - AddROUsages(step.MyContent, xc); - if (xc.SelectNodes("transition").Count > 0) - AddTransitions(step.MyContent, xc); - prevInfo = StepInfo.Get(step.ItemID); - if (xc.HasChildNodes) - AddParts(xc, prevInfo); - } - return prevInfo; - } - private void AddRNOs(XmlNode xn, ItemInfo parentInfo) - { - if (parentInfo.IsProcedure) - { - pbImportSection.Value = 0; - pbImportStep.Value = 0; - pbImportSection.Maximum = xn.ChildNodes.Count; - } - if (parentInfo.IsSection) - { - pbImportStep.Value = 0; - pbImportStep.Maximum = xn.ChildNodes.Count; - } - ItemInfo prevInfo = null; - foreach (XmlNode nd in xn.ChildNodes) - prevInfo = AddRNO(nd, parentInfo, prevInfo); - } - - // jsj 4-29-2016 appears to not be used - //private ItemInfo AddRNO(XmlReader xr, ItemInfo parentInfo, ItemInfo prevInfo, int oldid) - //{ - // string number = xr.GetAttribute("number"); - // string text = xr.GetAttribute("text"); - // int steptype = int.Parse(xr.GetAttribute("type")); - // string formatid = xr.GetAttribute("formatid"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Step step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.RNO); - // step.DTS = dts; - // step.UserID = userid; - // string formatfilename = xr.GetAttribute("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - // if (formatid != string.Empty) - // step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - // step.MyContent.Config = config; - // step.MyContent.DTS = dts; - // step.MyContent.UserID = userid; - // step.Save(); - // Old2NewItem.Add(oldid, step.ItemID); - // Old2NewContent.Add(int.Parse(xr.GetAttribute("contentid")), step.MyContent.ContentID); - // prevInfo = StepInfo.Get(step.ItemID); - // return prevInfo; - //} - - private ItemInfo AddRNO(XmlNode xn, ItemInfo parentInfo, ItemInfo prevInfo) - { - pbImportStep.PerformStep(); - lblImportStep.Text = string.Format("{0} of {1} Steps", pbImportStep.Value.ToString(), pbImportStep.Maximum.ToString()); - Application.DoEvents(); - XmlNode xc = xn.SelectSingleNode("content"); - Step step; - string number = xc.Attributes.GetNamedItem("number").InnerText; - string text = xc.Attributes.GetNamedItem("text").InnerText; - int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); - string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; - string config = xc.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); - CheckForFloatingFoldout(contentid, config); - string userid = xc.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); - using (step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.RNO)) - { - step.DTS = dts; - step.UserID = userid; - // check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute) - XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - if (formatid != string.Empty) - step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - step.MyContent.Config = config; - step.MyContent.DTS = dts; - step.MyContent.UserID = userid; - step.Save(); - if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText))) - Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), step.ItemID); - if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText))) - Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), step.MyContent.ContentID); - if (xn.SelectNodes("annotation").Count > 0) - AddAnnotations(step.ItemID, xn); - if (xc.SelectNodes("rousage").Count > 0) - AddROUsages(step.MyContent, xc); - if (xc.SelectNodes("transition").Count > 0) - AddTransitions(step.MyContent, xc); - prevInfo = StepInfo.Get(step.ItemID); - if (xc.HasChildNodes) - AddParts(xc, prevInfo); - } - return prevInfo; - } - private void AddNotes(XmlNode xn, ItemInfo parentInfo) - { - if (parentInfo.IsProcedure) - { - pbImportSection.Value = 0; - pbImportStep.Value = 0; - pbImportSection.Maximum = xn.ChildNodes.Count; - } - if (parentInfo.IsSection) - { - pbImportStep.Value = 0; - pbImportStep.Maximum = xn.ChildNodes.Count; - } - ItemInfo prevInfo = null; - foreach (XmlNode nd in xn.ChildNodes) - prevInfo = AddNote(nd, parentInfo, prevInfo); - } - - // jsj 4-29-2016 appears to not be used - //private ItemInfo AddNote(XmlReader xr, ItemInfo parentInfo, ItemInfo prevInfo, int oldid) - //{ - // string number = xr.GetAttribute("number"); - // string text = xr.GetAttribute("text"); - // int steptype = int.Parse(xr.GetAttribute("type")); - // string formatid = xr.GetAttribute("formatid"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Step step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Note); - // step.DTS = dts; - // step.UserID = userid; - // string formatfilename = xr.GetAttribute("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - // if (formatid != string.Empty) - // step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - // step.MyContent.Config = config; - // step.MyContent.DTS = dts; - // step.MyContent.UserID = userid; - // step.Save(); - // Old2NewItem.Add(oldid, step.ItemID); - // Old2NewContent.Add(int.Parse(xr.GetAttribute("contentid")), step.MyContent.ContentID); - // prevInfo = StepInfo.Get(step.ItemID); - // return prevInfo; - //} - - private ItemInfo AddNote(XmlNode xn, ItemInfo parentInfo, ItemInfo prevInfo) - { - pbImportStep.PerformStep(); - lblImportStep.Text = string.Format("{0} of {1} Steps", pbImportStep.Value.ToString(), pbImportStep.Maximum.ToString()); - Application.DoEvents(); - XmlNode xc = xn.SelectSingleNode("content"); - Step step; - string number = xc.Attributes.GetNamedItem("number").InnerText; - string text = xc.Attributes.GetNamedItem("text").InnerText; - int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); - string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; - string config = xc.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); - CheckForFloatingFoldout(contentid, config); - string userid = xc.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); - using (step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Note)) - { - step.DTS = dts; - step.UserID = userid; - // check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute) - XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - if (formatid != string.Empty) - step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - step.MyContent.Config = config; - step.MyContent.DTS = dts; - step.MyContent.UserID = userid; - step.Save(); - if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText))) - Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), step.ItemID); - if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText))) - Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), step.MyContent.ContentID); - if (xn.SelectNodes("annotation").Count > 0) - AddAnnotations(step.ItemID, xn); - if (xc.SelectNodes("rousage").Count > 0) - AddROUsages(step.MyContent, xc); - if (xc.SelectNodes("transition").Count > 0) - AddTransitions(step.MyContent, xc); - prevInfo = StepInfo.Get(step.ItemID); - if (xc.HasChildNodes) - AddParts(xc, prevInfo); - } - return prevInfo; - } - private void AddCautions(XmlNode xn, ItemInfo parentInfo) - { - if (parentInfo.IsProcedure) - { - pbImportSection.Value = 0; - pbImportStep.Value = 0; - pbImportSection.Maximum = xn.ChildNodes.Count; - } - if (parentInfo.IsSection) - { - pbImportStep.Value = 0; - pbImportStep.Maximum = xn.ChildNodes.Count; - } - ItemInfo prevInfo = null; - foreach (XmlNode nd in xn.ChildNodes) - prevInfo = AddCaution(nd, parentInfo, prevInfo); - } - - // jsj 4-29-2016 appears to not be used - //private ItemInfo AddCaution(XmlReader xr, ItemInfo parentInfo, ItemInfo prevInfo, int oldid) - //{ - // string number = xr.GetAttribute("number"); - // string text = xr.GetAttribute("text"); - // int steptype = int.Parse(xr.GetAttribute("type")); - // string formatid = xr.GetAttribute("formatid"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Step step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Caution); - // step.DTS = dts; - // step.UserID = userid; - // string formatfilename = xr.GetAttribute("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - // if (formatid != string.Empty) - // step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - // step.MyContent.Config = config; - // step.MyContent.DTS = dts; - // step.MyContent.UserID = userid; - // step.Save(); - // Old2NewItem.Add(oldid, step.ItemID); - // Old2NewContent.Add(int.Parse(xr.GetAttribute("contentid")), step.MyContent.ContentID); - // prevInfo = StepInfo.Get(step.ItemID); - // return prevInfo; - //} - - private ItemInfo AddCaution(XmlNode xn, ItemInfo parentInfo, ItemInfo prevInfo) - { - pbImportStep.PerformStep(); - lblImportStep.Text = string.Format("{0} of {1} Steps", pbImportStep.Value.ToString(), pbImportStep.Maximum.ToString()); - Application.DoEvents(); - XmlNode xc = xn.SelectSingleNode("content"); - Step step; - string number = xc.Attributes.GetNamedItem("number").InnerText; - string text = xc.Attributes.GetNamedItem("text").InnerText; - int steptype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); - string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; - string config = xc.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); - CheckForFloatingFoldout(contentid, config); - string userid = xc.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); - using (step = Step.MakeStep(parentInfo, prevInfo, number, text, steptype, E_FromType.Caution)) - { - step.DTS = dts; - step.UserID = userid; - // check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute) - XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - if (formatid != string.Empty) - step.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - step.MyContent.Config = config; - step.MyContent.DTS = dts; - step.MyContent.UserID = userid; - step.Save(); - if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText))) - Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), step.ItemID); - if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText))) - Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), step.MyContent.ContentID); - if (xn.SelectNodes("annotation").Count > 0) - AddAnnotations(step.ItemID, xn); - if (xc.SelectNodes("rousage").Count > 0) - AddROUsages(step.MyContent, xc); - if (xc.SelectNodes("transition").Count > 0) - AddTransitions(step.MyContent, xc); - prevInfo = StepInfo.Get(step.ItemID); - if (xc.HasChildNodes) - AddParts(xc, prevInfo); - } - return prevInfo; - } - private void AddSections(XmlNode xn, ItemInfo parentInfo) - { - if (parentInfo.IsProcedure) - { - pbImportSection.Value = 0; - pbImportStep.Value = 0; - pbImportSection.Maximum = xn.ChildNodes.Count; - } - if (parentInfo.IsSection) - { - pbImportStep.Value = 0; - pbImportStep.Maximum = xn.ChildNodes.Count; - } - ItemInfo prevInfo = null; - foreach (XmlNode nd in xn.ChildNodes) - prevInfo = AddSection(nd, parentInfo, prevInfo); - } - private Dictionary GetSectionData(XmlReader xr) - { - Dictionary rv = new Dictionary(); - rv.Add("itemid", xr.GetAttribute("itemid")); - return rv; - } - - // js j4-29-2016 appears to not be used - //private ItemInfo AddSection(XmlReader xr, ItemInfo parentInfo, ItemInfo prevInfo, int oldid) - //{ - // string number = xr.GetAttribute("number"); - // string text = xr.GetAttribute("text"); - // int sectiontype = int.Parse(xr.GetAttribute("type")); - // string formatid = xr.GetAttribute("formatid"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Section sect = Section.MakeSection(parentInfo, prevInfo, number, text, sectiontype); - // sect.DTS = dts; - // sect.UserID = userid; - // string formatfilename = xr.GetAttribute("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - // if (formatid != string.Empty) - // sect.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - // sect.MyContent.Config = config; - // sect.MyContent.DTS = dts; - // sect.MyContent.UserID = userid; - // sect.Save(); - // Old2NewItem.Add(oldid, sect.ItemID); - // Old2NewContent.Add(int.Parse(xr.GetAttribute("contentid")), sect.MyContent.ContentID); - // prevInfo = SectionInfo.Get(sect.ItemID); - // return prevInfo; - //} - - private ItemInfo AddSection(XmlNode xn, ItemInfo parentInfo, ItemInfo prevInfo) - { - pbImportSection.PerformStep(); - lblImportSection.Text = string.Format("{0} of {1} Sections", pbImportSection.Value.ToString(), pbImportSection.Maximum.ToString()); - Application.DoEvents(); - XmlNode xc = xn.SelectSingleNode("content"); - Section sect; - string number = xc.Attributes.GetNamedItem("number").InnerText; - string text = xc.Attributes.GetNamedItem("text").InnerText; - int sectiontype = int.Parse(xc.Attributes.GetNamedItem("type").InnerText); - string formatid = xc.Attributes.GetNamedItem("formatid").InnerText; - string config = xc.Attributes.GetNamedItem("config").InnerText; - config = StripEnhanced(config); - int contentid = int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText); - CheckForFloatingFoldout(contentid, config); - string userid = xc.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(xc.Attributes.GetNamedItem("dts").InnerText); - sect = Section.MakeSection(parentInfo, prevInfo, number, text, sectiontype); - sect.DTS = dts; - sect.UserID = userid; - // check for a null in case an older export file is being imported (the older files will not have the fromatfilename attribute) - XmlNode fnNode = xc.Attributes.GetNamedItem("formatfilename"); //Bug fix B2016-103 the formatid in an Export file may not match the formatid where you are importing to - string formatfilename = (fnNode != null) ? fnNode.InnerText : ""; - if (formatid != string.Empty) - sect.MyContent.MyFormat = OldToNewFormat(int.Parse(formatid), formatfilename); - sect.MyContent.Config = config; - sect.MyContent.DTS = dts; - sect.MyContent.UserID = userid; - sect.Save(); - if (!Old2NewContent.ContainsKey(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText))) - Old2NewContent.Add(int.Parse(xc.Attributes.GetNamedItem("contentid").InnerText), sect.MyContent.ContentID); - if (!Old2NewItem.ContainsKey(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText))) - Old2NewItem.Add(int.Parse(xn.Attributes.GetNamedItem("itemid").InnerText), sect.ItemID); - if (xn.SelectNodes("annotation").Count > 0) - AddAnnotations(sect.ItemID, xn); - if (xc.SelectNodes("entry").Count > 0) - AddEntry(sect.MyContent, xc); - if (xc.SelectNodes("rousage").Count > 0) - AddROUsages(sect.MyContent, xc); - if (xc.SelectNodes("transition").Count > 0) - AddTransitions(sect.MyContent, xc); - prevInfo = SectionInfo.Get(sect.ItemID); - if (xc.HasChildNodes) - AddParts(xc, prevInfo); - return prevInfo; - } - private string StripEnhanced(string config) - { - if (config.Length > 0) - { - XmlDocument xd = new XmlDocument(); - xd.LoadXml(config); - XmlNodeList nl = xd.DocumentElement.SelectNodes("//Enhanced"); - foreach (XmlNode nd in nl) - nd.ParentNode.RemoveChild(nd); - return xd.OuterXml; - } - return config; - } - private void CheckForFloatingFoldout(int contentid, string config) - { - if (config != string.Empty) - { - XmlDocument xd = new XmlDocument(); - xd.LoadXml(config); - XmlNode xn = xd.SelectSingleNode("Config/Step/@FloatingFoldout"); - if (xn != null) - floatFoldout.Add(contentid, int.Parse(xn.InnerText)); - } - } - - // jsj 2016Feb16 - This appears to not be used - //private void AddGrid(XmlReader xr) - //{ - // int contentid = int.Parse(xr.GetAttribute("contentid")); - // contentid = Old2NewContent[contentid]; - // Content content = Content.Get(contentid); - // string data = xr.GetAttribute("data"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // Grid gg = Grid.MakeGrid(content, data, config, dts, userid); - //} - - private void AddGrid(Content content, XmlNode xc) - { - XmlNode nd = xc.SelectSingleNode("grid"); - string data = nd.Attributes.GetNamedItem("data").InnerText; - XmlDocument xd = new XmlDocument(); - xd.LoadXml(data); - XmlNode gn = xd.SelectSingleNode("C1FlexGrid/Control/IsRoTable"); - if (gn.InnerText.ToLower() == "true") - { - gn = xd.SelectSingleNode("C1FlexGrid/Control/RODbId"); - gn.InnerText = newRODbID.ToString(); - data = xd.OuterXml; - } - else - { - XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Cells/Cell/Data"); - bool modified = false; - string lookFor = string.Format(" {0}[END", oldRODbID.ToString()); - string replaceWith = string.Format(" {0}[END", newRODbID.ToString()); - foreach (XmlNode nn in nl) - { - if (nn.InnerText.Contains("#Link:ReferencedObject:")) - { - nn.InnerText = nn.InnerText.Replace(lookFor, replaceWith); - modified = true; - } - } - if (modified) - data = xd.OuterXml; - } - string config = nd.Attributes.GetNamedItem("config").InnerText; - string userid = nd.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - Grid gg = Grid.MakeGrid(content, data, config, dts, userid); - gg.Save(); - } - - // jsj 4-29-2016 appears to not be used - //private Dictionary AddEntry(XmlReader xr) - //{ - // Dictionary dic = new Dictionary(); - // dic.Add("contentid", xr.GetAttribute("contentid")); - // dic.Add("dts", xr.GetAttribute("dts")); - // dic.Add("userid", xr.GetAttribute("userid")); - // return dic; - //} - - private void AddEntry(Content content, XmlNode xc) - { - XmlNode nd = xc.SelectSingleNode("entry"); - string userid = nd.Attributes.GetNamedItem("userid").InnerText; - DateTime dts = DateTime.Parse(nd.Attributes.GetNamedItem("dts").InnerText); - Document dd = AddDocument(nd.SelectSingleNode("document")); - Entry ee = Entry.MakeEntry(content, dd, dts, userid); - ee.Save(); - } - // jsj 2016Feb16 - This appears to not be used - //private void AddDocument(XmlReader xr, Dictionary dic) - //{ - // string libtitle = xr.GetAttribute("libtitle"); - // byte[] doccontent = Convert.FromBase64String(xr.GetAttribute("doccontent")); - // string docascii = xr.GetAttribute("docascii"); - // string config = xr.GetAttribute("config"); - // string userid = xr.GetAttribute("userid"); - // DateTime dts = DateTime.Parse(xr.GetAttribute("dts")); - // string fileextension = xr.GetAttribute("fileextension"); - // Document dd = Document.MakeDocument(libtitle, doccontent, docascii, config, dts, userid, fileextension); - // int contentid = int.Parse(dic["contentid"]); - // contentid = Old2NewContent[contentid]; - // Content content = Content.Get(contentid); - // dts = DateTime.Parse(dic["dts"]); - // userid = dic["userid"]; - // Entry ee = Entry.MakeEntry(content, dd, dts, userid); - //} - private Document AddDocument(XmlNode xn) - { - Document d; - int docid = int.Parse(xn.Attributes.GetNamedItem("docid").InnerText); - if (Old2NewLibDoc.ContainsKey(docid)) - { - docid = Old2NewLibDoc[docid]; - d = Document.Get(docid); - } - else - { - string libtitle = xn.Attributes.GetNamedItem("libtitle").InnerText; - DateTime dts = DateTime.Parse(xn.Attributes.GetNamedItem("dts").InnerText); - if (libtitle != "") - { - DocumentInfoList dil = DocumentInfoList.GetLibraries(true); - foreach (DocumentInfo di in dil) - { - if (di.LibTitle == libtitle && di.DTS == dts) - return di.Get(); // found library document in exiting database - } - } - byte[] doccontent = Convert.FromBase64String(xn.Attributes.GetNamedItem("doccontent").InnerText); - string docascii = xn.Attributes.GetNamedItem("docascii").InnerText; - string config = xn.Attributes.GetNamedItem("config").InnerText; - string userid = xn.Attributes.GetNamedItem("userid").InnerText; - string fileextension = xn.Attributes.GetNamedItem("fileextension").InnerText; - d = Document.MakeDocument(libtitle, doccontent, docascii, config, dts, userid, fileextension); - d.Save(); - Old2NewLibDoc.Add(docid, d.DocID); - } - return d; - } - #endregion - - private void btnCloseExport_Click(object sender, EventArgs e) - { - this.Close(); - } - - private void btnCloseImport_Click(object sender, EventArgs e) - { - this.Close(); - } - } -} diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh - Copy.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh - Copy.cs deleted file mode 100644 index 672218ba..00000000 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh - Copy.cs +++ /dev/null @@ -1,1026 +0,0 @@ -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 System.IO; -using Volian.Controls.Library; -using DevComponents.DotNetBar; -using JR.Utils.GUI.Forms; - -namespace VEPROMS -{ - public partial class frmBatchRefresh : Form - { - private SessionInfo _MySessionInfo; - public SessionInfo MySessionInfo - { - get { return _MySessionInfo; } - set { _MySessionInfo = value; } - } - public frmBatchRefresh() - { - InitializeComponent(); - } - private AdminTools adminToolsList; - private AdminTool selectedAdminTool; - // removed the Refresh ROs and Refresh Transitions and ROs options (now only Transitions can be refreshed) - // the Update ROs and Refresh ROs logic was merged together. The Update ROs will functionally do both - // also annotations will be placed on step elements that have RO changes - private void SetUpAdminTools() - { - adminToolsList = new AdminTools(); - adminToolsList.Add("Update RO Values" - , "Update RO Values Guidance" - , "This allows the user to update referenced objects values for multiple working drafts in a batch mode." - , "It is recommended that this be done during off hours." - , "WARNING:" - , true // True means Exclude Procedures - , false - , UpdateROValues); - adminToolsList.Add("Refresh Transitions", "Refresh Transitions Guidance", "Occasionally, transitions do not get updated.\r\n\r\nThis function will refresh transitions in all procedures selected below whether they were selected individually or as a group via a procedure set.", "If more than one procedure is selected, it is recommened that this be performed during off hours.", "WARNING:", false, false, RefreshTransitions); - adminToolsList.Add("Fix Hyphens", "Fix Hyphens", "Replace various forms of Hyphens with a consistent Hyphen so that search will find all Hyphens", "", "", true, true, "vesp_FixHyphens", FixHyphens); - adminToolsList.Add("Delete PDFs", "Delete PDFs Guidance", "It is sometimes desirable to clean up the database by removing extra pdf files. This process allows for this to occur", "", "", true, true, "vesp_DeletePDFs", DeletePDFs); - adminToolsList.Add("Identify Disconnected Items" - , "Identify Disconnected Items Guidance" - , "Everything in PROMS is inter-related. A working draft knows what is its first procedure and a procedure knows what is its first step. Likewise, a procedure knows what procedure is before it and after it.\r\n\r\nOccasionally, an item will become disconnected and does not know where it fits into the relationships. This tool identifies whether the database has this condition." - , "This tool may take an extended period of time to execute." - , "NOTE:" - , true - , true - , "vesp_GetDisconnectedItemsCount" - , IdentifyDisconnectedItems); - adminToolsList.Add("Purge Disconnected Items" - , "Purge Disconnected Items Guidance" - , "Everything in PROMS is inter-related. A working draft knows what is its first procedure and a procedure knows what is its first step. Likewise, a procedure knows what procedure is before it and after it.\r\n\r\nOccasionally, an item will become disconnected and does not know where it fits into the relationships. This tool removes any disconnected items from the database." - , "Be sure to have a backup prior to running this!!\r\n\r\nThis tool may take an extended period of time to execute." - , "Warning:" - , true - , true - , "vesp_PurgeDisconnectedData" - , PurgeDisconnectedItems); - adminToolsList.Add("Identify Non-Editable Items", "Identify Non-Editable Items Guidance", "Typically, a section in PROMS only has sub-sections or sub-steps. There are times when a section has both. When this occurs, the sub-step data can be marked as non-editable. If this occurs, the user can no longer get to these steps and they can become forgotten.\r\n\r\nThis tool will identify if the database has non-editable steps and provide a listing of these steps.", "This tool may take an extended period of time to execute.", "NOTE:", true, true, "vesp_GetNonEditableItems", IdentifyNonEditableItems); - adminToolsList.Add("Get Database Users", "Get Database Users Guidance", "This administrative tool will return all of the users currently with open sessions in the database and the details of any items they have checked out", "", "", true, true, "vesp_GetDatabaseSessions", GetDatabaseSessions); - adminToolsList.Add("Clean Up Referenced Object Associations" - , "Clean Up Referenced Object Associations Guidance" - , "Referenced Objects are associated with a procedure set (such as Working Draft). If unnecessary associations exist, these can be removed." - , "Be sure to have a backup prior to running this!!" - , "NOTE:" - , true - , true - , "vesp_CleanUpROAssociations" - , CleanUpROAssociations); - adminToolsList.Add("Remove Unused ROFSTs and Figures" - , "Remove Unused ROFSTs and Figures Guidance" - , "This tool removes any ROFSTs and Figures that are no longer used." - , "Be sure to have a backup prior to running this!!" - , "NOTE:" - , true - , true - , "vesp_RemoveUnusedRoFstsAndFigures" - , RemoveUnusedRoFstsAndFigures); - adminToolsList.Add("Identify Unused RO Associations" - , "Identify Unused RO Associations Guidance" - , "Referenced Objects are associated with a procedure set (such as Working Draft). If unnecessary associations exist, these can be removed." - , "" - , "NOTE:" - , true - , true - , "vesp_GetUnusedROAssociationsCount" - , IdentifyROAssociations); - adminToolsList.Add("Identify Unused ROFSTs and Figures" - , "Identify Unused ROFSTs and Figures Guidance" - , "This tool identifies any ROFSTs and Figures that are no longer used." - , "" - , "NOTE:" - , true - , true - , "vesp_GetUnusedRoFstsCount" - , IdentifyUnusedRoFstsAndFigures); - - //adminToolsList.Add("Find Referenced Object Problems", "Find Referenced Object Problems Guidance", "description for find ro problems", "", "", true, true, "vesp_FindROProblems", FindROProblems); - adminToolsList.Sort(); - cbxAdminTools.DataSource = adminToolsList; - cbxAdminTools.DisplayMember = "Title"; - cbxAdminTools.SelectedIndex = -1; - } - private void FixHyphens() - { - this.Cursor = Cursors.WaitCursor; - DateTime pStart = DateTime.Now; - txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - int affectedRows = ESP_FixHyphens.Execute(selectedAdminTool.StoredProcedure)/2;// Two results for each change - txtProcess.AppendText(string.Format("Fixed {0} Hyphens", affectedRows)); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - DateTime pEnd = DateTime.Now; - txtProcess.AppendText(pEnd.ToString("MM/dd/yyyy @ HH:mm")); - Application.DoEvents(); - this.Cursor = Cursors.Default; - MessageBox.Show(string.Format("{0} Completed", selectedAdminTool.Title), string.Format("{0} Complete", selectedAdminTool.Title)); - } - private Dictionary myProcedures = new Dictionary(); - private Dictionary myDocVersions = new Dictionary(); - private void frmBatchRefresh_Load(object sender, EventArgs e) - { - SetUpAdminTools(); - lblWarning.Visible = false; - } - private List myTreeNodePath; - private void ResetTV() - { - ResetTV(false); - } - private void ResetTV(bool noProcs) - { - this.Cursor = Cursors.WaitCursor; - myTreeNodePath = new List(); - myTV.Nodes.Clear(); - if (!selectedAdminTool.NoTreeView) - { - FolderInfo fi = FolderInfo.GetTop(); - TreeNode tn = myTV.Nodes.Add(fi.Name); - tn.Tag = fi; - if (fi.ChildFolderCount > 0) - LoadChildFolders(fi, tn, noProcs); - if (myTV.SelectedNode != null) - myTV.SelectedNode.Expand(); - } - this.Cursor = Cursors.Default; - } - private void LoadChildFolders(FolderInfo fi, TreeNode tn, bool noProcs) - { - foreach (FolderInfo fic in fi.SortedChildFolders) - { - TreeNode tnc = tn.Nodes.Add(fic.Name); - tnc.Tag = fic; - if (fic.ChildFolderCount > 0) - LoadChildFolders(fic, tnc, noProcs); - if (fic.FolderDocVersionCount > 0) - LoadDocVersions(fic, tnc, noProcs); - } - } - private void LoadDocVersions(FolderInfo fic, TreeNode tnc, bool noProcs) - { - foreach (DocVersionInfo dvi in fic.FolderDocVersions) - { - UserInfo ui = UserInfo.GetByUserID(MySessionInfo.UserID); - if (ui.IsAdministrator() || ui.IsSetAdministrator(dvi)) - { - tnc.Tag = dvi; - myDocVersions.Add(tnc, dvi); - if (!noProcs) - { - if (dvi.Procedures.Count > 0) - LoadProcedures(dvi, tnc); - } - myTreeNodePath.Add(tnc.FullPath); - } - else - { - while (tnc != null && tnc.Text != "VEPROMS" && !IsUsedPath(tnc.FullPath)) - { - TreeNode tmp = tnc.Parent; - tnc.Remove(); - tnc = tmp; - } - } - } - } - private bool IsUsedPath(string path) - { - foreach (string s in myTreeNodePath) - { - if (s.StartsWith(path)) - return true; - } - return false; - } - private void LoadProcedures(DocVersionInfo dvi, TreeNode tnc) - { - foreach (ProcedureInfo pi in dvi.Procedures) - { - TreeNode tn = tnc.Nodes.Add(string.Format("{0} {1}", pi.DisplayNumber, pi.DisplayText)); - myProcedures.Add(tn, pi); - tn.Tag = pi; - } - } - private void LoadFolderInfo(FolderInfo f) - { - TreeNode tn = myTV.Nodes.Add(f.Name); - tn.Tag = f; - if (f.ChildFolderCount > 0) - foreach (FolderInfo cf in f.SortedChildFolders) - LoadFolderInfo(cf); - } - private void UpdateROValues() - { - this.Cursor = Cursors.WaitCursor; - List dvil = new List(); - foreach (TreeNode tn in myDocVersions.Keys) - if (tn.Checked) - dvil.Add(myDocVersions[tn]); - DateTime pStart = DateTime.Now; - txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - pbProcess.Minimum = 0; - pbProcess.Maximum = dvil.Count; - pbProcess.Step = 1; - while (dvil.Count > 0) - { - StringBuilder sbDocVersions = new StringBuilder(); - Queue dviq = new Queue(); - foreach (DocVersionInfo dvi in dvil) - dviq.Enqueue(dvi); - dvil.Clear(); - // if we are processing more than one procedure set, use MessageList to hold the summary results for each set - if (dviq.Count > 1) - ROFstInfo.MessageList = new StringBuilder(); - while (dviq.Count > 0) - { - string msg = string.Empty; - DocVersionInfo dq = dviq.Dequeue(); - if (!MySessionInfo.CanCheckOutItem(dq.VersionID, CheckOutType.DocVersion, ref msg)) - { - dvil.Add(dq); - sbDocVersions.AppendLine(msg); - } - else - { - ContentInfo.StaticContentInfoChange += new StaticContentInfoEvent(ContentInfo_StaticContentInfoChange); - ProcessUpdateROValues(dq); - ContentInfo.StaticContentInfoChange -= new StaticContentInfoEvent(ContentInfo_StaticContentInfoChange); - pbProcess.PerformStep(); - Application.DoEvents(); - } - } - // when processing more than one procedure set, display only one completed message after all are processed - if (ROFstInfo.MessageList != null) - { - FlexibleMessageBox.Show(ROFstInfo.MessageList.ToString(), "RO Update Complete"); - ROFstInfo.MessageList = null; - } - DateTime pEnd = DateTime.Now; - txtProcess.AppendText(string.Format("{0} {1} Seconds Elapsed", pEnd.ToString("MM/dd/yyyy @ HH:mm"), TimeSpan.FromTicks(pEnd.Ticks - pStart.Ticks).TotalSeconds)); - Application.DoEvents(); - if (dvil.Count > 0) - { - StringBuilder sb = new StringBuilder(); - sb.AppendLine("The batch update process was not usccessful for all working drafts selected."); - sb.AppendLine("The following working drafts were not able to be refreshed..."); - sb.AppendLine(); - sb.AppendLine(sbDocVersions.ToString()); - sb.AppendLine(); - sb.AppendLine("If you want to update these working drafts, please contact the respective users and have them close any procedures in the working draft."); - sb.AppendLine("Once this is complete you can continue the process otherwise you may terminate the process immediately."); - sb.AppendLine(); - sb.AppendLine("Have you requested the users to close the procedures and do you want to continue the process?"); - frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(); - frmCO.MySessionInfo = MySessionInfo; - //frmCO.CheckedOutProcedures = dvil; - frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height); - frmCO.Show(this); - while (!this.Visible) - Application.DoEvents(); - } - } - this.Cursor = Cursors.Default; - } - private void RefreshTransitions() - { - this.Cursor = Cursors.WaitCursor; - List pil = new List(); - foreach (TreeNode tn in myProcedures.Keys) - if (tn.Checked) - pil.Add(myProcedures[tn]); - //PopulateTransitionInfoLists(pil); - DateTime pStart = DateTime.Now; - txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - pbProcess.Minimum = 0; - pbProcess.Maximum = pil.Count; - pbProcess.Step = 1; - while (pil.Count > 0) - { - ContentInfo.StaticContentInfoChange += new StaticContentInfoEvent(ContentInfo_StaticContentInfoChange); - StringBuilder sbProcs = new StringBuilder(); - Queue piq = new Queue(); - foreach (ProcedureInfo pi in pil) - piq.Enqueue(pi); - pil.Clear(); - while (piq.Count > 0) - { - string msg = string.Empty; - ProcedureInfo pq = piq.Dequeue(); - if (!MySessionInfo.CanCheckOutItem(pq.ItemID, CheckOutType.Procedure, ref msg)) - { - pil.Add(pq); - sbProcs.AppendLine(msg); - } - else - { - RefreshProcedureTransitions(pq); - pbProcess.PerformStep(); - Application.DoEvents(); - } - } - ContentInfo.StaticContentInfoChange -= new StaticContentInfoEvent(ContentInfo_StaticContentInfoChange); - DateTime pEnd = DateTime.Now; - txtProcess.AppendText(pEnd.ToString("MM/dd/yyyy @ HH:mm")); - Application.DoEvents(); - if (pil.Count > 0) - { - StringBuilder sb = new StringBuilder(); - sb.AppendLine("The batch refresh process was not usccessful for all procedures selected."); - sb.AppendLine("The following procedures were not able to be refreshed..."); - sb.AppendLine(); - sb.AppendLine(sbProcs.ToString()); - sb.AppendLine(); - sb.AppendLine("If you want to refresh these prcoedures, please contact the respective users and have them close the procedures."); - sb.AppendLine("Once this is complete you can continue the process otherwise you may terminate the process immediately."); - sb.AppendLine(); - sb.AppendLine("Have you requested the users to close the procedures and do you want to continue the process?"); - frmBatchRefreshCheckedOut frmCO = new frmBatchRefreshCheckedOut(); - frmCO.MySessionInfo = MySessionInfo; - frmCO.CheckedOutProcedures = pil; - frmCO.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - frmCO.Width, Screen.PrimaryScreen.WorkingArea.Height - frmCO.Height); - frmCO.Show(this); - while (!this.Visible) - Application.DoEvents(); - } - } - this.Cursor = Cursors.Default; - MessageBox.Show(string.Format("{0} Completed", selectedAdminTool.Title), string.Format("{0} Complete", selectedAdminTool.Title)); - } - private void DeletePDFs() - { - this.Cursor = Cursors.WaitCursor; - DateTime pStart = DateTime.Now; - txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - int affectedRows = ESP_DeletePDFs.Execute(selectedAdminTool.StoredProcedure); - txtProcess.AppendText(string.Format("Deleted {0} PDFs", affectedRows)); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - DateTime pEnd = DateTime.Now; - txtProcess.AppendText(pEnd.ToString("MM/dd/yyyy @ HH:mm")); - Application.DoEvents(); - this.Cursor = Cursors.Default; - MessageBox.Show(string.Format("{0} Completed", selectedAdminTool.Title), string.Format("{0} Complete", selectedAdminTool.Title)); - } - private void IdentifyDisconnectedItems() - { - this.Cursor = Cursors.WaitCursor; - DateTime pStart = DateTime.Now; - txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - int rowCount = ESP_IdentifyDisconnectedItems.Execute(selectedAdminTool.StoredProcedure); - txtProcess.AppendText(string.Format("Disconnected Items Count: {0}", rowCount)); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - if (rowCount > 0) - { - txtResults.Clear(); - txtResults.AppendText(string.Format("The database contains {0} disconnected items.", rowCount)); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText("It is recommended you contact Volian to assist in resolving this condition"); - } - else - { - txtResults.Text = "No Disconnected Records Found";// B2017-108 Always output results even if there isn't any - } - DateTime pEnd = DateTime.Now; - txtProcess.AppendText(pEnd.ToString("MM/dd/yyyy @ HH:mm")); - Application.DoEvents(); - this.Cursor = Cursors.Default; - MessageBox.Show(string.Format("{0} Completed", selectedAdminTool.Title), string.Format("{0} Complete", selectedAdminTool.Title)); - } - private void PurgeDisconnectedItems() - { - this.Cursor = Cursors.WaitCursor; - DateTime pStart = DateTime.Now; - txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - int rowCount = ESP_IdentifyDisconnectedItems.Execute("vesp_GetDisconnectedItemsCount"); - if (rowCount > 0) - { - ESP_PurgeDisconnectedItems.Execute(selectedAdminTool.StoredProcedure); - int rowCount2 = ESP_IdentifyDisconnectedItems.Execute("vesp_GetDisconnectedItemsCount"); - txtProcess.AppendText(string.Format("Disconnected Items Purged", rowCount)); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - txtResults.Clear(); - txtResults.AppendText(string.Format("The database contained {0} disconnected items.", rowCount)); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(string.Format("The database now contains {0} disconnected items.", rowCount2)); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(Environment.NewLine); - if (rowCount2 > 0) - txtResults.AppendText("It is recommended you contact Volian to assist in resolving this condition"); - } - else - { - txtResults.Clear(); - txtResults.AppendText(string.Format("The database contained {0} disconnected items.", rowCount)); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(string.Format("No Disconnected Data to Purge!")); - } - DateTime pEnd = DateTime.Now; - txtProcess.AppendText(pEnd.ToString("MM/dd/yyyy @ HH:mm")); - Application.DoEvents(); - this.Cursor = Cursors.Default; - MessageBox.Show(string.Format("{0} Completed", selectedAdminTool.Title), string.Format("{0} Complete", selectedAdminTool.Title)); - } - private void IdentifyUnusedRoFstsAndFigures() - { - this.Cursor = Cursors.WaitCursor; - DateTime pStart = DateTime.Now; - txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - int rowCountRoFst = ESP_GetUnusedRoFsts.Execute("vesp_GetUnusedRoFstsCount"); - int rowCountFigures = ESP_GetUnusedFigures.Execute("vesp_GetUnusedFiguresCount"); - txtProcess.AppendText(string.Format("Unused RoFsts Count: {0}, Unused Figures Count: {1}", rowCountRoFst, rowCountFigures)); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - if (rowCountRoFst > 0 || rowCountFigures > 0) - { - txtResults.Clear(); - txtResults.AppendText(string.Format("The database contains {0} unused RoFsts.", rowCountRoFst)); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(string.Format("The database contains {0} unused Figures items.", rowCountFigures)); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(Environment.NewLine); - } - else - { - txtResults.Text = "No Unused Records Found";// B2017-108 Always output results even if there isn't any - } - - DateTime pEnd = DateTime.Now; - txtProcess.AppendText(pEnd.ToString("MM/dd/yyyy @ HH:mm")); - Application.DoEvents(); - this.Cursor = Cursors.Default; - - MessageBox.Show(string.Format("{0} Completed", selectedAdminTool.Title), string.Format("{0} Complete", selectedAdminTool.Title)); - } - private void RemoveUnusedRoFstsAndFigures() - { - this.Cursor = Cursors.WaitCursor; - DateTime pStart = DateTime.Now; - txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - int rowCountRoFst = ESP_GetUnusedRoFsts.Execute("vesp_GetUnusedRoFstsCount"); - int rowCountFigures = ESP_GetUnusedFigures.Execute("vesp_GetUnusedFiguresCount"); - if (rowCountRoFst > 0 || rowCountFigures > 0) - { - ESP_PurgeUnusedRoFstsAndFigures.Execute(selectedAdminTool.StoredProcedure); - int rowCountRoFst2 = ESP_GetUnusedRoFsts.Execute("vesp_GetUnusedRoFstsCount"); - int rowCountFigures2 = ESP_GetUnusedFigures.Execute("vesp_GetUnusedFiguresCount"); - txtProcess.AppendText(string.Format("Unsed RoFsts Purged", rowCountRoFst)); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(string.Format("Unsed Figures Purged", rowCountFigures)); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - txtResults.Clear(); - txtResults.AppendText(string.Format("The database contained {0} unused RoFsts.", rowCountRoFst)); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(string.Format("The database contained {0} unused Figures items.", rowCountFigures)); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(string.Format("The database now contains {0} unused RoFsts.", rowCountRoFst2)); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(string.Format("The database now contains {0} unused Figures.", rowCountFigures2)); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(Environment.NewLine); - if (rowCountRoFst2 > 0 || rowCountFigures2 > 0) - txtResults.AppendText("It is recommended you contact Volian to assist in resolving this condition"); - } - else - { - txtResults.Clear(); - txtResults.AppendText(string.Format("The database contained {0} unused RoFsts or Figures items.", rowCountRoFst+rowCountFigures)); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(string.Format("No Unused Data to Purge!")); - } - DateTime pEnd = DateTime.Now; - txtProcess.AppendText(pEnd.ToString("MM/dd/yyyy @ HH:mm")); - Application.DoEvents(); - this.Cursor = Cursors.Default; - - MessageBox.Show(string.Format("{0} Completed", selectedAdminTool.Title), string.Format("{0} Complete", selectedAdminTool.Title)); - } - private void IdentifyROAssociations() - { - this.Cursor = Cursors.WaitCursor; - DateTime pStart = DateTime.Now; - txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - int rowCount = ESP_GetROAssoc.Execute("vesp_GetUnusedROAssociationsCount"); - txtProcess.AppendText(string.Format("Unused RO Associations Count: {0}", rowCount)); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - if (rowCount > 0) - { - txtResults.Clear(); - txtResults.AppendText(string.Format("The database contains {0} unused RO Associations.", rowCount)); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(Environment.NewLine); - } - else - { - txtResults.Text = "No unused RO Associations Found";// B2017-108 Always output results even if there isn't any - } - DateTime pEnd = DateTime.Now; - txtProcess.AppendText(pEnd.ToString("MM/dd/yyyy @ HH:mm")); - Application.DoEvents(); - this.Cursor = Cursors.Default; - - MessageBox.Show(string.Format("{0} Completed", selectedAdminTool.Title), string.Format("{0} Complete", selectedAdminTool.Title)); - } - private void CleanUpROAssociations() - { - this.Cursor = Cursors.WaitCursor; - DateTime pStart = DateTime.Now; - txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - int rowCount = ESP_GetROAssoc.Execute("vesp_GetUnusedROAssociationsCount"); - if (rowCount > 0) - { - ESP_CleanupROAssoc.Execute(selectedAdminTool.StoredProcedure); - int rowCount2 = ESP_GetROAssoc.Execute("vesp_GetUnusedROAssociationsCount"); - txtProcess.AppendText(string.Format("Unused Referenced Object Associations Purged", rowCount)); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - txtResults.Clear(); - txtResults.AppendText(string.Format("The database contained {0} unused items.", rowCount)); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(string.Format("The database now contains {0} unused items.", rowCount2)); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(Environment.NewLine); - if (rowCount2 > 0) - txtResults.AppendText("It is recommended you contact Volian to assist in resolving this condition"); - } - else - { - txtResults.Clear(); - txtResults.AppendText(string.Format("The database contained {0} unused items.", rowCount)); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(string.Format("No Disconnected Data to Purge!")); - } - DateTime pEnd = DateTime.Now; - txtProcess.AppendText(pEnd.ToString("MM/dd/yyyy @ HH:mm")); - Application.DoEvents(); - this.Cursor = Cursors.Default; - - MessageBox.Show(string.Format("{0} Completed", selectedAdminTool.Title), string.Format("{0} Complete", selectedAdminTool.Title)); - } - private void IdentifyNonEditableItems() - { - this.Cursor = Cursors.WaitCursor; - DateTime pStart = DateTime.Now; - txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - List myItems = ESP_IdentifyNonEditableItems.Execute(selectedAdminTool.StoredProcedure); - txtProcess.AppendText(string.Format("Non-Editable Items Count: {0}",myItems.Count)); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - if (myItems.Count > 0) - { - txtResults.Clear(); - txtResults.AppendText("The following items are non-editable..."); - txtResults.AppendText(Environment.NewLine); - txtResults.AppendText(Environment.NewLine); - foreach (ItemInfo ii in myItems) - { - txtResults.AppendText(ii.Path); - txtResults.AppendText(Environment.NewLine); - } - } - else - { - txtResults.Text = "No Non-Editable Items Found";// B2017-108 Always output results even if there isn't any - } - DateTime pEnd = DateTime.Now; - txtProcess.AppendText(pEnd.ToString("MM/dd/yyyy @ HH:mm")); - Application.DoEvents(); - this.Cursor = Cursors.Default; - MessageBox.Show(string.Format("{0} Completed", selectedAdminTool.Title), string.Format("{0} Complete", selectedAdminTool.Title)); - } - private void GetDatabaseSessions() - { - this.Cursor = Cursors.WaitCursor; - DateTime pStart = DateTime.Now; - txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - txtResults.Clear(); - txtResults.AppendText(ESP_GetDatabaseSessions.Execute(selectedAdminTool.StoredProcedure)); - DateTime pEnd = DateTime.Now; - txtProcess.AppendText(pEnd.ToString("MM/dd/yyyy @ HH:mm")); - Application.DoEvents(); - this.Cursor = Cursors.Default; - MessageBox.Show(string.Format("{0} Completed", selectedAdminTool.Title), string.Format("{0} Complete", selectedAdminTool.Title)); - } - private void FindROProblems() - { - this.Cursor = Cursors.WaitCursor; - DateTime pStart = DateTime.Now; - txtProcess.AppendText(pStart.ToString("MM/dd/yyyy @ HH:mm")); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - txtResults.Clear(); - //txtResults.AppendText(ExecuteStoredProcedureString.Execute(selectedAdminTool.StoredProcedure)); - DateTime pEnd = DateTime.Now; - txtProcess.AppendText(pEnd.ToString("MM/dd/yyyy @ HH:mm")); - Application.DoEvents(); - this.Cursor = Cursors.Default; - MessageBox.Show(string.Format("{0} Completed", selectedAdminTool.Title), string.Format("{0} Complete", selectedAdminTool.Title)); - } - private void btnRefresh_Click(object sender, EventArgs e) - { - txtProcess.Clear(); - txtResults.Clear();// C2017-027 - Clear results before admin tool is run - Application.DoEvents(); - if (btnRefresh.Text == "NO OPTION SELECTED") - { - MessageBox.Show("You must select an option under the Option panel", btnRefresh.Text); - return; - } - if (chkLater.Checked) - { - long later = long.Parse(dtpDate.Value.ToString("yyyyMMdd") + dtpTime.Value.ToString("HHmm")); - long now = long.Parse(DateTime.Now.ToString("yyyyMMddHHmm")); - while (now < later) - { - txtProcess.Clear(); - txtProcess.AppendText("Waiting..."); - System.Threading.Thread.Sleep(60000); - now = long.Parse(DateTime.Now.ToString("yyyyMMddHHmm")); - } - } - selectedAdminTool.Execute(); - } - private void ProcessUpdateROValues(DocVersionInfo dq) - { - InitialProgressBarMessage = string.Format("Updating ROs for {0}", dq.MyFolder.Name); - if (dq.DocVersionAssociationCount < 1) - { - ProgressBar.ColorTable = eProgressBarItemColor.Error; - FinalProgressBarMessage = "No ROs associated"; - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText("Error Updating ro.fst. No associated ro.fst"); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - return; - } - ROFstInfo roFstInfo = dq.DocVersionAssociations[0].MyROFst; - string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst"; - if (!File.Exists(rofstPath)) - { - ProgressBar.ColorTable = eProgressBarItemColor.Error; - FinalProgressBarMessage = "No existing RO.FST"; - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText("No existing ro.fst in path " + roFstInfo.MyRODb.FolderPath + ". Check for invalid path"); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - return; - } - FileInfo fiRofst = new FileInfo(rofstPath); - Cursor = Cursors.WaitCursor; - using (DocVersion dv = DocVersion.Get(dq.VersionID)) - { - roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); - ROFst newrofst = ROFstInfo.RefreshROFst(roFstInfo.MyRODb, dv.DocVersionAssociations[0], dv, roFstInfo, DoProgressBarRefresh, txtProcess); - roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); - } - Cursor = Cursors.Default; - ProgressBar.ColorTable = eProgressBarItemColor.Normal; - FinalProgressBarMessage = "ROs values updated"; - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText("ROs values updated"); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - return; - } - private void RefreshProcedureTransitions(ProcedureInfo pq) - { - DateTime start = DateTime.Now; - myFixes = new StringBuilder(); - ProcedureInfo.ResetTranCounters(); - ProcedureInfo.RefreshTransitions(pq);//, transitionsToDisconnected, transitionsToNonEditable); - TimeSpan ts = DateTime.Now - start; - txtProcess.AppendText(string.Format("Procedure: {1}{0}Checked {2} Transitions{0}Fixed {3} Transitions{0}Elapsed Seconds:{4}{0}{0}", Environment.NewLine, pq.DisplayNumber, ProcedureInfo.TranCheckCount, ProcedureInfo.TranFixCount, ts.TotalSeconds)); - if (myFixes.Length > 0) - { - txtResults.AppendText(myFixes.ToString()); - txtResults.AppendText(Environment.NewLine); - } - } - public List roFstInfo_ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args) - { - return VlnFlexGrid.ROTableUpdate(sender, args); - } - private void PopulateTransitionInfoLists(List pil) - { - Dictionary dic = new Dictionary(); - StringBuilder sb = new StringBuilder(); - foreach (ProcedureInfo pi in pil) - if (!dic.ContainsKey(pi.MyDocVersion.VersionID)) - { - dic.Add(pi.MyDocVersion.VersionID, pi.MyDocVersion.VersionID); - sb.Append(sb.Length == 0 ? pi.MyDocVersion.VersionID.ToString() : "," + pi.MyDocVersion.VersionID.ToString()); - } - txtProcess.AppendText("Preparing to process..."); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - //transitionsToDisconnected = TransitionInfoList.GetTransitionsToDisconnected(sb.ToString()); - //transitionsToNonEditable = TransitionInfoList.GetTransitionsToNonEditable(sb.ToString()); - } - private void ProgressBarShowText() - { - pbProcess.Refresh(); - int percent = (int)(((double)(pbProcess.Value - pbProcess.Minimum) / - (double)(pbProcess.Maximum - pbProcess.Minimum)) * 100); - using (Graphics gr = pbProcess.CreateGraphics()) - { - gr.DrawString(percent.ToString() + "%", - SystemFonts.DefaultFont, - Brushes.Black, - new PointF(pbProcess.Width / 2 - (gr.MeasureString(percent.ToString() + "%", - SystemFonts.DefaultFont).Width / 2.0F), - pbProcess.Height / 2 - (gr.MeasureString(percent.ToString() + "%", - SystemFonts.DefaultFont).Height / 2.0F))); - } - Application.DoEvents(); - } - StringBuilder myFixes; - // show the changes made in the Results pannel, include the ItemId of the step element - void ContentInfo_StaticContentInfoChange(object sender, StaticContentInfoEventArgs args) - { - if (args.Type == "TX") - { - if (args.NewValue.StartsWith("Reason for Change:")) - myFixes.AppendLine(string.Format("Fixed Transition for {1}({4}){0}Old Text: {2}{0}{3}{0}", Environment.NewLine, (sender as ItemInfo).ShortPath, args.OldValue, args.NewValue, (sender as ItemInfo).ItemID)); - else - myFixes.AppendLine(string.Format("Fixed Transition for {1}({4}){0}Old Text: {2}{0}New Text: {3}{0}", Environment.NewLine, (sender as ItemInfo).ShortPath, args.OldValue, args.NewValue, (sender as ItemInfo).ItemID)); - } - else if (args.Type == "RO") - { - txtResults.AppendText(string.Format("Fixed Referenced Object for {1}({4}){0}Old Text: {2}{0}New Text: {3}{0}{0}", Environment.NewLine, (sender as ItemInfo).ShortPath, args.OldValue, args.NewValue,(sender as ItemInfo).ItemID)); - Application.DoEvents(); - //myFixes.AppendLine(string.Format("Fixed Referenced Object for {1}{0}Old Text: {2}{0}New Text: {3}{0}", Environment.NewLine, (sender as ItemInfo).ShortPath, args.OldValue, args.NewValue)); - } - } - private void btnClear_Click(object sender, EventArgs e) - { - txtResults.Clear(); - } - private void btnSave_Click(object sender, EventArgs e) - { - SaveFileDialog sfd = new SaveFileDialog(); - sfd.DefaultExt = "txt"; - sfd.AddExtension = true; - sfd.Filter = "Text Files (*.txt)|*.txt"; - sfd.FileName = string.Format("BatchRefreshResults_{0}", DateTime.Now.ToString("yyyyMMdd_HHmm")); - sfd.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\VEPROMS"; - DialogResult dr = sfd.ShowDialog(); - if (dr == DialogResult.OK) - { - System.IO.StreamWriter sw = new System.IO.StreamWriter(sfd.FileName); - sw.Write(txtResults.Text); - sw.Close(); - } - } - private void myTV_AfterCheck(object sender, TreeViewEventArgs e) - { - if (e.Action != TreeViewAction.Unknown) - if(e.Node.Nodes.Count > 0) - CheckChildNodes(e.Node, e.Node.Checked); - } - private void CheckChildNodes(TreeNode treeNode, bool ischecked) - { - foreach (TreeNode tn in treeNode.Nodes) - { - tn.Checked = ischecked; - if (tn.Nodes.Count > 0) - CheckChildNodes(tn, ischecked); - } - } - private ProgressBarItem _ProgressBar = null; - public ProgressBarItem ProgressBar - { - get { return _ProgressBar; } - set - { - _ProgressBar = value; - _ProgressBar.TextVisible = true; - } - } - private void DoProgressBarRefresh(int value, int max, string text) - { - if (ProgressBar == null) return; - ProgressBar.Maximum = max; - ProgressBar.Value = value; - ProgressBar.Text = text; - Application.DoEvents(); - } - private string InitialProgressBarMessage - { - set - { - if (ProgressBar == null) return; - ProgressBar.Maximum = 100; - ProgressBar.Value = 0; - ProgressBar.Text = value; - txtProcess.AppendText(value); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - } - } - private string FinalProgressBarMessage - { - set - { - if (ProgressBar == null) return; - ProgressBar.Value = 100; - ProgressBar.Maximum = 100; - ProgressBar.Text = value; - txtProcess.AppendText(value); - txtProcess.AppendText(Environment.NewLine); - txtProcess.AppendText(Environment.NewLine); - Application.DoEvents(); - } - } - private void cbxAdminTools_SelectedIndexChanged(object sender, EventArgs e) - { - selectedAdminTool = cbxAdminTools.SelectedItem as AdminTool; - if (selectedAdminTool == null) - { - lblCaption.Text = string.Empty; - lblDescription.Text = string.Empty; - lblWarning.Text = string.Empty; - myTV.Nodes.Clear(); - btnRefresh.Text = "NO OPTION SELECTED"; - } - else - { - lblCaption.Text = selectedAdminTool.Caption; - lblDescription.Text = selectedAdminTool.Description; - lblWarning.Text = selectedAdminTool.WarningPrefix + " " + selectedAdminTool.Warning; - lblWarning.Visible = selectedAdminTool.Warning.Length > 0; - ResetTV(selectedAdminTool.NoProcedures); - btnRefresh.Text = selectedAdminTool.Title; - lblCaption.Focus(); - } - } - private void chkLater_CheckedChanged(object sender, EventArgs e) - { - pnlLater.Enabled = chkLater.Checked; - } - private void cbxAdminTools_Click(object sender, EventArgs e) - { - cbxAdminTools.DroppedDown = true; // expand dropdown list if user clicks anywhere on the dropdown control - } - } - public class AdminTool : IComparable - { - private string _Title; - public string Title - { - get { return _Title; } - set { _Title = value; } - } - private string _Caption; - public string Caption - { - get { return _Caption; } - set { _Caption = value; } - } - private string _Description; - public string Description - { - get { return _Description; } - set { _Description = value; } - } - private string _Warning; - public string Warning - { - get { return _Warning; } - set { _Warning = value; } - } - private string _WarningPrefix; - public string WarningPrefix - { - get { return _WarningPrefix; } - set { _WarningPrefix = value; } - } - private bool _NoProcedures; - public bool NoProcedures - { - get { return _NoProcedures; } - set { _NoProcedures = value; } - } - private bool _NoTreeView; - public bool NoTreeView - { - get { return _NoTreeView; } - set { _NoTreeView = value; } - } - private AdminToolExecute _MyExecute; - public AdminToolExecute MyExecute - { - get { return _MyExecute; } - set { _MyExecute = value; } - } - private string _StoredProcedure; - public string StoredProcedure - { - get { return _StoredProcedure; } - set { _StoredProcedure = value; } - } - public void Execute() - { - if (MyExecute != null) MyExecute(); - } - public AdminTool() - { - } - public AdminTool(string title, string caption, string description, string warning, string warningPrefix, bool noProcedures, bool noTreeView, AdminToolExecute myExecute) - { - _Title = title; - _Caption = caption; - _Description = description; - _Warning = warning; - _WarningPrefix = warningPrefix; - _NoProcedures = noProcedures; - _NoTreeView = noTreeView; - _MyExecute = myExecute; - } - public AdminTool(string title, string caption, string description, string warning, string warningPrefix, bool noProcedures, bool noTreeView, string storedProcedure, AdminToolExecute myExecute) - { - _Title = title; - _Caption = caption; - _Description = description; - _Warning = warning; - _WarningPrefix = warningPrefix; - _NoProcedures = noProcedures; - _NoTreeView = noTreeView; - _StoredProcedure = storedProcedure; - _MyExecute = myExecute; - } - public int CompareTo(AdminTool at) - { - return this.Title.CompareTo(at.Title); - } - } - public class AdminTools : List - { - public void Add(string title, string caption, string description, string warning, string warningPrefix, bool noProcedures, bool noTreeView, AdminToolExecute myExecute) - { - base.Add(new AdminTool(title, caption, description, warning, warningPrefix, noProcedures, noTreeView, myExecute)); - } - public void Add(string title, string caption, string description, string warning, string warningPrefix, bool noProcedures, bool noTreeView, string storedProcedure, AdminToolExecute myExecute) - { - base.Add(new AdminTool(title, caption, description, warning, warningPrefix, noProcedures, noTreeView, storedProcedure, myExecute)); - } - } - public delegate void AdminToolExecute(); -} diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh - Copy.designer.cs b/PROMS/VEPROMS User Interface/frmBatchRefresh - Copy.designer.cs deleted file mode 100644 index 37fe2ebf..00000000 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh - Copy.designer.cs +++ /dev/null @@ -1,472 +0,0 @@ -namespace VEPROMS -{ - partial class frmBatchRefresh - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.scBatch = new System.Windows.Forms.SplitContainer(); - this.splitContainer2 = new System.Windows.Forms.SplitContainer(); - this.lblWarning = new System.Windows.Forms.Label(); - this.lblDescription = new System.Windows.Forms.Label(); - this.lblCaption = new System.Windows.Forms.Label(); - this.cbxAdminTools = new DevComponents.DotNetBar.Controls.ComboBoxEx(); - this.label1 = new System.Windows.Forms.Label(); - this.myTV = new System.Windows.Forms.TreeView(); - this.label2 = new System.Windows.Forms.Label(); - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.panel2 = new System.Windows.Forms.Panel(); - this.txtProcess = new System.Windows.Forms.TextBox(); - this.pbProcess = new System.Windows.Forms.ProgressBar(); - this.label6 = new System.Windows.Forms.Label(); - this.panel3 = new System.Windows.Forms.Panel(); - this.pnlLater = new System.Windows.Forms.Panel(); - this.label5 = new System.Windows.Forms.Label(); - this.dtpTime = new System.Windows.Forms.DateTimePicker(); - this.dtpDate = new System.Windows.Forms.DateTimePicker(); - this.btnRefresh = new System.Windows.Forms.Button(); - this.chkLater = new System.Windows.Forms.CheckBox(); - this.label4 = new System.Windows.Forms.Label(); - this.txtResults = new System.Windows.Forms.TextBox(); - this.panel1 = new System.Windows.Forms.Panel(); - this.btnSave = new System.Windows.Forms.Button(); - this.btnClear = new System.Windows.Forms.Button(); - this.label3 = new System.Windows.Forms.Label(); - this.scBatch.Panel1.SuspendLayout(); - this.scBatch.Panel2.SuspendLayout(); - this.scBatch.SuspendLayout(); - this.splitContainer2.Panel1.SuspendLayout(); - this.splitContainer2.Panel2.SuspendLayout(); - this.splitContainer2.SuspendLayout(); - this.splitContainer1.Panel1.SuspendLayout(); - this.splitContainer1.Panel2.SuspendLayout(); - this.splitContainer1.SuspendLayout(); - this.panel2.SuspendLayout(); - this.panel3.SuspendLayout(); - this.pnlLater.SuspendLayout(); - this.panel1.SuspendLayout(); - this.SuspendLayout(); - // - // scBatch - // - this.scBatch.Dock = System.Windows.Forms.DockStyle.Fill; - this.scBatch.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; - this.scBatch.IsSplitterFixed = true; - this.scBatch.Location = new System.Drawing.Point(0, 0); - this.scBatch.Name = "scBatch"; - // - // scBatch.Panel1 - // - this.scBatch.Panel1.Controls.Add(this.splitContainer2); - // - // scBatch.Panel2 - // - this.scBatch.Panel2.Controls.Add(this.splitContainer1); - this.scBatch.Size = new System.Drawing.Size(994, 472); - this.scBatch.SplitterDistance = 300; - this.scBatch.TabIndex = 1; - // - // splitContainer2 - // - this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer2.Location = new System.Drawing.Point(0, 0); - this.splitContainer2.Name = "splitContainer2"; - this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // splitContainer2.Panel1 - // - this.splitContainer2.Panel1.Controls.Add(this.lblWarning); - this.splitContainer2.Panel1.Controls.Add(this.lblDescription); - this.splitContainer2.Panel1.Controls.Add(this.lblCaption); - this.splitContainer2.Panel1.Controls.Add(this.cbxAdminTools); - this.splitContainer2.Panel1.Controls.Add(this.label1); - // - // splitContainer2.Panel2 - // - this.splitContainer2.Panel2.Controls.Add(this.myTV); - this.splitContainer2.Panel2.Controls.Add(this.label2); - this.splitContainer2.Size = new System.Drawing.Size(300, 472); - this.splitContainer2.SplitterDistance = 219; - this.splitContainer2.TabIndex = 0; - // - // lblWarning - // - this.lblWarning.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lblWarning.BackColor = System.Drawing.Color.PaleGoldenrod; - this.lblWarning.ForeColor = System.Drawing.Color.Red; - this.lblWarning.Location = new System.Drawing.Point(5, 175); - this.lblWarning.Name = "lblWarning"; - this.lblWarning.Size = new System.Drawing.Size(290, 38); - this.lblWarning.TabIndex = 4; - this.lblWarning.Visible = false; - // - // lblDescription - // - this.lblDescription.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lblDescription.Location = new System.Drawing.Point(5, 66); - this.lblDescription.Name = "lblDescription"; - this.lblDescription.Size = new System.Drawing.Size(290, 109); - this.lblDescription.TabIndex = 3; - // - // lblCaption - // - this.lblCaption.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.lblCaption.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblCaption.Location = new System.Drawing.Point(5, 48); - this.lblCaption.Name = "lblCaption"; - this.lblCaption.Size = new System.Drawing.Size(290, 19); - this.lblCaption.TabIndex = 2; - this.lblCaption.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // cbxAdminTools - // - this.cbxAdminTools.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.cbxAdminTools.FlatStyle = System.Windows.Forms.FlatStyle.Standard; - this.cbxAdminTools.FormattingEnabled = true; - this.cbxAdminTools.Location = new System.Drawing.Point(5, 27); - this.cbxAdminTools.Name = "cbxAdminTools"; - this.cbxAdminTools.Size = new System.Drawing.Size(290, 21); - this.cbxAdminTools.TabIndex = 1; - this.cbxAdminTools.WatermarkBehavior = DevComponents.DotNetBar.eWatermarkBehavior.HideNonEmpty; - this.cbxAdminTools.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cbxAdminTools.WatermarkText = "Select Adminstrative Tool"; - this.cbxAdminTools.SelectedIndexChanged += new System.EventHandler(this.cbxAdminTools_SelectedIndexChanged); - this.cbxAdminTools.Click += new System.EventHandler(this.cbxAdminTools_Click); - // - // label1 - // - this.label1.BackColor = System.Drawing.SystemColors.ActiveCaption; - this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.label1.Dock = System.Windows.Forms.DockStyle.Top; - this.label1.Location = new System.Drawing.Point(0, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(300, 23); - this.label1.TabIndex = 0; - this.label1.Text = "Options"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // myTV - // - this.myTV.CheckBoxes = true; - this.myTV.Dock = System.Windows.Forms.DockStyle.Fill; - this.myTV.Location = new System.Drawing.Point(0, 23); - this.myTV.Name = "myTV"; - this.myTV.Size = new System.Drawing.Size(300, 226); - this.myTV.TabIndex = 4; - this.myTV.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.myTV_AfterCheck); - // - // label2 - // - this.label2.BackColor = System.Drawing.SystemColors.ActiveCaption; - this.label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.label2.Dock = System.Windows.Forms.DockStyle.Top; - this.label2.Location = new System.Drawing.Point(0, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(300, 23); - this.label2.TabIndex = 1; - this.label2.Text = "Selected Procedures Or Sets"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // splitContainer1 - // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; - this.splitContainer1.Location = new System.Drawing.Point(0, 0); - this.splitContainer1.Name = "splitContainer1"; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.Controls.Add(this.panel2); - this.splitContainer1.Panel1.Controls.Add(this.label4); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.Controls.Add(this.txtResults); - this.splitContainer1.Panel2.Controls.Add(this.panel1); - this.splitContainer1.Panel2.Controls.Add(this.label3); - this.splitContainer1.Size = new System.Drawing.Size(690, 472); - this.splitContainer1.SplitterDistance = 300; - this.splitContainer1.TabIndex = 0; - // - // panel2 - // - this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.panel2.Controls.Add(this.txtProcess); - this.panel2.Controls.Add(this.pbProcess); - this.panel2.Controls.Add(this.label6); - this.panel2.Controls.Add(this.panel3); - this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel2.Location = new System.Drawing.Point(0, 23); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(300, 449); - this.panel2.TabIndex = 4; - // - // txtProcess - // - this.txtProcess.AcceptsReturn = true; - this.txtProcess.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtProcess.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtProcess.Location = new System.Drawing.Point(0, 145); - this.txtProcess.Multiline = true; - this.txtProcess.Name = "txtProcess"; - this.txtProcess.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.txtProcess.Size = new System.Drawing.Size(298, 302); - this.txtProcess.TabIndex = 5; - // - // pbProcess - // - this.pbProcess.Dock = System.Windows.Forms.DockStyle.Top; - this.pbProcess.Location = new System.Drawing.Point(0, 122); - this.pbProcess.Name = "pbProcess"; - this.pbProcess.Size = new System.Drawing.Size(298, 23); - this.pbProcess.TabIndex = 6; - // - // label6 - // - this.label6.BackColor = System.Drawing.SystemColors.ActiveCaption; - this.label6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.label6.Dock = System.Windows.Forms.DockStyle.Top; - this.label6.Location = new System.Drawing.Point(0, 99); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(298, 23); - this.label6.TabIndex = 3; - this.label6.Text = "Process Status"; - this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // panel3 - // - this.panel3.Controls.Add(this.pnlLater); - this.panel3.Controls.Add(this.btnRefresh); - this.panel3.Controls.Add(this.chkLater); - this.panel3.Dock = System.Windows.Forms.DockStyle.Top; - this.panel3.Location = new System.Drawing.Point(0, 0); - this.panel3.Name = "panel3"; - this.panel3.Padding = new System.Windows.Forms.Padding(6); - this.panel3.Size = new System.Drawing.Size(298, 99); - this.panel3.TabIndex = 2; - // - // pnlLater - // - this.pnlLater.Controls.Add(this.label5); - this.pnlLater.Controls.Add(this.dtpTime); - this.pnlLater.Controls.Add(this.dtpDate); - this.pnlLater.Dock = System.Windows.Forms.DockStyle.Top; - this.pnlLater.Enabled = false; - this.pnlLater.Location = new System.Drawing.Point(6, 23); - this.pnlLater.Name = "pnlLater"; - this.pnlLater.Padding = new System.Windows.Forms.Padding(6); - this.pnlLater.Size = new System.Drawing.Size(286, 37); - this.pnlLater.TabIndex = 3; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(105, 15); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(18, 13); - this.label5.TabIndex = 5; - this.label5.Text = "@"; - // - // dtpTime - // - this.dtpTime.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.dtpTime.CustomFormat = "HH:mm"; - this.dtpTime.Format = System.Windows.Forms.DateTimePickerFormat.Custom; - this.dtpTime.Location = new System.Drawing.Point(129, 9); - this.dtpTime.Name = "dtpTime"; - this.dtpTime.ShowUpDown = true; - this.dtpTime.Size = new System.Drawing.Size(140, 20); - this.dtpTime.TabIndex = 4; - // - // dtpDate - // - this.dtpDate.Format = System.Windows.Forms.DateTimePickerFormat.Short; - this.dtpDate.Location = new System.Drawing.Point(9, 9); - this.dtpDate.Name = "dtpDate"; - this.dtpDate.Size = new System.Drawing.Size(90, 20); - this.dtpDate.TabIndex = 3; - // - // btnRefresh - // - this.btnRefresh.Dock = System.Windows.Forms.DockStyle.Bottom; - this.btnRefresh.Location = new System.Drawing.Point(6, 65); - this.btnRefresh.Name = "btnRefresh"; - this.btnRefresh.Size = new System.Drawing.Size(286, 28); - this.btnRefresh.TabIndex = 1; - this.btnRefresh.Text = "NO OPTION SELECTED"; - this.btnRefresh.UseVisualStyleBackColor = true; - this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click); - // - // chkLater - // - this.chkLater.AutoSize = true; - this.chkLater.Dock = System.Windows.Forms.DockStyle.Top; - this.chkLater.Location = new System.Drawing.Point(6, 6); - this.chkLater.Name = "chkLater"; - this.chkLater.Size = new System.Drawing.Size(286, 17); - this.chkLater.TabIndex = 4; - this.chkLater.Text = "Process Later"; - this.chkLater.UseVisualStyleBackColor = true; - this.chkLater.CheckedChanged += new System.EventHandler(this.chkLater_CheckedChanged); - // - // label4 - // - this.label4.BackColor = System.Drawing.SystemColors.ActiveCaption; - this.label4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.label4.Dock = System.Windows.Forms.DockStyle.Top; - this.label4.Location = new System.Drawing.Point(0, 0); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(300, 23); - this.label4.TabIndex = 3; - this.label4.Text = "Process"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // txtResults - // - this.txtResults.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtResults.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.txtResults.Location = new System.Drawing.Point(0, 52); - this.txtResults.Multiline = true; - this.txtResults.Name = "txtResults"; - this.txtResults.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.txtResults.Size = new System.Drawing.Size(386, 420); - this.txtResults.TabIndex = 4; - // - // panel1 - // - this.panel1.Controls.Add(this.btnSave); - this.panel1.Controls.Add(this.btnClear); - this.panel1.Dock = System.Windows.Forms.DockStyle.Top; - this.panel1.Location = new System.Drawing.Point(0, 23); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(386, 29); - this.panel1.TabIndex = 3; - // - // btnSave - // - this.btnSave.Dock = System.Windows.Forms.DockStyle.Left; - this.btnSave.Location = new System.Drawing.Point(95, 0); - this.btnSave.Name = "btnSave"; - this.btnSave.Size = new System.Drawing.Size(95, 29); - this.btnSave.TabIndex = 3; - this.btnSave.Text = "Save Results"; - this.btnSave.UseVisualStyleBackColor = true; - this.btnSave.Click += new System.EventHandler(this.btnSave_Click); - // - // btnClear - // - this.btnClear.Dock = System.Windows.Forms.DockStyle.Left; - this.btnClear.Location = new System.Drawing.Point(0, 0); - this.btnClear.Name = "btnClear"; - this.btnClear.Size = new System.Drawing.Size(95, 29); - this.btnClear.TabIndex = 2; - this.btnClear.Text = "Clear Results"; - this.btnClear.UseVisualStyleBackColor = true; - this.btnClear.Click += new System.EventHandler(this.btnClear_Click); - // - // label3 - // - this.label3.BackColor = System.Drawing.SystemColors.ActiveCaption; - this.label3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.label3.Dock = System.Windows.Forms.DockStyle.Top; - this.label3.Location = new System.Drawing.Point(0, 0); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(386, 23); - this.label3.TabIndex = 2; - this.label3.Text = "Results"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // frmBatchRefresh - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(994, 472); - this.Controls.Add(this.scBatch); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "frmBatchRefresh"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Administrative Tools"; - this.Load += new System.EventHandler(this.frmBatchRefresh_Load); - this.scBatch.Panel1.ResumeLayout(false); - this.scBatch.Panel2.ResumeLayout(false); - this.scBatch.ResumeLayout(false); - this.splitContainer2.Panel1.ResumeLayout(false); - this.splitContainer2.Panel2.ResumeLayout(false); - this.splitContainer2.ResumeLayout(false); - this.splitContainer1.Panel1.ResumeLayout(false); - this.splitContainer1.Panel2.ResumeLayout(false); - this.splitContainer1.Panel2.PerformLayout(); - this.splitContainer1.ResumeLayout(false); - this.panel2.ResumeLayout(false); - this.panel2.PerformLayout(); - this.panel3.ResumeLayout(false); - this.panel3.PerformLayout(); - this.pnlLater.ResumeLayout(false); - this.pnlLater.PerformLayout(); - this.panel1.ResumeLayout(false); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.SplitContainer scBatch; - private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.Button btnSave; - private System.Windows.Forms.Button btnClear; - private System.Windows.Forms.Button btnRefresh; - private System.Windows.Forms.SplitContainer splitContainer2; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.TextBox txtResults; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.Panel panel3; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.TreeView myTV; - private System.Windows.Forms.DateTimePicker dtpTime; - private System.Windows.Forms.DateTimePicker dtpDate; - private System.Windows.Forms.Panel pnlLater; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.TextBox txtProcess; - private System.Windows.Forms.ProgressBar pbProcess; - private DevComponents.DotNetBar.Controls.ComboBoxEx cbxAdminTools; - private System.Windows.Forms.Label lblCaption; - private System.Windows.Forms.Label lblDescription; - private System.Windows.Forms.Label lblWarning; - private System.Windows.Forms.CheckBox chkLater; - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/frmBatchRefresh - Copy.resx b/PROMS/VEPROMS User Interface/frmBatchRefresh - Copy.resx deleted file mode 100644 index 527d7b26..00000000 --- a/PROMS/VEPROMS User Interface/frmBatchRefresh - Copy.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 38 - - \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs.bak b/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs.bak deleted file mode 100644 index a5af8d4a..00000000 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs.bak +++ /dev/null @@ -1,1582 +0,0 @@ -namespace VEPROMS -{ - partial class frmVEPROMS - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmVEPROMS)); - this.ribbonControl1 = new DevComponents.DotNetBar.RibbonControl(); - this.btnHelp = new DevComponents.DotNetBar.ButtonItem(); - this.btnHelpManual = new DevComponents.DotNetBar.ButtonItem(); - this.btnHelpAbout = new DevComponents.DotNetBar.ButtonItem(); - this.btnHelpVWeb = new DevComponents.DotNetBar.ButtonItem(); - this.btnShortCuts = new DevComponents.DotNetBar.ButtonItem(); - this.btnSendErrorLog = new DevComponents.DotNetBar.ButtonItem(); - this.office2007StartButton1 = new DevComponents.DotNetBar.Office2007StartButton(); - this.itemContainer1 = new DevComponents.DotNetBar.ItemContainer(); - this.itemContainer2 = new DevComponents.DotNetBar.ItemContainer(); - this.itemContainer3 = new DevComponents.DotNetBar.ItemContainer(); - this.btnNew = new DevComponents.DotNetBar.ButtonItem(); - this.btnOpen = new DevComponents.DotNetBar.ButtonItem(); - this.btnPrint = new DevComponents.DotNetBar.ButtonItem(); - this.btnPrepare = new DevComponents.DotNetBar.ButtonItem(); - this.btnAdmin = new DevComponents.DotNetBar.ButtonItem(); - this.btnUpdateFormats = new DevComponents.DotNetBar.ButtonItem(); - this.icRecentDocs = new DevComponents.DotNetBar.ItemContainer(); - this.labelItem8 = new DevComponents.DotNetBar.LabelItem(); - this.itemContainer5 = new DevComponents.DotNetBar.ItemContainer(); - this.btnOptions = new DevComponents.DotNetBar.ButtonItem(); - this.btnExit = new DevComponents.DotNetBar.ButtonItem(); - this.qatCustomizeItem1 = new DevComponents.DotNetBar.QatCustomizeItem(); - this.galleryGroup1 = new DevComponents.DotNetBar.GalleryGroup(); - this.galleryGroup2 = new DevComponents.DotNetBar.GalleryGroup(); - this.galleryGroup3 = new DevComponents.DotNetBar.GalleryGroup(); - this.Common = new DevComponents.DotNetBar.GalleryGroup(); - this.Math = new DevComponents.DotNetBar.GalleryGroup(); - this.Misc = new DevComponents.DotNetBar.GalleryGroup(); - this.bottomBar = new DevComponents.DotNetBar.Bar(); - this.cmbFont = new System.Windows.Forms.ComboBox(); - this.labelItem10 = new DevComponents.DotNetBar.LabelItem(); - this.bottomProgBar = new DevComponents.DotNetBar.ProgressBarItem(); - this.labelItem20 = new DevComponents.DotNetBar.LabelItem(); - this.lblLocked = new DevComponents.DotNetBar.LabelItem(); - this.labelItem9 = new DevComponents.DotNetBar.LabelItem(); - this.lblEditView = new DevComponents.DotNetBar.LabelItem(); - this.labelItem11 = new DevComponents.DotNetBar.LabelItem(); - this.btnItemInfo = new DevComponents.DotNetBar.ButtonItem(); - this.lblItemID = new DevComponents.DotNetBar.LabelItem(); - this.lblResolution = new DevComponents.DotNetBar.LabelItem(); - this.btnEditItem = new DevComponents.DotNetBar.ButtonItem(); - this.epAnnotations = new DevComponents.DotNetBar.ExpandablePanel(); - this.ctrlAnnotationDetails = new Volian.Controls.Library.AnnotationDetails(); - this.btnAnnoDetailsPushPin = new DevComponents.DotNetBar.ButtonX(); - this.epProcedures = new DevComponents.DotNetBar.ExpandablePanel(); - this.tv = new Volian.Controls.Library.vlnTreeView(); - this.infoPanel = new DevComponents.DotNetBar.ExpandablePanel(); - this.infoTabs = new DevComponents.DotNetBar.TabControl(); - this.infotabControlPanelTags = new DevComponents.DotNetBar.TabControlPanel(); - this.panelEx1 = new DevComponents.DotNetBar.PanelEx(); - this.displayTags = new Volian.Controls.Library.DisplayTags(); - this.infotabTags = new DevComponents.DotNetBar.TabItem(this.components); - this.tcpApplicability = new DevComponents.DotNetBar.TabControlPanel(); - this.displayApplicability = new Volian.Controls.Library.DisplayApplicability(); - this.infotabApplicability = new DevComponents.DotNetBar.TabItem(this.components); - this.tabControlPanel1 = new DevComponents.DotNetBar.TabControlPanel(); - this.displayHistory = new Volian.Controls.Library.DisplayHistory(); - this.infotabHistory = new DevComponents.DotNetBar.TabItem(this.components); - this.infotabControlPanelRO = new DevComponents.DotNetBar.TabControlPanel(); - this.displayRO = new Volian.Controls.Library.DisplayRO(); - this.infotabRO = new DevComponents.DotNetBar.TabItem(this.components); - this.infotabControlPanelTransitions = new DevComponents.DotNetBar.TabControlPanel(); - this.displayTransition = new Volian.Controls.Library.DisplayTransition(); - this.infotabTransition = new DevComponents.DotNetBar.TabItem(this.components); - this.navigationPanePanel2 = new DevComponents.DotNetBar.NavigationPanePanel(); - this.expandableSplitter1 = new DevComponents.DotNetBar.ExpandableSplitter(); - this.expandableSplitter2 = new DevComponents.DotNetBar.ExpandableSplitter(); - this.expandableSplitter3 = new DevComponents.DotNetBar.ExpandableSplitter(); - this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip(); - this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.tmrTreeView = new System.Windows.Forms.Timer(this.components); - this.tmrAutomatic = new System.Windows.Forms.Timer(this.components); - this.toolsPanel = new DevComponents.DotNetBar.ExpandablePanel(); - this.toolsTabs = new DevComponents.DotNetBar.TabControl(); - this.annotationSearch = new DevComponents.DotNetBar.TabControlPanel(); - this.displaySearch1 = new Volian.Controls.Library.DisplaySearch(); - this.toolstabResults = new DevComponents.DotNetBar.TabItem(this.components); - this.tabControlPanel3 = new DevComponents.DotNetBar.TabControlPanel(); - this.displayReports = new Volian.Controls.Library.DisplayReports(); - this.toosTabReports = new DevComponents.DotNetBar.TabItem(this.components); - this.tabControlPanelLD = new DevComponents.DotNetBar.TabControlPanel(); - this.displayLibDocs = new Volian.Controls.Library.DisplayLibDocs(); - this.tabItemLibDocs = new DevComponents.DotNetBar.TabItem(this.components); - this.tabControlPanel2 = new DevComponents.DotNetBar.TabControlPanel(); - this.panelEx3 = new DevComponents.DotNetBar.PanelEx(); - this.displayBookMarks = new Volian.Controls.Library.DisplayBookMarks(); - this.toolsTabBookMarks = new DevComponents.DotNetBar.TabItem(this.components); - this.expandableSplitter4 = new DevComponents.DotNetBar.ExpandableSplitter(); - this.buttonItem1 = new DevComponents.DotNetBar.ButtonItem(); - this.itemAnnotationsBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.tc = new Volian.Controls.Library.DisplayTabControl(); - this.fbd = new System.Windows.Forms.FolderBrowserDialog(); - ((System.ComponentModel.ISupportInitialize)(this.bottomBar)).BeginInit(); - this.bottomBar.SuspendLayout(); - this.epAnnotations.SuspendLayout(); - this.epProcedures.SuspendLayout(); - this.infoPanel.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.infoTabs)).BeginInit(); - this.infoTabs.SuspendLayout(); - this.infotabControlPanelTags.SuspendLayout(); - this.panelEx1.SuspendLayout(); - this.tcpApplicability.SuspendLayout(); - this.tabControlPanel1.SuspendLayout(); - this.infotabControlPanelRO.SuspendLayout(); - this.infotabControlPanelTransitions.SuspendLayout(); - this.toolsPanel.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.toolsTabs)).BeginInit(); - this.toolsTabs.SuspendLayout(); - this.annotationSearch.SuspendLayout(); - this.tabControlPanel3.SuspendLayout(); - this.tabControlPanelLD.SuspendLayout(); - this.tabControlPanel2.SuspendLayout(); - this.panelEx3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.itemAnnotationsBindingSource)).BeginInit(); - this.SuspendLayout(); - // - // ribbonControl1 - // - // - // - // - this.ribbonControl1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ribbonControl1.CaptionVisible = true; - this.ribbonControl1.Dock = System.Windows.Forms.DockStyle.Top; - this.ribbonControl1.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btnHelp}); - this.ribbonControl1.KeyTipsEnabled = false; - this.ribbonControl1.KeyTipsFont = new System.Drawing.Font("Tahoma", 7F); - this.ribbonControl1.Location = new System.Drawing.Point(5, 1); - this.ribbonControl1.Name = "ribbonControl1"; - this.ribbonControl1.Padding = new System.Windows.Forms.Padding(0, 0, 0, 2); - this.ribbonControl1.QuickToolbarItems.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.office2007StartButton1, - this.qatCustomizeItem1}); - this.ribbonControl1.Size = new System.Drawing.Size(1185, 56); - this.ribbonControl1.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.ribbonControl1.SystemText.MaximizeRibbonText = "&Maximize the Ribbon"; - this.ribbonControl1.SystemText.MinimizeRibbonText = "Mi&nimize the Ribbon"; - this.ribbonControl1.SystemText.QatAddItemText = "&Add to Quick Access Toolbar"; - this.ribbonControl1.SystemText.QatCustomizeMenuLabel = "Customize Quick Access Toolbar"; - this.ribbonControl1.SystemText.QatCustomizeText = "&Customize Quick Access Toolbar..."; - this.ribbonControl1.SystemText.QatDialogAddButton = "&Add >>"; - this.ribbonControl1.SystemText.QatDialogCancelButton = "Cancel"; - this.ribbonControl1.SystemText.QatDialogCaption = "Customize Quick Access Toolbar"; - this.ribbonControl1.SystemText.QatDialogCategoriesLabel = "&Choose commands from:"; - this.ribbonControl1.SystemText.QatDialogOkButton = "OK"; - this.ribbonControl1.SystemText.QatDialogPlacementCheckbox = "&Place Quick Access Toolbar below the Ribbon"; - this.ribbonControl1.SystemText.QatDialogRemoveButton = "&Remove"; - this.ribbonControl1.SystemText.QatPlaceAboveRibbonText = "&Place Quick Access Toolbar above the Ribbon"; - this.ribbonControl1.SystemText.QatPlaceBelowRibbonText = "&Place Quick Access Toolbar below the Ribbon"; - this.ribbonControl1.SystemText.QatRemoveItemText = "&Remove from Quick Access Toolbar"; - this.ribbonControl1.TabGroupHeight = 14; - this.ribbonControl1.TabIndex = 0; - this.ribbonControl1.Text = "ribbonControl1"; - // - // btnHelp - // - this.btnHelp.AutoExpandOnClick = true; - this.btnHelp.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btnHelp.Image = ((System.Drawing.Image)(resources.GetObject("btnHelp.Image"))); - this.btnHelp.ItemAlignment = DevComponents.DotNetBar.eItemAlignment.Far; - this.btnHelp.KeyTips = "?"; - this.btnHelp.Name = "btnHelp"; - this.btnHelp.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btnHelpManual, - this.btnHelpAbout, - this.btnHelpVWeb, - this.btnShortCuts, - this.btnSendErrorLog}); - this.btnHelp.Text = "Help"; - // - // btnHelpManual - // - this.btnHelpManual.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btnHelpManual.Image = ((System.Drawing.Image)(resources.GetObject("btnHelpManual.Image"))); - this.btnHelpManual.Name = "btnHelpManual"; - this.btnHelpManual.Text = "User Manual"; - // - // btnHelpAbout - // - this.btnHelpAbout.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btnHelpAbout.Image = ((System.Drawing.Image)(resources.GetObject("btnHelpAbout.Image"))); - this.btnHelpAbout.Name = "btnHelpAbout"; - this.btnHelpAbout.Text = "About"; - this.btnHelpAbout.Click += new System.EventHandler(this.btnAbout_Click); - // - // btnHelpVWeb - // - this.btnHelpVWeb.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btnHelpVWeb.Image = ((System.Drawing.Image)(resources.GetObject("btnHelpVWeb.Image"))); - this.btnHelpVWeb.Name = "btnHelpVWeb"; - this.btnHelpVWeb.Text = "Volian Web"; - this.btnHelpVWeb.Click += new System.EventHandler(this.btnVlnWeb_Click); - // - // btnShortCuts - // - this.btnShortCuts.Image = global::VEPROMS.Properties.Resources.GotoShortcutsHS; - this.btnShortCuts.Name = "btnShortCuts"; - this.btnShortCuts.Text = "Shortcut List"; - this.btnShortCuts.Click += new System.EventHandler(this.btnShortCuts_Click); - // - // btnSendErrorLog - // - this.btnSendErrorLog.Image = global::VEPROMS.Properties.Resources.EnvelopeHS; - this.btnSendErrorLog.Name = "btnSendErrorLog"; - this.btnSendErrorLog.Text = "Send Error Log"; - this.btnSendErrorLog.Click += new System.EventHandler(this.btnSendErrorLog_Click); - // - // office2007StartButton1 - // - this.office2007StartButton1.AutoExpandOnClick = true; - this.office2007StartButton1.CanCustomize = false; - this.office2007StartButton1.Cursor = System.Windows.Forms.Cursors.Hand; - this.office2007StartButton1.HotTrackingStyle = DevComponents.DotNetBar.eHotTrackingStyle.Image; - this.office2007StartButton1.Image = ((System.Drawing.Image)(resources.GetObject("office2007StartButton1.Image"))); - this.office2007StartButton1.ImagePaddingHorizontal = 2; - this.office2007StartButton1.ImagePaddingVertical = 2; - this.office2007StartButton1.KeyTips = "V"; - this.office2007StartButton1.Name = "office2007StartButton1"; - this.office2007StartButton1.ShowSubItems = false; - this.office2007StartButton1.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.itemContainer1}); - this.office2007StartButton1.Text = "&File"; - this.office2007StartButton1.Click += new System.EventHandler(this.office2007StartButton1_Click); - // - // itemContainer1 - // - // - // - // - this.itemContainer1.BackgroundStyle.Class = "RibbonFileMenuContainer"; - this.itemContainer1.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.itemContainer1.LayoutOrientation = DevComponents.DotNetBar.eOrientation.Vertical; - this.itemContainer1.Name = "itemContainer1"; - this.itemContainer1.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.itemContainer2, - this.itemContainer5}); - // - // itemContainer2 - // - // - // - // - this.itemContainer2.BackgroundStyle.Class = "RibbonFileMenuTwoColumnContainer"; - this.itemContainer2.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.itemContainer2.ItemSpacing = 0; - this.itemContainer2.Name = "itemContainer2"; - this.itemContainer2.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.itemContainer3, - this.icRecentDocs}); - // - // itemContainer3 - // - // - // - // - this.itemContainer3.BackgroundStyle.Class = "RibbonFileMenuColumnOneContainer"; - this.itemContainer3.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.itemContainer3.LayoutOrientation = DevComponents.DotNetBar.eOrientation.Vertical; - this.itemContainer3.MinimumSize = new System.Drawing.Size(120, 0); - this.itemContainer3.Name = "itemContainer3"; - this.itemContainer3.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btnNew, - this.btnOpen, - this.btnPrint, - this.btnPrepare, - this.btnAdmin}); - // - // btnNew - // - this.btnNew.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btnNew.Image = ((System.Drawing.Image)(resources.GetObject("btnNew.Image"))); - this.btnNew.Name = "btnNew"; - this.btnNew.SubItemsExpandWidth = 24; - this.btnNew.Text = "&New"; - this.btnNew.Click += new System.EventHandler(this.btnNew_Click); - // - // btnOpen - // - this.btnOpen.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btnOpen.Image = ((System.Drawing.Image)(resources.GetObject("btnOpen.Image"))); - this.btnOpen.Name = "btnOpen"; - this.btnOpen.Shortcuts.Add(DevComponents.DotNetBar.eShortcut.CtrlO); - this.btnOpen.SubItemsExpandWidth = 24; - this.btnOpen.Text = "&Open..."; - this.btnOpen.Click += new System.EventHandler(this.btnOpen_Click); - // - // btnPrint - // - this.btnPrint.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btnPrint.Enabled = false; - this.btnPrint.Image = ((System.Drawing.Image)(resources.GetObject("btnPrint.Image"))); - this.btnPrint.Name = "btnPrint"; - this.btnPrint.SubItemsExpandWidth = 24; - this.btnPrint.Text = "Create &PDF"; - this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click); - // - // btnPrepare - // - this.btnPrepare.BeginGroup = true; - this.btnPrepare.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btnPrepare.CanCustomize = false; - this.btnPrepare.Image = ((System.Drawing.Image)(resources.GetObject("btnPrepare.Image"))); - this.btnPrepare.Name = "btnPrepare"; - this.btnPrepare.SubItemsExpandWidth = 24; - this.btnPrepare.Text = "Pr&epare"; - this.btnPrepare.Visible = false; - // - // btnAdmin - // - this.btnAdmin.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btnAdmin.CanCustomize = false; - this.btnAdmin.Image = global::VEPROMS.Properties.Resources.Admin; - this.btnAdmin.Name = "btnAdmin"; - this.btnAdmin.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btnUpdateFormats}); - this.btnAdmin.Text = "A&dministration"; - // - // btnUpdateFormats - // - this.btnUpdateFormats.Name = "btnUpdateFormats"; - this.btnUpdateFormats.Text = "Update Formats"; - this.btnUpdateFormats.Click += new System.EventHandler(this.btnUpdateFormat_Click); - // - // icRecentDocs - // - // - // - // - this.icRecentDocs.BackgroundStyle.Class = "RibbonFileMenuColumnTwoContainer"; - this.icRecentDocs.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.icRecentDocs.LayoutOrientation = DevComponents.DotNetBar.eOrientation.Vertical; - this.icRecentDocs.MinimumSize = new System.Drawing.Size(180, 0); - this.icRecentDocs.Name = "icRecentDocs"; - this.icRecentDocs.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.labelItem8}); - // - // labelItem8 - // - this.labelItem8.BorderSide = DevComponents.DotNetBar.eBorderSide.Bottom; - this.labelItem8.BorderType = DevComponents.DotNetBar.eBorderType.Etched; - this.labelItem8.CanCustomize = false; - this.labelItem8.Name = "labelItem8"; - this.labelItem8.PaddingBottom = 2; - this.labelItem8.PaddingTop = 2; - this.labelItem8.Stretch = true; - this.labelItem8.Text = "Recent Documents"; - // - // itemContainer5 - // - // - // - // - this.itemContainer5.BackgroundStyle.Class = "RibbonFileMenuBottomContainer"; - this.itemContainer5.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.itemContainer5.HorizontalItemAlignment = DevComponents.DotNetBar.eHorizontalItemsAlignment.Right; - this.itemContainer5.Name = "itemContainer5"; - this.itemContainer5.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.btnOptions, - this.btnExit}); - // - // btnOptions - // - this.btnOptions.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btnOptions.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnOptions.Image"))); - this.btnOptions.Name = "btnOptions"; - this.btnOptions.SubItemsExpandWidth = 24; - this.btnOptions.Text = "Opt&ions"; - this.btnOptions.Click += new System.EventHandler(this.btnOptions_Click); - // - // btnExit - // - this.btnExit.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.ImageAndText; - this.btnExit.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnExit.Image = ((System.Drawing.Image)(resources.GetObject("btnExit.Image"))); - this.btnExit.Name = "btnExit"; - this.btnExit.SubItemsExpandWidth = 24; - this.btnExit.Text = "E&xit"; - this.btnExit.Click += new System.EventHandler(this.btnExit_Click); - // - // qatCustomizeItem1 - // - this.qatCustomizeItem1.Name = "qatCustomizeItem1"; - // - // galleryGroup1 - // - this.galleryGroup1.Name = "galleryGroup1"; - this.galleryGroup1.Text = "Common"; - // - // galleryGroup2 - // - this.galleryGroup2.DisplayOrder = 1; - this.galleryGroup2.Name = "galleryGroup2"; - this.galleryGroup2.Text = "Math"; - // - // galleryGroup3 - // - this.galleryGroup3.DisplayOrder = 2; - this.galleryGroup3.Name = "galleryGroup3"; - this.galleryGroup3.Text = "Misc."; - // - // Common - // - this.Common.DisplayOrder = 1; - this.Common.Name = "Common"; - this.Common.Text = "Common Symbols"; - // - // Math - // - this.Math.DisplayOrder = 2; - this.Math.Name = "Math"; - this.Math.Text = "Math"; - // - // Misc - // - this.Misc.DisplayOrder = 3; - this.Misc.Name = "Misc"; - this.Misc.Text = "Misc."; - // - // bottomBar - // - this.bottomBar.Controls.Add(this.cmbFont); - this.bottomBar.Dock = System.Windows.Forms.DockStyle.Bottom; - this.bottomBar.Font = new System.Drawing.Font("Segoe UI", 9F); - this.bottomBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.labelItem10, - this.bottomProgBar, - this.labelItem20, - this.lblLocked, - this.labelItem9, - this.lblEditView, - this.labelItem11, - this.btnItemInfo, - this.lblItemID, - this.lblResolution, - this.btnEditItem}); - this.bottomBar.Location = new System.Drawing.Point(5, 597); - this.bottomBar.Name = "bottomBar"; - this.bottomBar.Size = new System.Drawing.Size(1185, 25); - this.bottomBar.Stretch = true; - this.bottomBar.Style = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.bottomBar.TabIndex = 1; - this.bottomBar.TabStop = false; - this.bottomBar.Text = "bar1"; - // - // cmbFont - // - this.cmbFont.Dock = System.Windows.Forms.DockStyle.Right; - this.cmbFont.FormattingEnabled = true; - this.cmbFont.Location = new System.Drawing.Point(1013, 0); - this.cmbFont.Name = "cmbFont"; - this.cmbFont.Size = new System.Drawing.Size(172, 23); - this.cmbFont.TabIndex = 0; - this.cmbFont.SelectedIndexChanged += new System.EventHandler(this.cmbFont_SelectedIndexChanged); - // - // labelItem10 - // - this.labelItem10.BorderSide = DevComponents.DotNetBar.eBorderSide.Left; - this.labelItem10.BorderType = DevComponents.DotNetBar.eBorderType.Bump; - this.labelItem10.Name = "labelItem10"; - // - // bottomProgBar - // - // - // - // - this.bottomProgBar.BackStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.bottomProgBar.ChunkGradientAngle = 0F; - this.bottomProgBar.MenuVisibility = DevComponents.DotNetBar.eMenuVisibility.VisibleAlways; - this.bottomProgBar.Name = "bottomProgBar"; - this.bottomProgBar.RecentlyUsed = false; - this.bottomProgBar.Width = 150; - // - // labelItem20 - // - this.labelItem20.BorderSide = DevComponents.DotNetBar.eBorderSide.Left; - this.labelItem20.BorderType = DevComponents.DotNetBar.eBorderType.Bump; - this.labelItem20.Name = "labelItem20"; - // - // lblLocked - // - this.lblLocked.BackColor = System.Drawing.Color.Transparent; - this.lblLocked.ForeColor = System.Drawing.SystemColors.MenuText; - this.lblLocked.Image = global::VEPROMS.Properties.Resources.UnProtectFormHS; - this.lblLocked.Name = "lblLocked"; - this.lblLocked.Text = "Unlocked"; - // - // labelItem9 - // - this.labelItem9.BorderSide = DevComponents.DotNetBar.eBorderSide.Left; - this.labelItem9.BorderType = DevComponents.DotNetBar.eBorderType.Bump; - this.labelItem9.Name = "labelItem9"; - // - // lblEditView - // - this.lblEditView.BackColor = System.Drawing.Color.Transparent; - this.lblEditView.ForeColor = System.Drawing.SystemColors.MenuText; - this.lblEditView.Name = "lblEditView"; - this.lblEditView.Text = "Edit"; - // - // labelItem11 - // - this.labelItem11.BorderSide = DevComponents.DotNetBar.eBorderSide.Left; - this.labelItem11.BorderType = DevComponents.DotNetBar.eBorderType.Bump; - this.labelItem11.Name = "labelItem11"; - // - // btnItemInfo - // - this.btnItemInfo.ForeColor = System.Drawing.Color.Blue; - this.btnItemInfo.Name = "btnItemInfo"; - this.btnItemInfo.Text = "ItemInfo"; - this.btnItemInfo.Click += new System.EventHandler(this.btnItemInfo_Click); - // - // lblItemID - // - this.lblItemID.Name = "lblItemID"; - this.lblItemID.Text = "ItemID=\"\""; - // - // lblResolution - // - this.lblResolution.BackColor = System.Drawing.Color.Transparent; - this.lblResolution.ForeColor = System.Drawing.SystemColors.MenuText; - this.lblResolution.Name = "lblResolution"; - this.lblResolution.Text = "Edit"; - this.lblResolution.Click += new System.EventHandler(this.lblResolution_Click); - // - // btnEditItem - // - this.btnEditItem.ForeColor = System.Drawing.Color.Blue; - this.btnEditItem.Name = "btnEditItem"; - this.btnEditItem.Text = "EditItem"; - this.btnEditItem.Click += new System.EventHandler(this.btnEditItem_Click); - // - // epAnnotations - // - this.epAnnotations.CanvasColor = System.Drawing.SystemColors.Control; - this.epAnnotations.CollapseDirection = DevComponents.DotNetBar.eCollapseDirection.TopToBottom; - this.epAnnotations.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.epAnnotations.Controls.Add(this.ctrlAnnotationDetails); - this.epAnnotations.Controls.Add(this.btnAnnoDetailsPushPin); - this.epAnnotations.Dock = System.Windows.Forms.DockStyle.Bottom; - this.epAnnotations.Expanded = false; - this.epAnnotations.ExpandedBounds = new System.Drawing.Rectangle(4, 544, 1187, 202); - this.epAnnotations.ExpandOnTitleClick = true; - this.epAnnotations.Location = new System.Drawing.Point(5, 571); - this.epAnnotations.Name = "epAnnotations"; - this.epAnnotations.Size = new System.Drawing.Size(1185, 26); - this.epAnnotations.Style.Alignment = System.Drawing.StringAlignment.Center; - this.epAnnotations.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.epAnnotations.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.epAnnotations.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.epAnnotations.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; - this.epAnnotations.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.epAnnotations.Style.GradientAngle = 90; - this.epAnnotations.TabIndex = 2; - this.epAnnotations.ThemeAware = true; - this.epAnnotations.TitleStyle.Alignment = System.Drawing.StringAlignment.Center; - this.epAnnotations.TitleStyle.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.epAnnotations.TitleStyle.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.epAnnotations.TitleStyle.Border = DevComponents.DotNetBar.eBorderType.RaisedInner; - this.epAnnotations.TitleStyle.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.epAnnotations.TitleStyle.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.epAnnotations.TitleStyle.GradientAngle = 90; - this.epAnnotations.TitleText = "Annotation Details"; - this.epAnnotations.ExpandedChanged += new DevComponents.DotNetBar.ExpandChangeEventHandler(this.epAnnotations_ExpandedChanged); - this.epAnnotations.Resize += new System.EventHandler(this.epAnnotations_Resize); - this.epAnnotations.ExpandedChanging += new DevComponents.DotNetBar.ExpandChangeEventHandler(this.expandPanelExpandedChanging); - // - // ctrlAnnotationDetails - // - this.ctrlAnnotationDetails.AnnotationRTFText = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Microsoft S" + - "ans Serif;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20\\par\r\n}\r\n"; - this.ctrlAnnotationDetails.Annotations = null; - this.ctrlAnnotationDetails.AnnotationText = ""; - this.ctrlAnnotationDetails.CurrentAnnotation = null; - this.ctrlAnnotationDetails.Dock = System.Windows.Forms.DockStyle.Fill; - this.ctrlAnnotationDetails.Location = new System.Drawing.Point(0, 26); - this.ctrlAnnotationDetails.Margin = new System.Windows.Forms.Padding(2); - this.ctrlAnnotationDetails.Name = "ctrlAnnotationDetails"; - this.ctrlAnnotationDetails.Size = new System.Drawing.Size(1185, 0); - this.ctrlAnnotationDetails.TabIndex = 15; - // - // btnAnnoDetailsPushPin - // - this.btnAnnoDetailsPushPin.AccessibleRole = System.Windows.Forms.AccessibleRole.CheckButton; - this.btnAnnoDetailsPushPin.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnAnnoDetailsPushPin.AutoCheckOnClick = true; - this.btnAnnoDetailsPushPin.BackColor = System.Drawing.Color.Transparent; - this.btnAnnoDetailsPushPin.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.btnAnnoDetailsPushPin.ColorTable = DevComponents.DotNetBar.eButtonColor.Flat; - this.btnAnnoDetailsPushPin.FocusCuesEnabled = false; - this.btnAnnoDetailsPushPin.Image = ((System.Drawing.Image)(resources.GetObject("btnAnnoDetailsPushPin.Image"))); - this.btnAnnoDetailsPushPin.Location = new System.Drawing.Point(1130, 1); - this.btnAnnoDetailsPushPin.Name = "btnAnnoDetailsPushPin"; - this.btnAnnoDetailsPushPin.PressedImage = ((System.Drawing.Image)(resources.GetObject("btnAnnoDetailsPushPin.PressedImage"))); - this.btnAnnoDetailsPushPin.ShowSubItems = false; - this.btnAnnoDetailsPushPin.Size = new System.Drawing.Size(27, 23); - this.superTooltip1.SetSuperTooltip(this.btnAnnoDetailsPushPin, new DevComponents.DotNetBar.SuperTooltipInfo("Annotation Details Push Pin", "", "This will toggle between keeping the Annotation Details window opened or to open/" + - "close automatically.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); - this.btnAnnoDetailsPushPin.TabIndex = 14; - this.btnAnnoDetailsPushPin.ThemeAware = true; - // - // epProcedures - // - this.epProcedures.CanvasColor = System.Drawing.SystemColors.Control; - this.epProcedures.CollapseDirection = DevComponents.DotNetBar.eCollapseDirection.RightToLeft; - this.epProcedures.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.epProcedures.Controls.Add(this.tv); - this.epProcedures.Dock = System.Windows.Forms.DockStyle.Left; - this.epProcedures.Expanded = false; - this.epProcedures.ExpandedBounds = new System.Drawing.Rectangle(5, 57, 326, 593); - this.epProcedures.ExpandOnTitleClick = true; - this.epProcedures.Location = new System.Drawing.Point(5, 57); - this.epProcedures.Name = "epProcedures"; - this.epProcedures.Size = new System.Drawing.Size(30, 514); - this.epProcedures.Style.Alignment = System.Drawing.StringAlignment.Center; - this.epProcedures.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.epProcedures.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.epProcedures.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.epProcedures.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; - this.epProcedures.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.epProcedures.Style.GradientAngle = 90; - this.epProcedures.TabIndex = 3; - this.epProcedures.TitleStyle.Alignment = System.Drawing.StringAlignment.Center; - this.epProcedures.TitleStyle.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.epProcedures.TitleStyle.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.epProcedures.TitleStyle.Border = DevComponents.DotNetBar.eBorderType.RaisedInner; - this.epProcedures.TitleStyle.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.epProcedures.TitleStyle.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.epProcedures.TitleStyle.GradientAngle = 90; - this.epProcedures.TitleText = "Procedures"; - this.epProcedures.ExpandedChanged += new DevComponents.DotNetBar.ExpandChangeEventHandler(this.epProcedures_ExpandedChanged); - this.epProcedures.Resize += new System.EventHandler(this.resizeVerticalExpandedPanel); - this.epProcedures.ExpandedChanging += new DevComponents.DotNetBar.ExpandChangeEventHandler(this.expandPanelExpandedChanging); - // - // tv - // - this.tv.AllowDrop = true; - this.tv.Dock = System.Windows.Forms.DockStyle.Fill; - this.tv.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.tv.HideSelection = false; - this.tv.Location = new System.Drawing.Point(0, 26); - this.tv.Name = "tv"; - this.tv.Size = new System.Drawing.Size(30, 508); - this.tv.TabIndex = 1; - this.tv.MouseUp += new System.Windows.Forms.MouseEventHandler(this.tv_MouseUp); - this.tv.SectionShouldClose += new Volian.Controls.Library.vlnTreeViewSectionInfoEvent(this.tv_SectionShouldClose); - this.tv.WordSectionDeleted += new Volian.Controls.Library.WordSectionDeletedEvent(this.tv_WordSectionDeleted); - this.tv.BeforeExpand += new System.Windows.Forms.TreeViewCancelEventHandler(this.tv_BeforeExpand); - // - // infoPanel - // - this.infoPanel.CanvasColor = System.Drawing.SystemColors.Control; - this.infoPanel.CollapseDirection = DevComponents.DotNetBar.eCollapseDirection.LeftToRight; - this.infoPanel.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.infoPanel.Controls.Add(this.infoTabs); - this.infoPanel.Dock = System.Windows.Forms.DockStyle.Right; - this.infoPanel.ExpandOnTitleClick = true; - this.infoPanel.Location = new System.Drawing.Point(927, 57); - this.infoPanel.Name = "infoPanel"; - this.infoPanel.Size = new System.Drawing.Size(230, 514); - this.infoPanel.Style.Alignment = System.Drawing.StringAlignment.Center; - this.infoPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.infoPanel.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.infoPanel.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.infoPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; - this.infoPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.infoPanel.Style.GradientAngle = 90; - this.infoPanel.TabIndex = 4; - this.infoPanel.TitleStyle.Alignment = System.Drawing.StringAlignment.Center; - this.infoPanel.TitleStyle.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.infoPanel.TitleStyle.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.infoPanel.TitleStyle.Border = DevComponents.DotNetBar.eBorderType.RaisedInner; - this.infoPanel.TitleStyle.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.infoPanel.TitleStyle.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.infoPanel.TitleStyle.GradientAngle = 90; - this.infoPanel.TitleText = "Step Properties"; - this.infoPanel.Click += new System.EventHandler(this.infoPanel_Click); - this.infoPanel.ExpandedChanged += new DevComponents.DotNetBar.ExpandChangeEventHandler(this.infoPanel_ExpandedChanged); - this.infoPanel.Resize += new System.EventHandler(this.resizeVerticalExpandedPanel); - this.infoPanel.ExpandedChanging += new DevComponents.DotNetBar.ExpandChangeEventHandler(this.expandPanelExpandedChanging); - // - // infoTabs - // - this.infoTabs.BackColor = System.Drawing.Color.Transparent; - this.infoTabs.CanReorderTabs = true; - this.infoTabs.Controls.Add(this.infotabControlPanelTags); - this.infoTabs.Controls.Add(this.tcpApplicability); - this.infoTabs.Controls.Add(this.tabControlPanel1); - this.infoTabs.Controls.Add(this.infotabControlPanelRO); - this.infoTabs.Controls.Add(this.infotabControlPanelTransitions); - this.infoTabs.Dock = System.Windows.Forms.DockStyle.Fill; - this.infoTabs.Location = new System.Drawing.Point(0, 26); - this.infoTabs.Name = "infoTabs"; - this.infoTabs.SelectedTabFont = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Bold); - this.infoTabs.SelectedTabIndex = 0; - this.infoTabs.Size = new System.Drawing.Size(230, 488); - this.infoTabs.TabAlignment = DevComponents.DotNetBar.eTabStripAlignment.Right; - this.infoTabs.TabIndex = 1; - this.infoTabs.TabLayoutType = DevComponents.DotNetBar.eTabLayoutType.FixedWithNavigationBox; - this.infoTabs.Tabs.Add(this.infotabTags); - this.infoTabs.Tabs.Add(this.infotabRO); - this.infoTabs.Tabs.Add(this.infotabTransition); - this.infoTabs.Tabs.Add(this.infotabHistory); - this.infoTabs.Tabs.Add(this.infotabApplicability); - this.infoTabs.Text = "tabControl1"; - this.infoTabs.ThemeAware = true; - this.infoTabs.Visible = false; - // - // infotabControlPanelTags - // - this.infotabControlPanelTags.Controls.Add(this.panelEx1); - this.infotabControlPanelTags.Dock = System.Windows.Forms.DockStyle.Fill; - this.infotabControlPanelTags.Location = new System.Drawing.Point(0, 0); - this.infotabControlPanelTags.Name = "infotabControlPanelTags"; - this.infotabControlPanelTags.Padding = new System.Windows.Forms.Padding(1); - this.infotabControlPanelTags.Size = new System.Drawing.Size(203, 488); - this.infotabControlPanelTags.Style.BackColor1.Color = System.Drawing.SystemColors.Control; - this.infotabControlPanelTags.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.infotabControlPanelTags.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Top) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.infotabControlPanelTags.Style.GradientAngle = 180; - this.infotabControlPanelTags.TabIndex = 1; - this.infotabControlPanelTags.TabItem = this.infotabTags; - this.infotabControlPanelTags.ThemeAware = true; - // - // panelEx1 - // - this.panelEx1.CanvasColor = System.Drawing.SystemColors.Control; - this.panelEx1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.panelEx1.Controls.Add(this.displayTags); - this.panelEx1.Dock = System.Windows.Forms.DockStyle.Fill; - this.panelEx1.Location = new System.Drawing.Point(1, 1); - this.panelEx1.Name = "panelEx1"; - this.panelEx1.Size = new System.Drawing.Size(201, 486); - this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center; - this.panelEx1.Style.BackColor1.Color = System.Drawing.Color.Transparent; - this.panelEx1.Style.BackColor2.Color = System.Drawing.Color.SlateGray; - this.panelEx1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.panelEx1.Style.BorderColor.Color = System.Drawing.Color.Gray; - this.panelEx1.Style.ForeColor.Color = System.Drawing.Color.Transparent; - this.panelEx1.TabIndex = 1; - // - // displayTags - // - this.displayTags.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.displayTags.CurItemInfo = null; - this.displayTags.Dock = System.Windows.Forms.DockStyle.Top; - this.displayTags.IsVisible = false; - this.displayTags.Location = new System.Drawing.Point(0, 0); - this.displayTags.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.displayTags.MinimumSize = new System.Drawing.Size(100, 630); - this.displayTags.MyEditItem = null; - this.displayTags.Name = "displayTags"; - this.displayTags.NotVisibleEditItem = null; - this.displayTags.Size = new System.Drawing.Size(201, 630); - this.displayTags.TabIndex = 0; - // - // infotabTags - // - this.infotabTags.AttachedControl = this.infotabControlPanelTags; - this.infotabTags.Name = "infotabTags"; - this.infotabTags.Text = "Tags"; - this.infotabTags.Visible = false; - this.infotabTags.Click += new System.EventHandler(this.infotabTags_Click); - // - // tcpApplicability - // - this.tcpApplicability.Controls.Add(this.displayApplicability); - this.tcpApplicability.Dock = System.Windows.Forms.DockStyle.Fill; - this.tcpApplicability.Location = new System.Drawing.Point(0, 0); - this.tcpApplicability.Name = "tcpApplicability"; - this.tcpApplicability.Padding = new System.Windows.Forms.Padding(1); - this.tcpApplicability.Size = new System.Drawing.Size(203, 488); - this.tcpApplicability.Style.BackColor1.Color = System.Drawing.SystemColors.Control; - this.tcpApplicability.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tcpApplicability.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Top) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tcpApplicability.Style.GradientAngle = 180; - this.tcpApplicability.TabIndex = 7; - this.tcpApplicability.TabItem = this.infotabApplicability; - this.tcpApplicability.ThemeAware = true; - // - // displayApplicability - // - this.displayApplicability.Dock = System.Windows.Forms.DockStyle.Fill; - this.displayApplicability.Location = new System.Drawing.Point(1, 1); - this.displayApplicability.MyApplicability = ""; - this.displayApplicability.MyItemInfo = null; - this.displayApplicability.Name = "displayApplicability"; - this.displayApplicability.Size = new System.Drawing.Size(201, 486); - this.displayApplicability.TabIndex = 2; - // - // infotabApplicability - // - this.infotabApplicability.AttachedControl = this.tcpApplicability; - this.infotabApplicability.Name = "infotabApplicability"; - this.infotabApplicability.Text = "Applicability"; - this.infotabApplicability.Visible = false; - // - // tabControlPanel1 - // - this.tabControlPanel1.Controls.Add(this.displayHistory); - this.tabControlPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControlPanel1.Location = new System.Drawing.Point(0, 0); - this.tabControlPanel1.Name = "tabControlPanel1"; - this.tabControlPanel1.Padding = new System.Windows.Forms.Padding(1); - this.tabControlPanel1.Size = new System.Drawing.Size(203, 488); - this.tabControlPanel1.Style.BackColor1.Color = System.Drawing.SystemColors.Control; - this.tabControlPanel1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tabControlPanel1.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Top) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tabControlPanel1.Style.GradientAngle = 180; - this.tabControlPanel1.TabIndex = 6; - this.tabControlPanel1.TabItem = this.infotabHistory; - this.tabControlPanel1.ThemeAware = true; - // - // displayHistory - // - this.displayHistory.Dock = System.Windows.Forms.DockStyle.Fill; - this.displayHistory.Location = new System.Drawing.Point(1, 1); - this.displayHistory.Margin = new System.Windows.Forms.Padding(4); - this.displayHistory.MyEditItem = null; - this.displayHistory.MyItemInfo = null; - this.displayHistory.MyProcedureInfo = null; - this.displayHistory.Name = "displayHistory"; - this.displayHistory.Size = new System.Drawing.Size(1, 509); - this.displayHistory.TabIndex = 0; - // - // infotabHistory - // - this.infotabHistory.AttachedControl = this.tabControlPanel1; - this.infotabHistory.Name = "infotabHistory"; - this.infotabHistory.Text = "History"; - this.infotabHistory.Visible = false; - // - // infotabControlPanelRO - // - this.infotabControlPanelRO.Controls.Add(this.displayRO); - this.infotabControlPanelRO.Dock = System.Windows.Forms.DockStyle.Fill; - this.infotabControlPanelRO.Location = new System.Drawing.Point(0, 0); - this.infotabControlPanelRO.Name = "infotabControlPanelRO"; - this.infotabControlPanelRO.Padding = new System.Windows.Forms.Padding(1); - this.infotabControlPanelRO.Size = new System.Drawing.Size(203, 488); - this.infotabControlPanelRO.Style.BackColor1.Color = System.Drawing.SystemColors.Control; - this.infotabControlPanelRO.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.infotabControlPanelRO.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Top) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.infotabControlPanelRO.Style.GradientAngle = 180; - this.infotabControlPanelRO.TabIndex = 4; - this.infotabControlPanelRO.TabItem = this.infotabRO; - this.infotabControlPanelRO.ThemeAware = true; - // - // displayRO - // - this.displayRO.CurROLink = null; - this.displayRO.Dock = System.Windows.Forms.DockStyle.Fill; - this.displayRO.Location = new System.Drawing.Point(1, 1); - this.displayRO.Margin = new System.Windows.Forms.Padding(4); - this.displayRO.Mydvi = null; - this.displayRO.MyROFST = null; - this.displayRO.MyRTB = null; - this.displayRO.Name = "displayRO"; - this.displayRO.ProgressBar = null; - this.displayRO.ROTypeFilter = VEPROMS.CSLA.Library.E_ROValueType.All; - this.displayRO.Size = new System.Drawing.Size(201, 486); - this.displayRO.TabControl = null; - this.displayRO.TabIndex = 0; - // - // infotabRO - // - this.infotabRO.AttachedControl = this.infotabControlPanelRO; - this.infotabRO.Name = "infotabRO"; - this.infotabRO.Text = "RO"; - this.infotabRO.Visible = false; - this.infotabRO.Click += new System.EventHandler(this.infotabRO_Click); - // - // infotabControlPanelTransitions - // - this.infotabControlPanelTransitions.Controls.Add(this.displayTransition); - this.infotabControlPanelTransitions.Dock = System.Windows.Forms.DockStyle.Fill; - this.infotabControlPanelTransitions.Location = new System.Drawing.Point(0, 0); - this.infotabControlPanelTransitions.Name = "infotabControlPanelTransitions"; - this.infotabControlPanelTransitions.Padding = new System.Windows.Forms.Padding(1); - this.infotabControlPanelTransitions.Size = new System.Drawing.Size(203, 488); - this.infotabControlPanelTransitions.Style.BackColor1.Color = System.Drawing.SystemColors.Control; - this.infotabControlPanelTransitions.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.infotabControlPanelTransitions.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Top) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.infotabControlPanelTransitions.Style.GradientAngle = 180; - this.infotabControlPanelTransitions.TabIndex = 5; - this.infotabControlPanelTransitions.TabItem = this.infotabTransition; - this.infotabControlPanelTransitions.ThemeAware = true; - this.infotabControlPanelTransitions.Click += new System.EventHandler(this.infotabTransition_Click); - // - // displayTransition - // - this.displayTransition.AutoSize = true; - this.displayTransition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.displayTransition.CurTrans = null; - this.displayTransition.Dock = System.Windows.Forms.DockStyle.Fill; - this.displayTransition.Location = new System.Drawing.Point(1, 1); - this.displayTransition.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.displayTransition.MyRTB = null; - this.displayTransition.Name = "displayTransition"; - this.displayTransition.RangeColor = System.Drawing.Color.LightGray; - this.displayTransition.Size = new System.Drawing.Size(201, 486); - this.displayTransition.TabIndex = 0; - // - // infotabTransition - // - this.infotabTransition.AttachedControl = this.infotabControlPanelTransitions; - this.infotabTransition.Name = "infotabTransition"; - this.infotabTransition.Text = "Transition"; - this.infotabTransition.Visible = false; - this.infotabTransition.Click += new System.EventHandler(this.infotabTransition_Click); - // - // navigationPanePanel2 - // - this.navigationPanePanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.navigationPanePanel2.Location = new System.Drawing.Point(1, 1); - this.navigationPanePanel2.Name = "navigationPanePanel2"; - this.navigationPanePanel2.ParentItem = null; - this.navigationPanePanel2.Size = new System.Drawing.Size(199, 401); - this.navigationPanePanel2.Style.Alignment = System.Drawing.StringAlignment.Center; - this.navigationPanePanel2.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; - this.navigationPanePanel2.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; - this.navigationPanePanel2.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.navigationPanePanel2.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.navigationPanePanel2.Style.GradientAngle = 90; - this.navigationPanePanel2.TabIndex = 3; - // - // expandableSplitter1 - // - this.expandableSplitter1.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(147)))), ((int)(((byte)(207))))); - this.expandableSplitter1.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.expandableSplitter1.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.expandableSplitter1.Enabled = false; - this.expandableSplitter1.ExpandFillColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(147)))), ((int)(((byte)(207))))); - this.expandableSplitter1.ExpandFillColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.expandableSplitter1.ExpandLineColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.expandableSplitter1.ExpandLineColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.expandableSplitter1.GripDarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.expandableSplitter1.GripDarkColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.expandableSplitter1.GripLightColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(239)))), ((int)(((byte)(255))))); - this.expandableSplitter1.GripLightColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; - this.expandableSplitter1.HotBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(151)))), ((int)(((byte)(61))))); - this.expandableSplitter1.HotBackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(184)))), ((int)(((byte)(94))))); - this.expandableSplitter1.HotBackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemPressedBackground2; - this.expandableSplitter1.HotBackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemPressedBackground; - this.expandableSplitter1.HotExpandFillColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(147)))), ((int)(((byte)(207))))); - this.expandableSplitter1.HotExpandFillColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.expandableSplitter1.HotExpandLineColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.expandableSplitter1.HotExpandLineColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.expandableSplitter1.HotGripDarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(147)))), ((int)(((byte)(207))))); - this.expandableSplitter1.HotGripDarkColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.expandableSplitter1.HotGripLightColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(239)))), ((int)(((byte)(255))))); - this.expandableSplitter1.HotGripLightColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; - this.expandableSplitter1.Location = new System.Drawing.Point(35, 57); - this.expandableSplitter1.Name = "expandableSplitter1"; - this.expandableSplitter1.Size = new System.Drawing.Size(3, 514); - this.expandableSplitter1.Style = DevComponents.DotNetBar.eSplitterStyle.Office2007; - this.expandableSplitter1.TabIndex = 5; - this.expandableSplitter1.TabStop = false; - // - // expandableSplitter2 - // - this.expandableSplitter2.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(147)))), ((int)(((byte)(207))))); - this.expandableSplitter2.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.expandableSplitter2.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.expandableSplitter2.Dock = System.Windows.Forms.DockStyle.Bottom; - this.expandableSplitter2.Enabled = false; - this.expandableSplitter2.ExpandFillColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(147)))), ((int)(((byte)(207))))); - this.expandableSplitter2.ExpandFillColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.expandableSplitter2.ExpandLineColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.expandableSplitter2.ExpandLineColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.expandableSplitter2.GripDarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.expandableSplitter2.GripDarkColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.expandableSplitter2.GripLightColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(239)))), ((int)(((byte)(255))))); - this.expandableSplitter2.GripLightColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; - this.expandableSplitter2.HotBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(151)))), ((int)(((byte)(61))))); - this.expandableSplitter2.HotBackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(184)))), ((int)(((byte)(94))))); - this.expandableSplitter2.HotBackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemPressedBackground2; - this.expandableSplitter2.HotBackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemPressedBackground; - this.expandableSplitter2.HotExpandFillColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(147)))), ((int)(((byte)(207))))); - this.expandableSplitter2.HotExpandFillColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.expandableSplitter2.HotExpandLineColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.expandableSplitter2.HotExpandLineColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.expandableSplitter2.HotGripDarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(147)))), ((int)(((byte)(207))))); - this.expandableSplitter2.HotGripDarkColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.expandableSplitter2.HotGripLightColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(239)))), ((int)(((byte)(255))))); - this.expandableSplitter2.HotGripLightColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; - this.expandableSplitter2.Location = new System.Drawing.Point(38, 568); - this.expandableSplitter2.Name = "expandableSplitter2"; - this.expandableSplitter2.Size = new System.Drawing.Size(889, 3); - this.expandableSplitter2.Style = DevComponents.DotNetBar.eSplitterStyle.Office2007; - this.expandableSplitter2.TabIndex = 6; - this.expandableSplitter2.TabStop = false; - // - // expandableSplitter3 - // - this.expandableSplitter3.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(147)))), ((int)(((byte)(207))))); - this.expandableSplitter3.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.expandableSplitter3.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.expandableSplitter3.Dock = System.Windows.Forms.DockStyle.Right; - this.expandableSplitter3.Enabled = false; - this.expandableSplitter3.ExpandFillColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(147)))), ((int)(((byte)(207))))); - this.expandableSplitter3.ExpandFillColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.expandableSplitter3.ExpandLineColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.expandableSplitter3.ExpandLineColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.expandableSplitter3.GripDarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.expandableSplitter3.GripDarkColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.expandableSplitter3.GripLightColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(239)))), ((int)(((byte)(255))))); - this.expandableSplitter3.GripLightColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; - this.expandableSplitter3.HotBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(151)))), ((int)(((byte)(61))))); - this.expandableSplitter3.HotBackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(184)))), ((int)(((byte)(94))))); - this.expandableSplitter3.HotBackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemPressedBackground2; - this.expandableSplitter3.HotBackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemPressedBackground; - this.expandableSplitter3.HotExpandFillColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(147)))), ((int)(((byte)(207))))); - this.expandableSplitter3.HotExpandFillColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.expandableSplitter3.HotExpandLineColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.expandableSplitter3.HotExpandLineColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.expandableSplitter3.HotGripDarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(147)))), ((int)(((byte)(207))))); - this.expandableSplitter3.HotGripDarkColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.expandableSplitter3.HotGripLightColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(239)))), ((int)(((byte)(255))))); - this.expandableSplitter3.HotGripLightColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; - this.expandableSplitter3.Location = new System.Drawing.Point(924, 57); - this.expandableSplitter3.Name = "expandableSplitter3"; - this.expandableSplitter3.Size = new System.Drawing.Size(3, 511); - this.expandableSplitter3.Style = DevComponents.DotNetBar.eSplitterStyle.Office2007; - this.expandableSplitter3.TabIndex = 7; - this.expandableSplitter3.TabStop = false; - // - // superTooltip1 - // - this.superTooltip1.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F"; - // - // tmrTreeView - // - this.tmrTreeView.Interval = 10; - this.tmrTreeView.Tick += new System.EventHandler(this.tmrTreeView_Tick); - // - // tmrAutomatic - // - this.tmrAutomatic.Interval = 100; - this.tmrAutomatic.Tick += new System.EventHandler(this.tmrAutomatic_Tick); - // - // toolsPanel - // - this.toolsPanel.CanvasColor = System.Drawing.SystemColors.Control; - this.toolsPanel.CollapseDirection = DevComponents.DotNetBar.eCollapseDirection.LeftToRight; - this.toolsPanel.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.toolsPanel.Controls.Add(this.toolsTabs); - this.toolsPanel.Dock = System.Windows.Forms.DockStyle.Right; - this.toolsPanel.Expanded = false; - this.toolsPanel.ExpandedBounds = new System.Drawing.Rectangle(847, 57, 343, 631); - this.toolsPanel.ExpandOnTitleClick = true; - this.toolsPanel.Location = new System.Drawing.Point(1160, 57); - this.toolsPanel.Name = "toolsPanel"; - this.toolsPanel.Size = new System.Drawing.Size(30, 514); - this.toolsPanel.Style.Alignment = System.Drawing.StringAlignment.Center; - this.toolsPanel.Style.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.toolsPanel.Style.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.toolsPanel.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.toolsPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder; - this.toolsPanel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.toolsPanel.Style.GradientAngle = 90; - this.toolsPanel.TabIndex = 9; - this.toolsPanel.TitleStyle.Alignment = System.Drawing.StringAlignment.Center; - this.toolsPanel.TitleStyle.BackColor1.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.toolsPanel.TitleStyle.BackColor2.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.toolsPanel.TitleStyle.Border = DevComponents.DotNetBar.eBorderType.RaisedInner; - this.toolsPanel.TitleStyle.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.toolsPanel.TitleStyle.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.toolsPanel.TitleStyle.GradientAngle = 90; - this.toolsPanel.TitleText = "Tools"; - this.toolsPanel.ExpandedChanged += new DevComponents.DotNetBar.ExpandChangeEventHandler(this.toolsPanel_ExpandedChanged); - this.toolsPanel.Resize += new System.EventHandler(this.resizeVerticalExpandedPanel); - this.toolsPanel.ExpandedChanging += new DevComponents.DotNetBar.ExpandChangeEventHandler(this.expandPanelExpandedChanging); - // - // toolsTabs - // - this.toolsTabs.BackColor = System.Drawing.Color.Transparent; - this.toolsTabs.CanReorderTabs = true; - this.toolsTabs.Controls.Add(this.annotationSearch); - this.toolsTabs.Controls.Add(this.tabControlPanel3); - this.toolsTabs.Controls.Add(this.tabControlPanelLD); - this.toolsTabs.Controls.Add(this.tabControlPanel2); - this.toolsTabs.Dock = System.Windows.Forms.DockStyle.Fill; - this.toolsTabs.Location = new System.Drawing.Point(0, 26); - this.toolsTabs.Name = "toolsTabs"; - this.toolsTabs.SelectedTabFont = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Bold); - this.toolsTabs.SelectedTabIndex = 0; - this.toolsTabs.Size = new System.Drawing.Size(30, 605); - this.toolsTabs.TabAlignment = DevComponents.DotNetBar.eTabStripAlignment.Right; - this.toolsTabs.TabIndex = 1; - this.toolsTabs.TabLayoutType = DevComponents.DotNetBar.eTabLayoutType.FixedWithNavigationBox; - this.toolsTabs.Tabs.Add(this.toolstabResults); - this.toolsTabs.Tabs.Add(this.toolsTabBookMarks); - this.toolsTabs.Tabs.Add(this.tabItemLibDocs); - this.toolsTabs.Tabs.Add(this.toosTabReports); - this.toolsTabs.Text = "tabControl1"; - this.toolsTabs.ThemeAware = true; - // - // annotationSearch - // - this.annotationSearch.Controls.Add(this.displaySearch1); - this.annotationSearch.Dock = System.Windows.Forms.DockStyle.Fill; - this.annotationSearch.Location = new System.Drawing.Point(0, 0); - this.annotationSearch.Name = "annotationSearch"; - this.annotationSearch.Padding = new System.Windows.Forms.Padding(1); - this.annotationSearch.Size = new System.Drawing.Size(3, 605); - this.annotationSearch.Style.BackColor1.Color = System.Drawing.SystemColors.Control; - this.annotationSearch.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.annotationSearch.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Top) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.annotationSearch.Style.GradientAngle = 180; - this.annotationSearch.TabIndex = 3; - this.annotationSearch.TabItem = this.toolstabResults; - this.annotationSearch.ThemeAware = true; - // - // displaySearch1 - // - this.displaySearch1.Dock = System.Windows.Forms.DockStyle.Fill; - this.displaySearch1.LoadingList = false; - this.displaySearch1.Location = new System.Drawing.Point(1, 1); - this.displaySearch1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.displaySearch1.Mydocversion = null; - this.displaySearch1.MyROFSTLookup = null; - this.displaySearch1.Name = "displaySearch1"; - this.displaySearch1.ProgressBar = null; - this.displaySearch1.ReportTitle = null; - this.displaySearch1.RightToLeft = System.Windows.Forms.RightToLeft.Yes; - this.displaySearch1.SearchResults = null; - this.displaySearch1.SearchString = null; - this.displaySearch1.Size = new System.Drawing.Size(1, 603); - this.displaySearch1.TabIndex = 0; - this.displaySearch1.TypesSelected = null; - // - // toolstabResults - // - this.toolstabResults.AttachedControl = this.annotationSearch; - this.toolstabResults.Name = "toolstabResults"; - this.toolstabResults.Text = "Search"; - this.toolstabResults.Click += new System.EventHandler(this.infotabResults_Click); - // - // tabControlPanel3 - // - this.tabControlPanel3.Controls.Add(this.displayReports); - this.tabControlPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControlPanel3.Location = new System.Drawing.Point(0, 0); - this.tabControlPanel3.Name = "tabControlPanel3"; - this.tabControlPanel3.Padding = new System.Windows.Forms.Padding(1); - this.tabControlPanel3.Size = new System.Drawing.Size(3, 443); - this.tabControlPanel3.Style.BackColor1.Color = System.Drawing.SystemColors.Control; - this.tabControlPanel3.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tabControlPanel3.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Top) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tabControlPanel3.Style.GradientAngle = 180; - this.tabControlPanel3.TabIndex = 5; - this.tabControlPanel3.TabItem = this.toosTabReports; - this.tabControlPanel3.ThemeAware = true; - // - // displayReports - // - this.displayReports.Dock = System.Windows.Forms.DockStyle.Fill; - this.displayReports.Location = new System.Drawing.Point(1, 1); - this.displayReports.Margin = new System.Windows.Forms.Padding(2); - this.displayReports.Mydocversion = null; - this.displayReports.MyROFSTLookup = null; - this.displayReports.Name = "displayReports"; - this.displayReports.ReportResult = null; - this.displayReports.RightToLeft = System.Windows.Forms.RightToLeft.Yes; - this.displayReports.Size = new System.Drawing.Size(1, 441); - this.displayReports.TabIndex = 0; - // - // toosTabReports - // - this.toosTabReports.AttachedControl = this.tabControlPanel3; - this.toosTabReports.Name = "toosTabReports"; - this.toosTabReports.Text = "Reports"; - this.toosTabReports.Click += new System.EventHandler(this.toosTabReports_Click); - // - // tabControlPanelLD - // - this.tabControlPanelLD.Controls.Add(this.displayLibDocs); - this.tabControlPanelLD.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControlPanelLD.Location = new System.Drawing.Point(0, 0); - this.tabControlPanelLD.Name = "tabControlPanelLD"; - this.tabControlPanelLD.Padding = new System.Windows.Forms.Padding(1); - this.tabControlPanelLD.Size = new System.Drawing.Size(3, 443); - this.tabControlPanelLD.Style.BackColor1.Color = System.Drawing.SystemColors.Control; - this.tabControlPanelLD.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tabControlPanelLD.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Top) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tabControlPanelLD.Style.GradientAngle = 180; - this.tabControlPanelLD.TabIndex = 4; - this.tabControlPanelLD.TabItem = this.tabItemLibDocs; - this.tabControlPanelLD.ThemeAware = true; - // - // displayLibDocs - // - this.displayLibDocs.AutoScroll = true; - this.displayLibDocs.CurLibDoc = null; - this.displayLibDocs.Dock = System.Windows.Forms.DockStyle.Fill; - this.displayLibDocs.LibDocList = null; - this.displayLibDocs.Location = new System.Drawing.Point(1, 1); - this.displayLibDocs.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.displayLibDocs.Name = "displayLibDocs"; - this.displayLibDocs.Size = new System.Drawing.Size(1, 441); - this.displayLibDocs.TabIndex = 0; - // - // tabItemLibDocs - // - this.tabItemLibDocs.AttachedControl = this.tabControlPanelLD; - this.tabItemLibDocs.Name = "tabItemLibDocs"; - this.tabItemLibDocs.Text = "Library Documents"; - this.tabItemLibDocs.Click += new System.EventHandler(this.tabItemLibDocs_Click); - // - // tabControlPanel2 - // - this.tabControlPanel2.Controls.Add(this.panelEx3); - this.tabControlPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControlPanel2.Location = new System.Drawing.Point(0, 0); - this.tabControlPanel2.Name = "tabControlPanel2"; - this.tabControlPanel2.Padding = new System.Windows.Forms.Padding(1); - this.tabControlPanel2.Size = new System.Drawing.Size(3, 605); - this.tabControlPanel2.Style.BackColor1.Color = System.Drawing.SystemColors.Control; - this.tabControlPanel2.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tabControlPanel2.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Top) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tabControlPanel2.Style.GradientAngle = 180; - this.tabControlPanel2.TabIndex = 2; - this.tabControlPanel2.TabItem = this.toolsTabBookMarks; - this.tabControlPanel2.ThemeAware = true; - // - // panelEx3 - // - this.panelEx3.AutoScroll = true; - this.panelEx3.CanvasColor = System.Drawing.SystemColors.Control; - this.panelEx3.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.panelEx3.Controls.Add(this.displayBookMarks); - this.panelEx3.Dock = System.Windows.Forms.DockStyle.Fill; - this.panelEx3.Location = new System.Drawing.Point(1, 1); - this.panelEx3.Name = "panelEx3"; - this.panelEx3.Size = new System.Drawing.Size(1, 603); - this.panelEx3.Style.Alignment = System.Drawing.StringAlignment.Center; - this.panelEx3.Style.BackColor1.Color = System.Drawing.Color.Transparent; - this.panelEx3.Style.BackColor2.Color = System.Drawing.Color.SlateGray; - this.panelEx3.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.panelEx3.Style.BorderColor.Color = System.Drawing.Color.Gray; - this.panelEx3.Style.ForeColor.Color = System.Drawing.Color.Transparent; - this.panelEx3.TabIndex = 3; - // - // displayBookMarks - // - this.displayBookMarks.Dock = System.Windows.Forms.DockStyle.Fill; - this.displayBookMarks.Location = new System.Drawing.Point(0, 0); - this.displayBookMarks.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); - this.displayBookMarks.MyDisplayTabControl = null; - this.displayBookMarks.MyEditItem = null; - this.displayBookMarks.Name = "displayBookMarks"; - this.displayBookMarks.Size = new System.Drawing.Size(1, 603); - this.displayBookMarks.TabIndex = 0; - // - // toolsTabBookMarks - // - this.toolsTabBookMarks.AttachedControl = this.tabControlPanel2; - this.toolsTabBookMarks.Name = "toolsTabBookMarks"; - this.toolsTabBookMarks.Text = "Bookmarks"; - // - // tabControlPanelLD - // - this.tabControlPanelLD.Controls.Add(this.displayLibDocs); - this.tabControlPanelLD.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControlPanelLD.Location = new System.Drawing.Point(0, 0); - this.tabControlPanelLD.Name = "tabControlPanelLD"; - this.tabControlPanelLD.Padding = new System.Windows.Forms.Padding(1); - this.tabControlPanelLD.Size = new System.Drawing.Size(3, 605); - this.tabControlPanelLD.Style.BackColor1.Color = System.Drawing.SystemColors.Control; - this.tabControlPanelLD.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tabControlPanelLD.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Top) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tabControlPanelLD.Style.GradientAngle = 180; - this.tabControlPanelLD.TabIndex = 4; - this.tabControlPanelLD.TabItem = this.tabItemLibDocs; - this.tabControlPanelLD.ThemeAware = true; - // - // displayLibDocs - // - this.displayLibDocs.AutoScroll = true; - this.displayLibDocs.CurLibDoc = null; - this.displayLibDocs.Dock = System.Windows.Forms.DockStyle.Fill; - this.displayLibDocs.LibDocList = null; - this.displayLibDocs.Location = new System.Drawing.Point(1, 1); - this.displayLibDocs.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.displayLibDocs.Name = "displayLibDocs"; - this.displayLibDocs.Size = new System.Drawing.Size(1, 603); - this.displayLibDocs.TabIndex = 0; - // - // tabItemLibDocs - // - this.tabItemLibDocs.AttachedControl = this.tabControlPanelLD; - this.tabItemLibDocs.Name = "tabItemLibDocs"; - this.tabItemLibDocs.Text = "Library Documents"; - this.tabItemLibDocs.Click += new System.EventHandler(this.tabItemLibDocs_Click); - // - // expandableSplitter4 - // - this.expandableSplitter4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(239)))), ((int)(((byte)(255))))); - this.expandableSplitter4.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(147)))), ((int)(((byte)(207))))); - this.expandableSplitter4.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.expandableSplitter4.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.expandableSplitter4.Dock = System.Windows.Forms.DockStyle.Right; - this.expandableSplitter4.Enabled = false; - this.expandableSplitter4.ExpandFillColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(147)))), ((int)(((byte)(207))))); - this.expandableSplitter4.ExpandFillColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.expandableSplitter4.ExpandLineColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.expandableSplitter4.ExpandLineColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.expandableSplitter4.GripDarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.expandableSplitter4.GripDarkColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.expandableSplitter4.GripLightColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(239)))), ((int)(((byte)(255))))); - this.expandableSplitter4.GripLightColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; - this.expandableSplitter4.HotBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(151)))), ((int)(((byte)(61))))); - this.expandableSplitter4.HotBackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(184)))), ((int)(((byte)(94))))); - this.expandableSplitter4.HotBackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemPressedBackground2; - this.expandableSplitter4.HotBackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemPressedBackground; - this.expandableSplitter4.HotExpandFillColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(147)))), ((int)(((byte)(207))))); - this.expandableSplitter4.HotExpandFillColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.expandableSplitter4.HotExpandLineColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); - this.expandableSplitter4.HotExpandLineColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.ItemText; - this.expandableSplitter4.HotGripDarkColor = System.Drawing.Color.FromArgb(((int)(((byte)(101)))), ((int)(((byte)(147)))), ((int)(((byte)(207))))); - this.expandableSplitter4.HotGripDarkColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.expandableSplitter4.HotGripLightColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(239)))), ((int)(((byte)(255))))); - this.expandableSplitter4.HotGripLightColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; - this.expandableSplitter4.Location = new System.Drawing.Point(1157, 57); - this.expandableSplitter4.Name = "expandableSplitter4"; - this.expandableSplitter4.Size = new System.Drawing.Size(3, 514); - this.expandableSplitter4.Style = DevComponents.DotNetBar.eSplitterStyle.Office2007; - this.expandableSplitter4.TabIndex = 3; - this.expandableSplitter4.TabStop = false; - // - // buttonItem1 - // - this.buttonItem1.Image = ((System.Drawing.Image)(resources.GetObject("buttonItem1.Image"))); - this.buttonItem1.Name = "buttonItem1"; - this.buttonItem1.Text = "buttonItem19"; - this.buttonItem1.Tooltip = "Degree"; - // - // itemAnnotationsBindingSource - // - this.itemAnnotationsBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.ItemAnnotation); - // - // tc - // - this.tc.Dock = System.Windows.Forms.DockStyle.Fill; - this.tc.ForeColor = System.Drawing.SystemColors.ControlText; - this.tc.Location = new System.Drawing.Point(38, 57); - this.tc.Margin = new System.Windows.Forms.Padding(4); - this.tc.MyCopyStep = null; - this.tc.Name = "tc"; - this.tc.RibbonExpanded = true; - this.tc.SelectedDisplayTabItem = null; - this.tc.Size = new System.Drawing.Size(886, 511); - this.tc.TabIndex = 8; - this.tc.PanelTabDisplay += new Volian.Controls.Library.StepPanelTabDisplayEvent(this.tc_PanelTabDisplay); - this.tc.WordSectionClose += new Volian.Controls.Library.StepPanelWordSectionCloseEvent(this.tc_WordSectionClose); - this.tc.SelectedDisplayTabItemChanged += new Volian.Controls.Library.DisplayTabControlEvent(this.tc_SelectedDisplayTabItemChanged); - this.tc.ModeChange += new Volian.Controls.Library.StepPanelModeChangeEvent(this.tc_StepPanelModeChange); - this.tc.LinkModifyTran += new Volian.Controls.Library.StepPanelLinkEvent(this.tc_LinkModifyTran); - this.tc.WordSectionDeleted += new Volian.Controls.Library.StepPanelWordSectionDeletedEvent(this.tc_WordSectionDeleted); - this.tc.ItemSelectedChanged += new Volian.Controls.Library.ItemSelectedChangedEvent(this.tc_ItemSelectedChanged); - this.tc.LinkModifyRO += new Volian.Controls.Library.StepPanelLinkEvent(this.tc_LinkModifyRO); - // - // frmVEPROMS - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.AutoScroll = true; - this.ClientSize = new System.Drawing.Size(1195, 624); - this.Controls.Add(this.tc); - this.Controls.Add(this.expandableSplitter3); - this.Controls.Add(this.expandableSplitter2); - this.Controls.Add(this.expandableSplitter1); - this.Controls.Add(this.infoPanel); - this.Controls.Add(this.expandableSplitter4); - this.Controls.Add(this.toolsPanel); - this.Controls.Add(this.epProcedures); - this.Controls.Add(this.epAnnotations); - this.Controls.Add(this.bottomBar); - this.Controls.Add(this.ribbonControl1); - this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.Name = "frmVEPROMS"; - this.Text = "Proms"; - this.Load += new System.EventHandler(this.frmVEPROMS_Load); - this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmVEPROMS_FormClosing); - this.Resize += new System.EventHandler(this.frmVEPROMS_Resize); - ((System.ComponentModel.ISupportInitialize)(this.bottomBar)).EndInit(); - this.bottomBar.ResumeLayout(false); - this.epAnnotations.ResumeLayout(false); - this.epProcedures.ResumeLayout(false); - this.infoPanel.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.infoTabs)).EndInit(); - this.infoTabs.ResumeLayout(false); - this.infotabControlPanelTags.ResumeLayout(false); - this.panelEx1.ResumeLayout(false); - this.tcpApplicability.ResumeLayout(false); - this.tabControlPanel1.ResumeLayout(false); - this.infotabControlPanelRO.ResumeLayout(false); - this.infotabControlPanelTransitions.ResumeLayout(false); - this.infotabControlPanelTransitions.PerformLayout(); - this.toolsPanel.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.toolsTabs)).EndInit(); - this.toolsTabs.ResumeLayout(false); - this.annotationSearch.ResumeLayout(false); - this.tabControlPanel3.ResumeLayout(false); - this.tabControlPanelLD.ResumeLayout(false); - this.tabControlPanel2.ResumeLayout(false); - this.panelEx3.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.itemAnnotationsBindingSource)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private DevComponents.DotNetBar.RibbonControl ribbonControl1; - private DevComponents.DotNetBar.Office2007StartButton office2007StartButton1; - private DevComponents.DotNetBar.ItemContainer itemContainer1; - private DevComponents.DotNetBar.ItemContainer itemContainer2; - private DevComponents.DotNetBar.ItemContainer itemContainer3; - private DevComponents.DotNetBar.ButtonItem btnNew; - private DevComponents.DotNetBar.ButtonItem btnOpen; - private DevComponents.DotNetBar.ButtonItem btnPrepare; - private DevComponents.DotNetBar.ButtonItem btnPrint; - private DevComponents.DotNetBar.ItemContainer icRecentDocs; - private DevComponents.DotNetBar.LabelItem labelItem8; - private DevComponents.DotNetBar.ItemContainer itemContainer5; - private DevComponents.DotNetBar.ButtonItem btnOptions; - private DevComponents.DotNetBar.ButtonItem btnExit; - private DevComponents.DotNetBar.QatCustomizeItem qatCustomizeItem1; - private DevComponents.DotNetBar.Bar bottomBar; - private DevComponents.DotNetBar.ProgressBarItem bottomProgBar; - private DevComponents.DotNetBar.ExpandablePanel epAnnotations; - private DevComponents.DotNetBar.ExpandablePanel epProcedures; - private DevComponents.DotNetBar.ExpandablePanel infoPanel; - private Volian.Controls.Library.vlnTreeView tv; - private DevComponents.DotNetBar.ExpandableSplitter expandableSplitter1; - private DevComponents.DotNetBar.ExpandableSplitter expandableSplitter2; - private DevComponents.DotNetBar.ExpandableSplitter expandableSplitter3; - private DevComponents.DotNetBar.TabControl infoTabs; - private DevComponents.DotNetBar.TabControlPanel infotabControlPanelTags; - private DevComponents.DotNetBar.TabItem infotabTags; - private DevComponents.DotNetBar.PanelEx panelEx1; - - private DevComponents.DotNetBar.Controls.CheckBoxX checkBoxX1; - private System.Windows.Forms.CheckedListBox checkedListBox1; - - //private System.Windows.Forms.PropertyGrid pg; - private DevComponents.DotNetBar.LabelItem labelItem9; - private DevComponents.DotNetBar.LabelItem labelItem10; - private DevComponents.DotNetBar.LabelItem labelItem11; - private DevComponents.DotNetBar.SuperTooltip superTooltip1; - private System.Windows.Forms.BindingSource itemAnnotationsBindingSource; - - private System.Windows.Forms.CheckBox checkBox1; - //private DevComponents.DotNetBar.Controls.GroupPanel groupPanel2; - //private DevComponents.DotNetBar.Controls.GroupPanel groupPanel1; - //private DevComponents.DotNetBar.Controls.GroupPanel groupPanel3; - - private DevComponents.DotNetBar.LabelItem labelItem20; - private DevComponents.DotNetBar.GalleryGroup Common; - private DevComponents.DotNetBar.GalleryGroup Math; - private DevComponents.DotNetBar.GalleryGroup Misc; - private DevComponents.DotNetBar.GalleryGroup galleryGroup1; - private DevComponents.DotNetBar.GalleryGroup galleryGroup2; - private DevComponents.DotNetBar.GalleryGroup galleryGroup3; - - //private DevComponents.DotNetBar.Controls.GroupPanel groupPanel4; - private DevComponents.DotNetBar.Controls.ComboBoxEx comboBoxEx1; - private DevComponents.DotNetBar.NavigationPanePanel navigationPanePanel2; - private DevComponents.DotNetBar.TabControlPanel infotabControlPanelRO; - private DevComponents.DotNetBar.TabItem infotabRO; - private DevComponents.DotNetBar.TabControlPanel infotabControlPanelTransitions; - private DevComponents.DotNetBar.TabItem infotabTransition; - private Volian.Controls.Library.DisplayTabControl tc; - private Volian.Controls.Library.DisplayTransition displayTransition; - private Volian.Controls.Library.DisplayRO displayRO; - private System.Windows.Forms.ToolTip toolTip1; - //private System.Windows.Forms.ComboBox cbGridAnnoType; - private DevComponents.DotNetBar.ButtonX btnAnnoDetailsPushPin; - private DevComponents.DotNetBar.ButtonItem buttonItem1; - private System.Windows.Forms.Timer tmrTreeView; - private System.Windows.Forms.Timer tmrAutomatic; - private Volian.Controls.Library.AnnotationDetails ctrlAnnotationDetails; - private DevComponents.DotNetBar.ButtonItem btnHelp; - private DevComponents.DotNetBar.ButtonItem btnHelpManual; - private DevComponents.DotNetBar.ButtonItem btnHelpAbout; - private DevComponents.DotNetBar.ButtonItem btnHelpVWeb; - private DevComponents.DotNetBar.ButtonItem btnAdmin; - - //private DevComponents.DotNetBar.ExpandablePanel searchPanel; - //private DevComponents.DotNetBar.TabControl searchTabControl; - private DevComponents.DotNetBar.ExpandablePanel toolsPanel; - private DevComponents.DotNetBar.TabControl toolsTabs; - - private DevComponents.DotNetBar.TabControlPanel annotationSearch; - //private DevComponents.DotNetBar.NavigationPane navpaneResults; - //private DevComponents.DotNetBar.NavigationPanePanel navpanSrchRslts; - //private Volian.Controls.Library.AnnotationSearch CtrlAnnotationSearch; - //private DevComponents.DotNetBar.ButtonItem btnSrchRslt; - //private DevComponents.DotNetBar.NavigationPanePanel navigationPanePanel3; - //private DevComponents.DotNetBar.ButtonItem btnSimStpsRslt; - private DevComponents.DotNetBar.TabItem toolstabResults; - private DevComponents.DotNetBar.TabControlPanel tabControlPanel2; - private DevComponents.DotNetBar.PanelEx panelEx3; - private DevComponents.DotNetBar.TabItem toolsTabBookMarks; - private DevComponents.DotNetBar.ExpandableSplitter expandableSplitter4; - private DevComponents.DotNetBar.TabControlPanel tabControlPanelLD; - private Volian.Controls.Library.DisplayLibDocs displayLibDocs; - private DevComponents.DotNetBar.TabItem tabItemLibDocs; - private Volian.Controls.Library.DisplayTags displayTags; - private Volian.Controls.Library.DisplaySearch displaySearch1; - private DevComponents.DotNetBar.LabelItem lblEditView; - private DevComponents.DotNetBar.ButtonItem btnItemInfo; - private Volian.Controls.Library.DisplayBookMarks displayBookMarks; - private DevComponents.DotNetBar.LabelItem lblLocked; - private DevComponents.DotNetBar.ButtonItem btnShortCuts; - private DevComponents.DotNetBar.LabelItem lblItemID; - private System.Windows.Forms.ComboBox cmbFont; - private DevComponents.DotNetBar.LabelItem lblResolution; - private DevComponents.DotNetBar.ButtonItem btnEditItem; - private DevComponents.DotNetBar.TabControlPanel tabControlPanel1; - private DevComponents.DotNetBar.TabItem infotabHistory; - private Volian.Controls.Library.DisplayHistory displayHistory; - private DevComponents.DotNetBar.ButtonItem btnUpdateFormats; - private System.Windows.Forms.FolderBrowserDialog fbd; - private DevComponents.DotNetBar.TabControlPanel tcpApplicability; - private DevComponents.DotNetBar.TabItem infotabApplicability; - private Volian.Controls.Library.DisplayApplicability displayApplicability; - private DevComponents.DotNetBar.ButtonItem btnSendErrorLog; - private DevComponents.DotNetBar.TabControlPanel tabControlPanel3; - private DevComponents.DotNetBar.TabItem toosTabReports; - private Volian.Controls.Library.DisplayReports displayReports; - } -} - diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs.bak b/PROMS/VEPROMS User Interface/frmVEPROMS.cs.bak deleted file mode 100644 index b6d2a072..00000000 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs.bak +++ /dev/null @@ -1,2578 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using System.IO; -using System.Configuration; -using VEPROMS.CSLA.Library; -//using Csla; -using DevComponents; -using DevComponents.DotNetBar; -using DevComponents.DotNetBar.Rendering; -using VEPROMS.Properties; -using Volian.Controls.Library; -using DescriptiveEnum; -using Volian.Base.Library; -using Volian.Print.Library; - -[assembly: log4net.Config.XmlConfigurator(Watch = true)] - -namespace VEPROMS -{ - enum PropPgStyle { Button = 1, Tab = 2, Grid = 3 }; - - public partial class frmVEPROMS : DevComponents.DotNetBar.Office2007RibbonForm - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region PropertiesVariables - private int securityRole; - private bool _panelExpandedChanging = false; - Color _CommentTitleBckColor; - DocVersionInfo _SelectedDVI = null; - StepTabPanel _SelectedStepTabPanel = null; - public FindReplace dlgFindReplace = null; - public VlnSpellCheck SpellChecker = null; - - public StepTabPanel SelectedStepTabPanel - { - get - { - return _SelectedStepTabPanel; - } - set - { - _SelectedStepTabPanel = value; - if (value == null) // DSO Tab Panel - { - dlgFindReplace.Visible = false; // Find/Replace dialog should not be visable for DSO tab panels - if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.MyItemInfo != null) // 2nd part is for unassociated libdocs - SelectedDVI = tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion; - else - SelectedDVI = null; - } - else // Step Tab Panel - { - // The following line was broken into separate lines because a NullReferenceError was occuring. - // Now we should be able to tell what is wrong by which line causes the Null Reference Error - // RHM 20101217 - //SelectedDVI = value.MyStepPanel.MyProcedureItemInfo.MyProcedure.ActiveParent as DocVersionInfo; - StepPanel stepPanel = value.MyStepPanel; - ItemInfo itemInfo = stepPanel.MyProcedureItemInfo; - ProcedureInfo procedureInfo = itemInfo.MyProcedure; - SelectedDVI = procedureInfo.MyDocVersion; - // Remove it first, if it wasn't set, this doesn't do anything, but if it was set, you don't want - // multiple events because the print dialog will be displayed for each time the event was added. - _SelectedStepTabPanel.MyStepTabRibbon.PrintRequest -= new StepTabRibbonEvent(MyStepTabRibbon_PrintRequest); - _SelectedStepTabPanel.MyStepTabRibbon.PrintRequest += new StepTabRibbonEvent(MyStepTabRibbon_PrintRequest); - } - } - } - - public DocVersionInfo SelectedDVI - { - get { return _SelectedDVI; } - set - { - if (_SelectedDVI != value) - { - _SelectedDVI = value; - _SelectedROFst = null; - } - InitiateSearch(false); - InitiateDisplayReports(false); - } - } - // TODO: Should the following be an info - // For the initial release, we are assuming there will be only one rofst fro a docversion. Changes - // will be needed here if more than 1. - private ROFstInfo _SelectedROFst; - public ROFstInfo SelectedROFst - { - get - { - if (_SelectedROFst == null && SelectedDVI != null) - { - if (SelectedDVI.DocVersionAssociationCount <= 0) - { - MessageBox.Show("There is no Referenced Object (RO) data for this procedure set. Use the Properties for the set to define the RO data."); - return null; - } - _SelectedROFst = SelectedDVI.DocVersionAssociations[0].MyROFst; - } - return _SelectedROFst; - } - set { _SelectedROFst = value; } - } - #endregion - public frmVEPROMS() - { - // The following Try/Catch was added to protect against a problem seen by Kathy and Michelle - // on January 1, 2013. Michelle's user.config file was empty and PROMS would not run. - // This logic will delete a "Bad" config file to attempt to eliminate the problem, and - // instructs the user to try again. - try - { - if (Properties.Settings.Default.UpdateSettings) - { - Properties.Settings.Default.Upgrade(); - Properties.Settings.Default.UpdateSettings = false; - Properties.Settings.Default.Save(); - } - } - catch (Exception ex) - { - _MyLog.Error(ex.GetType().Name + " - " + ex.InnerException, ex); - if (ex.Message.StartsWith("Configuration system failed to initialize")) - { - string filename = ex.InnerException.Message; - filename = filename.Substring(filename.IndexOf("(") + 1); - filename = filename.Substring(0, filename.IndexOf("user.config") + 11); - FileInfo myfile = new FileInfo(filename); - myfile.Delete(); - MessageBox.Show("Config file was corrupt, it has been deleted.\r\nTry Again", "Corrupt config file", MessageBoxButtons.OK, MessageBoxIcon.Error); - System.Diagnostics.Process.GetCurrentProcess().Kill(); - } - } - // If first time close any remaining WinWords. These will sometimes get hung in memory and cause problems. - if (System.Diagnostics.Process.GetProcessesByName(System.Diagnostics.Process.GetCurrentProcess().ProcessName).Length == 1) - Volian.MSWord.WordDoc.KillWordApps(); - // cleanup from previous run: - Volian.Base.Library.TmpFile.RemoveAllTmps(); - - if (VlnSettings.DebugMode) - { - //use local data (for development/debug mode) - if (Environment.MachineName == "RMARK-PC") - VEPROMS.CSLA.Library.Database.ConnectionName = "VEPROMS_RMARK_DEBUG"; - else if (Environment.UserName.ToUpper() == "BODINE") - VEPROMS.CSLA.Library.Database.ConnectionName = "VEPROMS_BODINE_DEBUG"; - else - VEPROMS.CSLA.Library.Database.ConnectionName = "VEPROMS_LOCAL"; - } - else - { - // use server data (default) - // - except for the volian laptop and Rich's Demo version where we need to use local data - if (Environment.MachineName == "RMARK-PC") - VEPROMS.CSLA.Library.Database.ConnectionName = "VEPROMS_RMARK_DEMO"; - else if (Environment.UserName.ToUpper() == "BODINE") - VEPROMS.CSLA.Library.Database.ConnectionName = "VEPROMS_BODINE_DEMO"; - else - VEPROMS.CSLA.Library.Database.ConnectionName = "VEPROMS_LOCAL"; - } - InitializeComponent(); - - // 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; - } - else - { - MSWordToPDF.DebugStatus = 0; - MSWordToPDF.OverrideColor = Color.Transparent; - } - MSWordToPDF.FormForPlotGraphics = this; - - // set the color of the ribbon - RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable((eOffice2007ColorScheme)Settings.Default.SystemColor); - - // LATER: get the user setting to control what is displayed for each tree node - // The logic is in the ToString() functions in FolderExt.cs and DocVersionExt.cs - //the GetFolder(1) function will read in the frist node (using ToString() to assign node text) - - // Get the saved Tree Node Diplay settings - //if (Settings.Default["UseNameOnTreeNode"]) - //{ - //} - //if (Settings.Default["UseTitleOnTreeNode"]) - //{ - //} - cmbFont.DataSource = FontFamily.Families; - cmbFont.DisplayMember = "Name"; - cmbFont.SelectedIndex = -1; - string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray()); - foreach (string parameter in parameters) - { - if (parameter.StartsWith("/DB=")) - Database.SelectedDatabase = parameter.Substring(4); - } - if (Properties.Settings.Default["DefaultDB"] != string.Empty) - Database.LastDatabase = Properties.Settings.Default.DefaultDB; - if (!FormatInfo.HasLatestChanges()) - throw new Exception("Inconsistent Formats"); - if (!ItemAuditInfo.IsChangeManagerVersion()) - throw new Exception("Inconsistent Data"); - if ((Database.LastDatabase ?? "") != (Database.SelectedDatabase ?? "")) - { - Properties.Settings.Default.MRIList = null; - Properties.Settings.Default.DefaultDB = Database.SelectedDatabase; - Properties.Settings.Default.Save(); - } - displayBookMarks.SetupBookMarks(); - DateTime dtSunday = DateTime.Now.AddDays(-((int)DateTime.Now.DayOfWeek)); - ChangeLogFileName("LogFileAppender", Database.SelectedDatabase + " " + dtSunday.ToString("yyyyMMdd") + " ErrorLog.txt"); - _MyLog.InfoFormat("\r\nSession Beginning\r\n<========={0}=========== User: {1}/{2} Started {3} =====================>" - , Application.ProductVersion, Environment.UserDomainName,Environment.UserName, DateTime.Now.ToString("dddd MMMM d, yyyy h:mm:ss tt")); - foreach (string parameter in parameters) - { - if (parameter.ToUpper().StartsWith("/UF=")) - UpdateFormats(parameter.Substring(4)); - else if (parameter.ToUpper().StartsWith("/UF")) - UpdateFormats(null); - } - VETreeNode tn = VETreeNode.GetFolder(1); - tv.Nodes.Add(tn); - tv.NodePSI += new vlnTreeViewPSIEvent(tv_NodePSI); - tv.NodeOpenProperty += new vlnTreeViewPropertyEvent(tv_NodeOpenProperty); - tv.NodeSelect += new Volian.Controls.Library.vlnTreeViewEvent(tv_NodeSelect); - tv.NodeNew += new vlnTreeViewEvent(tv_NodeNew); - tv.OpenItem += new vlnTreeViewItemInfoEvent(tv_OpenItem); - tv.DeleteItemInfo += new vlnTreeViewItemInfoDeleteEvent(tv_DeleteItemInfo); - tv.InsertItemInfo += new vlnTreeViewItemInfoInsertEvent(tv_InsertItemInfo); - tv.NodeInsert += new vlnTreeViewEvent(tv_NodeInsert); - tv.PasteItemInfo += new vlnTreeViewItemInfoPasteEvent(tv_PasteItemInfo); - tc.ItemPaste += new StepPanelItemPastedEvent(tc_ItemPasted); - displayHistory.HistorySelectionChanged += new DisplayHistoryEvent(displayHistory_HistorySelectionChanged); - _CommentTitleBckColor = epAnnotations.TitleStyle.BackColor1.Color; - if (!btnAnnoDetailsPushPin.Checked) - epAnnotations.Expanded = false; - infoPanel.Expanded = false; - toolsPanel.Expanded = false; - displayTags.Visible = false; - ribbonControl1.ExpandedChanged += new EventHandler(ribbonControl1_ExpandedChanged); - dlgFindReplace = new FindReplace(); - SpellChecker = new VlnSpellCheck(); - displaySearch1.PrintRequest += new DisplaySearchEvent(displaySearch1_PrintRequest); - displayHistory.ChronologyPrintRequest += new DisplayHistoryReportEvent(displayHistory_ChronologyPrintRequest); - displayHistory.SummaryPrintRequest += new DisplayHistoryReportEvent(displayHistory_SummaryPrintRequest); - displayHistory.AnnotationRestored += new AnnotationRestoredHandler(displayHistory_AnnotationRestored); - displayReports.PrintRequest += new DisplayReportsEvent(displayReports_PrintRequest); - this.Activated += new EventHandler(frmVEPROMS_Activated); - VlnSettings.StepTypeToolType = Settings.Default.StepTypeToolTip; - displayLibDocs.PrintRequest += new DisplayLibDocEvent(displayLibDocs_PrintRequest); - ContentInfo.InfoChanged += new ContentInfoEvent(RefreshDisplayHistory); - AnnotationInfo.InfoChanged += new AnnotationInfoEvent(RefreshDisplayHistory); - ItemInfo.InfoRestored += new ItemInfoEvent(RefreshDisplayHistory); - ItemInfo.ItemDeleted += new ItemInfoEvent(RefreshDisplayHistory); - tv.PrintProcedure += new vlnTreeViewEvent(tv_PrintProcedure); - tv.PrintAllProcedures += new vlnTreeViewEvent(tv_PrintAllProcedures); - tv.ApproveProcedure += new vlnTreeViewEvent(tv_ApproveProcedure); - tv.ApproveAllProcedures += new vlnTreeViewEvent(tv_ApproveAllProcedures); - tv.ApproveSomeProcedures += new vlnTreeViewEvent(tv_ApproveSomeProcedures); - tv.ReportAllProceduresInconsistencies += new vlnTreeViewEvent(tv_ReportAllProceduresInconsistencies); - tv.RefreshCheckedOutProcedures += new vlnTreeViewEvent(tv_RefreshCheckedOutProcedures); - tv.ProcedureCheckedOutTo += new vlnTreeViewEvent(tv_ProcedureCheckedOutTo); - tv.ViewPDF += new vlnTreeViewPdfEvent(tv_ViewPDF); - displayApplicability.ApplicabilityViewModeChanged += new DisplayApplicability.DisplayApplicabilityEvent(displayApplicability_ApplicabilityViewModeChanged); - } - - private void MakeDatabaseChanges() - { - // September 2012: Decided to store roimages as zipped. Any previous data may not have them zipped. - // Check the top folders config to see, and if needed, zip them: - ROImageInfo.CompressAllExistingImages += new ROImageInfoCompressionEvent(ROImageInfo_CompressAllExistingImages); - ROImageInfo.ZipImages(); - ROImageInfo.CompressAllExistingImages -= new ROImageInfoCompressionEvent(ROImageInfo_CompressAllExistingImages); - - } - - void ROImageInfo_CompressAllExistingImages(object sender, ROImageInfoCompressionEventArgs args) - { - switch (args.Type) - { - case ROImageCompressionEventType.Complete: - ProgBarText = "Compressing Complete"; - break; - case ROImageCompressionEventType.Initialize: - ProgBarMax = args.Total; - ProgBarText = "Compressing RO Images"; - break; - case ROImageCompressionEventType.Update: - ProgBarValue = args.Current; - ProgBarText = args.FileName; - break; - default: - break; - } - } - - static string _ErrorLogFileName; - - public static string ErrorLogFileName - { - get { return frmVEPROMS._ErrorLogFileName; } - set { frmVEPROMS._ErrorLogFileName = value; } - } - static bool ChangeLogFileName(string AppenderName, string NewFilename) - { - log4net.Repository.ILoggerRepository RootRep; - RootRep = log4net.LogManager.GetRepository(); - foreach (log4net.Appender.IAppender iApp in RootRep.GetAppenders()) - { - if (iApp.Name.CompareTo(AppenderName) == 0 - && iApp is log4net.Appender.FileAppender) - { - log4net.Appender.FileAppender fApp = (log4net.Appender.FileAppender)iApp; - string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); - fApp.File = folderPath + @"\VEPROMS\" + NewFilename; - ErrorLogFileName = fApp.File; - fApp.ActivateOptions(); - return true; // Appender found and name changed to NewFilename - } - } - return false; - } - - void displayApplicability_ApplicabilityViewModeChanged(object sender, EventArgs args) - { - if (tc.SelectedDisplayTabItem == null) return; - StepPanel pnl = tc.SelectedDisplayTabItem.MyStepTabPanel.MyStepPanel; - if (pnl != null) - { - pnl.ApplDisplayMode = displayApplicability.ViewMode; - displayHistory.ApplDisplayMode = pnl.ApplDisplayMode; - //added by jcb 20130718 to support enabling/diabling create pdf button until user selects a unit - if (pnl.ApplDisplayMode > 0) - { - pnl.MyStepTabPanel.MyStepTabRibbon.btnPdfCreate.Enabled = true; - btnPrint.Visible = true; - } - else - { - pnl.MyStepTabPanel.MyStepTabRibbon.btnPdfCreate.Enabled = false; - btnPrint.Visible = false; - } - //end added by jcb 20130718 - } - } - - void tv_ViewPDF(object sender, vlnTreeViewPdfArgs args) - { - byte[] buffer; - if (args.MyWatermark != string.Empty) - buffer = PromsPrinter.WatermarkPDF(args.MyBuffer, args.MyWatermark); - else - buffer = args.MyBuffer; - string fileName = Volian.Base.Library.VlnSettings.TemporaryFolder + "\\" + args.MyFilename; - try - { - FileStream fs = new FileStream(fileName, FileMode.Create); - fs.Write(buffer, 0, buffer.Length); - fs.Close(); - System.Diagnostics.Process.Start(fileName); - } - catch (Exception ex) - { - StringBuilder sb = new StringBuilder(); - sb.AppendLine("Could not create"); - sb.AppendLine(); - sb.AppendLine(fileName + "."); - sb.AppendLine(); - sb.AppendLine("If it is open, close and retry."); - MessageBox.Show(sb.ToString(), "Error on CreatePdf",MessageBoxButtons.OK,MessageBoxIcon.Warning); -// MessageBox.Show("Could not create " + fileName + ". If it is open, close and retry.", "Error on CreatePdf"); - } - } - - void displayHistory_AnnotationRestored(AnnotationInfo restoredAnnotationInfo, ItemInfo currentItem) - { - ctrlAnnotationDetails.UpdateAnnotationGrid(currentItem); - } - - void tv_ReportAllProceduresInconsistencies(object sender, vlnTreeEventArgs args) - { - DocVersionInfo dvi = (args.Node as VETreeNode).VEObject as DocVersionInfo; - if (dvi == null) return; - this.Cursor = Cursors.WaitCursor; - ItemInfoList iil = ItemInfoList.GetAllInconsistencies(dvi.VersionID); - Volian.Print.Library.PDFConsistencyCheckReport rpt = new Volian.Print.Library.PDFConsistencyCheckReport(Volian.Base.Library.VlnSettings.TemporaryFolder + @"\AllInconsistencies.pdf", iil); - rpt.BuildAllReport(dvi); - this.Cursor = Cursors.Default; - } - - void tv_ApproveSomeProcedures(object sender, vlnTreeEventArgs args) - { - DocVersionInfo dvi = (args.Node as VETreeNode).VEObject as DocVersionInfo; - if (dvi == null) return; - tc.SaveCurrentEditItem(); - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(dvi.VersionID, CheckOutType.DocVersion, ref message)) - { - MessageBox.Show(this, message, "Working Draft Has Items Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; - } - int ownerid = MySessionInfo.CheckOutItem(dvi.VersionID, CheckOutType.DocVersion); - dvi.DocVersionConfig.SelectedSlave = args.UnitIndex; - dlgApproveProcedure dlg = new dlgApproveProcedure(dvi, true); - dlg.MySessionInfo = MySessionInfo; - dlg.ShowDialog(this); - displayHistory.RefreshList(); - dvi.DocVersionConfig.SelectedSlave = 0; - MySessionInfo.CheckInItem(ownerid); - } - - void tv_ApproveAllProcedures(object sender, vlnTreeEventArgs args) - { - DocVersionInfo dvi = (args.Node as VETreeNode).VEObject as DocVersionInfo; - if (dvi == null) return; - tc.SaveCurrentEditItem(); - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(dvi.VersionID, CheckOutType.DocVersion, ref message)) - { - MessageBox.Show(this, message, "Working Draft Has Items Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; - } - int ownerid = MySessionInfo.CheckOutItem(dvi.VersionID, CheckOutType.DocVersion); - dvi.DocVersionConfig.SelectedSlave = args.UnitIndex; - dlgApproveProcedure dlg = new dlgApproveProcedure(dvi); - dlg.MySessionInfo = MySessionInfo; - dlg.ShowDialog(this); - displayHistory.RefreshList(); - dvi.DocVersionConfig.SelectedSlave = 0; - MySessionInfo.CheckInItem(ownerid); - } - - void tv_RefreshCheckedOutProcedures(object sender, vlnTreeEventArgs args) - { - OwnerInfoList.Reset(); - OwnerInfoList oil = OwnerInfoList.Get(); - Dictionary dicProcCheckedOut = new Dictionary(); - Dictionary dicDocCheckedOut = new Dictionary(); - foreach (OwnerInfo oi in oil) - { - if (oi.SessionID != MySessionInfo.SessionID && oi.OwnerType == (byte)CheckOutType.Procedure) - dicProcCheckedOut.Add(oi.OwnerItemID, oi.OwnerID); - else if (oi.SessionID != MySessionInfo.SessionID && oi.OwnerType == (byte)CheckOutType.Document) - dicDocCheckedOut.Add(oi.OwnerItemID, oi.OwnerID); - } - if (args.Node.IsExpanded) - { - foreach (TreeNode tn in args.Node.Nodes) - { - ProcedureInfo pi = (tn as VETreeNode).VEObject as ProcedureInfo; - if (pi != null && dicProcCheckedOut.ContainsKey(pi.ItemID)) - tn.ForeColor = Color.Red; - else - tn.ForeColor = Color.Black; - bool expanded = tn.IsExpanded; - if (!expanded) - tn.Expand(); - foreach (TreeNode tnn in tn.Nodes) - { - SectionInfo si = (tnn as VETreeNode).VEObject as SectionInfo; - if (si != null && si.MyContent.MyEntry != null) - { - if (dicDocCheckedOut.ContainsKey(si.MyContent.MyEntry.DocID)) - tnn.ForeColor = Color.Red; - else - tnn.ForeColor = Color.Black; - } - } - if (!expanded) - tn.Collapse(); - } - } - } - - void tv_ProcedureCheckedOutTo(object sender, vlnTreeEventArgs args) - { - ProcedureInfo pi = null; - SectionInfo si = null; - pi = (args.Node as VETreeNode).VEObject as ProcedureInfo; - if(pi == null) - si = (args.Node as VETreeNode).VEObject as SectionInfo; - UserInfo ui = UserInfo.GetByUserID(MySessionInfo.UserID); - dlgCheckedOutProcedure cop = new dlgCheckedOutProcedure(pi, si, ui); - cop.ShowDialog(this); - tv_RefreshCheckedOutProcedures(sender, new vlnTreeEventArgs(args.Node.Parent, null, 0)); - } - - void tv_ApproveProcedure(object sender, vlnTreeEventArgs args) - { - ProcedureInfo pi = (args.Node as VETreeNode).VEObject as ProcedureInfo; - pi.MyDocVersion.DocVersionConfig.SelectedSlave = args.UnitIndex; - if (pi == null) return; - tc.SaveCurrentEditItem(pi); - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(pi.ItemID, CheckOutType.Procedure, ref message)) - { - MessageBox.Show(this, message, "Procedure Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; - } - int ownerid = MySessionInfo.CheckOutItem(pi.ItemID, 0); - dlgApproveProcedure dlg = new dlgApproveProcedure(pi); - dlg.MySessionInfo = MySessionInfo; - dlg.ShowDialog(this); - displayHistory.RefreshList(); - pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0; - MySessionInfo.CheckInItem(ownerid); - } - - void tv_PrintAllProcedures(object sender, vlnTreeEventArgs args) - { - DocVersionInfo dvi = (args.Node as VETreeNode).VEObject as DocVersionInfo; - if (dvi == null) return; - tc.SaveCurrentEditItem(); - DlgPrintProcedure prnDlg = new DlgPrintProcedure(dvi); - prnDlg.MySessionInfo = MySessionInfo; - prnDlg.SelectedSlave = args.UnitIndex; - prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window - } - void tv_PrintProcedure(object sender, vlnTreeEventArgs args) - { - ProcedureInfo pi = (args.Node as VETreeNode).VEObject as ProcedureInfo; - pi.MyDocVersion.DocVersionConfig.SelectedSlave = args.UnitIndex; - if (pi == null) return; - tc.SaveCurrentEditItem(pi); - DlgPrintProcedure prnDlg = new DlgPrintProcedure(pi); - prnDlg.MySessionInfo = MySessionInfo; - prnDlg.SelectedSlave = args.UnitIndex; -// prnDlg.Show(this); // RHM 20120925 - Center dialog over PROMS window - prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window - pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0; - } - void RefreshDisplayHistory(object sender) - { - displayHistory.RefreshChangeList(); - } - void displayHistory_HistorySelectionChanged(object sender, DisplayHistoryEventArgs args) - { - tc.OpenItem(ItemInfo.Get(args.ItemID)); - } - void displayHistory_SummaryPrintRequest(object sender, DisplayHistoryReportEventArgs args) - { - Volian.Print.Library.PDFChronologyReport myChronoRpt = new Volian.Print.Library.PDFChronologyReport(args.ReportTitle, args.ProcedureInfo, args.AuditList, args.AnnotationList); - myChronoRpt.BuildSummary(); - } - void displayHistory_ChronologyPrintRequest(object sender, DisplayHistoryReportEventArgs args) - { - Volian.Print.Library.PDFChronologyReport myChronoRpt = new Volian.Print.Library.PDFChronologyReport(args.ReportTitle, args.ProcedureInfo, args.AuditList, args.AnnotationList); - myChronoRpt.BuildChronology(); - } - DialogResult tv_NodePSI(object sender, vlnTreeEventArgs args) - { - VETreeNode vNode = (VETreeNode)args.Node; - IVEDrillDownReadOnly veObj = vNode.VEObject; - ProcedureInfo myProc = veObj as ProcedureInfo; - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(myProc.ItemID, CheckOutType.Procedure, ref message)) - { - MessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return DialogResult.None; - } - int ownerID = MySessionInfo.CheckOutItem(myProc.ItemID, 0); - frmPSI fpsi = new frmPSI(myProc); - DialogResult dr = fpsi.ShowDialog(this); - MySessionInfo.CheckInItem(ownerID); - return dr; - } - /// - /// Activate tmrTreeView so that the newly created Step recieves focus - /// - /// - /// - void tv_NodeInsert(object sender, vlnTreeEventArgs args) - { - tmrTreeView.Enabled = true; - } - void frmVEPROMS_Activated(object sender, EventArgs e) - { - if (ActiveControl == tc) tc.HideCaret(); - // refresh anything that pertains to external files or programs: - - // if ro.fst was 'updated' from the roeditor, enable the update ro.fst values on - // the steptabribbon. - if (SelectedStepTabPanel!=null && SelectedStepTabPanel.MyStepTabRibbon != null) - SelectedStepTabPanel.MyStepTabRibbon.SetUpdRoValBtn(SelectedStepTabPanel.MyStepTabRibbon.NewerRoFst()); - } - void MyStepTabRibbon_PrintRequest(object sender, StepTabRibbonEventArgs args) - { - ProcedureInfo pi = args.Proc as ProcedureInfo; - //added by jcb 20130718 to support create pdf button when multiunit and user selects a unit - pi.MyDocVersion.DocVersionConfig.SelectedSlave = pi.ProcedureConfig.SelectedSlave; - //end added by jcb 20130718 - if (pi == null) return; - DlgPrintProcedure prnDlg = new DlgPrintProcedure(pi); - //added by jcb 20130718 to support create pdf button when multiunit and user selects a unit - prnDlg.SelectedSlave = pi.ProcedureConfig.SelectedSlave == 0 ? -1 : pi.ProcedureConfig.SelectedSlave; - prnDlg.MySessionInfo = MySessionInfo; - //end added by jcb 20130718 - prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window - //added by jcb 20130718 to support create pdf button when multiunit and user selects a unit - pi.MyDocVersion.DocVersionConfig.SelectedSlave = 0; - //end added by jcb 20130718 - } - void displaySearch1_PrintRequest(object sender, DisplaySearchEventArgs args) - { - Volian.Print.Library.PDFReport myReport = new Volian.Print.Library.PDFReport(args.ReportTitle, args.TypesSelected, args.MyItemInfoList, - Volian.Base.Library.VlnSettings.TemporaryFolder + @"\searchresults.pdf"); - if (args.SearchString != null) - myReport.SearchString = args.SearchString; - myReport.Build(); - } - - void displayLibDocs_PrintRequest(object sender, DisplayLibDocEventArgs args) - { - Volian.Print.Library.PDFReport myReport = new Volian.Print.Library.PDFReport(args.ReportTitle, args.LibDocList, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\LibDocUsage.pdf"); - myReport.Build(); - } - - void displayReports_PrintRequest(object sender, DisplayReportsEventArgs args) - { - if (args.TypesSelected == "RO Usage") - { - Volian.Print.Library.PDFReport myReport = new Volian.Print.Library.PDFReport(args.ReportTitle, args.MyItemInfoList, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\ROUsageReport.pdf", args.SortUsageByProcedure); - myReport.Build(); - } - else if (args.TypesSelected == "RO Report") - { - Volian.Print.Library.PDFReport myReport = new Volian.Print.Library.PDFReport(args.ReportTitle, args.RODataFile, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\ROCompleteReport.pdf", args.CompleteROReport); - myReport.Build(); - } - } - - - bool tv_InsertItemInfo(object sender, vlnTreeItemInfoInsertEventArgs args) - { - // Don't select the newly created Step. This will be handled by tmrTreeView - return tc.InsertRTBItem(args.MyItemInfo, args.StepText, args.InsertType, args.FromType, args.Type, false); - } - private bool tv_DeleteItemInfo(object sender, vlnTreeItemInfoEventArgs args) - { - if (displayHistory.MyEditItem != null && displayHistory.MyItemInfo.MyProcedure.ItemID == args.MyItemInfo.ItemID) - displayHistory.MyEditItem = null; - return tc.DeleteRTBItem(args.MyItemInfo); - //if (si == null) return false; - //si.RemoveItem(); - //return true; - } - private bool tv_PasteItemInfo(object sender, vlnTreeItemInfoPasteEventArgs args) - { - return tc.PasteRTBItem(args.MyItemInfo, args.CopyStartID, args.PasteType, (int)args.Type); - } - private void frmVEPROMS_FormClosing(object sender, FormClosingEventArgs e) - { - if (MyActivityTimer != null) - { - MyActivityTimer.Dispose(); - MySessionInfo.EndSession(); - // Save the location and size of the VE-PROMS appication for this user - if (this.WindowState == FormWindowState.Normal) - { - Settings.Default.Location = this.Location; - Settings.Default.Size = this.Size; - } - Settings.Default.WindowState = this.WindowState; - Settings.Default.QATItems = ribbonControl1.QatLayout; - SaveMRU(); - } - //Settings.Default.Save(); - Volian.Base.Library.DebugPagination.Close(); - Volian.Base.Library.DebugText.Close(); - } - void frmVEPROMS_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e) - { - // Close any open documents - tc.Dispose(); - // RHM 20121010 - // Something was causing the process to remain in memory for an extended period of time - // after printing procedures. The following lines kills the process immediately. - System.Diagnostics.Process.GetCurrentProcess().Kill(); - } - // Get the "Procedures" Panel Heading (title). - // by default the heading is "Procedures" (handled in the getting from the config) - // the heading is stored in the "title" field of the folder config. - // we currently only use the "title" field for the top (VEPROMS) tree node. - private string getProcedurePanelHeading() - { - VETreeNode jj_vetn = (VETreeNode)tv.Nodes[0]; // the VEPROMS tree node - return ((FolderConfig)jj_vetn.VEObject.MyConfig).Title; // get the panel heading - } - - private SessionInfo MySessionInfo; - private System.Threading.Timer MyActivityTimer; - private DevComponents.DotNetBar.ButtonItem btnManageSecurity; - private DevComponents.DotNetBar.ButtonItem btnResetSecurity; - private TabItemsToClose _MyCloseTabList = new TabItemsToClose(); - public TabItemsToClose MyCloseTabList - { - get { return _MyCloseTabList; } - } - private void PingSession(Object obj) - { - List myList = MySessionInfo.PingSession(); - foreach (DisplayTabItem dti in tc.MyBar.Items) - { - if (!myList.Contains(dti.OwnerID)) - MyCloseTabList.PushDTI(dti); - } - } - public Timer tmrCloseTabItems; - - private void frmVEPROMS_Load(object sender, EventArgs e) - { - InitializeSecurity(); - UpdateUser(); - btnManageSecurity = new ButtonItem("btnManageSecurity", "Manage Security"); - btnAdmin.SubItems.Add(btnManageSecurity); - btnManageSecurity.Click += new EventHandler(btnManageSecurity_Click); - //added by jcb - //menu item to reset security - //requires password to implement - btnResetSecurity = new ButtonItem("btnResetSecurity", "Reset Security"); - btnAdmin.SubItems.Add(btnResetSecurity); - btnResetSecurity.Click += new EventHandler(btnResetSecurity_Click); - //end added by jcb - UserInfo ui = null; - try - { - ui = UserInfo.GetByUserID(VlnSettings.UserID); - } - catch - { - MessageBox.Show("This database is not compatible with this version of PROMS. The PROMS program will terminate. Please contact Volian to assist in resolution."); - Application.Exit(); - } - if (ui == null) - { - User u = User.MakeUser(VlnSettings.UserID, "", "", "", "", "", "", "", "", "", "", DateTime.Now, VlnSettings.UserID); - Group g = Group.Get(securityRole); - Membership.MakeMembership(u, g, null, ""); - ui = UserInfo.Get(u.UID); - } - ctrlAnnotationDetails.MyUserInfo = ui; - bool isVisible = ui.IsAdministrator(); - btnManageSecurity.Visible = isVisible; - btnUpdateFormats.Visible = isVisible; - btnResetSecurity.Visible = isVisible; - tmrCloseTabItems = new Timer(); - tmrCloseTabItems.Interval = 100; - tmrCloseTabItems.Tick += new EventHandler(tmrCloseTabItems_Tick); - tmrCloseTabItems.Enabled = true; - MySessionInfo = SessionInfo.BeginSession(Environment.MachineName, System.Diagnostics.Process.GetCurrentProcess().Id); - tc.MySessionInfo = MySessionInfo; - tv.MySessionInfo = MySessionInfo; - System.Threading.AutoResetEvent autoEvent = new System.Threading.AutoResetEvent(false); - //System.Threading.TimerCallback timerDelegate = new System.Threading.TimerCallback(MySessionInfo.PingSession); - System.Threading.TimerCallback timerDelegate = new System.Threading.TimerCallback(this.PingSession); - MyActivityTimer = new System.Threading.Timer(timerDelegate, autoEvent, 10000, 10000); - //string debugMode = ConfigurationManager.AppSettings["Debug"]; - //VlnSettings.DebugMode = bool.Parse(debugMode); // set debug for the Volian.Controls.Library - // get the saved location and size of the VE-PROMS appication for this user - if (Settings.Default["Location"] != null) this.Location = Settings.Default.Location; - if (Settings.Default["Size"] != null) this.Size = Settings.Default.Size; - if (Settings.Default["WindowState"] != null) this.WindowState = Settings.Default.WindowState; - //if (Settings.Default.SaveTreeviewExpanded) epProcedures.Expanded = Settings.Default.TreeviewExpanded; - // if the Procedures panel was left open from the last session, then open it - epProcedures.Expanded = Settings.Default.TreeviewExpanded; - if (Settings.Default["QATItems"] != null) ribbonControl1.QatLayout = Settings.Default.QATItems; - - // See if any database 'changes' need done and do them: - MakeDatabaseChanges(); - - _MyMRIList = MostRecentItemList.GetMRILst((System.Collections.Specialized.StringCollection)(Properties.Settings.Default["MRIList"])); - _MyMRIList.AfterRemove += new ItemInfoEvent(_MyMRIList_AfterRemove); - SetupMRU(); - // if the user selected to "Remember Last" (was "Save Expanded") then use the MRU list to - // expand the tree to the last opened procedure - //if (epProcedures.Expanded && _MyMRIList.Count > 0) - if (Settings.Default.SaveTreeviewExpanded && _MyMRIList.Count > 0) - { - tv.AdjustTree(_MyMRIList[0].MyItemInfo.MyProcedure); - tv.SelectedNode.Expand(); - SetCaption(tv.SelectedNode as VETreeNode); - } - // Assign the Procedure Panel's title (heading) - epProcedures.TitleText = getProcedurePanelHeading();// get the panel heading - // if the procedure panel is expanded, make sure we enable the splitter so the user can resize the panel - // Bug fix: B2013-89 - expandableSplitter1.Enabled = epProcedures.Expanded; - - displaySearch1.SetupAnnotationSearch(ctrlAnnotationDetails, tc); - AnnotationTypeInfoList.ListChanged += new AnnotationTypeInfoListEvent(AnnotationTypeInfoList_ListChanged); - ctrlAnnotationDetails.SetupAnnotations(displaySearch1); - SetupButtons(); - displayBookMarks.MyDisplayTabControl = tc; // allows bookmark selection to bring up steps/docs - office2007StartButton1.MouseDown +=new MouseEventHandler(office2007StartButton1_MouseDown); - //displayRO.EnabledChanged += new EventHandler(displayRO_EnabledChanged); - tc.Enter += new EventHandler(tc_Enter); - tc.Leave += new EventHandler(tc_Leave); - tc.StatusChanged += new DisplayTabControlStatusEvent(tc_StatusChanged); - tc.ToggleRibbonExpanded += new DisplayTabControlEvent(tc_ToggleRibbonExpanded); - this.Deactivate += new EventHandler(frmVEPROMS_Deactivate); - if (VlnSettings.DemoMode) StepRTB.MyFontFamily = GetFamily("Bookman Old Style"); - displaySearch1.Enter += new EventHandler(displaySearch1_Enter); - displayHistory.Enter += new EventHandler(displayHistory_Enter); - ctrlAnnotationDetails.Enter += new EventHandler(ctrlAnnotationDetails_Enter); - Application.DoEvents(); - if (RunningNewRevision && ShowEULA() != DialogResult.OK) - { - Timer tmrShutDown = new Timer(); - tmrShutDown.Interval = 250; - tmrShutDown.Tick += new EventHandler(tmrShutDown_Tick); - tmrShutDown.Enabled = true; - } - else - tmrAutomatic.Enabled = true; - //// Shutoff UpdateFormats for Production Mode - //if (Volian.Base.Library.VlnSettings.ProductionMode) - // btnAdmin.Visible = false; - StepTabRibbon.PasteNoReturnsSetting = Properties.Settings.Default.PasteNoReturns; - StepTabRibbon.PastePlainTextSetting = Properties.Settings.Default.PastePlainText; - } - - void tmrCloseTabItems_Tick(object sender, EventArgs e) - { - while(MyCloseTabList.CountDTI > 0) - { - DisplayTabItem dti = MyCloseTabList.PopDTI(); - if (dti.MyDSOTabPanel != null) - dti.MyDSOTabPanel.OverrideClose = true; - tc.CloseTabItem(dti); - } - } - - private void InitializeSecurity() - { - Folder f = Folder.Get(1); - GroupInfo gi = GroupInfo.Get(1); - if (f.FolderConfig.Security_Group == 0) - { - f.FolderConfig.Security_Group = gi.GID; - f.Save(); - } - securityRole = f.FolderConfig.Security_Group; - } - - private string proxyUser; - private void UpdateUser() - { - string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray()); - foreach (string parameter in parameters) - { - if (parameter.ToUpper().StartsWith("/U=")) //this is for testing purposes on same machine to emulate different users - { - VlnSettings.UserID = parameter.Substring(3); - } - else if (parameter.StartsWith("/VeauLeeAnn")) //this is used by volian personnel to act as an existing user - { - //pop up user list to select from - ContextMenuStrip cms = BuildUserMenu(); - while (proxyUser == null) - { - cms.Show(new System.Drawing.Point((System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - cms.Width) / 2, (System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - cms.Height) / 2)); - System.Windows.Forms.Application.DoEvents(); - } - VlnSettings.UserID = proxyUser; - } - else if (parameter.StartsWith("/V3Pr0m5=")) //this is a backdoor to create another administrator - { - VlnSettings.UserID = parameter.Substring(9); - User u = User.MakeUser(VlnSettings.UserID, "", "", "", "", "", "", "", "", "", "", DateTime.Now, VlnSettings.UserID); - Group g = Group.GetByGroupName("Administrators"); - Membership.MakeMembership(u, g, null, ""); - } - } - lblUser.Text = VlnSettings.UserID; - } - - private ContextMenuStrip BuildUserMenu() - { - System.Windows.Forms.ContextMenuStrip cms = new System.Windows.Forms.ContextMenuStrip(); - cms.Items.Add("Choose User"); - System.Windows.Forms.ToolStripMenuItem tsmi = cms.Items[0] as System.Windows.Forms.ToolStripMenuItem; - tsmi.BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.ActiveCaption);// System.Drawing.Color.Pink; - tsmi.ForeColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.ActiveCaptionText); - tsmi.Font = new System.Drawing.Font(tsmi.Font, System.Drawing.FontStyle.Bold); - UserInfoList uil = UserInfoList.Get(); - foreach (UserInfo ui in uil) - { - if (ui.UserMembershipCount > 0) - { - foreach (MembershipInfo mi in ui.UserMemberships) - { - if (mi.EndDate == string.Empty) - { - string txt = string.Format("{0} - {1}", ui.UserID, mi.MyGroup.GroupName); - ToolStripItem tsi = cms.Items.Add(txt, null, new EventHandler(User_Click)); - tsi.Tag = ui; - break; - } - } - } - } - return cms; - } - - private void User_Click(object sender, EventArgs e) - { - ToolStripMenuItem tsmi = sender as ToolStripMenuItem; - if (tsmi != null) - { - UserInfo ui = tsmi.Tag as UserInfo; - proxyUser = ui.UserID; - } - } - void btnManageSecurity_Click(object sender, EventArgs e) - { - dlgManageSecurity dlg = new dlgManageSecurity(); - dlg.ShowDialog(this); - } - void btnResetSecurity_Click(object sender, EventArgs e) - { - string password = string.Empty; - if (ShowInputDialog(ref password) == DialogResult.OK) - { - if(password == "V3Pr0m5") - { - StringBuilder sb = new StringBuilder(); - sb.AppendLine("***** WARNING *****"); - sb.AppendLine(); - sb.AppendLine("This action will delete all Groups, Users and Memberships from the database."); - sb.AppendLine("This action is NOT reversible."); - sb.AppendLine("Following this action the application will terminate."); - sb.AppendLine(); - sb.AppendLine("Are you sure you want to continue?"); - if (MessageBox.Show(sb.ToString(), "Confirm Security Reset", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Stop) == DialogResult.Yes) - { - ResetSecurity.Execute(); - Application.Exit(); - } - } - else - MessageBox.Show("You have entered an incorrect password."); - } - } - private static DialogResult ShowInputDialog(ref string input) - { - System.Drawing.Size size = new System.Drawing.Size(200, 70); - Form inputBox = new Form(); - - inputBox.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - inputBox.ClientSize = size; - inputBox.Text = "Enter Password"; - inputBox.StartPosition = FormStartPosition.CenterScreen; - - System.Windows.Forms.TextBox textBox = new TextBox(); - textBox.Size = new System.Drawing.Size(size.Width - 10, 23); - textBox.Location = new System.Drawing.Point(5, 5); - textBox.PasswordChar = '*'; - textBox.Text = input; - inputBox.Controls.Add(textBox); - - Button okButton = new Button(); - okButton.DialogResult = System.Windows.Forms.DialogResult.OK; - okButton.Name = "okButton"; - okButton.Size = new System.Drawing.Size(75, 23); - okButton.Text = "&OK"; - okButton.Location = new System.Drawing.Point(size.Width - 80 - 80, 39); - inputBox.Controls.Add(okButton); - - Button cancelButton = new Button(); - cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - cancelButton.Name = "cancelButton"; - cancelButton.Size = new System.Drawing.Size(75, 23); - cancelButton.Text = "&Cancel"; - cancelButton.Location = new System.Drawing.Point(size.Width - 80, 39); - inputBox.Controls.Add(cancelButton); - - - DialogResult result = inputBox.ShowDialog(); - input = textBox.Text; - return result; - } - - void tc_StatusChanged(object sender, DisplayTabControlStatusEventArgs args) - { - switch (args.Type) - { - case VolianStatusType.Initialize: - ProgBarMax = args.Count; - ProgBarText = args.Text; - ProgBarValue = 0; - break; - case VolianStatusType.Update: - ProgBarText = args.Text; - ProgBarValue = args.Count; - break; - case VolianStatusType.Complete: - ProgBarText = args.Text; - ProgBarValue = 0; - break; - default: - break; - } - } - void tmrShutDown_Tick(object sender, EventArgs e) - { - (sender as Timer).Enabled = false; - this.Close(); - } - private DialogResult ShowEULA() - { - string eulaFile = string.Format(@"\{0}", VlnSettings.EULAfile); - string strEULA = System.Environment.CurrentDirectory + eulaFile; - frmViewTextFile ViewFile = new frmViewTextFile(strEULA, RichTextBoxStreamType.PlainText); - ViewFile.Text = "End-User License Agreement"; - ViewFile.ButtonText = "Agree"; - if (ViewFile.ShowDialog() == DialogResult.OK) - { - System.Version ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; - string thisVersion = ver.Major.ToString() + "." + ver.Minor.ToString(); - Properties.Settings.Default.LastVersion = thisVersion; - return DialogResult.OK; - } - return DialogResult.Cancel; - } - private bool RunningNewRevision - { - get - { - string lastVersion = Properties.Settings.Default.LastVersion; - System.Version ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; - string thisVersion = ver.Major.ToString() + "." + ver.Minor.ToString(); - return thisVersion != lastVersion; - } - } - void displayHistory_Enter(object sender, EventArgs e) - { - tc.HideCaret(); - } - void AnnotationTypeInfoList_ListChanged() - { - displaySearch1.SetupAnnotationSearch(ctrlAnnotationDetails, tc); - ctrlAnnotationDetails.SetupAnnotations(displaySearch1); - } - private void RunAutomatic() - { - string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray()); - bool ranAuto = false; - foreach (string parameter in parameters) - { - if(parameter.StartsWith("/P=")) - { - string[] dvstrs = parameter.Substring(3).Split(",".ToCharArray()); - foreach (string dvstr in dvstrs) - { - DocVersionInfo dvi = DocVersionInfo.Get(int.Parse(dvstr)); - if (dvi != null) - { - DlgPrintProcedure prnDlg = new DlgPrintProcedure(dvi,true); - if (dvi.MultiUnitCount == 0) - prnDlg.SelectedSlave = -1; - prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window - //prnDlg.FormClosed += new FormClosedEventHandler(prnDlg_FormClosed); - //while (!_RunNext) Application.DoEvents(); - ranAuto = true; - } - } - } - } - if (ranAuto) - { - this.Close(); - } - } - private bool _RunNext = false; - //void prnDlg_FormClosed(object sender, FormClosedEventArgs e) - //{ - // _RunNext = true; - //} - private FontFamily GetFamily(string name) - { - foreach (FontFamily ff in FontFamily.Families) - if (ff.Name == name) return ff; - return null; - } - void tc_ToggleRibbonExpanded(object sender, EventArgs args) - { - Volian.Base.Library.vlnStackTrace.ShowStackLocal("tc_ToggleRibbonExpanded {0}", ribbonControl1.Expanded); - ribbonControl1.Expanded = !ribbonControl1.Expanded; - } - void frmVEPROMS_Deactivate(object sender, EventArgs e) - { - tc.HideCaret(); // Hide the pseudo cursor (caret) - } - void tc_Leave(object sender, EventArgs e) - { - tc.ShowCaret();// Show the pseudo cursor (caret) - } - void tc_Enter(object sender, EventArgs e) - { - tc.HideCaret();// Hide the pseudo cursor (caret) - } - void displaySearch1_Enter(object sender, EventArgs e) - { - tc.HideCaret();// Hide the pseudo cursor (caret) - } - void ctrlAnnotationDetails_Enter(object sender, EventArgs e) - { - tc.HideCaret();// Hide the pseudo cursor (caret) - } - //void displayRO_EnabledChanged(object sender, EventArgs e) - //{ - // Console.WriteLine("here"); - //} - void _MyMRIList_AfterRemove(object sender) - { - SetupMRU(); - } - private void SetupButtons() - { - if (!VlnSettings.DebugMode) - { - lblItemID.Visible = false; - btnItemInfo.Visible = false; - cmbFont.Visible = false; - btnEditItem.Visible = false; - lblResolution.Visible = false; - } - } - #region MRU - private MostRecentItemList _MyMRIList; - private void SetupMRU() - { - icRecentDocs.SubItems.Clear(); - if (_MyMRIList.Count > 0) - { - LabelItem lblItem = new LabelItem(); - lblItem.Text = "Recent Documents:"; - icRecentDocs.SubItems.Add(lblItem); - //icRecentDocs.SubItems.Add(); - for (int i = 0; i < _MyMRIList.Count; i++) - { - MostRecentItem mri = _MyMRIList[i]; - ButtonItem btnItem = new ButtonItem(); - string menuTitle = mri.MenuTitle.Replace("\u2011", "-"); - if (i < 9) - btnItem.Text = string.Format("&{0}. {1}", i + 1, menuTitle); - else - btnItem.Text = string.Format(" {1}", i + 1, menuTitle); - btnItem.Tag = mri.ItemID; - btnItem.Tooltip = mri.ToolTip; - btnItem.Click += new EventHandler(btnItem_Click); - icRecentDocs.SubItems.Add(btnItem); - } - } - } - - void btnItem_Click(object sender, EventArgs e) - { - ButtonItem btnItem = (ButtonItem)sender; - MostRecentItem mri = _MyMRIList.Add((int)(btnItem.Tag)); - //SaveMRU(); - SetupMRU(); - if (mri != null) tc.OpenItem(mri.MyItemInfo); - } - private void SaveMRU() - { - Properties.Settings.Default.MRIList = _MyMRIList.ToSettings(); - Properties.Settings.Default.TreeviewExpanded = epProcedures.Expanded; - Properties.Settings.Default.Save(); - } - #endregion - #region Tree View - /// - /// Get the selected tree node's properties - /// - /// VETreeNode - bool SetupNodes(VETreeNode node) - { - if (_MyMRIList.Add(node.VEObject) != null) - SetupMRU(); - #region Sample Display Table Code - // display an exiting table in that rtf grid thing - //if ((_LastStepInfo.MyContent.Type == 20007) || (_LastStepInfo.MyContent.Type == 20009)) - //{ - // //MessageBox.Show("Source Grid"); - // //frmTable newtable1 = new frmTable(_LastStepInfo.MyContent.Text); - // //newtable1.ShowDialog(); - // //MessageBox.Show("IGrid"); - // //frmIGrid newtable2 = new frmIGrid(_LastStepInfo.MyContent.Text); - // //newtable2.ShowDialog(); - // //MessageBox.Show("GridView"); //standard Visual Studio Control - // //frmGridView newtable3 = new frmGridView(_LastStepInfo.MyContent.Text); - // //newtable3.ShowDialog(); - // MessageBox.Show("FlexCell"); - // frmFlexCell newtable4 = new frmFlexCell(_LastStepInfo.MyContent.Text); - // newtable4.ShowDialog(); - //} - #endregion - ItemInfo ii = node.VEObject as ItemInfo; - if (ii != null) tc.OpenItem(ii); - SetCaption(node); - return (ii != null); // return if successful on opening item in step editor or word - } - // The following code is used to setup the user interface depending on what - // is selected on the tree view (see vlnTreeView.cs) - void tv_NodeNew(object sender, vlnTreeEventArgs args) - { - VETreeNode vNode = (VETreeNode)args.Node; - IVEDrillDownReadOnly veObj = vNode.VEObject; - SectionInfo mySection = veObj as SectionInfo; - if (mySection != null && mySection.MyContent.MyEntry != null) - { - // if it is a word section, find the DisplayTabItem; - DisplayTabItem tabItem = tc.GetProcDisplayTabItem(mySection); - if(tabItem != null)tabItem.MyStepTabPanel.MyStepPanel.Reset(); - } - // Don't select the newly created Step. This will be handled by tmrTreeView - //SetupNodes((VETreeNode)args.Node); - } - private void tv_NodeSelect(object sender, vlnTreeEventArgs args) - { - SetupNodes((VETreeNode)args.Node); - } - private void SetCaption(VETreeNode tn) - { - StringBuilder caption = new StringBuilder(); - string sep = string.Empty; - while (tn != null) - { - if (tn.VEObject.GetType() == typeof(FolderInfo) || tn.VEObject.GetType() == typeof(DocVersionInfo)) - { - //caption.Append(sep + tn.Text); - caption.Insert(0, tn.Text + sep); - sep = " - "; - } - tn = (VETreeNode)tn.Parent; - } - this.Text = caption.ToString(); - } - void tv_OpenItem(object sender, vlnTreeItemInfoEventArgs args) - { - tc.OpenItem(args.MyItemInfo); - } - /// - /// When the treeview is clicked - a timer is set - /// This is done because the focus is returned to the treeview after the click event - /// This approach did not work and was replaced with the code below. - /// The problem was that each time the treeview was clicked, the last selected node - /// was opened again, or the edit window was repositioned. - /// If the item was deleted and another treenode expanded, the click to expand the - /// node would cause the deleted node to be selected. - /// - /// - /// - //private void tv_Click(object sender, EventArgs e) - //{ - //tv.Enabled = false; - //tmrTreeView.Enabled = true; - //} - /// - /// This opens nodes if the mouse is within the bounds of a node. - /// By using the timer, the focus can be passed to the edit window. - /// - /// - /// - void tv_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) - { - _ExpandingTree = false; - } - void tv_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e) - { - if (_ExpandingTree) - { - _ExpandingTree = false; - return; - } - if (e.Button != MouseButtons.Right) - { - Point newPoint = new Point(e.X, e.Y); - VETreeNode tn = tv.GetNodeAt(newPoint) as VETreeNode; - // Check to make sure that a node has been selected and - // that the mouse is within the bounds of the node. - if (tn != null && tn.Bounds.Left < newPoint.X) - { - tv.SelectedNode = tn; - tv.Enabled = false; - tmrTreeView.Enabled = true; - } - else - { - if (tn != null && tn.Bounds.Left < newPoint.X + 30) - return; - if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.SelectedItemInfo != null) - { - tv.AdjustTree(tc.SelectedDisplayTabItem.SelectedItemInfo); - tc.SelectedDisplayTabItem.Focus(); - SetCaption(tv.SelectedNode as VETreeNode); - } - } - } - } - /// - /// This event is fired from the timer after the treeview click event completes - /// - /// - /// - private void tmrTreeView_Tick(object sender, EventArgs e) - { - bool giveTvFocus = true; - tmrTreeView.Enabled = false; // Timer has now fired - VETreeNode tn = tv.SelectedNode as VETreeNode; - if (tn != null) giveTvFocus = !SetupNodes(tn); - tv.Enabled = true; - if (giveTvFocus) tv.Focus(); - } - private void tmrAutomatic_Tick(object sender, EventArgs e) - { - tmrAutomatic.Enabled = false; // Timer has now fired - RunAutomatic(); - } - private bool _ExpandingTree=false; - private void tv_BeforeExpand(object sender, TreeViewCancelEventArgs e) - { - _ExpandingTree = true; - VETreeNode tn = ((VETreeNode)e.Node); - tn.LoadingChildrenDone += new VETreeNodeEvent(tn_LoadingChildrenDone); - tn.LoadingChildrenMax += new VETreeNodeEvent(tn_LoadingChildrenMax); - tn.LoadingChildrenValue += new VETreeNodeEvent(tn_LoadingChildrenValue); - tn.LoadingChildrenSQL += new VETreeNodeEvent(tn_LoadingChildrenSQL); - tn.LoadChildren(true); - } - #region Property Page and Grid - DialogResult tv_NodeOpenProperty(object sender, vlnTreePropertyEventArgs args) - { - this.Cursor = Cursors.WaitCursor; - DialogResult dr = DialogResult.Cancel; - if ((int)Settings.Default["PropPageStyle"] == (int)PropPgStyle.Grid) - { - frmPropGrid propGrid = new frmPropGrid(args.ConfigObject, args.Title); - dr = propGrid.ShowDialog(); - } - else - { - if (args.FolderConfig != null) - { - frmFolderProperties frmfld = new frmFolderProperties(args.FolderConfig); - dr = frmfld.ShowDialog(); - if (dr == DialogResult.OK) - epProcedures.TitleText = getProcedurePanelHeading();// get the panel heading - } - else if (args.DocVersionConfig != null) - { - frmVersionsProperties frmver = new frmVersionsProperties(args.DocVersionConfig); - dr = frmver.ShowDialog(); - } - else if (args.ProcedureConfig != null) - { - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(args.ProcedureConfig.MyProcedure.ItemID, CheckOutType.Procedure, ref message)) - { - MessageBox.Show(this, message, "Procedure Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - this.Cursor = Cursors.Default; - return DialogResult.None; - } - int ownerID = MySessionInfo.CheckOutItem(args.ProcedureConfig.MyProcedure.ItemID, 0); - frmProcedureProperties frmproc = new frmProcedureProperties(args.ProcedureConfig); - dr = frmproc.ShowDialog(); - MySessionInfo.CheckInItem(ownerID); - } - else if (args.SectionConfig != null) - { - //// If this is a word document, close any edit sessions... - //ItemInfo ii = null; - //using (Section tmp = args.SectionConfig.MySection) - //{ - // ii = ItemInfo.Get(tmp.ItemID); - // if (!ii.IsStepSection) tc.CloseWordItem(ii); - //} - - frmSectionProperties frmsec = new frmSectionProperties(args.SectionConfig); - dr = frmsec.ShowDialog(); - if (dr == DialogResult.OK && displayLibDocs.LibDocList != null) - { - displayLibDocs.LibDocListFillIn(tc); - displayLibDocs.SetSelectedLibDoc(); - } - } - } - this.Cursor = Cursors.Default; - return dr; - } - #endregion - #endregion - #region ColorStuff - /// - /// Get a System.Drawing.Color from an Argb or color name - /// - /// Color Name or "[(alpha,)red,green,blue]" - /// - private static Color cGetColor(string strColor) - { - // This was copied from frmFolderProperties.CS - Color rtnColor; - if (strColor == null || strColor.Equals("")) - rtnColor = Color.White; - else - { - if (strColor[0] == '[') - { - string[] parts = strColor.Substring(1, strColor.Length - 2).Split(",".ToCharArray()); - int parts_cnt = 0; - foreach (string s in parts) - { - parts[parts_cnt] = parts[parts_cnt].TrimStart(' '); // remove preceeding blanks - parts_cnt++; - } - if (parts_cnt == 3) - rtnColor = Color.FromArgb(Int32.Parse(parts[0]), Int32.Parse(parts[1]), Int32.Parse(parts[2])); - else - rtnColor = Color.FromArgb(Int32.Parse(parts[0].Substring(2)), Int32.Parse(parts[1].Substring(2)), Int32.Parse(parts[2].Substring(2)), Int32.Parse(parts[3].Substring(2))); - } - else rtnColor = Color.FromName(strColor); - } - return rtnColor; - } - //private void SetupEditorColors(DisplayPanel vlnCSLAPanel1, TabPage pg) - //{ - // // setup color - // if (_LastFolderInfo == null) - // { - // // user didn't select a FolderInfo type of node. - // // walk up the tree to find the first FolderInfo node type - // VETreeNode tn = (VETreeNode)(tv.SelectedNode); - // while (tn != null && tn.VEObject.GetType() != typeof(FolderInfo)) - // tn = (VETreeNode)tn.Parent; - // _LastFolderInfo = (FolderInfo)(tn.VEObject); - // _LastFolder = _LastFolderInfo.Get(); - // } - - // if ((_LastFolderInfo.FolderConfig.Color_editbackground != null) && !(_LastFolderInfo.FolderConfig.Color_editbackground.Equals(""))) - // { - // vlnCSLAPanel1.ActiveColor = cGetColor(_LastFolderInfo.FolderConfig.Color_editbackground); - // } - // if ((_LastFolderInfo.FolderConfig.Default_BkColor != null) && !(_LastFolderInfo.FolderConfig.Default_BkColor.Equals(""))) - // { - // vlnCSLAPanel1.InactiveColor = _LastFolderInfo.FolderConfig.Default_BkColor; - // vlnCSLAPanel1.TabColor = vlnCSLAPanel1.InactiveColor; - // vlnCSLAPanel1.PanelColor = vlnCSLAPanel1.InactiveColor; - // pg.BackColor = vlnCSLAPanel1.InactiveColor; - // } - //} - #endregion - #region Table Insert Sample Code - // TODO: for tables - //private void btnInsTable_Click(object sender, EventArgs e) - //{ - // Point loc = btnInsTable.DisplayRectangle.Location; - // loc.X += 300; - // int top = this.Top + (btnInsTable.Size.Height * 2); - // TablePickerDlg(sender, e, loc, top); - //} - - //private void TablePickerDlg(object sender, EventArgs e, Point loc, int top) - //{ - // Accentra.Controls.TablePicker tp = new Accentra.Controls.TablePicker(); - // tp.Location = loc; - // tp.Top += top; - // tp.Show(); - // while (tp.Visible) - // { - // Application.DoEvents(); - // System.Threading.Thread.Sleep(0); - // } - // // This was used to display a dialog containing a table grid - // // using a product called Source Grid - was for demo purposes only - // // - // //if (!tp.Cancel) - // //{ - // // frmTable newtable = new frmTable(tp.SelectedRows, tp.SelectedColumns); - // // newtable.Show(); - // //} - //} - #endregion - #region Progress Bar - - /// - /// Used for the status bar in the lower left corner of the main screen - /// - /// - /// - void tn_LoadingChildrenSQL(object sender, VETreeNodeEventArgs args) - { - ProgBarText = "Loading SQL"; - } - - /// - /// Used for the status bar in the lower left corner of the main screen - /// - /// - /// - void tn_LoadingChildrenValue(object sender, VETreeNodeEventArgs args) - { - ProgBarValue = args.Value; - } - - /// - /// Used for the status bar in the lower left corner of the main screen - /// - /// - /// - void tn_LoadingChildrenMax(object sender, VETreeNodeEventArgs args) - { - ProgBarMax = args.Value; - ProgBarText = "Loading..."; - } - - /// - /// Used for the status bar in the lower left corner of the main screen - /// - /// - /// - void tn_LoadingChildrenDone(object sender, VETreeNodeEventArgs args) - { - if (VlnSettings.DebugMode) - ProgBarText = args.Info + " Seconds"; - else - ProgBarText = ""; - } - - public int ProgBarMax - { - get { return bottomProgBar.Maximum; } - set { bottomProgBar.Maximum = value; } - } - - public int ProgBarValue - { - get { return bottomProgBar.Value; } - set { bottomProgBar.Value = value; } - } - - public string ProgBarText - { - get { return bottomProgBar.Text; } - set - { - bottomProgBar.TextVisible = true; - bottomProgBar.Text = value; - } - } - - #endregion - #region Find/Replace and Search - - /// - /// Find/Replace button on the ribbon - /// Display the Find/Replace dialog - /// - /// - /// - //private void btnFindRplDlg_Click_1(object sender, EventArgs e) - //{ - // FindReplace frmFindRepl = new FindReplace(); - // frmFindRepl.Show(); - //} - - /// - /// Global Search button on the ribbon - /// Opens the Information Pannel and selects the Results tab - /// - /// - /// - //private void btnGlbSrch_Click(object sender, EventArgs e) - //{ - // toolsPanel.Expanded = true; - // toolsTabs.SelectedTab = toolstabResults; - //} - - #endregion - #region Similar Steps - - /// - /// Similar Steps button on the ribbon - /// Opens the Information Pannel and selects the Results tab - /// - /// - /// - private void btnSimStps_Click(object sender, EventArgs e) - { - //infoPanel.Expanded = true; - //infoTabs.SelectedTab = toolstabResults; - //btnSimStpsRslt.Checked = true; - } - - #endregion - #region Help/About - - /// - /// About button on the ribbon - /// Display the About dialog - /// - /// - /// - private void btnAbout_Click(object sender, EventArgs e) - { - AboutVEPROMS about = new AboutVEPROMS(); - about.ShowDialog(); - } - - /// - /// Volian Web button on the ribbon - /// display the Volian web site on a pop up form - /// - /// - /// - private void btnVlnWeb_Click(object sender, EventArgs e) - { - VlnWeb veWWW = new VlnWeb(); - veWWW.Show(); - } - - #endregion - #region Ribbon - /// - /// This Opens the treeView or opens the selected item in the TreeView - /// - /// - /// - private void btnOpen_Click(object sender, EventArgs e) - { - if (!epProcedures.Expanded) // If panel not expanded - expand it. - { - epProcedures.Expanded = true; - if (tv.Nodes.Count > 0 && tv.SelectedNode == null) - tv.SelectedNode = tv.Nodes[0]; - tv.Focus(); - } - else - { - // TODO: DeleteMe - //VETreeNode tn = (VETreeNode)(tv.SelectedNode); - tv.OpenNode(); - } - } - private void btnNew_Click(object sender, EventArgs e) - { - if (!epProcedures.Expanded) return; - VETreeNode vtn = tv.SelectedNode as VETreeNode; - if (vtn == null) return; // nothing was selected. - if (btnNew.SubItems.Count > 0) return; // submenu will be displayed - vtn.Expand(); - - // Determine type of 'new' based on tree node's object type. The - // only options here are those that would not have created, based on - // containers, a submenu (see the office2007buttonstartbutton1_click code) - FolderInfo fi = vtn.VEObject as FolderInfo; - if (fi != null) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.Folder); - return; - } - - DocVersionInfo dvi = vtn.VEObject as DocVersionInfo; - if (dvi != null) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.Procedure); - return; - } - - // All other types are handled with sub-menus. - - } - - /// - /// Options button on the dialog that appears when the V icon is clicked (top left of application window) - /// note that the "V icon" is also called the Office 2007 Start Button - /// - /// - /// - private void btnOptions_Click(object sender, EventArgs e) - { - frmSysOptions VeSysOpts = new frmSysOptions(); - VeSysOpts.ShowDialog(); - StepTabRibbon.PasteNoReturnsSetting = Properties.Settings.Default.PasteNoReturns; - StepTabRibbon.PastePlainTextSetting = Properties.Settings.Default.PastePlainText; - } - /// - /// Exit button on the dialog that appears when the V icon is clicked (top left of application window) - /// note that the "V icon" is also called the Office 2007 Start Button - /// - /// - /// - private void btnExit_Click(object sender, EventArgs e) - { - this.Close(); - } - #endregion - #region InfoTabRO - private void infotabRO_Click(object sender, EventArgs e) - { - infoPanel.Expanded = true; - infoTabs.SelectedTab = infotabRO; - //if (dtp == null) return; - - displayRO.Mydvi = SelectedDVI; - displayRO.MyROFSTLookup = SelectedROFst.GetROFSTLookup(SelectedDVI); - displayRO.MyRTB = (SelectedStepTabPanel == null) ? null : - SelectedStepTabPanel.MyStepPanel.SelectedEditItem == null ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; - displayRO.TabControl = tc; - - displayRO.ProgressBar = bottomProgBar; - } - #endregion - #region InfoTabTransition - private void infotabTransition_Click(object sender, EventArgs e) - { - if (tc == null || tc.SelectedDisplayTabItem == null) return; - if (SelectedStepTabPanel == null) return; - displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; - //displayTransition.RangeColor = global::VEPROMS.Properties.Settings.Default.TransitionRangeColor; - displayTransition.CurTrans = null; - } - #endregion - #region InfoTabLibDocs - private void tabItemLibDocs_Click(object sender, EventArgs e) - { - displayLibDocs.RefreshLibDocPanel(tc); - //displayLibDocs.LibDocListFillIn(tc); - } - private void tv_SectionShouldClose(object sender, vlnTreeSectionInfoEventArgs args) - { - if (!args.MySectionInfo.IsStepSection) tc.CloseWordItem(args.MySectionInfo, args.IsDeleting); - else - { - if (tc == null) return; - StepTabPanel tp = tc.GetProcedureTabPanel(args.MySectionInfo as ItemInfo); - if (tp == null) return; - DisplayTabItem ti = tp.MyDisplayTabItem; - tc.CloseTabItem(ti); - } - } - private void tv_WordSectionDeleted(object sender, WordSectionEventArgs args) - { - // is it a library document - if so and libdoc panel is visible, update lists on panel. - // entry is null if it's a table of contents. - if ((!args.MySectionInfo.IsStepSection) && (args.MySectionInfo.MyContent.MyEntry != null) && ((args.MySectionInfo.MyContent.MyEntry.MyDocument.LibTitle ?? "") != "") && (toolsPanel.Expanded)) - { - if (toolsTabs.SelectedTab == tabItemLibDocs) - { - displayLibDocs.RefreshLibDocPanel(tc); - } - } - } - #endregion - #region InfoTabTags - private void infotabTags_Click(object sender, EventArgs e) - { - infoPanel.Expanded = true; - infoTabs.SelectedTab = infotabTags; - displayTags.MyEditItem = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem; - } - #endregion - #region InfoTabBookMarks - private void infotabBookMarks_Click(object sender, EventArgs e) - { - infoPanel.Expanded = true; - infoTabs.SelectedTab = infotabTags; - displayTags.MyEditItem = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem; - } - #endregion - #region PanelSupport - private void tc_WordSectionClose(object sender, WordSectionEventArgs args) - { - if (!args.MySectionInfo.IsStepSection) tc.CloseWordItem(args.MySectionInfo); - } - private void tc_WordSectionDeleted(object sender, WordSectionEventArgs args) - { - // is it a library document - if so and libdoc panel is visible, update lists on panel. - if ((!args.MySectionInfo.IsStepSection) && (args.MySectionInfo.MyContent.MyEntry != null && (args.MySectionInfo.MyContent.MyEntry.MyDocument.LibTitle ?? "") != "") && (toolsPanel.Expanded)) - { - if (toolsTabs.SelectedTab == tabItemLibDocs) - { - displayLibDocs.RefreshLibDocPanel(tc); - } - } - } - private void tc_ItemPasted(object sender, vlnTreeItemInfoPasteEventArgs args) - { - // all this needs to do is refresh the libdoc display - if it is visible - // and the current item is word section, i.e. it may be a lib doc & would - // require refresh of the lib doc panel. - if (toolsTabs.SelectedTab == tabItemLibDocs && args.MyItemInfo.IsSection) - { - SectionInfo si = args.MyItemInfo as SectionInfo; - if (si != null && (si.MyContent.MyEntry.MyDocument.LibTitle ?? "") != "") displayLibDocs.RefreshLibDocPanel(tc); - } - displayHistory.RefreshChangeList(); - } - private void tc_PanelTabDisplay(object sender, StepPanelTabDisplayEventArgs args) - { - if (args.PanelTabName == "Bookmarks") - { - toolsPanel.Expanded = true; - toolsTabs.SelectedTab = toolsTabBookMarks; - if (_CurrentItem != null && !dlgFindReplace.Visible) displayBookMarks.AddBookMark(_CurrentItem); - } - else if (args.PanelTabName == "Global Search") - { - toolsPanel.Expanded = true; - toolsTabs.SelectedTab = toolstabResults; - } - else if (args.PanelTabName == "LibDocs") - { - toolsPanel.Expanded = true; - toolsTabs.SelectedTab = tabItemLibDocs; - toolsTabs.SelectedTab.PerformClick(); - } - else if (args.PanelTabName == "Annots") - { - epAnnotations.Expanded = true; - } - else if (args.PanelTabName == "Change Step Type") - { - infoPanel.Expanded = true; - infoTabs.SelectedTab = infotabTags; - displayTags.HighlightChangeStep(); - } - else if (args.PanelTabName == "FndRpl") - { - dlgFindReplace.InApproved = (_SelectedDVI != null && _SelectedDVI.VersionType == 127); - dlgFindReplace.Mydocversion = _SelectedDVI; - dlgFindReplace.Visible = true; - dlgFindReplace.MyDisplayBookMarks = displayBookMarks; - } - else if (args.PanelTabName == "SpellChecker") - { - SpellChecker.DoSpellCheck(); - } - else if (args.PanelTabName == "DisplayROUpdateROFST") - { - _SelectedROFst = null; - displayRO.MyROFSTLookup = SelectedROFst.GetROFSTLookup(SelectedDVI); - displayRO.RefreshRoTree(); - } - } - private void tc_SelectedDisplayTabItemChanged(object sender, EventArgs args) - { - // If the current procedure or section in the treeview doesn't match then change the treeview selection. - //jcb added for error B2012-117 - ItemInfo tvii; - if (tv.SelectedNode == null) - tvii = null; - else - tvii = ((tv.SelectedNode as VETreeNode).VEObject) as ItemInfo; - if (tc.SelectedDisplayTabItem == null) return; - if (tc.SelectedDisplayTabItem.MyItemInfo == null) return; // library document. - if (tc.SelectedDisplayTabItem.MyItemInfo.IsProcedure) - { - if (tvii == null || tvii.IsSection || tc.SelectedDisplayTabItem.MyItemInfo.ItemID != tvii.MyProcedure.ItemID) - tv.AdjustTree(tc.SelectedDisplayTabItem.MyItemInfo); - } - else - { - if (tvii == null || tc.SelectedDisplayTabItem.MyItemInfo.ItemID != tvii.ItemID) - tv.AdjustTree(tc.SelectedDisplayTabItem.MyItemInfo); - } - SetCaption(tv.SelectedNode as VETreeNode); - displayApplicability.MyDisplayTabItem = tc.SelectedDisplayTabItem; - lblUser.Text = tc.SelectedDisplayTabItem.MyUserRole; - if (tc.SelectedDisplayTabItem.MyItemInfo.MyDocVersion.MultiUnitCount > 1) - btnPrint.Visible = false; - else - btnPrint.Visible = true; - } - private void tc_StepPanelModeChange(object sender, StepRTBModeChangeEventArgs args) - { - this.lblEditView.Text = args.ViewMode == E_ViewMode.Edit ? "Edit" : "View"; - this.dlgFindReplace.ToggleReplaceTab(args.ViewMode); - } - private ItemInfo _CurrentItem = null; - private StepRTB _LastStepRTB = null; - private void tc_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args) - { - btnFixMSWord.Visible = (args != null && ( args.MyItemInfo != null && args.MyEditItem == null)); - if (_LastStepRTB != null && !_LastStepRTB.Disposing && !_LastStepRTB.Closed) - _LastStepRTB.EditModeChanged -= new StepRTBEvent(_LastStepRTB_EditModeChanged); - _LastStepRTB = args != null && args.MyEditItem != null ? args.MyEditItem.MyStepRTB : null; - if (_LastStepRTB != null) _LastStepRTB.EditModeChanged += new StepRTBEvent(_LastStepRTB_EditModeChanged); - lblEditView.Text = " "; - if (args == null) - { - _CurrentItem = null; - ctrlAnnotationDetails.CurrentAnnotation = null; - ctrlAnnotationDetails.Annotations = null; - infotabFoldoutMaint.Visible = infotabRO.Visible = infotabTransition.Visible = infotabTags.Visible = infotabHistory.Visible = infotabApplicability.Visible = false; - // When infotabTags is set to InVisible, the matching panel also needs to be set to invisible - infotabControlPanelTags.Visible = false; - displayTags.Visible = false; - SelectedStepTabPanel = null; - lblItemID.Text = "No Item Selected"; - lblItemID.ForeColor = Color.Yellow; - } - else - { - lblItemID.Text = string.Format("ItemID = {0}", args.MyItemInfo.ItemID); - lblItemID.ForeColor = Color.DarkBlue; - if (_CurrentItem != args.MyItemInfo) - { - if (_CurrentItem != null) _CurrentItem.Deleted -= new ItemInfoEvent(_CurrentItem_Deleted); - _CurrentItem = args.MyItemInfo; - } - //vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem); - if (args.MyEditItem == null) - { - infotabTransition.Visible = false; - infotabRO.Visible = false; - if (args.MyItemInfo.MyDocVersion.DocVersionAssociations != null) - { - displayRO.MyROFSTLookup = args.MyItemInfo.MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(args.MyItemInfo.MyDocVersion); - displayRO.MyRTB = null; - infotabRO.Visible = true; - } - infotabTags.Visible = false; - displayBookMarks.MyEditItem = null; - displayFoldoutMaint.Visible = false; - //vlnStackTrace.ShowStack("enter tc_ItemSelectedChanged {0}", _CurrentItem); - } - else - { - if (args.MyEditItem.MyItemInfo.IsSection || args.MyEditItem.MyItemInfo.IsProcedure) - { - infotabRO.Visible = infotabTransition.Visible = false; - infotabTags.Visible = false; - displayTags.Visible = false; - } - else - { - infotabTags.Visible = true; - if (_LastStepRTB != null) - { - infotabRO.Visible = infotabTransition.Visible = true; - displayRO.Enabled = _LastStepRTB.EditMode || _LastStepRTB.IsRoTable; - displayTransition.Enabled = _LastStepRTB.EditMode; - } - else - infotabRO.Visible = infotabTransition.Visible = false; - - // When infotabTags is set to Visible, the matching panel also needs to be set to visible - // the other panels will appear as they are selected by the user. - infotabControlPanelTags.Visible = true; - displayTags.IsVisible = true; - } - infotabHistory.Visible = true; - if (args.MyItemInfo.MyDocVersion.MultiUnitCount > 1) - { - infotabApplicability.Visible = true; - displayApplicability.MyItemInfo = args.MyEditItem.MyItemInfo; - } - else - infotabApplicability.Visible = false; - if (args.MyEditItem.MyItemInfo.ActiveFormat != null) - { - // see if format has floating foldouts, and if so, display the panel. - if (args.MyEditItem.MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout) - { - - displayFoldoutMaint.Visible = true; - infotabFoldoutMaint.Visible = true; - displayFoldoutMaint.Enabled = true; - displayFoldoutMaint.MyItemInfo = args.MyItemInfo; - } - } - // When infotabTags is set to Visible, it is given focus. The next line returns focus to the StepRTB - args.MyEditItem.SetFocus(); - displayTransition.MyRTB = args.MyEditItem.MyStepRTB; - - displayRO.MyRTB = args.MyEditItem.MyStepRTB; - displayTags.MyEditItem = args.MyEditItem; - displayBookMarks.MyEditItem = args.MyEditItem; - displayHistory.MyEditItem = args.MyEditItem; - - displayRO.ProgressBar = bottomProgBar; - - lblEditView.Text = args.MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit ? "Edit" : "View" ; - _CurrentItem.Deleted += new ItemInfoEvent(_CurrentItem_Deleted); - dlgFindReplace.MyEditItem = args.MyEditItem; - SpellChecker.MyEditItem = args.MyEditItem; - } - if (args.MyEditItem != null) - { - SelectedStepTabPanel = args.MyEditItem.MyStepPanel.MyStepTabPanel; - displayRO.ROTypeFilter = SelectedStepTabPanel.MyStepPanel.SelectedEditItem is Volian.Controls.Library.GridItem && (SelectedStepTabPanel.MyStepPanel.SelectedEditItem as Volian.Controls.Library.GridItem).MyFlexGrid.IsRoTable ? - E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image : E_ROValueType.Text; - } - else - { - SelectedDVI = args.MyItemInfo.MyDocVersion; - displayRO.ROTypeFilter = E_ROValueType.All; // allow all RO types for Word attachments (but fix) - } - } - ctrlAnnotationDetails.UpdateAnnotationGrid(_CurrentItem); - AnnotationPanelView(); - btnPrint.Enabled = (_CurrentItem != null); - } - - void _LastStepRTB_EditModeChanged(object sender, EventArgs args) - { - if (_LastStepRTB.EditMode) // going into edit mode in a cell of the grid. - displayRO.Enabled = displayTransition.Enabled = _LastStepRTB.EditMode; - else // going out of edit mode in a cell of the grid. - { - if (this.ActiveControl != tc || (!_LastStepRTB.Parent.Focused && (infotabRO.IsSelected || infotabTransition.IsSelected))) return; - displayRO.Enabled = displayTransition.Enabled = _LastStepRTB.EditMode; - } - } - - void _CurrentItem_Deleted(object sender) - { - //displayBookMarks.DeleteItemBookMarkPanel(_CurrentItem); - } - #endregion - #region Annotations - /// - /// Display or hide the Annotation Details panel - /// - private void AnnotationPanelView() - { - if (ctrlAnnotationDetails.Annotations != null && ctrlAnnotationDetails.Annotations.Count != 0) - { - if (Settings.Default.AutoPopUpAnnotations) //cbAnnotationPopup.Checked - epAnnotations.Expanded = true; - else - epAnnotations.TitleStyle.BackColor1.Color = Color.Yellow; - } - else - { - if (!btnAnnoDetailsPushPin.Checked) - epAnnotations.Expanded = false; - epAnnotations.TitleStyle.BackColor1.Color = _CommentTitleBckColor; - ctrlAnnotationDetails.AnnotationText = null; - } - } - #endregion - #region LinkSupport - private void tc_LinkActiveChanged(object sender, StepPanelLinkEventArgs args) - { - // determine if any infotabs are visisble, and if it is the Transition, - // change the curitem for the transition to the current item. - if (infoPanel.Expanded == true && infoTabs.SelectedTab == infotabTransition) - { - displayTransition.CurTrans = null; - } - } - private void tc_LinkModifyTran(object sender, StepPanelLinkEventArgs args) - { - infoPanel.Expanded = true; - infoTabs.SelectedTab = infotabTransition; - if (SelectedStepTabPanel == null) return; - //displayTransition.RangeColor = global::VEPROMS.Properties.Settings.Default.TransitionRangeColor; - displayTransition.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; - displayTransition.CurTrans = args.MyLinkText.MyTransitionInfo; - } - private void tc_LinkModifyRO(object sender, StepPanelLinkEventArgs args) - { - infoPanel.Expanded = true; - infoTabs.SelectedTab = infotabRO; - - if (SelectedStepTabPanel == null) return; - displayRO.MyROFSTLookup = SelectedROFst.GetROFSTLookup(SelectedDVI); - displayRO.MyRTB = SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyStepRTB; - displayRO.CurROLink = args.MyLinkText.MyRoUsageInfo; - displayRO.ROTypeFilter = SelectedStepTabPanel.MyStepPanel.SelectedEditItem is Volian.Controls.Library.GridItem && (SelectedStepTabPanel.MyStepPanel.SelectedEditItem as Volian.Controls.Library.GridItem).MyFlexGrid.IsRoTable ? - E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image: E_ROValueType.Text; - displayRO.Mydvi = SelectedDVI; - displayRO.ProgressBar = bottomProgBar; - displayRO.TabControl = tc; - } - #endregion - #region VButton - private void office2007StartButton1_Click(object sender, EventArgs e) - { - // If the V-Button is clicked, check to see what tree node is s selected - // to set up the New submenus. The New submenus are dependent on the type of - // object selected, i.e. folder, docversion, etc. - - // reset in case previous selection changed items. - btnNew.SubItems.Clear(); - btnNew.Enabled = false; - - VETreeNode vtn = tv.SelectedNode as VETreeNode; - if (vtn == null) return; - btnNew.Enabled = true; - vtn.Expand(); - - // Folders can have either folders & docversions, but - // not a mix. - FolderInfo fi = vtn.VEObject as FolderInfo; - if (fi != null) - { - if (fi.FolderDocVersionCount > 0) - { - btnNew.Enabled = false; - return; - } - // if at top, 'VEPROMS', folder and childfolders below this only - // option is to create a new (sub)folder, i.e. no submenu items. - if (fi.ChildFolderCount > 0 && fi.MyParent == null) return; - //if (fi.ChildFolderCount == 0) // submenu folders/docversion - //{ - if (fi.MyParent != null) - { - ButtonItem fldbbtn = new ButtonItem("fldbtn", "Folder Before"); - ButtonItem fldabtn = new ButtonItem("fldabtn", "Folder After"); - btnNew.SubItems.Add(fldbbtn); - btnNew.SubItems.Add(fldabtn); - fldbbtn.Click += new EventHandler(fldbbtn_Click); - fldabtn.Click += new EventHandler(fldabtn_Click); - } - ButtonItem fldbtn = new ButtonItem("fldbtn", "Folder"); - btnNew.SubItems.Add(fldbtn); - fldbtn.Click += new EventHandler(fldbtn_Click); - if (fi.ChildFolderCount == 0) - { - ButtonItem dvbtn = new ButtonItem("dvbtn", "Document Version"); - btnNew.SubItems.Add(dvbtn); - dvbtn.Click += new EventHandler(dvbtn_Click); - } - return; - //} - } - - // DocVersions can only have procedures, so no sub-menu - DocVersionInfo dvi = vtn.VEObject as DocVersionInfo; - if (dvi != null) return; - - // Procedures can have a section added or a new procedure before - // or after. - ProcedureInfo pi = vtn.VEObject as ProcedureInfo; - if (pi != null) - { - ButtonItem pbbtn = new ButtonItem("pfbtn", "Procedure Before"); - ButtonItem pabtn = new ButtonItem("pabtn", "Procedure After"); - ButtonItem sctbtn = new ButtonItem("sctbtn", "Section"); - btnNew.SubItems.Add(pbbtn); - btnNew.SubItems.Add(pabtn); - btnNew.SubItems.Add(sctbtn); - pbbtn.Click += new EventHandler(pbbtn_Click); - pabtn.Click += new EventHandler(pabtn_Click); - sctbtn.Click += new EventHandler(sctbtn_Click); - return; - } - - // Sections can have sections before, after, new subsections & if is - // a step section, can have steps - SectionInfo si = vtn.VEObject as SectionInfo; - if (si != null) - { - ButtonItem sbbtn = new ButtonItem("sbbtn", "Section Before"); - ButtonItem sabtn = new ButtonItem("sabtn", "Section After"); - ButtonItem subbtn = new ButtonItem("subbtn", "SubSection"); - btnNew.SubItems.Add(sbbtn); - btnNew.SubItems.Add(sabtn); - btnNew.SubItems.Add(subbtn); - sbbtn.Click += new EventHandler(sbbtn_Click); - sabtn.Click += new EventHandler(sabtn_Click); - subbtn.Click += new EventHandler(subbtn_Click); - if (si.IsStepSection) - { - ButtonItem stpbtn = new ButtonItem("stpbtn", "New Step"); - btnNew.SubItems.Add(stpbtn); - stpbtn.Click += new EventHandler(stpbtn_Click); - } - return; - } - - // Steps can have steps before or after only. - StepInfo stpi = vtn.VEObject as StepInfo; - if (stpi != null) - { - ButtonItem stpbbtn = new ButtonItem("stpbbtn", "New Step Before"); - ButtonItem stpabtn = new ButtonItem("stpabtn", "New Step After"); - btnNew.SubItems.Add(stpbbtn); - btnNew.SubItems.Add(stpabtn); - stpbbtn.Click += new EventHandler(stpbbtn_Click); - stpabtn.Click += new EventHandler(stpabtn_Click); - return; - } - } - - void fldabtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.FolderAfter); - } - - void fldbbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.FolderBefore); - } - - void stpabtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.StepAfter); - } - - void stpbbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.StepBefore); - } - - void subbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.Section); - } - - void sabtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.SectionAfter); - } - - void sbbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.SectionBefore); - } - - void stpbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.Step); - } - - void sctbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.Section); - } - - void pabtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.ProcedureAfter); - } - - void pbbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.ProcedureBefore); - } - - void dvbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.DocVersion); - } - - void fldbtn_Click(object sender, EventArgs e) - { - tv.tv_NodeNew(vlnTreeView.MenuSelections.Folder); - } - private void btnSave_Click(object sender, EventArgs e) - { - } - #endregion - #region PanelEvents - private void infoPanel_Click(object sender, EventArgs e) - { - displayTags.MyEditItem = (SelectedStepTabPanel == null) ? null : SelectedStepTabPanel.MyStepPanel.SelectedEditItem; - } - //private void tv_SectionShouldClose(object sender, vlnTreeSectionInfoEventArgs args) - //{ - // if (!args.MySectionInfo.IsStepSection) tc.CloseWordItem(args.MySectionInfo); - //} - - private void infotabResults_Click(object sender, EventArgs e) - { - toolsPanel.Expanded = true; - InitiateSearch(true); - } - private void InitiateSearch(bool searchFocus) - { - if (toolsPanel.Expanded) - { - if (displaySearch1.Mydocversion == null)//!displaySearch1.OpenDocFromSearch) - { - if (SelectedDVI != null) - { - displaySearch1.Mydocversion = SelectedDVI; - displaySearch1.advTreeStepTypesFillIn(); - } - displaySearch1.advTreeProcSetsFillIn(searchFocus); - } - } - } - - private void toosTabReports_Click(object sender, EventArgs e) - { - toolsPanel.Expanded = true; - InitiateDisplayReports(true); - } - - private void InitiateDisplayReports(bool reportFocus) - { - if (toolsPanel.Expanded) - { - if (SelectedDVI != null) - displayReports.Mydocversion = SelectedDVI; - displayReports.advTreeProcSetsFillIn(reportFocus); - displayReports.advTreeROFillIn(reportFocus); - displayReports.SelectReferencedObjectTab(); // to enable RO selection - } - } - - private void ribbonControl1_ExpandedChanged(object sender, EventArgs e) - { - Console.WriteLine("Size {0}", ribbonControl1.Expanded); - // TODO: Need to send message to all StepTabPanels and tell them to minimize their ribbons. - tc.RibbonExpanded = ribbonControl1.Expanded; - } - - private void btnItemInfo_Click(object sender, EventArgs e) - { - if (tc.SelectedDisplayTabItem != null && tc.SelectedDisplayTabItem.SelectedItemInfo != null) - { - frmPropGrid pg = new frmPropGrid(tc.SelectedDisplayTabItem.SelectedItemInfo, tc.SelectedDisplayTabItem.SelectedItemInfo.Path); - pg.Show(); - } - else - MessageBox.Show("Select Item First", "Item not selected", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - } - 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) - { - if (epAnnotations.Expanded && !_panelExpandedChanging) - { - // if the height of the panel is smaller than the titleheight+20 - //(due to the user dragging the splitter down), then un-expand the - // panel and set the height to the titleheight+75 - if (epAnnotations.Size.Height < epAnnotations.TitleHeight + 20) - { - Size sz = new Size(epAnnotations.Size.Width, epAnnotations.TitleHeight + 75); - epAnnotations.Size = sz; - epAnnotations.Expanded = false; - } - } - } - - private void resizeVerticalExpandedPanel(object sender, EventArgs e) - { - ExpandablePanel ep = (ExpandablePanel)sender; - if (ep.Expanded && !_panelExpandedChanging) - { - // if the width of the panel is smaller than the titleheight+20 - //(due to the user dragging the splitter over), then un-expand the - // panel and set the width to the titleheight+50 - if (ep.Size.Width < ep.TitleHeight + 10) - { - Size sz = new Size(ep.TitleHeight + 50, ep.Size.Height); - ep.Size = sz; - ep.Expanded = false; - } - } - } - - private void expandPanelExpandedChanging(object sender, ExpandedChangeEventArgs e) - { - _panelExpandedChanging = true; - } - - private void toolsPanel_ExpandedChanged(object sender, ExpandedChangeEventArgs e) - { - _panelExpandedChanging = false; - expandableSplitter4.Enabled = toolsPanel.Expanded; - if (toolsPanel.Expanded) - { - InitiateSearch(true); - InitiateDisplayReports(true); - } - } - - private void epAnnotations_ExpandedChanged(object sender, ExpandedChangeEventArgs e) - { - _panelExpandedChanging = false; - expandableSplitter2.Enabled = epAnnotations.Expanded; - } - - private void epProcedures_ExpandedChanged(object sender, ExpandedChangeEventArgs e) - { - _panelExpandedChanging = false; - expandableSplitter1.Enabled = epProcedures.Expanded; - } - - private void infoPanel_ExpandedChanged(object sender, ExpandedChangeEventArgs e) - { - _panelExpandedChanging = false; - expandableSplitter3.Enabled = infoPanel.Expanded; - // if our active tab is a Word attachment, call the Click even on the RO tab - // to ensure that the RO FST is loaded. This fixes a bug where if the first thing you - // open is a Word attachment, the RO panel would not have the RO's listed. - if (infoPanel.Expanded && _CurrentItem != null && _CurrentItem.HasWordContent) - infotabRO_Click(sender, e); - } - #endregion - - private void btnShortCuts_Click(object sender, EventArgs e) - { - ShortcutLists scListdlg = new ShortcutLists(); - scListdlg.Show(); - } - - private void cmbFont_SelectedIndexChanged(object sender, EventArgs e) - { - StepRTB.MyFontFamily = cmbFont.SelectedValue as FontFamily; - } - - private void btnPrint_Click(object sender, EventArgs e) - { - //VETreeNode vtn = tv.SelectedNode as VETreeNode; - //DocVersionInfo dvi = vtn.VEObject as DocVersionInfo; - //while (dvi == null) - //{ - // vtn = vtn.Parent as VETreeNode; - // dvi = vtn.VEObject as DocVersionInfo; - //} - //string pnum = DisplayText.StaticStripRtfCommands(this._CurrentItem.MyProcedure.ProcedureConfig.Number).Replace("\\u8209?", "-"); - DlgPrintProcedure prnDlg = new DlgPrintProcedure(this._CurrentItem.MyProcedure);//dvi.DocVersionConfig,pnum); - prnDlg.MySessionInfo = MySessionInfo; - prnDlg.ShowDialog(this); // RHM 20120925 - Center dialog over PROMS window - } - - private void lblResolution_Click(object sender, EventArgs e) - { - if (this.WindowState != FormWindowState.Normal) - { - this.WindowState = FormWindowState.Normal; - } - else if (this.Size.Width != 1280) - { - this.Size = new Size(1280, 800); - } - else - { - this.Size = new Size(1024, 768); - } - } - - private void frmVEPROMS_Resize(object sender, EventArgs e) - { - lblResolution.Text = string.Format("Resolution {0} x {1}", Size.Width, Size.Height); - } - private void office2007StartButton1_MouseDown(object sender, MouseEventArgs e) - { - // Refresh the MostRecentlyUsedList - _MyMRIList.Refresh(); - SetupMRU(); - } - - private void btnEditItem_Click(object sender, EventArgs e) - { - frmPropGrid pg = new frmPropGrid(tc.SelectedDisplayTabItem.MyStepTabPanel.SelectedEditItem, "EditItem"); - pg.Show(); - } - private void btnUpdateFormat_Click(object sender, EventArgs e) - { - UpdateFormats(null); - } - - private void UpdateFormats(string mypath) - { - if (mypath == null) - { - string fmtPath = Properties.Settings.Default.FormatPath ?? ""; - DirectoryInfo di = null; - do - { - fbd.Description = "Select folder containing FmtAll and GenMacAll folders to update formats"; - fbd.SelectedPath = fmtPath; - DialogResult dr = fbd.ShowDialog(); - if (dr == DialogResult.Cancel) - { - bottomProgBar.Text = "Format Update Cancelled"; - return; - } - di = new DirectoryInfo(fbd.SelectedPath); - fmtPath = di.FullName; - } while (((fmtPath ?? "") == "") || (!di.Exists || !Directory.Exists(di.FullName + @"\fmtall") || !Directory.Exists(di.FullName + @"\genmacall"))); - Properties.Settings.Default.FormatPath = fbd.SelectedPath; - Properties.Settings.Default.Save(); - mypath = di.FullName; - } - string fmtPathAll = mypath + @"\fmtall"; - string genmacPathAll = mypath + @"\genmacall"; - Format.FormatLoaded += new FormatEvent(Format_FormatLoaded); - Format.UpdateFormats(fmtPathAll, genmacPathAll); - Format.FormatLoaded -= new FormatEvent(Format_FormatLoaded); - } - - void Format_FormatLoaded(object sender, FormatEventArgs args) - { - if (args.Status.EndsWith("Formats to Load")) - { - bottomProgBar.Value = 0; - bottomProgBar.Maximum = int.Parse(args.Status.Split(" ".ToCharArray())[0]); - } - else - { - if (args.Status.StartsWith("Error")) - MessageBox.Show(args.Status, "Error Loading Format", MessageBoxButtons.OK, MessageBoxIcon.Error); - else if (!args.Status.Contains("SubFormat")) bottomProgBar.Value++; - } - bottomProgBar.Text = args.Status; - bottomProgBar.TextVisible = true; - Application.DoEvents(); - } - - private void btnSendErrorLog_Click(object sender, EventArgs e) - { - - frmSendErrorLog frm = new frmSendErrorLog(Properties.Settings.Default.OutlookEmail, Properties.Settings.Default["SMTPServer"].ToString(), Properties.Settings.Default["SMTPUser"].ToString(),ErrorLogFileName); - if (frm.ShowDialog(this) == DialogResult.OK) - { - Properties.Settings.Default.OutlookEmail = frm.OutlookEmail; - Properties.Settings.Default.SMTPServer = frm.SMTPServer; - Properties.Settings.Default.SMTPUser = frm.SMTPUser; - Properties.Settings.Default.Save(); - MessageBox.Show("PROMS Error Log successfully sent to Volian support"); - } - } - } - #region Lock stuff - public class TabItemsToClose : Stack - { - public void PushDTI(DisplayTabItem dti) - { - lock (this) - { - if(!this.Contains(dti)) - this.Push(dti); - } - } - public DisplayTabItem PopDTI() - { - lock (this) - { - return this.Pop(); - } - } - public int CountDTI - { - get - { - lock (this) - { - return this.Count; - } - } - } - } - #endregion -} diff --git a/PROMS/VEPROMS User Interface/frmVersionsProperties.Designer.cs.bak b/PROMS/VEPROMS User Interface/frmVersionsProperties.Designer.cs.bak deleted file mode 100644 index 7f9aba5b..00000000 --- a/PROMS/VEPROMS User Interface/frmVersionsProperties.Designer.cs.bak +++ /dev/null @@ -1,2136 +0,0 @@ -namespace VEPROMS -{ - partial class frmVersionsProperties - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmVersionsProperties)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - this.ppBtnCancel = new System.Windows.Forms.Button(); - this.ppBtnOK = new System.Windows.Forms.Button(); - this.ppBtnDefaultChgBar = new DevComponents.DotNetBar.ButtonX(); - this.ppCmbxChangeBarType = new DevComponents.DotNetBar.Controls.ComboBoxEx(); - this.docVersionConfigBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.ppBtnDefaultFmt = new DevComponents.DotNetBar.ButtonX(); - this.ppCmbxFormat = new DevComponents.DotNetBar.Controls.ComboBoxEx(); - this.ppLblChangeBarTypeDefault = new System.Windows.Forms.Label(); - this.ppLblFormatDefault = new System.Windows.Forms.Label(); - this.ppBtnDefCbTxtTyp = new DevComponents.DotNetBar.ButtonX(); - this.ppBtnDefaultCbPos = new DevComponents.DotNetBar.ButtonX(); - this.ppCmbxChgBarTxtType = new DevComponents.DotNetBar.Controls.ComboBoxEx(); - this.ppCmbxChgBarPos = new DevComponents.DotNetBar.Controls.ComboBoxEx(); - this.ppLblChgBarTxtTypeDefault = new System.Windows.Forms.Label(); - this.ppLblChgBarPosDefault = new System.Windows.Forms.Label(); - this.ppBtnDefCbTxt2 = new DevComponents.DotNetBar.ButtonX(); - this.ppBtnDefCbTxt1 = new DevComponents.DotNetBar.ButtonX(); - this.ppLblChgBarUserMsgTwoDefault = new System.Windows.Forms.Label(); - this.ppLblChgBarUserMsgOneDefault = new System.Windows.Forms.Label(); - this.label14 = new System.Windows.Forms.Label(); - this.ppTxbxChangeBarUserMsgOne = new System.Windows.Forms.RichTextBox(); - this.label15 = new System.Windows.Forms.Label(); - this.ppTxbxChangeBarUserMsgTwo = new System.Windows.Forms.RichTextBox(); - this.label13 = new System.Windows.Forms.Label(); - this.label12 = new System.Windows.Forms.Label(); - this.label10 = new System.Windows.Forms.Label(); - this.label11 = new System.Windows.Forms.Label(); - this.imageCodecInfoBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.ppBtnResetRoVals = new System.Windows.Forms.Button(); - this.ppBtnUpRoVals = new System.Windows.Forms.Button(); - this.label6 = new System.Windows.Forms.Label(); - this.ppCmbxProcSetType = new DevComponents.DotNetBar.Controls.ComboBoxEx(); - this.label9 = new System.Windows.Forms.Label(); - this.ppRTxtName = new System.Windows.Forms.RichTextBox(); - //added jcb for procedure set rev - this.lblProcSetRev = new System.Windows.Forms.Label(); - this.ppRTxtProcSetRev = new System.Windows.Forms.RichTextBox(); - //end added jcb for procedure set rev - this.ppRTxtTitle = new System.Windows.Forms.RichTextBox(); - this.ppDTPicker = new System.Windows.Forms.DateTimePicker(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.ppTxtBxUserID = new System.Windows.Forms.TextBox(); - this.label3 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.ppBtnPDFLoc = new DevComponents.DotNetBar.ButtonX(); - this.ppNumUpDwnOvrdPrnPenWidth = new System.Windows.Forms.NumericUpDown(); - this.label19 = new System.Windows.Forms.Label(); - this.label20 = new System.Windows.Forms.Label(); - this.ppNumUpDwnOverdPrnPenBoldWidth = new System.Windows.Forms.NumericUpDown(); - this.ppNumUpDwnOvrdPrnPenULineWidth = new System.Windows.Forms.NumericUpDown(); - this.label21 = new System.Windows.Forms.Label(); - this.ppNumUpDwnAdjPrnStartPos = new System.Windows.Forms.NumericUpDown(); - this.label22 = new System.Windows.Forms.Label(); - this.ppBtnDeftDisAutoDuplx = new DevComponents.DotNetBar.ButtonX(); - this.ppBtnDefWatermark = new DevComponents.DotNetBar.ButtonX(); - this.ppCmbxWatermark = new DevComponents.DotNetBar.Controls.ComboBoxEx(); - this.ppLblWatermarkDefault = new System.Windows.Forms.Label(); - this.ppTxtBxPDFLoc = new System.Windows.Forms.TextBox(); - this.label18 = new System.Windows.Forms.Label(); - this.ppLblAutoDuplexDefault = new System.Windows.Forms.Label(); - this.ppChbxDisAutoDuplex = new System.Windows.Forms.CheckBox(); - this.label17 = new System.Windows.Forms.Label(); - this.superTooltip1 = new DevComponents.DotNetBar.SuperTooltip(); - this.ppCbShwDefSettings = new DevComponents.DotNetBar.Controls.CheckBoxX(); - this.ppGpbxUserSpecCB = new DevComponents.DotNetBar.Controls.GroupPanel(); - this.ppGpbxUserSpecTxt = new DevComponents.DotNetBar.Controls.GroupPanel(); - this.ppLblDefSettingsInfo = new System.Windows.Forms.Label(); - this.dlgROFolder = new System.Windows.Forms.FolderBrowserDialog(); - this.tcVersions = new DevComponents.DotNetBar.TabControl(); - this.tcpGeneral = new DevComponents.DotNetBar.TabControlPanel(); - this.tiGeneral = new DevComponents.DotNetBar.TabItem(this.components); - this.tcpRefereceObjects = new DevComponents.DotNetBar.TabControlPanel(); - this.tbRoDb = new System.Windows.Forms.TextBox(); - this.ppBtnRoDbBrowse = new System.Windows.Forms.Button(); - this.btnRoDbProperties = new DevComponents.DotNetBar.ButtonX(); - this.cmbRoDb = new System.Windows.Forms.ComboBox(); - this.ppGpbxUpROvals = new DevComponents.DotNetBar.Controls.GroupPanel(); - this.tiRefObjs = new DevComponents.DotNetBar.TabItem(this.components); - this.tcpApplicability = new DevComponents.DotNetBar.TabControlPanel(); - this.label28 = new System.Windows.Forms.Label(); - this.label27 = new System.Windows.Forms.Label(); - this.label26 = new System.Windows.Forms.Label(); - this.label25 = new System.Windows.Forms.Label(); - this.label24 = new System.Windows.Forms.Label(); - this.label23 = new System.Windows.Forms.Label(); - this.label16 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.textBox11 = new System.Windows.Forms.TextBox(); - this.bsMiniApple = new System.Windows.Forms.BindingSource(this.components); - this.textBox10 = new System.Windows.Forms.TextBox(); - this.textBox9 = new System.Windows.Forms.TextBox(); - this.textBox8 = new System.Windows.Forms.TextBox(); - this.textBox7 = new System.Windows.Forms.TextBox(); - this.textBox6 = new System.Windows.Forms.TextBox(); - this.textBox5 = new System.Windows.Forms.TextBox(); - this.textBox4 = new System.Windows.Forms.TextBox(); - this.textBox3 = new System.Windows.Forms.TextBox(); - this.textBox2 = new System.Windows.Forms.TextBox(); - this.textBox1 = new System.Windows.Forms.TextBox(); - this.panel1 = new System.Windows.Forms.Panel(); - this.panel2 = new System.Windows.Forms.Panel(); - this.btnDelApple = new System.Windows.Forms.Button(); - this.btnNewApple = new System.Windows.Forms.Button(); - this.lbApplicabilities = new System.Windows.Forms.ListBox(); - this.bsApples = new System.Windows.Forms.BindingSource(this.components); - this.label5 = new System.Windows.Forms.Label(); - this.tiApplicability = new DevComponents.DotNetBar.TabItem(this.components); - this.tabControlPanel5 = new DevComponents.DotNetBar.TabControlPanel(); - this.ppGrdLibDocList = new DevComponents.DotNetBar.Controls.DataGridViewX(); - this.documentEntryCountDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.libTitleDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.documentInfoListBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.tiLibDocs = new DevComponents.DotNetBar.TabItem(this.components); - this.tcpFormatSettings = new DevComponents.DotNetBar.TabControlPanel(); - this.tiFmtSettings = new DevComponents.DotNetBar.TabItem(this.components); - this.tcpOutputSettings = new DevComponents.DotNetBar.TabControlPanel(); - this.ppChbxAddBlankPgs = new System.Windows.Forms.CheckBox(); - this.ppChbxAlwaysViewPDF = new System.Windows.Forms.CheckBox(); - this.ppChbxAlwaysOvrWrtPDF = new System.Windows.Forms.CheckBox(); - this.ppGrpbxPrnAdj = new DevComponents.DotNetBar.Controls.GroupPanel(); - this.tiOutputSettings = new DevComponents.DotNetBar.TabItem(this.components); - this.panVerBtns = new System.Windows.Forms.Panel(); - this.btnApplicability = new DevComponents.DotNetBar.ButtonX(); - this.btnLibDocs = new DevComponents.DotNetBar.ButtonX(); - this.btnFmtSettings = new DevComponents.DotNetBar.ButtonX(); - this.btnOutputSettings = new DevComponents.DotNetBar.ButtonX(); - this.btnRefObjs = new DevComponents.DotNetBar.ButtonX(); - this.btnGeneral = new DevComponents.DotNetBar.ButtonX(); - this.ROPrefixBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.PDFLocationBrowserDialog = new System.Windows.Forms.FolderBrowserDialog(); - this.formatInfoListBindingSource = new System.Windows.Forms.BindingSource(this.components); - ((System.ComponentModel.ISupportInitialize)(this.docVersionConfigBindingSource)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.imageCodecInfoBindingSource)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.ppNumUpDwnOvrdPrnPenWidth)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.ppNumUpDwnOverdPrnPenBoldWidth)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.ppNumUpDwnOvrdPrnPenULineWidth)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.ppNumUpDwnAdjPrnStartPos)).BeginInit(); - this.ppGpbxUserSpecCB.SuspendLayout(); - this.ppGpbxUserSpecTxt.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.tcVersions)).BeginInit(); - this.tcVersions.SuspendLayout(); - this.tcpGeneral.SuspendLayout(); - this.tcpRefereceObjects.SuspendLayout(); - this.ppGpbxUpROvals.SuspendLayout(); - this.tcpApplicability.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.bsMiniApple)).BeginInit(); - this.panel1.SuspendLayout(); - this.panel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.bsApples)).BeginInit(); - this.tabControlPanel5.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.ppGrdLibDocList)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.documentInfoListBindingSource)).BeginInit(); - this.tcpFormatSettings.SuspendLayout(); - this.tcpOutputSettings.SuspendLayout(); - this.ppGrpbxPrnAdj.SuspendLayout(); - this.panVerBtns.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.ROPrefixBindingSource)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.formatInfoListBindingSource)).BeginInit(); - this.SuspendLayout(); - // - // ppBtnCancel - // - this.ppBtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ppBtnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.ppBtnCancel.Location = new System.Drawing.Point(591, 370); - this.ppBtnCancel.Margin = new System.Windows.Forms.Padding(2); - this.ppBtnCancel.Name = "ppBtnCancel"; - this.ppBtnCancel.Size = new System.Drawing.Size(56, 21); - this.ppBtnCancel.TabIndex = 91; - this.ppBtnCancel.Text = "Cancel"; - this.ppBtnCancel.UseVisualStyleBackColor = true; - this.ppBtnCancel.Click += new System.EventHandler(this.btnFldrPropCancel_Click); - // - // ppBtnOK - // - this.ppBtnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ppBtnOK.Location = new System.Drawing.Point(517, 370); - this.ppBtnOK.Margin = new System.Windows.Forms.Padding(2); - this.ppBtnOK.Name = "ppBtnOK"; - this.ppBtnOK.Size = new System.Drawing.Size(56, 21); - this.ppBtnOK.TabIndex = 90; - this.ppBtnOK.Text = "OK"; - this.ppBtnOK.UseVisualStyleBackColor = true; - this.ppBtnOK.Click += new System.EventHandler(this.btnVersionsPropOK_Click); - // - // ppBtnDefaultChgBar - // - this.ppBtnDefaultChgBar.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.ppBtnDefaultChgBar.Location = new System.Drawing.Point(302, 82); - this.ppBtnDefaultChgBar.Margin = new System.Windows.Forms.Padding(2); - this.ppBtnDefaultChgBar.Name = "ppBtnDefaultChgBar"; - this.ppBtnDefaultChgBar.Size = new System.Drawing.Size(44, 20); - this.superTooltip1.SetSuperTooltip(this.ppBtnDefaultChgBar, new DevComponents.DotNetBar.SuperTooltipInfo("The Default Button", "", "This will revert the Change Bar selection back to using the parent\'s (default) se" + - "tting.\r\n\r\nCheck \"Show Default Settings\" to display the \"default\" Change Bar (bel" + - "ow the Change Bars selection box).", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(250, 145))); - this.ppBtnDefaultChgBar.TabIndex = 43; - this.ppBtnDefaultChgBar.Text = "Default"; - this.ppBtnDefaultChgBar.ThemeAware = true; - this.ppBtnDefaultChgBar.Visible = false; - this.ppBtnDefaultChgBar.Click += new System.EventHandler(this.ppBtnDefaultChgBar_Click); - // - // ppCmbxChangeBarType - // - this.ppCmbxChangeBarType.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.docVersionConfigBindingSource, "Print_ChangeBar", true)); - this.ppCmbxChangeBarType.DisplayMember = "Text"; - this.ppCmbxChangeBarType.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.ppCmbxChangeBarType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.ppCmbxChangeBarType.FormattingEnabled = true; - this.ppCmbxChangeBarType.Location = new System.Drawing.Point(89, 82); - this.ppCmbxChangeBarType.Margin = new System.Windows.Forms.Padding(2); - this.ppCmbxChangeBarType.Name = "ppCmbxChangeBarType"; - this.ppCmbxChangeBarType.Size = new System.Drawing.Size(210, 21); - this.ppCmbxChangeBarType.TabIndex = 42; - this.ppCmbxChangeBarType.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppCmbxChangeBarType.WatermarkText = "select change bar setting"; - this.ppCmbxChangeBarType.SelectedValueChanged += new System.EventHandler(this.ppCmbxChangeBarType_SelectedValueChanged); - // - // docVersionConfigBindingSource - // - this.docVersionConfigBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.DocVersionConfig); - // - // ppBtnDefaultFmt - // - this.ppBtnDefaultFmt.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.ppBtnDefaultFmt.Location = new System.Drawing.Point(445, 28); - this.ppBtnDefaultFmt.Margin = new System.Windows.Forms.Padding(2); - this.ppBtnDefaultFmt.Name = "ppBtnDefaultFmt"; - this.ppBtnDefaultFmt.Size = new System.Drawing.Size(38, 19); - this.superTooltip1.SetSuperTooltip(this.ppBtnDefaultFmt, new DevComponents.DotNetBar.SuperTooltipInfo("Default Button", "", "This will revert the format selection back to using the parent\'s format.\r\n\r\nCheck" + - " \"Show Default Settings\" to display the \"default\" format name (below the format " + - "selection box).", null, null, DevComponents.DotNetBar.eTooltipColor.System)); - this.ppBtnDefaultFmt.TabIndex = 41; - this.ppBtnDefaultFmt.Text = "Default"; - this.ppBtnDefaultFmt.ThemeAware = true; - this.ppBtnDefaultFmt.Click += new System.EventHandler(this.ppBtnDefaultFmt_Click); - // - // ppCmbxFormat - // - this.ppCmbxFormat.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.docVersionConfigBindingSource, "FormatSelection", true)); - this.ppCmbxFormat.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.ppCmbxFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.ppCmbxFormat.FormattingEnabled = true; - this.ppCmbxFormat.Location = new System.Drawing.Point(14, 28); - this.ppCmbxFormat.Margin = new System.Windows.Forms.Padding(2); - this.ppCmbxFormat.Name = "ppCmbxFormat"; - this.ppCmbxFormat.Size = new System.Drawing.Size(422, 21); - this.superTooltip1.SetSuperTooltip(this.ppCmbxFormat, new DevComponents.DotNetBar.SuperTooltipInfo("Format Selection", "", resources.GetString("ppCmbxFormat.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.System)); - this.ppCmbxFormat.TabIndex = 40; - this.ppCmbxFormat.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppCmbxFormat.WatermarkText = "Select a Format"; - this.ppCmbxFormat.SelectedValueChanged += new System.EventHandler(this.ppCmbxFormat_SelectedValueChanged); - // - // ppLblChangeBarTypeDefault - // - this.ppLblChangeBarTypeDefault.AutoSize = true; - this.ppLblChangeBarTypeDefault.BackColor = System.Drawing.Color.Transparent; - this.ppLblChangeBarTypeDefault.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppLblChangeBarTypeDefault.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.ppLblChangeBarTypeDefault.Location = new System.Drawing.Point(88, 103); - this.ppLblChangeBarTypeDefault.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.ppLblChangeBarTypeDefault.Name = "ppLblChangeBarTypeDefault"; - this.ppLblChangeBarTypeDefault.Size = new System.Drawing.Size(79, 13); - this.superTooltip1.SetSuperTooltip(this.ppLblChangeBarTypeDefault, new DevComponents.DotNetBar.SuperTooltipInfo("This is the default Change Bar setting", "", "Pressing the Default Button (to the right)\r\nwill set the Change Bar setting back " + - "to this.\r\n", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(270, 70))); - this.ppLblChangeBarTypeDefault.TabIndex = 27; - this.ppLblChangeBarTypeDefault.Text = "(default setting)"; - // - // ppLblFormatDefault - // - this.ppLblFormatDefault.AutoSize = true; - this.ppLblFormatDefault.BackColor = System.Drawing.Color.Transparent; - this.ppLblFormatDefault.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppLblFormatDefault.ForeColor = System.Drawing.Color.Gray; - this.ppLblFormatDefault.Location = new System.Drawing.Point(11, 50); - this.ppLblFormatDefault.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.ppLblFormatDefault.Name = "ppLblFormatDefault"; - this.ppLblFormatDefault.Size = new System.Drawing.Size(45, 13); - this.superTooltip1.SetSuperTooltip(this.ppLblFormatDefault, new DevComponents.DotNetBar.SuperTooltipInfo("The is the default Format setting", "", "Pressing the Reset Button (to the right)\r\nwill set the format setting back to thi" + - "s.\r\n", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(255, 70))); - this.ppLblFormatDefault.TabIndex = 26; - this.ppLblFormatDefault.Text = "(default)"; - // - // ppBtnDefCbTxtTyp - // - this.ppBtnDefCbTxtTyp.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.ppBtnDefCbTxtTyp.Location = new System.Drawing.Point(216, 15); - this.ppBtnDefCbTxtTyp.Margin = new System.Windows.Forms.Padding(2); - this.ppBtnDefCbTxtTyp.Name = "ppBtnDefCbTxtTyp"; - this.ppBtnDefCbTxtTyp.Size = new System.Drawing.Size(44, 20); - this.superTooltip1.SetSuperTooltip(this.ppBtnDefCbTxtTyp, new DevComponents.DotNetBar.SuperTooltipInfo("The Default Button", "", resources.GetString("ppBtnDefCbTxtTyp.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(235, 150))); - this.ppBtnDefCbTxtTyp.TabIndex = 45; - this.ppBtnDefCbTxtTyp.Text = "Default"; - this.ppBtnDefCbTxtTyp.ThemeAware = true; - this.ppBtnDefCbTxtTyp.Visible = false; - this.ppBtnDefCbTxtTyp.Click += new System.EventHandler(this.ppBtnDefCbTxtTyp_Click); - // - // ppBtnDefaultCbPos - // - this.ppBtnDefaultCbPos.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.ppBtnDefaultCbPos.Location = new System.Drawing.Point(210, 66); - this.ppBtnDefaultCbPos.Margin = new System.Windows.Forms.Padding(2); - this.ppBtnDefaultCbPos.Name = "ppBtnDefaultCbPos"; - this.ppBtnDefaultCbPos.Size = new System.Drawing.Size(44, 20); - this.superTooltip1.SetSuperTooltip(this.ppBtnDefaultCbPos, new DevComponents.DotNetBar.SuperTooltipInfo("The Default Button", "", resources.GetString("ppBtnDefaultCbPos.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 145))); - this.ppBtnDefaultCbPos.TabIndex = 51; - this.ppBtnDefaultCbPos.Text = "Default"; - this.ppBtnDefaultCbPos.ThemeAware = true; - this.ppBtnDefaultCbPos.Visible = false; - this.ppBtnDefaultCbPos.Click += new System.EventHandler(this.ppBtnDefaultCbPos_Click); - // - // ppCmbxChgBarTxtType - // - this.ppCmbxChgBarTxtType.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.docVersionConfigBindingSource, "Print_ChangeBarText", true)); - this.ppCmbxChgBarTxtType.DisplayMember = "Text"; - this.ppCmbxChgBarTxtType.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.ppCmbxChgBarTxtType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.ppCmbxChgBarTxtType.FormattingEnabled = true; - this.ppCmbxChgBarTxtType.Location = new System.Drawing.Point(72, 16); - this.ppCmbxChgBarTxtType.Margin = new System.Windows.Forms.Padding(2); - this.ppCmbxChgBarTxtType.Name = "ppCmbxChgBarTxtType"; - this.ppCmbxChgBarTxtType.Size = new System.Drawing.Size(140, 21); - this.ppCmbxChgBarTxtType.TabIndex = 44; - this.ppCmbxChgBarTxtType.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppCmbxChgBarTxtType.WatermarkText = "select change bar text type"; - this.ppCmbxChgBarTxtType.SelectedValueChanged += new System.EventHandler(this.ppCmbxChgBarTxtType_SelectedValueChanged); - // - // ppCmbxChgBarPos - // - this.ppCmbxChgBarPos.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.docVersionConfigBindingSource, "Print_ChangeBarLoc", true)); - this.ppCmbxChgBarPos.DisplayMember = "Text"; - this.ppCmbxChgBarPos.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.ppCmbxChgBarPos.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.ppCmbxChgBarPos.FormattingEnabled = true; - this.ppCmbxChgBarPos.Location = new System.Drawing.Point(72, 66); - this.ppCmbxChgBarPos.Margin = new System.Windows.Forms.Padding(2); - this.ppCmbxChgBarPos.Name = "ppCmbxChgBarPos"; - this.ppCmbxChgBarPos.Size = new System.Drawing.Size(135, 21); - this.ppCmbxChgBarPos.TabIndex = 50; - this.ppCmbxChgBarPos.Visible = false; - this.ppCmbxChgBarPos.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppCmbxChgBarPos.WatermarkText = "select change bar position"; - this.ppCmbxChgBarPos.SelectedValueChanged += new System.EventHandler(this.ppCmbxChgBarPos_SelectedValueChanged); - // - // ppLblChgBarTxtTypeDefault - // - this.ppLblChgBarTxtTypeDefault.AutoSize = true; - this.ppLblChgBarTxtTypeDefault.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppLblChgBarTxtTypeDefault.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.ppLblChgBarTxtTypeDefault.Location = new System.Drawing.Point(70, 37); - this.ppLblChgBarTxtTypeDefault.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.ppLblChgBarTxtTypeDefault.Name = "ppLblChgBarTxtTypeDefault"; - this.ppLblChgBarTxtTypeDefault.Size = new System.Drawing.Size(79, 13); - this.superTooltip1.SetSuperTooltip(this.ppLblChgBarTxtTypeDefault, new DevComponents.DotNetBar.SuperTooltipInfo("This is the default Custom Change Bar Text Type", "", "Pressing the Default Button (to the right) will set the Cusotom Change Bar Positi" + - "on setting back to this.\r\n", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(0, 0))); - this.ppLblChgBarTxtTypeDefault.TabIndex = 13; - this.ppLblChgBarTxtTypeDefault.Text = "(default setting)"; - // - // ppLblChgBarPosDefault - // - this.ppLblChgBarPosDefault.AutoSize = true; - this.ppLblChgBarPosDefault.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppLblChgBarPosDefault.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.ppLblChgBarPosDefault.Location = new System.Drawing.Point(74, 86); - this.ppLblChgBarPosDefault.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.ppLblChgBarPosDefault.Name = "ppLblChgBarPosDefault"; - this.ppLblChgBarPosDefault.Size = new System.Drawing.Size(79, 13); - this.superTooltip1.SetSuperTooltip(this.ppLblChgBarPosDefault, new DevComponents.DotNetBar.SuperTooltipInfo("This is the default Custom Change Bar Position", "", "Pressing the Default Button (to the right) will set the Cusotom Change Bar Positi" + - "on setting back to this.\r\n", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(300, 80))); - this.ppLblChgBarPosDefault.TabIndex = 12; - this.ppLblChgBarPosDefault.Text = "(default setting)"; - this.ppLblChgBarPosDefault.Visible = false; - // - // ppBtnDefCbTxt2 - // - this.ppBtnDefCbTxt2.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.ppBtnDefCbTxt2.Location = new System.Drawing.Point(119, 47); - this.ppBtnDefCbTxt2.Margin = new System.Windows.Forms.Padding(2); - this.ppBtnDefCbTxt2.Name = "ppBtnDefCbTxt2"; - this.ppBtnDefCbTxt2.Size = new System.Drawing.Size(44, 20); - this.superTooltip1.SetSuperTooltip(this.ppBtnDefCbTxt2, new DevComponents.DotNetBar.SuperTooltipInfo("The Default Button", "", resources.GetString("ppBtnDefCbTxt2.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 150))); - this.ppBtnDefCbTxt2.TabIndex = 49; - this.ppBtnDefCbTxt2.Text = "Default"; - this.ppBtnDefCbTxt2.ThemeAware = true; - this.ppBtnDefCbTxt2.Visible = false; - this.ppBtnDefCbTxt2.Click += new System.EventHandler(this.ppBtnDefCbTxt2_Click); - // - // ppBtnDefCbTxt1 - // - this.ppBtnDefCbTxt1.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.ppBtnDefCbTxt1.Location = new System.Drawing.Point(119, 6); - this.ppBtnDefCbTxt1.Margin = new System.Windows.Forms.Padding(2); - this.ppBtnDefCbTxt1.Name = "ppBtnDefCbTxt1"; - this.ppBtnDefCbTxt1.Size = new System.Drawing.Size(44, 20); - this.superTooltip1.SetSuperTooltip(this.ppBtnDefCbTxt1, new DevComponents.DotNetBar.SuperTooltipInfo("The Default Button", "", resources.GetString("ppBtnDefCbTxt1.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(250, 150))); - this.ppBtnDefCbTxt1.TabIndex = 47; - this.ppBtnDefCbTxt1.Text = "Default"; - this.ppBtnDefCbTxt1.ThemeAware = true; - this.ppBtnDefCbTxt1.Visible = false; - this.ppBtnDefCbTxt1.Click += new System.EventHandler(this.ppBtnDefCbTxt1_Click); - // - // ppLblChgBarUserMsgTwoDefault - // - this.ppLblChgBarUserMsgTwoDefault.AutoSize = true; - this.ppLblChgBarUserMsgTwoDefault.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppLblChgBarUserMsgTwoDefault.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.ppLblChgBarUserMsgTwoDefault.Location = new System.Drawing.Point(66, 66); - this.ppLblChgBarUserMsgTwoDefault.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.ppLblChgBarUserMsgTwoDefault.Name = "ppLblChgBarUserMsgTwoDefault"; - this.ppLblChgBarUserMsgTwoDefault.Size = new System.Drawing.Size(45, 13); - this.superTooltip1.SetSuperTooltip(this.ppLblChgBarUserMsgTwoDefault, new DevComponents.DotNetBar.SuperTooltipInfo("This is the default Custom Message Line Two", "", "Pressing the Default Button (to the right) will set the Cusotom Change Bar Messag" + - "e Line Two setting back to this.\r\n", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(0, 0))); - this.ppLblChgBarUserMsgTwoDefault.TabIndex = 7; - this.ppLblChgBarUserMsgTwoDefault.Text = "(default)"; - // - // ppLblChgBarUserMsgOneDefault - // - this.ppLblChgBarUserMsgOneDefault.AutoSize = true; - this.ppLblChgBarUserMsgOneDefault.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppLblChgBarUserMsgOneDefault.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.ppLblChgBarUserMsgOneDefault.Location = new System.Drawing.Point(66, 28); - this.ppLblChgBarUserMsgOneDefault.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.ppLblChgBarUserMsgOneDefault.Name = "ppLblChgBarUserMsgOneDefault"; - this.ppLblChgBarUserMsgOneDefault.Size = new System.Drawing.Size(45, 13); - this.superTooltip1.SetSuperTooltip(this.ppLblChgBarUserMsgOneDefault, new DevComponents.DotNetBar.SuperTooltipInfo("This is the default Custom Message Line One", "", "Pressing the Default Button (to the right) will set the Cusotom Change Bar Messag" + - "e Line One setting back to this.\r\n", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); - this.ppLblChgBarUserMsgOneDefault.TabIndex = 6; - this.ppLblChgBarUserMsgOneDefault.Text = "(default)"; - // - // label14 - // - this.label14.AutoSize = true; - this.label14.Location = new System.Drawing.Point(16, 9); - this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(48, 13); - this.label14.TabIndex = 4; - this.label14.Text = "Line one"; - // - // ppTxbxChangeBarUserMsgOne - // - this.ppTxbxChangeBarUserMsgOne.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.docVersionConfigBindingSource, "Print_UserCBMess1", true)); - this.ppTxbxChangeBarUserMsgOne.Location = new System.Drawing.Point(68, 6); - this.ppTxbxChangeBarUserMsgOne.Margin = new System.Windows.Forms.Padding(2); - this.ppTxbxChangeBarUserMsgOne.Multiline = false; - this.ppTxbxChangeBarUserMsgOne.Name = "ppTxbxChangeBarUserMsgOne"; - this.ppTxbxChangeBarUserMsgOne.Size = new System.Drawing.Size(44, 20); - this.superTooltip1.SetSuperTooltip(this.ppTxbxChangeBarUserMsgOne, new DevComponents.DotNetBar.SuperTooltipInfo("User Defined Message", "", "This message will appear on all change bars", null, null, DevComponents.DotNetBar.eTooltipColor.System)); - this.ppTxbxChangeBarUserMsgOne.TabIndex = 46; - this.ppTxbxChangeBarUserMsgOne.Text = ""; - this.ppTxbxChangeBarUserMsgOne.TextChanged += new System.EventHandler(this.ppTxbxChangeBarUserMsgOne_TextChanged); - // - // label15 - // - this.label15.AutoSize = true; - this.label15.Location = new System.Drawing.Point(16, 50); - this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(47, 13); - this.label15.TabIndex = 5; - this.label15.Text = "Line two"; - // - // ppTxbxChangeBarUserMsgTwo - // - this.ppTxbxChangeBarUserMsgTwo.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.docVersionConfigBindingSource, "Print_UserCBMess2", true)); - this.ppTxbxChangeBarUserMsgTwo.Location = new System.Drawing.Point(68, 47); - this.ppTxbxChangeBarUserMsgTwo.Margin = new System.Windows.Forms.Padding(2); - this.ppTxbxChangeBarUserMsgTwo.Multiline = false; - this.ppTxbxChangeBarUserMsgTwo.Name = "ppTxbxChangeBarUserMsgTwo"; - this.ppTxbxChangeBarUserMsgTwo.Size = new System.Drawing.Size(44, 20); - this.superTooltip1.SetSuperTooltip(this.ppTxbxChangeBarUserMsgTwo, new DevComponents.DotNetBar.SuperTooltipInfo("User Defined Message", "", "This message will appear on all change bars", null, null, DevComponents.DotNetBar.eTooltipColor.System)); - this.ppTxbxChangeBarUserMsgTwo.TabIndex = 48; - this.ppTxbxChangeBarUserMsgTwo.Text = ""; - this.ppTxbxChangeBarUserMsgTwo.TextChanged += new System.EventHandler(this.ppTxbxChangeBarUserMsgTwo_TextChanged); - // - // label13 - // - this.label13.AutoSize = true; - this.label13.Location = new System.Drawing.Point(15, 18); - this.label13.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(55, 13); - this.label13.TabIndex = 8; - this.label13.Text = "Text Type"; - // - // label12 - // - this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(25, 67); - this.label12.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(44, 13); - this.label12.TabIndex = 9; - this.label12.Text = "Position"; - this.label12.Visible = false; - // - // label10 - // - this.label10.AutoSize = true; - this.label10.BackColor = System.Drawing.Color.Transparent; - this.label10.Location = new System.Drawing.Point(11, 11); - this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(39, 13); - this.label10.TabIndex = 19; - this.label10.Text = "Format"; - // - // label11 - // - this.label11.AutoSize = true; - this.label11.BackColor = System.Drawing.Color.Transparent; - this.label11.Location = new System.Drawing.Point(17, 84); - this.label11.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(68, 13); - this.label11.TabIndex = 3; - this.label11.Text = "Change Bars"; - // - // imageCodecInfoBindingSource - // - this.imageCodecInfoBindingSource.DataSource = typeof(System.Drawing.Imaging.ImageCodecInfo); - // - // ppBtnResetRoVals - // - this.ppBtnResetRoVals.Location = new System.Drawing.Point(24, 73); - this.ppBtnResetRoVals.Margin = new System.Windows.Forms.Padding(2); - this.ppBtnResetRoVals.Name = "ppBtnResetRoVals"; - this.ppBtnResetRoVals.Size = new System.Drawing.Size(57, 63); - this.ppBtnResetRoVals.TabIndex = 20; - this.ppBtnResetRoVals.Text = "Reset to Previous Values"; - this.ppBtnResetRoVals.UseVisualStyleBackColor = true; - this.ppBtnResetRoVals.Visible = false; - this.ppBtnResetRoVals.Click += new System.EventHandler(this.ppBtnResetRoVals_Click); - // - // ppBtnUpRoVals - // - this.ppBtnUpRoVals.Location = new System.Drawing.Point(25, 11); - this.ppBtnUpRoVals.Margin = new System.Windows.Forms.Padding(2); - this.ppBtnUpRoVals.Name = "ppBtnUpRoVals"; - this.ppBtnUpRoVals.Size = new System.Drawing.Size(57, 59); - this.superTooltip1.SetSuperTooltip(this.ppBtnUpRoVals, new DevComponents.DotNetBar.SuperTooltipInfo("Update Referenced Objects Values", "", "This button will update all of the Referenced Objects Values in all of the proced" + - "ures in this procedure set.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray)); - this.ppBtnUpRoVals.TabIndex = 23; - this.ppBtnUpRoVals.Text = "Update RO Values"; - this.ppBtnUpRoVals.UseVisualStyleBackColor = true; - this.ppBtnUpRoVals.Click += new System.EventHandler(this.ppBtnUpRoVals_Click); - // - // label6 - // - this.label6.AutoSize = true; - this.label6.BackColor = System.Drawing.Color.Transparent; - this.label6.Location = new System.Drawing.Point(9, 17); - this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(72, 13); - this.label6.TabIndex = 12; - this.label6.Text = "RO Database"; - // - // ppCmbxProcSetType - // - this.ppCmbxProcSetType.DisplayMember = "Text"; - this.ppCmbxProcSetType.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.ppCmbxProcSetType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.ppCmbxProcSetType.FormattingEnabled = true; - this.ppCmbxProcSetType.Location = new System.Drawing.Point(175, 236); - this.ppCmbxProcSetType.Margin = new System.Windows.Forms.Padding(2); - this.ppCmbxProcSetType.Name = "ppCmbxProcSetType"; - this.ppCmbxProcSetType.Size = new System.Drawing.Size(133, 21); - this.ppCmbxProcSetType.TabIndex = 2; - this.ppCmbxProcSetType.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppCmbxProcSetType.WatermarkText = "select procedure set type"; - // - // label9 - // - this.label9.AutoSize = true; - this.label9.BackColor = System.Drawing.Color.Transparent; - this.label9.Location = new System.Drawing.Point(24, 238); - this.label9.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(145, 13); - this.label9.TabIndex = 16; - this.label9.Text = "Procedure Set Type (version)"; - // - // ppRTxtName - // - this.ppRTxtName.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.docVersionConfigBindingSource, "Name", true)); - this.ppRTxtName.Location = new System.Drawing.Point(56, 15); - this.ppRTxtName.Margin = new System.Windows.Forms.Padding(2); - this.ppRTxtName.Multiline = false; - this.ppRTxtName.Name = "ppRTxtName"; - this.ppRTxtName.Size = new System.Drawing.Size(210, 19); - this.ppRTxtName.TabIndex = 0; - this.ppRTxtName.Text = ""; - this.ppRTxtName.Leave += new System.EventHandler(this.ppRTxtName_Leave); - //added jcb for procedure set rev - // - // lblProcSetRev - // - this.lblProcSetRev.AutoSize = true; - this.lblProcSetRev.BackColor = System.Drawing.Color.Transparent; - this.lblProcSetRev.Location = new System.Drawing.Point(24, 204); - this.lblProcSetRev.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.lblProcSetRev.Name = "lblProcSetRev"; - this.lblProcSetRev.Size = new System.Drawing.Size(145, 13); - this.lblProcSetRev.TabIndex = 66; - this.lblProcSetRev.Text = "Procedure Set Revision"; - // - // ppRTxtProcSetRev - // - this.ppRTxtProcSetRev.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.docVersionConfigBindingSource, "ProcedureSetRev", true)); - this.ppRTxtProcSetRev.Location = new System.Drawing.Point(175, 201); - this.ppRTxtProcSetRev.Margin = new System.Windows.Forms.Padding(2); - this.ppRTxtProcSetRev.Multiline = false; - this.ppRTxtProcSetRev.Name = "ppRTxtProcSetRev"; - this.ppRTxtProcSetRev.Size = new System.Drawing.Size(210, 19); - this.ppRTxtProcSetRev.TabIndex = 0; - this.ppRTxtProcSetRev.Text = ""; - //end added jcb for procedure set rev - // - // ppRTxtTitle - // - this.ppRTxtTitle.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.docVersionConfigBindingSource, "Title", true)); - this.ppRTxtTitle.Location = new System.Drawing.Point(56, 57); - this.ppRTxtTitle.Margin = new System.Windows.Forms.Padding(2); - this.ppRTxtTitle.Name = "ppRTxtTitle"; - this.ppRTxtTitle.Size = new System.Drawing.Size(407, 50); - this.ppRTxtTitle.TabIndex = 1; - this.ppRTxtTitle.Text = ""; - this.ppRTxtTitle.Visible = false; - // - // ppDTPicker - // - this.ppDTPicker.CustomFormat = "MM\'/\'dd\'/\'yyyy hh\':\'mm:ss tt"; - this.ppDTPicker.Enabled = false; - this.ppDTPicker.Format = System.Windows.Forms.DateTimePickerFormat.Custom; - this.ppDTPicker.Location = new System.Drawing.Point(80, 123); - this.ppDTPicker.Margin = new System.Windows.Forms.Padding(2); - this.ppDTPicker.Name = "ppDTPicker"; - this.ppDTPicker.Size = new System.Drawing.Size(130, 20); - this.ppDTPicker.TabIndex = 12; - this.ppDTPicker.TabStop = false; - this.ppDTPicker.Visible = false; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Location = new System.Drawing.Point(26, 59); - this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(27, 13); - this.label1.TabIndex = 3; - this.label1.Text = "Title"; - this.label1.Visible = false; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.BackColor = System.Drawing.Color.Transparent; - this.label2.Location = new System.Drawing.Point(17, 18); - this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(35, 13); - this.label2.TabIndex = 4; - this.label2.Text = "Name"; - // - // ppTxtBxUserID - // - this.ppTxtBxUserID.Enabled = false; - this.ppTxtBxUserID.Location = new System.Drawing.Point(71, 169); - this.ppTxtBxUserID.Margin = new System.Windows.Forms.Padding(2); - this.ppTxtBxUserID.Name = "ppTxtBxUserID"; - this.ppTxtBxUserID.Size = new System.Drawing.Size(116, 20); - this.ppTxtBxUserID.TabIndex = 10; - this.ppTxtBxUserID.TabStop = false; - this.ppTxtBxUserID.Visible = false; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.BackColor = System.Drawing.Color.Transparent; - this.label3.Location = new System.Drawing.Point(26, 171); - this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(43, 13); - this.label3.TabIndex = 5; - this.label3.Text = "User ID"; - this.label3.Visible = false; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.BackColor = System.Drawing.Color.Transparent; - this.label4.Location = new System.Drawing.Point(20, 125); - this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(58, 13); - this.label4.TabIndex = 6; - this.label4.Text = "Date/Time"; - this.label4.Visible = false; - // - // ppBtnPDFLoc - // - this.ppBtnPDFLoc.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.ppBtnPDFLoc.Image = ((System.Drawing.Image)(resources.GetObject("ppBtnPDFLoc.Image"))); - this.ppBtnPDFLoc.Location = new System.Drawing.Point(465, 19); - this.ppBtnPDFLoc.Margin = new System.Windows.Forms.Padding(2); - this.ppBtnPDFLoc.Name = "ppBtnPDFLoc"; - this.ppBtnPDFLoc.Size = new System.Drawing.Size(16, 19); - this.ppBtnPDFLoc.TabIndex = 31; - this.ppBtnPDFLoc.Click += new System.EventHandler(this.ppBtnPDFLoc_Click); - // - // ppNumUpDwnOvrdPrnPenWidth - // - this.ppNumUpDwnOvrdPrnPenWidth.Location = new System.Drawing.Point(178, 14); - this.ppNumUpDwnOvrdPrnPenWidth.Margin = new System.Windows.Forms.Padding(2); - this.ppNumUpDwnOvrdPrnPenWidth.Name = "ppNumUpDwnOvrdPrnPenWidth"; - this.ppNumUpDwnOvrdPrnPenWidth.Size = new System.Drawing.Size(36, 20); - this.superTooltip1.SetSuperTooltip(this.ppNumUpDwnOvrdPrnPenWidth, new DevComponents.DotNetBar.SuperTooltipInfo("Normal Pen Width", "", "This will allow you to override pen width used for normal text and line drawing.", null, null, DevComponents.DotNetBar.eTooltipColor.System)); - this.ppNumUpDwnOvrdPrnPenWidth.TabIndex = 1; - // - // label19 - // - this.label19.AutoSize = true; - this.label19.BackColor = System.Drawing.Color.Transparent; - this.label19.Location = new System.Drawing.Point(5, 16); - this.label19.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label19.Name = "label19"; - this.label19.Size = new System.Drawing.Size(165, 13); - this.label19.TabIndex = 0; - this.label19.Text = "Override Normal Pen Width (dots)"; - // - // label20 - // - this.label20.AutoSize = true; - this.label20.BackColor = System.Drawing.Color.Transparent; - this.label20.Location = new System.Drawing.Point(6, 47); - this.label20.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label20.Name = "label20"; - this.label20.Size = new System.Drawing.Size(153, 13); - this.label20.TabIndex = 2; - this.label20.Text = "Override Bold Pen Width (dots)"; - // - // ppNumUpDwnOverdPrnPenBoldWidth - // - this.ppNumUpDwnOverdPrnPenBoldWidth.Location = new System.Drawing.Point(178, 46); - this.ppNumUpDwnOverdPrnPenBoldWidth.Margin = new System.Windows.Forms.Padding(2); - this.ppNumUpDwnOverdPrnPenBoldWidth.Name = "ppNumUpDwnOverdPrnPenBoldWidth"; - this.ppNumUpDwnOverdPrnPenBoldWidth.Size = new System.Drawing.Size(36, 20); - this.superTooltip1.SetSuperTooltip(this.ppNumUpDwnOverdPrnPenBoldWidth, new DevComponents.DotNetBar.SuperTooltipInfo("Bold Pen Width", "", "This will allow you to override the width used for bold text.", null, null, DevComponents.DotNetBar.eTooltipColor.System)); - this.ppNumUpDwnOverdPrnPenBoldWidth.TabIndex = 3; - // - // ppNumUpDwnOvrdPrnPenULineWidth - // - this.ppNumUpDwnOvrdPrnPenULineWidth.Location = new System.Drawing.Point(422, 14); - this.ppNumUpDwnOvrdPrnPenULineWidth.Margin = new System.Windows.Forms.Padding(2); - this.ppNumUpDwnOvrdPrnPenULineWidth.Name = "ppNumUpDwnOvrdPrnPenULineWidth"; - this.ppNumUpDwnOvrdPrnPenULineWidth.Size = new System.Drawing.Size(36, 20); - this.superTooltip1.SetSuperTooltip(this.ppNumUpDwnOvrdPrnPenULineWidth, new DevComponents.DotNetBar.SuperTooltipInfo("Underline Thickness", "", "This will allow you to change the thickness of the uderline.", null, null, DevComponents.DotNetBar.eTooltipColor.System)); - this.ppNumUpDwnOvrdPrnPenULineWidth.TabIndex = 5; - // - // label21 - // - this.label21.AutoSize = true; - this.label21.BackColor = System.Drawing.Color.Transparent; - this.label21.Location = new System.Drawing.Point(239, 16); - this.label21.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label21.Name = "label21"; - this.label21.Size = new System.Drawing.Size(176, 13); - this.label21.TabIndex = 4; - this.label21.Text = "Override Underline Thickness (dots)"; - // - // ppNumUpDwnAdjPrnStartPos - // - this.ppNumUpDwnAdjPrnStartPos.Location = new System.Drawing.Point(422, 46); - this.ppNumUpDwnAdjPrnStartPos.Margin = new System.Windows.Forms.Padding(2); - this.ppNumUpDwnAdjPrnStartPos.Maximum = new decimal(new int[] { - 500, - 0, - 0, - 0}); - this.ppNumUpDwnAdjPrnStartPos.Name = "ppNumUpDwnAdjPrnStartPos"; - this.ppNumUpDwnAdjPrnStartPos.Size = new System.Drawing.Size(36, 20); - this.superTooltip1.SetSuperTooltip(this.ppNumUpDwnAdjPrnStartPos, new DevComponents.DotNetBar.SuperTooltipInfo("Starting Print Position", "", "Allows you to move the starting point on the page of where text and boarder begin" + - " printing.", null, null, DevComponents.DotNetBar.eTooltipColor.System)); - this.ppNumUpDwnAdjPrnStartPos.TabIndex = 7; - // - // label22 - // - this.label22.AutoSize = true; - this.label22.BackColor = System.Drawing.Color.Transparent; - this.label22.Location = new System.Drawing.Point(228, 48); - this.label22.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label22.Name = "label22"; - this.label22.Size = new System.Drawing.Size(187, 13); - this.label22.TabIndex = 6; - this.label22.Text = "Adjust Starting Position on Page (dots)"; - // - // ppBtnDeftDisAutoDuplx - // - this.ppBtnDeftDisAutoDuplx.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.ppBtnDeftDisAutoDuplx.Location = new System.Drawing.Point(433, 60); - this.ppBtnDeftDisAutoDuplx.Margin = new System.Windows.Forms.Padding(2); - this.ppBtnDeftDisAutoDuplx.Name = "ppBtnDeftDisAutoDuplx"; - this.ppBtnDeftDisAutoDuplx.Size = new System.Drawing.Size(44, 20); - this.superTooltip1.SetSuperTooltip(this.ppBtnDeftDisAutoDuplx, new DevComponents.DotNetBar.SuperTooltipInfo("The Default Button", "", resources.GetString("ppBtnDeftDisAutoDuplx.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(255, 150))); - this.ppBtnDeftDisAutoDuplx.TabIndex = 35; - this.ppBtnDeftDisAutoDuplx.Text = "Default"; - this.ppBtnDeftDisAutoDuplx.ThemeAware = true; - this.ppBtnDeftDisAutoDuplx.Click += new System.EventHandler(this.ppBtnDeftDisAutoDuplx_Click); - // - // ppBtnDefWatermark - // - this.ppBtnDefWatermark.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.ppBtnDefWatermark.Location = new System.Drawing.Point(203, 58); - this.ppBtnDefWatermark.Margin = new System.Windows.Forms.Padding(2); - this.ppBtnDefWatermark.Name = "ppBtnDefWatermark"; - this.ppBtnDefWatermark.Size = new System.Drawing.Size(40, 20); - this.superTooltip1.SetSuperTooltip(this.ppBtnDefWatermark, new DevComponents.DotNetBar.SuperTooltipInfo("The Default Button", "", "This will revert the watermark selection back to using the parent\'s (default) set" + - "ting.\r\n\r\nCheck \"Show Default Settings\" to display the \"default\" watermark (below" + - " the Watermark selection box).", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(255, 145))); - this.ppBtnDefWatermark.TabIndex = 33; - this.ppBtnDefWatermark.Text = "Default"; - this.ppBtnDefWatermark.ThemeAware = true; - this.ppBtnDefWatermark.Visible = false; - this.ppBtnDefWatermark.Click += new System.EventHandler(this.ppBtnDefWatermark_Click); - // - // ppCmbxWatermark - // - this.ppCmbxWatermark.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.docVersionConfigBindingSource, "Print_Watermark", true)); - this.ppCmbxWatermark.DisplayMember = "Text"; - this.ppCmbxWatermark.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; - this.ppCmbxWatermark.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.ppCmbxWatermark.FormattingEnabled = true; - this.ppCmbxWatermark.Location = new System.Drawing.Point(74, 58); - this.ppCmbxWatermark.Margin = new System.Windows.Forms.Padding(2); - this.ppCmbxWatermark.Name = "ppCmbxWatermark"; - this.ppCmbxWatermark.Size = new System.Drawing.Size(126, 21); - this.ppCmbxWatermark.TabIndex = 32; - this.ppCmbxWatermark.WatermarkFont = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppCmbxWatermark.WatermarkText = "select watermark option"; - this.ppCmbxWatermark.SelectedValueChanged += new System.EventHandler(this.ppCmbxWatermark_SelectedValueChanged); - // - // ppLblWatermarkDefault - // - this.ppLblWatermarkDefault.AutoSize = true; - this.ppLblWatermarkDefault.BackColor = System.Drawing.Color.Transparent; - this.ppLblWatermarkDefault.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppLblWatermarkDefault.ForeColor = System.Drawing.Color.Gray; - this.ppLblWatermarkDefault.Location = new System.Drawing.Point(69, 80); - this.ppLblWatermarkDefault.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.ppLblWatermarkDefault.Name = "ppLblWatermarkDefault"; - this.ppLblWatermarkDefault.Size = new System.Drawing.Size(45, 13); - this.superTooltip1.SetSuperTooltip(this.ppLblWatermarkDefault, new DevComponents.DotNetBar.SuperTooltipInfo("This is the default Watermark settings", "", "Pressing the Default Button (to the right)\r\nwill reset the watermark setting back" + - " to \r\nthis default.\r\n", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(0, 0))); - this.ppLblWatermarkDefault.TabIndex = 57; - this.ppLblWatermarkDefault.Text = "(default)"; - // - // ppTxtBxPDFLoc - // - this.ppTxtBxPDFLoc.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.docVersionConfigBindingSource, "Print_PDFLocation", true)); - this.ppTxtBxPDFLoc.Location = new System.Drawing.Point(83, 19); - this.ppTxtBxPDFLoc.Margin = new System.Windows.Forms.Padding(2); - this.ppTxtBxPDFLoc.Name = "ppTxtBxPDFLoc"; - this.ppTxtBxPDFLoc.Size = new System.Drawing.Size(379, 20); - this.ppTxtBxPDFLoc.TabIndex = 30; - // - // label18 - // - this.label18.AutoSize = true; - this.label18.BackColor = System.Drawing.Color.Transparent; - this.label18.Location = new System.Drawing.Point(4, 22); - this.label18.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label18.Name = "label18"; - this.label18.Size = new System.Drawing.Size(72, 13); - this.label18.TabIndex = 54; - this.label18.Text = "PDF Location"; - // - // ppLblAutoDuplexDefault - // - this.ppLblAutoDuplexDefault.AutoSize = true; - this.ppLblAutoDuplexDefault.BackColor = System.Drawing.Color.Transparent; - this.ppLblAutoDuplexDefault.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppLblAutoDuplexDefault.ForeColor = System.Drawing.Color.Gray; - this.ppLblAutoDuplexDefault.Location = new System.Drawing.Point(286, 79); - this.ppLblAutoDuplexDefault.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.ppLblAutoDuplexDefault.Name = "ppLblAutoDuplexDefault"; - this.ppLblAutoDuplexDefault.Size = new System.Drawing.Size(64, 13); - this.superTooltip1.SetSuperTooltip(this.ppLblAutoDuplexDefault, new DevComponents.DotNetBar.SuperTooltipInfo("This is the Automatic Duplex default setting", "", "Pressing the Default Button (to the right)\r\nwill reset the Automatic Duplex setti" + - "ng back\r\nto this default.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(0, 0))); - this.ppLblAutoDuplexDefault.TabIndex = 53; - this.ppLblAutoDuplexDefault.Text = "(default ON)"; - // - // ppChbxDisAutoDuplex - // - this.ppChbxDisAutoDuplex.AutoSize = true; - this.ppChbxDisAutoDuplex.BackColor = System.Drawing.Color.Transparent; - this.ppChbxDisAutoDuplex.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.docVersionConfigBindingSource, "Print_DisableDuplex", true)); - this.ppChbxDisAutoDuplex.Location = new System.Drawing.Point(272, 60); - this.ppChbxDisAutoDuplex.Margin = new System.Windows.Forms.Padding(2); - this.ppChbxDisAutoDuplex.Name = "ppChbxDisAutoDuplex"; - this.ppChbxDisAutoDuplex.Size = new System.Drawing.Size(161, 17); - this.superTooltip1.SetSuperTooltip(this.ppChbxDisAutoDuplex, new DevComponents.DotNetBar.SuperTooltipInfo("Disable Automatic Duplex", "", "Checking this box will turn OFF the automatic duplexing used in some formats for " + - "Foldout pages.", null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, false, new System.Drawing.Size(0, 0))); - this.ppChbxDisAutoDuplex.TabIndex = 34; - this.ppChbxDisAutoDuplex.Text = "Disable Automatic Duplexing"; - this.ppChbxDisAutoDuplex.UseVisualStyleBackColor = false; - this.ppChbxDisAutoDuplex.CheckedChanged += new System.EventHandler(this.ppChbxDisAutoDuplex_CheckedChanged); - // - // label17 - // - this.label17.AutoSize = true; - this.label17.BackColor = System.Drawing.Color.Transparent; - this.label17.Location = new System.Drawing.Point(9, 62); - this.label17.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label17.Name = "label17"; - this.label17.Size = new System.Drawing.Size(59, 13); - this.label17.TabIndex = 27; - this.label17.Text = "Watermark"; - // - // superTooltip1 - // - this.superTooltip1.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F"; - // - // ppCbShwDefSettings - // - this.ppCbShwDefSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - // - // - // - this.ppCbShwDefSettings.BackgroundStyle.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ppCbShwDefSettings.Location = new System.Drawing.Point(17, 371); - this.ppCbShwDefSettings.Margin = new System.Windows.Forms.Padding(2); - this.ppCbShwDefSettings.Name = "ppCbShwDefSettings"; - this.ppCbShwDefSettings.Size = new System.Drawing.Size(154, 20); - this.superTooltip1.SetSuperTooltip(this.ppCbShwDefSettings, new DevComponents.DotNetBar.SuperTooltipInfo("Show Default Settings", "", "When checked, the default (parent\'s) setting will appear below the overridden sel" + - "ection.", null, null, DevComponents.DotNetBar.eTooltipColor.System)); - this.ppCbShwDefSettings.TabIndex = 92; - this.ppCbShwDefSettings.Text = "Show Default Settings"; - this.ppCbShwDefSettings.CheckedChanged += new System.EventHandler(this.tabpage_Enter); - // - // ppGpbxUserSpecCB - // - this.ppGpbxUserSpecCB.BackColor = System.Drawing.Color.Transparent; - this.ppGpbxUserSpecCB.CanvasColor = System.Drawing.SystemColors.Control; - this.ppGpbxUserSpecCB.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.ppGpbxUserSpecCB.Controls.Add(this.ppGpbxUserSpecTxt); - this.ppGpbxUserSpecCB.Controls.Add(this.ppBtnDefCbTxtTyp); - this.ppGpbxUserSpecCB.Controls.Add(this.ppCmbxChgBarPos); - this.ppGpbxUserSpecCB.Controls.Add(this.ppBtnDefaultCbPos); - this.ppGpbxUserSpecCB.Controls.Add(this.label12); - this.ppGpbxUserSpecCB.Controls.Add(this.ppCmbxChgBarTxtType); - this.ppGpbxUserSpecCB.Controls.Add(this.label13); - this.ppGpbxUserSpecCB.Controls.Add(this.ppLblChgBarPosDefault); - this.ppGpbxUserSpecCB.Controls.Add(this.ppLblChgBarTxtTypeDefault); - this.ppGpbxUserSpecCB.Location = new System.Drawing.Point(14, 136); - this.ppGpbxUserSpecCB.Margin = new System.Windows.Forms.Padding(2); - this.ppGpbxUserSpecCB.Name = "ppGpbxUserSpecCB"; - this.ppGpbxUserSpecCB.Size = new System.Drawing.Size(466, 130); - // - // - // - this.ppGpbxUserSpecCB.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.ppGpbxUserSpecCB.Style.BackColorGradientAngle = 90; - this.ppGpbxUserSpecCB.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.ppGpbxUserSpecCB.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUserSpecCB.Style.BorderBottomWidth = 1; - this.ppGpbxUserSpecCB.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.ppGpbxUserSpecCB.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUserSpecCB.Style.BorderLeftWidth = 1; - this.ppGpbxUserSpecCB.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUserSpecCB.Style.BorderRightWidth = 1; - this.ppGpbxUserSpecCB.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUserSpecCB.Style.BorderTopWidth = 1; - this.ppGpbxUserSpecCB.Style.CornerDiameter = 4; - this.ppGpbxUserSpecCB.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.ppGpbxUserSpecCB.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; - this.ppGpbxUserSpecCB.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.ppGpbxUserSpecCB.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; - // - // - // - this.ppGpbxUserSpecCB.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ppGpbxUserSpecCB.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.superTooltip1.SetSuperTooltip(this.ppGpbxUserSpecCB, new DevComponents.DotNetBar.SuperTooltipInfo("Change Bar Override Settings", "", resources.GetString("ppGpbxUserSpecCB.SuperTooltip"), null, null, DevComponents.DotNetBar.eTooltipColor.Gray, true, true, new System.Drawing.Size(230, 155))); - this.ppGpbxUserSpecCB.TabIndex = 49; - this.ppGpbxUserSpecCB.Text = "Custom Change Bar Text"; - // - // ppGpbxUserSpecTxt - // - this.ppGpbxUserSpecTxt.CanvasColor = System.Drawing.SystemColors.Control; - this.ppGpbxUserSpecTxt.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.ppGpbxUserSpecTxt.Controls.Add(this.ppBtnDefCbTxt2); - this.ppGpbxUserSpecTxt.Controls.Add(this.label14); - this.ppGpbxUserSpecTxt.Controls.Add(this.ppBtnDefCbTxt1); - this.ppGpbxUserSpecTxt.Controls.Add(this.ppTxbxChangeBarUserMsgTwo); - this.ppGpbxUserSpecTxt.Controls.Add(this.ppLblChgBarUserMsgTwoDefault); - this.ppGpbxUserSpecTxt.Controls.Add(this.label15); - this.ppGpbxUserSpecTxt.Controls.Add(this.ppLblChgBarUserMsgOneDefault); - this.ppGpbxUserSpecTxt.Controls.Add(this.ppTxbxChangeBarUserMsgOne); - this.ppGpbxUserSpecTxt.Location = new System.Drawing.Point(267, 6); - this.ppGpbxUserSpecTxt.Margin = new System.Windows.Forms.Padding(2); - this.ppGpbxUserSpecTxt.Name = "ppGpbxUserSpecTxt"; - this.ppGpbxUserSpecTxt.Size = new System.Drawing.Size(184, 103); - // - // - // - this.ppGpbxUserSpecTxt.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.ppGpbxUserSpecTxt.Style.BackColorGradientAngle = 90; - this.ppGpbxUserSpecTxt.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.ppGpbxUserSpecTxt.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUserSpecTxt.Style.BorderBottomWidth = 1; - this.ppGpbxUserSpecTxt.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.ppGpbxUserSpecTxt.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUserSpecTxt.Style.BorderLeftWidth = 1; - this.ppGpbxUserSpecTxt.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUserSpecTxt.Style.BorderRightWidth = 1; - this.ppGpbxUserSpecTxt.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUserSpecTxt.Style.BorderTopWidth = 1; - this.ppGpbxUserSpecTxt.Style.CornerDiameter = 4; - this.ppGpbxUserSpecTxt.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.ppGpbxUserSpecTxt.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; - this.ppGpbxUserSpecTxt.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.ppGpbxUserSpecTxt.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; - // - // - // - this.ppGpbxUserSpecTxt.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ppGpbxUserSpecTxt.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ppGpbxUserSpecTxt.TabIndex = 51; - this.ppGpbxUserSpecTxt.Text = "Change Bar Text"; - // - // ppLblDefSettingsInfo - // - this.ppLblDefSettingsInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ppLblDefSettingsInfo.AutoSize = true; - this.ppLblDefSettingsInfo.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ppLblDefSettingsInfo.Location = new System.Drawing.Point(11, 352); - this.ppLblDefSettingsInfo.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.ppLblDefSettingsInfo.Name = "ppLblDefSettingsInfo"; - this.ppLblDefSettingsInfo.Size = new System.Drawing.Size(156, 13); - this.ppLblDefSettingsInfo.TabIndex = 25; - this.ppLblDefSettingsInfo.Text = "* Default values shown in italics"; - // - // dlgROFolder - // - this.dlgROFolder.RootFolder = System.Environment.SpecialFolder.MyComputer; - // - // tcVersions - // - this.tcVersions.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.tcVersions.BackColor = System.Drawing.Color.Transparent; - this.tcVersions.CanReorderTabs = true; - this.tcVersions.Controls.Add(this.tcpGeneral); - this.tcVersions.Controls.Add(this.tcpRefereceObjects); - this.tcVersions.Controls.Add(this.tcpApplicability); - this.tcVersions.Controls.Add(this.tabControlPanel5); - this.tcVersions.Controls.Add(this.tcpFormatSettings); - this.tcVersions.Controls.Add(this.tcpOutputSettings); - this.tcVersions.Location = new System.Drawing.Point(160, 3); - this.tcVersions.Margin = new System.Windows.Forms.Padding(2); - this.tcVersions.Name = "tcVersions"; - this.tcVersions.SelectedTabFont = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold); - this.tcVersions.SelectedTabIndex = 0; - this.tcVersions.Size = new System.Drawing.Size(488, 337); - this.tcVersions.Style = DevComponents.DotNetBar.eTabStripStyle.Office2007Dock; - this.tcVersions.TabIndex = 28; - this.tcVersions.TabLayoutType = DevComponents.DotNetBar.eTabLayoutType.FixedWithNavigationBox; - this.tcVersions.Tabs.Add(this.tiGeneral); - this.tcVersions.Tabs.Add(this.tiRefObjs); - this.tcVersions.Tabs.Add(this.tiOutputSettings); - this.tcVersions.Tabs.Add(this.tiFmtSettings); - this.tcVersions.Tabs.Add(this.tiLibDocs); - this.tcVersions.Tabs.Add(this.tiApplicability); - this.tcVersions.TabsVisible = false; - this.tcVersions.Text = "tabControl1"; - // - // tcpGeneral - // - this.tcpGeneral.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.tcpGeneral.Controls.Add(this.ppCmbxProcSetType); - this.tcpGeneral.Controls.Add(this.ppRTxtName); - this.tcpGeneral.Controls.Add(this.label9); - //added jcb for procedure set rev - this.tcpGeneral.Controls.Add(this.ppRTxtProcSetRev); - this.tcpGeneral.Controls.Add(this.lblProcSetRev); - //end added jcb for procedure set rev - this.tcpGeneral.Controls.Add(this.label4); - this.tcpGeneral.Controls.Add(this.label3); - this.tcpGeneral.Controls.Add(this.ppRTxtTitle); - this.tcpGeneral.Controls.Add(this.ppTxtBxUserID); - this.tcpGeneral.Controls.Add(this.ppDTPicker); - this.tcpGeneral.Controls.Add(this.label2); - this.tcpGeneral.Controls.Add(this.label1); - this.tcpGeneral.Dock = System.Windows.Forms.DockStyle.Fill; - this.tcpGeneral.Location = new System.Drawing.Point(0, 22); - this.tcpGeneral.Margin = new System.Windows.Forms.Padding(2); - this.tcpGeneral.Name = "tcpGeneral"; - this.tcpGeneral.Padding = new System.Windows.Forms.Padding(1); - this.tcpGeneral.Size = new System.Drawing.Size(488, 315); - this.tcpGeneral.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); - this.tcpGeneral.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); - this.tcpGeneral.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tcpGeneral.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); - this.tcpGeneral.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tcpGeneral.Style.GradientAngle = 90; - this.tcpGeneral.TabIndex = 1; - this.tcpGeneral.TabItem = this.tiGeneral; - // - // tiGeneral - // - this.tiGeneral.AttachedControl = this.tcpGeneral; - this.tiGeneral.Name = "tiGeneral"; - this.tiGeneral.Text = "General"; - // - // tcpRefereceObjects - // - this.tcpRefereceObjects.Controls.Add(this.tbRoDb); - this.tcpRefereceObjects.Controls.Add(this.ppBtnRoDbBrowse); - this.tcpRefereceObjects.Controls.Add(this.btnRoDbProperties); - this.tcpRefereceObjects.Controls.Add(this.cmbRoDb); - this.tcpRefereceObjects.Controls.Add(this.ppGpbxUpROvals); - this.tcpRefereceObjects.Controls.Add(this.label6); - this.tcpRefereceObjects.Dock = System.Windows.Forms.DockStyle.Fill; - this.tcpRefereceObjects.Location = new System.Drawing.Point(0, 22); - this.tcpRefereceObjects.Margin = new System.Windows.Forms.Padding(2); - this.tcpRefereceObjects.Name = "tcpRefereceObjects"; - this.tcpRefereceObjects.Padding = new System.Windows.Forms.Padding(1); - this.tcpRefereceObjects.Size = new System.Drawing.Size(488, 315); - this.tcpRefereceObjects.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); - this.tcpRefereceObjects.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); - this.tcpRefereceObjects.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tcpRefereceObjects.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); - this.tcpRefereceObjects.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tcpRefereceObjects.Style.GradientAngle = 90; - this.tcpRefereceObjects.TabIndex = 2; - this.tcpRefereceObjects.TabItem = this.tiRefObjs; - this.tcpRefereceObjects.Enter += new System.EventHandler(this.tabpage_Enter); - // - // tbRoDb - // - this.tbRoDb.Enabled = false; - this.tbRoDb.Location = new System.Drawing.Point(80, 13); - this.tbRoDb.Margin = new System.Windows.Forms.Padding(2); - this.tbRoDb.Name = "tbRoDb"; - this.tbRoDb.Size = new System.Drawing.Size(318, 20); - this.tbRoDb.TabIndex = 20; - // - // ppBtnRoDbBrowse - // - this.ppBtnRoDbBrowse.Location = new System.Drawing.Point(406, 34); - this.ppBtnRoDbBrowse.Margin = new System.Windows.Forms.Padding(2); - this.ppBtnRoDbBrowse.Name = "ppBtnRoDbBrowse"; - this.ppBtnRoDbBrowse.Size = new System.Drawing.Size(51, 20); - this.ppBtnRoDbBrowse.TabIndex = 22; - this.ppBtnRoDbBrowse.Text = "Browse..."; - this.ppBtnRoDbBrowse.UseVisualStyleBackColor = true; - this.ppBtnRoDbBrowse.Click += new System.EventHandler(this.ppBtnRoDbBrowse_Click); - // - // btnRoDbProperties - // - this.btnRoDbProperties.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnRoDbProperties.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnRoDbProperties.Image = ((System.Drawing.Image)(resources.GetObject("btnRoDbProperties.Image"))); - this.btnRoDbProperties.Location = new System.Drawing.Point(406, 10); - this.btnRoDbProperties.Margin = new System.Windows.Forms.Padding(2); - this.btnRoDbProperties.Name = "btnRoDbProperties"; - this.btnRoDbProperties.Size = new System.Drawing.Size(33, 23); - this.btnRoDbProperties.TabIndex = 21; - this.btnRoDbProperties.Click += new System.EventHandler(this.btnRoDbProperties_Click); - // - // cmbRoDb - // - this.cmbRoDb.FormattingEnabled = true; - this.cmbRoDb.Location = new System.Drawing.Point(80, 13); - this.cmbRoDb.Margin = new System.Windows.Forms.Padding(2); - this.cmbRoDb.Name = "cmbRoDb"; - this.cmbRoDb.Size = new System.Drawing.Size(318, 21); - this.cmbRoDb.TabIndex = 47; - this.cmbRoDb.SelectedIndexChanged += new System.EventHandler(this.cmbRoDb_SelectedIndexChanged); - // - // ppGpbxUpROvals - // - this.ppGpbxUpROvals.BackColor = System.Drawing.Color.Transparent; - this.ppGpbxUpROvals.CanvasColor = System.Drawing.SystemColors.Control; - this.ppGpbxUpROvals.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.ppGpbxUpROvals.Controls.Add(this.ppBtnResetRoVals); - this.ppGpbxUpROvals.Controls.Add(this.ppBtnUpRoVals); - this.ppGpbxUpROvals.Location = new System.Drawing.Point(34, 69); - this.ppGpbxUpROvals.Margin = new System.Windows.Forms.Padding(2); - this.ppGpbxUpROvals.Name = "ppGpbxUpROvals"; - this.ppGpbxUpROvals.Size = new System.Drawing.Size(112, 162); - // - // - // - this.ppGpbxUpROvals.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.ppGpbxUpROvals.Style.BackColorGradientAngle = 90; - this.ppGpbxUpROvals.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.ppGpbxUpROvals.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUpROvals.Style.BorderBottomWidth = 1; - this.ppGpbxUpROvals.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.ppGpbxUpROvals.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUpROvals.Style.BorderLeftWidth = 1; - this.ppGpbxUpROvals.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUpROvals.Style.BorderRightWidth = 1; - this.ppGpbxUpROvals.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGpbxUpROvals.Style.BorderTopWidth = 1; - this.ppGpbxUpROvals.Style.CornerDiameter = 4; - this.ppGpbxUpROvals.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.ppGpbxUpROvals.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; - this.ppGpbxUpROvals.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.ppGpbxUpROvals.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; - // - // - // - this.ppGpbxUpROvals.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ppGpbxUpROvals.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ppGpbxUpROvals.TabIndex = 46; - this.ppGpbxUpROvals.Text = "RO Values"; - // - // tiRefObjs - // - this.tiRefObjs.AttachedControl = this.tcpRefereceObjects; - this.tiRefObjs.Name = "tiRefObjs"; - this.tiRefObjs.Text = "Referenced Objects"; - // - // tcpApplicability - // - this.tcpApplicability.Controls.Add(this.label28); - this.tcpApplicability.Controls.Add(this.label27); - this.tcpApplicability.Controls.Add(this.label26); - this.tcpApplicability.Controls.Add(this.label25); - this.tcpApplicability.Controls.Add(this.label24); - this.tcpApplicability.Controls.Add(this.label23); - this.tcpApplicability.Controls.Add(this.label16); - this.tcpApplicability.Controls.Add(this.label8); - this.tcpApplicability.Controls.Add(this.label7); - this.tcpApplicability.Controls.Add(this.textBox11); - this.tcpApplicability.Controls.Add(this.textBox10); - this.tcpApplicability.Controls.Add(this.textBox9); - this.tcpApplicability.Controls.Add(this.textBox8); - this.tcpApplicability.Controls.Add(this.textBox7); - this.tcpApplicability.Controls.Add(this.textBox6); - this.tcpApplicability.Controls.Add(this.textBox5); - this.tcpApplicability.Controls.Add(this.textBox4); - this.tcpApplicability.Controls.Add(this.textBox3); - this.tcpApplicability.Controls.Add(this.textBox2); - this.tcpApplicability.Controls.Add(this.textBox1); - this.tcpApplicability.Controls.Add(this.panel1); - this.tcpApplicability.Dock = System.Windows.Forms.DockStyle.Fill; - this.tcpApplicability.Location = new System.Drawing.Point(0, 22); - this.tcpApplicability.Margin = new System.Windows.Forms.Padding(2); - this.tcpApplicability.Name = "tcpApplicability"; - this.tcpApplicability.Padding = new System.Windows.Forms.Padding(1); - this.tcpApplicability.Size = new System.Drawing.Size(488, 315); - this.tcpApplicability.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); - this.tcpApplicability.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); - this.tcpApplicability.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tcpApplicability.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); - this.tcpApplicability.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tcpApplicability.Style.GradientAngle = 90; - this.tcpApplicability.TabIndex = 6; - this.tcpApplicability.TabItem = this.tiApplicability; - // - // label28 - // - this.label28.AutoSize = true; - this.label28.BackColor = System.Drawing.Color.Transparent; - this.label28.Location = new System.Drawing.Point(160, 161); - this.label28.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label28.Name = "label28"; - this.label28.Size = new System.Drawing.Size(54, 13); - this.label28.TabIndex = 21; - this.label28.Text = "Set Name"; - // - // label27 - // - this.label27.AutoSize = true; - this.label27.BackColor = System.Drawing.Color.Transparent; - this.label27.Location = new System.Drawing.Point(177, 140); - this.label27.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label27.Name = "label27"; - this.label27.Size = new System.Drawing.Size(37, 13); - this.label27.TabIndex = 20; - this.label27.Text = "Set ID"; - // - // label26 - // - this.label26.AutoSize = true; - this.label26.BackColor = System.Drawing.Color.Transparent; - this.label26.Location = new System.Drawing.Point(118, 119); - this.label26.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label26.Name = "label26"; - this.label26.Size = new System.Drawing.Size(96, 13); - this.label26.TabIndex = 19; - this.label26.Text = "Procedure Number"; - // - // label25 - // - this.label25.AutoSize = true; - this.label25.BackColor = System.Drawing.Color.Transparent; - this.label25.Location = new System.Drawing.Point(129, 85); - this.label25.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label25.Name = "label25"; - this.label25.Size = new System.Drawing.Size(28, 13); - this.label25.TabIndex = 18; - this.label25.Text = "Text"; - // - // label24 - // - this.label24.AutoSize = true; - this.label24.BackColor = System.Drawing.Color.Transparent; - this.label24.Location = new System.Drawing.Point(118, 64); - this.label24.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label24.Name = "label24"; - this.label24.Size = new System.Drawing.Size(44, 13); - this.label24.TabIndex = 17; - this.label24.Text = "Number"; - // - // label23 - // - this.label23.AutoSize = true; - this.label23.BackColor = System.Drawing.Color.Transparent; - this.label23.Location = new System.Drawing.Point(124, 44); - this.label23.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label23.Name = "label23"; - this.label23.Size = new System.Drawing.Size(35, 13); - this.label23.TabIndex = 16; - this.label23.Text = "Name"; - // - // label16 - // - this.label16.AutoSize = true; - this.label16.BackColor = System.Drawing.Color.Transparent; - this.label16.Location = new System.Drawing.Point(136, 23); - this.label16.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(18, 13); - this.label16.TabIndex = 15; - this.label16.Text = "ID"; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.BackColor = System.Drawing.Color.Transparent; - this.label8.Location = new System.Drawing.Point(330, 6); - this.label8.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(128, 13); - this.label8.TabIndex = 14; - this.label8.Text = "Other Unit/Train/Channel"; - // - // label7 - // - this.label7.AutoSize = true; - this.label7.BackColor = System.Drawing.Color.Transparent; - this.label7.Location = new System.Drawing.Point(165, 6); - this.label7.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(99, 13); - this.label7.TabIndex = 13; - this.label7.Text = "Unit/Train/Channel"; - // - // textBox11 - // - this.textBox11.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsMiniApple, "OtherText", true)); - this.textBox11.Location = new System.Drawing.Point(330, 83); - this.textBox11.Margin = new System.Windows.Forms.Padding(2); - this.textBox11.Name = "textBox11"; - this.textBox11.Size = new System.Drawing.Size(151, 20); - this.textBox11.TabIndex = 12; - // - // bsMiniApple - // - this.bsMiniApple.DataSource = typeof(VEPROMS.MiniConfig); - // - // textBox10 - // - this.textBox10.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsMiniApple, "OtherNumber", true)); - this.textBox10.Location = new System.Drawing.Point(330, 62); - this.textBox10.Margin = new System.Windows.Forms.Padding(2); - this.textBox10.Name = "textBox10"; - this.textBox10.Size = new System.Drawing.Size(151, 20); - this.textBox10.TabIndex = 11; - // - // textBox9 - // - this.textBox9.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsMiniApple, "OtherName", true)); - this.textBox9.Location = new System.Drawing.Point(330, 41); - this.textBox9.Margin = new System.Windows.Forms.Padding(2); - this.textBox9.Name = "textBox9"; - this.textBox9.Size = new System.Drawing.Size(151, 20); - this.textBox9.TabIndex = 10; - // - // textBox8 - // - this.textBox8.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsMiniApple, "OtherID", true)); - this.textBox8.Location = new System.Drawing.Point(330, 20); - this.textBox8.Margin = new System.Windows.Forms.Padding(2); - this.textBox8.Name = "textBox8"; - this.textBox8.Size = new System.Drawing.Size(151, 20); - this.textBox8.TabIndex = 9; - // - // textBox7 - // - this.textBox7.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsMiniApple, "SetName", true)); - this.textBox7.Location = new System.Drawing.Point(225, 158); - this.textBox7.Margin = new System.Windows.Forms.Padding(2); - this.textBox7.Name = "textBox7"; - this.textBox7.Size = new System.Drawing.Size(151, 20); - this.textBox7.TabIndex = 8; - // - // textBox6 - // - this.textBox6.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsMiniApple, "SetID", true)); - this.textBox6.Location = new System.Drawing.Point(225, 137); - this.textBox6.Margin = new System.Windows.Forms.Padding(2); - this.textBox6.Name = "textBox6"; - this.textBox6.Size = new System.Drawing.Size(151, 20); - this.textBox6.TabIndex = 7; - // - // textBox5 - // - this.textBox5.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsMiniApple, "ProcedureNumber", true)); - this.textBox5.Location = new System.Drawing.Point(225, 116); - this.textBox5.Margin = new System.Windows.Forms.Padding(2); - this.textBox5.Name = "textBox5"; - this.textBox5.Size = new System.Drawing.Size(151, 20); - this.textBox5.TabIndex = 6; - // - // textBox4 - // - this.textBox4.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsMiniApple, "Text", true)); - this.textBox4.Location = new System.Drawing.Point(165, 83); - this.textBox4.Margin = new System.Windows.Forms.Padding(2); - this.textBox4.Name = "textBox4"; - this.textBox4.Size = new System.Drawing.Size(151, 20); - this.textBox4.TabIndex = 5; - // - // textBox3 - // - this.textBox3.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsMiniApple, "Number", true)); - this.textBox3.Location = new System.Drawing.Point(165, 62); - this.textBox3.Margin = new System.Windows.Forms.Padding(2); - this.textBox3.Name = "textBox3"; - this.textBox3.Size = new System.Drawing.Size(151, 20); - this.textBox3.TabIndex = 4; - // - // textBox2 - // - this.textBox2.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsMiniApple, "Name", true)); - this.textBox2.Location = new System.Drawing.Point(165, 41); - this.textBox2.Margin = new System.Windows.Forms.Padding(2); - this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(151, 20); - this.textBox2.TabIndex = 3; - // - // textBox1 - // - this.textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsMiniApple, "ID", true)); - this.textBox1.Location = new System.Drawing.Point(165, 20); - this.textBox1.Margin = new System.Windows.Forms.Padding(2); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(151, 20); - this.textBox1.TabIndex = 2; - // - // panel1 - // - this.panel1.BackColor = System.Drawing.Color.Transparent; - this.panel1.Controls.Add(this.panel2); - this.panel1.Controls.Add(this.lbApplicabilities); - this.panel1.Controls.Add(this.label5); - this.panel1.Dock = System.Windows.Forms.DockStyle.Left; - this.panel1.Location = new System.Drawing.Point(1, 1); - this.panel1.Margin = new System.Windows.Forms.Padding(2); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(112, 313); - this.panel1.TabIndex = 1; - // - // panel2 - // - this.panel2.Controls.Add(this.btnDelApple); - this.panel2.Controls.Add(this.btnNewApple); - this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel2.Location = new System.Drawing.Point(0, 290); - this.panel2.Margin = new System.Windows.Forms.Padding(2); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(112, 23); - this.panel2.TabIndex = 1; - // - // btnDelApple - // - this.btnDelApple.Dock = System.Windows.Forms.DockStyle.Fill; - this.btnDelApple.Location = new System.Drawing.Point(56, 0); - this.btnDelApple.Margin = new System.Windows.Forms.Padding(2); - this.btnDelApple.Name = "btnDelApple"; - this.btnDelApple.Size = new System.Drawing.Size(56, 23); - this.btnDelApple.TabIndex = 1; - this.btnDelApple.Text = "Remove"; - this.btnDelApple.UseVisualStyleBackColor = true; - this.btnDelApple.Click += new System.EventHandler(this.btnDelApple_Click); - // - // btnNewApple - // - this.btnNewApple.Dock = System.Windows.Forms.DockStyle.Left; - this.btnNewApple.Location = new System.Drawing.Point(0, 0); - this.btnNewApple.Margin = new System.Windows.Forms.Padding(2); - this.btnNewApple.Name = "btnNewApple"; - this.btnNewApple.Size = new System.Drawing.Size(56, 23); - this.btnNewApple.TabIndex = 0; - this.btnNewApple.Text = "New"; - this.btnNewApple.UseVisualStyleBackColor = true; - this.btnNewApple.Click += new System.EventHandler(this.btnNewApple_Click); - // - // lbApplicabilities - // - this.lbApplicabilities.DataSource = this.bsApples; - this.lbApplicabilities.Dock = System.Windows.Forms.DockStyle.Fill; - this.lbApplicabilities.FormattingEnabled = true; - this.lbApplicabilities.Location = new System.Drawing.Point(0, 17); - this.lbApplicabilities.Margin = new System.Windows.Forms.Padding(2); - this.lbApplicabilities.Name = "lbApplicabilities"; - this.lbApplicabilities.Size = new System.Drawing.Size(112, 290); - this.lbApplicabilities.TabIndex = 0; - this.lbApplicabilities.SelectedIndexChanged += new System.EventHandler(this.lbApplicabilities_SelectedIndexChanged); - // - // bsApples - // - this.bsApples.DataSource = typeof(VEPROMS.MiniConfig); - // - // label5 - // - this.label5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.label5.Dock = System.Windows.Forms.DockStyle.Top; - this.label5.Location = new System.Drawing.Point(0, 0); - this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(112, 17); - this.label5.TabIndex = 0; - this.label5.Text = "Applicabilities"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // tiApplicability - // - this.tiApplicability.AttachedControl = this.tcpApplicability; - this.tiApplicability.Name = "tiApplicability"; - this.tiApplicability.Text = "Applicability"; - // - // tabControlPanel5 - // - this.tabControlPanel5.AutoScroll = true; - this.tabControlPanel5.Controls.Add(this.ppGrdLibDocList); - this.tabControlPanel5.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControlPanel5.Location = new System.Drawing.Point(0, 22); - this.tabControlPanel5.Margin = new System.Windows.Forms.Padding(2); - this.tabControlPanel5.Name = "tabControlPanel5"; - this.tabControlPanel5.Padding = new System.Windows.Forms.Padding(1); - this.tabControlPanel5.Size = new System.Drawing.Size(488, 315); - this.tabControlPanel5.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); - this.tabControlPanel5.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); - this.tabControlPanel5.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tabControlPanel5.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); - this.tabControlPanel5.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tabControlPanel5.Style.GradientAngle = 90; - this.tabControlPanel5.TabIndex = 5; - this.tabControlPanel5.TabItem = this.tiLibDocs; - this.tabControlPanel5.Enter += new System.EventHandler(this.tabpage_Enter); - // - // ppGrdLibDocList - // - this.ppGrdLibDocList.AllowUserToAddRows = false; - this.ppGrdLibDocList.AutoGenerateColumns = false; - this.ppGrdLibDocList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.ppGrdLibDocList.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.documentEntryCountDataGridViewTextBoxColumn, - this.libTitleDataGridViewTextBoxColumn}); - this.ppGrdLibDocList.DataSource = this.documentInfoListBindingSource; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.ppGrdLibDocList.DefaultCellStyle = dataGridViewCellStyle2; - this.ppGrdLibDocList.Dock = System.Windows.Forms.DockStyle.Fill; - this.ppGrdLibDocList.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(215)))), ((int)(((byte)(229))))); - this.ppGrdLibDocList.HighlightSelectedColumnHeaders = false; - this.ppGrdLibDocList.Location = new System.Drawing.Point(1, 1); - this.ppGrdLibDocList.Margin = new System.Windows.Forms.Padding(2); - this.ppGrdLibDocList.Name = "ppGrdLibDocList"; - this.ppGrdLibDocList.RowHeadersVisible = false; - this.ppGrdLibDocList.RowTemplate.Height = 24; - this.ppGrdLibDocList.SelectAllSignVisible = false; - this.ppGrdLibDocList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.ppGrdLibDocList.Size = new System.Drawing.Size(486, 313); - this.ppGrdLibDocList.TabIndex = 1; - // - // documentEntryCountDataGridViewTextBoxColumn - // - this.documentEntryCountDataGridViewTextBoxColumn.DataPropertyName = "DocumentEntryCount"; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.documentEntryCountDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle1; - this.documentEntryCountDataGridViewTextBoxColumn.HeaderText = "Number of Usages"; - this.documentEntryCountDataGridViewTextBoxColumn.Name = "documentEntryCountDataGridViewTextBoxColumn"; - this.documentEntryCountDataGridViewTextBoxColumn.ReadOnly = true; - this.documentEntryCountDataGridViewTextBoxColumn.Width = 95; - // - // libTitleDataGridViewTextBoxColumn - // - this.libTitleDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.libTitleDataGridViewTextBoxColumn.DataPropertyName = "LibTitle"; - this.libTitleDataGridViewTextBoxColumn.HeaderText = "Library Document Title"; - this.libTitleDataGridViewTextBoxColumn.Name = "libTitleDataGridViewTextBoxColumn"; - this.libTitleDataGridViewTextBoxColumn.ReadOnly = true; - // - // documentInfoListBindingSource - // - this.documentInfoListBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.DocumentInfo); - // - // tiLibDocs - // - this.tiLibDocs.AttachedControl = this.tabControlPanel5; - this.tiLibDocs.Name = "tiLibDocs"; - this.tiLibDocs.Text = "Library Documents"; - // - // tcpFormatSettings - // - this.tcpFormatSettings.Controls.Add(this.ppGpbxUserSpecCB); - this.tcpFormatSettings.Controls.Add(this.ppBtnDefaultChgBar); - this.tcpFormatSettings.Controls.Add(this.ppCmbxFormat); - this.tcpFormatSettings.Controls.Add(this.ppCmbxChangeBarType); - this.tcpFormatSettings.Controls.Add(this.label11); - this.tcpFormatSettings.Controls.Add(this.ppBtnDefaultFmt); - this.tcpFormatSettings.Controls.Add(this.label10); - this.tcpFormatSettings.Controls.Add(this.ppLblChangeBarTypeDefault); - this.tcpFormatSettings.Controls.Add(this.ppLblFormatDefault); - this.tcpFormatSettings.Dock = System.Windows.Forms.DockStyle.Fill; - this.tcpFormatSettings.Location = new System.Drawing.Point(0, 22); - this.tcpFormatSettings.Margin = new System.Windows.Forms.Padding(2); - this.tcpFormatSettings.Name = "tcpFormatSettings"; - this.tcpFormatSettings.Padding = new System.Windows.Forms.Padding(1); - this.tcpFormatSettings.Size = new System.Drawing.Size(488, 315); - this.tcpFormatSettings.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); - this.tcpFormatSettings.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); - this.tcpFormatSettings.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tcpFormatSettings.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); - this.tcpFormatSettings.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tcpFormatSettings.Style.GradientAngle = 90; - this.tcpFormatSettings.TabIndex = 4; - this.tcpFormatSettings.TabItem = this.tiFmtSettings; - this.tcpFormatSettings.Enter += new System.EventHandler(this.tabpage_Enter); - // - // tiFmtSettings - // - this.tiFmtSettings.AttachedControl = this.tcpFormatSettings; - this.tiFmtSettings.Name = "tiFmtSettings"; - this.tiFmtSettings.Text = "Format Settings"; - // - // tcpOutputSettings - // - this.tcpOutputSettings.Controls.Add(this.ppChbxAddBlankPgs); - this.tcpOutputSettings.Controls.Add(this.ppTxtBxPDFLoc); - this.tcpOutputSettings.Controls.Add(this.label18); - this.tcpOutputSettings.Controls.Add(this.ppChbxAlwaysViewPDF); - this.tcpOutputSettings.Controls.Add(this.ppBtnPDFLoc); - this.tcpOutputSettings.Controls.Add(this.ppChbxAlwaysOvrWrtPDF); - this.tcpOutputSettings.Controls.Add(this.ppGrpbxPrnAdj); - this.tcpOutputSettings.Controls.Add(this.label17); - this.tcpOutputSettings.Controls.Add(this.ppBtnDeftDisAutoDuplx); - this.tcpOutputSettings.Controls.Add(this.ppBtnDefWatermark); - this.tcpOutputSettings.Controls.Add(this.ppChbxDisAutoDuplex); - this.tcpOutputSettings.Controls.Add(this.ppLblAutoDuplexDefault); - this.tcpOutputSettings.Controls.Add(this.ppCmbxWatermark); - this.tcpOutputSettings.Controls.Add(this.ppLblWatermarkDefault); - this.tcpOutputSettings.Dock = System.Windows.Forms.DockStyle.Fill; - this.tcpOutputSettings.Location = new System.Drawing.Point(0, 22); - this.tcpOutputSettings.Margin = new System.Windows.Forms.Padding(2); - this.tcpOutputSettings.Name = "tcpOutputSettings"; - this.tcpOutputSettings.Padding = new System.Windows.Forms.Padding(1); - this.tcpOutputSettings.Size = new System.Drawing.Size(488, 315); - this.tcpOutputSettings.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(253)))), ((int)(((byte)(253)))), ((int)(((byte)(254))))); - this.tcpOutputSettings.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(157)))), ((int)(((byte)(188)))), ((int)(((byte)(227))))); - this.tcpOutputSettings.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine; - this.tcpOutputSettings.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(146)))), ((int)(((byte)(165)))), ((int)(((byte)(199))))); - this.tcpOutputSettings.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right) - | DevComponents.DotNetBar.eBorderSide.Bottom))); - this.tcpOutputSettings.Style.GradientAngle = 90; - this.tcpOutputSettings.TabIndex = 3; - this.tcpOutputSettings.TabItem = this.tiOutputSettings; - this.tcpOutputSettings.Enter += new System.EventHandler(this.tabpage_Enter); - // - // ppChbxAddBlankPgs - // - this.ppChbxAddBlankPgs.AutoSize = true; - this.ppChbxAddBlankPgs.BackColor = System.Drawing.Color.Transparent; - this.ppChbxAddBlankPgs.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.docVersionConfigBindingSource, "Print_AddBlankPagesWhenUsingDuplexFoldouts", true)); - this.ppChbxAddBlankPgs.Location = new System.Drawing.Point(9, 285); - this.ppChbxAddBlankPgs.Margin = new System.Windows.Forms.Padding(2); - this.ppChbxAddBlankPgs.Name = "ppChbxAddBlankPgs"; - this.ppChbxAddBlankPgs.Size = new System.Drawing.Size(249, 17); - this.ppChbxAddBlankPgs.TabIndex = 66; - this.ppChbxAddBlankPgs.Text = "Add Blank Pages When Using Duplex Foldouts"; - this.ppChbxAddBlankPgs.UseVisualStyleBackColor = false; - // - // ppChbxAlwaysViewPDF - // - this.ppChbxAlwaysViewPDF.AutoSize = true; - this.ppChbxAlwaysViewPDF.BackColor = System.Drawing.Color.Transparent; - this.ppChbxAlwaysViewPDF.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.docVersionConfigBindingSource, "Print_AlwaysViewPDFAfterCreate", true)); - this.ppChbxAlwaysViewPDF.Location = new System.Drawing.Point(9, 263); - this.ppChbxAlwaysViewPDF.Margin = new System.Windows.Forms.Padding(2); - this.ppChbxAlwaysViewPDF.Name = "ppChbxAlwaysViewPDF"; - this.ppChbxAlwaysViewPDF.Size = new System.Drawing.Size(175, 17); - this.ppChbxAlwaysViewPDF.TabIndex = 37; - this.ppChbxAlwaysViewPDF.Text = "Always View PDF after Creation"; - this.ppChbxAlwaysViewPDF.UseVisualStyleBackColor = false; - // - // ppChbxAlwaysOvrWrtPDF - // - this.ppChbxAlwaysOvrWrtPDF.AutoSize = true; - this.ppChbxAlwaysOvrWrtPDF.BackColor = System.Drawing.Color.Transparent; - this.ppChbxAlwaysOvrWrtPDF.DataBindings.Add(new System.Windows.Forms.Binding("Checked", this.docVersionConfigBindingSource, "Print_AlwaysOverwritePDF", true)); - this.ppChbxAlwaysOvrWrtPDF.Location = new System.Drawing.Point(9, 241); - this.ppChbxAlwaysOvrWrtPDF.Margin = new System.Windows.Forms.Padding(2); - this.ppChbxAlwaysOvrWrtPDF.Name = "ppChbxAlwaysOvrWrtPDF"; - this.ppChbxAlwaysOvrWrtPDF.Size = new System.Drawing.Size(131, 17); - this.ppChbxAlwaysOvrWrtPDF.TabIndex = 36; - this.ppChbxAlwaysOvrWrtPDF.Text = "Always Overwrite PDF"; - this.ppChbxAlwaysOvrWrtPDF.UseVisualStyleBackColor = false; - // - // ppGrpbxPrnAdj - // - this.ppGrpbxPrnAdj.BackColor = System.Drawing.Color.Transparent; - this.ppGrpbxPrnAdj.CanvasColor = System.Drawing.SystemColors.Control; - this.ppGrpbxPrnAdj.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007; - this.ppGrpbxPrnAdj.Controls.Add(this.ppNumUpDwnOvrdPrnPenWidth); - this.ppGrpbxPrnAdj.Controls.Add(this.label19); - this.ppGrpbxPrnAdj.Controls.Add(this.label22); - this.ppGrpbxPrnAdj.Controls.Add(this.label20); - this.ppGrpbxPrnAdj.Controls.Add(this.ppNumUpDwnAdjPrnStartPos); - this.ppGrpbxPrnAdj.Controls.Add(this.ppNumUpDwnOverdPrnPenBoldWidth); - this.ppGrpbxPrnAdj.Controls.Add(this.label21); - this.ppGrpbxPrnAdj.Controls.Add(this.ppNumUpDwnOvrdPrnPenULineWidth); - this.ppGrpbxPrnAdj.Location = new System.Drawing.Point(9, 112); - this.ppGrpbxPrnAdj.Margin = new System.Windows.Forms.Padding(2); - this.ppGrpbxPrnAdj.Name = "ppGrpbxPrnAdj"; - this.ppGrpbxPrnAdj.Size = new System.Drawing.Size(467, 97); - // - // - // - this.ppGrpbxPrnAdj.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2; - this.ppGrpbxPrnAdj.Style.BackColorGradientAngle = 90; - this.ppGrpbxPrnAdj.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground; - this.ppGrpbxPrnAdj.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGrpbxPrnAdj.Style.BorderBottomWidth = 1; - this.ppGrpbxPrnAdj.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder; - this.ppGrpbxPrnAdj.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGrpbxPrnAdj.Style.BorderLeftWidth = 1; - this.ppGrpbxPrnAdj.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGrpbxPrnAdj.Style.BorderRightWidth = 1; - this.ppGrpbxPrnAdj.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid; - this.ppGrpbxPrnAdj.Style.BorderTopWidth = 1; - this.ppGrpbxPrnAdj.Style.CornerDiameter = 4; - this.ppGrpbxPrnAdj.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded; - this.ppGrpbxPrnAdj.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center; - this.ppGrpbxPrnAdj.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText; - this.ppGrpbxPrnAdj.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near; - // - // - // - this.ppGrpbxPrnAdj.StyleMouseDown.CornerType = DevComponents.DotNetBar.eCornerType.Square; - // - // - // - this.ppGrpbxPrnAdj.StyleMouseOver.CornerType = DevComponents.DotNetBar.eCornerType.Square; - this.ppGrpbxPrnAdj.TabIndex = 65; - this.ppGrpbxPrnAdj.Text = "Output Adjustments"; - this.ppGrpbxPrnAdj.Visible = false; - // - // tiOutputSettings - // - this.tiOutputSettings.AttachedControl = this.tcpOutputSettings; - this.tiOutputSettings.Name = "tiOutputSettings"; - this.tiOutputSettings.Text = "Output Settings"; - // - // panVerBtns - // - this.panVerBtns.BackColor = System.Drawing.Color.Transparent; - this.panVerBtns.Controls.Add(this.btnApplicability); - this.panVerBtns.Controls.Add(this.btnLibDocs); - this.panVerBtns.Controls.Add(this.btnFmtSettings); - this.panVerBtns.Controls.Add(this.btnOutputSettings); - this.panVerBtns.Controls.Add(this.btnRefObjs); - this.panVerBtns.Controls.Add(this.btnGeneral); - this.panVerBtns.Location = new System.Drawing.Point(5, 2); - this.panVerBtns.Margin = new System.Windows.Forms.Padding(2); - this.panVerBtns.Name = "panVerBtns"; - this.panVerBtns.Size = new System.Drawing.Size(151, 280); - this.panVerBtns.TabIndex = 27; - // - // btnApplicability - // - this.btnApplicability.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnApplicability.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnApplicability.Dock = System.Windows.Forms.DockStyle.Top; - this.btnApplicability.Location = new System.Drawing.Point(0, 92); - this.btnApplicability.Margin = new System.Windows.Forms.Padding(2); - this.btnApplicability.Name = "btnApplicability"; - this.btnApplicability.Size = new System.Drawing.Size(151, 15); - this.btnApplicability.TabIndex = 98; - this.btnApplicability.Text = "Applicability"; - this.btnApplicability.Click += new System.EventHandler(this.btnApplicability_Click); - // - // btnLibDocs - // - this.btnLibDocs.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnLibDocs.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnLibDocs.Dock = System.Windows.Forms.DockStyle.Top; - this.btnLibDocs.Location = new System.Drawing.Point(0, 73); - this.btnLibDocs.Margin = new System.Windows.Forms.Padding(2); - this.btnLibDocs.Name = "btnLibDocs"; - this.btnLibDocs.Size = new System.Drawing.Size(151, 19); - this.btnLibDocs.TabIndex = 97; - this.btnLibDocs.Text = "Library Documents"; - this.btnLibDocs.Click += new System.EventHandler(this.btnLibDocs_Click); - // - // btnFmtSettings - // - this.btnFmtSettings.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnFmtSettings.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnFmtSettings.Dock = System.Windows.Forms.DockStyle.Top; - this.btnFmtSettings.Location = new System.Drawing.Point(0, 54); - this.btnFmtSettings.Margin = new System.Windows.Forms.Padding(2); - this.btnFmtSettings.Name = "btnFmtSettings"; - this.btnFmtSettings.Size = new System.Drawing.Size(151, 19); - this.btnFmtSettings.TabIndex = 96; - this.btnFmtSettings.Text = "Format Settings"; - this.btnFmtSettings.Click += new System.EventHandler(this.btnFmtSettings_Click); - // - // btnOutputSettings - // - this.btnOutputSettings.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnOutputSettings.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnOutputSettings.Dock = System.Windows.Forms.DockStyle.Top; - this.btnOutputSettings.Location = new System.Drawing.Point(0, 35); - this.btnOutputSettings.Margin = new System.Windows.Forms.Padding(2); - this.btnOutputSettings.Name = "btnOutputSettings"; - this.btnOutputSettings.Size = new System.Drawing.Size(151, 19); - this.btnOutputSettings.TabIndex = 95; - this.btnOutputSettings.Text = "Output Settings"; - this.btnOutputSettings.Click += new System.EventHandler(this.btnOutputSettings_Click); - // - // btnRefObjs - // - this.btnRefObjs.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnRefObjs.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnRefObjs.Dock = System.Windows.Forms.DockStyle.Top; - this.btnRefObjs.Location = new System.Drawing.Point(0, 19); - this.btnRefObjs.Margin = new System.Windows.Forms.Padding(2); - this.btnRefObjs.Name = "btnRefObjs"; - this.btnRefObjs.Size = new System.Drawing.Size(151, 16); - this.btnRefObjs.TabIndex = 94; - this.btnRefObjs.Text = "Referenced Objects"; - this.btnRefObjs.Click += new System.EventHandler(this.btnRefObjs_Click); - // - // btnGeneral - // - this.btnGeneral.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; - this.btnGeneral.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; - this.btnGeneral.Dock = System.Windows.Forms.DockStyle.Top; - this.btnGeneral.Location = new System.Drawing.Point(0, 0); - this.btnGeneral.Margin = new System.Windows.Forms.Padding(2); - this.btnGeneral.Name = "btnGeneral"; - this.btnGeneral.Size = new System.Drawing.Size(151, 19); - this.btnGeneral.TabIndex = 93; - this.btnGeneral.Text = "General"; - this.btnGeneral.Click += new System.EventHandler(this.btnGeneral_Click); - // - // formatInfoListBindingSource - // - this.formatInfoListBindingSource.DataSource = typeof(VEPROMS.CSLA.Library.FormatInfo); - // - // frmVersionsProperties - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.CancelButton = this.ppBtnCancel; - this.CaptionFont = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ClientSize = new System.Drawing.Size(654, 395); - this.ControlBox = false; - this.Controls.Add(this.panVerBtns); - this.Controls.Add(this.tcVersions); - this.Controls.Add(this.ppCbShwDefSettings); - this.Controls.Add(this.ppLblDefSettingsInfo); - this.Controls.Add(this.ppBtnCancel); - this.Controls.Add(this.ppBtnOK); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Margin = new System.Windows.Forms.Padding(2); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "frmVersionsProperties"; - this.ShowIcon = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Versions Properties"; - this.Load += new System.EventHandler(this.frmVersionsProperties_Load); - this.Shown += new System.EventHandler(this.frmVersionsProperties_Shown); - ((System.ComponentModel.ISupportInitialize)(this.docVersionConfigBindingSource)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.imageCodecInfoBindingSource)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.ppNumUpDwnOvrdPrnPenWidth)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.ppNumUpDwnOverdPrnPenBoldWidth)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.ppNumUpDwnOvrdPrnPenULineWidth)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.ppNumUpDwnAdjPrnStartPos)).EndInit(); - this.ppGpbxUserSpecCB.ResumeLayout(false); - this.ppGpbxUserSpecCB.PerformLayout(); - this.ppGpbxUserSpecTxt.ResumeLayout(false); - this.ppGpbxUserSpecTxt.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.tcVersions)).EndInit(); - this.tcVersions.ResumeLayout(false); - this.tcpGeneral.ResumeLayout(false); - this.tcpGeneral.PerformLayout(); - this.tcpRefereceObjects.ResumeLayout(false); - this.tcpRefereceObjects.PerformLayout(); - this.ppGpbxUpROvals.ResumeLayout(false); - this.tcpApplicability.ResumeLayout(false); - this.tcpApplicability.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.bsMiniApple)).EndInit(); - this.panel1.ResumeLayout(false); - this.panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.bsApples)).EndInit(); - this.tabControlPanel5.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.ppGrdLibDocList)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.documentInfoListBindingSource)).EndInit(); - this.tcpFormatSettings.ResumeLayout(false); - this.tcpFormatSettings.PerformLayout(); - this.tcpOutputSettings.ResumeLayout(false); - this.tcpOutputSettings.PerformLayout(); - this.ppGrpbxPrnAdj.ResumeLayout(false); - this.ppGrpbxPrnAdj.PerformLayout(); - this.panVerBtns.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.ROPrefixBindingSource)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.formatInfoListBindingSource)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Button ppBtnCancel; - private System.Windows.Forms.Button ppBtnOK; - private System.Windows.Forms.Label label15; - private System.Windows.Forms.Label label14; - private System.Windows.Forms.RichTextBox ppTxbxChangeBarUserMsgTwo; - private System.Windows.Forms.RichTextBox ppTxbxChangeBarUserMsgOne; - private System.Windows.Forms.Label label13; - private System.Windows.Forms.Label label12; - private System.Windows.Forms.Label label10; - private System.Windows.Forms.Label label11; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.Label label9; - private System.Windows.Forms.RichTextBox ppRTxtName; - //added jcb for procedure set rev - private System.Windows.Forms.Label lblProcSetRev; - private System.Windows.Forms.RichTextBox ppRTxtProcSetRev; - //end added jcb for procedure set rev - private System.Windows.Forms.RichTextBox ppRTxtTitle; - private System.Windows.Forms.DateTimePicker ppDTPicker; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox ppTxtBxUserID; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.Button ppBtnUpRoVals; - private System.Windows.Forms.Button ppBtnResetRoVals; - private System.Windows.Forms.BindingSource docVersionConfigBindingSource; - private System.Windows.Forms.Label label17; - private System.Windows.Forms.TextBox ppTxtBxPDFLoc; - private System.Windows.Forms.Label label18; - private System.Windows.Forms.Label ppLblAutoDuplexDefault; - private System.Windows.Forms.CheckBox ppChbxDisAutoDuplex; - private System.Windows.Forms.Label ppLblFormatDefault; - private DevComponents.DotNetBar.SuperTooltip superTooltip1; - private System.Windows.Forms.Label ppLblWatermarkDefault; - private System.Windows.Forms.Label ppLblChangeBarTypeDefault; - private System.Windows.Forms.Label ppLblChgBarPosDefault; - private System.Windows.Forms.Label ppLblChgBarTxtTypeDefault; - private System.Windows.Forms.Label ppLblChgBarUserMsgTwoDefault; - private System.Windows.Forms.Label ppLblChgBarUserMsgOneDefault; -// private C1.Win.C1FlexGrid.C1FlexGrid ppGrdLibDocList; - private System.Windows.Forms.BindingSource formatInfoListBindingSource; - private DevComponents.DotNetBar.Controls.ComboBoxEx ppCmbxWatermark; - private DevComponents.DotNetBar.Controls.ComboBoxEx ppCmbxProcSetType; - private DevComponents.DotNetBar.Controls.ComboBoxEx ppCmbxFormat; - private DevComponents.DotNetBar.ButtonX ppBtnDefaultFmt; - private DevComponents.DotNetBar.Controls.ComboBoxEx ppCmbxChangeBarType; - private DevComponents.DotNetBar.Controls.ComboBoxEx ppCmbxChgBarPos; - private DevComponents.DotNetBar.Controls.ComboBoxEx ppCmbxChgBarTxtType; - private System.Windows.Forms.BindingSource imageCodecInfoBindingSource; - private System.Windows.Forms.Label ppLblDefSettingsInfo; - private DevComponents.DotNetBar.Controls.CheckBoxX ppCbShwDefSettings; - private DevComponents.DotNetBar.ButtonX ppBtnDefWatermark; - private DevComponents.DotNetBar.ButtonX ppBtnDeftDisAutoDuplx; - private System.Windows.Forms.NumericUpDown ppNumUpDwnOvrdPrnPenWidth; - private System.Windows.Forms.Label label19; - private System.Windows.Forms.Label label20; - private System.Windows.Forms.NumericUpDown ppNumUpDwnOverdPrnPenBoldWidth; - private System.Windows.Forms.NumericUpDown ppNumUpDwnOvrdPrnPenULineWidth; - private System.Windows.Forms.Label label21; - private System.Windows.Forms.NumericUpDown ppNumUpDwnAdjPrnStartPos; - private System.Windows.Forms.Label label22; - private DevComponents.DotNetBar.ButtonX ppBtnPDFLoc; - private DevComponents.DotNetBar.ButtonX ppBtnDefaultChgBar; - private DevComponents.DotNetBar.ButtonX ppBtnDefCbTxt1; - private DevComponents.DotNetBar.ButtonX ppBtnDefCbTxt2; - private DevComponents.DotNetBar.ButtonX ppBtnDefaultCbPos; - private DevComponents.DotNetBar.ButtonX ppBtnDefCbTxtTyp; - private System.Windows.Forms.FolderBrowserDialog dlgROFolder; - private DevComponents.DotNetBar.TabControl tcVersions; - private DevComponents.DotNetBar.TabControlPanel tcpRefereceObjects; - private DevComponents.DotNetBar.TabItem tiRefObjs; - private DevComponents.DotNetBar.TabControlPanel tcpGeneral; - private DevComponents.DotNetBar.TabItem tiGeneral; - private DevComponents.DotNetBar.TabControlPanel tabControlPanel5; - private DevComponents.DotNetBar.TabItem tiLibDocs; - private DevComponents.DotNetBar.TabControlPanel tcpFormatSettings; - private DevComponents.DotNetBar.TabItem tiFmtSettings; - private DevComponents.DotNetBar.TabControlPanel tcpOutputSettings; - private DevComponents.DotNetBar.TabItem tiOutputSettings; - private DevComponents.DotNetBar.Controls.GroupPanel ppGpbxUpROvals; - private DevComponents.DotNetBar.Controls.GroupPanel ppGrpbxPrnAdj; - private DevComponents.DotNetBar.Controls.GroupPanel ppGpbxUserSpecCB; - private DevComponents.DotNetBar.Controls.GroupPanel ppGpbxUserSpecTxt; - private System.Windows.Forms.Panel panVerBtns; - private DevComponents.DotNetBar.ButtonX btnLibDocs; - private DevComponents.DotNetBar.ButtonX btnFmtSettings; - private DevComponents.DotNetBar.ButtonX btnOutputSettings; - private DevComponents.DotNetBar.ButtonX btnRefObjs; - private DevComponents.DotNetBar.ButtonX btnGeneral; - private System.Windows.Forms.BindingSource documentInfoListBindingSource; - private System.Windows.Forms.ComboBox cmbRoDb; - private DevComponents.DotNetBar.ButtonX btnRoDbProperties; - private System.Windows.Forms.TextBox tbRoDb; - private System.Windows.Forms.Button ppBtnRoDbBrowse; - private System.Windows.Forms.BindingSource ROPrefixBindingSource; - private DevComponents.DotNetBar.Controls.DataGridViewX ppGrdLibDocList; - private System.Windows.Forms.DataGridViewTextBoxColumn documentEntryCountDataGridViewTextBoxColumn; - private System.Windows.Forms.DataGridViewTextBoxColumn libTitleDataGridViewTextBoxColumn; - private System.Windows.Forms.FolderBrowserDialog PDFLocationBrowserDialog; - private System.Windows.Forms.CheckBox ppChbxAlwaysViewPDF; - private System.Windows.Forms.CheckBox ppChbxAlwaysOvrWrtPDF; - private DevComponents.DotNetBar.ButtonX btnApplicability; - private DevComponents.DotNetBar.TabControlPanel tcpApplicability; - private DevComponents.DotNetBar.TabItem tiApplicability; - private System.Windows.Forms.ListBox lbApplicabilities; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Button btnDelApple; - private System.Windows.Forms.Button btnNewApple; - private System.Windows.Forms.TextBox textBox1; - private System.Windows.Forms.BindingSource bsMiniApple; - private System.Windows.Forms.TextBox textBox11; - private System.Windows.Forms.TextBox textBox10; - private System.Windows.Forms.TextBox textBox9; - private System.Windows.Forms.TextBox textBox8; - private System.Windows.Forms.TextBox textBox7; - private System.Windows.Forms.TextBox textBox6; - private System.Windows.Forms.TextBox textBox5; - private System.Windows.Forms.TextBox textBox4; - private System.Windows.Forms.TextBox textBox3; - private System.Windows.Forms.TextBox textBox2; - private System.Windows.Forms.BindingSource bsApples; - private System.Windows.Forms.Label label24; - private System.Windows.Forms.Label label23; - private System.Windows.Forms.Label label16; - private System.Windows.Forms.Label label8; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.Label label28; - private System.Windows.Forms.Label label27; - private System.Windows.Forms.Label label26; - private System.Windows.Forms.Label label25; - private System.Windows.Forms.CheckBox ppChbxAddBlankPgs; - - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS User Interface/frmVersionsProperties.cs.bak b/PROMS/VEPROMS User Interface/frmVersionsProperties.cs.bak deleted file mode 100644 index d575e2e5..00000000 --- a/PROMS/VEPROMS User Interface/frmVersionsProperties.cs.bak +++ /dev/null @@ -1,1752 +0,0 @@ -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; -using VEPROMS.CSLA.Library; -using System.Drawing.Imaging; -using VEPROMS.Properties; -using Volian.Controls.Library; -using DescriptiveEnum; -using DevComponents.DotNetBar; -using DevComponents.DotNetBar.Controls; -using System.Xml.Serialization; -using Volian.Base.Library; - -namespace VEPROMS -{ - public partial class frmVersionsProperties : DevComponents.DotNetBar.Office2007Form - { - private List _Apples; - private List _DeletedApples; - private List _Enhanced; - private bool _Initializing = false; - private DocVersionConfig _DocVersionConfig; - - // Default values - private string _DefaultFormatName = null; - private string _DefaultROPrefix = null; - private string _DefaultImagePrefix = null; - //private string _DefaultPagination = null; - private string _DefaultWatermark = null; - private string _DefaultChgBarType = null; - private string _DefaultChgBarLoc = null; - private string _DefaultChgBarText = null; - private string _DefaultChgBarUsrMsg1 = null; - private string _DefaultChgBarUsrMsg2 = null; - private bool _DefaultDisableDuplex = false; - - // For the initial release, we are assuming there will be only one rofst for a docversion. Changes - // will be needed here if more than 1. - private ROFstInfo _SelectedROFst; - public ROFstInfo SelectedROFst - { - get - { - if (_SelectedROFst == null) - { - if (_DocVersionConfig.MyDocVersion.DocVersionAssociationCount < 1) return null; - _SelectedROFst = ROFstInfo.GetJustROFst(_DocVersionConfig.MyDocVersion.DocVersionAssociations[0].ROFstID); - } - return _SelectedROFst; - } - set { _SelectedROFst = value; } - } - // - - public frmVersionsProperties(DocVersionConfig docVersionConfig) - { - _DocVersionConfig = docVersionConfig; - _Initializing = true; - InitializeComponent(); - btnGeneral.PerformClick(); // always start with General tab or button - _Initializing = false; - //build the caption - this.Text = string.Format("{0} Properties", _DocVersionConfig.Name); - } - private string AddSlaveNode(MiniConfig mc) - { - System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); - xd.LoadXml(_DocVersionConfig.ToString()); - System.Xml.XmlNodeList nl = xd.SelectNodes("//Slave"); - int max = 0; - foreach (System.Xml.XmlNode n in nl) - { - max = int.Parse(n.Attributes.GetNamedItem("index").InnerText); - } - max++; - System.Xml.XmlNode nn = xd.CreateElement("Slave"); - AddSlaveAttribute(nn, "index", max.ToString()); - AddSlaveAttribute(nn, "ID", mc.ID); - AddSlaveAttribute(nn, "Name", mc.Name); - AddSlaveAttribute(nn, "Number", mc.Number); - AddSlaveAttribute(nn, "Text", mc.Text); - AddSlaveAttribute(nn, "ProcedureNumber", mc.ProcedureNumber); - AddSlaveAttribute(nn, "SetID", mc.SetID); - AddSlaveAttribute(nn, "SetName", mc.SetName); - AddSlaveAttribute(nn, "OtherID", mc.OtherID); - AddSlaveAttribute(nn, "OtherName", mc.OtherName); - AddSlaveAttribute(nn, "OtherNumber", mc.OtherNumber); - AddSlaveAttribute(nn, "OtherText", mc.OtherText); - System.Xml.XmlNode sn = xd.SelectSingleNode("//Slaves"); - sn.AppendChild(nn); - return xd.OuterXml; - } - private void AddSlaveAttribute(System.Xml.XmlNode nn, string name, string value) - { - System.Xml.XmlAttribute xa = nn.OwnerDocument.CreateAttribute(name); - xa.InnerText = value; - nn.Attributes.SetNamedItem(xa); - } - private void btnVersionsPropOK_Click(object sender, EventArgs e) - { - docVersionConfigBindingSource.EndEdit(); // need to end the edit session first or any format selection chanage will not stick B2015-157 - if (_DocVersionConfig.Unit_Count > 0 || (_Apples != null && _Apples.Count > 0)) - { - if (_DeletedApples != null && _DeletedApples.Count > 0) - { - foreach (MiniConfig mc in _DeletedApples) - _DocVersionConfig.RemoveSlave(mc.Index); - } - foreach (MiniConfig mc in _Apples) - { - if (mc.IsDirty) - { - if (mc.Index < 0) - { - mc.Index = _DocVersionConfig.MaxSlaveIndex + 1; - _DocVersionConfig.AddSlave(mc.MyXml); - } - else - { - int k = _DocVersionConfig.SelectedSlave; - _DocVersionConfig.SelectedSlave = mc.Index; - _DocVersionConfig.Unit_ID = mc.ID; - _DocVersionConfig.Unit_Name = mc.Name; - _DocVersionConfig.Unit_Number = mc.Number; - _DocVersionConfig.Unit_Text = mc.Text; - _DocVersionConfig.Unit_ProcedureNumber = mc.ProcedureNumber; - _DocVersionConfig.Unit_ProcedureSetID = mc.SetID; - _DocVersionConfig.Unit_ProcedureSetName = mc.SetName; - _DocVersionConfig.Other_Unit_ID = mc.OtherID; - _DocVersionConfig.Other_Unit_Name = mc.OtherName; - _DocVersionConfig.Other_Unit_Number = mc.OtherNumber; - _DocVersionConfig.Other_Unit_Text = mc.OtherText; - _DocVersionConfig.SelectedSlave = k; - } - } - } - } - if (_Enhanced != null) - { - foreach (EnhancedMiniConfig emc in _Enhanced) - { - if (emc.IsDirty) - { - bool isnew = true; - foreach (DVEnhancedDocument dved in _DocVersionConfig.MyEnhancedDocuments) - { - if (dved.Type == Convert.ToInt32(emc.Type)) - { - isnew = false; - dved.Name = emc.Name; - dved.PdfToken = emc.PdfToken; - try - { - dved.PdfX = Convert.ToInt32(emc.PdfXOffset); - } - catch (Exception ex) - { - dved.PdfX = 10; - } - } - } - if (isnew) // make new link for this and the enhanced it points to. - { - int ipdfx = 0; - try - { - ipdfx = Convert.ToInt32(emc.PdfXOffset); - } - catch (Exception ex) - { - ipdfx = (emc.PdfToken==null||emc.PdfToken=="")?0:10; - } - int itype = 0; - try - { - itype = Convert.ToInt32(emc.Type); - } - catch (Exception ex) - { - itype = 1; - } - // get index into combo box for doc version selected. - int selindx = cbxEnhVersions.SelectedIndex; - DocVersionInfo dvisel = NewEnhVersions[selindx]; - _DocVersionConfig.MyEnhancedDocuments.Add(new DVEnhancedDocument(emc.Name, itype, dvisel.VersionID, ipdfx, emc.PdfToken)); - using (DocVersion dv = DocVersion.Get(dvisel.VersionID)) - { - DocVersionConfig dvc = dv.MyConfig as DocVersionConfig; - dvc.MyEnhancedDocuments.Add(new DVEnhancedDocument("Source", 0, (int)_DocVersionConfig.MyDocVersion.VersionID, 10, "S")); - dvc.SaveDVEnhancedDocuments(); - dv.Config = dvc.ToString(); - dv.Save(); - } - } - } - } - _DocVersionConfig.SaveDVEnhancedDocuments(); - } - - _DocVersionConfig.Print_UnitNumberForPageList = ppTxbxUnitNum.Text; - - //docVersionConfigBindingSource.EndEdit(); - // Save Default settings for User - // - // Save whether we should display the default values on this property page - Settings.Default.ShowDefaultVersionProp = ppCbShwDefSettings.Checked; - Settings.Default.Save(); - DialogResult = DialogResult.OK; - _DocVersionConfig.MyDocVersion.Config = _DocVersionConfig.ToString(); - _DocVersionConfig.MyDocVersion.Save().Dispose(); - if (_EnhNeedToUnlink) - { - this.Cursor = Cursors.WaitCursor; - _DocVersionConfig.MyDocVersion.MyDocVersionInfo.DoUnlinkEnhancedDocVersion(); - this.Cursor = Cursors.Default; - } - this.Close(); - } - - private void btnFldrPropCancel_Click(object sender, EventArgs e) - { - docVersionConfigBindingSource.CancelEdit(); - this.Close(); - } - - /// - /// Use the ParentLookup to grab the default values - /// - set the watermark property (where applicable) of the control with that value - /// - set the default setting labels with that value - /// ** the default setting labels appear when the Show Default Values checkbox is checked by the user. - /// - private void FindDefaultValues() - { - _DocVersionConfig.ParentLookup = true; - - // get default format - _DefaultFormatName = _DocVersionConfig.DefaultFormatSelection; - SetupDefault(_DefaultFormatName, ppLblFormatDefault, ppCmbxFormat); - - // Get the default Change Bar Type - _DefaultChgBarType = _DocVersionConfig.Print_ChangeBar.ToString(); - SetupDefault(EnumDescConverter.GetEnumDescription(_DocVersionConfig.Print_ChangeBar), ppLblChangeBarTypeDefault, ppCmbxChangeBarType); - - // Get the default Change Bar Location - _DefaultChgBarLoc = _DocVersionConfig.Print_ChangeBarLoc.ToString(); - SetupDefault(EnumDescConverter.GetEnumDescription(_DocVersionConfig.Print_ChangeBarLoc), ppLblChgBarPosDefault, ppCmbxChgBarPos); - - // Get the default Change Bar text - _DefaultChgBarText = _DocVersionConfig.Print_ChangeBarText.ToString(); - SetupDefault(EnumDescConverter.GetEnumDescription(_DocVersionConfig.Print_ChangeBarText), ppLblChgBarTxtTypeDefault, ppCmbxChgBarTxtType); - - // Get the default User Change Bar Message 1 - _DefaultChgBarUsrMsg1 = _DocVersionConfig.Print_UserCBMess1; - if (!(_DefaultChgBarUsrMsg1.Equals(""))) - { - ppLblChgBarUserMsgOneDefault.Text = string.Format("({0})", _DefaultChgBarUsrMsg1); - } - - // Get the default User Change Bar Message 2 - _DefaultChgBarUsrMsg2 = _DocVersionConfig.Print_UserCBMess2; - if (!(_DefaultChgBarUsrMsg2.Equals(""))) - { - ppLblChgBarUserMsgTwoDefault.Text = string.Format("{0}", _DefaultChgBarUsrMsg2); - } - - // Get the ro path - there is no 'default' - if (_DocVersionConfig.MyDocVersion.DocVersionAssociationCount < 0 && _DocVersionConfig.MyDocVersion.DocVersionAssociations.Count == 0) - ;// The line above refreshes the data - if (_DocVersionConfig.MyDocVersion.DocVersionAssociationCount > 0) - { - RODbInfo rdi = RODbInfo.GetJustRODB(SelectedROFst.RODbID); - tbRoDb.Text = string.Format("{0} ({1})", rdi.ROName, rdi.FolderPath); - } - else - { - int selindx = -1; - cmbRoDb.Items.Clear(); - int myrodbid = -1; - if (_DocVersionConfig.MyDocVersion.DocVersionAssociationCount >= 1) myrodbid = SelectedROFst.RODbID; - foreach (RODbInfo rdi in RODbInfoList.Get()) - { - int i = cmbRoDb.Items.Add(string.Format("{0} ({1})", rdi.ROName, rdi.FolderPath)); - if (rdi.RODbID == myrodbid) selindx = i; - } - if (cmbRoDb.Items.Count > 0) cmbRoDb.SelectedIndex = selindx; - } - - // Get the default Print Pagination - //_DefaultPagination = _DocVersionConfig.Print_Pagination.ToString(); - //SetupDefault(EnumDescConverter.GetEnumDescription(_DocVersionConfig.Print_Pagination), ppLblPaginationDefault, ppCmbxPagination); - - // Get the default Watermark - _DefaultWatermark = _DocVersionConfig.Print_Watermark.ToString(); - SetupDefault(EnumDescConverter.GetEnumDescription(_DocVersionConfig.Print_Watermark), ppLblWatermarkDefault, ppCmbxWatermark); - - // Get the default Disable Duplex - _DefaultDisableDuplex = _DocVersionConfig.Print_DisableDuplex; - ppLblAutoDuplexDefault.Text = string.Format("(Duplex {0})", (_DefaultDisableDuplex) ? "OFF" : "ON"); - - _DocVersionConfig.ParentLookup = false; - } - - - private void frmVersionsProperties_Load(object sender, EventArgs e) - { - _Initializing = true; - docVersionConfigBindingSource.DataSource = _DocVersionConfig; - - //formatInfoListBindingSource.DataSource = FormatInfoList.Get(); - imageCodecInfoBindingSource.DataSource = ImageCodecInfo.GetImageDecoders(); - - ppCmbxFormat.DataSource = null; - ppCmbxFormat.DisplayMember = "FullName"; - ppCmbxFormat.ValueMember = "FullName"; - ppCmbxFormat.DataSource = FormatInfoList.SortedFormatInfoList; - if (_DocVersionConfig.FormatSelection != null) - { - ppCmbxFormat.SelectedValue = _DocVersionConfig.FormatSelection; - ppBtnDefaultFmt.Visible = true; //bug fix B2016-102 make the default button visable if other the the default format is being used - } - else - ppCmbxFormat.SelectedIndex = -1; // default format - - // Get the saved settings for this user - // - // Get setting telling us whether to display the default values on this property page - ppCbShwDefSettings.Checked = (Settings.Default["ShowDefaultVersionProp"] != null) ? Settings.Default.ShowDefaultVersionProp : false; - - // Get the User's property page style "PropPageStyle" (this is a system wide user setting) - // 1 - Button Dialog (default) - // 2 - Tab Dialog - if ((int)Settings.Default["PropPageStyle"] == (int)PropPgStyle.Tab) - { - tcVersions.TabsVisible = true; - panVerBtns.Visible = false; - this.Width -= panVerBtns.Width; - } - - // Get the default values for the property page information - FindDefaultValues(); - - ppCmbxChangeBarType.DataSource = EnumDetail.Details(); - ppCmbxChangeBarType.DisplayMember = "Description"; - ppCmbxChangeBarType.ValueMember = "EValue"; - ppCmbxChangeBarType.SelectedIndex = -1; - - ppCmbxChgBarPos.DataSource = EnumDetail.Details(); - ppCmbxChgBarPos.DisplayMember = "Description"; - ppCmbxChgBarPos.ValueMember = "EValue"; - ppCmbxChgBarPos.SelectedIndex = -1; - - ppCmbxChgBarTxtType.DataSource = EnumDetail.Details(); - ppCmbxChgBarTxtType.DisplayMember = "Description"; - ppCmbxChgBarTxtType.ValueMember = "EValue"; - ppCmbxChgBarTxtType.SelectedItem = -1; - - ppCmbxWatermark.DataSource = EnumDetail.Details(); - ppCmbxWatermark.DisplayMember = "Description"; - ppCmbxWatermark.ValueMember = "EValue"; - ppCmbxWatermark.SelectedIndex = -1; - - //ppCmbxPagination.DataSource = EnumDetail.Details(); - //ppCmbxPagination.DisplayMember = "Description"; - //ppCmbxPagination.ValueMember = "EValue"; - //ppCmbxPagination.SelectedIndex = -1; - - ppCmbxProcSetType.DataSource = EnumDetail.Details(); - ppCmbxProcSetType.DisplayMember = "Description"; - ppCmbxProcSetType.ValueMember = "EValue"; - ppCmbxProcSetType.Enabled = false; // maybe enable this if used for version creation - - // check active format to see if the unit number text box on the format tab is visible. - if (_DocVersionConfig.MyDocVersion.MyDocVersionInfo.ActiveFormat.PlantFormat.FormatData.PrintData.UnitNumber) - { - ppLblUnitNum.Visible = true; - ppTxbxUnitNum.Visible = true; - ppTxbxUnitNum.Text = _DocVersionConfig.Print_UnitNumberForPageList; - } - else - { - ppLblUnitNum.Visible = false; - ppTxbxUnitNum.Visible = false; - } - - documentInfoListBindingSource.DataSource = DocumentInfoList.GetLibraries(false); - - ppBtnRoDbBrowse.Visible = cmbRoDb.Visible = _DocVersionConfig.MyDocVersion.DocVersionAssociationCount == 0; - btnRoDbProperties.Visible = tbRoDb.Visible = !(_DocVersionConfig.MyDocVersion.DocVersionAssociationCount == 0); - ppBtnUpRoVals.Enabled = _DocVersionConfig.MyDocVersion.DocVersionAssociations != null && _DocVersionConfig.MyDocVersion.DocVersionAssociations.Count > 0; // only allow update if association - - // Set the auto duplex controls based on whether the format allows this: - // Note that the controls' visibility would not set correctly using the following two lines of code. That - // is why the more explicit logic was done. - //ppChbxDisAutoDuplex.Visible = _DocVersionConfig.MyDocVersion.MyFormat.PlantFormat.FormatData.PrintData.AllowDuplex; - //ppLblAutoDuplexDefault.Visible = ppBtnDeftDisAutoDuplx.Visible = ppLblAutoDuplexDefault.Visible; - if (_DocVersionConfig.MyDocVersion.MyFormat != null && _DocVersionConfig.MyDocVersion.MyFormat.PlantFormat.FormatData.PrintData.AllowDuplex) - { - ppChbxDisAutoDuplex.Visible = true; - ppLblAutoDuplexDefault.Visible = true; - ppBtnDeftDisAutoDuplx.Visible = true; - } - else - { - ppChbxDisAutoDuplex.Visible = false; - ppLblAutoDuplexDefault.Visible = false; - ppBtnDeftDisAutoDuplx.Visible = false; - } - //add new applicability stuff - if (_DocVersionConfig.Unit_Count > 0) - { - int k = _DocVersionConfig.SelectedSlave; - _Apples = new List(); - for (int i = 1; i <= _DocVersionConfig.MaxSlaveIndex; i++) - { - _DocVersionConfig.SelectedSlave = i; - try - { - MiniConfig cfg = new MiniConfig(i, _DocVersionConfig.Unit_ID, _DocVersionConfig.Unit_Name, _DocVersionConfig.Unit_Number, _DocVersionConfig.Unit_Text, _DocVersionConfig.Unit_ProcedureNumber, _DocVersionConfig.Unit_ProcedureSetID, _DocVersionConfig.Unit_ProcedureSetName, _DocVersionConfig.Other_Unit_ID, _DocVersionConfig.Other_Unit_Name, _DocVersionConfig.Other_Unit_Number, _DocVersionConfig.Other_Unit_Text); - _Apples.Add(cfg); - } - catch - { - } - } - _DocVersionConfig.SelectedSlave = k; - bsApples.DataSource = _Apples; - } - else - { - Button btnPC = new Button(); - btnPC.Text = "Add Applicability to Working Draft"; - btnPC.Width = 250; - btnPC.Location = new Point(25, 271); - btnPC.Parent = tcpGeneral; - btnPC.Click += new EventHandler(btnPC_Click); - btnApplicability.Visible = false; - tiApplicability.Visible = false; - } - ppTxtBxPDFLoc.TextChanged += new EventHandler(ppTxtBxPDFLoc_TextChanged); - //end add new applicability stuff - lblProcSetRev.Visible = ppRTxtProcSetRev.Visible = _DocVersionConfig.MyDocVersion.MyDocVersionInfo.ActiveFormat.MyStepSectionPrintData.UseXtraRevNumber; - - // the phone list button is only visible if the format has the print/phonelist format flag. - btnPhoneList.Visible = _DocVersionConfig.MyDocVersion.MyDocVersionInfo.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList; - btnUnlinkDocVersion.Visible = false; - InitEnhanced(); - _Initializing = false; - } - private void InitEnhanced() - { - // if this working draft has no enhanced documents, then put display a button for creating the enhanced links - - // but only if there are enhanced docversions to link to. - // Otherwise, set up the form with the data as it is. - if (_DocVersionConfig.MyEnhancedDocuments == null || _DocVersionConfig.MyEnhancedDocuments.Count == 0) - { - // also check that the format for this docversion does NOT have enhanced back/dev, i.e. it's format is an enhanced - // document - if (!(((_DocVersionConfig.MyDocVersion.MyDocVersionInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) || - ((_DocVersionConfig.MyDocVersion.MyDocVersionInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations))) - { - bool validEmptyEnhancedExists = false; - // See if there are available (enhanced) DocVersions that can be linked to from this (source) DocVersion - DocVersionInfoList nonenhdvs = DocVersionInfoList.GetNonEnhancedDocVersions(); // this is a list of docversions that have no 'Enhanced' in config data - foreach (DocVersionInfo nonenhdv in nonenhdvs) - { - if (nonenhdv.VersionID != _DocVersionConfig.MyDocVersion.VersionID) - { - if (((nonenhdv.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) || - ((nonenhdv.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations)) - { - validEmptyEnhancedExists = true; - break; - } - } - if (validEmptyEnhancedExists) break; - } - if (validEmptyEnhancedExists) - { - Button btnEnh = new Button(); - btnEnh.Text = "Link to Enhanced Document(s)"; - btnEnh.Width = 220; - btnEnh.Location = new Point(290, 271); - btnEnh.Parent = tcpGeneral; - btnEnh.Click += new EventHandler(btnEnh_Click); - } - } - btnEnhanced.Visible = false; - tiEnhanced.Visible = false; - return; - } - btnEnhanced.Visible = true; - tiEnhanced.Visible = true; - // get enhanced tab's data if: - // 1) hasEnhancedPO: this is source and format file has the purchase options for enhanced deviation or enhanced background - // 2) isEnhanced: this docversion has a config/enhanced node that defines it as an enhanced document. - bool hasEnhancedPO = true; // for now all can be enhanced - bool isEnhanced = (_DocVersionConfig.MyEnhancedDocuments != null && _DocVersionConfig.MyEnhancedDocuments.Count == 1 && _DocVersionConfig.MyEnhancedDocuments[0].Type == 0); - // isEnhanced is an already existing enhanced document. Only allow the user to change the Pdf settings: - if (isEnhanced) - { - _Enhanced = new List(); - // only display the data from the config setting. And only allow modify of PdfID and PdfXoffset - lbEnhanced.Visible = false; - lblEnhSet.Visible = false; - DocVersionInfo dvi = DocVersionInfo.Get(_DocVersionConfig.MyEnhancedDocuments[0].VersionID); - DVEnhancedDocument dvedUseData = _DocVersionConfig.MyEnhancedDocuments[0]; - DocVersionConfig dvc = dvi.MyConfig as DocVersionConfig; - EnhancedMiniConfig ecfg = new EnhancedMiniConfig(0, dvi.VersionID, "?", dvi.SearchDVPath, dvedUseData.Name, dvedUseData.Type.ToString(), dvedUseData.PdfToken, dvedUseData.PdfX.ToString()); - cbxEnhVersions.Items.Add(dvi.SearchDVPath); - tbEnhName.Enabled = false; - tbEnhType.Enabled = false; - _Enhanced.Add(ecfg); - bsMiniEnhanced.DataSource = _Enhanced; - cbxEnhVersions.SelectedIndex = 0; - cbxEnhVersions.Enabled = false; - btnNewEnh.Visible = false; - - // when in an enhanced doc version, make visible the button that allows user to unlink, need to get its 'title' - // from the source. - DocVersionInfo srcDVInfo = DocVersionInfo.Get(_DocVersionConfig.MyEnhancedDocuments[0].VersionID); - DocVersionConfig srcDVConfig = srcDVInfo.MyConfig as DocVersionConfig; - DVEnhancedDocuments dveds = srcDVConfig.MyEnhancedDocuments; - string ename = null; - foreach (DVEnhancedDocument dved in dveds) - { - if (dved.VersionID == _DocVersionConfig.MyDocVersion.VersionID) - { - ename = dved.Name; - break; - } - } - if (ename != null) - { - btnUnlinkDocVersion.Visible = true; - btnUnlinkDocVersion.Text = string.Format("Remove All {0} Links", ename); - } - } - else if (hasEnhancedPO) - { - // first set up existing enhanced linked documents (this is a listbox on left of form) - _Enhanced = new List(); - lbEnhanced.Visible = true; - lblEnhSet.Visible = true; - btnUnlinkDocVersion.Visible = false; // no unlink button when on a Source Document - foreach (DVEnhancedDocument dved in _DocVersionConfig.MyEnhancedDocuments) - { - DocVersionInfo dvi = DocVersionInfo.Get(dved.VersionID); - DocVersionConfig dvc = dvi.MyConfig as DocVersionConfig; - EnhancedMiniConfig ecfg = new EnhancedMiniConfig(0, dvi.VersionID, "?", dvi.SearchDVPath, dved.Name, dved.Type.ToString(), dved.PdfToken, dved.PdfX.ToString()); - cbxEnhVersions.Items.Add(dvi.SearchDVPath); - _Enhanced.Add(ecfg); - } - tbEnhName.Enabled = true; - tbEnhType.Enabled = false; - cbxEnhVersions.Enabled = false; - bsEnhanced.DataSource = _Enhanced; - if (cbxEnhVersions.Items.Count>0) cbxEnhVersions.SelectedIndex = 0; - if (lbEnhanced.Items.Count > 0) lbEnhanced.SelectedIndex = 0; - bsMiniEnhanced.DataSource = bsEnhanced.Current as EnhancedMiniConfig; - - // only allow new if there are available non-linked 'enhanced format' docversions. - int cntAvailForLinkEnh = 0; - DocVersionInfoList nonenhdvs = DocVersionInfoList.GetNonEnhancedDocVersions(); - foreach (DocVersionInfo nonenhdv in nonenhdvs) - { - if (nonenhdv.VersionID != _DocVersionConfig.MyDocVersion.VersionID) - { - if (((nonenhdv.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) || - ((nonenhdv.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations)) - { - cntAvailForLinkEnh++; - } - } - } - btnNewEnh.Visible = (cntAvailForLinkEnh > 0); - } - } - - void btnEnh_Click(object sender, EventArgs e) - { - if (MessageBox.Show(this, "Are you sure you want to Link Enhanced Document(s) to this Working Draft?", "Add Enhanced Link", MessageBoxButtons.YesNoCancel) == DialogResult.Yes) - { - btnEnhanced.Visible = true; - tiEnhanced.Visible = true; - Button btnEnh = (Button)sender; - btnEnh.Visible = false; - btnEnhanced_Click(sender, e); - } - } - void btnPC_Click(object sender, EventArgs e) - { - if (MessageBox.Show(this, "Are you sure you want to add Applicability to this Working Draft?", "Add Applicability", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Stop) == DialogResult.Yes) - { - btnApplicability.Visible = true; - tiApplicability.Visible = true; - Button btnPC = (Button)sender; - btnPC.Visible = false; - btnApplicability_Click(sender, e); - } - } - // The following code was added to fix Bug B2013-117 - void ppTxtBxPDFLoc_TextChanged(object sender, EventArgs e) - { - if (_Initializing == false) - _DocVersionConfig.Print_PDFLocation = ppTxtBxPDFLoc.Text; - } - #region General tab - - /// - /// This is the General button used on the button interface design - /// - /// object - /// EventArgs - private void btnGeneral_Click(object sender, EventArgs e) - { - ProcessButtonClick(tiGeneral, btnGeneral); - } - - #endregion - - #region Referenced Objects - - /// - /// This is the Referenced Objects button used on the button interface design - /// - /// object - /// EventArgs - private void btnRefObjs_Click(object sender, EventArgs e) - { - ProcessButtonClick(tiRefObjs, btnRefObjs); - } - - #endregion - - #region Output Settings - - /// - /// This is the Output Settings button used on the button interface design - /// - /// object - /// EventArgs - private void btnOutputSettings_Click(object sender, EventArgs e) - { - ProcessButtonClick(tiOutputSettings, btnOutputSettings); - } - - /// - /// Selection in Pagination combo box changed. - /// - /// object - /// EventArgs - //private void ppCmbxPagination_SelectedValueChanged(object sender, EventArgs e) - //{ - // if (!_Initializing) - // { - // PrintPagination pgtn = (PrintPagination)Enum.Parse(typeof(PrintPagination), _DefaultPagination); - // ProcessCmbxSelectionEnumChanged(ppCmbxPagination, pgtn, ppBtnDefPagination, ppLblPaginationDefault); - // } - //} - - /// - /// Reset to the parent setting. - /// Find the parent setting and assign it to _DocVersionConfig.Print_Pagination. - /// This will force the database to be updated. - /// - /// - /// - //private void ppBtnDefPagination_Click(object sender, EventArgs e) - //{ - // // Get the parent setting - // PrintPagination pgtn = (PrintPagination)Enum.Parse(typeof(PrintPagination), _DefaultPagination); - // // Compare parent setting with current setting - // if (pgtn != _DocVersionConfig.Print_Pagination) - // _DocVersionConfig.Print_Pagination = pgtn; // this will force a database update (write) - // ppCmbxPagination.SelectedIndex = -1; - // //tcpOutputSettings.Focus(); - //} - - /// - /// Selection in Watermark combo box changed. - /// - /// object - /// EventArgs - private void ppCmbxWatermark_SelectedValueChanged(object sender, EventArgs e) - { - if (!_Initializing) - { - PrintWatermark wtr = (PrintWatermark)Enum.Parse(typeof(PrintWatermark), _DefaultWatermark); - ProcessCmbxSelectionEnumChanged(ppCmbxWatermark, wtr, ppBtnDefWatermark, ppLblWatermarkDefault); - } - } - - /// - /// Reset to the parent setting. - /// Find the parent setting and assign it to _DocVersionConfig.Print_Watermark. - /// This will force the database to be updated. - /// - /// - /// - private void ppBtnDefWatermark_Click(object sender, EventArgs e) - { - // Get the parent setting - PrintWatermark wtr = (PrintWatermark)Enum.Parse(typeof(PrintWatermark), _DefaultWatermark); - // Compare parent setting with current setting - if (wtr != _DocVersionConfig.Print_Watermark) - _DocVersionConfig.Print_Watermark = wtr; // this will force a database update (write) - ppCmbxWatermark.SelectedIndex = -1; - //tcpOutputSettings.Focus(); - } - - #endregion - - #region Format Settings - - /// - /// This is the Format Settings button used on the button interface design - /// - /// object - /// EventArgs - private void btnFmtSettings_Click(object sender, EventArgs e) - { - ProcessButtonClick(tiFmtSettings, btnFmtSettings); - // added for code change C2017-004 - select default format in dropdown list - if (_InitialIndex < -1) _InitialIndex = ppCmbxFormat.SelectedIndex; // save the current format selection (happens here when current section is set to the default format) - } - - private void ppBtnDefaultFmt_Click(object sender, EventArgs e) - { - ppCmbxFormat.SelectedIndex = -1; - //tcpFormatSettings.Focus(); - } - - /// - /// If checked, will disable automatic duplexing (ex Foldout Pages) - /// - /// - /// - private void ppChbxDisAutoDuplex_CheckedChanged(object sender, EventArgs e) - { - if (!_Initializing) - { - _DocVersionConfig.Print_DisableDuplex = ppChbxDisAutoDuplex.Checked; - ppBtnDeftDisAutoDuplx.Visible = (_DefaultDisableDuplex != ppChbxDisAutoDuplex.Checked); - ppLblAutoDuplexDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDeftDisAutoDuplx.Visible; - } - - } - - // commented out as part of code change C2017-004. this also makes it consistent with section properties - ///// - ///// Selection in Format combo box changed. - ///// - ///// object - ///// EventArgs - //private void ppCmbxFormat_SelectedValueChanged(object sender, EventArgs e) - //{ - // if (!_Initializing) - // ProcessCmbxSelectedValueChange(ppCmbxFormat, _DefaultFormatName, ppBtnDefaultFmt, ppLblFormatDefault); - //} - - /// - /// Enable or disable the user specified change bar options base on the type - /// of change bar selected. - /// - private void setEnabledUserSpecifiedChgBarCombos(PrintChangeBar pcb) - { - //ppGpbxUserSpecCB.Enabled = - //ppCmbxChgBarPos.Enabled = - //ppCmbxChgBarTxtType.Enabled = - //ppBtnDefaultCbPos.Enabled = - //ppBtnDefCbTxtTyp.Enabled = (ppCmbxChangeBarType.SelectedValue != null && - //ppCmbxChangeBarType.SelectedValue.Equals(DocVersionConfig.PrintChangeBar.WithUserSpecified)) || - //(ppCmbxChangeBarType.SelectedValue == null && pcb.Equals(DocVersionConfig.PrintChangeBar.WithUserSpecified)); - - ppGpbxUserSpecCB.Enabled = (ppCmbxChangeBarType.SelectedValue != null && - ppCmbxChangeBarType.SelectedValue.Equals(PrintChangeBar.WithUserSpecified)) || - (ppCmbxChangeBarType.SelectedValue == null && pcb.Equals(PrintChangeBar.WithUserSpecified)); - - } - - /// - /// Selection in Change Bar combo box changed. - /// - /// object - /// EventArgs - private void ppCmbxChangeBarType_SelectedValueChanged(object sender, EventArgs e) - { - if (!_Initializing) - { - PrintChangeBar pcb = (PrintChangeBar)Enum.Parse(typeof(PrintChangeBar), _DefaultChgBarType); - ProcessCmbxSelectionEnumChanged(ppCmbxChangeBarType, pcb, ppBtnDefaultChgBar, ppLblChangeBarTypeDefault); - setEnabledUserSpecifiedChgBarCombos(pcb); - } - } - - /// - /// Reset to the parent setting. - /// Find the parent setting and assign it to _DocVersionConfig.PrintChangeBar. - /// This will force the database to be updated. - /// - /// - /// - private void ppBtnDefaultChgBar_Click(object sender, EventArgs e) - { - // Get the parent setting - PrintChangeBar pcb = (PrintChangeBar)Enum.Parse(typeof(PrintChangeBar), _DefaultChgBarType); - // Compare parent setting with current setting - if (pcb != _DocVersionConfig.Print_ChangeBar) - _DocVersionConfig.Print_ChangeBar = pcb; // this will force a database update (write) - ppCmbxChangeBarType.SelectedIndex = -1; //reset combo box to the default Change Bar setting - //tcpFormatSettings.Focus(); - } - - /// - /// Selection in Change Bar Position combo box changed. - /// - /// object - /// EventArgs - private void ppCmbxChgBarPos_SelectedValueChanged(object sender, EventArgs e) - { - if (!_Initializing) - { - PrintChangeBarLoc cbl = (PrintChangeBarLoc)Enum.Parse(typeof(PrintChangeBarLoc), _DefaultChgBarLoc); - ProcessCmbxSelectionEnumChanged(ppCmbxChgBarPos, cbl, ppBtnDefaultCbPos, ppLblChgBarPosDefault); - } - } - - /// - /// Reset to the parent setting. - /// Find the parent setting and assign it to _DocVersionConfig.Print_ChangeBarLoc. - /// This will force the database to be updated. - /// - /// - /// - private void ppBtnDefaultCbPos_Click(object sender, EventArgs e) - { - // Get the parent setting - PrintChangeBarLoc cbl = (PrintChangeBarLoc)Enum.Parse(typeof(PrintChangeBarLoc), _DefaultChgBarLoc); - // Compare parent setting with current setting - if (cbl != _DocVersionConfig.Print_ChangeBarLoc) - _DocVersionConfig.Print_ChangeBarLoc = cbl; // this will force a database update (write) - ppCmbxChgBarPos.SelectedIndex = -1; - //tcpFormatSettings.Focus(); - } - - /// - /// Enable or disable the user specified change bar text based on the selected - /// change bar text type (selected in the user specific change bar grouping) - /// - private void setEnabledUserSpecifiedChgBarText() - { - //ppGpbxUserSpecTxt.Enabled = - //ppTxbxChangeBarUserMsgOne.Enabled = - //ppTxbxChangeBarUserMsgTwo.Enabled = - //ppBtnDefCbTxt1.Enabled = - //ppBtnDefCbTxt2.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null && - //ppCmbxChgBarTxtType.SelectedValue.Equals(DocVersionConfig.PrintChangeBarText.UserDef)); - - //string decUserDef = EnumDescConverter.GetEnumDescription(DocVersionConfig.PrintChangeBarText.UserDef); - - // This string is used to check against our default setting to see if User Defined Changebar Text is active - string decUserDef = PrintChangeBarText.UserDef.ToString(); - - ppGpbxUserSpecTxt.Enabled = (ppCmbxChgBarTxtType.SelectedValue != null && - ppCmbxChgBarTxtType.SelectedValue.Equals(PrintChangeBarText.UserDef)) || - (ppCmbxChgBarTxtType.SelectedIndex == -1 && _DefaultChgBarText.Equals(decUserDef)); - - } - - /// - /// Selection in Change Bar Text Type combo box changed. - /// - /// object - /// EventArgs - private void ppCmbxChgBarTxtType_SelectedValueChanged(object sender, EventArgs e) - { - if (!_Initializing) - { - PrintChangeBarText cbt = (PrintChangeBarText)Enum.Parse(typeof(PrintChangeBarText), _DefaultChgBarText); - ProcessCmbxSelectionEnumChanged(ppCmbxChgBarTxtType, cbt, ppBtnDefCbTxtTyp, ppLblChgBarTxtTypeDefault); - setEnabledUserSpecifiedChgBarText(); - } - } - - /// - /// Reset to the parent setting. - /// Find the parent setting and assign it to _DocVersionConfig.Print_ChangeBarText. - /// This will force the database to be updated. - /// - /// - /// - private void ppBtnDefCbTxtTyp_Click(object sender, EventArgs e) - { - // Get the parent setting - PrintChangeBarText cbt = (PrintChangeBarText)Enum.Parse(typeof(PrintChangeBarText), _DefaultChgBarText); - // Compare parent setting with current setting - if (cbt != _DocVersionConfig.Print_ChangeBarText) - _DocVersionConfig.Print_ChangeBarText = cbt; // this will force a database update (write) - ppCmbxChgBarTxtType.SelectedIndex = -1; - //tcpFormatSettings.Focus(); - } - - /// - /// Selection in Change Bar User Message One text changed. - /// - /// object - /// EventArgs - private void ppTxbxChangeBarUserMsgOne_TextChanged(object sender, EventArgs e) - { - ppBtnDefCbTxt1.Visible = ((ppTxbxChangeBarUserMsgOne.Text != null) && !ppTxbxChangeBarUserMsgOne.Text.Equals(_DefaultChgBarUsrMsg1)); - ppLblChgBarUserMsgOneDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt1.Visible; - } - - /// - /// Selection in Change Bar User Message Two text changed. - /// - /// object - /// EventArgs - private void ppTxbxChangeBarUserMsgTwo_TextChanged(object sender, EventArgs e) - { - ppBtnDefCbTxt2.Visible = ((ppTxbxChangeBarUserMsgTwo.Text != null) && !ppTxbxChangeBarUserMsgTwo.Text.Equals(_DefaultChgBarUsrMsg2)); - ppLblChgBarUserMsgTwoDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt2.Visible; - } - - #endregion - - #region Library Documents - - /// - /// This is the Library Documents button used on the button interface design - /// - /// object - /// EventArgs - private void btnLibDocs_Click(object sender, EventArgs e) - { - ProcessButtonClick(tiLibDocs, btnLibDocs); - } - - #endregion - - #region Generic functions used on this property page - - /// - /// This is a generic Enter Event function for use with all of the property page tabs. - /// Found that the visiblity value of buttons is not recorded until the property page in which it resides is diplayed. - /// Thus we need to call defaultSettingVisiblity() to check and set visiblity states. - /// - /// type object - /// type EventArgs - private void tabpage_Enter(object sender, EventArgs e) - { - // Show or hide the labels containing the default values - //if (!_Initializing) - defaultSettingsVisiblity(); - } - - /// - /// Determines what labels (showing default values) are visable on the property pages - /// - private void defaultSettingsVisiblity() - { - ppLblDefSettingsInfo.Visible = ppCbShwDefSettings.Checked; - - ppLblChgBarUserMsgOneDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt1.Visible; - ppLblChgBarUserMsgTwoDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxt2.Visible; - - ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible; - ppLblChangeBarTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultChgBar.Visible; - ppLblChgBarPosDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultCbPos.Visible; - ppLblChgBarTxtTypeDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefCbTxtTyp.Visible; - //ppLblPaginationDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefPagination.Visible; - ppLblWatermarkDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefWatermark.Visible; - ppLblAutoDuplexDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDeftDisAutoDuplx.Visible; - } - - /// - /// For the Button Interface property page style, when a button is selected (pressed), - /// it will remain in the checked state even when a different button is selected. Thus - /// we must clear the checked state of the buttons when a button is selected, then set - /// the newly selected button's state to checked. - /// - private void ClearAllCheckedButtons() - { - btnGeneral.Checked = false; - btnRefObjs.Checked = false; - btnOutputSettings.Checked = false; - btnFmtSettings.Checked = false; - btnLibDocs.Checked = false; - btnApplicability.Checked = false; - } - - /// - /// Select the corresponding tab and set the button's state to checked - /// - /// Property Page Tab - /// Corresponding Property Page Button - private void ProcessButtonClick(TabItem tab, ButtonX button) - { - ClearAllCheckedButtons(); - tcVersions.SelectedTab = tab; - button.Checked = true; - } - - /// - /// Process a change in the enum combo box selection - /// - /// Combo Box Name - /// the default enum value - /// button to reset to default value - /// label containing the default - private void ProcessCmbxSelectionEnumChanged(ComboBoxEx cmbx, object enumval, ButtonX button, Label deflabel) - { - if ((cmbx.SelectedIndex != -1) && - cmbx.SelectedValue.Equals(enumval)) - { - _Initializing = true; - button.Visible = true; - button.Focus(); - button.PerformClick(); - cmbx.SelectedIndex = -1; // This will hide the Default button - _Initializing = false; - } - button.Visible = (cmbx.SelectedValue != null); - deflabel.Visible = ppCbShwDefSettings.Checked && button.Visible; - } - - /// - /// Process a change in the combo box selection - /// - /// Combo Box Name - /// string containing default text - /// button to reset to default value - /// label containing the default - private void ProcessCmbxSelectedValueChange(ComboBoxEx cmbx, string defstr, ButtonX button, Label deflabel) - { - if ((cmbx.SelectedIndex != -1) && defstr != null && defstr.Equals(cmbx.SelectedValue)) - { - button.Visible = true; - button.Focus(); - button.PerformClick(); - } - button.Visible = cmbx.SelectedValue != null; - deflabel.Visible = ppCbShwDefSettings.Checked && button.Visible; - } - /// - /// Set the watermark and default label - /// - /// The default text - /// Label that displays the current default when view defaults is set - /// Combo box with a watermark property - private static void SetupDefault(string defaultText, Label lbl, ComboBoxEx cmbo) - { - if (defaultText != null && !(defaultText.Equals(""))) - { - string deftext = string.Format("{0}", defaultText); - lbl.Text = deftext; - cmbo.WatermarkText = deftext; - } - } - - #endregion - - private void btnRoDbProperties_Click(object sender, EventArgs e) - { - frmRODbProperties dlgROProperties = new frmRODbProperties(_DocVersionConfig.MyDocVersion, SelectedROFst == null ? null : SelectedROFst.MyRODb); - dlgROProperties.ParentLocation = Location; - if (dlgROProperties.ShowDialog() == DialogResult.OK) - { - tbRoDb.Text = string.Format("{0} ({1})", SelectedROFst.MyRODb.ROName, SelectedROFst.MyRODb.FolderPath); - ppBtnUpRoVals.Enabled = _DocVersionConfig.MyDocVersion.DocVersionAssociations != null && _DocVersionConfig.MyDocVersion.DocVersionAssociations.Count > 0; // only allow update if association - } - } - - private void ppBtnUpRoVals_Click(object sender, EventArgs e) - { - InitialProgressBarMessage = "Updating ROs"; - // use rodb directory path of the first rofst for the this document version. Bring up a file - // selection dialog starting with this path. The user can select another path. - // RHM question - we talked about just using the current path, but what is the current path when - // a docversion can have more than one rofst (for now, just use first?) - should I bring up a dialog? - if (_DocVersionConfig.MyDocVersion.DocVersionAssociations.Count < 1) - { - MessageBox.Show("Error Updating ro.fst. No associated ro.fst"); - return; - } - foreach (DocVersionAssociation dva in _DocVersionConfig.MyDocVersion.DocVersionAssociations) - { - RODbInfo rdi = RODbInfo.Get(dva.ROFst_RODbID); - - string rofstPath = rdi.FolderPath + @"\ro.fst"; - if (!File.Exists(rofstPath)) - { - FinalProgressBarMessage = "No existing RO.FST"; - MessageBox.Show("No existing ro.fst in path " + rdi.FolderPath + ". Check for invalid path"); - break; - } - FileInfo fiRofst = new FileInfo(rofstPath); - if (SelectedROFst.DTS == fiRofst.LastWriteTimeUtc) - { - FinalProgressBarMessage = "RO.FST up to date"; - MessageBox.Show("ro.fst files are same for path " + rdi.FolderPath + ", import of that ro.fst will not be done"); - break; - } - if (SelectedROFst.DTS > fiRofst.LastWriteTimeUtc) - { - FinalProgressBarMessage = "RO.FST is older"; - MessageBox.Show("Cannot copy older ro.fst from " + rdi.FolderPath + ", import of that ro.fst will not be done"); - break; - } - Cursor = Cursors.WaitCursor; - SelectedROFst.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); - ROFst newrofst = ROFstInfo.RefreshROFst(rdi, dva, _DocVersionConfig.MyDocVersion, SelectedROFst, DoProgressBarRefresh, null); - SelectedROFst.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); - ppBtnUpRoVals.Enabled = _DocVersionConfig.MyDocVersion.DocVersionAssociations != null && _DocVersionConfig.MyDocVersion.DocVersionAssociations.Count > 0; - Cursor = Cursors.Default; - } - FinalProgressBarMessage = "ROs values updated"; - } - private ProgressBarItem _ProgressBar = null; - public ProgressBarItem ProgressBar - { - get { return _ProgressBar; } - set { _ProgressBar = value; } - } - private void DoProgressBarRefresh(int value, int max, string text) - { - if (ProgressBar == null) return; - ProgressBar.Maximum = max; - ProgressBar.Value = value; - ProgressBar.Text = text; - Application.DoEvents(); - } - private string InitialProgressBarMessage - { - set - { - if (ProgressBar == null) return; - ProgressBar.Value = 0; - ProgressBar.Maximum = 100; - ProgressBar.Text = value; - Application.DoEvents(); - } - } - private string FinalProgressBarMessage - { - set - { - if (ProgressBar == null) return; - ProgressBar.Maximum = 100; - ProgressBar.Value = 100; - ProgressBar.Text = value; - Application.DoEvents(); - } - } - public List roFstInfo_ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args) - { - string xml = null; - string srchtxt = null; - using (VlnFlexGrid myGrid = new VlnFlexGrid()) - { - using (StringReader sr = new StringReader(args.OldGridXml)) - { - myGrid.ReadXml(sr); - myGrid.KeyActionTab = C1.Win.C1FlexGrid.KeyActionEnum.MoveAcross; - sr.Close(); - } - string roid = myGrid.ROID; - int rodbid = myGrid.RODbId; - Font GridFont = myGrid.Font; - myGrid.Clear(); - myGrid.ParseTableFromText(args.ROText, GridLinePattern.Single); - myGrid.AutoSizeCols(); - myGrid.AutoSizeRows(); - myGrid.MakeRTFcells(); - myGrid.RODbId = rodbid; - myGrid.ROID = roid; - myGrid.IsRoTable = true; - using (StringWriter sw = new StringWriter()) - { - myGrid.WriteXml(sw); - xml = sw.GetStringBuilder().ToString(); - sw.Close(); - } - srchtxt = myGrid.GetSearchableText(); - } - List retlist = new List(); - retlist.Add(srchtxt); - retlist.Add(xml); - return retlist; - } - private void ppBtnResetRoVals_Click(object sender, EventArgs e) - { - // This will not be supported in the first release. A discussion was held on 1/6/09 with MRC, JSJ, RHM & - // KBR & it was decided that we'd wait to see if users end up needing this. It can be done by going - // into the sql database and modify/delete records if needed. - } - - private void cmbRoDb_SelectedIndexChanged(object sender, EventArgs e) - { - // The only way that a selected index can change on the rodb combo box is if there was no rofst - // to docversion association. If a selection is made, make that association and then change the - // combo box to a non-editable text box with button becoming a properties rather than browse. - if (_Initializing) return; - // add the rofst for the selected rodb (note that it may already exist, and will use the current - // one. - // get the rodb from the selection - and then do an 'update rofst'... - RODbInfoList rdil = RODbInfoList.Get(); - RODbInfo rdi = rdil[cmbRoDb.SelectedIndex]; - ROFstInfo fst=null; - foreach(ROFstInfo inf in rdi.RODbROFsts) - if(fst == null || inf.ROFstID > fst.ROFstID) - fst = inf; - if (fst != null) - { - using(ROFst fst1 = fst.Get()) - _DocVersionConfig.MyDocVersion.DocVersionAssociations.Add(fst1); - cmbRoDb.Visible = ppBtnRoDbBrowse.Visible = false; - tbRoDb.Visible = btnRoDbProperties.Visible = true; - tbRoDb.Text = string.Format("{0} ({1})", fst.MyRODb.ROName, fst.MyRODb.FolderPath); - - } - else - { - ROFst tmp = ROFstInfo.AddRoFst(rdi, _DocVersionConfig.MyDocVersion, DoProgressBarRefresh); // RHM Needs To Include Delegate - if (tmp == null) - { - MessageBox.Show("Invalid ro fst directory, use the Property dialog to fix directory path to ro.fst."); - frmRODbProperties dlgROProperties = new frmRODbProperties(_DocVersionConfig.MyDocVersion, rdi); - dlgROProperties.ProgressBar = ProgressBar; - if (dlgROProperties.ShowDialog() == DialogResult.OK) - { - tbRoDb.Text = string.Format("{0} ({1})", SelectedROFst.MyRODb.ROName, SelectedROFst.MyRODb.FolderPath); - ppBtnUpRoVals.Enabled = _DocVersionConfig.MyDocVersion.DocVersionAssociations != null && _DocVersionConfig.MyDocVersion.DocVersionAssociations.Count > 0; // only allow update if association - } - else - return; - } - cmbRoDb.Visible = ppBtnRoDbBrowse.Visible = false; - tbRoDb.Visible = btnRoDbProperties.Visible = true; - tbRoDb.Text = string.Format("{0} ({1})", tmp.MyRODb.ROName, tmp.MyRODb.FolderPath); - } - } - - private void ppBtnRoDbBrowse_Click(object sender, EventArgs e) - { - frmRODbProperties dlgROProperties = new frmRODbProperties(_DocVersionConfig.MyDocVersion, SelectedROFst == null ? null : SelectedROFst.MyRODb); - dlgROProperties.ParentLocation = Location; - // if a user has entered a valid rodb, then this docversion will be conntected to it - change - // to a non-editable text box and the button becomes a properties button rather than browse. - if (dlgROProperties.ShowDialog() == DialogResult.OK) - { - cmbRoDb.Items.Clear(); - _DocVersionConfig.MyDocVersion.Reset_DocVersionAssociations(); - if (_DocVersionConfig.MyDocVersion.DocVersionAssociations != null && _DocVersionConfig.MyDocVersion.DocVersionAssociationCount > 0) - { - cmbRoDb.Visible = ppBtnRoDbBrowse.Visible = false; - tbRoDb.Visible = btnRoDbProperties.Visible = true; - tbRoDb.Text = string.Format("{0} ({1})", SelectedROFst.MyRODb.ROName, SelectedROFst.MyRODb.FolderPath); - return; - } - RODbInfoList.Reset(); - int selindx = -1; - int myrodbid = (SelectedROFst == null) ? -1 : SelectedROFst.RODbID; - foreach (RODbInfo rdi in RODbInfoList.Get()) - { - int i = cmbRoDb.Items.Add(rdi.ROName + " (" + rdi.FolderPath + ")"); - if (rdi.RODbID == myrodbid) selindx = i; - } - if (cmbRoDb.Items.Count > 0) cmbRoDb.SelectedIndex = selindx; - } - } - - private void ppBtnPDFLoc_Click(object sender, EventArgs e) - { - PDFLocationBrowserDialog.SelectedPath = ppTxtBxPDFLoc.Text; - DialogResult dr = PDFLocationBrowserDialog.ShowDialog(); - if (dr == DialogResult.OK) - ppTxtBxPDFLoc.Text = PDFLocationBrowserDialog.SelectedPath; - } - - private void ppBtnDefCbTxt1_Click(object sender, EventArgs e) - { - // Compare default setting with current setting - // Reset with the default and hide the default button and label - if (_DefaultChgBarUsrMsg1 != _DocVersionConfig.Print_UserCBMess1) - { - _DocVersionConfig.Print_UserCBMess1 = _DefaultChgBarUsrMsg1; - ppLblChgBarUserMsgOneDefault.Visible = false; - ppBtnDefCbTxt1.Visible = false; - //tcpFormatSettings.Focus(); - } - } - - private void ppBtnDefCbTxt2_Click(object sender, EventArgs e) - { - // Compare default setting with current setting - // Reset with the default and hide the default button and label - if (_DefaultChgBarUsrMsg2 != _DocVersionConfig.Print_UserCBMess2) - { - _DocVersionConfig.Print_UserCBMess2 = _DefaultChgBarUsrMsg2; - ppLblChgBarUserMsgTwoDefault.Visible = false; - ppBtnDefCbTxt2.Visible = false; - //tcpFormatSettings.Focus(); - } - } - - private void ppBtnDeftDisAutoDuplx_Click(object sender, EventArgs e) - { - ppChbxDisAutoDuplex.Checked = _DefaultDisableDuplex; - _DocVersionConfig.Print_DisableDuplex = ppChbxDisAutoDuplex.Checked; - ppBtnDeftDisAutoDuplx.Visible = false; - ppLblAutoDuplexDefault.Visible = false; - //tcpOutputSettings.Focus(); - } - - private void frmVersionsProperties_Shown(object sender, EventArgs e) - { - ppRTxtName.Focus(); - } - - private void ppRTxtName_Leave(object sender, EventArgs e) - { - if (ppRTxtName.Text == null || ppRTxtName.Text == "") - { - MessageBox.Show("Cannot have a blank Name."); - return; - } - } - - private void btnApplicability_Click(object sender, EventArgs e) - { - ProcessButtonClick(tiApplicability, btnApplicability); - } - - private void lbApplicabilities_SelectedIndexChanged(object sender, EventArgs e) - { - if (lbApplicabilities.SelectedIndex > -1) - { - bsMiniApple.DataSource = bsApples.Current as MiniConfig; - btnDelApple.Enabled = true; - } - - } - private void btnNewApple_Click(object sender, EventArgs e) - { - MiniConfig cfg = new MiniConfig(); - cfg.Name = "New Applicability"; - if (_Apples == null) - _Apples = new List(); - _Apples.Add(cfg); - bsApples.DataSource = null; - bsApples.DataSource = _Apples; - lbApplicabilities.SelectedItem = cfg; - } - private void btnDelApple_Click(object sender, EventArgs e) - { - MiniConfig cfg = bsApples.Current as MiniConfig; - if (MessageBox.Show(string.Format("Are you sure you want to delete {0}", cfg.Name), "Confirm Delete", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes) - { - if (_DeletedApples == null) - _DeletedApples = new List(); - _DeletedApples.Add(cfg); - _Apples.Remove(cfg); - bsApples.DataSource = null; - bsApples.DataSource = _Apples; - } - } - - private void btnPhoneList_Click(object sender, EventArgs e) - { - dlgPhoneList dlgPL = new dlgPhoneList(_DocVersionConfig); - dlgPL.ShowDialog(); - } - - private void btnEnhanced_Click(object sender, EventArgs e) - { - ProcessButtonClick(tiEnhanced, btnEnhanced); - } - - private void lbEnhanced_SelectedIndexChanged(object sender, EventArgs e) - { - if (!_Initializing && lbEnhanced.SelectedIndex > -1 && !doingNew) - { - bsMiniEnhanced.DataSource = bsEnhanced.Current as EnhancedMiniConfig; - if (cbxEnhVersions.Items.Count >= lbEnhanced.Items.Count) - cbxEnhVersions.SelectedIndex = lbEnhanced.SelectedIndex; - } - } - private List NewEnhVersions = new List(); - private bool doingNew = false; - private void btnNewEnh_Click(object sender, EventArgs e) - { - _Initializing = true; - doingNew = true; - // the 'New' button is only enabled for Source documents. - EnhancedMiniConfig cfg = new EnhancedMiniConfig(); - cfg.Name = "New Enhanced"; - // need to have a unique number for this enhanced link, find largest and then increment by 1. - int maxtype = -1; - if (_DocVersionConfig.MyEnhancedDocuments != null && _DocVersionConfig.MyEnhancedDocuments.Count > 0) - { - foreach (DVEnhancedDocument dve in _DocVersionConfig.MyEnhancedDocuments) - { - maxtype = Math.Max(maxtype, dve.Type); - } - } - if (maxtype < 0) maxtype = 1; - else maxtype++; - cfg.Type = maxtype.ToString(); - - if (_Enhanced == null) - _Enhanced = new List(); - _Enhanced.Add(cfg); - bsEnhanced.DataSource = null; - bsEnhanced.DataSource = _Enhanced; - cbxEnhVersions.Items.Clear(); - NewEnhVersions.Clear(); - DocVersionInfoList nonenhdvs = DocVersionInfoList.GetNonEnhancedDocVersions(); // this is a list of docversions that have no 'Enhanced' in config data - foreach (DocVersionInfo nonenhdv in nonenhdvs) - { - if (nonenhdv.VersionID != _DocVersionConfig.MyDocVersion.VersionID) - { - if (((nonenhdv.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) || - ((nonenhdv.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations)) - { - NewEnhVersions.Add(nonenhdv); - cbxEnhVersions.Items.Add(nonenhdv.SearchDVPath); - } - } - } - if (cbxEnhVersions.Items.Count > 0) - { - cbxEnhVersions.Enabled = true; - cbxEnhVersions.SelectedIndex = 0; - } - else - cbxEnhVersions.Enabled = false; - bsMiniEnhanced.DataSource = cfg; - lbEnhanced.SelectedItem = cfg; - tbEnhType.Enabled = false; - btnNewEnh.Enabled = false; // for now, only do 1 at a time. - _Initializing = false; - } - private bool _EnhNeedToUnlink = false; - private void btnUnlinkDocVersion_Click(object sender, EventArgs e) - { - if (MessageBox.Show(this, "Are you sure you want to Unlink? Your documents will no longer link to Enhanced. NOTE that this processing occurs when 'OK' button is selected!", "Unlink", MessageBoxButtons.YesNo) == DialogResult.Yes) - { - _EnhNeedToUnlink = true; // do the unlink when 'OK' button is selected - } - } - - private void ppCmbxFormat_DropDown(object sender, EventArgs e) - { - _Initializing = true; - // C2017-004 - if using the default format, position the dropdown to the default format - if (ppCmbxFormat.SelectedIndex == -1) - ppCmbxFormat.SelectedValue = _DefaultFormatName; - _Initializing = false; - } - - private void ppCmbxFormat_DropDownClosed(object sender, EventArgs e) - { - // upon exit of the dropdown if the default format is selected - click the Default button - if ((string)(ppCmbxFormat.SelectedValue) == _DefaultFormatName) - { - ppBtnDefaultFmt.PerformClick(); - ppCmbxChangeBarType.Focus(); - } - } - - // added as part of code change C2017-004. this also makes it consistent with section properties - int _InitialIndex = -2; - private void ppCmbxFormat_SelectedIndexChanged(object sender, EventArgs e) - { - if (_Initializing) - { - // determine if the default button and the default description text should visable - ppBtnDefaultFmt.Visible = !(ppCmbxFormat.SelectedValue == null || ppCmbxFormat.SelectedIndex == -1); - ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible; - return; - } - if (_InitialIndex < -1) _InitialIndex = ppCmbxFormat.SelectedIndex; // save the current format selection (happens here when current section format is not the default section) - if ((ppCmbxFormat.SelectedIndex != -1) && _DefaultFormatName != null && _DefaultFormatName.Equals(ppCmbxFormat.SelectedValue)) - { - ppBtnDefaultFmt.Focus(); - ppBtnDefaultFmt.PerformClick(); - } - // determine if the default button and the default description text should visable - ppBtnDefaultFmt.Visible = !(ppCmbxFormat.SelectedValue == null || ppCmbxFormat.SelectedIndex == -1); - ppLblFormatDefault.Visible = ppCbShwDefSettings.Checked && ppBtnDefaultFmt.Visible; - } - } - [XmlRoot("Enhanced")] - public class EnhancedMiniConfig - { - private static int lastindex = 0; - private bool _isDeleted; - [XmlIgnore] - public bool IsDeleted - { - get { return _isDeleted; } - set { _isDeleted = value; } - } - private bool _isDirty; - [XmlIgnore] - public bool IsDirty - { - get { return _isDirty; } - set { _isDirty = value; } - } - private int _index; - [XmlAttribute("index")] - public int Index - { - get { return _index; } - set { _index = value; IsDirty = true; } - } - private int _versionID; - [XmlAttribute("VersionID")] - public int VersionID - { - get { return _versionID; } - set { _versionID = value; IsDirty = true; } - } - private string _versionPathName; - [XmlAttribute("VersionPathName")] - public string VersionPathName - { - get { return _versionPathName; } - set { _versionPathName = value; IsDirty = true; } - } - private string _name; - [XmlAttribute("Name")] - public string Name - { - get { return _name; } - set { _name = value; IsDirty = true; } - } - private string _type; - [XmlAttribute("Type")] - public string Type - { - get { return _type; } - set { _type = value; IsDirty = true; } - } - private string _pdfToken; - [XmlAttribute("PdfToken")] - public string PdfToken - { - get { return _pdfToken; } - set { _pdfToken = value; IsDirty = true; } - } - private string _pdfXOffset; - [XmlAttribute("PdfXOffset")] - public string PdfXOffset - { - get { return _pdfXOffset; } - set { _pdfXOffset = value; IsDirty = true; } - } - public EnhancedMiniConfig() - { - _index = --lastindex; - _versionID = -1; - _versionPathName = string.Empty; - _name = string.Empty; - _type = string.Empty; - _pdfToken = string.Empty; - _pdfXOffset = string.Empty; - _isDirty = false; - } - public EnhancedMiniConfig(int index, int versionid, string id, string versionPathName, string name, string type, string pdftoken, string pdfxoffset) - { - _index = index; - _versionID = versionid; - _versionPathName = versionPathName; - _name = name; - _type = type; - _pdfToken = pdftoken; - _pdfXOffset = pdfxoffset; - _isDirty = false; - } - public override string ToString() - { - return Name; - } - } - [XmlRoot("Slave")] - public class MiniConfig - { - private static int lastindex = 0; - private bool _isDeleted; - [XmlIgnore] - public bool IsDeleted - { - get { return _isDeleted; } - set { _isDeleted = value; } - } - private bool _isDirty; - [XmlIgnore] - public bool IsDirty - { - get { return _isDirty; } - set { _isDirty = value; } - } - private int _index; - [XmlAttribute("index")] - public int Index - { - get { return _index; } - set { _index = value; IsDirty = true; } - } - private string _iD; - [XmlAttribute("ID")] - public string ID - { - get { return _iD; } - set { _iD = value; IsDirty = true; } - } - private string _name; - [XmlAttribute("Name")] - public string Name - { - get { return _name; } - set { _name = value; IsDirty = true; } - } - private string _number; - [XmlAttribute("Number")] - public string Number - { - get { return _number; } - set { _number = value; IsDirty = true; } - } - private string _text; - [XmlAttribute("Text")] - public string Text - { - get { return _text; } - set { _text = value; IsDirty = true; } - } - private string _procedureNumber; - [XmlAttribute("ProcedureNumber")] - public string ProcedureNumber - { - get { return _procedureNumber; } - set { _procedureNumber = value; IsDirty = true; } - } - private string _setID; - [XmlAttribute("SetID")] - public string SetID - { - get { return _setID; } - set { _setID = value; IsDirty = true; } - } - private string _setName; - [XmlAttribute("SetName")] - public string SetName - { - get { return _setName; } - set { _setName = value; IsDirty = true; } - } - private string _otherID; - [XmlAttribute("OtherID")] - public string OtherID - { - get { return _otherID; } - set { _otherID = value; IsDirty = true; } - } - private string _otherName; - [XmlAttribute("OtherName")] - public string OtherName - { - get { return _otherName; } - set { _otherName = value; IsDirty = true; } - } - private string _otherNumber; - [XmlAttribute("OtherNumber")] - public string OtherNumber - { - get { return _otherNumber; } - set { _otherNumber = value; IsDirty = true; } - } - private string _otherText; - [XmlAttribute("OyherText")] - public string OtherText - { - get { return _otherText; } - set { _otherText = value; IsDirty = true; } - } - public MiniConfig() - { - _index = --lastindex; - _iD = string.Empty; - _name = string.Empty; - _number = string.Empty; - _text = string.Empty; - _procedureNumber = string.Empty; - _setID = string.Empty; - _setName = string.Empty; - _otherID = string.Empty; - _otherName = string.Empty; - _otherNumber = string.Empty; - _otherText = string.Empty; - _isDirty = false; - } - public MiniConfig(int index, string id, string name, string number, string text, string procedurenumber, string setid, string setname, string otherid, string othername, string othernumber, string othertext) - { - _index = index; - _iD = id; - _name = name; - _number = number; - _text = text; - _procedureNumber = procedurenumber; - _setID = setid; - _setName = setname; - _otherID = otherid; - _otherName = othername; - _otherNumber = othernumber; - _otherText = othertext; - _isDirty = false; - } - public override string ToString() - { - return Name; - } - public string MyXml - { - get { return GenericSerializer.StringSerialize(this); } - } - //#region XML Serializer Namespaces - //private XmlSerializerNamespaces _Namespaces = null; - //[XmlNamespaceDeclarations] - //public XmlSerializerNamespaces Namespaces - //{ - // get - // { - // if (_Namespaces == null) - // { - // _Namespaces = new XmlSerializerNamespaces(); - // } - // return _Namespaces; - // } - // set { _Namespaces = value; } - //} - //#endregion - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS.CSLA.Library/Config/AssocConfig - Copy (2).cs b/PROMS/VEPROMS.CSLA.Library/Config/AssocConfig - Copy (2).cs deleted file mode 100644 index bc0b72dc..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Config/AssocConfig - Copy (2).cs +++ /dev/null @@ -1,120 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.ComponentModel; - -namespace VEPROMS.CSLA.Library -{ - [Serializable] - [TypeConverter(typeof(ExpandableObjectConverter))] - public class AssociationConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged - { - #region DynamicTypeDescriptor - internal override bool IsReadOnly - { - get { return _Association == null; } - } - #endregion - #region XML - private XMLProperties _Xp; - private XMLProperties Xp - { - get { return _Xp; } - } - #endregion - #region Constructors - private Association _Association; - public AssociationConfig(Association association) - { - _Association = association; - string xml = association.Config; - if (xml == string.Empty) xml = ""; - _Xp = new XMLProperties(xml); - } - private AssociationInfo _AssociationInfo; - public AssociationConfig(AssociationInfo association) - { - _AssociationInfo = association; - string xml = association.Config; - if (xml == string.Empty) xml = ""; - _Xp = new XMLProperties(xml); - } - public AssociationConfig(string xml) - { - _Xp = new XMLProperties(xml); - } - public AssociationConfig() - { - string xml = ""; - _Xp = new XMLProperties(xml); - } - internal string GetValue(string group, string item) - { - return _Xp[group, item]; - } - #endregion - public Association MyAssociation - { get { return _Association; } } - #region RODefaults // From proc.ini - [Category("Referenced Objects")] - [DisplayName("Default RO Prefix")] - [RefreshProperties(RefreshProperties.All)] - [Description("Setpoint Prefix")] - public string RODefaults_setpointprefix - { - get - { - string s = _Xp["RODefaults", "Setpoint"];// get the saved value - return s; - } - set - { - _Xp["RODefaults", "Setpoint"] = value; // save selected value - OnPropertyChanged("RODefaults_setpointprefix"); - } - } - [Category("Referenced Objects")] - [DisplayName("Default Graphics Prefix")] - [RefreshProperties(RefreshProperties.All)] - [Description("Graphics Prefix")] - public string RODefaults_graphicsprefix - { - get - { - string s = _Xp["RODefaults", "Graphics"];// get the saved value - return s; - } - set - { - _Xp["RODefaults", "Graphics"] = value; // save selected value - } - } - #endregion - #region ROUpdate - [Category("RO Update")] - [DisplayName("Last Completed")] - [RefreshProperties(RefreshProperties.All)] - [Description("Last RO Update Completed")] - public string ROUpdate_LastCompleted - { - get - { - string s = _Xp["ROUpdate", "LastCompleted"];// get the saved value - return s; - } - set - { - _Xp["ROUpdate", "LastCompleted"] = value; // save selected value - } - } - #endregion // ROUpdate - #region ToString - public override string ToString() - { - string s = _Xp.ToString(); - if (s == "" || s == "") return string.Empty; - return s; - } - #endregion - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Config/AssocConfig - Copy.cs b/PROMS/VEPROMS.CSLA.Library/Config/AssocConfig - Copy.cs deleted file mode 100644 index a109f629..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Config/AssocConfig - Copy.cs +++ /dev/null @@ -1,104 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.ComponentModel; - -namespace VEPROMS.CSLA.Library -{ - [Serializable] - [TypeConverter(typeof(ExpandableObjectConverter))] - public class AssociationConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged - { - #region DynamicTypeDescriptor - internal override bool IsReadOnly - { - get { return _Association == null; } - } - #endregion - #region XML - private XMLProperties _Xp; - private XMLProperties Xp - { - get { return _Xp; } - } - #endregion - #region Constructors - private Association _Association; - public AssociationConfig(Association association) - { - _Association = association; - string xml = association.Config; - if (xml == string.Empty) xml = ""; - _Xp = new XMLProperties(xml); - } - private AssociationInfo _AssociationInfo; - public AssociationConfig(AssociationInfo association) - { - _AssociationInfo = association; - string xml = association.Config; - if (xml == string.Empty) xml = ""; - _Xp = new XMLProperties(xml); - } - public AssociationConfig(string xml) - { - _Xp = new XMLProperties(xml); - } - public AssociationConfig() - { - string xml = ""; - _Xp = new XMLProperties(xml); - } - internal string GetValue(string group, string item) - { - return _Xp[group, item]; - } - #endregion - public Association MyAssociation - { get { return _Association; } } - #region RODefaults // From proc.ini - [Category("Referenced Objects")] - [DisplayName("Default RO Prefix")] - [RefreshProperties(RefreshProperties.All)] - [Description("Setpoint Prefix")] - public string RODefaults_setpointprefix - { - get - { - string s = _Xp["RODefaults", "Setpoint"];// get the saved value - return s; - } - set - { - _Xp["RODefaults", "Setpoint"] = value; // save selected value - OnPropertyChanged("RODefaults_setpointprefix"); - } - } - #endregion - #region ROUpdate - [Category("RO Update")] - [DisplayName("Last Completed")] - [RefreshProperties(RefreshProperties.All)] - [Description("Last RO Update Completed")] - public string ROUpdate_LastCompleted - { - get - { - string s = _Xp["ROUpdate", "LastCompleted"];// get the saved value - return s; - } - set - { - _Xp["ROUpdate", "LastCompleted"] = value; // save selected value - } - } - #endregion // ROUpdate - #region ToString - public override string ToString() - { - string s = _Xp.ToString(); - if (s == "" || s == "") return string.Empty; - return s; - } - #endregion - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs.bak b/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs.bak deleted file mode 100644 index 06823f8a..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Config/ProcConfig.cs.bak +++ /dev/null @@ -1,798 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.ComponentModel; -using DescriptiveEnum; - -namespace VEPROMS.CSLA.Library -{ - [Serializable] - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ProcedureConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged, IItemConfig - { - #region DynamicTypeDescriptor - internal override bool IsReadOnly - { - get { return _Procedure == null; } - } - #endregion - #region XML - private XMLProperties _Xp; - private XMLProperties Xp - { - get { return _Xp; } - } - #endregion - #region Constructors - //PROPGRID: Hide ParentLookup - [Browsable(false)] - public bool ParentLookup - { - get { return _Xp.ParentLookup; } - set { _Xp.ParentLookup = value; } - } - //PROPGRID: Needed to comment out [NonSerialized] in order to hide AncestorLookup from property grid - //[NonSerialized] - //private bool _AncestorLookup; - ////PROPGRID: Hide AncestorLookup - //[Browsable(false)] - //public bool AncestorLookup - //{ - // get { return _AncestorLookup; } - // set { _AncestorLookup = value; } - //} - private Procedure _Procedure; - private ProcedureInfo _ProcedureInfo; - public ProcedureConfig(Procedure procedure) - { - _Procedure = procedure; - string xml = procedure.MyContent.Config; - if (xml == string.Empty) xml = ""; - _Xp = new XMLProperties(xml); - if (procedure.MyProcedureInfo.ActiveParent != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder); - } - private string Xp_LookInAncestorFolder(object sender, XMLPropertiesArgs args) - { - if (args.AncestorLookup || ParentLookup) - { - string retval; - // There may be levels of procedures, i.e. procedures within a procedure. - ProcedureInfo proc = _Procedure != null ? _Procedure.MyProcedureInfo : _ProcedureInfo; - while (proc.ActiveParent.IsProcedure) - { - retval = proc.ProcedureConfig.GetValue(args.Group, args.Item); - if (retval != string.Empty) return retval; - proc = (ProcedureInfo)proc.ActiveParent; - } - DocVersionInfo docVersion = proc.ActiveParent as DocVersionInfo; - if (docVersion == null) return string.Empty; - retval = docVersion.DocVersionConfig.GetValue(args.Group, args.Item); - if (retval != string.Empty) return retval; - for (FolderInfo folder = docVersion.MyFolder; folder != null; folder = folder.MyParent) - { - retval = folder.FolderConfig.GetValue(args.Group, args.Item); - if (retval != string.Empty) return retval; - } - } - return string.Empty; - } - //private string Xp_LookInAncestorFolderInfo(object sender, XMLPropertiesArgs args) - //{ - // if (args.AncestorLookup || ParentLookup) - // { - - // DocVersionInfo docVersion = (DocVersionInfo)_Procedure.ActiveParent; - // string retval = docVersion.DocVersionConfig.GetValue(args.Group, args.Item); - // if (retval != string.Empty) return retval; - // for (FolderInfo folder = docVersion.MyFolder; folder != null; folder = folder.MyParent) - // { - // retval = folder.FolderConfig.GetValue(args.Group, args.Item); - // if (retval != string.Empty) return retval; - // } - // } - // return string.Empty; - //} - public ProcedureConfig(ProcedureInfo procedureInfo) - { - _ProcedureInfo = procedureInfo; - string xml = procedureInfo.MyContent.Config; - if (xml == string.Empty) xml = ""; - _Xp = new XMLProperties(xml); - _Xp.AncestorLookup = true; - if (procedureInfo.ActiveParent != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder); - } - private int _SelectedSlave = 0; - //[Browsable(false)] - public int SelectedSlave - { - get { return _SelectedSlave; } - set { _SelectedSlave = value; } - } - public ProcedureConfig(string xml) - { - if (xml == string.Empty) xml = ""; - _Xp = new XMLProperties(xml); - } - //public ProcedureConfig() - //{ - // _Xp = new XMLProperties(); - //} - public string GetValue(string group, string item) - { - return _Xp[group, item]; - } - public void SetValue(string group, string item, string newvalue) - { - _Xp[group, item] = newvalue; - } - #endregion - #region Local Properties - [Category("General")] - [DisplayName("Number")] - [Description("Number")] - public string Number - { - get { return (_Procedure != null ? _Procedure.MyContent.Number : _ProcedureInfo.MyContent.Number); } - set { if (_Procedure != null) _Procedure.MyContent.Number = value; } - } - [Category("General")] - [DisplayName("Title")] - [Description("Title")] - public string Title - { - get { return (_Procedure != null ? _Procedure.MyContent.Text : _ProcedureInfo.MyContent.Text); } - set { if (_Procedure != null) _Procedure.MyContent.Text = value; } - } - [Category("Identification")] - //PROPGRID: Hide Old Sequence - [Browsable(false)] - [DisplayName("Old Sequence")] - [Description("Old Sequence")] - public string OldSequence - { - get { return (_Procedure != null ? _Procedure.MyContent.MyZContent.OldStepSequence : (_ProcedureInfo.MyContent.MyZContent == null ? null : _ProcedureInfo.MyContent.MyZContent.OldStepSequence)); } - set { if (_Procedure != null) _Procedure.MyContent.MyZContent.OldStepSequence = value; } - } - [Category("Identification")] - //PROPGRID: Hide Dirty - [Browsable(false)] - [DisplayName("Dirty")] - [Description("Dirty")] - public bool Dirty - { - get { return (_Procedure != null ? _Procedure.IsDirty : false); } - } - [Category("Format Settings")] - [DisplayName("Format")] - [Description("Format")] - [TypeConverter(typeof(FormatList))] - public string FormatSelection - { - get - { - if (_Procedure != null && _Procedure.MyContent.MyFormat != null) return _Procedure.MyContent.MyFormat.FullName; //.PlantFormat.FormatData.Name; - if (_ProcedureInfo != null && _ProcedureInfo.MyContent.MyFormat != null) return _ProcedureInfo.MyContent.MyFormat.FullName;//.PlantFormat.FormatData.Name; - return null; - } - set - { - if (_Procedure != null) - { - _Procedure.MyContent.MyFormat = FormatList.ToFormat(value); // Can only be set if _DocVersion is set - //_Procedure.ActiveFormat = null; - } - } - } - [Category("Format Settings")] - [DisplayName("Default Format")] - [Description("Default Format")] - [TypeConverter(typeof(FormatList))] - public string DefaultFormatSelection - { - get - { - if (_Procedure != null && _Procedure.MyProcedureInfo.ActiveParent != null && _Procedure.MyProcedureInfo.ActiveParent.ActiveFormat != null) return _Procedure.MyProcedureInfo.ActiveParent.ActiveFormat.FullName; - if (_ProcedureInfo != null && _ProcedureInfo.MyParent != null && _ProcedureInfo.MyParent.ActiveFormat != null) return _ProcedureInfo.MyParent.ActiveFormat.FullName; - return null; - } - } - public Procedure MyProcedure - { get { return _Procedure; } } - #endregion - #region ToString - public override string ToString() - { - string s = _Xp.ToString(); - if (s == "" || s == "") return string.Empty; - return s; - } - #endregion - #region FormatCategory - //[TypeConverter(typeof(EnumDescConverter))] - //public enum FormatColumns : int - //{ - // Default = 0, - // [Description("Single Column")] - // OneColumn, - // [Description("Dual Column")] - // TwoColumn, - // [Description("Triple Column")] - // ThreeColumn, - // [Description("Quad Column")] - // FourColumns - //} - [Category("General")] - [DisplayName("Default Column Mode")] - [RefreshProperties(RefreshProperties.All)] - [Description("Column Layout")] - public FormatColumns Format_Columns - { - get - { - string s = _Xp["Format", "Columns"]; - - //If there is no value to get, then get the parent value (a.k.a. default value). - if (s == string.Empty) - s = _Xp.ParentValue("Format", "Columns"); // get the parent value - // If there is no parent value, then use the volian default - if (s == string.Empty) - return FormatColumns.TwoColumn;// At the procedure level, default to Two column - - return (FormatColumns)int.Parse(s); - } - set - { - // if value being saved is same as the parent value, then clear the value (save blank). This will - // reset the data to use the parent value. - - string parval = _Xp.ParentValue("Format", "Columns"); // get the parent value - - if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default - parval = ((int)(FormatColumns.Default)).ToString(); - - if (parval.Equals(((int)value).ToString())) - _Xp["Format", "Columns"] = string.Empty; // reset to parent value - else - _Xp["Format", "Columns"] = ((int)value).ToString(); // save selected value - - OnPropertyChanged("Format_Columns"); - } - } - [Category("Format")] - //PROPGRID: Hide Plant Format Name (using Format and Default Format) - [Browsable(false)] - [DisplayName("Plant Format Name")] - [RefreshProperties(RefreshProperties.All)] - [Description("Default Plant Format")] - public string Format_Plant - { - get - { - return _Xp["format", "plant"]; - } - set - { - _Xp["format", "plant"] = value; - OnPropertyChanged("Format_Plant"); - } - } - #endregion - #region PrintSettingsCategory // originally from first entry in fix file and curset.dat - [Category("Print Settings")] //Note that this print setting is stored under 'Procedure' element - [Browsable(false)] - [DisplayName("Revision Number")] - [RefreshProperties(RefreshProperties.All)] - [Description("Revision Number")] - public string Print_Rev - { - get - { - string s = _Xp["Procedure", "Rev"]; - if (SelectedSlave > 0) - s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "Rev"]; - return s; - } - set - { - if (SelectedSlave > 0) - _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "Rev"] = value; // save selected value - else - _Xp["Procedure", "Rev"] = value; - OnPropertyChanged("Print_Rev"); - } - } - [Category("Print Settings")] //Note that this print setting is stored under 'Procedure' element - [Browsable(false)] - [DisplayName("Revision Date")] - [RefreshProperties(RefreshProperties.All)] - [Description("Revision Date")] - public string Print_RevDate - { - get - { - string s = _Xp["Procedure", "RevDate"]; - if (SelectedSlave > 0) - s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "RevDate"]; - return s; - } - set - { - if (SelectedSlave > 0) - _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "RevDate"] = value; // save selected value - else - _Xp["Procedure", "RevDate"] = value; - OnPropertyChanged("Print_RevDate"); - } - } - [Category("Print Settings")] //Note that this print setting is stored under 'Procedure' element - [Browsable(false)] - [DisplayName("Review Date")] - [RefreshProperties(RefreshProperties.All)] - [Description("Review Date")] - public string Print_ReviewDate - { - get - { - string s = _Xp["Procedure", "ReviewDate"]; - if (SelectedSlave > 0) - s = _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "ReviewDate"]; - return s; - } - set - { - if (SelectedSlave > 0) - _Xp["Slave[@index='" + SelectedSlave.ToString() + "']", "ReviewDate"] = value; // save selected value - else - _Xp["Procedure", "ReviewDate"] = value; - OnPropertyChanged("Print_ReviewDate"); - } - } - [Category("Print Settings")] - //PROPGRID: Hide Number of Copies - [Browsable(false)] - [DisplayName("Number of Copies")] - [RefreshProperties(RefreshProperties.All)] - [Description("Number of Copies")] - public int Print_NumCopies - { - get - { - string s = _Xp["PrintSettings", "numcopies"]; - if (s == string.Empty) return 1; - return int.Parse(_Xp["PrintSettings", "numcopies"]); - } - set - { - _Xp["PrintSettings", "numcopies"] = value.ToString(); - OnPropertyChanged("Print_NumCopies"); - } - } - //public enum PrintPagination : int - //{ - // Free = 0, Fixed, - // [Description("Automatic")] - // Auto - //} - [Category("Print Settings")] - [DisplayName("Pagination")] - [RefreshProperties(RefreshProperties.All)] - [Description("Pagination")] - public PrintPagination Print_Pagination - { - get - { - - string s = _Xp["PrintSettings", "Pagination"]; - //If there is no value to get, then get the parent value (a.k.a. default value). - if (s == string.Empty) - s = _Xp.ParentValue("PrintSettings", "Pagination"); // get the parent value - // If there is no parent value, then use the volian default - if (s == string.Empty) - return PrintPagination.Auto;// default to volian default - - return (PrintPagination)int.Parse(s); - } - set - { - // if value being saved is same as the parent value, then clear the value (save blank). This will - // reset the data to use the parent value. - - string parval = _Xp.ParentValue("PrintSettings", "Pagination"); // get the parent value - - if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default - parval = ((int)(PrintPagination.Auto)).ToString(); - - if (parval.Equals(((int)value).ToString())) - _Xp["PrintSettings", "Pagination"] = string.Empty; // reset to parent value - else - _Xp["PrintSettings", "Pagination"] = ((int)value).ToString(); // save selected value - - OnPropertyChanged("Print_Pagination"); - } - } - //[TypeConverter(typeof(EnumDescConverter))] - //public enum PrintWatermark : int - //{ - // None = 0, Reference, Draft, Master, Sample, - // [Description("Information Only")] - // InformationOnly - //} - [Category("Print Settings")] - [DisplayName("Watermark")] - [RefreshProperties(RefreshProperties.All)] - [Description("Watermark")] - public PrintWatermark Print_Watermark - { - get - { - string s = _Xp["PrintSettings", "Watermark"]; - - //If there is no value to get, then get the parent value (a.k.a. default value). - if (s == string.Empty) - s = _Xp.ParentValue("PrintSettings", "Watermark"); // get the parent value - // If there is no parent value, then use the volian default - if (s == string.Empty) - return PrintWatermark.Draft;// default to volian default - - return (PrintWatermark)int.Parse(s); - } - set - { - // if value being saved is same as the parent value, then clear the value (save blank). This will - // reset the data to use the parent value. - - string parval = _Xp.ParentValue("PrintSettings", "Watermark"); // get the parent value - - if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default - parval = ((int)(PrintWatermark.Draft)).ToString(); - - if (parval.Equals(((int)value).ToString())) - _Xp["PrintSettings", "Watermark"] = string.Empty; // reset to parent value - else - _Xp["PrintSettings", "Watermark"] = ((int)value).ToString(); // save selected value - - OnPropertyChanged("Print_Watermark"); - } - } - [Category("Print Settings")] - [DisplayName("Disable Automatic Duplexing")] - [RefreshProperties(RefreshProperties.All)] - [Description("Disable Duplex Printing")] - public bool Print_DisableDuplex - { - get - { - string s = _Xp["PrintSettings", "disableduplex"]; - - //If there is no value to get, then get the parent value (a.k.a. default value). - if (s == string.Empty) - s = _Xp.ParentValue("PrintSettings", "disableduplex"); // get the parent value - // If there is no parent value, then use the volian default - if (s == string.Empty) - s = "false";// default to volian default - - return bool.Parse(s); - } - set - { - // if value being saved is same as the parent value, then clear the value (save blank). This will - // reset the data to use the parent value. - - string parval = _Xp.ParentValue("PrintSettings", "disableduplex"); // get the parent value - - if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default - parval = "false"; - - if (parval.Equals(value.ToString())) - _Xp["PrintSettings", "disableduplex"] = string.Empty; // reset to parent value - else - _Xp["PrintSettings", "disableduplex"] = value.ToString(); // save selected value - - OnPropertyChanged("Print_DisableDuplex"); - } - } - // Change Bar Use from 16-bit code: - // No Default - // Without Change Bars - // With Default Change Bars - // With User Specified Change Bars - //[TypeConverter(typeof(EnumDescConverter))] - //public enum PrintChangeBar : int - //{ - // [Description("Select Before Printing")] - // SelectBeforePrinting = 0, - // [Description("Without Change Bars")] - // Without, - // [Description("With Default Change Bars")] - // WithDefault, - // [Description("Use Custom Change Bars")] - // WithUserSpecified - //} - [Category("Format Settings")] - [DisplayName("Change Bar")] - [RefreshProperties(RefreshProperties.All)] - [Description("Change Bar Use")] - public PrintChangeBar Print_ChangeBar - { - get - { - string s = _Xp["PrintSettings", "ChangeBar"]; - - //If there is no value to get, then get the parent value (a.k.a. default value). - if (s == string.Empty) - s = _Xp.ParentValue("PrintSettings", "ChangeBar"); // get the parent value - // If there is no parent value, then use the volian default - if (s == string.Empty) - return PrintChangeBar.SelectBeforePrinting;// default to volian default - - return (PrintChangeBar)int.Parse(s); - } - set - { - // if value being saved is same as the parent value, then clear the value (save blank). This will - // reset the data to use the parent value. - - string parval = _Xp.ParentValue("PrintSettings", "ChangeBar"); // get the parent value - - if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default - parval = ((int)(PrintChangeBar.SelectBeforePrinting)).ToString(); - - if (parval.Equals(((int)value).ToString())) - _Xp["PrintSettings", "ChangeBar"] = string.Empty; // reset to parent value - else - _Xp["PrintSettings", "ChangeBar"] = ((int)value).ToString(); // save selected value - - OnPropertyChanged("Print_ChangeBar"); - } - } - // User Specified Change Bar Location from16-bit code: - // With Text - // Outside Box - // AER on LEFT, RNO on Right - // To the Left of Text - //[TypeConverter(typeof(EnumDescConverter))] - //public enum PrintChangeBarLoc : int - //{ - // [Description("With Text")] - // WithText = 0, - // [Description("Outside Box")] - // OutsideBox, - // [Description("AER on Left RNO on Right")] - // AERleftRNOright, - // [Description("To the Left of the Text")] - // LeftOfText - //} - [Category("Format Settings")] - [DisplayName("Change Bar Position")] - [RefreshProperties(RefreshProperties.All)] - [Description("User Specified Change Bar Location")] - public PrintChangeBarLoc Print_ChangeBarLoc - { - get - { - string s = _Xp["PrintSettings", "ChangeBarLoc"]; - - //If there is no value to get, then get the parent value (a.k.a. default value). - if (s == string.Empty) - s = _Xp.ParentValue("PrintSettings", "ChangeBarLoc"); // get the parent value - // If there is no parent value, then use the volian default - if (s == string.Empty) - return PrintChangeBarLoc.WithText;// default to volian default - - return (PrintChangeBarLoc)int.Parse(s); - } - set - { - // if value being saved is same as the parent value, then clear the value (save blank). This will - // reset the data to use the parent value. - - string parval = _Xp.ParentValue("PrintSettings", "ChangeBarLoc"); // get the parent value - - if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default - parval = ((int)(PrintChangeBarLoc.WithText)).ToString(); - - if (parval.Equals(((int)value).ToString())) - _Xp["PrintSettings", "ChangeBarLoc"] = string.Empty; // reset to parent value - else - _Xp["PrintSettings", "ChangeBarLoc"] = ((int)value).ToString(); // save selected value - - OnPropertyChanged("Print_ChangeBarLoc"); - } - } - - // Change Bar Text from16-bit code: - // Date and Change ID - // Revision Number - // Change ID - // No Change Bar Message - // User Defined Message - //[TypeConverter(typeof(EnumDescConverter))] - //public enum PrintChangeBarText : int - //{ - // [Description("Date and Change ID")] - // DateChgID = 0, - // [Description("Revision Number")] - // RevNum, - // [Description("Change ID")] - // ChgID, - // [Description("No Change Bar Text")] - // None, - // [Description("Custom Change Bar Text")] - // UserDef - //} - [Category("Format Settings")] - [DisplayName("Change Bar Text Type")] - [RefreshProperties(RefreshProperties.All)] - [Description("Change Bar Text")] - public PrintChangeBarText Print_ChangeBarText - { - get - { - string s = _Xp["PrintSettings", "ChangeBarText"]; - - //If there is no value to get, then get the parent value (a.k.a. default value). - if (s == string.Empty) - s = _Xp.ParentValue("PrintSettings", "ChangeBarText"); // get the parent value - // If there is no parent value, then use the volian default - if (s == string.Empty) - return PrintChangeBarText.DateChgID;// default to volian default - - return (PrintChangeBarText)int.Parse(s); - } - set - { - // if value being saved is same as the parent value, then clear the value (save blank). This will - // reset the data to use the parent value. - - string parval = _Xp.ParentValue("PrintSettings", "ChangeBarText"); // get the parent value - - if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default - parval = ((int)(PrintChangeBarText.DateChgID)).ToString(); - - if (parval.Equals(((int)value).ToString())) - _Xp["PrintSettings", "ChangeBarText"] = string.Empty; // reset to parent value - else - _Xp["PrintSettings", "ChangeBarText"] = ((int)value).ToString(); // save selected value - - OnPropertyChanged("Print_ChangeBarText"); - } - } - - [Category("Print Settings")] - //PROPGRID: Hide User Format - [Browsable(false)] - [DisplayName("User Format")] - [RefreshProperties(RefreshProperties.All)] - [Description("User Format")] - public string Print_UserFormat - { - get - { - return _Xp["PrintSettings", "userformat"]; - } - set - { - _Xp["PrintSettings", "userformat"] = value; - OnPropertyChanged("Print_UserFormat"); - } - } - - [Category("Format Settings")] - [DisplayName("Custom Change Bar Message Line One")] - [RefreshProperties(RefreshProperties.All)] - [Description("User Change Bar Message1")] - public string Print_UserCBMess1 - { - get - { - string s = _Xp["PrintSettings", "usercbmess1"];// get the saved value - - //If there is no value to get, then get the parent value (a.k.a. default value). - if (s == string.Empty) - s = _Xp.ParentValue("PrintSettings", "usercbmess1"); // get the parent value - // If there is no parent value, then use the volian default - if (s == string.Empty) - s = "";// default to volian default - - return s; - } - set - { - // if value being saved is same as the parent value, then clear the value (save blank). This will - // reset the data to use the parent value. - - string parval = _Xp.ParentValue("PrintSettings", "usercbmess1"); // get the parent value - - if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default - parval = ""; - - if (parval.Equals(value)) - _Xp["PrintSettings", "usercbmess1"] = string.Empty; // reset to parent value - else - _Xp["PrintSettings", "usercbmess1"] = value; // save selected value - - OnPropertyChanged("Print_UserCBMess1"); - } - } - - [Category("Format Settings")] - [DisplayName("Custom Change Bar Message Line Two")] - [RefreshProperties(RefreshProperties.All)] - [Description("User Change Bar Message2")] - public string Print_UserCBMess2 - { - get - { - string s = _Xp["PrintSettings", "usercbmess2"];// get the saved value - - //If there is no value to get, then get the parent value (a.k.a. default value). - if (s == string.Empty) - s = _Xp.ParentValue("PrintSettings", "usercbmess2"); // get the parent value - // If there is no parent value, then use the volian default - if (s == string.Empty) - s = "";// default to volian default - - return s; - } - set - { - // if value being saved is same as the parent value, then clear the value (save blank). This will - // reset the data to use the parent value. - - string parval = _Xp.ParentValue("PrintSettings", "usercbmess2"); // get the parent value - - if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default - parval = ""; - - if (parval.Equals(value)) - _Xp["PrintSettings", "usercbmess2"] = string.Empty; // reset to parent value - else - _Xp["PrintSettings", "usercbmess2"] = value; // save selected value - - OnPropertyChanged("Print_UserCBMess2"); - } - } - - // the following is for internal use only: - [Browsable(false)] - public string SectionStart - { - get - { - return _Xp["Procedure", "SectionStart"]; - } - set - { - _Xp["Procedure", "SectionStart"] = value; - OnPropertyChanged("Proceduret_SectionStart"); - } - } - #endregion - - #region IItemConfig Members - - [Category("Master/Slave Settings")] - [DisplayName("Applicability")] - [RefreshProperties(RefreshProperties.All)] - [Description("Scope Applicability")] - public Volian.Base.Library.BigNum MasterSlave_Applicability - { - get - { - string s = _Xp["MasterSlave", "Applicability"]; - return new Volian.Base.Library.BigNum(s); - } - set - { - _Xp["MasterSlave", "Applicability"] = value.FlagList; - OnPropertyChanged("MasterSlave_Applicability"); - } - } - - #endregion - } - public interface IItemConfig - { - Volian.Base.Library.BigNum MasterSlave_Applicability { get; set;} - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup MultiValRO.csx b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup MultiValRO.csx deleted file mode 100644 index ed9d2fe3..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup MultiValRO.csx +++ /dev/null @@ -1,1115 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.ComponentModel; -using System.Text.RegularExpressions; -using System.IO; - -namespace VEPROMS.CSLA.Library -{ - [Serializable] - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ROFSTLookup - { - #region Log4Net - private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Structs - [Serializable] - public struct roHdr - { - public int hSize; - public int hYear; - public byte hMonth; - public byte hDay; - public int hcYear; - public byte hcMonth; - public byte hcDay; - public byte hcHour; - public byte hcMin; - public byte hcSec; - public byte hcHund; - public rodbi[] myDbs; - }; - [Serializable] - public struct rodbi - { - public int dbiID; - public int dbiType; - public int dbiAW; - public string dbiTitle; - public string dbiAP; - public int ID; - public int ParentID; - public rochild[] children; - }; - public struct rogrp - { - public int ID; - public int ParentID; - public rochild[] children; - public string value; - public string appid; - }; - public struct rochild - { - public int ID; - public int ParentID; - public int type; - public string title; - public string roid; - public string appid; - public string value; - public rochild[] children; - }; - public class roChild - { - rochild _MyChild; - public rochild MyChild - { - get { return _MyChild; } - set { _MyChild = value; } - } - public roChild(rochild myChild) - { - _MyChild = myChild; - } - public override string ToString() - { - return _MyChild.title; - } - }; - #endregion - #region Local Data - private string _ROValue = ""; - private List lstRoValues; - private List lstRoValuesMulti; - private Dictionary DictROVar = new Dictionary(); - #endregion - #region Constructors - private ROFst _ROFst; - private ROFstInfo _ROFstInfo; - private int _SelectedSlave; - - private DocVersionInfo _DocVersionInfo; - - public DocVersionInfo DocVersionInfo - { - get { return _DocVersionInfo; } - set - { - _DocVersionInfo = value; - if (_DocVersionInfo.DocVersionConfig.SelectedSlave != _SelectedSlave) - { - _SelectedSlave = _DocVersionInfo.DocVersionConfig.SelectedSlave; - Reset(); - } - } - } - public ROFSTLookup(ROFst rofst) - { - _ROFst = rofst; - _ROFstInfo = null; - using (ROFstInfo rfi = ROFstInfo.GetJustROFst(_ROFst.ROFstID)) - { - _DocVersionInfo = rfi.docVer;//==null?null: DocVersionInfo.Get(rfi.docVer.VersionID); - } - ParseIntoDictionary(rofst.ROLookup); - } - public ROFSTLookup(ROFstInfo rofstinfo) - { - _ROFstInfo = rofstinfo; - _ROFst = null; - // docversion will be null if we're working with an ro.fst that is not currently connected - // to a docversion. One example of this is when updating ro.fst and comparing the original - // with the new to find differences. The docversioninfo is only used to get unit/master - // slave info, thus is not needed to compare the raw values. - _DocVersionInfo = _ROFstInfo.docVer;//==null?null: DocVersionInfo.Get(_ROFstInfo.docVer.VersionID); - ParseIntoDictionary(rofstinfo.ROLookup); - } - public ROFSTLookup(string filePath) - { - _ROFstInfo = null; - _ROFst = null; - _DocVersionInfo = null; - FileInfo rofstFile = new FileInfo(filePath); - FileStream fs = rofstFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - byte[] buf = new byte[rofstFile.Length]; - fs.Read(buf, 0, buf.Length); - fs.Close(); - ParseIntoDictionary(buf); - } - #endregion - #region PropertiesAndData - public roHdr myHdr; - private int TableID; - private Dictionary dicRos; - private Dictionary dicRosIntIDs; - public void Reset() - { - dicRos = null; - dicRosIntIDs = null; - } - #endregion - #region AppSupport - public void Close() - { - // remove the dictionary - if (dicRosIntIDs != null)dicRosIntIDs.Clear(); - dicRosIntIDs = null; - if (dicRos != null)dicRos.Clear(); - dicRos = null; - } - public List GetValueDifferences(ROFSTLookup origROFst, ref List delList) - { - // use this list to see what differences are between it and the original - List modList = new List(); - // assume each rofstlookup has a parsed dictionary - foreach (string key in origROFst.dicRos.Keys) - { - string cvalue = null; - string ovalue = origROFst.dicRos[key].value; - if (dicRos.ContainsKey(key)) - cvalue = dicRos[key].value; - if (cvalue == null && cvalue != ovalue) - delList.Add(key); - else if (cvalue != ovalue) - { - // Value Change - modList.Add(key); - //Console.WriteLine("RO{0}\t\"{1}\"\t\"{2}\"", key, cvalue, ovalue); - } - } - return modList; - } - //public static ROImageInfo Get(RODbInfo rodbinfo, string filename) - //{ - // if (rodbinfo.RODbROImageCount != 0) - // { - // foreach (ROImageInfo ri in rodbinfo.RODbROImages) - // { - // if (ri.FileName == filename) return ri; - // } - // } - // return null; - //} - - public string GetTranslatedRoValue(string ROID16, bool DoCaret) - { - string retval = GetRoValue(ROID16); - retval = ReplaceUnicode(retval, DoCaret); - retval = ConvertFortranFormatToScienctificNotation(retval); - return retval.Replace("\r\n", @"\par "); - } - private string ReplaceUnicode(string s2, bool DoCaret) - { - string orig = s2; - s2 = s2.Replace("`", @"\'b0"); // convert backquote to degree - left over from DOS days. - s2 = s2.Replace("\xa0", @"\u160?"); // hardspace - s2 = s2.Replace("\xb0", @"\'b0"); // degree - s2 = s2.Replace("\x7f", @"\u916?"); // delta - s2 = s2.Replace("\x2265", @"\u8805?"); // greater than or equal - s2 = s2.Replace("\x2264", @"\u8804?"); // less than or equal - s2 = s2.Replace("\xB1", @"\'b1"); // plus minus - s2 = s2.Replace("\x3A3", @"\u931?"); // sigma - s2 = s2.Replace("\x3C4", @"\u947?"); // gamma - s2 = s2.Replace("\xBD", @"\'bd"); // half - s2 = s2.Replace("\x25A0", @"\u9604?"); // accum 2584 - s2 = s2.Replace("\x7", @"\u9679?"); // bullet 25CF - s2 = s2.Replace("\x2248", @"\u8776?"); // approx eq - s2 = s2.Replace("\x2261", @"\u8773?"); // similar eq 2245 - s2 = s2.Replace("\xF7", @"\'f7"); // division - s2 = s2.Replace("\x221A", @"\u8730?"); // square root - s2 = s2.Replace("\x393", @"\u961?"); // rho 3C1 - s2 = s2.Replace("\x3C0", @"\u960?"); // pi - s2 = s2.Replace("\xb5", @"\u956?"); // micro 3BC (try e6, if not work try 109) - s2 = s2.Replace("\x3B4", @"\u948?"); // lower case delta - s2 = s2.Replace("\x3C3", @"\u963?"); // lower case sigma - s2 = s2.Replace("\xBC", @"\'bc"); // quarter - s2 = s2.Replace("\x3C6", @"\'d8"); // dist zero, D8 - s2 = s2.Replace("\xC9", @"\u274?"); // energy, 112 - s2 = s2.Replace("\xEC", @"\'ec"); // grave - s2 = s2.Replace("\x2502", @"\u9474?"); // bar - s2 = s2.Replace("\x3B5", @"\u949?"); // epsilon - s2 = s2.Replace("\x398", @"\u952?"); // theta, 3B8 - s2 = s2.Replace("\x221E", @"\u8857?"); // dot in oval, 2299 - s2 = s2.Replace("\xBF", @"\u964?"); // tau, 3C4 - s2 = s2.Replace("\x2310", @"\u9830?"); // diamond, 2666 - s2 = s2.Replace("\x2192", @"\u8594?"); - s2 = s2.Replace("\x2190", @"\u8592?"); - s2 = s2.Replace("\x2191", @"\u8593?"); - s2 = s2.Replace("\x2193", @"\u8595?"); - s2 = s2.Replace("\x2207", @"\u8711?"); - s2 = s2.Replace("\x2591", @"\'b0"); // Degree Symbol - s2 = s2.Replace("\xFF", @"\u8593?"); // Up Arrow - s2 = s2.Replace("\xD6", @"\u8595?"); // Down Arrow - - if (DoCaret) s2 = s2.Replace("^", @"\u916?"); - // Convert dash to a non-breaking dash. This is a unicode character. - // This character will be used in veproms rather than a dash. - //if the dash is preceeded byte a token remove the space following the token - s2 = Regex.Replace(s2, @"(\\[^ \\?]*) \-", @"$1\u8209?"); - s2 = s2.Replace("-", @"\u8209?"); - return s2; - } - // this only gets rochild values. Later we may want another - // dictionary to get groups. - public string GetRoValue(string ROID16) - { - string ROID = ROID16.Substring(0,12); - if (dicRos == null) ParseIntoDictionary(_ROFst!=null?_ROFst.ROLookup:_ROFstInfo.ROLookup); - // Use the ROID to get the value from the dictionary - if (dicRos.ContainsKey(ROID.ToUpper())) - { - rochild rochld = (rochild)dicRos[ROID.ToUpper()]; - if (rochld.value != null && rochld.value != string.Empty) - return rochld.value; - if (rochld.children != null) - { - foreach (rochild child in rochld.children) - if (child.roid.ToUpper() == ROID16 || (child.roid.EndsWith("0041") && ROID16.EndsWith("0000"))) - return child.value; - // if there isn't a specific match for multi-return values, default to the first child. - return rochld.children[0].value; - } - } - //if (ROID == "FFFF00000001") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Unit_Number; - //if (ROID == "FFFF00000002") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Other_Unit_Number; - //if (ROID == "FFFF00000003") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Unit_Text; - //if (ROID == "FFFF00000004") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Other_Unit_Text; - //if (ROID == "FFFF00000005") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Unit_ID; - //if (ROID == "FFFF00000006") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Other_Unit_ID; - //if (ROID == "FFFF00000007") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Unit_Name; - //if (ROID == "FFFF00000008") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Other_Unit_Name; - //new stuff - if (ROID == "FFFF00000001") return _ROFstInfo.docVer.DocVersionConfig.Unit_Number; - if (ROID == "FFFF00000002") return _ROFstInfo.docVer.DocVersionConfig.Other_Unit_Number; - if (ROID == "FFFF00000003") return _ROFstInfo.docVer.DocVersionConfig.Unit_Text; - if (ROID == "FFFF00000004") return _ROFstInfo.docVer.DocVersionConfig.Other_Unit_Text; - if (ROID == "FFFF00000005") return _ROFstInfo.docVer.DocVersionConfig.Unit_ID; - if (ROID == "FFFF00000006") return _ROFstInfo.docVer.DocVersionConfig.Other_Unit_ID; - if (ROID == "FFFF00000007") return _ROFstInfo.docVer.DocVersionConfig.Unit_Name; - if (ROID == "FFFF00000008") return _ROFstInfo.docVer.DocVersionConfig.Other_Unit_Name; - //end new stuff - if (ROID.StartsWith("FFFF")) return "?"; // string.Format("Invalid Unit RO '{0}'", ROID); - return "?"; // string.Format("Invalid RO '{0}'", ROID); - } - // Get the the RO's Accessory Page ID - public string GetRoACID(string ROID16) - { - string ROID = ROID16.Substring(0,12); - if (dicRos == null) ParseIntoDictionary(_ROFst!=null?_ROFst.ROLookup:_ROFstInfo.ROLookup); - // Use the ROID to get the value from the dictionary - if (dicRos.ContainsKey(ROID.ToUpper())) - { - rochild rochld = (rochild)dicRos[ROID.ToUpper()]; - if (rochld.value != null && rochld.value != string.Empty) - return rochld.appid; - if (rochld.children != null) - { - foreach (rochild child in rochld.children) - if (child.roid.ToUpper() == ROID16 || (child.roid.EndsWith("0041") && ROID16.EndsWith("0000"))) - return child.appid; - // if there isn't a specific match for multi-return values, default to the first child. - return rochld.children[0].appid; - } - } - return ""; // no accessory page ID found - } - public rochild GetRoChild12(string ROID16) - { - string ROID = ROID16.Substring(0, 12); - if (dicRos == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); - // Use the ROID to get the value from the dictionary - if (dicRos.ContainsKey(ROID.ToUpper())) - { - rochild rochld = (rochild)dicRos[ROID.ToUpper()]; - return rochld; - } - rochild tmp = new rochild(); - tmp.ID = -1; - return tmp; - } - public rochild GetRoChild(string ROID) - { - if (dicRos == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); - // Use the ROID to get the value from the dictionary - if (dicRos.ContainsKey(ROID.ToUpper())) - { - rochild rochld = (rochild)dicRos[ROID.ToUpper()]; - return rochld; - } - rochild tmp = new rochild(); - tmp.ID = -1; - return tmp; - } - public string GetROTitle(string ROID) - { - StringBuilder sb = new StringBuilder(); - rochild roc = GetRoChild12(ROID); - if (roc.value == null) - roc = GetRoChild(ROID); - sb.Append(roc.title.Replace(roc.appid,"").Replace(roc.value,"").Trim()); - do - { - string parent = ROID.Substring(0, 4) + string.Format("{0:X8}", roc.ParentID); - roc = GetRoChild12(parent); - if (roc.ID > 0) - sb.Insert(0, roc.title + " - "); - } while (roc.ID > 0); - return sb.ToString(); - } - // Return the RO Title in a list of strings - // The last item in the list is the actual RO title, the items preceding it are the - // titles of the groups and sub-groups containing the RO - public List GetROTitleAndGroupPath(string ROID) - { - List titlePath = new List(); - rochild roc = GetRoChild12(ROID); - //string tmp = roc.title.Replace(roc.appid, "").Replace(roc.value, "").Trim(); - string tmp = roc.title.Replace(roc.appid, string.Format("<{0}>",roc.appid)).Trim(); - titlePath.Add(tmp); - do - { - string parent = ROID.Substring(0, 4) + string.Format("{0:X8}", roc.ParentID); - roc = GetRoChild12(parent); - if (roc.ID > 0) - titlePath.Add(roc.title); - } while (roc.ID > 0); - titlePath.Reverse(); - return titlePath; - } - - // The following Method is not correct. It needs to have a RO database id as well as an id. Without that, - // the first RO with a specific id will be found regardless of the RO Database id. - //public rochild GetRoChildFromID(int id) - //{ - // if (dicRosIntIDs == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); - // // Use the id to get the value from the dictionary - // if (dicRosIntIDs.ContainsKey(id)) - // { - // rochild rochld = (rochild)dicRosIntIDs[id]; - // return rochld; - // } - // rochild tmp = new rochild(); - // tmp.ID = -1; - // return tmp; - //} - public rodbi[] GetRODatabaseList() - { - return myHdr.myDbs; - } - //public string GetDefaultROPrefix() - //{ - // if (docVer != null) - // return docVer.DocVersionConfig.RODefaults_setpointprefix; - // else - // return "SP1"; // Not Sure about this... - //} - //public string GetDefaultGraphicsPrefix() - //{ - // if (docVer != null) - // return docVer.DocVersionConfig.RODefaults_graphicsprefix; - // else - // return "IG1"; // Not Sure about this... - //} - #region Update Ro Values - /// - /// Updates an ro.fst into a sql database. - /// - /// - /// ROFst: Returns the created rofst object - //public static ROFst UpdateRoFst(RODbInfo rdi, DocVersionAssociation dva, DocVersion docver) - //{ - // // file validity checks are done before getting here - just do the import - // // here. - // string rofstfilepath = rdi.FolderPath + @"\ro.fst"; - - // DirectoryInfo di = new DirectoryInfo(rdi.FolderPath); - - // // There may be more than 1 'ro' as the 'ROName' field (ROName is derived from the ropath). - // // Get new name be incrementing, if so. - // string newname = NewROName(di.Name); - - // // Next read in the rofst & make the rofst record. - // FileStream fsIn = new FileStream(rofstfilepath, FileMode.Open, FileAccess.Read, FileShare.Read); - // // Create an instance of StreamReader that can read characters from the FileStream. - // BinaryReader r = new BinaryReader(fsIn); - // byte[] ab = r.ReadBytes((int)fsIn.Length); - // fsIn.Close(); - - // using (RODb rd = RODb.Get(rdi.RODbID)) - // { - // ROFst rofst = ROFst.MakeROFst(rd, ab, null, di.LastWriteTimeUtc, rdi.UserID); - // // Hook this into the current docversion by replacing the rofstid field in the doc version - // // association object: - // dva.MyROFst = rofst; - // docver.Save(); - - // // Now load any images in... type 8 - integrated graphics ro type - // ROFstInfo rofstInfo = ROFstInfo.Get(rofst.ROFstID); - // rofstInfo.ParseIntoDictionary(rofstInfo.ROFST); - // for (int i = 0; i < rofstInfo.myHdr.myDbs.Length; i++) - // { - // // walk through the rofst 'database' searching for all nodes that are integrated graphics, type 8: - // if (rofstInfo.myHdr.myDbs[i].children != null) rofstInfo.MigrateRoFstGraphics(rdi, rofstInfo.myHdr.myDbs[i].children); - // } - // return rofst; - // } - //} - //private static string RoAppConfigExt(string fstPath) - //{ - // string inipath = fstPath + @"\roapp.ini"; - // if (!File.Exists(inipath)) return null; - // StreamReader myReader = new StreamReader(inipath); - // string sLine; - // int indx = -1; - // while ((sLine = myReader.ReadLine()) != null) - // { - // if (sLine.Length > 0 && sLine.Substring(0, 1) != ";") - // { - // if ((indx = sLine.ToLower().IndexOf("extention")) >= 0) - // { - // indx = sLine.IndexOf("=", indx + 9); - // return sLine.Substring(indx + 1, sLine.Length - indx - 1).Trim(); - // } - // } - // } - // myReader.Close(); - // return null; - //} - //private static string NewROName(string roName) - //{ - // string retval = roName; - // int iSuffix = -1; - // RODbInfoList rodblist = RODbInfoList.Get(); - - - // foreach (RODbInfo rdi in rodblist) - // { - // if (rdi.ROName.StartsWith(roName)) - // { - // if (rdi.ROName == roName) - // iSuffix = 0; - // else if (Regex.IsMatch(rdi.ROName, roName + "[_][0-9]+")) - // { - // int ii = int.Parse(rdi.ROName.Substring(1 + roName.Length)); - // if (ii > iSuffix) iSuffix = ii; - // } - // } - // } - // if (iSuffix >= 0) - // retval = string.Format("{0}_{1}", roName, iSuffix + 1); - // return retval; - //} - //private void MigrateRoFstGraphics(RODbInfo rdi, ROFstInfo.rochild[] rochild) - //{ - // for (int i = 0; i < rochild.Length; i++) - // { - // if (rochild[i].type == 8) AddGraphic(rdi, rochild[i].value); - // if (rochild[i].children != null) MigrateRoFstGraphics(rdi, rochild[i].children); - // } - //} - //private void AddGraphic(RODbInfo rdi, string p) - //{ - // if (p == null) return; - // string imgname = p.Substring(0, p.IndexOf('\n')); - // int thedot = imgname.LastIndexOf('.'); - // string fname = imgname; - // if (thedot == -1 || (thedot != (imgname.Length - 4))) - // { - // RODbConfig roDbCfg = new RODbConfig(rdi.Config); - // fname += string.Format(".{0}", roDbCfg.GetDefaultGraphicExtension()); - // } - - // string imgfile = rdi.FolderPath + @"\" + fname; - - // ROImage roImg = null; - // if (File.Exists(imgfile)) - // { - // FileInfo fi = new FileInfo(imgfile); - // // if the roimage record exists, don't create a new one... - // using (roImg = ROImage.GetByRODbID_FileName_DTS(rdi.RODbID, imgname, fi.LastWriteTimeUtc)) - // { - // if (roImg == null) - // { - // FileStream fsIn = new FileStream(imgfile, FileMode.Open, FileAccess.Read, FileShare.Read); - // BinaryReader r = new BinaryReader(fsIn); - // byte[] ab = r.ReadBytes((int)fsIn.Length); - // r.Close(); - // fsIn.Close(); - // using (RODb rodb = RODb.Get(rdi.RODbID)) - // { - // roImg = ROImage.MakeROImage(rodb, imgname, ab, null, fi.LastWriteTimeUtc, "Migration"); - // } - // } - // Figure figure = Figure.GetByROFstID_ImageID(this.ROFstID, roImg.ImageID); - // if (figure != null) return; - // using (ROFst rofst = ROFst.Get(this.ROFstID)) - // { - // figure = Figure.MakeFigure(rofst, roImg, null); - // } - // } - // } - // else - // Console.WriteLine(string.Format("{0}", imgfile), "Cannot Find Image File"); - //} - #endregion - #endregion - #region LoadStructs - private int StringLength(byte[] ab, int offset) - { - int i = 0; - while (ab[i + offset] != 0) i++; - return i; - } - private rogrp LoadGroup(byte[] ab, int offset) - { - rogrp myGrp = new rogrp(); - myGrp.ID = BitConverter.ToInt32(ab, offset); - myGrp.ParentID = BitConverter.ToInt32(ab, offset + 4); - int howmany = BitConverter.ToInt16(ab, offset + 8); - if (howmany > 0) - { - myGrp.children = new rochild[howmany]; - int myOffset = offset + 10; - for (int i = 0; i < myGrp.children.Length; i++) - { - int childOffset = BitConverter.ToInt32(ab, myOffset); - rochild tmp = new rochild(); - //tmp.offset=BitConverter.ToInt32(ab,myOffset); - tmp.type = BitConverter.ToInt16(ab, myOffset + 4); - int slen = StringLength(ab, myOffset + 6); - tmp.title = Encoding.Default.GetString(ab, myOffset + 6, slen); - myOffset += (7 + slen); - rogrp tmpg = LoadGroup(ab, childOffset); - MultipleReturnValuesInheritType(ref tmpg, tmp.type); - tmp.ID = tmpg.ID; - tmp.ParentID = tmpg.ParentID; - tmp.children = tmpg.children; - tmp.value = tmpg.value; - tmp.appid = tmpg.appid; - tmp.roid = TableID.ToString("X4") + tmp.ID.ToString("X8"); - // Add dictionary entries for children - if (tmp.children != null) - { - foreach (rochild child in tmp.children) - if (!dicRos.ContainsKey(child.roid.ToUpper())) - dicRos.Add(child.roid.ToUpper(), child); - } - dicRos.Add(tmp.roid.ToUpper(), tmp); - if (!dicRosIntIDs.ContainsKey(tmp.ID)) dicRosIntIDs.Add(tmp.ID, tmp); - int j; - for (j = i - 1; j >= 0 && tmp.ID < myGrp.children[j].ID; j--) - { - myGrp.children[j + 1] = myGrp.children[j]; - } - myGrp.children[j + 1] = tmp; - } - } - else - { - int slen = StringLength(ab, offset + 12); - //myGrp.value = Encoding.Default.GetString(ab, offset + 12, slen); - ProcessROReturnValue(ref myGrp, Encoding.Default.GetString(ab, offset + 12, slen)); - int slen2 = StringLength(ab, offset + 13 + slen); - myGrp.appid = Encoding.Default.GetString(ab, offset + 13 + slen, slen2); - } - return myGrp; - } - - /// - /// This function will take the raw RO return value and resolve any macros, conditionals, and - /// generated the return value or a list of multiple return values. - /// - /// - /// - private void ProcessROReturnValue(ref rogrp myGrp, string rawvalue) - { - if (dicRos == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); - List lstROVals = GetROReturnValue(rawvalue); - if (lstROVals.Count > 1) // mulitple return values - { - myGrp.children = new rochild[lstROVals.Count]; - for (int i = 0; i < lstROVals.Count; i++) - { - myGrp.children[i].value = lstROVals[i]; - myGrp.children[i].roid = TableID.ToString("X4") + myGrp.ID.ToString("X8") + (0x41+i).ToString("X4"); - myGrp.children[i].type = -1; // Multiple return value inherit type from parent - myGrp.children[i].title = lstROVals[i]; - } - } - else - myGrp.value = lstROVals[0]; - return; - - } - /// - /// Multiple return values need to get the type from the parent node. - /// - /// - /// - private void MultipleReturnValuesInheritType(ref rogrp myGrp, int parenttype) - { - if (myGrp.children != null) - { - for (int cnt = 0; cnt < myGrp.children.Length; cnt++) - { - if (myGrp.children[cnt].type == -1) - { - myGrp.children[cnt].type = parenttype; - myGrp.children[cnt].appid = myGrp.appid; - } - } - } - } - - private void ParseIntoDictionary(byte[] ab) - { - if (dicRos == null) dicRos = new Dictionary(); - if (dicRosIntIDs == null) dicRosIntIDs = new Dictionary(); - - myHdr.hSize = BitConverter.ToInt32(ab, 0); - myHdr.hYear = BitConverter.ToInt16(ab, 4); - myHdr.hMonth = ab[6]; - myHdr.hDay = ab[7]; - myHdr.hcYear = BitConverter.ToInt16(ab, 8); - myHdr.hcMonth = ab[10]; - myHdr.hcDay = ab[11]; - myHdr.hcHour = ab[12]; - myHdr.hcMin = ab[13]; - myHdr.hcSec = ab[14]; - myHdr.hcHund = ab[15]; - int hdrOffset = BitConverter.ToInt32(ab, 16); - int howbig = BitConverter.ToInt32(ab, hdrOffset); - int dbs = BitConverter.ToInt16(ab, hdrOffset + 4); - myHdr.myDbs = new rodbi[dbs]; - for (int i = 0; i < dbs; i++) - { - int offset = hdrOffset + 6 + (i * 30); - myHdr.myDbs[i].dbiID = BitConverter.ToInt16(ab, offset + 0); - TableID = myHdr.myDbs[i].dbiID; - myHdr.myDbs[i].dbiType = BitConverter.ToInt16(ab, offset + 2); - myHdr.myDbs[i].dbiAW = BitConverter.ToInt16(ab, offset + 4); - rogrp tmp = LoadGroup(ab, BitConverter.ToInt32(ab, offset + 6)); - myHdr.myDbs[i].ID = tmp.ID; - myHdr.myDbs[i].children = tmp.children; - int iPtr = BitConverter.ToInt32(ab, offset + 22) + hdrOffset + 6; - myHdr.myDbs[i].dbiTitle = Encoding.Default.GetString(ab, iPtr, StringLength(ab, iPtr)); - iPtr = BitConverter.ToInt32(ab, offset + 26) + hdrOffset + 6; - myHdr.myDbs[i].dbiAP = Encoding.Default.GetString(ab, iPtr, StringLength(ab, iPtr)); - } - } - #endregion - #region GetRoValues - public List GetROReturnValue(string roval) - { - lstRoValues = new List(); - lstRoValuesMulti = new List(); - DictROVar = new Dictionary(); // set up a dictionary of RO defined Variables - string tmp = ProcessRO(_DocVersionInfo==null?roval:_DocVersionInfo.ProcessDocVersionSpecificInfo(roval), false); - if (lstRoValues.Count == 0) // was not a multiple return value - lstRoValues.Add(tmp); - else - { - // DictROVar has the variables with their 'key'. Sort these and then put them in the lstRoValues in - // the order of their keys. - List tmpSortRoVar = new List(); - foreach (KeyValuePair kvp in DictROVar) - tmpSortRoVar.Add(kvp.Key + "#" + kvp.Value); - tmpSortRoVar.Sort(); - lstRoValues.Clear(); - foreach (string strRoVar in tmpSortRoVar) - lstRoValues.Add(strRoVar.Substring(strRoVar.IndexOf("#")+1)); - - // we need to order the lstRoValues by the A, B, C, D order in the DictROVar - //lstRoValues.Clear(); - //// in dictionary, find the 'lowest' variable, i.e. the value: - ////char starttmp = ((char)Convert.ToInt32(roval.Substring(12, 4), 16)); - //for (int i = 0; i < DictROVar.Count; i++) - //{ - // bool notfound = true; - // int k = 0; - // while (notfound || k < DictROVar.Count) - // { - // if (DictROVar.ContainsKey(tmp.ToString())) - // lstRoValues.Add(DictROVar[tmp]); - // } - //} - } - return lstRoValues; - } - - private string ProcessRO(string roval, bool multiRtnVal) - { - string str = roval; - string rtnstr = ""; - int l = roval.Length; - while (l > 0) - { - int ptr = NextDelimiter("{", str); - if (ptr == -1) - { // add remaining text - //add(new seText(str, l)); - rtnstr += str; - l = 0; // break out of while loop - } - else - { - int cnt = ptr; //(int)(ptr - str); - if (cnt > 0) - { // add text - //add(new seText(str, cnt)); - rtnstr += str.Substring(0, cnt); - l -= cnt; - //str = ptr; - str = str.Substring(ptr); - } - ptr = MatchingBrace(str) + 1; - cnt = ptr; //(int)(ptr - str); - bool nfnd = false; - string pbstr = ProcessBrace(str.Substring(1, cnt - 2), cnt - 2, ref nfnd, multiRtnVal); - if (nfnd) - rtnstr += str.Substring(0, cnt); - // add(new seText(str, cnt)); - else - rtnstr += pbstr; - l -= cnt; - //str = ptr; - str = str.Substring(ptr); - } - } - //rtnstr = rtnstr.Replace("`", @"\'b0"); // convert backquote to degree - left over from DOS days. - rtnstr = ProcessMacros(rtnstr); - return rtnstr; - } - - // - // 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 - // - // right now the only macro is @HSP(), where every space between the "(" and ")" will be replaced with a hardspace - // - private string ProcessMacros(string str) - { - if( str == null || str == "" ) return str; - string rtnstr = str; - int indx = -1; - while ((indx = rtnstr.ToUpper().IndexOf("@HSP("))>-1) - { - string resstr = rtnstr.Substring(0,indx); - int endHsp = rtnstr.IndexOf(")",indx); - string tmpstr = rtnstr.Substring(indx+5,endHsp-indx-5); - tmpstr = tmpstr.Replace(" ", @"\u160?"); - resstr = resstr + tmpstr; - rtnstr = resstr + rtnstr.Substring(endHsp+1); - } - return rtnstr; - } - - private string ProcessConditional(string cnd, string opt, int lencnd, int lenopt, bool multiRtnVal) - { - // equaluate condition - string stat = (_DocVersionInfo != null) ? this._DocVersionInfo.Evaluate(cnd, lencnd) : ""; - int ls = stat.Length;//strlen(stat); - if (ls == 0) - return ""; // if evaluation not defined then return an empty string - no matches can be made - // look for match - remember default - string match = null; - int matchlen = 0; - string def = null; - int deflen = 0; - while (lenopt > 0 && match == null) - { - int end = MatchingBrace(opt); - int eq = opt.IndexOf('=');// strchr(opt, '='); - int len = end + 1; //(int)((end + 1) - opt); // +1 to include the '}' - int li = eq - 1;//(int)(eq - opt) - 1; - int ld = len - li - 3;// One for '{', '=' and '}' - if (def == null || eq == 1) // (!def || eq == opt+1) - { - def = opt.Substring(eq + 1); //def=eq+1; - deflen = ld; - } - if (ls == li && opt.Substring(1).StartsWith(stat+"=")) // (stat.IndexOf(opt.Substring(1), li) > -1)) //(ls == li && !strncmp(stat, opt + 1, li)) - { - match = opt.Substring(eq + 1, ld);// match = eq + 1; - matchlen = ld; - } - opt = opt.Substring(len); //opt += len;// point to the next piece - lenopt -= len; - } - // if match process option - or process default - if (match == null) //(!match) - { - match = def.Substring(0, deflen); - matchlen = deflen; - } - return ProcessRO(match, multiRtnVal); //process(match, matchlen); - } - - private string ProcessBrace(string str, int l, ref bool nfnd, bool multiRtnVal) - { - string rtnstr = ""; - int nxt = NextDelimiter("{=", str); //nextDelimiter("{=", str, l); - if (nxt == -1) // no delimiter found - { // VarUse - //strList *found=vl->lookFor(str,l); - bool found = DictROVar.ContainsKey(str); - if (found) - rtnstr = DictROVar[str]; - //add(new seVarUse(found)); - else - nfnd = true; - } - else - { - if (str[nxt] == '{') - { // conditonal or menu - if (nxt == 0) // if (nxt == str) - { // menu - // TODO: implement Menu logic - //ml->process(str, l, vl); - //add(new seMenuUse(ml)); - //lstRoValues.Add(ProcessRO(str.Substring(0,l), true)); - ProcessMultiReturnValues(str, l); - - } - else - { // conditional - rtnstr = ProcessConditional(str, str.Substring(nxt), nxt, str.Length - nxt - 1, multiRtnVal);//processCondition(str, nxt, (int)(nxt - str), l - (int)(nxt - str)); - } - } - else - { // must be variable definiton - //vl->add(str, nxt+1, (int)(nxt-str), (l - (int)(nxt-str))-1, ml); - - // 'l' is the lenght up to the matching brace of the variable definition - string tmpval = ProcessRO(str.Substring(nxt + 1, l - nxt - 1), multiRtnVal); - if (tmpval.Equals(string.Empty)) tmpval = " "; // nothing assinged to variable - DictROVar.Add(str.Substring(0, nxt), tmpval); - if (multiRtnVal) - rtnstr = tmpval; - } - } - return rtnstr; - } - private Dictionary> _ValueLookupDictionary = null; - public List GetRosByValue(string value) - { - if (_ValueLookupDictionary == null) - BuildValueDictionary(); - if (value == string.Empty) - return null; - if(_ValueLookupDictionary.ContainsKey(value.ToUpper())) - return _ValueLookupDictionary[value.ToUpper()]; - return null; - } - private void BuildValueDictionary() - { - _ValueLookupDictionary = new Dictionary>(); - if (dicRos == null) - ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); - foreach (rochild child in dicRos.Values) - { - if (child.value != null) - { - string value = child.value.ToUpper(); - if (_ValueLookupDictionary.ContainsKey(value)) - _ValueLookupDictionary[value].Add(new roChild(child)); - else - { - List children = new List(); - children.Add(new roChild(child)); - _ValueLookupDictionary.Add(value, children); - } - } - } - } - private Dictionary _dicROAPID = null; - public rochild? GetROChildByAccPageID(string accPageID, string spDefault, string igDefault) - { - rochild? child = GetRoChildByAccPagID(accPageID, spDefault, igDefault); - if (child == null) - { - if(Regex.IsMatch(accPageID, @".*\.[A-Z]")) - { - string accpage = accPageID.Substring(0, accPageID.Length - 3); - int index = accPageID.Substring(accPageID.Length - 2, 1)[0] - 'A'; - child = GetRoChildByAccPagID(accpage, spDefault, igDefault); - if (child == null) return null; - if (((rochild)child).children != null && ((rochild)child).children.Length > 0 && ((rochild)child).children.Length > index) - return ((rochild)child).children[index]; - } - return null; - } - if (((rochild)child).children != null && ((rochild)child).children.Length > 0) - return ((rochild)child).children[0]; - return (rochild)child; - } - public string GetROValueByAccPagID(string accPageID, string spDefault, string igDefault) - { - rochild? child = GetROChildByAccPageID(accPageID, spDefault, igDefault); - if (child == null) return null; - return ((rochild)child).value; - } - public int? GetROTypeByAccPagID(string accPageID, string spDefault, string igDefault) - { - rochild? child = GetROChildByAccPageID(accPageID, spDefault, igDefault); - if (child == null) return null; - return ((rochild)child).type; - } - public string GetROIDByAccPagID(string accPageID, string spDefault, string igDefault) - { - rochild? child = GetROChildByAccPageID(accPageID, spDefault, igDefault); - if (child == null) return null; - return ((rochild)child).roid; - } - public rochild? GetRoChildByAccPagID(string accPageID, string spDefault, string igDefault) - { - if (_dicROAPID == null) - BuildROAPIDDictionary(); - accPageID = accPageID.Replace("".ToCharArray()); // String < and > - if (_dicROAPID.ContainsKey(accPageID)) - return _dicROAPID[accPageID]; - return null; - } - private void BuildROAPIDDictionary() - { - if (dicRos == null) - ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); - _dicROAPID = new Dictionary(); - foreach (rodbi dbi in myHdr.myDbs) - { - if (dbi.children != null) - BuildROAPIDDictionary(dbi.dbiAP, dbi.children); - } - } - private void BuildROAPIDDictionary(string prefix, rochild[] children) - { - foreach (rochild child in children) - { - if (child.appid != null && child.appid != "" && child.ID != 0) - { - string key = string.Format("{0}-{1}", prefix, child.appid); - if (!_dicROAPID.ContainsKey(key)) - _dicROAPID.Add(key, child); - } - if (child.children != null) - BuildROAPIDDictionary(prefix, child.children); - } - } - private void ProcessMultiReturnValues(string str, int len) - { - string tstr = str.Substring(0, len); - while (tstr.Length > 0) - { - int idx = MatchingBrace(tstr); - string tmpro = ProcessRO(tstr.Substring(0, idx + 1), true); - lstRoValues.Add(tmpro); - tstr = tstr.Substring(idx + 1); - } - } - - - private int MatchingBrace(string str) - { - int level = 1; - int idx = 0; // the while will skip the first position (the first brace) - while (level > 0 && idx++ < str.Length) - { - switch (str[idx]) - { - case '{': - level++; - break; - case '}': - level--; - break; - } - } - if (level != 0) - idx = -1; // didn't find matching brace - - return idx; //length including end brace - } - - private int NextDelimiter(string delim, string str) - { - int idx; - idx = str.IndexOfAny(delim.ToCharArray()); - return idx; - } - public List GetRoChildrenByType(int type) - { - List children = new List(); - AddRoChildByType(children, type); - return children; - } - private void AddRoChildByType(List children, int type) - { - foreach (rodbi dbi in myHdr.myDbs) - { - if (dbi.children != null) - AddRoChildByType(dbi.children,children,type); - } - } - private void AddRoChildByType(rochild[] roChildren, List children, int type) - { - foreach (rochild child in roChildren) - { - if (child.type == type && child.value != null) - children.Add(child); - if (child.children != null) - AddRoChildByType(child.children,children,type); - } - } - #endregion - #region FortranFormat - public static string ConvertFortranFormatToScienctificNotation(string str) - { - // ([+-]?|\\u8209\?) either an optional single character Plus (+) or Minus (-) or non-breaking dash (\u8209?) - // ([0-9]+) a group of at least one digits - // [.] a decimal point - // ([0-9]*?) a group of zero or more digits - // 0*E optional zeros (spare zeros) followed - // ([+-]?|\\u8209\?) either an optional single character Plus (+) or Minus (-) or non-breaking dash (\u8209?) - // ([0-9]+) a group of at least one digits - string retval = Regex.Replace(str, @"([+-]?|\\u8209\?)([0-9]+)[.]([0-9]*?)0*E([+-]?|\\u8209\?)([0-9]+)", new MatchEvaluator(FixFortranNumber)); - // don't convert # and ~ to super/subscripts, this is a DOS holdout and is done only for non-procedure step sections - //retval = Regex.Replace(retval, "[#](.*?)[#]", "\\up2 $1\\up0 ");// DOS Superscript - //retval = Regex.Replace(retval, "[~](.*?)[~]", "\\dn2 $1\\up0 ");// DOS Subscript - return retval; - } - private static string FixFortranNumber(Match match) - { - StringBuilder sb = new StringBuilder(match.Groups[1].Value.Replace("-",@"\u8209?")); - if (match.Groups[3].Length == 0) // Nothing to the right of the decimal - if (match.Groups[2].Value != "1") // Other than "1", multiply it times 10 raised to a power - sb.Append(match.Groups[2].Value + "x10"); - else // The number is simply 1 so it can be ignored and 10 can be raised to a power - sb.Append("10"); - else // A number with a decimal point - sb.Append(match.Groups[2].Value + "." + match.Groups[3].Value + "x10"); - // Add the exponent as superscript - return sb.ToString() + "\\up2 " + match.Groups[4].Value.Replace("-",@"\u8209?") + match.Groups[5].Value + "\\up0 "; - } - #endregion - } - [Flags] - public enum E_ROValueType : uint - { - All = 0, - Text = 1, - Table = 2, - Graph = 4, - Image = 8, - Video = 16, - Hologram = 32 - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs.bak b/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs.bak deleted file mode 100644 index e454de1c..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Config/ROFSTLookup.cs.bak +++ /dev/null @@ -1,1156 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.ComponentModel; -using System.Text.RegularExpressions; -using System.IO; - -namespace VEPROMS.CSLA.Library -{ - [Serializable] - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ROFSTLookup - { - #region Log4Net - private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Structs - [Serializable] - public struct roHdr - { - public int hSize; - public int hYear; - public byte hMonth; - public byte hDay; - public int hcYear; - public byte hcMonth; - public byte hcDay; - public byte hcHour; - public byte hcMin; - public byte hcSec; - public byte hcHund; - public rodbi[] myDbs; - }; - [Serializable] - public struct rodbi - { - public int dbiID; - public int dbiType; - public int dbiAW; - public string dbiTitle; - public string dbiAP; - public int ID; - public int ParentID; - public rochild[] children; - }; - public struct rogrp - { - public int ID; - public int ParentID; - public rochild[] children; - public string value; - public string appid; - }; - public struct rochild - { - public int ID; - public int ParentID; - public int type; - public string title; - public string roid; - public string appid; - public string value; - public rochild[] children; - }; - public class roChild - { - rochild _MyChild; - public rochild MyChild - { - get { return _MyChild; } - set { _MyChild = value; } - } - public roChild(rochild myChild) - { - _MyChild = myChild; - } - public override string ToString() - { - return _MyChild.title; - } - }; - #endregion - #region Local Data - private string _ROValue = ""; - private List lstRoValues; - private List multiRoValues; - private Dictionary DictROVar = new Dictionary(); - #endregion - #region Constructors - private ROFst _ROFst; - private ROFstInfo _ROFstInfo; - private int _SelectedSlave; - - private DocVersionInfo _DocVersionInfo; - - public DocVersionInfo DocVersionInfo - { - get { return _DocVersionInfo; } - set - { - _DocVersionInfo = value; - if (_DocVersionInfo.DocVersionConfig.SelectedSlave != _SelectedSlave) - { - _SelectedSlave = _DocVersionInfo.DocVersionConfig.SelectedSlave; - Reset(); - } - } - } - public ROFSTLookup(ROFst rofst) - { - _ROFst = rofst; - _ROFstInfo = null; - using (ROFstInfo rfi = ROFstInfo.GetJustROFst(_ROFst.ROFstID)) - { - _DocVersionInfo = rfi.docVer;//==null?null: DocVersionInfo.Get(rfi.docVer.VersionID); - } - ParseIntoDictionary(rofst.ROLookup); - } - public ROFSTLookup(ROFstInfo rofstinfo) - { - _ROFstInfo = rofstinfo; - _ROFst = null; - // docversion will be null if we're working with an ro.fst that is not currently connected - // to a docversion. One example of this is when updating ro.fst and comparing the original - // with the new to find differences. The docversioninfo is only used to get unit/master - // slave info, thus is not needed to compare the raw values. - _DocVersionInfo = _ROFstInfo.docVer;//==null?null: DocVersionInfo.Get(_ROFstInfo.docVer.VersionID); - ParseIntoDictionary(rofstinfo.ROLookup); - } - public ROFSTLookup(string filePath) - { - _ROFstInfo = null; - _ROFst = null; - _DocVersionInfo = null; - FileInfo rofstFile = new FileInfo(filePath); - FileStream fs = rofstFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - byte[] buf = new byte[rofstFile.Length]; - fs.Read(buf, 0, buf.Length); - fs.Close(); - ParseIntoDictionary(buf); - } - #endregion - #region PropertiesAndData - public roHdr myHdr; - private int TableID; - private Dictionary dicRos; - private Dictionary dicRosIntIDs; - public void Reset() - { - dicRos = null; - dicRosIntIDs = null; - } - #endregion - #region AppSupport - public void Close() - { - // remove the dictionary - if (dicRosIntIDs != null)dicRosIntIDs.Clear(); - dicRosIntIDs = null; - if (dicRos != null)dicRos.Clear(); - dicRos = null; - } - public List GetValueDifferences(ROFSTLookup origROFst, ref List delList) - { - // use this list to see what differences are between it and the original - List modList = new List(); - // assume each rofstlookup has a parsed dictionary - foreach (string key in origROFst.dicRos.Keys) - { - string cvalue = null; - string ovalue = origROFst.dicRos[key].value; - if (dicRos.ContainsKey(key)) - cvalue = dicRos[key].value; - if (cvalue == null && cvalue != ovalue) - delList.Add(key); - else if (cvalue != ovalue) - { - // Value Change - modList.Add(key); - //Console.WriteLine("RO{0}\t\"{1}\"\t\"{2}\"", key, cvalue, ovalue); - } - } - return modList; - } - //public static ROImageInfo Get(RODbInfo rodbinfo, string filename) - //{ - // if (rodbinfo.RODbROImageCount != 0) - // { - // foreach (ROImageInfo ri in rodbinfo.RODbROImages) - // { - // if (ri.FileName == filename) return ri; - // } - // } - // return null; - //} - - public string GetTranslatedRoValue(string ROID16, bool DoCaret) - { - string retval = GetRoValue(ROID16); - retval = ReplaceUnicode(retval, DoCaret); - retval = ConvertFortranFormatToScienctificNotation(retval); - return retval.Replace("\r\n", @"\par "); - } - private string ReplaceUnicode(string s2, bool DoCaret) - { - string orig = s2; - s2 = s2.Replace("`", @"\'b0"); // convert backquote to degree - left over from DOS days. - s2 = s2.Replace("\xa0", @"\u160?"); // hardspace - s2 = s2.Replace("\xb0", @"\'b0"); // degree - s2 = s2.Replace("\x7f", @"\u916?"); // delta - s2 = s2.Replace("\x2265", @"\u8805?"); // greater than or equal - s2 = s2.Replace("\x2264", @"\u8804?"); // less than or equal - s2 = s2.Replace("\xB1", @"\'b1"); // plus minus - s2 = s2.Replace("\x3A3", @"\u931?"); // sigma - s2 = s2.Replace("\x3C4", @"\u947?"); // gamma - s2 = s2.Replace("\xBD", @"\'bd"); // half - s2 = s2.Replace("\x25A0", @"\u9604?"); // accum 2584 - s2 = s2.Replace("\x7", @"\u9679?"); // bullet 25CF - s2 = s2.Replace("\x2248", @"\u8776?"); // approx eq - s2 = s2.Replace("\x2261", @"\u8773?"); // similar eq 2245 - s2 = s2.Replace("\xF7", @"\'f7"); // division - s2 = s2.Replace("\x221A", @"\u8730?"); // square root - s2 = s2.Replace("\x393", @"\u961?"); // rho 3C1 - s2 = s2.Replace("\x3C0", @"\u960?"); // pi - s2 = s2.Replace("\xb5", @"\u956?"); // micro 3BC (try e6, if not work try 109) - s2 = s2.Replace("\x3B4", @"\u948?"); // lower case delta - s2 = s2.Replace("\x3C3", @"\u963?"); // lower case sigma - s2 = s2.Replace("\xBC", @"\'bc"); // quarter - s2 = s2.Replace("\x3C6", @"\'d8"); // dist zero, D8 - s2 = s2.Replace("\xC9", @"\u274?"); // energy, 112 - s2 = s2.Replace("\xEC", @"\'ec"); // grave - s2 = s2.Replace("\x2502", @"\u9474?"); // bar - s2 = s2.Replace("\x3B5", @"\u949?"); // epsilon - s2 = s2.Replace("\x398", @"\u952?"); // theta, 3B8 - s2 = s2.Replace("\x221E", @"\u8857?"); // dot in oval, 2299 - s2 = s2.Replace("\xBF", @"\u964?"); // tau, 3C4 - s2 = s2.Replace("\x2310", @"\u9830?"); // diamond, 2666 - s2 = s2.Replace("\x2192", @"\u8594?"); - s2 = s2.Replace("\x2190", @"\u8592?"); - s2 = s2.Replace("\x2191", @"\u8593?"); - s2 = s2.Replace("\x2193", @"\u8595?"); - s2 = s2.Replace("\x2207", @"\u8711?"); - s2 = s2.Replace("\x2591", @"\'b0"); // Degree Symbol - s2 = s2.Replace("\xFF", @"\u8593?"); // Up Arrow - s2 = s2.Replace("\xD6", @"\u8595?"); // Down Arrow - - if (DoCaret) s2 = s2.Replace("^", @"\u916?"); - // Convert dash to a non-breaking dash. This is a unicode character. - // This character will be used in veproms rather than a dash. - //if the dash is preceeded byte a token remove the space following the token - s2 = Regex.Replace(s2, @"(\\[^ \\?]*) \-", @"$1\u8209?"); - s2 = s2.Replace("-", @"\u8209?"); - return s2; - } - private string FixUnitROs(string val) - { - if (val.StartsWith("") val = _ROFstInfo.docVer.DocVersionConfig.Unit_Text; - else if (val.ToUpper() == "") val = _ROFstInfo.docVer.DocVersionConfig.Unit_Number; - else if (val.ToUpper() == "") val = _ROFstInfo.docVer.DocVersionConfig.Unit_Name; - else if (val.ToUpper() == "") val = _ROFstInfo.docVer.DocVersionConfig.Unit_ID; - else if (val.ToUpper() == "") val = _ROFstInfo.docVer.DocVersionConfig.Other_Unit_Text; - else if (val.ToUpper() == "") val = _ROFstInfo.docVer.DocVersionConfig.Other_Unit_Number; - else if (val.ToUpper() == "") val = _ROFstInfo.docVer.DocVersionConfig.Other_Unit_Name; - else if (val.ToUpper() == "") val = _ROFstInfo.docVer.DocVersionConfig.Other_Unit_ID; - } - return val; - } - // this only gets rochild values. Later we may want another - // dictionary to get groups. - public string GetRoValue(string ROID16) - { - string ROID = ROID16.Substring(0,12); - if (dicRos == null) ParseIntoDictionary(_ROFst!=null?_ROFst.ROLookup:_ROFstInfo.ROLookup); - // Use the ROID to get the value from the dictionary - if (dicRos.ContainsKey(ROID.ToUpper())) - { - rochild rochld = (rochild)dicRos[ROID.ToUpper()]; - if (rochld.value != null && rochld.value != string.Empty) - return FixUnitROs( rochld.value); - if (rochld.children != null) - { - foreach (rochild child in rochld.children) - if (child.roid.ToUpper() == ROID16.ToUpper() || (child.roid.EndsWith("0041") && ROID16.EndsWith("0000"))) - return FixUnitROs(child.value); - // if there isn't a specific match for multi-return values, default to the first child. - return FixUnitROs(rochld.children[0].value); - } - } - //if (ROID == "FFFF00000001") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Unit_Number; - //if (ROID == "FFFF00000002") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Other_Unit_Number; - //if (ROID == "FFFF00000003") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Unit_Text; - //if (ROID == "FFFF00000004") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Other_Unit_Text; - //if (ROID == "FFFF00000005") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Unit_ID; - //if (ROID == "FFFF00000006") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Other_Unit_ID; - //if (ROID == "FFFF00000007") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Unit_Name; - //if (ROID == "FFFF00000008") return _ROFstInfo.ROFstAssociations[0].MyDocVersion.DocVersionConfig.Other_Unit_Name; - //new stuff - if (ROID == "FFFF00000001") return _ROFstInfo.docVer.DocVersionConfig.Unit_Number; - if (ROID == "FFFF00000002") return _ROFstInfo.docVer.DocVersionConfig.Other_Unit_Number; - if (ROID == "FFFF00000003") return _ROFstInfo.docVer.DocVersionConfig.Unit_Text; - if (ROID == "FFFF00000004") return _ROFstInfo.docVer.DocVersionConfig.Other_Unit_Text; - if (ROID == "FFFF00000005") return _ROFstInfo.docVer.DocVersionConfig.Unit_ID; - if (ROID == "FFFF00000006") return _ROFstInfo.docVer.DocVersionConfig.Other_Unit_ID; - if (ROID == "FFFF00000007") return _ROFstInfo.docVer.DocVersionConfig.Unit_Name; - if (ROID == "FFFF00000008") return _ROFstInfo.docVer.DocVersionConfig.Other_Unit_Name; - //end new stuff - if (ROID.StartsWith("FFFF")) return "?"; // string.Format("Invalid Unit RO '{0}'", ROID); - return "?"; // string.Format("Invalid RO '{0}'", ROID); - } - // Get the the RO's Accessory Page ID - public string GetRoACID(string ROID16) - { - string ROID = ROID16.Substring(0,12); - if (dicRos == null) ParseIntoDictionary(_ROFst!=null?_ROFst.ROLookup:_ROFstInfo.ROLookup); - // Use the ROID to get the value from the dictionary - if (dicRos.ContainsKey(ROID.ToUpper())) - { - rochild rochld = (rochild)dicRos[ROID.ToUpper()]; - if (rochld.value != null && rochld.value != string.Empty) - return rochld.appid; - if (rochld.children != null) - { - foreach (rochild child in rochld.children) - if (child.roid.ToUpper() == ROID16 || (child.roid.EndsWith("0041") && ROID16.EndsWith("0000"))) - return child.appid; - // if there isn't a specific match for multi-return values, default to the first child. - return rochld.children[0].appid; - } - } - return ""; // no accessory page ID found - } - public rochild GetRoChild12(string ROID16) - { - string ROID = ROID16.Substring(0, 12); - if (dicRos == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); - // Use the ROID to get the value from the dictionary - if (dicRos.ContainsKey(ROID.ToUpper())) - { - rochild rochld = (rochild)dicRos[ROID.ToUpper()]; - return rochld; - } - rochild tmp = new rochild(); - tmp.ID = -1; - return tmp; - } - public rochild GetRoChild(string ROID) - { - if (dicRos == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); - // Use the ROID to get the value from the dictionary - if (dicRos.ContainsKey(ROID.ToUpper())) - { - rochild rochld = (rochild)dicRos[ROID.ToUpper()]; - return rochld; - } - if (ROID.StartsWith("FFFF")) - { - rochild roc = new rochild(); - roc.roid = ROID; - roc.type = 1; - int selectedSlave = _ROFstInfo.docVer.DocVersionConfig.SelectedSlave; - _ROFstInfo.docVer.DocVersionConfig.SelectedSlave = 0; - roc.value = GetRoValue(ROID); - _ROFstInfo.docVer.DocVersionConfig.SelectedSlave = selectedSlave; - switch (ROID) - { - case "FFFF00000001": - roc.appid = "U-Number"; - break; - case "FFFF00000002": - roc.appid = "U-Other Number"; - break; - case "FFFF00000003": - roc.appid = "U-Text"; - break; - case "FFFF00000004": - roc.appid = "U-Other Text"; - break; - case "FFFF00000005": - roc.appid = "U-ID"; - break; - case "FFFF00000006": - roc.appid = "U-Other ID"; - break; - case "FFFF00000007": - roc.appid = "U-Name"; - break; - case "FFFF00000008": - roc.appid = "U-Other Name"; - break; - default: - roc.appid = "U-Unknown"; - break; - } - return roc; - } - rochild tmp = new rochild(); - tmp.ID = -1; - return tmp; - } - public string GetROTitle(string ROID) - { - StringBuilder sb = new StringBuilder(); - rochild roc = GetRoChild12(ROID); - if (roc.value == null) - roc = GetRoChild(ROID); - sb.Append(roc.title.Replace(roc.appid,"").Replace(roc.value,"").Trim()); - do - { - string parent = ROID.Substring(0, 4) + string.Format("{0:X8}", roc.ParentID); - roc = GetRoChild12(parent); - if (roc.ID > 0) - sb.Insert(0, roc.title + " - "); - } while (roc.ID > 0); - return sb.ToString(); - } - // Return the RO Title in a list of strings - // The last item in the list is the actual RO title, the items preceding it are the - // titles of the groups and sub-groups containing the RO - public List GetROTitleAndGroupPath(string ROID) - { - List titlePath = new List(); - rochild roc = GetRoChild12(ROID); - //string tmp = roc.title.Replace(roc.appid, "").Replace(roc.value, "").Trim(); - string tmp = roc.title.Replace(roc.appid, string.Format("<{0}>",roc.appid)).Trim(); - titlePath.Add(tmp); - do - { - string parent = ROID.Substring(0, 4) + string.Format("{0:X8}", roc.ParentID); - roc = GetRoChild12(parent); - if (roc.ID > 0) - titlePath.Add(roc.title); - } while (roc.ID > 0); - titlePath.Reverse(); - return titlePath; - } - - // The following Method is not correct. It needs to have a RO database id as well as an id. Without that, - // the first RO with a specific id will be found regardless of the RO Database id. - //public rochild GetRoChildFromID(int id) - //{ - // if (dicRosIntIDs == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); - // // Use the id to get the value from the dictionary - // if (dicRosIntIDs.ContainsKey(id)) - // { - // rochild rochld = (rochild)dicRosIntIDs[id]; - // return rochld; - // } - // rochild tmp = new rochild(); - // tmp.ID = -1; - // return tmp; - //} - public rodbi[] GetRODatabaseList() - { - return myHdr.myDbs; - } - //public string GetDefaultROPrefix() - //{ - // if (docVer != null) - // return docVer.DocVersionConfig.RODefaults_setpointprefix; - // else - // return "SP1"; // Not Sure about this... - //} - //public string GetDefaultGraphicsPrefix() - //{ - // if (docVer != null) - // return docVer.DocVersionConfig.RODefaults_graphicsprefix; - // else - // return "IG1"; // Not Sure about this... - //} - #region Update Ro Values - /// - /// Updates an ro.fst into a sql database. - /// - /// - /// ROFst: Returns the created rofst object - //public static ROFst UpdateRoFst(RODbInfo rdi, DocVersionAssociation dva, DocVersion docver) - //{ - // // file validity checks are done before getting here - just do the import - // // here. - // string rofstfilepath = rdi.FolderPath + @"\ro.fst"; - - // DirectoryInfo di = new DirectoryInfo(rdi.FolderPath); - - // // There may be more than 1 'ro' as the 'ROName' field (ROName is derived from the ropath). - // // Get new name be incrementing, if so. - // string newname = NewROName(di.Name); - - // // Next read in the rofst & make the rofst record. - // FileStream fsIn = new FileStream(rofstfilepath, FileMode.Open, FileAccess.Read, FileShare.Read); - // // Create an instance of StreamReader that can read characters from the FileStream. - // BinaryReader r = new BinaryReader(fsIn); - // byte[] ab = r.ReadBytes((int)fsIn.Length); - // fsIn.Close(); - - // using (RODb rd = RODb.Get(rdi.RODbID)) - // { - // ROFst rofst = ROFst.MakeROFst(rd, ab, null, di.LastWriteTimeUtc, rdi.UserID); - // // Hook this into the current docversion by replacing the rofstid field in the doc version - // // association object: - // dva.MyROFst = rofst; - // docver.Save(); - - // // Now load any images in... type 8 - integrated graphics ro type - // ROFstInfo rofstInfo = ROFstInfo.Get(rofst.ROFstID); - // rofstInfo.ParseIntoDictionary(rofstInfo.ROFST); - // for (int i = 0; i < rofstInfo.myHdr.myDbs.Length; i++) - // { - // // walk through the rofst 'database' searching for all nodes that are integrated graphics, type 8: - // if (rofstInfo.myHdr.myDbs[i].children != null) rofstInfo.MigrateRoFstGraphics(rdi, rofstInfo.myHdr.myDbs[i].children); - // } - // return rofst; - // } - //} - //private static string RoAppConfigExt(string fstPath) - //{ - // string inipath = fstPath + @"\roapp.ini"; - // if (!File.Exists(inipath)) return null; - // StreamReader myReader = new StreamReader(inipath); - // string sLine; - // int indx = -1; - // while ((sLine = myReader.ReadLine()) != null) - // { - // if (sLine.Length > 0 && sLine.Substring(0, 1) != ";") - // { - // if ((indx = sLine.ToLower().IndexOf("extention")) >= 0) - // { - // indx = sLine.IndexOf("=", indx + 9); - // return sLine.Substring(indx + 1, sLine.Length - indx - 1).Trim(); - // } - // } - // } - // myReader.Close(); - // return null; - //} - //private static string NewROName(string roName) - //{ - // string retval = roName; - // int iSuffix = -1; - // RODbInfoList rodblist = RODbInfoList.Get(); - - - // foreach (RODbInfo rdi in rodblist) - // { - // if (rdi.ROName.StartsWith(roName)) - // { - // if (rdi.ROName == roName) - // iSuffix = 0; - // else if (Regex.IsMatch(rdi.ROName, roName + "[_][0-9]+")) - // { - // int ii = int.Parse(rdi.ROName.Substring(1 + roName.Length)); - // if (ii > iSuffix) iSuffix = ii; - // } - // } - // } - // if (iSuffix >= 0) - // retval = string.Format("{0}_{1}", roName, iSuffix + 1); - // return retval; - //} - //private void MigrateRoFstGraphics(RODbInfo rdi, ROFstInfo.rochild[] rochild) - //{ - // for (int i = 0; i < rochild.Length; i++) - // { - // if (rochild[i].type == 8) AddGraphic(rdi, rochild[i].value); - // if (rochild[i].children != null) MigrateRoFstGraphics(rdi, rochild[i].children); - // } - //} - //private void AddGraphic(RODbInfo rdi, string p) - //{ - // if (p == null) return; - // string imgname = p.Substring(0, p.IndexOf('\n')); - // int thedot = imgname.LastIndexOf('.'); - // string fname = imgname; - // if (thedot == -1 || (thedot != (imgname.Length - 4))) - // { - // RODbConfig roDbCfg = new RODbConfig(rdi.Config); - // fname += string.Format(".{0}", roDbCfg.GetDefaultGraphicExtension()); - // } - - // string imgfile = rdi.FolderPath + @"\" + fname; - - // ROImage roImg = null; - // if (File.Exists(imgfile)) - // { - // FileInfo fi = new FileInfo(imgfile); - // // if the roimage record exists, don't create a new one... - // using (roImg = ROImage.GetByRODbID_FileName_DTS(rdi.RODbID, imgname, fi.LastWriteTimeUtc)) - // { - // if (roImg == null) - // { - // FileStream fsIn = new FileStream(imgfile, FileMode.Open, FileAccess.Read, FileShare.Read); - // BinaryReader r = new BinaryReader(fsIn); - // byte[] ab = r.ReadBytes((int)fsIn.Length); - // r.Close(); - // fsIn.Close(); - // using (RODb rodb = RODb.Get(rdi.RODbID)) - // { - // roImg = ROImage.MakeROImage(rodb, imgname, ab, null, fi.LastWriteTimeUtc, "Migration"); - // } - // } - // Figure figure = Figure.GetByROFstID_ImageID(this.ROFstID, roImg.ImageID); - // if (figure != null) return; - // using (ROFst rofst = ROFst.Get(this.ROFstID)) - // { - // figure = Figure.MakeFigure(rofst, roImg, null); - // } - // } - // } - // else - // Console.WriteLine(string.Format("{0}", imgfile), "Cannot Find Image File"); - //} - #endregion - #endregion - #region LoadStructs - private int StringLength(byte[] ab, int offset) - { - int i = 0; - while (ab[i + offset] != 0) i++; - return i; - } - private rogrp LoadGroup(byte[] ab, int offset) - { - rogrp myGrp = new rogrp(); - myGrp.ID = BitConverter.ToInt32(ab, offset); - if (myGrp.ID == 1195) - Console.WriteLine("jcb"); - myGrp.ParentID = BitConverter.ToInt32(ab, offset + 4); - int howmany = BitConverter.ToInt16(ab, offset + 8); - if (howmany > 0) - { - myGrp.children = new rochild[howmany]; - int myOffset = offset + 10; - for (int i = 0; i < myGrp.children.Length; i++) - { - int childOffset = BitConverter.ToInt32(ab, myOffset); - rochild tmp = new rochild(); - //tmp.offset=BitConverter.ToInt32(ab,myOffset); - tmp.type = BitConverter.ToInt16(ab, myOffset + 4); - int slen = StringLength(ab, myOffset + 6); - tmp.title = Encoding.Default.GetString(ab, myOffset + 6, slen); - myOffset += (7 + slen); - rogrp tmpg = LoadGroup(ab, childOffset); - MultipleReturnValuesInheritType(ref tmpg, tmp.type); - tmp.ID = tmpg.ID; - tmp.ParentID = tmpg.ParentID; - tmp.children = tmpg.children; - tmp.value = tmpg.value; - tmp.appid = tmpg.appid; - tmp.roid = TableID.ToString("X4") + tmp.ID.ToString("X8"); - // Add dictionary entries for children - if (tmp.children != null) - { - foreach (rochild child in tmp.children) - if (!dicRos.ContainsKey(child.roid.ToUpper())) - dicRos.Add(child.roid.ToUpper(), child); - } - dicRos.Add(tmp.roid.ToUpper(), tmp); - if (!dicRosIntIDs.ContainsKey(tmp.ID)) dicRosIntIDs.Add(tmp.ID, tmp); - int j; - for (j = i - 1; j >= 0 && tmp.ID < myGrp.children[j].ID; j--) - { - myGrp.children[j + 1] = myGrp.children[j]; - } - myGrp.children[j + 1] = tmp; - } - } - else - { - int slen = StringLength(ab, offset + 12); - //myGrp.value = Encoding.Default.GetString(ab, offset + 12, slen); - ProcessROReturnValue(ref myGrp, Encoding.Default.GetString(ab, offset + 12, slen)); - int slen2 = StringLength(ab, offset + 13 + slen); - myGrp.appid = Encoding.Default.GetString(ab, offset + 13 + slen, slen2); - } - return myGrp; - } - - /// - /// This function will take the raw RO return value and resolve any macros, conditionals, and - /// generated the return value or a list of multiple return values. - /// - /// - /// - private void ProcessROReturnValue(ref rogrp myGrp, string rawvalue) - { - if (dicRos == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); - List lstROVals = GetROReturnValue(rawvalue); - if (lstROVals.Count > 1) // mulitple return values - { - myGrp.children = new rochild[lstROVals.Count]; - for (int i = 0; i < lstROVals.Count; i++) - { - string tsts = Convert.ToInt32(multiRoValues[i][0]).ToString("X4"); - myGrp.children[i].value = lstROVals[i]; - myGrp.children[i].roid = TableID.ToString("X4") + myGrp.ID.ToString("X8") + tsts; - myGrp.children[i].type = -1; // Multiple return value inherit type from parent - myGrp.children[i].title = lstROVals[i]; - } - } - else - myGrp.value = lstROVals[0]; - return; - - } - /// - /// Multiple return values need to get the type from the parent node. - /// - /// - /// - private void MultipleReturnValuesInheritType(ref rogrp myGrp, int parenttype) - { - if (myGrp.children != null) - { - for (int cnt = 0; cnt < myGrp.children.Length; cnt++) - { - if (myGrp.children[cnt].type == -1) - { - myGrp.children[cnt].type = parenttype; - myGrp.children[cnt].appid = myGrp.appid; - } - } - } - } - - private void ParseIntoDictionary(byte[] ab) - { - if (dicRos == null) dicRos = new Dictionary(); - if (dicRosIntIDs == null) dicRosIntIDs = new Dictionary(); - - myHdr.hSize = BitConverter.ToInt32(ab, 0); - myHdr.hYear = BitConverter.ToInt16(ab, 4); - myHdr.hMonth = ab[6]; - myHdr.hDay = ab[7]; - myHdr.hcYear = BitConverter.ToInt16(ab, 8); - myHdr.hcMonth = ab[10]; - myHdr.hcDay = ab[11]; - myHdr.hcHour = ab[12]; - myHdr.hcMin = ab[13]; - myHdr.hcSec = ab[14]; - myHdr.hcHund = ab[15]; - int hdrOffset = BitConverter.ToInt32(ab, 16); - int howbig = BitConverter.ToInt32(ab, hdrOffset); - int dbs = BitConverter.ToInt16(ab, hdrOffset + 4); - myHdr.myDbs = new rodbi[dbs]; - for (int i = 0; i < dbs; i++) - { - int offset = hdrOffset + 6 + (i * 30); - myHdr.myDbs[i].dbiID = BitConverter.ToInt16(ab, offset + 0); - TableID = myHdr.myDbs[i].dbiID; - myHdr.myDbs[i].dbiType = BitConverter.ToInt16(ab, offset + 2); - myHdr.myDbs[i].dbiAW = BitConverter.ToInt16(ab, offset + 4); - rogrp tmp = LoadGroup(ab, BitConverter.ToInt32(ab, offset + 6)); - myHdr.myDbs[i].ID = tmp.ID; - myHdr.myDbs[i].children = tmp.children; - int iPtr = BitConverter.ToInt32(ab, offset + 22) + hdrOffset + 6; - myHdr.myDbs[i].dbiTitle = Encoding.Default.GetString(ab, iPtr, StringLength(ab, iPtr)); - iPtr = BitConverter.ToInt32(ab, offset + 26) + hdrOffset + 6; - myHdr.myDbs[i].dbiAP = Encoding.Default.GetString(ab, iPtr, StringLength(ab, iPtr)); - } - } - #endregion - #region GetRoValues - public List GetROReturnValue(string roval) - { - lstRoValues = new List(); - multiRoValues = new List(); - DictROVar = new Dictionary(); // set up a dictionary of RO defined Variables - string tmp = ProcessRO(_DocVersionInfo==null?roval:_DocVersionInfo.ProcessDocVersionSpecificInfo(roval), false); - if (tmp != null && lstRoValues.Count == 0) // was not a multiple return value - lstRoValues.Add(tmp); - return lstRoValues; - } - - private string ProcessRO(string roval, bool multiRtnVal) - { - string str = roval; - string rtnstr = ""; - int l = roval.Length; - while (l > 0) - { - int ptr = NextDelimiter("{", str); - if (ptr == -1) - { // add remaining text - //add(new seText(str, l)); - rtnstr += str; - l = 0; // break out of while loop - } - else - { - int cnt = ptr; //(int)(ptr - str); - if (cnt > 0) - { // add text - //add(new seText(str, cnt)); - rtnstr += str.Substring(0, cnt); - l -= cnt; - //str = ptr; - str = str.Substring(ptr); - } - ptr = MatchingBrace(str) + 1; - cnt = ptr; //(int)(ptr - str); - bool nfnd = false; - string pbstr = ProcessBrace(str.Substring(1, cnt - 2), cnt - 2, ref nfnd, multiRtnVal); - if (pbstr == null) return null; - if (nfnd) - rtnstr += str.Substring(0, cnt); - // add(new seText(str, cnt)); - else - rtnstr += pbstr; - l -= cnt; - //str = ptr; - str = str.Substring(ptr); - } - } - //rtnstr = rtnstr.Replace("`", @"\'b0"); // convert backquote to degree - left over from DOS days. - rtnstr = ProcessMacros(rtnstr); - return rtnstr; - } - - // - // 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 - // - // right now the only macro is @HSP(), where every space between the "(" and ")" will be replaced with a hardspace - // - private string ProcessMacros(string str) - { - if( str == null || str == "" ) return str; - string rtnstr = str; - int indx = -1; - while ((indx = rtnstr.ToUpper().IndexOf("@HSP("))>-1) - { - string resstr = rtnstr.Substring(0,indx); - int endHsp = rtnstr.IndexOf(")",indx); - string tmpstr = rtnstr.Substring(indx+5,endHsp-indx-5); - tmpstr = tmpstr.Replace(" ", @"\u160?"); - resstr = resstr + tmpstr; - rtnstr = resstr + rtnstr.Substring(endHsp+1); - } - return rtnstr; - } - - private string ProcessConditional(string cnd, string opt, int lencnd, int lenopt, bool multiRtnVal) - { - // equaluate condition - string stat = (_DocVersionInfo != null) ? this._DocVersionInfo.Evaluate(cnd, lencnd) : ""; - int ls = stat.Length;//strlen(stat); - if (ls == 0) - return ""; // if evaluation not defined then return an empty string - no matches can be made - // look for match - remember default - string match = null; - int matchlen = 0; - string def = null; - int deflen = 0; - while (lenopt > 0 && match == null) - { - int end = MatchingBrace(opt); - int eq = opt.IndexOf('=');// strchr(opt, '='); - int len = end + 1; //(int)((end + 1) - opt); // +1 to include the '}' - int li = eq - 1;//(int)(eq - opt) - 1; - int ld = len - li - 3;// One for '{', '=' and '}' - if (def == null || eq == 1) // (!def || eq == opt+1) - { - def = opt.Substring(eq + 1); //def=eq+1; - deflen = ld; - } - if (ls == li && opt.Substring(1).StartsWith(stat+"=")) // (stat.IndexOf(opt.Substring(1), li) > -1)) //(ls == li && !strncmp(stat, opt + 1, li)) - { - match = opt.Substring(eq + 1, ld);// match = eq + 1; - matchlen = ld; - } - opt = opt.Substring(len); //opt += len;// point to the next piece - lenopt -= len; - } - // if match process option - or process default - if (match == null) //(!match) - { - match = def.Substring(0, deflen); - matchlen = deflen; - } - return ProcessRO(match, multiRtnVal); //process(match, matchlen); - } - - private string ProcessBrace(string str, int l, ref bool nfnd, bool multiRtnVal) - { - string rtnstr = ""; - int nxt = NextDelimiter("{=", str); //nextDelimiter("{=", str, l); - if (nxt == -1) // no delimiter found - { // VarUse - //strList *found=vl->lookFor(str,l); - bool found = DictROVar.ContainsKey(str); - if (found) - rtnstr = DictROVar[str]; - //add(new seVarUse(found)); - else - nfnd = true; - } - else - { - if (str[nxt] == '{') - { // conditonal or menu - if (nxt == 0) // if (nxt == str) - { // menu - // TODO: implement Menu logic - //ml->process(str, l, vl); - //add(new seMenuUse(ml)); - //lstRoValues.Add(ProcessRO(str.Substring(0,l), true)); - ProcessMultiReturnValues(str, l); - } - else - { // conditional - rtnstr = ProcessConditional(str, str.Substring(nxt), nxt, str.Length - nxt - 1, multiRtnVal);//processCondition(str, nxt, (int)(nxt - str), l - (int)(nxt - str)); - } - } - else - { // must be variable definiton - //vl->add(str, nxt+1, (int)(nxt-str), (l - (int)(nxt-str))-1, ml); - - // 'l' is the lenght up to the matching brace of the variable definition - string tmpval = ProcessRO(str.Substring(nxt + 1, l - nxt - 1), multiRtnVal); - if (tmpval.Equals(string.Empty)) tmpval = " "; // nothing assinged to variable - if (!DictROVar.ContainsKey(str.Substring(0, nxt))) // need a try/catch here. - { - DictROVar.Add(str.Substring(0, nxt), tmpval); - if(nxt == 1) - multiRoValues.Add(str.Substring(0, nxt)); - } - else - return null; - if (multiRtnVal) - rtnstr = tmpval; - } - } - return rtnstr; - } - private Dictionary> _ValueLookupDictionary = null; - public List GetRosByValue(string value) - { - if (_ValueLookupDictionary == null) - BuildValueDictionary(); - if (value == string.Empty) - return null; - if(_ValueLookupDictionary.ContainsKey(value.ToUpper())) - return _ValueLookupDictionary[value.ToUpper()]; - return null; - } - private void BuildValueDictionary() - { - _ValueLookupDictionary = new Dictionary>(); - if (dicRos == null) - ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); - foreach (rochild child in dicRos.Values) - { - if (child.value != null) - { - string value = child.value.ToUpper(); - if (_ValueLookupDictionary.ContainsKey(value)) - _ValueLookupDictionary[value].Add(new roChild(child)); - else - { - List children = new List(); - children.Add(new roChild(child)); - _ValueLookupDictionary.Add(value, children); - } - } - } - } - private Dictionary _dicROAPID = null; - public rochild? GetROChildByAccPageID(string accPageID, string spDefault, string igDefault) - { - rochild? child = GetRoChildByAccPagID(accPageID, spDefault, igDefault); - if (child == null) - { - if(Regex.IsMatch(accPageID, @".*\.[A-Z]")) - { - string accpage = accPageID.Substring(0, accPageID.Length - 3); - int index = accPageID.Substring(accPageID.Length - 2, 1)[0] - 'A'; - child = GetRoChildByAccPagID(accpage, spDefault, igDefault); - if (child == null) return null; - if (((rochild)child).children != null && ((rochild)child).children.Length > 0 && ((rochild)child).children.Length > index) - return ((rochild)child).children[index]; - } - return null; - } - if (((rochild)child).children != null && ((rochild)child).children.Length > 0) - return ((rochild)child).children[0]; - return (rochild)child; - } - public string GetROValueByAccPagID(string accPageID, string spDefault, string igDefault) - { - rochild? child = GetROChildByAccPageID(accPageID, spDefault, igDefault); - if (child == null) return null; - return ((rochild)child).value; - } - public int? GetROTypeByAccPagID(string accPageID, string spDefault, string igDefault) - { - rochild? child = GetROChildByAccPageID(accPageID, spDefault, igDefault); - if (child == null) return null; - return ((rochild)child).type; - } - public string GetROIDByAccPagID(string accPageID, string spDefault, string igDefault) - { - rochild? child = GetROChildByAccPageID(accPageID, spDefault, igDefault); - if (child == null) return null; - return ((rochild)child).roid; - } - public rochild? GetRoChildByAccPagID(string accPageID, string spDefault, string igDefault) - { - if (_dicROAPID == null) - BuildROAPIDDictionary(); - accPageID = accPageID.Replace("".ToCharArray()); // String < and > - if (_dicROAPID.ContainsKey(accPageID)) - return _dicROAPID[accPageID]; - return null; - } - private void BuildROAPIDDictionary() - { - if (dicRos == null) - ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup); - _dicROAPID = new Dictionary(); - foreach (rodbi dbi in myHdr.myDbs) - { - if (dbi.children != null) - BuildROAPIDDictionary(dbi.dbiAP, dbi.children); - } - } - private void BuildROAPIDDictionary(string prefix, rochild[] children) - { - foreach (rochild child in children) - { - if (child.appid != null && child.appid != "" && child.ID != 0) - { - string key = string.Format("{0}-{1}", prefix, child.appid); - if (!_dicROAPID.ContainsKey(key)) - _dicROAPID.Add(key, child); - } - if (child.children != null) - BuildROAPIDDictionary(prefix, child.children); - } - } - private void ProcessMultiReturnValues(string str, int len) - { - if (str.Contains("{A={EQ}}")) // .StartsWith("{EQ=}")) - Console.WriteLine("jcb"); - string tstr = str.Substring(0, len); - while (tstr.Length > 0) - { - int idx = MatchingBrace(tstr); - string tmpVal = ProcessRO(tstr.Substring(0, idx + 1), true); - if (tmpVal != null) lstRoValues.Add(tmpVal); // duplicates get returned as null - tstr = tstr.Substring(idx + 1); - } - } - - - private int MatchingBrace(string str) - { - int level = 1; - int idx = 0; // the while will skip the first position (the first brace) - while (level > 0 && idx++ < str.Length) - { - switch (str[idx]) - { - case '{': - level++; - break; - case '}': - level--; - break; - } - } - if (level != 0) - idx = -1; // didn't find matching brace - - return idx; //length including end brace - } - - private int NextDelimiter(string delim, string str) - { - int idx; - idx = str.IndexOfAny(delim.ToCharArray()); - return idx; - } - public List GetRoChildrenByType(int type) - { - List children = new List(); - AddRoChildByType(children, type); - return children; - } - private void AddRoChildByType(List children, int type) - { - foreach (rodbi dbi in myHdr.myDbs) - { - if (dbi.children != null) - AddRoChildByType(dbi.children,children,type); - } - } - private void AddRoChildByType(rochild[] roChildren, List children, int type) - { - foreach (rochild child in roChildren) - { - if (child.type == type && child.value != null) - children.Add(child); - if (child.children != null) - AddRoChildByType(child.children,children,type); - } - } - #endregion - #region FortranFormat - public static string ConvertFortranFormatToScienctificNotation(string str) - { - // ([+-]?|\\u8209\?) either an optional single character Plus (+) or Minus (-) or non-breaking dash (\u8209?) - // ([0-9]+) a group of at least one digits - // [.] a decimal point - // ([0-9]*?) a group of zero or more digits - // 0*E optional zeros (spare zeros) followed - // ([+-]?|\\u8209\?) either an optional single character Plus (+) or Minus (-) or non-breaking dash (\u8209?) - // ([0-9]+) a group of at least one digits - string retval = Regex.Replace(str, @"([+-]?|\\u8209\?)([0-9]+)[.]([0-9]*?)0*E([+-]?|\\u8209\?)([0-9]+)", new MatchEvaluator(FixFortranNumber)); - // don't convert # and ~ to super/subscripts, this is a DOS holdout and is done only for non-procedure step sections - //retval = Regex.Replace(retval, "[#](.*?)[#]", "\\up2 $1\\up0 ");// DOS Superscript - //retval = Regex.Replace(retval, "[~](.*?)[~]", "\\dn2 $1\\up0 ");// DOS Subscript - return retval; - } - private static string FixFortranNumber(Match match) - { - StringBuilder sb = new StringBuilder(match.Groups[1].Value.Replace("-",@"\u8209?")); - if (match.Groups[3].Length == 0) // Nothing to the right of the decimal - if (match.Groups[2].Value != "1") // Other than "1", multiply it times 10 raised to a power - sb.Append(match.Groups[2].Value + "x10"); - else // The number is simply 1 so it can be ignored and 10 can be raised to a power - sb.Append("10"); - else // A number with a decimal point - sb.Append(match.Groups[2].Value + "." + match.Groups[3].Value + "x10"); - // Add the exponent as superscript - return sb.ToString() + "\\up2 " + match.Groups[4].Value.Replace("-",@"\u8209?") + match.Groups[5].Value + "\\up0 "; - } - #endregion - } - [Flags] - public enum E_ROValueType : uint - { - All = 0, - Text = 1, - Table = 2, - Graph = 4, - Image = 8, - Video = 16, - Hologram = 32 - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs.bak b/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs.bak deleted file mode 100644 index 76e7fec5..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs.bak +++ /dev/null @@ -1,777 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.ComponentModel; -using DescriptiveEnum; - -namespace VEPROMS.CSLA.Library -{ - [Serializable] - [TypeConverter(typeof(ExpandableObjectConverter))] - public class SectionConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged, IItemConfig - { - #region DynamicTypeDescriptor - internal override bool IsReadOnly - { - get { return false; }//_Section == null; } - } - #endregion - #region XML - private XMLProperties _Xp; - private XMLProperties Xp - { - get { return _Xp; } - } - #endregion - #region Constructors - //PROPGRID: Hide ParentLookup - [Browsable(false)] - public bool ParentLookup - { - get { return _Xp.ParentLookup; } - set { _Xp.ParentLookup = value; } - } - //PROPGRID: Had to comment out NonSerialized to hide AncestorLookup from Property Grid - //[NonSerialized] - private bool _AncestorLookup; - //PROPGRID: Hide AncestorLookup - //[Browsable(false)] - //public bool AncestorLookup - //{ - // get { return _AncestorLookup; } - // set { _AncestorLookup = value; } - //} - private Section _Section; - private SectionInfo _SectionInfo; - private static int _SectionConfigUnique = 0; - private static int SectionConfigUnique - { get { return ++_SectionConfigUnique; } } - private int _MySectionConfigUnique = SectionConfigUnique; - public int MySectionConfigUnique // Absolutely Unique ID - Info - { get { return _MySectionConfigUnique; } } - - public SectionConfig(Section section) - { - _Section = section; - string xml = section.MyContent.Config; - if (xml == string.Empty) xml = ""; - _Xp = new XMLProperties(xml); - if (section.MySectionInfo.ActiveParent != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder); - } - private string Xp_LookInAncestorFolder(object sender, XMLPropertiesArgs args) - { - if (args.AncestorLookup || ParentLookup) - { - string retval; - // There may be levels of sections, i.e. sections within a section. - SectionInfo sect = _Section != null ? _Section.MySectionInfo : _SectionInfo; - while (sect.ActiveParent.IsSection) - { - retval = sect.SectionConfig.GetValue(args.Group, args.Item); - if (retval != string.Empty) return retval; - sect = (sect.ActiveParent as SectionInfo) ?? SectionInfo.Get((sect.ActiveParent as ItemInfo).ItemID); - } - // There may be levels of procedures, i.e. procedures within a procedure. - ProcedureInfo proc = sect.MyProcedure; - retval = proc.ProcedureConfig.GetValue(args.Group, args.Item); - if (retval != string.Empty) return retval; - while (proc.ActiveParent.IsProcedure) - { - retval = proc.ProcedureConfig.GetValue(args.Group, args.Item); - if (retval != string.Empty) return retval; - proc = (ProcedureInfo)proc.ActiveParent; - } - DocVersionInfo docVersion = proc.ActiveParent as DocVersionInfo; - if (docVersion == null) return string.Empty; - retval = docVersion.DocVersionConfig.GetValue(args.Group, args.Item); - if (retval != string.Empty) return retval; - for (FolderInfo folder = docVersion.MyFolder; folder != null; folder = folder.MyParent) - { - retval = folder.FolderConfig.GetValue(args.Group, args.Item); - if (retval != string.Empty) return retval; - } - } - return string.Empty; - } - public SectionConfig(SectionInfo sectionInfo) - { - _SectionInfo = sectionInfo; - string xml = sectionInfo.MyContent.Config; - if (xml == string.Empty) xml = ""; - _Xp = new XMLProperties(xml); - if (_SectionInfo.ActiveParent != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder); - } - public SectionConfig(string xml) - { - if (xml == string.Empty) xml = ""; - _Xp = new XMLProperties(xml); - } - public SectionConfig() - { - _Xp = new XMLProperties(); - } - internal string GetValue(string group, string item) - { - return _Xp[group, item]; - } - #endregion - #region Local Properties - //[Category("Identification")] - [Category("General")] - [DisplayName("Number")] - [Description("Number")] - public string Number - { - get { return (_Section != null ? _Section.MyContent.Number : _SectionInfo.MyContent.Number); } - set { if (_Section != null) _Section.MyContent.Number = value; } - } - //[Category("Identification")] - [Category("General")] - [DisplayName("Title")] - [Description("Title")] - public string Title - { - get { return (_Section != null ? _Section.MyContent.Text : _SectionInfo.MyContent.Text); } - set { if (_Section != null) _Section.MyContent.Text = value; } - } - [Category("Identification")] - //PROPGRID: Hide Old Sequence - [Browsable(false)] - [DisplayName("Old Sequence")] - [Description("Old Sequence")] - public string OldSequence - { - get { return (_Section != null ? _Section.MyContent.MyZContent.OldStepSequence : (_SectionInfo.MyContent.MyZContent == null ? null : _SectionInfo.MyContent.MyZContent.OldStepSequence)); } - set { if (_Section != null) _Section.MyContent.MyZContent.OldStepSequence = value; } - } - [Category("Identification")] - //PROPGRID: Hide Dirty - [Browsable(false)] - [DisplayName("Dirty")] - [Description("Dirty")] - public bool Dirty - { - get { return (_Section != null ? _Section.IsDirty : false); } - } - [Category("Format")] - [DisplayName("Format")] - [Description("Format")] - [TypeConverter(typeof(FormatList))] - public string FormatSelection - { - get - { - if (_Section != null && _Section.MyContent.MyFormat != null) return _Section.MyContent.MyFormat.FullName; - if (_SectionInfo != null && _SectionInfo.MyContent.MyFormat != null) return _SectionInfo.MyContent.MyFormat.FullName; - return null; - } - set - { - if (_Section != null) - { - _Section.MyContent.MyFormat = FormatList.ToFormat(value); // Can only be set if _DocVersion is set - //_Section.ActiveFormat = null; - DocStyleListConverter.MySection = _Section; - } - } - } - [Browsable(false)] - public FormatInfo MyFormat - { - get - { - if (_Section != null) - { - SectionInfo sectionInfo = SectionInfo.Get(_Section.ItemID); - return sectionInfo.LocalFormat; - } - if (_SectionInfo != null)return _SectionInfo.LocalFormat; - return null; - } - set - { - if (_Section != null) - _Section.MyContent.MyFormat = value == null ? null : value.GetJustFormat(); - } - } - [Category("Format")] - [DisplayName("Default Format")] - [Description("Default Format")] - [TypeConverter(typeof(FormatList))] - public string DefaultFormatSelection - { - get - { - if (_Section != null && _Section.MySectionInfo.ActiveParent != null && _Section.MySectionInfo.ActiveParent.ActiveFormat != null) return _Section.MySectionInfo.ActiveParent.ActiveFormat.FullName; - if (_SectionInfo != null && _SectionInfo.MyParent != null && _SectionInfo.MyParent.ActiveFormat != null) return _SectionInfo.MyParent.ActiveFormat.FullName; - return null; - } - } - [Browsable(false)] - public FormatInfo MyDefaultFormat - { - get - { - if (_Section != null) return _Section.MySectionInfo.ActiveParent.ActiveFormat; - return _SectionInfo.ActiveParent.ActiveFormat; - } - } - //[Browsable(false)] - [Category("Format")] - [DisplayName("Section Type")] - [Description("Section Type")] - [TypeConverter(typeof(DocStyleListConverter))] - public string MySectionType - { - get - { - if (_Section != null) - { - return DocStyleListConverter.ToString(_Section.MyContent.Type); - } - return string.Empty; - } - set - { - if (_Section != null) - _Section.MyContent.Type = DocStyleListConverter.ToSectionType(value); - } - } - [Browsable(false)] - public int? SectionType - { - get - { - if (_Section != null) - { - return _Section.MyContent.Type-10000; - } - return null; - } - set - { - if (_Section != null) - _Section.MyContent.Type = value+10000; - } - } - public Section MySection - { get { return _Section; } } - [Category("Format")] - [DisplayName("Keep Word Document Margins")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section WordMargin")] - public string Section_WordMargin - { - get - { - string tmp = _Xp["Section", "WordMargin"]; - return tmp == null || tmp == "" ? "N" : tmp; - } - set - { - _Xp["Section", "WordMargin"] = value; - OnPropertyChanged("Section_WordMargin"); - } - } - #endregion - #region ToString - public override string ToString() - { - string s = _Xp.ToString(); - if (s == "" || s == "") return string.Empty; - return s; - } - #endregion - #region SectionCategory // from sequence number in 16-bit database. - [TypeConverter(typeof(EnumDescConverter))] - public enum SectionPagination : int - { - //Default = 0, Continuous, Separate - Continuous = 1, Separate = 2 - } - [Category("Format")] - [DisplayName("Section Pagination")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section Pagination")] - public SectionPagination Section_Pagination - { - get - { - string s = _Xp["Section", "Pagination"]; - - //If there is no value to get, then get the parent value (a.k.a. default value). - if (s == string.Empty) - s = _Xp.ParentValue("Section", "Pagination"); // get the parent value - //If there is no parent value, then use the volian default - if (s == string.Empty) - { - if (MyFormat != null) - { - bool rval = MyFormat.MyStepSectionLayoutData.BreakOnSections; - return (rval) ? SectionPagination.Separate : SectionPagination.Continuous;// default to volian default - } - else - { - bool rval = MyDefaultFormat.MyStepSectionLayoutData.BreakOnSections; - return (rval) ? SectionPagination.Separate : SectionPagination.Continuous;// default to volian default - } - } - return (SectionPagination)int.Parse(s); - } - set - { - // if value being saved is same as the parent value, then clear the value (save blank). This will - // reset the data to use the parent value. - - string parval = _Xp.ParentValue("Section", "Pagination"); // get the parent value - - if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default - { - bool rval = _Section.MySectionInfo.ActiveFormat.MyStepSectionLayoutData.BreakOnSections; - parval = (rval) ? ((int)(SectionPagination.Separate)).ToString() : ((int)(SectionPagination.Continuous)).ToString(); - //parval = ((int)(SectionPagination.Default)).ToString(); - } - - if (parval.Equals(((int)value).ToString())) - _Xp["Section", "Pagination"] = string.Empty; // reset to parent value - else - _Xp["Section", "Pagination"] = ((int)value).ToString(); // save selected value - - OnPropertyChanged("Section_Pagination"); - } - } - [Category("View Settings")] - //PROPGRID: Hide Include in Background/Deviation - [DisplayName("Include in Background/Deviation")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section LinkEnhanced")] - public string Section_LnkEnh - { - get - { - return _Xp["Section", "LnkEnh"]; - } - set - { - _Xp["Section", "LnkEnh"] = value; - OnPropertyChanged("Section_LnkEnh"); - } - } - [Category("General")] - //PROPGRID: Hide Include On Table Of Contents - [DisplayName("Include On Table Of Contents")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section TOC")] - public string Section_TOC - { - get - { - string tmp = _Xp["Section", "TOC"]; - return tmp == null || tmp == "" ? "N" : tmp; - } - set - { - _Xp["Section", "TOC"] = value; - OnPropertyChanged("Section_TOC"); - } - } - [Category("Section")] - //PROPGRID: Hide AutoGen - [DisplayName("Section AutoGen")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section AutoGen")] - public string Section_AutoGen - { - get - { - return _Xp["Section", "AutoGen"]; - } - set - { - _Xp["Section", "AutoGen"] = value; - OnPropertyChanged("Section_AutoGen"); - } - } - [Category("Section")] - //PROPGRID: Hide Subsection PH - [DisplayName("Section PrintHdr")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section PrintHdr")] - public string Section_PrintHdr - { - get - { - // if null - return a "Y" - string tmp = _Xp["Section", "PrintHdr"]; - return tmp == null || tmp == "" ? "Y" : tmp; - } - set - { - _Xp["Section", "PrintHdr"] = value; - OnPropertyChanged("Section_PrintHdr"); - } - } - [Browsable(false)] - [DisplayName("Section OriginalSteps")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section OriginalSteps")] - public string Section_OriginalSteps - { - get - { - return _Xp["Section", "OriginalSteps"]; - } - set - { - _Xp["Section", "OriginalSteps"] = value; - OnPropertyChanged("Section_OriginalSteps"); - } - } - [Category("Section")] - //PROPGRID: Hide Section NumPages - [Browsable(false)] - [DisplayName("Section NumPages")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section NumPages")] - public string Section_NumPages - { - get - { - return _Xp["Section", "NumPages"]; - } - set - { - _Xp["Section", "NumPages"] = value; - OnPropertyChanged("Section_NumPages"); - } - } - [TypeConverter(typeof(EnumDescConverter))] - public enum SectionColumnMode : int - { - //[Description("Format Default")] - //Default = 0, - [Description("Single Column")] - One = 1, - [Description("Dual Column")] - Two = 2, - [Description("Triple Column")] - Three = 3, - [Description("Quad Column")] - Four = 4 - } - [Category("Format")] - [DisplayName("Columns")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section ColumnMode")] - public SectionColumnMode Section_ColumnMode - { - get - { - string s = _Xp["Section", "ColumnMode"]; - - //If there is no value to get, then get the parent value (a.k.a. default value). - if (s == string.Empty) - s = _Xp.ParentValue("Section", "ColumnMode"); // get the parent value - // If there is no parent value, then use the volian default - if (s == string.Empty) - { - int rval = 0; - if (MyFormat != null) - { - rval = (int)MyFormat.MyStepSectionLayoutData.PMode; - //int rval = (int)MyFormat.MyStepSectionLayoutData.PMode; - //return (SectionColumnMode)rval;//SectionColumnMode.Two; //SectionColumnMode.Default;// default to volian default - } - else - { - //int rval = (int)MyDefaultFormat.MyStepSectionLayoutData.PMode; - rval = (int)MyDefaultFormat.MyStepSectionLayoutData.PMode; - //return (SectionColumnMode)rval; - } - // if no pmode is defined, i.e. rval = 0, then go up to the procedure level & get - // it's format column. - if (rval == 0) - { - SectionInfo si = _SectionInfo != null? _SectionInfo: SectionInfo.Get(_Section.ItemID); - if (si != null) - { - switch (si.MyProcedure.ProcedureConfig.Format_Columns) - { - case FormatColumns.OneColumn: - return SectionColumnMode.One; - break; - case FormatColumns.TwoColumn: - return SectionColumnMode.Two; - break; - default: - return SectionColumnMode.One; - break; - } - } - else - return SectionColumnMode.One; // 16bit's default if nothing defined - } - return (SectionColumnMode)rval; - } - else - return (SectionColumnMode)int.Parse(s); - - //if (s == string.Empty) - // return SectionColumnMode.Default; - - //return (SectionColumnMode)int.Parse(s); - } - set - { - // if value being saved is same as the parent value, then clear the value (save blank). This will - // reset the data to use the parent value. - - string parval = _Xp.ParentValue("Section", "ColumnMode"); // get the parent value - - if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default - { - int rval = 0; - // Use Inherited Format (ActiveFormat for Section) if MyFormat is Null - if (MyFormat == null) - { - FormatInfo myFormat = _Section == null ? _SectionInfo.ActiveFormat : SectionInfo.Get(_Section.ItemID).ActiveFormat; - rval = (int)myFormat.MyStepSectionLayoutData.PMode; - } - else - rval =(int)MyFormat.MyStepSectionLayoutData.PMode; - parval = ((rval > 0)?((SectionColumnMode)rval).ToString() : "2"); // if PMode is zero default to 2 column mode - //parval = ((SectionColumnMode)rval).ToString(); - //parval = ((int)(SectionColumnMode.Default)).ToString(); - } - - if (parval.Equals(((int)value).ToString())) - _Xp["Section", "ColumnMode"] = string.Empty; // reset to parent value - else - _Xp["Section", "ColumnMode"] = ((int)value).ToString(); // save selected value - - OnPropertyChanged("Section_ColumnMode"); - } - } -//char * far printtypes[] = { -// "Compressed, 8 lines per inch", -// "Elite, 6 lines per inch", -// "Pica, 6 lines per inch", -// "Default font, 4 Lines Per Inch", -// "Default font, 6 Lines Per Inch", -// "Compressed 6 LPI", -// "Default font, 7 Lines Per Inch", -// "Special Landscape, Elite, 6 lines per inch" -//}; - //[TypeConverter(typeof(EnumDescConverter))] - //public enum AttPrintSize : int - //{ - // [Description("Compressed, 8 lines per inch")] - // Cmp8lpi = 0, - // [Description("Elite, 6 lines per inch")] - // Elite6lpi = 1, - // [Description("Pica, 6 lines per inch")] - // Pica6lpi = 2, - // [Description("Default font, 4 Lines Per Inch")] - // Def4lpi = 3, - // [Description("Default font, 6 Lines Per Inch")] - // Def6lpi = 4, - // [Description("Compressed 6 LPI")] - // Cmp6lpi = 5, - // [Description("Default font, 7 Lines Per Inch")] - // Def7lpi = 6, - // [Description("Landscape, Elite, 6 lines per inch")] - // landElite6lpi = 7 - //} - - //[Category("Format")] - //[DisplayName("Attachment PrintSize")] - //[RefreshProperties(RefreshProperties.All)] - //[Description("Attachment Print Size")] - //public AttPrintSize Section_AttachmentPrintSize - //{ - // get - // { - // string lpiSettings = "*pP46f7L"; - // string s = _Xp["Section", "OldType"]; - // int idx = -1; - - // //If there is no value to get, then get the parent value (a.k.a. default value). - // if (s == string.Empty) - // s = _Xp.ParentValue("Section", "OldType"); // get the parent value - // // If there is no parent value, then use the volian default - // if (s == string.Empty) - // return AttPrintSize.Def6lpi;// default to volian default - - // idx = lpiSettings.IndexOf(s[1]); - // if (idx == -1) idx = 4; - // return (AttPrintSize)idx; - // //return (AttPrintSize)int.Parse(s); - // } - // set - // { - // // if value being saved is same as the parent value, then clear the value (save blank). This will - // // reset the data to use the parent value. - - // string lpiSettings = "*pP46f7L"; - // string parval = _Xp.ParentValue("Section", "OldType"); // get the parent value - // StringBuilder sb = new StringBuilder(); - // string curval = parval[1].ToString(); - - // sb.Append(parval[0]); // save first part of OldType - - // if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default - // { - // //parval = ((int)(AttPrintSize.Def6lpi)).ToString(); - // //sb.Append(((int)(AttPrintSize.Def6lpi)).ToString()); - // sb.Append(lpiSettings[(int)(AttPrintSize.Def6lpi)]); - // } - - // if (curval.Equals(((int)value).ToString())) - // _Xp["Section", "OldType"] = string.Empty; // reset to parent value - // else - // { - // //sb.Append(((int)value).ToString()); - // sb.Append(lpiSettings[(int)value]); - // _Xp["Section", "OldType"] = sb.ToString(); // save selected value - // } - - // OnPropertyChanged("Section_AttachmentPrintSize"); - // } - //} - /* - int chkOffType = (rid[0] & 0x007F) - '0'; - if (chkOffType > 0) - ci.AddItem("Section", "CheckoffSelection", chkOffType.ToString()); - - if (stype.Length > 1) - { - int chkOffHeading = (stype[1] & 0x007F) - '0'; - if (chkOffHeading > 0) - ci.AddItem("Section", "CheckoffHeading", chkOffHeading.ToString()); - */ - [Category("Format")] - [DisplayName("Checkoff List Selection")] - [Description("Checkoff List Selection")] - public int Section_CheckoffListSelection - { - get - { - string s = _Xp["Section", "CheckoffSelection"]; - if (s != null && !s.Equals(string.Empty)) - return Convert.ToInt32(s); - return 0; - } - set - { - string s = value.ToString(); - _Xp["Section", "CheckoffSelection"] = s; - } - } - [Category("Format")] - [DisplayName("Checkoff Header Selection")] - [RefreshProperties(RefreshProperties.All)] - [Description("Checkoff Header Selection")] - public int Section_CheckoffHeaderSelection - { - get - { - string s = _Xp["Section", "CheckoffHeading"]; - if (s != null && !s.Equals(string.Empty)) - return Convert.ToInt32(s); - return 0; - } - set - { - string s = value.ToString(); - _Xp["Section", "CheckoffHeading"] = s; - } - } - #endregion - #region SubSectionCategory // from sequence number in 16-bit database. - [Category("SubSection")] - //PROPGRID: Hide SubSection Edit - [Browsable(false)] - [DisplayName("SubSection Edit")] - [RefreshProperties(RefreshProperties.All)] - [Description("SubSection Edit")] - public string SubSection_Edit - { - get - { - // if null - return a "Y" - string tmp = _Xp["SubSection", "Edit"]; - return tmp == null || tmp == "" ? "N" : tmp; - } - set - { - _Xp["SubSection", "Edit"] = value; - OnPropertyChanged("SubSection_Edit"); - } - } - - [Category("SubSection")] - //PROPGRID: Hide Subsection AutoIndent - [Browsable(false)] - [DisplayName("SubSection AutoIndent")] - [RefreshProperties(RefreshProperties.All)] - [Description("SubSection AutoIndent")] - public string SubSection_AutoIndent - { - get - { - // if null - return a "Y" - string tmp = _Xp["SubSection", "AutoIndent"]; - return tmp==null||tmp==""?"Y":tmp; - } - set - { - _Xp["SubSection", "AutoIndent"] = value; - OnPropertyChanged("SubSection_AutoIndent"); - } - } - #endregion - #region LibDocCategory // from library document file during migration - [Category("LibraryDocument")] - //PROPGRID: Hide Libary Document Comment - [Browsable(false)] - [DisplayName("LibraryDocument Comment")] - [RefreshProperties(RefreshProperties.All)] - [Description("LibraryDocument Comment")] - public string LibDoc_Comment - { - get - { - return _Xp["LibraryDocument", "Comment"]; - } - set - { - _Xp["LibraryDocument", "Comment"] = value; - OnPropertyChanged("LibDoc_Comment"); - } - } - - #endregion - - #region IItemConfig Members - - [Category("Master/Slave Settings")] - [DisplayName("Applicability")] - [RefreshProperties(RefreshProperties.All)] - [Description("Scope Applicability")] - public Volian.Base.Library.BigNum MasterSlave_Applicability - { - get - { - string s = _Xp["MasterSlave", "Applicability"]; - return new Volian.Base.Library.BigNum(s); - } - set - { - _Xp["MasterSlave", "Applicability"] = value.FlagList; - OnPropertyChanged("MasterSlave_Applicability"); - } - } - - #endregion - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs.org b/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs.org deleted file mode 100644 index c83de056..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs.org +++ /dev/null @@ -1,753 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.ComponentModel; -using DescriptiveEnum; - -namespace VEPROMS.CSLA.Library -{ - [Serializable] - [TypeConverter(typeof(ExpandableObjectConverter))] - public class SectionConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged - { - #region DynamicTypeDescriptor - internal override bool IsReadOnly - { - get { return false; }//_Section == null; } - } - #endregion - #region XML - private XMLProperties _Xp; - private XMLProperties Xp - { - get { return _Xp; } - } - #endregion - #region Constructors - //PROPGRID: Hide ParentLookup - [Browsable(false)] - public bool ParentLookup - { - get { return _Xp.ParentLookup; } - set { _Xp.ParentLookup = value; } - } - //PROPGRID: Had to comment out NonSerialized to hide AncestorLookup from Property Grid - //[NonSerialized] - private bool _AncestorLookup; - //PROPGRID: Hide AncestorLookup - //[Browsable(false)] - //public bool AncestorLookup - //{ - // get { return _AncestorLookup; } - // set { _AncestorLookup = value; } - //} - private Section _Section; - private SectionInfo _SectionInfo; - private static int _SectionConfigUnique = 0; - private static int SectionConfigUnique - { get { return ++_SectionConfigUnique; } } - private int _MySectionConfigUnique = SectionConfigUnique; - public int MySectionConfigUnique // Absolutely Unique ID - Info - { get { return _MySectionConfigUnique; } } - - public SectionConfig(Section section) - { - _Section = section; - string xml = section.MyContent.Config; - if (xml == string.Empty) xml = ""; - _Xp = new XMLProperties(xml); - if (section.MySectionInfo.ActiveParent != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder); - } - private string Xp_LookInAncestorFolder(object sender, XMLPropertiesArgs args) - { - if (args.AncestorLookup || ParentLookup) - { - string retval; - SectionInfo sect = _Section != null ? _Section.MySectionInfo : _SectionInfo; - while (sect.ActiveParent.GetType() == typeof(SectionInfo)) - { - retval = sect.SectionConfig.GetValue(args.Group, args.Item); - if (retval != string.Empty) return retval; - sect = (SectionInfo)sect.ActiveParent; - } - ProcedureInfo proc = ProcedureInfo.Get(((ItemInfo)sect.ActiveParent).ItemID); - //ProcedureInfo proc = (ProcedureInfo)sect.ActiveParent; - retval = proc.ProcedureConfig.GetValue(args.Group, args.Item); - if (retval != string.Empty) return retval; - while (proc.ActiveParent.GetType() == typeof(ProcedureInfo)) - { - retval = proc.ProcedureConfig.GetValue(args.Group, args.Item); - if (retval != string.Empty) return retval; - proc = (ProcedureInfo)proc.ActiveParent; - } - DocVersionInfo docVersion = proc.ActiveParent as DocVersionInfo; - if (docVersion == null) return string.Empty; - retval = docVersion.DocVersionConfig.GetValue(args.Group, args.Item); - if (retval != string.Empty) return retval; - for (FolderInfo folder = docVersion.MyFolder; folder != null; folder = folder.MyParent) - { - retval = folder.FolderConfig.GetValue(args.Group, args.Item); - if (retval != string.Empty) return retval; - } - } - return string.Empty; - } - public SectionConfig(SectionInfo sectionInfo) - { - _SectionInfo = sectionInfo; - string xml = sectionInfo.MyContent.Config; - if (xml == string.Empty) xml = ""; - _Xp = new XMLProperties(xml); - if (_SectionInfo.ActiveParent != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder); - } - public SectionConfig(string xml) - { - if (xml == string.Empty) xml = ""; - _Xp = new XMLProperties(xml); - } - public SectionConfig() - { - _Xp = new XMLProperties(); - } - internal string GetValue(string group, string item) - { - return _Xp[group, item]; - } - #endregion - #region Local Properties - //[Category("Identification")] - [Category("General")] - [DisplayName("Number")] - [Description("Number")] - public string Number - { - get { return (_Section != null ? _Section.MyContent.Number : _SectionInfo.MyContent.Number); } - set { if (_Section != null) _Section.MyContent.Number = value; } - } - //[Category("Identification")] - [Category("General")] - [DisplayName("Title")] - [Description("Title")] - public string Title - { - get { return (_Section != null ? _Section.MyContent.Text : _SectionInfo.MyContent.Text); } - set { if (_Section != null) _Section.MyContent.Text = value; } - } - [Category("Identification")] - //PROPGRID: Hide Old Sequence - [Browsable(false)] - [DisplayName("Old Sequence")] - [Description("Old Sequence")] - public string OldSequence - { - get { return (_Section != null ? _Section.MyContent.MyZContent.OldStepSequence : (_SectionInfo.MyContent.MyZContent == null ? null : _SectionInfo.MyContent.MyZContent.OldStepSequence)); } - set { if (_Section != null) _Section.MyContent.MyZContent.OldStepSequence = value; } - } - [Category("Identification")] - //PROPGRID: Hide Dirty - [Browsable(false)] - [DisplayName("Dirty")] - [Description("Dirty")] - public bool Dirty - { - get { return (_Section != null ? _Section.IsDirty : false); } - } - [Category("Format")] - [DisplayName("Format")] - [Description("Format")] - [TypeConverter(typeof(FormatList))] - public string FormatSelection - { - get - { - if (_Section != null && _Section.MyContent.MyFormat != null) return _Section.MyContent.MyFormat.FullName; - if (_SectionInfo != null && _SectionInfo.MyContent.MyFormat != null) return _SectionInfo.MyContent.MyFormat.FullName; - return null; - } - set - { - if (_Section != null) - { - _Section.MyContent.MyFormat = FormatList.ToFormat(value); // Can only be set if _DocVersion is set - //_Section.ActiveFormat = null; - DocStyleListConverter.MySection = _Section; - } - } - } - [Browsable(false)] - public FormatInfo MyFormat - { - get - { - if (_Section != null) - { - SectionInfo sectionInfo = SectionInfo.Get(_Section.ItemID); - return sectionInfo.LocalFormat; - } - if (_SectionInfo != null)return _SectionInfo.LocalFormat; - return null; - } - set - { - if (_Section != null) - _Section.MyContent.MyFormat = value == null ? null : value.Get(); - } - } - [Category("Format")] - [DisplayName("Default Format")] - [Description("Default Format")] - [TypeConverter(typeof(FormatList))] - public string DefaultFormatSelection - { - get - { - if (_Section != null && _Section.MySectionInfo.ActiveParent != null && _Section.MySectionInfo.ActiveParent.ActiveFormat != null) return _Section.MySectionInfo.ActiveParent.ActiveFormat.FullName; - if (_SectionInfo != null && _SectionInfo.MyParent != null && _SectionInfo.MyParent.ActiveFormat != null) return _SectionInfo.MyParent.ActiveFormat.FullName; - return null; - } - } - [Browsable(false)] - public FormatInfo MyDefaultFormat - { - get - { - if (_Section != null) return _Section.MySectionInfo.ActiveParent.ActiveFormat; - return _SectionInfo.ActiveParent.ActiveFormat; - } - } - //[Browsable(false)] - [Category("Format")] - [DisplayName("Section Type")] - [Description("Section Type")] - [TypeConverter(typeof(DocStyleListConverter))] - public string MySectionType - { - get - { - if (_Section != null) - { - return DocStyleListConverter.ToString(_Section.MyContent.Type); - } - return string.Empty; - } - set - { - if (_Section != null) - _Section.MyContent.Type = DocStyleListConverter.ToSectionType(value); - } - } - [Browsable(false)] - public int? SectionType - { - get - { - if (_Section != null) - { - return _Section.MyContent.Type-10000; - } - return null; - } - set - { - if (_Section != null) - _Section.MyContent.Type = value+10000; - } - } - public Section MySection - { get { return _Section; } } - [Category("Format")] - [DisplayName("Keep Word Document Margins")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section WordMargin")] - public string Section_WordMargin - { - get - { - string tmp = _Xp["Section", "WordMargin"]; - return tmp == null || tmp == "" ? "N" : tmp; - } - set - { - _Xp["Section", "WordMargin"] = value; - OnPropertyChanged("Section_WordMargin"); - } - } - #endregion - #region ToString - public override string ToString() - { - string s = _Xp.ToString(); - if (s == "" || s == "") return string.Empty; - return s; - } - #endregion - #region SectionCategory // from sequence number in 16-bit database. - [TypeConverter(typeof(EnumDescConverter))] - public enum SectionPagination : int - { - //Default = 0, Continuous, Separate - Continuous = 1, Separate = 2 - } - [Category("Format")] - [DisplayName("Section Pagination")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section Pagination")] - public SectionPagination Section_Pagination - { - get - { - string s = _Xp["Section", "Pagination"]; - - //If there is no value to get, then get the parent value (a.k.a. default value). - if (s == string.Empty) - s = _Xp.ParentValue("Section", "Pagination"); // get the parent value - //If there is no parent value, then use the volian default - if (s == string.Empty) - { - if (MyFormat != null) - { - bool rval = MyFormat.MyStepSectionLayoutData.BreakOnSections; - return (rval) ? SectionPagination.Separate : SectionPagination.Continuous;// default to volian default - } - else - { - bool rval = MyDefaultFormat.MyStepSectionLayoutData.BreakOnSections; - return (rval) ? SectionPagination.Separate : SectionPagination.Continuous;// default to volian default - } - } - return (SectionPagination)int.Parse(s); - } - set - { - // if value being saved is same as the parent value, then clear the value (save blank). This will - // reset the data to use the parent value. - - string parval = _Xp.ParentValue("Section", "Pagination"); // get the parent value - - if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default - { - bool rval = _Section.MySectionInfo.ActiveFormat.MyStepSectionLayoutData.BreakOnSections; - parval = (rval) ? ((int)(SectionPagination.Separate)).ToString() : ((int)(SectionPagination.Continuous)).ToString(); - //parval = ((int)(SectionPagination.Default)).ToString(); - } - - if (parval.Equals(((int)value).ToString())) - _Xp["Section", "Pagination"] = string.Empty; // reset to parent value - else - _Xp["Section", "Pagination"] = ((int)value).ToString(); // save selected value - - OnPropertyChanged("Section_Pagination"); - } - } - [Category("View Settings")] - //PROPGRID: Hide Include in Background/Deviation - [DisplayName("Include in Background/Deviation")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section LinkEnhanced")] - public string Section_LnkEnh - { - get - { - return _Xp["Section", "LnkEnh"]; - } - set - { - _Xp["Section", "LnkEnh"] = value; - OnPropertyChanged("Section_LnkEnh"); - } - } - [Category("General")] - //PROPGRID: Hide Include On Table Of Contents - [DisplayName("Include On Table Of Contents")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section TOC")] - public string Section_TOC - { - get - { - string tmp = _Xp["Section", "TOC"]; - return tmp == null || tmp == "" ? "N" : tmp; - } - set - { - _Xp["Section", "TOC"] = value; - OnPropertyChanged("Section_TOC"); - } - } - [Category("Section")] - //PROPGRID: Hide AutoGen - [DisplayName("Section AutoGen")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section AutoGen")] - public string Section_AutoGen - { - get - { - return _Xp["Section", "AutoGen"]; - } - set - { - _Xp["Section", "AutoGen"] = value; - OnPropertyChanged("Section_AutoGen"); - } - } - [Category("Section")] - //PROPGRID: Hide Subsection PH - [DisplayName("Section PrintHdr")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section PrintHdr")] - public string Section_PrintHdr - { - get - { - // if null - return a "Y" - string tmp = _Xp["Section", "PrintHdr"]; - return tmp == null || tmp == "" ? "Y" : tmp; - } - set - { - _Xp["Section", "PrintHdr"] = value; - OnPropertyChanged("Section_PrintHdr"); - } - } - [Browsable(false)] - [DisplayName("Section OriginalSteps")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section OriginalSteps")] - public string Section_OriginalSteps - { - get - { - return _Xp["Section", "OriginalSteps"]; - } - set - { - _Xp["Section", "OriginalSteps"] = value; - OnPropertyChanged("Section_OriginalSteps"); - } - } - [Category("Section")] - //PROPGRID: Hide Section NumPages - [Browsable(false)] - [DisplayName("Section NumPages")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section NumPages")] - public string Section_NumPages - { - get - { - return _Xp["Section", "NumPages"]; - } - set - { - _Xp["Section", "NumPages"] = value; - OnPropertyChanged("Section_NumPages"); - } - } - [TypeConverter(typeof(EnumDescConverter))] - public enum SectionColumnMode : int - { - //[Description("Format Default")] - //Default = 0, - [Description("Single Column")] - One = 1, - [Description("Dual Column")] - Two = 2, - [Description("Triple Column")] - Three = 3, - [Description("Quad Column")] - Four = 4 - } - [Category("Format")] - [DisplayName("Columns")] - [RefreshProperties(RefreshProperties.All)] - [Description("Section ColumnMode")] - public SectionColumnMode Section_ColumnMode - { - get - { - string s = _Xp["Section", "ColumnMode"]; - //If there is no value to get, then get the parent value (a.k.a. default value). - if (s == string.Empty) - s = _Xp.ParentValue("Section", "ColumnMode"); // get the parent value - // If there is no parent value, then use the volian default - if (s == string.Empty) - { - int rval = 0; - if (MyFormat != null) - { - rval = (int)MyFormat.MyStepSectionLayoutData.PMode; - //int rval = (int)MyFormat.MyStepSectionLayoutData.PMode; - //return (SectionColumnMode)rval;//SectionColumnMode.Two; //SectionColumnMode.Default;// default to volian default - } - else - { - //int rval = (int)MyDefaultFormat.MyStepSectionLayoutData.PMode; - rval = (int)MyDefaultFormat.MyStepSectionLayoutData.PMode; - //return (SectionColumnMode)rval; - } - // if no pmode is defined, i.e. rval = 0, then go up to the procedure level & get - // it's format column. - if (rval == 0) - { - SectionInfo si = _SectionInfo != null? _SectionInfo: SectionInfo.Get(_Section.ItemID); - if (si != null) - { - switch (si.MyProcedure.ProcedureConfig.Format_Columns) - { - case FormatColumns.OneColumn: - return SectionColumnMode.One; - break; - case FormatColumns.TwoColumn: - return SectionColumnMode.Two; - break; - default: - return SectionColumnMode.One; - break; - } - } - else - return SectionColumnMode.One; // 16bit's default if nothing defined - } - return (SectionColumnMode)rval; - } - else - return (SectionColumnMode)int.Parse(s); - - //if (s == string.Empty) - // return SectionColumnMode.Default; - - //return (SectionColumnMode)int.Parse(s); - } - set - { - // if value being saved is same as the parent value, then clear the value (save blank). This will - // reset the data to use the parent value. - - string parval = _Xp.ParentValue("Section", "ColumnMode"); // get the parent value - - if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default - { - int rval = 0; - // Use Inherited Format (ActiveFormat for Section) if MyFormat is Null - if (MyFormat == null) - { - FormatInfo myFormat = _Section == null ? _SectionInfo.ActiveFormat : SectionInfo.Get(_Section.ItemID).ActiveFormat; - rval = (int)myFormat.MyStepSectionLayoutData.PMode; - } - else - rval =(int)MyFormat.MyStepSectionLayoutData.PMode; - parval = ((rval > 0)?((SectionColumnMode)rval).ToString() : "2"); // if PMode is zero default to 2 column mode - //parval = ((SectionColumnMode)rval).ToString(); - //parval = ((int)(SectionColumnMode.Default)).ToString(); - } - - if (parval.Equals(((int)value).ToString())) - _Xp["Section", "ColumnMode"] = string.Empty; // reset to parent value - else - _Xp["Section", "ColumnMode"] = ((int)value).ToString(); // save selected value - - OnPropertyChanged("Section_ColumnMode"); - } - } -//char * far printtypes[] = { -// "Compressed, 8 lines per inch", -// "Elite, 6 lines per inch", -// "Pica, 6 lines per inch", -// "Default font, 4 Lines Per Inch", -// "Default font, 6 Lines Per Inch", -// "Compressed 6 LPI", -// "Default font, 7 Lines Per Inch", -// "Special Landscape, Elite, 6 lines per inch" -//}; - //[TypeConverter(typeof(EnumDescConverter))] - //public enum AttPrintSize : int - //{ - // [Description("Compressed, 8 lines per inch")] - // Cmp8lpi = 0, - // [Description("Elite, 6 lines per inch")] - // Elite6lpi = 1, - // [Description("Pica, 6 lines per inch")] - // Pica6lpi = 2, - // [Description("Default font, 4 Lines Per Inch")] - // Def4lpi = 3, - // [Description("Default font, 6 Lines Per Inch")] - // Def6lpi = 4, - // [Description("Compressed 6 LPI")] - // Cmp6lpi = 5, - // [Description("Default font, 7 Lines Per Inch")] - // Def7lpi = 6, - // [Description("Landscape, Elite, 6 lines per inch")] - // landElite6lpi = 7 - //} - - //[Category("Format")] - //[DisplayName("Attachment PrintSize")] - //[RefreshProperties(RefreshProperties.All)] - //[Description("Attachment Print Size")] - //public AttPrintSize Section_AttachmentPrintSize - //{ - // get - // { - // string lpiSettings = "*pP46f7L"; - // string s = _Xp["Section", "OldType"]; - // int idx = -1; - - // //If there is no value to get, then get the parent value (a.k.a. default value). - // if (s == string.Empty) - // s = _Xp.ParentValue("Section", "OldType"); // get the parent value - // // If there is no parent value, then use the volian default - // if (s == string.Empty) - // return AttPrintSize.Def6lpi;// default to volian default - - // idx = lpiSettings.IndexOf(s[1]); - // if (idx == -1) idx = 4; - // return (AttPrintSize)idx; - // //return (AttPrintSize)int.Parse(s); - // } - // set - // { - // // if value being saved is same as the parent value, then clear the value (save blank). This will - // // reset the data to use the parent value. - - // string lpiSettings = "*pP46f7L"; - // string parval = _Xp.ParentValue("Section", "OldType"); // get the parent value - // StringBuilder sb = new StringBuilder(); - // string curval = parval[1].ToString(); - - // sb.Append(parval[0]); // save first part of OldType - - // if (parval.Equals(string.Empty)) // if the parent value is empty, then use the volian default - // { - // //parval = ((int)(AttPrintSize.Def6lpi)).ToString(); - // //sb.Append(((int)(AttPrintSize.Def6lpi)).ToString()); - // sb.Append(lpiSettings[(int)(AttPrintSize.Def6lpi)]); - // } - - // if (curval.Equals(((int)value).ToString())) - // _Xp["Section", "OldType"] = string.Empty; // reset to parent value - // else - // { - // //sb.Append(((int)value).ToString()); - // sb.Append(lpiSettings[(int)value]); - // _Xp["Section", "OldType"] = sb.ToString(); // save selected value - // } - - // OnPropertyChanged("Section_AttachmentPrintSize"); - // } - //} - /* - int chkOffType = (rid[0] & 0x007F) - '0'; - if (chkOffType > 0) - ci.AddItem("Section", "CheckoffSelection", chkOffType.ToString()); - - if (stype.Length > 1) - { - int chkOffHeading = (stype[1] & 0x007F) - '0'; - if (chkOffHeading > 0) - ci.AddItem("Section", "CheckoffHeading", chkOffHeading.ToString()); - */ - [Category("Format")] - [DisplayName("Checkoff List Selection")] - [Description("Checkoff List Selection")] - public int Section_CheckoffListSelection - { - get - { - string s = _Xp["Section", "CheckoffSelection"]; - if (s != null && !s.Equals(string.Empty)) - return Convert.ToInt32(s); - return 0; - } - set - { - string s = value.ToString(); - _Xp["Section", "CheckoffSelection"] = s; - } - } - [Category("Format")] - [DisplayName("Checkoff Header Selection")] - [RefreshProperties(RefreshProperties.All)] - [Description("Checkoff Header Selection")] - public int Section_CheckoffHeaderSelection - { - get - { - string s = _Xp["Section", "CheckoffHeading"]; - if (s != null && !s.Equals(string.Empty)) - return Convert.ToInt32(s); - return 0; - } - set - { - string s = value.ToString(); - _Xp["Section", "CheckoffHeading"] = s; - } - } - #endregion - #region SubSectionCategory // from sequence number in 16-bit database. - [Category("SubSection")] - //PROPGRID: Hide SubSection Edit - [Browsable(false)] - [DisplayName("SubSection Edit")] - [RefreshProperties(RefreshProperties.All)] - [Description("SubSection Edit")] - public string SubSection_Edit - { - get - { - // if null - return a "Y" - string tmp = _Xp["SubSection", "Edit"]; - return tmp == null || tmp == "" ? "N" : tmp; - } - set - { - _Xp["SubSection", "Edit"] = value; - OnPropertyChanged("SubSection_Edit"); - } - } - - [Category("SubSection")] - //PROPGRID: Hide Subsection AutoIndent - [Browsable(false)] - [DisplayName("SubSection AutoIndent")] - [RefreshProperties(RefreshProperties.All)] - [Description("SubSection AutoIndent")] - public string SubSection_AutoIndent - { - get - { - // if null - return a "Y" - string tmp = _Xp["SubSection", "AutoIndent"]; - return tmp==null||tmp==""?"Y":tmp; - } - set - { - _Xp["SubSection", "AutoIndent"] = value; - OnPropertyChanged("SubSection_AutoIndent"); - } - } - #endregion - #region LibDocCategory // from library document file during migration - [Category("LibraryDocument")] - //PROPGRID: Hide Libary Document Comment - [Browsable(false)] - [DisplayName("LibraryDocument Comment")] - [RefreshProperties(RefreshProperties.All)] - [Description("LibraryDocument Comment")] - public string LibDoc_Comment - { - get - { - return _Xp["LibraryDocument", "Comment"]; - } - set - { - _Xp["LibraryDocument", "Comment"] = value; - OnPropertyChanged("LibDoc_Comment"); - } - } - - #endregion - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Config/StepConfig.cs.bak b/PROMS/VEPROMS.CSLA.Library/Config/StepConfig.cs.bak deleted file mode 100644 index 490afb5e..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Config/StepConfig.cs.bak +++ /dev/null @@ -1,240 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.ComponentModel; -using DescriptiveEnum; - -namespace VEPROMS.CSLA.Library -{ - [Serializable] - [TypeConverter(typeof(ExpandableObjectConverter))] - public class StepConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged, IItemConfig - { - #region DynamicTypeDescriptor - internal override bool IsReadOnly - { - get { return false; }//_Section == null; } - } - #endregion - #region XML - private XMLProperties _Xp; - private XMLProperties Xp - { - get { return _Xp; } - } - #endregion - #region Constructors - //PROPGRID: Hide ParentLookup - [Browsable(false)] - public bool ParentLookup - { - get { return _Xp.ParentLookup; } - set { _Xp.ParentLookup = value; } - } - //PROPGRID: Had to comment out NonSerialized to hide AncestorLookup from Property Grid - //[NonSerialized] - //private bool _AncestorLookup; - ////PROPGRID: Hide AncestorLookup - //[Browsable(false)] - //public bool AncestorLookup - //{ - // get { return _AncestorLookup; } - // set { _AncestorLookup = value; } - //} - private Step _Step; - private StepInfo _StepInfo; - public StepConfig(Step step) - { - _Step = step; - string xml = step.MyContent.Config; - if (xml == string.Empty) xml = ""; - _Xp = new XMLProperties(xml); - } - public StepConfig(StepInfo stepInfo) - { - _StepInfo = stepInfo; - string xml = stepInfo.MyContent.Config; - if (xml == string.Empty) xml = ""; - _Xp = new XMLProperties(xml); - } - public StepConfig(string xml) - { - if (xml == string.Empty) xml = ""; - _Xp = new XMLProperties(xml); - } - public StepConfig() - { - _Xp = new XMLProperties(); - } - internal string GetValue(string group, string item) - { - return _Xp[group, item]; - } - #endregion - #region Local Properties - - #endregion - #region ToString - public override string ToString() - { - string s = _Xp.ToString(); - if (s == "" || s == "") return string.Empty; - return s; - } - #endregion - #region StepAttr - //[Category("Step Attributes")] - //[DisplayName("Step Continuous Action Summary")] - //[RefreshProperties(RefreshProperties.All)] - //[Description("Step Continuous Action Summary")] - public bool Step_CAS - { - get - { - string s = _Xp["Step", "ContActSum"]; - - //If there is no value to get, then get the parent value (a.k.a. default value). - if (s == string.Empty) return false; - if (s == "True") return true; - return false; - } - set - { - string s = _Xp["Step", "ContActSum"]; - if (value.ToString() == s) return; - _Xp["Step", "ContActSum"] = value.ToString(); - OnPropertyChanged("Step_CAS"); - } - } - //[Category("Step Attributes")] - //[DisplayName("Step Check Off Index")] - //[RefreshProperties(RefreshProperties.All)] - //[Description("Step Check Off Index")] - public int Step_CheckOffIndex - { - get - { - string s = _Xp["Step", "CheckOffIndex"]; - - if (s == string.Empty) return 0; - - return int.Parse(s); - } - set - { - string s = _Xp["Step", "CheckOffIndex"]; - if (value.ToString() == s) return; - _Xp["Step", "CheckOffIndex"] = value.ToString(); - OnPropertyChanged("Step_CheckOffIndex"); - } - } - //[Category("Step Attributes")] - //[DisplayName("Step Manual Pagebreak")] - //[RefreshProperties(RefreshProperties.All)] - //[Description("Step Manual Pagebreak")] - public bool Step_ManualPagebreak - { - get - { - string s = _Xp["Step", "ManualPagebreak"]; - - if (s == string.Empty) return false; - if (s == "True") return true; - return false; - } - set - { - string s = _Xp["Step", "ManualPagebreak"]; - if (value.ToString() == s) return; - _Xp["Step", "ManualPagebreak"] = value.ToString(); - OnPropertyChanged("Step_ManualPagebreak"); - } - } - public bool Step_NewManualPagebreak - { - get - { - string s = _Xp["Step", "NewManualPagebreak"]; - - if (s == string.Empty) return false; - if (s == "True") return true; - return false; - } - set - { - string s = _Xp["Step", "NewManualPagebreak"]; - if (value.ToString() == s) return; - _Xp["Step", "NewManualPagebreak"] = value.ToString(); - OnPropertyChanged("Step_NewManualPagebreak"); - } - } - //[Category("Step Attributes")] - //[DisplayName("Step Change Bar Override")] - //[RefreshProperties(RefreshProperties.All)] - //[Description("Step Change Bar Override")] - public string Step_CBOverride - { - get - { - string s = _Xp["Step", "CBOverride"]; - - if (s == string.Empty) return null; - return s; - } - set - { - string s = _Xp["Step", "CBOverride"]; - - if (value != null && value.ToString() == s) return; - if (value == null && s != null) _Xp["Step", "CBOverride"] = null; - else _Xp["Step", "CBOverride"] = value.ToString(); - OnPropertyChanged("Step_CBOverride"); - } - } - public string Step_MultipleChangeID - { - get - { - string s = _Xp["Step", "MultipleChangeID"]; - - if (s == string.Empty) return null; - return s; - } - set - { - string s = _Xp["Step", "MultipleChangeID"]; - - if (value != null && value.ToString() == s) return; - if (value == null && s != null) _Xp["Step", "MultipleChangeID"] = null; - else _Xp["Step", "MultipleChangeID"] = value.ToString(); - OnPropertyChanged("Step_MultipleChangeID"); - } - } - #endregion - - #region IItemConfig Members - - [Category("Master/Slave Settings")] - [DisplayName("Applicability")] - [RefreshProperties(RefreshProperties.All)] - [Description("Scope Applicability")] - public Volian.Base.Library.BigNum MasterSlave_Applicability - { - get - { - string s = _Xp["MasterSlave", "Applicability"]; - return new Volian.Base.Library.BigNum(s); - } - set - { - if (value != null) - _Xp["MasterSlave", "Applicability"] = value.FlagList; - else - _Xp["MasterSlave", "Applicability"] = null; - OnPropertyChanged("MasterSlave_Applicability"); - } - } - - #endregion - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/AnnotationExt.cs.bak b/PROMS/VEPROMS.CSLA.Library/Extension/AnnotationExt.cs.bak deleted file mode 100644 index 10000df0..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/AnnotationExt.cs.bak +++ /dev/null @@ -1,326 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Data; -using System.Data.SqlClient; -using System.Text.RegularExpressions; -using Csla; -using Csla.Data; - -namespace VEPROMS.CSLA.Library -{ - public partial class AnnotationInfo - { - public override string ToString() - { - return _SearchText; - } - #region JCB Annotation Status - private bool _IsAnnotationNew = false; - - public bool IsAnnotationNew - { - get - { - ProcedureInfo pi = this.MyItem.MyProcedure; - if (pi != null) - //todo figure out audit count - _IsAnnotationNew = (this.DTS > pi.DTS); - return _IsAnnotationNew; - } - } - private bool _IsAnnotationChanged; - - public bool IsAnnotationChanged - { - get - { - ProcedureInfo pi = this.MyItem.MyProcedure; - if (pi != null) - { - //todo figure out audit count - _IsAnnotationChanged = (this.DTS > pi.DTS); - } - return _IsAnnotationChanged; - } - } - #endregion - - } - public partial class AnnotationType - { - public override string ToString() - { - return _Name; - } - public static AnnotationType GetByName2(string name) - { - try - { - AnnotationType tmp = DataPortal.Fetch(new GetByNameCriteria(name)); - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up AnnotationType - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationType.GetByName", ex); - } - } - [Serializable()] - protected class GetByNameCriteria - { - private string _Name; - public string Name { get { return _Name; } } - public GetByNameCriteria(string name) - { - _Name = name; - } - } - private void DataPortal_Fetch(GetByNameCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationType.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationTypeByName"; - cm.Parameters.AddWithValue("@Name", criteria.Name); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationType.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationType.DataPortal_Fetch", ex); - } - } - } - public partial class AnnotationTypeInfo - { - public static List AllList() - { - //return _AllList; - return AnnotationTypeInfo._CacheList; - } - public override string ToString() - { - return _Name; - } - public static AnnotationTypeInfo GetByName(string name) - { - try - { - AnnotationTypeInfo tmp = DataPortal.Fetch(new GetByNameCriteria(name)); - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up AnnotationTypeInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationTypeInfo.GetByName", ex); - } - } - [Serializable()] - protected class GetByNameCriteria - { - private string _Name; - public string Name { get { return _Name; } } - public GetByNameCriteria(string name) - { - _Name = name; - } - } - private void DataPortal_Fetch(GetByNameCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationTypeInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationTypeByName"; - cm.Parameters.AddWithValue("@Name", criteria.Name); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationTypeInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationTypeInfo.DataPortal_Fetch", ex); - } - } - } - public partial class AnnotationTypeInfoList - { - public static void Refresh() - { - Reset(); - _AnnotationTypeInfoList = Get(); - } - } - public partial class Annotation - { - /// - /// Change the annotation type and update the Annotation record - /// - /// - public void Update(int anotypeid) - { - if (_TypeID != anotypeid) - { - _TypeID = anotypeid; - MarkDirty(); // force the record update - Save(); - //Update(); // commit record to database - } - } - public void CommitChanges() - { - MarkDirty(); // force the record update - Save(true); - //Update(); - } - - public static void DeleteAnnotation(AnnotationInfo obj) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Annotation"); - try - { - // ItemInfo nextItem = item.NextItem; - // ItemInfo prevItem = item.MyPrevious; - // item.OnBeforeDelete(); - DataPortal.Delete(new DeleteCriteria(obj.AnnotationID, Volian.Base.Library.VlnSettings.UserID)); - AnnotationInfo.StaticOnInfoChanged(); - // if (nextItem != null) // Adjust PreviousID for NextItem - // { - // ItemInfo.RefreshPrevious(nextItem.ItemID, item.PreviousID); - // // The order of the next two methods was required to fix a null reference - // // when getting myparent. This bug was found when deleting a node from the - // // tree when the RTBItem was not open (i.e. in the step editor window). - // nextItem.RefreshItemParts(); - // //nextItem.ResetOrdinal(); - UpdateTransitionText calls ResetOrdinal - // nextItem.UpdateTransitionText(); - // } - // else if (prevItem != null) - // { - // prevItem.RefreshNextItems(); - // if (prevItem.IsCaution || prevItem.IsNote) prevItem.ResetOrdinal(); - // prevItem.UpdateTransitionText(); - // } - // ItemInfo.DeleteItemInfoAndChildren(item.ItemID); // Dispose ItemInfo and Children - } - catch (Exception ex) - { - Console.WriteLine("AnnotationExt: Stacktrace = {0}", ex.StackTrace); - System.Data.SqlClient.SqlException exSQL = SqlException(ex); - if (exSQL != null && exSQL.Message.Contains("###Cannot Delete Item###")) - //return false; - throw exSQL; - else - throw new DbCslaException("Error on Annotation.Delete", ex); - } - } - private static System.Data.SqlClient.SqlException SqlException(Exception ex) - { - Type sqlExType = typeof(System.Data.SqlClient.SqlException); - while (ex != null) - { - if (ex.GetType() == sqlExType) return ex as System.Data.SqlClient.SqlException; - ex = ex.InnerException; - } - return null; - } - - [Serializable()] - protected class DeleteCriteria - { - private int _AnnotationID; - public int AnnotationID - { get { return _AnnotationID; } } - private string _UserID; - public string UserID - { - get { return _UserID; } - set { _UserID = value; } - } - public DeleteCriteria(int annotationID, String userID) - { - _AnnotationID = annotationID; - _UserID = userID; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(DeleteCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteAnnotationWithUserID"; - cm.Parameters.AddWithValue("@AnnotationID", criteria.AnnotationID); - cm.Parameters.AddWithValue("@UserID", criteria.UserID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Item.DataPortal_Delete", ex); - } - } - } - //public partial class AnnotationTypeAnnotations - //{ - // public static int GetAnnotationID() - // { - // return AnnotationTypeAnnotat - // } - //} -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs.bak b/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs.bak deleted file mode 100644 index 58dd9bef..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/AuditExt.cs.bak +++ /dev/null @@ -1,1790 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Csla; -using Csla.Data; -using Csla.Validation; -using System.Data.SqlClient; -using System.Data; -using System.Text.RegularExpressions; - -namespace VEPROMS.CSLA.Library -{ - public partial class AnnotationAuditInfo - { - internal string _ActionWhat; - public string ActionWhat - { - get { return _ActionWhat; } - set { _ActionWhat = value; } - } - internal DateTime _ActionWhen; - public DateTime ActionWhen - { - get { return _ActionWhen; } - set { _ActionWhen = value; } - } - internal int _IContentID; - public int IContentID - { - get { return _IContentID; } - set { _IContentID = value; } - } - public ItemInfo MyItemInfo - { - get {return ItemInfo.Get(this.ItemID);} - } - public string ListString() - { - string who = string.Empty; - string when = string.Empty; - if (this.UserID != "Migration" || this.TypeID != 1) - 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.DeleteStatus == 0 ? "Changed" : "Deleted", who, when); - } - public override string ToString() - { - string itemTitle = Regex.Replace(this.MyItemInfo.SearchPath, "^..+?\\u0007", ""); - itemTitle = itemTitle.Replace("\x11", itemTitle[0] == '\x11' ? "" : " - ").Replace("\\u8209?", "-"); - return string.Format("{0} Annotation {1}", itemTitle, this.ListString()); - } - } - - public partial class ContentAuditInfo - { - internal string _ActionWhat; - public string ActionWhat - { - get { return _ActionWhat; } - set { _ActionWhat = value; } - } - internal DateTime _ActionWhen; - public DateTime ActionWhen - { - get { return _ActionWhen; } - set { _ActionWhen = value; } - } - internal string _Path; - public string Path - { - get { return _Path; } - set { _Path = value; } - } - internal int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - internal string _Typename; - public string TypeName - { - get { return _Typename; } - set { _Typename = value; } - } - public override string ToString() - { - string itemTitle = Regex.Replace(this.Path, "^..+?\\u0007", ""); - itemTitle = itemTitle.Replace("\x11", itemTitle[0] == '\x11' ? "" : " - ").Replace("\\u8209?", "-"); - 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("{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"); - } - public string ListString() - { - string who = string.Empty; - string when = string.Empty; - if (this.UserID != "Migration") - 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); - } - } - - public partial class DocumentAuditInfo - { - public override string ToString() - { - return string.Format("{0} - {1} {2}", this.UserID, this.DTS, this.DeleteStatus == 0 ? "" : "Deleted"); - } - } - - public partial class EntryAuditInfo - { - public override string ToString() - { - return string.Format("{0} - {1} {2}", this.UserID, this.DTS, this.DeleteStatus == 0 ? "" : "Deleted"); - } - } - - public partial class GridAuditInfo - { - public override string ToString() - { - 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"); - } - } - - public partial class ImageAuditInfo - { - public override string ToString() - { - return string.Format("{0} - {1} {2}", this.UserID, this.DTS, this.DeleteStatus == 0 ? "" : "Deleted"); - } - } - - public partial class ItemAuditInfo - { - public static bool IsChangeManagerVersion() - { - try - { - using (ItemAuditInfoList list = ItemAuditInfoList.Get()) - { - ; - } - } - catch (Exception ex1) - { - Exception ex = ex1; - while (ex.InnerException != null) - ex = ex.InnerException; - if (ex.Message.StartsWith("Could not find stored procedure")) - { - System.Windows.Forms.MessageBox.Show("Running Change Manager Code with Non-Change Manager Data", "Inconsistent Data", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); - return false; - } - throw new Exception("Failed on check of Change Manager Data",ex1); - } - return true; - } - internal int _Level; - public int Level - { - get { return _Level; } - } - internal string _ItemType; - public string ItemType - { - get { return _ItemType; } - } - - 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("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()); - } - } - - public partial class PartAuditInfo - { - public override string ToString() - { - return string.Format("{0} - {1} {2}", this.UserID, this.DTS, this.DeleteStatus == 0 ? "" : "Deleted"); - } - } - - public partial class AnnotationAuditInfoList - { - /// - /// Return a list of all AnnotationAuditInfo by ItemID. - /// - /// Selected ItemID for Annotation Audit Records - /// - public static AnnotationAuditInfoList GetByItemID(int itemID) - { - try - { - //if (_AnnotationAuditInfoList != null) - // return _AnnotationAuditInfoList; - AnnotationAuditInfoList tmp = DataPortal.Fetch(new ItemIDCriteria(itemID)); - //AnnotationAuditInfo.AddList(tmp); - //tmp.AddEvents(); - //_AnnotationAuditInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationAuditInfoList.GetByItemID", ex); - } - } - [Serializable()] - protected class ItemIDCriteria - { - private int _ItemID; - public int ItemID - { get { return _ItemID; } } - public ItemIDCriteria(int itemID) - { - _ItemID = itemID; - } - } - private void DataPortal_Fetch(ItemIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationAuditsByItemID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new AnnotationAuditInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("AnnotationAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - - public static AnnotationAuditInfoList GetByAnnotationID(int annotationID) - { - try - { - //if (_AnnotationAuditInfoList != null) - // return _AnnotationAuditInfoList; - AnnotationAuditInfoList tmp = DataPortal.Fetch(new AnnotationIDCriteria(annotationID)); - //AnnotationAuditInfo.AddList(tmp); - //tmp.AddEvents(); - //_AnnotationAuditInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationAuditInfoList.GetByAnnotationID", ex); - } - } - [Serializable()] - protected class AnnotationIDCriteria - { - private int _AnnotationID; - public int AnnotationID - { get { return _AnnotationID; } } - public AnnotationIDCriteria(int annotationID) - { - _AnnotationID = annotationID; - } - } - private void DataPortal_Fetch(AnnotationIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationAuditsByAnnotationID"; - cm.Parameters.AddWithValue("@AnnotationID", criteria.AnnotationID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new AnnotationAuditInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("AnnotationAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - - #region ChronologyReport - //chronology report - public static AnnotationAuditInfoList GetChronology(int @procItemID, int itemID) - { - try - { - AnnotationAuditInfoList tmp = DataPortal.Fetch(new ChronologyCriteria(procItemID, itemID)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationAuditInfoList.GetChronology", ex); - } - } - [Serializable()] - protected class ChronologyCriteria - { - private int _procItemID; - public int ProcItemID - { - get { return _procItemID; } - } - private int _itemID; - public int ItemID - { - get { return _itemID; } - } - public ChronologyCriteria(int procItemID, int itemID) - { - _procItemID = procItemID; - _itemID = itemID; - } - } - private void DataPortal_Fetch(ChronologyCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationAuditsChronologyByItemID"; - cm.Parameters.AddWithValue("@ProcItemID", criteria.ProcItemID); - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - { - AnnotationAuditInfo aai = new AnnotationAuditInfo(dr); - aai.ActionWhat = dr.GetString("ActionWhat"); - aai.ActionWhen = dr.GetDateTime("ActionWhen"); - aai.IContentID = dr.GetInt32("IContentID"); - this.Add(aai); - - } - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("AnnotationAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - //chronology report by unit - public static AnnotationAuditInfoList GetChronologyByUnit(int @procItemID, int itemID, int unitID) - { - try - { - AnnotationAuditInfoList tmp = DataPortal.Fetch(new ChronologyCriteriaByUnit(procItemID, itemID, unitID)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationAuditInfoList.GetChronologyByUnit", ex); - } - } - [Serializable()] - protected class ChronologyCriteriaByUnit - { - private int _procItemID; - public int ProcItemID - { - get { return _procItemID; } - } - private int _itemID; - public int ItemID - { - get { return _itemID; } - } - private int _UnitID; - public int UnitID - { - get { return _UnitID; } - } - public ChronologyCriteriaByUnit(int procItemID, int itemID, int unitID) - { - _procItemID = procItemID; - _itemID = itemID; - _UnitID = unitID; - } - } - private void DataPortal_Fetch(ChronologyCriteriaByUnit criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationAuditsChronologyByItemIDandUnitID"; - cm.Parameters.AddWithValue("@ProcItemID", criteria.ProcItemID); - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.Parameters.AddWithValue("@UnitID", criteria.UnitID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - { - AnnotationAuditInfo aai = new AnnotationAuditInfo(dr); - aai.ActionWhat = dr.GetString("ActionWhat"); - aai.ActionWhen = dr.GetDateTime("ActionWhen"); - aai.IContentID = dr.GetInt32("IContentID"); - this.Add(aai); - - } - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("AnnotationAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - - } - - public partial class ContentAuditInfoList - { - /// - /// Return a list of all ContentAuditInfo by ContentID. - /// - /// Selected ContentID for Content Audit Records - /// - public static ContentAuditInfoList Get(int contentID) - { - try - { - //if (_ContentAuditInfoList != null) - // return _ContentAuditInfoList; - ContentAuditInfoList tmp = DataPortal.Fetch(new ContentIDCriteria(contentID)); - //ContentAuditInfo.AddList(tmp); - //tmp.AddEvents(); - //_ContentAuditInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentAuditInfoList.Get", ex); - } - } - [Serializable()] - protected class ContentIDCriteria - { - private int _ContentID; - public int ContentID - { get { return _ContentID; } } - public ContentIDCriteria(int contentID) - { - _ContentID = contentID; - } - } - private void DataPortal_Fetch(ContentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getContentAuditsByContentID"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - { - ContentAuditInfo cai = new ContentAuditInfo(dr); - cai.ActionWhat = dr.GetString("ActionWhat"); - this.Add(cai); -// this.Add(new ContentAuditInfo(dr)); - } - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ContentAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - //byDTS - public static ContentAuditInfoList Get(int contentID, DateTime dts) - { - try - { - //if (_ContentAuditInfoList != null) - // return _ContentAuditInfoList; - ContentAuditInfoList tmp = DataPortal.Fetch(new ContentIDandDTSCriteria(contentID, dts)); - //ContentAuditInfo.AddList(tmp); - //tmp.AddEvents(); - //_ContentAuditInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentAuditInfoList.Get", ex); - } - } - [Serializable()] - protected class ContentIDandDTSCriteria - { - private int _ContentID; - public int ContentID - { get { return _ContentID; } } - private DateTime _DTS; - public DateTime DTS - { - get { return _DTS; } - } - public ContentIDandDTSCriteria(int contentID, DateTime dts) - { - _ContentID = contentID; - _DTS = dts; - } - } - private void DataPortal_Fetch(ContentIDandDTSCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getContentAuditsByContentIDandDTS"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - cm.Parameters.AddWithValue("@DTS", criteria.DTS); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - { - ContentAuditInfo cai = new ContentAuditInfo(dr); - cai.ActionWhat = dr.GetString("ActionWhat"); - this.Add(cai); - // this.Add(new ContentAuditInfo(dr)); - } - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ContentAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - //by delete status - public static ContentAuditInfoList GetByDeleteStatus(int deleteStatus) - { - try - { - //if (_ContentAuditInfoList != null) - // return _ContentAuditInfoList; - ContentAuditInfoList tmp = DataPortal.Fetch(new DeleteStatusCriteria(deleteStatus)); - //ContentAuditInfo.AddList(tmp); - //tmp.AddEvents(); - //_ContentAuditInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentAuditInfoList.GetByDeleteStatus", ex); - } - } - [Serializable()] - protected class DeleteStatusCriteria - { - private int _DeleteStatus; - public int DeleteStatus - { get { return _DeleteStatus; } } - public DeleteStatusCriteria(int deleteStatus) - { - _DeleteStatus = deleteStatus; - } - } - private void DataPortal_Fetch(DeleteStatusCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getContentAuditsByDeleteStatus"; - cm.Parameters.AddWithValue("@DeleteStatus", criteria.DeleteStatus); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new ContentAuditInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ContentAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - - #region ChronologyReport - //chronology report - public static ContentAuditInfoList GetChronology(int procedureItemID, int currentItemID, bool includeDeletedChildren) - { - try - { - ContentAuditInfoList tmp = DataPortal.Fetch(new ChronologyCriteria(procedureItemID, currentItemID, includeDeletedChildren)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentAuditInfoList.GetChronology", ex); - } - } - [Serializable()] - protected class ChronologyCriteria - { - private int _ProcedureItemID; - public int ProcedureItemID - { - get { return _ProcedureItemID; } - } - private int _CurrentItemID; - public int CurrentItemID - { - get { return _CurrentItemID; } - } - private bool _IncludeDeletedChildren; - public bool IncludeDeletedChildren - { - get { return _IncludeDeletedChildren; } - } - public ChronologyCriteria(int procedureItemID, int currentItemID, bool includeDeletedChildren) - { - _ProcedureItemID = procedureItemID; - _CurrentItemID = currentItemID; - _IncludeDeletedChildren = includeDeletedChildren; - } - } - private void DataPortal_Fetch(ChronologyCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getContentAuditsChronologyByItemID"; - cm.Parameters.AddWithValue("@ProcedureItemID", criteria.ProcedureItemID); - cm.Parameters.AddWithValue("@SelectedItemID", criteria.CurrentItemID); - cm.Parameters.AddWithValue("@IncludeDeletedChildren", criteria.IncludeDeletedChildren ? 1 : 0); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - { - ContentAuditInfo cai = new ContentAuditInfo(dr); - cai.ActionWhat = dr.GetString("ActionWhat"); - cai.ActionWhen = dr.GetDateTime("ActionWhen"); - cai.Path = dr.GetString("Path"); - cai.ItemID = dr.GetInt32("ItemID"); - cai.TypeName = dr.GetString("TypeName"); - this.Add(cai); - - } - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ContentAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - //chronology report by unit - public static ContentAuditInfoList GetChronologyByUnit(int procedureItemID, int currentItemID, bool includeDeletedChildren, int unitID) - { - try - { - ContentAuditInfoList tmp = DataPortal.Fetch(new ChronologyCriteriaByUnit(procedureItemID, currentItemID, includeDeletedChildren, unitID)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentAuditInfoList.GetChronologyByUnit", ex); - } - } - [Serializable()] - protected class ChronologyCriteriaByUnit - { - private int _ProcedureItemID; - public int ProcedureItemID - { - get { return _ProcedureItemID; } - } - private int _CurrentItemID; - public int CurrentItemID - { - get { return _CurrentItemID; } - } - private bool _IncludeDeletedChildren; - public bool IncludeDeletedChildren - { - get { return _IncludeDeletedChildren; } - } - private int _UnitID; - public int UnitID - { - get { return _UnitID; } - } - public ChronologyCriteriaByUnit(int procedureItemID, int currentItemID, bool includeDeletedChildren, int unitID) - { - _ProcedureItemID = procedureItemID; - _CurrentItemID = currentItemID; - _IncludeDeletedChildren = includeDeletedChildren; - _UnitID = unitID; - } - } - private void DataPortal_Fetch(ChronologyCriteriaByUnit criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getContentAuditsChronologyByItemIDandUnitID"; - cm.Parameters.AddWithValue("@ProcedureItemID", criteria.ProcedureItemID); - cm.Parameters.AddWithValue("@SelectedItemID", criteria.CurrentItemID); - cm.Parameters.AddWithValue("@IncludeDeletedChildren", criteria.IncludeDeletedChildren ? 1 : 0); - cm.Parameters.AddWithValue("@UnitID", criteria.UnitID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - { - ContentAuditInfo cai = new ContentAuditInfo(dr); - cai.ActionWhat = dr.GetString("ActionWhat"); - cai.ActionWhen = dr.GetDateTime("ActionWhen"); - cai.Path = dr.GetString("Path"); - cai.ItemID = dr.GetInt32("ItemID"); - cai.TypeName = dr.GetString("TypeName"); - this.Add(cai); - - } - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ContentAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - - #region SummaryReport - //summary report - public static ContentAuditInfoList GetSummary(int procedureItemID, int currentItemID, bool includeDeletedChildren) - { - try - { - ContentAuditInfoList tmp = DataPortal.Fetch(new SummaryCriteria(procedureItemID, currentItemID, includeDeletedChildren)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentAuditInfoList.GetSummary", ex); - } - } - [Serializable()] - protected class SummaryCriteria - { - private int _ProcedureItemID; - public int ProcedureItemID - { - get { return _ProcedureItemID; } - } - private int _CurrentItemID; - public int CurrentItemID - { - get { return _CurrentItemID; } - } - private bool _IncludeDeletedChildren; - public bool IncludeDeletedChildren - { - get { return _IncludeDeletedChildren; } - } - public SummaryCriteria(int procedureItemID, int currentItemID, bool includeDeletedChildren) - { - _ProcedureItemID = procedureItemID; - _CurrentItemID = currentItemID; - _IncludeDeletedChildren = includeDeletedChildren; - } - } - private void DataPortal_Fetch(SummaryCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getContentAuditsSummaryByItemID"; - cm.Parameters.AddWithValue("@ProcedureItemID", criteria.ProcedureItemID); - cm.Parameters.AddWithValue("@SelectedItemID", criteria.CurrentItemID); - cm.Parameters.AddWithValue("@IncludeDeletedChildren", criteria.IncludeDeletedChildren ? 1 : 0); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - { - ContentAuditInfo cai = new ContentAuditInfo(dr); - cai.ActionWhat = dr.GetString("ActionWhat"); - cai.ActionWhen = dr.GetDateTime("ActionWhen"); - cai.Path = dr.GetString("Path"); - cai.ItemID = dr.GetInt32("ItemID"); - cai.TypeName = dr.GetString("TypeName"); - this.Add(cai); - - } - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ContentAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - //summary report by unit - public static ContentAuditInfoList GetSummaryByUnit(int procedureItemID, int currentItemID, bool includeDeletedChildren, int unitID) - { - try - { - ContentAuditInfoList tmp = DataPortal.Fetch(new SummaryCriteriaByUnit(procedureItemID, currentItemID, includeDeletedChildren, unitID)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentAuditInfoList.GetSummaryByUnit", ex); - } - } - [Serializable()] - protected class SummaryCriteriaByUnit - { - private int _ProcedureItemID; - public int ProcedureItemID - { - get { return _ProcedureItemID; } - } - private int _CurrentItemID; - public int CurrentItemID - { - get { return _CurrentItemID; } - } - private bool _IncludeDeletedChildren; - public bool IncludeDeletedChildren - { - get { return _IncludeDeletedChildren; } - } - private int _UnitID; - public int UnitID - { - get { return _UnitID; } - } - public SummaryCriteriaByUnit(int procedureItemID, int currentItemID, bool includeDeletedChildren, int unitID) - { - _ProcedureItemID = procedureItemID; - _CurrentItemID = currentItemID; - _IncludeDeletedChildren = includeDeletedChildren; - _UnitID = unitID; - } - } - private void DataPortal_Fetch(SummaryCriteriaByUnit criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getContentAuditsSummaryByItemIDandUnitID"; - cm.Parameters.AddWithValue("@ProcedureItemID", criteria.ProcedureItemID); - cm.Parameters.AddWithValue("@SelectedItemID", criteria.CurrentItemID); - cm.Parameters.AddWithValue("@IncludeDeletedChildren", criteria.IncludeDeletedChildren ? 1 : 0); - cm.Parameters.AddWithValue("@UnitID", criteria.UnitID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - { - ContentAuditInfo cai = new ContentAuditInfo(dr); - cai.ActionWhat = dr.GetString("ActionWhat"); - cai.ActionWhen = dr.GetDateTime("ActionWhen"); - cai.Path = dr.GetString("Path"); - cai.ItemID = dr.GetInt32("ItemID"); - cai.TypeName = dr.GetString("TypeName"); - this.Add(cai); - - } - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ContentAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - - } - - public partial class DocumentAuditInfoList - { - /// - /// Return a list of all DocumentAuditInfo by DocID. - /// - /// Selected DocID for Document Audit Records - /// - public static DocumentAuditInfoList Get(int docID) - { - try - { - DocumentAuditInfoList tmp = DataPortal.Fetch(new DocumentIDCriteria(docID)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocumentAuditInfoList.Get", ex); - } - } - [Serializable()] - protected class DocumentIDCriteria - { - private int _DocID; - public int DocID - { get { return _DocID; } } - public DocumentIDCriteria(int docID) - { - _DocID = docID; - } - } - private void DataPortal_Fetch(DocumentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocumentAuditsByDocID"; - cm.Parameters.AddWithValue("@DocID", criteria.DocID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new DocumentAuditInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("DocumentAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - } - - public partial class EntryAuditInfoList - { - /// - /// Return a list of all EntryAuditInfo by ContentID. - /// - /// Selected ContentID for Entry Audit Records - /// - public static EntryAuditInfoList Get(int contentID) - { - try - { - EntryAuditInfoList tmp = DataPortal.Fetch(new ContentIDCriteria(contentID)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on EntryAuditInfoList.Get", ex); - } - } - [Serializable()] - protected class ContentIDCriteria - { - private int _ContentID; - public int ContentID - { get { return _ContentID; } } - public ContentIDCriteria(int contentID) - { - _ContentID = contentID; - } - } - private void DataPortal_Fetch(ContentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getEntryAuditsByContentID"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new EntryAuditInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("EntryAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - } - - public partial class GridAuditInfoList - { - /// - /// Return a list of all GridAuditInfo by ContentID. - /// - /// Selected ContentID for Grid Audit Records - /// - public static GridAuditInfoList Get(int contentID) - { - try - { - GridAuditInfoList tmp = DataPortal.Fetch(new ContentIDCriteria(contentID)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on GridAuditInfoList.Get", ex); - } - } - [Serializable()] - protected class ContentIDCriteria - { - private int _ContentID; - public int ContentID - { get { return _ContentID; } } - public ContentIDCriteria(int contentID) - { - _ContentID = contentID; - } - } - private void DataPortal_Fetch(ContentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] GridAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getGridAuditsByContentID"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new GridAuditInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("GridAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("GridAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - } - - public partial class ImageAuditInfoList - { - /// - /// Return a list of all ImageAuditInfo by ContentID. - /// - /// Selected ContentID for Image Audit Records - /// - public static ImageAuditInfoList Get(int contentID) - { - try - { - ImageAuditInfoList tmp = DataPortal.Fetch(new ContentIDCriteria(contentID)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ImageAuditInfoList.Get", ex); - } - } - [Serializable()] - protected class ContentIDCriteria - { - private int _ContentID; - public int ContentID - { get { return _ContentID; } } - public ContentIDCriteria(int contentID) - { - _ContentID = contentID; - } - } - private void DataPortal_Fetch(ContentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ImageAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getImageAuditsByContentID"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new ImageAuditInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ImageAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ImageAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - } - - public partial class ItemAuditInfoList - { - /// - /// Return a list of all ItemAuditInfo by ItemID. - /// - /// Selected ItemID for Item Audit Records - /// - public static ItemAuditInfoList Get(int itemID) - { - try - { - ItemAuditInfoList tmp = DataPortal.Fetch(new ItemIDCriteria(itemID)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemAuditInfoList.Get", ex); - } - } - [Serializable()] - protected class ItemIDCriteria - { - private int _ItemID; - public int ItemID - { get { return _ItemID; } } - public ItemIDCriteria(int itemID) - { - _ItemID = itemID; - } - } - private void DataPortal_Fetch(ItemIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getItemAuditsByItemID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - { - ItemAuditInfo iai = new ItemAuditInfo(dr); - iai._Level = dr.GetInt32("Level"); - iai._ItemType = dr.GetString("ItemType"); - this.Add(iai); - } - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - - } - - public partial class PartAuditInfoList - { - /// - /// Return a list of all PartAuditInfo by ContentID. - /// - /// Selected ContentID for Part Audit Records - /// - public static PartAuditInfoList Get(int contentID) - { - try - { - PartAuditInfoList tmp = DataPortal.Fetch(new ContentIDCriteria(contentID)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on PartAuditInfoList.Get", ex); - } - } - [Serializable()] - protected class ContentIDCriteria - { - private int _ContentID; - public int ContentID - { get { return _ContentID; } } - public ContentIDCriteria(int contentID) - { - _ContentID = contentID; - } - } - private void DataPortal_Fetch(ContentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] PartAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPartAuditsByContentID"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new PartAuditInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("PartAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("PartAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - - public static PartAuditInfoList GetByDeleteStatus(int deleteStatus) - { - try - { - PartAuditInfoList tmp = DataPortal.Fetch(new DeleteStatusCriteria(deleteStatus)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on PartAuditInfoList.GetByDeleteStatus", ex); - } - } - [Serializable()] - protected class DeleteStatusCriteria - { - private int _DeleteStatus; - public int DeleteStatus - { get { return _DeleteStatus; } } - public DeleteStatusCriteria(int deleteStatus) - { - _DeleteStatus = deleteStatus; - } - } - private void DataPortal_Fetch(DeleteStatusCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] PartAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPartAuditsByDeleteStatus"; - cm.Parameters.AddWithValue("@DeleteStatus", criteria.DeleteStatus); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new PartAuditInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("PartAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("PartAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - - public static PartAuditInfoList GetByItemID(int itemID) - { - try - { - PartAuditInfoList tmp = DataPortal.Fetch(new ItemIDCriteria(itemID)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on PartAuditInfoList.GetByItemID", ex); - } - } - [Serializable()] - protected class ItemIDCriteria - { - private int _ItemID; - public int ItemID - { get { return _ItemID; } } - public ItemIDCriteria(int itemID) - { - _ItemID = itemID; - } - } - private void DataPortal_Fetch(ItemIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] PartAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPartAuditsByItemID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new PartAuditInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("PartAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("PartAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - - } - - public partial class ItemInfo - { - public static event ItemInfoEvent InfoRestored; - private void OnInfoRestored(ItemInfo itemInfo) - { - if (InfoRestored != null) - InfoRestored(this); - } - public ItemInfo RestoreSibling(ItemAuditInfo iai) - { - if (iai.DeleteStatus == 0) - return null; - int nextID = iai.Level == 0 ? ItemID : NextItem == null ? 0 : NextItem.ItemID; - ItemInfo tmp = RestoreItem(iai); - if(nextID > 0) - using (Item item = Item.Get(nextID)) ItemInfo.Refresh(item); - if (iai.Level == 0) - OnNewSiblingBefore(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Before)); - else - OnNewSiblingAfter(new ItemInfoInsertEventArgs(tmp, EAddpingPart.After)); - ((ItemInfo)ActiveParent).MyContent.RefreshContentParts(); - tmp.OnInfoRestored(tmp); - return tmp; - } - public ItemInfo RestoreItem(ItemAuditInfo iai) - { - ItemInfo tmp2 = null; - try - { - ItemInfo tmp = DataPortal.Fetch(new RestoreCriteria(iai, this)); - tmp2 = tmp; - AddToCache(tmp); - if (tmp.ErrorMessage == "No Record Found") tmp = null; - if(iai.Level == 2) - OnNewChild(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Child)); - int? nextID = null; - if (tmp.NextItem != null) - { - nextID = tmp.NextItem.ItemID; - ItemInfo.RefreshPrevious(nextID, tmp.ItemID); - tmp.NextItem.ResetOrdinal(); - } - //tmp.UpdateTransitionText(); - if (tmp.MyContent.ContentTransitions != null) - { - foreach (TransitionInfo tran in tmp.MyContent.ContentTransitions) - { - if(tran.MyItemToID != null) - tran.MyItemToID.UpdateTransitionText(); - } - } - using (Content cont = tmp.MyContent.Get()) - { - if (cont.ContentTransitionCount > 0) - { - foreach (ContentTransition tran in cont.ContentTransitions) - { - cont.FixTransitionText(TransitionInfo.Get(tran.TransitionID)); - } - cont.Save(); - } - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfo.RestoreItem", ex); - } - } - // Criteria to get Item and children - [Serializable()] - private class RestoreCriteria - { - public RestoreCriteria(ItemAuditInfo iai, ItemInfo ii) - { - _MyAudit = iai; - _MyInfo = ii; - } - private ItemAuditInfo _MyAudit; - public ItemAuditInfo MyAudit - { - get { return _MyAudit; } - set { _MyAudit = value; } - } - private ItemInfo _MyInfo; - public ItemInfo MyInfo - { - get { return _MyInfo; } - set { _MyInfo = value; } - } - } - private void DataPortal_Fetch(RestoreCriteria criteria) - { - ItemAuditInfo iai = criteria.MyAudit; - ItemInfo ii = criteria.MyInfo; - //if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "restoreDeletedItem"; - cm.Parameters.AddWithValue("@ItemID", iai.ItemID); - cm.Parameters.AddWithValue("@DeleteID", iai.DeleteStatus); - cm.Parameters.AddWithValue("@CurrentID", ii.ItemID); - cm.Parameters.AddWithValue("@Level", iai.Level); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - //if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemAuditInfoList.DataPortal_Fetch", ex); - //throw new DbCslaException("ItemAuditInfoList.DataPortal_Fetch", ex); - } - DataPortal_Fetch(new PKCriteria(iai.ItemID)); - } - } - - public partial class AnnotationInfo - { - public static AnnotationInfo RestoreAnnotation(AnnotationAuditInfo aai) - { - try - { - AnnotationInfo tmp = DataPortal.Fetch(new RestoreCriteria(aai)); - AddToCache(tmp); - if (tmp.ErrorMessage == "No Record Found") tmp = null; - tmp.MyItem.RefreshItemAnnotations(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotaionInfo.RestoreAnnotation", ex); - } - } - //criteria to get annotation - [Serializable] - private class RestoreCriteria - { - public RestoreCriteria(AnnotationAuditInfo aai) - { - _MyAudit = aai; - } - private AnnotationAuditInfo _MyAudit; - - public AnnotationAuditInfo MyAudit - { - get { return _MyAudit; } - set { _MyAudit = value; } - } - } - private void DataPortal_Fetch(RestoreCriteria criteria) - { - AnnotationAuditInfo aai = criteria.MyAudit; - if (aai.DeleteStatus == 0) - { - //if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "restoreChangedAnnotation"; - cm.Parameters.AddWithValue("@AuditID", aai.AuditID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - //if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemAuditInfoList.DataPortal_Fetch", ex); - //throw new DbCslaException("ItemAuditInfoList.DataPortal_Fetch", ex); - } - } - else - { - //if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "restoreDeletedAnnotation"; - cm.Parameters.AddWithValue("@AnnotationID", aai.AnnotationID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - //if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemAuditInfoList.DataPortal_Fetch", ex); - //throw new DbCslaException("ItemAuditInfoList.DataPortal_Fetch", ex); - } - } - DataPortal_Fetch(new PKCriteria(aai.AnnotationID)); - } - } - - public partial class ContentInfo - { - public static ContentInfo RestoreContent(ContentAuditInfo cai) - { - try - { - ContentInfo tmp = DataPortal.Fetch(new RestoreCriteria(cai)); - AddToCache(tmp); - if (tmp.ErrorMessage == "No Record Found") tmp = null; - tmp.RefreshContentDetails(); - tmp.RefreshContentItems(); - tmp.RefreshContentParts(); - tmp.RefreshContentRoUsages(); - tmp.RefreshContentTransitions(); - using (Content ctmp = tmp.Get()) - { - ROFstInfo myrofst = tmp.ContentItems[0].MyProcedure.MyDocVersion.DocVersionAssociations[0].MyROFst; - ROFSTLookup mylookup = myrofst.ROFSTLookup; - foreach(RoUsageInfo rou in tmp.ContentRoUsages) - { - ROFSTLookup.rochild rocc = mylookup.GetRoChild12(rou.ROID); - string myvalue = rocc.value; - int mytype = rocc.type; - ctmp.FixContentText(rou, myvalue, mytype, null); - } - Content cctmp = ctmp; - if (ctmp.IsDirty) - { - cctmp.DTS = DateTime.Now; - cctmp = ctmp.Save(); - } - ContentInfo.Refresh(cctmp); - } - //FixContentText(RoUsageInfo rousg, string value, int rotype, ROFstInfo origROFstInfo - - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentInfo.RestoreContent", ex); - } - } - //criteria to get content - [Serializable] - private class RestoreCriteria - { - public RestoreCriteria(ContentAuditInfo cai) - { - _MyAudit = cai; - } - private ContentAuditInfo _MyAudit; - public ContentAuditInfo MyAudit - { - get { return _MyAudit; } - set { _MyAudit = value; } - } - } - private void DataPortal_Fetch(RestoreCriteria criteria) - { - ContentAuditInfo cai = criteria.MyAudit; - //if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "restoreChangedContent"; - cm.Parameters.AddWithValue("@AuditID", cai.AuditID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - //if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemAuditInfoList.DataPortal_Fetch", ex); - //throw new DbCslaException("ItemAuditInfoList.DataPortal_Fetch", ex); - } - DataPortal_Fetch(new PKCriteria(cai.ContentID)); - } - } - public partial class StageInfoList - { - public static void Refresh() - { - Reset(); - _StageInfoList = Get(); - } - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ContentExt.cs.bak b/PROMS/VEPROMS.CSLA.Library/Extension/ContentExt.cs.bak deleted file mode 100644 index 06131a2c..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ContentExt.cs.bak +++ /dev/null @@ -1,509 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Csla; -using Csla.Data; -using System.Xml; -using System.Data.SqlClient; -using System.Data; -using System.Text.RegularExpressions; - -namespace VEPROMS.CSLA.Library -{ - public partial class Content - { - public override string ToString() - { - return string.Format("{0} {1}", Number, Text); - } - public void FixTransitionText(TransitionInfo tran) - { - string transText = tran.ResolvePathTo(); - string lookFor = string.Format(@"", tran.TranType, tran.TransitionID); - //string lookFor = string.Format(@"", tran.TranType, tran.TransitionID); - Match m = Regex.Match(Text, lookFor); - if (m != null && m.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = m.Groups[3]; - if (g.ToString() != transText) - Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length); - } - // see if there is a grid to update too. - if (tran.MyContent.MyGrid != null) - { - string lookForXml = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID); - Match mg = Regex.Match(MyGrid.Data, lookForXml); - if (mg != null && mg.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = mg.Groups[3]; - if (g.ToString() != transText) - MyGrid.Data = MyGrid.Data.Substring(0, g.Index) + transText + MyGrid.Data.Substring(g.Index + g.Length); - } - } - } - private string GetMySuffix(int start) - { - string txt = Text.Substring(start); - int firstSlashVeeZero = txt.IndexOf(@"\v0"); - if (firstSlashVeeZero == 0 && txt.Length > 3 && txt[3] == ' ') //"\v0 " - return Text.Substring(start, 4); - return Text.Substring(start, firstSlashVeeZero + 3); //everything upto \v0" - } - private string GetMyPrefix(int start, int lastIndex) - { - string defPrefix = Text.Substring(start - 3, 3); - if (defPrefix != @"\v ") throw new Exception(string.Format("rtf string {0} does not match expected format", defPrefix)); - string txt = Text.Substring(lastIndex, start - lastIndex - 3); - int lastSlash = txt.LastIndexOf(@"\"); - int lastSpace = txt.LastIndexOf(" "); - int lastCR = txt.LastIndexOf("\r"); - if (lastSpace < lastCR) - lastSpace = lastCR; - if (lastSlash <= lastSpace) //this will return "\v " - return defPrefix; - txt = txt.Substring(lastSlash); - if(txt.StartsWith(@"\'")) //this is a hex - return defPrefix; - if (Regex.IsMatch(txt, @"\\u[0-9].*")) //this is unicode - return defPrefix; - return @"\v"; - } - public string ConvertROToText(RoUsageInfo rousg, string value, int rotype, ROFstInfo origROFstInfo) - { - string retval = null; - string newvalue = value; - string findLink = @""; - MatchCollection ms = Regex.Matches(Text, findLink); - string lookFor = string.Format(@"", rousg.ROUsageID); - int lastIndex = 0; - string newText = Text; - foreach (Match mm in ms) - { - int offset = mm.Index; - Match m = Regex.Match(mm.Value, lookFor, RegexOptions.Singleline); - if (m != null && m.Groups.Count > 1) - { - string prefix = GetMyPrefix(mm.Index, lastIndex); - string suffix = GetMySuffix(mm.Index + mm.Length); - System.Text.RegularExpressions.Group g = m.Groups[3]; - string part1 = newText.Substring(0, mm.Index); - string part2 = g.Value; - string part3 = newText.Substring(mm.Index + mm.Length); - //modify part1 based on prefix - if (prefix == @"\v ") - part1 = part1.Substring(0, part1.Length - 3); - else - part1 = part1.Substring(0, part1.Length - 3) + " "; - //modify part3 based on suffix - if (suffix == @"\v0 ") - part3 = part3.Substring(4); - else - part3 = suffix.Replace(@"\v0","") + part3.Substring(suffix.Length); - System.Text.RegularExpressions.Group g2 = m.Groups[2]; - if (g2.Value.StartsWith(@"\u8209?")) - { - string gg = g2.Value + " " + g.Value; - retval = gg; - part2 = retval; - } - else - //else if (g.ToString() != newvalue) - { - retval = g.Value; - part2 = retval; - } - Text = part1 + part2 + part3; - break; // Text has been processed - } - lastIndex = mm.Index + mm.Length; - } - Console.WriteLine("Text: {0} NewText: {1}", Text, newText); - // see if there is a grid to update too. - if (rousg.MyContent.MyGrid != null) - { - if (rotype == (int)E_ROValueType.Table) // if change in rotable data... - { - if (origROFstInfo != null) - { - List retlist = origROFstInfo.OnROTableUpdate(this, new ROFstInfoROTableUpdateEventArgs(newvalue, MyGrid.Data)); - if (MyGrid.Data != retlist[1]) - { - MyGrid.Data = retlist[1]; - retval = Text; - if (Text != retlist[0]) - Text = retlist[0]; - } - } - } - else - { - // if it's an ro within a table, need to process into an flex grid to save the grid data: - string findLinkXml = @"<START\].*?\[END>"; - string lookForXml = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID); - MatchCollection msg = Regex.Matches(MyGrid.Data, findLinkXml); - int nmsg = msg.Count; - for (int i = nmsg - 1; i >= 0; i--) - { - Match mmg = msg[i]; - int offset = 0; // crashed in substring line below if using mmg.Index; Set to 0 and it worked - KBR. - Match mg = Regex.Match(mmg.Value, lookForXml);// Regex.Match(MyGrid.Data, lookForXml); - if (mg != null && mg.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = mg.Groups[3]; - if (g.ToString() != newvalue) - { - retval = g.Value; - MyGrid.Data = MyGrid.Data.Substring(0, offset + mmg.Index + g.Index) + newvalue + MyGrid.Data.Substring(offset + mmg.Index + g.Index + g.Length); - } - } - } - } - } - return retval; - } - public string FixContentText(RoUsageInfo rousg, string value, int rotype, ROFstInfo origROFstInfo) // string newvalue) - { - return FixContentText(rousg, value, rotype, origROFstInfo, null); - } - public string FixContentText(RoUsageInfo rousg, string value, int rotype, ROFstInfo origROFstInfo,string fileNameOnly) // string newvalue) - { - string retval = null; - string newvalue = value; - string findLink = @""; - MatchCollection ms = Regex.Matches(Text, findLink); - //string lookFor = string.Format(@"", rousg.ROUsageID); - string lookFor = string.Format(@"^$", rousg.ROUsageID); - foreach (Match mm in ms) - { - Match m = Regex.Match(mm.Value, lookFor, RegexOptions.Singleline); - if (m != null && m.Groups.Count > 1) - { - int myIndex = m.Groups[4].Index + mm.Index; - int myLength = m.Groups[4].Length; - if(m.Groups[3] != " ") - { - myIndex = m.Groups[3].Index + mm.Index; - myLength += m.Groups[3].Length; - } - string gg = Text.Substring(myIndex,myLength); - if ((gg.Replace(@"\'b0", @"\'B0") != newvalue.Replace(@"\'b0", @"\'B0")) && ((fileNameOnly == null) || (gg != fileNameOnly))) - { - retval = gg; - Text = Text.Substring(0, myIndex) + newvalue + Text.Substring(myIndex + myLength); - break; // Text has been processed - } - } - } - // see if there is a grid to update too. - if (rousg.MyContent.MyGrid != null) - { - if (rotype == (int)E_ROValueType.Table) // if change in rotable data... - { - if (origROFstInfo != null) - { - List retlist = origROFstInfo.OnROTableUpdate(this, new ROFstInfoROTableUpdateEventArgs(newvalue, MyGrid.Data)); - if (MyGrid.Data != retlist[1]) - { - MyGrid.Data = retlist[1]; - retval = Text; - if (Text != retlist[0]) - Text = retlist[0]; - } - } - } - else - { - // if it's an ro within a table, need to process into an flex grid to save the grid data: - string findLinkXml = @"<START\].*?\[END>"; - //string lookForXml = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID); - string lookFor = string.Format(@"^<START\](\\[^v \\]+)*\\v0(\\[^v '?{}\\]+)*( |\\u[0-9]{1,4}?|\\'[0-9a-fA-F]{2})(.*?)(\\[^v'?{} \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>$", rousg.ROUsageID); - MatchCollection msg = Regex.Matches(MyGrid.Data, findLinkXml); - foreach (Match mmg in msg) - { - Match mg = Regex.Match(mmg.Value, lookForXml);// Regex.Match(MyGrid.Data, lookForXml); - if (mg != null && mg.Groups.Count > 1) - { - int myIndex = m.Groups[4].Index + mmg.Index; - int myLength = m.Groups[4].Length; - if (m.Groups[3] != " ") - { - myIndex = m.Groups[3].Index + mmg.Index; - myLength += m.Groups[3].Length; - } - string gg = Text.Substring(myIndex, myLength); - if (gg != newvalue) - { - retval = gg; - MyGrid.Data = MyGrid.Data.Substring(0, myIndex) + newvalue + MyGrid.Data.Substring(myIndex + myLength); - } - } - } - } - } - return retval; - } - } - public partial class ContentInfo - { - public void FixTransitionText(TransitionInfo tran) - { - string transText = tran.ResolvePathTo(); - string lookFor = string.Format(@"", tran.TranType, tran.TransitionID); - //string lookFor = string.Format(@"", tran.TranType, tran.TransitionID); - Match m = Regex.Match(Text, lookFor); - if (m != null && m.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = m.Groups[3]; - if (g.ToString() != transText) - _Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length); - } - // see if there is a grid to update too. - if (tran.MyContent.MyGrid != null) - { - string lookForXml = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID); - Match mg = Regex.Match(MyGrid.Data, lookForXml); - if (mg != null && mg.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = mg.Groups[3]; - //if (g.ToString() != transText) - // MyGrid.Data = MyGrid.Data.Substring(0, g.Index) + transText + MyGrid.Data.Substring(g.Index + g.Length); - } - } - } - public void FixTransitionText(TransitionInfo tran, TransitionLookup tranLookup) - { - string transText = tran.ResolvePathTo(tranLookup); - string lookFor = string.Format(@"", tran.TranType, tran.TransitionID); - //string lookFor = string.Format(@"", tran.TranType, tran.TransitionID); - Match m = Regex.Match(Text, lookFor); - if (m != null && m.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = m.Groups[3]; - if (g.ToString() != transText) - _Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length); - } - // see if there is a grid to update too. - if (MyGrid != null) - { - string lookForXml = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID); - Match mg = Regex.Match(MyGrid.Data, lookForXml); - if (mg != null && mg.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = mg.Groups[3]; - if (g.ToString() != transText) - MyGrid.SetData(MyGrid.Data.Substring(0, g.Index) + transText + MyGrid.Data.Substring(g.Index + g.Length)); - } - } - } - public void FixContentText(RoUsageInfo rousg, string value, int rotype, ROFstInfo origROFstInfo) // string newvalue) - { - string newvalue = value; - string findLink = @""; - MatchCollection ms = Regex.Matches(Text, findLink); - string lookFor = string.Format(@"", rousg.ROUsageID); - foreach (Match mm in ms) - { - int offset = mm.Index; - Match m = Regex.Match(mm.Value, lookFor, RegexOptions.Singleline); - if (m != null && m.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = m.Groups[3]; - if (g.ToString() != newvalue) - { - _Text = Text.Substring(0, offset + g.Index) + newvalue + Text.Substring(offset + g.Index + g.Length); - break; // Text has been processed - } - } - } - // see if there is a grid to update too. - if (MyGrid != null) - { - if (rotype == (int)E_ROValueType.Table) // if change in rotable data... - { - List retlist = origROFstInfo.OnROTableUpdate(this, new ROFstInfoROTableUpdateEventArgs(newvalue, MyGrid.Data)); - if (Text != retlist[0]) _Text = retlist[0]; - //if (MyGrid.Data != retlist[1]) MyGrid.Data = retlist[1]; - } - else - { - // if it's an ro within a table, need to process into an flex grid to save the grid data: - string findLinkXml = @"<START\].*?\[END>"; - string lookForXml = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID); - MatchCollection msg = Regex.Matches(MyGrid.Data, findLinkXml); - foreach (Match mmg in msg) - { - //int offset = 0; // crashed in substring line below if using mmg.Index; Set to 0 and it worked - KBR. - Match mg = Regex.Match(mmg.Value, lookForXml); - if (mg != null && mg.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = mg.Groups[3]; - if (g.ToString() != newvalue) - { - string prefix1 = MyGrid.Data.Substring(0,mmg.Index); - string prefix2 = mmg.Value.Substring(0,g.Index); - string suffix1 = MyGrid.Data.Substring(mmg.Index + mmg.Length); - string suffix2 = mmg.Value.Substring(g.Index + g.Length); - MyGrid.SetData(prefix1 + prefix2 + newvalue + suffix2 + suffix1); - break; - } - } - } - } - } - if (_Text == string.Empty) - _Text = "?"; - } - public void LoadNonCachedGrid() - { - _MyGrid = GridInfo.GetNonCached(ContentID); - //Console.WriteLine("LoadNonCachedGrid {0},{1},{2}",ContentID,_MyGrid==null,_MyContentInfoUnique); - } - public PartInfoList LocalContentParts - { - get { return _ContentParts; } - } - public void AddPart(SafeDataReader dr, ItemInfo itemInfo) - { - if (_ContentParts == null) - _ContentParts = new PartInfoList(dr, itemInfo); - else - _ContentParts.AddPartInfo(dr, itemInfo); - } - public override string ToString() - { - return string.Format("{0} {1}", Number, Text); - } - public void ShowChange() - { - OnChange(); - } - //public XmlNode ToXml(XmlNode xn) - //{ - // XmlNode nd = xn.OwnerDocument.CreateElement("Content"); - // xn.AppendChild(nd); - // AddAttribute(nd, "Number", _Number); - // AddAttribute(nd, "Text", _Text); - // AddAttribute(nd, "FormatID", _FormatID); - // AddAttribute(nd, "Config", _Config); - // return nd; - //} - //public void AddAttribute(XmlNode xn, string name, object o) - //{ - // if (o != null && o.ToString() != "") - // { - // XmlAttribute xa = xn.OwnerDocument.CreateAttribute(name); - // xa.Value = o.ToString(); - // xn.Attributes.Append(xa); - // } - //} - internal ContentInfo(SafeDataReader dr,bool ForItem) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentInfo.Constructor", GetHashCode()); - try - { - ReadDataItemList(dr); - _CacheList.Add(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentInfo.Constructor", ex); - throw new DbCslaException("ContentInfo.Constructor", ex); - } - } - private void ReadDataItemList(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentInfo.ReadDataItemList", GetHashCode()); - try - { - _ContentID = dr.GetInt32("ContentID"); - _Number = dr.GetString("Number"); - _Text = dr.GetString("Text"); - _Type = (int?)dr.GetValue("Type"); - _FormatID = (int?)dr.GetValue("FormatID"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("cDTS"); - _UserID = dr.GetString("cUserID"); - _ContentDetailCount = dr.GetInt32("DetailCount"); - _ContentEntryCount = dr.GetInt32("EntryCount"); - _ContentGridCount = dr.GetInt32("GridCount"); - _ContentImageCount = dr.GetInt32("ImageCount"); - _ContentItemCount = dr.GetInt32("ItemCount"); - _ContentPartCount = dr.GetInt32("cPartCount"); - _ContentRoUsageCount = dr.GetInt32("RoUsageCount"); - _ContentTransitionCount = dr.GetInt32("TransitionCount"); - _ContentZContentCount = dr.GetInt32("ZContentCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ContentInfo.ReadData", ex); - } - } - - } - public partial class ContentInfoList - { - public static ContentInfoList GetList(int? itemID) - { - try - { - ContentInfoList tmp = DataPortal.Fetch(new ContentListCriteria(itemID)); - ContentInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetChildren", ex); - } - } - [Serializable()] - private class ContentListCriteria - { - public ContentListCriteria(int? itemID) - { - _ItemID = itemID; - } - private int? _ItemID; - public int? ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - private void DataPortal_Fetch(ContentListCriteria criteria) - { - this.RaiseListChangedEvents = false; - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_ListContentsByItemID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - { - ContentInfo contentInfo = new ContentInfo(dr); - this.Add(contentInfo); - } - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - Database.LogException("ContentInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ContentInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ContentExt.cs.org b/PROMS/VEPROMS.CSLA.Library/Extension/ContentExt.cs.org deleted file mode 100644 index 59946a36..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ContentExt.cs.org +++ /dev/null @@ -1,343 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Csla; -using Csla.Data; -using System.Xml; -using System.Data.SqlClient; -using System.Data; -using System.Text.RegularExpressions; - -namespace VEPROMS.CSLA.Library -{ - public partial class Content - { - public override string ToString() - { - return string.Format("{0} {1}", Number, Text); - } - public void FixTransitionText(TransitionInfo tran) - { - string transText = tran.ResolvePathTo(); - string lookFor = string.Format(@"", tran.TranType, tran.TransitionID); - //string lookFor = string.Format(@"", tran.TranType, tran.TransitionID); - Match m = Regex.Match(Text, lookFor); - if (m != null && m.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = m.Groups[3]; - if (g.ToString() != transText) - Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length); - } - // see if there is a grid to update too. - if (tran.MyContent.MyGrid != null) - { - string lookForXml = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID); - Match mg = Regex.Match(MyGrid.Data, lookForXml); - if (mg != null && mg.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = mg.Groups[3]; - if (g.ToString() != transText) - MyGrid.Data = MyGrid.Data.Substring(0, g.Index) + transText + MyGrid.Data.Substring(g.Index + g.Length); - } - } - } - public void FixContentText(RoUsageInfo rousg, string value, int rotype, ROFstInfo origROFstInfo) // string newvalue) - { - string newvalue = value; - string findLink = @""; - MatchCollection ms = Regex.Matches(Text, findLink); - string lookFor = string.Format(@"", rousg.ROUsageID); - foreach (Match mm in ms) - { - int offset = mm.Index; - Match m = Regex.Match(mm.Value, lookFor, RegexOptions.Singleline); - if (m != null && m.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = m.Groups[3]; - if (g.ToString() != newvalue) - { - Text = Text.Substring(0, offset + g.Index) + newvalue + Text.Substring(offset + g.Index + g.Length); - break; // Text has been processed - } - } - } - // see if there is a grid to update too. - if (rousg.MyContent.MyGrid != null) - { - if (rotype == (int)E_ROValueType.Table) // if change in rotable data... - { - List retlist = origROFstInfo.OnROTableUpdate(this, new ROFstInfoROTableUpdateEventArgs(newvalue, MyGrid.Data)); - if (Text != retlist[0]) Text = retlist[0]; - if (MyGrid.Data != retlist[1]) MyGrid.Data = retlist[1]; - } - else - { - // if it's an ro within a table, need to process into an flex grid to save the grid data: - string findLinkXml = @"<START\].*?\[END>"; - string lookForXml = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID); - MatchCollection msg = Regex.Matches(MyGrid.Data, findLinkXml); - foreach (Match mmg in msg) - { - int offset = 0; // crashed in substring line below if using mmg.Index; Set to 0 and it worked - KBR. - Match mg = Regex.Match(MyGrid.Data, lookForXml); - if (mg != null && mg.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = mg.Groups[3]; - if (g.ToString() != newvalue) - MyGrid.Data = MyGrid.Data.Substring(0, offset + g.Index) + newvalue + MyGrid.Data.Substring(offset + g.Index + g.Length); - } - } - } - } - } - } - public partial class ContentInfo - { - public void FixTransitionText(TransitionInfo tran) - { - string transText = tran.ResolvePathTo(); - string lookFor = string.Format(@"", tran.TranType, tran.TransitionID); - //string lookFor = string.Format(@"", tran.TranType, tran.TransitionID); - Match m = Regex.Match(Text, lookFor); - if (m != null && m.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = m.Groups[3]; - if (g.ToString() != transText) - _Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length); - } - // see if there is a grid to update too. - if (tran.MyContent.MyGrid != null) - { - string lookForXml = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID); - Match mg = Regex.Match(MyGrid.Data, lookForXml); - if (mg != null && mg.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = mg.Groups[3]; - //if (g.ToString() != transText) - // MyGrid.Data = MyGrid.Data.Substring(0, g.Index) + transText + MyGrid.Data.Substring(g.Index + g.Length); - } - } - } - public void FixTransitionText(TransitionInfo tran, TransitionLookup tranLookup) - { - string transText = tran.ResolvePathTo(tranLookup); - string lookFor = string.Format(@"", tran.TranType, tran.TransitionID); - //string lookFor = string.Format(@"", tran.TranType, tran.TransitionID); - Match m = Regex.Match(Text, lookFor); - if (m != null && m.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = m.Groups[3]; - if (g.ToString() != transText) - _Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length); - } - // see if there is a grid to update too. - if (tran.MyContent.MyGrid != null) - { - string lookForXml = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* ([^#]*?)(\\[^v'? \\]+)*\\v(\\[^v \\]+)* #Link:Transition[^:]*?:{0} {1}( [0-9]*){{1,2}}\[END>", tran.TranType, tran.TransitionID); - Match mg = Regex.Match(MyGrid.Data, lookForXml); - if (mg != null && mg.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = mg.Groups[3]; - //if (g.ToString() != transText) - // MyGrid.Data = MyGrid.Data.Substring(0, g.Index) + transText + MyGrid.Data.Substring(g.Index + g.Length); - } - } - } - public void FixContentText(RoUsageInfo rousg, string value, int rotype, ROFstInfo origROFstInfo) // string newvalue) - { - string newvalue = value; - string findLink = @""; - MatchCollection ms = Regex.Matches(Text, findLink); - string lookFor = string.Format(@"", rousg.ROUsageID); - foreach (Match mm in ms) - { - int offset = mm.Index; - Match m = Regex.Match(mm.Value, lookFor, RegexOptions.Singleline); - if (m != null && m.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = m.Groups[3]; - if (g.ToString() != newvalue) - { - _Text = Text.Substring(0, offset + g.Index) + newvalue + Text.Substring(offset + g.Index + g.Length); - break; // Text has been processed - } - } - } - // see if there is a grid to update too. - if (rousg.MyContent.MyGrid != null) - { - if (rotype == (int)E_ROValueType.Table) // if change in rotable data... - { - List retlist = origROFstInfo.OnROTableUpdate(this, new ROFstInfoROTableUpdateEventArgs(newvalue, MyGrid.Data)); - if (Text != retlist[0]) _Text = retlist[0]; - //if (MyGrid.Data != retlist[1]) MyGrid.Data = retlist[1]; - } - else - { - // if it's an ro within a table, need to process into an flex grid to save the grid data: - string findLinkXml = @"<START\].*?\[END>"; - string lookForXml = string.Format(@"<START\](\\[^v \\]+)*\\v0(\\[^v \\]+)* (.*?)(\\[^v '?\\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>", rousg.ROUsageID); - MatchCollection msg = Regex.Matches(MyGrid.Data, findLinkXml); - foreach (Match mmg in msg) - { - int offset = 0; // crashed in substring line below if using mmg.Index; Set to 0 and it worked - KBR. - Match mg = Regex.Match(MyGrid.Data, lookForXml); - if (mg != null && mg.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = mg.Groups[3]; - //if (g.ToString() != newvalue) - // MyGrid.Data = MyGrid.Data.Substring(0, offset + g.Index) + newvalue + MyGrid.Data.Substring(offset + g.Index + g.Length); - } - } - } - } - } - public PartInfoList LocalContentParts - { - get { return _ContentParts; } - } - public void AddPart(SafeDataReader dr, ItemInfo itemInfo) - { - if (_ContentParts == null) - _ContentParts = new PartInfoList(dr, itemInfo); - else - _ContentParts.AddPartInfo(dr, itemInfo); - } - public override string ToString() - { - return string.Format("{0} {1}", Number, Text); - } - public void ShowChange() - { - OnChange(); - } - //public XmlNode ToXml(XmlNode xn) - //{ - // XmlNode nd = xn.OwnerDocument.CreateElement("Content"); - // xn.AppendChild(nd); - // AddAttribute(nd, "Number", _Number); - // AddAttribute(nd, "Text", _Text); - // AddAttribute(nd, "FormatID", _FormatID); - // AddAttribute(nd, "Config", _Config); - // return nd; - //} - //public void AddAttribute(XmlNode xn, string name, object o) - //{ - // if (o != null && o.ToString() != "") - // { - // XmlAttribute xa = xn.OwnerDocument.CreateAttribute(name); - // xa.Value = o.ToString(); - // xn.Attributes.Append(xa); - // } - //} - internal ContentInfo(SafeDataReader dr,bool ForItem) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentInfo.Constructor", GetHashCode()); - try - { - ReadDataItemList(dr); - _CacheList.Add(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentInfo.Constructor", ex); - throw new DbCslaException("ContentInfo.Constructor", ex); - } - } - private void ReadDataItemList(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentInfo.ReadDataItemList", GetHashCode()); - try - { - _ContentID = dr.GetInt32("ContentID"); - _Number = dr.GetString("Number"); - _Text = dr.GetString("Text"); - _Type = (int?)dr.GetValue("Type"); - _FormatID = (int?)dr.GetValue("FormatID"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("cDTS"); - _UserID = dr.GetString("cUserID"); - _ContentDetailCount = dr.GetInt32("DetailCount"); - _ContentEntryCount = dr.GetInt32("EntryCount"); - _ContentGridCount = dr.GetInt32("GridCount"); - _ContentImageCount = dr.GetInt32("ImageCount"); - _ContentItemCount = dr.GetInt32("ItemCount"); - _ContentPartCount = dr.GetInt32("cPartCount"); - _ContentRoUsageCount = dr.GetInt32("RoUsageCount"); - _ContentTransitionCount = dr.GetInt32("TransitionCount"); - _ContentZContentCount = dr.GetInt32("ZContentCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ContentInfo.ReadData", ex); - } - } - - } - public partial class ContentInfoList - { - public static ContentInfoList GetList(int? itemID) - { - try - { - ContentInfoList tmp = DataPortal.Fetch(new ContentListCriteria(itemID)); - ContentInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetChildren", ex); - } - } - [Serializable()] - private class ContentListCriteria - { - public ContentListCriteria(int? itemID) - { - _ItemID = itemID; - } - private int? _ItemID; - public int? ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - private void DataPortal_Fetch(ContentListCriteria criteria) - { - this.RaiseListChangedEvents = false; - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_ListContentsByItemID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - { - ContentInfo contentInfo = new ContentInfo(dr); - this.Add(contentInfo); - } - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - Database.LogException("ContentInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ContentInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayTextANSI.cs b/PROMS/VEPROMS.CSLA.Library/Extension/DisplayTextANSI.cs deleted file mode 100644 index 0b0adad8..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DisplayTextANSI.cs +++ /dev/null @@ -1,824 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; -using System.Text.RegularExpressions; -using System.Drawing; - -namespace VEPROMS.CSLA.Library -{ - public class DisplayText - { - #region Properties - private ItemInfo _MyItemInfo; - // list of 'pieces of text' for this item. Pieces include symbols, ros, - // transitions & plain text. - private List _DisplayTextElementList; - public List DisplayTextElementList - { - get { return _DisplayTextElementList; } - set { _DisplayTextElementList = value; } - } - // dictionary for the font table for this item. Note that this may - // go away (it is not really used). - private Dictionary _dicRtfFontTable; - public Dictionary dicRtfFontTable - { - get { return _dicRtfFontTable; } - set { _dicRtfFontTable = value; } - } - private VE_Font _textFont; // Font from format for this item - public VE_Font TextFont - { - get { return _textFont; } - set { _textFont = value; } - } - public string StartText; - public string OriginalText; // compare for save to see if change. - private FormatInfo _MyFormat; - #endregion - #region Constructors - /// - /// DisplayText constructor: - /// Creates a DisplayText object that converts the database text into rtf text - /// Arguments are: - /// ItemInfo itemInfo - the item whose text will be resolved - /// E_EditPrintMode ep_mode - edit or print. - /// E_ViewMode vw_mode - view or edit. - /// bool noEdit - flags whether to edit or not (used to set data in - /// rtb as resolved replacewords for non-active rtb. - /// - public DisplayText(ItemInfo itemInfo, E_EditPrintMode epMode, E_ViewMode vwMode, bool noEdit) - { - _MyItemInfo = itemInfo; - OriginalText = itemInfo.MyContent.Text; - TextFont = GetItemFont(); - string text = _MyItemInfo.MyContent.Text; - - // if in print mode, view mode, or non-active richtextbox do replace words. Only if in - // actual edit mode are replace words left as is. - _MyFormat = itemInfo.ActiveFormat; - if (epMode == E_EditPrintMode.Print || vwMode == E_ViewMode.View || noEdit) text = DoReplaceWords(text); - - // adjust formatting of exponents - if (!_MyFormat.PlantFormat.FormatData.SectData.StepSectionData.FortranFormatNumbers && (epMode == E_EditPrintMode.Print || vwMode == E_ViewMode.View || noEdit)) text = DoFortranFormat(text); - - // as a precaution, convert any \~ to \u160?. This is for Hard spaces. see the commentary in the - // save portion of this code for an explanation. - text = text.Replace(@"\~", @"\u160?"); - text = text.Replace(@"\r\n", @"\par "); - - text = text.Replace(@"\line", @"\par"); - - // add colors around links: - text = Regex.Replace(text, @"( x103 where 3 is superscripted - // and 10.E5 -> 10x10-5 where 5 is superscripted - string pat = @"(\d*).E([+-]*\d+)"; - string retstr = text; - // for each one that needs translated: - foreach (Match m in Regex.Matches(text, pat)) - { - string fnum = m.Groups[1].Value; - string supnum = m.Groups[2].Value; - string newstr = string.Format(@"{0}x10\super {1}\nosupersub ", fnum, supnum); - retstr = retstr.Replace(m.Value, newstr); - } - return retstr; - } - #endregion - #region SaveData - public bool Save(RichTextBox rtb) - { - try - { - Item itm = _MyItemInfo.Get(); - // check for different text, i.e. text from this itm doesn't match - // original text, a change occurred in database, but not from this user. - if (OriginalText != itm.MyContent.Text) - { - Console.WriteLine("Save Failed because text changed outside of this edit session."); - return false; - } - - // remove rtf codes that aren't defining attributes, symbols, or links - string modtext = RtfToDbText(rtb.Rtf); - - if (modtext != OriginalText) - { - // if there are links, we'll need to do extra processing to see if - // there were additions, deletions or modifications. - bool haslinks = ((modtext.IndexOf(@" -1) || (OriginalText != null && OriginalText != "" && OriginalText.IndexOf(@" -1)); - if (haslinks) - { - // Get all links in original list - RtfToDisplayTextElements(OriginalText); - List origList = GetLinkList(DisplayTextElementList); - // now get new text into displaytext elements for comparison for links: - RtfToDisplayTextElements(rtb.Rtf); - - // Compare ro/transition lists and delete or add any to the item for any ros/transitions that have been - // added/deleted or modified. - ProcessRoTranChanges(itm, origList); - itm.MyContent.Text = DteToString(); - } - else - { - itm.MyContent.Text = modtext; - itm.Save(); - } - - if (haslinks) - { - // if new transitions/ros, we need to 'fix' the string in the embedded link to contain the - // transition or usage record. - Dictionary ctReplacements = BuildCtReplacements(itm.MyContent.ContentTransitions); - Dictionary roUsgReplacements = BuildRoUsgReplacements(itm.MyContent.ContentRoUsages); - itm.Save(); - if (ctReplacements.Count > 0) - { - itm.MyContent.Text = FixCtReplacements(itm.MyContent.Text, ctReplacements); - itm.Save(); - } - if (roUsgReplacements.Count > 0) - { - itm.MyContent.Text = FixRoUsgReplacements(itm.MyContent.Text, roUsgReplacements); - itm.Save(); - } - modtext = itm.MyContent.Text; - } - OriginalText = modtext; - } - else - return true; // no text changed, but did not fail so return true. - } - catch (Exception ex) - { - Console.WriteLine("Save Failed with error: {0}", ex.Message); - return false; - } - return true; - } - private string DteToString() - { - StringBuilder sret = new StringBuilder(); - foreach (displayTextElement vte in DisplayTextElementList) - { - if (vte.Type == E_TextElementType.Text || vte.Type == E_TextElementType.Symbol) - sret.Append(vte.Text); - else - { - displayLinkElement dle = vte as displayLinkElement; - if (vte != null) sret.Append(dle.TextAndLink); - } - } - string modtext = sret.ToString(); - return modtext; - } - private string FixRoUsgReplacements(string p, Dictionary roUsgReplacements) - { - foreach (int oldid in roUsgReplacements.Keys) - { - p = p.Replace(string.Format("", oldid), roUsgReplacements[oldid].ROUsageID.ToString()); - } - return p; - } - private Dictionary BuildRoUsgReplacements(ContentRoUsages contentRoUsages) - { - Dictionary retval = new Dictionary(); - foreach (ContentRoUsage rou in contentRoUsages) - { - if (rou.ROUsageID < 0) retval.Add(rou.ROUsageID, rou); - } - return retval; - } - private string FixCtReplacements(string p, Dictionary ctReplacements) - { - foreach (int oldid in ctReplacements.Keys) - { - p = p.Replace(string.Format("",oldid),ctReplacements[oldid].TransitionID.ToString()); - } - return p; - } - private Dictionary BuildCtReplacements(ContentTransitions contentTransitions) - { - Dictionary retval = new Dictionary(); - foreach (ContentTransition ct in contentTransitions) - { - if (ct.TransitionID < 0) retval.Add(ct.TransitionID, ct); - } - return retval; - } - private void ProcessRoTranChanges(Item itm, List origList) - { - // go through list. Note that only linked items are in the origList. - // 1) delete any that are in origList but not in the DisplayTextElementList - // (that represents the current text & links) - // 2) add any that are only in DisplayTextElementList - // 3) delete/add for modify? - - // delete first - if in original, but not in current list, delete the one - // in the original list. - foreach (displayLinkElement odte in origList) - { - bool found = false; - foreach (displayTextElement dte in DisplayTextElementList) - { - if (dte.Type == odte.Type) - { - displayLinkElement l_dte = (displayLinkElement)dte; - if (odte.Link == l_dte.Link) - { - found = true; - break; - } - } - } - // remove the link element from the item. - if (!found) - { - // Get record id for ro or trans and then find the associated ro or transition - // in the item's list. remove it. - int recid = -1; - if (odte.Type != E_TextElementType.ReferencedObject) - { - int sp = odte.Link.IndexOf(" ") + 1; // get past tran type - string srecid = odte.Link.Substring(sp, odte.Link.IndexOf(" ", sp) - sp); - recid = System.Convert.ToInt32(srecid); - foreach (ContentTransition ct in itm.MyContent.ContentTransitions) - { - if (ct.TransitionID == recid) - { - itm.MyContent.ContentTransitions.Remove(ct); - break; - } - } - } - else - { - int sp = odte.Link.IndexOf(" "); - //rousageid starts after "ReferencedObject:", i.e. index in link of 17 - string srecid = odte.Link.Substring(17, sp-17); - recid = System.Convert.ToInt32(srecid); - foreach (ContentRoUsage cr in itm.MyContent.ContentRoUsages) - { - if (cr.ROUsageID == recid) - { - itm.MyContent.ContentRoUsages.Remove(cr); - break; - } - } - } - } - } - // now do insert, i.e. in new list, but not in old. - foreach (displayTextElement dte in DisplayTextElementList) - { - bool found = false; - if (dte.Type == E_TextElementType.ReferencedObject || dte.Type == E_TextElementType.Transition || dte.Type == E_TextElementType.TransitionRange) - { - foreach (displayLinkElement odte in origList) - { - if (dte.Type == odte.Type) - { - // if the link is the same, it exists, so no action is required. - displayLinkElement l_dte = (displayLinkElement)dte; - if (odte.Link == l_dte.Link) - { - found = true; - break; - } - } - } - // Insert the link (ro or transition) to the item - if (!found) - { - if (dte.Type == E_TextElementType.ReferencedObject) // do ro - { - displayLinkElement l_dte = (displayLinkElement)dte; - Match m = Regex.Match(l_dte.Link, "([A-Za-z]*):(.*)"); - string linkstr = m.Groups[2].Value; - string[] roparts = linkstr.Split(" ".ToCharArray()); - ContentRoUsage rousg = null; - using (RODb rodb = RODb.Get(Convert.ToInt32(roparts[2]))) - { - rousg = itm.MyContent.ContentRoUsages.Add(roparts[1], rodb); - } - l_dte.Link = l_dte.Link.Replace("", string.Format("", rousg.ROUsageID)); - l_dte.TextAndLink = l_dte.TextAndLink.Replace("", string.Format("", rousg.ROUsageID)); - break; - } - else if (dte.Type == E_TextElementType.TransitionRange || dte.Type == E_TextElementType.Transition) - { - displayLinkElement l_dte = (displayLinkElement)dte; - Match m = Regex.Match(l_dte.Link, "([A-Za-z]*):(.*)"); - string linkstr = m.Groups[2].Value; - string[] tparts = linkstr.Split(" ".ToCharArray()); - int type = System.Convert.ToInt32(tparts[0]); - int tr1 = System.Convert.ToInt32(tparts[2]); // tparts[1] is token for tranid - Item itm1 = Item.Get(tr1); - Item itm2 = null; - if (dte.Type == E_TextElementType.TransitionRange) - { - itm2 = Item.Get(System.Convert.ToInt32(tparts[2])); - } - else - itm2 = itm1; - ContentTransition ct = itm.MyContent.ContentTransitions.Add(itm1, itm2); - ct.TranType = type; - l_dte.Link = l_dte.Link.Replace("", string.Format("", ct.TransitionID)); - l_dte.TextAndLink = l_dte.TextAndLink.Replace("", string.Format("", ct.TransitionID)); - } - } - } - } - } - private List GetLinkList(List locDisplayTextElementList) - { - List retList = new List(); - foreach (displayTextElement vte in locDisplayTextElementList) - { - if (vte.Type == E_TextElementType.ReferencedObject || vte.Type == E_TextElementType.TransitionRange || vte.Type == E_TextElementType.Transition) - { - displayLinkElement tmp = (displayLinkElement)vte; - displayLinkElement copy_vte = new displayLinkElement(); - copy_vte.Type = tmp.Type; - copy_vte.Link = tmp.Link; - copy_vte.Text = tmp.Text; - retList.Add(copy_vte); - } - } - return retList; - } - private void RtfToDisplayTextElements(string text) - { - // get original text into displaytext elements for comparison for links: - if (DisplayTextElementList == null) - DisplayTextElementList = new List(); - else - DisplayTextElementList.Clear(); - - if (text == null || text == "") return; - - string noExtraRtfStr = RtfToDbText(text); - - int startIndex = 0; - int index = -1; - while ((index = FindTokenChar(noExtraRtfStr, startIndex)) > -1) - { - // Do any 'plain' text that preceeds the token. - if (index > startIndex) DoTextElement(noExtraRtfStr, startIndex, index); - - if (noExtraRtfStr[index + 1] == 'v') - index = DoLink(noExtraRtfStr, index); - else - index = DoSymbol(noExtraRtfStr, startIndex, index); - startIndex = index; // +1; - if (startIndex >= noExtraRtfStr.Length) break; - } - // Add any remaining text. - if (startIndex < noExtraRtfStr.Length) DoTextElement(noExtraRtfStr, startIndex, index); - } - private string RtfToDbText(string text) - { - // For hardspaces, the windows richtextbox does some 'quirky' things: - // A unicode representation of \u160? is sent INTO the rtb. Coming out, - // that \u160? was translated to a \~ (by the underlying windows rtb). - // Note that if the \~ is sent to the rtb, it is treated as a regular space, - // i.e. no longer a hardspace, and actually is converted to a regular space. - // SO, on the way out, convert any \~ to \u160? - string noExtraRtfStr = text.Replace(@"\~", @"\u160?"); - - // Check for two links in a row & if found, add separating rtf comment - // commands (these get removed in the richtextbox: - noExtraRtfStr = noExtraRtfStr.Replace(@"[END>\v0 \v -1) noExtraRtfStr = noExtraRtfStr.Replace(@"\'05", "\x05"); - - return noExtraRtfStr; - } - private string RemoveRtfStyles(string rtf) - { - string retval = rtf; - // remove rtf commands for any styles that were added. Note that if - // the entire item has a style, and also contains 'pieces' of text with - // the same style, the underlying rtf box removes the embedded rtf commands, - // for example, if the entire step is bolded, and 'THEN' has bold on/off - // surrounding it, the rtf box removes the bold around the 'THEN' - // These remove the command with a following space or the command alone, - // either case may exist, because if there are rtf commands following the - // style command, there will be no space character following the style command. - if (((TextFont.Style & E_Style.Bold) > 0) || ((TextFont.Style & E_Style.MmBold) > 0)) - { - retval = Regex.Replace(retval, @"\\b0 ?", ""); - retval = Regex.Replace(retval, @"\\b ?",""); - } - if ((TextFont.Style & E_Style.Underline) > 0) - { - retval = Regex.Replace(retval, @"\\ulnone ?", ""); - retval = Regex.Replace(retval, @"\\ul ?", ""); - } - if ((TextFont.Style & E_Style.Italics) > 0) - { - retval = Regex.Replace(retval, @"\\i0 ?", ""); - retval = Regex.Replace(retval, @"\\i ?", ""); - } - return retval; - } - public string ReplaceRTFClause(Match m) - { - switch (m.Value[1]) - { - case 'u': - if (Regex.IsMatch(m.Value, @"\\u[0-9]+")) - return m.Value; // Special Charcaters - if (Regex.IsMatch(m.Value, @"\\ulnone")) - return m.Value; - if (Regex.IsMatch(m.Value, @"\\ul.*")) - return m.Value; // Underline - break; - case '\'': // Special Character - return m.Value; - case 'b': // Bold - return m.Value; - case 's': // sub or super.... - if (m.Value == @"\sub") return m.Value; - if (m.Value == @"\super") return m.Value; - break; - case 'n': // nosubsuper... - if (m.Value == @"\nosupersub") return m.Value; - break; - case 'i': // Italics - return m.Value; - case '{': // look for escape for curly braces: - return m.Value; - case '}': - return m.Value; - case 'v': // save link hidden info - if (m.Value == @"\v") return m.Value; // comment part of link - // end comment may end in space or may end in '\' if another rtf command, - // or may end at end of string. First check for space, keep it in string - // if it is there. - if (Regex.IsMatch(m.Value, @"\\v0 ")) - return m.Value; - if (Regex.IsMatch(m.Value, @"\\v0")) - return m.Value; - break; - case 'l': - if (m.Value == @"\line") return m.Value; - break; - case 'p': - if (m.Value == @"\par") return @"\par"; - //if (m.Value == @"\protect") - // return m.Value; - //if (m.Value == @"\protect0") - // return m.Value; - if (m.Value.Length>=6 && m.Value.Substring(0,6) == "\\par\r\n") return m.Value.Replace("\r\n", " "); - break; - case 'f': // handle fonts separately because they may or may not have a space after them - if (m.Value[2]>='0' && m.Value[2]<='9')return m.Value; - break; - } - return "";//Strip All - } - private string StripRtfCommands(string rtf) - { - // replace \{ & \} with (![ & (!] respectively and then redo at end. The curly braces - // are rtf so were getting removed and/or not handled correctly. - string retval = rtf.Replace(@"\{", @"(!["); - retval = retval.Replace(@"\}", @"(!]"); - - // remove carriage return/newlines after \par commands (these are introduced by rtb - // for hard returns, goes into rtb as \par and comes out as \par\r\n): - retval = Regex.Replace(retval, @"\\par\r\n([^\\.*?])", "\\par $1"); - retval = Regex.Replace(retval, @"\\par\r\n([\\.*?])", "\\par$1"); - - retval = Regex.Replace(retval, @"[\r\n]", "", RegexOptions.Singleline); // Strip Carriage Returns and Newlines - retval = Regex.Replace(retval, @"^\{(.*)\}$", "$1", RegexOptions.Singleline); // Strip Opening and Closing Braces - retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - retval = Regex.Replace(retval, @"\\f[0-9] ", ""); // remove font command with ending space - retval = Regex.Replace(retval, @"\\f[0-9]", ""); // remove font command without ending space - retval = Regex.Replace(retval, @"\\[^ \\?]+", new MatchEvaluator(ReplaceRTFClause)); // take backslash xyz and evaluates them - // remove a space if there is one as the first character or the last character - if (retval[0]==' ')retval = retval.Remove(0, 1); - retval = retval.TrimEnd(' '); - // remove \r\n and \par at end of string. - if (retval.Substring(retval.Length - 2, 2) == "\r\n") retval = retval.Remove(retval.Length - 2, 2); - if (retval.Substring(retval.Length - 4, 4) == @"\par") retval = retval.Remove(retval.Length - 4, 4); - - if (retval.Length == 0) return ""; - if (retval.Substring(retval.Length - 2, 2) == @"\v") retval = retval.Remove(retval.Length - 2, 2); - retval = RemoveRtfStyles(retval); - retval = retval.Replace(@"(![", @"\{"); - retval = retval.Replace(@"(!]", @"\}"); - return retval; - } - #endregion - #region StyleData - private VE_Font GetItemFont() - { - VE_Font font = null; - FormatInfo format = _MyItemInfo.ActiveFormat; - int type = (int)_MyItemInfo.MyContent.Type; - switch (type/10000) - { - case 0: // procedure - font = format.PlantFormat.FormatData.Font; - break; - case 1: // section - font = format.PlantFormat.FormatData.SectData.SectionHeader.Font; - break; - case 2: // step types - int typindx = type - 20000; // what to do for other types rather than steps - font = format.PlantFormat.FormatData.StepDataList[typindx].Font; - break; - } - TextFont = font; - return font; - } - #endregion - #region DoListElements - private int FindTokenChar(string txt, int startIndex) - { - // 'tokens' are for symbols and links (ro & transitions). symbols are represented by \u - // and links are represented by \v \v0 - bool done = false; - while (!done) - { - int indx = txt.IndexOf('\\', startIndex); - if (indx < 0) return indx; - // see if symbol (but not underline) or another rtf command: has a 'u' - // followed by a non-underline or single quote, and if so, return it. - if (((txt[indx + 1] == 'u' && txt[indx + 2] != 'l')) || (txt[indx + 1] == '\'')) return indx; - // see if link - if (txt[indx + 1] == 'v') return indx; - // Otherwise, get next index, must have been a slash or other rtf command. - startIndex = indx + 1; - } - return -1; - } - private int DoTextElement(string text, int startIndex, int index) - { - displayTextElement vte = new displayTextElement(); - vte.Type = E_TextElementType.Text; - int len = (index == -1) ? text.Length - startIndex : index - startIndex; - vte.Text = text.Substring(startIndex, len); - DisplayTextElementList.Add(vte); - return index+1; - } - private int DoLink(string text, int startIndex) - { - int retval = -1; - int fnd = text.IndexOf("#Link:", startIndex); - if (text.Substring(fnd + 6, 3) == "Ref") - retval = DoRO(text, startIndex); - else - retval = DoTran(text, startIndex); - return retval; - } - private int DoRO(string text, int index) - { - displayLinkElement vte = new displayLinkElement(); - vte.Type = E_TextElementType.ReferencedObject; - return DoLinkElements(text, index, vte); - } - private string FixTransition(string link, string text) - { - if (link.IndexOf("") != -1) return text; - int transitionID = Convert.ToInt32(link.Split(" ".ToCharArray())[1]); - // Find the transition - if (_MyItemInfo.MyContent.ContentTransitionCount <= 0) return "*Resolved Transition Text*"; - foreach (TransitionInfo ti in _MyItemInfo.MyContent.ContentTransitions) - { - if (ti.TransitionID == transitionID) - { - string path = ti.ResolvePathTo(_MyFormat, _MyItemInfo, ItemInfo.Get(ti.ToID), ti.RangeID==0?null:ItemInfo.Get(ti.RangeID)); - return path; - } - } - return text; - } - private int DoTran(string text,int index) - { - displayLinkElement vte = new displayLinkElement(); - - // determine if Range by checking for "R" after Transition (otherwise ":") - int linkindx = text.IndexOf(@"#Link", index); - vte.Type = (text[linkindx+16]=='R')?E_TextElementType.TransitionRange:E_TextElementType.Transition; - return DoLinkElements(text, index, vte); - } - private int DoLinkElements(string text, int index, displayLinkElement vte) - { - // Find the 'end comment' for the - int endLinkIndxV = text.IndexOf(@"\v0 ", linkIndx); - if (endLinkIndxV == -1) endLinkIndxV = text.IndexOf(@"\v0", linkIndx); // at end of string - int endLinkIndxE = text.IndexOf(@"[END>", linkIndx); - int endLinkIndx = (endLinkIndxV < endLinkIndxE) ? endLinkIndxV : endLinkIndxE; - vte.Link = text.Substring(linkIndx + 6, endLinkIndx - linkIndx - 6); // 6 for #Link: - - string tmptxt = null; - if (vte.Type != E_TextElementType.ReferencedObject) - { - tmptxt = FixTransition(vte.Link, vte.Text); - vte.Text = tmptxt; - } - - // Now get the entire text & link. Account for various ending possibilities: - // ends with '\v0\'; ends with '\v0 '; ends with '\v0' (end of string); - // ends with '[END>' if two in a row - will have ", endLinkIndx + 3); // get past end of link - int endComment = text.IndexOf(@"\v0", endToken); - - int rettoken = 0; - int retlen = 4; - if (endComment + 3 == text.Length) retlen = 3; - else if (text[endComment + 3] == '\\') retlen = 3; - vte.TextAndLink = text.Substring(index, endComment - index + retlen); - rettoken = endComment + retlen; - if (vte.Type != E_TextElementType.ReferencedObject) vte.TextAndLink = vte.TextAndLink = vte.TextAndLink.Replace("(Resolved Transition Text)", tmptxt); - DisplayTextElementList.Add(vte); - return rettoken; - } - private int DoSymbol(string text, int startIndex, int index) - { - displayTextElement vte = new displayTextElement(); - vte.Type = E_TextElementType.Symbol; - // symbols are the unicode/rtf command. A symbol can be represented by \'xy or - // in the text from the database \uxyz?. If the \'xy is used the length of the - // symbol number will always be two, otherwise find the index of the '?' to - // find the end. - int endindx = -1; - if (text[index + 1] == '\'') endindx = index + 3; - else endindx = text.IndexOf("?", index); - vte.Text = text.Substring(index, endindx - index + 1); - DisplayTextElementList.Add(vte); - return endindx+1; - } - #endregion - #region ReplaceWords - private ReplaceStr _rs; - //private string ReplaceIt(Match m) - //{ - // string s = m.ToString(); - // string t = s.Replace(_rs.ReplaceWord, _rs.ReplaceWith); - // return m.ToString().Replace(_rs.ReplaceWord, _rs.ReplaceWith); - //} - private string DoReplaceWords(string Text) - { - ReplaceStrList rsl = _MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList; - foreach (ReplaceStr rs in rsl) - { - if (_MyItemInfo.MyContent.Type < 20000) return Text; // for now only replace in steps. - bool replaceit = false; - - // note that the order of this check is important. Check in this order... - // background here - if (_MyItemInfo.IsHigh && (rs.Flag & E_ReplaceFlags.High)>0) replaceit = true; - else if ((_MyItemInfo.IsTable || _MyItemInfo.IsFigure) && (rs.Flag & E_ReplaceFlags.Table) > 0) replaceit = true; - else if (_MyItemInfo.IsInRNO && (rs.Flag & E_ReplaceFlags.RNO) > 0) replaceit = true; - else if (_MyItemInfo.IsCaution && (rs.Flag & E_ReplaceFlags.Caution) > 0) replaceit = true; - else if (_MyItemInfo.IsNote && (rs.Flag & E_ReplaceFlags.Note) > 0) replaceit = true; - else if (_MyItemInfo.IsInFirstLevelSubStep && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - else if (_MyItemInfo.IsAccPages & (rs.Flag & E_ReplaceFlags.Attach) > 0) replaceit = true; - - if (replaceit) - { - // CASEINSENS: Do ReplaceWords for all words that match, regardless of case, and replace - // with the ReplaceWith string as is - if ((rs.Flag & E_ReplaceFlags.CaseInsens) > 0) - { - string res = ""; - string fortest = Text.ToUpper(); - string pat = @"(?<=\W|^)" + rs.ReplaceWord.ToUpper() + @"(?=\W|$)"; - int cpindx = 0; - foreach (Match m in Regex.Matches(fortest, pat)) - { - res += Text.Substring(cpindx, m.Index-cpindx); - cpindx += (m.Index - cpindx); - res += rs.ReplaceWith; - cpindx += rs.ReplaceWord.Length; - } - if (cpindx < Text.Length) res += Text.Substring(cpindx, Text.Length - cpindx); - Text = res; - } - // CASEINSENSALL: Do ReplaceWords for all words that match the ReplaceWord, regardless of case - else if ((rs.Flag & E_ReplaceFlags.CaseInsensAll) > 0) - { - // not in hlp - } - // CASEINSENSFIRST: Do ReplaceWords for all words that exactly match the ReplaceWord, - // except the case where the first character may be different - else if ((rs.Flag & E_ReplaceFlags.CaseInsensFirst) > 0) - { - // not in hlp - } - else - { - string pat = @"(?<=\W|^)" + rs.ReplaceWord + @"(?=\W|$)"; - Text = Regex.Replace(Text, pat, rs.ReplaceWith); - } - - } - } - return Text; - } - #endregion - } - #region displayTextElementClass - public enum E_TextElementType : uint - { - Text = 0, - Transition = 1, - TransitionRange = 2, - ReferencedObject = 3, - Symbol = 4 - }; - public class displayTextElement - { - private E_TextElementType _Type; - public E_TextElementType Type - { - get { return _Type; } - set { _Type = value; } - } - private string _Text; - public string Text - { - get { return _Text; } - set { _Text = value; } - } - } - public class displayLinkElement : displayTextElement - { - private string _Link; - public string Link - { - get { return _Link; } - set { _Link = value; } - } - private string _TextAndLink; - public string TextAndLink - { - get { return _TextAndLink; } - set { _TextAndLink = value; } - } - } - #endregion - -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocVersionExt.cs.bak b/PROMS/VEPROMS.CSLA.Library/Extension/DocVersionExt.cs.bak deleted file mode 100644 index 8ead7849..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocVersionExt.cs.bak +++ /dev/null @@ -1,512 +0,0 @@ -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Collections.Generic; -//using VEPROMS.Properties; - -namespace VEPROMS.CSLA.Library -{ - public partial class DocVersion: IVEDrillDown - { - #region VersionType - public VersionTypeEnum eVersionType - { - get { return (VersionTypeEnum)_VersionType; } - set { _VersionType = (int)value; } - } - #endregion - #region DocVersion Config - [NonSerialized] - private DocVersionConfig _DocVersionConfig; - public DocVersionConfig DocVersionConfig - { - get - { - if (_DocVersionConfig == null) - { - _DocVersionConfig = new DocVersionConfig(this); - _DocVersionConfig.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_DocVersionConfig_PropertyChanged); - } - return _DocVersionConfig; - } - } - private void _DocVersionConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) - { - Config = _DocVersionConfig.ToString(); - } - #endregion - #region UserSettings - /// - /// These settings are set on the user interface side. - /// This is used to control whether the Name and/or Title is displayed - /// next to the tree nodes in the user interface - /// - private bool _DisplayTreeNodeNames = true; - public bool DisplayTreeNodeNames - { - get { return _DisplayTreeNodeNames; } - set { _DisplayTreeNodeNames = value; } - } - private bool _DisplayTreeNodeTitles = false; - - public bool DisplayTreeNodeTitles - { - get { return _DisplayTreeNodeTitles; } - set { _DisplayTreeNodeTitles = value; } - } - #endregion - public override string ToString() - { - // assume that at least one of the two options was selected - string rtnstr = ""; - if (_DisplayTreeNodeNames) rtnstr = Name; - if (_DisplayTreeNodeTitles) - { - if (rtnstr.Length > 0) rtnstr += " - "; - rtnstr += Title; - } - return rtnstr; - //return string.Format("{0} - {1}", Name, Title); - } - #region IVEDrillDown - //public System.Collections.IList GetChildren() - //{ - // return null; - //} - //public bool HasChildren - //{ - // get { return _ItemID > 0; } - //} - //public IVEDrillDown ActiveParent - //{ - // get - // { - // return MyFolder; - // } - //} - //private Format _ActiveFormat = null; - //public Format ActiveFormat - //{ - // get - // { - // if (_ActiveFormat == null) - // _ActiveFormat = LocalFormat != null ? LocalFormat : ActiveParent.ActiveFormat; - // return _ActiveFormat; - // } - // set - // { - // _ActiveFormat = null; - // } - //} - //public Format LocalFormat - //{ - // get { return MyFormat; } - //} - public ConfigDynamicTypeDescriptor MyConfig - { - get { return DocVersionConfig; } - } - #endregion - public DocVersionInfo MyDocVersionInfo - { get { return DocVersionInfo.Get(VersionID); } } - } - public partial class DocVersionInfo : IVEDrillDownReadOnly - { - #region SearchPaths - public string _SearchDVPath; - public string SearchDVPath - { - get - { - if (_SearchDVPath == null) - _SearchDVPath = ActiveParent.SearchDVPath + "\u0007" + Name; - return _SearchDVPath; - } - } - public string SearchPath { get { return ""; } } - #endregion - - #region DocVersion Config - [NonSerialized] - private DocVersionConfig _DocVersionConfig; - public DocVersionConfig DocVersionConfig - { get { return (_DocVersionConfig != null ? _DocVersionConfig : _DocVersionConfig = new DocVersionConfig(this)); } } - private void DocVersionConfigRefresh() - { - _DocVersionConfig = null; - } - #endregion - #region MOVE TO DOCVERSION CONFIG - private string GetProfile(string grp, string nam) - { - return GetProfile(grp, nam, false); - } - - private string GetProfile(string grp, string nam, bool flag) - { - DocVersionConfig dvcfg = DocVersionConfig; - string buff = null; - if (grp != null && !grp.Equals(string.Empty)) - { - buff = dvcfg.GetValue(grp, nam); // get the value of 'nam' in 'grp' - if (buff == null || buff.Equals(string.Empty)) - { - if (!flag) - buff = string.Format("<{0}-{1}>", grp, nam); - else - buff = null; - } - } - return buff; - } - - - public string UnitSpecific(string str, int len) - { - - // This routine retrieves the procedure number format from the - // current directory and uses it to adjust the procedure number - // in the specified string - string retvalu = ""; - string asis = "#"; - if (str == null || str.Equals(string.Empty)) return retvalu; // return a null (empty) string - /* - * Bug fix: B2005-017 3/2/2005 - * Need to use the largest procedure number length that's in the - * SET.DFF file. "LargestNumber" is the largest length after the - * procedure number is replaced via the SET.INI file "replace" list. - * - if(len==0)len=LargestNumber; - */ - // TODO: Do we need this line?-->>> if(len==0)len=LargestRawSetNumber; - - //GetPrivateProfileString("unit", "procedure number", asis, mstr, MAXPATH, "proc.ini"); - string pnum = asis; - //rhm/jcb stuff 20120511 - //string mstr = GetProfile("Unit", "ProcedureNumber", true); - string mstr = DocVersionConfig.Unit_ProcedureNumber; - if (mstr != null && !mstr.Equals(string.Empty)) - pnum = mstr; - if (pnum.Equals(asis)) - retvalu = str; - else if (pnum[0] == '!') - { - // look for mstr in SET.INI - // GetPrivateProfileString("replace", mstr, mstr, tonum, 24, "set.ini"); - - // TODO: NOT SURE IF SET.INI AND PROC.INI HAVE UNIQUE GROUP NAMES!!!!!!! - //mstr = GetProfile("Replace", mstr); - mstr = GetProfile("Replace", mstr, true); // true allow it to return a null if not found - if (mstr == null) retvalu = str; // no replacement, use procedure number as is - } - else - { - retvalu = ""; - string[] pnumsplit = pnum.Split(new Char[] { '#' }); - int cnt = 0; - foreach (string s in pnumsplit) - { - if (!s.Equals(string.Empty)) - { - if ((cnt == 0) && (str.StartsWith(" "))) - { - string padding = new string(' ', s.Length); - retvalu += padding; - } - else - retvalu += s; - } - else - retvalu += str.Trim(); - cnt++; - } - // append trailing blanks or procedure number (str) - if (str.EndsWith(" ")) - { - // count number of trailing blanks and append them to retvalu - cnt = str.Length - 1; - while (cnt > 0 && str[cnt] == ' ') cnt--; - retvalu += new string(' ', str.Length - cnt - 1); - } - } - return retvalu; - } - - public string Evaluate(string str, int len) - { - string retval = null; - string swhir = "PSU"; /* order inwhich to check */ - string pn; - if (str.Length > 1 && str[1] == '-') - { - int swptr = swhir.IndexOf((str.ToUpper())[0]); - //char swchar = ''; - //if (swptr != -1) - // swchar = swhir[swptr]; - - string sav = str.Substring(len); - str = str.Substring(0, len); - string substr = str.Substring(2); - substr = substr.Replace(" ",""); - while (swptr >= 0 && swptr < swhir.Length && retval == null) //retval.Equals(string.Empty)) - { - switch (swhir[swptr]) - { - case 'U': - //retval = GetProfile("Unit", substr, true); - if (substr.ToLower() == "id") - retval = this.DocVersionConfig.Unit_ID; - if (substr.ToLower() == "name") - retval = this.DocVersionConfig.Unit_Name; - if (substr.ToLower() == "number") - retval = this.DocVersionConfig.Unit_Number; - if (substr.ToLower() == "text") - retval = this.DocVersionConfig.Unit_Text; - //retval = this.DocVersionConfig.Other_Unit_ID; - //retval = this.DocVersionConfig.Other_Unit_Name; - //retval = this.DocVersionConfig.Other_Unit_Number; - //retval = this.DocVersionConfig.Other_Unit_Text; - break; - case 'S': - //retval = GetProfile("Procedure_Set", substr, true); - if(substr.ToLower() == "id") - retval = this.DocVersionConfig.Unit_ProcedureSetID; - if (substr.ToLower() == "name") - retval = this.DocVersionConfig.Unit_ProcedureSetName; - break; - case 'P': - //TODO: THIS IS A GLOBAL IN THE 16 BIT CODE!!!! - string procnumber = ""; - pn = UnitSpecific(procnumber, 0); - retval = GetProfile(pn, substr, true); - break; - } - if (retval == null) // .Equals(string.Empty)) - swptr++; - } - str += sav; - } - else if (len == 1 && (str.ToUpper())[0] == 'U') - { - retval = this.DocVersionConfig.Unit_Number; - } - else if (len == 2 && str.StartsWith("ID")) - { - retval = this.DocVersionConfig.Unit_ID; - } - // if the return value is empty, then the resulting - // evaluation should repeat the token string including - // the braces. - the beginning brace is not passed in. - //if (retval.Equals(string.Empty)) - //{ - // retval = (char*)mallocq(len + 3); - // strncpy(retval, str - 1, len + 2); - //} - if (retval == null) - retval = string.Format("<{0}>", str.Substring(0, len)); - - return retval; - } - - - public string ProcessDocVersionSpecificInfo(string rawvalue) - { - string str = rawvalue; - string rtnstr = ""; - int l = rawvalue.Length; - while (l > 0) - { - int ptr = str.IndexOf('<'); //nextDelimiter("<", str, l); - int cptr = (ptr == -1) ? -1 : str.IndexOf('>'); //nextDelimiter(">", ptr, strlen(ptr)); - // jsj 2/5/10 added "|| (ptr > cptr)" to fix bug where rawvalue = "Insert token for ->Step<- to transition back to." - if (ptr == -1 || (ptr > -1 && ((cptr == -1) || (ptr > cptr)))) - { - //add(new seText(str, l)); - //str += l; - rtnstr += str; - l = 0; // jump out of while loop - } - else - { - int cnt = ptr; - if (cnt > 0) - { - //add(new seText(str, cnt)); - rtnstr += str.Substring(0, cnt); - l -= cnt; - str = str.Substring(ptr); - } - ptr = str.IndexOf('>')+1; //nextDelimiter(">", str, l) + 1; - cnt = ptr; //(int)(ptr - str); - //add(new seUser(str + 1, cnt - 2)); - rtnstr += Evaluate(str.Substring(1, cnt - 2),cnt-2); - l -= cnt; - str = str.Substring(ptr); //ptr; - } - } - return rtnstr; - } - - - #endregion - - ItemInfoList _Procedures = null; - public ItemInfoList Procedures - { get { return (_Procedures != null ? _Procedures : _Procedures = ItemInfoList.GetList(_ItemID, (int)E_FromType.Procedure)); } } - public void ResetProcedures() - { - _Procedures = null; - } - #region IVEReadOnlyItem - public System.Collections.IList GetChildren() - { - return Procedures; - } - //public bool ChildrenAreLoaded - //{ - // get { return _iil == null; } - //} - public bool HasChildren - { - get { return _ItemID > 0; } - } - public IVEDrillDownReadOnly ActiveParent - { - get - { - return MyFolder; - } - } - public FormatInfo ActiveFormat - { - get {return LocalFormat != null ? LocalFormat : ActiveParent.ActiveFormat;} - } - public FormatInfo LocalFormat - { - get { - //Console.WriteLine("DV Local {0} {1} {2}", (MyFormat == null) ? "MYformat is null" : MyFormat.Name,FormatID,(MyFormat == null)?0:MyFormat.FormatID); - return MyFormat; - } - } - public ConfigDynamicTypeDescriptor MyConfig - { - get { return Get().DocVersionConfig; } - } - //public bool HasStandardSteps() - //{ return false; } - #region UserSettings - /// - /// These settings are set on the user interface side. - /// This is used to control whether the Name and/or Title is displayed - /// next to the tree nodes in the user interface - /// - private bool _DisplayTreeNodeNames = true; - public bool DisplayTreeNodeNames - { - get { return _DisplayTreeNodeNames; } - set { _DisplayTreeNodeNames = value; } - } - private bool _DisplayTreeNodeTitles = false; - - public bool DisplayTreeNodeTitles - { - get { return _DisplayTreeNodeTitles; } - set { _DisplayTreeNodeTitles = value; } - } - #endregion - public override string ToString() - { - // assume that at least one of the two options was selected - string rtnstr = ""; - if (_DisplayTreeNodeNames) rtnstr = Name; - if (_DisplayTreeNodeTitles) - { - if (rtnstr.Length > 0) rtnstr += " - "; - rtnstr += Title; - } - return rtnstr; - //return string.Format("{0} - {1}", Name, Title); - } - //public string ToString(string str,System.IFormatProvider ifp) - //{ - // return ToString(); - //} - public ItemInfo LastChild() - { - return MyItem.LastSibling; - } - public ItemInfo FirstChild() - { - return MyItem; - } - #endregion - #region Extension - partial class DocVersionInfoExtension : extensionBase - { - public override void Refresh(DocVersionInfo tmp) - { - tmp.DocVersionConfigRefresh(); - } - - } - #endregion - public ROFstInfo GetROFst(int rodbid) - { - foreach (AssociationInfo dva in DocVersionAssociations) - { - if (dva.MyROFst.RODbID == rodbid) - return dva.MyROFst; - } - return null; - } - public int MultiUnitCount - { - get - { - return DocVersionConfig.Unit_Count; - } - } - private string[] _UnitNames; - public string[] UnitNames - { - get - { - if (_UnitNames == null) - { -// _UnitNames = DocVersionConfig.Unit_Name.Split(','); - _UnitNames = new string[DocVersionConfig.Unit_Count]; - int j = 0; - for (int k = 1; k <= DocVersionConfig.MaxSlaveIndex; k++) - { - DocVersionConfig.SelectedSlave = k; - try - { - _UnitNames[j] = DocVersionConfig.Unit_Name; - j++; - } - catch - { - } - } - } - return _UnitNames; - } - } - } - public enum VersionTypeEnum : int - { - WorkingDraft = 0, Temporary = 1, Revision = 128, Approved = 129 - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs.bak b/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs.bak deleted file mode 100644 index 40f03bb8..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/DocumentExt.cs.bak +++ /dev/null @@ -1,1387 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.IO; -using Csla; -using Csla.Data; -using System.Data; -using System.Data.SqlClient; -//----------------- -using System.Drawing; -using System.Text.RegularExpressions; -using LBWordLibrary; -using System.Drawing.Imaging; -using Volian.Base.Library; -using System.Diagnostics; - - -namespace VEPROMS.CSLA.Library -{ - public enum VolianStatusType - { - Initialize, - Update, - Complete - } - public delegate void VolianStatusChange(VolianStatusType type, int count, string text); - public partial class Document - { - public string DocumentTitle - { - get - { - if (_LibTitle == "") return string.Format("Document {0}", _DocID); - return _LibTitle; - } - } - private static LBApplicationClass _MyApp = null; - public static LBApplicationClass MyApp - { - get - { - if (_MyApp == null) - _MyApp = new LBApplicationClass(); - return _MyApp; - } - } - public void UpdateDRoUsages(List roids) - { - _DocumentDROUsageCount = -1; - if (DocumentDROUsages.Count > 0) - { - List delList = new List(); - foreach (DocumentDROUsage myUsage in DocumentDROUsages) - { - string roidkey = string.Format("{0}:{1}", myUsage.RODbID, myUsage.ROID); - if (roids.Contains(roidkey)) - roids.Remove(roidkey);// If in both, nothing to do - else - delList.Add(myUsage); - } - foreach (DocumentDROUsage myUsage in delList) - DocumentDROUsages.Remove(myUsage); // If only in old, remove it - } - foreach (string roidkey in roids) - { - string [] parts = roidkey.Split(":".ToCharArray()); - DocumentDROUsages.Add(parts[1], RODb.GetJustRoDb(int.Parse(parts[0]))); - } - } - private int _Unique = 0; - private string Unique - { - get - { - string retval = ""; - if (_Unique != 0) retval = "_" + _Unique.ToString(); - _Unique++; - return retval; - } - } - public void StatusChanged(VolianStatusType type, int count, string text) - { - //if (Parent != null && Parent.Parent != null && Parent.Parent.Parent is DisplayTabControl) - //{ - // DisplayTabControl tc = Parent.Parent.Parent as DisplayTabControl; - // tc.ONStatusChanged(this, new DisplayTabControlStatusEventArgs(type, count, text)); - //} - } - public void RestoreWordDoc(ItemInfo myItemInfo) - { - DocumentAuditInfo savDocAuditInfo = null; - using (DocumentAuditInfoList dail = DocumentAuditInfoList.Get(DocID)) - { - if (dail.Count > 0) - { - DocumentAuditInfo dai = dail[0]; - foreach (DocumentAuditInfo tmpa in dail) - { - FileInfo tmpFile = new FileInfo(string.Format(@"{0}\tmp_{1}{2}{3}", VlnSettings.TemporaryFolder, DocID, Unique, tmpa.FileExtension)); - while (tmpFile.Exists) - { - tmpFile = new FileInfo(string.Format(@"{0}\tmp_{1}{2}{3}", VlnSettings.TemporaryFolder, DocID, Unique, tmpa.FileExtension)); - } - FileStream fs = tmpFile.Create(); - if (tmpa.DocContent != null) fs.Write(tmpa.DocContent, 0, tmpa.DocContent.Length); - fs.Close(); - LBDocumentClass myDoc = null; - try - { - myDoc = MyApp.Documents.Open(tmpFile.FullName, false); - savDocAuditInfo = tmpa; - myDoc.Close(); - break; - } - catch (Exception ex) - { - if (myDoc != null) myDoc.Close(); - continue; // get next document audit item. - } - } - } - if (savDocAuditInfo != null) - { - FileExtension = savDocAuditInfo.FileExtension; - DocContent = savDocAuditInfo.DocContent; - DocAscii = savDocAuditInfo.DocAscii; - Config = savDocAuditInfo.Config; - UserID = savDocAuditInfo.UserID; - DTS = savDocAuditInfo.DTS; - Save(); - List roids = new List(); - DocumentInfo docinfo = DocumentInfo.Get(DocID); - - string pdfTmp = MSWordToPDF.ToPDFReplaceROs(docinfo, roids, myItemInfo, StatusChanged); - FileInfo pdfFile = new FileInfo(pdfTmp); - FileStream fs = pdfFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - Byte[] buf = new byte[pdfFile.Length]; - fs.Read(buf, 0, buf.Length); - fs.Close(); - pdfFile.Delete(); - Pdf.DeleteAll(DocID); // clear the PDF table for DocID first - DocStyle myDocStyle = myItemInfo.ActiveSection.MyDocStyle; - SectionConfig sc = myItemInfo.ActiveSection.MyConfig as SectionConfig; - if (sc != null && sc.Section_WordMargin == "Y") - { - using (Pdf myPdf = Pdf.MakePdf(this, MSWordToPDF.DebugStatus, 0, 0, 0, 0, (double)myItemInfo.MSWordPageCount, buf)) { ;} - } - else - { - using (Pdf myPdf = Pdf.MakePdf(this, MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength, - (int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth, (double)myItemInfo.MSWordPageCount, buf)) { ;} - } - UpdateDRoUsages(roids); - Save(); - } - } - } - /// - /// FixString processes the string returned and changes any symbols (0xF0??) to normal characters - /// - /// - /// - //private static string FixString(string str) - //{ - // StringBuilder results = new StringBuilder(); - // foreach (char c in str) - // { - // if ((c & 0xFF00) == 0xF000) - // results.Append((char)(c & 0xFF)); - // else - // results.Append((char)(c)); - // } - // return results.ToString(); - //} - } - public partial class DocumentInfo - { - public string DocumentTitle - { - get - { - if (_LibTitle == "") return string.Format("Document {0}", _DocID); - return _LibTitle; - } - } - public string LibraryDocumentUsage - { - get - { - StringBuilder sb = new StringBuilder(); - string sep = "\r\nUsed In:\r\n "; - if (DocumentEntries == null) - sb.Append("None"); - else - { - int limit = 20; - foreach (EntryInfo myEntry in DocumentEntries) - { - foreach (ItemInfo myItem in myEntry.MyContent.ContentItems) - { - --limit; - if (limit < 0) - { - sb.Append(sep + "..."); - return sb.ToString(); - } - ItemInfo proc = myItem.MyProcedure; - sb.Append(sep + proc.DisplayNumber + " - " + proc.DisplayText); - sep = "\r\n "; - } - } - } - return sb.ToString(); - } - } - public ItemInfoList LibraryDocumentUsageList - { - get - { - bool first = true; - ItemInfoList iil = null; - if (DocumentEntries == null) return null; - foreach (EntryInfo myEntry in DocumentEntries) - { - foreach (ItemInfo myitem in myEntry.MyContent.ContentItems) - { - if (first) - { - iil = new ItemInfoList(myitem); - first = false; - } - else - iil.AddItem(myitem); - } - } - return iil; - } - } - #region DocumentConfig - [NonSerialized] - private DocumentConfig _DocumentConfig; - public DocumentConfig DocumentConfig - { get { return (_DocumentConfig != null ? _DocumentConfig : _DocumentConfig = new DocumentConfig(this)); } } - public void RefreshConfig() - { - _DocumentConfig = null; - } - #endregion - public static DocumentInfo GetByLibDocName(string libdoc, int versionID) - { - try - { - DocumentInfo tmp = DataPortal.Fetch(new LibDocCriteria(libdoc, versionID)); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocumentInfo.GetByLibDocName", ex); - } - } - [Serializable()] - protected class LibDocCriteria - { - private string _LibDoc; - public string LibDoc - { get { return _LibDoc; } } - private int _VersionID; - public int VersionID - { get { return _VersionID; } } - public LibDocCriteria(string libdoc, int versionid) - { - _LibDoc = libdoc; - _VersionID = versionid; - } - } - private void DataPortal_Fetch(LibDocCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocumentByLibDoc"; - cm.Parameters.AddWithValue("@LibDoc", criteria.LibDoc); - cm.Parameters.AddWithValue("@VersionID", criteria.VersionID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfo.DataPortal_Fetch", ex); - throw new DbCslaException("DocumentInfo.DataPortal_Fetch", ex); - } - } - - } - public partial class DocumentInfoList - { - public static DocumentInfoList GetLibraries(bool forceload) - { - try - { - if (!forceload && _DocumentInfoList != null) - return _DocumentInfoList; - DocumentInfoList tmp = DataPortal.Fetch(new LibraryCriteria(true)); - DocumentInfo.AddList(tmp); - tmp.AddEvents(); - _DocumentInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocumentInfoList.Get", ex); - } - } - [Serializable()] - protected class LibraryCriteria - { - private bool _IsLibrary; - - public bool IsLibrary - { - get { return _IsLibrary; } - set { _IsLibrary = value; } - } - public LibraryCriteria(bool islibrary) - { - _IsLibrary = islibrary; - } - } - private void DataPortal_Fetch(LibraryCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getLibraryDocuments"; - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new DocumentInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("DocumentInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - } - public class DSOFile : IDisposable - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #region Fields - private bool _IsDisposed; - private DocumentInfo _MyDocument = null; - private FileInfo _MyFile = null; - private string _Extension = "DOC"; - #endregion - #region Properties - public DocumentInfo MyDocument - { - get { return _MyDocument; } - set - { - TryDelete(); - _MyDocument = value; - CreateFile(); - } - } - public FileInfo MyFile - { - get { return _MyFile; } - } - public string Extension - { - get { return _Extension; } - set { _Extension = value; } - } - #endregion - #region Private Methods - private void TryDelete() - { - if (_MyDocument == null) return; - if (_MyFile == null) return; - if (_MyFile.Exists) - { - try - { - _MyFile.Delete(); - } - catch (IOException ex) - { - // _MyLog.Error("TryDelete", ex); - } - finally - { - _MyFile = null; - _MyDocument = null; - } - } - } - private bool _Created = false; - private int _Unique = 0; - private string Unique - { - get - { - string retval = ""; - if (_Unique != 0) retval = "_" + _Unique.ToString(); - _Unique++; - return retval; - } - } - private void CreateFile() - { - while (!_Created) - CreateTemporaryFile(); - } - - private void CreateTemporaryFile() - { - try - { - if (_MyDocument != null) - { - _MyFile = new FileInfo(string.Format(@"{0}\tmp_{1}{2}{3}", VlnSettings.TemporaryFolder, MyDocument.DocID, Unique, MyDocument.FileExtension)); - while (_MyFile.Exists) - { - _MyFile = new FileInfo(string.Format(@"{0}\tmp_{1}{2}{3}", VlnSettings.TemporaryFolder, MyDocument.DocID, Unique, MyDocument.FileExtension)); - } - FileStream fs = _MyFile.Create(); - if (MyDocument.DocContent != null) fs.Write(MyDocument.DocContent, 0, MyDocument.DocContent.Length); - fs.Close(); - _MyFile.CreationTimeUtc = _MyDocument.DTS; - _MyFile.LastWriteTimeUtc = _MyDocument.DTS; - _Created = true; - } - } - catch (Exception ex) - { - _MyLog.Error("***** Could not create " + _MyFile.FullName, ex); - Console.WriteLine(ex.Message); - } - } - public string FullName - { - get { return _MyFile.FullName; } - set - { - if (FullName != value) - _MyFile = new FileInfo(value); - } - } - public void SaveFile(float length, string ascii, ItemInfo myItemInfo, bool cvtLibDoc, VolianStatusChange statusChange) - { - // TODO: Add Try & Catch logic - if (_MyDocument == null) return; - Document doc = _MyDocument.Get(); - FileStream fs = _MyFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - long savLen = _MyFile.Length; - Byte[] buf = new byte[_MyFile.Length]; - fs.Read(buf, 0, buf.Length); - fs.Close(); - - // Handle if this is a libdoc & the user wanted to convert to a non-library document. - if (cvtLibDoc) - { - // if just one usage (this one), then just convert this to a non-library document. If there is more - // than one usage, make a copy so that the rest of the usages still point to the library document. - if (doc.DocumentEntryCount == 1) - doc.LibTitle = null; - else - { - // make new document with 'no' libtitle. Then link this to the item/content via the entry. - // the data gets set below. - Document tdoc = Document.MakeDocument(null, null, null, null); - _MyDocument = DocumentInfo.Get(doc.DocID); - doc = tdoc; - using (Entry ent = myItemInfo.MyContent.MyEntry.Get()) - { - ent.MyDocument = tdoc; - ent.Save(); - } - } - } - doc.FileExtension = MyFile.Extension; - doc.DocContent = buf; - doc.DocAscii = ascii; - //doc.UpdateDocAscii(_MyFile.FullName); - DocumentConfig cfg = new DocumentConfig(doc); - cfg.Edit_Initialized = true; - doc.Config = cfg.ToString(); - doc.UserID = Volian.Base.Library.VlnSettings.UserID; - //doc.DTS = _MyFile.LastWriteTimeUtc; - doc.DTS = DateTime.Now.ToUniversalTime(); - doc = doc.Save(); - List roids = new List(); - string pdfTmp = MSWordToPDF.ToPDFReplaceROs(_MyDocument, roids, myItemInfo,statusChange); - FileInfo pdfFile = new FileInfo(pdfTmp); - fs = pdfFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - buf = new byte[pdfFile.Length]; - fs.Read(buf, 0, buf.Length); - fs.Close(); - pdfFile.Delete(); - Pdf.DeleteAll(doc.DocID); // clear the PDF table for DocID first - DocStyle myDocStyle = myItemInfo.ActiveSection.MyDocStyle; - SectionConfig sc = myItemInfo.ActiveSection.MyConfig as SectionConfig; - if (sc != null && sc.Section_WordMargin == "Y") - { - using (Pdf myPdf = Pdf.MakePdf(doc, MSWordToPDF.DebugStatus, 0, 0, 0, 0, (double)myItemInfo.MSWordPageCount, buf)) { ;} - } - else - { - using (Pdf myPdf = Pdf.MakePdf(doc, MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength, - (int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth, (double)myItemInfo.MSWordPageCount, buf)) { ;} - } - doc.UpdateDRoUsages(roids); - doc.Save(); - if (savLen != _MyFile.Length) _MyLog.ErrorFormat("DSO FRAMER: File size changed during Save for Word Document, beginSize = {0}, endSize = {1}", savLen, _MyFile.Length); - } - #endregion - #region Constructors - public DSOFile(DocumentInfo myDocument) - { - MyDocument = myDocument; - } - #endregion - #region Destructor - ~DSOFile() - { - Dispose(false); - } - public void Dispose() - { - Dispose(false); - GC.SuppressFinalize(this); - } - - protected void Dispose(bool disposing) - { - if (!_IsDisposed) - { - _IsDisposed = true; - TryDelete(); - } - } - #endregion - } - public static class MSWordToPDF - { - private static bool _CloseWordWhenDone = true; - public static bool CloseWordWhenDone - { - get { return MSWordToPDF._CloseWordWhenDone; } - set { MSWordToPDF._CloseWordWhenDone = value; } - } - private static LBApplicationClass _MyApp = null; - public static LBApplicationClass MyApp - { - get - { - if (_MyApp == null) - _MyApp = new LBApplicationClass(); - return _MyApp; - } - } - private static int _DebugStatus = 0; - public static int DebugStatus - { - get { return MSWordToPDF._DebugStatus; } - set { MSWordToPDF._DebugStatus = value; } - } - private static System.Drawing.Color _OverrideColor = System.Drawing.Color.Transparent; - public static System.Drawing.Color OverrideColor - { - get { return MSWordToPDF._OverrideColor; } - set { MSWordToPDF._OverrideColor = value; } - } - private static System.Windows.Forms.Form _FormForPlotGraphics=null; - public static System.Windows.Forms.Form FormForPlotGraphics - { - get { return MSWordToPDF._FormForPlotGraphics; } - set { MSWordToPDF._FormForPlotGraphics = value; } - } - private static SectionInfo _MySection; - public static string GetDocPdf(SectionInfo sect, Color overrideColor) - { - _MySection = sect; - DocumentInfo mydoc = sect.MyContent.MyEntry.MyDocument; - UpdateDocPdf(mydoc, overrideColor,sect); - string fileName = GetFileName(sect); - FileInfo fi = new FileInfo(fileName); - FileStream fs = fi.Create(); - PdfInfo myPdf = PdfInfo.Get(sect); - if (myPdf != null && myPdf.DocPdf != null) fs.Write(myPdf.DocPdf, 0, myPdf.DocPdf.Length); - fs.Close(); - return fileName; - } - - public static bool UpdateDocPdf(DocumentInfo mydoc, Color overrideColor, ItemInfo sect) - { - MSWordToPDF.OverrideColor = overrideColor; - PdfInfo myPdf = PdfInfo.Get(sect); - return true; - } - public static bool SetDocPdf(DocumentInfo docInfo, ItemInfo sect) - { - string pdfTmp = null; - List roids = new List(); - try - { - pdfTmp = MSWordToPDF.ToPDFReplaceROs(docInfo,roids,sect,null); - } - catch (Exception ex) - { - return false; - } - if (pdfTmp == null) return false; - FileInfo pdfFile = new FileInfo(pdfTmp); - FileStream fs = pdfFile.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - Byte[] buf = new byte[pdfFile.Length]; - fs.Read(buf, 0, buf.Length); - fs.Close(); - pdfFile.Delete(); - using (Document doc = docInfo.Get()) - { - DocStyle myDocStyle = sect.ActiveSection.MyDocStyle; - SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig; - int ss = sect.MyDocVersion.DocVersionConfig.SelectedSlave; - if (sc != null && sc.Section_WordMargin == "Y") - { - using (Pdf myPdf = Pdf.MakePdf(doc, ss*10 + MSWordToPDF.DebugStatus, 0, 0, 0, 0, (double)sect.MSWordPageCount, buf)) { ;} - } - else - { - using (Pdf myPdf1 = Pdf.MakePdf(doc, ss*10 + MSWordToPDF.DebugStatus, (int)myDocStyle.Layout.TopMargin, (int)myDocStyle.Layout.PageLength, - (int)myDocStyle.Layout.LeftMargin, (int)myDocStyle.Layout.PageWidth, (double)sect.MSWordPageCount, buf)) { ;} - } - doc.UpdateDRoUsages(roids); - doc.Save(); - } - docInfo.RefreshConfig(); - return true; - } - public static string ToPDFReplaceROs(DocumentInfo doc, List roids, ItemInfo sect, VolianStatusChange statusChange) - { - //ItemInfo sect = doc.DocumentEntries[0].MyContent.ContentItems[0]; - return ToPDFReplaceROs(sect, false, roids, statusChange); - } - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - public static string ToPDFReplaceROs(ItemInfo sect, bool openPdf, List roids, VolianStatusChange statusChange) //, System.Drawing.Color overrideColor, System.Windows.Forms.Form myForm) - { - string fileName = GetFileName(sect); - // TODO: do we want to cache the word pdfs - //if (System.IO.File.Exists(@"C:\Temp\" + fileName + ".pdf")) - // return @"C:\Temp\" + fileName + ".pdf"; - //int docStyleIndex = ((int)sect.MyContent.Type) % 10000; - //DocStyle myDocStyle = sect.ActiveFormat.PlantFormat.DocStyles.DocStyleList[docStyleIndex]; - DocStyle myDocStyle = sect.MyDocStyle; - //PageStyle myPageStyle = myDocStyle.pagestyle; - ProcedureInfo proc = sect.MyProcedure; - DocVersionInfo dvi = proc.ActiveParent as DocVersionInfo; - bool hasRos = false; - ROFstInfo rofst = null; - ROFSTLookup lookup = null; - string igPrefix = null; - string spPrefix = null; - - if (dvi.DocVersionAssociationCount > 0) - { - hasRos = true; - rofst = dvi.DocVersionAssociations[0].MyROFst; - lookup = rofst.GetROFSTLookup(dvi); - igPrefix = dvi.DocVersionConfig.RODefaults_graphicsprefix; - spPrefix = dvi.DocVersionConfig.RODefaults_setpointprefix; - } - // string AccPageID = string.Format("<{0}-{1}>", accPrefix, roch.appid); - using (DSOFile myFile = new DSOFile(sect.MyContent.MyEntry.MyDocument)) - { - // Increase the priority of the Word Process so that the pdf creation happens quickly - Process[] myProcessess = Process.GetProcessesByName("winword"); - foreach (Process myProcess in myProcessess) - { - try - { - if (myProcess.PriorityClass != ProcessPriorityClass.High && myProcess.MainWindowTitle == "") - myProcess.PriorityClass = ProcessPriorityClass.High; - } - catch (Exception ex) - { - while (ex != null) - { - Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message); - ex = ex.InnerException; - } - } - } - LBDocumentClass myDoc = MyApp.Documents.Open(myFile.FullName, false); - try - { - SectionConfig sc = sect.ActiveSection.MyConfig as SectionConfig; - if (sc == null || sc.Section_WordMargin == "N") - { - AdjustMargins(myDocStyle, myDoc, true); - } - } - catch (Exception ex) - { - _MyLog.Error("Could not Adjust Margins", ex); - } - LBSelection selxy = hasRos ? FindXyPlot() : null; - string pngFile = VlnSettings.TemporaryFolder + @"\XYPlot1.png"; //@"C:\Temp\XYPlot1.png"; - if (File.Exists(pngFile)) File.Delete(pngFile); - int filecount = 1; - while (selxy != null) - { - string xyplot = selxy.Text; - xyplot = xyplot.Replace("`", "\xB0"); - // The 16bit code must have kept the carriage returns in the word doc, if there - // are carriage returns in the plot language. Count number of carriage return/newlines - // so that they can be added back. - int cnt = 0; - int indxCr = xyplot.IndexOf("\r"); - while (indxCr > 0) - { - cnt++; - indxCr = xyplot.IndexOf("\r", indxCr + 1); - } - // Setting the selected text to "" actually sets it to "\r", thus cnt-- (subtract one - // from cnt since there's already a return in the string. - cnt--; - float x = (float)selxy.get_Information(LBWdInformation.wdHorizontalPositionRelativeToPage); - float y = (float)selxy.get_Information(LBWdInformation.wdVerticalPositionRelativeToPage); - LBRange myRange = selxy.Paragraphs.First.Range; - float yTop = (float)myRange.get_Information(LBWdInformation.wdVerticalPositionRelativeToPage); - float yTop1 = (float)myRange.get_Information(LBWdInformation.wdVerticalPositionRelativeToTextBoundary); - - // some data had regular text embedded in the xyplot definition. If so, the plain text must - // be left in the file. Otherwise, we can replace with empty text. - string resXyPlot = xyplot; - string txt = FindEmbeddedText(selxy.Text, ref resXyPlot); - if (txt != null) - { - selxy.Text = txt; - xyplot = resXyPlot.Replace(">\r>", ">>\r"); - } - else - { - selxy.Text = ""; - if (cnt > 0) for (int icnt = 0; icnt < cnt; icnt++) selxy.Text = selxy.Text + "\r"; - } - - pngFile = VlnSettings.TemporaryFolder + @"\XYPlot" + filecount.ToString() + @".png"; //@"C:\Temp\XYPlot1.png"; - //FileInfo fi = new FileInfo(pngFile); - //_MyLog.WarnFormat("PNG Name = {0}, size = {1}", fi.Name, fi.Length); - filecount++; - RectangleF plotRect = CreatePlot(pngFile, xyplot, 600F, FormForPlotGraphics); - - float xAdjust = (float)-sect.MyDocStyle.Layout.LeftMargin; - float yAdjust = selxy.Font.Size; - LBShape shape = myDoc.Shapes.AddPicture(pngFile, x + xAdjust + plotRect.X, yAdjust + y - yTop + plotRect.Y, selxy.Range); - File.Delete(pngFile); - shape.LockAspectRatio = LBMsoTriState.msoTrue; - shape.Width = plotRect.Width; - selxy.WholeStory(); - selxy = FindXyPlot(); - } - LBSelection sel = MyApp.Selection; - sel.WholeStory(); - if (statusChange != null) statusChange(VolianStatusType.Initialize, sel.End, "Refreshing ROs"); - sel = hasRos ? FindRO() : null; - int roCount = 0; - // force Print of MS Word Attachment to Final without revisions and comments - myDoc.ActiveWindow.View.ShowRevisionsAndComments = false; - myDoc.ActiveWindow.View.RevisionsView = LBWdRevisionsView.wdRevisionsViewFinal; - while (sel != null) - { - if (statusChange != null) statusChange(VolianStatusType.Update, sel.Start, string.Format("{0} ROs Refreshed", ++roCount)); - string val = lookup.GetROValueByAccPagID(sel.Text, spPrefix, igPrefix); - int? type = lookup.GetROTypeByAccPagID(sel.Text, spPrefix, igPrefix); - // if type is null, then set type to zero so that InsertROValue will put in "RO Not Found" for the value - if (type == null) - type = 0; - // If multiple return values includes X-Y Plot, check to see if it is an X-Y Plot - if (val == null) - { - if(sel.Text.ToUpper() == "") val =lookup.MyDocVersionInfo.DocVersionConfig.Unit_Text; - else if (sel.Text.ToUpper() == "") val = lookup.MyDocVersionInfo.DocVersionConfig.Unit_Number; - else if (sel.Text.ToUpper() == "") val = lookup.MyDocVersionInfo.DocVersionConfig.Unit_Name; - else if (sel.Text.ToUpper() == "") val = lookup.MyDocVersionInfo.DocVersionConfig.Unit_ID; - else if (sel.Text.ToUpper() == "") val = lookup.MyDocVersionInfo.DocVersionConfig.Other_Unit_Text; - else if (sel.Text.ToUpper() == "") val = lookup.MyDocVersionInfo.DocVersionConfig.Other_Unit_Number; - else if (sel.Text.ToUpper() == "") val = lookup.MyDocVersionInfo.DocVersionConfig.Other_Unit_Name; - else if (sel.Text.ToUpper() == "") val = lookup.MyDocVersionInfo.DocVersionConfig.Other_Unit_ID; - //val = "",MyDocVersion.DocVersionConfig.Unit_ID); - //text = text.Replace(@"", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ProcedureSetID); - //text = text.Replace("", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Number); - } - if ((type & 4) == 4 && val.StartsWith("< 0) && (idx < sel.Text.Length + 1)) - { - idx = sel.Text.IndexOf("\r", idx + 1); - y += (float)sel.ParagraphFormat.LineSpacing; // get_Information(LBWdLineSpacing.wdLineSpaceSingle); - } - //LBInlineShape shape = sel.InlineShapes.AddPicture(pngFile); - LBRange myRange = sel.Paragraphs.First.Range; - float yTop = (float)myRange.get_Information(LBWdInformation.wdVerticalPositionRelativeToPage); - float yTop1 = (float)myRange.get_Information(LBWdInformation.wdVerticalPositionRelativeToTextBoundary); - float xAdjust = (float)-sect.MyDocStyle.Layout.LeftMargin; - float yAdjust = sel.Font.Size; - // The following two lines made the xyplot location for WCN2 match the 16bit output. However, how the - // xTweak value is determined is phantom of Rich's mind. Word document location of the RO token - // will be modified in data before delivery so that this xTweak is not needed. - //float xTweak = -(30 + xAdjust) / 3; // Used to align plots for WCN2. - //LBShape shape = myDoc.Shapes.AddPicture(pngFile, x + xAdjust + plotRect.X + xTweak, yAdjust + y - yTop + plotRect.Y, sel.Range); - LBShape shape = myDoc.Shapes.AddPicture(pngFile, x + xAdjust + plotRect.X, yAdjust + y - yTop + plotRect.Y, sel.Range); - File.Delete(pngFile); - shape.LockAspectRatio = LBMsoTriState.msoTrue; - //shape.Width = .89F * shape.Width; - //shape.Width = float.Parse(tbAdjust.Text) * shape.Width; - shape.Width = plotRect.Width; - //shape.Height = .89F * shape.Height; - sel.WholeStory(); - // TODO: Do we want to color code ROs - //sel.Range.Font.Color = LBWdColor.wdColorRed; - //shape.Width = width; - //shape.Height = height; - //imageROTokenReplaced = true; - } - catch (Exception ex) - { - // something is wrong with the X/Y plot RO. - // print out the un-processed X/Y plot RO value - sel.Text = val; - //return null; - } - } - else - { - if (val != null) - val = val.Replace("`", "\xB0"); - //AddInfo("\tRO Found {0} = '{1}'", sel.Text, val); - // if val is null, then InsertROValue will put in "RO Not Found" for the value - InsertROValue(sel, val, sect.ActiveFormat.PlantFormat.FormatData.ROData.UpRoIfPrevUpper); - } - sel = FindRO(); - } - if (statusChange != null) statusChange(VolianStatusType.Update, 0, "Creating PDF"); - sel = MyApp.Selection; - sel.WholeStory(); - //sel.Range.Font.Color = (LBWdColor)WordColor(PrintOverride.OverrideTextColor(System.Drawing.Color.Black)); - sel.Range.Font.Color = (LBWdColor)WordColor(OverrideColor == System.Drawing.Color.Transparent ? System.Drawing.Color.Black : OverrideColor); - sect.MSWordPageCount = myDoc.Length; - fileName = CreatePDF(fileName, openPdf,MSWordToPDF.DebugStatus); - CloseDocument(); - if (CloseWordWhenDone) - { - CloseAppAfterWait(); - } - if (statusChange != null) statusChange(VolianStatusType.Complete, 0, ""); - return fileName; - } - } - private static void CloseDocument() - { - int attempts = 0; - while (++attempts < 11) - { - if (TryToClose(attempts)) return; - WaitMS(1000); - } - } - private static bool TryToClose(int attempts) - { - try - { - MyApp.ActiveDocument.Close(false); - return true; - } - catch (Exception ex) - { - _MyLog.WarnFormat("{0} - {1}, Attempt {2}", ex.GetType().Name, ex.Message, attempts); - if (attempts >= 10) - _MyLog.Error("Failed to close 10 times.", ex); - return false; - } - } - private static string FindEmbeddedText(string p, ref string resXyPlot) - { - StringBuilder sb = new StringBuilder(); // contains embedded text - StringBuilder xy = new StringBuilder(); // contains xyplot without embedded text. - string origXy = p; - bool findEmbeddedText = false; - // get past opening command: - int indxCmd = p.IndexOf("<"); - indxCmd = p.IndexOf("<", indxCmd + 1); - xy.Append(p.Substring(0, indxCmd)); - // While there are xyplot commands, check for beginning/ending. - // Any text not in a command, save. - while (indxCmd > 0) - { - // find end of command. Look for another beginning of command, newline, - // regular text, or end of graph and handle each of these cases. - int indxClose = GetNonStringCmdClose(p, indxCmd + 1); // p.IndexOf(">", indxCmd + 1); - int nxtIndxCmd = p.IndexOf("<", indxCmd + 1); - xy.Append(p.Substring(indxCmd, indxClose - indxCmd+1)); - xy.Append("\r"); // the xyplot code assumes a return exists. - // get substrings between end index & start of next and if any - // non white space text, add it to return string and flag that we have - // embedded text. If there's a newline and just other white space put a - // newline in return string. - if (nxtIndxCmd > 0) - { - string mydebug = p.Substring(indxClose + 1); - for (int i = indxClose + 1; i < nxtIndxCmd; i++) - { - if (!System.Char.IsWhiteSpace(p[i])) - { - sb.Append(p[i]); - findEmbeddedText = true; - } - if (p[i] == '\r' || p[i] == ' ') sb.Append(p[i]); - } - } - indxCmd = nxtIndxCmd; - } - xy.Append(">"); - if (findEmbeddedText) - { - resXyPlot = xy.ToString(); - return sb.ToString(); - } - resXyPlot = origXy; - return null; - } - - private static int GetNonStringCmdClose(string p, int indxCmd) - { - int indxClose = p.IndexOf(">", indxCmd); - if (indxClose >= 0) - { - // if there are any quotes between the open of command and close, - // need to see if the close command is quoted. - if (p.IndexOf('"', indxCmd, indxClose - indxCmd) > -1) - { - // see how many quotes between open/close command, if - // an odd number, the close command char '>' is in quotes. - int countQuotes = 0; - for (int i = indxCmd; i < indxClose; i++) if (p[i] == '"') countQuotes++; - if ((countQuotes % 2) != 0) - { - // find quote after close, and then get next close. - int closeQuote = p.IndexOf('"', indxClose); - if (closeQuote < 0) return -1; // this is error, so return end not found. - return p.IndexOf(">", closeQuote + 1); - } - } - } - return indxClose; - } - public static void AddPrecedingText(LBSelection sel, string val) - { - if (val.IndexOf("_") == -1) // Is some of the text underlined? - { - sel.Text = val; // nothing is underlined, use text as is - return; - } - // Back in the DOS days, an underbar was used to toggle underlining on/off - // Spit the val text on the underbar characters - string[] parts = val.Split("_".ToCharArray()); - foreach (string part in parts) - { - // If there is a carrage return, and underline is turned on, then turn off the underline - if (sel.Font.Underline != LBWdUnderline.wdUnderlineNone && part.Contains("\r")) - { - int idx = part.IndexOf("\r"); - string part1 = part.Substring(0, idx); - string part2 = part.Substring(idx); - sel.TypeText(part1); - sel.Font.Underline = LBWdUnderline.wdUnderlineNone; - sel.TypeText(part2); - } - else // put out each part of the split text and toggle the underline on/off - { - // Farley had a case where the underlining of text with spaces at end of line was - // not underlining the spaces. To fix this, test for spaces at the end of text - // and ireplace last space with a hard space. Note that the underlying issue - // existed in MS Word, so this is a work around from our code to make MS Word work. - // The problem was in Farley's FNP-1-ECP-3.1, Table 1 - 'ro': W.4T. - if (part.EndsWith(" ")) - { - sel.TypeText(part.Substring(0,part.Length-1)); - sel.InsertSymbol(160); - } - else - sel.TypeText(part); - - if (sel.Font.Underline == LBWdUnderline.wdUnderlineNone) - sel.Font.Underline = LBWdUnderline.wdUnderlineSingle; - else - sel.Font.Underline = LBWdUnderline.wdUnderlineNone; - } - } - // We are done processing the text in val, if underline is on, turn it off - if (sel.Font.Underline != LBWdUnderline.wdUnderlineNone) - sel.Font.Underline = LBWdUnderline.wdUnderlineNone; - } - - public static void AdjustMargins(DocStyle myDocStyle, LBDocumentClass myDoc, bool printingMode) - { - float newTop = (float)myDocStyle.Layout.TopMargin; - float newLeft = (float)myDocStyle.Layout.LeftMargin; - float newLength = (float)myDocStyle.Layout.PageLength; - float newWidth = (float)myDocStyle.Layout.PageWidth; - float oldTop = myDoc.PageSetup.TopMargin; - float oldLeft = myDoc.PageSetup.LeftMargin; - float oldBottom = myDoc.PageSetup.BottomMargin; - float oldRight = myDoc.PageSetup.RightMargin; - float oldHeight = myDoc.PageSetup.PageHeight; - float oldWidth = myDoc.PageSetup.PageWidth; - // in the following line, the 2 accounts for a difference between how word treats margin versus - // ours, we are not exactly sure why. - float newRight = Math.Max(0, oldWidth - (newWidth + 2)); - float newBottom = Math.Max(0, oldHeight - (newLength + newTop + 1)); - //Console.WriteLine("{0},{1},{2},{3},{4},{5},{6},{7},{8},{9}", newTop, newLeft, newLength, newWidth, oldTop, oldLeft, oldBottom, oldRight,oldHeight,oldWidth); - if (printingMode) - { - if (myDoc.PageSetup.BottomMargin != 9999999) - { - // the + 1 in the next line allows for rounding. - if ((newWidth > (8.5f * 72)) && newWidth > newLength) - if(myDoc.PageSetup.Orientation != LBWdOrientation.wdOrientLandscape) - myDoc.PageSetup.Orientation = LBWdOrientation.wdOrientLandscape; - myDoc.PageSetup.BottomMargin = newBottom; - myDoc.PageSetup.RightMargin = newRight; - myDoc.PageSetup.LeftMargin = newLeft; - myDoc.PageSetup.TopMargin = newTop; - } - else - { - try - { - // the + 1 in the next line allows for rounding. - myDoc.PageSetup.BottomMargin = newBottom; - myDoc.PageSetup.RightMargin = newRight; - myDoc.PageSetup.LeftMargin = newLeft; - myDoc.PageSetup.TopMargin = newTop; - } - catch (Exception ex) - { - if (_MySection != null) - { - _MyLog.ErrorFormat("<<< ERROR >>> MSWord could not set margins\r\n==>'MSWord could not set margins',{0},'{1}','{2}'" - , _MySection.ItemID, _MySection.MyDocVersion.MyFolder.Name, _MySection.ShortPath); - } - else - _MyLog.Error("Could not set margins", ex); - } - } - } - else - { - myDoc.PageSetup.TopMargin = 0; - myDoc.PageSetup.LeftMargin = 0; - myDoc.PageSetup.RightMargin = (8.5F * 72) - newWidth + newLeft; - // For OHLP, docstyle (ohlpdoc.in) in 16-bit for "Cover Page", pagelen seems to be incorrect. It would - // put out text on a second page. The following code is to catch this condition and reset the bottom margin. - // 11 * 72 -> 11 inches converted to points. newLength is printable part so BottomMargin is unprintable part - if (newTop + 36 > ((11 * 72) - newLength)) // 36 is 1/2 inch - myDoc.PageSetup.BottomMargin = newTop + 36; // makes an 1/2 inch bottom margin - else - myDoc.PageSetup.BottomMargin = (11 * 72) - newLength; - } - } - public static void CloseApp() - { - //WaitMS(900);// This was added because MSWord will sometimes get the error below - // Microsoft Office Word has stopped working - // It appears that this is caused by quiting the MS Word application - // to soon after closing the document or doing an export. - MyApp.Quit(false); - _MyApp = null; - } - /// - /// This closes the MS Word Application, but, delays for about 1 second. - /// It appears that closing MSWord to quickly causes a: - /// "Microsoft Office Word has stopped working" error. - /// - public static void CloseAppAfterWait() - { - System.Windows.Forms.Application.DoEvents(); - new CloseWordApp(_MyApp, 1000); - _MyApp = null; - } - private class CloseWordApp:System.Windows.Forms.Timer - { - LBApplicationClass _MyApp; - public LBApplicationClass MyApp - { - get { return _MyApp; } - set { _MyApp = value; } - } - public CloseWordApp(LBApplicationClass myApp, int interval) - { - MyApp = myApp; - Interval = interval; - Tick += new EventHandler(CloseWordApp_Tick); - Enabled = true; - } - void CloseWordApp_Tick(object sender, EventArgs e) - { - Enabled = false; - MyApp.Quit(false); - Dispose(); - } - } - private static void WaitMS(int n) - { - DateTime dtw = DateTime.Now.AddMilliseconds(n); - while (DateTime.Now < dtw) - { - System.Windows.Forms.Application.DoEvents(); - } - } - private static int WordColor(System.Drawing.Color color) - { - System.Drawing.Color c1 = System.Drawing.Color.FromArgb(0, color.B, color.G, color.R); - return c1.ToArgb(); - } - private static string GetFileName(ItemInfo sect) - { - string fileName = VlnSettings.TemporaryFolder + @"\Doc " + sect.MyContent.MyEntry.DocID.ToString(); // +" " + (sect.DisplayNumber == "" ? sect.DisplayText : sect.DisplayNumber); - return fileName; - } - private static RectangleF CreatePlot(string pngFile, string xyPlot, float resolution, System.Windows.Forms.Form myForm) - { - RectangleF retval = new RectangleF(0, 0, 0, 0); - //Form frm = Application.OpenForms[0]; - System.Windows.Forms.Form frm = myForm; - Graphics grfx = frm.CreateGraphics(); - string emfFile = pngFile.Replace(".png", ".emf"); - Metafile mf = new Metafile(emfFile, grfx.GetHdc()); - grfx.Dispose(); - grfx = Graphics.FromImage(mf); - float dpi = grfx.DpiX; - //grfx.ScaleTransform(resolution / grfx.DpiX, (resolution +1F) / grfx.DpiY); - grfx.ScaleTransform(resolution / grfx.DpiX, resolution / grfx.DpiY); - grfx.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor; - grfx.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; - grfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; - grfx.Clear(MSWordToPDF.DebugStatus==1 ? System.Drawing.Color.Transparent : System.Drawing.Color.White); - //grfx.Clear(System.Drawing.Color.SlateGray); - XYPlots.XYPlot.BlackColor = MSWordToPDF.OverrideColor == Color.Red ? Color.Red : Color.Black; - XYPlots.XYPlot myPlot = new XYPlots.XYPlot(xyPlot); - myPlot.SetMargins(0, 0, 0, 0); - VG.IVGOutput vgOut = new VG.VGOut_Graphics(grfx); - vgOut.DebugStatus = MSWordToPDF.DebugStatus; - myPlot.Process(vgOut); - grfx.Dispose(); - GraphicsUnit gu = new GraphicsUnit(); - retval = mf.GetBounds(ref gu); - retval.Width *= dpi / resolution; - retval.Height *= dpi / resolution; - retval.X *= dpi / resolution; - retval.Y *= dpi / resolution; - //retval.X = myPlot.Width-retval.Width; - //AddInfo("{0},{1},{2},{3},{4},{5}", myPlot.Width, myPlot.Height, retval.Width, retval.Height,retval.X,retval.Y); - //Console.Write("{0},{1},{2},{3}", myPlot.Width, myPlot.Height, retval.Width, retval.Height); - mf.Save(pngFile, ImageFormat.Png); - //Console.WriteLine("'pngfile','{0}'", pngFile); - mf.Dispose(); - FileInfo myFile = new System.IO.FileInfo(emfFile); - myFile.Delete(); - return retval; - } - private static void InsertROValue(LBSelection sel, string roValue, bool upRoIfPrevUpper) - { - if (roValue == null) - { - sel.Text = "RO Not Found"; - sel.Font.Color = LBWdColor.wdColorRed; - } - else - { - if (upRoIfPrevUpper && sel.LastWasUpper) roValue = roValue.ToUpper(); - // Convert fortran formatted numbers to scientific notation. - - //string tmp = DisplayRO.ConvertFortranFormatToScienctificNotation(roValue); - string tmp = ROFSTLookup.ConvertFortranFormatToScienctificNotation(roValue); - // Only in Word sections, convert the # to superscripts and ~ to subscrtipts - tmp = Regex.Replace(tmp, "[#](.*?)[#]", "\\up2 $1\\up0 ");// DOS Superscript - tmp = Regex.Replace(tmp, "[~](.*?)[~]", "\\dn2 $1\\up0 ");// DOS Subscript - tmp = tmp.Replace(@"\u160?", "\xA0"); - tmp = tmp.Replace(@"\U160?", "\xA0"); - tmp = tmp.Replace(@"[xB3]", "\xB3"); - tmp = tmp.Replace(@"\U8209?", "-"); // fixes negative value in scienctific notation - tmp = tmp.Replace(@"\u8209?", "-"); - // Look for superscript or subscript and insert the appropriate commands - Match roMatch = Regex.Match(tmp, @"(.*?)\\(up2|dn2) (.*?)\\(up0|dn0) "); - if (roMatch.Groups.Count == 5)// Superscript or subscript found - { - sel.Font.Color = LBWdColor.wdColorRed; - while (roMatch.Groups.Count == 5) - { - sel.TypeText(roMatch.Groups[1].Value); // output the text preceeding the super or sub command - sel.Font.Position = roMatch.Groups[2].Value == "up2" ? 2 : -2; // Shift the vertical position for super or sub - sel.TypeText(roMatch.Groups[3].Value); // output the superscript or subscript - sel.Font.Position = 0; // restore the vertical position - tmp = tmp.Substring(roMatch.Length); // remove the processed text - roMatch = Regex.Match(tmp, @"(.*?)\\(up2|dn2) (.*?)\\(up0|dn0) "); // check to see if the text contain another super or sub - } - if (tmp != "")// Add any remaining text - sel.TypeText(tmp); - sel.Font.Color = LBWdColor.wdColorAutomatic; - } - else // if no superscripts or subscripts just output the text - { - roValue = roValue.Replace(@"\u160?", "\xA0"); - roValue = roValue.Replace(@"\U160?", "\xA0"); - roValue = roValue.Replace(@"[xB3]", "\xB3"); - roValue = roValue.Replace(@"[XB3]", "\xB3"); - sel.Text = roValue; - // look for toggling of '_' to turn underlining on/off: - AddPrecedingText(sel, roValue); // parse underlining - sel.Font.Color = LBWdColor.wdColorRed; - } - } - } - private static LBSelection FindXyPlot() - { - LBSelection sel = MyApp.Selection; - LBFind find = sel.Find; - find.ClearFormatting(); - // Search string format - this is MSWord wildcard format - // If you do a search in MSWord, make sure wildcard box is checked and then press the - // Special button to see the definitions of the various wildcards - // [<] - Less-Than Character - // [!<> ]@ - 1 or more characters not including Less-Than, Greater-Than or Space - // - Dash - // [!<> ]@ - 1 or more characters not including Less-Than, Greater-Than or Space - // [>] - Greater-Than Character - find.Text = "[<][<]*[>][>]"; - //find.Wrap = LBWdFindWrap.wdFindStop; - find.Wrap = LBWdFindWrap.wdFindContinue; - find.MatchCase = false; - find.MatchWholeWord = false; - find.MatchWildcards = true; - find.MatchSoundsLike = false; - find.MatchAllWordForms = false; - if (find.Execute()) return sel; - return null; - } - private static LBSelection FindRO() - { - int firstStart = 0; - bool executeResult = false; - LBSelection sel = null; - while (!executeResult) - { - sel = MyApp.Selection; - LBFind find = sel.Find; - find.ClearFormatting(); - // Search string format - this is MSWord wildcard format - // If you do a search in MSWord, make sure wildcard box is checked and then press the - // Special button to see the definitions of the various wildcards - // [<] - Less-Than Character - // [!<> ]@ - 1 or more characters not including Less-Than, Greater-Than or Space - // - Dash - // [!<>]@ - 1 or more characters not including Less-Than, Greater-Than. - // a space be included as part of the accessory page id (Callaway, EOP Addendum 37) - // [>] - Greater-Than Character - find.Text = "[<][!<> ]@-[!<>]@[>]"; - find.Wrap = LBWdFindWrap.wdFindContinue; - find.MatchCase = false; - find.MatchWholeWord = false; - find.MatchWildcards = true; - find.MatchSoundsLike = false; - find.MatchAllWordForms = false; - executeResult = find.Execute(); - if (!executeResult) return null; - // MS Word found 'invalid' ro when text had "[335.0 - { - public string User_FullName - { - get { return User_LastName + ", " + User_FirstName; } - } - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs.bak b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs.bak deleted file mode 100644 index ab43df9f..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs.bak +++ /dev/null @@ -1,3721 +0,0 @@ -#define ItemWithContent - -using System; -using System.Collections.Generic; -using System.Text; -using Csla; -using Csla.Data; -using System.Data; -using System.Data.SqlClient; -using System.Xml; -using System.Drawing; -using System.Text.RegularExpressions; - -namespace VEPROMS.CSLA.Library -{ - - #region Item - public partial class Item : IVEDrillDown - { - // put in for debug - //public static int CacheCountPrimaryKey - //{ get { return _CacheByPrimaryKey.Count; } } - //public static int CacheCountList - //{ get { return _CacheList.Count; } } - - public string DisplayNumber - { - get { return ItemInfo.ConvertToDisplayText(MyContent.Number); } - } - public ItemInfo MyItemInfo /* Return Info version of the current Item */ - { get { return ItemInfo.Get(ItemID); } } - public static void ShowAllocated(string title) - { - Console.WriteLine("{0} - {1} Items in the dictionary", title, _CacheByPrimaryKey.Count); - foreach (List itmlst in _CacheByPrimaryKey.Values) - foreach(Item itm in itmlst) - Console.WriteLine("Item {0} UniqueID {1}", itm.ItemID, itm.MyItemUnique); - Console.WriteLine("- - - - - -"); - } - - public override string ToString() - { - return string.Format("{0} {1}", MyContent.Number, MyContent.Text).Trim(); - } - // TODO: Move to ItemInfo Extension - - #region IVEDrillDown - //public System.Collections.IList GetChildren() - //{ - // return this.MyContent.ContentParts; - //} - //public bool HasChildren - //{ - // get { return this.MyContent.ContentPartCount > 0; } - //} - //public Item MyProcedure - //{ - // get - // { - // // Walk up active parents until the parent is not an item - // Item tmp = this; - // while (tmp.ActiveParent.GetType() != typeof(DocVersion)) tmp = (Item)tmp.ActiveParent; - // return tmp; - // } - //} - //private IVEDrillDown _ActiveParent = null; - //public IVEDrillDown ActiveParent - //{ - // get - // { - // if (_ActiveParent == null) - // { - // if (MyPrevious != null) - // _ActiveParent = _MyPrevious.ActiveParent; - // else - // { - // if (ItemDocVersionCount > 0) - // _ActiveParent = this.ItemDocVersions[0].MyDocVersion; - // else - // { - // if (this.ItemParts == null || this.ItemPartCount == 0) - // _ActiveParent = this; - // else - // _ActiveParent = this.ItemParts[0].MyContent.ContentItems[0].MyItem; - // } - // } - // } - // return _ActiveParent == this ? null : _ActiveParent; - // } - //} - //private Format _ActiveFormat = null;// Added to cache ActiveFormat - //public Format ActiveFormat - //{ - // get - // { - // if (_ActiveFormat == null) - // _ActiveFormat = (LocalFormat != null ? LocalFormat : ActiveParent.ActiveFormat); - // return _ActiveFormat; - // } - // set - // { - // _ActiveFormat = null; // Reset - // } - //} - //public Format LocalFormat - //{ - // get { return MyContent.MyFormat; } - //} - public ConfigDynamicTypeDescriptor MyConfig - { - get { return null; } - } - #endregion - public void MoveItem(IVEDrillDownReadOnly pInfo, int index) - { - bool wasfirstchild = false; - ItemInfo parentInfo = pInfo as ItemInfo; - DocVersionInfo parentInfoDV = pInfo as DocVersionInfo; - IList children = null; - E_FromType partType = 0; // this is needed later to determine sub-group type. - if (parentInfo != null) - { - // this may have subgroups, need to use part type to get children list... - ItemInfo thisinfo = ItemInfo.Get(ItemID); - partType = thisinfo.FirstSibling.ItemParts[0].PartType; - children = (IList)parentInfo.Lookup((int)partType); - } - else - children = (IList)parentInfoDV.GetChildren(); - int numChild = children.Count; - - if (this.MyPrevious == null) wasfirstchild = true; - Item origNextItem = null; - - // First, remove from this item from its list. To do this, get the current item's next point and redirect it's myprevious - // to this item's previous... - if (NextItems != null && NextItems.Count > 0) - { - origNextItem = NextItems.Items[0]; - origNextItem.MyPrevious = this.MyPrevious; - this.Save(); - } - - // check to see if the item is being moved into the middle of some items. newPreviousItem is the item defined - // by index-1, i.e. inserting below newPreviousItem. - ItemInfo newPreviousInfo = (index == 0) ? null : children[index - 1]; - ItemInfo newNextInfo = (index == children.Count) ? null : children[index]; - - // Adjust the new next proc to be me. - if (newNextInfo != null) - { - using (Item newNextItem = newNextInfo.Get()) - { - newNextItem.MyPrevious = this; - newNextItem.Save().Dispose(); - } - } - - // adjust the previous node, i.e. may either be at same level or, if first in list, adjust the parent... - // if 'newPreviousItem' isn't null, then adding to the middle of the list. - if (newPreviousInfo != null) - { - using (Item newPreviousItem = newPreviousInfo.Get()) - { - MyPrevious = newPreviousItem; - Save(); - } - } - // newPreviousInfo == null if moving into first child, and wasfirstchild == true if moving out of first child. - // This will require adjusting the DocVersion to point to the correct first child if a procedure is moved. - if (newPreviousInfo == null || wasfirstchild) - { - if (parentInfo != null) // Moving Item within procedure, i.e. moving a section or step - { - using (Item parentItem = parentInfo.Get()) - { - // moving first child out... reset parent to point to the original next item - if (wasfirstchild) - { - parentItem.MyContent.ContentParts[(int)partType].MyItem = origNextItem; - newPreviousInfo.RefreshItemParts(); - } - else - parentItem.MyContent.ContentParts[(int)partType].MyItem = this; - parentItem.Save().Dispose(); - } - } - else if (parentInfoDV != null) // Moving Item (Procedure) within DocVersion - { - using (DocVersion parentItemDV = parentInfoDV.Get()) - { - ItemInfo firstinfo = parentInfoDV.FirstChild(); - parentItemDV.MyItem = wasfirstchild?parentInfoDV.Procedures[1].Get():this; - parentItemDV.Save().Dispose(); - if (!wasfirstchild && firstinfo != null) - { - using (Item firstchild = firstinfo.Get()) - { - firstchild.MyPrevious = this; - firstchild.Save().Dispose(); - } - } - } - } - if (!wasfirstchild) - { - this.MyPrevious = null; - this.Save(); - } - if (origNextItem != null) origNextItem.Dispose(); - if (parentInfo != null) - parentInfo.MyContent.RefreshContentParts(); - if (parentInfoDV != null) - parentInfoDV.ResetProcedures(); - } - - } - protected static int MakeNewItem(IVEDrillDownReadOnly parentInfoDD, ItemInfo previousInfo, string number, string title, int type, E_FromType partType) - { - int newitemid = 0; - if (parentInfoDD == null) - parentInfoDD = previousInfo.ActiveParent; - ItemInfo parentInfo = parentInfoDD as ItemInfo; - DocVersionInfo parentInfoDV = parentInfoDD as DocVersionInfo; - using (Content cont = Content.New(number, title, type, null, null)) - { - using (Item fromitem = previousInfo == null ? null : previousInfo.Get()) - { - ItemInfo nextInfo = null; // Check to see if the item is being inserted in the middle of some items. - if (previousInfo != null && previousInfo.NextItems != null && previousInfo.NextItems.Count > 0) - nextInfo = previousInfo.NextItems[0]; - using (Item itm = Item.MakeItem(fromitem, cont)) - { - newitemid = itm.ItemID; - if (nextInfo != null) - { - using (Item nextItem = nextInfo.Get()) - { - nextItem.MyPrevious = itm;// Aim the next item back at the new item. - nextItem.Save().Dispose(); - } - } - if (fromitem == null) - { - if (parentInfo != null) // Adding Item to Procedure, Section or Step - { - using (Item parentItem = parentInfo.Get()) - { - ItemInfo firstinfo = parentInfo.FirstChild(partType); - if (firstinfo != null) - { - using (Item firstchild = firstinfo.Get()) - { - parentItem.MyContent.ContentParts[(int)partType].MyItem = itm;// First update the parent to point to the new first child - parentItem.Save().Dispose(); - firstchild.MyPrevious = itm;// Aim the old first child to point to the new first child. - firstchild.Save().Dispose(); - } - } - else - { - parentItem.MyContent.ContentParts.Add((int)partType, itm);// update the parent to point to the new first child - parentItem.Save().Dispose(); - } - } - } - if (parentInfoDV != null) // Adding Item (Procedure) to DocVersion - { - using (DocVersion parentItemDV = parentInfoDV.Get()) - { - ItemInfo firstinfo = parentInfoDV.FirstChild(); - parentItemDV.MyItem = itm;// First update the parent to point to the new first child - parentItemDV.Save().Dispose(); - if (firstinfo != null) - { - using (Item firstchild = firstinfo.Get()) - { - firstchild.MyPrevious = itm;// Aim the old first child to point to the new first child. - firstchild.Save().Dispose(); - } - } - } - } - - } - } - } - } - if (parentInfo != null) - parentInfo.MyContent.RefreshContentParts(); - if (parentInfoDV != null) - parentInfoDV.ResetProcedures(); - return newitemid; - } - } - #endregion - #region ItemInfo - public partial class ItemInfo:IVEDrillDownReadOnly - { - // put in for debugging - //public static int CacheCountPrimaryKey - //{ get { return _CacheByPrimaryKey.Count; } } - //public static int CacheCountList - //{ get { return _CacheList.Count; } } - - //public override bool Equals(object obj) - //{ - // ItemInfo ii = obj as ItemInfo; - // if (ii != null) - // return ii._ItemID == _ItemID; - // return false; - //} - private int _PrintBias = 0; - public int PrintBias - { - get { return _PrintBias; } - set { _PrintBias = value; } - } - private int _PrintLevel = 0; - public int PrintLevel - { - get - { - if (_PrintLevel != 0) return _PrintLevel; - int _PrintBias = 0; - _PrintLevel = GetStepLevel(ref _PrintBias); - - return _PrintLevel; - } - set { _PrintLevel = value; } - } - private float _MSWordPageCount = 0; - public float MSWordPageCount - { - get { return _MSWordPageCount; } - set { _MSWordPageCount = value; } - } - public event ItemInfoEvent OrdinalChanged; - private void OnOrdinalChange() - { - if (OrdinalChanged != null) OrdinalChanged(this); - } - public static void OnOrdinalChange(int itemID) - { - ConvertListToDictionary(); - string key = itemID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ItemInfo item in _CacheByPrimaryKey[key]) - item.OnOrdinalChange(); - } - public bool IsFirstSubStep - { - get - { - if (!IsStepPart) return false; - if (IsHigh) return false; - return (MyPrevious == null); - } - } - public bool IsAutoTOCSection - { - get - { - if (!IsSection) return false; - if (MyDocStyle.StructureStyle.Style == null) return false; - return ((ActiveFormat.PlantFormat.FormatData.PurchaseOptions & E_PurchaseOptions.AutoTableOfContents) == E_PurchaseOptions.AutoTableOfContents && - (MyDocStyle.StructureStyle.Style & E_DocStructStyle.TableOfContents) == E_DocStructStyle.TableOfContents); - } - } - #region StepLevel - private int _StepLevel = -2;// Not yet calculated - public int StepLevel - { - get - { - if (_StepLevel == -2) - { - _StepLevel = CalcStepLevel(this); - //ItemInfo parent = ActiveParent as ItemInfo; - //Console.WriteLine("{0},{1},{2},{3},{4},{5},{6}",ItemID, DBSequence, _StepLevel, MyContent.Type % 10000, parent.MyContent.Type % 10000,HasCautionOrNote ? 1 : 0, parent.Cautions == null? 0 : 1); - } - return _StepLevel; - } - set { _StepLevel = value; } - } - public string ToolTip - { - get - { - if (IsStep) - return FormatStepData.StepEditData.TypeMenu.MenuItem; //FormatStepData.Type; - else if (IsSection) - return MyDocStyle.Name; - return "Procedure Title"; - } - } - public bool HasCautionOrNote - { - get { return Cautions != null || Notes != null; } - } - private static Regex regexDBSeqPass1 = new Regex("([^.]*)[.]S([^.]*)[.]S([0-9]*)[.](.*)"); - private static Regex regexDBSeqPass2 = new Regex("[.](.)([^.]*)[.]"); - public string DBSequence - { - get - { - Match m1 = regexDBSeqPass1.Match(ShortPath); - MatchCollection m2s = regexDBSeqPass2.Matches(m1.Groups[4].Value); - StringBuilder retval = new StringBuilder(string.Format("\"{0}\"\t\"{1}\"\t\"{2}\"", m1.Groups[1].Value, m1.Groups[2].Value, m1.Groups[3].Value)); - string prefix = "S"; - string suffix = ""; - foreach (Match m2 in m2s) - { - int i = ((int) '0') + int.Parse(m2.Groups[2].Value); - char c = (char)i; - suffix = c.ToString(); - switch (m2.Groups[1].Value) - { - case "S": - break; - case "R": - prefix += "$"; - suffix = ""; - break; - case "C": - prefix = "!"; - break; - case "N": - prefix = "*"; - break; - case "T": - prefix += "#"; - suffix = ""; - break; - default: - break; - } - retval.Append(prefix + suffix); - prefix = ""; - } - retval.Append(prefix + "'"); - //Volian.Base.Library.DebugText.WriteLine("'{0}','{1}','{2}'", retval, ShortPath, Path); - return retval.ToString(); - } - } - private static int CalcStepLevel(ItemInfo item) - { - if(item == null) return 0; - int id=0; - // Determines the substep level. - int level = CountLevels(item); - - // PaginateOnFirstSubstep allows orphans, first child can be separated from its parent. - int firstInc = item.ActiveFormat.MyStepSectionLayoutData.PaginateOnFirstSubstep ? 0 : 1; - ItemInfo parent = item.ActiveParent as ItemInfo; - - // TODO: Format flag 'TreatAsSequential': - // The following needs to account for use of format flag 'TreatAsSequential' when doing - // formats that have it. - if (item.IsExactType("And") || item.IsExactType("Or") || item.IsExactType("ImplicitOr")) - level++; - if (parent != null && (parent.IsExactType("And") || parent.IsExactType("Or"))) - level++; - - // First substep, this is where it uses the orphan logic from above. - if (!item.IsRNOPart && !item.IsHigh && item.MyPrevious == null) - level += firstInc; - else - firstInc = 0; - - // Try not to paginate on a step that has Cautions & Notes, keep the Caution/Note with - // the step. - if (item.IsStepPart) - { - if (item.Cautions != null || item.Notes != null) - level += 2; - } - // Paginate before first caution, not between cautions. - else if (item.IsCautionPart) - { - if (item.MyPrevious == null) level-=(1 + firstInc); - else level++; - } - // Paginate before first note, if the step does not have a caution. - // Otherwise, try to keep the notes together. - else if (item.IsNotePart) - { - if (parent.Cautions == null && item.MyPrevious == null) level-=(1 + firstInc); - else level++; - } - // Try not to paginate on a table. - else if (item.IsTablePart) - { - level += 2; - } - // For an RNO to the right, make it the same level as the AER item. - else if(item.IsRNOPart) - { - level = (item.ActiveParent as ItemInfo).StepLevel + item.RNOLevel - item.ColumnMode; - } - return level; - } - - /// - /// Count all levels, including substeps within RNOs. Ignore RNOs that are to the right of - /// the AER, but count those that are below higher level RNOs. - /// - /// - /// - private static int CountLevels(ItemInfo item) - { - int level = 0; - if (item.IsProcedure) return 0; - int ignoreRNOs = item.ActiveSection.ColumnMode; - while (item != null && !item.IsHigh) - { - if (ignoreRNOs > 0 && item.IsRNOPart) - ignoreRNOs--; - else - level++; - item = item.ActiveParent as ItemInfo; - } - return level; - } - #endregion - public bool HasHeader - { - get - { - if (MyHeader==null)return false; - if (MyHeader.CleanText==null) return false; - if (MyHeader.CleanText=="") return false; - return true; - } - } - protected void ExtensionRefreshFields(Item tmp) - { - _ActiveParent = null; - } - #region LoadAtOnce2 - public static ItemInfo GetItemAndChildren2(int? itemID) - { - try - { - ItemInfo tmp = DataPortal.Fetch(new ItemAndChildrenCriteria2(itemID)); - AddToCache(tmp); - if (tmp.ErrorMessage == "No Record Found") tmp = null; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetItemAndChildren2", ex); - } - } - // Criteria to get Item and children - [Serializable()] - private class ItemAndChildrenCriteria2 - { - public ItemAndChildrenCriteria2(int? itemID) - { - _ItemID = itemID; - } - private int? _ItemID; - public int? ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - // Data Portal to Get Item and Children - private void DataPortal_Fetch(ItemAndChildrenCriteria2 criteria) - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getItem"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - SpinThroughChildren(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - Database.LogException("ItemInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - RemoveFromCache(this); - } - private void SpinThroughChildren() - { - if(MyContent.ContentPartCount > 0) - foreach(PartInfo partInfo in MyContent.ContentParts) - 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) - { - try - { - ItemInfo tmp = DataPortal.Fetch(new ItemAndChildrenCriteria(itemID,parentID)); - AddToCache(tmp); - if (tmp.ErrorMessage == "No Record Found") tmp = null; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetChildren", ex); - } - } - // Criteria to get Item and children - [Serializable()] - private class ItemAndChildrenCriteria - { - public ItemAndChildrenCriteria(int? itemID, int? parentID) - { - _ItemID = itemID; - _ParentID = parentID; - } - private int? _ItemID; - public int? ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - private int? _ParentID; - public int? ParentID - { - get { return _ParentID; } - set { _ParentID = value; } - } - } - // Data Portal to Get Item and Children - private void DataPortal_Fetch(ItemAndChildrenCriteria criteria) - { - //ItemInfo tmp = null; - Dictionary lookup = new Dictionary(); ; - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_ListItemAndChildren"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.Parameters.AddWithValue("@ParentID", criteria.ParentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) - { - if (dr.GetInt32("Level")==0) - { - //tmp = itemInfo; - ReadData(dr); - AddContent(dr); - lookup[this.ItemID] = this; - } - else - { - ItemInfo itemInfo = null; - int itemType = dr.GetInt32("Type") / 10000; - switch (itemType) - { - case 0: - itemInfo = new ProcedureInfo(dr); - break; - case 1: - itemInfo = new SectionInfo(dr); - break; - case 2: - itemInfo = new StepInfo(dr); - break; - } - // Load Children - itemInfo.AddContent(dr); - ItemInfo parent = lookup[dr.GetInt32("ParentID")]; - itemInfo._ActiveParent = parent; - itemInfo._ActiveSection = (itemInfo.IsSection ? itemInfo : parent._ActiveSection); - parent.AddPart(dr, itemInfo); - lookup.Add(itemInfo.ItemID, itemInfo); - } - } - //Console.WriteLine("I'm here {0}",this.MyContent.ContentPartCount); - } - } - } - } - catch (Exception ex) - { - Database.LogException("ItemInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - } - private void AddPart(SafeDataReader dr, ItemInfo itemInfo) - { - // Either a new PartInfo or an existing PartInfo - if (dr.IsDBNull(dr.GetOrdinal("PreviousID"))) - { - //PartInfo prt = new PartInfo(dr, itemInfo); - _MyContent.AddPart(dr, itemInfo); - } - else - { - foreach (PartInfo pi in MyContent.ContentParts) - { - if (dr.GetInt32("FromType") == (int)pi.PartType) - { - if (pi._MyItems == null) - pi._MyItems = new ItemInfoList(itemInfo); - else - pi.MyItems.AddItem(itemInfo); - } - } - } - } - #endregion - #region IsType - public bool IsFirstCautionPart - { - get - { - return ((ItemPartCount > 0) && (ItemParts[0].PartType == E_FromType.Caution)); - } - } - public bool IsFirstNotePart - { - get - { - return ((ItemPartCount > 0) && (ItemParts[0].PartType == E_FromType.Note)); - } - } - - public bool IsCautionPart - { - get - { - return ((FirstSibling.ItemPartCount > 0) && (FirstSibling.ItemParts[0].PartType == E_FromType.Caution)); - } - } - public bool IsNotePart - { - get - { - return ((FirstSibling.ItemPartCount > 0) && (FirstSibling.ItemParts[0].PartType == E_FromType.Note)); - } - } - - public bool IsType(string type) - { - if ((int)MyContent.Type < 20000) return false; - int stepType = ((int)MyContent.Type) % 10000; - StepDataList sdlist = ActiveFormat.PlantFormat.FormatData.StepDataList; - if (stepType > sdlist.Count) - { - Console.WriteLine("Error getting type - contentid = {0}", MyContent.ContentID); - return false; - } - StepData sd = sdlist[stepType]; - while (sd.Index != 0) - { - if (sd.Type == type) return true; - sd = sdlist[sd.ParentType]; - } - return false; - } - public bool IsExactType(string type) - { - if ((int)MyContent.Type < 20000) return false; - int stepType = ((int)MyContent.Type) % 10000; - StepDataList sdlist = ActiveFormat.PlantFormat.FormatData.StepDataList; - if (stepType > sdlist.Count) - { - Console.WriteLine("Error getting type - contentid = {0}", MyContent.ContentID); - return false; - } - StepData sd = sdlist[stepType]; - return (sd.Type == type); - } - public bool IsCaution - { - get - { - return IsType("Caution"); - } - } - public bool IsNote - { - get - { - return IsType("Note"); - } - } - public bool IsTable - { - get - { - return IsType("Table"); - } - } - public bool IsFigure - { - get - { - return IsType("Figure"); - } - } - public bool IsOr - { - get - { - return IsType("Or"); - } - } - public bool IsAnd - { - get - { - return IsType("And"); - } - } - public bool IsEquipmentList - { - get - { - return IsType("EquipmentList"); - } - } - public bool IsTitle - { - get - { - return IsType("Title"); - } - } - public bool IsAccPages - { - get - { - return IsType("AccPages"); - } - } - public bool IsParagraph - { - get - { - return IsType("Paragraph"); - } - } - public bool IsDefault - { - get - { - return IsType("Default"); - } - } - public bool IsContAcSequential - { - get - { - return IsType("ContAcSequential"); - } - } - public bool IsHigh - { - get - { - // check to see if ActiveParent is a section, if so it is a high level step - if (MyContent.Type / 10000 != 2) return false; - ItemInfo parent = ActiveParent as ItemInfo; - if (parent == null) return false; - if ((parent.MyContent.Type / 10000) == 1) - return true; - return false; - } - } - public bool IsSequential - { - get - { - if ((MyContent.Type / 10000) != 2) return false; - string tabstr = FormatStepData.TabData.IdentPrint; - if (tabstr.Contains("{seq}")) return true; - return false; - } - } - public bool IsTablePart - { - get - { - return ((ItemPartCount > 0) && (ItemParts[0].PartType == E_FromType.Table)); - } - } - public bool IsRNOPart - { - get - { - return ((ItemPartCount > 0) && (ItemParts[0].PartType == E_FromType.RNO)); - } - } - public bool IsInRNO - { - get - { - if (IsHigh) return false; - if (IsRNOPart) return true; - ItemInfo parent = ActiveParent as ItemInfo; - if (parent == null) return false; - return parent.IsInRNO; - } - } - #endregion - #region Level Columns Relationships - public int RNOLevel - { - get - { - return ((IsProcedure || IsSection || IsHigh)?0:(IsRNOPart?1:0)+((ItemInfo)ActiveParent).RNOLevel); - } - } - public int ColumnMode - { - get - { - // check config value on my section, if null/default use Pmode of active format - if (ActiveSection != null) - { - SectionInfo si = SectionInfo.Get(ActiveSection.ItemID); //ActiveSection as SectionInfo; - if (si != null) - { - // there is no longer a "default" ENUM item - SectionConfig will return format default if needed - //if (si.SectionConfig.Section_ColumnMode != SectionConfig.SectionColumnMode.Default) - return (int)si.SectionConfig.Section_ColumnMode - 1; - } - } - return (ActiveFormat.MyStepSectionLayoutData.PMode ?? 2) -1; - } - } - /// - /// FormatStepType - Maps to step type in format file. All types map directly from step type in content - /// to step type in format - /// - public int FormatStepType - { - get - { - return (((int)MyContent.Type) % 10000); - } - } - /// - /// returns the format's stepdata for the given content type. - /// - public StepData FormatStepData - { - get - { - int typ = (int)MyContent.Type - 20000; - foreach (StepData sd in ActiveFormat.PlantFormat.FormatData.StepDataList) - { - if (sd.Index == typ) return sd; - } - return null; - } - } - public ItemInfo FirstSibling - { - get - { - ItemInfo temp = this; - while (temp.MyPrevious != null) temp = temp.MyPrevious; - return temp; - } - } - public ItemInfo LastSibling - { - get - { - ItemInfo temp = this; - while (temp.NextItems != null && temp.NextItems.Count > 0) temp = temp.NextItems[0]; - return temp; - } - } - public ItemInfo LastChild(E_FromType partType) - { - ItemInfoList myitems = Lookup((int)partType); - if (myitems !=null) return myitems[myitems.Count-1]; - return null; - } - public ItemInfo FirstChild(E_FromType partType) - { - ItemInfoList myitems = Lookup((int)partType); - if (myitems != null) return myitems[0]; - return null; - } - public bool HasAncestor(ItemInfo ancestor) - { - if (ancestor == null) return false; - ItemInfo parent = ActiveParent as ItemInfo; - if (parent == null) return false; - if (ancestor.ItemID == parent.ItemID) return true; - return parent.HasAncestor(ancestor); - } - #endregion - #region More IsType - public bool IsProcedurePart - { - get - { - return ((FirstSibling.ItemPartCount > 0) && (FirstSibling.ItemParts[0].PartType == E_FromType.Procedure)); - } - } - public bool IsSectionPart - { - get - { - return ((FirstSibling.ItemPartCount > 0) && (FirstSibling.ItemParts[0].PartType == E_FromType.Section)); - } - } - public bool IsStepPart - { - get - { - return ((FirstSibling.ItemPartCount > 0) && (FirstSibling.ItemParts[0].PartType == E_FromType.Step)); - } - } - public bool IsInSubStep - { - get - { - if (IsHigh) return false; - if (IsStepPart) return true; - ItemInfo parent = ActiveParent as ItemInfo; - if (parent == null) return false; - return parent.IsInSubStep; - } - } - public bool IsInFirstLevelSubStep - { - get - { - ItemInfo temp = FirstSibling; - if(temp.ActiveParent.GetType() == typeof(VEPROMS.CSLA.Library.DocVersionInfo))return false; - if (temp.MyParent.IsSection) return false; // already at hls - if (temp.IsProcedure || temp.IsSection) return false; - while (((ItemInfo)temp.ActiveParent).IsHigh == false) - temp = ((ItemInfo)temp.ActiveParent).FirstSibling; - return temp.IsStepPart; - } - } - public bool IsStepSection - { - get - { - if (IsSection && MyDocStyle.IsStepSection) return true; - return false; - } - } - public bool IsSection - { - get - { - if ((MyContent.Type / 10000) == 1) return true; - return false; - } - } - public bool IsDefaultSection - { - get - { - // check to see if ActiveParent is a section, if so it is a high level step - if (MyContent.Type / 10000 != 1) return false; - // get procedure section and then - ItemInfo parent = (ItemInfo)ActiveParent; - if (!parent.IsProcedure) return false; - ProcedureConfig pc = (ProcedureConfig)parent.MyConfig; - int sectstartid = -1; - string ss = pc == null ? null : pc.SectionStart; - if (ss != null) sectstartid = System.Convert.ToInt32(ss); - else return false; - if (ItemID == sectstartid) return true; - return false; - } - } - public bool IsProcedure - { - get - { - if ((MyContent.Type / 10000) == 0) return true; - return false; - } - } - public bool IsStep - { - get - { - if ((MyContent.Type / 10000) == 2) return true; - return false; - } - } - private E_FromType ItemType - { - get - { - if (MyContent.Type == 0) return E_FromType.Procedure; - if (MyContent.Type < 20000) return E_FromType.Section; - return E_FromType.Step; - } - } - public Item GetByType() - { - Item tmp = null; - switch (ItemType) - { - case E_FromType.Procedure: - tmp = Procedure.Get(_ItemID); - break; - //case E_FromType.Section: - // itemInfo = new Section(dr); - // break; - //default: - // itemInfo = new Step(dr); - // break; - } - return tmp; - } - #endregion - #region Ordinal CslaType and Tostring - [NonSerialized] - private int? _Ordinal; - public int Ordinal - { - get - { - if (_Ordinal == null) - { - if (MyPrevious != null) - _Ordinal = MyPrevious.Ordinal + 1; - else - _Ordinal = 1; - } - return (int) _Ordinal; - } - } - public string CslaType - { get { return this.GetType().FullName; } } - public override string ToString() - { - //Item editable = Item.GetExistingByPrimaryKey(_ItemID); - //return string.Format("{0}{1} {2}", (editable == null ? "" : (editable.IsDirty ? "* " : "")), - // (MyContent.Type >= 20000 ? Ordinal.ToString() + "." : MyContent.Number), MyContent.Text); - ContentInfo cont = MyContent; - //string number = cont.Number; - string number = DisplayNumber; - //if (cont.Type >= 20000) number = Ordinal.ToString() + "."; - if (cont.Type >= 20000) number = MyTab.CleanText; - return string.Format("{0} {1}", number, DisplayText).Trim(); - //return string.Format("{0} {1}", number, cont.Text).Trim(); - //return string.Format("{0} {1}", cont.Number, cont.Text); - //return "Now is the time for all good men to come to the aid of their country!"; - } - //public string ToString(string str,System.IFormatProvider ifp) - //{ - // return ToString(); - //} - #endregion - #region Search - internal string _SearchDVPath; - public string SearchDVPath - { - get - { - if (_SearchDVPath == null) - _SearchDVPath = ActiveParent.SearchDVPath; - return _SearchDVPath; - } - } - internal string _SearchPath; - public string SearchPath - { - get - { - if (_SearchPath==null) - { - if (IsProcedure) - _SearchPath = ActiveParent.SearchPath + "\u0007" + (DisplayNumber ?? "") + "\u0011" + DisplayText ; - else if (IsSection) - _SearchPath = ActiveParent.SearchPath + "\u0007" + (DisplayNumber ?? "") + "\u0011" + DisplayText; - else - { - PartInfo myPart = FirstSibling.ItemPartCount > 0 ? FirstSibling.ItemParts[0] : null; - if(myPart != null) - _SearchPath = myPart.SearchPath + (!IsHigh ? "." : "\u0007") + Ordinal.ToString(); - else - _SearchPath = ActiveParent.SearchPath + (!IsHigh ? "." : "\u0007") + Ordinal.ToString(); - } - } - return _SearchPath; - } - } - public string ShortSearchPath - { - get { return ConvertToDisplayText(Regex.Replace(_SearchPath ?? "", "\x11.*?\x07", "\x07")); } - } - internal int _SearchAnnotationID; - public int SearchAnnotationID - { - get { return _SearchAnnotationID; } - } - internal string _SearchAnnotationText; - public string SearchAnnotationText - { - get { return _SearchAnnotationText; } - set { _SearchAnnotationText = value; } - } - internal string _SearchAnnotationType; - public string SearchAnnotationType - { - get { return _SearchAnnotationType; } - } - #endregion - #region ProcedureConfig - [NonSerialized] - private ProcedureConfig _ProcedureConfig = null; - public PrintChangeBar PrintChangeBar - { - get - { - if (_ProcedureConfig == null) SetProcedureConfig(); - return _ProcedureConfig.Print_ChangeBar; - } - } - public PrintChangeBarLoc PrintChangeBarLoc - { - get - { - if (_ProcedureConfig == null) SetProcedureConfig(); - return _ProcedureConfig.Print_ChangeBarLoc; - } - } - public PrintChangeBarText PrintChangeBarText - { - get - { - if (_ProcedureConfig == null) SetProcedureConfig(); - return _ProcedureConfig.Print_ChangeBarText; - } - } - public string PrintChangeBarUsrMsg1 - { - get - { - if (_ProcedureConfig == null) SetProcedureConfig(); - return _ProcedureConfig.Print_UserCBMess1; - } - } - public string PrintChangeBarUsrMsg2 - { - get - { - if (_ProcedureConfig == null) SetProcedureConfig(); - return _ProcedureConfig.Print_UserCBMess2; - } - } - private void SetProcedureConfig() - { - // Walk up tree until find my procedure. Then get its change bar (default will - // get inherited information if not set at this level). - // Find the procedure level and its config. - ItemInfo tmpitm = this; - while (tmpitm.MyContent.Type != 0) - tmpitm = tmpitm.MyParent; - - ProcedureInfo pi = ProcedureInfo.Get(tmpitm.ItemID); - if (pi == null) return; - _ProcedureConfig = pi.MyConfig as ProcedureConfig; - } - #endregion - #region Formatting of Text - public string DisplayText - { - get { return ConvertToDisplayText(MyContent.Text); } - } - public string DisplayNumber - { - get - { - string str = (this.IsProcedure)?MyDocVersion.UnitSpecific(MyContent.Number,0):MyContent.Number; - return ConvertToDisplayText(str); - } - //get { return ConvertToDisplayText(MyContent.Number); } - } - public static string ConvertToDisplayText(string txt) - { - string retval = txt; - retval = StripRtfFormatting(retval); - retval = StripLinks(retval); - retval = ReplaceSpecialCharacters(retval); - retval = retval.Replace("\u2011","-"); - retval = retval.Replace("\r\n", ";"); - retval = retval.Replace("\n", ";"); //added for consistency checking with approved version - return retval; - } - public static string StripRtfFormatting(string rtf) - { - string retval = rtf; - retval = Regex.Replace(retval, @"\\b0 ?", ""); - retval = Regex.Replace(retval, @"\\b ?", ""); - retval = Regex.Replace(retval, @"\\ulnone ?", ""); - retval = Regex.Replace(retval, @"\\ul0 ?", ""); - retval = Regex.Replace(retval, @"\\ul ?", ""); - retval = Regex.Replace(retval, @"\\i0 ?", ""); - retval = Regex.Replace(retval, @"\\i ?", ""); - //retval = Regex.Replace(retval, @"\\super ?", ""); - //retval = Regex.Replace(retval, @"\\sub ?", ""); - //retval = Regex.Replace(retval, @"\\nosupersub ?", ""); - retval = Regex.Replace(retval, @"\\up[320] ?", ""); - retval = Regex.Replace(retval, @"\\dn[320] ?", ""); - return retval; - } - public static string StripLinks(string rtf) - { - string retval = rtf; - retval = Regex.Replace(retval, @"\\v.*?\\v0", ""); - retval = retval.Replace("\u252C", "");// Unicode 9516 Transition - retval = retval.Replace("\u2566", "");// Unicode 9574 Transition - retval = retval.Replace("\u0015", "");// Unicode 21 RO - return retval; - } - private static string ReplaceSpecialCharacter(Match m) - { - StringBuilder sb = new StringBuilder(); - int i = int.Parse(m.ToString().Substring(2,m.ToString().Length-3)); - sb.Append((char)i); - return sb.ToString(); - } - private static string ReplaceSpecialHexCharacter(Match m) - { - StringBuilder sb = new StringBuilder(); - int i = int.Parse(m.ToString().Substring(2), System.Globalization.NumberStyles.HexNumber); - sb.Append((char)i); - return sb.ToString(); - } - private static string ReplaceSpecialCharacters(string rtf) - { - string retval = rtf; - retval = retval.Replace("`", "\u00B0");// Degree - retval = Regex.Replace(retval, @"\\u[0-9]+[?]", new MatchEvaluator(ReplaceSpecialCharacter)); - retval = Regex.Replace(retval, @"\\'[0-9A-Fa-f][0-9A-Fa-f]", new MatchEvaluator(ReplaceSpecialHexCharacter)); - return retval; - } - - public VE_Font GetItemFont() - { - return GetItemFont(ActiveFormat); - } - - public VE_Font GetItemFont(FormatInfo fmt) - { - VE_Font font = null; - try - { - FormatInfo format = (LocalFormat != null || fmt == null) ? LocalFormat : fmt;//_MyItemInfo.ActiveFormat; - int type = (int)MyContent.Type;//_MyItemInfo.MyContent.Type; - switch (type / 10000) - { - case 0: // procedure - font = format.PlantFormat.FormatData.Font; - break; - case 1: // section - font = format.PlantFormat.FormatData.SectData.SectionHeader.Font; - break; - case 2: // step types - int typindx = type - 20000; // what to do for other types rather than steps - font = format.PlantFormat.FormatData.StepDataList[typindx].Font; - if (typindx == _ParagraphType) font = AdjustForTextSubFollowsTextStyle(format,typindx,font); - break; - } - } - catch (Exception ex) - { - Console.WriteLine("GetItemFont(): {0} - {1}", ex.GetType(), ex.Message); - } - return font; - } - private const int _ParagraphType=24; - protected VE_Font AdjustForTextSubFollowsTextStyle(VE_Font font) - { - return AdjustForTextSubFollowsTextStyle(ActiveFormat, this.FormatStepType, font); - } - private VE_Font AdjustForTextSubFollowsTextStyle(FormatInfo format, int typindx, VE_Font font) - { - StepData myFormatStepData = format.PlantFormat.FormatData.StepDataList[typindx]; - if (myFormatStepData.TextSubFollowsTextStyle && ParentNoteOrCaution != null) - { - bool isBold = (myFormatStepData.Font.Style & E_Style.Bold) > 0; - bool isMmBold = (myFormatStepData.Font.Style & E_Style.MmBold) > 0; - myFormatStepData = format.PlantFormat.FormatData.StepDataList[ParentNoteOrCaution.FormatStepType]; - font = myFormatStepData.Font; - E_Style myStyle = (E_Style) font.Style; - myStyle ^= (myStyle & E_Style.Bold); - myStyle ^= (myStyle & E_Style.MmBold); - myStyle |= isBold ? E_Style.Bold : 0; - myStyle |= isMmBold ? E_Style.MmBold : 0; - if (myStyle != font.Style) - font = new VE_Font(font.Family, (int)font.Size, myStyle, (float)font.CPI); - } - return font; - } - private string RemoveToken(string str, string token) - { - // if this token is preceeded by another token and followed by a space - // leave the preceeding token the ending space - string retval = Regex.Replace(str, @"(\\[^ \\?\r\n\t]*)" + token + " ", "$1 "); - //if (retval != str) // Show the token replacement - // Console.WriteLine("Leave the preceeding token the ending space '{0}'\r\n{1}\r\n{2}",token,str,retval); - // otherwise replace the token optionally followed by a space - retval = Regex.Replace(retval, token + " ?", ""); - return retval; - } - public string RemoveRtfStyles(string rtf) - { - return RemoveRtfStyles(rtf, ActiveFormat); - } - public string RemoveRtfStyles(string rtf, FormatInfo fmt) - { - string retval = rtf; - VE_Font TextFont = GetItemFont(fmt); - if (TextFont != null) - { - // remove rtf commands for any styles that were added. Note that if - // the entire item has a style, and also contains 'pieces' of text with - // the same style, the underlying rtf box removes the embedded rtf commands, - // for example, if the entire step is bolded, and 'THEN' has bold on/off - // surrounding it, the rtf box removes the bold around the 'THEN' - // These remove the command with a following space or the command alone, - // either case may exist, because if there are rtf commands following the - // style command, there will be no space character following the style command. - if (((TextFont.Style & E_Style.Bold) > 0) || ((TextFont.Style & E_Style.MmBold) > 0)) - { - retval = RemoveToken(retval, @"\\b0"); - retval = RemoveToken(retval, @"\\b"); - } - if ((TextFont.Style & E_Style.Underline) > 0) - { - retval = RemoveToken(retval, @"\\ulnone"); - retval = RemoveToken(retval, @"\\ul"); - } - if ((TextFont.Style & E_Style.Italics) > 0) - { - retval = RemoveToken(retval, @"\\i0"); - retval = RemoveToken(retval, @"\\i"); - } - } - return retval; - } - #endregion - #region Path and Parent - public string Path - { - get - { - string number = (MyContent.Type >= 20000 ? Ordinal.ToString() + "." : ((DisplayNumber ?? "")==""? DisplayText: DisplayNumber)); - ItemInfo parent = this; - while (parent.MyPrevious != null) parent = parent.MyPrevious; - if (parent.ItemPartCount == 0) - return number + ", " + DisplayText; - else - { - PartInfo partInfo = parent.ItemParts[0]; - return partInfo.MyContent.ContentItems.Items[0].Path + " " + ((E_FromType)partInfo.FromType).ToString() + " " + number; - } - } - } - public string ShortPath - { - get - { - string number = (MyContent.Type >= 20000 ? Ordinal.ToString() + "." : ((DisplayNumber ?? "") == "" ? DisplayText : DisplayNumber)); - ItemInfo parent = this; - while (parent.MyPrevious != null) parent = parent.MyPrevious; - if (parent.ItemPartCount == 0) - return number; - else - { - PartInfo partInfo = parent.ItemParts[0]; - return partInfo.MyContent.ContentItems.Items[0].ShortPath + "." + ((E_FromType)partInfo.FromType).ToString().Substring(0,1) + number; - } - } - } - public ContentInfo ParentContent - { - get - { - string number = (MyContent.Type >= 20000 ? Ordinal.ToString() + "." : ((MyContent.Number ?? "") == "" ? MyContent.Text : MyContent.Number)); - ItemInfo parent = this; - while (parent.MyPrevious != null) parent = parent.MyPrevious; - if (parent.ItemPartCount <= 0 || parent.ItemParts.Count == 0) - return null; - else - { - return parent.ItemParts[0].MyContent; - } - } - } - public ItemInfo MyParent - { - get - { - //if (ItemDocVersionCount > 0) return ItemDocVersions[0]; Need to create one interface to support Folders, DocVersions and Items - ContentInfo parentContent = ParentContent; - if (parentContent == null || parentContent.ContentItemCount == 0) return null; - return parentContent.ContentItems[0]; - } - } - #endregion - #region Lookups and More Related - private ItemInfoList Lookup(int fromType, ref ItemInfoList itemInfoList) - { - if (itemInfoList == null) - itemInfoList = Lookup(fromType); - return itemInfoList; - } - internal ItemInfoList Lookup(int fromType) - { - ItemInfoList itemInfoList = null; - if (MyContent.ContentPartCount != 0) - foreach (PartInfo partInfo in MyContent.ContentParts) - if (partInfo.FromType == fromType) - { - itemInfoList = partInfo._MyItems = ItemInfoList.GetList(partInfo.ItemID, partInfo.FromType); - return itemInfoList; - } - return null; - } - public static void ResetParts(int itemID) - { - string key = itemID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) - { - bool firstContent = true; - foreach (ItemInfo itm in _CacheByPrimaryKey[key]) - { - itm.ResetParts(); - if (itm._MyContent != null && firstContent) - { - firstContent = false;// Only need to do this once. - //RefreshContentParts looks through ContentInfo objects - itm._MyContent.RefreshContentParts(); - } - } - } - } - public void ResetParts() - { - _Procedures = null; - _Sections = null; - _Cautions = null; - _Notes = null; - _RNOs = null; - _Steps = null; - _Tables = null; - } - private ItemInfoList _Procedures; - public ItemInfoList Procedures - { get { return Lookup(1,ref _Procedures); } } - private ItemInfoList _Sections; - public ItemInfoList Sections - { get { return Lookup(2,ref _Sections); } } - private ItemInfoList _Cautions; - public ItemInfoList Cautions - { get { return Lookup(3,ref _Cautions); } } - private ItemInfoList _Notes; - public ItemInfoList Notes - { get { return Lookup(4,ref _Notes); } } - private ItemInfoList _RNOs; - public ItemInfoList RNOs - { get { return Lookup(5,ref _RNOs); } } - private ItemInfoList _Steps; - public ItemInfoList Steps - { get { return Lookup(6,ref _Steps); } } - private ItemInfoList _Tables; - public ItemInfoList Tables - { get { return Lookup(7,ref _Tables); } } - //public void ResetChildren() - //{ - // _Procedures = null; - // _Sections = null; - // _Steps = null; - // _Cautions = null; - // _Notes = null; - // _RNOs = null; - // _Steps = null; - // _Tables = null; - //} - //public XmlDocument ToXml() - //{ - // XmlDocument retval = new XmlDocument(); - // retval.LoadXml(""); - // return ToXml(retval.DocumentElement); - //} - //public void AddList(XmlNode xn,string name, ItemInfoList itemInfoList) - //{ - // if (itemInfoList != null) - // { - // XmlNode nd = xn.OwnerDocument.CreateElement(name); - // xn.AppendChild(nd); - // itemInfoList.ToXml(xn); - // } - //} - //public XmlDocument ToXml(XmlNode xn) - //{ - // XmlNode nd = MyContent.ToXml(xn); - // // Now add the children - // AddList(nd, "Procedures", Procedures); - // AddList(nd, "Sections", Sections); - // AddList(nd, "Cautions", Cautions); - // AddList(nd, "Notes", Notes); - // AddList(nd, "RNOs", RNOs); - // AddList(nd, "Steps", SubItems); - // AddList(nd, "Tables", Tables); - // return xn.OwnerDocument; - //} - #endregion - #region UI Tab - public string TabToolTip - { - get - { - if (MyContent.MyEntry == null) - return DisplayNumber + " - " + DisplayText; - string toolTip = MyProcedure.TabToolTip + "\r\n"; - if (MyContent.Number != "") - toolTip += DisplayNumber + " - " + DisplayText; - else - toolTip += DisplayText; - DocumentInfo myDocument = MyContent.MyEntry.MyDocument; - if (myDocument.LibTitle != "") - { - toolTip += string.Format("\r\n(Library Document - {0})\r\n", myDocument.LibTitle); - toolTip += myDocument.LibraryDocumentUsage; - } - return toolTip; - } - } - public string TabTitle - { - get - { - if (MyContent.MyEntry == null) - if(DisplayNumber == string.Empty) - return DisplayText.Replace("\u2011", "-").Split(" ,.;:-_".ToCharArray())[0] + "..."; - return DisplayNumber.Replace("\u2011","-"); - if (MyContent.Number != "") - return ((MyContent.MyEntry.MyDocument.LibTitle ?? "") == "" ? "" : "\u1D38\u1D35\u1D2E ") + DisplayNumber; - if (MyContent.MyEntry.MyDocument.LibTitle != "") - { - if (DisplayText.Length <= 7) return "\u1D38\u1D35\u1D2E " + DisplayText.Replace("\u2011", "-"); - return "\u1D38\u1D35\u1D2E " + DisplayText.Replace("\u2011", "-").Split(" ,.;:-_".ToCharArray())[0] + "..."; - } - if (DisplayText.Length <= 10) - return DisplayText.Replace("\u2011", "-"); - return DisplayText.Replace("\u2011", "-").Split(" ,.;:-_".ToCharArray())[0]+ "..."; - } - } - #endregion - #region Change Bar - public bool HasChangeBar - { - get - { - if (this.IsAccPages || this.IsProcedure || this.IsSection) return false; - StepInfo si = this as StepInfo; - if (si == null) return false; - StepConfig sc = si.MyConfig as StepConfig; - if (sc == null) return false; - // if there is no override & return whether there was a change to the text. - if (sc.Step_CBOverride == null) - return (MyContent.DTS > MyProcedure.DTS); - else // override is on: - return (sc.Step_CBOverride == "On"); - } - } - #endregion - #region IVEReadOnlyItem - PartInfoList _PartInfoList; - public System.Collections.IList GetChildren() - { - _PartInfoList = this.MyContent.ContentParts; - if (_PartInfoList.Count == 1 && ((IsProcedure && _PartInfoList[0].ToString() == "Sections") || _PartInfoList[0].ToString() == "Steps")) - return _PartInfoList[0].GetChildren(); - return _PartInfoList; - } - public System.Collections.IList GetChildren(bool allParts) - { - _PartInfoList = this.MyContent.ContentParts; - if (allParts) - { - if (_PartInfoList.Count == 1 && ((IsProcedure && _PartInfoList[0].ToString() == "Sections") || _PartInfoList[0].ToString() == "Steps")) - - return _PartInfoList[0].GetChildren(); - return _PartInfoList; - } - else // Steps and Sections only - { - for(int i = 0;i<_PartInfoList.Count;i++) - if(_PartInfoList[i].ToString() == "Sections" || _PartInfoList[i].ToString() == "Steps") - return _PartInfoList[i].GetChildren(); - return null; - } - } - //public bool ChildrenAreLoaded - //{ - // get { return _PartInfoList == null; } - //} - public bool HasChildren - { - get { return this.MyContent.ContentPartCount > 0; } - } - public bool HasWordContent - { - get { return this.MyContent.MyEntry != null; } - } - public bool HasStepContent - { - get - { - if (MyContent.ContentPartCount == 0) return false; - if (MyContent.ContentPartCount == 1 && MyContent.ContentParts[0].PartType == E_FromType.Section) return false; - return true; - } - } - public ProcedureInfo MyProcedure - { - get - { - // Walk up active parents until the parent is not an item - ItemInfo tmp = this; - while (tmp.ActiveParent != null && tmp.ActiveParent.GetType() != typeof(DocVersionInfo)) - tmp = (ItemInfo)tmp.ActiveParent; - if (tmp is ProcedureInfo) - return tmp as ProcedureInfo; - return ProcedureInfo.Get(tmp.ItemID); - } - } - private ItemInfo _MyHLS = null; - public ItemInfo MyHLS - { - get - { - if (_MyHLS == null) - { - if (IsHigh) _MyHLS = this; - else - { - if(MyActiveParent is ItemInfo) - _MyHLS = ((ItemInfo)MyActiveParent).MyHLS; - } - } - return _MyHLS; - } - } - - private DocVersionInfo _MyDocVersion = null; - - public DocVersionInfo MyDocVersion - { - get - { - if (_MyDocVersion == null) - { - if (ActiveParent is DocVersionInfo) - _MyDocVersion = ActiveParent as DocVersionInfo; - else - _MyDocVersion = (ActiveParent as ItemInfo).MyDocVersion; - } - return _MyDocVersion; - } - } - private IVEDrillDownReadOnly _ActiveParent = null; - public IVEDrillDownReadOnly MyActiveParent { get { return _ActiveParent; } } - public IVEDrillDownReadOnly ActiveParent - { - get - { - //if (_ActiveParent == this)_ActiveParent = null; - if (_ActiveParent == null) - { - if (MyPrevious != null) - _ActiveParent = _MyPrevious.ActiveParent; - else - { - if (this.ItemDocVersions != null && this.ItemDocVersions.Count > 0) - _ActiveParent = this.ItemDocVersions[0]; - else - { - //The following using command caused a cached iteminfo to be disposed. - //using (ContentInfo parentContent = ParentContent) - //{ - ContentInfo parentContent = ParentContent; - if (parentContent == null)// || parentContent.ContentItemCount == 0) - _ActiveParent = this; - else - { - int itemID = 0; - if (parentContent.ContentItems.Count == 0) - parentContent.RefreshContentItems(); - using(ItemInfoList list = parentContent.ContentItems) - itemID = list[0].ItemID; - if (itemID == 0) - _ActiveParent = this; - else - _ActiveParent = ItemInfo.Get(itemID); - } - //} - } - } - } - return _ActiveParent==this ? null : _ActiveParent; - } - internal set - //set - { - _ActiveParent = value; - } - } - private ItemInfo _ActiveSection = null; - /// - /// MyActiveSection is used to determine if _ActiveSection is null or not. - /// - public ItemInfo MyActiveSection { get { return _ActiveSection; } } - public ItemInfo ActiveSection - { - get - { - if (_ActiveSection == null) - { - if (IsSection) - _ActiveSection = this; - else - { - ItemInfo parent = ActiveParent as ItemInfo; - if (parent != null) - _ActiveSection = parent.ActiveSection; - else - _ActiveSection = this; - } - } - return _ActiveSection.IsSection ? _ActiveSection : null; - } - set - { - _ActiveSection = value; - } - } - //private int _PageNumForDocStyle = 0; - //public int PageNumForDocStyle - //{ - // get { return _PageNumForDocStyle; } - // set { _PageNumForDocStyle = value; } - //} - private DocStyle _MyDocStyle; - //private DocStyle _MyDocStyleOtherThanFirstPage; - public DocStyle MyDocStyle - { - get - { - if (_MyDocStyle == null && ActiveSection != null) - { - int typ = (int)ActiveSection.MyContent.Type; - int subtyp = typ % 10000; - _MyDocStyle = ActiveFormat.PlantFormat.DocStyles.DocStyleList[subtyp]; - // if (((MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnFirstPage) != 0) && PageNumForDocStyle > 1) - // { - // if (_MyDocStyleOtherThanFirstPage == null) - // { - // foreach (DocStyle ds in ActiveFormat.PlantFormat.DocStyles.DocStyleList) - // { - // if ((ds.StructureStyle.Where & E_DocStyleUse.UseOnAllButFirstPage) != 0) - // { - // _MyDocStyleOtherThanFirstPage = ds; - // break; - // } - // } - // } - // } - } - //if (PageNumForDocStyle <= 1) - return _MyDocStyle; - //else - // return _MyDocStyleOtherThanFirstPage; - } - } - private FormatInfo _ActiveFormat = null; - public FormatInfo ActiveFormat - { - get - { - //if (_ActiveFormat == null) // jsj added check for NULL ActiveParent - _ActiveFormat = (LocalFormat != null ? LocalFormat : (ActiveParent != null)? ActiveParent.ActiveFormat : null); - //Console.WriteLine("Active {0}", (_ActiveFormat == null) ? "_ActiveFormat is null" : _ActiveFormat.Name); - return _ActiveFormat; - } - //get { return LocalFormat != null ? LocalFormat : ActiveParent.ActiveFormat; } - } - public FormatInfo LocalFormat - { - get { - //Console.WriteLine("Local {0}", (MyContent.MyFormat==null)?"MYformat is null": MyContent.MyFormat.Name); - return MyContent.MyFormat; } - } - private bool _IsDeleted = false; - public bool IsDeleted - { - get { return _IsDeleted; } - set - { - _IsDeleted = value; - if (value == true) - UpdateCacheIsDeleted(ItemID); - } - } - private static void UpdateCacheIsDeleted(int itemID) - { - ConvertListToDictionary(); - string key = itemID.ToString(); - if (key != null && _CacheByPrimaryKey.ContainsKey(key)) - { - ItemInfo[] items = _CacheByPrimaryKey[key].ToArray(); - foreach (ItemInfo item in items) - item._IsDeleted = true; - } - } - private ConfigDynamicTypeDescriptor _MyConfig = null; - public ConfigDynamicTypeDescriptor MyConfig - { - get - { - if (_MyConfig == null) - { - switch (MyContent.Type / 10000) - { - case 0: - _MyConfig = new ProcedureConfig(MyContent.Config); - break; - case 1: - _MyConfig = new SectionConfig(MyContent.Config); - if (ItemID == 317) - Console.WriteLine("Myconfig: id = {0}, column mode = {1}", MyItemInfoUnique, (_MyConfig as SectionConfig).Section_ColumnMode); - break; - case 2: - _MyConfig = new StepConfig(MyContent.Config); - break; - } - } - return _MyConfig; - } - set - { - if (_MyConfig == null) return; - _MyConfig = null; - //MyContent.Config = value; - } - } - public void RefreshConfig() - { - Console.WriteLine("refreshconfig: Itemid = {0}", ItemID); - string key = ItemID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ItemInfo tmpInfo in _CacheByPrimaryKey[key]) - { - if (tmpInfo.ItemID == 317) Console.WriteLine("RefreshConfig: id = {0}", tmpInfo.MyItemInfoUnique); - tmpInfo.MyConfig = null; - } - } - static public void RefreshConfig(string key) - { - Console.WriteLine("Static refreshconfig: Itemid = {0}", key); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ItemInfo tmpInfo in _CacheByPrimaryKey[key]) - { - if (tmpInfo.ItemID == 317) Console.WriteLine("Static RefreshConfig: id = {0}", tmpInfo.MyItemInfoUnique); - tmpInfo.MyConfig = null; - } - } - //public bool HasStandardSteps() - //{ return MyContent.ContentItemCount > 1; } - public Color ForeColor - { get { return (HasBrokenRules != null ? Color.Red : (MyContent.ContentItemCount > 1 ? Color.Blue : Color.Black)); } } - public Color BackColor - { get { return (ItemAnnotationCount > 0 ? Color.Yellow : Color.White); } } - #endregion - #region Constructor - internal ItemInfo(SafeDataReader dr, bool forIRichtem) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - AddContent(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfo.Constructor", ex); - throw new DbCslaException("ItemInfo.Constructor", ex); - } - } - internal void AddContent(SafeDataReader dr) - { - _MyContent = new ContentInfo(dr, true); - } - #endregion - #region MetaTags - Tabs, Headers, Footers - [NonSerialized] - protected Tab _MyTab; - public Tab MyTab - { - get - { - if (!_TagsSetup) SetupTags(); - return _MyTab; - } - set - { - _MyTab = value; - } - } - [NonSerialized] - protected MetaTag _MyHeader; - public MetaTag MyHeader - { - get - { - if (!_TagsSetup) SetupTags(); - return _MyHeader; - } - set - { - _MyHeader = value; - } - } - [NonSerialized] - protected MetaTag _MyFooter; - public MetaTag MyFooter - { - get - { - if (!_TagsSetup) SetupTags(); - return _MyFooter; - } - set { _MyFooter = value; } - } - [NonSerialized] - protected bool _TagsSetup = false; - public virtual void SetupTags() - { - if (IsStep) - { - MyTab = new Tab(AdjustForTextSubFollowsTextStyle(FormatStepData.TabData.Font)); - _MyHeader = new MetaTag(FormatStepData.TabData.Font); - _MyFooter = new MetaTag(FormatStepData.TabData.Font); - SetTabText(); - } - else - { - _MyTab = new Tab(ActiveFormat.PlantFormat.FormatData.Font); - _MyHeader = null; - _MyFooter = null; - _MyTab.CleanText = DisplayNumber; - } - _TagsSetup = true; - } - protected void SetTabText() - { - string cltext = null; - if (IsParagraph) - { - _MyTab.Text = ""; - _MyTab.CleanText = ""; - return; - } - int stepType = (int)(MyContent.Type % 10000); - string tbformat = IsInRNO ? FormatStepData.TabData.RNOIdentPrint : FormatStepData.TabData.IdentPrint; - // rno gets parent tab - if (IsRNOPart) - { - try - { - if ((((ItemInfo)ActiveParent).IsHigh && FormatStepData.NumberHighLevel) || ((!((ItemInfo)ActiveParent).IsHigh) && ((tbformat == null || tbformat == "") && (RNOLevel <= ColumnMode)))) - { - _MyTab.CleanText = ((ItemInfo)ActiveParent).MyTab.CleanText; - _MyTab.Text = ((ItemInfo)ActiveParent).MyTab.Text; - return; - } - } - catch (Exception ex) - { - Console.WriteLine("SetTabText IsRNO error {0}", ex.Message); - } - } - if (tbformat == null) - { - _MyTab.Text = ""; - _MyTab.CleanText = ""; - return; - } - - // account for metasection indenting/tabbing in the 'PrintLevel', i.e. if we have metasection, we may be in - // a subsection. Index into the seqtabs array has to account for metasection level. - int localPrintLevel = PrintLevel; - StepSectionData sd = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData; - if (sd.StepSectionLayoutData.TieTabToLevel && ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections) - { - if (sd.StepSectionLayoutData.ShowSectionTitles - && !MyDocStyle.CancelSectTitle - && !(MyDocStyle.SpecialStepsFoldout && MyDocStyle.UseColSByLevel)) - localPrintLevel = PrintLevel + CurrentSectionLevel(); - } - // Start with basic cases of alpha/numeric/seq: - if (tbformat.IndexOf("{seq}") > -1) - { - SeqTabFmtList seqtabs = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.SeqTabFmtList; - int itmp = (localPrintLevel + PrintBias) % seqtabs.Count; - tbformat = seqtabs[itmp].PrintTabFormat; // seqtab in 16bit, i.e. '. or )' etc. - string tbtoken = seqtabs[localPrintLevel % seqtabs.Count].TabToken; // seqstart in 16bit, number/letter - tbformat = tbformat.Replace("{seq}", tbtoken); - } - - // If token includes 'Wpar', the parent tab prefix's the tab. - if (localPrintLevel > 0 && (tbformat.IndexOf("{numericWpar}") > -1 || tbformat.IndexOf("{alphaWpar}") > -1 || tbformat.IndexOf("{ALPHAWpar}") > -1)) - { - string parentTab = ((ItemInfo)(ActiveParent)).MyTab.CleanText.Trim(); - tbformat = parentTab + (parentTab.EndsWith(".") ? "" : ".") + tbformat.TrimStart(); - } - if (tbformat.IndexOf("#2#") > -1 || tbformat.IndexOf("#1#") > -1) - { - string ofst = tbformat.Substring(0, 3); - _MyTab.Offset = Convert.ToInt32(ofst.Substring(1, 1)); - cltext = tbformat.Replace("#2#", ""); - cltext = cltext.Replace("#1#", ""); - } - // if this is a caution/note type determine where 'NOTE/CAUTION' tab goes, as tab or as 'header' - // and also determine whether the tab itself gets converted to a bullet. - if (IsCaution || IsNote) tbformat = CheckNoteCautionTab(tbformat); - - int ordinal = Ordinal; - bool trimTabStart = false; - if (!IsSection && !IsProcedure && tbformat.IndexOf("{Section Prefix}") >= 0) - { - // if there is a section prefix, trim any spaces from the start of this tab, so we don't have - // a tab that looks like "1. 1" - string tmpsectpref = SectionPrefix(tbformat) ?? string.Empty; - if (ActiveSection.MyTab.CleanText != null && ActiveSection.MyTab.CleanText != "" && tmpsectpref != string.Empty) trimTabStart = true; - tbformat = tbformat.Replace("{Section Prefix}", SectionPrefix(tbformat)); - } - string alpha = AlphabeticalNumbering(ordinal); - tbformat = tbformat.Replace("{alpha}", alpha.ToLower()); - tbformat = tbformat.Replace("{alphaWpar}", alpha.ToLower()); - tbformat = tbformat.Replace("{ALPHA}", alpha); - tbformat = tbformat.Replace("{ALPHAWpar}", alpha); - string roman = RomanNumbering(ordinal); - tbformat = tbformat.Replace("{roman}", roman.ToLower()); - tbformat = tbformat.Replace("{ROMAN}", roman); - tbformat = tbformat.Replace("{numeric}", trimTabStart ? ordinal.ToString() : ordinal.ToString().PadLeft(2)); - tbformat = tbformat.Replace("{numericWpar}", ordinal.ToString()); - - if (tbformat.IndexOf("{!C0}") > -1) // wolf creek uses this to get lines above/below step number - { - cltext = cltext == null ? tbformat.Replace("{!C0}", "") : cltext.Replace("{!C0}", ""); - cltext = cltext + " "; - } - - // "{Null}" was introduced so that inheritance in format files could differentiate between an - // empty string, and null. And also, so that if a tab was null but it's parent had text in the - // tab, don't inherit the parent's tab, use a null. - if (MyPrevious != null && FormatStepData.Sep != null && FormatStepData.Sep != "{Null}") - { - if (_MyHeader == null) _MyHeader = new MetaTag(FormatStepData.TabData.Font); - _MyHeader.Text = FormatStepData.Sep; - _MyHeader.CleanText = StripRtfFormatting(_MyHeader.Text); - _MyHeader.Justify = ContentAlignment.MiddleCenter; - } - #region Non Converted Plants tab TODO - // other possible 'tokens' - // Position offset - do this one here, so don't get background substitution below.. - // ##-3# - Offset of -3 from Parent (FNP) - // "{Pos-3}" - - // Background/Deviation Documents - check for E_PurchaseOptions.(ENHANCEDBACKGROUNDS or ENHANCEDDEVIATIONS) - // # - Related Caution or Note number - // ~ - Linked Step Number - //"{LNK C/N Num}" - //"{LNK Step Num}" - - // Position offset - // \257 - Indent (CALLOWAY BACKGROUNDS) - // Newline within a tab (calbck) - //"{indent}"); - //"{par}"); - - //Macros - // - draws a diamond around the stepnumber - // - A macro - // - // <> - ignored - // \241 - circle macro around step, same as - // Also note, the format files had "<>", these get converted during input in this - // format converter code. - //wkstr = wkstr.Replace("{!asterisk}", "\\fs10 \\b*\\b0"); // was font size 20 in 16-bit - //wkstr = Regex.Replace(wkstr, @"{![.*?]}", @"{!$1}"); - //wkstr = wkstr.Replace("{}", ""); - //if (vefont != null && vefont.HasCircleString2()) wkstr.Insert(0,"{!C0}"); - - //wkstr = wkstr.Replace("ê", @"{Box Step}"); - #endregion - _MyTab.Text = tbformat; - _MyTab.CleanText = cltext != null ? cltext : tbformat; - } - - private string GetToken(string tbformat) - { - int stindx = tbformat.IndexOf("{"); - return (tbformat.Substring(stindx, tbformat.IndexOf("}")-stindx+1)); - } - - public int GetStepLevel(ref int bias) - { - int level = 0; - ItemInfo par = this; - ItemInfo LastRNO = null; - while (par != null && !par.IsSection && !par.IsProcedure && !par.IsHigh) - { - if (par.IsRNOPart) LastRNO = par.MyParent; - if (!par.IsRNOPart && (par.IsSequential || (!(par.IsCaution || par.IsNote) - && ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CountAllSubLevels))) - level++; - par = par.MyParent; - } - bias = 0; - if (par.FormatStepData.TabData.IdentPrint.Contains("{ALPHA}")) - level--; - - // ImperfectStructure is used so that the sequential numbering for substeps under an RNO is not same - // numbering (alpha vs numeric), if the HLS has substeps - WCN uses this, as well as other plants. - if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectStructure && IsSequential - && (LastRNO != null) && LastRNO.IsHigh && LastRNO.HasChildren - && LastRNO.FirstChild(E_FromType.Step) != null && LastRNO.FirstChild(E_FromType.Step).IsSequential) - { - level++; // 16bit has this: I didn't and mine worked most of time. - if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectStructurePlus4) level += 2; - if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectSubstep && !ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectStructurePlus4) - bias = -1; - } - // ImperfectStructure for substeps - only good for level 1 RNOs - else if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectSubstep && RNOLevel == 1) - { - par = this; - while (!par.IsRNOPart) par = par.MyParent; // get to the rno. - if (par.MyParent.HasChildren) // if parent has children? - { - ItemInfo tchild = par.MyParent.FirstChild(E_FromType.Step); - if (tchild != null) - { - int typ = (int)tchild.MyContent.Type - 20000; - if (ActiveFormat.PlantFormat.FormatData.StepDataList[typ].TabData.IdentPrint.Contains("{seq}")) - { - level++; - if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectStructurePlus4) level += 1; - if (!ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ImperfectStructurePlus4) bias = -1; - } - } - } - } - return level; - } - public int CurrentSectionLevel() - { - int countlev = 0; - if ((MyActiveSection.MyDocStyle.StructureStyle.Style ?? 0 & E_DocStructStyle.DSS_TreatAsTrueSectNum) != 0) - { - ItemInfo ii = ActiveSection.MyParent; - while (!ii.IsProcedure) - { - if (ii.DisplayNumber != null && ii.DisplayNumber != "") - { - SectionConfig sc = MyActiveSection.MyConfig as SectionConfig; - if (sc != null && sc.SubSection_AutoIndent == "Y") - countlev++; - } - ii = ii.MyParent; - } - } - return countlev; - } - private string SectionPrefix(string tbformat) - { - // if not metasection/tietabtolevel, return the 'section number'. (where the '.' may or may not exist) - if (!ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel) - { - // If the Section's 'tab' is a character or has a character preceding the '.' is an alpha character, - // just return the alpha (no '.') - // If the character preceding the '. 'is a number, return the section tab up to and including the '.' - // Otherwise, just return the section tab. - // Before checking for anything, if the DisplayNumber starts with 'ATTACHMENT ', don't use that in the Section - // prefix for the tabstring. - string attNum = ActiveSection.DisplayNumber.ToUpper().StartsWith("ATTACHMENT ") ? ActiveSection.DisplayNumber.Substring(11) : ActiveSection.DisplayNumber; - Match m = Regex.Match(attNum, @"[a-zA-Z]"); // for alpha, use non-touched displaynumber - int indx = -1; - if (m.Success) - { - indx = attNum.IndexOf("."); - if (indx < 0) return attNum; - return attNum.Substring(0, indx); - } - indx = ActiveSection.MyTab.CleanText.IndexOf("."); - if (indx > 0) return ActiveSection.MyTab.CleanText.Substring(0, indx + 1); // include the '.' - return ActiveSection.MyTab.CleanText.TrimEnd(); - } - - // the rest of this is for metasections (tietabtolevel format flag) - - SectionInfo si = SectionInfo.Get(ActiveSection.ItemID); - // A 'TrueSectionNum' must have a '.' and cannot have lettters after the '.'. - if (si != null && si.TrueSectionNum()) - { - string attNum = ActiveSection.DisplayNumber; // ActiveSection.DisplayNumber.ToUpper().StartsWith("ATTACHMENT ") ? ActiveSection.DisplayNumber.Substring(11) : ActiveSection.DisplayNumber; - // If section number is of form '1.0', return '1.' - if (attNum.Length > 1 && attNum[attNum.Length - 1] == '0' && attNum[attNum.Length - 2] == '.') - return attNum.Substring(0, attNum.Length - 1); - // If section number is of form '1', return '1.' - else if (attNum.Length > 0 && attNum[attNum.Length - 1] != '.') - return attNum + '.'; - } - // For the docstyle flag DSS_TreatAsTrueSectNum, look for last space, and if one is - // found, the the Section Prefix is the text after the space with a '.' appended - for - // example, 'Attachment A' becomes 'A.'. - if ((MyDocStyle.StructureStyle.Style ?? 0 & E_DocStructStyle.DSS_TreatAsTrueSectNum) != 0) - { - int lindx = ActiveSection.DisplayNumber.LastIndexOf(" "); - if (lindx > 0) - { - return ActiveSection.DisplayNumber.Substring(lindx + 1) + "."; - } - } - - // If we're in a subsection, be sure there is a '.' at the end. - int subsection = CurrentSectionLevel(); - if (subsection >= 1) - { - string tmptab = ActiveSection.MyTab.CleanText.TrimEnd(); - if (tmptab.LastIndexOf(".") != tmptab.Length - 1) tmptab = tmptab + "."; - return tmptab; - } - return ActiveSection.MyTab.CleanText.TrimEnd(); - } - - private string CheckNoteCautionTab(string tbformat) - { - string prevTbFormat = null; - string nextTbFormat = null; - StepData nextStepData = null; - if (MyPrevious != null) - { - // int prevStepType = ((int)MyPrevious.MyContent.Type) % 10000; - StepData prevStepData = MyPrevious.FormatStepData; // ActiveFormat.PlantFormat.FormatData.StepDataList[prevStepType]; - prevTbFormat = MyPrevious.IsInRNO ? prevStepData.TabData.RNOIdentPrint : prevStepData.TabData.IdentPrint; - } - if (NextItem != null) - { - nextStepData = NextItem.FormatStepData; - // tried to duplicate functionality from 16-bit code. - nextTbFormat = NextItem.IsInRNO ? nextStepData.TabData.RNOIdentPrint : nextStepData.TabData.IdentPrint; - } - // Handle the centered tab - if this tab is centered make it a header. - if (FormatStepData.TabData.Justify == "Center") - { - _MyHeader.Justify = ContentAlignment.MiddleCenter; - _MyHeader.Text = tbformat.Trim(); ; - _MyHeader.CleanText = StripRtfFormatting(_MyHeader.Text); - // if there is only step in the group - no bullet is used, if more that one replace the tab - // with a bullet. Also, if only one in group and tab text ends with 'S', remove it: - if (MyPrevious == null && NextItem == null) - { - if (_MyHeader.CleanText.ToUpper().EndsWith("S")) - { - string origTxt = _MyHeader.CleanText; - _MyHeader.CleanText = _MyHeader.CleanText.Substring(0, _MyHeader.CleanText.Length - 1); - // Text may have rtf commands: - _MyHeader.Text = _MyHeader.Text.Replace(origTxt, _MyHeader.CleanText); - } - tbformat = ""; - } - else - { - if (MyPrevious != null) _MyHeader = null; - tbformat = ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB; - TabToIdentBAdjustFont(); - - } - return tbformat; - } - - // If this has a previous, and the tabs of this & previous match - if (tbformat != null && MyPrevious != null && !FormatStepData.AlwaysTab && (!FormatStepData.MixCautionsAndNotes || (tbformat == prevTbFormat))) - { - tbformat = tbformat + ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB; - TabToIdentBAdjustFont(); - } - // else if this has a next - else if (tbformat != null && NextItem != null && !FormatStepData.AlwaysTab && - (!FormatStepData.MixCautionsAndNotes || - (FormatStepData.TabData.UsePreviousStyle && !nextStepData.TabData.UsePreviousStyle && tbformat == nextTbFormat) || - ((prevTbFormat != tbformat && (NextItem.MyContent.Type == (int)(MyContent.Type % 10000)))))) - { - tbformat = tbformat + ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB; - _MyTab.RemovedStyleUnderline = true; - TabToIdentBAdjustFont(); - } - return tbformat; - } - - private void TabToIdentBAdjustFont() - { - if ((FormatStepData.TabData.Font.Style & E_Style.Underline) > 0) - { - FontStyle style = FontStyle.Regular; - if ((FormatStepData.TabData.Font.Style & E_Style.Bold) > 0) style |= FontStyle.Bold; - if ((FormatStepData.TabData.Font.Style & E_Style.Italics) > 0) style |= FontStyle.Italic; - _MyTab.MyFont.WindowsFont = new Font(FormatStepData.TabData.Font.WindowsFont.FontFamily, FormatStepData.TabData.Font.WindowsFont.Size, style); - } - } - private string AlphabeticalNumbering(int number) - { - string retval = string.Empty; - if (number > 26) retval += Letter((number - 1) / 26); - retval += Letter(1 + ((number - 1) % 26)); - return retval; - } - private string Letter(int number) - { - char c = (char)(number + 64); - return c.ToString(); - } - private enum RomanOffset : int - { - Hundreds = 2, - Tens = 4, - Units = 6 - } - private string _Romans = "MDCLXVI"; - private string RomanPart(RomanOffset offset, int value) - { - int iFive = value / 5; - int iUnits = value % 5; - int iFour = iUnits / 4; - return _Romans.Substring(((int)offset), iFour) + - _Romans.Substring(((int)offset) - iFive - iFour, iFive | iFour) + - "".PadRight(iUnits % 4, _Romans[((int)offset)]); - } - private string RomanNumbering(int number) - { - int thousands = number / 1000; - int hundreds = (number % 1000) / 100; - int tens = (number % 100) / 10; - int units = number % 10; - return "".PadRight(thousands, _Romans[0]) + - RomanPart(RomanOffset.Hundreds, hundreds) + - RomanPart(RomanOffset.Tens, tens) + - RomanPart(RomanOffset.Units, units); - } - public static void ResetTabString(int itemID) - { - ConvertListToDictionary(); - string key = itemID.ToString(); - if (key != null && _CacheByPrimaryKey.ContainsKey(key)) - { - ItemInfo[] items = _CacheByPrimaryKey[key].ToArray(); - foreach (ItemInfo item in items) - { - item._TagsSetup = false; - } - } - } - #endregion - #region ParentNoteOrCaution - private bool _ParentNoteOrCautionLoaded = false; - private ItemInfo _ParentNoteOrCaution; - public ItemInfo ParentNoteOrCaution - { - get - { - if (!_ParentNoteOrCautionLoaded) - { - ItemInfo parent = ActiveParent as ItemInfo; - if (parent != null) - { - if (parent.IsCautionPart || parent.IsNotePart) - _ParentNoteOrCaution = parent; - else if(!parent.IsHigh) - { - _ParentNoteOrCaution = parent.ParentNoteOrCaution; - } - } - _ParentNoteOrCautionLoaded = true; - } - return _ParentNoteOrCaution; - } - } - #endregion - #region Macro List - [NonSerialized] - protected List _MyMacros; - protected bool _MacrosSetup = false; - public List MyMacros - { - get - { - if (!_MacrosSetup) SetupMacros(); - return _MyMacros; - } - set - { - _MyMacros = value; - } - } - private void SetupMacros() - { - if (FormatStepData == null) return; - // see if each macro should be printed based on its attributes and the item we're on. - // Attributes to check are NotInRNO, i.e. only add this macro to the result list if - // the item is not in the RNO column. Also, Groupings is used to only have the macro if - // there are N or more of the type in the grouping. - List tmp = new List(); - StepData myStepData = (FormatStepData.TextSubFollowsTextStyle && ParentNoteOrCaution != null) ? ParentNoteOrCaution.FormatStepData : FormatStepData; - // foreach (Macro macro in ActiveFormat.PlantFormat.FormatData.StepDataList[FormatStepType].TabData.MacroList) - foreach (Macro macro in myStepData.TabData.MacroList) - { - bool addToList = true; - if (macro.NotInRNO && IsInRNO) addToList = false; - if (macro.Grouping != null && macro.Grouping > 0) - { - int count = 0; - ItemInfo ii = FirstSibling; - while (ii != null) - { - if (ii.MyContent.Type == MyContent.Type) count++; - ii = ii.NextItem; - } - if (count <= macro.Grouping) addToList = false; - } - if (addToList) tmp.Add(macro); - } - if (tmp.Count > 0) _MyMacros = tmp; - } - #endregion - #region CheckOffs - private string _SectionCheckOffHeader; - public string SectionCheckOffHeader - { - get - { - if (_SectionCheckOffHeader == null) - { - // first check if format has checkoff data, including checkoffheaders. - ProcData pd = ActiveFormat.PlantFormat.FormatData.ProcData; - if (pd.CheckOffData == null || pd.CheckOffData.CheckOffHeaderList == null || pd.CheckOffData.CheckOffHeaderList.Count <= 1) _SectionCheckOffHeader = string.Empty; - else - { - SectionConfig sc = ActiveSection.MyConfig as SectionConfig; - if (sc == null) _SectionCheckOffHeader = string.Empty; - else if (sc.Section_CheckoffHeaderSelection <= 0) _SectionCheckOffHeader = string.Empty; - else - { - _SectionCheckOffHeader = pd.CheckOffData.CheckOffHeaderList[sc.Section_CheckoffHeaderSelection].CheckOffHeading; - if (_SectionCheckOffHeader.Contains("{NO HEADING}")) _SectionCheckOffHeader = string.Empty; - } - } - } - return _SectionCheckOffHeader; - } - } - public bool SectionHasCheckOffs() - { - // To determine if the section has a checkoff... - // Section won't have checkoffs if there is no checkofflist, or - ProcData pd = ActiveFormat.PlantFormat.FormatData.ProcData; - if (pd.CheckOffData == null || pd.CheckOffData.CheckOffList == null || pd.CheckOffData.CheckOffList.Count <= 0) return false; - if (pd.CheckOffData.CheckOffHeaderList == null || pd.CheckOffData.CheckOffHeaderList.Count <= 1) return true; - //if (pd.CheckOffData == null || pd.CheckOffData.CheckOffHeaderList == null || pd.CheckOffData.CheckOffHeaderList.Count <= 1) return false; - - // To find whether the step has a checkoff, first check that the section - // has a check off header. If it doesn't, just return -1. - // if config item is set for checkoffindex, use it. If it == 0, then use - // the section default. - SectionConfig sc = ActiveSection.MyConfig as SectionConfig; - if (sc == null) return false; - if (sc.Section_CheckoffHeaderSelection < 0) return false; - return true; - } - private int CheckOffIndex() - { - StepConfig stc = MyConfig as StepConfig; - if (stc == null) return 0; //section default. - if (stc != null && stc.Step_CheckOffIndex == 1) return -1; // index of 1, always means 'No Checkoff' - return stc.Step_CheckOffIndex; - } - private int SectionDefaultCheckOffIndex() - { - ProcData pd = ActiveFormat.PlantFormat.FormatData.ProcData; - if (pd.CheckOffData != null && pd.CheckOffData.CheckOffList != null && pd.CheckOffData.CheckOffList.Count == 2) return 0; // if only two items, first is macro - use it. - SectionConfig sc = ActiveSection.MyConfig as SectionConfig; - return sc.Section_CheckoffListSelection; - } - public CheckOff GetCheckOffStep() - { - if (!IsStep || !SectionHasCheckOffs()) return null; - int stpCoIndx = CheckOffIndex(); // this step has a checkoff defined - if (stpCoIndx == -1) return null; - if (stpCoIndx > 1) return ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList[stpCoIndx]; - 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() && !RNOsHighHasCheckOff())) - return ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList[sectCoIndx]; - return null; - } - private bool IsLowestLevelStep() - { - // This test only checks if using the section default, otherwise the code above, uses what the checkoff - // that is set in the config. - StepConfig stc = MyConfig as StepConfig; - if (stc != null && stc.Step_CheckOffIndex == 0) - { - if (!(IsCaution || IsNote || IsTable || Steps != null || MyParent.IsCaution || MyParent.IsNote)) return true; - } - return false; - } - private bool RNOsHighHasCheckOff() - { - // If this is a High Level Step's RNO, the checkoff would be placed on the HLS, not the RNO. - if (IsRNOPart && MyParent.IsHigh && MyParent.CheckOffIndex() != -1) return true; - return false; - } - #endregion - #region JCB Item Status - private bool _IsItemNew = false; - public bool IsItemNew - { - get - { - ProcedureInfo pi = this.MyProcedure; - if (pi != null) - _IsItemNew = (this.DTS > pi.DTS); - return _IsItemNew; - } - } - private bool _IsItemChanged; - public bool IsItemChanged - { - get - { - ProcedureInfo pi = this.MyProcedure; - if (pi != null) - _IsItemChanged = (this.MyContent.DTS > pi.DTS); - return _IsItemChanged; - } - } - #endregion - } - #endregion ItemInfo - #region Tab - public class MetaTag - { - public VE_Font MyFont; - public ContentAlignment Justify = ContentAlignment.MiddleLeft; - public string Text; // may include tokens, such as macros for circles/diamonds, etc - public string CleanText; // all tokens removed - public MetaTag() - { - } - public MetaTag(VE_Font font) - { - MyFont = new VE_Font(font.XmlNode); - } - } - public class Tab : MetaTag - { - private bool _RemovedStyleUnderline = false; - public bool RemovedStyleUnderline - { - get { return _RemovedStyleUnderline; } - set { _RemovedStyleUnderline = value; } - } - public Tab(VE_Font font) - { - MyFont = font; - } - public int Offset; - private static Regex _ReplaceSymbols = new Regex("^[^0-9A-Za-z]*"); // trim anything that isn't an ascii alpha/numeric from the beginning - public string CleanTextNoSymbols - { - get - { - // this trims off any symbols at the start of the tab - return _ReplaceSymbols.Replace(CleanText, ""); - } - } - - } - public class Header : MetaTag - { - } - #endregion - #region ItemInfoList - public partial class ItemInfoList - { - //public void ToXml(XmlNode xn) - //{ - // foreach (ItemInfo itemInfo in this) - // { - // itemInfo.ToXml(xn); - // } - //} - internal ItemInfoList(ItemInfo itemInfo) - { - AddItem(itemInfo); - } - public static ItemInfoList GetList(int? itemID,int type) - { - try - { - ItemInfoList tmp = DataPortal.Fetch(new ItemListCriteria(itemID,type)); - ItemInfo.AddList(tmp); - tmp.AddEvents(); -#if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList - ContentInfoList.GetList(itemID); // Performance - Load All Content -#endif - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetChildren", ex); - } - } - public static ItemInfoList GetListByPartType(E_FromType fromType) - { - try - { - ItemInfoList tmp = DataPortal.Fetch(new ItemListPartTypeCriteria(fromType)); - ItemInfo.AddList(tmp); - tmp.AddEvents(); -#if (!ItemWithContent) // If ItemWithContent is set, the content is returned with the ItemInfoList - ContentInfoList.GetList(itemID); // Performance - Load All Content -#endif - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetChildren", ex); - } - } - [Serializable()] - private class ItemListCriteria - { - public ItemListCriteria(int? itemID,int type) - { - _ItemID = itemID; - _Type = type; - } - private int? _ItemID; - public int? ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - private int _Type; - public int Type - { - get { return _Type; } - set { _Type = value; } - } - } - [Serializable()] - private class ItemListPartTypeCriteria - { - public ItemListPartTypeCriteria(E_FromType type) - { - _Type = type; - } - private E_FromType _Type; - public E_FromType Type - { - get { return _Type; } - set { _Type = value; } - } - } - private void DataPortal_Fetch(ItemListCriteria criteria) - { - this.RaiseListChangedEvents = false; - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; -#if ItemWithContent - cm.CommandText = "vesp_ListItemsAndContent"; -#else - cm.CommandText = "vesp_ListItems"; -#endif - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) - { - ItemInfo itemInfo = null; - switch ((E_FromType)criteria.Type) - { - case E_FromType.Procedure: - itemInfo = new ProcedureInfo(dr); - break; - case E_FromType.Section: - itemInfo = new SectionInfo(dr); - break; - default: - itemInfo = new StepInfo(dr); - break; - } - IsReadOnly = false; - this.Add(itemInfo); - IsReadOnly = true; - } - } - } - } - } - catch (Exception ex) - { - Database.LogException("ItemInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - private void DataPortal_Fetch(ItemListPartTypeCriteria criteria) - { - this.RaiseListChangedEvents = false; - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; -#if ItemWithContent - cm.CommandText = "getItemsByPartTypeAndContent"; -#else - cm.CommandText = "getItemsByPartType"; -#endif - cm.Parameters.AddWithValue("@FromType", (int) criteria.Type); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) - { - ItemInfo itemInfo = null; - switch (criteria.Type) - { - case E_FromType.Procedure: - itemInfo = new ProcedureInfo(dr); - break; - case E_FromType.Section: - itemInfo = new SectionInfo(dr); - break; - default: - itemInfo = new StepInfo(dr); - break; - } - IsReadOnly = false; - this.Add(itemInfo); - IsReadOnly = true; - } - } - } - } - } - catch (Exception ex) - { - Database.LogException("ItemInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void AddItem(ItemInfo itemInfo) - { - IsReadOnly = false; - this.Add(itemInfo); - IsReadOnly = true; - } - #region Text Search - public static ItemInfoList GetListFromTextSearch(string docVersionList, string stepTypeList, string searchString, int caseSensitive, ItemSearchIncludeLinks includeLinks, bool includeRtfFormatting, bool includeSpecialCharacters, string unitPrefix) - { - try - { - ItemInfoList tmp = DataPortal.Fetch(new ItemListSearchCriteria(docVersionList, stepTypeList, searchString, caseSensitive, includeLinks, includeRtfFormatting, includeSpecialCharacters,unitPrefix)); - ItemInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetListFromTextSearch", ex); - } - } - [Serializable()] - private class ItemListSearchCriteria - { - private string _DocVersionList; - public string DocVersionList - { - get { return _DocVersionList; } - set { _DocVersionList = value; } - } - private string _StepTypeList; - public string StepTypeList - { - get { return _StepTypeList; } - set { _StepTypeList = value; } - } - private string _SearchString; - public string SearchString - { - get { return _SearchString; } - set { _SearchString = value; } - } - private int _CaseSensitive; - public int CaseSensitive - { - get { return _CaseSensitive; } - set { _CaseSensitive = value; } - } - private ItemSearchIncludeLinks _IncludeLinks; - public ItemSearchIncludeLinks IncludeLinks - { - get { return _IncludeLinks; } - set { _IncludeLinks = value; } - } - private bool _IncludeRtfFormatting; - public bool IncludeRtfFormatting - { - get { return _IncludeRtfFormatting; } - set { _IncludeRtfFormatting = value; } - } - private bool _IncludeSpecialCharacters; - public bool IncludeSpecialCharacters - { - get { return _IncludeSpecialCharacters; } - set { _IncludeSpecialCharacters = value; } - } - private string _UnitPrefix; - - public string UnitPrefix - { - get { return _UnitPrefix; } - set { _UnitPrefix = value; } - } - public ItemListSearchCriteria(string docVersionList, string stepTypeList, string searchString, - int caseSensitive, ItemSearchIncludeLinks includeLinks, bool includeRtfFormatting, bool includeSpecialCharacters, string unitPrefix) - { - _DocVersionList = docVersionList; - _StepTypeList = stepTypeList; - _SearchString = searchString; - _CaseSensitive = caseSensitive; - _IncludeLinks = includeLinks; - _IncludeRtfFormatting = includeRtfFormatting; - _IncludeSpecialCharacters = includeSpecialCharacters; - _UnitPrefix = unitPrefix; - } - } - private void DataPortal_Fetch(ItemListSearchCriteria criteria) - { - this.RaiseListChangedEvents = false; - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_SearchItemAndChildrenNew"; - cm.Parameters.AddWithValue("@DocVersionList", criteria.DocVersionList); - cm.Parameters.AddWithValue("@StepTypeList", criteria.StepTypeList); - cm.Parameters.AddWithValue("@SearchString", criteria.SearchString); - cm.Parameters.AddWithValue("@CaseSensitive", criteria.CaseSensitive); - cm.Parameters.AddWithValue("@IncludeLinks", (int) criteria.IncludeLinks); - cm.Parameters.AddWithValue("@IncludeRtfFormatting", criteria.IncludeRtfFormatting ? 1 : 0); - cm.Parameters.AddWithValue("@IncludeSpecialCharacters", criteria.IncludeSpecialCharacters ? 1 : 0); - cm.Parameters.AddWithValue("@UnitPrefix", criteria.UnitPrefix); - cm.CommandTimeout = 120; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) - { - ItemInfo itemInfo = null; - int itemType = dr.GetInt32("Type") / 10000; - switch (itemType) - { - case 0: - itemInfo = new ProcedureInfo(dr); - break; - case 1: - itemInfo = new SectionInfo(dr); - break; - default: - itemInfo = new StepInfo(dr); - break; - } - itemInfo.AddContent(dr); - itemInfo._SearchDVPath = dr.GetString("DVPath"); - itemInfo._SearchPath = dr.GetString("Path"); - IsReadOnly = false; - this.Add(itemInfo); - IsReadOnly = true; - } - } - } - } - } - catch (Exception ex) - { - Database.LogException("ItemInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region RO Search - public static ItemInfoList GetListFromROSearch(string docVersionList, string stepTypeList, string roSearchString, string unitPrefix) - { - try - { - ItemInfoList tmp = DataPortal.Fetch(new ItemListROSearchCriteria(docVersionList, stepTypeList, roSearchString, unitPrefix)); - ItemInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetChildren", ex); - } - } - [Serializable()] - private class ItemListROSearchCriteria - { - private string _DocVersionList; - public string DocVersionList - { - get { return _DocVersionList; } - set { _DocVersionList = value; } - } - private string _StepTypeList; - public string StepTypeList - { - get { return _StepTypeList; } - set { _StepTypeList = value; } - } - private string _ROSearchString; - public string ROSearchString - { - get { return _ROSearchString; } - set { _ROSearchString = value; } - } - private string _UnitPrefix; - public string UnitPrefix - { - get { return _UnitPrefix; } - set { _UnitPrefix = value; } - } - public ItemListROSearchCriteria(string docVersionList, string stepTypeList, string roSearchString, string unitPrefix) - { - _DocVersionList = docVersionList; - _StepTypeList = stepTypeList; - _ROSearchString = roSearchString; - _UnitPrefix = unitPrefix; - } - } - private void DataPortal_Fetch(ItemListROSearchCriteria criteria) - { - this.RaiseListChangedEvents = false; - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_SearchROItemAndChildren"; - cm.Parameters.AddWithValue("@DocVersionList", criteria.DocVersionList); - cm.Parameters.AddWithValue("@StepTypeList", criteria.StepTypeList); - cm.Parameters.AddWithValue("@ROSearchString", criteria.ROSearchString); - cm.Parameters.AddWithValue("@UnitPrefix", criteria.UnitPrefix); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) - { - ItemInfo itemInfo = null; - int itemType = dr.GetInt32("Type") / 10000; - switch (itemType) - { - case 0: - itemInfo = new ProcedureInfo(dr); - break; - case 1: - itemInfo = new SectionInfo(dr); - break; - default: - itemInfo = new StepInfo(dr); - break; - } - itemInfo.AddContent(dr); - itemInfo._SearchDVPath = dr.GetString("DVPath"); - itemInfo._SearchPath = dr.GetString("Path"); - IsReadOnly = false; - this.Add(itemInfo); - IsReadOnly = true; - } - } - } - } - } - catch (Exception ex) - { - Database.LogException("ItemInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region Annotation Search - public static ItemInfoList GetListFromAnnotationSearch(string docVersionList, string stepTypeList, string annotationTypeList, string searchString, bool caseSensitive, string unitPrefix) - { - try - { - ItemInfoList tmp = DataPortal.Fetch(new ItemListAnnotationSearchCriteria(docVersionList, stepTypeList, annotationTypeList, searchString, caseSensitive, unitPrefix)); - ItemInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetChildren", ex); - } - } - [Serializable()] - private class ItemListAnnotationSearchCriteria - { - private string _DocVersionList; - public string DocVersionList - { - get { return _DocVersionList; } - set { _DocVersionList = value; } - } - private string _StepTypeList; - public string StepTypeList - { - get { return _StepTypeList; } - set { _StepTypeList = value; } - } - private string _AnnotationTypeList; - public string AnnotationTypeList - { - get { return _AnnotationTypeList; } - set { _AnnotationTypeList = value; } - } - private string _SearchString; - public string SearchString - { - get { return _SearchString; } - set { _SearchString = value; } - } - private bool _CaseSensitive; - public bool CaseSensitive - { - get { return _CaseSensitive; } - set { _CaseSensitive = value; } - } - private string _UnitPrefix; - public string UnitPrefix - { - get { return _UnitPrefix; } - set { _UnitPrefix = value; } - } - - public ItemListAnnotationSearchCriteria(string docVersionList, string stepTypeList, string annotationTypeList, string searchString, bool caseSensitive, string unitPrefix) - { - _DocVersionList = docVersionList; - _StepTypeList = stepTypeList; - _AnnotationTypeList = annotationTypeList; - _SearchString = searchString; - _CaseSensitive = caseSensitive; - _UnitPrefix = unitPrefix; - } - } - private void DataPortal_Fetch(ItemListAnnotationSearchCriteria criteria) - { - this.RaiseListChangedEvents = false; - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_SearchAnnotationItemAndChildren"; - cm.Parameters.AddWithValue("@DocVersionList", criteria.DocVersionList); - cm.Parameters.AddWithValue("@StepTypeList", criteria.StepTypeList); - cm.Parameters.AddWithValue("@AnnotationTypeList", criteria.AnnotationTypeList); - cm.Parameters.AddWithValue("@SearchString", criteria.SearchString); - cm.Parameters.AddWithValue("@CaseSensitive", criteria.CaseSensitive ? 1 : 0); - cm.Parameters.AddWithValue("@UnitPrefix", criteria.UnitPrefix); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) - { - ItemInfo itemInfo = null; - int itemType = dr.GetInt32("Type") / 10000; - switch (itemType) - { - case 0: - itemInfo = new ProcedureInfo(dr); - break; - case 1: - itemInfo = new SectionInfo(dr); - break; - default: - itemInfo = new StepInfo(dr); - break; - } - itemInfo.AddContent(dr); - itemInfo._SearchDVPath = dr.GetString("DVPath"); - itemInfo._SearchPath = dr.GetString("Path"); - itemInfo._SearchAnnotationID = dr.GetInt32("SearchAnnotationID"); - itemInfo._SearchAnnotationText = dr.GetString("SearchText"); - itemInfo._SearchAnnotationType = dr.GetString("AnnotationType"); - IsReadOnly = false; - this.Add(itemInfo); - IsReadOnly = true; - } - } - } - } - } - catch (Exception ex) - { - Database.LogException("ItemInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - } - #endregion - #region ProcedureInfo - [Serializable()] - public partial class ProcedureInfo : ItemInfo, IVEDrillDownReadOnly - { - public override void SetupTags() - { - base.SetupTags(); - } - protected override void RefreshFields(Item tmp) - { - base.RefreshFields(tmp); - ExtensionRefreshFields(tmp); - } -#if ItemWithContent - public ProcedureInfo(SafeDataReader dr) : base(dr, true) { } -#else - public ProcedureInfo(SafeDataReader dr) : base(dr) { } -#endif - private ProcedureInfo() : base() { ;} - public new static ProcedureInfo Get(int itemID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Item"); - try - { - ProcedureInfo tmp = GetCachedByPrimaryKey(itemID) as ProcedureInfo; - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(itemID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") tmp = null; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Item.Get", ex); - } - } - public void MoveProcedure(IVEDrillDownReadOnly pInfo, int index) - { - using (Item ii = Item.Get(this.ItemID)) - { - ii.MoveItem(pInfo, index); - } - } - public new Procedure Get() - { - return (Procedure) (_Editable = Procedure.Get(ItemID)); - } - #region ProcedureConfig - [NonSerialized] - private ProcedureConfig _ProcedureConfig; - public ProcedureConfig ProcedureConfig - { get { return (_ProcedureConfig != null ? _ProcedureConfig : _ProcedureConfig = new ProcedureConfig(this)); } } - #endregion - public new ConfigDynamicTypeDescriptor MyConfig - { - get { return ProcedureConfig ; } - set { _ProcedureConfig = null; } - } - public DocVersionInfo MyDocVersion - { - get { return ActiveParent as DocVersionInfo; } - } - } - #endregion - #region Procedure - [Serializable()] - public partial class Procedure : Item - { - public ProcedureInfo MyProcedureInfo /* Return Info version of the current Item */ - { get { return ProcedureInfo.Get(ItemID); } } - public new static Procedure Get(int itemID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Item"); - try - { - Item itm = GetCachedByPrimaryKey(itemID); - Procedure tmp = itm as Procedure; - //Procedure tmp = (Procedure)GetExistingByPrimaryKey(itemID); - if (tmp == null) - { - if (itm != null) Console.WriteLine("type = {0}", itm.GetType().Name); - tmp = DataPortal.Fetch(new PKCriteria(itemID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") tmp = null; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Item.Get", ex); - } - } - public new Procedure Save() - { - return (Procedure)base.Save(); - } - public static Procedure MakeProcedure(IVEDrillDownReadOnly parentInfo, ItemInfo previousInfo, string procNumber, string procTitle, int procType) - { - int newitemid = MakeNewItem(parentInfo, previousInfo, procNumber, procTitle, procType, E_FromType.Procedure); - return Procedure.Get(newitemid); - } - #region ProcedureConfig - [NonSerialized] - private ProcedureConfig _ProcedureConfig; - public ProcedureConfig ProcedureConfig - { - get - { - if (_ProcedureConfig == null) - { - _ProcedureConfig = new ProcedureConfig(this); - _ProcedureConfig.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_ProcedureConfig_PropertyChanged); - } - return _ProcedureConfig; - } - } - private void _ProcedureConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) - { - MyContent.Config = _ProcedureConfig.ToString(); - } - #endregion - } - #endregion - #region SectionInfo - [Serializable()] - public partial class SectionInfo : ItemInfo, IVEDrillDownReadOnly - { - public override void SetupTags() - { - MyTab = new Tab(ActiveFormat.PlantFormat.FormatData.SectData.SectionNumber.Font); - string sectTab = GetSectionTab(false); - _MyTab.Text = sectTab; - _MyTab.CleanText = sectTab.PadRight(20); - MyHeader = new MetaTag(ActiveFormat.PlantFormat.FormatData.SectData.SectionHeader.Font); - _MyHeader.Text = null; - MyFooter = null; - _TagsSetup = true; - } - private string GetSectionTab(bool underline) - { - if (DisplayNumber == null || DisplayNumber == "" || !IsStepSection) return DisplayNumber; - if (MyDocStyle.SpecialStepsFoldout) return DisplayNumber; - if (ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel) - { - if (underline) - return @"\ul " + DisplayNumber + @"\ul0 "; - else - return DisplayNumber; - } - string retStr = null; - string ch = DisplayNumber != null && DisplayNumber != "" ? DisplayNumber.Substring(0,1) : null; - int Snum = GetSectionNum(); - if (Snum == -1) - retStr = ch + "."; - else { - string tmp = DisplayNumber.IndexOf(".")>-1?DisplayNumber.Substring(0,DisplayNumber.IndexOf(".")):DisplayNumber; - if (underline) - retStr = @"\ul " + tmp + "." + Snum.ToString() + @"\ul0 "; - else - retStr = tmp + "." + Snum.ToString(); - } - return retStr; - } - - private int GetSectionNum() - { - int indx = -1; - if (DisplayNumber != null && DisplayNumber != "" && (indx = DisplayNumber.IndexOf("."))>-1) - { - // if there is a number after the '.', return it as a number. For example if it is 001, return a 1: - string tmpstr = indx+1 '9') return false; - return true; - } - // the following returns the 'index' into the format's CheckOffHeaderList. - // It returns a -1 if not set or none exist. - public int CheckOffHeadingIndex() - { - if (ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList == null || ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList.Count == 0) return -1; - SectionConfig sc = MyConfig as SectionConfig; - if (sc == null) return -1; - return sc.Section_CheckoffHeaderSelection; - } - protected override void RefreshFields(Item tmp) - { - base.RefreshFields(tmp); - ExtensionRefreshFields(tmp); - } -#if ItemWithContent - public SectionInfo(SafeDataReader dr) : base(dr, true) { } -#else - public SectionInfo(SafeDataReader dr) : base(dr) { } -#endif - private SectionInfo() : base() { ;} - public new static SectionInfo Get(int itemID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Item"); - try - { - SectionInfo tmp = GetCachedByPrimaryKey(itemID) as SectionInfo; - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(itemID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") tmp = null; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Item.Get", ex); - } - } - public void MoveSection(IVEDrillDownReadOnly pInfo, int index) - { - using (Item ii = Item.Get(this.ItemID)) - { - ii.MoveItem(pInfo, index); - } - } - public new Section Get() - { - return (Section)(_Editable = Section.Get(ItemID)); - } - - #region SectionConfig - [NonSerialized] - private SectionConfig _SectionConfig; - public SectionConfig SectionConfig - { get { return (_SectionConfig != null ? _SectionConfig : _SectionConfig = new SectionConfig(this)); } } - #endregion - public new ConfigDynamicTypeDescriptor MyConfig - { - get { return SectionConfig; } - set { _SectionConfig = null; } - } - } - #endregion - #region Section - [Serializable()] - public partial class Section : Item - { - public SectionInfo MySectionInfo /* Return Info version of the current Item */ - { get { return SectionInfo.Get(ItemID); } } - public new static Section Get(int itemID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Item"); - try - { - Section tmp = GetCachedByPrimaryKey(itemID) as Section; - if (tmp == null) - { - tmp = DataPortal.Fetch
(new PKCriteria(itemID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") tmp = null; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Item.Get", ex); - } - } - public new Section Save() - { - return (Section)base.Save(); - } - public static Section MakeSection(IVEDrillDownReadOnly parentInfo, ItemInfo previousInfo, string sectNumber, string sectTitle, int sectType) - { - int newitemid = MakeNewItem(parentInfo, previousInfo, sectNumber, sectTitle, sectType, E_FromType.Section); - return Section.Get(newitemid); - } - #region SectionConfig - [NonSerialized] - private SectionConfig _SectionConfig; - public SectionConfig SectionConfig - { - get - { - if (_SectionConfig == null) - { - _SectionConfig = new SectionConfig(this); - _SectionConfig.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_SectionConfig_PropertyChanged); - } - return _SectionConfig; - } - } - private void _SectionConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) - { - MyContent.Config = _SectionConfig.ToString(); - ItemInfo.RefreshConfig(ItemID.ToString()); - } - #endregion - } - #endregion - #region StepInfo - [Serializable()] - public partial class StepInfo : ItemInfo - { - #region Tab - public override void SetupTags() - { - _TagsSetup = true; - MyTab = new Tab(AdjustForTextSubFollowsTextStyle(FormatStepData.TabData.Font)); - MyHeader = new MetaTag(FormatStepData.TabData.Font); - MyFooter = new MetaTag(FormatStepData.TabData.Font); - SetTabText(); - } - - #endregion - protected override void RefreshFields(Item tmp) - { - base.RefreshFields(tmp); - ExtensionRefreshFields(tmp); - } - //public override string ToString() - //{ - // return "Step " + base.ToString(); - //} -#if ItemWithContent - public StepInfo(SafeDataReader dr) : base(dr, true) { } -#else - public StepInfo(SafeDataReader dr) : base(dr) { } -#endif - private StepInfo() : base() { ;} - public new static StepInfo Get(int itemID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Item"); - try - { - StepInfo tmp = GetCachedByPrimaryKey(itemID) as StepInfo; - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(itemID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") tmp = null; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Item.Get", ex); - } - } - public void MoveStep(IVEDrillDownReadOnly pInfo, int index) - { - using (Item ii = Item.Get(this.ItemID)) - { - ii.MoveItem(pInfo, index); - } - } - public new Step Get() - { - return (Step)(_Editable = Step.Get(ItemID)); - } - //public E_FromType FromType - //{ get { return E_FromType.Step; } } - } - - #endregion - #region Step - [Serializable()] - public partial class Step : Item - { - public new static Step Get(int itemID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Item"); - try - { - Step tmp = (Step)GetCachedByPrimaryKey(itemID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(itemID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") tmp = null; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Item.Get", ex); - } - } - // TODO :MakeCaution; - // TODO :MakeNote; - // TODO :MakeRNO; - // TODO :MakeSection; - // TODO :MakeSubStep; - // TODO :MakeTable; - public static Step MakeStep(IVEDrillDownReadOnly parentInfo, ItemInfo previousInfo, string stepNumber, string stepTitle, int stepType, E_FromType fromType) - { - int newitemid = MakeNewItem(parentInfo, previousInfo, stepNumber, stepTitle, stepType, fromType); - return Step.Get(newitemid); - } - //#region StepConfig - //[NonSerialized] - //private StepConfig _StepConfig; - //public StepConfig StepConfig - //{ - // get - // { - // if (_StepConfig == null) - // { - // _StepConfig = new StepConfig(this); - // _StepConfig.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(_StepConfig_PropertyChanged); - // } - // return _SectionConfig; - // } - //} - //private void _StepConfig_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) - //{ - // MyContent.Config = _StepConfig.ToString(); - //} - //#endregion - } - #endregion - public enum ItemSearchIncludeLinks - { - Nothing = 0, - Value = 1, - Everything =2 - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs.bak b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs.bak deleted file mode 100644 index eebcb8e3..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs.bak +++ /dev/null @@ -1,1081 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Data; -using System.Data.SqlClient; -using System.Text.RegularExpressions; -using Csla; -using Csla.Data; - -namespace VEPROMS.CSLA.Library -{ - public delegate void ItemInfoInsertEvent(object sender, ItemInfoInsertEventArgs args); - public class ItemInfoInsertEventArgs - { - private ItemInfo _ItemInserted; - public ItemInfo ItemInserted - { - get { return _ItemInserted; } - set { _ItemInserted = value; } - } - private ItemInfo.EAddpingPart _AddingPart; - public ItemInfo.EAddpingPart AddingPart - { - get { return _AddingPart; } - set { _AddingPart = value; } - } - public ItemInfoInsertEventArgs(ItemInfo itemInserted,ItemInfo.EAddpingPart addingPart) - { - _ItemInserted = itemInserted; - _AddingPart = addingPart; - } - } - public partial class ItemInfo - { - #region Old Insert - //public ItemInfo InsertSiblingBeforeOld(string text) - //{ - // return InsertSiblingBefore(text, null); - //} - //public ItemInfo InsertSiblingBeforeOld(string text, string number) - //{ - // ItemInfo prevItemInfo = MyPrevious; - // ItemInfo newItemInfo = null; - // PartInfoList partInfoList = null; - // if (MyParent != null && MyParent.MyContent != null) - // { - // MyParent.MyContent.RefreshContentParts(); - // partInfoList = MyParent.MyContent.ContentParts; - // } - // using (Item prevItem = prevItemInfo == null ? null : prevItemInfo.Get()) // Get the previous Item - // { - // using (Item newItem = Item.MakeItem(prevItem, Content.MakeContent(number, text, MyContent.Type, null, null))) // Create the new Item - // { - // using (Item thisItem = Get()) // Get the next item in the list - // { - // thisItem.MyPrevious = newItem; // Point to the new item - // thisItem.Save(); // Save Changes - // if (prevItem == null) - // { - // PartInfo partInfo = partInfoList.Find(this); - // using (Part part = partInfo.Get()) - // { - // part.MyItem = newItem; - // part.Save(); - // } - // } - // } - // // ToDo: Need change PartInfo in PartInfoList - // newItemInfo = ItemInfo.Get(newItem.ItemID); - // newItemInfo.ResetOrdinal(); - // } - // } - // return newItemInfo; - //} - //public ItemInfo InsertSiblingAfterOld(string text) - //{ - // return InsertSiblingAfter(text, null); - //} - //public ItemInfo InsertSiblingAfterOld(string text, string number) - //{ - // return InsertSiblingAfter(text, number, MyContent.Type); - //} - //public ItemInfo InsertSiblingAfterOld(string text, string number, int? type) - //{ - // ItemInfo nextItemInfo = NextItem; - // ItemInfo newItemInfo = null; - // using (Item thisItem = Get()) // Get the Current Item - // { - // using (Item newItem = Item.MakeItem(thisItem, Content.MakeContent(number, text, type, null, null))) // Create the new Item - // { - // if (nextItemInfo != null) // Simple case, adding to end of list: - // using (Item nextItem = nextItemInfo.Get()) // Get the next item in the list - // { - // nextItem.MyPrevious = newItem; // Point to the new item - // nextItem.Save(); // Save Changes - // } - // // ToDo: Need change PartInfo in PartInfoList - // newItemInfo = ItemInfo.Get(newItem.ItemID); - // newItemInfo.ResetOrdinal(); - // } - // } - // return newItemInfo; - //} - //public ItemInfo InsertChildOld(E_FromType fromType, int type, string text) - //{ - // return InsertChild(fromType, type, text, null); - //} - //public ItemInfo InsertChildOld(E_FromType fromType, int type, string text, string number) - //{ - // ItemInfo newItemInfo = null; - // using (Item thisItem = Get()) // Get the Current Item - // { - // using (Item newItem = Item.MakeItem(null, Content.MakeContent(number, text, type, null, null))) // Create the new Item - // { - // PartInfo partInfo = MyContent.ContentParts == null ? null : MyContent.ContentParts.Find(fromType); - // if (partInfo != null) - // { - // //this could be equivalent to adding a sibling with a specific type - // using (Part part = partInfo.Get()) - // { - // part.MyItem.MyPrevious = newItem; - // part.MyItem.Save(); - // part.MyItem = newItem; - // part.Save(); - // } - // } - // else - // { - // // This means that a part needs to be added to point to the new item - // //using (Part part = Part.MakePart(thisItem.MyContent, )) - // //{ ;} - // thisItem.MyContent.ContentParts.Add((int)fromType, newItem); - // thisItem.Save(); - // } - // newItemInfo = ItemInfo.Get(newItem.ItemID); - // } - // } - // ResetParts(); - // return newItemInfo; - //} - #endregion - #region Events - public event ItemInfoEvent BeforeDelete; - public void OnBeforeDelete() - { - OnBeforeDelete(ItemID); - - if (MyContent.ContentPartCount > 0) - { - foreach (PartInfo pi in MyContent.ContentParts) - { - foreach (ItemInfo ii in pi.MyItems) - { - ii.OnBeforeDelete(); - } - } - } - //if (ItemPartCount > 0) - //{ - // foreach (PartInfo pi in ItemParts) - // { - // foreach (ItemInfo ii in pi.MyItems) - // { - // ii.OnBeforeDelete(); - // } - // } - //} - } - - private void OnBeforeDelete(int ItemID) - { - if (_CacheByPrimaryKey.ContainsKey(ItemID.ToString())) - { - List itmlst = _CacheByPrimaryKey[ItemID.ToString()]; - foreach (ItemInfo itm in itmlst) - if (itm.BeforeDelete != null) - { - itm.BeforeDelete(itm); - } - } - } - public static event ItemInfoEvent ItemDeleted; - - public event ItemInfoEvent Deleted; - internal void OnDeleted(object sender) - { - if (Deleted != null) Deleted(sender); - if (ItemDeleted != null) ItemDeleted(sender); - if (MyParent != null) - { - MyParent.OnChildrenDeleted(sender); - MyParent.MyContent.RefreshContentParts(); - } - } - //internal void OnDeleted(object sender, Volian.Base.Library.VlnTimer tmr) - //{ - //tmr.ActiveProcess = "Deleted"; - //if (Deleted != null) Deleted(sender); - //tmr.ActiveProcess = "ItemDeleted"; - //if (ItemDeleted != null) ItemDeleted(sender); - //if (MyParent != null) - //{ - //tmr.ActiveProcess = "OnChildrenDeleted"; - //MyParent.OnChildrenDeleted(sender); - //tmr.ActiveProcess = "RefreshContentParts"; - //MyParent.MyContent.RefreshContentParts(); - //} - //} - public event ItemInfoEvent ChildrenDeleted; - internal void OnChildrenDeleted(object sender) - { - if (_CacheByPrimaryKey.ContainsKey(ItemID.ToString())) - { - List itmlst = _CacheByPrimaryKey[ItemID.ToString()]; - foreach (ItemInfo itm in itmlst) - if (itm.ChildrenDeleted != null) - { - itm.ChildrenDeleted(itm); - } - } - } - public event ItemInfoInsertEvent NewSiblingAfter; - internal void OnNewSiblingAfter(object sender, ItemInfoInsertEventArgs args) - { - if (NewSiblingAfter != null) NewSiblingAfter(sender,args); - if (MyParent != null) - MyParent.MyContent.RefreshContentParts(); - } - internal void OnNewSiblingAfter(ItemInfoInsertEventArgs args) - { - string key = ItemID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) - { - ItemInfo[] items = _CacheByPrimaryKey[key].ToArray(); - foreach (ItemInfo item in items) - { - item.OnNewSiblingAfter(item,args); - } - } - } - public event ItemInfoInsertEvent NewSiblingBefore; - internal void OnNewSiblingBefore(object sender, ItemInfoInsertEventArgs args) - { - if (NewSiblingBefore != null) NewSiblingBefore(sender,args); - if (MyParent != null) - MyParent.MyContent.RefreshContentParts(); - } - internal void OnNewSiblingBefore(ItemInfoInsertEventArgs args) - { - string key = ItemID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) - { - ItemInfo[] items = _CacheByPrimaryKey[key].ToArray(); - foreach (ItemInfo item in items) - { - item.OnNewSiblingBefore(item,args); - } - } - } - public event ItemInfoInsertEvent NewChild; - internal void OnNewChild(object sender, ItemInfoInsertEventArgs args) - { - if (NewChild != null) NewChild(sender, args); - MyContent.RefreshContentParts(); - } - internal void OnNewChild(ItemInfoInsertEventArgs args) - { - string key = ItemID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) - { - ItemInfo[] items = _CacheByPrimaryKey[key].ToArray(); - foreach (ItemInfo item in items) - { - item.OnNewChild(item, args); - } - } - } - #endregion - #region Insert Before - public ItemInfo InsertSiblingBefore(string text) - { - return InsertSiblingBefore(text, null); - } - public ItemInfo InsertSiblingBefore(string text, string number) - { - ItemInfo tmp = NewItemInfoFetch(ItemID, EAddpingPart.Before, number, text, null, null, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID); - // this item is updated in SQL so we have to manually force the iteminfo updates - // Refresh ItemInfo to update Previous - using (Item item = Get()) ItemInfo.Refresh(item); - // Update all of the content records that have transitions that point to the Siblings or Sibling Children of the new item - tmp.UpdateTransitionText(); - OnNewSiblingBefore(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Before)); - ((ItemInfo)ActiveParent).MyContent.RefreshContentParts(); - return tmp; - } - #endregion - #region PasteSiblingBefore - public ItemInfo PasteSiblingBefore(int copyStartID) - { - // To determine 'type' of pasted item, if it's a step (type >=20000), use the originating - // item, i.e. item inserting after. If it's a section or procedure, use the copied item's type. - ItemInfo cpItem = ItemInfo.Get(copyStartID); - int? type = MyContent.Type >= 20000 ? MyContent.Type : cpItem.MyContent.Type; - ItemInfo tmp = CopyPasteItemInfoFetch(copyStartID, this.ItemID, type, type, EAddpingPart.Before); - using (Item item = Get()) ItemInfo.Refresh(item); - tmp.UpdateTransitionText(); - tmp.UpdatePastedStepTransitionText(); - OnNewSiblingBefore(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Before)); - return tmp; - } - public ItemInfo PasteSiblingAfter(int copyStartID) - { - // To determine 'type' of pasted item, if it's a step (type >=20000), use the originating - // item, i.e. item inserting after. If it's a section or procedure, use the copied item's type. - ItemInfo cpItem = ItemInfo.Get(copyStartID); - int? type = MyContent.Type >= 20000 ? MyContent.Type : cpItem.MyContent.Type; - ItemInfo tmp = CopyPasteItemInfoFetch(copyStartID, this.ItemID, type, type, EAddpingPart.After); - using (Item item = Get()) ItemInfo.Refresh(item); - if (tmp.NextItem != null) using (Item item = tmp.NextItem.Get()) ItemInfo.Refresh(item); - RefreshNextItems(); - // if inserting after a caution or note, refreshes tabs. This will adjust bullets - // of any previous cautions or notes. - if (tmp.IsCaution || tmp.IsNote) ResetOrdinal(); - tmp.UpdateTransitionText(); - tmp.UpdatePastedStepTransitionText(); - OnNewSiblingAfter(new ItemInfoInsertEventArgs(tmp, EAddpingPart.After)); - return tmp; - } - private ItemInfo CopyPasteItemInfoFetch(int copyStartID, int itemID, int? type, int? fromType, EAddpingPart addType) - { - ItemInfo tmp=null; - if (addType == EAddpingPart.Child) // has to add in child relationship - uses 'fromtype' - { - // adding children. Type is based on 'fromType' - switch ((E_FromType)fromType) - { - case E_FromType.Procedure: - tmp = DataPortal.Fetch(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID)); - break; - case E_FromType.Section: - tmp = DataPortal.Fetch(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID)); - break; - default: - tmp = DataPortal.Fetch(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID)); - break; - } - } - else - { - if (GetType() == typeof(ProcedureInfo)) - tmp = DataPortal.Fetch(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID)); - else if (GetType() == typeof(SectionInfo)) - tmp = DataPortal.Fetch(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID)); - else - tmp = DataPortal.Fetch(new PastingPartCriteria(copyStartID, itemID, addType, type, fromType, DateTime.Now, Volian.Base.Library.VlnSettings.UserID)); - } - return tmp; - - } - #endregion - #region Insert After - public ItemInfo InsertSiblingAfter(string text) - { - return InsertSiblingAfter(text, null); - } - public ItemInfo InsertSiblingAfter(string text, string number) - { - return InsertSiblingAfter(text, number, MyContent.Type); - } - public ItemInfo InsertSiblingAfter(string text, string number, int? type) - { - ItemInfo tmp = NewItemInfoFetch(ItemID, EAddpingPart.After, number, text, type, null, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID); - //tmp = DataPortal.Fetch(new AddingPartCriteria(ItemID, EAddpingPart.After, number, text, type, null, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID)); - // if next exists, it is updated in SQL so we have to manually force the iteminfo updates - // Refresh ItemInfo to update PreviousID field - if (tmp.NextItem != null) using (Item item = tmp.NextItem.Get()) ItemInfo.Refresh(item); - RefreshNextItems(); - // if inserting after a caution or note, refreshes tabs. This will adjust bullets - // of any previous cautions or notes. - if (tmp.IsCaution || tmp.IsNote) ResetOrdinal(); - // Update all of the content records that have transitions that point to the Siblings or Sibling Children of the new item - tmp.UpdateTransitionText(); - OnNewSiblingAfter(new ItemInfoInsertEventArgs(tmp, EAddpingPart.After)); - return tmp; - } - - private ItemInfo NewItemInfoFetch(int itemID, EAddpingPart addType, string number, string text, int? type, int? fromType, int? formatID, string config, DateTime dts, string userID) - { - ItemInfo tmp; - if (addType == EAddpingPart.Child) - { - // adding children. Type is based on 'fromType' - switch ((E_FromType)fromType) - { - case E_FromType.Procedure: - tmp = DataPortal.Fetch(new AddingPartCriteria(itemID, addType, number, text, type, fromType, formatID, config, dts, userID)); - break; - case E_FromType.Section: - tmp = DataPortal.Fetch(new AddingPartCriteria(itemID, addType, number, text, type, fromType, formatID, config, dts, userID)); - break; - default: - tmp = DataPortal.Fetch(new AddingPartCriteria(itemID, addType, number, text, type, fromType, formatID, config, dts, userID)); - break; - } - } - else - { - if (GetType() == typeof(ProcedureInfo)) - tmp = DataPortal.Fetch(new AddingPartCriteria(itemID, addType, number, text, type, fromType, formatID, config, dts, userID)); - else if (GetType() == typeof(SectionInfo)) - tmp = DataPortal.Fetch(new AddingPartCriteria(itemID, addType, number, text, type, fromType, formatID, config, dts, userID)); - else - tmp = DataPortal.Fetch(new AddingPartCriteria(itemID, addType, number, text, type, fromType, formatID, config, dts, userID)); - } - return tmp; - } - public void UpdateTransitionText() - { - // Update Ordinals from here down for Steps - if (!IsStep) return; - ResetOrdinal(); - // This returns a list of all of the transitions that may have been affected - using(TransitionInfoList trans = TransitionInfoList.GetAffected(this.ItemID)) - { - #region B2012-071 fix JCB - foreach (TransitionInfo tran in trans) - { - Content oldContent = null; - using (Content content = tran.MyContent.Get()) - { - if (oldContent != null && content.ContentID != oldContent.ContentID) - { - if (oldContent.IsDirty) - { - oldContent.DTS = DateTime.Now; - #region B2012-079 fix JCB - oldContent.UserID = Volian.Base.Library.VlnSettings.UserID + " - Renumber"; - #endregion B2012-079 fix JCB - oldContent.Save(); - } - else // Update ContentInfo objects to reflect the change in the transition - ContentInfo.Refresh(oldContent); - oldContent = content; - } - if (oldContent == null) oldContent = content; - oldContent.FixTransitionText(tran); - //if (content.IsDirty) - //{ - // content.DTS = DateTime.Now; - // content.Save(); - //} - if (oldContent != null) - { - if (oldContent.IsDirty) - { - oldContent.DTS = DateTime.Now; - #region B2012-079 fix JCB - oldContent.UserID = Volian.Base.Library.VlnSettings.UserID + " - Renumber"; - #endregion B2012-079 fix JCB - oldContent.Save(); - } - else // Update ContentInfo objects to reflect the change in the transition - ContentInfo.Refresh(oldContent); - } - } - } - - #endregion B2012-071 fix JCB - } - } - public void UpdatePastedStepTransitionText() - { - // Get a list of all of the transitions included in this step & its children. - // Their transition text may have been affected, i.e. depending on the format, etc - using (TransitionInfoList trans = TransitionInfoList.GetPastedAffected(this.ItemID)) - { - foreach (TransitionInfo tran in trans) - { - using (Content content = tran.MyContent.Get()) - { - content.FixTransitionText(tran); - if (content.IsDirty) - content.Save(); - else // Update ContentInfo objects to reflect the change in the transition - ContentInfo.Refresh(content); - } - } - } - } - #endregion - #region Insert Child - public ItemInfo InsertChild(E_FromType fromType, int type, string text) - { - return InsertChild(fromType, type, text, null); - } - public ItemInfo InsertChild(E_FromType fromType, int type, string text, string number) - { - ItemInfo tmp = NewItemInfoFetch(ItemID, EAddpingPart.Child, number, text, type, (int?)fromType, null, null, DateTime.Now, Volian.Base.Library.VlnSettings.UserID); - // if next exists, it is updated in SQL so we have to manually force the iteminfo updates - // Refresh ItemInfo to update PreviousID field - if (tmp.NextItem != null) using (Item item = tmp.NextItem.Get()) ItemInfo.Refresh(item); - // Update all of the content records that have transitions that point to the Siblings or Sibling Children of the new item - tmp.UpdateTransitionText(); - MyContent.RefreshContentParts(); - OnNewChild(new ItemInfoInsertEventArgs(tmp, EAddpingPart.Child)); - return tmp; - } - #endregion - #region DataPortal - private void DataPortal_Fetch(PastingPartCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.Parameters.AddWithValue("@StartItemID", criteria.StartItemID); - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); //ABC After Before Child - cm.Parameters.AddWithValue("@Type", criteria.Type); //ABC - cm.Parameters.AddWithValue("@DTS", criteria.DTS); //ABC - cm.Parameters.AddWithValue("@UserID", criteria.UserID); //ABC - SqlParameter param_ContentID = new SqlParameter("@NewItemID", SqlDbType.Int); - param_ContentID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_ContentID); - switch (criteria.AddType) - { - case EAddpingPart.Child: - //cm.CommandText = "addItemChild"; - //cm.Parameters.AddWithValue("@FromType", criteria.FromType); //--C - break; - case EAddpingPart.Before: - cm.CommandText = "PasteItemSiblingBefore"; - break; - case EAddpingPart.After: - cm.CommandText = "PasteItemSiblingAfter"; - break; - case EAddpingPart.Replace: - cm.CommandText = "PasteItemReplace"; - break; - } - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - //newItemID = (int)cm.Parameters["@newContentID"].Value; - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ItemInfo.DataPortal_Fetch", ex); - } - } - private void DataPortal_Fetch(AddingPartCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); //ABC After Before Child - cm.Parameters.AddWithValue("@Number", criteria.Number); //ABC - cm.Parameters.AddWithValue("@Text", criteria.Text); //ABC - cm.Parameters.AddWithValue("@FormatID", criteria.FormatID); //ABC - cm.Parameters.AddWithValue("@Config", criteria.Config); //ABC - cm.Parameters.AddWithValue("@Type", criteria.Type); //ABC - cm.Parameters.AddWithValue("@DTS", criteria.DTS); //ABC - cm.Parameters.AddWithValue("@UserID", criteria.UserID); //ABC - SqlParameter param_ContentID = new SqlParameter("@newItemID", SqlDbType.Int); - param_ContentID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_ContentID); - switch (criteria.AddType) - { - case EAddpingPart.Child: - cm.CommandText = "addItemChild"; - cm.Parameters.AddWithValue("@FromType", criteria.FromType); //--C - break; - case EAddpingPart.Before: - cm.CommandText = "addItemSiblingBefore"; - break; - case EAddpingPart.After: - cm.CommandText = "addItemSiblingAfter"; - break; - } - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - //newItemID = (int)cm.Parameters["@newContentID"].Value; - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ItemInfo.DataPortal_Fetch", ex); - } - } - #endregion - #region PastingPartCriteria - [Serializable()] - public class PastingPartCriteria - { - #region Properties - private int _StartItemID; - public int StartItemID - { - get { return _StartItemID; } - set { _StartItemID = value; } - } - //private int _CopyEndID; - //public int CopyEndID - //{ - // get { return _CopyEndID; } - // set { _CopyEndID = value; } - //} - private int _ItemID; // paste relative to this itemid - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - private EAddpingPart _AddType; - public EAddpingPart AddType - { - get { return _AddType; } - set { _AddType = value; } - } - private int? _FromType = null; - public int? FromType - { - get { return _FromType; } - set { _FromType = value; } - } - private int? _Type = null; - public int? Type - { - get { return _Type; } - set { _Type = value; } - } - private DateTime _DTS; - public DateTime DTS - { - get { return _DTS; } - set { _DTS = value; } - } - private string _UserID; - public string UserID - { - get { return _UserID; } - set { _UserID = value; } - } - #endregion - #region Constructor - public PastingPartCriteria(int startItemid, int itemID, EAddpingPart addType, int? type, int? fromType, DateTime dts, string userID) - { - _StartItemID = startItemid; - _ItemID = itemID; - _AddType = addType; - _Type = type; - _FromType = fromType; - _DTS = dts; - _UserID = userID; - } - #endregion - } - #endregion - [Serializable()] - protected class AddingPartCriteria - { - #region Properties - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - private EAddpingPart _AddType; - public EAddpingPart AddType - { - get { return _AddType; } - set { _AddType = value; } - } - private string _Number=null; - public string Number - { - get { return _Number; } - set { _Number = value; } - } - private string _Text=null; - public string Text - { - get { return _Text; } - set { _Text = value; } - } - private int? _FromType = null; - public int? FromType - { - get { return _FromType; } - set { _FromType = value; } - } - private int? _Type=null; - public int? Type - { - get { return _Type; } - set { _Type = value; } - } - private int? _FormatID=null; - public int? FormatID - { - get { return _FormatID; } - set { _FormatID = value; } - } - private string _Config=null; - public string Config - { - get { return _Config; } - set { _Config = value; } - } - private DateTime _DTS; - public DateTime DTS - { - get { return _DTS; } - set { _DTS = value; } - } - private string _UserID; - public string UserID - { - get { return _UserID; } - set { _UserID = value; } - } - #endregion - #region Constructor - public AddingPartCriteria(int itemID, EAddpingPart addType, string number, string text, int? type, int? fromType, int? formatID, string config, DateTime dts, string userID) - { - _ItemID = itemID; - _AddType = addType; - _Number = number; - _Text = text; - _Type = type; - _FromType = fromType; - _FormatID = formatID; - _Config = config; - _DTS = dts; - _UserID = userID; - } - #endregion - } - public enum EAddpingPart - { - Child=0, - Before=1, - After=2, - Replace=3 - } - public ItemInfo NextItem - { - get - { - if (NextItemCount > 0 && NextItems != null && NextItems.Count > 0) - return NextItems[0]; - return null; - } - } - private static void ResetOrdinal(int itemID) - { - ConvertListToDictionary(); - string key = itemID.ToString(); - while (key != null && _CacheByPrimaryKey.ContainsKey(key)) - { - ItemInfo[] items = _CacheByPrimaryKey[key].ToArray(); - key = null; - foreach (ItemInfo item in items) - { - item._Ordinal = null; - item._TagsSetup = false; - //item.MyContent.ShowChange(); // Replaced with OnOrdinalChange below - if (key == null && item.NextItem != null) - key = item.NextItem.ItemID.ToString(); - } - ItemInfo.OnOrdinalChange(items[0].ItemID); // After _Ordinal reset trigger event - } - } - public void ResetOrdinal() - { - ResetOrdinal(ItemID); - } - public static void DeleteItemInfoAndChildren(int itemID) - { - //Volian.Base.Library.VlnTimer _MyTimer = new Volian.Base.Library.VlnTimer(); - //_MyTimer.ActiveProcess = "ConvertListToDictionary"; - ConvertListToDictionary(); - string key = itemID.ToString(); - if(_CacheByPrimaryKey.ContainsKey(key)) - { - - ItemInfo [] items = _CacheByPrimaryKey[key].ToArray(); - ItemInfo parent = items[0].ActiveParent as ItemInfo; - //_MyTimer.ActiveProcess = "ResetParts"; - if (parent != null) - ItemInfo.ResetParts(parent.ItemID); - //Console.WriteLine("\r\n\r\n'Deleting Item {0}'\r\n{0}'Type ','ParentID','ParentUnique','ItemID','Unique'",itemID); - foreach (ItemInfo item in items) - { - //_MyTimer.ActiveProcess = "IsDeleted"; - item.IsDeleted = true; - //_MyTimer.ActiveProcess = string.Format("OnDeleted {0}", items.Length); - item.OnDeleted(item); - //item.OnDeleted(item, _MyTimer); - //_MyTimer.ActiveProcess = "DeleteItemInfoAndChildren"; - item.DeleteItemInfoAndChildren(" "); - } - //Console.WriteLine("\r\n'Item Deleted'"); - - } - //_MyTimer.ShowElapsedTimes("DeleteItemInfoAndChildren"); - } - - private void DeleteItemInfoAndChildren(string depth) - { - if (MyContent.LocalContentParts != null) - { - foreach (PartInfo part in MyContent.LocalContentParts) - { - if (part._MyItems != null) - { - int whereami = 1; - try - { - List items = new List(); - foreach (ItemInfo item in part._MyItems) - { - items.Add(item); - } - foreach (ItemInfo item in items) - { - string key = item.ItemID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) - { - ItemInfo[] itemz = _CacheByPrimaryKey[key].ToArray(); - foreach (ItemInfo itm in itemz) - { - //Console.WriteLine("'{0}cache ',{1},{2},{3},{4}", depth + depth, this.ItemID, this._MyItemInfoUnique, itm.ItemID, itm._MyItemInfoUnique); - //whereami = 2; - itm.OnDeleted(itm); - //whereami = 4; - itm.DeleteItemInfoAndChildren(depth + " "); - //whereami = 3; - } - } - else - { - //Console.WriteLine("'{0}noncache',{1},{2},{3},{4}", depth + depth, this.ItemID, this._MyItemInfoUnique, item.ItemID, item._MyItemInfoUnique); - //whereami = 5; - item.OnDeleted(item); - //whereami = 7; - item.DeleteItemInfoAndChildren(depth + " "); - //whereami = 6; - } - } - } - catch (Exception ex) - { - Console.WriteLine("where = {0}, type = {1}, msg = {2}", whereami, ex.GetType().Name, ex.Message); - } - } - } - } - Dispose(); - } - public static void RefreshPrevious(int? itemID, int? previousID) - { - if (itemID == null) return; - string key = itemID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ItemInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshPrevious(previousID); - } - private void RefreshPrevious(int? previousID) - { - if (_PreviousID != previousID) - { - if (MyPrevious != null) MyPrevious.RefreshNextItems(); // Update List for old value - _PreviousID = previousID; // Update the value - } - _MyPrevious = null; // Reset list so that the next line gets a new list - if (MyPrevious != null) MyPrevious.RefreshNextItems(); // Update List for new value - } - } - public partial class Item - { - #region DeleteItemAndChildren - public static void DeleteItemAndChildren(ItemInfo item) - { - //Volian.Base.Library.VlnTimer _MyTimer = new Volian.Base.Library.VlnTimer(); - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Item"); - try - { - ItemInfo nextItem = item.NextItem; - ItemInfo prevItem = item.MyPrevious; - DocVersionInfo docVersion = item.ItemDocVersionCount == 1 ? item.ItemDocVersions[0] : null; - item.OnBeforeDelete(); - //_MyTimer.ActiveProcess = "DataPortal.Delete"; - DataPortal.Delete(new DeleteCriteria(item.ItemID, Volian.Base.Library.VlnSettings.UserID)); - if (nextItem != null) // Adjust PreviousID for NextItem - { - if (docVersion != null) - using (DocVersion dv = docVersion.Get()) - DocVersionInfo.Refresh(dv); - //_MyTimer.ActiveProcess = "RefreshPrevious"; - ItemInfo.RefreshPrevious(nextItem.ItemID, item.PreviousID); - // The order of the next two methods was required to fix a null reference - // when getting myparent. This bug was found when deleting a node from the - // tree when the RTBItem was not open (i.e. in the step editor window). - //_MyTimer.ActiveProcess = "RefreshItemParts"; - nextItem.RefreshItemParts(); - //nextItem.ResetOrdinal(); - UpdateTransitionText calls ResetOrdinal - //_MyTimer.ActiveProcess = "UpdateTransitionText"; - nextItem.UpdateTransitionText(); - } - else if (prevItem != null) - { - //_MyTimer.ActiveProcess = "RefreshNextItems"; - prevItem.RefreshNextItems(); - //_MyTimer.ActiveProcess = "ResetOrdinal"; - if (prevItem.IsCaution || prevItem.IsNote) prevItem.ResetOrdinal(); - //_MyTimer.ActiveProcess = "UpdateTransitionText"; - prevItem.UpdateTransitionText(); - } - //_MyTimer.ActiveProcess = "DeleteItemInfoAndChildren"; - ItemInfo.DeleteItemInfoAndChildren(item.ItemID); // Dispose ItemInfo and Children - } - catch (Exception ex) - { - Console.WriteLine("ItemInsertExt: Stacktrace = {0}", ex.StackTrace); - System.Data.SqlClient.SqlException exSQL = SqlException(ex); - if (exSQL != null && exSQL.Message.Contains("###Cannot Delete Item###")) - //return false; - throw exSQL; - else - throw new DbCslaException("Error on Item.DeleteItemAndChildren", ex); - } - //_MyTimer.ShowElapsedTimes("DeleteItemAndChildren"); - } - private static System.Data.SqlClient.SqlException SqlException(Exception ex) - { - Type sqlExType = typeof(System.Data.SqlClient.SqlException); - while (ex != null) - { - if (ex.GetType() == sqlExType) return ex as System.Data.SqlClient.SqlException; - ex = ex.InnerException; - } - return null; - } - [Serializable()] - protected class DeleteCriteria - { - private int _ItemID; - public int ItemID - { get { return _ItemID; } } - private string _UserID; - public string UserID - { - get { return _UserID; } - set { _UserID = value; } - } - public DeleteCriteria(int itemID,String userID) - { - _ItemID = itemID; - _UserID = userID; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(DeleteCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "DeleteItemAndChildren"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.Parameters.AddWithValue("@UserID", criteria.UserID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Item.DataPortal_Delete", ex); - } - } - #endregion - #region PasteReplace - public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Item"); - ItemInfo newItemInfo = CopyPasteReplaceItemInfoFetch(copyStartID, itemInfo); //itemInfo.ItemID, itemInfo.MyContent.Type, itemInfo.MyContent.Type); - // Delete business objects, including remove from tree - ItemInfo.DeleteItemInfoAndChildren(itemInfo.ItemID); // Dispose ItemInfo and Children - using (Item item = Get(newItemInfo.ItemID)) ItemInfo.Refresh(item); - if (newItemInfo.NextItem != null) using (Item item = newItemInfo.NextItem.Get()) ItemInfo.Refresh(item); - newItemInfo.RefreshNextItems(); - // if inserting after a caution or note, refreshes tabs. This will adjust bullets - // of any previous cautions or notes. - if (newItemInfo.IsCaution || newItemInfo.IsNote) newItemInfo.ResetOrdinal(); - newItemInfo.UpdateTransitionText(); - newItemInfo.UpdatePastedStepTransitionText(); - // Add to tree - if (newItemInfo.NextItemCount > 0) - { - using (ItemInfo itm = ItemInfo.Get(newItemInfo.NextItem.ItemID)) - { - itm.OnNewSiblingBefore(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.Before)); - } - } - else if (newItemInfo.PreviousID != null) - { - using (ItemInfo itm2 = ItemInfo.Get((int)newItemInfo.PreviousID)) - { - itm2.OnNewSiblingAfter(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.After)); - } - } - else - { - newItemInfo.MyParent.OnNewChild(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.Child)); - } - return newItemInfo; - } - private static ItemInfo CopyPasteReplaceItemInfoFetch(int copyStartID, ItemInfo itemInfo) // int itemID, int? type, int? fromType) - { - ItemInfo tmp = null; - if (itemInfo.GetType() == typeof(ProcedureInfo)) - tmp = DataPortal.Fetch(new ItemInfo.PastingPartCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Volian.Base.Library.VlnSettings.UserID)); - else if (itemInfo.GetType() == typeof(SectionInfo)) - tmp = DataPortal.Fetch(new ItemInfo.PastingPartCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Volian.Base.Library.VlnSettings.UserID)); - else - tmp = DataPortal.Fetch(new ItemInfo.PastingPartCriteria(copyStartID, itemInfo.ItemID, ItemInfo.EAddpingPart.Replace, itemInfo.MyContent.Type, itemInfo.MyContent.Type, DateTime.Now, Volian.Base.Library.VlnSettings.UserID)); - - return tmp; - } - #endregion - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.org b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.org deleted file mode 100644 index 9c028db0..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.org +++ /dev/null @@ -1,401 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Data; -using System.Data.SqlClient; -using System.Text.RegularExpressions; -using Csla; -using Csla.Data; - -namespace VEPROMS.CSLA.Library -{ - public partial class ItemInfo - { - #region Old Insert - //public ItemInfo InsertSiblingBeforeOld(string text) - //{ - // return InsertSiblingBefore(text, null); - //} - //public ItemInfo InsertSiblingBeforeOld(string text, string number) - //{ - // ItemInfo prevItemInfo = MyPrevious; - // ItemInfo newItemInfo = null; - // PartInfoList partInfoList = null; - // if (MyParent != null && MyParent.MyContent != null) - // { - // MyParent.MyContent.RefreshContentParts(); - // partInfoList = MyParent.MyContent.ContentParts; - // } - // using (Item prevItem = prevItemInfo == null ? null : prevItemInfo.Get()) // Get the previous Item - // { - // using (Item newItem = Item.MakeItem(prevItem, Content.MakeContent(number, text, MyContent.Type, null, null))) // Create the new Item - // { - // using (Item thisItem = Get()) // Get the next item in the list - // { - // thisItem.MyPrevious = newItem; // Point to the new item - // thisItem.Save(); // Save Changes - // if (prevItem == null) - // { - // PartInfo partInfo = partInfoList.Find(this); - // using (Part part = partInfo.Get()) - // { - // part.MyItem = newItem; - // part.Save(); - // } - // } - // } - // // ToDo: Need change PartInfo in PartInfoList - // newItemInfo = ItemInfo.Get(newItem.ItemID); - // newItemInfo.ResetOrdinal(); - // } - // } - // return newItemInfo; - //} - //public ItemInfo InsertSiblingAfterOld(string text) - //{ - // return InsertSiblingAfter(text, null); - //} - //public ItemInfo InsertSiblingAfterOld(string text, string number) - //{ - // return InsertSiblingAfter(text, number, MyContent.Type); - //} - //public ItemInfo InsertSiblingAfterOld(string text, string number, int? type) - //{ - // ItemInfo nextItemInfo = NextItem; - // ItemInfo newItemInfo = null; - // using (Item thisItem = Get()) // Get the Current Item - // { - // using (Item newItem = Item.MakeItem(thisItem, Content.MakeContent(number, text, type, null, null))) // Create the new Item - // { - // if (nextItemInfo != null) // Simple case, adding to end of list: - // using (Item nextItem = nextItemInfo.Get()) // Get the next item in the list - // { - // nextItem.MyPrevious = newItem; // Point to the new item - // nextItem.Save(); // Save Changes - // } - // // ToDo: Need change PartInfo in PartInfoList - // newItemInfo = ItemInfo.Get(newItem.ItemID); - // newItemInfo.ResetOrdinal(); - // } - // } - // return newItemInfo; - //} - //public ItemInfo InsertChildOld(E_FromType fromType, int type, string text) - //{ - // return InsertChild(fromType, type, text, null); - //} - //public ItemInfo InsertChildOld(E_FromType fromType, int type, string text, string number) - //{ - // ItemInfo newItemInfo = null; - // using (Item thisItem = Get()) // Get the Current Item - // { - // using (Item newItem = Item.MakeItem(null, Content.MakeContent(number, text, type, null, null))) // Create the new Item - // { - // PartInfo partInfo = MyContent.ContentParts == null ? null : MyContent.ContentParts.Find(fromType); - // if (partInfo != null) - // { - // //this could be equivalent to adding a sibling with a specific type - // using (Part part = partInfo.Get()) - // { - // part.MyItem.MyPrevious = newItem; - // part.MyItem.Save(); - // part.MyItem = newItem; - // part.Save(); - // } - // } - // else - // { - // // This means that a part needs to be added to point to the new item - // //using (Part part = Part.MakePart(thisItem.MyContent, )) - // //{ ;} - // thisItem.MyContent.ContentParts.Add((int)fromType, newItem); - // thisItem.Save(); - // } - // newItemInfo = ItemInfo.Get(newItem.ItemID); - // } - // } - // ResetParts(); - // return newItemInfo; - //} - #endregion - #region Insert Before - public ItemInfo InsertSiblingBefore(string text) - { - return InsertSiblingBefore(text, null); - } - public ItemInfo InsertSiblingBefore(string text, string number) - { - ItemInfo tmp = NewItemInfoFetch(ItemID, EAddpingPart.Before, number, text, null, null, null, null, DateTime.Now, Environment.UserName); - // this item is updated in SQL so we have to manually force the iteminfo updates - // Refresh ItemInfo to update Previous - using (Item item = Get()) ItemInfo.Refresh(item); - // Update all of the content records that have transitions that point to the Siblings or Sibling Children of the new item - tmp.UpdateTransitionText(); - return tmp; - } - #endregion - #region Insert After - public ItemInfo InsertSiblingAfter(string text) - { - return InsertSiblingAfter(text, null); - } - public ItemInfo InsertSiblingAfter(string text, string number) - { - return InsertSiblingAfter(text, number, MyContent.Type); - } - public ItemInfo InsertSiblingAfter(string text, string number, int? type) - { - ItemInfo tmp = NewItemInfoFetch(ItemID, EAddpingPart.After, number, text, type, null, null, null, DateTime.Now, Environment.UserName); - //tmp = DataPortal.Fetch(new AddingPartCriteria(ItemID, EAddpingPart.After, number, text, type, null, null, null, DateTime.Now, Environment.UserName)); - // if next exists, it is updated in SQL so we have to manually force the iteminfo updates - // Refresh ItemInfo to update PreviousID field - if (tmp.NextItem != null) using (Item item = tmp.NextItem.Get()) ItemInfo.Refresh(item); - // Update all of the content records that have transitions that point to the Siblings or Sibling Children of the new item - tmp.UpdateTransitionText(); - return tmp; - } - private ItemInfo NewItemInfoFetch(int itemID, EAddpingPart addType, string number, string text, int? type, int? fromType, int? formatID, string config, DateTime dts, string userID) - { - ItemInfo tmp; - if (addType == EAddpingPart.Child) - { - // adding children. Type is based on 'fromType' - switch ((E_FromType)fromType) - { - case E_FromType.Procedure: - tmp = DataPortal.Fetch(new AddingPartCriteria(itemID, addType, number, text, type, fromType, formatID, config, dts, userID)); - break; - case E_FromType.Section: - tmp = DataPortal.Fetch(new AddingPartCriteria(itemID, addType, number, text, type, fromType, formatID, config, dts, userID)); - break; - default: - tmp = DataPortal.Fetch(new AddingPartCriteria(itemID, addType, number, text, type, fromType, formatID, config, dts, userID)); - break; - } - } - else - { - if (GetType() == typeof(ProcedureInfo)) - tmp = DataPortal.Fetch(new AddingPartCriteria(itemID, addType, number, text, type, fromType, formatID, config, dts, userID)); - else if (GetType() == typeof(SectionInfo)) - tmp = DataPortal.Fetch(new AddingPartCriteria(itemID, addType, number, text, type, fromType, formatID, config, dts, userID)); - else - tmp = DataPortal.Fetch(new AddingPartCriteria(itemID, addType, number, text, type, fromType, formatID, config, dts, userID)); - } - return tmp; - } - public void UpdateTransitionText() - { - // Update Ordinals from here down - ResetOrdinal(); - // This returns a list of all of the transitions that may have been affected - using(TransitionInfoList trans = TransitionInfoList.GetAffected(this.ItemID)) - { - foreach (TransitionInfo tran in trans) - { - using (Content content = tran.MyContent.Get()) - { - content.FixTransitionText(tran); - if (content.IsDirty) - content.Save(); - } - } - } - } - #endregion - #region Insert Child - public ItemInfo InsertChild(E_FromType fromType, int type, string text) - { - return InsertChild(fromType, type, text, null); - } - public ItemInfo InsertChild(E_FromType fromType, int type, string text, string number) - { - ItemInfo tmp = NewItemInfoFetch(ItemID, EAddpingPart.Child, number, text, type, (int?) fromType, null, null, DateTime.Now, Environment.UserName); - // if next exists, it is updated in SQL so we have to manually force the iteminfo updates - // Refresh ItemInfo to update PreviousID field - if (tmp.NextItem != null) using (Item item = tmp.NextItem.Get()) ItemInfo.Refresh(item); - // Update all of the content records that have transitions that point to the Siblings or Sibling Children of the new item - tmp.UpdateTransitionText(); - return tmp; - } - #endregion - #region DataPortal - private void DataPortal_Fetch(AddingPartCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); //ABC After Before Child - cm.Parameters.AddWithValue("@Number", criteria.Number); //ABC - cm.Parameters.AddWithValue("@Text", criteria.Text); //ABC - cm.Parameters.AddWithValue("@FormatID", criteria.FormatID); //ABC - cm.Parameters.AddWithValue("@Config", criteria.Config); //ABC - cm.Parameters.AddWithValue("@Type", criteria.Type); //ABC - cm.Parameters.AddWithValue("@DTS", criteria.DTS); //ABC - cm.Parameters.AddWithValue("@UserID", criteria.UserID); //ABC - SqlParameter param_ContentID = new SqlParameter("@newItemID", SqlDbType.Int); - param_ContentID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_ContentID); - switch (criteria.AddType) - { - case EAddpingPart.Child: - cm.CommandText = "addItemChild"; - cm.Parameters.AddWithValue("@FromType", criteria.FromType); //--C - break; - case EAddpingPart.Before: - cm.CommandText = "addItemSiblingBefore"; - break; - case EAddpingPart.After: - cm.CommandText = "addItemSiblingAfter"; - break; - } - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - //newItemID = (int)cm.Parameters["@newContentID"].Value; - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ItemInfo.DataPortal_Fetch", ex); - } - } - #endregion - [Serializable()] - protected class AddingPartCriteria - { - #region Properties - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - private EAddpingPart _AddType; - public EAddpingPart AddType - { - get { return _AddType; } - set { _AddType = value; } - } - private string _Number=null; - public string Number - { - get { return _Number; } - set { _Number = value; } - } - private string _Text=null; - public string Text - { - get { return _Text; } - set { _Text = value; } - } - private int? _FromType = null; - public int? FromType - { - get { return _FromType; } - set { _FromType = value; } - } - private int? _Type=null; - public int? Type - { - get { return _Type; } - set { _Type = value; } - } - private int? _FormatID=null; - public int? FormatID - { - get { return _FormatID; } - set { _FormatID = value; } - } - private string _Config=null; - public string Config - { - get { return _Config; } - set { _Config = value; } - } - private DateTime _DTS; - public DateTime DTS - { - get { return _DTS; } - set { _DTS = value; } - } - private string _UserID; - public string UserID - { - get { return _UserID; } - set { _UserID = value; } - } - #endregion - #region Constructor - public AddingPartCriteria(int itemID, EAddpingPart addType, string number, string text, int? type, int? fromType, int? formatID, string config, DateTime dts, string userID) - { - _ItemID = itemID; - _AddType = addType; - _Number = number; - _Text = text; - _Type = type; - _FromType = fromType; - _FormatID = formatID; - _Config = config; - _DTS = dts; - _UserID = userID; - } - #endregion - } - public enum EAddpingPart - { - Child=0, - Before=1, - After=2 - } - public ItemInfo NextItem - { - get - { - if (NextItemCount > 0 && NextItems.Count > 0) - return NextItems[0]; - return null; - } - } - private static void ResetOrdinal(int itemID) - { - ConvertListToDictionary(); - string key = itemID.ToString(); - while (key != null && _CacheByPrimaryKey.ContainsKey(key)) - { - ItemInfo[] items = _CacheByPrimaryKey[key].ToArray(); - key = null; - foreach (ItemInfo item in items) - { - //Console.WriteLine("item = {0}, ordinal = {1}",item,item.Ordinal); - item._Ordinal = null; - item._TagsSetup = false; - if (key == null && item.NextItem != null) - key = item.NextItem.ItemID.ToString(); - } - } - } - private void ResetOrdinal() - { - ResetOrdinal(ItemID); - } - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/LinkText.cs b/PROMS/VEPROMS.CSLA.Library/Extension/LinkText.cs deleted file mode 100644 index e7b6b81a..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/LinkText.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Text.RegularExpressions; -namespace VEPROMS.CSLA.Library -{ - public partial class LinkText - { - public LinkText(string linkInfoText) - { - _LinkInfoText = linkInfoText; - } - public void ParseLink() - { - if (_MyParsedLinkType == ParsedLinkType.NotParsed) - { - if (_LinkInfoText == null) return; - // First parse the string - _LinkInfoText = _LinkInfoText.Replace(@"\v ", ""); - // 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; - switch (m.Groups[2].Value) - { - case "ReferencedObject": - _MyParsedLinkType = ParsedLinkType.ReferencedObject; - string[] subs = m.Groups[3].Value.Split(" ".ToCharArray()); - if (subs[0] == "") - _MyRoUsageInfo = null; - else - { - int roUsageid = Convert.ToInt32(subs[0]); - _MyRoUsageInfo = RoUsageInfo.Get(roUsageid); - } - break; - case "Transition": - case "TransitionRange": - _MyParsedLinkType = (ParsedLinkType)Enum.Parse(_MyParsedLinkType.GetType(), m.Groups[2].Value); - if (m.Groups[3].Value.Split(" ".ToCharArray())[1] == "") - _MyTransitionInfo = null; - else - { - int transitionID = Convert.ToInt32(m.Groups[3].Value.Split(" ".ToCharArray())[1]); - _MyTransitionInfo = TransitionInfo.Get(transitionID); - } - break; - } - } - } - private string _LinkInfoText; - public string LinkInfoText - { - get { return _LinkInfoText; } - } - private TransitionInfo _MyTransitionInfo = null; - public TransitionInfo MyTransitionInfo - { - get { ParseLink(); return _MyTransitionInfo; } - } - public ItemInfo MyTranToItemInfo - { - get { ParseLink(); return _MyTransitionInfo.MyItemToID; } - } - public ItemInfo MyTranRangeItemInfo - { - 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 - { - NotParsed = 0, - Transition = 1, - TransitionRange = 2, - ReferencedObject = 3 - } - #endregion -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs.bak b/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs.bak deleted file mode 100644 index cac677ad..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs.bak +++ /dev/null @@ -1,890 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Data; -using System.Data.SqlClient; -using System.Text.RegularExpressions; -using Csla; -using Csla.Data; - -namespace VEPROMS.CSLA.Library -{ - #region Enum stuff - public enum CheckOutType : int - { - Procedure = 0, Document = 1, DocVersion = 2 - } - #endregion - #region SessionInfoList stuff - public partial class SessionInfoList - { - [Serializable()] - public class CanCheckOutItemCriteria - { - private int _ObjectID; - public int ObjectID - { get { return _ObjectID; } } - private CheckOutType _ObjectType; - public CheckOutType ObjectType - { get { return _ObjectType; } } - public CanCheckOutItemCriteria(int objectID, CheckOutType objectType) - { - _ObjectID = objectID; - _ObjectType = objectType; - } - } - private void DataPortal_Fetch(CanCheckOutItemCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] SessionInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_SessionCanCheckOutItem"; - cm.Parameters.AddWithValue("@ObjectID", criteria.ObjectID); - cm.Parameters.AddWithValue("@ObjectType", criteria.ObjectType); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new SessionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("SessionInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("SessionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - } - #endregion - #region SessionInfo stuff - public partial class SessionInfo - { - public static SessionInfo BeginSession(string machineName, int processID) - { - try - { - SessionInfo tmp = DataPortal.Fetch(new BeginSessionCriteria(Volian.Base.Library.VlnSettings.UserID, machineName, processID)); - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up SessionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on SessionInfo.BeginSession", ex); - } - } - public List PingSession() - { - List myList = new List(); - SessionPing.Execute(this.SessionID); - OwnerInfoList oil = OwnerInfoList.GetBySessionID(this.SessionID); - foreach (OwnerInfo oi in oil) - myList.Add(oi.OwnerID); - return myList; - } - public void EndSession() - { - SessionEnd.Execute(this.SessionID); - } - public bool CanCheckOutItem(int objectID, CheckOutType objectType, ref string message) - { - try - { - SessionInfoList sil = DataPortal.Fetch(new SessionInfoList.CanCheckOutItemCriteria(objectID, objectType)); - if (sil.Count == 0) - return true; - bool rv = true; - foreach (SessionInfo si in sil) - { - if (si.SessionID != this.SessionID && objectType == CheckOutType.Procedure) - { - message = string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(objectID).MyProcedure.DisplayNumber, si.UserID); - rv = rv && false; - } - else if (si.SessionID != this.SessionID && objectType == CheckOutType.Document) - { - message = string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(objectID).DocumentEntries[0].MyContent.Text, si.UserID); - rv = rv && false; - } - else if (si.SessionID != this.SessionID && objectType == CheckOutType.DocVersion) - { - OwnerInfo oi = OwnerInfo.GetBySessionIDandVersionID(si.SessionID, objectID); - if(oi.OwnerType == 0) - message = message + string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(oi.OwnerItemID).MyProcedure.DisplayNumber, si.UserID) + Environment.NewLine; - else if (oi.OwnerType == 1) - message = message + string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(oi.OwnerItemID).DocumentEntries[0].MyContent.Text, si.UserID) + Environment.NewLine; - else if (oi.OwnerType == 2) - message = message + string.Format("The working draft is already checked out to {0}", si.UserID); - rv = rv && false; - } - } - return rv; - } - catch (Exception ex) - { - throw new DbCslaException("Error on SessionInfo.Get", ex); - } - } - public int CheckOutItem(int itemID, CheckOutType itemType) - { - int ownerID = SessionCheckOutItem.Execute(this.SessionID, itemID, itemType); - return ownerID; - } - public void CheckInItem(int ownerID) - { - SessionCheckInItem.Execute(ownerID); - } - private void DataPortal_Fetch(BeginSessionCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] SessionInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_SessionBegin"; - cm.Parameters.AddWithValue("@UserID", criteria.UserID); - cm.Parameters.AddWithValue("@MachineName", criteria.MachineName); - cm.Parameters.AddWithValue("@ProcessID", criteria.ProcessID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("SessionInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("SessionInfo.DataPortal_Fetch", ex); - } - } - //private void DataPortal_Fetch(CanCheckOutItemCriteria criteria) - //{ - // if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] SessionInfo.DataPortal_Fetch", GetHashCode()); - // try - // { - // using (SqlConnection cn = Database.VEPROMS_SqlConnection) - // { - // ApplicationContext.LocalContext["cn"] = cn; - // using (SqlCommand cm = cn.CreateCommand()) - // { - // cm.CommandType = CommandType.StoredProcedure; - // cm.CommandText = "vesp_SessionCanCheckOutItem"; - // cm.Parameters.AddWithValue("@ObjectID", criteria.ObjectID); - // cm.Parameters.AddWithValue("@ObjectType", criteria.ObjectType); - // using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - // { - // while(dr.Read()) - - // if (!dr.Read()) - // { - // _ErrorMessage = "No Record Found"; - // return; - // } - // ReadData(dr); - // } - // } - // // removing of item only needed for local data portal - // if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - // ApplicationContext.LocalContext.Remove("cn"); - // } - // } - // catch (Exception ex) - // { - // if (_MyLog.IsErrorEnabled) _MyLog.Error("SessionInfo.DataPortal_Fetch", ex); - // _ErrorMessage = ex.Message; - // throw new DbCslaException("SessionInfo.DataPortal_Fetch", ex); - // } - //} - [Serializable()] - protected class BeginSessionCriteria - { - private string _UserID; - public string UserID - { get { return _UserID; } } - private string _MachineName; - public string MachineName - { get { return _MachineName; } } - private int _ProcessID; - public int ProcessID - { get { return _ProcessID; } } - public BeginSessionCriteria(string userID, string machineName, int processID) - { - _UserID = userID; - _MachineName = machineName; - _ProcessID = processID; - } - } - //[Serializable()] - //protected class CanCheckOutItemCriteria - //{ - // private int _ObjectID; - // public int ObjectID - // { get { return _ObjectID; } } - // private CheckOutType _ObjectType; - // public CheckOutType ObjectType - // { get { return _ObjectType; } } - // public CanCheckOutItemCriteria(int objectID, CheckOutType objectType) - // { - // _ObjectID = objectID; - // _ObjectType = objectType; - // } - //} - } - public class ResetSecurity : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #region Factory Methods - public static void Execute() - { - ResetSecurity cmd = new ResetSecurity(); - DataPortal.Execute(cmd); - } - #endregion - #region Server-Side code - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("vesp_ResetSecurity", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Reset Security Error", ex); - throw new ApplicationException("Failure on Reset Security", ex); - } - } - #endregion - } - public class SessionPing : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private int _SessionID; - public int SessionID - { - get { return _SessionID; } - set { _SessionID = value; } - } - #region Factory Methods - public static void Execute(int sessionID) - { - SessionPing cmd = new SessionPing(); - cmd.SessionID = sessionID; - DataPortal.Execute(cmd); - } - #endregion - #region Server-Side code - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("vesp_SessionPing", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.Parameters.AddWithValue("@SessionID", SessionID); - cmd.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session Ping Error", ex); - throw new ApplicationException("Failure on Session Ping", ex); - } - } - #endregion - } - public class SessionEnd : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private int _SessionID; - public int SessionID - { - get { return _SessionID; } - set { _SessionID = value; } - } - #region Factory Methods - public static void Execute(int sessionID) - { - SessionEnd cmd = new SessionEnd(); - cmd.SessionID = sessionID; - DataPortal.Execute(cmd); - } - #endregion - #region Server-Side code - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("vesp_SessionEnd", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.Parameters.AddWithValue("@SessionID", SessionID); - cmd.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session End Error", ex); - throw new ApplicationException("Failure on Session End", ex); - } - } - #endregion - } - public class SessionCheckOutItem : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private int _SessionID; - public int SessionID - { - get { return _SessionID; } - set { _SessionID = value; } - } - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - private int _ItemType; - public int ItemType - { - get { return _ItemType; } - set { _ItemType = value; } - } - private int _OwnerID; - public int OwnerID - { - get { return _OwnerID; } - set { _OwnerID = value; } - } - #region Factory Methods - public static int Execute(int sessionID, int itemID, CheckOutType itemType) - { - SessionCheckOutItem cmd = new SessionCheckOutItem(); - cmd.SessionID = sessionID; - cmd.ItemID = itemID; - cmd.ItemType = (int)itemType; - cmd = DataPortal.Execute(cmd); - return cmd.OwnerID; - } - #endregion - #region Server-Side code - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("vesp_SessionCheckOutItem", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.Parameters.AddWithValue("@SessionID", SessionID); - cmd.Parameters.AddWithValue("@ItemID", ItemID); - cmd.Parameters.AddWithValue("@ItemType", ItemType); - SqlParameter parm = cmd.Parameters.AddWithValue("@OwnerID", 0); - parm.Direction = ParameterDirection.Output; - cmd.ExecuteNonQuery(); - OwnerID = (int)cmd.Parameters["@OwnerID"].Value; - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session End Error", ex); - throw new ApplicationException("Failure on Session End", ex); - } - } - #endregion - } - public class SessionCheckInItem : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private int _OwnerID; - public int OwnerID - { - get { return _OwnerID; } - set { _OwnerID = value; } - } - private int _ItemID; - #region Factory Methods - public static void Execute(int ownerID) - { - SessionCheckInItem cmd = new SessionCheckInItem(); - cmd.OwnerID = ownerID; - DataPortal.Execute(cmd); - } - #endregion - #region Server-Side code - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("vesp_SessionCheckInItem", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.Parameters.AddWithValue("@OwnerID", OwnerID); - cmd.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session End Error", ex); - throw new ApplicationException("Failure on Session End", ex); - } - } - #endregion - } - #endregion - #region OwnerInfo stuff - public partial class OwnerInfoList - { - public static OwnerInfoList GetBySessionID(int sessionID) - { - OwnerInfoList tmp = DataPortal.Fetch(new GetBySessionIDCriteria(sessionID)); - return tmp; - } - [Serializable()] - protected class GetBySessionIDCriteria - { - private int _SessionID; - public int SessionID { get { return _SessionID; } } - public GetBySessionIDCriteria(int sessionID) - { - _SessionID = sessionID; - } - } - private void DataPortal_Fetch(GetBySessionIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getOwnersBySessionID"; - cm.Parameters.AddWithValue("@SessionID", criteria.SessionID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new OwnerInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("OwberInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - } - public partial class OwnerInfo - { - public static OwnerInfo GetBySessionIDandVersionID(int sessionID, int versionID) - { - try - { - OwnerInfo tmp = DataPortal.Fetch(new GetBySessionIDandVersionIDCriteria(sessionID, versionID)); - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up SessionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on OwnerInfo.GetBySessionIDandVersionID", ex); - } - } - [Serializable()] - protected class GetBySessionIDandVersionIDCriteria - { - private int _SessionID; - public int SessionID - { get { return _SessionID; } } - private int _VersionID; - public int VersionID - { get { return _VersionID; } } - public GetBySessionIDandVersionIDCriteria(int sessionID, int versionID) - { - _SessionID = sessionID; - _VersionID = versionID; - } - } - private void DataPortal_Fetch(GetBySessionIDandVersionIDCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getOwnerBySessionIDandVersionID"; - cm.Parameters.AddWithValue("@SessionID", criteria.SessionID); - cm.Parameters.AddWithValue("@VersionID", criteria.VersionID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("OwnerInfo.DataPortal_Fetch", ex); - } - } - public static OwnerInfo GetByItemID(int itemID, CheckOutType itemType) - { - try - { - OwnerInfo tmp = DataPortal.Fetch(new GetByItemIDCriteria(itemID, itemType)); - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up SessionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on OwnerInfo.GetByItemID", ex); - } - } - [Serializable()] - protected class GetByItemIDCriteria - { - private int _ItemID; - public int ItemID - { get { return _ItemID; } } - private CheckOutType _ItemType; - public CheckOutType ItemType - { get { return _ItemType; } } - public GetByItemIDCriteria(int itemID, CheckOutType itemType) - { - _ItemID = itemID; - _ItemType = itemType; - } - } - private void DataPortal_Fetch(GetByItemIDCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getOwnerByItemID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.Parameters.AddWithValue("@ItemType", (int)criteria.ItemType); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("OwnerInfo.DataPortal_Fetch", ex); - } - } - public string SessionUserID - { - get - { - SessionInfo si = SessionInfo.Get(this.SessionID); - return si.UserID; - } - } - } - #endregion - #region UserInfo stuff - public partial class UserInfo - { - public bool IsAdministrator() - { - if (this.UserMembershipCount == 0) - return false; - foreach (MembershipInfo mi in this.UserMemberships) - { - if (mi.EndDate == string.Empty) - { - foreach (AssignmentInfo ai in mi.MyGroup.GroupAssignments) - { - if (ai.FolderID == 1 && ai.MyRole.Name == "Administrator") - return true; - } - } - } - return false; - } - public bool IsSetAdministrator(FolderInfo fi) - { - if (this.UserMembershipCount == 0) - return false; - foreach (MembershipInfo mi in this.UserMemberships) - { - if (mi.EndDate == string.Empty) - { - Dictionary folders = new Dictionary(); - //FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID); - while (fi.FolderID > 1) - { - folders.Add(fi.FolderID, fi.FolderID); - fi = fi.MyParent; - } - folders.Add(1, 1); - foreach (AssignmentInfo ai in mi.MyGroup.GroupAssignments) - { - if (folders.ContainsKey(ai.FolderID) && ai.MyRole.Name == "Set Administrator") - return true; - } - } - } - return false; - } - public bool IsSetAdministrator(DocVersionInfo dv) - { - if (this.UserMembershipCount == 0) - return false; - foreach (MembershipInfo mi in this.UserMemberships) - { - if (mi.EndDate == string.Empty) - { - Dictionary folders = new Dictionary(); - FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID); - while (fi.FolderID > 1) - { - folders.Add(fi.FolderID, fi.FolderID); - fi = fi.MyParent; - } - folders.Add(1, 1); - foreach (AssignmentInfo ai in mi.MyGroup.GroupAssignments) - { - if (folders.ContainsKey(ai.FolderID) && ai.MyRole.Name == "Set Administrator") - return true; - } - } - } - return false; - } - public bool IsWriter(DocVersionInfo dv) - { - if (this.UserMembershipCount == 0) - return false; - foreach (MembershipInfo mi in this.UserMemberships) - { - if (mi.EndDate == string.Empty) - { - Dictionary folders = new Dictionary(); - FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID); - while (fi.FolderID > 1) - { - folders.Add(fi.FolderID, fi.FolderID); - fi = fi.MyParent; - } - folders.Add(1, 1); - foreach (AssignmentInfo ai in mi.MyGroup.GroupAssignments) - { - if (folders.ContainsKey(ai.FolderID) && ai.MyRole.Name == "Writer") - return true; - } - } - } - return false; - } - public bool IsReviewer(DocVersionInfo dv) - { - if (this.UserMembershipCount == 0) - return false; - foreach (MembershipInfo mi in this.UserMemberships) - { - if (mi.EndDate == string.Empty) - { - Dictionary folders = new Dictionary(); - FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID); - while (fi.FolderID > 1) - { - folders.Add(fi.FolderID, fi.FolderID); - fi = fi.MyParent; - } - folders.Add(1, 1); - foreach (AssignmentInfo ai in mi.MyGroup.GroupAssignments) - { - if (folders.ContainsKey(ai.FolderID) && ai.MyRole.Name == "Reviewer") - return true; - } - } - } - return false; - } - public bool IsROEditor(DocVersionInfo dv) - { - if (this.UserMembershipCount == 0) - return false; - foreach (MembershipInfo mi in this.UserMemberships) - { - if (mi.EndDate == string.Empty) - { - Dictionary folders = new Dictionary(); - FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID); - while (fi.FolderID > 1) - { - folders.Add(fi.FolderID, fi.FolderID); - fi = fi.MyParent; - } - folders.Add(1, 1); - foreach (AssignmentInfo ai in mi.MyGroup.GroupAssignments) - { - if (folders.ContainsKey(ai.FolderID) && ai.MyRole.Name == "RO Editor") - return true; - } - } - } - return false; - } - public static UserInfo GetByUserID(string userID) - { - try - { - UserInfo tmp = DataPortal.Fetch(new GetByUserIDCriteria(userID)); - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up SessionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on UserInfo.GetByUserID", ex); - } - } - [Serializable()] - protected class GetByUserIDCriteria - { - private string _UserID; - public string UserID - { get { return _UserID; } } - public GetByUserIDCriteria(string userID) - { - _UserID = userID; - } - } - private void DataPortal_Fetch(GetByUserIDCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] UserInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getUserByUserID"; - cm.Parameters.AddWithValue("@UserID", criteria.UserID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("UserInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("UserInfo.DataPortal_Fetch", ex); - } - } - } - #endregion -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs.org b/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs.org deleted file mode 100644 index 8454e66f..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/MultiUserExt.cs.org +++ /dev/null @@ -1,1286 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Data; -using System.Data.SqlClient; -using System.Text.RegularExpressions; -using Csla; -using Csla.Data; - -namespace VEPROMS.CSLA.Library -{ - #region Enum stuff - public enum CheckOutType : int - { - Procedure = 0, Document = 1, DocVersion = 2, Folder = 3, Session = 4 - } - #endregion - #region SessionInfoList stuff - public partial class SessionInfoList - { - [Serializable()] - public class CanCheckOutItemCriteria - { - private int _ObjectID; - public int ObjectID - { get { return _ObjectID; } } - private CheckOutType _ObjectType; - public CheckOutType ObjectType - { get { return _ObjectType; } } - public CanCheckOutItemCriteria(int objectID, CheckOutType objectType) - { - _ObjectID = objectID; - _ObjectType = objectType; - } - } - private void DataPortal_Fetch(CanCheckOutItemCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] SessionInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_SessionCanCheckOutItem"; - cm.Parameters.AddWithValue("@ObjectID", criteria.ObjectID); - cm.Parameters.AddWithValue("@ObjectType", criteria.ObjectType); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new SessionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("SessionInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("SessionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - } - #endregion - #region SessionInfo stuff - public partial class SessionInfo - { - private Int64 _LastContentChange; - public Int64 LastContentChange - { - get { return _LastContentChange; } - set { _LastContentChange = value; } - } - private byte[] _LastChanged = new byte[8]; - public byte[] LastChanged - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _LastChanged; - } - set { _LastChanged = value; } - } - public string LastChangedString - { - get { return ContentInfo.FormatByteArray(_LastChanged); } - } - public Int64 LastChangedInt64 - { - get { return Convert.ToInt64(LastChangedString, 16); } - } - public static SessionInfo BeginSession(string machineName, int processID) - { - try - { - SessionInfo tmp = DataPortal.Fetch(new BeginSessionCriteria(Volian.Base.Library.VlnSettings.UserID, machineName, processID)); - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up SessionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on SessionInfo.BeginSession", ex); - } - } - private Dictionary _ChangedContents; - public Dictionary ChangedContents - { - get { return _ChangedContents; } - set { _ChangedContents = value; } - } - private Dictionary _ChangedItems; - public Dictionary ChangedItems - { - get { return _ChangedItems; } - set { _ChangedItems = value; } - } - public List PingSession() - { - List myList = new List(); - SessionPing.Execute(this.SessionID); - ChangedContents = SessionChangedContents.Execute(this.LastContentChange); - ChangedItems = SessionChangedItems.Execute(this.LastContentChange); - OwnerInfoList oil = OwnerInfoList.GetBySessionID(this.SessionID); - foreach (OwnerInfo oi in oil) - myList.Add(oi.OwnerID); - return myList; - } - public void EndSession() - { - SessionEnd.Execute(this.SessionID); - } - public bool CanCheckOutItem(int objectID, CheckOutType objectType, ref string message) - { - try - { - SessionInfoList sil = DataPortal.Fetch(new SessionInfoList.CanCheckOutItemCriteria(objectID, objectType)); - if (sil.Count == 0) - return true; - if (objectType == CheckOutType.Session) - { - if (sil.Count == 1) - { - OwnerInfoList oil = OwnerInfoList.GetBySessionID(sil[0].SessionID); - if (oil.Count == 0) - return true; - else - { - message = "Export Procedure Set and Import Procedure Set are not available because you have open procedures or documents"; - return false; - } - } - else - { - message = "Export Procedure Set and Import Procedure Set are not available because there are other sessions open in the database"; - return false; - } - } - bool rv = true; - foreach (SessionInfo si in sil) - { - //if (si.SessionID != this.SessionID && objectType == CheckOutType.Procedure) - if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Procedure) - { - message = string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(objectID).MyProcedure.DisplayNumber, si.UserID); - rv = rv && false; - } - //else if (si.SessionID != this.SessionID && objectType == CheckOutType.Document) - else if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Document) - { - message = string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(objectID).DocumentEntries[0].MyContent.Text, si.UserID); - rv = rv && false; - } - else if (si.SessionID != this.SessionID && objectType == CheckOutType.DocVersion) - //else if (si.ProcessID != this.ProcessID && objectType == CheckOutType.DocVersion) - { - // gets here if other session has working draft open & click on sam working draft. - OwnerInfo oi = OwnerInfo.GetBySessionIDandVersionID(si.SessionID, objectID); - if (oi == null) - message = message + string.Format("The working draft is already checked out to {0}", si.UserID) + Environment.NewLine; - else if(oi.OwnerType == 0) - message = message + string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(oi.OwnerItemID).MyProcedure.DisplayNumber, si.UserID) + Environment.NewLine; - else if (oi.OwnerType == 1) - message = message + string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(oi.OwnerItemID).DocumentEntries[0].MyContent.Text, si.UserID) + Environment.NewLine; - else if (oi.OwnerType == 2) - message = message + string.Format("The working draft is already checked out to {0}", si.UserID); - rv = rv && false; - } - else if (si.SessionID != this.SessionID && objectType == CheckOutType.Folder) - //else if (si.ProcessID != this.ProcessID && objectType == CheckOutType.Folder) - { - // gets here if other session has working draft open & click on folder above. Gets here - // if other session has wd open and click on top folder - query returns empty. - OwnerInfo oi = OwnerInfo.GetBySessionIDandFolderID(si.SessionID, objectID); - if (oi != null) - { - if (oi.OwnerType == 0) - message = message + string.Format("The procedure {0} is already checked out to {1}", ItemInfo.Get(oi.OwnerItemID).MyProcedure.DisplayNumber, si.UserID) + Environment.NewLine; - else if (oi.OwnerType == 1) - message = message + string.Format("The document {0} is already checked out to {1}", DocumentInfo.Get(oi.OwnerItemID).DocumentEntries[0].MyContent.Text, si.UserID) + Environment.NewLine; - else if (oi.OwnerType == 2) - message = message + string.Format("The working draft is already checked out to {0}", si.UserID); - else if (oi.OwnerType == 3) - message = message + string.Format("The folder is already checked out to {0}", si.UserID); - rv = rv && false; - } - } - } - return rv; - } - catch (Exception ex) - { - throw new DbCslaException("Error on SessionInfo.Get", ex); - } - } - public int CheckOutItem(int itemID, CheckOutType itemType) - { - int ownerID = SessionCheckOutItem.Execute(this.SessionID, itemID, itemType); - return ownerID; - } - public void CheckInItem(int ownerID) - { - SessionCheckInItem.Execute(ownerID); - } - private void DataPortal_Fetch(BeginSessionCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] SessionInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_SessionBegin"; - cm.Parameters.AddWithValue("@UserID", criteria.UserID); - cm.Parameters.AddWithValue("@MachineName", criteria.MachineName); - cm.Parameters.AddWithValue("@ProcessID", criteria.ProcessID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("SessionInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("SessionInfo.DataPortal_Fetch", ex); - } - } - //private void DataPortal_Fetch(CanCheckOutItemCriteria criteria) - //{ - // if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] SessionInfo.DataPortal_Fetch", GetHashCode()); - // try - // { - // using (SqlConnection cn = Database.VEPROMS_SqlConnection) - // { - // ApplicationContext.LocalContext["cn"] = cn; - // using (SqlCommand cm = cn.CreateCommand()) - // { - // cm.CommandType = CommandType.StoredProcedure; - // cm.CommandText = "vesp_SessionCanCheckOutItem"; - // cm.Parameters.AddWithValue("@ObjectID", criteria.ObjectID); - // cm.Parameters.AddWithValue("@ObjectType", criteria.ObjectType); - // using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - // { - // while(dr.Read()) - - // if (!dr.Read()) - // { - // _ErrorMessage = "No Record Found"; - // return; - // } - // ReadData(dr); - // } - // } - // // removing of item only needed for local data portal - // if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - // ApplicationContext.LocalContext.Remove("cn"); - // } - // } - // catch (Exception ex) - // { - // if (_MyLog.IsErrorEnabled) _MyLog.Error("SessionInfo.DataPortal_Fetch", ex); - // _ErrorMessage = ex.Message; - // throw new DbCslaException("SessionInfo.DataPortal_Fetch", ex); - // } - //} - [Serializable()] - protected class BeginSessionCriteria - { - private string _UserID; - public string UserID - { get { return _UserID; } } - private string _MachineName; - public string MachineName - { get { return _MachineName; } } - private int _ProcessID; - public int ProcessID - { get { return _ProcessID; } } - public BeginSessionCriteria(string userID, string machineName, int processID) - { - _UserID = userID; - _MachineName = machineName; - _ProcessID = processID; - } - } - //[Serializable()] - //protected class CanCheckOutItemCriteria - //{ - // private int _ObjectID; - // public int ObjectID - // { get { return _ObjectID; } } - // private CheckOutType _ObjectType; - // public CheckOutType ObjectType - // { get { return _ObjectType; } } - // public CanCheckOutItemCriteria(int objectID, CheckOutType objectType) - // { - // _ObjectID = objectID; - // _ObjectType = objectType; - // } - //} - } - public class TurnChangeManagerOff : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #region Factory Methods - public static void Execute() - { - TurnChangeManagerOff cmd = new TurnChangeManagerOff(); - DataPortal.Execute(cmd); - } - #endregion - #region Server-Side code - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("vesp_TurnChangeManagerOFF", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("TurnChangeManagerOff Error", ex); - throw new ApplicationException("Failure on TurnChangeManagerOff", ex); - } - } - #endregion - } - public class TurnChangeManagerOn : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #region Factory Methods - public static void Execute() - { - TurnChangeManagerOn cmd = new TurnChangeManagerOn(); - DataPortal.Execute(cmd); - } - #endregion - #region Server-Side code - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("vesp_TurnChangeManagerON", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("TurnChangeManagerOn Error", ex); - throw new ApplicationException("Failure on TurnChangeManagerOn", ex); - } - } - #endregion - } - public class ResetSecurity : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #region Factory Methods - public static void Execute() - { - ResetSecurity cmd = new ResetSecurity(); - DataPortal.Execute(cmd); - } - #endregion - #region Server-Side code - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("vesp_ResetSecurity", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Reset Security Error", ex); - throw new ApplicationException("Failure on Reset Security", ex); - } - } - #endregion - } - public class SessionPing : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private int _SessionID; - public int SessionID - { - get { return _SessionID; } - set { _SessionID = value; } - } - #region Factory Methods - public static void Execute(int sessionID) - { - try - { - SessionPing cmd = new SessionPing(); - cmd.SessionID = sessionID; - DataPortal.Execute(cmd); - } - catch (Exception ex) - { - _MyLog.Warn("Session Ping Failure", ex); - } - } - #endregion - #region Server-Side code - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("vesp_SessionPing", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.Parameters.AddWithValue("@SessionID", SessionID); - cmd.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session Ping Error", ex); - throw new ApplicationException("Failure on Session Ping", ex); - } - } - #endregion - } - public class SessionEnd : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private int _SessionID; - public int SessionID - { - get { return _SessionID; } - set { _SessionID = value; } - } - #region Factory Methods - public static void Execute(int sessionID) - { - SessionEnd cmd = new SessionEnd(); - cmd.SessionID = sessionID; - DataPortal.Execute(cmd); - } - #endregion - #region Server-Side code - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("vesp_SessionEnd", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.Parameters.AddWithValue("@SessionID", SessionID); - cmd.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session End Error", ex); - throw new ApplicationException("Failure on Session End", ex); - } - } - #endregion - } - public class SessionCheckOutItem : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private int _SessionID; - public int SessionID - { - get { return _SessionID; } - set { _SessionID = value; } - } - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - private int _ItemType; - public int ItemType - { - get { return _ItemType; } - set { _ItemType = value; } - } - private int _OwnerID; - public int OwnerID - { - get { return _OwnerID; } - set { _OwnerID = value; } - } - #region Factory Methods - public static int Execute(int sessionID, int itemID, CheckOutType itemType) - { - SessionCheckOutItem cmd = new SessionCheckOutItem(); - cmd.SessionID = sessionID; - cmd.ItemID = itemID; - cmd.ItemType = (int)itemType; - cmd = DataPortal.Execute(cmd); - return cmd.OwnerID; - } - #endregion - #region Server-Side code - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("vesp_SessionCheckOutItem", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.Parameters.AddWithValue("@SessionID", SessionID); - cmd.Parameters.AddWithValue("@ItemID", ItemID); - cmd.Parameters.AddWithValue("@ItemType", ItemType); - SqlParameter parm = cmd.Parameters.AddWithValue("@OwnerID", 0); - parm.Direction = ParameterDirection.Output; - cmd.ExecuteNonQuery(); - OwnerID = (int)cmd.Parameters["@OwnerID"].Value; - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session End Error", ex); - throw new ApplicationException("Failure on Session End", ex); - } - } - #endregion - } - public class SessionCheckInItem : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private int _OwnerID; - public int OwnerID - { - get { return _OwnerID; } - set { _OwnerID = value; } - } - private int _ItemID; - #region Factory Methods - public static void Execute(int ownerID) - { - SessionCheckInItem cmd = new SessionCheckInItem(); - cmd.OwnerID = ownerID; - DataPortal.Execute(cmd); - } - #endregion - #region Server-Side code - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("vesp_SessionCheckInItem", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.Parameters.AddWithValue("@OwnerID", OwnerID); - cmd.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session End Error", ex); - throw new ApplicationException("Failure on Session End", ex); - } - } - #endregion - } - public class SessionChangedContents : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private Int64 _LastContentChange; - public Int64 LastContentChange - { - get { return _LastContentChange; } - set { _LastContentChange = value; } - } - private Dictionary _ChangedContents; - public Dictionary ChangedContents - { - get { return _ChangedContents; } - set { _ChangedContents = value; } - } - #region Factory Methods - public static Dictionary Execute(Int64 lastContentChanged) - { - SessionChangedContents cmd = new SessionChangedContents(); - cmd.LastContentChange = lastContentChanged; - cmd = DataPortal.Execute(cmd); - return cmd.ChangedContents; - } - #endregion - #region Server-Side Code - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("vesp_ListContentsAfterLastChanged2", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.Parameters.AddWithValue("@LastChanged", LastContentChange); - cmd.Parameters.AddWithValue("@UserID", Volian.Base.Library.VlnSettings.UserID); - SqlDataReader dr = cmd.ExecuteReader(); - ChangedContents = new Dictionary(); - while (dr.Read()) - ChangedContents.Add(dr.GetInt32(0), (Int64)dr.GetSqlInt64(1)); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("SessionChangedContents Error", ex); - throw new ApplicationException("Failure on SessionChangedContents", ex); - } - } - #endregion - } - public class SessionChangedItems : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private Int64 _LastContentChange; - public Int64 LastContentChange - { - get { return _LastContentChange; } - set { _LastContentChange = value; } - } - private Dictionary _ChangedItems; - public Dictionary ChangedItems - { - get { return _ChangedItems; } - set { _ChangedItems = value; } - } - #region Factory Methods - public static Dictionary Execute(Int64 lastContentChanged) - { - SessionChangedItems cmd = new SessionChangedItems(); - cmd.LastContentChange = lastContentChanged; - cmd = DataPortal.Execute(cmd); - return cmd.ChangedItems; - } - #endregion - #region Server-Side Code - protected override void DataPortal_Execute() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("vesp_ListItemsAfterLastChanged", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.Parameters.AddWithValue("@LastChanged", LastContentChange); - cmd.Parameters.AddWithValue("@UserID", Volian.Base.Library.VlnSettings.UserID); - SqlDataReader dr = cmd.ExecuteReader(); - ChangedItems = new Dictionary(); - while (dr.Read()) - ChangedItems.Add(dr.GetInt32(0), (Int64)dr.GetSqlInt64(1)); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("SessionChangedItems Error", ex); - throw new ApplicationException("Failure on SessionChangedItems", ex); - } - } - #endregion - } - #endregion - #region OwnerInfo stuff - public partial class OwnerInfoList - { - public static OwnerInfoList GetBySessionID(int sessionID) - { - OwnerInfoList tmp = DataPortal.Fetch(new GetBySessionIDCriteria(sessionID)); - return tmp; - } - [Serializable()] - protected class GetBySessionIDCriteria - { - private int _SessionID; - public int SessionID { get { return _SessionID; } } - public GetBySessionIDCriteria(int sessionID) - { - _SessionID = sessionID; - } - } - private void DataPortal_Fetch(GetBySessionIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getOwnersBySessionID"; - cm.Parameters.AddWithValue("@SessionID", criteria.SessionID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new OwnerInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("OwnerInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - public static OwnerInfoList GetByVersionID(int versionID) - { - try - { - OwnerInfoList tmp = DataPortal.Fetch(new GetByVersionIDCriteria(versionID)); - return tmp; - } - catch (Exception ex) - { - if (ex.Message.Contains("Could not find stored procedure")) - System.Windows.Forms.MessageBox.Show("Have your DBA run the latest version of PROMSFixes.SQL", "SQL code is not current", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation); - return null; - } - } - [Serializable()] - protected class GetByVersionIDCriteria - { - private int _VersionID; - public int VersionID { get { return _VersionID; } } - public GetByVersionIDCriteria(int versionID) - { - _VersionID = versionID; - } - } - private void DataPortal_Fetch(GetByVersionIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getOwnersByVersionID"; - cm.Parameters.AddWithValue("@VersionID", criteria.VersionID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new OwnerInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("OwnerInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - } - public partial class OwnerInfo - { - public static OwnerInfo GetBySessionIDandFolderID(int sessionID, int folderID) - { - try - { - OwnerInfo tmp = DataPortal.Fetch(new GetBySessionIDandFolderIDCriteria(sessionID, folderID)); - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up SessionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on OwnerInfo.GetBySessionIDandFolderID", ex); - } - } - [Serializable()] - protected class GetBySessionIDandFolderIDCriteria - { - private int _SessionID; - public int SessionID - { get { return _SessionID; } } - private int _FolderID; - public int FolderID - { get { return _FolderID; } } - public GetBySessionIDandFolderIDCriteria(int sessionID, int folderID) - { - _SessionID = sessionID; - _FolderID = folderID; - } - } - private void DataPortal_Fetch(GetBySessionIDandFolderIDCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getOwnerBySessionIDandFolderID"; - cm.Parameters.AddWithValue("@SessionID", criteria.SessionID); - cm.Parameters.AddWithValue("@FolderID", criteria.FolderID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("OwnerInfo.DataPortal_Fetch", ex); - } - } - public static OwnerInfo GetBySessionIDandVersionID(int sessionID, int versionID) - { - try - { - OwnerInfo tmp = DataPortal.Fetch(new GetBySessionIDandVersionIDCriteria(sessionID, versionID)); - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up SessionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on OwnerInfo.GetBySessionIDandVersionID", ex); - } - } - [Serializable()] - protected class GetBySessionIDandVersionIDCriteria - { - private int _SessionID; - public int SessionID - { get { return _SessionID; } } - private int _VersionID; - public int VersionID - { get { return _VersionID; } } - public GetBySessionIDandVersionIDCriteria(int sessionID, int versionID) - { - _SessionID = sessionID; - _VersionID = versionID; - } - } - private void DataPortal_Fetch(GetBySessionIDandVersionIDCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getOwnerBySessionIDandVersionID"; - cm.Parameters.AddWithValue("@SessionID", criteria.SessionID); - cm.Parameters.AddWithValue("@VersionID", criteria.VersionID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("OwnerInfo.DataPortal_Fetch", ex); - } - } - public static OwnerInfo GetByItemID(int itemID, CheckOutType itemType) - { - try - { - OwnerInfo tmp = DataPortal.Fetch(new GetByItemIDCriteria(itemID, itemType)); - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up SessionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on OwnerInfo.GetByItemID", ex); - } - } - [Serializable()] - protected class GetByItemIDCriteria - { - private int _ItemID; - public int ItemID - { get { return _ItemID; } } - private CheckOutType _ItemType; - public CheckOutType ItemType - { get { return _ItemType; } } - public GetByItemIDCriteria(int itemID, CheckOutType itemType) - { - _ItemID = itemID; - _ItemType = itemType; - } - } - private void DataPortal_Fetch(GetByItemIDCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getOwnerByItemID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.Parameters.AddWithValue("@ItemType", (int)criteria.ItemType); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("OwnerInfo.DataPortal_Fetch", ex); - } - } - public string SessionUserID - { - get - { - SessionInfo si = SessionInfo.Get(this.SessionID); - return si.UserID; - } - } - } - #endregion - #region UserInfo stuff - public partial class UserInfo - { - public static bool CanEdit(UserInfo myUserInfo, DocVersionInfo myDVI) - { - return myUserInfo!=null && myDVI!=null && (myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(myDVI) || myUserInfo.IsWriter(myDVI)); - } - public static bool CanEditROs(UserInfo myUserInfo, DocVersionInfo myDVI) - { - return myUserInfo != null && myDVI != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(myDVI) || myUserInfo.IsROEditor(myDVI); - } - public static bool CanCreateFolders(UserInfo myUserInfo, DocVersionInfo myDVI) - { - return myUserInfo != null && myDVI != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(myDVI); - } - public static bool CanCreateFolders(UserInfo myUserInfo, FolderInfo fi) - { - return myUserInfo != null && fi != null && myUserInfo.IsAdministrator() || myUserInfo.IsSetAdministrator(fi); - } - public bool IsAdministrator() - { - if (this.UserMembershipCount == 0) - return false; - foreach (MembershipInfo mi in this.UserMemberships) - { - if (mi.EndDate == string.Empty) - { - foreach (AssignmentInfo ai in mi.MyGroup.GroupAssignments) - { - if (ai.FolderID == 1 && ai.MyRole.Name == "Administrator") - return true; - } - } - } - return false; - } - public bool IsSetAdministrator(FolderInfo fi) - { - if (this.UserMembershipCount == 0) - return false; - foreach (MembershipInfo mi in this.UserMemberships) - { - if (mi.EndDate == string.Empty) - { - Dictionary folders = new Dictionary(); - //FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID); - while (fi.FolderID > 1) - { - folders.Add(fi.FolderID, fi.FolderID); - fi = fi.MyParent; - } - folders.Add(1, 1); - foreach (AssignmentInfo ai in mi.MyGroup.GroupAssignments) - { - if (folders.ContainsKey(ai.FolderID) && ai.MyRole.Name == "Set Administrator") - return true; - } - } - } - return false; - } - public bool IsSetAdministrator(DocVersionInfo dv) - { - if (this.UserMembershipCount == 0) - return false; - foreach (MembershipInfo mi in this.UserMemberships) - { - if (mi.EndDate == string.Empty) - { - Dictionary folders = new Dictionary(); - FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID); - while (fi.FolderID > 1) - { - folders.Add(fi.FolderID, fi.FolderID); - fi = fi.MyParent; - } - folders.Add(1, 1); - foreach (AssignmentInfo ai in mi.MyGroup.GroupAssignments) - { - if (folders.ContainsKey(ai.FolderID) && ai.MyRole.Name == "Set Administrator") - return true; - } - } - } - return false; - } - public bool IsWriter(DocVersionInfo dv) - { - if (this.UserMembershipCount == 0) - return false; - foreach (MembershipInfo mi in this.UserMemberships) - { - if (mi.EndDate == string.Empty) - { - Dictionary folders = new Dictionary(); - FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID); - while (fi.FolderID > 1) - { - folders.Add(fi.FolderID, fi.FolderID); - fi = fi.MyParent; - } - folders.Add(1, 1); - foreach (AssignmentInfo ai in mi.MyGroup.GroupAssignments) - { - if (folders.ContainsKey(ai.FolderID) && ai.MyRole.Name == "Writer") - return true; - } - } - } - return false; - } - public bool IsReviewer(DocVersionInfo dv) - { - if (this.UserMembershipCount == 0) - return false; - foreach (MembershipInfo mi in this.UserMemberships) - { - if (mi.EndDate == string.Empty) - { - Dictionary folders = new Dictionary(); - FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID); - while (fi.FolderID > 1) - { - folders.Add(fi.FolderID, fi.FolderID); - fi = fi.MyParent; - } - folders.Add(1, 1); - foreach (AssignmentInfo ai in mi.MyGroup.GroupAssignments) - { - if (folders.ContainsKey(ai.FolderID) && ai.MyRole.Name == "Reviewer") - return true; - } - } - } - return false; - } - public bool IsROEditor(DocVersionInfo dv) - { - if (this.UserMembershipCount == 0) - return false; - foreach (MembershipInfo mi in this.UserMemberships) - { - if (mi.EndDate == string.Empty) - { - Dictionary folders = new Dictionary(); - FolderInfo fi = FolderInfo.Get(dv.MyFolder.FolderID); - while (fi.FolderID > 1) - { - folders.Add(fi.FolderID, fi.FolderID); - fi = fi.MyParent; - } - folders.Add(1, 1); - foreach (AssignmentInfo ai in mi.MyGroup.GroupAssignments) - { - if (folders.ContainsKey(ai.FolderID) && ai.MyRole.Name == "RO Editor") - return true; - } - } - } - return false; - } - public static UserInfo GetByUserID(string userID) - { - try - { - UserInfo tmp = DataPortal.Fetch(new GetByUserIDCriteria(userID)); - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up SessionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on UserInfo.GetByUserID", ex); - } - } - [Serializable()] - protected class GetByUserIDCriteria - { - private string _UserID; - public string UserID - { get { return _UserID; } } - public GetByUserIDCriteria(string userID) - { - _UserID = userID; - } - } - private void DataPortal_Fetch(GetByUserIDCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] UserInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getUserByUserID"; - cm.Parameters.AddWithValue("@UserID", criteria.UserID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("UserInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("UserInfo.DataPortal_Fetch", ex); - } - } - } - #endregion -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/PermissionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/PermissionExt.cs deleted file mode 100644 index cd20042e..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/PermissionExt.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Csla; - -namespace VEPROMS.CSLA.Library -{ - public partial class Permission - { - private static List _permADLookup; - private static List _permLevelLookup; - private static void setupLookup() - { - if (_permADLookup == null) - { - _permADLookup = new List(); - _permADLookup.Add(new vlnValueKey(0,"Allow")); - _permADLookup.Add(new vlnValueKey(1, "Deny")); - } - if (_permLevelLookup == null) - { - _permLevelLookup = new List(); - _permLevelLookup.Add(new vlnValueKey(0, "Security")); - _permLevelLookup.Add(new vlnValueKey(1, "System")); - _permLevelLookup.Add(new vlnValueKey(2, "RO")); - _permLevelLookup.Add(new vlnValueKey(3, "Procedure")); - _permLevelLookup.Add(new vlnValueKey(4, "Sections")); - _permLevelLookup.Add(new vlnValueKey(5, "Steps")); - _permLevelLookup.Add(new vlnValueKey(6, "Comments")); - } - } - public static List PermADLookup - { - get { setupLookup(); return _permADLookup; } - } - public static List PermLevelLookup - { - get { setupLookup(); return _permLevelLookup; } - } - public bool ReadAccess - { - get { return ((PermValue & 1) == 1); } - set { PermValue = (value?PermValue|1:PermValue^(PermValue&1));} - } - public bool WriteAccess - { - get { return ((PermValue & 2) == 2); } - set { PermValue = (value ? PermValue | 2 : PermValue ^ (PermValue & 2)); } - } - public bool CreateAccess - { - get { return ((PermValue & 4) == 4); } - set { PermValue = (value ? PermValue | 4 : PermValue ^ (PermValue & 4)); } - } - public bool DeleteAccess - { - get { return ((PermValue & 8) == 8); } - set { PermValue = (value ? PermValue | 8 : PermValue ^ (PermValue & 8)); } - } - // partial class Extension : extensionBase - // { - // TODO: Override automatic defaults - // public virtual int DefaultPermad - // { - // get { return 0; } - // } - // public virtual SmartDate DefaultStartDate - // { - // get { return DateTime.Now.ToShortDateString(); } - // } - // public virtual DateTime DefaultDts - // { - // get { return DateTime.Now; } - // } - // public virtual string DefaultUsrid - // { - // get { return Environment.UserName.ToUpper(); } - // } - // public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - // { - // //rules.AllowRead(Dbid, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs.bak b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs.bak deleted file mode 100644 index 592ff8c8..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTExt.cs.bak +++ /dev/null @@ -1,808 +0,0 @@ -// ======================================================================== -// Copyright 2006 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text; -using System.IO; -using System.Xml.Serialization; -using System.Xml; -using System.Xml.XPath; -using System.Text.RegularExpressions; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; - -namespace VEPROMS.CSLA.Library -{ - public partial class ROFst - { - // put in for debug - //public static int CacheCountPrimaryKey - //{ get { return _CacheByPrimaryKey.Count; } } - //public static int CacheCountByRODbID_DTS - //{ get { return _CacheByRODbID_DTS.Count; } } - //public static int CacheCountList - //{ get { return _CacheList.Count; } } - - [NonSerialized] - private ROFSTLookup _ROFSTLookup; - public ROFSTLookup ROFSTLookup - { - get - { - if (_ROFSTLookup == null) - { - _ROFSTLookup = new ROFSTLookup(this); - } - return _ROFSTLookup; - } - } - public static ROFst GetJustROFst(int rOFstID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a ROFst"); - try - { - ROFst tmp = GetCachedByPrimaryKey(rOFstID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteriaJustROFst(rOFstID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ROFst - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFst.Get", ex); - } - } - [Serializable()] - protected class PKCriteriaJustROFst - { - private int _ROFstID; - public int ROFstID - { get { return _ROFstID; } } - public PKCriteriaJustROFst(int rOFstID) - { - _ROFstID = rOFstID; - } - } - private void DataPortal_Fetch(PKCriteriaJustROFst criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getJustROFst"; - cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - //dr.NextResult(); - //_ROFstAssociations = ROFstAssociations.Get(dr); - // load child objects - //dr.NextResult(); - //_ROFstFigures = ROFstFigures.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFst.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROFst.DataPortal_Fetch", ex); - } - } - - } - public delegate List ROFstInfoROTableUpdateEvent(object sender, ROFstInfoROTableUpdateEventArgs args); - public partial class ROFstInfo - { - // put in for debug - //public static int CacheCountPrimaryKey - //{ get { return _CacheByPrimaryKey.Count; } } - //public static int CacheCountList - //{ get { return _CacheList.Count; } } - #region Log4Net - private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region PropertiesAndData - private DocVersionInfo _docVer; - public DocVersionInfo docVer - { - get - { - if (_docVer == null) - { - if (ROFstAssociations.Count == 0) return null; -// _docVer = DocVersion.Get(this.ROFstAssociations[0].MyDocVersion.VersionID); - _docVer = this.ROFstAssociations[0].MyDocVersion; - } - return _docVer; - } - set - { - _docVer = value; - - } - } - [NonSerialized] - private ROFSTLookup _ROFSTLookup; - public ROFSTLookup ROFSTLookup - { - get - { - if (_ROFSTLookup == null) - { - _ROFSTLookup = new ROFSTLookup(this); - } - return _ROFSTLookup; - } - } - #endregion - #region AppSupport - //public static ROImageInfo Get(RODbInfo rodbinfo, string filename) - //{ - // if (rodbinfo.RODbROImageCount != 0) - // { - // foreach (ROImageInfo ri in rodbinfo.RODbROImages) - // { - // if (ri.FileName == filename) return ri; - // } - // } - // return null; - //} - public string GetDefaultROPrefix() - { - if (docVer != null) - return docVer.DocVersionConfig.RODefaults_setpointprefix; - else - return "SP1"; // Not Sure about this... - } - public string GetDefaultGraphicsPrefix() - { - if (docVer != null) - return docVer.DocVersionConfig.RODefaults_graphicsprefix; - else - return "IG1"; // Not Sure about this... - } - #region Add New Ro Fst - /// - /// Adds an ro.fst into a sql database. - /// - /// - /// ROFst: Returns the created rofst object - public static ROFst AddRoFst(RODbInfo rdi, DocVersion docver) - { - string rofstfilepath = rdi.FolderPath + @"\ro.fst"; - DirectoryInfo di = new DirectoryInfo(rdi.FolderPath); - if (!di.Exists) return null; - if (!File.Exists(rofstfilepath)) return null; - - // check if this rofst has been loaded, i.e. dts on file versus dts in db... - // if so, just make association with docversion. - ROFst rofst = ROFst.GetByRODbID_DTS(rdi.RODbID, di.LastWriteTimeUtc); - if (rofst != null) - { - docver.DocVersionAssociations.Add(rofst); - docver.Save(); - return rofst; - } - - // Next read in the rofst & make the rofst record. - FileStream fsIn = new FileStream(rofstfilepath, FileMode.Open, FileAccess.Read, FileShare.Read); - // Create an instance of StreamReader that can read characters from the FileStream. - BinaryReader r = new BinaryReader(fsIn); - byte[] ab = r.ReadBytes((int)fsIn.Length); - fsIn.Close(); - - using (RODb rodb = RODb.Get(rdi.RODbID)) - { - using (ROImageInfoList myROImages = ROImageInfoList.GetByRODbID(rdi.RODbID)) - { - Dictionary myExistingROImages = BuildROImagesList(myROImages); - List myUnChangedROImages = new List(); - List myAddedROImages = new List(); - rofst = ROFst.MakeROFst(rodb, ab, null, di.LastWriteTimeUtc, rdi.UserID); - // Hook this into the current docversion by replacing the rofstid field in the doc version - // association object: - docver.DocVersionAssociations.Add(rofst); - docver.Save(); - - // Now load any images in... type 8 - integrated graphics ro type - for (int i = 0; i < rofst.ROFSTLookup.myHdr.myDbs.Length; i++) - { - // walk through the rofst 'database' searching for all nodes that are integrated graphics, type 8: - if (rofst.ROFSTLookup.myHdr.myDbs[i].children != null) - { - using (ROFstInfo rfi = ROFstInfo.Get(rofst.ROFstID)) - { - rfi.MigrateRoFstGraphics(rdi, rofst.ROFSTLookup.myHdr.myDbs[i].children, rodb, rofst, myExistingROImages, myUnChangedROImages, myAddedROImages);// TODO: Need to add MyImages - } - } - } - if (myUnChangedROImages.Count > 0) - using (FigureInfoList fil = FigureInfoList.AddByROFstIDImageIDs(rofst.ROFstID, buildImageIDString(myUnChangedROImages))) ; - return rofst; - } - } - } - #endregion - #region Update Ro Values - /// - /// Updates an ro.fst into a sql database. - /// - /// - /// ROFst: Returns the created rofst object - public static ROFst UpdateRoFst(RODbInfo rdi, DocVersionAssociation dva, DocVersion docver, ROFstInfo origROFst) - { - DirectoryInfo di = new DirectoryInfo(rdi.FolderPath); - // check if this rofst has been loaded, i.e. dts on file versus dts in db... - // if so, just make association to existing with docversion. - ROFst rofst = ROFst.GetByRODbID_DTS(rdi.RODbID, di.LastWriteTimeUtc); - if (rofst != null) - { - docver.DocVersionAssociations[0].MyROFst = rofst; - docver.Save(); - return rofst; - } - - // Read in the rofst & make the rofst record. - string rofstfilepath = rdi.FolderPath + @"\ro.fst"; - FileStream fsIn = new FileStream(rofstfilepath, FileMode.Open, FileAccess.Read, FileShare.Read); - // Create an instance of StreamReader that can read characters from the FileStream. - BinaryReader r = new BinaryReader(fsIn); - byte[] ab = r.ReadBytes((int)fsIn.Length); - fsIn.Close(); - using (RODb rodb = RODb.GetJustRoDb(rdi.RODbID)) - { - rofst = ROFst.MakeROFst(rodb, ab, null, di.LastWriteTimeUtc, rdi.UserID); - // Hook this into the current docversion by replacing the rofstid field in the doc version - // association object: - dva.MyROFst = rofst; - docver.Save(); - // Now load any images in... type 8 - integrated graphics ro type - using (ROImageInfoList myROImages = ROImageInfoList.GetByRODbIDNoData(rdi.RODbID)) - { - Dictionary myExistingROImages = BuildROImagesList(myROImages); - List myUnChangedROImages = new List(); - List myAddedROImages = new List(); - using (ROFstInfo rfi = ROFstInfo.Get(rofst.ROFstID)) - { - for (int i = 0; i < rofst.ROFSTLookup.myHdr.myDbs.Length; i++) - { - // walk through the rofst 'database' searching for all nodes that are integrated graphics, type 8: - if (rofst.ROFSTLookup.myHdr.myDbs[i].children != null) - { - rfi.MigrateRoFstGraphics(rdi, rofst.ROFSTLookup.myHdr.myDbs[i].children, rodb, rofst, myExistingROImages, myUnChangedROImages, myAddedROImages); - } - } - } - // Add references for existing RO Images to the Figure table (Figure table relates ro.fst with its images) - if (myUnChangedROImages.Count > 0) - using (FigureInfoList fil = FigureInfoList.AddByROFstIDImageIDs(rofst.ROFstID, buildImageIDString(myUnChangedROImages))) ; - } - // Now update the usages: compare old to new rofsts and update usages accordingly, i.e. modified - // values, deleted ros, etc. - UpdateROValuesText(origROFst, rofst); - return rofst; - } - } - private static Dictionary BuildROImagesList(ROImageInfoList myROImages) - { - Dictionary myRoImagesList = new Dictionary(); - foreach (ROImageInfo myROImage in myROImages) - myRoImagesList.Add(ROImageKey(myROImage.FileName, myROImage.DTS),myROImage.ImageID); - return myRoImagesList; - } - private static string ROImageKey(string fileName, DateTime dts) - { - return string.Format("{0}:{1}", fileName, dts); - } - private static string buildImageIDString(List myROImageIDs) - { - StringBuilder sb = new StringBuilder(); - string sep = ""; - foreach (int imageID in myROImageIDs) - { - sb.Append(sep + imageID.ToString()); - sep = ","; - } - return sb.ToString(); - } - private static void UpdateROValuesText(ROFstInfo origROFstInfo, ROFst newROFst) - { - ROFSTLookup origLU = new ROFSTLookup(origROFstInfo); - ROFSTLookup newLU = new ROFSTLookup(newROFst); - List delList = new List(); - List chgList = newLU.GetValueDifferences(origLU, ref delList); - string RoidList = GetRoidList(newROFst.RODbID, chgList); - List activeRoids = BuildActiveROIDsForRoUsages(RoidList); - foreach (string chg in chgList) - { - if (activeRoids.Contains(chg)) - { - ROFSTLookup.rochild roch = newLU.GetRoChild(chg); - string desc = string.Format("Change in RO Values: Old value = {0}, New value = {1}", origLU.GetRoValue(chg), 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; - using (RoUsageInfoList affected = RoUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroid, desc, "Changed")) - { - foreach (RoUsageInfo roUsg in affected) - { - using (Content content = Content.Get(roUsg.MyContent.ContentID)) - { - foreach (ItemInfo ii in roUsg.MyContent.ContentItems) - { - string val = newLU.GetTranslatedRoValue(padroid, ii.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta); - content.FixContentText(roUsg, val, roch.type, 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(); - } - } - } - } - } - } - } - activeRoids = BuildActiveROIDsForDRoUsages(RoidList); - foreach (string chg in chgList) - { - if (activeRoids.Contains(chg)) - { - ROFSTLookup.rochild roch = newLU.GetRoChild(chg); - string desc = string.Format("Change in RO Values: Old value = {0}, New value = {1}", origLU.GetRoValue(chg), 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; - using (DROUsageInfoList affected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroid.Substring(0,12), desc, "Changed")) - { - foreach (DROUsageInfo droUsg in affected) - { - Pdf.DeleteAll(droUsg.DocID); - } - } - } - } - foreach (string del in delList) - { - string desc = string.Format("Deleted RO: Value = {0}", origLU.GetRoValue(del)); - string padroiddel = del.Length <= 12 ? del + "0000" : del; - using (RoUsageInfoList affected = RoUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, padroiddel, desc, "Deleted")) - { - 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(); - } - } - } - } - using (DROUsageInfoList Daffected = DROUsageInfoList.GetAffected(origROFstInfo.MyRODb.RODbID, del.Substring(0,12), desc, "Deleted")) - { - foreach (DROUsageInfo droUsg in Daffected) - { - Pdf.DeleteAll(droUsg.DocID); - } - } - } - } - private static List BuildActiveROIDsForRoUsages(string RoidList) - { - List activeRoids = new List(); - using (RoUsageInfoList activeList = RoUsageInfoList.GetROUSagesByROIDs(RoidList)) - { - foreach (RoUsageInfo roui in activeList) - { - string roid = roui.ROID.ToUpper(); - if (roid.EndsWith("0000")) roid = roid.Substring(0, 12); - if (!activeRoids.Contains(roid)) - activeRoids.Add(roid); - } - } - return activeRoids; - } - private static List BuildActiveROIDsForDRoUsages(string RoidList) - { - List activeRoids = new List(); - using (DROUsageInfoList activeList = DROUsageInfoList.GetDROUsagesByROIDs(RoidList)) - { - foreach (DROUsageInfo roui in activeList) - { - string roid = roui.ROID; - if (roid.EndsWith("0000")) roid = roid.Substring(0, 12); - if (!activeRoids.Contains(roid)) - activeRoids.Add(roid); - } - } - return activeRoids; - } - private static string GetRoidList(int dbid, List chgList) - { - StringBuilder sb = new StringBuilder(string.Format("{0}", dbid)); - string sep=":"; - foreach (string roid in chgList) - { - sb.Append(sep + roid); - sep = ","; - } - return sb.ToString(); - } - private static string NewROName(string roName) - { - string retval = roName; - int iSuffix = -1; - RODbInfoList rodblist = RODbInfoList.Get(); - - - foreach (RODbInfo rdi in rodblist) - { - if (rdi.ROName.StartsWith(roName)) - { - if (rdi.ROName == roName) - iSuffix = 0; - else if (Regex.IsMatch(rdi.ROName, roName + "[_][0-9]+")) - { - int ii = int.Parse(rdi.ROName.Substring(1 + roName.Length)); - if (ii > iSuffix) iSuffix = ii; - } - } - } - if (iSuffix >= 0) - retval = string.Format("{0}_{1}", roName, iSuffix + 1); - return retval; - } - private void MigrateRoFstGraphics(RODbInfo rdi, ROFSTLookup.rochild[] rochild, RODb rodb, ROFst rofst, Dictionary myExistingROImages, List myUnChangedROImages, List myAddedROImages) - { - for (int i = 0; i < rochild.Length; i++) - { - if (rochild[i].type == 8) this.AddGraphic(rdi, rochild[i].value, rodb, rofst, myExistingROImages, myUnChangedROImages, myAddedROImages); - if (rochild[i].children != null) this.MigrateRoFstGraphics(rdi, rochild[i].children, rodb, rofst, myExistingROImages, myUnChangedROImages, myAddedROImages); - } - } - private void AddGraphic(RODbInfo rdi, string p, RODb rodb, ROFst rofst, Dictionary myExistingROImages, List myUnChangedROImages, List myAddedROImages) - { - if (p == null) return; - string imgname = p.Substring(0, p.IndexOf('\n')); - int thedot = imgname.LastIndexOf('.'); - string fname = imgname; - if (thedot == -1 || (thedot != (imgname.Length - 4))) - { - RODbConfig roDbCfg = new RODbConfig(rdi.Config); - fname += string.Format(".{0}", roDbCfg.GetDefaultGraphicExtension()); - } - - string imgfile = rdi.FolderPath + @"\" + fname; - - ROImage roImg = null; - if (File.Exists(imgfile)) - { - FileInfo fi = new FileInfo(imgfile); - // if the roimage record exists, don't create a new one... - string key = ROImageKey(imgname, fi.LastWriteTimeUtc); - if (myExistingROImages.ContainsKey(key)) - { - int imageID = myExistingROImages[key]; - if (!myUnChangedROImages.Contains(imageID)) - myUnChangedROImages.Add(imageID); - } - else - { - if (!myAddedROImages.Contains(key)) - { - FileStream fsIn = new FileStream(imgfile, FileMode.Open, FileAccess.Read, FileShare.Read); - BinaryReader r = new BinaryReader(fsIn); - byte[] ab = r.ReadBytes((int)fsIn.Length); - r.Close(); - fsIn.Close(); - byte[] cmp = ROImageInfo.Compress(ab); - int existingImageID = FindExisting(myExistingROImages, imgname, imgfile, cmp, ab); - if (existingImageID != 0) - { - if (!myUnChangedROImages.Contains(existingImageID)) - myUnChangedROImages.Add(existingImageID); - return; - } - ROImageConfig rc = new ROImageConfig(); - rc.Image_Size = ab.Length.ToString(); - using (roImg = ROImage.MakeROImage(rodb, imgname, ROImageInfo.Compress(ab), rc.ToString(), fi.LastWriteTimeUtc, "Migration")) - { - using (Figure figure = Figure.GetByROFstID_ImageID(this.ROFstID, roImg.ImageID)) - { - if (figure != null) return; - Figure.MakeFigure(rofst, roImg, null).Dispose(); - myAddedROImages.Add(key); - } - } - } - } - } - } - - private int FindExisting(Dictionary myExistingROImages, string imgname, string imgfile, byte[] cmpFileContents, byte[] fileContents) - { - // the reason the following check is necessary is that the DTS can be off by hours - // because of the way windows handles Daylight savings time for file DTS. - - FileInfo fi = new FileInfo(imgfile); - DateTime dts = fi.LastWriteTimeUtc; - - // loop through myExistingROImages looking for matching name. - foreach (string key in myExistingROImages.Keys) - { - // if found, compare the date/time stamp - string part1 = Regex.Replace(key, ":.*$", ""); - string part2 = Regex.Replace(key, "^.*?:", ""); - if (part1.ToUpper() == imgname.ToUpper()) - { - // if date/time stamps matches date, minutes & seconds, compare contents - string cmp1 = Regex.Replace(dts.ToString(), " [0-9]*:", " x:"); - cmp1 = Regex.Replace(cmp1, " [AP]", " x"); - string cmp2 = Regex.Replace(part2, " [0-9]*:", " x:"); - cmp2 = Regex.Replace(cmp2, " [AP]", " x"); - if (cmp1==cmp2) - { - // compare contents - int imgId = myExistingROImages[key]; - using (ROImageInfo roii = ROImageInfo.Get(imgId)) - { - ROImageConfig roicfg = new ROImageConfig(roii); - int size = Convert.ToInt32(roicfg.Image_Size); - byte[] tmpb = ROImageInfo.Decompress(roii.Content, size); - - if (ByteArrayCompare(roii.Content, cmpFileContents)) - return imgId; - if (ByteArrayCompare(tmpb, fileContents)) - return imgId; - } - } - } - } - return 0; - } - - private bool ByteArrayCompare(byte[] ba1, byte[] ba2) - { - // we wrote our own byte array comparinson because the system's 'equals' did not work! - if (ba1.Length != ba2.Length) return false; - for (int i = 0; i < ba1.Length; i++) - if (ba1[i] != ba2[i]) return false; - return true; - } - - private ROImageInfo GetMyImage(Dictionary myImages, string imgname, DateTime dts) - { - string key = string.Format("{0}:{1}", imgname, dts); - if(myImages.ContainsKey(key)) - return myImages[key]; - return null; - } - #endregion - #endregion - public bool IsSetpointDB(int id) - { - ROFSTLookup.rodbi[] dbs = ROFSTLookup.GetRODatabaseList(); - foreach (ROFSTLookup.rodbi rodbi in dbs) - { - if (id == rodbi.dbiID) - return (rodbi.dbiAP.StartsWith("SP")); - } - return false; - } - public event ROFstInfoROTableUpdateEvent ROTableUpdate; - public List OnROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args) - { - if (ROTableUpdate != null) return ROTableUpdate(sender, args); - return null; - } - public static ROFstInfo GetJustROFst(int rOFstID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a ROFst"); - try - { - ROFstInfo tmp = GetCachedByPrimaryKey(rOFstID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteriaJustROFst(rOFstID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ROFstInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFstInfo.Get", ex); - } - } - [Serializable()] - protected class PKCriteriaJustROFst - { - private int _ROFstID; - public int ROFstID - { get { return _ROFstID; } } - public PKCriteriaJustROFst(int rOFstID) - { - _ROFstID = rOFstID; - } - } - private void DataPortal_Fetch(PKCriteriaJustROFst criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getJustROFst"; - cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROFstInfo.DataPortal_Fetch", ex); - } - } - - } - public class ROFstInfoROTableUpdateEventArgs - { - private string _ROText; - public string ROText - { - get { return _ROText; } - set { _ROText = value; } - } - private string _OldGridXml; - public string OldGridXml - { - get { return _OldGridXml; } - set { _OldGridXml = value; } - } - public ROFstInfoROTableUpdateEventArgs(string rotext, string oldgridxml) - { - _ROText = rotext; - _OldGridXml = oldgridxml; - } - } - public partial class ROFstInfoList - { - [Serializable()] - private class RoFstSizeCriteria - { - public RoFstSizeCriteria(int roDbID, int len) - { - _RODbID = roDbID; - _Len = len; - } - private int _RODbID; - public int RODbID - { - get { return _RODbID; } - set { _RODbID = value; } - } - private int _Len; - public int Len - { - get { return _Len; } - set { _Len = value; } - } - } - public static ROFstInfoList GetBySize(int roDbID, int len) - { - try - { - ROFstInfoList tmp = DataPortal.Fetch(new RoFstSizeCriteria(roDbID, len)); - ROFstInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RoFstInfoList.GetBySize", ex); - } - } - private void DataPortal_Fetch(RoFstSizeCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstInfoList.DataPortal_FetchBySize", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRoFstBySize"; - cm.Parameters.AddWithValue("@RODbID", criteria.RODbID); - cm.Parameters.AddWithValue("@Len", criteria.Len); - - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - this.Add(new ROFstInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstInfoList.DataPortal_FetchBySize", ex); - throw new DbCslaException("ROFstInfoList.DataPortal_FetchBySize", ex); - } - this.RaiseListChangedEvents = true; - } - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTValue.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTValue.cs deleted file mode 100644 index c57f7997..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ROFSTValue.cs +++ /dev/null @@ -1,195 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace VEPROMS.CSLA.Library -{ - public partial class ROFST - { - private string _ROValue = ""; - private List lstRoValues; - private Dictionary DictROVar = new Dictionary(); - - public List GetROReturnValue(string roval /*, DocVersionInfo docverinfo */) - { - lstRoValues = new List(); - DictROVar = new Dictionary(); // set up a diction of RO defined Variables - string tmp = ProcessRO(docVerInfo.ProcessDocVersionSpecificInfo(roval), false /*, docverinfo */); - if (lstRoValues.Count == 0) // was not a multiple return value - lstRoValues.Add(tmp); - return lstRoValues; - } - - private string ProcessRO(string roval, bool multiRtnVal /*, DocVersionInfo docverinfo*/) - { - string str = roval; - string rtnstr = ""; - int l = roval.Length; - while (l > 0) - { - int ptr = NextDelimiter("{", str); - if (ptr == -1) - { // add remaining text - //add(new seText(str, l)); - rtnstr += str; - l = 0; // break out of while loop - } - else - { - int cnt = ptr; //(int)(ptr - str); - if (cnt > 0) - { // add text - //add(new seText(str, cnt)); - rtnstr += str.Substring(0, cnt); - l -= cnt; - //str = ptr; - str = str.Substring(ptr); - } - ptr = MatchingBrace(str) + 1; - cnt = ptr; //(int)(ptr - str); - bool nfnd = false; - string pbstr = ProcessBrace(str.Substring(1, cnt - 2), cnt - 2, ref nfnd, multiRtnVal /*, docverinfo */); - if (nfnd) - rtnstr += str.Substring(0, cnt); - // add(new seText(str, cnt)); - else - rtnstr += pbstr; - l -= cnt; - //str = ptr; - str = str.Substring(ptr); - } - } - //rtnstr = rtnstr.Replace("`", @"\'b0"); // convert backquote to degree - left over from DOS days. - return rtnstr; - } - - private string ProcessConditional(string cnd, string opt, int lencnd, int lenopt, bool multiRtnVal /*, DocVersionInfo docverinfo */) - { - // equaluate condition - string stat = (docVerInfo != null) ? docVerInfo.Evaluate(cnd,lencnd) : ""; - int ls = stat.Length;//strlen(stat); - if (ls == 0) - return ""; // if evaluation not defined then return an empty string - no matches can be made - // look for match - remember default - string match = null; - int matchlen = 0; - string def = null; - int deflen = 0; - while (lenopt > 0 && match == null) - { - int end = MatchingBrace(opt); - int eq = opt.IndexOf('=');// strchr(opt, '='); - int len = end + 1; //(int)((end + 1) - opt); // +1 to include the '}' - int li = eq - 1;//(int)(eq - opt) - 1; - int ld = len - li - 3;// One for '{', '=' and '}' - if (def == null || eq == 1) // (!def || eq == opt+1) - { - def = opt.Substring(eq + 1); //def=eq+1; - deflen = ld; - } - if (ls == li && (stat.IndexOf(opt.Substring(1),li) > -1)) //(ls == li && !strncmp(stat, opt + 1, li)) - { - match = opt.Substring(eq + 1,ld);// match = eq + 1; - matchlen = ld; - } - opt = opt.Substring(len); //opt += len;// point to the next piece - lenopt -= len; - } - // if match process option - or process default - if (match == null) //(!match) - { - match = def.Substring(0,deflen); - matchlen = deflen; - } - return ProcessRO(match, multiRtnVal /*, docverinfo */); //process(match, matchlen); - } - - private string ProcessBrace(string str, int l, ref bool nfnd, bool multiRtnVal /*, DocVersionInfo docverinfo */) - { - string rtnstr = ""; - int nxt = NextDelimiter("{=", str); //nextDelimiter("{=", str, l); - if (nxt == -1) // no delimiter found - { // VarUse - //strList *found=vl->lookFor(str,l); - bool found = DictROVar.ContainsKey(str); - if (found) - rtnstr = DictROVar[str]; - //add(new seVarUse(found)); - else - nfnd = true; - } - else - { - if (str[nxt] == '{') - { // conditonal or menu - if (nxt == 0) // if (nxt == str) - { // menu - // TODO: implement Menu logic - //ml->process(str, l, vl); - //add(new seMenuUse(ml)); - //lstRoValues.Add(ProcessRO(str.Substring(0,l), true)); - ProcessMultiReturnValues(str, l); - } - else - { // conditional - rtnstr = ProcessConditional(str, str.Substring(nxt), nxt, str.Length - nxt - 1, multiRtnVal /*, docverinfo */);//processCondition(str, nxt, (int)(nxt - str), l - (int)(nxt - str)); - } - } - else - { // must be variable definiton - //vl->add(str, nxt+1, (int)(nxt-str), (l - (int)(nxt-str))-1, ml); - - // 'l' is the lenght up to the matching brace of the variable definition - string tmpval = ProcessRO(str.Substring(nxt + 1, l - nxt - 1), multiRtnVal /*,docverinfo */); - if (tmpval.Equals(string.Empty)) tmpval = " "; // nothing assinged to variable - DictROVar.Add(str.Substring(0, nxt), tmpval); - if (multiRtnVal) - rtnstr = tmpval; - } - } - return rtnstr; - } - - private void ProcessMultiReturnValues(string str, int len) - { - string tstr = str.Substring(0, len); - while (tstr.Length > 0) - { - int idx = MatchingBrace(tstr); - lstRoValues.Add(ProcessRO(tstr.Substring(0,idx+1),true)); - tstr = tstr.Substring(idx+1); - } - } - - - private int MatchingBrace(string str) - { - int level = 1; - int idx = 0; // the while will skip the first position (the first brace) - while (level > 0 && idx++ < str.Length) - { - switch (str[idx]) - { - case '{': - level++; - break; - case '}': - level--; - break; - } - } - if (level != 0) - idx = -1; // didn't find matching brace - - return idx; //length including end brace - } - - private int NextDelimiter(string delim, string str) - { - int idx; - idx = str.IndexOfAny(delim.ToCharArray()); - return idx; - } - - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/RevisionInfoExt.cs.bak b/PROMS/VEPROMS.CSLA.Library/Extension/RevisionInfoExt.cs.bak deleted file mode 100644 index a4ca0812..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/RevisionInfoExt.cs.bak +++ /dev/null @@ -1,1596 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Csla; -using Csla.Data; -using Csla.Validation; -using System.Data.SqlClient; -using System.Data; -using Volian.Base.Library; -using System.ComponentModel; -using System.Xml; -using System.Xml.Serialization; -using System.Text.RegularExpressions; - -namespace VEPROMS.CSLA.Library -{ - public partial class ItemInfo - { - internal string _CheckXML; - public string CheckXML - { - get { return _CheckXML; } - set { _CheckXML = value; } - } - private ConsistencyChecks _MyDifferences; - public ConsistencyChecks MyDifferences - { - get - { - if (CheckXML == null) - { - return null; - } - if (_MyDifferences == null) - { - _MyDifferences = GenericSerializer.StringDeserialize(CheckXML); - } - return _MyDifferences; - } - } - private string _MyDifferenceReasons; - public string MyDifferenceReasons - { - get - { - _MyDifferenceReasons = string.Empty; - string sep = ""; - if (MyDifferences != null) - { - if (MyDifferences.ROConsistency.MyROChecks.Length > 0) - { - _MyDifferenceReasons += sep + "Reference Object"; - sep = ", "; - } - if (MyDifferences.TransitionConsistency.MyTransitionChecks.Length > 0) - { - _MyDifferenceReasons += sep + "Transition"; - sep = ", "; - } - if (MyDifferences.LibDocConsistency.MyLibDocChecks.Length > 0) - { - _MyDifferenceReasons += sep + "Library Document"; - } - } - if (_MyDifferenceReasons == string.Empty) - _MyDifferenceReasons = "No Differences Found"; - return _MyDifferenceReasons; - } - } - private string _MyDifferencesText; - public string MyDifferencesText - { - get - { - _MyDifferencesText = string.Empty; - StringBuilder sb = new StringBuilder(); - if (MyDifferences != null) - { - if (MyDifferences.ROConsistency.MyROChecks.Length > 0) - { - sb.Append("Reference Objects Differences:\r\n"); - ROFSTLookup lu = MyDocVersion.DocVersionAssociations[0].MyROFst.ROFSTLookup; - foreach (ROCheck roc in MyDifferences.ROConsistency.MyROChecks) - { - ROFSTLookup.rochild rocc = lu.GetRoChild12(roc.ROID); - if(rocc.type == 1) - sb.Append(string.Format(" {0} - Old Value: {1} - New Value: {2}\r\n", lu.GetROTitle(roc.ROID), roc.OldROValue, roc.ROValue)); - else - sb.Append(string.Format(" {0} - Value has changed.\r\n", lu.GetROTitle(roc.ROID))); - } - } -//jcb - if (MyDifferences.TransitionConsistency.MyTransitionChecks.Length > 0) - { - if (sb.Length > 0) - sb.AppendLine(); - sb.Append("Transition Differences:\r\n"); - foreach (TransitionCheck tc in MyDifferences.TransitionConsistency.MyTransitionChecks) - { - TransitionInfo tmp = TransitionInfo.Get(tc.TransitionID); - string tt = tmp.MyContent.ContentItems[0].Path; - string ov = ItemInfo.ConvertToDisplayText(tc.OldTransitionValue); - string nv = ItemInfo.ConvertToDisplayText(tc.TransitionValue); - sb.Append(string.Format(" From {0}\r\n", tt)); - sb.Append(string.Format(" Old To: {0}\r\n", ov)); - sb.Append(string.Format(" New To: {0}\r\n", nv)); - } - } -//end jcb - if (MyDifferences.LibDocConsistency.MyLibDocChecks.Length > 0) - { - if (sb.Length > 0) - sb.AppendLine(); - sb.Append("Library Document Differences:\r\n"); - foreach (LibDocCheck ldc in MyDifferences.LibDocConsistency.MyLibDocChecks) - { - DocumentInfo di = DocumentInfo.Get(ldc.DocID); - string libdoc = string.Format(" {0} - Old Date: {1} - New Date: {2}\r\n", di.DocumentTitle, ldc.OldDocDate.ToString(), ldc.DocDate.ToString()); - sb.Append(libdoc); - } - } - _MyDifferencesText = sb.ToString(); - } - if (_MyDifferencesText == string.Empty) - _MyDifferencesText = MyDifferenceReasons; - return _MyDifferencesText; - } - } - private bool _IsSelected = false; - public bool IsSelected - { - get { return _IsSelected; } - set { _IsSelected = value; } - } - } - public delegate void ItemInfoListCCEvent(object sender, ItemInfoListCCEventArgs args); - public class ItemInfoListCCEventArgs : EventArgs - { - private ProcedureInfo _MyProcedure; - - public ProcedureInfo MyProcedure - { - get { return _MyProcedure; } - set { _MyProcedure = value; } - } - private int _MyCount; - - public int MyCount - { - get { return _MyCount; } - set { _MyCount = value; } - } - public ItemInfoListCCEventArgs(ProcedureInfo myProcedure, int myCount) - { - _MyProcedure = myProcedure; - _MyCount = myCount; - } - } - public partial class ItemInfoList - { - public static event ItemInfoListCCEvent ConsistencyCheckUpdated; - private static void OnConsistencyCheckUpdated(object sender, ItemInfoListCCEventArgs args) - { - if (ConsistencyCheckUpdated != null) - ConsistencyCheckUpdated(sender, args); - } - public static ItemInfoList GetMoreProcedures(List procs) - { - StringBuilder sb = new StringBuilder(""); - int count = 1; - foreach (ProcedureInfo pi in procs) - { - OnConsistencyCheckUpdated(pi, new ItemInfoListCCEventArgs(pi, count++)); - string cc = RevisionInfo.BuildRevisionChecks(pi); - cc = Regex.Replace(cc, @"\<\?.*?\?\>", ""); - sb.Append(cc); - } - sb.Append(""); - OnConsistencyCheckUpdated(null, new ItemInfoListCCEventArgs(null, -1)); - try - { - ItemInfoList tmp = DataPortal.Fetch(new ItemListConsistencyCheckCriteria(procs[0].MyDocVersion.VersionID, sb.ToString())); - ItemInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetMoreProcedures", ex); - } - } - [Serializable()] - private class ItemListConsistencyCheckCriteria - { - private int _DocVersionID; - public int DocVersionID - { - get { return _DocVersionID; } - set { _DocVersionID = value; } - } - private string _CheckXML; - public string CheckXML - { - get { return _CheckXML; } - set { _CheckXML = value; } - } - public ItemListConsistencyCheckCriteria(int docVersionID, string checkXML) - { - _DocVersionID = docVersionID; - _CheckXML = checkXML; - } - } - private void DataPortal_Fetch(ItemListConsistencyCheckCriteria criteria) - { - this.RaiseListChangedEvents = false; - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_GetConsistencyCheckProcedures"; - cm.Parameters.AddWithValue("@DocVersionID", criteria.DocVersionID); - cm.Parameters.AddWithValue("@MyXml", criteria.CheckXML); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) - { - ItemInfo itemInfo = null; - int itemType = dr.GetInt32("Type") / 10000; - switch (itemType) - { - case 0: - itemInfo = new ProcedureInfo(dr); - break; - case 1: - itemInfo = new SectionInfo(dr); - break; - default: - itemInfo = new StepInfo(dr); - break; - } - itemInfo.AddContent(dr); - itemInfo.CheckXML = dr.GetString("ChkXml"); - IsReadOnly = false; - this.Add(itemInfo); - IsReadOnly = true; - } - } - } - } - } - catch (Exception ex) - { - Database.LogException("ItemInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - //new for all procs - public static ItemInfoList GetAllInconsistencies(int docVersionID) - { - try - { - ItemInfoList tmp = DataPortal.Fetch(new ItemListAllInConsistenciesCriteria(docVersionID)); - ItemInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetAllInconsistencies", ex); - } - } - [Serializable()] - private class ItemListAllInConsistenciesCriteria - { - private int _DocVersionID; - public int DocVersionID - { - get { return _DocVersionID; } - set { _DocVersionID = value; } - } - public ItemListAllInConsistenciesCriteria(int docVersionID) - { - _DocVersionID = docVersionID; - } - } - private void DataPortal_Fetch(ItemListAllInConsistenciesCriteria criteria) - { - this.RaiseListChangedEvents = false; - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "vesp_GetAllConsistencyIssues"; - cm.Parameters.AddWithValue("@DocVersionID", criteria.DocVersionID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) - { - ItemInfo itemInfo = null; - int itemType = dr.GetInt32("Type") / 10000; - switch (itemType) - { - case 0: - itemInfo = new ProcedureInfo(dr); - break; - case 1: - itemInfo = new SectionInfo(dr); - break; - default: - itemInfo = new StepInfo(dr); - break; - } - itemInfo.AddContent(dr); - itemInfo.CheckXML = dr.GetString("ChkXml"); - IsReadOnly = false; - this.Add(itemInfo); - IsReadOnly = true; - } - } - } - } - } - catch (Exception ex) - { - Database.LogException("ItemInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - //end new for all procs - } - public partial class Revision - { - private RevisionConfig _MyConfig; - public RevisionConfig MyConfig - { - get - { - if (_MyConfig == null) - _MyConfig = new RevisionConfig(this); - return _MyConfig; - } - } - public static Revision GetByItemIDAndRevisionNumber(int itemID, string revisionNumber) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Revision"); - try - { - //Revision tmp = GetCachedByPrimaryKey(revisionID); - //if (tmp == null) - //{ - Revision tmp = DataPortal.Fetch(new ItemRevisionNumberCriteria(itemID, revisionNumber)); - // AddToCache(tmp); - //} - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Revision - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Revision.GetByItemIDAndRevisionNumber", ex); - } - } - [Serializable()] - protected class ItemRevisionNumberCriteria - { - private int _ItemID; - public int ItemID - { get { return _ItemID; } } - private string _RevisionNumber; - public string RevisionNumber - { get { return _RevisionNumber; } } - public ItemRevisionNumberCriteria(int itemID, string revisionNumber) - { - _ItemID = itemID; - _RevisionNumber = revisionNumber; - } - } - private void DataPortal_Fetch(ItemRevisionNumberCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Revision.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRevisionByItemIDandRevisionNumber"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.Parameters.AddWithValue("@RevisionNumber", criteria.RevisionNumber); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _RevisionChecks = RevisionChecks.Get(dr); - // load child objects - dr.NextResult(); - _RevisionVersions = RevisionVersions.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Revision.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Revision.DataPortal_Fetch", ex); - } - } - //jcb 20120625 - public static Revision GetByItemIDAndRevisionNumberAndUnitID(int itemID, string revisionNumber, int unitID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Revision"); - try - { - //Revision tmp = GetCachedByPrimaryKey(revisionID); - //if (tmp == null) - //{ - Revision tmp = DataPortal.Fetch(new UnitItemRevisionNumberCriteria(itemID, revisionNumber, unitID)); - // AddToCache(tmp); - //} - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Revision - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Revision.GetByItemIDAndRevisionNumber", ex); - } - } - [Serializable()] - protected class UnitItemRevisionNumberCriteria - { - private int _ItemID; - public int ItemID - { get { return _ItemID; } } - private string _RevisionNumber; - public string RevisionNumber - { get { return _RevisionNumber; } } - private int _UnitID; - public int UnitID - { get { return _UnitID; } } - public UnitItemRevisionNumberCriteria(int itemID, string revisionNumber, int unitID) - { - _ItemID = itemID; - _RevisionNumber = revisionNumber; - _UnitID = unitID; - } - } - private void DataPortal_Fetch(UnitItemRevisionNumberCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Revision.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRevisionByItemIDandRevisionNumberAndUnitID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.Parameters.AddWithValue("@RevisionNumber", criteria.RevisionNumber); - cm.Parameters.AddWithValue("@UnitID", criteria.UnitID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _RevisionChecks = RevisionChecks.Get(dr); - // load child objects - dr.NextResult(); - _RevisionVersions = RevisionVersions.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Revision.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Revision.DataPortal_Fetch", ex); - } - } - //end jcb 20120625 - } - public partial class RevisionInfoList - { - public static RevisionInfoList GetByItemID(int itemID) - { - try - { - //if (_RevisionInfoList != null) - // return _RevisionInfoList; - RevisionInfoList tmp = DataPortal.Fetch(new ItemCriteria(itemID)); - RevisionInfo.AddList(tmp); - tmp.AddEvents(); - //_RevisionInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RevisionInfoList.GetByItemID", ex); - } - } - [Serializable()] - protected class ItemCriteria - { - private int _ItemID; - public int ItemID - { get { return _ItemID; } } - public ItemCriteria(int itemID) - { - _ItemID = itemID; - } - } - private void DataPortal_Fetch(ItemCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRevisionsByItemID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new RevisionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("RevisionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - //jcb 20120626 - public static RevisionInfoList GetByItemIDandUnitID(int itemID, int unitID) - { - try - { - //if (_RevisionInfoList != null) - // return _RevisionInfoList; - RevisionInfoList tmp = DataPortal.Fetch(new ItemUnitCriteria(itemID, unitID)); - RevisionInfo.AddList(tmp); - tmp.AddEvents(); - //_RevisionInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RevisionInfoList.GetByItemID", ex); - } - } - [Serializable()] - protected class ItemUnitCriteria - { - private int _ItemID; - public int ItemID - { get { return _ItemID; } } - private int _UnitID; - public int UnitID - { get { return _UnitID; } } - public ItemUnitCriteria(int itemID, int unitID) - { - _ItemID = itemID; - _UnitID = unitID; - } - } - private void DataPortal_Fetch(ItemUnitCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRevisionsByItemIDandUnitID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.Parameters.AddWithValue("@UnitID", criteria.UnitID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new RevisionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("RevisionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - //end jcb 20120626 - } - public partial class RevisionInfo - { - private RevisionConfig _MyConfig; - public RevisionConfig MyConfig - { - get - { - if (_MyConfig == null) - _MyConfig = new RevisionConfig(this); - return _MyConfig; - } - } - #region new bozo - [Serializable()] - protected class ItemCriteria - { - private int _ItemID; - public int ItemID - { get { return _ItemID; } } - public ItemCriteria(int itemID) - { - _ItemID = itemID; - } - private int _UnitID = 0; - public int UnitID - { - get{return _UnitID;} - set{_UnitID = value;} - } - } - [Serializable()] - protected class CurrentItemCriteria : ItemCriteria - { - public CurrentItemCriteria(int itemID) - : base(itemID) - { - } - } - [Serializable()] - protected class CurrentItemUnitCriteria : ItemCriteria - { - public CurrentItemUnitCriteria(int itemID, int unitID) - : base(itemID) - { - UnitID = unitID; - } - } - [Serializable()] - protected class PreviousItemCriteria : ItemCriteria - { - public PreviousItemCriteria(int itemID) - : base(itemID) - { - } - } - public static RevisionInfo GetCurrentByItemID(int itemID) - { - try - { - //RevisionInfo tmp = GetCachedByPrimaryKey(revisionID); - //if (tmp == null) - //{ - // tmp = DataPortal.Fetch(new PKCriteria(revisionID)); - // AddToCache(tmp); - //} - RevisionInfo tmp = DataPortal.Fetch(new CurrentItemCriteria(itemID)); - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up RevisionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RevisionInfo.GetCurrentByItemID", ex); - } - } - public static RevisionInfo GetCurrentByItemIDandUnitID(int itemID, int unitID) - { - try - { - RevisionInfo tmp = DataPortal.Fetch(new CurrentItemUnitCriteria(itemID, unitID)); - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up RevisionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RevisionInfo.GetCurrentByItemID", ex); - } - } - public static RevisionInfo GetPreviousByItemID(int itemID) - { - try - { - //RevisionInfo tmp = GetCachedByPrimaryKey(revisionID); - //if (tmp == null) - //{ - // tmp = DataPortal.Fetch(new PKCriteria(revisionID)); - // AddToCache(tmp); - //} - RevisionInfo tmp = DataPortal.Fetch(new PreviousItemCriteria(itemID)); - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up RevisionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RevisionInfo.GetPreviousByItemID", ex); - } - } - private void DataPortal_Fetch(CurrentItemCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getCurrentRevisionByItemID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RevisionInfo.DataPortal_Fetch", ex); - } - } - private void DataPortal_Fetch(PreviousItemCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPreviousRevisionByItemID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RevisionInfo.DataPortal_Fetch", ex); - } - } - private void DataPortal_Fetch(CurrentItemUnitCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getCurrentRevisionByItemIDandUnitID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.Parameters.AddWithValue("@UnitID", criteria.UnitID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RevisionInfo.DataPortal_Fetch", ex); - } - } - #endregion - //jcb stuff - public VersionInfo LatestVersion - { - get - { - if (this.RevisionVersions.Count == 0) return null; - VersionInfo latest = this.RevisionVersions[0]; - foreach (VersionInfo vi in this.RevisionVersions) - { - if (vi.DTS > latest.DTS) - latest = vi; - } - return latest; - } - } - public override string ToString() - { - return string.Format("{0} Revision {1} on {2}", LatestVersion.MyStage.Name, this.RevisionNumber, this.RevisionDate.Value.ToShortDateString()); - } - public static string BuildRevisionChecks(ProcedureInfo proc) - { - ConsistencyChecks cc = new ConsistencyChecks(); - cc.ItemID = proc.ItemID; - BuildROChecks(cc, proc); - BuildTransitionFromChecks(cc, proc); - BuildTransitionToChecks(cc, proc); - BuildLibDocChecks(cc, proc); - return cc.ToString().Replace("OldDocDate=\"0001-01-01T00:00:00\"",""); - } - //end jcb stuff - private static void BuildROChecks(ConsistencyChecks cc, ProcedureInfo proc) - { - //grab all roids from rousages for this proc and children - List myROIDs = new List(); - //_MyTimer.ActiveProcess = "Build Distinct RO Usage List"; - using (RoUsageInfoList myList = RoUsageInfoList.GetAllForProcedure(proc)) - foreach (RoUsageInfo myRO in myList) - if (!myROIDs.Contains(myRO.ShortROID)) - myROIDs.Add(myRO.ShortROID); - using (DROUsageInfoList myList = DROUsageInfoList.GetAllForProcedure(proc)) - foreach (DROUsageInfo myRO in myList) - if (!myROIDs.Contains(myRO.ROID.ToUpper())) - myROIDs.Add(myRO.ROID.ToUpper()); - //create checkro record for each roid - //_MyTimer.ActiveProcess = "Get DocVersionInfo"; -// DocVersionInfo dbi = proc.ActiveParent as DocVersionInfo; - DocVersionInfo dvi = proc.MyDocVersion; - //_MyTimer.ActiveProcess = "Get MyROFst"; - ROFstInfo rofst = ROFstInfo.GetJustROFst(dvi.DocVersionAssociations[0].ROFstID); - //_MyTimer.ActiveProcess = "Get ROFst Lookup"; - rofst.docVer = dvi; - ROFSTLookup lookup = rofst.ROFSTLookup; - //_MyTimer.ActiveProcess = "Populating RevisionChecksXML table"; - cc.ROConsistency.ROFstDate = rofst.DTS; - foreach (string s in myROIDs) - cc.AddROCheck(s, ItemInfo.ConvertToDisplayText(lookup.GetRoValue(s))); - //_MyTimer.ActiveProcess = "External"; - } - private static void BuildTransitionFromChecks(ConsistencyChecks cc, ProcedureInfo proc) - { - using (TransitionInfoList myList = TransitionInfoList.GetAllForProcedure(proc, true)) - foreach (TransitionInfo myTI in myList) - { - //\v \v0 - string lookFor = string.Format(@"", myTI.TranType, myTI.TransitionID); - //string lookFor = string.Format(@"", tran.TranType, tran.TransitionID); - Match m = Regex.Match(myTI.ContentText, lookFor); - if (m != null && m.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = m.Groups[3]; - cc.AddTransitionFromCheck(myTI.TransitionID, g.ToString()); - } - //_MyTimer.ActiveProcess = "get from path"; - //string myPath = myTI.MyItemToID.ShortPath; - } - } - private static void BuildTransitionToChecks(ConsistencyChecks cc, ProcedureInfo proc) - { - using (TransitionInfoList myList = TransitionInfoList.GetAllForProcedure(proc, false)) - foreach (TransitionInfo myTI in myList) - { - string lookFor = string.Format(@"", myTI.TranType, myTI.TransitionID); - //string lookFor = string.Format(@"", tran.TranType, tran.TransitionID); - Match m = Regex.Match(myTI.ContentText, lookFor); - if (m != null && m.Groups.Count > 1) - { - System.Text.RegularExpressions.Group g = m.Groups[3]; - cc.AddTransitionToCheck(myTI.TransitionID, g.ToString()); - } - } - } - private static void BuildLibDocChecks(ConsistencyChecks cc, ProcedureInfo proc) - { - using (DocumentInfoList myList = DocumentInfoList.GetAllForProcedure(proc)) - foreach (DocumentInfo myDI in myList) - cc.AddLibDocCheck(myDI.DocID, myDI.DTS); - } - private static Volian.Base.Library.VlnTimer _MyTimer; - public static void SetupTimer() - { - _MyTimer = new Volian.Base.Library.VlnTimer(); - } - public static void ShowTimer() - { - _MyTimer.ShowElapsedTimes("BuildROChecks"); - } - } - public partial class RoUsageInfoList - { - [Serializable()] - private class AllForProcedureCriteria - { - public AllForProcedureCriteria(int itemID) - { - _ItemID = itemID; - } - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - public static RoUsageInfoList GetAllForProcedure(ProcedureInfo proc) - { - try - { - RoUsageInfoList tmp = DataPortal.Fetch(new AllForProcedureCriteria(proc.ItemID)); - RoUsageInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROUsageInfoList.GetAllForProcedure", ex); - } - } - private void DataPortal_Fetch(AllForProcedureCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROUsageInfoList.DataPortal_FetchAllForProc", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRoUsagesForProc"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - this.Add(new RoUsageInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsageInfoList.DataPortal_FetchAllForProc", ex); - throw new DbCslaException("ROUsageInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - } - public partial class DROUsageInfoList - { - [Serializable()] - private class AllForProcedureCriteria - { - public AllForProcedureCriteria(int itemID) - { - _ItemID = itemID; - } - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - public static DROUsageInfoList GetAllForProcedure(ProcedureInfo proc) - { - try - { - DROUsageInfoList tmp = DataPortal.Fetch(new AllForProcedureCriteria(proc.ItemID)); - DROUsageInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DROUsageInfoList.GetAllForProcedure", ex); - } - } - private void DataPortal_Fetch(AllForProcedureCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DROUsageInfoList.DataPortal_FetchAllForProc", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDROUsagesForProc"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - this.Add(new DROUsageInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DROUsageInfoList.DataPortal_FetchAllForProc", ex); - throw new DbCslaException("DROUsageInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - } - public partial class TransitionInfo - { - internal string _ContentText; - public string ContentText - { - get { return _ContentText; } - set { _ContentText = value; } - } - } - public partial class TransitionInfoList - { - [Serializable()] - private class AllForProcedureCriteria - { - public AllForProcedureCriteria(int itemID, bool from) - { - _ItemID = itemID; - _From = from; - } - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - private bool _From; - public bool From - { - get { return _From; } - set { _From = value; } - } - } - public static TransitionInfoList GetAllForProcedure(ProcedureInfo proc, bool from) - { - try - { - TransitionInfoList tmp = DataPortal.Fetch(new AllForProcedureCriteria(proc.ItemID, from)); - TransitionInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on TransitionInfoList.GetAllForProcedure", ex); - } - } - private void DataPortal_Fetch(AllForProcedureCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] TransitionInfoList.DataPortal_FetchAllForProc", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - if(criteria.From) - cm.CommandText = "getTransitionsFromProc"; - else - cm.CommandText = "getTransitionsToProc"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - { - TransitionInfo ti = new TransitionInfo(dr); - ti.ContentText = dr.GetString("ContentText"); - this.Add(ti); - } - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("TransitionInfoList.DataPortal_FetchAllForProc", ex); - throw new DbCslaException("TransitionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - } - public partial class DocumentInfoList - { - [Serializable()] - private class AllForProcedureCriteria - { - public AllForProcedureCriteria(int itemID) - { - _ItemID = itemID; - } - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - public static DocumentInfoList GetAllForProcedure(ProcedureInfo proc) - { - try - { - DocumentInfoList tmp = DataPortal.Fetch(new AllForProcedureCriteria(proc.ItemID)); - DocumentInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocumentInfoList.GetAllForProcedure", ex); - } - } - private void DataPortal_Fetch(AllForProcedureCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfoList.DataPortal_FetchAllForProc", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getLibDocsForProc"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) - this.Add(new DocumentInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfoList.DataPortal_FetchAllForProc", ex); - throw new DbCslaException("DocumentInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - } - [Serializable] - [XmlRoot("ConsistencyChecks")] - public class ConsistencyChecks - { - public static ConsistencyChecks Get(string xml) - { - return GenericSerializer.StringDeserialize(xml); - } - public override string ToString() - { - return GenericSerializer.StringSerialize(this); - } - private int _ItemID; - [XmlAttribute("ItemID")] - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - private ROConsistency _ROConsistency = new ROConsistency(); - [XmlElement("ROChecks")] - [Category("Referenced Objects")] - [Description("RO Consistency Data")] - [DisplayName("RO Consistency")] - public ROConsistency ROConsistency - { - get { return _ROConsistency; } - set { _ROConsistency = value; } - } - public void AddROCheck(string roid, string roValue) - { - ROConsistency.AddROCheck(roid, roValue); - } - - private TransitionConsistency _TransitionFromConsistency = new TransitionConsistency(); - [XmlElement("TransitionFromChecks")] - [Category("Transitions")] - [Description("Transition From Consistency Data")] - [DisplayName("Transition From Consistency")] - public TransitionConsistency TransitionFromConsistency - { - get { return _TransitionFromConsistency; } - set { _TransitionFromConsistency = value; } - } - public void AddTransitionFromCheck(int transitionid, string transitionValue) - { - TransitionFromConsistency.AddTransitionCheck(transitionid, transitionValue); - } - private TransitionConsistency _TransitionToConsistency = new TransitionConsistency(); - [XmlElement("TransitionToChecks")] - [Category("Transitions")] - [Description("Transition To Consistency Data")] - [DisplayName("Transition To Consistency")] - public TransitionConsistency TransitionToConsistency - { - get { return _TransitionToConsistency; } - set { _TransitionToConsistency = value; } - } - public void AddTransitionToCheck(int transitionid, string transitionValue) - { - TransitionToConsistency.AddTransitionCheck(transitionid, transitionValue); - } - private TransitionConsistency _TransitionConsistency = new TransitionConsistency(); - [XmlElement("TransitionChecks")] - [Category("Transitions")] - [Description("Transition Consistency Data")] - [DisplayName("Transition Consistency")] - public TransitionConsistency TransitionConsistency - { - get { return _TransitionConsistency; } - set { _TransitionConsistency = value; } - } - - private LibDocConsistency _LibDocConsistency = new LibDocConsistency(); - [XmlElement("LibDocChecks")] - [Category("Library Documents")] - [Description("Lib Doc Consistency Data")] - [DisplayName("Lib Doc Consistency")] - public LibDocConsistency LibDocConsistency - { - get { return _LibDocConsistency; } - set { _LibDocConsistency = value; } - } - public void AddLibDocCheck(int docid, DateTime docdate) - { - LibDocConsistency.AddLibDocCheck(docid, docdate); - } - } - [Serializable] - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ROConsistency - { - private DateTime _ROFstDate = DateTime.Now; - [XmlAttribute("ROFstDate")] - [Description("Date ROFst Generated")] - [DisplayName("ROFst Date")] - public DateTime ROFstDate - { - get { return _ROFstDate; } - set { _ROFstDate = value; } - } - private SortedDictionary _ROCheckList = new SortedDictionary(); - [XmlElement("ROCheck")] - [Description("RO Data")] - [DisplayName("RO Data")] - public ROCheck[] MyROChecks - { - get - { - ROCheck[] ros = new ROCheck[_ROCheckList.Count]; - _ROCheckList.Values.CopyTo(ros, 0); - return ros; - } - set - { - _ROCheckList = new SortedDictionary(); - foreach (ROCheck ro in value) - _ROCheckList.Add(ro.ROID, ro); - } - } - public void AddROCheck(string roid, string roValue) - { - if (!_ROCheckList.ContainsKey(roid)) - _ROCheckList.Add(roid, new ROCheck(roid, roValue)); - } - public override string ToString() - { - return string.Format("{0} ROs", _ROCheckList.Count); - } - } - [Serializable] - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ROCheck - { - private string _ROID; - [XmlAttribute("ROID")] - [Description("RO Unique ID")] - public string ROID - { - get { return _ROID; } - set { _ROID = value; } - } - private string _ROValue; - [XmlAttribute("ROValue")] - [Description("RO Value")] - public string ROValue - { - get { return _ROValue; } - set { _ROValue = value; } - } - private string _OldROValue; - [XmlAttribute("OldROValue")] - [Description("Old RO Value")] - public string OldROValue - { - get { return _OldROValue; } - set { _OldROValue = value; } - } - public ROCheck(string roid, string rovalue) - { - _ROID = roid; - _ROValue = rovalue; - } - public ROCheck() - { - } - public override string ToString() - { - return string.Format("{0} - '{1}'", ROID, ROValue); - } - } - - [Serializable] - [TypeConverter(typeof(ExpandableObjectConverter))] - public class TransitionConsistency - { - private SortedDictionary _TransitionCheckList = new SortedDictionary(); - [XmlElement("TransitionCheck")] - [Description("Transition Data")] - [DisplayName("Transition Data")] - public TransitionCheck[] MyTransitionChecks - { - get - { - TransitionCheck[] ts = new TransitionCheck[_TransitionCheckList.Count]; - _TransitionCheckList.Values.CopyTo(ts, 0); - return ts; - } - set - { - _TransitionCheckList = new SortedDictionary(); - foreach (TransitionCheck tc in value) - _TransitionCheckList.Add(tc.TransitionID, tc); - } - } - public void AddTransitionCheck(int transitionid, string transitionValue) - { - if (!_TransitionCheckList.ContainsKey(transitionid)) - _TransitionCheckList.Add(transitionid, new TransitionCheck(transitionid, transitionValue)); - } - public override string ToString() - { - return string.Format("{0} Transitions", _TransitionCheckList.Count); - } - } - [Serializable] - [TypeConverter(typeof(ExpandableObjectConverter))] - public class TransitionCheck - { - private int _TransitionID; - [XmlAttribute("TransitionID")] - [Description("Transition Unique ID")] - public int TransitionID - { - get { return _TransitionID; } - set { _TransitionID = value; } - } - private string _TransitionValue; - [XmlAttribute("TransitionValue")] - [Description("Transition Value")] - public string TransitionValue - { - get { return _TransitionValue; } - set { _TransitionValue = value; } - } - private string _OldTransitionValue; - [XmlAttribute("OldTransitionValue")] - [Description("Old Transition Value")] - public string OldTransitionValue - { - get { return _OldTransitionValue; } - set { _OldTransitionValue = value; } - } - public TransitionCheck(int transitionid, string transitionvalue) - { - _TransitionID = transitionid; - _TransitionValue = transitionvalue; - } - public TransitionCheck() - { - } - public override string ToString() - { - return string.Format("{0} - '{1}'", TransitionID, TransitionValue); - } - } - - [Serializable] - [TypeConverter(typeof(ExpandableObjectConverter))] - public class LibDocConsistency - { - private SortedDictionary _LibDocCheckList = new SortedDictionary(); - [XmlElement("LibDocCheck")] - [Description("LibDoc Data")] - [DisplayName("LibDoc Data")] - public LibDocCheck[] MyLibDocChecks - { - get - { - LibDocCheck[] lds = new LibDocCheck[_LibDocCheckList.Count]; - _LibDocCheckList.Values.CopyTo(lds, 0); - return lds; - } - set - { - _LibDocCheckList = new SortedDictionary(); - foreach (LibDocCheck ld in value) - _LibDocCheckList.Add(ld.DocID, ld); - } - } - public void AddLibDocCheck(int docid, DateTime docDate) - { - if (!_LibDocCheckList.ContainsKey(docid)) - _LibDocCheckList.Add(docid, new LibDocCheck(docid, docDate)); - } - public override string ToString() - { - return string.Format("{0} LibDocs", _LibDocCheckList.Count); - } - } - [Serializable] - [TypeConverter(typeof(ExpandableObjectConverter))] - public class LibDocCheck - { - private int _DocID; - [XmlAttribute("DocID")] - [Description("Lib Doc Unique ID")] - public int DocID - { - get { return _DocID; } - set { _DocID = value; } - } - private DateTime _DocDate; - [XmlAttribute("DocDate")] - [Description("Lib Doc Date")] - public DateTime DocDate - { - get { return _DocDate; } - set { _DocDate = value; } - } - private DateTime _OldDocDate; - [XmlAttribute("OldDocDate")] - [Description("Old Lib Doc Date")] - public DateTime OldDocDate - { - get - { - //if (_OldDocDate == DateTime.MinValue) - // return null; - return _OldDocDate; - } - set - { - //if (value == null) - // _OldDocDate = DateTime.MinValue; - //else - // _OldDocDate = value.Value; - _OldDocDate = value; - } - } - public LibDocCheck(int docid, DateTime docdate) - { - _DocID = docid; - _DocDate = docdate; - } - public LibDocCheck() - { - } - public override string ToString() - { - return string.Format("{0} - '{1}'", DocID, DocDate); - } - } - public enum Rev_Types : int - { - Revision = 1, TempMod = 2 - } - -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/RolePermissionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/RolePermissionExt.cs deleted file mode 100644 index 333b1975..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/RolePermissionExt.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Csla; - -namespace VEPROMS.CSLA.Library -{ - public partial class RolePermission : BusinessBase - { - public static RolePermission New() - { - return new RolePermission(1, 1, 1); - } - public bool ReadAccess - { - get { return ((PermValue & 1) == 1); } - set { PermValue = (value ? PermValue | 1 : PermValue ^ (PermValue & 1)); } - } - public bool WriteAccess - { - get { return ((PermValue & 2) == 2); } - set { PermValue = (value ? PermValue | 2 : PermValue ^ (PermValue & 2)); } - } - public bool CreateAccess - { - get { return ((PermValue & 4) == 4); } - set { PermValue = (value ? PermValue | 4 : PermValue ^ (PermValue & 4)); } - } - public bool DeleteAccess - { - get { return ((PermValue & 8) == 8); } - set { PermValue = (value ? PermValue | 8 : PermValue ^ (PermValue & 8)); } - } - public List PermADLookup - { - get { return Permission.PermADLookup; } - } - public List PermLevelLookup - { - get { return Permission.PermLevelLookup; } - } - } - public class PermLookup - { - public List PermADLookup - { - get { return Permission.PermADLookup; } - } - public List PermLevelLookup - { - get { return Permission.PermLevelLookup; } - } - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/Security/PermissionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/Security/PermissionExt.cs deleted file mode 100644 index cd20042e..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/Security/PermissionExt.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Csla; - -namespace VEPROMS.CSLA.Library -{ - public partial class Permission - { - private static List _permADLookup; - private static List _permLevelLookup; - private static void setupLookup() - { - if (_permADLookup == null) - { - _permADLookup = new List(); - _permADLookup.Add(new vlnValueKey(0,"Allow")); - _permADLookup.Add(new vlnValueKey(1, "Deny")); - } - if (_permLevelLookup == null) - { - _permLevelLookup = new List(); - _permLevelLookup.Add(new vlnValueKey(0, "Security")); - _permLevelLookup.Add(new vlnValueKey(1, "System")); - _permLevelLookup.Add(new vlnValueKey(2, "RO")); - _permLevelLookup.Add(new vlnValueKey(3, "Procedure")); - _permLevelLookup.Add(new vlnValueKey(4, "Sections")); - _permLevelLookup.Add(new vlnValueKey(5, "Steps")); - _permLevelLookup.Add(new vlnValueKey(6, "Comments")); - } - } - public static List PermADLookup - { - get { setupLookup(); return _permADLookup; } - } - public static List PermLevelLookup - { - get { setupLookup(); return _permLevelLookup; } - } - public bool ReadAccess - { - get { return ((PermValue & 1) == 1); } - set { PermValue = (value?PermValue|1:PermValue^(PermValue&1));} - } - public bool WriteAccess - { - get { return ((PermValue & 2) == 2); } - set { PermValue = (value ? PermValue | 2 : PermValue ^ (PermValue & 2)); } - } - public bool CreateAccess - { - get { return ((PermValue & 4) == 4); } - set { PermValue = (value ? PermValue | 4 : PermValue ^ (PermValue & 4)); } - } - public bool DeleteAccess - { - get { return ((PermValue & 8) == 8); } - set { PermValue = (value ? PermValue | 8 : PermValue ^ (PermValue & 8)); } - } - // partial class Extension : extensionBase - // { - // TODO: Override automatic defaults - // public virtual int DefaultPermad - // { - // get { return 0; } - // } - // public virtual SmartDate DefaultStartDate - // { - // get { return DateTime.Now.ToShortDateString(); } - // } - // public virtual DateTime DefaultDts - // { - // get { return DateTime.Now; } - // } - // public virtual string DefaultUsrid - // { - // get { return Environment.UserName.ToUpper(); } - // } - // public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - // { - // //rules.AllowRead(Dbid, ""); - // } - // public new void AddValidationRules(Csla.Validation.ValidationRules rules) - // { - // rules.AddRule( - // Csla.Validation.CommonRules.StringMaxLength, - // new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - // } - // } - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/Security/RolePermissionExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/Security/RolePermissionExt.cs deleted file mode 100644 index 333b1975..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/Security/RolePermissionExt.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Csla; - -namespace VEPROMS.CSLA.Library -{ - public partial class RolePermission : BusinessBase - { - public static RolePermission New() - { - return new RolePermission(1, 1, 1); - } - public bool ReadAccess - { - get { return ((PermValue & 1) == 1); } - set { PermValue = (value ? PermValue | 1 : PermValue ^ (PermValue & 1)); } - } - public bool WriteAccess - { - get { return ((PermValue & 2) == 2); } - set { PermValue = (value ? PermValue | 2 : PermValue ^ (PermValue & 2)); } - } - public bool CreateAccess - { - get { return ((PermValue & 4) == 4); } - set { PermValue = (value ? PermValue | 4 : PermValue ^ (PermValue & 4)); } - } - public bool DeleteAccess - { - get { return ((PermValue & 8) == 8); } - set { PermValue = (value ? PermValue | 8 : PermValue ^ (PermValue & 8)); } - } - public List PermADLookup - { - get { return Permission.PermADLookup; } - } - public List PermLevelLookup - { - get { return Permission.PermLevelLookup; } - } - } - public class PermLookup - { - public List PermADLookup - { - get { return Permission.PermADLookup; } - } - public List PermLevelLookup - { - get { return Permission.PermLevelLookup; } - } - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/Security/vlnValueKey.cs b/PROMS/VEPROMS.CSLA.Library/Extension/Security/vlnValueKey.cs deleted file mode 100644 index 7b32485f..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/Security/vlnValueKey.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace VEPROMS.CSLA.Library -{ - public class vlnValueKey - { - public vlnValueKey() { ;} - public vlnValueKey(int key, string value) - { - _key = key; - _value = value; - } - private int _key; - public int Key - { - get { return _key; } - } - private string _value; - public string Value - { - get { return _value; } - } - public override string ToString() - { - return _value; - } - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs.bak b/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs.bak deleted file mode 100644 index a8ec4eec..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/TransitionExt.cs.bak +++ /dev/null @@ -1,1153 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Data; -using System.Data.SqlClient; -using System.Text.RegularExpressions; -using Csla; -using Csla.Data; - -namespace VEPROMS.CSLA.Library -{ - public partial class TransitionInfo - { - private bool _NewTransToUnNumberedItem = false; - public bool NewTransToUnNumberedItem - { - get { return _NewTransToUnNumberedItem; } - set { _NewTransToUnNumberedItem = value; } - } - public string PathTo - { - get - { - return MyItemToID.Path; - } - } - public string PathFrom - { - get - { - return MyContent.ContentItems[0].Path; - } - } - [NonSerialized] - private TransitionConfig _TransitionConfig; - public TransitionConfig TransitionConfig - { - get - { - if (_TransitionConfig == null) - { - _TransitionConfig = new TransitionConfig(this); - } - return _TransitionConfig; - } - } - public bool HasPageNum - { - get - { - return TransitionConfig.Transition_Formatted.ToUpper() == "TRUE"; - } - } - public string ResolvePathTo(FormatInfo fi, ItemInfo itminfo, int tranType, ItemInfo toitem, ItemInfo rangeitem, bool hasPageNum) - { - try - { - return TransitionText.GetResolvedText(fi, itminfo, tranType, toitem, rangeitem, HasPageNum); - } - catch (Exception ex) - { - if (tranType == 2 && ex.Message == "Cannot find Next Item") - return TransitionText.GetResolvedText(fi, itminfo, tranType, toitem, toitem, HasPageNum); - _MyLog.Error("Error Processing Transition Text", ex); - return "(Resolved Transition Text)"; - } - } - public string ResolvePathTo(FormatInfo fi, ItemInfo itminfo, int tranType, ItemInfo toitem, ItemInfo rangeitem) - { - try - { - return TransitionText.GetResolvedText(fi, itminfo, tranType, toitem, rangeitem, HasPageNum); - } - catch (Exception ex) - { - if (tranType == 2 && ex.Message == "Cannot find Next Item") - return TransitionText.GetResolvedText(fi, itminfo, tranType, toitem, toitem, HasPageNum); - _MyLog.Error("Error Processing Transition Text", ex); - return "(Resolved Transition Text)"; - } - } - public string ResolvePathTo() - { - MyContent.RefreshContentItems(); - ItemInfo item = MyContent.ContentItems[0]; - //Console.WriteLine("Format = {0}", item.ActiveFormat); - //Console.WriteLine("item = {0}", item.ItemID); - //Console.WriteLine("TranType = {0}", TranType); - //Console.WriteLine("MyItemToID = {0}", MyItemToID); - //Console.WriteLine("MyItemRangeID = {0}", MyItemRangeID); - return ResolvePathTo(item.ActiveFormat, item, TranType, MyItemToID, MyItemRangeID); - } - public string ResolvePathTo(TransitionLookup tranLookup) - { - MyContent.RefreshContentItems(); - ItemInfo item = MyContent.ContentItems[0]; - ItemInfo myItemToID = MyItemToID; - if (tranLookup.ContainsKey(item.ItemID)) item = tranLookup[item.ItemID]; - bool hasPageNum = false; - if (item.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier || - item.ActiveFormat.PlantFormat.FormatData.TransData.UseSpecificTransitionModifier) - { - TransitionConfig tc = new TransitionConfig(Config); - if (tc != null && tc.Transition_Formatted.ToUpper() == "TRUE") hasPageNum = true; - } - if (tranLookup.ContainsKey(ToID)) - { - myItemToID = tranLookup[ToID]; - } - else - { - //different proc - //_MyLog.WarnFormat("Transition May Not Be Correct at Location From {0} To {1}", item.SearchPath, myItemToID.SearchPath); - if (!tranLookup.MyLookups.ContainsKey(myItemToID.MyProcedure.ItemID)) - tranLookup.AddProcLookup(myItemToID.MyProcedure.ItemID, ProcedureInfo.GetNewLookup(tranLookup, new TransitionLookupEventArgs(myItemToID.MyProcedure.ItemID, tranLookup.ApplicabilityUnit, MyItemToID.MyDocVersion, tranLookup)).MyLookup); - if (tranLookup.ContainsKey(ToID)) - myItemToID = tranLookup[ToID]; - else - _MyLog.WarnFormat("Invalid Unit Transition: from,to '{0}','{1}'", MyContent.ContentItems[0].ShortPath, myItemToID.ShortPath); - } - ItemInfo myItemRangeID = MyItemRangeID; - if (tranLookup.ContainsKey(RangeID)) - myItemRangeID = tranLookup[RangeID]; - else - { - //different proc - //_MyLog.WarnFormat("Transition May Not Be Correct at Location From {0} To {1}", item.SearchPath, myItemRangeID.SearchPath); - if (!tranLookup.MyLookups.ContainsKey(MyItemRangeID.MyProcedure.ItemID)) - tranLookup.AddProcLookup(MyItemRangeID.MyProcedure.ItemID, ProcedureInfo.GetNewLookup(tranLookup, new TransitionLookupEventArgs(MyItemRangeID.MyProcedure.ItemID, tranLookup.ApplicabilityUnit, MyItemRangeID.MyDocVersion, tranLookup)).MyLookup); - if (tranLookup.ContainsKey(RangeID)) - myItemRangeID = tranLookup[RangeID]; - else - if (myItemRangeID.ItemID != myItemToID.ItemID) - _MyLog.WarnFormat("Invalid Unit Range Transition: from,to '{0}','{1}'", MyContent.ContentItems[0].ShortPath, myItemRangeID.ShortPath); - //Console.WriteLine("Format = {0}", item.ActiveFormat); - //Console.WriteLine("item = {0}", item.ItemID); - //Console.WriteLine("TranType = {0}", TranType); - //Console.WriteLine("MyItemToID = {0}", MyItemToID); - //Console.WriteLine("MyItemRangeID = {0}", MyItemRangeID); - } - return ResolvePathTo(item.ActiveFormat, item, TranType, myItemToID, myItemRangeID, hasPageNum); - } - } - #region AffectedTransitons - public partial class TransitionInfoList - { - [Serializable()] - private class AffectedTransitonsCriteria - { - public AffectedTransitonsCriteria(int itemID) - { - _ItemID = itemID; - } - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - public static TransitionInfoList GetAffected(int itemID) - { - try - { - TransitionInfoList tmp = DataPortal.Fetch(new AffectedTransitonsCriteria(itemID)); - TransitionInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on TransitionInfoList.GetAffected", ex); - } - } - private void DataPortal_Fetch(AffectedTransitonsCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] TransitionInfoList.DataPortal_FetchAffected", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAffectedTransitions"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new TransitionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("TransitionInfoList.DataPortal_FetchAffected", ex); - throw new DbCslaException("TransitionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - public string Summarize() - { - StringBuilder sb = new StringBuilder(""); - foreach (TransitionInfo trans in this) - sb.Append("\r\n" + trans.PathFrom); - return sb.ToString(); - } - #endregion - #region ExternalTransitionsToChildren - private class ExternalTransitionsToChildrenCriteria - { - public ExternalTransitionsToChildrenCriteria(int itemID) - { - _ItemID = itemID; - } - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - public static TransitionInfoList GetExternalTransitionsToChildren(int itemID) - { - try - { - TransitionInfoList tmp = DataPortal.Fetch(new ExternalTransitionsToChildrenCriteria(itemID)); - TransitionInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on TransitionInfoList.GetExternalTransitionsToChildren", ex); - } - } - private void DataPortal_Fetch(ExternalTransitionsToChildrenCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] TransitionInfoList.DataPortal_FetchExternalTransitionsToChildren", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getExternalTransitionsToChildren"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new TransitionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("TransitionInfoList.DataPortal_FetchExternalTransitionsToChildren", ex); - throw new DbCslaException("TransitionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ExternalTransitions - private class ExternalTransitionsCriteria - { - public ExternalTransitionsCriteria(int itemID) - { - _ItemID = itemID; - } - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - public static TransitionInfoList GetExternalTransitions(int itemID) - { - try - { - TransitionInfoList tmp = DataPortal.Fetch(new ExternalTransitionsCriteria(itemID)); - TransitionInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on TransitionInfoList.GetExternalTransitions", ex); - } - } - private void DataPortal_Fetch(ExternalTransitionsCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] TransitionInfoList.DataPortal_FetchExternalTransitions", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getExternalTransitions"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new TransitionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("TransitionInfoList.DataPortal_FetchExternalTransitions", ex); - throw new DbCslaException("TransitionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region PastedAffectedTransitions - private class PastedAffectedTransitonsCriteria - { - public PastedAffectedTransitonsCriteria(int itemID) - { - _ItemID = itemID; - } - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - internal static TransitionInfoList GetPastedAffected(int itemID) - { - try - { - TransitionInfoList tmp = DataPortal.Fetch(new PastedAffectedTransitonsCriteria(itemID)); - TransitionInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on TransitionInfoList.GetPastedAffected", ex); - } - } - private void DataPortal_Fetch(PastedAffectedTransitonsCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] TransitionInfoList.DataPortal_FetchPastedAffected", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPastedAffectedTransitions"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.CommandTimeout = Database.DefaultTimeout; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new TransitionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("TransitionInfoList.DataPortal_FetchPastedAffected", ex); - throw new DbCslaException("TransitionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - } - public class TransitionBuilder - { - private StringBuilder _Results = new StringBuilder(); - public FormatData _FormatData; - public string _TransFormat; - public E_TransUI _TransUI; - public ItemInfo _FromItem; - public int _TranType; - public ItemInfo _ToItem; - public ItemInfo _RangeItem; - public bool _UsedRangeAncestor; - private string _Token; - public bool SectNumWithStepNum; - public string Token - { - get { return _Token; } - set { _Token = value; } - } - private string _Prefix; - public string Prefix - { - get { return _Prefix; } - set { if(_Prefix==null)_Prefix = value; } - } - public void ResetPrefix(string str) - { - _Prefix = str; - } - public bool HasText - { - get - { - return _Results.Length > 0; - } - } - public StringBuilder Append(string str) - { - return _Results.Append(str); - } - public StringBuilder ReplaceToken(string str) - { - if (str == null || str == "") return _Results; - if (_FormatData.TransData.XchngTranSpForHard && str[0]!=',' && str[0] != ' ') - { - int indx = str.IndexOf(' '); // 16 bit code only processes 1st occurance - if (indx > -1) // Not a while loop in 16 bit. - { // (see \promsnt\lib\edit\gettran.c:TransitionCat) - str = str.Remove(indx, 1); - str = str.Insert(indx, @"\u160?"); - } - } - return _Results.Append(str); - } - public override string ToString() - { - return _Results.ToString(); - } - public StringBuilder Remove(int startIndex, int length) - { - return _Results.Remove(startIndex, length); - } - public int Length - { - get { return _Results.Length; } - } - public void AppendPrefix() - { - if (HasText && Prefix != null) - { - if (!_Results.ToString().EndsWith(_Prefix)) - _Results.Append(Prefix); - _Prefix = null; - } - else if (_TranType == 4 && _ToItem.MoreThanOneStepSection()) - { - if (!HasText && Prefix != null && Prefix.ToUpper().StartsWith(", STEP")) - { - _Prefix = null; - return; - } - _Results.Append(Prefix); - _Prefix = null; - } - else if (_TranType == 5 && Prefix != null) - { - if (!HasText && Prefix.StartsWith(", ")) - _Results.Append(Prefix.TrimStart(", ".ToCharArray())); - else - _Results.Append(Prefix); - _Prefix = null; - } - // If the prefix contains an open paren, we want to add the open paren regardless - // of whether there already is text in the resulting string. - else if (!HasText && Prefix != null && Prefix.Contains("(")) - { - _Results.Append(Prefix.TrimStart(" ".ToCharArray())); // since no text in result, trim starting space. - } - } - - public string OverridePrefix - { - set { _Prefix = value; } - } - } - public static class TransitionText - { - private delegate bool TransitionAppendFunction(TransitionBuilder tb); - - private static Dictionary _AppendMethods; - private static void SetupMethods() - { - _AppendMethods = new Dictionary(); - _AppendMethods.Add("{Proc Num}", AddTransitionProcNum); - _AppendMethods.Add("{?.Proc Num}", AddOptionalTransitionProcNum); - _AppendMethods.Add("{Proc Title}", AddTransitionProcTitle); - _AppendMethods.Add("{?.Proc Title}", AddOptionalTransitionProcTitle); - _AppendMethods.Add("{First Step}", AddStepNumber); - _AppendMethods.Add("{Step Number}", AddStepNumber); // WCN2, tran type 6 - _AppendMethods.Add("{Last Step}", AddRangeStepNumber); - _AppendMethods.Add("{.}", AddIncludedStepNumber); - _AppendMethods.Add("{Sect Hdr}", AddTranGetSectionHdr); - _AppendMethods.Add("{?.Sect Hdr}", AddOptionalTranGetSectionHdr); - _AppendMethods.Add("{Sect Title}", AddTranGetSectionTitle); - _AppendMethods.Add("{?.Sect Title}", AddOptionalTranGetSectionTitle); - _AppendMethods.Add("{?.Sect Num}", AddOptionalTranGetSectionNum); - _AppendMethods.Add("{Sect Num}", AddTranGetSectionNumber); - _AppendMethods.Add("{Sect Number}", AddTranGetSectionNumber); // WCN2, tran type 6 - _AppendMethods.Add("{Page Num}", AddPageNumber); - _AppendMethods.Add("{Step Text}", AddStepText); - } - public static string GetResolvedText(ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem, bool hasPageNum) - { - return GetResolvedText(fromInfo.ActiveFormat, fromInfo, tranType, toItem, rangeItem, hasPageNum); - } - public static string GetResolvedText(FormatInfo formatInfo, ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem, bool pagenum) - { - if (!pagenum) - { - TransitionInfo ct = fromInfo.MyContent.ContentTransitionCount > 0 ? fromInfo.MyContent.ContentTransitions[0] : null; - int trIU = -1; - string cfg = string.Empty; - if (ct != null) - { - trIU = fromInfo.MyContent.ContentTransitions[0].MyTransitionInfoUnique; - cfg = fromInfo.MyContent.ContentTransitions[0].Config; - } - else - { - string pattern = string.Format(@"( [0-9]*){{1,2}}\[END>"); - //string pattern = string.Format(@".*\\v ( [0-9]*){{1,2}}\[END>"); - Match m = Regex.Match(fromInfo.MyContent.Text, pattern); - if (m.Groups.Count > 1 && m.Groups[1].Value.Contains("(Page ~)")) - pagenum = true; - } - } - if (toItem == null || rangeItem == null || toItem.IsDeleted || rangeItem.IsDeleted) - return "Invalid Transition Destination"; - TransitionBuilder tb = SetupTransitionBuilder(formatInfo, fromInfo, tranType, toItem, - toItem.ItemID==rangeItem.ItemID && !toItem.IsHigh?toItem.LastSibling:rangeItem); - if (pagenum && (tranType==1||tranType==2||tranType==4)) - { - // if range transition, the page number token needs to go after the first step, else it's at the end: - if (tranType == 2 && tb._TransFormat.Contains("{First Step")) - { - tb._TransFormat = tb._TransFormat.Insert(tb._TransFormat.IndexOf("{First Step}")+12, " {Page Num}"); - } - else - tb._TransFormat = tb._TransFormat + " {Page Num}"; - } - if(_AppendMethods==null) - SetupMethods(); - string retval = BuildString(tb); - // Added for transitions to un-numbered steps - if (retval == string.Empty) - { - retval = toItem.Ordinal.ToString(); - fromInfo.NewTransToUnNumberedItem = true; - //Volian.Base.Library.vlnStackTrace.ShowStackLocal("Setting Flag", 3, 10); - //using (Item itm = fromInfo.Get()) - //{ - // ItemAnnotation ia = itm.ItemAnnotations.Add(AnnotationType.GetByName("Verifcation Required")); - // ia.SearchText = "Transition to Un-Numbered Step"; - //itm.Save(); - //} - } - return retval; - - } - private static TransitionBuilder SetupTransitionBuilder(FormatInfo formatInfo, ItemInfo fromInfo, int tranType, ItemInfo toItem, ItemInfo rangeItem) - { - TransitionBuilder tb = new TransitionBuilder(); - tb._FormatData = formatInfo.PlantFormat.FormatData; - // get the format of the transition string based on this transition's index into the TransData part of - // format.... - if (tranType > tb._FormatData.TransData.TransTypeList.Count) - tranType = 0; - // Replace 3 tokens ", {.}, {.}, {.}" with a single token "{.}" - tb._TransFormat = tb._FormatData.TransData.TransTypeList[tranType].TransFormat.Replace(", {.}, {.}, {.}", "{.}"); - if (formatInfo.PlantFormat.FormatData.TransData.UpcaseTranAnd) tb._TransFormat = tb._TransFormat.Replace("and", "AND"); - tb._TransUI = (E_TransUI)tb._FormatData.TransData.TransTypeList[tranType].TransUI; - tb._FromItem = fromInfo; - tb._TranType = tranType; - tb._ToItem = toItem; - tb._RangeItem = rangeItem; - return tb; - } - private static string BuildString(TransitionBuilder tb) - { - //Invalid Transition Check - if (tb._ToItem.ActiveParent == null || tb._RangeItem.ActiveParent == null) - return "?"; - int startIndex = 0; - int index = -1; - int rexIndex = -1; - string prefix = null; - string prevToken = null; - bool lastAdded = false; - MatchCollection mc = Regex.Matches(tb._TransFormat, @"{(Proc Num|\?\.Proc Num|Proc Title|\?\.Proc Title|" + - @"First Step|Step Number|Last Step|\.|Sect Hdr|\?\.Sect Hdr|Sect Title|\?\.Sect Title|\?\.Sect Num|Sect Num|" + - @"Sect Number|Page Num|Step Text)}"); - foreach (Match m in mc) - { - string tmppref = prefix; - prefix = null; - rexIndex = m.Index; - int rexEndToken = m.Index + m.Length - 1; - if (rexIndex > startIndex) prefix = tb._TransFormat.Substring(startIndex, rexIndex - startIndex); - if (prefix == null) prevToken = null; - // if the last token did not add anything to the buffer, still want to put the text prefix in: - if (!lastAdded && prefix == null) prefix = tmppref; - if (startIndex == 0 && prefix != null && prefix.Length > 0) - { - tb.Append(prefix); - prefix = ""; - } - string token = tb._TransFormat.Substring(rexIndex, rexEndToken - rexIndex + 1); - // we need to flag condition where the step number already has the section number in it. For example, Wolf Creek - // using WCN2, has some sections whose section number is 'D' and the step number is 'D1', or 'D2'. The resolved - // transition text was coming out as 'DD1'. The format's HLS tab format contains '{Section Prefix}' whose implementation - // adds the section number to the tab. - if (token.Contains("Sect Num") && tb._TransFormat.Length > rexEndToken + 1) - { - int nxtTokenS = tb._TransFormat.IndexOf("{", rexEndToken); - if (nxtTokenS > -1 && nxtTokenS == rexEndToken + 1) // the {step} token has to immediately follow the section num token - { - int nxtTokenE = tb._TransFormat.IndexOf("}", nxtTokenS); - string nxtToken = tb._TransFormat.Substring(nxtTokenS, nxtTokenE - nxtTokenS + 1); - tb.SectNumWithStepNum = tb._ToItem.IsStep && nxtToken.Contains("Step") - && tb._ToItem.MyHLS.FormatStepData.TabData.IdentPrint.Contains("{Section Prefix}"); - } - } - if (token == "{.}" && tb._ToItem.ItemID == tb._RangeItem.ItemID) - { - startIndex = tb._TransFormat.Length; // skip the rest of the trans format - break; - } - if (_AppendMethods.ContainsKey(token)) - { - tb.Token = token; - if (token[1] == '?') // If it's a conditional token, only update the prefix if the prefix is null - tb.Prefix = prefix; - else // If not conditional, force the prefix to be updated - tb.OverridePrefix = prefix; - lastAdded = _AppendMethods[token](tb); - } - else - tb.Append("\\" + token.Substring(0, token.Length - 1) + "\\}"); - startIndex = rexEndToken + 1; - prevToken = token; - if (startIndex >= tb._TransFormat.Length) break; - } - if ((startIndex < tb._TransFormat.Length) && lastAdded) tb.Append(tb._TransFormat.Substring(startIndex, tb._TransFormat.Length - startIndex)); - return (tb.ToString()); - } - - // TODO: For hlp: LowerCaseTranNumber - lower case substep numbers in transitions - private static bool AddTransitionProcNum(TransitionBuilder tb) // Coded for HLP - { - string retstr = tb._ToItem.MyProcedure.MyContent.Number; - // start with UnitSpecific procedure number. - string unitnum = null; - if (tb._ToItem.MyDocVersion != null && tb._ToItem.MyDocVersion.DocVersionConfig != null) - unitnum = tb._ToItem.MyDocVersion.DocVersionConfig.Unit_ProcedureNumber; - if (unitnum != null && unitnum.Length > 0) - { - unitnum = unitnum.Replace("-", @"\u8209?"); - retstr = unitnum.Replace("#", retstr); - } - // LATER: Format Flag TruncateProcNmAfter1stSpace (dropped plants) - // LATER: Format Flag HardSpTranProcNumb (active plants) - tb.AppendPrefix(); - if (tb._FormatData.TransData.HardSpTranProcNumb) retstr = retstr.Replace(" ", @"\u160?"); - tb.ReplaceToken(retstr); - return (retstr != null && retstr != ""); - } - private static bool AddOptionalTransitionProcNum(TransitionBuilder tb) - { - // token is passed in for future use, i.e. if text is placed between "?" and "." to - // request other processing. - - // for now the only test is to check if the toitem is in the current procedure. - if (tb._FromItem.MyProcedure.ItemID == tb._ToItem.MyProcedure.ItemID) return false; // tb.TextAdded; - return AddTransitionProcNum(tb); - } - - private static bool AddTransitionProcTitle(TransitionBuilder tb)// Coded for HLP - { - tb.AppendPrefix(); - - // if can't find procedure, just put in a question mark. - if (tb._ToItem.PreviousID == null && tb._ToItem.ItemPartCount == 0 && tb._ToItem.ItemDocVersionCount == 0) - { - if (tb._ToItem.ActiveParent is ItemInfo && (tb._ToItem.ActiveParent as ItemInfo).Steps[0].ItemID == tb._ToItem.ItemID) - { - // If the transition is to the first applicable step, then use the location rather than outputting a question mark. - } - else - { - tb.Append("?"); - return true; // (tb.TextAdded = true); - } - } - string parenstr = tb._ToItem.MyProcedure.MyContent.Text; - parenstr = parenstr.Replace("\\LINE ", " ").Replace("\r\n", " "); - StringBuilder lretstr = new StringBuilder(); - // LATER: For an else - Do I need to strip underlining here? See promsnt\lib\edit\gettran.c - if (parenstr != "" || tb._FormatData.ProcData.PrintNoTitle) - { - lretstr.Append(tb._FormatData.TransData.DelimiterForTransitionTitle); - lretstr.Append(tb._FormatData.TransData.CapsTransitions ? parenstr.ToUpper().Replace(@"\U", @"\u") : - tb._FormatData.TransData.Cap1stCharTrans ? CapFirstLetterOnly(parenstr, 0) : - parenstr); - lretstr.Append(tb._FormatData.TransData.DelimiterForTransitionTitle); - } - tb.ReplaceToken(lretstr.ToString()); - return (lretstr.Length != 0); - } - private static bool AddOptionalTransitionProcTitle(TransitionBuilder tb) - { - // token is passed in for future use, i.e. if text is placed between "?" and "." to - // request other processing. - - // for now the only test is to check if the toitem is in the current procedure. - if (tb._FromItem.MyProcedure.ItemID == tb._ToItem.MyProcedure.ItemID) return false; // tb.TextAdded; - return AddTransitionProcTitle(tb); - } - private static string Tab(ItemInfo item, bool doStep) - { - // if this section has the DSS_AddDotZeroStdHLS, then we need to account for this when - // concatenating text onto the tabs. - bool hasDotZero = (item.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_AddDotZeroStdHLS) == E_DocStructStyle.DSS_AddDotZeroStdHLS; - if (item == null) return ""; - string sret = ""; - switch (item.MyContent.Type / 10000) - { - case 0: //procedure - sret = ProcedureInfo.Get(item.ItemID).MyTab.CleanText; - break; - case 1: // section - sret = SectionInfo.Get(item.ItemID).MyTab.CleanText; - break; - case 2: // step - - ItemInfo pitem = item; - bool hasDelim = item.ActiveFormat.PlantFormat.FormatData.TransData.StepSubstepDelimeter != null; - List DelimList = null; - if (!hasDelim) - { - DelimList = new List(); - SeqTabFmtList seqtabs = item.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.SeqTabFmtList; - foreach (SeqTabFmt seqtab in seqtabs) - { - string delim = seqtab.PrintTabFormat.Replace("{seq}", ""); - DelimList.Add(delim.Trim()); - } - } - while (!pitem.IsHigh) - { - //string thisTab = StepInfo.Get(pitem.ItemID).MyTab.CleanText; - string thisTab = pitem.MyTab.CleanText;// StepInfo.Get(pitem.ItemID).MyTab.CleanText; - // remove delimiters of '.' and ')' in tab. - if (!hasDelim) - { - // get list of delimiters to remove from the format: - foreach (string rmvDelim in DelimList) thisTab = thisTab.Replace(rmvDelim, ""); - } - if (pitem.IsRNOPart) - { - if (thisTab == null || thisTab == "") - sret = "RNO." + sret; - else - { - thisTab = thisTab.Trim(" ".ToCharArray()); - sret = "RNO." + thisTab + sret; - } - } - else - { - if (thisTab != null && thisTab != "") - { - thisTab = thisTab.Trim(" ".ToCharArray()); - if (hasDelim && !thisTab.EndsWith(".") && !thisTab.EndsWith(")")) thisTab = thisTab + "."; - if (hasDotZero && thisTab.EndsWith(".0.")) thisTab = thisTab.Substring(0, thisTab.Length - 2); - } - // RHM 20130326 2039 - I added the logic to limit the addition of the section tab to - // the existing tab if it starts the same. - // Westinghouse/System Procs/WRS-101/Add6/4.2.7 Transition to 4.2.5 - if(sret == "" || !sret.StartsWith(thisTab)) sret = thisTab + sret; - } - pitem = pitem.ActiveParent as ItemInfo; - if (pitem == null) break; - } - // add hls tab if it's not already in the tab. doStep was added to handle the TStepNoFlag - // which is used to define whether the step number is included in the range transition text - // if the 'to' transition is a substep. Note that only skip the following if going to a substep - // thus change 'doStep' to true if the 'to' transition is a hls. - if (!doStep && item.IsHigh) doStep = true; - if (doStep && pitem.IsHigh) - { - Tab myTab = pitem.MyDocVersion.DocVersionConfig.SelectedSlave == 0 ? StepInfo.Get(pitem.ItemID).MyTab : pitem.MyTab; - string hlsTab = myTab.BasicTab ?? myTab.CleanTextNoSymbols; - if (!sret.StartsWith(hlsTab.Trim(" ".ToCharArray()))) - { - if (!hasDelim) - foreach (string rmvDelim in DelimList) hlsTab = hlsTab.Replace(rmvDelim, ""); - hlsTab = hlsTab.Trim(" ".ToCharArray()); - if (hasDelim && !hlsTab.EndsWith(".") && !hlsTab.EndsWith(")")) hlsTab = hlsTab + "."; - if (hasDotZero) - { - if (item.IsHigh) - hlsTab = hlsTab.Substring(0, hlsTab.Length - 1); - else if (hlsTab.EndsWith(".0.")) - hlsTab = hlsTab.Substring(0, hlsTab.Length - 2); - if (sret == "" || !sret.StartsWith(hlsTab)) sret = hlsTab + sret; - } - else - sret = hlsTab + sret; - } - } - break; - } - sret = sret.Trim(" .)".ToCharArray()); - return sret; - } - private static bool AddPageNumber(TransitionBuilder tb) - { - if (tb._ToItem.PageNumber != 0 && tb._FromItem.PageNumber != 0) - { - int pgoffset = tb._ToItem.PageNumber - tb._FromItem.PageNumber; - tb._ToItem.PageNumberUsed = tb._ToItem.PageNumber; - switch (pgoffset) - { - case 1: - tb.Append(" (Next Page)"); - //Console.WriteLine("Next Page: {0}", tb._FromItem.ShortPath); - break; - case -1: - tb.Append(" (Previous Page)"); - //Console.WriteLine("Prev Page: {0}", tb._FromItem.ShortPath); - break; - case 0: - break; - default: - tb.Append(string.Format(" (Page {0})", tb._ToItem.PageNumber + 1)); - //Console.WriteLine("Page: {0}, {1}", tb._FromItem.ShortPath, tb._ToItem.PageNumber); - break; - } - } - else - { - tb.Append(" (Page ~)"); - } - return true; - } - private static bool AddStepNumber(TransitionBuilder tb) - { - // If we're on a step put out the step number. - ItemInfo secitm = TranGetSectionItem(tb._ToItem); - if ((!((tb._TransUI & E_TransUI.StepAllowNone) == E_TransUI.StepAllowNone)) || tb._ToItem.MyContent.Type > 20000) - { - if (tb.HasText) - { - // check for transition that goes to a procedure step section with title of 'Procedure steps' followed - // by ', Step'. This should output as 'Procedure step xyz' rather than 'Procedure steps, step xyz' - // TODO: NEED TO USE A FORMAT VARIABLE TO CONTROL THE FOLLOWING - if ((tb._FormatData.TransData.AdjustStepTransitionText || tb._ToItem.ActiveFormat.Name.StartsWith("OHLP")) && !tb._TransFormat.Contains("{Last Step}") && tb.Prefix != null && tb.Prefix.ToUpper().Contains(", STEP") && tb.ToString().ToUpper().EndsWith("PROCEDURE STEPS")) - { - tb.Remove(tb.Length - 15, 15); // remove "procedure steps" - tb.Append("procedure Step"); - tb.ResetPrefix(" "); // just setting = to a space wasn't resetting prefix. - } - string tmpStr = tb.ToString(); - if (tmpStr.ToUpper().EndsWith(", STEP ") && (tb.Prefix.ToUpper().EndsWith(", STEP "))) - tb.Remove(tb.Length - 7, 7); // 7 is length of ", Step " - tb.AppendPrefix(); - } - //else if (tb._TranType == 4 && tb._ToItem.MoreThanOneStepSection()) - else if (tb._TranType == 4 && tb._ToItem.MoreThanOneStepSection() || tb._TranType == 5) - { - tb.AppendPrefix(); - } - if (tb._ToItem.PreviousID == null && tb._ToItem.ItemPartCount == 0 && tb._ToItem.ItemDocVersionCount == 0) - { - // Logic added for handling applicability. If the first item is not applicable, then the second item will effectively become - // the first item but it's itempartcount will be zero - if(tb._ToItem.ActiveParent is ItemInfo && (tb._ToItem.ActiveParent as ItemInfo).Steps[0].ItemID == tb._ToItem.ItemID) - tb.ReplaceToken(Tab(tb._ToItem, true)); - else - tb.Append("?"); - } - else - tb.ReplaceToken(Tab(tb._ToItem, true)); - return true; - } - else if ((tb._ToItem.IsSection || tb._ToItem.IsProcedure) && ((tb._TransUI & E_TransUI.StepAllowNone) == E_TransUI.StepAllowNone)) - { - string tmpStr = tb.ToString(); - if (tmpStr.ToUpper().EndsWith(", STEP ")) - tb.Remove(tb.Length - 7, 7); // 7 is length of ", Step " - else if (tb.Prefix != null && tb.Prefix.StartsWith(")") && (tb.ToString().IndexOf("(")>-1)) - tb.Append(")"); - return true; - } - else - return false; - } - private static bool AddRangeStepNumber(TransitionBuilder tb) - { - tb.AppendPrefix(); - if (tb._RangeItem.PreviousID == null && tb._RangeItem.ItemPartCount == 0 && tb._RangeItem.ItemDocVersionCount == 0) - tb.Append("?"); - else - tb.ReplaceToken(Tab(tb._RangeItem, tb._RangeItem.ActiveFormat.PlantFormat.FormatData.TransData.TStepNoFlag)); - return true; - } - private static bool AddIncludedStepNumber(TransitionBuilder tb) - { - Dictionary rangeAncestors = GetAncestors(tb._RangeItem); - tb.AppendPrefix(); - bool usedRangeAncestor = false; - ItemInfo next = GetNextItem(tb._ToItem, rangeAncestors, ref usedRangeAncestor); - string lastTab = Tab(tb._RangeItem, tb._RangeItem.ActiveFormat.PlantFormat.FormatData.TransData.TStepNoFlag); - while (next.ItemID != tb._RangeItem.ItemID) - { - string thisTab = Tab(next, tb._RangeItem.ActiveFormat.PlantFormat.FormatData.TransData.TStepNoFlag); - if (lastTab == thisTab) break; - tb.ReplaceToken(", " + thisTab); - next = GetNextItem(next, rangeAncestors, ref usedRangeAncestor); - } - tb._UsedRangeAncestor = usedRangeAncestor; - return true; - } - private static bool AddStepText(TransitionBuilder tb) - { - tb.AppendPrefix(); - string txt = tb._ToItem.MyContent.Text; - tb.Append(txt); - return true; - } - private static Dictionary GetAncestors(ItemInfo itemInfo) - { - Dictionary retval = new Dictionary(); - while (!itemInfo.IsHigh) - { - ItemInfo parent = itemInfo.MyActiveParent as ItemInfo; - retval.Add(parent.ItemID, itemInfo.FirstSibling); - itemInfo = parent; - } - return retval; - } - private static ItemInfo GetNextItem(ItemInfo next, Dictionary rangeAncestors, ref bool usedRangeAncestor) - { - if (rangeAncestors.ContainsKey(next.ItemID)) - return rangeAncestors[next.ItemID]; - while (next.GetNextItem() == null) - { - next = next.ActiveParent as ItemInfo; - if(next == null) throw(new Exception("Cannot find Next Item")); - } - return next.GetNextItem(); - } - private static bool AddOptionalTranGetSectionHdr(TransitionBuilder tb) - { - // first handle 'to' non-step section. Always add it. - if (tb._ToItem.IsSection && !tb._ToItem.IsStepSection) return AddTranGetSectionHdr(tb); - - int cntsect = 0; - ItemInfo sect = TranGetSectionItem(tb._ToItem); - if (tb._ToItem.MyProcedure.Sections == null) - tb._ToItem.MyProcedure.MyContent.RefreshContentParts(); - foreach (ItemInfo ii in tb._ToItem.MyProcedure.Sections) if (ii.IsStepSection) cntsect++; - // If Procedure going to has only 1 step section, do not add it. - if (cntsect == 1) return false; // tb.TextAdded; - - // If procedure going to has more than 1 step section and is NOT same procedure - // and going to default section, do not add it. - if (tb._ToItem.MyProcedure.ItemID != tb._FromItem.MyProcedure.ItemID && sect != null && - sect.IsDefaultSection) return false; // tb.TextAdded; - - // if in same procedure and same section do not add it. - if (tb._ToItem.MyProcedure.ItemID == tb._FromItem.MyProcedure.ItemID && - sect == TranGetSectionItem(tb._FromItem) && - ! tb._ToItem.IsSection) - return false; - - // If a 'thru' range, only put out the section if it's to a different section - // that is not the default section. - if (((tb._TransUI & E_TransUI.StepLast) == E_TransUI.StepLast) && ((tb._TransUI & E_TransUI.SectMenuStep) == E_TransUI.SectMenuStep)) - { - ItemInfo fi = tb._FromItem; - while (!fi.IsSection)fi = fi.ActiveParent as ItemInfo; - ItemInfo ti = tb._ToItem; - while (!ti.IsSection) ti = ti.ActiveParent as ItemInfo; - if (fi.ItemID == ti.ItemID || ti.IsDefaultSection) return false; // tb.TextAdded; - } - return AddTranGetSectionHdr(tb); - } - private static bool AddTranGetSectionHdr(TransitionBuilder tb) - { - // output from 16-bit code looks like section header - // if this is a step section & the default section, just return - //if (TranGetSectionItem(itminfo).IsDefaultSection) return; - StringBuilder retstr = new StringBuilder(); - retstr.Append(TranGetSectionNumber(tb._ToItem)); - string txt; - if(retstr.Length > 0) - txt = TranGetSectionTitle(tb,tb._ToItem); - else - txt = TranGetSectionTitle(tb,tb._ToItem, true); - if (retstr.Length > 0 && (txt!=null && txt.Length > 0)) retstr.Append(", "); - retstr.Append(txt); - tb.AppendPrefix(); - tb.ReplaceToken(retstr.ToString()); - return (retstr.Length != 0); - } - private static bool AddOptionalTranGetSectionTitle(TransitionBuilder tb) - { - // token is passed in for future use, i.e. if text is placed between "?" and "." to - // request other processing. - - // for now the only test is to check if the toitem is in the current section. - if (TranGetSectionItem(tb._FromItem).ItemID == TranGetSectionItem(tb._ToItem).ItemID) return false; // tb.TextAdded; - tb.AppendPrefix(); - string retstr = TranGetSectionTitle(tb,tb._ToItem); - tb.ReplaceToken(retstr); - return (retstr != null && retstr != ""); - } - private static bool AddOptionalTranGetSectionNum(TransitionBuilder tb) - { - if (TranGetSectionItem(tb._FromItem).ItemID == TranGetSectionItem(tb._ToItem).ItemID) return false; - if (tb.SectNumWithStepNum) return false; - if (tb._ToItem.IsSection) return false; - tb.AppendPrefix(); - string retstr = TranGetSectionNumber(tb._ToItem); - tb.ReplaceToken(retstr); - return (retstr != null && retstr != ""); - } - private static bool AddTranGetSectionTitle(TransitionBuilder tb) - { - // LATER: Cap1stSectionTitle, CapFirstLetterOnly - if (tb._FormatData.TransData.UseSecTitles) - { - string retstr = TranGetSectionTitle(tb,tb._ToItem); - tb.AppendPrefix(); - tb.ReplaceToken(retstr); - return (retstr != null && retstr != ""); - } - return false; - } - private static bool AddTranGetSectionNumber(TransitionBuilder tb) - { - if (tb._TranType == 1 && tb._ToItem.ActiveSection.ItemID == tb._FromItem.ActiveSection.ItemID) return false; - if (tb.SectNumWithStepNum) return false; - if (tb._TranType == 0 && (tb._ToItem.IsSection || tb._ToItem.IsProcedure) && ((tb._TransUI & E_TransUI.StepAllowNone) == E_TransUI.StepAllowNone)) - { - string tmpStr = tb.ToString(); - if (tmpStr.ToUpper().EndsWith(", STEP ")) tb.Remove(tb.Length - 7, 7); // 7 is length of ", Step " - else if (tb.Prefix != null && tb.Prefix.StartsWith(")")) - tb.Append(")"); - return true; - } - string retstr = TranGetSectionNumber(tb._ToItem); - if (retstr != null && retstr != "") - { - int indx = retstr.IndexOf(' '); // 16 bit code only processes 1st occurance - if (indx > -1) // Not a while loop in 16 bit. - { // (see \promsnt\lib\edit\gettran.c:TransitionCat) - retstr = retstr.Remove(indx, 1); - retstr = retstr.Insert(indx, @"\u160?"); - } - } - // *** DO NOT DELETE - to fix a problem where the word ,step was appearing twice when there was no - // section tab. - //if (retstr!=null&&retstr!="") tb.AppendPrefix(); - tb.AppendPrefix(); - tb.ReplaceToken(retstr); - return (retstr != null && retstr != ""); - } - private static string FixTitleCase(Match m) - { - if (Regex.IsMatch(m.Value, @"^[A-Za-z]+\.?$")) - { - // don't title case "words" that have no vowles - if (Regex.IsMatch(m.Value.ToUpper(), @"^[BCDFGHJKLMNPQRSTVWXZ]+\.?$")) - return m.Value; - string part1 = m.Value.Substring(0, 1); - string part2 = m.Value.Substring(1); - return part1.ToUpper() + part2.ToLower(); - } - return m.Value; - } - private static string CapFirstLetterOnly(string retstr, int p) - { - // LATER: write code to capitalize first letter (active plants) - string lretstr = Regex.Replace(retstr, @"([^ ,]+)", new MatchEvaluator(FixTitleCase)); - return lretstr; - } - // TODO: Section methods are not complete.... - private static ItemInfo TranGetSectionItem(ItemInfo itminfo) - { - ItemInfo tmpitm = itminfo; - while (tmpitm.MyContent.Type >= 20000) tmpitm = tmpitm.MyParent; - return tmpitm; - } - private static string TranGetSectionNumber(ItemInfo itminfo) - { - ItemInfo tmpitm = TranGetSectionItem(itminfo); - if (!tmpitm.IsSection) return ""; - string str = tmpitm.MyContent.Number; - str = Regex.Replace(str, @"\", itminfo.MyDocVersion.DocVersionConfig.Unit_Number, RegexOptions.IgnoreCase ); - str = Regex.Replace(str, @"\", itminfo.MyDocVersion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase); - return (str); - } - private static string TranGetSectionTitle(TransitionBuilder tb, ItemInfo itminfo) - { - // LATER: Cap1stSectionTitle, CapFirstLetterOnly - if (tb._FormatData.TransData.UseSecTitles) - { - ItemInfo tmpitm = TranGetSectionItem(itminfo); - string sectionTitle = tmpitm.MyContent.Text; - sectionTitle = (tb._FormatData.TransData.CapsTransitionsSection ? sectionTitle.ToUpper().Replace(@"\U", @"\u") : - tb._FormatData.TransData.Cap1stCharTransSection ? CapFirstLetterOnly(sectionTitle, 0) : - sectionTitle); - return (sectionTitle); - } - return null; - } - private static string TranGetSectionTitle(TransitionBuilder tb, ItemInfo itminfo, bool overRide) - { - // LATER: Cap1stSectionTitle, CapFirstLetterOnly - if (overRide) - { - ItemInfo tmpitm = TranGetSectionItem(itminfo); - string sectionTitle = tmpitm.MyContent.Text; - sectionTitle = (tb._FormatData.TransData.CapsTransitionsSection ? sectionTitle.ToUpper().Replace(@"\U", @"\u") : - tb._FormatData.TransData.Cap1stCharTransSection ? CapFirstLetterOnly(sectionTitle, 0) : - sectionTitle); - return (sectionTitle); - } - return null; - } - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/UserInfoListExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/UserInfoListExt.cs deleted file mode 100644 index 9431a685..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/UserInfoListExt.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Csla; -namespace Volian.Object.Library -{ - /// - /// Extensions - /// - public partial class UserInfo : ReadOnlyBase - { - public string FullName - { - get { return LastName + ", " + FirstName; } - } - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/transtypes.TXT b/PROMS/VEPROMS.CSLA.Library/Extension/transtypes.TXT deleted file mode 100644 index e92e9cfe..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/transtypes.TXT +++ /dev/null @@ -1,40 +0,0 @@ -Adding special flag chars to tokens: - -?. means the following for !section transitions - -for proc - if current, don't put out text, if !current, put out text -for sect - if curproc: if cursect, don't put out text; if !cursect, put out text - if !curproc: if default sect, don't put out text; if !default sect, put out text - -DONE: "0" TransFormat="{Proc Num}, {Proc Title}, Step {First Step}" TransUI="ProcMenu, SectDefault, StepAllowNone, StepFirst" -DONE: "1" TransFormat="{First Step}" TransUI="ProcCur, SectCur, StepFirst" -DONE: "2" TransFormat="{First Step}, {.}, {.}, {.} and {Last Step}" TransUI="ProcCur, SectCur, StepFirst, StepLast" -DONE: "3" TransFormat="{First Step} thru {Last Step} of {?.Proc Num}, {?.Proc Title}, {?.Sect Hdr}" TransUI="ProcMenu, SectMenuStep, StepFirst, StepLast" -DONE: "4" TransFormat="{?.Sect Title}, Step {First Step}" TransUI="ProcCur, SectMenuAny, StepAllowNone, StepFirst" -DONE: "5" TransFormat="{Proc Num}, {Proc Title}, {?.Sect Hdr}, Step {First Step}"TransUI="ProcMenu, SectMenuAny, StepAllowNone, StepFirst" - - -SECTION TRANSITIONS (calloway used as test... - -Menu [format] comment - -"{Proc Num}, {Proc Title}, Step {Sect Num}{First Step}", same as menu -"{Sect Num}{First Step} ( Within the current section )", {Sect Num}{First Step} -"{Sect Num}{First Step}, {.}, {.}, {.} and {Sect Num}{Last Step}", same as menu current section -"{Sect Num}{First Step} thru {Sect Num}{Last Step}", same as menu step section in current proc -"{Sect Num}{First Step} ( To a different section )", {Sect Num}, Step {?.Sect Num}{?.First Step} - no stepnumber needed -"{Sect Num}{First Step}, {Sect Title} ( To a different section )" {Sect Hdr}, Step{{Sect Num}{First Step} - puts all out even if current. -"{Sect Num}" {Sect Num} - prompts for step too, but only lists sect num, Go To step though -"{Step}" {Step} - prompts for proc, step sect & step number. (sometimes gives ?) - - // made up the following string so that the token processing for setting - // up the menu enums would work as expected. - private string[] DefaultSectionTransTokenStr = - { - "{Proc Num}, {Proc Title}, Step {First Step}", - "{First Step} ( Within the current section )", - "{First Step}, {.}, {.}, {.} and {Last Step}", - "{Sect Num}.{First Step} thru {Sect Num}.{Last Step}", - "{Sect Num}.{First Step} ( To a different section )", - "{Sect Num}.{First Step}, {Sect Title} ( To a different section )" - }; \ No newline at end of file diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/transtypes.TXT.bak b/PROMS/VEPROMS.CSLA.Library/Extension/transtypes.TXT.bak deleted file mode 100644 index 0e71ee90..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/transtypes.TXT.bak +++ /dev/null @@ -1,39 +0,0 @@ -Adding special flag chars to tokens: - -?. means the following for !section transitions - -for proc - if current, don't put out text, if !current, put out text -for sect - if curproc: if cursect, don't put out text; if !cursect, put out text - if !curproc: if default sect, don't put out text; if !default sect, put out text - -DONE: "0" TransFormat="{Proc Num}, {Proc Title}, Step {First Step}" TransUI="ProcMenu, SectDefault, StepAllowNone, StepFirst" -DONE: "1" TransFormat="{First Step}" TransUI="ProcCur, SectCur, StepFirst" -DONE: "2" TransFormat="{First Step}, {.}, {.}, {.} and {Last Step}" TransUI="ProcCur, SectCur, StepFirst, StepLast" -DONE: "3" TransFormat="{First Step} thru {Last Step} of {?.Proc Num}, {?.Proc Title}, {?.Sect Hdr}" TransUI="ProcMenu, SectMenuStep, StepFirst, StepLast" -DONE: "4" TransFormat="{?.Sect Title}, Step {First Step}" TransUI="ProcCur, SectMenuAny, StepAllowNone, StepFirst" -DONE: "5" TransFormat="{Proc Num}, {Proc Title}, {?.Sect Hdr}, Step {First Step}"TransUI="ProcMenu, SectMenuAny, StepAllowNone, StepFirst" - - -SECTION TRANSITIONS (calloway used as test... - -Menu [format] comment - -"{Proc Num}, {Proc Title}, Step {Sect Num}{First Step}", same as menu -"{Sect Num}{First Step} ( Within the current section )", {Sect Num}{First Step} -"{Sect Num}{First Step}, {.}, {.}, {.} and {Sect Num}{Last Step}", same as menu current section -"{Sect Num}{First Step} thru {Sect Num}{Last Step}", same as menu step section in current proc -"{Sect Num}{First Step} ( To a different section )", {Sect Num}, Step {?.Sect Num}{?.First Step} - no stepnumber needed -"{Sect Num}{First Step}, {Sect Title} ( To a different section )" {Sect Hdr}, Step{{Sect Num}{First Step} - puts all out even if current. - - - // made up the following string so that the token processing for setting - // up the menu enums would work as expected. - private string[] DefaultSectionTransTokenStr = - { - "{Proc Num}, {Proc Title}, Step {First Step}", - "{First Step} ( Within the current section )", - "{First Step}, {.}, {.}, {.} and {Last Step}", - "{Sect Num}.{First Step} thru {Sect Num}.{Last Step}", - "{Sect Num}.{First Step} ( To a different section )", - "{Sect Num}.{First Step}, {Sect Title} ( To a different section )" - }; \ No newline at end of file diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/vlnValueKey.cs b/PROMS/VEPROMS.CSLA.Library/Extension/vlnValueKey.cs deleted file mode 100644 index 7b32485f..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Extension/vlnValueKey.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace VEPROMS.CSLA.Library -{ - public class vlnValueKey - { - public vlnValueKey() { ;} - public vlnValueKey(int key, string value) - { - _key = key; - _value = value; - } - private int _key; - public int Key - { - get { return _key; } - } - private string _value; - public string Value - { - get { return _value; } - } - public override string ToString() - { - return _value; - } - } -} diff --git a/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs.org b/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs.org deleted file mode 100644 index 2e7058d9..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs.org +++ /dev/null @@ -1,974 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.ComponentModel; -using System.Xml; - -namespace VEPROMS.CSLA.Library -{ - #region DocStyles - [TypeConverter(typeof(ExpandableObjectConverter))] - public class DocStyles : vlnFormatItem - { - [Description("Document Styles Name")] - private LazyLoad _Name; - public string Name - { - get - { - return LazyLoad(ref _Name, "@Name"); - } - } - private DocStyleList _DocStyleList; - public DocStyleList DocStyleList - { - get - { - if (_DocStyleList == null) - { - DocStyleList tmp = new DocStyleList(SelectNodes("DocStyle")); - DocStyleList retval = new DocStyleList(null); - foreach (DocStyle ds in tmp) - { - if (!ds.Inactive) retval.Add(ds); - } - _DocStyleList = retval; - } - return (_DocStyleList); - } - set { _DocStyleList = value; } - } - public DocStyles(XmlNode xmlNode) : base(xmlNode) { } - } - #endregion - #region DocStyleAll - #region DocStyle - [TypeConverter(typeof(ExpandableObjectConverter))] - public class DocStyle : vlnFormatItem, IVlnIndexedFormatItem - { - public DocStyle(XmlNode xmlNode) : base(xmlNode) { } - public DocStyle() : base() { } - #region IndexName - private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - [Description("Document Styles Name")] - private LazyLoad _Name; - public string Name - { - get - { - return LazyLoad(ref _Name, "@Name"); - } - } - #endregion - #region Font - private VE_Font _Font; - [Category("Font")] - [DisplayName("Font")] - [Description("Font")] - public VE_Font Font - { - get - { - return(_Font == null) ?_Font = new VE_Font(XmlNode): _Font; - } - } - #endregion - #region numberingsequence - [Category("Miscellaneous")] - [Description("Numbering Sequence")] - private LazyLoad _NumberingSequence; - public E_NumberingSequence? NumberingSequence - { - get - { - return LazyLoad(ref _NumberingSequence, "@NumberingSequence"); - } - } - #endregion - #region IndexOtherThanFirstPage - [Category("Miscellaneous")] - [Description("IndexOtherThanFirstPage")] - private LazyLoad _IndexOtherThanFirstPage; - public int? IndexOtherThanFirstPage - { - get - { - return LazyLoad(ref _IndexOtherThanFirstPage, "@IndexOtherThanFirstPage"); - } - } - #endregion - #region IsStepSection - [Category("Miscellaneous")] - [Description("Is a Step Section")] - private LazyLoad _IsStepSection; - public bool IsStepSection - { - get - { - return LazyLoad(ref _IsStepSection, "@IsStepSection"); - } - } - #endregion - #region Inactive - [Category("Miscellaneous")] - [Description("Is Active Section Type")] - private LazyLoad _Inactive; - public bool Inactive - { - get - { - return LazyLoad(ref _Inactive, "@Inactive"); - } - } - #endregion - #region LandscapePageList - [Category("Miscellaneous")] - [Description("Should PageList be landscape")] - private LazyLoad _LandscapePageList; - public bool LandscapePageList - { - get - { - return LazyLoad(ref _LandscapePageList, "@LandscapePageList"); - } - } - #endregion - #region ShowSectionTitles - [Category("Miscellaneous")] - [Description("Should Section Titles be shown")] - private LazyLoad _ShowSectionTitles; - public bool ShowSectionTitles - { - get - { - return LazyLoad(ref _ShowSectionTitles, "@ShowSectionTitles"); - } - } - #endregion - #region ResetFirstPageOnSection - [Category("Miscellaneous")] - [Description("Reset first page of section on Separate pagination section")] - private LazyLoad _ResetFirstPageOnSection; - public bool ResetFirstPageOnSection - { - get - { - return LazyLoad(ref _ResetFirstPageOnSection, "@ResetFirstPageOnSection"); - } - } - #endregion - #region IncludeInTOC - [Category("Miscellaneous")] - [Description("Include in Auto Table Of Contents")] - private LazyLoad _IncludeInTOC; - public bool IncludeInTOC - { - get - { - return LazyLoad(ref _IncludeInTOC, "@IncludeInTOC"); - } - } - #endregion - #region UseCheckOffs - [Category("Miscellaneous")] - [Description("Section Uses Checkoffs")] - private LazyLoad _UseCheckOffs; - public bool UseCheckOffs - { - get - { - return LazyLoad(ref _UseCheckOffs, "@UseCheckOffs"); - } - } - #endregion - #region UseCheckOffs - [Category("Miscellaneous")] - [Description("Section Uses MetaSection ColSByLevel")] - private LazyLoad _UseColSByLevel; - public bool UseColSByLevel - { - get - { - return LazyLoad(ref _UseColSByLevel, "@UseColSByLevel"); - } - } - #endregion - #region Oldtonew - [Category("Miscellaneous")] - [Description("Convert from old to new")] - private LazyLoad _OldToNew; - public int? OldToNew - { - get - { - return LazyLoad(ref _OldToNew, "@OldToNew"); - } - } - #endregion - #region CancelSectTitle - [Category("Miscellaneous")] - [Description("Section Cancel Section Title")] - private LazyLoad _CancelSectTitle; - public bool CancelSectTitle - { - get - { - return LazyLoad(ref _CancelSectTitle, "@CancelSectTitle"); - } - } - #endregion - #region CenterLine - //CenterLineX="261.9" CenterLineYTop="673.2" CenterLineYBottom="44.2" - private LazyLoad _CenterLineX; - [Category("CenterLine")] - [DisplayName("X Location")] - [Description("Distance from left side of page")] - public float? CenterLineX - { - get - { - return LazyLoad(ref _CenterLineX, "@CenterLineX"); - } - } - private LazyLoad _CenterLineYTop; - [Category("CenterLine")] - [DisplayName("Y Top Location")] - [Description("starting vertical point of line")] - public float? CenterLineYTop - { - get - { - return LazyLoad(ref _CenterLineYTop, "@CenterLineYTop"); - } - } - private LazyLoad _CenterLineYBottom; - [Category("CenterLine")] - [DisplayName("Y Bottom Location")] - [Description("ending vertical point of line")] - public float? CenterLineYBottom - { - get - { - return LazyLoad(ref _CenterLineYBottom, "@CenterLineYBottom"); - } - } - private LazyLoad _CLineWidth; - [Category("CenterLine")] - [DisplayName("Line Width")] - [Description("Width of Lines Internal to Boxes")] - public float? CLineWidth - { - get - { - return LazyLoad(ref _CLineWidth, "@CLineWidth"); - } - } - #endregion - #region OptionalSectionContent - [Category("Miscellaneous")] - [Description("Section Optional Content")] - private LazyLoad _OptionalSectionContent; - public bool OptionalSectionContent - { - get - { - return LazyLoad(ref _OptionalSectionContent, "@OptionalSectionContent"); - } - } - #endregion - #region SpecialStepsFoldout - [Category("Miscellaneous")] - [Description("Section Special Steps Foldout")] - private LazyLoad _SpecialStepsFoldout; - public bool SpecialStepsFoldout - { - get - { - return LazyLoad(ref _SpecialStepsFoldout, "@SpecialStepsFoldout"); - } - } - [Category("Miscellaneous")] - [Description("Section Extra Line Header")] - private LazyLoad _ExtraLineHeader; - public bool ExtraLineHeader - { - get - { - return LazyLoad(ref _ExtraLineHeader, "@ExtraLineHeader"); - } - } - #endregion - #region UndSpecialStepsFoldout - [Category("Miscellaneous")] - [Description("Section Cancel Section Title")] - private LazyLoad _UndSpecialStepsFoldout; - public bool UndSpecialStepsFoldout - { - get - { - return LazyLoad(ref _UndSpecialStepsFoldout, "@UndSpecialStepsFoldout"); - } - } - #endregion - #region AlignHLSTabWithSect - [Category("Miscellaneous")] - [Description("Align HLS Tab With Sect")] - private LazyLoad _AlignHLSTabWithSect; - public bool AlignHLSTabWithSect - { - get - { - return LazyLoad(ref _AlignHLSTabWithSect, "@AlignHLSTabWithSect"); - } - } - #endregion - #region ComponentList - [Category("Miscellaneous")] - [Description("Component List")] - private LazyLoad _ComponentList; - public bool ComponentList - { - get - { - return LazyLoad(ref _ComponentList, "@ComponentList"); - } - } - #endregion - #region pagestyle - private PageStyle _pagestyle; - [Category("Miscellaneous")] - [DisplayName("Page Style")] - [Description("Page Style")] - public PageStyle pagestyle - { - get - { - string str = "//PageStyles/PageStyle[" + (IntLookup("@PageStyle") + 1).ToString() + "]"; - XmlNode xn = SelectSingleNode(str); - if (_pagestyle == null) _pagestyle = new PageStyle(SelectSingleNode("//PageStyles/PageStyle[" + (IntLookup("@PageStyle") + 1).ToString() + "]")); - return _pagestyle; - } - } - #endregion - #region SubElements - private Layout _Layout; - public Layout Layout - { - get - { - return (_Layout == null ? _Layout = new Layout(SelectSingleNode("Layout")) : _Layout); - } - } - private SectTop _SectTop; - public SectTop SectTop - { - get - { - return (_SectTop == null ? _SectTop = new SectTop(SelectSingleNode("SectTop")) : _SectTop); - } - } - private Continue _Continue; - public Continue Continue - { - get - { - return (_Continue == null ? _Continue = new Continue(SelectSingleNode("Continue")) : _Continue); - } - } - private End _End; - public End End - { - get - { - return (_End == null ? _End = new End(SelectSingleNode("End")) : _End); - } - } - private Final _Final; - public Final Final - { - get - { - return (_Final == null ? _Final = new Final(SelectSingleNode("Final")) : _Final); - } - } - private StructureStyle _StructureStyle; - public StructureStyle StructureStyle - { - get - { - return (_StructureStyle == null ? _StructureStyle = new StructureStyle(SelectSingleNode("StructureStyle")) : _StructureStyle); - } - } - #endregion - public override string ToString() - { - return String.Format("{0:D2} - {1}", Index, Name); - } - } - #endregion - #region DocStyleList - [TypeConverter(typeof(vlnListConverter))] - public class DocStyleList : vlnIndexedFormatList - { - public DocStyleList(XmlNodeList xmlNodeList) : base(xmlNodeList, null) { } - } - #endregion - #region Layout - [TypeConverter(typeof(ExpandableObjectConverter))] - public class Layout : vlnFormatItem - { - public Layout(XmlNode xmlNode) : base(xmlNode) { } - public Layout() : base() { } - #region TopMargin - private LazyLoad _TopMargin; - [Category("Layout")] - [DisplayName("Top Margin on Printed Page")] - [Description("Top Margin on Printed Page")] - public float? TopMargin - { - get - { - return LazyLoad(ref _TopMargin, "@TopMargin"); - } - } - #endregion - #region FooterLength - private LazyLoad _FooterLength; - [Category("Location")] - [DisplayName("Number of lines required for footer")] - [Description("Number of lines required for footer")] - public float? FooterLength - { - get - { - return LazyLoad(ref _FooterLength, "@FooterLength"); - } - } - #endregion - #region LeftMargin - private LazyLoad _LeftMargin; - [Category("Location")] - [DisplayName("Size of left margin")] - [Description("Size of left margin")] - public float? LeftMargin - { - get - { - return LazyLoad(ref _LeftMargin, "@LeftMargin"); - } - } - #endregion - #region PageLength - private LazyLoad _PageLength; - [Category("Location")] - [DisplayName("Length of Page")] - [Description("Length of Page")] - public float? PageLength - { - get - { - return LazyLoad(ref _PageLength, "@PageLength"); - } - } - #endregion - #region PageWidth - private LazyLoad _PageWidth; - [Category("Location")] - [DisplayName("Width of Page")] - [Description("Width of Page")] - public float? PageWidth - { - get - { - return LazyLoad(ref _PageWidth, "@PageWidth"); - } - } - #endregion - #region TableUpperLimit - private LazyLoad _TableUpperLimit; - [Category("Location")] - [DisplayName("Table's right margin")] - [Description("Table's right margin")] - public float? TableUpperLimit - { - get - { - return LazyLoad(ref _TableUpperLimit, "@TableUpperLimit"); - } - } - #endregion - #region MSWordXAdj - private LazyLoad _MSWordXAdj; - [Category("Location")] - [DisplayName("MSWord X Adjustment")] - [Description("X Placement of PDF during Print")] - public float? MSWordXAdj - { - get - { - return LazyLoad(ref _MSWordXAdj, "@MSWordXAdj"); - } - } - #endregion - #region MSWordYAdj - private LazyLoad _MSWordYAdj; - [Category("Location")] - [DisplayName("MSWord Y Adjustment")] - [Description("Y Placement of PDF during Print")] - public float? MSWordYAdj - { - get - { - return LazyLoad(ref _MSWordYAdj, "@MSWordYAdj"); - } - } - #endregion - #region SectionMacro - private LazyLoad _SectionMacro; - [Category("Extras")] - [DisplayName("Section Macro")] - [Description("Section Macro Prints With Title")] - public string SectionMacro - { - get - { - return LazyLoad(ref _SectionMacro, "@SectionMacro"); - } - } - #endregion - #region CenterToStepThenPage - [Category("Layout")] - [Description("CenterToStepThenPage")] - private LazyLoad _CenterToStepThenPage; - public bool CenterToStepThenPage - { - get - { - return LazyLoad(ref _CenterToStepThenPage, "@CenterToStepThenPage"); - } - } - #endregion - } - #endregion - #region SectTop - [TypeConverter(typeof(ExpandableObjectConverter))] - public class SectTop : vlnFormatItem - { - public SectTop(XmlNode xmlNode) : base(xmlNode) { } - public SectTop() : base() { } - #region Font - private VE_Font _Font; - [Category("Font")] - [DisplayName("Font")] - [Description("Font")] - public VE_Font Font - { - get - { - return (_Font == null) ? _Font = new VE_Font(XmlNode) : _Font; - } - } - #endregion - #region Margin - private LazyLoad _Margin; - [Category("Section Continue Msg")] - [DisplayName("Margin for Section top msg")] - [Description("Margin for Section top msg")] - public float? Margin - { - get - { - return LazyLoad(ref _Margin, "@Margin"); - } - } - #endregion - #region MaxLen - private LazyLoad _MaxLen; - [Category("Section Continue Msg")] - [DisplayName("MaxLen for text within the column")] - [Description("MaxLen for text within the column")] - public int? MaxLen - { - get - { - return LazyLoad(ref _MaxLen, "@MaxLen"); - } - } - #endregion - #region Message - private LazyLoad _Message; - [Category("Continue Msg")] - [DisplayName("Section Top Continue Msg")] - [Description("Section Top Continue Msg")] - public string Message - { - get - { - return LazyLoad(ref _Message, "@Message"); - } - } - #endregion - } - #endregion - #region ContinueAll - #region Continue - [TypeConverter(typeof(ExpandableObjectConverter))] - public class Continue : vlnFormatItem - { - public Continue(XmlNode xmlNode) : base(xmlNode) { } - public Continue() : base() { } - #region Font - private VE_Font _Font; - [Category("Continue Msg")] - [DisplayName("Font")] - [Description("Font")] - public VE_Font Font - { - get - { - return (_Font == null ? _Font = new VE_Font(base.XmlNode) : _Font); - } - } - #endregion - #region SubElements - private Top _Top; - public Top Top - { - get - { - return (_Top == null? _Top = new Top(SelectSingleNode("Top")): _Top); - } - } - private Bottom _Bottom; - public Bottom Bottom - { - get - { - return (_Bottom == null ? _Bottom = new Bottom(SelectSingleNode("Bottom")) : _Bottom); - } - } - private SectionTitle _SectionTitle; - public SectionTitle SectionTitle - { - get - { - return (_SectionTitle == null ? _SectionTitle = new SectionTitle(SelectSingleNode("SectionTitle")) : _SectionTitle); - } - } - #endregion - } - #endregion - #region Top - [TypeConverter(typeof(ExpandableObjectConverter))] - public class Top : vlnFormatItem - { - public Top(XmlNode xmlNode) : base(xmlNode) { } - public Top() : base() { } - #region Font - private VE_Font _Font; - [Category("Font")] - [DisplayName("Font")] - [Description("Font")] - public VE_Font Font - { - get - { - return (_Font == null) ? _Font = new VE_Font(XmlNode) : _Font; - } - } - #endregion - #region Margin - private LazyLoad _Margin; - [Category("Continue Msg")] - [DisplayName("Margin for top msg")] - [Description("Margin for top msg")] - public float? Margin - { - get - { - return LazyLoad(ref _Margin, "@Margin"); - } - } - #endregion - #region UseStepTabs - private LazyLoad _UseStepTabs; - [Category("Continue Msg")] - [DisplayName("Flag to use step tabs")] - [Description("Flag to use step tabs")] - public bool UseStepTabs - { - get - { - return LazyLoad(ref _UseStepTabs, "@UseStepTabs"); - } - } - #endregion - #region HLS - private LazyLoad _HLS; - [Category("Continue Msg")] - [DisplayName("Include HLS in top continue msg")] - [Description("Include HLS in top continue msg")] - public int? HLS - { - get - { - return LazyLoad(ref _HLS, "@HLS"); - } - } - #endregion - #region Message - private LazyLoad _Message; - [Category("Continue Msg")] - [DisplayName("Top Continue Msg")] - [Description("Top Continue Msg")] - public string Message - { - get - { - return LazyLoad(ref _Message, "@Message"); - } - } - #endregion - } - #endregion - #region Bottom - [TypeConverter(typeof(ExpandableObjectConverter))] - public class Bottom : vlnFormatItem - { - public Bottom(XmlNode xmlNode) : base(xmlNode) { } - public Bottom() : base() { } - #region Font - private VE_Font _Font; - [Category("Font")] - [DisplayName("Font")] - [Description("Font")] - public VE_Font Font - { - get - { - return (_Font == null) ? _Font = new VE_Font(XmlNode) : _Font; - } - } - #endregion - #region Margin - private LazyLoad _Margin; - [Category("Continue Msg")] - [DisplayName("Margin for bottom msg")] - [Description("Margin for bottom msg")] - public float? Margin - { - get - { - return LazyLoad(ref _Margin, "@Margin"); - } - } - #endregion - #region MarginR BGE - private LazyLoad _MarginR; - [Category("Continue Msg")] - [DisplayName("Margin for bottom msg RNO Column (if in both columns)")] - [Description("Margin for bottom msg RNO Column (if in both columns)")] - public float? MarginR - { - get - { - return LazyLoad(ref _MarginR, "@MarginR"); - } - } - #endregion - #region Location - [Category("Continue Msg")] - [Description("Bottom Continue Location")] - - private LazyLoad _NumberingSequence; - public E_NumberingSequence? NumberingSequence - { - get - { - return LazyLoad(ref _NumberingSequence, "@NumberingSequence"); - } - } - private LazyLoad _Location; - public E_ContBottomLoc? Location - { - get - { - return LazyLoad(ref _Location, "@Location"); - } - } - private LazyLoad _NoOverrideSpace; - public bool NoOverrideSpace - { - get - { - return LazyLoad(ref _NoOverrideSpace, "@NoOverrideSpace"); - } - } - #endregion - #region Message - private LazyLoad _Message; - [Category("Continue Msg")] - [DisplayName("Bottom Continue Msg")] - [Description("Bottom Continue Msg")] - public string Message - { - get - { - return LazyLoad(ref _Message, "@Message"); - } - } - #endregion - } - #endregion - #region SectionTitle - [TypeConverter(typeof(ExpandableObjectConverter))] - public class SectionTitle : vlnFormatItem - { - public SectionTitle(XmlNode xmlNode) : base(xmlNode) { } - public SectionTitle() : base() { } - #region AppendToTitle - private LazyLoad _AppendToTitle; - [Category("Section Title Continue Msg")] - [DisplayName("AppendToTitle")] - [Description("Append Text to Section Title For Continue Msg")] - public string AppendToTitle - { - get - { - return LazyLoad(ref _AppendToTitle, "@AppendToTitle"); - } - } - #endregion - } - #endregion //SectionTitle - continue setting - #endregion - #region End - [TypeConverter(typeof(ExpandableObjectConverter))] - public class End : vlnFormatItem - { - public End(XmlNode xmlNode) : base(xmlNode) { } - public End() : base() { } - #region Font - private VE_Font _Font; - [Category("End Msg")] - [DisplayName("Font")] - [Description("Font")] - public VE_Font Font - { - get - { - return (_Font == null ? _Font = new VE_Font(XmlNode) : _Font); - } - } - #endregion - #region Flag - private LazyLoad _Flag; - [Category("End Msg")] - [DisplayName("End Msg Exists")] - [Description("End Msg Exists")] - public int? Flag - { - get - { - return LazyLoad(ref _Flag, "@Flag"); - } - } - #endregion - #region Message - private LazyLoad _Message; - [Category("End Msg")] - [DisplayName("End Message")] - [Description("End Message")] - public string Message - { - get - { - return LazyLoad(ref _Message, "@Message"); - } - } - public string FixedMessage - { - get - { - return Message == null ? null : Message.Replace("\n","\r\n").Replace(@"{par}","\r\n"); - } - } - private LazyLoad _Margin; - public float? Margin - { - get - { - return LazyLoad(ref _Margin, "@Margin"); - } - } - private LazyLoad _EndMessageOnEachSubSection; - public bool EndMessageOnEachSubSection - { - get - { - return LazyLoad(ref _EndMessageOnEachSubSection, "@EndMessageOnEachSubSection"); - } - } - #endregion - } - #endregion - #region Final - [TypeConverter(typeof(ExpandableObjectConverter))] - public class Final : vlnFormatItem - { - public Final(XmlNode xmlNode) : base(xmlNode) { } - public Final() : base() { } - private LazyLoad _Message; - [Category("Final Msg")] - [DisplayName("Final Message")] - [Description("Final Message")] - public string Message - { - get - { - return LazyLoad(ref _Message, "@Message"); - } - } - } - #endregion - #region StructureStyle - [TypeConverter(typeof(ExpandableObjectConverter))] - public class StructureStyle : vlnFormatItem - { - public StructureStyle(XmlNode xmlNode) : base(xmlNode) { } - public StructureStyle() : base() { } - #region Where - [Category("Structure Style")] - [Description("Where Used")] - private LazyLoad _Where; - public E_DocStyleUse? Where - { - get - { - return LazyLoad(ref _Where, "@Where"); - } - } - #endregion - #region Style - [Category("Structure Style")] - [Description("Style")] - private LazyLoad _Style; - public E_DocStructStyle? Style - { - get - { - return LazyLoad(ref _Style, "@Style"); - } - } - #endregion - } - #endregion - #endregion -} diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs.bak b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs.bak deleted file mode 100644 index 6b99fcbb..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs.bak +++ /dev/null @@ -1,5480 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Xml; -using System.ComponentModel; -using System.Drawing; - -namespace VEPROMS.CSLA.Library -{ - #region PlantFormat - [TypeConverter(typeof(ExpandableObjectConverter))] - public class PlantFormat - { - public PlantFormat(IFormatOrFormatInfo format) - { - _MyFormat = format; - } - private IFormatOrFormatInfo _MyFormat; - public IFormatOrFormatInfo MyFormat - { - get { return _MyFormat; } - set { _MyFormat = value; } - } - private vlnFormatDocument _XmlDoc; - internal vlnFormatDocument XmlDoc - { - get - { - if (_XmlDoc == null) - _XmlDoc = new vlnFormatDocument(_MyFormat); - return _XmlDoc; - } - } - private FormatData _FormatData; - public FormatData FormatData - { - get - { - if (_FormatData == null) _FormatData = new FormatData(XmlDoc.SelectSingleNode("/PlantFormat/FormatData")); - return _FormatData; - } - } - private PageStyles _PageStyles; - public PageStyles PageStyles - { - get - { - if (_PageStyles == null) _PageStyles = new PageStyles(XmlDoc.SelectNodes("/PlantFormat/PageStyles/PageStyle")); - return _PageStyles; - } - } - private DocStyles _DocStyles; - public DocStyles DocStyles - { - get - { - if (_DocStyles == null) _DocStyles = new DocStyles(XmlDoc.SelectSingleNode("/PlantFormat/DocStyles")); - return _DocStyles; - } - } - public bool HasPageListToken(string token) - {; - string xpath = string.Format("/PlantFormat/PageStyles/PageStyle/Item[@Token = '{0}']", token); - XmlNodeList nl = XmlDoc.SelectNodes(xpath); - return nl.Count > 0; - } - } - #endregion - #region VE_Font - [TypeConverter(typeof(ExpandableObjectConverter))] - public class VE_Font : vlnFormatItem - { - public VE_Font(XmlNode xmlNode) : base(xmlNode) { } - public VE_Font(string family, int size, E_Style style, float CPI) - { - _Family = new LazyLoad(family); - _Size = new LazyLoad(size); - _Style = new LazyLoad(style); - _CPI = new LazyLoad(CPI); - } - private LazyLoad _Family; - private Font _WindowsFont; - public Font WindowsFont - { - get - { - if (_WindowsFont == null) - { - //FontStyle style = (Family == "Cornet")?FontStyle.Italic : FontStyle.Regular; - FontStyle style = FontStyle.Regular; - if (Style != E_Style.None) - { - if (((Style & E_Style.Bold) != 0) || ((Style & E_Style.MmBold) !=0)) - style |= FontStyle.Bold; - if ((Style & E_Style.Italics) != 0) - style |= FontStyle.Italic; - if ((Style & E_Style.Underline) != 0) - style |= FontStyle.Underline; - } - // for now - check size to be 0 and set to 10 if so, error in fmtxml? - if (Family == null) // Need to get inherited font - _WindowsFont = new Font("Arial", 10, FontStyle.Regular); - else - _WindowsFont = new Font(Family, Size == 0 ? 10 : (float)Size, style); - } - return _WindowsFont; - } - set - { - _WindowsFont = value; - } - } - [Description("Font Family")] - public string Family - { - get - { - return LazyLoad(ref _Family,"Font/@Family"); - } - } - private LazyLoad _Size; - [Description("Font Size (in Double Points)")] - public int? Size - { - get - { - return LazyLoad(ref _Size, "Font/@Size"); - } - } - private LazyLoad _Style; - public E_Style? Style - { - get - { - return LazyLoad(ref _Style, "Font/@Style"); - } - //set - //{ - // _Style.Value = value; - //} - } - private LazyLoad _CPI; - public float? CPI - { - get - { - return LazyLoad(ref _CPI, "Font/@CPI"); - } - } - public float CharsToTwips - { - get - { - return (72 / (CPI ?? 12)); - } - - } - public override string ToString() - { - return string.Format("{0}, {1} pt, {2}", Family, Size, Style); - } - public bool FontIsProportional() - { - if (Family.Contains("Arial") || Family.Contains("Times New Roman")) return true; - return false; - } - } - #endregion - #region FormatData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class FormatData : vlnFormatItem - { - public FormatData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _Name; - public string Name - { - get - { - return LazyLoad(ref _Name, "@Name"); - } - } - // TPL represents Templates which are sizes of columns for 'table' type data. If the format - // has the 'UseSmartTemplate' format flag, this table will have starting location & widths, and - // other data for the listed step types. Data from this table overrides width data as specified - // by the step type format data. The only active format that has 'UseSmartTemplate' is WCNCKL. - // The TPL data is also used by other formats, many of which are using it for Enhanced Background - // & Deviations. The actual format of the template can be in an old or new format. The old format - // uses spaces as delimiters, the new uses commas. - private LazyLoad _TPL; - public string TPL - { - get - { - return LazyLoad(ref _TPL, "@TPL"); - } - } - private bool _NewTemplateFormat; - public bool NewTemplateFormat - { - get { return _NewTemplateFormat; } - set { _NewTemplateFormat = value; } - } - private Dictionary _TopTemplateTypes; - public Dictionary TopTemplateTypes - { - get - { - if (_TopTemplateTypes == null && Templates != null) - { - _TopTemplateTypes = new Dictionary(); - // loop through all of templates to find those that are top level, i.e. - // right below the '0'. - int indx = 0; - while (indx < Templates.Count) - { - // level of 0 starts a new group. - if (Templates[indx].level == 0) TopTemplateTypes[Templates[indx + 1].type] = indx+1; - indx++; - } - } - return _TopTemplateTypes; - } - } - private List _Templates; - public List Templates - { - get - { - if (_Templates == null) // Load template class from format's string data. - { - NewTemplateFormat = false; - // count newlines - which gives number of template records. - int NumTemplates = 0; - if (TPL == null) return null; - int indx = TPL.IndexOf('\n'); - while (indx > -1) - { - NumTemplates++; - indx = TPL.Length > indx + 1 ? TPL.IndexOf('\n', indx + 1) : -1; - } - if (NumTemplates == 0) return null; - - _Templates = new List(NumTemplates); - // for each item, create and add to list - if (TPL.IndexOf(',') > -1) NewTemplateFormat = true; - int cnt = 0; - - int tmpStrIndxStart = 0; - int tmpStrIndxEnd = 0; - while (cnt < NumTemplates) - { - tmpStrIndxEnd = TPL.IndexOf("\n", tmpStrIndxStart); - if (tmpStrIndxEnd < 0) - { - cnt++; - continue; // maybe extra newlines at end of string. - } - string tpl = TPL.Substring(tmpStrIndxStart, tmpStrIndxEnd-tmpStrIndxStart); - tmpStrIndxStart = tmpStrIndxEnd + 1; - int level = 0; - int type = 0; - int start = 0; - int width = 0; - int nocol = 0; - int row = 0; - string stmp = null; - if (!NewTemplateFormat) - { - string[] tmpOld = tpl.Split(" ".ToCharArray()); - level = Convert.ToInt32(tmpOld[0]); - type = Convert.ToInt32(tmpOld[1]); - stmp = tmpOld.Length <= 2 ? null : tmpOld[2]; - } - else - { - string[] tmpNew = tpl.Split(",".ToCharArray()); - if (tmpNew.Length < 5) - { - cnt++; - continue; // may be extra newlines at end of string - } - level = Convert.ToInt32(tmpNew[0]); - type = Convert.ToInt32(tmpNew[1]); - start = Convert.ToInt32(tmpNew[2]); - width = Convert.ToInt32(tmpNew[3]); - row = Convert.ToInt32(tmpNew[4]); - nocol = Convert.ToInt32(tmpNew[5]); - stmp = tmpNew.Length <= 6 ? null : tmpNew[6]; - } - TPlate tp = new TPlate(level, type, start, width, row, nocol, stmp); - _Templates.Add(tp); - cnt++; - } - } - return _Templates; - } - } - - private LazyLoad _PurchaseOptions; - public E_PurchaseOptions? PurchaseOptions - { - get - { - return LazyLoad(ref _PurchaseOptions, "@PurchaseOptions"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return _Font == null? _Font = new VE_Font(base.XmlNode): _Font; - } - } - private SymbolList _SymbolList; - public SymbolList SymbolList - { - get - { - return (_SymbolList == null) ? _SymbolList = new SymbolList(SelectNodes("Symbols/Symbol")) : _SymbolList; - } - set { _SymbolList = value; } - } - private EditData _EditData; - public EditData EditData - { - get - { - return _EditData == null ? _EditData = new EditData(SelectSingleNode("EditData")): _EditData; - } - } - private PrintData _PrintData; - public PrintData PrintData - { - get - { - return _PrintData == null? _PrintData = new PrintData(SelectSingleNode("PrintData")):_PrintData; - } - } - private ProcData _ProcData; - public ProcData ProcData - { - get - { - return _ProcData == null? _ProcData = new ProcData(SelectSingleNode("ProcData")):_ProcData; - } - } - private SectData _SectData; - public SectData SectData - { - get - { - return _SectData == null? _SectData = new SectData(SelectSingleNode("SectData")):_SectData; - } - } - private BoxList _BoxList; - public BoxList BoxList - { - get - { - return _BoxList == null? _BoxList = new BoxList(SelectNodes("BoxData/Box"),MyFormat):_BoxList; - } - set { _BoxList = value; } - } - private TransData _TransData; - public TransData TransData - { - get - { - return _TransData == null? _TransData = new TransData(SelectSingleNode("TransData")):_TransData; - } - } - private ROData _ROData; - public ROData ROData - { - get - { - return _ROData == null ? _ROData = new ROData(SelectSingleNode("ROData")) : _ROData; - } - } - private StepDataList _StepDataList; - public StepDataList StepDataList - { - get - { - return _StepDataList == null? _StepDataList = new StepDataList(SelectNodes("StepData/Step"),MyFormat):_StepDataList; - } - set { _StepDataList = value; } - } - public List GetSearchableSteps() - { - List sds = new List(); - foreach (StepData sd in StepDataList) - { - if (!sd.Inactive && sd.StepEditData.Searchable && sd.StepEditData.TypeMenu.InMenu) - sds.Add(new StepDataRetval(sd.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(sd.Index))); - } - return sds; - } - public StepData StepTopUnderBase(StepData sd, int formatStepType) - { - StepData top = sd; - while (top.ParentType != "Base") - { - string sParStp = StepDataList[formatStepType].ParentType; - foreach (StepData stp in StepDataList) - { - if (top.ParentType == stp.Type) - { - top = stp; - break; - } - } - } - return top; - } - public List StepGetLevelTypes(bool alwaysAdd, StepData topType, ref int cursel, string curType, ItemInfo _CurItemInfo) - { - List sds = new List(); - int retval = -1; - int cntitm = 0; - // if there are alternatenames for this item, use that list, otherwise, get list from - // xml for current node & its children.... - if (topType.StepEditData.TypeMenu.AlternateNameList != null && topType.StepEditData.TypeMenu.AlternateNameList != "") - { - // loop through the AlternateName string, it has indices for step types.. - string[] split = topType.StepEditData.TypeMenu.AlternateNameList.Split(new Char[] { ',' }); - foreach (string s in split) - { - foreach (StepData sd in this.StepDataList) - { - if (sd.Type == s && !sd.Inactive) - { - sds.Add(new StepDataRetval(sd.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(sd.Index))); - if (curType == sd.Type) retval = cntitm; - cntitm++; - break; - } - } - } - } - - // some menu items (step change types) can only be done in aer column, check for that.... - // also tables and figures off caution/notes must use rno data. - else if (alwaysAdd || (topType.StepEditData.TypeMenu.InMenu && ((topType.StepEditData.TypeMenu.RnoInMenu) || - (!topType.StepEditData.TypeMenu.RnoInMenu && !_CurItemInfo.IsInRNO && !_CurItemInfo.IsCaution && !_CurItemInfo.IsNote) || - (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsInRNO) || - (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsCaution) || - (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsNote)))) - { - if (!topType.Inactive) - { - if ((_CurItemInfo.IsInRNO||_CurItemInfo.IsCaution||_CurItemInfo.IsNote) && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != "") - sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.RnoMenuItem, Convert.ToInt32(topType.Index))); - else - sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(topType.Index))); - - if (topType.Type == curType) retval = cntitm; - cntitm++; - } - foreach (StepData sd in StepDataList) - { - if (sd.ParentType == topType.Type) - { - int tmpindx = DoListChildStepTypes(alwaysAdd, ref sds, sd, curType, _CurItemInfo, ref cntitm); - if (sd.Type == curType) retval = tmpindx; - if (retval < 0 && tmpindx > 0) retval = tmpindx; - } - } - } - cursel = retval; - return sds; - } - - private int DoListChildStepTypes(bool alwaysAdd, ref List sds, StepData topType, string curType, ItemInfo _CurItemInfo, ref int cntitm) - { - int retval = -1; - if (alwaysAdd || (topType.StepEditData.TypeMenu.InMenu && ((topType.StepEditData.TypeMenu.RnoInMenu) || - (!topType.StepEditData.TypeMenu.RnoInMenu && !_CurItemInfo.IsInRNO&&!_CurItemInfo.IsCaution&&!_CurItemInfo.IsNote) || - (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsInRNO) || - (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsCaution) || - (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsNote)))) - { - if (!topType.Inactive) - { - if ((_CurItemInfo.IsInRNO||_CurItemInfo.IsCaution||_CurItemInfo.IsNote) && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != "") - sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.RnoMenuItem, Convert.ToInt32(topType.Index))); - else - sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(topType.Index))); - - if (topType.Type == curType) retval = cntitm; - cntitm++; - } - foreach (StepData sd in StepDataList) - { - if (sd.ParentType == topType.Type) - { - int tmpindx = DoListChildStepTypes(alwaysAdd, ref sds, sd, curType, _CurItemInfo, ref cntitm); - if (sd.Type == curType) retval = tmpindx; - if (retval < 0 && tmpindx > 0) retval = tmpindx; - } - } - } - return retval; - } - /// - /// for format data given a string representing the Type of step, find the index. - /// - public int GetIndexFromType(string type) - { - foreach (StepData sd in StepDataList) - { - if (sd.Type == type) return (int)sd.Index; - } - return 0; // default to the base - } - } - #endregion - #region Symbols - [TypeConverter(typeof(ExpandableObjectConverter))] - public class Symbol : vlnFormatItem - { - public Symbol(XmlNode xmlNode) : base(xmlNode) { } - public Symbol() : base() { } - [Category("Ints")] - private LazyLoad _Unicode; - public int? Unicode - { - get - { - return LazyLoad(ref _Unicode, "@Unicode"); - } - } - [Category("Strings")] - private LazyLoad _Desc; - public string Desc - { - get - { - return LazyLoad(ref _Desc, "@Desc"); - } - } - public override string GetPDDisplayName() - { return Desc; } - public override string GetPDDescription() - { return string.Format("Symbol Unicode '{0}' Description '{1}'", Unicode, Desc); } - public override string GetPDCategory() - { return "Supported Symbols"; } - public override string ToString() - { - return Desc; - } - } - [TypeConverter(typeof(vlnListConverter))] - public class SymbolList : vlnFormatList - { - public SymbolList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region Templates - public class TPlate - { - public int level; // sub-step level - public int type; // type of step/substep - public int start; // starting position (for horizontal only) - public int width; // width of text in characters (") - public int row; - public int nocolm; // 1 or 2 columns - default(0) is one column - public string text; // text to be automatically entered - public TPlate(int l, int t, int s, int w, int r, int c, string x) - { - level = l; - type = t; - start = s; - width = w; - row = r; - nocolm = c; - text = x; - } - } - #endregion - #region EditData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class EditData : vlnFormatItem - { - public EditData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _EMode; - public E_EMode? EMode - { - get - { - return LazyLoad(ref _EMode, "@EMode"); - } - } - private LazyLoad _PromptForCautionType; - public bool PromptForCautionType - { - get - { - return LazyLoad(ref _PromptForCautionType, "@PromptForCautionType"); - } - } - } - #endregion - #region PrintDataAll - #region PrintData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class PrintData : vlnFormatItem - { - public PrintData(XmlNode xmlNode) : base(xmlNode) { } - private VersionIdTextList _VersionIdTextList; - public VersionIdTextList VersionIdTextList - { - get - { - return _VersionIdTextList == null? _VersionIdTextList = new VersionIdTextList(SelectNodes("VersionIdText/string")):_VersionIdTextList; - } - set { _VersionIdTextList = value; } - } - private ProcDescrList _ProcDescrList; - public ProcDescrList ProcDescrList - { - get - { - return _ProcDescrList == null? _ProcDescrList = new ProcDescrList(SelectNodes("ProcDescrList/ProcDescr")):_ProcDescrList; - } - } - private LazyLoad _DoPrnDrvrAdjusts; - public int? DoPrnDrvrAdjusts - { - get - { - return LazyLoad(ref _DoPrnDrvrAdjusts, "@DoPrnDrvrAdjusts"); - } - } - private LazyLoad _TopOfPageThing; - public string TopOfPageThing - { - get - { - return LazyLoad(ref _TopOfPageThing, "@TopOfPageThing"); - } - } - private LazyLoad _DoRevDate; - public bool DoRevDate - { - get - { - return LazyLoad(ref _DoRevDate, "@DoRevDate"); - } - } - private LazyLoad _AlternateFoldoutPages; - public bool AlternateFoldoutPages - { - get - { - return LazyLoad(ref _AlternateFoldoutPages, "@AlternateFoldoutPages"); - } - } - private LazyLoad _AlternateFloatingFoldout; - public bool AlternateFloatingFoldout - { - get - { - return LazyLoad(ref _AlternateFloatingFoldout, "@AlternateFloatingFoldout"); - } - } - private LazyLoad _SectionLevelFoldouts; - public bool SectionLevelFoldouts - { - get - { - return LazyLoad(ref _SectionLevelFoldouts, "@SectionLevelFoldouts"); - } - } - private LazyLoad _SlashReplace; - public string SlashReplace - { - get - { - return LazyLoad(ref _SlashReplace, "@SlashReplace"); - } - } - private LazyLoad _RevDateWithForwardSlash; - public bool RevDateWithForwardSlash - { - get - { - return LazyLoad(ref _RevDateWithForwardSlash, "@RevDateWithForwardSlash"); - } - } - private LazyLoad _SpecialStepsFoldout; - public bool SpecialStepsFoldout - { - get - { - return LazyLoad(ref _SpecialStepsFoldout, "@SpecialStepsFoldout"); - } - } - private LazyLoad _AllowDuplex; - public bool AllowDuplex - { - get - { - return LazyLoad(ref _AllowDuplex, "@AllowDuplex"); - } - } - private LazyLoad _AccessoryDocsInDuplex; - public bool AccessoryDocsInDuplex - { - get - { - return LazyLoad(ref _AccessoryDocsInDuplex, "@AccessoryDocsInDuplex"); - } - } - private LazyLoad _FoldoutsInDuplex; - public bool FoldoutsInDuplex - { - get - { - return LazyLoad(ref _FoldoutsInDuplex, "@FoldoutsInDuplex"); - } - } - private LazyLoad _PagelistChangeIDsWithCommas; - public bool PagelistChangeIDsWithCommas - { - get - { - return LazyLoad(ref _PagelistChangeIDsWithCommas, "@PagelistChangeIDsWithCommas"); - } - } - } - #endregion - #region VersionIdText - [TypeConverter(typeof(ExpandableObjectConverter))] - public class VersionIdText : vlnFormatItem - { - public VersionIdText(XmlNode xmlNode) : base(xmlNode) { } - public VersionIdText() : base() { } - private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("VersionIdText '{0}'", Text); } - public override string GetPDCategory() - { return "Version Id Text"; } - public override string ToString() - { - return Text; - } - } - #endregion - #region VersionIdTextList - [TypeConverter(typeof(vlnListConverter))] - public class VersionIdTextList : vlnFormatList - { - public VersionIdTextList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region ProcDescr - [TypeConverter(typeof(ExpandableObjectConverter))] - public partial class ProcDescr : vlnFormatItem //: BusinessBase, IDisposable - { - public ProcDescr(XmlNode xmlNode) : base(xmlNode) { } - public ProcDescr() : base() { } - private LazyLoad _MatchProcNumber; - public string MatchProcNumber - { - get - { - return LazyLoad(ref _MatchProcNumber, "@MatchProcNumber"); - } - } - private LazyLoad _ProcDescr1; - public string ProcDescr1 - { - get - { - return LazyLoad(ref _ProcDescr1, "@ProcDescr1"); - } - } - private LazyLoad _ProcDescr2; - public string ProcDescr2 - { - get - { - return LazyLoad(ref _ProcDescr2, "@ProcDescr2"); - } - } - public override string ToString() - { - return string.Format("{0}, {1}", ProcDescr1, MatchProcNumber); - } - } - #region ProcDescrList - [TypeConverter(typeof(vlnListConverter))] - public class ProcDescrList : vlnFormatList - { - public ProcDescrList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #endregion - #endregion - #region ProcDataAll - #region ProcData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ProcData : vlnFormatItem - { - public ProcData(XmlNode xmlNode): base(xmlNode) {} - private ProcedureSuffixList _ProcedureSuffixList; - public ProcedureSuffixList ProcedureSuffixList - { - get - { - return _ProcedureSuffixList == null? _ProcedureSuffixList = new ProcedureSuffixList(SelectNodes("ProcedureSuffix/string")): _ProcedureSuffixList; - } - set { _ProcedureSuffixList = value; } - } - private ChangeBarData _ChangeBarData; - public ChangeBarData ChangeBarData - { - get - { - return _ChangeBarData == null? _ChangeBarData = new ChangeBarData(SelectSingleNode("ChangeBarData")):_ChangeBarData; - } - } - private CheckOffData _CheckOffData; - public CheckOffData CheckOffData - { - get - { - return _CheckOffData == null? _CheckOffData = new CheckOffData(SelectSingleNode("CheckOffData")):_CheckOffData; - } - } - private PSI _PSI; - public PSI PSI - { - get - { - return _PSI == null ? _PSI = new PSI(SelectSingleNode("PSI")) : _PSI; - } - } - private LazyLoad _TitleLength; - public int? TitleLength - { - get - { - return LazyLoad(ref _TitleLength, "@TitleLength"); - } - } - private LazyLoad _CoverTitleLength; - public int? CoverTitleLength - { - get - { - return LazyLoad(ref _CoverTitleLength, "@CoverTitleLength"); - } - } - private LazyLoad _ProcedureSuffixFlags; - public string ProcedureSuffixFlags - { - get - { - return LazyLoad(ref _ProcedureSuffixFlags, "@ProcedureSuffixFlags"); - } - } - private LazyLoad _CapitalizeTitle; - public bool CapitalizeTitle - { - get - { - return LazyLoad(ref _CapitalizeTitle, "@CapitalizeTitle"); - } - } - private LazyLoad _ChangeStyleForEverySection; - public bool ChangeStyleForEverySection - { - get - { - return LazyLoad(ref _ChangeStyleForEverySection, "@ChangeStyleForEverySection"); - } - } - private LazyLoad _PrintNoTitle; - public bool PrintNoTitle - { - get - { - return LazyLoad(ref _PrintNoTitle, "@PrintNoTitle"); - } - } - private LazyLoad _CountFoldoutPages; - public bool CountFoldoutPages - { - get - { - return LazyLoad(ref _CountFoldoutPages, "@CountFoldoutPages"); - } - } - private LazyLoad _ForeColor; - public string ForeColor - { - get - { - return LazyLoad(ref _ForeColor, "@ForeColor"); - } - } - private LazyLoad _BackColor; - public string BackColor - { - get - { - return LazyLoad(ref _BackColor, "@BackColor"); - } - } - } - #endregion - #region ProcedureSuffix - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ProcedureSuffix : vlnFormatItem - { - public ProcedureSuffix(XmlNode xmlNode) : base(xmlNode) { } - public ProcedureSuffix() : base() { } - private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("ProcedureSuffix '{0}'", Text); } - public override string GetPDCategory() - { return "Procedure Suffix"; } - public override string ToString() - { - return Text; - } - } - #endregion - #region ProcedureSuffixList - [TypeConverter(typeof(vlnListConverter))] - public class ProcedureSuffixList : vlnFormatList - { - public ProcedureSuffixList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region PsiAll - [TypeConverter(typeof(ExpandableObjectConverter))] - public class PSI : vlnFormatItem - { - public PSI(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _x; - public int? x - { - get - { - return LazyLoad(ref _x, "@x"); - } - } - private LazyLoad _y; - public int? y - { - get - { - return LazyLoad(ref _y, "@y"); - } - } - private LazyLoad _Caption; - public string Caption - { - get - { - return LazyLoad(ref _Caption, "@Caption"); - } - } - private LazyLoad _ButtonsOnBottom; // change to bool - public string ButtonsOnBottom - { - get - { - return LazyLoad(ref _ButtonsOnBottom, "@ButtonsOnBottom"); - } - } - private PsiLabels _LabelList; - public PsiLabels LabelList - { - get - { - return _LabelList == null ? _LabelList = new PsiLabels(SelectNodes("/PlantFormat/FormatData/ProcData/PSI/Label")) : _LabelList; - } - } - private PsiFields _FieldList; - public PsiFields FieldList - { - get - { - return _FieldList == null ? _FieldList = new PsiFields(SelectNodes("/PlantFormat/FormatData/ProcData/PSI/Field")) : _FieldList; - } - } - } - public class PsiLabels : vlnFormatList - { - public PsiLabels(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - - public class PsiLabel : vlnFormatItem - { - public PsiLabel(XmlNode xmlNode) : base(xmlNode) { } - public PsiLabel() : base() { } - private LazyLoad _text; - public string text - { - get - { - return LazyLoad(ref _text, "@text"); - } - } - private LazyLoad _Justify; - public string Justify - { - get - { - return LazyLoad(ref _Justify, "@Justify"); - } - } - private LazyLoad _x; - public int? x - { - get - { - return LazyLoad(ref _x, "@x"); - } - } - private LazyLoad _y; - public int? y - { - get - { - return LazyLoad(ref _y, "@y"); - } - } - private LazyLoad _width; - public int? width - { - get - { - return LazyLoad(ref _width, "@width"); - } - } - private LazyLoad _height; - public int? height - { - get - { - return LazyLoad(ref _height, "@height"); - } - } - } - public class PsiFields : vlnFormatList - { - public PsiFields(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - public class PsiField : vlnFormatItem - { - public PsiField(XmlNode xmlNode) : base(xmlNode) { } - public PsiField() : base() { } - private LazyLoad _name; - public string name - { - get - { - return LazyLoad(ref _name, "@name"); - } - } - private LazyLoad _type; - public string type - { - get - { - return LazyLoad(ref _type, "@type"); - } - } - private LazyLoad _text; - public string text - { - get - { - return LazyLoad(ref _text, "@text"); - } - } - private LazyLoad _Length; - public int? Length - { - get - { - return LazyLoad(ref _Length, "@Length"); - } - } - private LazyLoad _x; - public int? x - { - get - { - return LazyLoad(ref _x, "@x"); - } - } - private LazyLoad _y; - public int? y - { - get - { - return LazyLoad(ref _y, "@y"); - } - } - private LazyLoad _width; - public int? width - { - get - { - return LazyLoad(ref _width, "@width"); - } - } - private LazyLoad _height; - public int? height - { - get - { - return LazyLoad(ref _height, "@height"); - } - } - } - #endregion - #region CheckOffAll - #region CheckOffData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class CheckOffData : vlnFormatItem - { - public CheckOffData(XmlNode xmlNode) : base(xmlNode) { } - private CheckOffList _CheckOffList; - public CheckOffList CheckOffList - { - get - { - return _CheckOffList == null? _CheckOffList = new CheckOffList(SelectNodes("CheckOffList/CheckOff"),MyFormat):_CheckOffList; - } - } - private CheckOffHeaderList _CheckOffHeaderList; - public CheckOffHeaderList CheckOffHeaderList - { - get - { - return _CheckOffHeaderList == null? _CheckOffHeaderList = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"),MyFormat): _CheckOffHeaderList; - } - } - private LazyLoad _Menu; - public string Menu - { - get - { - return LazyLoad(ref _Menu, "@Menu"); - } - } - private LazyLoad _AllowSectEdit; - public bool AllowSectEdit - { - get - { - return LazyLoad(ref _AllowSectEdit, "@AllowSectEdit"); - } - } - private LazyLoad _AllowStepEdit; - public bool AllowStepEdit - { - get - { - return LazyLoad(ref _AllowStepEdit, "@AllowStepEdit"); - } - } - private LazyLoad _UseCheckOffsIn; - public int? UseCheckOffsIn - { - get - { - return LazyLoad(ref _UseCheckOffsIn, "@UseCheckOffsIn"); - } - } - private LazyLoad _CheckOffAdjustment; - public float? CheckOffAdjustment - { - get - { - return LazyLoad(ref _CheckOffAdjustment, "@CheckOffAdjustment"); - } - } - private LazyLoad _XLocation; - public float? XLocation - { - get - { - return LazyLoad(ref _XLocation, "@XLocation"); - } - } - private LazyLoad _RelXLocation; - public float? RelXLocation - { - get - { - return LazyLoad(ref _RelXLocation, "@RelXLocation"); - } - } - private LazyLoad _CheckOffXtraLines; - public int? CheckOffXtraLines - { - get - { - return LazyLoad(ref _CheckOffXtraLines, "@CheckOffXtraLines"); - } - } - private LazyLoad _DropCheckOff; - public bool DropCheckOff - { - get - { - return LazyLoad(ref _DropCheckOff, "@DropCheckOff"); - } - } - private LazyLoad _CheckOffOnHLSOnly; - public bool CheckOffOnHLSOnly - { - get - { - return LazyLoad(ref _CheckOffOnHLSOnly, "@CheckOffOnHLSOnly"); - } - } - private LazyLoad _SkipSpaces; - public bool SkipSpaces - { - get - { - return LazyLoad(ref _SkipSpaces, "@SkipSpaces"); - } - } - } - #endregion - //#region RightCheckOffBox - //[TypeConverter(typeof(ExpandableObjectConverter))] - //public class RightCheckOffBox : vlnFormatItem, IVlnIndexedFormatItem - //{ - // public RightCheckOffBox(XmlNode xmlNode) : base(xmlNode) { } - // public RightCheckOffBox() : base() { } - // private LazyLoad _Index; - // public int? Index - // { - // get - // { - // return LazyLoad(ref _Index, "@Index"); - // } - // } - // private LazyLoad _RightCheckOffBoxChar; - // public int? RightCheckOffBoxChar - // { - // get - // { - // return LazyLoad(ref _RightCheckOffBoxChar, "@RightCheckOffBoxChar"); - // } - // } - // public override string GetPDDisplayName() - // { return string.Format("[{0}]", Index); } - // public override string GetPDDescription() - // { return string.Format("[{0}] - {1}", Index, RightCheckOffBoxChar); } - // public override string GetPDCategory() - // { return "RightCheckOffBox Data"; } - // public override string ToString() - // { - // return RightCheckOffBoxChar.ToString(); - // } - //} - //#endregion - //#region RightCheckOffBoxList - //[TypeConverter(typeof(vlnIndexedListConverter))] - //public class RightCheckOffBoxList : vlnIndexedFormatList - //{ - // public RightCheckOffBoxList(XmlNodeList xmlNodeList,IFormatOrFormatInfo myFormat) : base(xmlNodeList,myFormat) { } - // public override vlnIndexedFormatList InheritedList - // { - // get - // { - // IFormatOrFormatInfo parentFormat = MyFormat.MyIParent; - // if (parentFormat != null) - // return parentFormat.PlantFormat.FormatData.ProcData.CheckOffData.RightCheckOffBoxList; - // return null; - // } - // } - //} - //#endregion - #region CheckOff - [TypeConverter(typeof(ExpandableObjectConverter))] - public class CheckOff : vlnFormatItem,IVlnIndexedFormatItem - { - public CheckOff(XmlNode xmlNode) : base(xmlNode) { } - public CheckOff() : base() { } - private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private LazyLoad _UIMark; - public int? UIMark - { - get - { - return LazyLoad(ref _UIMark, "@UIMark"); - } - } - private LazyLoad _CheckOffWidAdjust; - public float? CheckOffWidAdjust - { - get - { - return LazyLoad(ref _CheckOffWidAdjust, "@CheckOffWidAdjust"); - } - } - private LazyLoad _MenuItem; - public string MenuItem - { - get - { - return LazyLoad(ref _MenuItem, "@MenuItem"); - } - } - private LazyLoad _Macro; - public string Macro - { - get - { - return LazyLoad(ref _Macro, "@Macro"); - } - } - private LazyLoad _NotOnEmpty; - public bool NotOnEmpty - { - get - { - return LazyLoad(ref _NotOnEmpty, "@NotOnEmpty"); - } - } - public override string GetPDDisplayName() - { return string.Format("[{0}]",Index); } - public override string GetPDDescription() - { return string.Format("[{0}] - {1}", Index, MenuItem); } - public override string GetPDCategory() - { return "Checkoff Data"; } - public override string ToString() - { - return MenuItem; - } - } - #endregion - #region CheckOffList - [TypeConverter(typeof(vlnIndexedListConverter))] - public class CheckOffList : vlnIndexedFormatList - { - public CheckOffList(XmlNodeList xmlNodeList,IFormatOrFormatInfo myFormat) : base(xmlNodeList,myFormat) { } - public override vlnIndexedFormatList InheritedList - { - get - { - IFormatOrFormatInfo parentFormat = MyFormat.MyIParent; - if (parentFormat != null) - return parentFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList; - return null; - } - } - } - #endregion - #region CheckOffHeader - [TypeConverter(typeof(ExpandableObjectConverter))] - public class CheckOffHeader : vlnFormatItem,IVlnIndexedFormatItem - { - public CheckOffHeader(XmlNode xmlNode) : base(xmlNode) { } - public CheckOffHeader() : base() { } - private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null ? _Font = new VE_Font(base.XmlNode) : _Font); - } - } - private LazyLoad _CheckOffHeading; - public string CheckOffHeading - { - get - { - return LazyLoad(ref _CheckOffHeading, "@CheckOffHeading"); - } - } - public override string GetPDDisplayName() - { return string.Format("[{0}]", Index); } - public override string GetPDDescription() - { return string.Format("[{0}] - {1}", Index, CheckOffHeading); } - public override string GetPDCategory() - { return "Checkoff Header Data"; } - public override string ToString() - { - return CheckOffHeading; - } - } - #endregion - #region CheckOffHeaderList - [TypeConverter(typeof(vlnIndexedListConverter))] - public class CheckOffHeaderList : vlnIndexedFormatList - { - public CheckOffHeaderList(XmlNodeList xmlNodeList,IFormatOrFormatInfo myFormat) : base(xmlNodeList,myFormat) { } - public override vlnIndexedFormatList InheritedList - { - get - { - IFormatOrFormatInfo parentFormat = MyFormat.MyIParent; - if (parentFormat != null) - return parentFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList; - return null; - } - } - } - #endregion - #endregion - #region ChangeBarData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ChangeBarData : vlnFormatItem - { - public ChangeBarData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _DefaultCBLoc; - public string DefaultCBLoc - { - get - { - return LazyLoad(ref _DefaultCBLoc, "@DefaultCBLoc"); - } - } - private LazyLoad _ChangeBarMessage; - public string ChangeBarMessage - { - get - { - return LazyLoad(ref _ChangeBarMessage, "@ChangeBarMessage"); - } - } - private LazyLoad _FixedChangeColumn; - public int? FixedChangeColumn - { - get - { - return LazyLoad(ref _FixedChangeColumn, "@FixedChangeColumn"); - } - } - private LazyLoad _FixedAERChangeColumn; - public int? FixedAERChangeColumn - { - get - { - return LazyLoad(ref _FixedAERChangeColumn, "@FixedAERChangeColumn"); - } - } - private LazyLoad _ChangeSummaryStyle; - public E_Style? ChangeSummaryStyle - { - get - { - return LazyLoad(ref _ChangeSummaryStyle, "@ChangeSummaryStyle"); - } - } - private LazyLoad _ChangeBarStyle; - public E_Style? ChangeBarStyle - { - get - { - return LazyLoad(ref _ChangeBarStyle, "@ChangeBarStyle"); - } - } - private LazyLoad _SpecialChangeBar; - public string SpecialChangeBar - { - get - { - return LazyLoad(ref _SpecialChangeBar, "@SpecialChangeBar"); - } - } - private LazyLoad _CondensedChangeBar; - public bool CondensedChangeBar - { - get - { - return LazyLoad(ref _CondensedChangeBar, "@CondensedChangeBar"); - } - } - private LazyLoad _AbsoluteFixedChangeColumn; - public bool AbsoluteFixedChangeColumn - { - get - { - return LazyLoad(ref _AbsoluteFixedChangeColumn, "@AbsoluteFixedChangeColumn"); - } - } - private LazyLoad _ContinuousChangeBars; - public bool ContinuousChangeBars - { - get - { - return LazyLoad(ref _ContinuousChangeBars, "@ContinuousChangeBars"); - } - } - private LazyLoad _ChgBarMessageFromEdit; - public bool ChgBarMessageFromEdit - { - get - { - return LazyLoad(ref _ChgBarMessageFromEdit, "@ChgBarMessageFromEdit"); - } - } - private LazyLoad _MultipleChangeIds; - public bool MultipleChangeIds - { - get - { - return LazyLoad(ref _MultipleChangeIds, "@MultipleChangeIds"); - } - } - private LazyLoad _ChangeBarToRNOSep; - public bool ChangeBarToRNOSep - { - get - { - return LazyLoad(ref _ChangeBarToRNOSep, "@ChangeBarToRNOSep"); - } - } - private LazyLoad _ChangeBarsOnLinkedText; - public bool ChangeBarsOnLinkedText - { - get - { - return LazyLoad(ref _ChangeBarsOnLinkedText, "@ChangeBarsOnLinkedText"); - } - } - } - #endregion - #endregion - #region SectDataAll - #region SectData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class SectData : vlnFormatItem - { - public SectData(XmlNode xmlNode) : base(xmlNode) { } - private SectionNumber _SectionNumber; - public SectionNumber SectionNumber - { - get - { - if (_SectionNumber == null) _SectionNumber = new SectionNumber(SelectSingleNode("SectionNumber")); - return _SectionNumber; - } - } - private SectionHeader _SectionHeader; - public SectionHeader SectionHeader - { - get - { - if (_SectionHeader == null) _SectionHeader = new SectionHeader(SelectSingleNode("SectionHeader")); - return _SectionHeader; - } - } - private StepSectionData _StepSectionData; - public StepSectionData StepSectionData - { - get - { - if (_StepSectionData == null) _StepSectionData = new StepSectionData(SelectSingleNode("StepSectionData")); - return _StepSectionData; - } - } - private AccSectionData _AccSectionData; - public AccSectionData AccSectionData - { - get - { - if (_AccSectionData == null) _AccSectionData = new AccSectionData(SelectSingleNode("AccSectionData")); - return _AccSectionData; - } - } - private MetaSectionList _MetaSectionList; - public MetaSectionList MetaSectionList - { - get - { - if (_MetaSectionList == null) _MetaSectionList = new MetaSectionList(SelectNodes("MetaSectionData/MetaSection"),MyFormat); - return _MetaSectionList; - } - set { _MetaSectionList = value; } - } - private ReplaceStrList _ReplaceStrList; - public ReplaceStrList ReplaceStrList - { - get - { - return (_ReplaceStrList == null) ? _ReplaceStrList = new ReplaceStrList(SelectNodes("ReplaceStrData/ReplaceStr")) : _ReplaceStrList; - } - set { _ReplaceStrList = value; } - } - private LazyLoad _SectionTitleLength; - public int? SectionTitleLength - { - get - { - return LazyLoad(ref _SectionTitleLength, "@SectionTitleLength"); - } - } - private LazyLoad _ForeColor; - public string ForeColor - { - get - { - return LazyLoad(ref _ForeColor, "@ForeColor"); - } - } - private LazyLoad _BackColor; - public string BackColor - { - get - { - return LazyLoad(ref _BackColor, "@BackColor"); - } - } - private LazyLoad _MetaSectEndMessage; - public bool MetaSectEndMessage - { - get - { - return LazyLoad(ref _MetaSectEndMessage, "@MetaSectEndMessage"); - } - } - private LazyLoad _ReadOnlyTypeInContMsg; - public bool ReadOnlyTypeInContMsg - { - get - { - return LazyLoad(ref _ReadOnlyTypeInContMsg, "@ReadOnlyTypeInContMsg"); - } - } - private LazyLoad _ReplaceWordsInROs; - public bool ReplaceWordsInROs - { - get - { - return LazyLoad(ref _ReplaceWordsInROs, "@ReplaceWordsInROs"); - } - } - private LazyLoad _UseMetaSections; - public bool UseMetaSections - { - get - { - return LazyLoad(ref _UseMetaSections, "@UseMetaSections"); - } - } - private LazyLoad _DefaultNoSubAutoIndent; - public bool DefaultNoSubAutoIndent - { - get - { - return LazyLoad(ref _DefaultNoSubAutoIndent, "@DefaultNoSubAutoIndent"); - } - } - private LazyLoad _NonEditableSteps; - public bool NonEditableSteps - { - get - { - return LazyLoad(ref _NonEditableSteps, "@NonEditableSteps"); - } - } - private LazyLoad _SearchAllReplaceWords; - public bool SearchAllReplaceWords - { - get - { - return LazyLoad(ref _SearchAllReplaceWords, "@SearchAllReplaceWords"); - } - } - private LazyLoad _SecTitleContinue; - public bool SecTitleContinue - { - get - { - return LazyLoad(ref _SecTitleContinue, "@SecTitleContinue"); - } - } - private LazyLoad _ConvertCaretToDelta; - public bool ConvertCaretToDelta - { - get - { - return LazyLoad(ref _ConvertCaretToDelta, "@ConvertCaretToDelta"); - } - } - // This format flag turns off the Replace Words functionality. - // in 16-bit proms, this was done simply by having an empty Replace Words list. - // in 32-bit the inheiradence logic finds a replace words list in the base format - // if the plant format does not have one. Thus the need of this format flag. - private LazyLoad _TurnOffReplaceWords; - public bool TurnOffReplaceWords - { - get - { - return LazyLoad(ref _TurnOffReplaceWords, "@TurnOffReplaceWords"); - } - } - } - #endregion - #region SectionNumber - [TypeConverter(typeof(ExpandableObjectConverter))] - public class SectionNumber : vlnFormatItem - { - public SectionNumber(XmlNode xmlNode) : base(xmlNode) { } - public SectionNumber() : base() { } - private LazyLoad _Pos; - public float? Pos - { - get - { - return LazyLoad(ref _Pos, "@Pos"); - } - } - private LazyLoad _Just; - public string Just - { - get - { - return LazyLoad(ref _Just, "@Just"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null ? _Font = new VE_Font(base.XmlNode) : _Font); - } - } - } - #endregion - #region SectionHeader - [TypeConverter(typeof(ExpandableObjectConverter))] - public class SectionHeader : vlnFormatItem - { - public SectionHeader(XmlNode xmlNode) : base(xmlNode) { } - public SectionHeader() : base() { } - private LazyLoad _Pos; - public float? Pos - { - get - { - return LazyLoad(ref _Pos, "@Pos"); - } - } - private LazyLoad _Just; - public string Just - { - get - { - return LazyLoad(ref _Just, "@Just"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null ? _Font = new VE_Font(base.XmlNode) : _Font); - } - } - } - #endregion - #region StepSectionDataAll - #region StepSectionData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class StepSectionData : vlnFormatItem - { - public StepSectionData(XmlNode xmlNode) : base(xmlNode) { } - private TextTypeValueList _TextTypeValueList; - public TextTypeValueList TextTypeValueList - { - get - { - return (_TextTypeValueList == null)? _TextTypeValueList = new TextTypeValueList(SelectNodes("TextTypeValue/short")): _TextTypeValueList; - } - set { _TextTypeValueList = value; } - } - private TextTypeList _TextTypeList; - public TextTypeList TextTypeList - { - get - { - return (_TextTypeList == null)? _TextTypeList = new TextTypeList(SelectNodes("TextType/string")): _TextTypeList; - } - set { _TextTypeList = value; } - } - //private SeqTabList _SeqTabList; - //public SeqTabList SeqTabList - //{ - // get - // { - // return (_SeqTabList == null)? _SeqTabList = new SeqTabList(SelectNodes("SeqTab/string")): _SeqTabList; - // } - // set { _SeqTabList = value; } - //} - //private PreSeqTabEditList _PreSeqTabEditList; - //public PreSeqTabEditList PreSeqTabEditList - //{ - // get - // { - // return (_PreSeqTabEditList == null) ?_PreSeqTabEditList = new PreSeqTabEditList(SelectNodes("PreSeqTabEdit/string")): _PreSeqTabEditList; - // } - // set { _PreSeqTabEditList = value; } - //} - //private PreSeqTabPrintList _PreSeqTabPrintList; - //public PreSeqTabPrintList PreSeqTabPrintList - //{ - // get - // { - // return (_PreSeqTabPrintList == null)? _PreSeqTabPrintList = new PreSeqTabPrintList(SelectNodes("PreSeqTabPrint/string")):_PreSeqTabPrintList; - // } - // set { _PreSeqTabPrintList = value; } - //} - //private PostSeqTabEditList _PostSeqTabEditList; - //public PostSeqTabEditList PostSeqTabEditList - //{ - // get - // { - // return (_PostSeqTabEditList == null)? _PostSeqTabEditList = new PostSeqTabEditList(SelectNodes("PostSeqTabEdit/string")): _PostSeqTabEditList; - // } - // set { _PostSeqTabEditList = value; } - //} - //private PostSeqTabPrintList _PostSeqTabPrintList; - //public PostSeqTabPrintList PostSeqTabPrintList - //{ - // get - // { - // return (_PostSeqTabPrintList == null)? _PostSeqTabPrintList = new PostSeqTabPrintList(SelectNodes("PostSeqTabPrint/string")): _PostSeqTabPrintList; - // } - // set { _PostSeqTabPrintList = value; } - //} - private UnderlineTerminateList _UnderlineTerminateList; - public UnderlineTerminateList UnderlineTerminateList - { - get - { - return (_UnderlineTerminateList == null)? _UnderlineTerminateList = new UnderlineTerminateList(SelectNodes("UnderlineTerminate/string")):_UnderlineTerminateList; - } - set { _UnderlineTerminateList = value; } - } - private ObserveNCString1List _ObserveNCString1List; - public ObserveNCString1List ObserveNCString1List - { - get - { - return (_ObserveNCString1List == null)? _ObserveNCString1List = new ObserveNCString1List(SelectNodes("ObserveNCString1/string")): _ObserveNCString1List; - } - set { _ObserveNCString1List = value; } - } - private ObserveNCString2List _ObserveNCString2List; - public ObserveNCString2List ObserveNCString2List - { - get - { - return (_ObserveNCString2List == null)? _ObserveNCString2List = new ObserveNCString2List(SelectNodes("ObserveNCString2/string")):_ObserveNCString2List; - } - set { _ObserveNCString2List = value; } - } - private StepSectionLayoutData _StepSectionLayoutData; - public StepSectionLayoutData StepSectionLayoutData - { - get - { - return (_StepSectionLayoutData == null)? _StepSectionLayoutData = new StepSectionLayoutData(SelectSingleNode("StpSectLayData")):_StepSectionLayoutData; - } - } - private StepSectionEditData _StepSectionEditData; - public StepSectionEditData StepSectionEditData - { - get - { - return (_StepSectionEditData == null)? _StepSectionEditData = new StepSectionEditData(SelectSingleNode("StpSectEditData")): _StepSectionEditData; - } - } - private SeqTabFmtList _SeqTabFmtList; - public SeqTabFmtList SeqTabFmtList - { - get - { - return (_SeqTabFmtList == null) ? _SeqTabFmtList = new SeqTabFmtList(SelectNodes("SequentialTabFormat/SeqTabFmt"),MyFormat) : _SeqTabFmtList; - } - } - private StepSectionPrintData _StepSectionPrintData; - public StepSectionPrintData StepSectionPrintData - { - get - { - return (_StepSectionPrintData == null) ? _StepSectionPrintData = new StepSectionPrintData(SelectSingleNode("StpSectPrtData")) : _StepSectionPrintData; - } - } - private LazyLoad _TopRow; - public int? TopRow - { - get - { - return LazyLoad(ref _TopRow, "@TopRow"); - } - } - //private LazyLoad _SeqStart; - //public string SeqStart - //{ - // get - // { - // return LazyLoad(ref _SeqStart, "@SeqStart"); - // } - //} - //private LazyLoad _LeftJustSeqTab; - //public string LeftJustSeqTab - //{ - // get - // { - // return LazyLoad(ref _LeftJustSeqTab, "@LeftJustSeqTab") ; - // } - //} - //private LazyLoad _HighSeqStart; - //public int? HighSeqStart - //{ - // get - // { - // return LazyLoad(ref _HighSeqStart, "@HighSeqStart"); - // } - //} - private LazyLoad _IndentToken; - public string IndentToken - { - get - { - return LazyLoad(ref _IndentToken, "@IndentToken"); - } - } - private LazyLoad _NumberOfHighLevelSteps; - public int? NumberOfHighLevelSteps - { - get - { - return LazyLoad(ref _NumberOfHighLevelSteps, "@NumberOfHighLevelSteps"); - } - } - private LazyLoad _NumberOfSubStypeTypes; - public int? NumberOfSubStypeTypes - { - get - { - return LazyLoad(ref _NumberOfSubStypeTypes, "@NumberOfSubStepTypes"); - } - } - private LazyLoad _IdentB; - public string IdentB - { - get - { - return LazyLoad(ref _IdentB, "@IdentB"); - } - } - private LazyLoad _WolfCreekBackgroundFormat; - public bool WolfCreekBackgroundFormat - { - get - { - return LazyLoad(ref _WolfCreekBackgroundFormat, "@WolfCreekBackgroundFormat"); - } - } - private LazyLoad _WolfcreekCKLFormat; - public bool WolfcreekCKLFormat - { - get - { - return LazyLoad(ref _WolfcreekCKLFormat, "@WolfcreekCKLFormat"); - } - } - private LazyLoad _WolfcreekCKLBackgndFormat; - public bool WolfcreekCKLBackgndFormat - { - get - { - return LazyLoad(ref _WolfcreekCKLBackgndFormat, "@WolfcreekCKLBackgndFormat"); - } - } - private LazyLoad _FortranFormatNumbers; - public bool FortranFormatNumbers - { - get - { - return LazyLoad(ref _FortranFormatNumbers, "@FortranFormatNumbers"); - } - } - private LazyLoad _UseTopContinueMessageAtEnd; - public bool UseTopContinueMessageAtEnd - { - get - { - return LazyLoad(ref _UseTopContinueMessageAtEnd, "@UseTopContinueMessageAtEnd"); - } - } - private LazyLoad _FloatingContinueMessage; - public bool FloatingContinueMessage - { - get - { - return LazyLoad(ref _FloatingContinueMessage, "@FloatingContinueMessage"); - } - } - private LazyLoad _WrapSameAsEdit; - public bool WrapSameAsEdit - { - get - { - return LazyLoad(ref _WrapSameAsEdit, "@WrapSameAsEdit"); - } - } - private LazyLoad _ContinueSectionHeader; - public bool ContinueSectionHeader - { - get - { - return LazyLoad(ref _ContinueSectionHeader, "@ContinueSectionHeader"); - } - } - private LazyLoad _CompressHPSub; - public bool CompressHPSub - { - get - { - return LazyLoad(ref _CompressHPSub, "@CompressHPSub"); - } - } - private LazyLoad _CompressHPSuper; - public bool CompressHPSuper - { - get - { - return LazyLoad(ref _CompressHPSuper, "@CompressHPSuper"); - } - } - private LazyLoad _UndSpecialStepsFoldout; - public bool UndSpecialStepsFoldout - { - get - { - return LazyLoad(ref _UndSpecialStepsFoldout, "@UndSpecialStepsFoldout"); - } - } - private LazyLoad _UnderlineAllMetaTitles; - public bool UnderlineAllMetaTitles - { - get - { - return LazyLoad(ref _UnderlineAllMetaTitles, "@UnderlineAllMetaTitles"); - } - } - private LazyLoad _BoldOnlySectionZero; - public bool BoldOnlySectionZero - { - get - { - return LazyLoad(ref _BoldOnlySectionZero, "@BoldOnlySectionZero"); - } - } - private LazyLoad _ImperfectStructure; - public bool ImperfectStructure - { - get - { - return LazyLoad(ref _ImperfectStructure, "@ImperfectStructure"); - } - } - private LazyLoad _ImperfectSubstep; - public bool ImperfectSubstep - { - get - { - return LazyLoad(ref _ImperfectSubstep, "@ImperfectSubstep"); - } - } - private LazyLoad _ImperfectStructurePlus4; - public bool ImperfectStructurePlus4 - { - get - { - return LazyLoad(ref _ImperfectStructurePlus4, "@ImperfectStructurePlus4"); - } - } - private LazyLoad _CountAllSubLevels; - public bool CountAllSubLevels - { - get - { - return LazyLoad(ref _CountAllSubLevels, "@CountAllSubLevels"); - } - } - private LazyLoad _UseMultiLineSectionTitle; - public bool UseMultiLineSectionTitle - { - get - { - return LazyLoad(ref _UseMultiLineSectionTitle, "@UseMultiLineSectionTitle"); - } - } - private LazyLoad _AdjustRNOCautionNoteWidth; - public bool AdjustRNOCautionNoteWidth - { - get - { - return LazyLoad(ref _AdjustRNOCautionNoteWidth, "@AdjustRNOCautionNoteWidth"); - } - } - } - #endregion - #region TextTypeValue - [TypeConverter(typeof(ExpandableObjectConverter))] - public class TextTypeValue : vlnFormatItem - { - public TextTypeValue(XmlNode xmlNode) : base(xmlNode) { } - public TextTypeValue() : base() { } - private LazyLoad _TheValue; - public int? TheValue - { - get - { - return LazyLoad(ref _TheValue, "text()"); - } - } - public override string GetPDDisplayName() - { return "Value"; } - public override string GetPDDescription() - { return string.Format("TextTypeValue '{0}'", TheValue); } - public override string GetPDCategory() - { return "Text Type Value"; } - public override string ToString() - { - return TheValue.ToString(); - } - } - #endregion - #region TextTypeValueList - [TypeConverter(typeof(vlnListConverter))] - public class TextTypeValueList : vlnFormatList - { - public TextTypeValueList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region TextType - [TypeConverter(typeof(ExpandableObjectConverter))] - public class TextType : vlnFormatItem - { - public TextType(XmlNode xmlNode) : base(xmlNode) { } - public TextType() : base() { } - //[Category("Strings")] - private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("TextType '{0}'", Text); } - public override string GetPDCategory() - { return "Text Type"; } - public override string ToString() - { - return Text; - } - } - #endregion - #region TextTypeList - [TypeConverter(typeof(vlnListConverter))] - public class TextTypeList : vlnFormatList - { - public TextTypeList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region OLD - SeqTab - //[TypeConverter(typeof(ExpandableObjectConverter))] - //public class SeqTab : vlnFormatItem - //{ - // public SeqTab(XmlNode xmlNode) : base(xmlNode) { } - // public SeqTab() : base() { } - // private LazyLoad _Text; - // public string Text - // { - // get - // { - // return LazyLoad(ref _Text, "text()"); - // } - // } - // public override string GetPDDisplayName() - // { return "Text"; } - // public override string GetPDDescription() - // { return string.Format("SeqTab '{0}'", Text); } - // public override string GetPDCategory() - // { return "Seq Tab"; } - // public override string ToString() - // { - // return Text; - // } - //} - #endregion - #region OLD - SeqTabList - //[TypeConverter(typeof(vlnListConverter))] - //public class SeqTabList : vlnFormatList - //{ - // public SeqTabList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - //} - #endregion - #region OLD - PreSeqTabEdit - //[TypeConverter(typeof(ExpandableObjectConverter))] - //public class PreSeqTabEdit : vlnFormatItem - //{ - // public PreSeqTabEdit(XmlNode xmlNode) : base(xmlNode) { } - // public PreSeqTabEdit() : base() { } - // //[Category("Strings")] - // private LazyLoad _Text; - // public string Text - // { - // get - // { - // return LazyLoad(ref _Text, "text()"); - // } - // } - // public override string GetPDDisplayName() - // { return "Text"; } - // public override string GetPDDescription() - // { return string.Format("PreSeqTabEdit '{0}'", Text); } - // public override string GetPDCategory() - // { return "PreSeq Tab Edit"; } - // public override string ToString() - // { - // return Text; - // } - //} - #endregion - #region OLD - PreSeqTabEditList - //[TypeConverter(typeof(vlnListConverter))] - //public class PreSeqTabEditList : vlnFormatList - //{ - // public PreSeqTabEditList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - //} - #endregion - #region OLD - PreSeqTabPrint - //[TypeConverter(typeof(ExpandableObjectConverter))] - //public class PreSeqTabPrint : vlnFormatItem - //{ - // public PreSeqTabPrint(XmlNode xmlNode) : base(xmlNode) { } - // public PreSeqTabPrint() : base() { } - // private LazyLoad _Text; - // public string Text - // { - // get - // { - // return LazyLoad(ref _Text, "text()"); - // } - // } - // public override string GetPDDisplayName() - // { return "Text"; } - // public override string GetPDDescription() - // { return string.Format("PreSeqTabPrint '{0}'", Text); } - // public override string GetPDCategory() - // { return "PreSeq Tab Printt"; } - // public override string ToString() - // { - // return Text; - // } - //} - #endregion - #region OLD - PreSeqTabPrintList - //[TypeConverter(typeof(vlnListConverter))] - //public class PreSeqTabPrintList : vlnFormatList - //{ - // public PreSeqTabPrintList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - //} - #endregion - #region OLD - PostSeqTabEdit - //[TypeConverter(typeof(ExpandableObjectConverter))] - //public class PostSeqTabEdit : vlnFormatItem - //{ - // public PostSeqTabEdit(XmlNode xmlNode) : base(xmlNode) { } - // public PostSeqTabEdit() : base() { } - // private LazyLoad _Text; - // public string Text - // { - // get - // { - // return LazyLoad(ref _Text, "text()"); - // } - // } - // public override string GetPDDisplayName() - // { return "Text"; } - // public override string GetPDDescription() - // { return string.Format("PostSeqTabEdit '{0}'", Text); } - // public override string GetPDCategory() - // { return "PostSeq Tab Edit"; } - // public override string ToString() - // { - // return Text; - // } - //} - #endregion - #region OLD - PostSeqTabEditList - //[TypeConverter(typeof(vlnListConverter))] - //public class PostSeqTabEditList : vlnFormatList - //{ - // public PostSeqTabEditList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - //} - #endregion - #region OLD - PostSeqTabPrint - //[TypeConverter(typeof(ExpandableObjectConverter))] - //public class PostSeqTabPrint : vlnFormatItem - //{ - // public PostSeqTabPrint(XmlNode xmlNode) : base(xmlNode) { } - // public PostSeqTabPrint() : base() { } - // private LazyLoad _Text; - // public string Text - // { - // get - // { - // return LazyLoad(ref _Text, "text()"); - // } - // } - // public override string GetPDDisplayName() - // { return "Text"; } - // public override string GetPDDescription() - // { return string.Format("PostSeqTabPrint '{0}'", Text); } - // public override string GetPDCategory() - // { return "PostSeq Tab Printt"; } - // public override string ToString() - // { - // return Text; - // } - //} - #endregion - #region OLD - PostSeqTabPrintList - //[TypeConverter(typeof(vlnListConverter))] - //public class PostSeqTabPrintList : vlnFormatList - //{ - // public PostSeqTabPrintList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - //} - #endregion - #region UnderlineTerminate - [TypeConverter(typeof(ExpandableObjectConverter))] - public class UnderlineTerminate : vlnFormatItem - { - public UnderlineTerminate(XmlNode xmlNode) : base(xmlNode) { } - public UnderlineTerminate() : base() { } - private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("UnderlineTerminate '{0}'", Text); } - public override string GetPDCategory() - { return "Underline Terminate"; } - public override string ToString() - { - return Text; - } - } - #endregion - #region UnderlineTerminateList - [TypeConverter(typeof(vlnListConverter))] - public class UnderlineTerminateList : vlnFormatList - { - public UnderlineTerminateList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region ObserveNCString1 - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ObserveNCString1 : vlnFormatItem - { - public ObserveNCString1(XmlNode xmlNode) : base(xmlNode) { } - public ObserveNCString1() : base() { } - private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("ObserveNCString1 '{0}'", Text); } - public override string GetPDCategory() - { return "ObserveNCString1"; } - public override string ToString() - { - return Text; - } - } - #endregion - #region ObserveNCString1List - [TypeConverter(typeof(vlnListConverter))] - public class ObserveNCString1List : vlnFormatList - { - public ObserveNCString1List(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region ObserveNCString2 - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ObserveNCString2 : vlnFormatItem - { - public ObserveNCString2(XmlNode xmlNode) : base(xmlNode) { } - public ObserveNCString2() : base() { } - private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("ObserveNCString2 '{0}'", Text); } - public override string GetPDCategory() - { return "ObserveNCString2"; } - public override string ToString() - { - return Text; - } - } - #endregion - #region ObserveNCString2List - [TypeConverter(typeof(vlnListConverter))] - public class ObserveNCString2List : vlnFormatList - { - public ObserveNCString2List(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region ReplaceStr - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ReplaceStr : vlnFormatItem - { - public ReplaceStr(XmlNode xmlNode) : base(xmlNode) { } - public ReplaceStr() : base() { } - [Category("Strings")] - private LazyLoad _ReplaceWord; - public string ReplaceWord - { - get - { - return LazyLoad(ref _ReplaceWord, "@ReplaceWord"); - } - } - [Category("Strings")] - private LazyLoad _ReplaceWith; - public string ReplaceWith - { - get - { - return LazyLoad(ref _ReplaceWith, "@ReplaceWith"); - } - } - private LazyLoad _Flag; - public E_ReplaceFlags? Flag - { - get - { - return LazyLoad(ref _Flag, "@Flag"); - } - } - public override string GetPDDisplayName() - { return ReplaceWord; } - public override string GetPDDescription() - { return string.Format("Replace '{0}' with '{1}'",ReplaceWord,ReplaceWith); } - public override string GetPDCategory() - { return "Words to Replace"; } - public override string ToString() - { - return ReplaceWith; - } - } - - #endregion - #region ReplaceStrList - [TypeConverter(typeof(vlnListConverter))] - public class ReplaceStrList : vlnFormatList - { - public ReplaceStrList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region StepSectionLayoutData - public class StepSectionLayoutData : vlnFormatItem - { - public StepSectionLayoutData(XmlNode xmlNode) : base(xmlNode) { } - private TopOfPage _TopOfPage; - public TopOfPage TopOfPage - { - get - { - return (_TopOfPage == null)? _TopOfPage = new TopOfPage(SelectSingleNode("TopOfPage")): _TopOfPage; - } - } - private Separator _Separator; - public Separator Separator - { - get - { - return (_Separator == null) ?_Separator = new Separator(SelectSingleNode("Separator")):_Separator; - } - } - private LazyLoad _LastLineToStartStep; - public float? LastLineToStartStep - { - get - { - return LazyLoad(ref _LastLineToStartStep, "@LastLineToStartStep"); - } - } - private LazyLoad _LineDrawingOption; - public int? LineDrawingOption - { - get - { - return LazyLoad(ref _LineDrawingOption, "@LineDrawingOption"); - } - } - private LazyLoad _TabPtsPerChar; - public float? TabPtsPerChar - { - get - { - return LazyLoad(ref _TabPtsPerChar, "@TabPtsPerChar"); - } - } - private LazyLoad _ColS; - public float? ColS - { - get - { - return LazyLoad(ref _ColS, "@ColS"); - } - } - private LazyLoad _ColT; - public float? ColT - { - get - { - return LazyLoad(ref _ColT, "@ColT"); - } - } - private LazyLoad _ColAbs; - public float? ColAbs - { - get - { - return LazyLoad(ref _ColAbs, "@ColAbs"); - } - } - private LazyLoad _WidT; - public float? WidT - { - get - { - return LazyLoad(ref _WidT, "@WidT"); - } - } - private LazyLoad _PMode; - public int? PMode - { - get - { - return LazyLoad(ref _PMode, "@PMode"); - } - } - private LazyLoad _MaxRNO; - public int? MaxRNO - { - get - { - return LazyLoad(ref _MaxRNO, "@MaxRNO"); - } - } - private LazyLoad _MaxRNOTable; - public string MaxRNOTable - { - get - { - return LazyLoad(ref _MaxRNOTable, "@MaxRNOTable"); - } - } - private LazyLoad _RNOWidthSameAsHighParent; - public bool RNOWidthSameAsHighParent - { - get - { - return LazyLoad(ref _RNOWidthSameAsHighParent, "@RNOWidthSameAsHighParent"); - } - } - private LazyLoad _SingleColumnRNOIndent; - public float? SingleColumnRNOIndent - { - get - { - return LazyLoad(ref _SingleColumnRNOIndent, "@SingleColumnRNOIndent"); - } - } - private LazyLoad _ColRTable; - public string ColRTable - { - get - { - return LazyLoad(ref _ColRTable, "@ColRTable"); - } - } - private LazyLoad _WidSTableEdit; - public string WidSTableEdit - { - get - { - return LazyLoad(ref _WidSTableEdit, "@WidSTableEdit"); - } - } - private LazyLoad _WidSTablePrint; - public string WidSTablePrint - { - get - { - return LazyLoad(ref _WidSTablePrint, "@WidSTablePrint"); - } - } - private LazyLoad _AdjRNOCol; - public float? AdjRNOCol - { - get - { - return LazyLoad(ref _AdjRNOCol, "@AdjRNOCol"); - } - } - private LazyLoad _EndMessagePos; - public int? EndMessagePos - { - get - { - return LazyLoad(ref _EndMessagePos, "@EndMessagePos"); - } - } - private LazyLoad _RNOWidthAlt; - public string RNOWidthAlt - { - get - { - return LazyLoad(ref _RNOWidthAlt, "@RNOWidthAlt"); - } - } - private LazyLoad _RNOWidthAdj; - public string RNOWidthAdj - { - get - { - return LazyLoad(ref _RNOWidthAdj, "@RNOWidthAdj"); - } - } - private LazyLoad _BoxLeftAdj; - public string BoxLeftAdj - { - get - { - return LazyLoad(ref _BoxLeftAdj, "@BoxLeftAdj"); - } - } - private LazyLoad _HLSWidthOVRD; - public int? HLSWidthOVRD - { - get - { - return LazyLoad(ref _HLSWidthOVRD, "@HLSWidthOVRD"); - } - } - private LazyLoad _SubPaginationWght; - public int? SubPaginationWght - { - get - { - return LazyLoad(ref _SubPaginationWght, "@SubPaginationWght"); - } - } - private LazyLoad _TextTitleAdjustment; - public int? TextTitleAdjustment - { - get - { - return LazyLoad(ref _TextTitleAdjustment, "@TextTitleAdjustment"); - } - } - private VE_Font _VertStyle; - public VE_Font VertStyle - { - get - { - return (_VertStyle == null)? _VertStyle = new VE_Font(base.XmlNode): _VertStyle; - } - } - private LazyLoad _TableCenterPos; - public string TableCenterPos - { - get - { - return LazyLoad(ref _TableCenterPos, "@TableCenterPos"); - } - } - private LazyLoad _LowerLimitDivisor; - public string LowerLimitDivisor - { - get - { - return LazyLoad(ref _LowerLimitDivisor, "@LowerLimitDivisor"); - } - } - private LazyLoad _NonLinkedStepNumber; - public string NonLinkedStepNumber - { - get - { - return LazyLoad(ref _NonLinkedStepNumber, "@NonLinkedStepNumber"); - } - } - private LazyLoad _NonLinkedCautNoteNumber; - public string NonLinkedCautNoteNumber - { - get - { - return LazyLoad(ref _NonLinkedCautNoteNumber, "@NonLinkedCautNoteNumber"); - } - } - private LazyLoad _NonLinkedRNONumber; - public string NonLinkedRNONumber - { - get - { - return LazyLoad(ref _NonLinkedRNONumber, "@NonLinkedRNONumber"); - } - } - private LazyLoad _Dev_Format; - public bool Dev_Format - { - get - { - return LazyLoad(ref _Dev_Format, "@Dev_Format"); - } - } - private LazyLoad _EnhancedShortFormDev; - public bool EnhancedShortFormDev - { - get - { - return LazyLoad(ref _EnhancedShortFormDev, "@EnhancedShortFormDev"); - } - } - private LazyLoad _SpecialPageBreakFlag; - public bool SpecialPageBreakFlag - { - get - { - return LazyLoad(ref _SpecialPageBreakFlag, "@SpecialPageBreakFlag"); - } - } - private LazyLoad _PaginateOnFirstSubstep; - public bool PaginateOnFirstSubstep - { - get - { - return LazyLoad(ref _PaginateOnFirstSubstep, "@PaginateOnFirstSubstep"); - } - } - private LazyLoad _PaginateOnFirstSubstep2X; - public bool PaginateOnFirstSubstep2X - { - get - { - return LazyLoad(ref _PaginateOnFirstSubstep2X, "@PaginateOnFirstSubstep2X"); - } - } - private LazyLoad _UseHalfLines; - public bool UseHalfLines - { - get - { - return LazyLoad(ref _UseHalfLines, "@UseHalfLines"); - } - } - private LazyLoad _TryToFillHalfOfPage; - public bool TryToFillHalfOfPage - { - get - { - return LazyLoad(ref _TryToFillHalfOfPage, "@TryToFillHalfOfPage"); - } - } - private LazyLoad _CompressSteps; - public bool CompressSteps - { - get - { - return LazyLoad(ref _CompressSteps, "@CompressSteps"); - } - } - private LazyLoad _DoSTExtraAtTop; - public bool DoSTExtraAtTop - { - get - { - return LazyLoad(ref _DoSTExtraAtTop, "@DoSTExtraAtTop"); - } - } - private LazyLoad _KeepStepsOnPage; - public bool KeepStepsOnPage - { - get - { - return LazyLoad(ref _KeepStepsOnPage, "@KeepStepsOnPage"); - } - } - private LazyLoad _BreakOnSections; - public bool BreakOnSections - { - get - { - return LazyLoad(ref _BreakOnSections, "@BreakOnSections"); - } - } - private LazyLoad _ShowSectionTitles; - public bool ShowSectionTitles - { - get - { - return LazyLoad(ref _ShowSectionTitles, "@ShowSectionTitles"); - } - } - private LazyLoad _EndForSingle; - public bool EndForSingle - { - get - { - return LazyLoad(ref _EndForSingle, "@EndForSingle"); - } - } - private LazyLoad _PaginateOnFirstSubstep3X; - public bool PaginateOnFirstSubstep3X - { - get - { - return LazyLoad(ref _PaginateOnFirstSubstep3X, "@PaginateOnFirstSubstep3X"); - } - } - private LazyLoad _PaginateOnLowerStepLevel; - public bool PaginateOnLowerStepLevel - { - get - { - return LazyLoad(ref _PaginateOnLowerStepLevel, "@PaginateOnLowerStepLevel"); - } - } - private LazyLoad _CustomSpacing; - public bool CustomSpacing - { - get - { - return LazyLoad(ref _CustomSpacing, "@CustomSpacing"); - } - } - private LazyLoad _SplitStepInPrntStep; - public bool SplitStepInPrntStep - { - get - { - return LazyLoad(ref _SplitStepInPrntStep, "@SplitStepInPrntStep"); - } - } - private LazyLoad _LineAboveUnderSection; - public bool LineAboveUnderSection - { - get - { - return LazyLoad(ref _LineAboveUnderSection, "@LineAboveUnderSection"); - } - } - private LazyLoad _PicaIgnoreFiveSixths; - public bool PicaIgnoreFiveSixths - { - get - { - return LazyLoad(ref _PicaIgnoreFiveSixths, "@PicaIgnoreFiveSixths"); - } - } - private LazyLoad _SpaceForNoSecNumb; - public bool SpaceForNoSecNumb - { - get - { - return LazyLoad(ref _SpaceForNoSecNumb, "@SpaceForNoSecNumb"); - } - } - private LazyLoad _PageBreakOnFirstBlankLine; - public bool PageBreakOnFirstBlankLine - { - get - { - return LazyLoad(ref _PageBreakOnFirstBlankLine, "@PageBreakOnFirstBlankLine"); - } - } - private LazyLoad _PutOnPageByItself; - public bool PutOnPageByItself - { - get - { - return LazyLoad(ref _PutOnPageByItself, "@PutOnPageByItself"); - } - } - private LazyLoad _PaginateAtHighestPaginLevel; - public bool PaginateAtHighestPaginLevel - { - get - { - return LazyLoad(ref _PaginateAtHighestPaginLevel, "@PaginateAtHighestPaginLevel"); - } - } - private LazyLoad _UseSTExtraRealValue; - public bool UseSTExtraRealValue - { - get - { - return LazyLoad(ref _UseSTExtraRealValue, "@UseSTExtraRealValue"); - } - } - private LazyLoad _DoSectionSeparatorLine; - public bool DoSectionSeparatorLine - { - get - { - return LazyLoad(ref _DoSectionSeparatorLine, "@DoSectionSeparatorLine"); - } - } - private LazyLoad _TieTabToLevel; - public bool TieTabToLevel - { - get - { - return LazyLoad(ref _TieTabToLevel, "@TieTabToLevel"); - } - } - private LazyLoad _HighLevelRNOBeforeAERSubsteps; - public bool HighLevelRNOBeforeAERSubsteps - { - get - { - return LazyLoad(ref _HighLevelRNOBeforeAERSubsteps, "@HighLevelRNOBeforeAERSubsteps"); - } - } - private LazyLoad _UseStepTypeWidthOverride; - public bool UseStepTypeWidthOverride - { - get - { - return LazyLoad(ref _UseStepTypeWidthOverride, "@UseStepTypeWidthOverride"); - } - } - private LazyLoad _UseStepTypeWidthOverrideEditPrint; - public bool UseStepTypeWidthOverrideEditPrint - { - get - { - return LazyLoad(ref _UseStepTypeWidthOverrideEditPrint, "@UseStepTypeWidthOverrideEditPrint"); - } - } - private LazyLoad _PartialStepCompression; - public bool PartialStepCompression - { - get - { - return LazyLoad(ref _PartialStepCompression, "@PartialStepCompression"); - } - } - private LazyLoad _VirtualDotInHLSTab; - public bool VirtualDotInHLSTab - { - get - { - return LazyLoad(ref _VirtualDotInHLSTab, "@VirtualDotInHLSTab"); - } - } - private LazyLoad _OverrideEnhancedTabs; - public bool OverrideEnhancedTabs - { - get - { - return LazyLoad(ref _OverrideEnhancedTabs, "@OverrideEnhancedTabs"); - } - } - private LazyLoad _RNO; - public bool RNO - { - get - { - return LazyLoad(ref _RNO, "@RNO"); - } - } - private LazyLoad _OnlySingleColumn; - public bool OnlySingleColumn - { - get - { - return LazyLoad(ref _OnlySingleColumn, "@OnlySingleColumn"); - } - } - private LazyLoad _NullBox; - public bool NullBox - { - get - { - return LazyLoad(ref _NullBox, "@NullBox"); - } - } - private LazyLoad _AllowNoteCautionAdd; - public bool AllowNoteCautionAdd - { - get - { - return LazyLoad(ref _AllowNoteCautionAdd, "@AllowNoteCautionAdd"); - } - } - } - #endregion - #region TopOfPage - public class TopOfPage : vlnFormatItem - { - public TopOfPage(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _Row; - public float? Row - { - get - { - return LazyLoad(ref _Row, "@Row"); - } - } - private LazyLoad _Col; - public float? Col - { - get - { - return LazyLoad(ref _Col, "@Col"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null? _Font = new VE_Font(base.XmlNode): _Font); - } - } - } - #endregion - #region Separator - public class Separator : vlnFormatItem - { - public Separator(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _Location; - public int? Location - { - get - { - return LazyLoad(ref _Location, "@Location"); - //return LazyLoad(ref _SeparatorLocation, "@SeparatorLocation"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null ? _Font = new VE_Font(base.XmlNode) : _Font); - } - } - } - #endregion - #region StepSectionEditData - public class StepSectionEditData : vlnFormatItem - { - public StepSectionEditData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _ColSScreenAdj; - public float? ColSScreenAdj - { - get - { - return LazyLoad(ref _ColSScreenAdj, "@ColSScreenAdj"); - } - } - private LazyLoad _ScrnAdjRNOText; - public float? ScrnAdjRNOText - { - get - { - return LazyLoad(ref _ScrnAdjRNOText, "@ScrnAdjRNOText"); - } - } - private LazyLoad _ColRScreen; - public string ColRScreen - { - get - { - return LazyLoad(ref _ColRScreen, "@ColRScreen"); - } - } - } - #endregion - #region StepSectionPrintData - public class StepSectionPrintData : vlnFormatItem - { - public StepSectionPrintData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _ImmStepHdrCol; - public float? ImmStepHdrCol - { - get - { - return LazyLoad(ref _ImmStepHdrCol, "@ImmStepHdrCol"); - } - } - private LazyLoad _SecColHdrforActPMode; - public int? SecColHdrforActPMode - { - get - { - return LazyLoad(ref _SecColHdrforActPMode, "@SecColHdrforActPMode"); - } - } - private LazyLoad _RNOSepString; - public string RNOSepString - { - get - { - return LazyLoad(ref _RNOSepString, "@RNOSepString"); - } - } - private LazyLoad _RNOSepLineLength; - public float? RNOSepLineLength - { - get - { - return LazyLoad(ref _RNOSepLineLength, "@RNOSepLineLength"); - } - } - private LazyLoad _HLStpSeparatorString; - public string HLStpSeparatorString - { - get - { - return LazyLoad(ref _HLStpSeparatorString, "@HLStpSeparatorString"); - } - } - private LazyLoad _HLRNOStpSeparatorString; - public string HLRNOStpSeparatorString - { - get - { - return LazyLoad(ref _HLRNOStpSeparatorString, "@HLRNOStpSeparatorString"); - } - } - private LazyLoad _LowerCaseRevNum; - public bool LowerCaseRevNum - { - get - { - return LazyLoad(ref _LowerCaseRevNum, "@LowerCaseRevNum"); - } - } - private LazyLoad _UseXtraRevNumber; - public bool UseXtraRevNumber - { - get - { - return LazyLoad(ref _UseXtraRevNumber, "@UseXtraRevNumber"); - } - } - private LazyLoad _SpecialLandscapeMode; - public bool SpecialLandscapeMode - { - get - { - return LazyLoad(ref _SpecialLandscapeMode, "@SpecialLandscapeMode"); - } - } - private VE_Font _ModifiedTextStyle; - public VE_Font ModifiedTextStyle - { - get - { - return (_ModifiedTextStyle == null)? _ModifiedTextStyle = new VE_Font(base.XmlNode):_ModifiedTextStyle; - } - } - private VE_Font _ImmStepHdrStyle; - public VE_Font ImmStepHdrStyle - { - get - { - return (_ImmStepHdrStyle == null)? _ImmStepHdrStyle = new VE_Font(base.XmlNode):_ImmStepHdrStyle; - } - } - private ImmStepHdrList _ImmStepHdrList; - public ImmStepHdrList ImmStepHdrList - { - get - { - return (_ImmStepHdrList == null)? _ImmStepHdrList = new ImmStepHdrList(SelectNodes("ImmStepHdrList/string")):_ImmStepHdrList; - } - set { _ImmStepHdrList = value; } - } - private LeftJustifyList _LeftJustifyList; - public LeftJustifyList LeftJustifyList - { - get - { - return (_LeftJustifyList == null) ? _LeftJustifyList = new LeftJustifyList(SelectNodes("LeftJustifyList/LeftJustify")) : _LeftJustifyList; - } - set { _LeftJustifyList = value; } - } - } - #region ImmStepHdr - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ImmStepHdr : vlnFormatItem - { - public ImmStepHdr(XmlNode xmlNode) : base(xmlNode) { } - public ImmStepHdr() : base() { } - private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("ImmStepHdr '{0}'", Text); } - public override string GetPDCategory() - { return "Imm Step Hdr"; } - public override string ToString() - { - return Text; - } - } - #endregion - #region ImmStepHdrList - [TypeConverter(typeof(vlnListConverter))] - public class ImmStepHdrList : vlnFormatList - { - public ImmStepHdrList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region LeftJustifyList - [TypeConverter(typeof(vlnListConverter))] - public class LeftJustifyList : vlnFormatList - { - public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region LeftJustify - [TypeConverter(typeof(ExpandableObjectConverter))] - public class LeftJustify : vlnFormatItem, IVlnIndexedFormatItem - { - public LeftJustify(XmlNode xmlNode) : base(xmlNode) { } - public LeftJustify() : base() { } - private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private LazyLoad _Size; - public float? Size - { - get - { - return LazyLoad(ref _Size, "@Size"); - } - } - } - #endregion - #endregion - #region SeqTabFmtAll - #region SeqTabFmt - [TypeConverter(typeof(ExpandableObjectConverter))] - public class SeqTabFmt : vlnFormatItem,IVlnIndexedFormatItem - { - public SeqTabFmt() : base() { } - private LazyLoad _Index; //not included - is it needed? - [Description("SeqTab Index")] - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private LazyLoad _TabToken; - public string TabToken - { - get - { - return LazyLoad(ref _TabToken, "@TabToken"); - } - } - private LazyLoad _TabFormat; - public string TabFormat - { - get - { - return LazyLoad(ref _TabFormat, "@TabFormat"); - } - } - private LazyLoad _PrintTabFormat; - public string PrintTabFormat - { - get - { - return LazyLoad(ref _TabFormat, "@PrintTabFormat"); - } - } - public override string GetPDDisplayName() - { return string.Format("Index [{0}]",Index); } - public override string GetPDDescription() - { return string.Format("Sequential Tab Format Index '{0}' Format '{1}'", Index, TabFormat); } - public override string GetPDCategory() - { return "Sequential Tab Formatting"; } - public override string ToString() - { - return TabFormat; - } - } - #endregion - #region SeqTabFmtList - [TypeConverter(typeof(vlnIndexedListConverter))] - public class SeqTabFmtList : vlnIndexedFormatList - { - public SeqTabFmtList(XmlNodeList xmlNodeList,IFormatOrFormatInfo myFormat) : base(xmlNodeList,myFormat) { } - public override vlnIndexedFormatList InheritedList - { - get - { - IFormatOrFormatInfo parentFormat = MyFormat.MyIParent; - if (parentFormat != null) - return parentFormat.PlantFormat.FormatData.SectData.StepSectionData.SeqTabFmtList; - return null; - } - } - } - #endregion - #endregion - #endregion - #region AccSectionDataAll - #region AccSectionData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class AccSectionData : vlnFormatItem - { - public AccSectionData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _AutoContActSumSection; - public int? AutoContActSumSection - { - get - { - return LazyLoad(ref _AutoContActSumSection, "@AutoContActSumSection"); - } - } - private TableOfContentsData _TableOfContentsData; - public TableOfContentsData TableOfContentsData - { - get - { - return (_TableOfContentsData == null ? _TableOfContentsData = new TableOfContentsData(SelectSingleNode("TableOfContentsData")) : _TableOfContentsData); - } - } - } - #endregion - #region TableOfContentsData - public class TableOfContentsData : vlnFormatItem - { - public TableOfContentsData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _TofCSecNumPos; - public float? TofCSecNumPos - { - get - { - return LazyLoad(ref _TofCSecNumPos, "@TofCSecNumPos"); - } - } - private LazyLoad _TofCSecTitlePos; - public float? TofCSecTitlePos - { - get - { - return LazyLoad(ref _TofCSecTitlePos, "@TofCSecTitlePos"); - } - } - private LazyLoad _TofCSecTitleLen; - public int? TofCSecTitleLen - { - get - { - return LazyLoad(ref _TofCSecTitleLen, "@TofCSecTitleLen"); - } - } - private LazyLoad _TofCPageNumPos; - public float? TofCPageNumPos - { - get - { - return LazyLoad(ref _TofCPageNumPos, "@TofCPageNumPos"); - } - } - private LazyLoad _TofCSpaceChar; - public string TofCSpaceChar - { - get - { - return LazyLoad(ref _TofCSpaceChar, "@TofCSpaceChar"); - } - } - private LazyLoad _TofCLineSpacing; - public int? TofCLineSpacing - { - get - { - return LazyLoad(ref _TofCLineSpacing, "@TofCLineSpacing"); - } - } - private LazyLoad _TofCNumLevels; - public int? TofCNumLevels - { - get - { - return LazyLoad(ref _TofCNumLevels, "@TofCNumLevels"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null) ?_Font = new VE_Font(base.XmlNode):_Font; - } - } - } - #endregion - #endregion - #region MetaSectionAll - #region MetaSection - [TypeConverter(typeof(ExpandableObjectConverter))] - public class MetaSection : vlnFormatItem,IVlnIndexedFormatItem - { - public MetaSection(XmlNode xmlNode) : base(xmlNode) { } - public MetaSection() : base() { } - private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private LazyLoad _SecNumPositionAdj; - public float? SecNumPositionAdj - { - get - { - return LazyLoad(ref _SecNumPositionAdj, "@SecNumPositionAdj"); - } - } - private LazyLoad _SecTitlePositionAdj; - public float? SecTitlePositionAdj - { - get - { - return LazyLoad(ref _SecTitlePositionAdj, "@SecTitlePositionAdj"); - } - } - private LazyLoad _ColSByLevel; - public float? ColSByLevel - { - get - { - return LazyLoad(ref _ColSByLevel, "@ColSByLevel"); - } - } - private LazyLoad _TofCPositionAdj; - public float? TofCPositionAdj - { - get - { - return LazyLoad(ref _TofCPositionAdj, "@TofCPositionAdj"); - } - } - private LazyLoad _WidSAdjByLevel; - public float? WidSAdjByLevel - { - get - { - return LazyLoad(ref _WidSAdjByLevel, "@WidSAdjByLevel"); - } - } - public override string GetPDDisplayName() - { return string.Format("[{0}]", Index); } - public override string GetPDCategory() - { return "Meta Section Values"; } - public override string ToString() - { - return String.Format("{0}, {1}, {2}, {3}, {4}", SecNumPositionAdj, SecTitlePositionAdj, ColSByLevel, TofCPositionAdj, TofCPositionAdj); - } - } - - #endregion - #region MetaSectionList - [TypeConverter(typeof(vlnIndexedListConverter))] - public class MetaSectionList : vlnIndexedFormatList - { - public MetaSectionList(XmlNodeList xmlNodeList,IFormatOrFormatInfo myFormat) : base(xmlNodeList,myFormat) { } - public override vlnIndexedFormatList InheritedList - { - get - { - IFormatOrFormatInfo parentFormat = MyFormat.MyIParent; - if (parentFormat != null) - return parentFormat.PlantFormat.FormatData.SectData.MetaSectionList; - return null; - } - } - - - } - #endregion - #endregion - #endregion - #region StepDataAll - #region Step - [TypeConverter(typeof(ExpandableObjectConverter))] - public class StepData : vlnFormatItem,IVlnIndexedFormatItem - { - public StepData() : base() { } - private LazyLoad _Index; - [Description("Step Index")] - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private LazyLoad _Type; - public string Type - { - get - { - return LazyLoad(ref _Type, "@Type"); - } - } - private LazyLoad _ParentType; - public string ParentType - { - get - { - return LazyLoad(ref _ParentType, "@ParentType"); - } - } - private LazyLoad _ReadOnly; - public bool ReadOnly - { - get - { - return LazyLoad(ref _ReadOnly, "@ReadOnly"); - } - } - private LazyLoad _Inactive; - public bool Inactive - { - get - { - return LazyLoad(ref _Inactive, "@Inactive"); - } - } - private LazyLoad _ColOverride; - public float? ColOverride - { - get - { - return LazyLoad(ref _ColOverride, "@ColOverride"); - } - } - private LazyLoad _ColOverrideEdit; - - public float? ColOverrideEdit - { - get - { - return LazyLoad(ref _ColOverrideEdit, "@ColOverrideEdit"); - } - } - private LazyLoad _WidthOverride; - - public string WidthOverride - { - get - { - return LazyLoad(ref _WidthOverride, "@WidthOverride"); - } - } - //private LazyLoad _WidthOverride; - - //public float? WidthOverride - //{ - // get - // { - // return LazyLoad(ref _WidthOverride, "@WidthOverride"); - // } - //} - private LazyLoad _WidthOverrideEdit; - - public float? WidthOverrideEdit - { - get - { - return LazyLoad(ref _WidthOverrideEdit, "@WidthOverrideEdit"); - } - } - private LazyLoad _Sep; - public string Sep - { - get - { - return LazyLoad(ref _Sep, "@Sep"); - } - } - private LazyLoad _Prefix; - public string Prefix - { - get - { - return LazyLoad(ref _Prefix, "@Prefix"); - } - } - private LazyLoad _Suffix; - public string Suffix - { - get - { - return LazyLoad(ref _Suffix, "@Suffix"); - } - } - private LazyLoad _UnderlineTheseChar; - public string UnderlineTheseChar - { - get - { - return LazyLoad(ref _UnderlineTheseChar, "@UnderlineTheseChar"); - } - } - private LazyLoad _VertPos; - public string VertPos - { - get - { - return LazyLoad(ref _VertPos, "@VertPos"); - } - } - - private LazyLoad _DoubleSpace; - public bool DoubleSpace - { - get - { - return LazyLoad(ref _DoubleSpace, "@DoubleSpace"); - } - } - private LazyLoad _EnhancedStepNumFromPrev; - public bool EnhancedStepNumFromPrev - { - get - { - return LazyLoad(ref _EnhancedStepNumFromPrev, "@EnhancedStepNumFromPrev"); - } - } - private LazyLoad _UseSmartTemplate; - public bool UseSmartTemplate - { - get - { - return LazyLoad(ref _UseSmartTemplate, "@UseSmartTemplate"); - } - } - private LazyLoad _UseOldTemplate; - public bool UseOldTemplate - { - get - { - return LazyLoad(ref _UseOldTemplate, "@UseOldTemplate"); - } - } - private LazyLoad _AlwaysUseExtraLines; - public bool AlwaysUseExtraLines - { - get - { - return LazyLoad(ref _AlwaysUseExtraLines, "@AlwaysUseExtraLines"); - } - } - private LazyLoad _SeparateBox; - public bool SeparateBox - { - get - { - return LazyLoad(ref _SeparateBox, "@SeparateBox"); - } - } - private LazyLoad _SeparateBoxCautions; - public bool SeparateBoxCautions - { - get - { - return LazyLoad(ref _SeparateBoxCautions, "@SeparateBoxCautions"); - } - } - private LazyLoad _SpaceDouble; - public bool SpaceDouble - { - get - { - return LazyLoad(ref _SpaceDouble, "@SpaceDouble"); - } - } - private LazyLoad _ReduceLineAfter; - public bool ReduceLineAfter - { - get - { - return LazyLoad(ref _ReduceLineAfter, "@ReduceLineAfter"); - } - } - private LazyLoad _SameLevel; - public bool SameLevel - { - get - { - return LazyLoad(ref _SameLevel, "@SameLevel"); - } - } - private LazyLoad _BoldHighLevel; - public bool BoldHighLevel - { - get - { - return LazyLoad(ref _BoldHighLevel, "@BoldHighLevel"); - } - } - private LazyLoad _OneLineBeforeTab; - public bool OneLineBeforeTab - { - get - { - return LazyLoad(ref _OneLineBeforeTab, "@OneLineBeforeTab"); - } - } - private LazyLoad _CheckOffOnAllSteps; - public bool CheckOffOnAllSteps - { - get - { - return LazyLoad(ref _CheckOffOnAllSteps, "@CheckOffOnAllSteps"); - } - } - private LazyLoad _BoxIt; - public bool BoxIt - { - get - { - return LazyLoad(ref _BoxIt, "@BoxIt"); - } - } - private LazyLoad _Boxed; - public bool Boxed - { - get - { - return LazyLoad(ref _Boxed, "@Boxed"); - } - } - private LazyLoad _XLines_StepFix; - public bool XLines_StepFix - { - get - { - return LazyLoad(ref _XLines_StepFix, "@XLines_StepFix"); - } - } - private LazyLoad _Rebox; - public bool Rebox - { - get - { - return LazyLoad(ref _Rebox, "@Rebox"); - } - } - private LazyLoad _SpcHdr; - public bool SpcHdr - { - get - { - return LazyLoad(ref _SpcHdr, "@SpcHdr"); - } - } - private LazyLoad _ContinueOnly; - public bool ContinueOnly - { - get - { - return LazyLoad(ref _ContinueOnly, "@ContinueOnly"); - } - } - private LazyLoad _SepAfterAER; - public bool SepAfterAER - { - get - { - return LazyLoad(ref _SepAfterAER, "@SepAfterAER"); - } - } - private LazyLoad _UseAlternateStepBox; - public bool UseAlternateStepBox - { - get - { - return LazyLoad(ref _UseAlternateStepBox, "@UseAlternateStepBox"); - } - } - private LazyLoad _UnderlineAfterDashSpace; - public bool UnderlineAfterDashSpace - { - get - { - return LazyLoad(ref _UnderlineAfterDashSpace, "@UnderlineAfterDashSpace"); - } - } - private LazyLoad _SpaceIn; - public bool SpaceIn - { - get - { - return LazyLoad(ref _SpaceIn, "@SpaceIn"); - } - } - private LazyLoad _PageBreakOnStep; - public bool PageBreakOnStep - { - get - { - return LazyLoad(ref _PageBreakOnStep, "@PageBreakOnStep"); - } - } - private LazyLoad _AlignNullTabWSectHead; - public bool AlignNullTabWSectHead - { - get - { - return LazyLoad(ref _AlignNullTabWSectHead, "@AlignNullTabWSectHead"); - } - } - private LazyLoad _AlignHLSTabWithSectOvride; - public bool AlignHLSTabWithSectOvride - { - get - { - return LazyLoad(ref _AlignHLSTabWithSectOvride, "@AlignHLSTabWithSectOvride"); - } - } - private LazyLoad _TextSubFollowsTextStyle; - public bool TextSubFollowsTextStyle - { - get - { - return LazyLoad(ref _TextSubFollowsTextStyle, "@TextSubFollowsTextStyle"); - } - } - private LazyLoad _CautionOrNoteSubstepIndent; - public int? CautionOrNoteSubstepIndent - { - get - { - return LazyLoad(ref _CautionOrNoteSubstepIndent, "@CautionOrNoteSubstepIndent"); - } - } - private LazyLoad _TreatAsSequential; - public bool TreatAsSequential - { - get - { - return LazyLoad(ref _TreatAsSequential, "@TreatAsSequential"); - } - } - private LazyLoad _MatchUpRNO; - public bool MatchUpRNO - { - get - { - return LazyLoad(ref _MatchUpRNO, "@MatchUpRNO"); - } - } - private LazyLoad _InPageList; - public bool InPageList - { - get - { - return LazyLoad(ref _InPageList, "@InPageList"); - } - } - private LazyLoad _CenterOneLineOnly; - public bool CenterOneLineOnly - { - get - { - return LazyLoad(ref _CenterOneLineOnly, "@CenterOneLineOnly"); - } - } - private LazyLoad _SubTableGetsUp1Level; - public bool SubTableGetsUp1Level - { - get - { - return LazyLoad(ref _SubTableGetsUp1Level, "@SubTableGetsUp1Level"); - } - } - private LazyLoad _Remember; - public bool Remember - { - get - { - return LazyLoad(ref _Remember, "@Remember"); - } - } - private LazyLoad _CenterOneLineAdjust; - public bool CenterOneLineAdjust - { - get - { - return LazyLoad(ref _CenterOneLineAdjust, "@CenterOneLineAdjust"); - } - } - private LazyLoad _Break; - public bool Break - { - get - { - return LazyLoad(ref _Break, "@Break"); - } - } - private LazyLoad _BreakEquipmentList; - public bool BreakEquipmentList - { - get - { - return LazyLoad(ref _BreakEquipmentList, "@BreakEquipmentList"); - } - } - private LazyLoad _BreakCautionsNotesOnSubstps; - public bool BreakCautionsNotesOnSubstps - { - get - { - return LazyLoad(ref _BreakCautionsNotesOnSubstps, "@BreakCautionsNotesOnSubstps"); - } - } - private LazyLoad _CenterTextWithinWidth; - public bool CenterTextWithinWidth - { - get - { - return LazyLoad(ref _CenterTextWithinWidth, "@CenterTextWithinWidth"); - } - } - private LazyLoad _NewlineAfter; - public bool NewlineAfter - { - get - { - return LazyLoad(ref _NewlineAfter, "@NewlineAfter"); - } - } - private LazyLoad _StartLineWithDash; - public bool StartLineWithDash - { - get - { - return LazyLoad(ref _StartLineWithDash, "@StartLineWithDash"); - } - } - private LazyLoad _BlankLineBeforeSubStep; - public bool BlankLineBeforeSubStep - { - get - { - return LazyLoad(ref _BlankLineBeforeSubStep, "@BlankLineBeforeSubStep"); - } - } - private LazyLoad _AlwaysTab; - public bool AlwaysTab - { - get - { - return LazyLoad(ref _AlwaysTab, "@AlwaysTab"); - } - } - private LazyLoad _NoSpaceMultipleRNOs; - public bool NoSpaceMultipleRNOs - { - get - { - return LazyLoad(ref _NoSpaceMultipleRNOs, "@NoSpaceMultipleRNOs"); - } - } - private LazyLoad _MixCautionsAndNotes; - public bool MixCautionsAndNotes - { - get - { - return LazyLoad(ref _MixCautionsAndNotes, "@MixCautionsAndNotes"); - } - } - private LazyLoad _NumberHighLevel; - public bool NumberHighLevel - { - get - { - return LazyLoad(ref _NumberHighLevel, "@NumberHighLevel"); - } - } - private LazyLoad _OffsetTab; - public bool OffsetTab - { - get - { - return LazyLoad(ref _OffsetTab, "@OffsetTab"); - } - } - private LazyLoad _AdjHighLevelTab; - public float? AdjHighLevelTab - { - get - { - return LazyLoad(ref _AdjHighLevelTab, "@AdjHighLevelTab"); - } - } - private LazyLoad _ChildIndent; - public float? ChildIndent - { - get - { - return LazyLoad(ref _ChildIndent, "@ChildIndent"); - } - } - private LazyLoad _LeftJustifyBorderless; - public bool LeftJustifyBorderless - { - get - { - return LazyLoad(ref _LeftJustifyBorderless, "@LeftJustifyBorderless"); - } - } - private LazyLoad _StepNumIfOnlyOne; - public bool StepNumIfOnlyOne - { - get - { - return LazyLoad(ref _StepNumIfOnlyOne, "@StepNumIfOnlyOne"); - } - } - private LazyLoad _LJTabs; - public bool LJTabs - { - get - { - return LazyLoad(ref _LJTabs, "@LJTabs"); - } - } - private LazyLoad _NumberSubs; - public bool NumberSubs - { - get - { - return LazyLoad(ref _NumberSubs, "@NumberSubs"); - } - } - private LazyLoad _BulletOnContinuous; - public bool BulletOnContinuous - { - get - { - return LazyLoad(ref _BulletOnContinuous, "@BulletOnContinuous"); - } - } - private LazyLoad _StepNumberForHighLevel; - public bool StepNumberForHighLevel - { - get - { - return LazyLoad(ref _StepNumberForHighLevel, "@StepNumberForHighLevel"); - } - } - private LazyLoad _SameRowAsParent; - public bool SameRowAsParent - { - get - { - return LazyLoad(ref _SameRowAsParent, "@SameRowAsParent"); - } - } - private LazyLoad _CheckOffSameAsParent; - public bool CheckOffSameAsParent - { - get - { - return LazyLoad(ref _CheckOffSameAsParent, "@CheckOffSameAsParent"); - } - } - private LazyLoad _AtLeastTwoDigits; - public bool AtLeastTwoDigits - { - get - { - return LazyLoad(ref _AtLeastTwoDigits, "@AtLeastTwoDigits"); - } - } - private LazyLoad _UseInAcTable; - public bool UseInAcTable - { - get - { - return LazyLoad(ref _UseInAcTable, "@UseInAcTable"); - } - } - private LazyLoad _Number; - public bool Number - { - get - { - return LazyLoad(ref _Number, "@Number"); - } - } - private LazyLoad _ThreeBlanksAbove; - public bool ThreeBlanksAbove - { - get - { - return LazyLoad(ref _ThreeBlanksAbove, "@ThreeBlanksAbove"); - } - } - private LazyLoad _CheckOffs; - public bool CheckOffs - { - get - { - return LazyLoad(ref _CheckOffs, "@CheckOffs"); - } - } - private LazyLoad _Quoted; - public bool Quoted - { - get - { - return LazyLoad(ref _Quoted, "@Quoted"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null) ?_Font = new VE_Font(base.XmlNode): _Font; - } - } - private StepLayoutData _StepLayoutData; - public StepLayoutData StepLayoutData - { - get - { - return (_StepLayoutData == null)? _StepLayoutData = new StepLayoutData(base.XmlNode): _StepLayoutData; - } - } - private StepEditData _StepEditData; - public StepEditData StepEditData - { - get - { - return (_StepEditData == null) ? _StepEditData = new StepEditData(base.XmlNode) : _StepEditData; - } - } - private StepPrintData _StepPrintData; - public StepPrintData StepPrintData - { - get - { - return (_StepPrintData == null) ? _StepPrintData = new StepPrintData(base.XmlNode) : _StepPrintData; - } - } - private TabData _TabData; - public TabData TabData - { - get - { - return (_TabData == null) ? _TabData = new TabData(base.XmlNode) : _TabData; - } - } - public override string ToString() - { - return string.Format("{0}", Type); - } - } - #endregion - #region StepDataList - [TypeConverter(typeof(vlnIndexedListConverter))] - public class StepDataList : vlnIndexedFormatList - { - //public new StepData this[int index] - //{ - // get - // { - // foreach (StepData stepData in this) - // if (stepData.Index == index) return stepData; - // return null; - // } - //} - public override vlnIndexedFormatList InheritedList - { - get - { - IFormatOrFormatInfo parentFormat = MyFormat.MyIParent; - if (parentFormat != null) - return parentFormat.PlantFormat.FormatData.StepDataList; - return null; - } - } - public StepData this[string type] - { - get - { - foreach (StepData stepData in this) - if (stepData.Type == type) return stepData; - return null; - } - } - public StepData this[int index] - { - get - { - foreach (StepData stepData in this) - if (stepData.Index == index) return stepData; - return null; - } - } - public StepDataList(XmlNodeList xmlNodeList, IFormatOrFormatInfo myFormat) : base(xmlNodeList, myFormat) { } - private StepData _HLS; - public StepData HLS - { - get - { - if (_HLS!=null) return _HLS; - foreach (StepData sd in this) - { - if (sd.Type == "High") - { - _HLS = sd; - return sd; - } - } - return null; - } - } - private StepData _Caution; - public StepData Caution - { - get - { - if (_Caution != null) return _Caution; - foreach (StepData sd in this) - { - if (sd.Type == "Caution") - { - _Caution = sd; - return sd; - } - } - return null; - } - } - private StepData _Note; - public StepData Note - { - get - { - if (_Note != null) return _Note; - foreach (StepData sd in this) - { - if (sd.Type == "Note") - { - _Note = sd; - return sd; - } - } - return null; - } - } - private StepData _RNO; - public StepData RNO - { - get - { - if (_RNO != null) return _RNO; - foreach (StepData sd in this) - { - if (sd.Type == "RNOType") - { - _RNO = sd; - return sd; - } - } - return null; - } - } - private StepData _Fig; - public StepData Fig - { - get - { - if (_Fig != null) return _Fig; - foreach (StepData sd in this) - { - if (sd.Type == "Figure") - { - _Fig = sd; - return sd; - } - } - return null; - } - } - private StepData _Table; - public StepData Table - { - get - { - if (_Table != null) return _Table; - foreach (StepData sd in this) - { - if (sd.Type == "Table") - { - _Table = sd; - return sd; - } - } - return null; - } - } - private StepData _Substep; - public StepData Substep - { - get - { - if (_Substep != null) return _Substep; - foreach (StepData sd in this) - { - if (sd.Type == "Substep") - { - _Substep = sd; - return sd; - } - } - return null; - } - } - } - #endregion - #region StepLayoutData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class StepLayoutData : vlnFormatItem - { - public StepLayoutData(XmlNode xmlNode) - : base(xmlNode) - { - } - private LazyLoad _ForeColor; - public string ForeColor - { - get - { - return LazyLoad(ref _ForeColor, "StepLayoutData/@ForeColor"); - } - } - private LazyLoad _BackColor; - public string BackColor - { - get - { - return LazyLoad(ref _BackColor, "StepLayoutData/@BackColor"); - } - } - private LazyLoad _STExtraSpace; - public int? STExtraSpace - { - get - { - return LazyLoad(ref _STExtraSpace, "StepLayoutData/@STExtraSpace"); - } - } - private LazyLoad _STBoxindex; - public int? STBoxindex - { - get - { - return LazyLoad(ref _STBoxindex, "StepLayoutData/@STBoxindex"); - } - } - private LazyLoad _EveryNLines; - public int? EveryNLines - { - get - { - return LazyLoad(ref _EveryNLines, "StepLayoutData/@EveryNLines"); - } - } - private LazyLoad _AlignWithParentTab; - public bool AlignWithParentTab - { - get - { - return LazyLoad(ref _AlignWithParentTab, "StepLayoutData/@AlignWithParentTab"); - } - } - - } - #endregion - #region StepEditData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class StepEditData : vlnFormatItem - { - public StepEditData(XmlNode xmlNode) - : base(xmlNode) - { - } - private TypeMenu _TypeMenu; - public TypeMenu TypeMenu - { - get - { - return (_TypeMenu == null) ? _TypeMenu = new TypeMenu(base.XmlNode) : _TypeMenu; - } - } - private LazyLoad _ForeColor; - public string ForeColor - { - get - { - return LazyLoad(ref _ForeColor, "StepEditData/@ForeColor"); - } - } - private LazyLoad _BackColor; - public string BackColor - { - get - { - return LazyLoad(ref _BackColor, "StepEditData/@BackColor"); - } - } - private LazyLoad _AcTable; - public E_AccStep? AcTable - { - get - { - return LazyLoad(ref _AcTable, "StepEditData/@AcTable"); - } - } - private LazyLoad _Searchable; - public bool Searchable - { - get - { - return LazyLoad(ref _Searchable, "StepEditData/@Searchable"); - } - } - } - #endregion - #region StepPrintData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class StepPrintData : vlnFormatItem - { - public StepPrintData(XmlNode xmlNode) - : base(xmlNode) - { - } - private LazyLoad _PosAdjust; - public float? PosAdjust - { - get - { - return LazyLoad(ref _PosAdjust, "StepPrintData/@PosAdjust"); - } - } - private LazyLoad _Justify; - public string Justify - { - get - { - return LazyLoad(ref _Justify, "StepPrintData/@Justify"); - } - } - } - #endregion - #region TypeMenu - [TypeConverter(typeof(ExpandableObjectConverter))] - public class TypeMenu : vlnFormatItem - { - public TypeMenu(XmlNode xmlNode) - : base(xmlNode) - { - } - private LazyLoad _InMenu; - public bool InMenu - { - get - { - return LazyLoad(ref _InMenu, "StepEditData/TypeMenu/@InMenu"); - } - } - private LazyLoad _RnoInMenu; - public bool RnoInMenu - { - get - { - return LazyLoad(ref _RnoInMenu, "StepEditData/TypeMenu/@RnoInMenu"); - } - } - private LazyLoad _MenuItem; - public string MenuItem - { - get - { - return LazyLoad(ref _MenuItem, "StepEditData/TypeMenu/@MenuItem"); - } - } - private LazyLoad _RnoMenuItem; - public string RnoMenuItem - { - get - { - return LazyLoad(ref _RnoMenuItem, "StepEditData/TypeMenu/@RnoMenuItem"); - } - } - private LazyLoad _NoChgReason; - public string NoChgReason - { - get - { - return LazyLoad(ref _NoChgReason, "StepEditData/TypeMenu/@NoChgReason"); - } - } - private LazyLoad _AlternateNameList; - public string AlternateNameList - { - get - { - return LazyLoad(ref _AlternateNameList, "StepEditData/TypeMenu/@AlternateNameList"); - } - } - } - #endregion - #region Bullet - [TypeConverter(typeof(ExpandableObjectConverter))] - public class Bullet : vlnFormatItem - { - public Bullet(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _Separate; - public bool Separate - { - get - { - return LazyLoad(ref _Separate, "TabData/Bullet/@Separate"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - if (_Font == null) - { - XmlNode xn = vlnFormatDocument.LookupSingleStepNode(base.XmlNode, "Bullet[Font]"); - _Font = new VE_Font(xn); - } - return _Font; - } - } - } - - #endregion - #region StepTab - [TypeConverter(typeof(ExpandableObjectConverter))] - public class TabData : vlnFormatItem - { - public TabData(XmlNode xmlNode) - : base(xmlNode) - { - } - private MacroList _MacroList; - public MacroList MacroList - { - get - { - return _MacroList == null ? _MacroList = new MacroList(SelectNodes("TabData/MacroList/Macro")) : _MacroList; - } - } - private LazyLoad _IdentEdit; - public string IdentEdit - { - get - { - return LazyLoad(ref _IdentEdit, "TabData/@IdentEdit"); - } - } - private LazyLoad _IdentPrint; - public string IdentPrint - { - get - { - return LazyLoad(ref _IdentPrint, "TabData/@Ident"); - } - } - private LazyLoad _IdentAltPrint; - public string IdentAltPrint - { - get - { - return LazyLoad(ref _IdentAltPrint, "TabData/@IdentAltPrint"); - } - } - private LazyLoad _RNOIdentEdit; - public string RNOIdentEdit - { - get - { - return LazyLoad(ref _RNOIdentEdit, "TabData/@RNOIdentEdit"); - } - } - private LazyLoad _RNOIdent; - public string RNOIdent - { - get - { - return LazyLoad(ref _RNOIdent, "TabData/@RNOIdent"); - } - } - private LazyLoad _RNOIdentPrint; - public string RNOIdentPrint - { - get - { - return LazyLoad(ref _RNOIdentPrint, "TabData/@RNOIdent"); - } - } - private LazyLoad _RNOExcludeMacros; - public bool RNOExcludeMacros - { - get - { - return LazyLoad(ref _RNOExcludeMacros, "TabData/@RNOExcludeMacros"); - } - } - private LazyLoad _Justify; - public string Justify - { - get - { - return LazyLoad(ref _Justify, "TabData/@Justify"); - } - } - private LazyLoad _UsePreviousStyle; - public bool UsePreviousStyle - { - get - { - return LazyLoad(ref _UsePreviousStyle, "TabData/@UsePreviousStyle"); - } - } - private LazyLoad _IsTransition; - public bool IsTransition - { - get - { - return LazyLoad(ref _IsTransition, "TabData/@IsTransition"); - } - } - private LazyLoad _IdentWidth; - public float? IdentWidth - { - get - { - return LazyLoad(ref _IdentWidth, "TabData/@IdentWidth"); - } - } - private LazyLoad _RNOAdjustTabSize; - public float? RNOAdjustTabSize - { - get - { - return LazyLoad(ref _RNOAdjustTabSize, "TabData/@RNOAdjustTabSize"); - } - } - private LazyLoad _MacroTabAdjust; - public float? MacroTabAdjust - { - get - { - return LazyLoad(ref _MacroTabAdjust, "TabData/@MacroTabAdjust"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - if (_Font == null) - { - XmlNode xn = vlnFormatDocument.LookupSingleStepNode(base.XmlNode, "TabData[Font]"); - _Font = new VE_Font(xn); - } - return _Font; - } - } - private Bullet _Bullet; - public Bullet Bullet - { - get - { - return (_Bullet == null) ? _Bullet = new Bullet(base.XmlNode) : _Bullet; - } - } - private LazyLoad _NoTrim; - public bool NoTrim - { - get - { - return LazyLoad(ref _NoTrim, "TabData/@NoTrim"); - } - } - - } - #endregion - #region MacroList - [TypeConverter(typeof(vlnListConverter))] - public class MacroList : vlnNamedFormatList - { - public MacroList(XmlNodeList xmlNodeList) : base(xmlNodeList, null) { } - public override vlnNamedFormatList InheritedList - { - get - { - - return null; - } - } - } - #endregion - #region Macro - [TypeConverter(typeof(ExpandableObjectConverter))] - public class Macro : vlnFormatItem, IVlnNamedFormatItem - { - public Macro(XmlNode xmlNode) : base(xmlNode) { } - public Macro() : base() { } - private LazyLoad _Name; - public string Name - { - get - { - return LazyLoad(ref _Name, "@Name"); - } - } - private LazyLoad _MacroDef; - public string MacroDef - { - get - { - if (_Inherited == null) SetupStepInheritance(); - return LazyLoad(ref _MacroDef, "@Macro"); - } - } - private LazyLoad _LocWithXOff; - public bool? LocWithXOff - { - get - { - return LazyLoad(ref _LocWithXOff, "@LocWithXOff"); - } - } - - private LazyLoad _Grouping; - public int? Grouping - { - get - { - if (_Inherited == null) SetupStepInheritance(); - return LazyLoad(ref _Grouping, "@Grouping"); - } - } - private LazyLoad _NotInRNO; - public bool NotInRNO - { - get - { - if (_Inherited == null) SetupStepInheritance(); - return LazyLoad(ref _NotInRNO, "@NotInRNO"); - } - } - - private bool? _Inherited; - public bool Inherited - { - get - { - if (_Inherited == null) SetupStepInheritance(); - return (bool) _Inherited; - } - } - private void SetupStepInheritance() - { - if (_Inherited != null) return; - LazyLoad macroName = null; - _Inherited = (LazyLoad(ref macroName, "@Macro") == null); - // No MacroName, Find parent that has data - string path = string.Format("TabData/MacroList/Macro[@Name='{0}' and @Macro]", Name); - XmlNode xn = vlnFormatDocument.LookupSingleStepNode(XmlNode.ParentNode.ParentNode.ParentNode, path); - if (xn != null) - { - _MacroDef = new LazyLoad(RetrieveString(xn.SelectSingleNode("@Macro"))); - _Grouping = new LazyLoad(RetrieveInt("@Grouping" ,xn.SelectSingleNode("@Grouping"))); - _NotInRNO = new LazyLoad(RetrieveBool( xn.SelectSingleNode("@NotInRNO"))); - } - } - } -#endregion - #endregion - #region BoxDataAll - #region Box - [TypeConverter(typeof(ExpandableObjectConverter))] - public class Box : vlnFormatItem,IVlnIndexedFormatItem - { - public Box(XmlNode xmlNode) : base(xmlNode) { } - public Box() : base() { } - private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private LazyLoad _Start; - public float? Start - { - get - { - return LazyLoad(ref _Start, "@Start"); - } - } - private LazyLoad _End; - public float? End - { - get - { - return LazyLoad(ref _End, "@End"); - } - } - private LazyLoad _TxtStart; - public float? TxtStart - { - get - { - return LazyLoad(ref _TxtStart, "@TxtStart"); - } - } - private LazyLoad _TxtWidth; - public float? TxtWidth - { - get - { - return LazyLoad(ref _TxtWidth, "@TxtWidth"); - } - } - private LazyLoad _Height; - public float? Height - { - get - { - return LazyLoad(ref _Height, "@Height"); - } - } - private LazyLoad _TabPos; - public float? TabPos - { - get - { - return LazyLoad(ref _TabPos, "@TabPos"); - } - } - private LazyLoad _TxtRowAdj; - public int? TxtRowAdj - { - get - { - return LazyLoad(ref _TxtRowAdj, "@TxtRowAdj"); - } - } - private LazyLoad _BXURC; - public string BXURC - { - get - { - return LazyLoad(ref _BXURC, "@BXURC"); - } - } - private LazyLoad _BXHorz; - public string BXHorz - { - get - { - return LazyLoad(ref _BXHorz, "@BXHorz"); - } - } - private LazyLoad _BXULC; - public string BXULC - { - get - { - return LazyLoad(ref _BXULC, "@BXULC"); - } - } - private LazyLoad _BXVert; - public string BXVert - { - get - { - return LazyLoad(ref _BXVert, "@BXVert"); - } - } - private LazyLoad _BXMLS; - public string BXMLS - { - get - { - return LazyLoad(ref _BXMLS, "@BXMLS"); - } - } - private LazyLoad _BXMRS; - public string BXMRS - { - get - { - return LazyLoad(ref _BXMRS, "@BXMRS"); - } - } - private LazyLoad _BXLRC; - public string BXLRC - { - get - { - return LazyLoad(ref _BXLRC, "@BXLRC"); - } - } - private LazyLoad _BXLLC; - public string BXLLC - { - get - { - return LazyLoad(ref _BXLLC, "@BXLLC"); - } - } - private LazyLoad _BXMID; - public string BXMID - { - get - { - return LazyLoad(ref _BXMID, "@BXMID"); - } - } - private LazyLoad _BXLHorz; - public string BXLHorz - { - get - { - return LazyLoad(ref _BXLHorz, "@BXLHorz"); - } - } - private LazyLoad _BXUMID; - public string BXUMID - { - get - { - return LazyLoad(ref _BXUMID, "@BXUMID"); - } - } - private LazyLoad _BXLMID; - public string BXLMID - { - get - { - return LazyLoad(ref _BXLMID, "@BXLMID"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null) ?_Font = new VE_Font(base.XmlNode):_Font; - } - } - public override string GetPDDisplayName() - { return string.Format("[{0}]", Index); } - public override string GetPDCategory() - { return "Box Definition"; } - public override string ToString() - { - return String.Format("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}", - BXURC, BXHorz, BXULC, BXVert, BXMLS, BXMRS, BXLRC, BXLLC, BXMID, BXLHorz, BXUMID, BXLMID); - } - public string BoxStyle - { - get - { - return String.Format("{0}.{1}.{2}.{3}.{4}.{5}.{6}.{7}.{8}.{9}.{10}.{11}", - BXURC ?? " ", BXHorz ?? " ", BXULC ?? " ", BXVert ?? " ", BXMLS ?? " ", BXMRS ?? " ", BXLRC ?? " ", BXLLC ?? " ", BXMID ?? " ", BXLHorz ?? BXHorz, BXUMID ?? " ", BXLMID ?? " "); - } - } - } - #endregion - #region BoxList - [TypeConverter(typeof(vlnIndexedListConverter))] - public class BoxList : vlnIndexedFormatList - { - public BoxList(XmlNodeList xmlNodeList, IFormatOrFormatInfo myFormat) : base(xmlNodeList, myFormat) { } - public override vlnIndexedFormatList InheritedList - { - get - { - IFormatOrFormatInfo parentFormat = MyFormat.MyIParent; - if (parentFormat != null) - return parentFormat.PlantFormat.FormatData.BoxList; - return null; - } - } - - } - #endregion - #endregion - #region TransDataAll - #region TransData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class TransData : vlnFormatItem - { - private TransTypeList _TransTypeList; - public TransTypeList TransTypeList - { - get - { - return(_TransTypeList == null || _TransTypeList.Count==0)? _TransTypeList = new TransTypeList(SelectNodes("TransTypeData/TransTypes"),MyFormat): _TransTypeList; - } - } - public TransData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _DelimiterForTransitionTitle; - public string DelimiterForTransitionTitle - { - get - { - return LazyLoad(ref _DelimiterForTransitionTitle, "@DelimiterForTransitionTitle"); - } - } - private LazyLoad _StepSubstepDelimeter; - public string StepSubstepDelimeter - { - get - { - return LazyLoad(ref _StepSubstepDelimeter, "@StepSubstepDelimeter"); - } - } - private LazyLoad _ThroughString; - public string ThroughString - { - get - { - return LazyLoad(ref _ThroughString, "@ThroughString"); - } - } - private LazyLoad _SpecifiedSubstepsOnly; - public bool SpecifiedSubstepsOnly - { - get - { - return LazyLoad(ref _SpecifiedSubstepsOnly, "@SpecifiedSubstepsOnly"); - } - } - private LazyLoad _CapsTransitions; - public bool CapsTransitions - { - get - { - return LazyLoad(ref _CapsTransitions, "@CapsTransitions"); - } - } - private LazyLoad _CapsTransitionsSection; - public bool CapsTransitionsSection - { - get - { - return LazyLoad(ref _CapsTransitionsSection, "@CapsTransitionsSection"); - } - } - private LazyLoad _CapTranStep; - public bool CapTranStep - { - get - { - return LazyLoad(ref _CapTranStep, "@CapTranStep"); - } - } - private LazyLoad _TStepNoFlag; - public bool TStepNoFlag - { - get - { - return LazyLoad(ref _TStepNoFlag, "@TStepNoFlag"); - } - } - private LazyLoad _LowerCaseTranNumber; - public bool LowerCaseTranNumber - { - get - { - return LazyLoad(ref _LowerCaseTranNumber, "@LowerCaseTranNumber"); - } - } - private LazyLoad _UpcaseTranAnd; - public bool UpcaseTranAnd - { - get - { - return LazyLoad(ref _UpcaseTranAnd, "@UpcaseTranAnd"); - } - } - private LazyLoad _SuppressAndInTran; - public bool SuppressAndInTran - { - get - { - return LazyLoad(ref _SuppressAndInTran, "@SuppressAndInTran"); - } - } - private LazyLoad _Cap1stCharTrans; - public bool Cap1stCharTrans - { - get - { - return LazyLoad(ref _Cap1stCharTrans, "@Cap1stCharTrans"); - } - } - private LazyLoad _Cap1stCharTransSection; - public bool Cap1stCharTransSection - { - get - { - return LazyLoad(ref _Cap1stCharTransSection, "@Cap1stCharTransSection"); - } - } - private LazyLoad _UseTransitionModifier; - public bool UseTransitionModifier - { - get - { - return LazyLoad(ref _UseTransitionModifier, "@UseTransitionModifier"); - } - } - private LazyLoad _UseSecTitles; - public bool UseSecTitles - { - get - { - return LazyLoad(ref _UseSecTitles, "@UseSecTitles"); - } - } - private LazyLoad _DoSectionTransitions; - public bool DoSectionTransitions - { - get - { - return LazyLoad(ref _DoSectionTransitions, "@DoSectionTransitions"); - } - } - private LazyLoad _HardSpTranProcNumb; - public bool HardSpTranProcNumb - { - get - { - return LazyLoad(ref _HardSpTranProcNumb, "@HardSpTranProcNumb"); - } - } - private LazyLoad _XchngTranSpForHard; - public bool XchngTranSpForHard - { - get - { - return LazyLoad(ref _XchngTranSpForHard, "@XchngTranSpForHard"); - } - } - private LazyLoad _AbsoluteTransitionUpdate; - public bool AbsoluteTransitionUpdate - { - get - { - return LazyLoad(ref _AbsoluteTransitionUpdate, "@AbsoluteTransitionUpdate"); - } - } - private LazyLoad _LowerCaseStepInTran; - public bool LowerCaseStepInTran - { - get - { - return LazyLoad(ref _LowerCaseStepInTran, "@LowerCaseStepInTran"); - } - } - private LazyLoad _BoldTransition; - public bool BoldTransition - { - get - { - return LazyLoad(ref _BoldTransition, "@BoldTransition"); - } - } - private LazyLoad _BoldTransitionExceptHLS; - public bool BoldTransitionExceptHLS - { - get - { - return LazyLoad(ref _BoldTransitionExceptHLS, "@BoldTransitionExceptHLS"); - } - } - private LazyLoad _AdjustStepTransitionText; - public bool AdjustStepTransitionText - { - get - { - return LazyLoad(ref _AdjustStepTransitionText, "@AdjustStepTransitionText"); - } - } - } - #endregion - #region TransType - [TypeConverter(typeof(ExpandableObjectConverter))] - public class TransType : vlnFormatItem,IVlnIndexedFormatItem - { - public TransType(XmlNode xmlNode) : base(xmlNode) { } - public TransType() : base() { } - private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private LazyLoad _Type; - public int? Type - { - get - { - return LazyLoad(ref _Type, "@TransType"); - } - } - private LazyLoad _TransFormat; - public string TransFormat - { - get - { - return LazyLoad(ref _TransFormat, "@TransFormat"); - } - } - private LazyLoad _TransUI; - public E_TransUI? TransUI - { - get - { - return LazyLoad(ref _TransUI, "@TransUI"); - } - } - private LazyLoad _TransMenu; - public string TransMenu - { - get - { - return LazyLoad(ref _TransMenu, "@TransMenu"); - } - } - public override string GetPDDisplayName() - { return string.Format("[{0}] - Type {1}", Index, Type); } - public override string GetPDCategory() - { return "Transition Type Data"; } - public override string ToString() - { - return string.Format("{0} - {1}",TransFormat, TransMenu); - } - } - #endregion - #region TransTypeList - [TypeConverter(typeof(vlnIndexedListConverter))] - public class TransTypeList : vlnIndexedFormatList - { - public TransTypeList(XmlNodeList xmlNodeList, IFormatOrFormatInfo myFormat) : base(xmlNodeList,myFormat) { } - public override vlnIndexedFormatList InheritedList - { - get - { - IFormatOrFormatInfo parentFormat = MyFormat.MyIParent; - if (parentFormat != null) - return parentFormat.PlantFormat.FormatData.TransData.TransTypeList; - return null; - } - } - } - #endregion - #region RoData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ROData : vlnFormatItem - { - public ROData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _AllUnits; - public bool AllUnits - { - get - { - return LazyLoad(ref _AllUnits, "@AllUnits"); - } - } - private LazyLoad _UpRoAftrDash; - public bool UpRoAftrDash - { - get - { - return LazyLoad(ref _UpRoAftrDash, "@UpRoAftrDash"); - } - } - private LazyLoad _UpcaseAllRoUnits; - public bool UpcaseAllRoUnits - { - get - { - return LazyLoad(ref _UpcaseAllRoUnits, "@UpcaseAllRoUnits"); - } - } - private LazyLoad _CapHighRo; - public bool CapHighRo - { - get - { - return LazyLoad(ref _CapHighRo, "@CapHighRo"); - } - } - private LazyLoad _CapRoIfLastLower; - public bool CapRoIfLastLower - { - get - { - return LazyLoad(ref _CapRoIfLastLower, "@CapRoIfLastLower"); - } - } - private LazyLoad _UpRoIfPrevUpper; - public bool UpRoIfPrevUpper - { - get - { - return LazyLoad(ref _UpRoIfPrevUpper, "@UpRoIfPrevUpper"); - } - } - private LazyLoad _UnderlineRo; - public bool UnderlineRo - { - get - { - return LazyLoad(ref _UnderlineRo, "@UnderlineRo"); - } - } - private LazyLoad _CapFirstLetterInHighRO; - public bool CapFirstLetterInHighRO - { - get - { - return LazyLoad(ref _CapFirstLetterInHighRO, "@CapFirstLetterInHighRO"); - } - } - } - #endregion - #endregion - #region SupportClasses - public class StepDataRetval - { - private string _Name; - public string Name - { - get { return _Name; } - set { _Name = value; } - } - private int _Index; - public int Index - { - get { return _Index; } - set { _Index = value; } - } - public StepDataRetval(string name, int index) - { - Name = name; - Index = index; - } - } - #endregion -} - diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.org b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.org deleted file mode 100644 index 8962a610..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.org +++ /dev/null @@ -1,4530 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Xml; -using System.ComponentModel; -using System.Drawing; - -namespace VEPROMS.CSLA.Library -{ - #region PlantFormat - [TypeConverter(typeof(ExpandableObjectConverter))] - public class PlantFormat - { - public PlantFormat(IFormatOrFormatInfo format) - { - _MyFormat = format; - } - private IFormatOrFormatInfo _MyFormat; - public IFormatOrFormatInfo MyFormat - { - get { return _MyFormat; } - set { _MyFormat = value; } - } - private vlnFormatDocument _XmlDoc; - internal vlnFormatDocument XmlDoc - { - get - { - if (_XmlDoc == null) - _XmlDoc = new vlnFormatDocument(_MyFormat); - return _XmlDoc; - } - } - private FormatData _FormatData; - public FormatData FormatData - { - get - { - if (_FormatData == null) _FormatData = new FormatData(XmlDoc.SelectSingleNode("/PlantFormat/FormatData")); - return _FormatData; - } - } - private PageStyles _PageStyles; - public PageStyles PageStyles - { - get - { - if (_PageStyles == null) _PageStyles = new PageStyles(XmlDoc.SelectNodes("/PlantFormat/PageStyles/PageStyle")); - return _PageStyles; - } - } - private DocStyles _DocStyles; - public DocStyles DocStyles - { - get - { - if (_DocStyles == null) _DocStyles = new DocStyles(XmlDoc.SelectSingleNode("/PlantFormat/DocStyles")); - return _DocStyles; - } - } - } - #endregion - #region VE_Font - [TypeConverter(typeof(ExpandableObjectConverter))] - public class VE_Font : vlnFormatItem - { - public VE_Font(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _Family; - private Font _WindowsFont; - public Font WindowsFont - { - get - { - if (_WindowsFont == null) - { - FontStyle style = FontStyle.Regular; - if (Style != E_Style.None) - { - if (((Style & E_Style.Bold) != 0) || ((Style & E_Style.MmBold) !=0)) - style |= FontStyle.Bold; - if ((Style & E_Style.Italics) != 0) - style |= FontStyle.Italic; - if ((Style & E_Style.Underline) != 0) - style |= FontStyle.Underline; - } - _WindowsFont = new Font(Family, (float)Size, style); - } - return _WindowsFont; - } - } - [Description("Font Family")] - public string Family - { - get - { - return LazyLoad(ref _Family,"Font/@Family"); - } - } - private LazyLoad _Size; - [Description("Font Size (in Double Points)")] - public int? Size - { - get - { - return LazyLoad(ref _Size, "Font/@Size"); - } - } - private LazyLoad _Style; - public E_Style? Style - { - get - { - return LazyLoad(ref _Style, "Font/@Style"); - } - } - public override string ToString() - { - return string.Format("{0}, {1} pt, {2}", Family, Size, Style); - } - } - #endregion - #region FormatData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class FormatData : vlnFormatItem - { - public FormatData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _Name; - public string Name - { - get - { - return LazyLoad(ref _Name, "@Name"); - } - } - //private LazyLoad _XtraFlags; - //public string XtraFlags - //{ - // get - // { - // return LazyLoad(ref _XtraFlags, "XtraFlags"); - // } - //} - //public bool XtraOptions(string attr) - //{ - // XmlNode nd = this.SelectSingleNode("XtraFlags/@" + attr); - // if (nd == null) return false; - // if (nd.InnerText.ToUpper() == "TRUE") return true; - // return false; - //} - private LazyLoad _PurchaseOptions; - public E_PurchaseOptions? PurchaseOptions - { - get - { - return LazyLoad(ref _PurchaseOptions, "@PurchaseOptions"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return _Font == null? _Font = new VE_Font(base.XmlNode): _Font; - } - } - private SymbolList _SymbolList; - public SymbolList SymbolList - { - get - { - return (_SymbolList == null) ? _SymbolList = new SymbolList(SelectNodes("Symbols/Symbol")) : _SymbolList; - } - set { _SymbolList = value; } - } - private EditData _EditData; - public EditData EditData - { - get - { - return _EditData == null ? _EditData = new EditData(SelectSingleNode("EditData")): _EditData; - } - } - private PrintData _PrintData; - public PrintData PrintData - { - get - { - return _PrintData == null? _PrintData = new PrintData(SelectSingleNode("PrintData")):_PrintData; - } - } - private ProcData _ProcData; - public ProcData ProcData - { - get - { - return _ProcData == null? _ProcData = new ProcData(SelectSingleNode("ProcData")):_ProcData; - } - } - private SectData _SectData; - public SectData SectData - { - get - { - return _SectData == null? _SectData = new SectData(SelectSingleNode("SectData")):_SectData; - } - } - private BoxList _BoxList; - public BoxList BoxList - { - get - { - return _BoxList == null? _BoxList = new BoxList(SelectNodes("BoxData/Box"),MyFormat):_BoxList; - } - set { _BoxList = value; } - } - private TransData _TransData; - public TransData TransData - { - get - { - return _TransData == null? _TransData = new TransData(SelectSingleNode("TransData")):_TransData; - } - } - private StepDataList _StepDataList; - public StepDataList StepDataList - { - get - { - return _StepDataList == null? _StepDataList = new StepDataList(SelectNodes("StepData/Step"),MyFormat):_StepDataList; - } - set { _StepDataList = value; } - } - public List GetSearchableSteps() - { - List sds = new List(); - foreach (StepData sd in StepDataList) - { - if (!sd.Inactive && sd.StepEditData.Searchable && sd.StepEditData.TypeMenu.InMenu) - sds.Add(new StepDataRetval(sd.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(sd.Index))); - } - return sds; - } - public StepData StepTopUnderBase(StepData sd, int formatStepType) - { - StepData top = sd; - while (top.ParentType != "Base") - { - string sParStp = StepDataList[formatStepType].ParentType; - foreach (StepData stp in StepDataList) - { - if (top.ParentType == stp.Type) - { - top = stp; - break; - } - } - } - return top; - } - public List StepGetLevelTypes(bool alwaysAdd, StepData topType, ref int cursel, string curType, ItemInfo _CurItemInfo) - { - List sds = new List(); - int retval = -1; - int cntitm = 0; - // if there are alternatenames for this item, use that list, otherwise, get list from - // xml for current node & its children.... - if (topType.StepEditData.TypeMenu.AlternateNameList != null && topType.StepEditData.TypeMenu.AlternateNameList != "") - { - // loop through the AlternateName string, it has indices for step types.. - string[] split = topType.StepEditData.TypeMenu.AlternateNameList.Split(new Char[] { ',' }); - foreach (string s in split) - { - foreach (StepData sd in this.StepDataList) - { - if (sd.Type == s && !sd.Inactive) - { - sds.Add(new StepDataRetval(sd.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(sd.Index))); - if (topType.Type == sd.Type) retval = cntitm; - cntitm++; - break; - } - } - } - } - - // some menu items (step change types) can only be done in aer column, check for that.... - // also tables and figures off caution/notes must use rno data. - else if (alwaysAdd || (topType.StepEditData.TypeMenu.InMenu && ((topType.StepEditData.TypeMenu.RnoInMenu) || - (!topType.StepEditData.TypeMenu.RnoInMenu && !_CurItemInfo.IsInRNO && !_CurItemInfo.IsCaution && !_CurItemInfo.IsNote) || - (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsInRNO) || - (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsCaution) || - (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsNote)))) - { - if (!topType.Inactive) - { - if ((_CurItemInfo.IsInRNO||_CurItemInfo.IsCaution||_CurItemInfo.IsNote) && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != "") - sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.RnoMenuItem, Convert.ToInt32(topType.Index))); - else - sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(topType.Index))); - - if (topType.Type == curType) retval = cntitm; - cntitm++; - } - foreach (StepData sd in StepDataList) - { - if (sd.ParentType == topType.Type) - { - int tmpindx = DoListChildStepTypes(alwaysAdd, ref sds, sd, curType, _CurItemInfo, ref cntitm); - if (sd.Type == curType) retval = tmpindx; - if (retval < 0 && tmpindx > 0) retval = tmpindx; - } - } - } - cursel = retval; - return sds; - } - - private int DoListChildStepTypes(bool alwaysAdd, ref List sds, StepData topType, string curType, ItemInfo _CurItemInfo, ref int cntitm) - { - int retval = -1; - if (alwaysAdd || (topType.StepEditData.TypeMenu.InMenu && ((topType.StepEditData.TypeMenu.RnoInMenu) || - (!topType.StepEditData.TypeMenu.RnoInMenu && !_CurItemInfo.IsInRNO&&!_CurItemInfo.IsCaution&&!_CurItemInfo.IsNote) || - (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsInRNO) || - (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsCaution) || - (topType.StepEditData.TypeMenu.RnoInMenu && _CurItemInfo.IsNote)))) - { - if (!topType.Inactive) - { - if ((_CurItemInfo.IsInRNO||_CurItemInfo.IsCaution||_CurItemInfo.IsNote) && topType.StepEditData.TypeMenu.RnoMenuItem != null && topType.StepEditData.TypeMenu.RnoMenuItem != "") - sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.RnoMenuItem, Convert.ToInt32(topType.Index))); - else - sds.Add(new StepDataRetval(topType.StepEditData.TypeMenu.MenuItem, Convert.ToInt32(topType.Index))); - - if (topType.Type == curType) retval = cntitm; - cntitm++; - } - foreach (StepData sd in StepDataList) - { - if (sd.ParentType == topType.Type) - { - int tmpindx = DoListChildStepTypes(alwaysAdd, ref sds, sd, curType, _CurItemInfo, ref cntitm); - if (sd.Type == curType) retval = tmpindx; - if (retval < 0 && tmpindx > 0) retval = tmpindx; - } - } - } - return retval; - } - /// - /// for format data given a string representing the Type of step, find the index. - /// - public int GetIndexFromType(string type) - { - foreach (StepData sd in StepDataList) - { - if (sd.Type == type) return (int)sd.Index; - } - return 0; // default to the base - } - } - #endregion - #region Symbols - [TypeConverter(typeof(ExpandableObjectConverter))] - public class Symbol : vlnFormatItem - { - public Symbol(XmlNode xmlNode) : base(xmlNode) { } - public Symbol() : base() { } - [Category("Ints")] - private LazyLoad _Unicode; - public int? Unicode - { - get - { - return LazyLoad(ref _Unicode, "@Unicode"); - } - } - [Category("Strings")] - private LazyLoad _Desc; - public string Desc - { - get - { - return LazyLoad(ref _Desc, "@Desc"); - } - } - public override string GetPDDisplayName() - { return Desc; } - public override string GetPDDescription() - { return string.Format("Symbol Unicode '{0}' Description '{1}'", Unicode, Desc); } - public override string GetPDCategory() - { return "Supported Symbols"; } - public override string ToString() - { - return Desc; - } - } - [TypeConverter(typeof(vlnListConverter))] - public class SymbolList : vlnFormatList - { - public SymbolList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region EditData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class EditData : vlnFormatItem - { - public EditData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _EMode; - public E_EMode? EMode - { - get - { - return LazyLoad(ref _EMode, "@EMode"); - } - } - private LazyLoad _PromptForCautionType; - public bool PromptForCautionType - { - get - { - return LazyLoad(ref _PromptForCautionType, "@PromptForCautionType"); - } - } - } - #endregion - #region PrintDataAll - #region PrintData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class PrintData : vlnFormatItem - { - public PrintData(XmlNode xmlNode) : base(xmlNode) { } - private VersionIdTextList _VersionIdTextList; - public VersionIdTextList VersionIdTextList - { - get - { - return _VersionIdTextList == null? _VersionIdTextList = new VersionIdTextList(SelectNodes("VersionIdText/string")):_VersionIdTextList; - } - set { _VersionIdTextList = value; } - } - private ProcDescrList _ProcDescrList; - public ProcDescrList ProcDescrList - { - get - { - return _ProcDescrList == null? _ProcDescrList = new ProcDescrList(SelectNodes("ProcDescrList/ProcDescr")):_ProcDescrList; - } - } - private LazyLoad _DoPrnDrvrAdjusts; - public int? DoPrnDrvrAdjusts - { - get - { - return LazyLoad(ref _DoPrnDrvrAdjusts, "@DoPrnDrvrAdjusts"); - } - } - private LazyLoad _TopOfPageThing; - public string TopOfPageThing - { - get - { - return LazyLoad(ref _TopOfPageThing, "@TopOfPageThing"); - } - } - private LazyLoad _DoRevDate; - public bool DoRevDate - { - get - { - return LazyLoad(ref _DoRevDate, "@DoRevDate"); - } - } - private LazyLoad _AlternateFoldoutPages; - public bool AlternateFoldoutPages - { - get - { - return LazyLoad(ref _AlternateFoldoutPages, "@AlternateFoldoutPages"); - } - } - private LazyLoad _AlternateFloatingFoldout; - public bool AlternateFloatingFoldout - { - get - { - return LazyLoad(ref _AlternateFloatingFoldout, "@AlternateFloatingFoldout"); - } - } - private LazyLoad _SectionLevelFoldouts; - public bool SectionLevelFoldouts - { - get - { - return LazyLoad(ref _SectionLevelFoldouts, "@SectionLevelFoldouts"); - } - } - private LazyLoad _RevDateWithForwardSlash; - public bool RevDateWithForwardSlash - { - get - { - return LazyLoad(ref _RevDateWithForwardSlash, "@RevDateWithForwardSlash"); - } - } - private LazyLoad _SpecialStepsFoldout; - public bool SpecialStepsFoldout - { - get - { - return LazyLoad(ref _SpecialStepsFoldout, "@SpecialStepsFoldout"); - } - } - private LazyLoad _AccessoryDocsInDuplex; - public bool AccessoryDocsInDuplex - { - get - { - return LazyLoad(ref _AccessoryDocsInDuplex, "@AccessoryDocsInDuplex"); - } - } - private LazyLoad _FoldoutsInDuplex; - public bool FoldoutsInDuplex - { - get - { - return LazyLoad(ref _FoldoutsInDuplex, "@FoldoutsInDuplex"); - } - } - private LazyLoad _PagelistChangeIDsWithCommas; - public bool PagelistChangeIDsWithCommas - { - get - { - return LazyLoad(ref _PagelistChangeIDsWithCommas, "@PagelistChangeIDsWithCommas"); - } - } - } - #endregion - #region VersionIdText - [TypeConverter(typeof(ExpandableObjectConverter))] - public class VersionIdText : vlnFormatItem - { - public VersionIdText(XmlNode xmlNode) : base(xmlNode) { } - public VersionIdText() : base() { } - private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("VersionIdText '{0}'", Text); } - public override string GetPDCategory() - { return "Version Id Text"; } - public override string ToString() - { - return Text; - } - } - #endregion - #region VersionIdTextList - [TypeConverter(typeof(vlnListConverter))] - public class VersionIdTextList : vlnFormatList - { - public VersionIdTextList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region ProcDescr - [TypeConverter(typeof(ExpandableObjectConverter))] - public partial class ProcDescr : vlnFormatItem //: BusinessBase, IDisposable - { - public ProcDescr(XmlNode xmlNode) : base(xmlNode) { } - public ProcDescr() : base() { } - private LazyLoad _MatchProcNumber; - public string MatchProcNumber - { - get - { - return LazyLoad(ref _MatchProcNumber, "@MatchProcNumber"); - } - } - private LazyLoad _ProcDescr1; - public string ProcDescr1 - { - get - { - return LazyLoad(ref _ProcDescr1, "@ProcDescr1"); - } - } - private LazyLoad _ProcDescr2; - public string ProcDescr2 - { - get - { - return LazyLoad(ref _ProcDescr2, "@ProcDescr2"); - } - } - public override string ToString() - { - return string.Format("{0}, {1}", ProcDescr1, MatchProcNumber); - } - } - #region ProcDescrList - [TypeConverter(typeof(vlnListConverter))] - public class ProcDescrList : vlnFormatList - { - public ProcDescrList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #endregion - #endregion - #region ProcDataAll - #region ProcData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ProcData : vlnFormatItem - { - public ProcData(XmlNode xmlNode): base(xmlNode) {} - private ProcedureSuffixList _ProcedureSuffixList; - public ProcedureSuffixList ProcedureSuffixList - { - get - { - return _ProcedureSuffixList == null? _ProcedureSuffixList = new ProcedureSuffixList(SelectNodes("ProcedureSuffix/string")): _ProcedureSuffixList; - } - set { _ProcedureSuffixList = value; } - } - private ChangeBarData _ChangeBarData; - public ChangeBarData ChangeBarData - { - get - { - return _ChangeBarData == null? _ChangeBarData = new ChangeBarData(SelectSingleNode("ChangeBarData")):_ChangeBarData; - } - } - private CheckOffData _CheckOffData; - public CheckOffData CheckOffData - { - get - { - return _CheckOffData == null? _CheckOffData = new CheckOffData(SelectSingleNode("CheckOffData")):_CheckOffData; - } - } - private LazyLoad _TitleLength; - public int? TitleLength - { - get - { - return LazyLoad(ref _TitleLength, "@TitleLength"); - } - } - private LazyLoad _CoverTitleLength; - public int? CoverTitleLength - { - get - { - return LazyLoad(ref _CoverTitleLength, "@CoverTitleLength"); - } - } - private LazyLoad _ProcedureSuffixFlags; - public string ProcedureSuffixFlags - { - get - { - return LazyLoad(ref _ProcedureSuffixFlags, "@ProcedureSuffixFlags"); - } - } - private LazyLoad _CapitalizeTitle; - public bool CapitalizeTitle - { - get - { - return LazyLoad(ref _CapitalizeTitle, "@CapitalizeTitle"); - } - } - private LazyLoad _ChangeStyleForEverySection; - public bool ChangeStyleForEverySection - { - get - { - return LazyLoad(ref _ChangeStyleForEverySection, "@ChangeStyleForEverySection"); - } - } - private LazyLoad _PrintNoTitle; - public bool PrintNoTitle - { - get - { - return LazyLoad(ref _PrintNoTitle, "@PrintNoTitle"); - } - } - private LazyLoad _CountFoldoutPages; - public bool CountFoldoutPages - { - get - { - return LazyLoad(ref _CountFoldoutPages, "@CountFoldoutPages"); - } - } - private LazyLoad _PSInfFile; - public string PSInfFile - { - get - { - return LazyLoad(ref _PSInfFile, "@PSInfFile"); - } - } - private LazyLoad _ForeColor; - public string ForeColor - { - get - { - return LazyLoad(ref _ForeColor, "@ForeColor"); - } - } - private LazyLoad _BackColor; - public string BackColor - { - get - { - return LazyLoad(ref _BackColor, "@BackColor"); - } - } - } - #endregion - #region ProcedureSuffix - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ProcedureSuffix : vlnFormatItem - { - public ProcedureSuffix(XmlNode xmlNode) : base(xmlNode) { } - public ProcedureSuffix() : base() { } - private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("ProcedureSuffix '{0}'", Text); } - public override string GetPDCategory() - { return "Procedure Suffix"; } - public override string ToString() - { - return Text; - } - } - #endregion - #region ProcedureSuffixList - [TypeConverter(typeof(vlnListConverter))] - public class ProcedureSuffixList : vlnFormatList - { - public ProcedureSuffixList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region CheckOffAll - #region CheckOffData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class CheckOffData : vlnFormatItem - { - public CheckOffData(XmlNode xmlNode) : base(xmlNode) { } - private RightCheckOffBoxList _RightCheckOffBoxList; - public RightCheckOffBoxList RightCheckOffBoxList - { - get - { - return _RightCheckOffBoxList == null? _RightCheckOffBoxList = new RightCheckOffBoxList(SelectNodes("RightCheckOffBoxList/RightCheckOffBox"),MyFormat):_RightCheckOffBoxList; - } - } - private CheckOffList _CheckOffList; - public CheckOffList CheckOffList - { - get - { - return _CheckOffList == null? _CheckOffList = new CheckOffList(SelectNodes("CheckOffList/CheckOff"),MyFormat):_CheckOffList; - } - } - private CheckOffHeaderList _CheckOffHeaderList; - public CheckOffHeaderList CheckOffHeaderList - { - get - { - return _CheckOffHeaderList == null? _CheckOffHeaderList = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"),MyFormat): _CheckOffHeaderList; - } - } - private LazyLoad _UseCheckOffsIn; - public int? UseCheckOffsIn - { - get - { - return LazyLoad(ref _UseCheckOffsIn, "@UseCheckOffsIn"); - } - } - private LazyLoad _CheckOffAdjustment; - public int? CheckOffAdjustment - { - get - { - return LazyLoad(ref _CheckOffAdjustment, "@CheckOffAdjustment"); - } - } - private LazyLoad _DropCheckOff; - public bool DropCheckOff - { - get - { - return LazyLoad(ref _DropCheckOff, "@DropCheckOff"); - } - } - private LazyLoad _CheckOffOnHLSOnly; - public bool CheckOffOnHLSOnly - { - get - { - return LazyLoad(ref _CheckOffOnHLSOnly, "@CheckOffOnHLSOnly"); - } - } - } - #endregion - #region RightCheckOffBox - [TypeConverter(typeof(ExpandableObjectConverter))] - public class RightCheckOffBox : vlnFormatItem, IVlnIndexedFormatItem - { - public RightCheckOffBox(XmlNode xmlNode) : base(xmlNode) { } - public RightCheckOffBox() : base() { } - private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private LazyLoad _RightCheckOffBoxChar; - public int? RightCheckOffBoxChar - { - get - { - return LazyLoad(ref _RightCheckOffBoxChar, "@RightCheckOffBoxChar"); - } - } - public override string GetPDDisplayName() - { return string.Format("[{0}]", Index); } - public override string GetPDDescription() - { return string.Format("[{0}] - {1}", Index, RightCheckOffBoxChar); } - public override string GetPDCategory() - { return "RightCheckOffBox Data"; } - public override string ToString() - { - return RightCheckOffBoxChar.ToString(); - } - } - #endregion - #region RightCheckOffBoxList - [TypeConverter(typeof(vlnIndexedListConverter))] - public class RightCheckOffBoxList : vlnIndexedFormatList - { - public RightCheckOffBoxList(XmlNodeList xmlNodeList,IFormatOrFormatInfo myFormat) : base(xmlNodeList,myFormat) { } - public override vlnIndexedFormatList InheritedList - { - get - { - IFormatOrFormatInfo parentFormat = MyFormat.MyIParent; - if (parentFormat != null) - return parentFormat.PlantFormat.FormatData.ProcData.CheckOffData.RightCheckOffBoxList; - return null; - } - } - - } - #endregion - #region CheckOff - [TypeConverter(typeof(ExpandableObjectConverter))] - public class CheckOff : vlnFormatItem,IVlnIndexedFormatItem - { - public CheckOff(XmlNode xmlNode) : base(xmlNode) { } - public CheckOff() : base() { } - private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private LazyLoad _RightCheckOffChars; - public int? RightCheckOffChars - { - get - { - return LazyLoad(ref _RightCheckOffChars, "@RightCheckOffChars"); - } - } - private LazyLoad _CheckOffWidAdjust; - public int? CheckOffWidAdjust - { - get - { - return LazyLoad(ref _CheckOffWidAdjust, "@CheckOffWidAdjust"); - } - } - private LazyLoad _RightCheckOffPrompt; - public string RightCheckOffPrompt - { - get - { - return LazyLoad(ref _RightCheckOffPrompt, "@RightCheckOffPrompt"); - } - } - public override string GetPDDisplayName() - { return string.Format("[{0}]",Index); } - public override string GetPDDescription() - { return string.Format("[{0}] - {1}", Index, RightCheckOffPrompt); } - public override string GetPDCategory() - { return "Checkoff Data"; } - public override string ToString() - { - return RightCheckOffPrompt; - } - } - #endregion - #region CheckOffList - [TypeConverter(typeof(vlnIndexedListConverter))] - public class CheckOffList : vlnIndexedFormatList - { - public CheckOffList(XmlNodeList xmlNodeList,IFormatOrFormatInfo myFormat) : base(xmlNodeList,myFormat) { } - public override vlnIndexedFormatList InheritedList - { - get - { - IFormatOrFormatInfo parentFormat = MyFormat.MyIParent; - if (parentFormat != null) - return parentFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList; - return null; - } - } - } - #endregion - #region CheckOffHeader - [TypeConverter(typeof(ExpandableObjectConverter))] - public class CheckOffHeader : vlnFormatItem,IVlnIndexedFormatItem - { - public CheckOffHeader(XmlNode xmlNode) : base(xmlNode) { } - public CheckOffHeader() : base() { } - private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null ? _Font = new VE_Font(base.XmlNode) : _Font); - } - } - private LazyLoad _CheckOffHeading; - public string CheckOffHeading - { - get - { - return LazyLoad(ref _CheckOffHeading, "@CheckOffHeading"); - } - } - public override string GetPDDisplayName() - { return string.Format("[{0}]", Index); } - public override string GetPDDescription() - { return string.Format("[{0}] - {1}", Index, CheckOffHeading); } - public override string GetPDCategory() - { return "Checkoff Header Data"; } - public override string ToString() - { - return CheckOffHeading; - } - } - #endregion - #region CheckOffHeaderList - [TypeConverter(typeof(vlnIndexedListConverter))] - public class CheckOffHeaderList : vlnIndexedFormatList - { - public CheckOffHeaderList(XmlNodeList xmlNodeList,IFormatOrFormatInfo myFormat) : base(xmlNodeList,myFormat) { } - public override vlnIndexedFormatList InheritedList - { - get - { - IFormatOrFormatInfo parentFormat = MyFormat.MyIParent; - if (parentFormat != null) - return parentFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList; - return null; - } - } - } - #endregion - #endregion - #region ChangeBarData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ChangeBarData : vlnFormatItem - { - public ChangeBarData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _ChangeBarMessage; - public string ChangeBarMessage - { - get - { - return LazyLoad(ref _ChangeBarMessage, "@ChangeBarMessage"); - } - } - private LazyLoad _FixedChangeColumn; - public int? FixedChangeColumn - { - get - { - return LazyLoad(ref _FixedChangeColumn, "@FixedChangeColumn"); - } - } - private LazyLoad _FixedAERChangeColumn; - public int? FixedAERChangeColumn - { - get - { - return LazyLoad(ref _FixedAERChangeColumn, "@FixedAERChangeColumn"); - } - } - private LazyLoad _ChangeSummaryStyle; - public E_Style? ChangeSummaryStyle - { - get - { - return LazyLoad(ref _ChangeSummaryStyle, "@ChangeSummaryStyle"); - } - } - private LazyLoad _ChangeBarStyle; - public E_Style? ChangeBarStyle - { - get - { - return LazyLoad(ref _ChangeBarStyle, "@ChangeBarStyle"); - } - } - private LazyLoad _SpecialChangeBar; - public string SpecialChangeBar - { - get - { - return LazyLoad(ref _SpecialChangeBar, "@SpecialChangeBar"); - } - } - private LazyLoad _CondensedChangeBar; - public bool CondensedChangeBar - { - get - { - return LazyLoad(ref _CondensedChangeBar, "@CondensedChangeBar"); - } - } - private LazyLoad _AbsoluteFixedChangeColumn; - public bool AbsoluteFixedChangeColumn - { - get - { - return LazyLoad(ref _AbsoluteFixedChangeColumn, "@AbsoluteFixedChangeColumn"); - } - } - private LazyLoad _ContinuousChangeBars; - public bool ContinuousChangeBars - { - get - { - return LazyLoad(ref _ContinuousChangeBars, "@ContinuousChangeBars"); - } - } - private LazyLoad _ChgBarMessageFromEdit; - public bool ChgBarMessageFromEdit - { - get - { - return LazyLoad(ref _ChgBarMessageFromEdit, "@ChgBarMessageFromEdit"); - } - } - private LazyLoad _MultipleChangeIds; - public bool MultipleChangeIds - { - get - { - return LazyLoad(ref _MultipleChangeIds, "@MultipleChangeIds"); - } - } - private LazyLoad _ChangeBarToRNOSep; - public bool ChangeBarToRNOSep - { - get - { - return LazyLoad(ref _ChangeBarToRNOSep, "@ChangeBarToRNOSep"); - } - } - private LazyLoad _ChangeBarsOnLinkedText; - public bool ChangeBarsOnLinkedText - { - get - { - return LazyLoad(ref _ChangeBarsOnLinkedText, "@ChangeBarsOnLinkedText"); - } - } - } - #endregion - #endregion - #region SectDataAll - #region SectData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class SectData : vlnFormatItem - { - public SectData(XmlNode xmlNode) : base(xmlNode) { } - private SectionNumber _SectionNumber; - public SectionNumber SectionNumber - { - get - { - if (_SectionNumber == null) _SectionNumber = new SectionNumber(SelectSingleNode("SectionNumber")); - return _SectionNumber; - } - } - private SectionHeader _SectionHeader; - public SectionHeader SectionHeader - { - get - { - if (_SectionHeader == null) _SectionHeader = new SectionHeader(SelectSingleNode("SectionHeader")); - return _SectionHeader; - } - } - private StepSectionData _StepSectionData; - public StepSectionData StepSectionData - { - get - { - if (_StepSectionData == null) _StepSectionData = new StepSectionData(SelectSingleNode("StepSectionData")); - return _StepSectionData; - } - } - private AccSectionData _AccSectionData; - public AccSectionData AccSectionData - { - get - { - if (_AccSectionData == null) _AccSectionData = new AccSectionData(SelectSingleNode("AccSectionData")); - return _AccSectionData; - } - } - private MetaSectionList _MetaSectionList; - public MetaSectionList MetaSectionList - { - get - { - if (_MetaSectionList == null) _MetaSectionList = new MetaSectionList(SelectNodes("MetaSectionData/MetaSection"),MyFormat); - return _MetaSectionList; - } - set { _MetaSectionList = value; } - } - private ReplaceStrList _ReplaceStrList; - public ReplaceStrList ReplaceStrList - { - get - { - return (_ReplaceStrList == null) ? _ReplaceStrList = new ReplaceStrList(SelectNodes("ReplaceStrData/ReplaceStr")) : _ReplaceStrList; - } - set { _ReplaceStrList = value; } - } - private LazyLoad _SectionTitleLength; - public int? SectionTitleLength - { - get - { - return LazyLoad(ref _SectionTitleLength, "@SectionTitleLength"); - } - } - private LazyLoad _ForeColor; - public string ForeColor - { - get - { - return LazyLoad(ref _ForeColor, "@ForeColor"); - } - } - private LazyLoad _BackColor; - public string BackColor - { - get - { - return LazyLoad(ref _BackColor, "@BackColor"); - } - } - private LazyLoad _CancelSecTitlesOnS1; - public bool CancelSecTitlesOnS1 - { - get - { - return LazyLoad(ref _CancelSecTitlesOnS1, "@CancelSecTitlesOnS1"); - } - } - private LazyLoad _CancelSecTitlesOnS2; - public bool CancelSecTitlesOnS2 - { - get - { - return LazyLoad(ref _CancelSecTitlesOnS2, "@CancelSecTitlesOnS2"); - } - } - private LazyLoad _CancelSecTitlesOnE0; - public bool CancelSecTitlesOnE0 - { - get - { - return LazyLoad(ref _CancelSecTitlesOnE0, "@CancelSecTitlesOnE0"); - } - } - private LazyLoad _CancelSecTitlesOnE2; - public bool CancelSecTitlesOnE2 - { - get - { - return LazyLoad(ref _CancelSecTitlesOnE2, "@CancelSecTitlesOnE2"); - } - } - private LazyLoad _MetaSectEndMessage; - public bool MetaSectEndMessage - { - get - { - return LazyLoad(ref _MetaSectEndMessage, "@MetaSectEndMessage"); - } - } - private LazyLoad _ReadOnlyTypeInContMsg; - public bool ReadOnlyTypeInContMsg - { - get - { - return LazyLoad(ref _ReadOnlyTypeInContMsg, "@ReadOnlyTypeInContMsg"); - } - } - private LazyLoad _ReplaceWordsInROs; - public bool ReplaceWordsInROs - { - get - { - return LazyLoad(ref _ReplaceWordsInROs, "@ReplaceWordsInROs"); - } - } - private LazyLoad _UseMetaSections; - public bool UseMetaSections - { - get - { - return LazyLoad(ref _UseMetaSections, "@UseMetaSections"); - } - } - private LazyLoad _NonEditableSteps; - public bool NonEditableSteps - { - get - { - return LazyLoad(ref _NonEditableSteps, "@NonEditableSteps"); - } - } - private LazyLoad _SearchAllReplaceWords; - public bool SearchAllReplaceWords - { - get - { - return LazyLoad(ref _SearchAllReplaceWords, "@SearchAllReplaceWords"); - } - } - private LazyLoad _SecTitleContinue; - public bool SecTitleContinue - { - get - { - return LazyLoad(ref _SecTitleContinue, "@SecTitleContinue"); - } - } - private LazyLoad _ConvertCaretToDelta; - public bool ConvertCaretToDelta - { - get - { - return LazyLoad(ref _ConvertCaretToDelta, "@ConvertCaretToDelta"); - } - } - } - #endregion - #region SectionNumber - [TypeConverter(typeof(ExpandableObjectConverter))] - public class SectionNumber : vlnFormatItem - { - public SectionNumber(XmlNode xmlNode) : base(xmlNode) { } - public SectionNumber() : base() { } - private LazyLoad _Pos; - public int? Pos - { - get - { - return LazyLoad(ref _Pos, "@Pos"); - } - } - private LazyLoad _Just; - public string Just - { - get - { - return LazyLoad(ref _Just, "@Just"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null ? _Font = new VE_Font(base.XmlNode) : _Font); - } - } - } - #endregion - #region SectionHeader - [TypeConverter(typeof(ExpandableObjectConverter))] - public class SectionHeader : vlnFormatItem - { - public SectionHeader(XmlNode xmlNode) : base(xmlNode) { } - public SectionHeader() : base() { } - private LazyLoad _Pos; - public int? Pos - { - get - { - return LazyLoad(ref _Pos, "@Pos"); - } - } - private LazyLoad _Just; - public string Just - { - get - { - return LazyLoad(ref _Just, "@Just"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null ? _Font = new VE_Font(base.XmlNode) : _Font); - } - } - } - #endregion - #region StepSectionDataAll - #region StepSectionData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class StepSectionData : vlnFormatItem - { - public StepSectionData(XmlNode xmlNode) : base(xmlNode) { } - private TextTypeValueList _TextTypeValueList; - public TextTypeValueList TextTypeValueList - { - get - { - return (_TextTypeValueList == null)? _TextTypeValueList = new TextTypeValueList(SelectNodes("TextTypeValue/short")): _TextTypeValueList; - } - set { _TextTypeValueList = value; } - } - private TextTypeList _TextTypeList; - public TextTypeList TextTypeList - { - get - { - return (_TextTypeList == null)? _TextTypeList = new TextTypeList(SelectNodes("TextType/string")): _TextTypeList; - } - set { _TextTypeList = value; } - } - //private SeqTabList _SeqTabList; - //public SeqTabList SeqTabList - //{ - // get - // { - // return (_SeqTabList == null)? _SeqTabList = new SeqTabList(SelectNodes("SeqTab/string")): _SeqTabList; - // } - // set { _SeqTabList = value; } - //} - //private PreSeqTabEditList _PreSeqTabEditList; - //public PreSeqTabEditList PreSeqTabEditList - //{ - // get - // { - // return (_PreSeqTabEditList == null) ?_PreSeqTabEditList = new PreSeqTabEditList(SelectNodes("PreSeqTabEdit/string")): _PreSeqTabEditList; - // } - // set { _PreSeqTabEditList = value; } - //} - //private PreSeqTabPrintList _PreSeqTabPrintList; - //public PreSeqTabPrintList PreSeqTabPrintList - //{ - // get - // { - // return (_PreSeqTabPrintList == null)? _PreSeqTabPrintList = new PreSeqTabPrintList(SelectNodes("PreSeqTabPrint/string")):_PreSeqTabPrintList; - // } - // set { _PreSeqTabPrintList = value; } - //} - //private PostSeqTabEditList _PostSeqTabEditList; - //public PostSeqTabEditList PostSeqTabEditList - //{ - // get - // { - // return (_PostSeqTabEditList == null)? _PostSeqTabEditList = new PostSeqTabEditList(SelectNodes("PostSeqTabEdit/string")): _PostSeqTabEditList; - // } - // set { _PostSeqTabEditList = value; } - //} - //private PostSeqTabPrintList _PostSeqTabPrintList; - //public PostSeqTabPrintList PostSeqTabPrintList - //{ - // get - // { - // return (_PostSeqTabPrintList == null)? _PostSeqTabPrintList = new PostSeqTabPrintList(SelectNodes("PostSeqTabPrint/string")): _PostSeqTabPrintList; - // } - // set { _PostSeqTabPrintList = value; } - //} - private UnderlineTerminateList _UnderlineTerminateList; - public UnderlineTerminateList UnderlineTerminateList - { - get - { - return (_UnderlineTerminateList == null)? _UnderlineTerminateList = new UnderlineTerminateList(SelectNodes("UnderlineTerminate/string")):_UnderlineTerminateList; - } - set { _UnderlineTerminateList = value; } - } - private ObserveNCString1List _ObserveNCString1List; - public ObserveNCString1List ObserveNCString1List - { - get - { - return (_ObserveNCString1List == null)? _ObserveNCString1List = new ObserveNCString1List(SelectNodes("ObserveNCString1/string")): _ObserveNCString1List; - } - set { _ObserveNCString1List = value; } - } - private ObserveNCString2List _ObserveNCString2List; - public ObserveNCString2List ObserveNCString2List - { - get - { - return (_ObserveNCString2List == null)? _ObserveNCString2List = new ObserveNCString2List(SelectNodes("ObserveNCString2/string")):_ObserveNCString2List; - } - set { _ObserveNCString2List = value; } - } - private StepSectionLayoutData _StepSectionLayoutData; - public StepSectionLayoutData StepSectionLayoutData - { - get - { - return (_StepSectionLayoutData == null)? _StepSectionLayoutData = new StepSectionLayoutData(SelectSingleNode("StpSectLayData")):_StepSectionLayoutData; - } - } - private StepSectionEditData _StepSectionEditData; - public StepSectionEditData StepSectionEditData - { - get - { - return (_StepSectionEditData == null)? _StepSectionEditData = new StepSectionEditData(SelectSingleNode("StpSectEditData")): _StepSectionEditData; - } - } - private SeqTabFmtList _SeqTabFmtList; - public SeqTabFmtList SeqTabFmtList - { - get - { - return (_SeqTabFmtList == null) ? _SeqTabFmtList = new SeqTabFmtList(SelectNodes("SequentialTabFormat/SeqTabFmt"),MyFormat) : _SeqTabFmtList; - } - } - private StepSectionPrintData _StepSectionPrintData; - public StepSectionPrintData StepSectionPrintData - { - get - { - return (_StepSectionPrintData == null) ? _StepSectionPrintData = new StepSectionPrintData(SelectSingleNode("StpSectPrtData")) : _StepSectionPrintData; - } - } - private LazyLoad _TopRow; - public int? TopRow - { - get - { - return LazyLoad(ref _TopRow, "@TopRow"); - } - } - //private LazyLoad _SeqStart; - //public string SeqStart - //{ - // get - // { - // return LazyLoad(ref _SeqStart, "@SeqStart"); - // } - //} - //private LazyLoad _LeftJustSeqTab; - //public string LeftJustSeqTab - //{ - // get - // { - // return LazyLoad(ref _LeftJustSeqTab, "@LeftJustSeqTab") ; - // } - //} - //private LazyLoad _HighSeqStart; - //public int? HighSeqStart - //{ - // get - // { - // return LazyLoad(ref _HighSeqStart, "@HighSeqStart"); - // } - //} - private LazyLoad _IndentToken; - public string IndentToken - { - get - { - return LazyLoad(ref _IndentToken, "@IndentToken"); - } - } - private LazyLoad _NumberOfHighLevelSteps; - public int? NumberOfHighLevelSteps - { - get - { - return LazyLoad(ref _NumberOfHighLevelSteps, "@NumberOfHighLevelSteps"); - } - } - private LazyLoad _NumberOfSubStypeTypes; - public int? NumberOfSubStypeTypes - { - get - { - return LazyLoad(ref _NumberOfSubStypeTypes, "@NumberOfSubStepTypes"); - } - } - private LazyLoad _IdentB; - public string IdentB - { - get - { - return LazyLoad(ref _IdentB, "@IdentB"); - } - } - private LazyLoad _WolfCreekBackgroundFormat; - public bool WolfCreekBackgroundFormat - { - get - { - return LazyLoad(ref _WolfCreekBackgroundFormat, "@WolfCreekBackgroundFormat"); - } - } - private LazyLoad _WolfcreekCKLFormat; - public bool WolfcreekCKLFormat - { - get - { - return LazyLoad(ref _WolfcreekCKLFormat, "@WolfcreekCKLFormat"); - } - } - private LazyLoad _WolfcreekCKLBackgndFormat; - public bool WolfcreekCKLBackgndFormat - { - get - { - return LazyLoad(ref _WolfcreekCKLBackgndFormat, "@WolfcreekCKLBackgndFormat"); - } - } - private LazyLoad _FortranFormatNumbers; - public bool FortranFormatNumbers - { - get - { - return LazyLoad(ref _FortranFormatNumbers, "@FortranFormatNumbers"); - } - } - private LazyLoad _UseTopContinueMessageAtEnd; - public bool UseTopContinueMessageAtEnd - { - get - { - return LazyLoad(ref _UseTopContinueMessageAtEnd, "@UseTopContinueMessageAtEnd"); - } - } - private LazyLoad _FloatingContinueMessage; - public bool FloatingContinueMessage - { - get - { - return LazyLoad(ref _FloatingContinueMessage, "@FloatingContinueMessage"); - } - } - private LazyLoad _WrapSameAsEdit; - public bool WrapSameAsEdit - { - get - { - return LazyLoad(ref _WrapSameAsEdit, "@WrapSameAsEdit"); - } - } - private LazyLoad _ContinueSectionHeader; - public bool ContinueSectionHeader - { - get - { - return LazyLoad(ref _ContinueSectionHeader, "@ContinueSectionHeader"); - } - } - private LazyLoad _CompressHPSub; - public bool CompressHPSub - { - get - { - return LazyLoad(ref _CompressHPSub, "@CompressHPSub"); - } - } - private LazyLoad _CompressHPSuper; - public bool CompressHPSuper - { - get - { - return LazyLoad(ref _CompressHPSuper, "@CompressHPSuper"); - } - } - private LazyLoad _UndSpecialStepsFoldout; - public bool UndSpecialStepsFoldout - { - get - { - return LazyLoad(ref _UndSpecialStepsFoldout, "@UndSpecialStepsFoldout"); - } - } - private LazyLoad _UnderlineAllMetaTitles; - public bool UnderlineAllMetaTitles - { - get - { - return LazyLoad(ref _UnderlineAllMetaTitles, "@UnderlineAllMetaTitles"); - } - } - private LazyLoad _BoldOnlySectionZero; - public bool BoldOnlySectionZero - { - get - { - return LazyLoad(ref _BoldOnlySectionZero, "@BoldOnlySectionZero"); - } - } - private LazyLoad _ImperfectStructure; - public bool ImperfectStructure - { - get - { - return LazyLoad(ref _ImperfectStructure, "@ImperfectStructure"); - } - } - private LazyLoad _ImperfectSubstep; - public bool ImperfectSubstep - { - get - { - return LazyLoad(ref _ImperfectSubstep, "@ImperfectSubstep"); - } - } - private LazyLoad _ImperfectStructurePlus4; - public bool ImperfectStructurePlus4 - { - get - { - return LazyLoad(ref _ImperfectStructurePlus4, "@ImperfectStructurePlus4"); - } - } - private LazyLoad _CountAllSubLevels; - public bool CountAllSubLevels - { - get - { - return LazyLoad(ref _CountAllSubLevels, "@CountAllSubLevels"); - } - } - private LazyLoad _UseMultiLineSectionTitle; - public bool UseMultiLineSectionTitle - { - get - { - return LazyLoad(ref _UseMultiLineSectionTitle, "@UseMultiLineSectionTitle"); - } - } - } - #endregion - #region TextTypeValue - [TypeConverter(typeof(ExpandableObjectConverter))] - public class TextTypeValue : vlnFormatItem - { - public TextTypeValue(XmlNode xmlNode) : base(xmlNode) { } - public TextTypeValue() : base() { } - private LazyLoad _TheValue; - public int? TheValue - { - get - { - return LazyLoad(ref _TheValue, "text()"); - } - } - public override string GetPDDisplayName() - { return "Value"; } - public override string GetPDDescription() - { return string.Format("TextTypeValue '{0}'", TheValue); } - public override string GetPDCategory() - { return "Text Type Value"; } - public override string ToString() - { - return TheValue.ToString(); - } - } - #endregion - #region TextTypeValueList - [TypeConverter(typeof(vlnListConverter))] - public class TextTypeValueList : vlnFormatList - { - public TextTypeValueList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region TextType - [TypeConverter(typeof(ExpandableObjectConverter))] - public class TextType : vlnFormatItem - { - public TextType(XmlNode xmlNode) : base(xmlNode) { } - public TextType() : base() { } - //[Category("Strings")] - private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("TextType '{0}'", Text); } - public override string GetPDCategory() - { return "Text Type"; } - public override string ToString() - { - return Text; - } - } - #endregion - #region TextTypeList - [TypeConverter(typeof(vlnListConverter))] - public class TextTypeList : vlnFormatList - { - public TextTypeList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region OLD - SeqTab - //[TypeConverter(typeof(ExpandableObjectConverter))] - //public class SeqTab : vlnFormatItem - //{ - // public SeqTab(XmlNode xmlNode) : base(xmlNode) { } - // public SeqTab() : base() { } - // private LazyLoad _Text; - // public string Text - // { - // get - // { - // return LazyLoad(ref _Text, "text()"); - // } - // } - // public override string GetPDDisplayName() - // { return "Text"; } - // public override string GetPDDescription() - // { return string.Format("SeqTab '{0}'", Text); } - // public override string GetPDCategory() - // { return "Seq Tab"; } - // public override string ToString() - // { - // return Text; - // } - //} - #endregion - #region OLD - SeqTabList - //[TypeConverter(typeof(vlnListConverter))] - //public class SeqTabList : vlnFormatList - //{ - // public SeqTabList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - //} - #endregion - #region OLD - PreSeqTabEdit - //[TypeConverter(typeof(ExpandableObjectConverter))] - //public class PreSeqTabEdit : vlnFormatItem - //{ - // public PreSeqTabEdit(XmlNode xmlNode) : base(xmlNode) { } - // public PreSeqTabEdit() : base() { } - // //[Category("Strings")] - // private LazyLoad _Text; - // public string Text - // { - // get - // { - // return LazyLoad(ref _Text, "text()"); - // } - // } - // public override string GetPDDisplayName() - // { return "Text"; } - // public override string GetPDDescription() - // { return string.Format("PreSeqTabEdit '{0}'", Text); } - // public override string GetPDCategory() - // { return "PreSeq Tab Edit"; } - // public override string ToString() - // { - // return Text; - // } - //} - #endregion - #region OLD - PreSeqTabEditList - //[TypeConverter(typeof(vlnListConverter))] - //public class PreSeqTabEditList : vlnFormatList - //{ - // public PreSeqTabEditList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - //} - #endregion - #region OLD - PreSeqTabPrint - //[TypeConverter(typeof(ExpandableObjectConverter))] - //public class PreSeqTabPrint : vlnFormatItem - //{ - // public PreSeqTabPrint(XmlNode xmlNode) : base(xmlNode) { } - // public PreSeqTabPrint() : base() { } - // private LazyLoad _Text; - // public string Text - // { - // get - // { - // return LazyLoad(ref _Text, "text()"); - // } - // } - // public override string GetPDDisplayName() - // { return "Text"; } - // public override string GetPDDescription() - // { return string.Format("PreSeqTabPrint '{0}'", Text); } - // public override string GetPDCategory() - // { return "PreSeq Tab Printt"; } - // public override string ToString() - // { - // return Text; - // } - //} - #endregion - #region OLD - PreSeqTabPrintList - //[TypeConverter(typeof(vlnListConverter))] - //public class PreSeqTabPrintList : vlnFormatList - //{ - // public PreSeqTabPrintList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - //} - #endregion - #region OLD - PostSeqTabEdit - //[TypeConverter(typeof(ExpandableObjectConverter))] - //public class PostSeqTabEdit : vlnFormatItem - //{ - // public PostSeqTabEdit(XmlNode xmlNode) : base(xmlNode) { } - // public PostSeqTabEdit() : base() { } - // private LazyLoad _Text; - // public string Text - // { - // get - // { - // return LazyLoad(ref _Text, "text()"); - // } - // } - // public override string GetPDDisplayName() - // { return "Text"; } - // public override string GetPDDescription() - // { return string.Format("PostSeqTabEdit '{0}'", Text); } - // public override string GetPDCategory() - // { return "PostSeq Tab Edit"; } - // public override string ToString() - // { - // return Text; - // } - //} - #endregion - #region OLD - PostSeqTabEditList - //[TypeConverter(typeof(vlnListConverter))] - //public class PostSeqTabEditList : vlnFormatList - //{ - // public PostSeqTabEditList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - //} - #endregion - #region OLD - PostSeqTabPrint - //[TypeConverter(typeof(ExpandableObjectConverter))] - //public class PostSeqTabPrint : vlnFormatItem - //{ - // public PostSeqTabPrint(XmlNode xmlNode) : base(xmlNode) { } - // public PostSeqTabPrint() : base() { } - // private LazyLoad _Text; - // public string Text - // { - // get - // { - // return LazyLoad(ref _Text, "text()"); - // } - // } - // public override string GetPDDisplayName() - // { return "Text"; } - // public override string GetPDDescription() - // { return string.Format("PostSeqTabPrint '{0}'", Text); } - // public override string GetPDCategory() - // { return "PostSeq Tab Printt"; } - // public override string ToString() - // { - // return Text; - // } - //} - #endregion - #region OLD - PostSeqTabPrintList - //[TypeConverter(typeof(vlnListConverter))] - //public class PostSeqTabPrintList : vlnFormatList - //{ - // public PostSeqTabPrintList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - //} - #endregion - #region UnderlineTerminate - [TypeConverter(typeof(ExpandableObjectConverter))] - public class UnderlineTerminate : vlnFormatItem - { - public UnderlineTerminate(XmlNode xmlNode) : base(xmlNode) { } - public UnderlineTerminate() : base() { } - private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("UnderlineTerminate '{0}'", Text); } - public override string GetPDCategory() - { return "Underline Terminate"; } - public override string ToString() - { - return Text; - } - } - #endregion - #region UnderlineTerminateList - [TypeConverter(typeof(vlnListConverter))] - public class UnderlineTerminateList : vlnFormatList - { - public UnderlineTerminateList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region ObserveNCString1 - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ObserveNCString1 : vlnFormatItem - { - public ObserveNCString1(XmlNode xmlNode) : base(xmlNode) { } - public ObserveNCString1() : base() { } - private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("ObserveNCString1 '{0}'", Text); } - public override string GetPDCategory() - { return "ObserveNCString1"; } - public override string ToString() - { - return Text; - } - } - #endregion - #region ObserveNCString1List - [TypeConverter(typeof(vlnListConverter))] - public class ObserveNCString1List : vlnFormatList - { - public ObserveNCString1List(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region ObserveNCString2 - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ObserveNCString2 : vlnFormatItem - { - public ObserveNCString2(XmlNode xmlNode) : base(xmlNode) { } - public ObserveNCString2() : base() { } - private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("ObserveNCString2 '{0}'", Text); } - public override string GetPDCategory() - { return "ObserveNCString2"; } - public override string ToString() - { - return Text; - } - } - #endregion - #region ObserveNCString2List - [TypeConverter(typeof(vlnListConverter))] - public class ObserveNCString2List : vlnFormatList - { - public ObserveNCString2List(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region ReplaceStr - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ReplaceStr : vlnFormatItem - { - public ReplaceStr(XmlNode xmlNode) : base(xmlNode) { } - public ReplaceStr() : base() { } - [Category("Strings")] - private LazyLoad _ReplaceWord; - public string ReplaceWord - { - get - { - return LazyLoad(ref _ReplaceWord, "@ReplaceWord"); - } - } - [Category("Strings")] - private LazyLoad _ReplaceWith; - public string ReplaceWith - { - get - { - return LazyLoad(ref _ReplaceWith, "@ReplaceWith"); - } - } - private LazyLoad _Flag; - public E_ReplaceFlags? Flag - { - get - { - return LazyLoad(ref _Flag, "@Flag"); - } - } - public override string GetPDDisplayName() - { return ReplaceWord; } - public override string GetPDDescription() - { return string.Format("Replace '{0}' with '{1}'",ReplaceWord,ReplaceWith); } - public override string GetPDCategory() - { return "Words to Replace"; } - public override string ToString() - { - return ReplaceWith; - } - } - - #endregion - #region ReplaceStrList - [TypeConverter(typeof(vlnListConverter))] - public class ReplaceStrList : vlnFormatList - { - public ReplaceStrList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #region StepSectionLayoutData - public class StepSectionLayoutData : vlnFormatItem - { - public StepSectionLayoutData(XmlNode xmlNode) : base(xmlNode) { } - private TopOfPage _TopOfPage; - public TopOfPage TopOfPage - { - get - { - return (_TopOfPage == null)? _TopOfPage = new TopOfPage(SelectSingleNode("TopOfPage")): _TopOfPage; - } - } - private Separator _Separator; - public Separator Separator - { - get - { - return (_Separator == null) ?_Separator = new Separator(SelectSingleNode("Separator")):_Separator; - } - } - private LazyLoad _LastLineToStartStep; - public int? LastLineToStartStep - { - get - { - return LazyLoad(ref _LastLineToStartStep, "@LastLineToStartStep"); - } - } - private LazyLoad _LineDrawingOption; - public int? LineDrawingOption - { - get - { - return LazyLoad(ref _LineDrawingOption, "@LineDrawingOption"); - } - } - private LazyLoad _ColS; - public int? ColS - { - get - { - return LazyLoad(ref _ColS, "@ColS"); - } - } - private LazyLoad _ColT; - public int? ColT - { - get - { - return LazyLoad(ref _ColT, "@ColT"); - } - } - private LazyLoad _ColAbs; - public int? ColAbs - { - get - { - return LazyLoad(ref _ColAbs, "@ColAbs"); - } - } - private LazyLoad _WidT; - public int? WidT - { - get - { - return LazyLoad(ref _WidT, "@WidT"); - } - } - private LazyLoad _PMode; - public int? PMode - { - get - { - return LazyLoad(ref _PMode, "@PMode"); - } - } - private LazyLoad _MaxRNO; - public int? MaxRNO - { - get - { - return LazyLoad(ref _MaxRNO, "@MaxRNO"); - } - } - private LazyLoad _MaxRNOTable; - public string MaxRNOTable - { - get - { - return LazyLoad(ref _MaxRNOTable, "@MaxRNOTable"); - } - } - private LazyLoad _ColRTable; - public string ColRTable - { - get - { - return LazyLoad(ref _ColRTable, "@ColRTable"); - } - } - private LazyLoad _WidSTableEdit; - public string WidSTableEdit - { - get - { - return LazyLoad(ref _WidSTableEdit, "@WidSTableEdit"); - } - } - private LazyLoad _WidSTablePrint; - public string WidSTablePrint - { - get - { - return LazyLoad(ref _WidSTablePrint, "@WidSTablePrint"); - } - } - private LazyLoad _AdjRNOCol; - public int? AdjRNOCol - { - get - { - return LazyLoad(ref _AdjRNOCol, "@AdjRNOCol"); - } - } - private LazyLoad _EndMessagePos; - public int? EndMessagePos - { - get - { - return LazyLoad(ref _EndMessagePos, "@EndMessagePos"); - } - } - private LazyLoad _RNOWidthAlt; - public string RNOWidthAlt - { - get - { - return LazyLoad(ref _RNOWidthAlt, "@RNOWidthAlt"); - } - } - private LazyLoad _HLSWidthOVRD; - public int? HLSWidthOVRD - { - get - { - return LazyLoad(ref _HLSWidthOVRD, "@HLSWidthOVRD"); - } - } - private LazyLoad _SubPaginationWght; - public int? SubPaginationWght - { - get - { - return LazyLoad(ref _SubPaginationWght, "@SubPaginationWght"); - } - } - private LazyLoad _TextTitleAdjustment; - public int? TextTitleAdjustment - { - get - { - return LazyLoad(ref _TextTitleAdjustment, "@TextTitleAdjustment"); - } - } - private VE_Font _VertStyle; - public VE_Font VertStyle - { - get - { - return (_VertStyle == null)? _VertStyle = new VE_Font(base.XmlNode): _VertStyle; - } - } - private LazyLoad _TableCenterPos; - public string TableCenterPos - { - get - { - return LazyLoad(ref _TableCenterPos, "@TableCenterPos"); - } - } - private LazyLoad _LowerLimitDivisor; - public string LowerLimitDivisor - { - get - { - return LazyLoad(ref _LowerLimitDivisor, "@LowerLimitDivisor"); - } - } - private LazyLoad _NonLinkedStepNumber; - public string NonLinkedStepNumber - { - get - { - return LazyLoad(ref _NonLinkedStepNumber, "@NonLinkedStepNumber"); - } - } - private LazyLoad _NonLinkedCautNoteNumber; - public string NonLinkedCautNoteNumber - { - get - { - return LazyLoad(ref _NonLinkedCautNoteNumber, "@NonLinkedCautNoteNumber"); - } - } - private LazyLoad _NonLinkedRNONumber; - public string NonLinkedRNONumber - { - get - { - return LazyLoad(ref _NonLinkedRNONumber, "@NonLinkedRNONumber"); - } - } - private LazyLoad _Dev_Format; - public bool Dev_Format - { - get - { - return LazyLoad(ref _Dev_Format, "@Dev_Format"); - } - } - private LazyLoad _EnhancedShortFormDev; - public bool EnhancedShortFormDev - { - get - { - return LazyLoad(ref _EnhancedShortFormDev, "@EnhancedShortFormDev"); - } - } - private LazyLoad _SpecialPageBreakFlag; - public bool SpecialPageBreakFlag - { - get - { - return LazyLoad(ref _SpecialPageBreakFlag, "@SpecialPageBreakFlag"); - } - } - private LazyLoad _PaginateOnFirstSubstep; - public bool PaginateOnFirstSubstep - { - get - { - return LazyLoad(ref _PaginateOnFirstSubstep, "@PaginateOnFirstSubstep"); - } - } - private LazyLoad _PaginateOnFirstSubstep2X; - public bool PaginateOnFirstSubstep2X - { - get - { - return LazyLoad(ref _PaginateOnFirstSubstep2X, "@PaginateOnFirstSubstep2X"); - } - } - private LazyLoad _UseHalfLines; - public bool UseHalfLines - { - get - { - return LazyLoad(ref _UseHalfLines, "@UseHalfLines"); - } - } - private LazyLoad _TryToFillHalfOfPage; - public bool TryToFillHalfOfPage - { - get - { - return LazyLoad(ref _TryToFillHalfOfPage, "@TryToFillHalfOfPage"); - } - } - private LazyLoad _CompressSteps; - public bool CompressSteps - { - get - { - return LazyLoad(ref _CompressSteps, "@CompressSteps"); - } - } - private LazyLoad _DoSTExtraAtTop; - public bool DoSTExtraAtTop - { - get - { - return LazyLoad(ref _DoSTExtraAtTop, "@DoSTExtraAtTop"); - } - } - private LazyLoad _KeepStepsOnPage; - public bool KeepStepsOnPage - { - get - { - return LazyLoad(ref _KeepStepsOnPage, "@KeepStepsOnPage"); - } - } - private LazyLoad _BreakOnSections; - public bool BreakOnSections - { - get - { - return LazyLoad(ref _BreakOnSections, "@BreakOnSections"); - } - } - private LazyLoad _ShowSectionTitles; - public bool ShowSectionTitles - { - get - { - return LazyLoad(ref _ShowSectionTitles, "@ShowSectionTitles"); - } - } - private LazyLoad _EndForSingle; - public bool EndForSingle - { - get - { - return LazyLoad(ref _EndForSingle, "@EndForSingle"); - } - } - private LazyLoad _PaginateOnFirstSubstep3X; - public bool PaginateOnFirstSubstep3X - { - get - { - return LazyLoad(ref _PaginateOnFirstSubstep3X, "@PaginateOnFirstSubstep3X"); - } - } - private LazyLoad _PaginateOnLowerStepLevel; - public bool PaginateOnLowerStepLevel - { - get - { - return LazyLoad(ref _PaginateOnLowerStepLevel, "@PaginateOnLowerStepLevel"); - } - } - private LazyLoad _CustomSpacing; - public bool CustomSpacing - { - get - { - return LazyLoad(ref _CustomSpacing, "@CustomSpacing"); - } - } - private LazyLoad _SplitStepInPrntStep; - public bool SplitStepInPrntStep - { - get - { - return LazyLoad(ref _SplitStepInPrntStep, "@SplitStepInPrntStep"); - } - } - private LazyLoad _LineAboveUnderSection; - public bool LineAboveUnderSection - { - get - { - return LazyLoad(ref _LineAboveUnderSection, "@LineAboveUnderSection"); - } - } - private LazyLoad _PicaIgnoreFiveSixths; - public bool PicaIgnoreFiveSixths - { - get - { - return LazyLoad(ref _PicaIgnoreFiveSixths, "@PicaIgnoreFiveSixths"); - } - } - private LazyLoad _SpaceForNoSecNumb; - public bool SpaceForNoSecNumb - { - get - { - return LazyLoad(ref _SpaceForNoSecNumb, "@SpaceForNoSecNumb"); - } - } - private LazyLoad _PageBreakOnFirstBlankLine; - public bool PageBreakOnFirstBlankLine - { - get - { - return LazyLoad(ref _PageBreakOnFirstBlankLine, "@PageBreakOnFirstBlankLine"); - } - } - private LazyLoad _PutOnPageByItself; - public bool PutOnPageByItself - { - get - { - return LazyLoad(ref _PutOnPageByItself, "@PutOnPageByItself"); - } - } - private LazyLoad _PaginateAtHighestPaginLevel; - public bool PaginateAtHighestPaginLevel - { - get - { - return LazyLoad(ref _PaginateAtHighestPaginLevel, "@PaginateAtHighestPaginLevel"); - } - } - private LazyLoad _UseSTExtraRealValue; - public bool UseSTExtraRealValue - { - get - { - return LazyLoad(ref _UseSTExtraRealValue, "@UseSTExtraRealValue"); - } - } - private LazyLoad _DoSectionSeparatorLine; - public bool DoSectionSeparatorLine - { - get - { - return LazyLoad(ref _DoSectionSeparatorLine, "@DoSectionSeparatorLine"); - } - } - private LazyLoad _TieTabToLevel; - public bool TieTabToLevel - { - get - { - return LazyLoad(ref _TieTabToLevel, "@TieTabToLevel"); - } - } - private LazyLoad _HighLevelRNOBeforeAERSubsteps; - public bool HighLevelRNOBeforeAERSubsteps - { - get - { - return LazyLoad(ref _HighLevelRNOBeforeAERSubsteps, "@HighLevelRNOBeforeAERSubsteps"); - } - } - private LazyLoad _UseStepTypeWidthOverride; - public bool UseStepTypeWidthOverride - { - get - { - return LazyLoad(ref _UseStepTypeWidthOverride, "@UseStepTypeWidthOverride"); - } - } - private LazyLoad _UseStepTypeWidthOverrideEditPrint; - public bool UseStepTypeWidthOverrideEditPrint - { - get - { - return LazyLoad(ref _UseStepTypeWidthOverrideEditPrint, "@UseStepTypeWidthOverrideEditPrint"); - } - } - private LazyLoad _PartialStepCompression; - public bool PartialStepCompression - { - get - { - return LazyLoad(ref _PartialStepCompression, "@PartialStepCompression"); - } - } - private LazyLoad _VirtualDotInHLSTab; - public bool VirtualDotInHLSTab - { - get - { - return LazyLoad(ref _VirtualDotInHLSTab, "@VirtualDotInHLSTab"); - } - } - private LazyLoad _OverrideEnhancedTabs; - public bool OverrideEnhancedTabs - { - get - { - return LazyLoad(ref _OverrideEnhancedTabs, "@OverrideEnhancedTabs"); - } - } - private LazyLoad _RNO; - public bool RNO - { - get - { - return LazyLoad(ref _RNO, "@RNO"); - } - } - private LazyLoad _OnlySingleColumn; - public bool OnlySingleColumn - { - get - { - return LazyLoad(ref _OnlySingleColumn, "@OnlySingleColumn"); - } - } - } - #endregion - #region TopOfPage - public class TopOfPage : vlnFormatItem - { - public TopOfPage(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _Row; - public int? Row - { - get - { - return LazyLoad(ref _Row, "@Row"); - } - } - private LazyLoad _Col; - public int? Col - { - get - { - return LazyLoad(ref _Col, "@Col"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null? _Font = new VE_Font(base.XmlNode): _Font); - } - } - } - #endregion - #region Separator - public class Separator : vlnFormatItem - { - public Separator(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _Location; - public int? Location - { - get - { - return LazyLoad(ref _Location, "@Location"); - //return LazyLoad(ref _SeparatorLocation, "@SeparatorLocation"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null ? _Font = new VE_Font(base.XmlNode) : _Font); - } - } - } - #endregion - #region StepSectionEditData - public class StepSectionEditData : vlnFormatItem - { - public StepSectionEditData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _ColSScreenAdj; - public int? ColSScreenAdj - { - get - { - return LazyLoad(ref _ColSScreenAdj, "@ColSScreenAdj"); - } - } - private LazyLoad _ScrnAdjRNOText; - public int? ScrnAdjRNOText - { - get - { - return LazyLoad(ref _ScrnAdjRNOText, "@ScrnAdjRNOText"); - } - } - private LazyLoad _ColRScreen; - public string ColRScreen - { - get - { - return LazyLoad(ref _ColRScreen, "@ColRScreen"); - } - } - } - #endregion - #region StepSectionPrintData - public class StepSectionPrintData : vlnFormatItem - { - public StepSectionPrintData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _ImmStepHdrCol; - public int? ImmStepHdrCol - { - get - { - return LazyLoad(ref _ImmStepHdrCol, "@ImmStepHdrCol"); - } - } - private LazyLoad _SecColHdrforActPMode; - public int? SecColHdrforActPMode - { - get - { - return LazyLoad(ref _SecColHdrforActPMode, "@SecColHdrforActPMode"); - } - } - private LazyLoad _RNOSepString; - public string RNOSepString - { - get - { - return LazyLoad(ref _RNOSepString, "@RNOSepString"); - } - } - private LazyLoad _HLStpSeparatorString; - public string HLStpSeparatorString - { - get - { - return LazyLoad(ref _HLStpSeparatorString, "@HLStpSeparatorString"); - } - } - private LazyLoad _HLRNOStpSeparatorString; - public string HLRNOStpSeparatorString - { - get - { - return LazyLoad(ref _HLRNOStpSeparatorString, "@HLRNOStpSeparatorString"); - } - } - private LazyLoad _LowerCaseRevNum; - public bool LowerCaseRevNum - { - get - { - return LazyLoad(ref _LowerCaseRevNum, "@LowerCaseRevNum"); - } - } - private LazyLoad _UseXtraRevNumber; - public bool UseXtraRevNumber - { - get - { - return LazyLoad(ref _UseXtraRevNumber, "@UseXtraRevNumber"); - } - } - private LazyLoad _SpecialLandscapeMode; - public bool SpecialLandscapeMode - { - get - { - return LazyLoad(ref _SpecialLandscapeMode, "@SpecialLandscapeMode"); - } - } - private VE_Font _ModifiedTextStyle; - public VE_Font ModifiedTextStyle - { - get - { - return (_ModifiedTextStyle == null)? _ModifiedTextStyle = new VE_Font(base.XmlNode):_ModifiedTextStyle; - } - } - private VE_Font _ImmStepHdrStyle; - public VE_Font ImmStepHdrStyle - { - get - { - return (_ImmStepHdrStyle == null)? _ImmStepHdrStyle = new VE_Font(base.XmlNode):_ImmStepHdrStyle; - } - } - private ImmStepHdrList _ImmStepHdrList; - public ImmStepHdrList ImmStepHdrList - { - get - { - return (_ImmStepHdrList == null)? _ImmStepHdrList = new ImmStepHdrList(SelectNodes("ImmStepHdrList/string")):_ImmStepHdrList; - } - set { _ImmStepHdrList = value; } - } - } - #region ImmStepHdr - [TypeConverter(typeof(ExpandableObjectConverter))] - public class ImmStepHdr : vlnFormatItem - { - public ImmStepHdr(XmlNode xmlNode) : base(xmlNode) { } - public ImmStepHdr() : base() { } - private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("ImmStepHdr '{0}'", Text); } - public override string GetPDCategory() - { return "Imm Step Hdr"; } - public override string ToString() - { - return Text; - } - } - #endregion - #region ImmStepHdrList - [TypeConverter(typeof(vlnListConverter))] - public class ImmStepHdrList : vlnFormatList - { - public ImmStepHdrList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } - } - #endregion - #endregion - #region SeqTabFmtAll - #region SeqTabFmt - [TypeConverter(typeof(ExpandableObjectConverter))] - public class SeqTabFmt : vlnFormatItem,IVlnIndexedFormatItem - { - public SeqTabFmt() : base() { } - private LazyLoad _Index; //not included - is it needed? - [Description("SeqTab Index")] - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private LazyLoad _LeftJustify; - public int? LeftJustify - { - get - { - return LazyLoad(ref _LeftJustify, "@LeftJustify"); - } - } - private LazyLoad _TabFormat; - public string TabFormat - { - get - { - return LazyLoad(ref _TabFormat, "@TabFormat"); - } - } - private LazyLoad _PrintTabFormat; - public string PrintTabFormat - { - get - { - return LazyLoad(ref _TabFormat, "@PrintTabFormat"); - } - } - public override string GetPDDisplayName() - { return string.Format("Index [{0}]",Index); } - public override string GetPDDescription() - { return string.Format("Sequential Tab Format Index '{0}' Format '{1}'", Index, TabFormat); } - public override string GetPDCategory() - { return "Sequential Tab Formatting"; } - public override string ToString() - { - return TabFormat; - } - } - #endregion - #region SeqTabFmtList - [TypeConverter(typeof(vlnIndexedListConverter))] - public class SeqTabFmtList : vlnIndexedFormatList - { - public SeqTabFmtList(XmlNodeList xmlNodeList,IFormatOrFormatInfo myFormat) : base(xmlNodeList,myFormat) { } - public override vlnIndexedFormatList InheritedList - { - get - { - IFormatOrFormatInfo parentFormat = MyFormat.MyIParent; - if (parentFormat != null) - return parentFormat.PlantFormat.FormatData.SectData.StepSectionData.SeqTabFmtList; - return null; - } - } - } - #endregion - #endregion - #endregion - #region AccSectionDataAll - #region AccSectionData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class AccSectionData : vlnFormatItem - { - public AccSectionData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _AutoContActSumSection; - public int? AutoContActSumSection - { - get - { - return LazyLoad(ref _AutoContActSumSection, "@AutoContActSumSection"); - } - } - private TableOfContentsData _TableOfContentsData; - public TableOfContentsData TableOfContentsData - { - get - { - return (_TableOfContentsData == null ? _TableOfContentsData = new TableOfContentsData(SelectSingleNode("TableOfContentsData")) : _TableOfContentsData); - } - } - } - #endregion - #region TableOfContentsData - public class TableOfContentsData : vlnFormatItem - { - public TableOfContentsData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _TofCSecNumPos; - public int? TofCSecNumPos - { - get - { - return LazyLoad(ref _TofCSecNumPos, "@TofCSecNumPos"); - } - } - private LazyLoad _TofCSecTitlePos; - public int? TofCSecTitlePos - { - get - { - return LazyLoad(ref _TofCSecTitlePos, "@TofCSecTitlePos"); - } - } - private LazyLoad _TofCSecTitleLen; - public int? TofCSecTitleLen - { - get - { - return LazyLoad(ref _TofCSecTitleLen, "@TofCSecTitleLen"); - } - } - private LazyLoad _TofCPageNumPos; - public int? TofCPageNumPos - { - get - { - return LazyLoad(ref _TofCPageNumPos, "@TofCPageNumPos"); - } - } - private LazyLoad _TofCSpaceChar; - public int? TofCSpaceChar - { - get - { - return LazyLoad(ref _TofCSpaceChar, "@TofCSpaceChar"); - } - } - private LazyLoad _TofCLineSpacing; - public int? TofCLineSpacing - { - get - { - return LazyLoad(ref _TofCLineSpacing, "@TofCLineSpacing"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null) ?_Font = new VE_Font(base.XmlNode):_Font; - } - } - } - #endregion - #endregion - #region MetaSectionAll - #region MetaSection - [TypeConverter(typeof(ExpandableObjectConverter))] - public class MetaSection : vlnFormatItem,IVlnIndexedFormatItem - { - public MetaSection(XmlNode xmlNode) : base(xmlNode) { } - public MetaSection() : base() { } - private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private LazyLoad _SecNumPositionAdj; - public int? SecNumPositionAdj - { - get - { - return LazyLoad(ref _SecNumPositionAdj, "@SecNumPositionAdj"); - } - } - private LazyLoad _SecTitlePositionAdj; - public int? SecTitlePositionAdj - { - get - { - return LazyLoad(ref _SecTitlePositionAdj, "@SecTitlePositionAdj"); - } - } - private LazyLoad _ColSByLevel; - public int? ColSByLevel - { - get - { - return LazyLoad(ref _ColSByLevel, "@ColSByLevel"); - } - } - private LazyLoad _TofCPositionAdj; - public int? TofCPositionAdj - { - get - { - return LazyLoad(ref _TofCPositionAdj, "@TofCPositionAdj"); - } - } - private LazyLoad _WidSAdjByLevel; - public int? WidSAdjByLevel - { - get - { - return LazyLoad(ref _WidSAdjByLevel, "@WidSAdjByLevel"); - } - } - public override string GetPDDisplayName() - { return string.Format("[{0}]", Index); } - public override string GetPDCategory() - { return "Meta Section Values"; } - public override string ToString() - { - return String.Format("{0}, {1}, {2}, {3}, {4}", SecNumPositionAdj, SecTitlePositionAdj, ColSByLevel, TofCPositionAdj, TofCPositionAdj); - } - } - - #endregion - #region MetaSectionList - [TypeConverter(typeof(vlnIndexedListConverter))] - public class MetaSectionList : vlnIndexedFormatList - { - public MetaSectionList(XmlNodeList xmlNodeList,IFormatOrFormatInfo myFormat) : base(xmlNodeList,myFormat) { } - public override vlnIndexedFormatList InheritedList - { - get - { - IFormatOrFormatInfo parentFormat = MyFormat.MyIParent; - if (parentFormat != null) - return parentFormat.PlantFormat.FormatData.SectData.MetaSectionList; - return null; - } - } - - - } - #endregion - #endregion - #endregion - #region StepDataAll - #region Step - [TypeConverter(typeof(ExpandableObjectConverter))] - public class StepData : vlnFormatItem,IVlnIndexedFormatItem - { - public StepData() : base() { } - private LazyLoad _Index; - [Description("Step Index")] - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private LazyLoad _Type; - public string Type - { - get - { - return LazyLoad(ref _Type, "@Type"); - } - } - private LazyLoad _ParentType; - public string ParentType - { - get - { - return LazyLoad(ref _ParentType, "@ParentType"); - } - } - private LazyLoad _Inactive; - public bool Inactive - { - get - { - return LazyLoad(ref _Inactive, "@Inactive"); - } - } - private LazyLoad _StepTypeColOverride; - public string StepTypeColOverride - { - get - { - - return LazyLoad(ref _StepTypeColOverride, "@StepTypeColOverride"); - } - } - private LazyLoad _Sep; - public string Sep - { - get - { - return LazyLoad(ref _Sep, "@Sep"); - } - } - private LazyLoad _Prefix; - public string Prefix - { - get - { - return LazyLoad(ref _Prefix, "@Prefix"); - } - } - private LazyLoad _Suffix; - public string Suffix - { - get - { - return LazyLoad(ref _Suffix, "@Suffix"); - } - } - private LazyLoad _UnderlineTheseChar; - public string UnderlineTheseChar - { - get - { - return LazyLoad(ref _UnderlineTheseChar, "@UnderlineTheseChar"); - } - } - private LazyLoad _VertPos; - public string VertPos - { - get - { - return LazyLoad(ref _VertPos, "@VertPos"); - } - } - private LazyLoad _DoubleSpace; - public bool DoubleSpace - { - get - { - return LazyLoad(ref _DoubleSpace, "@DoubleSpace"); - } - } - private LazyLoad _EnhancedStepNumFromPrev; - public bool EnhancedStepNumFromPrev - { - get - { - return LazyLoad(ref _EnhancedStepNumFromPrev, "@EnhancedStepNumFromPrev"); - } - } - private LazyLoad _UseSmartTemplate; - public bool UseSmartTemplate - { - get - { - return LazyLoad(ref _UseSmartTemplate, "@UseSmartTemplate"); - } - } - private LazyLoad _AlwaysUseExtraLines; - public bool AlwaysUseExtraLines - { - get - { - return LazyLoad(ref _AlwaysUseExtraLines, "@AlwaysUseExtraLines"); - } - } - private LazyLoad _SeparateBox; - public bool SeparateBox - { - get - { - return LazyLoad(ref _SeparateBox, "@SeparateBox"); - } - } - private LazyLoad _SeparateBoxCautions; - public bool SeparateBoxCautions - { - get - { - return LazyLoad(ref _SeparateBoxCautions, "@SeparateBoxCautions"); - } - } - private LazyLoad _SpaceDouble; - public bool SpaceDouble - { - get - { - return LazyLoad(ref _SpaceDouble, "@SpaceDouble"); - } - } - private LazyLoad _ReduceLineAfter; - public bool ReduceLineAfter - { - get - { - return LazyLoad(ref _ReduceLineAfter, "@ReduceLineAfter"); - } - } - private LazyLoad _SameLevel; - public bool SameLevel - { - get - { - return LazyLoad(ref _SameLevel, "@SameLevel"); - } - } - private LazyLoad _BoldHighLevel; - public bool BoldHighLevel - { - get - { - return LazyLoad(ref _BoldHighLevel, "@BoldHighLevel"); - } - } - private LazyLoad _OneLineBeforeTab; - public bool OneLineBeforeTab - { - get - { - return LazyLoad(ref _OneLineBeforeTab, "@OneLineBeforeTab"); - } - } - private LazyLoad _CheckOffOnAllSteps; - public bool CheckOffOnAllSteps - { - get - { - return LazyLoad(ref _CheckOffOnAllSteps, "@CheckOffOnAllSteps"); - } - } - private LazyLoad _BoxIt; - public bool BoxIt - { - get - { - return LazyLoad(ref _BoxIt, "@BoxIt"); - } - } - private LazyLoad _Boxed; - public bool Boxed - { - get - { - return LazyLoad(ref _Boxed, "@Boxed"); - } - } - private LazyLoad _XLines_StepFix; - public bool XLines_StepFix - { - get - { - return LazyLoad(ref _XLines_StepFix, "@XLines_StepFix"); - } - } - private LazyLoad _Rebox; - public bool Rebox - { - get - { - return LazyLoad(ref _Rebox, "@Rebox"); - } - } - private LazyLoad _SpcHdr; - public bool SpcHdr - { - get - { - return LazyLoad(ref _SpcHdr, "@SpcHdr"); - } - } - private LazyLoad _ContinueOnly; - public bool ContinueOnly - { - get - { - return LazyLoad(ref _ContinueOnly, "@ContinueOnly"); - } - } - private LazyLoad _SepAfterAER; - public bool SepAfterAER - { - get - { - return LazyLoad(ref _SepAfterAER, "@SepAfterAER"); - } - } - private LazyLoad _UseAlternateStepBox; - public bool UseAlternateStepBox - { - get - { - return LazyLoad(ref _UseAlternateStepBox, "@UseAlternateStepBox"); - } - } - private LazyLoad _UnderlineAfterDashSpace; - public bool UnderlineAfterDashSpace - { - get - { - return LazyLoad(ref _UnderlineAfterDashSpace, "@UnderlineAfterDashSpace"); - } - } - private LazyLoad _SpaceIn; - public bool SpaceIn - { - get - { - return LazyLoad(ref _SpaceIn, "@SpaceIn"); - } - } - private LazyLoad _PageBreakOnStep; - public bool PageBreakOnStep - { - get - { - return LazyLoad(ref _PageBreakOnStep, "@PageBreakOnStep"); - } - } - private LazyLoad _AlignNullTabWSectHead; - public bool AlignNullTabWSectHead - { - get - { - return LazyLoad(ref _AlignNullTabWSectHead, "@AlignNullTabWSectHead"); - } - } - private LazyLoad _TextSubFollowsTextStyle; - public bool TextSubFollowsTextStyle - { - get - { - return LazyLoad(ref _TextSubFollowsTextStyle, "@TextSubFollowsTextStyle"); - } - } - private LazyLoad _TreatAsSequential; - public bool TreatAsSequential - { - get - { - return LazyLoad(ref _TreatAsSequential, "@TreatAsSequential"); - } - } - private LazyLoad _MatchUpRNO; - public bool MatchUpRNO - { - get - { - return LazyLoad(ref _MatchUpRNO, "@MatchUpRNO"); - } - } - private LazyLoad _InPageList; - public bool InPageList - { - get - { - return LazyLoad(ref _InPageList, "@InPageList"); - } - } - private LazyLoad _CenterOneLineOnly; - public bool CenterOneLineOnly - { - get - { - return LazyLoad(ref _CenterOneLineOnly, "@CenterOneLineOnly"); - } - } - private LazyLoad _SubTableGetsUp1Level; - public bool SubTableGetsUp1Level - { - get - { - return LazyLoad(ref _SubTableGetsUp1Level, "@SubTableGetsUp1Level"); - } - } - private LazyLoad _Remember; - public bool Remember - { - get - { - return LazyLoad(ref _Remember, "@Remember"); - } - } - private LazyLoad _CenterOneLineAdjust; - public bool CenterOneLineAdjust - { - get - { - return LazyLoad(ref _CenterOneLineAdjust, "@CenterOneLineAdjust"); - } - } - private LazyLoad _Break; - public bool Break - { - get - { - return LazyLoad(ref _Break, "@Break"); - } - } - private LazyLoad _BreakEquipmentList; - public bool BreakEquipmentList - { - get - { - return LazyLoad(ref _BreakEquipmentList, "@BreakEquipmentList"); - } - } - private LazyLoad _BreakCautionsNotesOnSubstps; - public bool BreakCautionsNotesOnSubstps - { - get - { - return LazyLoad(ref _BreakCautionsNotesOnSubstps, "@BreakCautionsNotesOnSubstps"); - } - } - private LazyLoad _CenterTextWithinWidth; - public bool CenterTextWithinWidth - { - get - { - return LazyLoad(ref _CenterTextWithinWidth, "@CenterTextWithinWidth"); - } - } - private LazyLoad _NewlineAfter; - public bool NewlineAfter - { - get - { - return LazyLoad(ref _NewlineAfter, "@NewlineAfter"); - } - } - private LazyLoad _StartLineWithDash; - public bool StartLineWithDash - { - get - { - return LazyLoad(ref _StartLineWithDash, "@StartLineWithDash"); - } - } - private LazyLoad _BlankLineBeforeSubStep; - public bool BlankLineBeforeSubStep - { - get - { - return LazyLoad(ref _BlankLineBeforeSubStep, "@BlankLineBeforeSubStep"); - } - } - private LazyLoad _AlwaysTab; - public bool AlwaysTab - { - get - { - return LazyLoad(ref _AlwaysTab, "@AlwaysTab"); - } - } - private LazyLoad _MixCautionsAndNotes; - public bool MixCautionsAndNotes - { - get - { - return LazyLoad(ref _MixCautionsAndNotes, "@MixCautionsAndNotes"); - } - } - private LazyLoad _NumberHighLevel; - public bool NumberHighLevel - { - get - { - return LazyLoad(ref _NumberHighLevel, "@NumberHighLevel"); - } - } - private LazyLoad _OffsetTab; - public bool OffsetTab - { - get - { - return LazyLoad(ref _OffsetTab, "@OffsetTab"); - } - } - private LazyLoad _LeftJustifyBorderless; - public bool LeftJustifyBorderless - { - get - { - return LazyLoad(ref _LeftJustifyBorderless, "@LeftJustifyBorderless"); - } - } - private LazyLoad _StepNumIfOnlyOne; - public bool StepNumIfOnlyOne - { - get - { - return LazyLoad(ref _StepNumIfOnlyOne, "@StepNumIfOnlyOne"); - } - } - private LazyLoad _LJTabs; - public bool LJTabs - { - get - { - return LazyLoad(ref _LJTabs, "@LJTabs"); - } - } - private LazyLoad _NumberSubs; - public bool NumberSubs - { - get - { - return LazyLoad(ref _NumberSubs, "@NumberSubs"); - } - } - private LazyLoad _Bullet; - public bool Bullet - { - get - { - return LazyLoad(ref _Bullet, "@Bullet"); - } - } - private LazyLoad _StepNumberForHighLevel; - public bool StepNumberForHighLevel - { - get - { - return LazyLoad(ref _StepNumberForHighLevel, "@StepNumberForHighLevel"); - } - } - private LazyLoad _SameRowAsParent; - public bool SameRowAsParent - { - get - { - return LazyLoad(ref _SameRowAsParent, "@SameRowAsParent"); - } - } - private LazyLoad _CheckOffSameAsParent; - public bool CheckOffSameAsParent - { - get - { - return LazyLoad(ref _CheckOffSameAsParent, "@CheckOffSameAsParent"); - } - } - private LazyLoad _AtLeastTwoDigits; - public bool AtLeastTwoDigits - { - get - { - return LazyLoad(ref _AtLeastTwoDigits, "@AtLeastTwoDigits"); - } - } - private LazyLoad _UseInAcTable; - public bool UseInAcTable - { - get - { - return LazyLoad(ref _UseInAcTable, "@UseInAcTable"); - } - } - private LazyLoad _Number; - public bool Number - { - get - { - return LazyLoad(ref _Number, "@Number"); - } - } - private LazyLoad _ThreeBlanksAbove; - public bool ThreeBlanksAbove - { - get - { - return LazyLoad(ref _ThreeBlanksAbove, "@ThreeBlanksAbove"); - } - } - private LazyLoad _CheckOffs; - public bool CheckOffs - { - get - { - return LazyLoad(ref _CheckOffs, "@CheckOffs"); - } - } - private LazyLoad _Quoted; - public bool Quoted - { - get - { - return LazyLoad(ref _Quoted, "@Quoted"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null) ?_Font = new VE_Font(base.XmlNode): _Font; - } - } - private StepLayoutData _StepLayoutData; - public StepLayoutData StepLayoutData - { - get - { - return (_StepLayoutData == null)? _StepLayoutData = new StepLayoutData(base.XmlNode): _StepLayoutData; - } - } - private StepEditData _StepEditData; - public StepEditData StepEditData - { - get - { - return (_StepEditData == null) ? _StepEditData = new StepEditData(base.XmlNode) : _StepEditData; - } - } - private TabData _TabData; - public TabData TabData - { - get - { - return (_TabData == null) ? _TabData = new TabData(base.XmlNode) : _TabData; - } - } - public override string ToString() - { - return string.Format("{0:00} - {1}", Index, Type); - } - } - #endregion - #region StepDataList - [TypeConverter(typeof(vlnIndexedListConverter))] - public class StepDataList : vlnIndexedFormatList - { - //public new StepData this[int index] - //{ - // get - // { - // foreach (StepData stepData in this) - // if (stepData.Index == index) return stepData; - // return null; - // } - //} - public override vlnIndexedFormatList InheritedList - { - get - { - IFormatOrFormatInfo parentFormat = MyFormat.MyIParent; - if (parentFormat != null) - return parentFormat.PlantFormat.FormatData.StepDataList; - return null; - } - } - public StepData this[string type] - { - get - { - foreach (StepData stepData in this) - if (stepData.Type == type) return stepData; - return null; - } - } - public StepDataList(XmlNodeList xmlNodeList,IFormatOrFormatInfo myFormat) : base(xmlNodeList,myFormat) { } - private StepData _HLS; - public StepData HLS - { - get - { - if (_HLS!=null) return _HLS; - foreach (StepData sd in this) - { - if (sd.Type == "High") - { - _HLS = sd; - return sd; - } - } - return null; - } - } - private StepData _Caution; - public StepData Caution - { - get - { - if (_Caution != null) return _Caution; - foreach (StepData sd in this) - { - if (sd.Type == "Caution") - { - _Caution = sd; - return sd; - } - } - return null; - } - } - private StepData _Note; - public StepData Note - { - get - { - if (_Note != null) return _Note; - foreach (StepData sd in this) - { - if (sd.Type == "Note") - { - _Note = sd; - return sd; - } - } - return null; - } - } - private StepData _RNO; - public StepData RNO - { - get - { - if (_RNO != null) return _RNO; - foreach (StepData sd in this) - { - if (sd.Type == "RNOType") - { - _RNO = sd; - return sd; - } - } - return null; - } - } - private StepData _Fig; - public StepData Fig - { - get - { - if (_Fig != null) return _Fig; - foreach (StepData sd in this) - { - if (sd.Type == "Figure") - { - _Fig = sd; - return sd; - } - } - return null; - } - } - private StepData _Table; - public StepData Table - { - get - { - if (_Table != null) return _Table; - foreach (StepData sd in this) - { - if (sd.Type == "Table") - { - _Table = sd; - return sd; - } - } - return null; - } - } - private StepData _Substep; - public StepData Substep - { - get - { - if (_Substep != null) return _Substep; - foreach (StepData sd in this) - { - if (sd.Type == "Substep") - { - _Substep = sd; - return sd; - } - } - return null; - } - } - } - #endregion - #region StepLayoutData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class StepLayoutData : vlnFormatItem - { - public StepLayoutData(XmlNode xmlNode) - : base(xmlNode) - { - } - private LazyLoad _ForeColor; - public string ForeColor - { - get - { - return LazyLoad(ref _ForeColor, "StepLayoutData/@ForeColor"); - } - } - private LazyLoad _BackColor; - public string BackColor - { - get - { - return LazyLoad(ref _BackColor, "StepLayoutData/@BackColor"); - } - } - //private LazyLoad _STExtralines; Replaced with STExtraSpace - //public int? STExtralines - //{ - // get - // { - // return LazyLoad(ref _STExtralines, "StepLayoutData/@STExtralines"); - // } - //} - private LazyLoad _STExtraSpace; - public int? STExtraSpace - { - get - { - return LazyLoad(ref _STExtraSpace, "StepLayoutData/@STExtraSpace"); - } - } - private LazyLoad _STBoxindex; - public int? STBoxindex - { - get - { - return LazyLoad(ref _STBoxindex, "StepLayoutData/@STBoxindex"); - } - } - private LazyLoad _EveryNLines; - public int? EveryNLines - { - get - { - return LazyLoad(ref _EveryNLines, "StepLayoutData/@EveryNLines"); - } - } - } - #endregion - #region StepEditData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class StepEditData : vlnFormatItem - { - public StepEditData(XmlNode xmlNode) - : base(xmlNode) - { - } - private TypeMenu _TypeMenu; - public TypeMenu TypeMenu - { - get - { - return (_TypeMenu == null) ? _TypeMenu = new TypeMenu(base.XmlNode) : _TypeMenu; - } - } - private LazyLoad _ForeColor; - public string ForeColor - { - get - { - return LazyLoad(ref _ForeColor, "StepEditData/@ForeColor"); - } - } - private LazyLoad _BackColor; - public string BackColor - { - get - { - return LazyLoad(ref _BackColor, "StepEditData/@BackColor"); - } - } - private LazyLoad _AcTable; - public E_AccStep? AcTable - { - get - { - return LazyLoad(ref _AcTable, "StepEditData/@AcTable"); - } - } - private LazyLoad _Searchable; - public bool Searchable - { - get - { - return LazyLoad(ref _Searchable, "StepEditData/@Searchable"); - } - } - } - #endregion - #region TypeMenu - [TypeConverter(typeof(ExpandableObjectConverter))] - public class TypeMenu : vlnFormatItem - { - public TypeMenu(XmlNode xmlNode) - : base(xmlNode) - { - } - private LazyLoad _InMenu; - public bool InMenu - { - get - { - return LazyLoad(ref _InMenu, "StepEditData/TypeMenu/@InMenu"); - } - } - private LazyLoad _RnoInMenu; - public bool RnoInMenu - { - get - { - return LazyLoad(ref _RnoInMenu, "StepEditData/TypeMenu/@RnoInMenu"); - } - } - private LazyLoad _MenuItem; - public string MenuItem - { - get - { - return LazyLoad(ref _MenuItem, "StepEditData/TypeMenu/@MenuItem"); - } - } - private LazyLoad _RnoMenuItem; - public string RnoMenuItem - { - get - { - return LazyLoad(ref _RnoMenuItem, "StepEditData/TypeMenu/@RnoMenuItem"); - } - } - private LazyLoad _NoChgReason; - public string NoChgReason - { - get - { - return LazyLoad(ref _NoChgReason, "StepEditData/TypeMenu/@NoChgReason"); - } - } - private LazyLoad _AlternateNameList; - public string AlternateNameList - { - get - { - return LazyLoad(ref _AlternateNameList, "StepEditData/TypeMenu/@AlternateNameList"); - } - } - } - #endregion - #region StepTab - [TypeConverter(typeof(ExpandableObjectConverter))] - public class TabData : vlnFormatItem - { - public TabData(XmlNode xmlNode) - : base(xmlNode) - { - } - private LazyLoad _IdentEdit; - public string IdentEdit - { - get - { - return LazyLoad(ref _IdentEdit, "TabData/@IdentEdit"); - } - } - private LazyLoad _IdentPrint; - public string IdentPrint - { - get - { - return LazyLoad(ref _IdentPrint, "TabData/@Ident"); - } - } - private LazyLoad _IdentAltPrint; - public string IdentAltPrint - { - get - { - return LazyLoad(ref _IdentAltPrint, "TabData/@IdentAltPrint"); - } - } - private LazyLoad _RNOIdentEdit; - public string RNOIdentEdit - { - get - { - return LazyLoad(ref _RNOIdentEdit, "TabData/@RNOIdentEdit"); - } - } - private LazyLoad _RNOIdentPrint; - public string RNOIdentPrint - { - get - { - return LazyLoad(ref _RNOIdentPrint, "TabData/@RNOIdent"); - } - } - private LazyLoad _Justify; - public string Justify - { - get - { - return LazyLoad(ref _Justify, "TabData/@Justify"); - } - } - private LazyLoad _CheckOff; - public string CheckOff - { - get - { - return LazyLoad(ref _CheckOff, "TabData/@CheckOff"); - } - } - private LazyLoad _UsePreviousStyle; - public bool UsePreviousStyle - { - get - { - return LazyLoad(ref _UsePreviousStyle, "TabData/@UsePreviousStyle"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - XmlNode xn = vlnFormatDocument.LookupSingleStepNode(base.XmlNode, "TabData[Font]"); - return (_Font == null ? _Font = new VE_Font(xn) : _Font); - } - } - } - #endregion - #endregion - #region BoxDataAll - #region Box - [TypeConverter(typeof(ExpandableObjectConverter))] - public class Box : vlnFormatItem,IVlnIndexedFormatItem - { - public Box(XmlNode xmlNode) : base(xmlNode) { } - public Box() : base() { } - private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private LazyLoad _Start; - public int? Start - { - get - { - return LazyLoad(ref _Start, "@Start"); - } - } - private LazyLoad _End; - public int? End - { - get - { - return LazyLoad(ref _End, "@End"); - } - } - private LazyLoad _TxtStart; - public int? TxtStart - { - get - { - return LazyLoad(ref _TxtStart, "@TxtStart"); - } - } - private LazyLoad _TxtWidth; - public int? TxtWidth - { - get - { - return LazyLoad(ref _TxtWidth, "@TxtWidth"); - } - } - private LazyLoad _Height; - public int? Height - { - get - { - return LazyLoad(ref _Height, "@Height"); - } - } - private LazyLoad _TabPos; - public int? TabPos - { - get - { - return LazyLoad(ref _TabPos, "@TabPos"); - } - } - private LazyLoad _TxtRowAdj; - public int? TxtRowAdj - { - get - { - return LazyLoad(ref _TxtRowAdj, "@TxtRowAdj"); - } - } - private LazyLoad _BXURC; - public string BXURC - { - get - { - return LazyLoad(ref _BXURC, "@BXURC"); - } - } - private LazyLoad _BXHorz; - public string BXHorz - { - get - { - return LazyLoad(ref _BXHorz, "@BXHorz"); - } - } - private LazyLoad _BXULC; - public string BXULC - { - get - { - return LazyLoad(ref _BXULC, "@BXULC"); - } - } - private LazyLoad _BXVert; - public string BXVert - { - get - { - return LazyLoad(ref _BXVert, "@BXVert"); - } - } - private LazyLoad _BXMLS; - public string BXMLS - { - get - { - return LazyLoad(ref _BXMLS, "@BXMLS"); - } - } - private LazyLoad _BXMRS; - public string BXMRS - { - get - { - return LazyLoad(ref _BXMRS, "@BXMRS"); - } - } - private LazyLoad _BXLRC; - public string BXLRC - { - get - { - return LazyLoad(ref _BXLRC, "@BXLRC"); - } - } - private LazyLoad _BXLLC; - public string BXLLC - { - get - { - return LazyLoad(ref _BXLLC, "@BXLLC"); - } - } - private LazyLoad _BXMID; - public string BXMID - { - get - { - return LazyLoad(ref _BXMID, "@BXMID"); - } - } - private LazyLoad _BXLHorz; - public string BXLHorz - { - get - { - return LazyLoad(ref _BXLHorz, "@BXLHorz"); - } - } - private LazyLoad _BXUMID; - public string BXUMID - { - get - { - return LazyLoad(ref _BXUMID, "@BXUMID"); - } - } - private LazyLoad _BXLMID; - public string BXLMID - { - get - { - return LazyLoad(ref _BXLMID, "@BXLMID"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null) ?_Font = new VE_Font(base.XmlNode):_Font; - } - } - public override string GetPDDisplayName() - { return string.Format("[{0}]", Index); } - public override string GetPDCategory() - { return "Box Definition"; } - public override string ToString() - { - return String.Format("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}", - BXURC, BXHorz, BXULC, BXVert, BXMLS, BXMRS, BXLRC, BXLLC, BXMID, BXLHorz, BXUMID, BXLMID); - } - } - #endregion - #region BoxList - [TypeConverter(typeof(vlnIndexedListConverter))] - public class BoxList : vlnIndexedFormatList - { - public BoxList(XmlNodeList xmlNodeList, IFormatOrFormatInfo myFormat) : base(xmlNodeList, myFormat) { } - public override vlnIndexedFormatList InheritedList - { - get - { - IFormatOrFormatInfo parentFormat = MyFormat.MyIParent; - if (parentFormat != null) - return parentFormat.PlantFormat.FormatData.BoxList; - return null; - } - } - - } - #endregion - #endregion - #region TransDataAll - #region TransData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class TransData : vlnFormatItem - { - private TransTypeList _TransTypeList; - public TransTypeList TransTypeList - { - get - { - return(_TransTypeList == null || _TransTypeList.Count==0)? _TransTypeList = new TransTypeList(SelectNodes("TransTypeData/TransTypes"),MyFormat): _TransTypeList; - } - } - public TransData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _DelimiterForTransitionTitle; - public string DelimiterForTransitionTitle - { - get - { - return LazyLoad(ref _DelimiterForTransitionTitle, "@DelimiterForTransitionTitle"); - } - } - private LazyLoad _StepSubstepDelimeter; - public string StepSubstepDelimeter - { - get - { - return LazyLoad(ref _StepSubstepDelimeter, "@StepSubstepDelimeter"); - } - } - private LazyLoad _ThroughString; - public string ThroughString - { - get - { - return LazyLoad(ref _ThroughString, "@ThroughString"); - } - } - private LazyLoad _SpecifiedSubstepsOnly; - public bool SpecifiedSubstepsOnly - { - get - { - return LazyLoad(ref _SpecifiedSubstepsOnly, "@SpecifiedSubstepsOnly"); - } - } - private LazyLoad _CapsTransitions; - public bool CapsTransitions - { - get - { - return LazyLoad(ref _CapsTransitions, "@CapsTransitions"); - } - } - private LazyLoad _CapTranStep; - public bool CapTranStep - { - get - { - return LazyLoad(ref _CapTranStep, "@CapTranStep"); - } - } - private LazyLoad _TStepNoFlag; - public bool TStepNoFlag - { - get - { - return LazyLoad(ref _TStepNoFlag, "@TStepNoFlag"); - } - } - private LazyLoad _LowerCaseTranNumber; - public bool LowerCaseTranNumber - { - get - { - return LazyLoad(ref _LowerCaseTranNumber, "@LowerCaseTranNumber"); - } - } - private LazyLoad _UpcaseTranAnd; - public bool UpcaseTranAnd - { - get - { - return LazyLoad(ref _UpcaseTranAnd, "@UpcaseTranAnd"); - } - } - private LazyLoad _SuppressAndInTran; - public bool SuppressAndInTran - { - get - { - return LazyLoad(ref _SuppressAndInTran, "@SuppressAndInTran"); - } - } - private LazyLoad _Cap1stCharTrans; - public bool Cap1stCharTrans - { - get - { - return LazyLoad(ref _Cap1stCharTrans, "@Cap1stCharTrans"); - } - } - private LazyLoad _UseTransitionModifier; - public bool UseTransitionModifier - { - get - { - return LazyLoad(ref _UseTransitionModifier, "@UseTransitionModifier"); - } - } - private LazyLoad _UseSecTitles; - public bool UseSecTitles - { - get - { - return LazyLoad(ref _UseSecTitles, "@UseSecTitles"); - } - } - private LazyLoad _HardSpTranProcNumb; - public bool HardSpTranProcNumb - { - get - { - return LazyLoad(ref _HardSpTranProcNumb, "@HardSpTranProcNumb"); - } - } - private LazyLoad _XchngTranSpForHard; - public bool XchngTranSpForHard - { - get - { - return LazyLoad(ref _XchngTranSpForHard, "@XchngTranSpForHard"); - } - } - private LazyLoad _AbsoluteTransitionUpdate; - public bool AbsoluteTransitionUpdate - { - get - { - return LazyLoad(ref _AbsoluteTransitionUpdate, "@AbsoluteTransitionUpdate"); - } - } - private LazyLoad _LowerCaseStepInTran; - public bool LowerCaseStepInTran - { - get - { - return LazyLoad(ref _LowerCaseStepInTran, "@LowerCaseStepInTran"); - } - } - } - #endregion - #region TransType - [TypeConverter(typeof(ExpandableObjectConverter))] - public class TransType : vlnFormatItem,IVlnIndexedFormatItem - { - public TransType(XmlNode xmlNode) : base(xmlNode) { } - public TransType() : base() { } - private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private LazyLoad _Type; - public int? Type - { - get - { - return LazyLoad(ref _Type, "@TransType"); - } - } - private LazyLoad _TransFormat; - public string TransFormat - { - get - { - return LazyLoad(ref _TransFormat, "@TransFormat"); - } - } - private LazyLoad _TransUI; - public E_TransUI? TransUI - { - get - { - return LazyLoad(ref _TransUI, "@TransUI"); - } - } - private LazyLoad _TransMenu; - public string TransMenu - { - get - { - return LazyLoad(ref _TransMenu, "@TransMenu"); - } - } - public override string GetPDDisplayName() - { return string.Format("[{0}] - Type {1}", Index, Type); } - public override string GetPDCategory() - { return "Transition Type Data"; } - public override string ToString() - { - return string.Format("{0} - {1}",TransFormat, TransMenu); - } - } - #endregion - #region TransTypeList - [TypeConverter(typeof(vlnIndexedListConverter))] - public class TransTypeList : vlnIndexedFormatList - { - public TransTypeList(XmlNodeList xmlNodeList, IFormatOrFormatInfo myFormat) : base(xmlNodeList,myFormat) { } - public override vlnIndexedFormatList InheritedList - { - get - { - IFormatOrFormatInfo parentFormat = MyFormat.MyIParent; - if (parentFormat != null) - return parentFormat.PlantFormat.FormatData.TransData.TransTypeList; - return null; - } - } - } - #endregion - #region RoData - [TypeConverter(typeof(ExpandableObjectConverter))] - public class RoData : vlnFormatItem - { - public RoData(XmlNode xmlNode) : base(xmlNode) { } - private LazyLoad _AllUnits; - public bool AllUnits - { - get - { - return LazyLoad(ref _AllUnits, "@AllUnits"); - } - } - private LazyLoad _UpRoAftrDash; - public bool UpRoAftrDash - { - get - { - return LazyLoad(ref _UpRoAftrDash, "@UpRoAftrDash"); - } - } - private LazyLoad _UpcaseAllRoUnits; - public bool UpcaseAllRoUnits - { - get - { - return LazyLoad(ref _UpcaseAllRoUnits, "@UpcaseAllRoUnits"); - } - } - private LazyLoad _CapHighRo; - public bool CapHighRo - { - get - { - return LazyLoad(ref _CapHighRo, "@CapHighRo"); - } - } - private LazyLoad _CapRoIfLastLower; - public bool CapRoIfLastLower - { - get - { - return LazyLoad(ref _CapRoIfLastLower, "@CapRoIfLastLower"); - } - } - private LazyLoad _UpRoIfPrevUpper; - public bool UpRoIfPrevUpper - { - get - { - return LazyLoad(ref _UpRoIfPrevUpper, "@UpRoIfPrevUpper"); - } - } - private LazyLoad _UnderlineRo; - public bool UnderlineRo - { - get - { - return LazyLoad(ref _UnderlineRo, "@UnderlineRo"); - } - } - } - #endregion - #endregion - #region SupportClasses - public class StepDataRetval - { - private string _Name; - public string Name - { - get { return _Name; } - set { _Name = value; } - } - private int _Index; - public int Index - { - get { return _Index; } - set { _Index = value; } - } - public StepDataRetval(string name, int index) - { - Name = name; - Index = index; - } - } - #endregion -} - diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of AnnotationAudit.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Copy of AnnotationAudit.cs deleted file mode 100644 index fe11cf1e..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of AnnotationAudit.cs +++ /dev/null @@ -1,1071 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// AnnotationAudit Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(AnnotationAuditConverter))] - public partial class AnnotationAudit : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshAnnotationAudits = new List(); - private void AddToRefreshList(List refreshAnnotationAudits) - { - if (IsDirty) - refreshAnnotationAudits.Add(this); - } - private void BuildRefreshList() - { - _RefreshAnnotationAudits = new List(); - AddToRefreshList(_RefreshAnnotationAudits); - } - private void ProcessRefreshList() - { - foreach (AnnotationAudit tmp in _RefreshAnnotationAudits) - { - AnnotationAuditInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(AnnotationAudit annotationAudit) - { - if (!_CacheList.Contains(annotationAudit)) _CacheList.Add(annotationAudit); // In AddToCache - } - protected static void RemoveFromCache(AnnotationAudit annotationAudit) - { - while (_CacheList.Contains(annotationAudit)) _CacheList.Remove(annotationAudit); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - while (_CacheList.Count > 0) // Move AnnotationAudit(s) from temporary _CacheList to _CacheByPrimaryKey - { - AnnotationAudit tmp = _CacheList[0]; // Get the first AnnotationAudit - string pKey = tmp.AuditID.ToString(); - if (!_CacheByPrimaryKey.ContainsKey(pKey)) - { - _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list - _CacheList.RemoveAt(0); // Remove the first AnnotationAudit - } - } - protected static AnnotationAudit GetCachedByPrimaryKey(long auditID) - { - ConvertListToDictionary(); - string key = auditID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextAuditID = -1; - public static int NextAuditID - { - get { return _nextAuditID--; } - } - private long _AuditID; - [System.ComponentModel.DataObjectField(true, true)] - public long AuditID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AuditID; - } - } - private int _AnnotationID; - public int AnnotationID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AnnotationID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_AnnotationID != value) - { - _AnnotationID = value; - PropertyHasChanged(); - } - } - } - private int _ItemID; - public int ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_ItemID != value) - { - _ItemID = value; - PropertyHasChanged(); - } - } - } - private int _TypeID; - public int TypeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _TypeID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_TypeID != value) - { - _TypeID = value; - PropertyHasChanged(); - } - } - } - private string _RtfText = string.Empty; - public string RtfText - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RtfText; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_RtfText != value) - { - _RtfText = value; - PropertyHasChanged(); - } - } - } - private string _SearchText = string.Empty; - public string SearchText - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _SearchText; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_SearchText != value) - { - _SearchText = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private int _DeleteStatus; - public int DeleteStatus - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DeleteStatus; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DeleteStatus != value) - { - _DeleteStatus = value; - PropertyHasChanged(); - } - } - } - public override bool IsDirty - { - get { return base.IsDirty; } - } - public bool IsDirtyList(List list) - { - return base.IsDirty; - } - public override bool IsValid - { - get { return (IsNew && !IsDirty) ? true : base.IsValid; } - } - public bool IsValidList(List list) - { - return (IsNew && !IsDirty) ? true : base.IsValid; - } - // CSLATODO: Replace base AnnotationAudit.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current AnnotationAudit - //public override string ToString() - //{ - // return base.ToString(); - //} - // CSLATODO: Check AnnotationAudit.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current AnnotationAudit - protected override object GetIdValue() - { - return MyAnnotationAuditUnique; // Absolutely Unique ID - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("RtfText", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("SearchText", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 200)); - //ValidationRules.AddDependantProperty("x", "y"); - _AnnotationAuditExtension.AddValidationRules(ValidationRules); - // CSLATODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _AnnotationAuditExtension.AddInstanceValidationRules(ValidationRules); - // CSLATODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //CSLATODO: Who can read/write which fields - //AuthorizationRules.AllowRead(AuditID, ""); - //AuthorizationRules.AllowRead(AnnotationID, ""); - //AuthorizationRules.AllowRead(ItemID, ""); - //AuthorizationRules.AllowRead(TypeID, ""); - //AuthorizationRules.AllowRead(RtfText, ""); - //AuthorizationRules.AllowRead(SearchText, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowRead(DeleteStatus, ""); - //AuthorizationRules.AllowWrite(AnnotationID, ""); - //AuthorizationRules.AllowWrite(ItemID, ""); - //AuthorizationRules.AllowWrite(TypeID, ""); - //AuthorizationRules.AllowWrite(RtfText, ""); - //AuthorizationRules.AllowWrite(SearchText, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - //AuthorizationRules.AllowWrite(DeleteStatus, ""); - _AnnotationAuditExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //CSLATODO: Who can read/write which fields - _AnnotationAuditExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // CSLATODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // CSLATODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // CSLATODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // CSLATODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _AnnotationAuditUnique = 0; - protected static int AnnotationAuditUnique - { get { return ++_AnnotationAuditUnique; } } - private int _MyAnnotationAuditUnique = AnnotationAuditUnique; - public int MyAnnotationAuditUnique // Absolutely Unique ID - Editable - { get { return _MyAnnotationAuditUnique; } } - protected AnnotationAudit() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) - { - List listAnnotationAudit = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items - while (listAnnotationAudit.Contains(this)) listAnnotationAudit.Remove(this); // Remove the item from the list - if (listAnnotationAudit.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list - } - } - public static AnnotationAudit New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a AnnotationAudit"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationAudit.New", ex); - } - } - public static AnnotationAudit New(int annotationID, int itemID, int typeID, DateTime dts, string userID, int deleteStatus) - { - AnnotationAudit tmp = AnnotationAudit.New(); - tmp.AnnotationID = annotationID; - tmp.ItemID = itemID; - tmp.TypeID = typeID; - tmp.DTS = dts; - tmp.UserID = userID; - tmp.DeleteStatus = deleteStatus; - return tmp; - } - public static AnnotationAudit New(int annotationID, int itemID, int typeID, string rtfText, string searchText, string config, DateTime dts, string userID, int deleteStatus) - { - AnnotationAudit tmp = AnnotationAudit.New(); - tmp.AnnotationID = annotationID; - tmp.ItemID = itemID; - tmp.TypeID = typeID; - tmp.RtfText = rtfText; - tmp.SearchText = searchText; - tmp.Config = config; - tmp.DTS = dts; - tmp.UserID = userID; - tmp.DeleteStatus = deleteStatus; - return tmp; - } - public static AnnotationAudit MakeAnnotationAudit(int annotationID, int itemID, int typeID, string rtfText, string searchText, string config, DateTime dts, string userID, int deleteStatus) - { - AnnotationAudit tmp = AnnotationAudit.New(annotationID, itemID, typeID, rtfText, searchText, config, dts, userID, deleteStatus); - if (tmp.IsSavable) - { - AnnotationAudit tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static AnnotationAudit Get(long auditID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a AnnotationAudit"); - try - { - AnnotationAudit tmp = GetCachedByPrimaryKey(auditID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(auditID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up AnnotationAudit - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationAudit.Get", ex); - } - } - public static AnnotationAudit Get(SafeDataReader dr) - { - if (dr.Read()) return new AnnotationAudit(dr); - return null; - } - internal AnnotationAudit(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(long auditID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a AnnotationAudit"); - try - { - DataPortal.Delete(new PKCriteria(auditID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationAudit.Delete", ex); - } - } - public override AnnotationAudit Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a AnnotationAudit"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a AnnotationAudit"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a AnnotationAudit"); - try - { - BuildRefreshList(); - AnnotationAudit annotationAudit = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(annotationAudit);//Refresh the item in AllList - ProcessRefreshList(); - return annotationAudit; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private long _AuditID; - public long AuditID - { get { return _AuditID; } } - public PKCriteria(long auditID) - { - _AuditID = auditID; - } - } - // CSLATODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _AuditID = NextAuditID; - // Database Defaults - - // CSLATODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAudit.ReadData", GetHashCode()); - try - { - _AuditID = dr.GetInt64("AuditID"); - _AnnotationID = dr.GetInt32("AnnotationID"); - _ItemID = dr.GetInt32("ItemID"); - _TypeID = dr.GetInt32("TypeID"); - _RtfText = dr.GetString("RtfText"); - _SearchText = dr.GetString("SearchText"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _DeleteStatus = dr.GetInt32("DeleteStatus"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAudit.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationAudit.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAudit.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationAudit"; - cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAudit.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationAudit.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAudit.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationAudit.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAudit.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addAnnotationAudit"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@AnnotationID", _AnnotationID); - cm.Parameters.AddWithValue("@ItemID", _ItemID); - cm.Parameters.AddWithValue("@TypeID", _TypeID); - cm.Parameters.AddWithValue("@RtfText", _RtfText); - cm.Parameters.AddWithValue("@SearchText", _SearchText); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@DeleteStatus", _DeleteStatus); - // Output Calculated Columns - SqlParameter param_AuditID = new SqlParameter("@newAuditID", SqlDbType.BigInt); - param_AuditID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_AuditID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _AuditID = (long)cm.Parameters["@newAuditID"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAudit.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAudit.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationAudit.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Add(SqlConnection cn, ref long auditID, int annotationID, int itemID, int typeID, string rtfText, string searchText, string config, DateTime dts, string userID, int deleteStatus) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAudit.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addAnnotationAudit"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@AnnotationID", annotationID); - cm.Parameters.AddWithValue("@ItemID", itemID); - cm.Parameters.AddWithValue("@TypeID", typeID); - cm.Parameters.AddWithValue("@RtfText", rtfText); - cm.Parameters.AddWithValue("@SearchText", searchText); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@DeleteStatus", deleteStatus); - // Output Calculated Columns - SqlParameter param_AuditID = new SqlParameter("@newAuditID", SqlDbType.BigInt); - param_AuditID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_AuditID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - auditID = (long)cm.Parameters["@newAuditID"].Value; - // No Timestamp value to return - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAudit.Add", ex); - throw new DbCslaException("AnnotationAudit.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAudit.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAudit.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAudit.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateAnnotationAudit"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@AuditID", _AuditID); - cm.Parameters.AddWithValue("@AnnotationID", _AnnotationID); - cm.Parameters.AddWithValue("@ItemID", _ItemID); - cm.Parameters.AddWithValue("@TypeID", _TypeID); - cm.Parameters.AddWithValue("@RtfText", _RtfText); - cm.Parameters.AddWithValue("@SearchText", _SearchText); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@DeleteStatus", _DeleteStatus); - // Output Calculated Columns - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAudit.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - AnnotationAudit.Add(cn, ref _AuditID, _AnnotationID, _ItemID, _TypeID, _RtfText, _SearchText, _Config, _DTS, _UserID, _DeleteStatus); - else - AnnotationAudit.Update(cn, ref _AuditID, _AnnotationID, _ItemID, _TypeID, _RtfText, _SearchText, _Config, _DTS, _UserID, _DeleteStatus); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Update(SqlConnection cn, ref long auditID, int annotationID, int itemID, int typeID, string rtfText, string searchText, string config, DateTime dts, string userID, int deleteStatus) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAudit.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateAnnotationAudit"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@AuditID", auditID); - cm.Parameters.AddWithValue("@AnnotationID", annotationID); - cm.Parameters.AddWithValue("@ItemID", itemID); - cm.Parameters.AddWithValue("@TypeID", typeID); - cm.Parameters.AddWithValue("@RtfText", rtfText); - cm.Parameters.AddWithValue("@SearchText", searchText); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@DeleteStatus", deleteStatus); - // Output Calculated Columns - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - // No Timestamp value to return - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAudit.Update", ex); - throw new DbCslaException("AnnotationAudit.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_AuditID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAudit.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteAnnotationAudit"; - cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAudit.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationAudit.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, long auditID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAudit.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteAnnotationAudit"; - // Input PK Fields - cm.Parameters.AddWithValue("@AuditID", auditID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAudit.Remove", ex); - throw new DbCslaException("AnnotationAudit.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(long auditID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(auditID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationAudit.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private long _AuditID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(long auditID) - { - _AuditID = auditID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAudit.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsAnnotationAudit"; - cm.Parameters.AddWithValue("@AuditID", _AuditID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAudit.DataPortal_Execute", ex); - throw new DbCslaException("AnnotationAudit.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - AnnotationAuditExtension _AnnotationAuditExtension = new AnnotationAuditExtension(); - [Serializable()] - partial class AnnotationAuditExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class AnnotationAuditConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is AnnotationAudit) - { - // Return the ToString value - return ((AnnotationAudit)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create AnnotationAuditExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class AnnotationAudit -// { -// partial class AnnotationAuditExtension : extensionBase -// { -// // CSLATODO: Override automatic defaults -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of AnnotationAuditInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Copy of AnnotationAuditInfo.cs deleted file mode 100644 index 9bbfd86d..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of AnnotationAuditInfo.cs +++ /dev/null @@ -1,384 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void AnnotationAuditInfoEvent(object sender); - /// - /// AnnotationAuditInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(AnnotationAuditInfoConverter))] - public partial class AnnotationAuditInfo : ReadOnlyBase, IDisposable - { - public event AnnotationAuditInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(AnnotationAuditInfo annotationAuditInfo) - { - if (!_CacheList.Contains(annotationAuditInfo)) _CacheList.Add(annotationAuditInfo); // In AddToCache - } - protected static void RemoveFromCache(AnnotationAuditInfo annotationAuditInfo) - { - while (_CacheList.Contains(annotationAuditInfo)) _CacheList.Remove(annotationAuditInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - while (_CacheList.Count > 0) // Move AnnotationAuditInfo(s) from temporary _CacheList to _CacheByPrimaryKey - { - AnnotationAuditInfo tmp = _CacheList[0]; // Get the first AnnotationAuditInfo - string pKey = tmp.AuditID.ToString(); - if (!_CacheByPrimaryKey.ContainsKey(pKey)) - { - _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list - _CacheList.RemoveAt(0); // Remove the first AnnotationAuditInfo - } - } - internal static void AddList(AnnotationAuditInfoList lst) - { - foreach (AnnotationAuditInfo item in lst) AddToCache(item); - } - protected static AnnotationAuditInfo GetCachedByPrimaryKey(long auditID) - { - ConvertListToDictionary(); - string key = auditID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected AnnotationAudit _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private long _AuditID; - [System.ComponentModel.DataObjectField(true, true)] - public long AuditID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AuditID; - } - } - private int _AnnotationID; - public int AnnotationID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AnnotationID; - } - } - private int _ItemID; - public int ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemID; - } - } - private int _TypeID; - public int TypeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _TypeID; - } - } - private string _RtfText = string.Empty; - public string RtfText - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RtfText; - } - } - private string _SearchText = string.Empty; - public string SearchText - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _SearchText; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - private int _DeleteStatus; - public int DeleteStatus - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DeleteStatus; - } - } - // CSLATODO: Replace base AnnotationAuditInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current AnnotationAuditInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // CSLATODO: Check AnnotationAuditInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current AnnotationAuditInfo - protected override object GetIdValue() - { - return MyAnnotationAuditInfoUnique; // Absolutely Unique ID - } - #endregion - #region Factory Methods - private static int _AnnotationAuditInfoUnique = 0; - private static int AnnotationAuditInfoUnique - { get { return ++_AnnotationAuditInfoUnique; } } - private int _MyAnnotationAuditInfoUnique = AnnotationAuditInfoUnique; - public int MyAnnotationAuditInfoUnique // Absolutely Unique ID - Info - { get { return _MyAnnotationAuditInfoUnique; } } - protected AnnotationAuditInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return; - List listAnnotationAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items - while (listAnnotationAuditInfo.Contains(this)) listAnnotationAuditInfo.Remove(this); // Remove the item from the list - if (listAnnotationAuditInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list - } - public virtual AnnotationAudit Get() - { - return _Editable = AnnotationAudit.Get(_AuditID); - } - public static void Refresh(AnnotationAudit tmp) - { - string key = tmp.AuditID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (AnnotationAuditInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(AnnotationAudit tmp) - { - _AnnotationID = tmp.AnnotationID; - _ItemID = tmp.ItemID; - _TypeID = tmp.TypeID; - _RtfText = tmp.RtfText; - _SearchText = tmp.SearchText; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _DeleteStatus = tmp.DeleteStatus; - _AnnotationAuditInfoExtension.Refresh(this); - OnChange();// raise an event - } - public static AnnotationAuditInfo Get(long auditID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a AnnotationAudit"); - try - { - AnnotationAuditInfo tmp = GetCachedByPrimaryKey(auditID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(auditID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up AnnotationAuditInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationAuditInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal AnnotationAuditInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfo.Constructor", ex); - throw new DbCslaException("AnnotationAuditInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private long _AuditID; - public long AuditID - { get { return _AuditID; } } - public PKCriteria(long auditID) - { - _AuditID = auditID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfo.ReadData", GetHashCode()); - try - { - _AuditID = dr.GetInt64("AuditID"); - _AnnotationID = dr.GetInt32("AnnotationID"); - _ItemID = dr.GetInt32("ItemID"); - _TypeID = dr.GetInt32("TypeID"); - _RtfText = dr.GetString("RtfText"); - _SearchText = dr.GetString("SearchText"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _DeleteStatus = dr.GetInt32("DeleteStatus"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationAuditInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationAudit"; - cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationAuditInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - AnnotationAuditInfoExtension _AnnotationAuditInfoExtension = new AnnotationAuditInfoExtension(); - [Serializable()] - partial class AnnotationAuditInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(AnnotationAuditInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class AnnotationAuditInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is AnnotationAuditInfo) - { - // Return the ToString value - return ((AnnotationAuditInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of AnnotationAuditInfoList.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Copy of AnnotationAuditInfoList.cs deleted file mode 100644 index ccd56d4d..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of AnnotationAuditInfoList.cs +++ /dev/null @@ -1,205 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// AnnotationAuditInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(AnnotationAuditInfoListConverter))] - public partial class AnnotationAuditInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (AnnotationAuditInfo tmp in this) - { - tmp.Changed += new AnnotationAuditInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (AnnotationAuditInfo tmp in this) - { - tmp.Changed -= new AnnotationAuditInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static AnnotationAuditInfoList _AnnotationAuditInfoList = null; - /// - /// Return a list of all AnnotationAuditInfo. - /// - public static AnnotationAuditInfoList Get() - { - try - { - if (_AnnotationAuditInfoList != null) - return _AnnotationAuditInfoList; - AnnotationAuditInfoList tmp = DataPortal.Fetch(); - AnnotationAuditInfo.AddList(tmp); - tmp.AddEvents(); - _AnnotationAuditInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationAuditInfoList.Get", ex); - } - } - /// - /// Reset the list of all AnnotationAuditInfo. - /// - public static void Reset() - { - _AnnotationAuditInfoList = null; - } - // CSLATODO: Add alternative gets - - //public static AnnotationAuditInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on AnnotationAuditInfoList.Get", ex); - // } - //} - private AnnotationAuditInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationAudits"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new AnnotationAuditInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("AnnotationAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - AnnotationAuditInfoListPropertyDescriptor pd = new AnnotationAuditInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class AnnotationAuditInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private AnnotationAuditInfo Item { get { return (AnnotationAuditInfo)_Item; } } - public AnnotationAuditInfoListPropertyDescriptor(AnnotationAuditInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class AnnotationAuditInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is AnnotationAuditInfoList) - { - // Return department and department role separated by comma. - return ((AnnotationAuditInfoList)value).Items.Count.ToString() + " AnnotationAudits"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of ContentAudit.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Copy of ContentAudit.cs deleted file mode 100644 index 3fcd5f44..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of ContentAudit.cs +++ /dev/null @@ -1,1016 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ContentAudit Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ContentAuditConverter))] - public partial class ContentAudit : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshContentAudits = new List(); - private void AddToRefreshList(List refreshContentAudits) - { - if (IsDirty) - refreshContentAudits.Add(this); - } - private void BuildRefreshList() - { - _RefreshContentAudits = new List(); - AddToRefreshList(_RefreshContentAudits); - } - private void ProcessRefreshList() - { - foreach (ContentAudit tmp in _RefreshContentAudits) - { - ContentAuditInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(ContentAudit contentAudit) - { - if (!_CacheList.Contains(contentAudit)) _CacheList.Add(contentAudit); // In AddToCache - } - protected static void RemoveFromCache(ContentAudit contentAudit) - { - while (_CacheList.Contains(contentAudit)) _CacheList.Remove(contentAudit); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - while (_CacheList.Count > 0) // Move ContentAudit(s) from temporary _CacheList to _CacheByPrimaryKey - { - ContentAudit tmp = _CacheList[0]; // Get the first ContentAudit - string pKey = tmp.AuditID.ToString(); - if (!_CacheByPrimaryKey.ContainsKey(pKey)) - { - _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list - _CacheList.RemoveAt(0); // Remove the first ContentAudit - } - } - protected static ContentAudit GetCachedByPrimaryKey(long auditID) - { - ConvertListToDictionary(); - string key = auditID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextAuditID = -1; - public static int NextAuditID - { - get { return _nextAuditID--; } - } - private long _AuditID; - [System.ComponentModel.DataObjectField(true, true)] - public long AuditID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AuditID; - } - } - private int _ContentID; - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_ContentID != value) - { - _ContentID = value; - PropertyHasChanged(); - } - } - } - private string _Number = string.Empty; - public string Number - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Number; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Number != value) - { - _Number = value; - PropertyHasChanged(); - } - } - } - private string _Text = string.Empty; - public string Text - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Text; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Text != value) - { - _Text = value; - PropertyHasChanged(); - } - } - } - private int? _Type; - public int? Type - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Type; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_Type != value) - { - _Type = value; - PropertyHasChanged(); - } - } - } - private int? _FormatID; - public int? FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FormatID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_FormatID != value) - { - _FormatID = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private int _DeleteStatus; - public int DeleteStatus - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DeleteStatus; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DeleteStatus != value) - { - _DeleteStatus = value; - PropertyHasChanged(); - } - } - } - public override bool IsDirty - { - get { return base.IsDirty; } - } - public bool IsDirtyList(List list) - { - return base.IsDirty; - } - public override bool IsValid - { - get { return (IsNew && !IsDirty) ? true : base.IsValid; } - } - public bool IsValidList(List list) - { - return (IsNew && !IsDirty) ? true : base.IsValid; - } - // CSLATODO: Replace base ContentAudit.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ContentAudit - //public override string ToString() - //{ - // return base.ToString(); - //} - // CSLATODO: Check ContentAudit.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ContentAudit - protected override object GetIdValue() - { - return MyContentAuditUnique; // Absolutely Unique ID - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Number", 512)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Text", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 200)); - //ValidationRules.AddDependantProperty("x", "y"); - _ContentAuditExtension.AddValidationRules(ValidationRules); - // CSLATODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _ContentAuditExtension.AddInstanceValidationRules(ValidationRules); - // CSLATODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //CSLATODO: Who can read/write which fields - //AuthorizationRules.AllowRead(AuditID, ""); - //AuthorizationRules.AllowRead(ContentID, ""); - //AuthorizationRules.AllowRead(Number, ""); - //AuthorizationRules.AllowRead(Text, ""); - //AuthorizationRules.AllowRead(Type, ""); - //AuthorizationRules.AllowRead(FormatID, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowRead(DeleteStatus, ""); - //AuthorizationRules.AllowWrite(ContentID, ""); - //AuthorizationRules.AllowWrite(Number, ""); - //AuthorizationRules.AllowWrite(Text, ""); - //AuthorizationRules.AllowWrite(Type, ""); - //AuthorizationRules.AllowWrite(FormatID, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - //AuthorizationRules.AllowWrite(DeleteStatus, ""); - _ContentAuditExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //CSLATODO: Who can read/write which fields - _ContentAuditExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // CSLATODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // CSLATODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // CSLATODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // CSLATODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _ContentAuditUnique = 0; - protected static int ContentAuditUnique - { get { return ++_ContentAuditUnique; } } - private int _MyContentAuditUnique = ContentAuditUnique; - public int MyContentAuditUnique // Absolutely Unique ID - Editable - { get { return _MyContentAuditUnique; } } - protected ContentAudit() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) - { - List listContentAudit = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items - while (listContentAudit.Contains(this)) listContentAudit.Remove(this); // Remove the item from the list - if (listContentAudit.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list - } - } - public static ContentAudit New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a ContentAudit"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentAudit.New", ex); - } - } - public static ContentAudit New(int contentID, DateTime dts, string userID, int deleteStatus) - { - ContentAudit tmp = ContentAudit.New(); - tmp.ContentID = contentID; - tmp.DTS = dts; - tmp.UserID = userID; - tmp.DeleteStatus = deleteStatus; - return tmp; - } - public static ContentAudit New(int contentID, string number, string text, int? type, int? formatID, string config, DateTime dts, string userID, int deleteStatus) - { - ContentAudit tmp = ContentAudit.New(); - tmp.ContentID = contentID; - tmp.Number = number; - tmp.Text = text; - tmp.Type = type; - tmp.FormatID = formatID; - tmp.Config = config; - tmp.DTS = dts; - tmp.UserID = userID; - tmp.DeleteStatus = deleteStatus; - return tmp; - } - public static ContentAudit MakeContentAudit(int contentID, string number, string text, int? type, int? formatID, string config, DateTime dts, string userID, int deleteStatus) - { - ContentAudit tmp = ContentAudit.New(contentID, number, text, type, formatID, config, dts, userID, deleteStatus); - if (tmp.IsSavable) - { - ContentAudit tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static ContentAudit Get(long auditID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a ContentAudit"); - try - { - ContentAudit tmp = GetCachedByPrimaryKey(auditID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(auditID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ContentAudit - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentAudit.Get", ex); - } - } - public static ContentAudit Get(SafeDataReader dr) - { - if (dr.Read()) return new ContentAudit(dr); - return null; - } - internal ContentAudit(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(long auditID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a ContentAudit"); - try - { - DataPortal.Delete(new PKCriteria(auditID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentAudit.Delete", ex); - } - } - public override ContentAudit Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a ContentAudit"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a ContentAudit"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a ContentAudit"); - try - { - BuildRefreshList(); - ContentAudit contentAudit = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(contentAudit);//Refresh the item in AllList - ProcessRefreshList(); - return contentAudit; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private long _AuditID; - public long AuditID - { get { return _AuditID; } } - public PKCriteria(long auditID) - { - _AuditID = auditID; - } - } - // CSLATODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _AuditID = NextAuditID; - // Database Defaults - - // CSLATODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAudit.ReadData", GetHashCode()); - try - { - _AuditID = dr.GetInt64("AuditID"); - _ContentID = dr.GetInt32("ContentID"); - _Number = dr.GetString("Number"); - _Text = dr.GetString("Text"); - _Type = (int?)dr.GetValue("Type"); - _FormatID = (int?)dr.GetValue("FormatID"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _DeleteStatus = dr.GetInt32("DeleteStatus"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAudit.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ContentAudit.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAudit.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getContentAudit"; - cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAudit.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ContentAudit.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAudit.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ContentAudit.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAudit.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addContentAudit"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", _ContentID); - cm.Parameters.AddWithValue("@Number", _Number); - cm.Parameters.AddWithValue("@Text", _Text); - cm.Parameters.AddWithValue("@Type", _Type); - cm.Parameters.AddWithValue("@FormatID", _FormatID); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@DeleteStatus", _DeleteStatus); - // Output Calculated Columns - SqlParameter param_AuditID = new SqlParameter("@newAuditID", SqlDbType.BigInt); - param_AuditID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_AuditID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _AuditID = (long)cm.Parameters["@newAuditID"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAudit.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAudit.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ContentAudit.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Add(SqlConnection cn, ref long auditID, int contentID, string number, string text, int? type, int? formatID, string config, DateTime dts, string userID, int deleteStatus) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAudit.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addContentAudit"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", contentID); - cm.Parameters.AddWithValue("@Number", number); - cm.Parameters.AddWithValue("@Text", text); - cm.Parameters.AddWithValue("@Type", type); - cm.Parameters.AddWithValue("@FormatID", formatID); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@DeleteStatus", deleteStatus); - // Output Calculated Columns - SqlParameter param_AuditID = new SqlParameter("@newAuditID", SqlDbType.BigInt); - param_AuditID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_AuditID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - auditID = (long)cm.Parameters["@newAuditID"].Value; - // No Timestamp value to return - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAudit.Add", ex); - throw new DbCslaException("ContentAudit.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAudit.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAudit.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAudit.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateContentAudit"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@AuditID", _AuditID); - cm.Parameters.AddWithValue("@ContentID", _ContentID); - cm.Parameters.AddWithValue("@Number", _Number); - cm.Parameters.AddWithValue("@Text", _Text); - cm.Parameters.AddWithValue("@Type", _Type); - cm.Parameters.AddWithValue("@FormatID", _FormatID); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@DeleteStatus", _DeleteStatus); - // Output Calculated Columns - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAudit.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - ContentAudit.Add(cn, ref _AuditID, _ContentID, _Number, _Text, _Type, _FormatID, _Config, _DTS, _UserID, _DeleteStatus); - else - ContentAudit.Update(cn, ref _AuditID, _ContentID, _Number, _Text, _Type, _FormatID, _Config, _DTS, _UserID, _DeleteStatus); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Update(SqlConnection cn, ref long auditID, int contentID, string number, string text, int? type, int? formatID, string config, DateTime dts, string userID, int deleteStatus) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAudit.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateContentAudit"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@AuditID", auditID); - cm.Parameters.AddWithValue("@ContentID", contentID); - cm.Parameters.AddWithValue("@Number", number); - cm.Parameters.AddWithValue("@Text", text); - cm.Parameters.AddWithValue("@Type", type); - cm.Parameters.AddWithValue("@FormatID", formatID); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@DeleteStatus", deleteStatus); - // Output Calculated Columns - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - // No Timestamp value to return - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAudit.Update", ex); - throw new DbCslaException("ContentAudit.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_AuditID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAudit.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteContentAudit"; - cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAudit.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ContentAudit.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, long auditID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAudit.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteContentAudit"; - // Input PK Fields - cm.Parameters.AddWithValue("@AuditID", auditID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAudit.Remove", ex); - throw new DbCslaException("ContentAudit.Remove", ex); - } - } - #endregion - // Standard Default Code - #region extension - ContentAuditExtension _ContentAuditExtension = new ContentAuditExtension(); - [Serializable()] - partial class ContentAuditExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ContentAuditConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ContentAudit) - { - // Return the ToString value - return ((ContentAudit)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ContentAuditExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ContentAudit -// { -// partial class ContentAuditExtension : extensionBase -// { -// // CSLATODO: Override automatic defaults -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of ContentAuditInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Copy of ContentAuditInfo.cs deleted file mode 100644 index 68303647..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of ContentAuditInfo.cs +++ /dev/null @@ -1,384 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void ContentAuditInfoEvent(object sender); - /// - /// ContentAuditInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ContentAuditInfoConverter))] - public partial class ContentAuditInfo : ReadOnlyBase, IDisposable - { - public event ContentAuditInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(ContentAuditInfo contentAuditInfo) - { - if (!_CacheList.Contains(contentAuditInfo)) _CacheList.Add(contentAuditInfo); // In AddToCache - } - protected static void RemoveFromCache(ContentAuditInfo contentAuditInfo) - { - while (_CacheList.Contains(contentAuditInfo)) _CacheList.Remove(contentAuditInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - while (_CacheList.Count > 0) // Move ContentAuditInfo(s) from temporary _CacheList to _CacheByPrimaryKey - { - ContentAuditInfo tmp = _CacheList[0]; // Get the first ContentAuditInfo - string pKey = tmp.AuditID.ToString(); - if (!_CacheByPrimaryKey.ContainsKey(pKey)) - { - _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list - _CacheList.RemoveAt(0); // Remove the first ContentAuditInfo - } - } - internal static void AddList(ContentAuditInfoList lst) - { - foreach (ContentAuditInfo item in lst) AddToCache(item); - } - protected static ContentAuditInfo GetCachedByPrimaryKey(long auditID) - { - ConvertListToDictionary(); - string key = auditID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected ContentAudit _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private long _AuditID; - [System.ComponentModel.DataObjectField(true, true)] - public long AuditID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AuditID; - } - } - private int _ContentID; - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentID; - } - } - private string _Number = string.Empty; - public string Number - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Number; - } - } - private string _Text = string.Empty; - public string Text - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Text; - } - } - private int? _Type; - public int? Type - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Type; - } - } - private int? _FormatID; - public int? FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FormatID; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - private int _DeleteStatus; - public int DeleteStatus - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DeleteStatus; - } - } - // CSLATODO: Replace base ContentAuditInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ContentAuditInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // CSLATODO: Check ContentAuditInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ContentAuditInfo - protected override object GetIdValue() - { - return MyContentAuditInfoUnique; // Absolutely Unique ID - } - #endregion - #region Factory Methods - private static int _ContentAuditInfoUnique = 0; - private static int ContentAuditInfoUnique - { get { return ++_ContentAuditInfoUnique; } } - private int _MyContentAuditInfoUnique = ContentAuditInfoUnique; - public int MyContentAuditInfoUnique // Absolutely Unique ID - Info - { get { return _MyContentAuditInfoUnique; } } - protected ContentAuditInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return; - List listContentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items - while (listContentAuditInfo.Contains(this)) listContentAuditInfo.Remove(this); // Remove the item from the list - if (listContentAuditInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list - } - public virtual ContentAudit Get() - { - return _Editable = ContentAudit.Get(_AuditID); - } - public static void Refresh(ContentAudit tmp) - { - string key = tmp.AuditID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ContentAuditInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ContentAudit tmp) - { - _ContentID = tmp.ContentID; - _Number = tmp.Number; - _Text = tmp.Text; - _Type = tmp.Type; - _FormatID = tmp.FormatID; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _DeleteStatus = tmp.DeleteStatus; - _ContentAuditInfoExtension.Refresh(this); - OnChange();// raise an event - } - public static ContentAuditInfo Get(long auditID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a ContentAudit"); - try - { - ContentAuditInfo tmp = GetCachedByPrimaryKey(auditID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(auditID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ContentAuditInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentAuditInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal ContentAuditInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.Constructor", ex); - throw new DbCslaException("ContentAuditInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private long _AuditID; - public long AuditID - { get { return _AuditID; } } - public PKCriteria(long auditID) - { - _AuditID = auditID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.ReadData", GetHashCode()); - try - { - _AuditID = dr.GetInt64("AuditID"); - _ContentID = dr.GetInt32("ContentID"); - _Number = dr.GetString("Number"); - _Text = dr.GetString("Text"); - _Type = (int?)dr.GetValue("Type"); - _FormatID = (int?)dr.GetValue("FormatID"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _DeleteStatus = dr.GetInt32("DeleteStatus"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ContentAuditInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getContentAudit"; - cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ContentAuditInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - ContentAuditInfoExtension _ContentAuditInfoExtension = new ContentAuditInfoExtension(); - [Serializable()] - partial class ContentAuditInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(ContentAuditInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class ContentAuditInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ContentAuditInfo) - { - // Return the ToString value - return ((ContentAuditInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of ContentAuditInfoList.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Copy of ContentAuditInfoList.cs deleted file mode 100644 index 048c26df..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of ContentAuditInfoList.cs +++ /dev/null @@ -1,205 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// ContentAuditInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ContentAuditInfoListConverter))] - public partial class ContentAuditInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (ContentAuditInfo tmp in this) - { - tmp.Changed += new ContentAuditInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (ContentAuditInfo tmp in this) - { - tmp.Changed -= new ContentAuditInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static ContentAuditInfoList _ContentAuditInfoList = null; - /// - /// Return a list of all ContentAuditInfo. - /// - public static ContentAuditInfoList Get() - { - try - { - if (_ContentAuditInfoList != null) - return _ContentAuditInfoList; - ContentAuditInfoList tmp = DataPortal.Fetch(); - ContentAuditInfo.AddList(tmp); - tmp.AddEvents(); - _ContentAuditInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentAuditInfoList.Get", ex); - } - } - /// - /// Reset the list of all ContentAuditInfo. - /// - public static void Reset() - { - _ContentAuditInfoList = null; - } - // CSLATODO: Add alternative gets - - //public static ContentAuditInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on ContentAuditInfoList.Get", ex); - // } - //} - private ContentAuditInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getContentAudits"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new ContentAuditInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ContentAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ContentAuditInfoListPropertyDescriptor pd = new ContentAuditInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ContentAuditInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private ContentAuditInfo Item { get { return (ContentAuditInfo)_Item; } } - public ContentAuditInfoListPropertyDescriptor(ContentAuditInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ContentAuditInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ContentAuditInfoList) - { - // Return department and department role separated by comma. - return ((ContentAuditInfoList)value).Items.Count.ToString() + " ContentAudits"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of DocumentAudit.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Copy of DocumentAudit.cs deleted file mode 100644 index 340ceadb..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of DocumentAudit.cs +++ /dev/null @@ -1,1049 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// DocumentAudit Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DocumentAuditConverter))] - public partial class DocumentAudit : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshDocumentAudits = new List(); - private void AddToRefreshList(List refreshDocumentAudits) - { - if (IsDirty) - refreshDocumentAudits.Add(this); - } - private void BuildRefreshList() - { - _RefreshDocumentAudits = new List(); - AddToRefreshList(_RefreshDocumentAudits); - } - private void ProcessRefreshList() - { - foreach (DocumentAudit tmp in _RefreshDocumentAudits) - { - DocumentAuditInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(DocumentAudit documentAudit) - { - if (!_CacheList.Contains(documentAudit)) _CacheList.Add(documentAudit); // In AddToCache - } - protected static void RemoveFromCache(DocumentAudit documentAudit) - { - while (_CacheList.Contains(documentAudit)) _CacheList.Remove(documentAudit); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - while (_CacheList.Count > 0) // Move DocumentAudit(s) from temporary _CacheList to _CacheByPrimaryKey - { - DocumentAudit tmp = _CacheList[0]; // Get the first DocumentAudit - string pKey = tmp.AuditID.ToString(); - if (!_CacheByPrimaryKey.ContainsKey(pKey)) - { - _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list - _CacheList.RemoveAt(0); // Remove the first DocumentAudit - } - } - protected static DocumentAudit GetCachedByPrimaryKey(long auditID) - { - ConvertListToDictionary(); - string key = auditID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextAuditID = -1; - public static int NextAuditID - { - get { return _nextAuditID--; } - } - private long _AuditID; - [System.ComponentModel.DataObjectField(true, true)] - public long AuditID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AuditID; - } - } - private int _DocID; - public int DocID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DocID != value) - { - _DocID = value; - PropertyHasChanged(); - } - } - } - private string _LibTitle = string.Empty; - public string LibTitle - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _LibTitle; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_LibTitle != value) - { - _LibTitle = value; - PropertyHasChanged(); - } - } - } - private byte[] _DocContent; - public byte[] DocContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocContent; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DocContent != value) - { - _DocContent = value; - PropertyHasChanged(); - } - } - } - private string _DocAscii = string.Empty; - public string DocAscii - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocAscii; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_DocAscii != value) - { - _DocAscii = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private string _FileExtension = string.Empty; - public string FileExtension - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FileExtension; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_FileExtension != value) - { - _FileExtension = value; - PropertyHasChanged(); - } - } - } - private byte[] _DocPdf; - public byte[] DocPdf - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocPdf; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DocPdf != value) - { - _DocPdf = value; - PropertyHasChanged(); - } - } - } - private int _DeleteStatus; - public int DeleteStatus - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DeleteStatus; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DeleteStatus != value) - { - _DeleteStatus = value; - PropertyHasChanged(); - } - } - } - public override bool IsDirty - { - get { return base.IsDirty; } - } - public bool IsDirtyList(List list) - { - return base.IsDirty; - } - public override bool IsValid - { - get { return (IsNew && !IsDirty) ? true : base.IsValid; } - } - public bool IsValidList(List list) - { - return (IsNew && !IsDirty) ? true : base.IsValid; - } - // CSLATODO: Replace base DocumentAudit.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current DocumentAudit - //public override string ToString() - //{ - // return base.ToString(); - //} - // CSLATODO: Check DocumentAudit.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current DocumentAudit - protected override object GetIdValue() - { - return MyDocumentAuditUnique; // Absolutely Unique ID - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("LibTitle", 2048)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("DocAscii", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 200)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "FileExtension"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("FileExtension", 20)); - //ValidationRules.AddDependantProperty("x", "y"); - _DocumentAuditExtension.AddValidationRules(ValidationRules); - // CSLATODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _DocumentAuditExtension.AddInstanceValidationRules(ValidationRules); - // CSLATODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //CSLATODO: Who can read/write which fields - //AuthorizationRules.AllowRead(AuditID, ""); - //AuthorizationRules.AllowRead(DocID, ""); - //AuthorizationRules.AllowRead(LibTitle, ""); - //AuthorizationRules.AllowRead(DocContent, ""); - //AuthorizationRules.AllowRead(DocAscii, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowRead(FileExtension, ""); - //AuthorizationRules.AllowRead(DocPdf, ""); - //AuthorizationRules.AllowRead(DeleteStatus, ""); - //AuthorizationRules.AllowWrite(DocID, ""); - //AuthorizationRules.AllowWrite(LibTitle, ""); - //AuthorizationRules.AllowWrite(DocContent, ""); - //AuthorizationRules.AllowWrite(DocAscii, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - //AuthorizationRules.AllowWrite(FileExtension, ""); - //AuthorizationRules.AllowWrite(DocPdf, ""); - //AuthorizationRules.AllowWrite(DeleteStatus, ""); - _DocumentAuditExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //CSLATODO: Who can read/write which fields - _DocumentAuditExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // CSLATODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // CSLATODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // CSLATODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // CSLATODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _DocumentAuditUnique = 0; - protected static int DocumentAuditUnique - { get { return ++_DocumentAuditUnique; } } - private int _MyDocumentAuditUnique = DocumentAuditUnique; - public int MyDocumentAuditUnique // Absolutely Unique ID - Editable - { get { return _MyDocumentAuditUnique; } } - protected DocumentAudit() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) - { - List listDocumentAudit = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items - while (listDocumentAudit.Contains(this)) listDocumentAudit.Remove(this); // Remove the item from the list - if (listDocumentAudit.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list - } - } - public static DocumentAudit New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a DocumentAudit"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocumentAudit.New", ex); - } - } - public static DocumentAudit New(int docID, DateTime dts, string userID, string fileExtension, int deleteStatus) - { - DocumentAudit tmp = DocumentAudit.New(); - tmp.DocID = docID; - tmp.DTS = dts; - tmp.UserID = userID; - tmp.FileExtension = fileExtension; - tmp.DeleteStatus = deleteStatus; - return tmp; - } - public static DocumentAudit New(int docID, string libTitle, byte[] docContent, string docAscii, string config, DateTime dts, string userID, string fileExtension, byte[] docPdf, int deleteStatus) - { - DocumentAudit tmp = DocumentAudit.New(); - tmp.DocID = docID; - tmp.LibTitle = libTitle; - tmp.DocContent = docContent; - tmp.DocAscii = docAscii; - tmp.Config = config; - tmp.DTS = dts; - tmp.UserID = userID; - tmp.FileExtension = fileExtension; - tmp.DocPdf = docPdf; - tmp.DeleteStatus = deleteStatus; - return tmp; - } - public static DocumentAudit MakeDocumentAudit(int docID, string libTitle, byte[] docContent, string docAscii, string config, DateTime dts, string userID, string fileExtension, byte[] docPdf, int deleteStatus) - { - DocumentAudit tmp = DocumentAudit.New(docID, libTitle, docContent, docAscii, config, dts, userID, fileExtension, docPdf, deleteStatus); - if (tmp.IsSavable) - { - DocumentAudit tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static DocumentAudit Get(long auditID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a DocumentAudit"); - try - { - DocumentAudit tmp = GetCachedByPrimaryKey(auditID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(auditID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up DocumentAudit - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocumentAudit.Get", ex); - } - } - public static DocumentAudit Get(SafeDataReader dr) - { - if (dr.Read()) return new DocumentAudit(dr); - return null; - } - internal DocumentAudit(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(long auditID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a DocumentAudit"); - try - { - DataPortal.Delete(new PKCriteria(auditID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocumentAudit.Delete", ex); - } - } - public override DocumentAudit Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a DocumentAudit"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a DocumentAudit"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a DocumentAudit"); - try - { - BuildRefreshList(); - DocumentAudit documentAudit = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(documentAudit);//Refresh the item in AllList - ProcessRefreshList(); - return documentAudit; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private long _AuditID; - public long AuditID - { get { return _AuditID; } } - public PKCriteria(long auditID) - { - _AuditID = auditID; - } - } - // CSLATODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _AuditID = NextAuditID; - // Database Defaults - - // CSLATODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAudit.ReadData", GetHashCode()); - try - { - _AuditID = dr.GetInt64("AuditID"); - _DocID = dr.GetInt32("DocID"); - _LibTitle = dr.GetString("LibTitle"); - _DocContent = (byte[])dr.GetValue("DocContent"); - _DocAscii = dr.GetString("DocAscii"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _FileExtension = dr.GetString("FileExtension"); - _DocPdf = (byte[])dr.GetValue("DocPdf"); - _DeleteStatus = dr.GetInt32("DeleteStatus"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAudit.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocumentAudit.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAudit.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocumentAudit"; - cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAudit.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocumentAudit.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAudit.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocumentAudit.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAudit.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addDocumentAudit"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@DocID", _DocID); - cm.Parameters.AddWithValue("@LibTitle", _LibTitle); - cm.Parameters.AddWithValue("@DocContent", _DocContent); - cm.Parameters.AddWithValue("@DocAscii", _DocAscii); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@FileExtension", _FileExtension); - cm.Parameters.AddWithValue("@DocPdf", _DocPdf); - cm.Parameters.AddWithValue("@DeleteStatus", _DeleteStatus); - // Output Calculated Columns - SqlParameter param_AuditID = new SqlParameter("@newAuditID", SqlDbType.BigInt); - param_AuditID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_AuditID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _AuditID = (long)cm.Parameters["@newAuditID"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAudit.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAudit.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocumentAudit.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Add(SqlConnection cn, ref long auditID, int docID, string libTitle, byte[] docContent, string docAscii, string config, DateTime dts, string userID, string fileExtension, byte[] docPdf, int deleteStatus) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAudit.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addDocumentAudit"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@DocID", docID); - cm.Parameters.AddWithValue("@LibTitle", libTitle); - cm.Parameters.AddWithValue("@DocContent", docContent); - cm.Parameters.AddWithValue("@DocAscii", docAscii); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@FileExtension", fileExtension); - cm.Parameters.AddWithValue("@DocPdf", docPdf); - cm.Parameters.AddWithValue("@DeleteStatus", deleteStatus); - // Output Calculated Columns - SqlParameter param_AuditID = new SqlParameter("@newAuditID", SqlDbType.BigInt); - param_AuditID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_AuditID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - auditID = (long)cm.Parameters["@newAuditID"].Value; - // No Timestamp value to return - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAudit.Add", ex); - throw new DbCslaException("DocumentAudit.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAudit.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAudit.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAudit.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateDocumentAudit"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@AuditID", _AuditID); - cm.Parameters.AddWithValue("@DocID", _DocID); - cm.Parameters.AddWithValue("@LibTitle", _LibTitle); - cm.Parameters.AddWithValue("@DocContent", _DocContent); - cm.Parameters.AddWithValue("@DocAscii", _DocAscii); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@FileExtension", _FileExtension); - cm.Parameters.AddWithValue("@DocPdf", _DocPdf); - cm.Parameters.AddWithValue("@DeleteStatus", _DeleteStatus); - // Output Calculated Columns - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAudit.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - DocumentAudit.Add(cn, ref _AuditID, _DocID, _LibTitle, _DocContent, _DocAscii, _Config, _DTS, _UserID, _FileExtension, _DocPdf, _DeleteStatus); - else - DocumentAudit.Update(cn, ref _AuditID, _DocID, _LibTitle, _DocContent, _DocAscii, _Config, _DTS, _UserID, _FileExtension, _DocPdf, _DeleteStatus); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Update(SqlConnection cn, ref long auditID, int docID, string libTitle, byte[] docContent, string docAscii, string config, DateTime dts, string userID, string fileExtension, byte[] docPdf, int deleteStatus) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAudit.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateDocumentAudit"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@AuditID", auditID); - cm.Parameters.AddWithValue("@DocID", docID); - cm.Parameters.AddWithValue("@LibTitle", libTitle); - cm.Parameters.AddWithValue("@DocContent", docContent); - cm.Parameters.AddWithValue("@DocAscii", docAscii); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@FileExtension", fileExtension); - cm.Parameters.AddWithValue("@DocPdf", docPdf); - cm.Parameters.AddWithValue("@DeleteStatus", deleteStatus); - // Output Calculated Columns - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - // No Timestamp value to return - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAudit.Update", ex); - throw new DbCslaException("DocumentAudit.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_AuditID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAudit.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteDocumentAudit"; - cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAudit.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocumentAudit.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, long auditID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAudit.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteDocumentAudit"; - // Input PK Fields - cm.Parameters.AddWithValue("@AuditID", auditID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAudit.Remove", ex); - throw new DbCslaException("DocumentAudit.Remove", ex); - } - } - #endregion - // Standard Default Code - #region extension - DocumentAuditExtension _DocumentAuditExtension = new DocumentAuditExtension(); - [Serializable()] - partial class DocumentAuditExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class DocumentAuditConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DocumentAudit) - { - // Return the ToString value - return ((DocumentAudit)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create DocumentAuditExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class DocumentAudit -// { -// partial class DocumentAuditExtension : extensionBase -// { -// // CSLATODO: Override automatic defaults -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of DocumentAuditInfo.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Copy of DocumentAuditInfo.cs deleted file mode 100644 index 6a414a83..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of DocumentAuditInfo.cs +++ /dev/null @@ -1,395 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void DocumentAuditInfoEvent(object sender); - /// - /// DocumentAuditInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DocumentAuditInfoConverter))] - public partial class DocumentAuditInfo : ReadOnlyBase, IDisposable - { - public event DocumentAuditInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(DocumentAuditInfo documentAuditInfo) - { - if (!_CacheList.Contains(documentAuditInfo)) _CacheList.Add(documentAuditInfo); // In AddToCache - } - protected static void RemoveFromCache(DocumentAuditInfo documentAuditInfo) - { - while (_CacheList.Contains(documentAuditInfo)) _CacheList.Remove(documentAuditInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - while (_CacheList.Count > 0) // Move DocumentAuditInfo(s) from temporary _CacheList to _CacheByPrimaryKey - { - DocumentAuditInfo tmp = _CacheList[0]; // Get the first DocumentAuditInfo - string pKey = tmp.AuditID.ToString(); - if (!_CacheByPrimaryKey.ContainsKey(pKey)) - { - _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list - _CacheList.RemoveAt(0); // Remove the first DocumentAuditInfo - } - } - internal static void AddList(DocumentAuditInfoList lst) - { - foreach (DocumentAuditInfo item in lst) AddToCache(item); - } - protected static DocumentAuditInfo GetCachedByPrimaryKey(long auditID) - { - ConvertListToDictionary(); - string key = auditID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected DocumentAudit _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private long _AuditID; - [System.ComponentModel.DataObjectField(true, true)] - public long AuditID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AuditID; - } - } - private int _DocID; - public int DocID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocID; - } - } - private string _LibTitle = string.Empty; - public string LibTitle - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _LibTitle; - } - } - private byte[] _DocContent; - public byte[] DocContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocContent; - } - } - private string _DocAscii = string.Empty; - public string DocAscii - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocAscii; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - private string _FileExtension = string.Empty; - public string FileExtension - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FileExtension; - } - } - private byte[] _DocPdf; - public byte[] DocPdf - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocPdf; - } - } - private int _DeleteStatus; - public int DeleteStatus - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DeleteStatus; - } - } - // CSLATODO: Replace base DocumentAuditInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current DocumentAuditInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // CSLATODO: Check DocumentAuditInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current DocumentAuditInfo - protected override object GetIdValue() - { - return MyDocumentAuditInfoUnique; // Absolutely Unique ID - } - #endregion - #region Factory Methods - private static int _DocumentAuditInfoUnique = 0; - private static int DocumentAuditInfoUnique - { get { return ++_DocumentAuditInfoUnique; } } - private int _MyDocumentAuditInfoUnique = DocumentAuditInfoUnique; - public int MyDocumentAuditInfoUnique // Absolutely Unique ID - Info - { get { return _MyDocumentAuditInfoUnique; } } - protected DocumentAuditInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) return; - List listDocumentAuditInfo = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items - while (listDocumentAuditInfo.Contains(this)) listDocumentAuditInfo.Remove(this); // Remove the item from the list - if (listDocumentAuditInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list - } - public virtual DocumentAudit Get() - { - return _Editable = DocumentAudit.Get(_AuditID); - } - public static void Refresh(DocumentAudit tmp) - { - string key = tmp.AuditID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (DocumentAuditInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(DocumentAudit tmp) - { - _DocID = tmp.DocID; - _LibTitle = tmp.LibTitle; - _DocContent = tmp.DocContent; - _DocAscii = tmp.DocAscii; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _FileExtension = tmp.FileExtension; - _DocPdf = tmp.DocPdf; - _DeleteStatus = tmp.DeleteStatus; - _DocumentAuditInfoExtension.Refresh(this); - OnChange();// raise an event - } - public static DocumentAuditInfo Get(long auditID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a DocumentAudit"); - try - { - DocumentAuditInfo tmp = GetCachedByPrimaryKey(auditID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(auditID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up DocumentAuditInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocumentAuditInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal DocumentAuditInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.Constructor", ex); - throw new DbCslaException("DocumentAuditInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private long _AuditID; - public long AuditID - { get { return _AuditID; } } - public PKCriteria(long auditID) - { - _AuditID = auditID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.ReadData", GetHashCode()); - try - { - _AuditID = dr.GetInt64("AuditID"); - _DocID = dr.GetInt32("DocID"); - _LibTitle = dr.GetString("LibTitle"); - _DocContent = (byte[])dr.GetValue("DocContent"); - _DocAscii = dr.GetString("DocAscii"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _FileExtension = dr.GetString("FileExtension"); - _DocPdf = (byte[])dr.GetValue("DocPdf"); - _DeleteStatus = dr.GetInt32("DeleteStatus"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocumentAuditInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocumentAudit"; - cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocumentAuditInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - DocumentAuditInfoExtension _DocumentAuditInfoExtension = new DocumentAuditInfoExtension(); - [Serializable()] - partial class DocumentAuditInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(DocumentAuditInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class DocumentAuditInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DocumentAuditInfo) - { - // Return the ToString value - return ((DocumentAuditInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of DocumentAuditInfoList.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Copy of DocumentAuditInfoList.cs deleted file mode 100644 index 24119f8d..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of DocumentAuditInfoList.cs +++ /dev/null @@ -1,205 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// DocumentAuditInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DocumentAuditInfoListConverter))] - public partial class DocumentAuditInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (DocumentAuditInfo tmp in this) - { - tmp.Changed += new DocumentAuditInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (DocumentAuditInfo tmp in this) - { - tmp.Changed -= new DocumentAuditInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static DocumentAuditInfoList _DocumentAuditInfoList = null; - /// - /// Return a list of all DocumentAuditInfo. - /// - public static DocumentAuditInfoList Get() - { - try - { - if (_DocumentAuditInfoList != null) - return _DocumentAuditInfoList; - DocumentAuditInfoList tmp = DataPortal.Fetch(); - DocumentAuditInfo.AddList(tmp); - tmp.AddEvents(); - _DocumentAuditInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocumentAuditInfoList.Get", ex); - } - } - /// - /// Reset the list of all DocumentAuditInfo. - /// - public static void Reset() - { - _DocumentAuditInfoList = null; - } - // CSLATODO: Add alternative gets - - //public static DocumentAuditInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on DocumentAuditInfoList.Get", ex); - // } - //} - private DocumentAuditInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentAuditInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocumentAudits"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new DocumentAuditInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentAuditInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("DocumentAuditInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - DocumentAuditInfoListPropertyDescriptor pd = new DocumentAuditInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class DocumentAuditInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private DocumentAuditInfo Item { get { return (DocumentAuditInfo)_Item; } } - public DocumentAuditInfoListPropertyDescriptor(DocumentAuditInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class DocumentAuditInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DocumentAuditInfoList) - { - // Return department and department role separated by comma. - return ((DocumentAuditInfoList)value).Items.Count.ToString() + " DocumentAudits"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of EntryAudit.cs b/PROMS/VEPROMS.CSLA.Library/Generated/Copy of EntryAudit.cs deleted file mode 100644 index 1949a3da..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Copy of EntryAudit.cs +++ /dev/null @@ -1,891 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// EntryAudit Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(EntryAuditConverter))] - public partial class EntryAudit : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshEntryAudits = new List(); - private void AddToRefreshList(List refreshEntryAudits) - { - if (IsDirty) - refreshEntryAudits.Add(this); - } - private void BuildRefreshList() - { - _RefreshEntryAudits = new List(); - AddToRefreshList(_RefreshEntryAudits); - } - private void ProcessRefreshList() - { - foreach (EntryAudit tmp in _RefreshEntryAudits) - { - EntryAuditInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(EntryAudit entryAudit) - { - if (!_CacheList.Contains(entryAudit)) _CacheList.Add(entryAudit); // In AddToCache - } - protected static void RemoveFromCache(EntryAudit entryAudit) - { - while (_CacheList.Contains(entryAudit)) _CacheList.Remove(entryAudit); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - while (_CacheList.Count > 0) // Move EntryAudit(s) from temporary _CacheList to _CacheByPrimaryKey - { - EntryAudit tmp = _CacheList[0]; // Get the first EntryAudit - string pKey = tmp.AuditID.ToString(); - if (!_CacheByPrimaryKey.ContainsKey(pKey)) - { - _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list - _CacheList.RemoveAt(0); // Remove the first EntryAudit - } - } - protected static EntryAudit GetCachedByPrimaryKey(long auditID) - { - ConvertListToDictionary(); - string key = auditID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextAuditID = -1; - public static int NextAuditID - { - get { return _nextAuditID--; } - } - private long _AuditID; - [System.ComponentModel.DataObjectField(true, true)] - public long AuditID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AuditID; - } - } - private int _ContentID; - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_ContentID != value) - { - _ContentID = value; - PropertyHasChanged(); - } - } - } - private int _DocID; - public int DocID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DocID != value) - { - _DocID = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private int _DeleteStatus; - public int DeleteStatus - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DeleteStatus; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DeleteStatus != value) - { - _DeleteStatus = value; - PropertyHasChanged(); - } - } - } - public override bool IsDirty - { - get { return base.IsDirty; } - } - public bool IsDirtyList(List list) - { - return base.IsDirty; - } - public override bool IsValid - { - get { return (IsNew && !IsDirty) ? true : base.IsValid; } - } - public bool IsValidList(List list) - { - return (IsNew && !IsDirty) ? true : base.IsValid; - } - // CSLATODO: Replace base EntryAudit.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current EntryAudit - //public override string ToString() - //{ - // return base.ToString(); - //} - // CSLATODO: Check EntryAudit.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current EntryAudit - protected override object GetIdValue() - { - return MyEntryAuditUnique; // Absolutely Unique ID - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 200)); - //ValidationRules.AddDependantProperty("x", "y"); - _EntryAuditExtension.AddValidationRules(ValidationRules); - // CSLATODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _EntryAuditExtension.AddInstanceValidationRules(ValidationRules); - // CSLATODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //CSLATODO: Who can read/write which fields - //AuthorizationRules.AllowRead(AuditID, ""); - //AuthorizationRules.AllowRead(ContentID, ""); - //AuthorizationRules.AllowRead(DocID, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowRead(DeleteStatus, ""); - //AuthorizationRules.AllowWrite(ContentID, ""); - //AuthorizationRules.AllowWrite(DocID, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - //AuthorizationRules.AllowWrite(DeleteStatus, ""); - _EntryAuditExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //CSLATODO: Who can read/write which fields - _EntryAuditExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // CSLATODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // CSLATODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // CSLATODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // CSLATODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _EntryAuditUnique = 0; - protected static int EntryAuditUnique - { get { return ++_EntryAuditUnique; } } - private int _MyEntryAuditUnique = EntryAuditUnique; - public int MyEntryAuditUnique // Absolutely Unique ID - Editable - { get { return _MyEntryAuditUnique; } } - protected EntryAudit() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(AuditID.ToString())) - { - List listEntryAudit = _CacheByPrimaryKey[AuditID.ToString()]; // Get the list of items - while (listEntryAudit.Contains(this)) listEntryAudit.Remove(this); // Remove the item from the list - if (listEntryAudit.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(AuditID.ToString()); // remove the list - } - } - public static EntryAudit New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a EntryAudit"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on EntryAudit.New", ex); - } - } - public static EntryAudit New(int contentID, int docID, DateTime dts, string userID, int deleteStatus) - { - EntryAudit tmp = EntryAudit.New(); - tmp.ContentID = contentID; - tmp.DocID = docID; - tmp.DTS = dts; - tmp.UserID = userID; - tmp.DeleteStatus = deleteStatus; - return tmp; - } - public static EntryAudit MakeEntryAudit(int contentID, int docID, DateTime dts, string userID, int deleteStatus) - { - EntryAudit tmp = EntryAudit.New(contentID, docID, dts, userID, deleteStatus); - if (tmp.IsSavable) - { - EntryAudit tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static EntryAudit Get(long auditID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a EntryAudit"); - try - { - EntryAudit tmp = GetCachedByPrimaryKey(auditID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(auditID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up EntryAudit - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on EntryAudit.Get", ex); - } - } - public static EntryAudit Get(SafeDataReader dr) - { - if (dr.Read()) return new EntryAudit(dr); - return null; - } - internal EntryAudit(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(long auditID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a EntryAudit"); - try - { - DataPortal.Delete(new PKCriteria(auditID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on EntryAudit.Delete", ex); - } - } - public override EntryAudit Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a EntryAudit"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a EntryAudit"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a EntryAudit"); - try - { - BuildRefreshList(); - EntryAudit entryAudit = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(entryAudit);//Refresh the item in AllList - ProcessRefreshList(); - return entryAudit; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private long _AuditID; - public long AuditID - { get { return _AuditID; } } - public PKCriteria(long auditID) - { - _AuditID = auditID; - } - } - // CSLATODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _AuditID = NextAuditID; - // Database Defaults - - // CSLATODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAudit.ReadData", GetHashCode()); - try - { - _AuditID = dr.GetInt64("AuditID"); - _ContentID = dr.GetInt32("ContentID"); - _DocID = dr.GetInt32("DocID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _DeleteStatus = dr.GetInt32("DeleteStatus"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAudit.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("EntryAudit.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAudit.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getEntryAudit"; - cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAudit.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("EntryAudit.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAudit.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("EntryAudit.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAudit.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addEntryAudit"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", _ContentID); - cm.Parameters.AddWithValue("@DocID", _DocID); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@DeleteStatus", _DeleteStatus); - // Output Calculated Columns - SqlParameter param_AuditID = new SqlParameter("@newAuditID", SqlDbType.BigInt); - param_AuditID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_AuditID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _AuditID = (long)cm.Parameters["@newAuditID"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAudit.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAudit.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("EntryAudit.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Add(SqlConnection cn, ref long auditID, int contentID, int docID, DateTime dts, string userID, int deleteStatus) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAudit.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addEntryAudit"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", contentID); - cm.Parameters.AddWithValue("@DocID", docID); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@DeleteStatus", deleteStatus); - // Output Calculated Columns - SqlParameter param_AuditID = new SqlParameter("@newAuditID", SqlDbType.BigInt); - param_AuditID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_AuditID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - auditID = (long)cm.Parameters["@newAuditID"].Value; - // No Timestamp value to return - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAudit.Add", ex); - throw new DbCslaException("EntryAudit.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAudit.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAudit.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAudit.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateEntryAudit"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@AuditID", _AuditID); - cm.Parameters.AddWithValue("@ContentID", _ContentID); - cm.Parameters.AddWithValue("@DocID", _DocID); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@DeleteStatus", _DeleteStatus); - // Output Calculated Columns - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAudit.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - EntryAudit.Add(cn, ref _AuditID, _ContentID, _DocID, _DTS, _UserID, _DeleteStatus); - else - EntryAudit.Update(cn, ref _AuditID, _ContentID, _DocID, _DTS, _UserID, _DeleteStatus); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Update(SqlConnection cn, ref long auditID, int contentID, int docID, DateTime dts, string userID, int deleteStatus) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAudit.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateEntryAudit"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@AuditID", auditID); - cm.Parameters.AddWithValue("@ContentID", contentID); - cm.Parameters.AddWithValue("@DocID", docID); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@DeleteStatus", deleteStatus); - // Output Calculated Columns - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - // No Timestamp value to return - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAudit.Update", ex); - throw new DbCslaException("EntryAudit.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_AuditID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAudit.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteEntryAudit"; - cm.Parameters.AddWithValue("@AuditID", criteria.AuditID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAudit.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("EntryAudit.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, long auditID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryAudit.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteEntryAudit"; - // Input PK Fields - cm.Parameters.AddWithValue("@AuditID", auditID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryAudit.Remove", ex); - throw new DbCslaException("EntryAudit.Remove", ex); - } - } - #endregion - // Standard Default Code - #region extension - EntryAuditExtension _EntryAuditExtension = new EntryAuditExtension(); - [Serializable()] - partial class EntryAuditExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class EntryAuditConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is EntryAudit) - { - // Return the ToString value - return ((EntryAudit)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create EntryAuditExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class EntryAudit -// { -// partial class EntryAuditExtension : extensionBase -// { -// // CSLATODO: Override automatic defaults -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Database.cs.bak b/PROMS/VEPROMS.CSLA.Library/Generated/Database.cs.bak deleted file mode 100644 index 70efdc76..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Database.cs.bak +++ /dev/null @@ -1,210 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Diagnostics; -namespace VEPROMS.CSLA.Library -{ - /// - /// Database Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public static partial class Database - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - public static void LogException(string s, Exception ex) - { - int i = 0; - Console.WriteLine("Error - {0}", s); - for (; ex != null; ex = ex.InnerException) - { - Console.WriteLine("{0}{1} - {2}", "".PadLeft(++i * 2), ex.GetType().ToString(), ex.Message); - } - } - private static bool _LoggingInfo = false; // By default don't log info - public static bool LoggingInfo - { - get { return _LoggingInfo; } - set { _LoggingInfo = value; } - } - static System.Diagnostics.Process _CurrentProcess = System.Diagnostics.Process.GetCurrentProcess(); - public static void LogInfo(string s, int hashCode) - { - if (_LoggingInfo) - Console.WriteLine("{0} MB {1}", _CurrentProcess.WorkingSet64 / 1000000, string.Format(s, hashCode)); - } - public static void LogDebug(string s, int hashCode) - { - if (_LoggingInfo) - Console.WriteLine("{0} MB {1}", _CurrentProcess.WorkingSet64 / 1000000, string.Format(s, hashCode)); - } - private static string _ConnectionName = "VEPROMS"; - public static string ConnectionName - { - get { return Database._ConnectionName; } - set { Database._ConnectionName = value; _VEPROMS_Connection = null; /* Reset Connection */ } - } - private static string _VEPROMS_Connection; - public static string VEPROMS_Connection - { - get - { - if (_VEPROMS_Connection != null) // Use Lazy Load - return _VEPROMS_Connection; - DateTime.Today.ToLongDateString(); - // If DBConnection.XML exists, use the connection string from DBConnection.XML - string cnOverride = System.Windows.Forms.Application.StartupPath + @"\DBConnection.XML"; - if (System.IO.File.Exists(cnOverride)) - { - System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); - xd.Load(cnOverride); - System.Xml.XmlNode xn = xd.SelectSingleNode("DBConnection/@string"); - if (xn != null) - { - return _VEPROMS_Connection = xn.InnerText; - } - } - // Otherwise get the value from the ConfigurationManager - ConnectionStringSettings cs = ConfigurationManager.ConnectionStrings[ConnectionName]; - if (cs == null) - { - throw new ApplicationException("Database.cs Could not find connection " + ConnectionName); - } - string constr = cs.ConnectionString; - if (constr.Contains("{MENU}")) - { - constr = ChooseDatabase(constr); - } - return _VEPROMS_Connection = constr; - } - } - private static string _SelectedDatabase; - - public static string SelectedDatabase - { - get { return Database._SelectedDatabase; } - set { Database._SelectedDatabase = value; } - } - private static string ChooseDatabase(string constr) - { - string tmp = constr.Replace("{MENU}", "master"); - SqlConnection cn = new SqlConnection(tmp); - cn.Open(); -// SqlDataAdapter da = new SqlDataAdapter("select name from sysdatabases where name like 'VEP%' order by name", cn); - SqlDataAdapter da = new SqlDataAdapter("select name,case when object_id(name + '..Revisions') is not null then 'Approval' when object_id(name + '..ContentAudits') is not null then 'Change Manager' else 'Original' end functionality from sysdatabases where name like 'VEP%' order by name", cn); - DataSet ds = new DataSet(); - da.Fill(ds); - cn.Close(); - System.Windows.Forms.ContextMenuStrip cms = new System.Windows.Forms.ContextMenuStrip(); - cms.Items.Add("Choose Database"); - System.Windows.Forms.ToolStripMenuItem tsmi = cms.Items[0] as System.Windows.Forms.ToolStripMenuItem; - tsmi.BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.ActiveCaption);// System.Drawing.Color.Pink; - tsmi.ForeColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.ActiveCaptionText); - tsmi.Font = new System.Drawing.Font(tsmi.Font, System.Drawing.FontStyle.Bold); - foreach (DataRow dr in ds.Tables[0].Rows) - { - if(dr["functionality"].ToString() == "Approval") - cms.Items.Add(dr["name"].ToString(), null, new EventHandler(Database_Click)); - } - while (_SelectedDatabase == null) - { - cms.Show(new System.Drawing.Point((System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - cms.Width) / 2, (System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - cms.Height) / 2)); - System.Windows.Forms.Application.DoEvents(); - } - return constr.Replace("{MENU}", _SelectedDatabase); - } - - static void Database_Click(object sender, EventArgs e) - { - System.Windows.Forms.ToolStripMenuItem tsmi = sender as System.Windows.Forms.ToolStripMenuItem; - if (tsmi != null) - { - _SelectedDatabase = tsmi.Text; - } - } - - public static SqlConnection VEPROMS_SqlConnection - { - get - { - string strConn = VEPROMS_Connection; // If failure - Fail (Don't try to catch) - // Attempt to make a connection - try - { - SqlConnection cn = new SqlConnection(strConn); - cn.Open(); - return cn; - } - catch (SqlException exsql) - { - const string strAttachError = "An attempt to attach an auto-named database for file "; - if (exsql.Message.StartsWith(strAttachError)) - {// Check to see if the file is missing - string sFile = exsql.Message.Substring(strAttachError.Length); - sFile = sFile.Substring(0, sFile.IndexOf(" failed")); - // "An attempt to attach an auto-named database for file failed" - if (strConn.ToLower().IndexOf("user instance=true") < 0) - { - throw new ApplicationException("Connection String missing attribute: User Instance=True"); - } - if (System.IO.File.Exists(sFile)) - { - throw new ApplicationException("Database file " + sFile + " Cannot be opened\r\n", exsql); - } - else - { - throw new FileNotFoundException("Database file " + sFile + " Not Found", exsql); - } - } - else - { - throw new ApplicationException("Failure on Connect", exsql); - } - } - catch (Exception ex)// Throw Application Exception on Failure - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection Error", ex); - throw new ApplicationException("Failure on Connect", ex); - } - } - } - public static void PurgeData() - { - try - { - SqlConnection cn = VEPROMS_SqlConnection; - SqlCommand cmd = new SqlCommand("purgedata", cn); - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.ExecuteNonQuery(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Purge Error", ex); - throw new ApplicationException("Failure on Purge", ex); - } - } - } - public class DbCslaException : Exception - { - internal DbCslaException(string message, Exception innerException) : base(message, innerException) { ;} - internal DbCslaException(string message) : base(message) { ;} - internal DbCslaException() : base() { ;} - } // Class -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/Database.cs.org b/PROMS/VEPROMS.CSLA.Library/Generated/Database.cs.org deleted file mode 100644 index a997f4af..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Generated/Database.cs.org +++ /dev/null @@ -1,575 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Diagnostics; -using System.Collections.Generic; - -namespace VEPROMS.CSLA.Library -{ - /// - /// Database Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public static partial class Database - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - private static int _DefaultTimeout = 600; // 600 seconds, i.e. 10 minutes - - public static int DefaultTimeout - { - get { return _DefaultTimeout; } - set { _DefaultTimeout = value; } - } - - public static void LogException(string s, Exception ex) - { - int i = 0; - Console.WriteLine("Error - {0}", s); - for (; ex != null; ex = ex.InnerException) - { - Console.WriteLine("{0}{1} - {2}", "".PadLeft(++i * 2), ex.GetType().ToString(), ex.Message); - } - } - private static bool _LoggingInfo = false; // By default don't log info - public static bool LoggingInfo - { - get { return _LoggingInfo; } - set { _LoggingInfo = value; } - } - static System.Diagnostics.Process _CurrentProcess = System.Diagnostics.Process.GetCurrentProcess(); - public static void LogInfo(string s, int hashCode) - { - if (_LoggingInfo) - Console.WriteLine("{0} MB {1}", _CurrentProcess.WorkingSet64 / 1000000, string.Format(s, hashCode)); - } - public static void LogDebug(string s, int hashCode) - { - if (_LoggingInfo) - Console.WriteLine("{0} MB {1}", _CurrentProcess.WorkingSet64 / 1000000, string.Format(s, hashCode)); - } - private static string _ConnectionName = "VEPROMS"; - public static string ConnectionName - { - get { return Database._ConnectionName; } - set { Database._ConnectionName = value; _VEPROMS_Connection = null; /* Reset Connection */ } - } - private static string _VEPROMS_Connection; - public static string VEPROMS_Connection - { - get - { - if (_VEPROMS_Connection != null) // Use Lazy Load - return _VEPROMS_Connection; - DateTime.Today.ToLongDateString(); - // If DBConnection.XML exists, use the connection string from DBConnection.XML - string cnOverride = System.Windows.Forms.Application.StartupPath + @"\DBConnection.XML"; - if (System.IO.File.Exists(cnOverride)) - { - System.Xml.XmlDocument xd = new System.Xml.XmlDocument(); - xd.Load(cnOverride); - System.Xml.XmlNode xn = xd.SelectSingleNode("DBConnection/@string"); - // bug fix: B2013-079 - // If we are using the DBConnection.xml file, - // Check to see if "{MENU}" is being used and if a database was specified (ex."VEPROMS.EXE \DB=VEPROMS_xxx") - // If both conditions are true, then call the ChooseDatabases() funtion which will return a valid connection string (we hope) - // otherwise use the connection string as it is in the DBConnection.xml - if (xn != null) - { - if (xn.InnerText.Contains("{MENU}") && SelectedDatabase != null && SelectedDatabase.Length > 0) - _VEPROMS_Connection = ChooseDatabase(xn.InnerText); - else - _VEPROMS_Connection = xn.InnerText; - return _VEPROMS_Connection; - } - } - // Otherwise get the value from the ConfigurationManager - ConnectionStringSettings cs = ConfigurationManager.ConnectionStrings[ConnectionName]; - if (cs == null) - { - throw new ApplicationException("Database.cs Could not find connection " + ConnectionName); - } - string constr = cs.ConnectionString; - if (constr.Contains("{MENU}")) - { - constr = ChooseDatabase(constr); - } - return _VEPROMS_Connection = constr; - } - set { _VEPROMS_Connection = value; } - } - private static string _SelectedDatabase; - public static string SelectedDatabase - { - get { return Database._SelectedDatabase; } - set { Database._SelectedDatabase = value; } - } - private static string _LastDatabase="NoDefault"; - public static string LastDatabase - { - get { return Database._LastDatabase; } - set { Database._LastDatabase = value; } - } - private static string ChooseDatabase(string constr) - { - if (_SelectedDatabase == null) - { - if (LastDatabase != "NoDefault" && LastDatabase != "") - { - if (System.Windows.Forms.MessageBox.Show("Open " + LastDatabase, "Reopen Last Database", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) - { - SelectedDatabase = LastDatabase; - return constr.Replace("{MENU}", _SelectedDatabase); - } - } - System.Windows.Forms.ContextMenuStrip cms = BuildDatabaseMenu(constr); - while (_SelectedDatabase == null) - { - cms.Show(new System.Drawing.Point((System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - cms.Width) / 2, (System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - cms.Height) / 2)); - System.Windows.Forms.Application.DoEvents(); - } - } - return constr.Replace("{MENU}", _SelectedDatabase); - } - private static System.Windows.Forms.ContextMenuStrip BuildDatabaseMenu(string constr) - { - string tmp = constr.Replace("{MENU}", "master"); - SqlConnection cn = new SqlConnection(tmp); - cn.Open(); - // SqlDataAdapter da = new SqlDataAdapter("select name from sysdatabases where name like 'VEP%' order by name", cn); - //SqlDataAdapter da = new SqlDataAdapter("select name, case when object_id('[' + name + ']..Items') is null then 'Not PROMS' when object_id('[' + name + ']..Revisions') is not null then 'Approval' when object_id('[' + name + ']..ContentAudits') is not null then 'Change Manager' else 'Original' end functionality from sysdatabases where name not in ('master','model','msdb','tempdb') order by name", cn); - SqlDataAdapter da = new SqlDataAdapter("select name, 'Approval' functionality from sysdatabases where name not in ('master','model','msdb','tempdb') order by name", cn); - da.SelectCommand.CommandTimeout = 300; // 300 sec timeout - DataSet ds = new DataSet(); - try - { - da.Fill(ds); - } - catch (Exception ex) - { - System.Windows.Forms.MessageBox.Show(ex.GetType().Name, ex.Message); - throw(new Exception("Cannot Load Data List",ex)); - } - cn.Close(); - System.Windows.Forms.ContextMenuStrip cms = new System.Windows.Forms.ContextMenuStrip(); - cms.Items.Add("Choose Database"); - System.Windows.Forms.ToolStripMenuItem tsmi = cms.Items[0] as System.Windows.Forms.ToolStripMenuItem; - tsmi.BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.ActiveCaption);// System.Drawing.Color.Pink; - tsmi.ForeColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.ActiveCaptionText); - tsmi.Font = new System.Drawing.Font(tsmi.Font, System.Drawing.FontStyle.Bold); - foreach (DataRow dr in ds.Tables[0].Rows) - { - if (dr["functionality"].ToString() == "Approval") - cms.Items.Add(dr["name"].ToString(), null, new EventHandler(Database_Click)); - } - return cms; - } - - static void Database_Click(object sender, EventArgs e) - { - System.Windows.Forms.ToolStripMenuItem tsmi = sender as System.Windows.Forms.ToolStripMenuItem; - if (tsmi != null) - { - _SelectedDatabase = tsmi.Text; - } - } - - public static SqlConnection VEPROMS_SqlConnection - { - get - { - string strConn = VEPROMS_Connection; // If failure - Fail (Don't try to catch) - // Attempt to make a connection - try - { - SqlConnection cn = new SqlConnection(strConn); - cn.Open(); - return cn; - } - catch (SqlException exsql) - { - const string strAttachError = "An attempt to attach an auto-named database for file "; - if (exsql.Message.StartsWith(strAttachError)) - {// Check to see if the file is missing - string sFile = exsql.Message.Substring(strAttachError.Length); - sFile = sFile.Substring(0, sFile.IndexOf(" failed")); - // "An attempt to attach an auto-named database for file failed" - if (strConn.ToLower().IndexOf("user instance=true") < 0) - { - throw new ApplicationException("Connection String missing attribute: User Instance=True"); - } - if (System.IO.File.Exists(sFile)) - { - throw new ApplicationException("Database file " + sFile + " Cannot be opened\r\n", exsql); - } - else - { - throw new FileNotFoundException("Database file " + sFile + " Not Found", exsql); - } - } - else - { - throw new ApplicationException("Failure on Connect", exsql); - } - } - catch (Exception ex)// Throw Application Exception on Failure - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection Error", ex); - throw new ApplicationException("Failure on Connect", ex); - } - } - } - public static void PurgeData() - { - try - { - //SqlConnection cn = VEPROMS_SqlConnection; - //SqlCommand cmd = new SqlCommand("purgedata", cn); - using (SqlConnection cn = VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("purgedata", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Purge Error", ex); - throw new ApplicationException("Failure on Purge", ex); - } - } - } - public class DbCslaException : Exception - { - internal DbCslaException(string message, Exception innerException) : base(message, innerException) { ;} - internal DbCslaException(string message) : base(message) { ;} - internal DbCslaException() : base() { ;} - } // Class - #region commandbase object jcb - [Serializable()] - public class PurgeDataCommand : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private int _RowsAffected; - public int RowsAffected - { - get { return _RowsAffected; } - set { _RowsAffected = value; } - } - #region Factory Methods - public static int Execute() - { - PurgeDataCommand cmd = new PurgeDataCommand(); - cmd = DataPortal.Execute(cmd); - return cmd.RowsAffected; - } - private PurgeDataCommand() - { /* require use of factory methods */ } - #endregion - #region Server-Side code - protected override void DataPortal_Execute() - { - try - { - //SqlConnection cn = VEPROMS_SqlConnection; - //SqlCommand cmd = new SqlCommand("purgedata", cn); - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("purgedata", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - RowsAffected = cmd.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Purge Error", ex); - throw new ApplicationException("Failure on Purge", ex); - } - } - #endregion - } - [Serializable()] - public class CanTransitionBeCreatedCommand : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private ProposedTransition _ProposedTransition; - public ProposedTransition ProposedTransition - { - get { return _ProposedTransition; } - set { _ProposedTransition = value; } - } - private int _FromID; - public int FromID - { - get { return _FromID; } - set { _FromID = value; } - } - private int _ToID; - public int ToID - { - get { return _ToID; } - set { _ToID = value; } - } - #region Factory Methods - public static ProposedTransition Execute(int fromID, int toID) - { - CanTransitionBeCreatedCommand cmd = new CanTransitionBeCreatedCommand(); - cmd.FromID = fromID; - cmd.ToID = toID; - cmd = DataPortal.Execute(cmd); - return cmd.ProposedTransition; - } - private CanTransitionBeCreatedCommand() - { /* require use of factory methods */ } - #endregion - #region Server-Side code - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] CanTransitionBeCreatedCommand.ReadData", GetHashCode()); - try - { - _ProposedTransition = new ProposedTransition(dr.GetInt32("status"), dr.GetString("fromappl"), dr.GetString("toappl"), dr.GetString("fromstep"), dr.GetString("tostep")); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Detail.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("CanTransitionBeCreatedCommand.ReadData", ex); - } - } - protected override void DataPortal_Execute() - { - try - { - //SqlConnection cn = VEPROMS_SqlConnection; - //SqlCommand cmd = new SqlCommand("purgedata", cn); - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("vesp_CanTransitionBeCreated", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.Parameters.AddWithValue("fromItemID", _FromID); - cmd.Parameters.AddWithValue("toItemID", _ToID); - using (SafeDataReader dr = new SafeDataReader(cmd.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("CanTransitionBeCreatedCommand Error", ex); - throw new ApplicationException("Failure on CanTransitionBeCreatedCommand", ex); - } - } - #endregion - } - [Serializable()] - public class WillTransitionsBeValidCommand : CommandBase - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private List _InvalidTransitions; - public List InvalidTransitions - { - get { return _InvalidTransitions; } - } - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - private string _NewAppl; - public string NewAppl - { - get { return _NewAppl; } - set { _NewAppl = value; } - } - #region Factory Methods - public static List Execute(int itemID, string newAppl) - { - WillTransitionsBeValidCommand cmd = new WillTransitionsBeValidCommand(); - cmd.ItemID = itemID; - cmd.NewAppl = newAppl; - cmd = DataPortal.Execute(cmd); - return cmd.InvalidTransitions; - } - private WillTransitionsBeValidCommand() - { /* require use of factory methods */ } - #endregion - #region Server-Side code - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Detail.ReadData", GetHashCode()); - try - { - do - { - _InvalidTransitions.Add(new InvalidTransition(dr.GetInt32("myitemid"), dr.GetString("srcappl"), dr.GetString("tgtappl"), dr.GetString("srcstep"), dr.GetString("tgtstep"))); - } while (dr.Read()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("WillTransitionsBeValidCommand.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("WillTransitionsBeValidCommand.ReadData", ex); - } - } - protected override void DataPortal_Execute() - { - try - { - //SqlConnection cn = VEPROMS_SqlConnection; - //SqlCommand cmd = new SqlCommand("purgedata", cn); - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cmd = new SqlCommand("vesp_WillTransitionsBeValid", cn)) - { - cmd.CommandType = CommandType.StoredProcedure; - cmd.Parameters.AddWithValue("ItemID", _ItemID); - cmd.Parameters.AddWithValue("NewAppl", _NewAppl); - using (SafeDataReader dr = new SafeDataReader(cmd.ExecuteReader())) - { - _InvalidTransitions = new List(); - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("WillTransitionsBeValidCommand Error", ex); - throw new ApplicationException("Failure on WillTransitionsBeValidCommand", ex); - } - } - #endregion - } - [Serializable()] - public class InvalidTransition - { - private int _MyItemID; - public int MyItemID - { - get { return _MyItemID; } - set { _MyItemID = value; } - } - private string _SrcAppl; - public string SrcAppl - { - get { return _SrcAppl; } - set { _SrcAppl = value; } - } - private string _TgtAppl; - public string TgtAppl - { - get { return _TgtAppl; } - set { _TgtAppl = value; } - } - private string _SrcStep; - public string SrcStep - { - get { return _SrcStep; } - set { _SrcStep = value; } - } - private string _TgtStep; - public string TgtStep - { - get { return _TgtStep; } - set { _TgtStep = value; } - } - public InvalidTransition(int myItemID, string srcAppl, string tgtAppl, string srcStep, string tgtStep) - { - _MyItemID = myItemID; - _SrcAppl = srcAppl; - _TgtAppl = tgtAppl; - _SrcStep = srcStep; - _TgtStep = tgtStep; - } - } - [Serializable()] - public class ProposedTransition - { - private int _Status; - public int Status - { - get { return _Status; } - set { _Status = value; } - } - private string _FromAppl; - public string FromAppl - { - get { return _FromAppl; } - set { _FromAppl = value; } - } - private string _ToAppl; - public string ToAppl - { - get { return _ToAppl; } - set { _ToAppl = value; } - } - private string _FromStep; - public string FromStep - { - get { return _FromStep; } - set { _FromStep = value; } - } - private string _ToStep; - public string ToStep - { - get { return _ToStep; } - set { _ToStep = value; } - } - public ProposedTransition(int status, string fromAppl, string toAppl, string fromStep, string toStep) - { - _Status = status; - _FromAppl = fromAppl; - _ToAppl = toAppl; - _FromStep = fromStep; - _ToStep = toStep; - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/FigureInfoList.cs.bak b/PROMS/VEPROMS.CSLA.Library/Generated/FigureInfoList.cs.bak deleted file mode 100644 index df8b4b7d..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Generated/FigureInfoList.cs.bak +++ /dev/null @@ -1,312 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// FigureInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FigureInfoListConverter))] - public partial class FigureInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (FigureInfo tmp in this) - { - tmp.Changed += new FigureInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (FigureInfo tmp in this) - { - tmp.Changed -= new FigureInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static FigureInfoList _FigureInfoList = null; - /// - /// Return a list of all projects. - /// - public static FigureInfoList Get() - { - try - { - if (_FigureInfoList != null) - return _FigureInfoList; - FigureInfoList tmp = DataPortal.Fetch(); - FigureInfo.AddList(tmp); - tmp.AddEvents(); - _FigureInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on FigureInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static FigureInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on FigureInfoList.Get", ex); - // } - //} - public static FigureInfoList GetByROFstID(int rOFstID) - { - try - { - FigureInfoList tmp = DataPortal.Fetch(new ROFstIDCriteria(rOFstID)); - FigureInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on FigureInfoList.GetByROFstID", ex); - } - } - public static FigureInfoList GetByImageID(int imageID) - { - try - { - FigureInfoList tmp = DataPortal.Fetch(new ImageIDCriteria(imageID)); - FigureInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on FigureInfoList.GetByImageID", ex); - } - } - private FigureInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FigureInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFigures"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new FigureInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FigureInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("FigureInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ROFstIDCriteria - { - public ROFstIDCriteria(int rOFstID) - { - _ROFstID = rOFstID; - } - private int _ROFstID; - public int ROFstID - { - get { return _ROFstID; } - set { _ROFstID = value; } - } - } - private void DataPortal_Fetch(ROFstIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FigureInfoList.DataPortal_FetchROFstID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFiguresByROFstID"; - cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new FigureInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FigureInfoList.DataPortal_FetchROFstID", ex); - throw new DbCslaException("FigureInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ImageIDCriteria - { - public ImageIDCriteria(int imageID) - { - _ImageID = imageID; - } - private int _ImageID; - public int ImageID - { - get { return _ImageID; } - set { _ImageID = value; } - } - } - private void DataPortal_Fetch(ImageIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FigureInfoList.DataPortal_FetchImageID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFiguresByImageID"; - cm.Parameters.AddWithValue("@ImageID", criteria.ImageID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new FigureInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FigureInfoList.DataPortal_FetchImageID", ex); - throw new DbCslaException("FigureInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - FigureInfoListPropertyDescriptor pd = new FigureInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class FigureInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private FigureInfo Item { get { return (FigureInfo)_Item; } } - public FigureInfoListPropertyDescriptor(FigureInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class FigureInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is FigureInfoList) - { - // Return department and department role separated by comma. - return ((FigureInfoList)value).Items.Count.ToString() + " Figures"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/ItemInfo.cs.bak b/PROMS/VEPROMS.CSLA.Library/Generated/ItemInfo.cs.bak deleted file mode 100644 index 0fa82c48..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Generated/ItemInfo.cs.bak +++ /dev/null @@ -1,692 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void ItemInfoEvent(object sender); - /// - /// ItemInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ItemInfoConverter))] - public partial class ItemInfo : ReadOnlyBase, IDisposable - { - public event ItemInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(ItemInfo itemInfo) - { - if (!_CacheList.Contains(itemInfo)) _CacheList.Add(itemInfo); // In AddToCache - } - protected static void RemoveFromCache(ItemInfo itemInfo) - { - while (_CacheList.Contains(itemInfo)) _CacheList.Remove(itemInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - while (_CacheList.Count > 0) // Move ItemInfo(s) from temporary _CacheList to _CacheByPrimaryKey - { - ItemInfo tmp = _CacheList[0]; // Get the first ItemInfo - string pKey = tmp.ItemID.ToString(); - if (!_CacheByPrimaryKey.ContainsKey(pKey)) - { - _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list - _CacheList.RemoveAt(0); // Remove the first ItemInfo - } - } - internal static void AddList(ItemInfoList lst) - { - foreach (ItemInfo item in lst) AddToCache(item); - } - protected static ItemInfo GetCachedByPrimaryKey(int itemID) - { - ConvertListToDictionary(); - string key = itemID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Item _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _ItemID; - [System.ComponentModel.DataObjectField(true, true)] - public int ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ItemID", true); - return _ItemID; - } - } - private int? _PreviousID; - public int? PreviousID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("PreviousID", true); - if (_MyPrevious != null) _PreviousID = _MyPrevious.ItemID; - return _PreviousID; - } - } - private ItemInfo _MyPrevious; - public ItemInfo MyPrevious - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("MyPrevious", true); - if (_MyPrevious == null && _PreviousID != null) _MyPrevious = ItemInfo.Get((int)_PreviousID); - return _MyPrevious; - } - } - private int _ContentID; - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ContentID", true); - if (_MyContent != null) _ContentID = _MyContent.ContentID; - return _ContentID; - } - } - private ContentInfo _MyContent; - public ContentInfo MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("MyContent", true); - if (_MyContent == null && _ContentID != 0) _MyContent = ContentInfo.Get(_ContentID); - return _MyContent; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("DTS", true); - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("UserID", true); - return _UserID; - } - } - private int _ItemAnnotationCount = 0; - /// - /// Count of ItemAnnotations for this Item - /// - public int ItemAnnotationCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ItemAnnotationCount", true); - if (_ItemAnnotationCount < 0) - _ItemAnnotationCount = ItemAnnotations.Count; - return _ItemAnnotationCount; - } - } - private AnnotationInfoList _ItemAnnotations = null; - [TypeConverter(typeof(AnnotationInfoListConverter))] - public AnnotationInfoList ItemAnnotations - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ItemAnnotations", true); - if (_ItemAnnotationCount < 0 || (_ItemAnnotationCount > 0 && _ItemAnnotations == null)) - _ItemAnnotations = AnnotationInfoList.GetByItemID(_ItemID); - if (_ItemAnnotationCount < 0) - _ItemAnnotationCount = _ItemAnnotations.Count; - return _ItemAnnotations; - } - } - public void RefreshItemAnnotations() - { - _ItemAnnotationCount = -1; - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ItemID.ToString())) - foreach (ItemInfo tmp in _CacheByPrimaryKey[_ItemID.ToString()]) - tmp._ItemAnnotationCount = -1; // This will cause the data to be requeried - } - private int _ItemDocVersionCount = 0; - /// - /// Count of ItemDocVersions for this Item - /// - public int ItemDocVersionCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ItemDocVersionCount", true); - if (_ItemDocVersionCount < 0) - _ItemDocVersionCount = ItemDocVersions.Count; - return _ItemDocVersionCount; - } - } - private DocVersionInfoList _ItemDocVersions = null; - [TypeConverter(typeof(DocVersionInfoListConverter))] - public DocVersionInfoList ItemDocVersions - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ItemDocVersions", true); - if (_ItemDocVersionCount < 0 || (_ItemDocVersionCount > 0 && _ItemDocVersions == null)) - _ItemDocVersions = DocVersionInfoList.GetByItemID(_ItemID); - if (_ItemDocVersionCount < 0) - _ItemDocVersionCount = _ItemDocVersions.Count; - return _ItemDocVersions; - } - } - public void RefreshItemDocVersions() - { - _ItemDocVersionCount = -1; - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ItemID.ToString())) - foreach (ItemInfo tmp in _CacheByPrimaryKey[_ItemID.ToString()]) - tmp._ItemDocVersionCount = -1; // This will cause the data to be requeried - } - private int _NextItemCount = 0; - /// - /// Count of NextItems for this Item - /// - public int NextItemCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("NextItemCount", true); - if (_NextItemCount < 0) - _NextItemCount = NextItems.Count; - return _NextItemCount; - } - } - private ItemInfoList _NextItems = null; - [TypeConverter(typeof(ItemInfoListConverter))] - public ItemInfoList NextItems - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("NextItems", true); - if (_NextItemCount < 0 || (_NextItemCount > 0 && _NextItems == null)) - _NextItems = ItemInfoList.GetNext(_ItemID); - if (_NextItemCount < 0) - _NextItemCount = _NextItems.Count; - return _NextItems; - } - } - public void RefreshNextItems() - { - _NextItemCount = -1; - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ItemID.ToString())) - foreach (ItemInfo tmp in _CacheByPrimaryKey[_ItemID.ToString()]) - tmp._NextItemCount = -1; // This will cause the data to be requeried - } - private int _ItemPartCount = 0; - /// - /// Count of ItemParts for this Item - /// - public int ItemPartCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ItemPartCount", true); - if (_ItemPartCount < 0) - _ItemPartCount = ItemParts.Count; - return _ItemPartCount; - } - } - private PartInfoList _ItemParts = null; - [TypeConverter(typeof(PartInfoListConverter))] - public PartInfoList ItemParts - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ItemParts", true); - if (_ItemPartCount < 0 || (_ItemPartCount > 0 && _ItemParts == null)) - _ItemParts = PartInfoList.GetByItemID(_ItemID); - if (_ItemPartCount < 0) - _ItemPartCount = _ItemParts.Count; - return _ItemParts; - } - } - public void RefreshItemParts() - { - _ItemPartCount = -1; - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ItemID.ToString())) - foreach (ItemInfo tmp in _CacheByPrimaryKey[_ItemID.ToString()]) - tmp._ItemPartCount = -1; // This will cause the data to be requeried - } - private int _ItemTransition_RangeIDCount = 0; - /// - /// Count of ItemTransitions_RangeID for this Item - /// - public int ItemTransition_RangeIDCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ItemTransition_RangeIDCount", true); - if (_ItemTransition_RangeIDCount < 0) - _ItemTransition_RangeIDCount = ItemTransitions_RangeID.Count; - return _ItemTransition_RangeIDCount; - } - } - private TransitionInfoList _ItemTransitions_RangeID = null; - [TypeConverter(typeof(TransitionInfoListConverter))] - public TransitionInfoList ItemTransitions_RangeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ItemTransitions_RangeID", true); - if (_ItemTransition_RangeIDCount < 0 || (_ItemTransition_RangeIDCount > 0 && _ItemTransitions_RangeID == null)) - _ItemTransitions_RangeID = TransitionInfoList.GetByRangeID(_ItemID); - if (_ItemTransition_RangeIDCount < 0) - _ItemTransition_RangeIDCount = _ItemTransitions_RangeID.Count; - return _ItemTransitions_RangeID; - } - } - public void RefreshItemTransitions_RangeID() - { - _ItemTransition_RangeIDCount = -1; - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ItemID.ToString())) - foreach (ItemInfo tmp in _CacheByPrimaryKey[_ItemID.ToString()]) - tmp._ItemTransition_RangeIDCount = -1; // This will cause the data to be requeried - } - private int _ItemTransition_ToIDCount = 0; - /// - /// Count of ItemTransitions_ToID for this Item - /// - public int ItemTransition_ToIDCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ItemTransition_ToIDCount", true); - if (_ItemTransition_ToIDCount < 0) - _ItemTransition_ToIDCount = ItemTransitions_ToID.Count; - return _ItemTransition_ToIDCount; - } - } - private TransitionInfoList _ItemTransitions_ToID = null; - [TypeConverter(typeof(TransitionInfoListConverter))] - public TransitionInfoList ItemTransitions_ToID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ItemTransitions_ToID", true); - if (_ItemTransition_ToIDCount < 0 || (_ItemTransition_ToIDCount > 0 && _ItemTransitions_ToID == null)) - _ItemTransitions_ToID = TransitionInfoList.GetByToID(_ItemID); - if (_ItemTransition_ToIDCount < 0) - _ItemTransition_ToIDCount = _ItemTransitions_ToID.Count; - return _ItemTransitions_ToID; - } - } - public void RefreshItemTransitions_ToID() - { - _ItemTransition_ToIDCount = -1; - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ItemID.ToString())) - foreach (ItemInfo tmp in _CacheByPrimaryKey[_ItemID.ToString()]) - tmp._ItemTransition_ToIDCount = -1; // This will cause the data to be requeried - } - // CSLATODO: Replace base ItemInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ItemInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // CSLATODO: Check ItemInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ItemInfo - protected override object GetIdValue() - { - return MyItemInfoUnique; // Absolutely Unique ID - } - #endregion - #region Factory Methods - private static int _ItemInfoUnique = 0; - private static int ItemInfoUnique - { get { return ++_ItemInfoUnique; } } - private int _MyItemInfoUnique = ItemInfoUnique; - public int MyItemInfoUnique // Absolutely Unique ID - Info - { get { return _MyItemInfoUnique; } } - protected ItemInfo() - {/* require use of factory methods */ - AddToCache(this); - } - private bool _Disposed = false; - private static int _CountCreated = 0; - private static int _CountDisposed = 0; - private static int _CountFinalized = 0; - private static int IncrementCountCreated - { get { return ++_CountCreated; } } - private int _CountWhenCreated = IncrementCountCreated; - public static int CountCreated - { get { return _CountCreated; } } - public static int CountNotDisposed - { get { return _CountCreated - _CountDisposed; } } - public static int CountNotFinalized - { get { return _CountCreated - _CountFinalized; } } - ~ItemInfo() - { - _CountFinalized++; - } - public void Dispose() - { - if (_Disposed) return; - _CountDisposed++; - _Disposed = true; - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(ItemID.ToString())) return; - List listItemInfo = _CacheByPrimaryKey[ItemID.ToString()]; // Get the list of items - while (listItemInfo.Contains(this)) listItemInfo.Remove(this); // Remove the item from the list - if (listItemInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(ItemID.ToString()); // remove the list - if (_MyContent != null) - _MyContent = null; - if (_MyPrevious != null) - _MyPrevious = null; - //if (_ActiveFormat != null) - // _ActiveFormat = null; - //if (_ActiveParent != null) - // _ActiveParent = null; - //if (_ActiveSection != null) - // _ActiveSection = null; - //if (_MyDocVersion != null) - // _MyDocVersion = null; - //if (_ParentNoteOrCaution != null) - // _ParentNoteOrCaution = null; - } - public virtual Item Get() - { - return _Editable = Item.Get(_ItemID); - } - public static void Refresh(Item tmp) - { - string key = tmp.ItemID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ItemInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Item tmp) - { - if (_PreviousID != tmp.PreviousID) - { - if (MyPrevious != null) MyPrevious.RefreshNextItems(); // Update List for old value - _PreviousID = tmp.PreviousID; // Update the value - } - _MyPrevious = null; // Reset list so that the next line gets a new list - if (MyPrevious != null) MyPrevious.RefreshNextItems(); // Update List for new value - //if (_ContentID != tmp.ContentID) - //{ - if (MyContent != null) MyContent.RefreshContentItems(); // Update List for old value - _ContentID = tmp.ContentID; // Update the value - //} - _MyContent = null; // Reset list so that the next line gets a new list - if (MyContent != null) MyContent.RefreshContentItems(); // Update List for new value - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _ItemInfoExtension.Refresh(this); -//RHM Removed 20090724 - Duplicates function of code above. -// - Dispose caused error when a new step was added. -// - Resequence of transitions did not work properly. -// if(_MyPrevious != null) -// { -// _MyPrevious.Dispose();// Dispose related value -// _MyPrevious = null;// Reset related value -// } -//RHM Removed 20090724 - Duplicates function of code above. -// - Dispose caused error when a new step was added. -// - Resequence of transitions did not work properly. -// if(_MyContent != null) -// { -// _MyContent.Dispose();// Dispose related value -// _MyContent = null;// Reset related value -// } - OnChange();// raise an event - } - public static void Refresh(ContentItem tmp) - { - string key = tmp.ItemID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ItemInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ContentItem tmp) - { - if (_PreviousID != tmp.PreviousID) - { - if (MyPrevious != null) MyPrevious.RefreshNextItems(); // Update List for old value - _PreviousID = tmp.PreviousID; // Update the value - } - _MyPrevious = null; // Reset list so that the next line gets a new list - if (MyPrevious != null) MyPrevious.RefreshNextItems(); // Update List for new value - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _ItemInfoExtension.Refresh(this); -//RHM Removed 20090724 - Duplicates function of code above. -// - Dispose caused error when a new step was added. -// - Resequence of transitions did not work properly. -// if(_MyPrevious != null) -// { -// _MyPrevious.Dispose();// Dispose related value -// _MyPrevious = null;// Reset related value -// } -//RHM Removed 20090724 - Duplicates function of code above. -// - Dispose caused error when a new step was added. -// - Resequence of transitions did not work properly. -// if(_MyContent != null) -// { -// _MyContent.Dispose();// Dispose related value -// _MyContent = null;// Reset related value -// } - OnChange();// raise an event - } - public static ItemInfo Get(int itemID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Item"); - try - { - ItemInfo tmp = GetCachedByPrimaryKey(itemID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(itemID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ItemInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal ItemInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfo.Constructor", ex); - throw new DbCslaException("ItemInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _ItemID; - public int ItemID - { get { return _ItemID; } } - public PKCriteria(int itemID) - { - _ItemID = itemID; - } - } - protected void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.ReadData", GetHashCode()); - try - { - _ItemID = dr.GetInt32("ItemID"); - _PreviousID = (int?)dr.GetValue("PreviousID"); - _ContentID = dr.GetInt32("ContentID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _ItemAnnotationCount = dr.GetInt32("AnnotationCount"); - _ItemDocVersionCount = dr.GetInt32("DocVersionCount"); - _NextItemCount = dr.GetInt32("NextCount"); - _ItemPartCount = dr.GetInt32("PartCount"); - _ItemTransition_RangeIDCount = dr.GetInt32("Transition_RangeIDCount"); - _ItemTransition_ToIDCount = dr.GetInt32("Transition_ToIDCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ItemInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getItem"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ItemInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - ItemInfoExtension _ItemInfoExtension = new ItemInfoExtension(); - [Serializable()] - partial class ItemInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(ItemInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class ItemInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ItemInfo) - { - // Return the ToString value - return ((ItemInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RevisionROCheck.cs.bak b/PROMS/VEPROMS.CSLA.Library/Generated/RevisionROCheck.cs.bak deleted file mode 100644 index b16b77a2..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RevisionROCheck.cs.bak +++ /dev/null @@ -1,956 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// RevisionROCheck Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RevisionROCheckConverter))] - public partial class RevisionROCheck : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshRevisionROChecks = new List(); - private void AddToRefreshList(List refreshRevisionROChecks) - { - if (IsDirty) - refreshRevisionROChecks.Add(this); - } - private void BuildRefreshList() - { - _RefreshRevisionROChecks = new List(); - AddToRefreshList(_RefreshRevisionROChecks); - } - private void ProcessRefreshList() - { - foreach (RevisionROCheck tmp in _RefreshRevisionROChecks) - { - RevisionROCheckInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(RevisionROCheck revisionROCheck) - { - if (!_CacheList.Contains(revisionROCheck)) _CacheList.Add(revisionROCheck); // In AddToCache - } - protected static void RemoveFromCache(RevisionROCheck revisionROCheck) - { - while (_CacheList.Contains(revisionROCheck)) _CacheList.Remove(revisionROCheck); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - while (_CacheList.Count > 0) // Move RevisionROCheck(s) from temporary _CacheList to _CacheByPrimaryKey - { - RevisionROCheck tmp = _CacheList[0]; // Get the first RevisionROCheck - string pKey = tmp.CheckID.ToString(); - if (!_CacheByPrimaryKey.ContainsKey(pKey)) - { - _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list - _CacheList.RemoveAt(0); // Remove the first RevisionROCheck - } - } - protected static RevisionROCheck GetCachedByPrimaryKey(int checkID) - { - ConvertListToDictionary(); - string key = checkID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextCheckID = -1; - public static int NextCheckID - { - get { return _nextCheckID--; } - } - private int _CheckID; - [System.ComponentModel.DataObjectField(true, true)] - public int CheckID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("CheckID", true); - return _CheckID; - } - } - private int _ItemID; - public int ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ItemID", true); - return _ItemID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - CanWriteProperty("ItemID", true); - if (_ItemID != value) - { - _ItemID = value; - PropertyHasChanged(); - } - } - } - private int _ROID; - public int ROID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ROID", true); - return _ROID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - CanWriteProperty("ROID", true); - if (_ROID != value) - { - _ROID = value; - PropertyHasChanged(); - } - } - } - private string _RODate = string.Empty; - public string RODate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("RODate", true); - return _RODate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - CanWriteProperty("RODate", true); - if (value == null) value = string.Empty; - _RODate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_RODate != tmp.ToString()) - { - _RODate = tmp.ToString(); - // CSLATODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private string _ROValue = string.Empty; - public string ROValue - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ROValue", true); - return _ROValue; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - CanWriteProperty("ROValue", true); - if (value == null) value = string.Empty; - if (_ROValue != value) - { - _ROValue = value; - PropertyHasChanged(); - } - } - } - public override bool IsDirty - { - get { return base.IsDirty; } - } - public bool IsDirtyList(List list) - { - return base.IsDirty; - } - public override bool IsValid - { - get { return (IsNew && !IsDirty) ? true : base.IsValid; } - } - public bool IsValidList(List list) - { - return (IsNew && !IsDirty) ? true : base.IsValid; - } - // CSLATODO: Replace base RevisionROCheck.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current RevisionROCheck - //public override string ToString() - //{ - // return base.ToString(); - //} - // CSLATODO: Check RevisionROCheck.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current RevisionROCheck - protected override object GetIdValue() - { - return MyRevisionROCheckUnique; // Absolutely Unique ID - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(RODateValid, "RODate"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("ROValue", 1073741823)); - //ValidationRules.AddDependantProperty("x", "y"); - _RevisionROCheckExtension.AddValidationRules(ValidationRules); - // CSLATODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _RevisionROCheckExtension.AddInstanceValidationRules(ValidationRules); - // CSLATODO: Add other validation rules - } - private static bool RODateValid(RevisionROCheck target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._RODate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //CSLATODO: Who can read/write which fields - //AuthorizationRules.AllowRead(CheckID, ""); - //AuthorizationRules.AllowRead(ItemID, ""); - //AuthorizationRules.AllowRead(ROID, ""); - //AuthorizationRules.AllowRead(RODate, ""); - //AuthorizationRules.AllowRead(ROValue, ""); - //AuthorizationRules.AllowWrite(ItemID, ""); - //AuthorizationRules.AllowWrite(ROID, ""); - //AuthorizationRules.AllowWrite(RODate, ""); - //AuthorizationRules.AllowWrite(ROValue, ""); - _RevisionROCheckExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //CSLATODO: Who can read/write which fields - _RevisionROCheckExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // CSLATODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // CSLATODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // CSLATODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // CSLATODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _RevisionROCheckUnique = 0; - protected static int RevisionROCheckUnique - { get { return ++_RevisionROCheckUnique; } } - private int _MyRevisionROCheckUnique = RevisionROCheckUnique; - public int MyRevisionROCheckUnique // Absolutely Unique ID - Editable - { get { return _MyRevisionROCheckUnique; } } - protected RevisionROCheck() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(CheckID.ToString())) - { - List listRevisionROCheck = _CacheByPrimaryKey[CheckID.ToString()]; // Get the list of items - while (listRevisionROCheck.Contains(this)) listRevisionROCheck.Remove(this); // Remove the item from the list - if (listRevisionROCheck.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(CheckID.ToString()); // remove the list - } - } - public static RevisionROCheck New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a RevisionROCheck"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on RevisionROCheck.New", ex); - } - } - public static RevisionROCheck New(int itemID, int roid) - { - RevisionROCheck tmp = RevisionROCheck.New(); - tmp.ItemID = itemID; - tmp.ROID = roid; - return tmp; - } - public static RevisionROCheck New(int itemID, int roid, string rODate, string rOValue) - { - RevisionROCheck tmp = RevisionROCheck.New(); - tmp.ItemID = itemID; - tmp.ROID = roid; - tmp.RODate = rODate; - tmp.ROValue = rOValue; - return tmp; - } - public static RevisionROCheck MakeRevisionROCheck(int itemID, int roid, string rODate, string rOValue) - { - RevisionROCheck tmp = RevisionROCheck.New(itemID, roid, rODate, rOValue); - if (tmp.IsSavable) - { - RevisionROCheck tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static RevisionROCheck Get(int checkID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a RevisionROCheck"); - try - { - RevisionROCheck tmp = GetCachedByPrimaryKey(checkID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(checkID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up RevisionROCheck - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RevisionROCheck.Get", ex); - } - } - public static RevisionROCheck Get(SafeDataReader dr) - { - if (dr.Read()) return new RevisionROCheck(dr); - return null; - } - internal RevisionROCheck(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int checkID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a RevisionROCheck"); - try - { - DataPortal.Delete(new PKCriteria(checkID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on RevisionROCheck.Delete", ex); - } - } - public override RevisionROCheck Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a RevisionROCheck"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a RevisionROCheck"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a RevisionROCheck"); - try - { - BuildRefreshList(); - RevisionROCheck revisionROCheck = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(revisionROCheck);//Refresh the item in AllList - ProcessRefreshList(); - return revisionROCheck; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _CheckID; - public int CheckID - { get { return _CheckID; } } - public PKCriteria(int checkID) - { - _CheckID = checkID; - } - } - // CSLATODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _CheckID = NextCheckID; - // Database Defaults - - // CSLATODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionROCheck.ReadData", GetHashCode()); - try - { - _CheckID = dr.GetInt32("CheckID"); - _ItemID = dr.GetInt32("ItemID"); - _ROID = dr.GetInt32("ROID"); - _RODate = dr.GetSmartDate("RODate").Text; - _ROValue = dr.GetString("ROValue"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionROCheck.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RevisionROCheck.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionROCheck.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRevisionROCheck"; - cm.Parameters.AddWithValue("@CheckID", criteria.CheckID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionROCheck.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RevisionROCheck.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionROCheck.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RevisionROCheck.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionROCheck.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addRevisionROCheck"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ItemID", _ItemID); - cm.Parameters.AddWithValue("@ROID", _ROID); - cm.Parameters.AddWithValue("@RODate", new SmartDate(_RODate).DBValue); - cm.Parameters.AddWithValue("@ROValue", _ROValue); - // Output Calculated Columns - SqlParameter param_CheckID = new SqlParameter("@newCheckID", SqlDbType.Int); - param_CheckID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_CheckID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _CheckID = (int)cm.Parameters["@newCheckID"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionROCheck.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionROCheck.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RevisionROCheck.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Add(SqlConnection cn, ref int checkID, int itemID, int roid, SmartDate rODate, string rOValue) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionROCheck.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addRevisionROCheck"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ItemID", itemID); - cm.Parameters.AddWithValue("@ROID", roid); - cm.Parameters.AddWithValue("@RODate", rODate.DBValue); - cm.Parameters.AddWithValue("@ROValue", rOValue); - // Output Calculated Columns - SqlParameter param_CheckID = new SqlParameter("@newCheckID", SqlDbType.Int); - param_CheckID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_CheckID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - checkID = (int)cm.Parameters["@newCheckID"].Value; - // No Timestamp value to return - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionROCheck.Add", ex); - throw new DbCslaException("RevisionROCheck.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionROCheck.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionROCheck.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionROCheck.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateRevisionROCheck"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@CheckID", _CheckID); - cm.Parameters.AddWithValue("@ItemID", _ItemID); - cm.Parameters.AddWithValue("@ROID", _ROID); - cm.Parameters.AddWithValue("@RODate", new SmartDate(_RODate).DBValue); - cm.Parameters.AddWithValue("@ROValue", _ROValue); - // Output Calculated Columns - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionROCheck.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - RevisionROCheck.Add(cn, ref _CheckID, _ItemID, _ROID, new SmartDate(_RODate), _ROValue); - else - RevisionROCheck.Update(cn, ref _CheckID, _ItemID, _ROID, new SmartDate(_RODate), _ROValue); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Update(SqlConnection cn, ref int checkID, int itemID, int roid, SmartDate rODate, string rOValue) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionROCheck.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateRevisionROCheck"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@CheckID", checkID); - cm.Parameters.AddWithValue("@ItemID", itemID); - cm.Parameters.AddWithValue("@ROID", roid); - cm.Parameters.AddWithValue("@RODate", rODate); - cm.Parameters.AddWithValue("@ROValue", rOValue); - // Output Calculated Columns - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - // No Timestamp value to return - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionROCheck.Update", ex); - throw new DbCslaException("RevisionROCheck.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_CheckID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionROCheck.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteRevisionROCheck"; - cm.Parameters.AddWithValue("@CheckID", criteria.CheckID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionROCheck.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RevisionROCheck.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int checkID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionROCheck.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteRevisionROCheck"; - // Input PK Fields - cm.Parameters.AddWithValue("@CheckID", checkID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionROCheck.Remove", ex); - throw new DbCslaException("RevisionROCheck.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int checkID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(checkID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RevisionROCheck.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _CheckID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int checkID) - { - _CheckID = checkID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionROCheck.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsRevisionROCheck"; - cm.Parameters.AddWithValue("@CheckID", _CheckID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionROCheck.DataPortal_Execute", ex); - throw new DbCslaException("RevisionROCheck.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - RevisionROCheckExtension _RevisionROCheckExtension = new RevisionROCheckExtension(); - [Serializable()] - partial class RevisionROCheckExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class RevisionROCheckConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RevisionROCheck) - { - // Return the ToString value - return ((RevisionROCheck)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create RevisionROCheckExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS_.CSLA.Library -//{ -// public partial class RevisionROCheck -// { -// partial class RevisionROCheckExtension : extensionBase -// { -// // CSLATODO: Override automatic defaults -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/Generated/RevisionROCheckInfo.cs.bak b/PROMS/VEPROMS.CSLA.Library/Generated/RevisionROCheckInfo.cs.bak deleted file mode 100644 index 68c336cc..00000000 --- a/PROMS/VEPROMS.CSLA.Library/Generated/RevisionROCheckInfo.cs.bak +++ /dev/null @@ -1,334 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void RevisionROCheckInfoEvent(object sender); - /// - /// RevisionROCheckInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RevisionROCheckInfoConverter))] - public partial class RevisionROCheckInfo : ReadOnlyBase, IDisposable - { - public event RevisionROCheckInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(RevisionROCheckInfo revisionROCheckInfo) - { - if (!_CacheList.Contains(revisionROCheckInfo)) _CacheList.Add(revisionROCheckInfo); // In AddToCache - } - protected static void RemoveFromCache(RevisionROCheckInfo revisionROCheckInfo) - { - while (_CacheList.Contains(revisionROCheckInfo)) _CacheList.Remove(revisionROCheckInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - while (_CacheList.Count > 0) // Move RevisionROCheckInfo(s) from temporary _CacheList to _CacheByPrimaryKey - { - RevisionROCheckInfo tmp = _CacheList[0]; // Get the first RevisionROCheckInfo - string pKey = tmp.CheckID.ToString(); - if (!_CacheByPrimaryKey.ContainsKey(pKey)) - { - _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list - _CacheList.RemoveAt(0); // Remove the first RevisionROCheckInfo - } - } - internal static void AddList(RevisionROCheckInfoList lst) - { - foreach (RevisionROCheckInfo item in lst) AddToCache(item); - } - protected static RevisionROCheckInfo GetCachedByPrimaryKey(int checkID) - { - ConvertListToDictionary(); - string key = checkID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected RevisionROCheck _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _CheckID; - [System.ComponentModel.DataObjectField(true, true)] - public int CheckID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("CheckID", true); - return _CheckID; - } - } - private int _ItemID; - public int ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ItemID", true); - return _ItemID; - } - } - private int _ROID; - public int ROID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ROID", true); - return _ROID; - } - } - private string _RODate = string.Empty; - public string RODate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("RODate", true); - return _RODate; - } - } - private string _ROValue = string.Empty; - public string ROValue - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - CanReadProperty("ROValue", true); - return _ROValue; - } - } - // CSLATODO: Replace base RevisionROCheckInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current RevisionROCheckInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // CSLATODO: Check RevisionROCheckInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current RevisionROCheckInfo - protected override object GetIdValue() - { - return MyRevisionROCheckInfoUnique; // Absolutely Unique ID - } - #endregion - #region Factory Methods - private static int _RevisionROCheckInfoUnique = 0; - private static int RevisionROCheckInfoUnique - { get { return ++_RevisionROCheckInfoUnique; } } - private int _MyRevisionROCheckInfoUnique = RevisionROCheckInfoUnique; - public int MyRevisionROCheckInfoUnique // Absolutely Unique ID - Info - { get { return _MyRevisionROCheckInfoUnique; } } - protected RevisionROCheckInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(CheckID.ToString())) return; - List listRevisionROCheckInfo = _CacheByPrimaryKey[CheckID.ToString()]; // Get the list of items - while (listRevisionROCheckInfo.Contains(this)) listRevisionROCheckInfo.Remove(this); // Remove the item from the list - if (listRevisionROCheckInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(CheckID.ToString()); // remove the list - } - public virtual RevisionROCheck Get() - { - return _Editable = RevisionROCheck.Get(_CheckID); - } - public static void Refresh(RevisionROCheck tmp) - { - string key = tmp.CheckID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (RevisionROCheckInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(RevisionROCheck tmp) - { - _ItemID = tmp.ItemID; - _ROID = tmp.ROID; - _RODate = tmp.RODate; - _ROValue = tmp.ROValue; - _RevisionROCheckInfoExtension.Refresh(this); - OnChange();// raise an event - } - public static RevisionROCheckInfo Get(int checkID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a RevisionROCheck"); - try - { - RevisionROCheckInfo tmp = GetCachedByPrimaryKey(checkID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(checkID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up RevisionROCheckInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RevisionROCheckInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal RevisionROCheckInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionROCheckInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionROCheckInfo.Constructor", ex); - throw new DbCslaException("RevisionROCheckInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _CheckID; - public int CheckID - { get { return _CheckID; } } - public PKCriteria(int checkID) - { - _CheckID = checkID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionROCheckInfo.ReadData", GetHashCode()); - try - { - _CheckID = dr.GetInt32("CheckID"); - _ItemID = dr.GetInt32("ItemID"); - _ROID = dr.GetInt32("ROID"); - _RODate = dr.GetSmartDate("RODate").Text; - _ROValue = dr.GetString("ROValue"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionROCheckInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RevisionROCheckInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RevisionROCheckInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRevisionROCheck"; - cm.Parameters.AddWithValue("@CheckID", criteria.CheckID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RevisionROCheckInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RevisionROCheckInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - RevisionROCheckInfoExtension _RevisionROCheckInfoExtension = new RevisionROCheckInfoExtension(); - [Serializable()] - partial class RevisionROCheckInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(RevisionROCheckInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class RevisionROCheckInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RevisionROCheckInfo) - { - // Return the ToString value - return ((RevisionROCheckInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/NewGenerated/CommonRules.cs b/PROMS/VEPROMS.CSLA.Library/NewGenerated/CommonRules.cs deleted file mode 100644 index b59fd468..00000000 --- a/PROMS/VEPROMS.CSLA.Library/NewGenerated/CommonRules.cs +++ /dev/null @@ -1,40 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -using System.Reflection; -namespace VEPROMS.CSLA.Library -{ - /// - /// CommonRules Generated by MyGeneration using the CSLA Object Mapping template - /// - public static class CommonRules - { - public static bool Required(object target, Csla.Validation.RuleArgs e) - { - PropertyInfo propertyInfoObj = target.GetType().GetProperty(e.PropertyName); - if (propertyInfoObj == null) return true; - if (propertyInfoObj.GetValue(target, null) == null) - { - e.Description = e.PropertyName + " is a required field"; - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS.CSLA.Library/NewGenerated/Database.cs b/PROMS/VEPROMS.CSLA.Library/NewGenerated/Database.cs deleted file mode 100644 index a92a62b8..00000000 --- a/PROMS/VEPROMS.CSLA.Library/NewGenerated/Database.cs +++ /dev/null @@ -1,144 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Diagnostics; -namespace VEPROMS.CSLA.Library -{ - /// - /// Database Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public static partial class Database - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - public static void LogException(string s, Exception ex) - { - int i = 0; - Console.WriteLine("Error - {0}", s); - for (; ex != null; ex = ex.InnerException) - { - Console.WriteLine("{0}{1} - {2}", "".PadLeft(++i * 2), ex.GetType().ToString(), ex.Message); - } - } - private static bool _LoggingInfo = false; // By default don't log info - public static bool LoggingInfo - { - get { return _LoggingInfo; } - set { _LoggingInfo = value; } - } - static System.Diagnostics.Process _CurrentProcess = System.Diagnostics.Process.GetCurrentProcess(); - public static void LogInfo(string s, int hashCode) - { - if (_LoggingInfo) - Console.WriteLine("{0} MB {1}", _CurrentProcess.WorkingSet64 / 1000000, string.Format(s, hashCode)); - } - public static void LogDebug(string s, int hashCode) - { - if (_LoggingInfo) - Console.WriteLine("{0} MB {1}", _CurrentProcess.WorkingSet64 / 1000000, string.Format(s, hashCode)); - } - private static string _ConnectionName = "VEPROMS"; - public static string ConnectionName - { - get { return Database._ConnectionName; } - set { Database._ConnectionName = value; } - } - public static string VEPROMS_Connection - { - get - { - DateTime.Today.ToLongDateString(); - ConnectionStringSettings cs = ConfigurationManager.ConnectionStrings[ConnectionName]; - if (cs == null) - { - throw new ApplicationException("Database.cs Could not find connection " + ConnectionName); - } - return cs.ConnectionString; - } - } - public static SqlConnection VEPROMS_SqlConnection - { - get - { - string strConn = VEPROMS_Connection; // If failure - Fail (Don't try to catch) - // Attempt to make a connection - try - { - SqlConnection cn = new SqlConnection(strConn); - cn.Open(); - return cn; - } - catch (SqlException exsql) - { - const string strAttachError = "An attempt to attach an auto-named database for file "; - if (exsql.Message.StartsWith(strAttachError)) - {// Check to see if the file is missing - string sFile = exsql.Message.Substring(strAttachError.Length); - sFile = sFile.Substring(0, sFile.IndexOf(" failed")); - // "An attempt to attach an auto-named database for file failed" - if (strConn.ToLower().IndexOf("user instance=true") < 0) - { - throw new ApplicationException("Connection String missing attribute: User Instance=True"); - } - if (System.IO.File.Exists(sFile)) - { - throw new ApplicationException("Database file " + sFile + " Cannot be opened\r\n", exsql); - } - else - { - throw new FileNotFoundException("Database file " + sFile + " Not Found", exsql); - } - } - else - { - throw new ApplicationException("Failure on Connect", exsql); - } - } - catch (Exception ex)// Throw Application Exception on Failure - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection Error", ex); - throw new ApplicationException("Failure on Connect", ex); - } - } - } - public static void PurgeData() - { - try - { - SqlConnection cn = VEPROMS_SqlConnection; - SqlCommand cmd = new SqlCommand("purgedata", cn); - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.ExecuteNonQuery(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Purge Error", ex); - throw new ApplicationException("Failure on Purge", ex); - } - } - } - public class DbCslaException : Exception - { - internal DbCslaException(string message, Exception innerException) : base(message, innerException) { ;} - internal DbCslaException(string message) : base(message) { ;} - internal DbCslaException() : base() { ;} - } // Class -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/NewGenerated/Owner.cs b/PROMS/VEPROMS.CSLA.Library/NewGenerated/Owner.cs deleted file mode 100644 index 30a7d78c..00000000 --- a/PROMS/VEPROMS.CSLA.Library/NewGenerated/Owner.cs +++ /dev/null @@ -1,986 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Owner Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(OwnerConverter))] - public partial class Owner : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshOwners = new List(); - private void AddToRefreshList(List refreshOwners) - { - if (IsDirty) - refreshOwners.Add(this); - } - private void ClearRefreshList() - { - _RefreshOwners = new List(); - } - private void BuildRefreshList() - { - ClearRefreshList(); - AddToRefreshList(_RefreshOwners); - } - private void ProcessRefreshList() - { - foreach (Owner tmp in _RefreshOwners) - { - OwnerInfo.Refresh(tmp); - } - ClearRefreshList(); - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Owner owner) - { - if (!_CacheList.Contains(owner)) _CacheList.Add(owner); // In AddToCache - } - protected static void RemoveFromCache(Owner owner) - { - while (_CacheList.Contains(owner)) _CacheList.Remove(owner); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - while (_CacheList.Count > 0) // Move Owner(s) from temporary _CacheList to _CacheByPrimaryKey - { - Owner tmp = _CacheList[0]; // Get the first Owner - string pKey = tmp.OwnerID.ToString(); - if (!_CacheByPrimaryKey.ContainsKey(pKey)) - { - _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list - _CacheList.RemoveAt(0); // Remove the first Owner - } - } - protected static Owner GetCachedByPrimaryKey(int ownerID) - { - ConvertListToDictionary(); - string key = ownerID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextOwnerID = -1; - public static int NextOwnerID - { - get { return _nextOwnerID--; } - } - private int _OwnerID; - [System.ComponentModel.DataObjectField(true, true)] - public int OwnerID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _OwnerID; - } - } - private int _SessionID; - public int SessionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _SessionID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_SessionID != value) - { - _SessionID = value; - PropertyHasChanged(); - } - } - } - private byte _OwnerType; - public byte OwnerType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _OwnerType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_OwnerType != value) - { - _OwnerType = value; - PropertyHasChanged(); - } - } - } - private int _OwnerItemID; - public int OwnerItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _OwnerItemID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_OwnerItemID != value) - { - _OwnerItemID = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTSStart = new DateTime(); - public DateTime DTSStart - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTSStart; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTSStart != value) - { - _DTSStart = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - public override bool IsDirty - { - get { return base.IsDirty; } - } - public bool IsDirtyList(List list) - { - return base.IsDirty; - } - public override bool IsValid - { - get { return (IsNew && !IsDirty) ? true : base.IsValid; } - } - public bool IsValidList(List list) - { - return (IsNew && !IsDirty) ? true : base.IsValid; - } - // CSLATODO: Replace base Owner.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Owner - //public override string ToString() - //{ - // return base.ToString(); - //} - // CSLATODO: Check Owner.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Owner - protected override object GetIdValue() - { - return MyOwnerUnique; // Absolutely Unique ID - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - //ValidationRules.AddDependantProperty("x", "y"); - _OwnerExtension.AddValidationRules(ValidationRules); - // CSLATODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _OwnerExtension.AddInstanceValidationRules(ValidationRules); - // CSLATODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //CSLATODO: Who can read/write which fields - //AuthorizationRules.AllowRead(OwnerID, ""); - //AuthorizationRules.AllowRead(SessionID, ""); - //AuthorizationRules.AllowRead(OwnerType, ""); - //AuthorizationRules.AllowRead(OwnerItemID, ""); - //AuthorizationRules.AllowRead(DTSStart, ""); - //AuthorizationRules.AllowWrite(SessionID, ""); - //AuthorizationRules.AllowWrite(OwnerType, ""); - //AuthorizationRules.AllowWrite(OwnerItemID, ""); - //AuthorizationRules.AllowWrite(DTSStart, ""); - _OwnerExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //CSLATODO: Who can read/write which fields - _OwnerExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // CSLATODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // CSLATODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // CSLATODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // CSLATODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _OwnerUnique = 0; - protected static int OwnerUnique - { get { return ++_OwnerUnique; } } - private int _MyOwnerUnique = OwnerUnique; - public int MyOwnerUnique // Absolutely Unique ID - Editable - { get { return _MyOwnerUnique; } } - protected Owner() - {/* require use of factory methods */ - AddToCache(this); - } - private bool _Disposed = false; - private static int _CountCreated = 0; - private static int _CountDisposed = 0; - private static int _CountFinalized = 0; - private static int IncrementCountCreated - { get { return ++_CountCreated; } } - private int _CountWhenCreated = IncrementCountCreated; - public static int CountCreated - { get { return _CountCreated; } } - public static int CountNotDisposed - { get { return _CountCreated - _CountDisposed; } } - public static int CountNotFinalized - { get { return _CountCreated - _CountFinalized; } } - ~Owner() - { - _CountFinalized++; - } - public void Dispose() - { - if (_Disposed) return; - _CountDisposed++; - _Disposed = true; - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(OwnerID.ToString())) - { - List listOwner = _CacheByPrimaryKey[OwnerID.ToString()]; // Get the list of items - while (listOwner.Contains(this)) listOwner.Remove(this); // Remove the item from the list - if (listOwner.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(OwnerID.ToString()); // remove the list - } - } - public static Owner New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Owner"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Owner.New", ex); - } - } - public static Owner New(int sessionID, byte ownerType, int ownerItemID, DateTime dTSStart) - { - Owner tmp = Owner.New(); - tmp.SessionID = sessionID; - tmp.OwnerType = ownerType; - tmp.OwnerItemID = ownerItemID; - tmp.DTSStart = dTSStart; - return tmp; - } - public static Owner MakeOwner(int sessionID, byte ownerType, int ownerItemID, DateTime dTSStart) - { - Owner tmp = Owner.New(sessionID, ownerType, ownerItemID, dTSStart); - if (tmp.IsSavable) - tmp = tmp.Save(); - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Owner Get(int ownerID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Owner"); - try - { - Owner tmp = GetCachedByPrimaryKey(ownerID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(ownerID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Owner - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Owner.Get", ex); - } - } - public static Owner Get(SafeDataReader dr) - { - if (dr.Read()) return new Owner(dr); - return null; - } - internal Owner(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int ownerID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Owner"); - try - { - DataPortal.Delete(new PKCriteria(ownerID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Owner.Delete", ex); - } - } - public override Owner Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Owner"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Owner"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Owner"); - try - { - BuildRefreshList(); - Owner owner = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(owner);//Refresh the item in AllList - ProcessRefreshList(); - return owner; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _OwnerID; - public int OwnerID - { get { return _OwnerID; } } - public PKCriteria(int ownerID) - { - _OwnerID = ownerID; - } - } - // CSLATODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _OwnerID = NextOwnerID; - // Database Defaults - _SessionID = _OwnerExtension.DefaultSessionID; - _OwnerType = _OwnerExtension.DefaultOwnerType; - _OwnerItemID = _OwnerExtension.DefaultOwnerItemID; - _DTSStart = _OwnerExtension.DefaultDTSStart; - // CSLATODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Owner.ReadData", GetHashCode()); - try - { - _OwnerID = dr.GetInt32("OwnerID"); - _SessionID = dr.GetInt32("SessionID"); - _OwnerType = dr.GetByte("OwnerType"); - _OwnerItemID = dr.GetInt32("OwnerItemID"); - _DTSStart = dr.GetDateTime("DTSStart"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Owner.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Owner.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Owner.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getOwner"; - cm.Parameters.AddWithValue("@OwnerID", criteria.OwnerID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Owner.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Owner.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Owner.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Owner.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Owner.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addOwner"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@SessionID", _SessionID); - cm.Parameters.AddWithValue("@OwnerType", _OwnerType); - cm.Parameters.AddWithValue("@OwnerItemID", _OwnerItemID); - if (_DTSStart.Year >= 1753 && _DTSStart.Year <= 9999) cm.Parameters.AddWithValue("@DTSStart", _DTSStart); - // Output Calculated Columns - SqlParameter param_OwnerID = new SqlParameter("@newOwnerID", SqlDbType.Int); - param_OwnerID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_OwnerID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _OwnerID = (int)cm.Parameters["@newOwnerID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Owner.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Owner.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Owner.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int ownerID, int sessionID, byte ownerType, int ownerItemID, DateTime dTSStart) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Owner.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addOwner"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@SessionID", sessionID); - cm.Parameters.AddWithValue("@OwnerType", ownerType); - cm.Parameters.AddWithValue("@OwnerItemID", ownerItemID); - if (dTSStart.Year >= 1753 && dTSStart.Year <= 9999) cm.Parameters.AddWithValue("@DTSStart", dTSStart); - // Output Calculated Columns - SqlParameter param_OwnerID = new SqlParameter("@newOwnerID", SqlDbType.Int); - param_OwnerID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_OwnerID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - ownerID = (int)cm.Parameters["@newOwnerID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Owner.Add", ex); - throw new DbCslaException("Owner.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Owner.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Owner.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Owner.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateOwner"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@OwnerID", _OwnerID); - cm.Parameters.AddWithValue("@SessionID", _SessionID); - cm.Parameters.AddWithValue("@OwnerType", _OwnerType); - cm.Parameters.AddWithValue("@OwnerItemID", _OwnerItemID); - if (_DTSStart.Year >= 1753 && _DTSStart.Year <= 9999) cm.Parameters.AddWithValue("@DTSStart", _DTSStart); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Owner.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Owner.Add(cn, ref _OwnerID, _SessionID, _OwnerType, _OwnerItemID, _DTSStart); - else - _LastChanged = Owner.Update(cn, ref _OwnerID, _SessionID, _OwnerType, _OwnerItemID, _DTSStart, ref _LastChanged); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int ownerID, int sessionID, byte ownerType, int ownerItemID, DateTime dTSStart, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Owner.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateOwner"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@OwnerID", ownerID); - cm.Parameters.AddWithValue("@SessionID", sessionID); - cm.Parameters.AddWithValue("@OwnerType", ownerType); - cm.Parameters.AddWithValue("@OwnerItemID", ownerItemID); - if (dTSStart.Year >= 1753 && dTSStart.Year <= 9999) cm.Parameters.AddWithValue("@DTSStart", dTSStart); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Owner.Update", ex); - throw new DbCslaException("Owner.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_OwnerID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Owner.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteOwner"; - cm.Parameters.AddWithValue("@OwnerID", criteria.OwnerID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Owner.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Owner.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int ownerID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Owner.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteOwner"; - // Input PK Fields - cm.Parameters.AddWithValue("@OwnerID", ownerID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Owner.Remove", ex); - throw new DbCslaException("Owner.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int ownerID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(ownerID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Owner.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _OwnerID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int ownerID) - { - _OwnerID = ownerID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Owner.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsOwner"; - cm.Parameters.AddWithValue("@OwnerID", _OwnerID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Owner.DataPortal_Execute", ex); - throw new DbCslaException("Owner.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - OwnerExtension _OwnerExtension = new OwnerExtension(); - [Serializable()] - partial class OwnerExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultSessionID - { - get { return 0; } - } - public virtual byte DefaultOwnerType - { - get { return 0; } - } - public virtual int DefaultOwnerItemID - { - get { return 0; } - } - public virtual DateTime DefaultDTSStart - { - get { return DateTime.Now; } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class OwnerConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Owner) - { - // Return the ToString value - return ((Owner)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create OwnerExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Owner -// { -// partial class OwnerExtension : extensionBase -// { -// // CSLATODO: Override automatic defaults -// public virtual int DefaultSessionID -// { -// get { return 0; } -// } -// public virtual byte DefaultOwnerType -// { -// get { return 0; } -// } -// public virtual int DefaultOwnerItemID -// { -// get { return 0; } -// } -// public virtual DateTime DefaultDTSStart -// { -// get { return DateTime.Now; } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/NewGenerated/OwnerInfo.cs b/PROMS/VEPROMS.CSLA.Library/NewGenerated/OwnerInfo.cs deleted file mode 100644 index c01d2795..00000000 --- a/PROMS/VEPROMS.CSLA.Library/NewGenerated/OwnerInfo.cs +++ /dev/null @@ -1,349 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void OwnerInfoEvent(object sender); - /// - /// OwnerInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(OwnerInfoConverter))] - public partial class OwnerInfo : ReadOnlyBase, IDisposable - { - public event OwnerInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(OwnerInfo ownerInfo) - { - if (!_CacheList.Contains(ownerInfo)) _CacheList.Add(ownerInfo); // In AddToCache - } - protected static void RemoveFromCache(OwnerInfo ownerInfo) - { - while (_CacheList.Contains(ownerInfo)) _CacheList.Remove(ownerInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - while (_CacheList.Count > 0) // Move OwnerInfo(s) from temporary _CacheList to _CacheByPrimaryKey - { - OwnerInfo tmp = _CacheList[0]; // Get the first OwnerInfo - string pKey = tmp.OwnerID.ToString(); - if (!_CacheByPrimaryKey.ContainsKey(pKey)) - { - _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list - _CacheList.RemoveAt(0); // Remove the first OwnerInfo - } - } - internal static void AddList(OwnerInfoList lst) - { - foreach (OwnerInfo item in lst) AddToCache(item); - } - protected static OwnerInfo GetCachedByPrimaryKey(int ownerID) - { - ConvertListToDictionary(); - string key = ownerID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Owner _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _OwnerID; - [System.ComponentModel.DataObjectField(true, true)] - public int OwnerID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _OwnerID; - } - } - private int _SessionID; - public int SessionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _SessionID; - } - } - private byte _OwnerType; - public byte OwnerType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _OwnerType; - } - } - private int _OwnerItemID; - public int OwnerItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _OwnerItemID; - } - } - private DateTime _DTSStart = new DateTime(); - public DateTime DTSStart - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTSStart; - } - } - // CSLATODO: Replace base OwnerInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current OwnerInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // CSLATODO: Check OwnerInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current OwnerInfo - protected override object GetIdValue() - { - return MyOwnerInfoUnique; // Absolutely Unique ID - } - #endregion - #region Factory Methods - private static int _OwnerInfoUnique = 0; - private static int OwnerInfoUnique - { get { return ++_OwnerInfoUnique; } } - private int _MyOwnerInfoUnique = OwnerInfoUnique; - public int MyOwnerInfoUnique // Absolutely Unique ID - Info - { get { return _MyOwnerInfoUnique; } } - protected OwnerInfo() - {/* require use of factory methods */ - AddToCache(this); - } - private bool _Disposed = false; - private static int _CountCreated = 0; - private static int _CountDisposed = 0; - private static int _CountFinalized = 0; - private static int IncrementCountCreated - { get { return ++_CountCreated; } } - private int _CountWhenCreated = IncrementCountCreated; - public static int CountCreated - { get { return _CountCreated; } } - public static int CountNotDisposed - { get { return _CountCreated - _CountDisposed; } } - public static int CountNotFinalized - { get { return _CountCreated - _CountFinalized; } } - ~OwnerInfo() - { - _CountFinalized++; - } - public void Dispose() - { - if (_Disposed) return; - _CountDisposed++; - _Disposed = true; - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(OwnerID.ToString())) return; - List listOwnerInfo = _CacheByPrimaryKey[OwnerID.ToString()]; // Get the list of items - while (listOwnerInfo.Contains(this)) listOwnerInfo.Remove(this); // Remove the item from the list - if (listOwnerInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(OwnerID.ToString()); // remove the list - } - public virtual Owner Get() - { - return _Editable = Owner.Get(_OwnerID); - } - public static void Refresh(Owner tmp) - { - string key = tmp.OwnerID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (OwnerInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Owner tmp) - { - _SessionID = tmp.SessionID; - _OwnerType = tmp.OwnerType; - _OwnerItemID = tmp.OwnerItemID; - _DTSStart = tmp.DTSStart; - _OwnerInfoExtension.Refresh(this); - OnChange();// raise an event - } - public static OwnerInfo Get(int ownerID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Owner"); - try - { - OwnerInfo tmp = GetCachedByPrimaryKey(ownerID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(ownerID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up OwnerInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on OwnerInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal OwnerInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfo.Constructor", ex); - throw new DbCslaException("OwnerInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _OwnerID; - public int OwnerID - { get { return _OwnerID; } } - public PKCriteria(int ownerID) - { - _OwnerID = ownerID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfo.ReadData", GetHashCode()); - try - { - _OwnerID = dr.GetInt32("OwnerID"); - _SessionID = dr.GetInt32("SessionID"); - _OwnerType = dr.GetByte("OwnerType"); - _OwnerItemID = dr.GetInt32("OwnerItemID"); - _DTSStart = dr.GetDateTime("DTSStart"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("OwnerInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getOwner"; - cm.Parameters.AddWithValue("@OwnerID", criteria.OwnerID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("OwnerInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - OwnerInfoExtension _OwnerInfoExtension = new OwnerInfoExtension(); - [Serializable()] - partial class OwnerInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(OwnerInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class OwnerInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is OwnerInfo) - { - // Return the ToString value - return ((OwnerInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/NewGenerated/OwnerInfoList.cs b/PROMS/VEPROMS.CSLA.Library/NewGenerated/OwnerInfoList.cs deleted file mode 100644 index 746db559..00000000 --- a/PROMS/VEPROMS.CSLA.Library/NewGenerated/OwnerInfoList.cs +++ /dev/null @@ -1,225 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// OwnerInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(OwnerInfoListConverter))] - public partial class OwnerInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (OwnerInfo tmp in this) - { - tmp.Changed += new OwnerInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - private bool _Disposed = false; - private static int _CountCreated = 0; - private static int _CountDisposed = 0; - private static int _CountFinalized = 0; - private static int IncrementCountCreated - { get { return ++_CountCreated; } } - private int _CountWhenCreated = IncrementCountCreated; - public static int CountCreated - { get { return _CountCreated; } } - public static int CountNotDisposed - { get { return _CountCreated - _CountDisposed; } } - public static int CountNotFinalized - { get { return _CountCreated - _CountFinalized; } } - ~OwnerInfoList() - { - _CountFinalized++; - } - public void Dispose() - { - if (_Disposed) return; - _CountDisposed++; - _Disposed = true; - foreach (OwnerInfo tmp in this) - { - tmp.Changed -= new OwnerInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static OwnerInfoList _OwnerInfoList = null; - /// - /// Return a list of all OwnerInfo. - /// - public static OwnerInfoList Get() - { - try - { - if (_OwnerInfoList != null) - return _OwnerInfoList; - OwnerInfoList tmp = DataPortal.Fetch(); - OwnerInfo.AddList(tmp); - tmp.AddEvents(); - _OwnerInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on OwnerInfoList.Get", ex); - } - } - /// - /// Reset the list of all OwnerInfo. - /// - public static void Reset() - { - _OwnerInfoList = null; - } - // CSLATODO: Add alternative gets - - //public static OwnerInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on OwnerInfoList.Get", ex); - // } - //} - private OwnerInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] OwnerInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getOwners"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new OwnerInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("OwnerInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("OwnerInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - OwnerInfoListPropertyDescriptor pd = new OwnerInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class OwnerInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private OwnerInfo Item { get { return (OwnerInfo)_Item; } } - public OwnerInfoListPropertyDescriptor(OwnerInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class OwnerInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is OwnerInfoList) - { - // Return department and department role separated by comma. - return ((OwnerInfoList)value).Items.Count.ToString() + " Owners"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/NewGenerated/PropertyDescriptor.cs b/PROMS/VEPROMS.CSLA.Library/NewGenerated/PropertyDescriptor.cs deleted file mode 100644 index 020ffbe7..00000000 --- a/PROMS/VEPROMS.CSLA.Library/NewGenerated/PropertyDescriptor.cs +++ /dev/null @@ -1,67 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// PropertyDescriptor Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class vlnListPropertyDescriptor : PropertyDescriptor - { - protected object _Item = null; - public vlnListPropertyDescriptor(System.Collections.IList collection, int index) - : base("#" + index.ToString(), null) - { _Item = collection[index]; } - public override bool CanResetValue(object component) - { return true; } - public override Type ComponentType - { get { return _Item.GetType(); } } - public override object GetValue(object component) - { return _Item; } - public override bool IsReadOnly - { get { return false; } } - public override Type PropertyType - { get { return _Item.GetType(); } } - public override void ResetValue(object component) - { ;} - public override bool ShouldSerializeValue(object component) - { return true; } - public override void SetValue(object component, object value) - { /*_Item = value*/;} - //public override AttributeCollection Attributes - //{ get { return new AttributeCollection(null); } } - public override string DisplayName - { get { return _Item.ToString(); } } - public override string Description - { get { return _Item.ToString(); } } - public override string Name - { get { return _Item.ToString(); } } - } // Class - public interface IVEHasBrokenRules - { - IVEHasBrokenRules HasBrokenRules { get; } - BrokenRulesCollection BrokenRules { get; } - } -} // Namespace -// The following are samples of ToString overrides -// public partial class Owner -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class OwnerInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } \ No newline at end of file diff --git a/PROMS/VEPROMS.CSLA.Library/NewGenerated/Session.cs b/PROMS/VEPROMS.CSLA.Library/NewGenerated/Session.cs deleted file mode 100644 index 59026810..00000000 --- a/PROMS/VEPROMS.CSLA.Library/NewGenerated/Session.cs +++ /dev/null @@ -1,1072 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Session Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(SessionConverter))] - public partial class Session : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshSessions = new List(); - private void AddToRefreshList(List refreshSessions) - { - if (IsDirty) - refreshSessions.Add(this); - } - private void ClearRefreshList() - { - _RefreshSessions = new List(); - } - private void BuildRefreshList() - { - ClearRefreshList(); - AddToRefreshList(_RefreshSessions); - } - private void ProcessRefreshList() - { - foreach (Session tmp in _RefreshSessions) - { - SessionInfo.Refresh(tmp); - } - ClearRefreshList(); - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Session session) - { - if (!_CacheList.Contains(session)) _CacheList.Add(session); // In AddToCache - } - protected static void RemoveFromCache(Session session) - { - while (_CacheList.Contains(session)) _CacheList.Remove(session); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - while (_CacheList.Count > 0) // Move Session(s) from temporary _CacheList to _CacheByPrimaryKey - { - Session tmp = _CacheList[0]; // Get the first Session - string pKey = tmp.SessionID.ToString(); - if (!_CacheByPrimaryKey.ContainsKey(pKey)) - { - _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list - _CacheList.RemoveAt(0); // Remove the first Session - } - } - protected static Session GetCachedByPrimaryKey(int sessionID) - { - ConvertListToDictionary(); - string key = sessionID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextSessionID = -1; - public static int NextSessionID - { - get { return _nextSessionID--; } - } - private int _SessionID; - [System.ComponentModel.DataObjectField(true, true)] - public int SessionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _SessionID; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTSDtart = new DateTime(); - public DateTime DTSDtart - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTSDtart; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTSDtart != value) - { - _DTSDtart = value; - PropertyHasChanged(); - } - } - } - private DateTime? _DTSEnd; - public DateTime? DTSEnd - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTSEnd; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTSEnd != value) - { - _DTSEnd = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTSActivity = new DateTime(); - public DateTime DTSActivity - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTSActivity; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTSActivity != value) - { - _DTSActivity = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private string _MachineName = string.Empty; - public string MachineName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _MachineName; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_MachineName != value) - { - _MachineName = value; - PropertyHasChanged(); - } - } - } - private int _ProcessID; - public int ProcessID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ProcessID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_ProcessID != value) - { - _ProcessID = value; - PropertyHasChanged(); - } - } - } - public override bool IsDirty - { - get { return base.IsDirty; } - } - public bool IsDirtyList(List list) - { - return base.IsDirty; - } - public override bool IsValid - { - get { return (IsNew && !IsDirty) ? true : base.IsValid; } - } - public bool IsValidList(List list) - { - return (IsNew && !IsDirty) ? true : base.IsValid; - } - // CSLATODO: Replace base Session.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Session - //public override string ToString() - //{ - // return base.ToString(); - //} - // CSLATODO: Check Session.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Session - protected override object GetIdValue() - { - return MySessionUnique; // Absolutely Unique ID - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "MachineName"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("MachineName", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _SessionExtension.AddValidationRules(ValidationRules); - // CSLATODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _SessionExtension.AddInstanceValidationRules(ValidationRules); - // CSLATODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //CSLATODO: Who can read/write which fields - //AuthorizationRules.AllowRead(SessionID, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowRead(DTSDtart, ""); - //AuthorizationRules.AllowRead(DTSEnd, ""); - //AuthorizationRules.AllowRead(DTSActivity, ""); - //AuthorizationRules.AllowRead(MachineName, ""); - //AuthorizationRules.AllowRead(ProcessID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - //AuthorizationRules.AllowWrite(DTSDtart, ""); - //AuthorizationRules.AllowWrite(DTSEnd, ""); - //AuthorizationRules.AllowWrite(DTSActivity, ""); - //AuthorizationRules.AllowWrite(MachineName, ""); - //AuthorizationRules.AllowWrite(ProcessID, ""); - _SessionExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //CSLATODO: Who can read/write which fields - _SessionExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // CSLATODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // CSLATODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // CSLATODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // CSLATODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _SessionUnique = 0; - protected static int SessionUnique - { get { return ++_SessionUnique; } } - private int _MySessionUnique = SessionUnique; - public int MySessionUnique // Absolutely Unique ID - Editable - { get { return _MySessionUnique; } } - protected Session() - {/* require use of factory methods */ - AddToCache(this); - } - private bool _Disposed = false; - private static int _CountCreated = 0; - private static int _CountDisposed = 0; - private static int _CountFinalized = 0; - private static int IncrementCountCreated - { get { return ++_CountCreated; } } - private int _CountWhenCreated = IncrementCountCreated; - public static int CountCreated - { get { return _CountCreated; } } - public static int CountNotDisposed - { get { return _CountCreated - _CountDisposed; } } - public static int CountNotFinalized - { get { return _CountCreated - _CountFinalized; } } - ~Session() - { - _CountFinalized++; - } - public void Dispose() - { - if (_Disposed) return; - _CountDisposed++; - _Disposed = true; - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(SessionID.ToString())) - { - List listSession = _CacheByPrimaryKey[SessionID.ToString()]; // Get the list of items - while (listSession.Contains(this)) listSession.Remove(this); // Remove the item from the list - if (listSession.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(SessionID.ToString()); // remove the list - } - } - public static Session New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Session"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Session.New", ex); - } - } - public static Session New(string machineName, int processID) - { - Session tmp = Session.New(); - tmp.MachineName = machineName; - tmp.ProcessID = processID; - return tmp; - } - public static Session New(string userID, DateTime dTSDtart, DateTime? dTSEnd, DateTime dTSActivity, string machineName, int processID) - { - Session tmp = Session.New(); - tmp.UserID = userID; - tmp.DTSDtart = dTSDtart; - tmp.DTSEnd = dTSEnd; - tmp.DTSActivity = dTSActivity; - tmp.MachineName = machineName; - tmp.ProcessID = processID; - return tmp; - } - public static Session MakeSession(string userID, DateTime dTSDtart, DateTime? dTSEnd, DateTime dTSActivity, string machineName, int processID) - { - Session tmp = Session.New(userID, dTSDtart, dTSEnd, dTSActivity, machineName, processID); - if (tmp.IsSavable) - tmp = tmp.Save(); - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Session New(DateTime? dTSEnd, string machineName, int processID) - { - Session tmp = Session.New(); - tmp.DTSEnd = dTSEnd; - tmp.MachineName = machineName; - tmp.ProcessID = processID; - return tmp; - } - public static Session MakeSession(DateTime? dTSEnd, string machineName, int processID) - { - Session tmp = Session.New(dTSEnd, machineName, processID); - if (tmp.IsSavable) - tmp = tmp.Save(); - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Session Get(int sessionID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Session"); - try - { - Session tmp = GetCachedByPrimaryKey(sessionID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(sessionID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Session - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Session.Get", ex); - } - } - public static Session Get(SafeDataReader dr) - { - if (dr.Read()) return new Session(dr); - return null; - } - internal Session(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int sessionID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Session"); - try - { - DataPortal.Delete(new PKCriteria(sessionID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Session.Delete", ex); - } - } - public override Session Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Session"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Session"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Session"); - try - { - BuildRefreshList(); - Session session = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(session);//Refresh the item in AllList - ProcessRefreshList(); - return session; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _SessionID; - public int SessionID - { get { return _SessionID; } } - public PKCriteria(int sessionID) - { - _SessionID = sessionID; - } - } - // CSLATODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _SessionID = NextSessionID; - // Database Defaults - _UserID = _SessionExtension.DefaultUserID; - _DTSDtart = _SessionExtension.DefaultDTSDtart; - _DTSActivity = _SessionExtension.DefaultDTSActivity; - // CSLATODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Session.ReadData", GetHashCode()); - try - { - _SessionID = dr.GetInt32("SessionID"); - _UserID = dr.GetString("UserID"); - _DTSDtart = dr.GetDateTime("DTSDtart"); - if (!dr.IsDBNull(dr.GetOrdinal("DTSEnd"))) _DTSEnd = dr.GetDateTime("DTSEnd"); - _DTSActivity = dr.GetDateTime("DTSActivity"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _MachineName = dr.GetString("MachineName"); - _ProcessID = dr.GetInt32("ProcessID"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Session.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Session.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getSession"; - cm.Parameters.AddWithValue("@SessionID", criteria.SessionID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Session.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Session.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Session.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addSession"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@UserID", _UserID); - if (_DTSDtart.Year >= 1753 && _DTSDtart.Year <= 9999) cm.Parameters.AddWithValue("@DTSDtart", _DTSDtart); - if (_DTSEnd != null && ((DateTime)_DTSEnd).Year >= 1753 && ((DateTime)_DTSEnd).Year <= 9999) cm.Parameters.AddWithValue("@DTSEnd", _DTSEnd); - if (_DTSActivity.Year >= 1753 && _DTSActivity.Year <= 9999) cm.Parameters.AddWithValue("@DTSActivity", _DTSActivity); - cm.Parameters.AddWithValue("@MachineName", _MachineName); - cm.Parameters.AddWithValue("@ProcessID", _ProcessID); - // Output Calculated Columns - SqlParameter param_SessionID = new SqlParameter("@newSessionID", SqlDbType.Int); - param_SessionID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_SessionID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _SessionID = (int)cm.Parameters["@newSessionID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Session.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Session.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int sessionID, string userID, DateTime dTSDtart, DateTime? dTSEnd, DateTime dTSActivity, string machineName, int processID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Session.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addSession"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@UserID", userID); - if (dTSDtart.Year >= 1753 && dTSDtart.Year <= 9999) cm.Parameters.AddWithValue("@DTSDtart", dTSDtart); - if (dTSEnd != null && ((DateTime)dTSEnd).Year >= 1753 && ((DateTime)dTSEnd).Year <= 9999) cm.Parameters.AddWithValue("@DTSEnd", dTSEnd); - if (dTSActivity.Year >= 1753 && dTSActivity.Year <= 9999) cm.Parameters.AddWithValue("@DTSActivity", dTSActivity); - cm.Parameters.AddWithValue("@MachineName", machineName); - cm.Parameters.AddWithValue("@ProcessID", processID); - // Output Calculated Columns - SqlParameter param_SessionID = new SqlParameter("@newSessionID", SqlDbType.Int); - param_SessionID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_SessionID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - sessionID = (int)cm.Parameters["@newSessionID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session.Add", ex); - throw new DbCslaException("Session.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Session.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Session.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateSession"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@SessionID", _SessionID); - cm.Parameters.AddWithValue("@UserID", _UserID); - if (_DTSDtart.Year >= 1753 && _DTSDtart.Year <= 9999) cm.Parameters.AddWithValue("@DTSDtart", _DTSDtart); - if (_DTSEnd != null && ((DateTime)_DTSEnd).Year >= 1753 && ((DateTime)_DTSEnd).Year <= 9999) cm.Parameters.AddWithValue("@DTSEnd", _DTSEnd); - if (_DTSActivity.Year >= 1753 && _DTSActivity.Year <= 9999) cm.Parameters.AddWithValue("@DTSActivity", _DTSActivity); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - cm.Parameters.AddWithValue("@MachineName", _MachineName); - cm.Parameters.AddWithValue("@ProcessID", _ProcessID); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Session.Add(cn, ref _SessionID, _UserID, _DTSDtart, _DTSEnd, _DTSActivity, _MachineName, _ProcessID); - else - _LastChanged = Session.Update(cn, ref _SessionID, _UserID, _DTSDtart, _DTSEnd, _DTSActivity, ref _LastChanged, _MachineName, _ProcessID); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int sessionID, string userID, DateTime dTSDtart, DateTime? dTSEnd, DateTime dTSActivity, ref byte[] lastChanged, string machineName, int processID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Session.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateSession"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@SessionID", sessionID); - cm.Parameters.AddWithValue("@UserID", userID); - if (dTSDtart.Year >= 1753 && dTSDtart.Year <= 9999) cm.Parameters.AddWithValue("@DTSDtart", dTSDtart); - if (dTSEnd != null && ((DateTime)dTSEnd).Year >= 1753 && ((DateTime)dTSEnd).Year <= 9999) cm.Parameters.AddWithValue("@DTSEnd", dTSEnd); - if (dTSActivity.Year >= 1753 && dTSActivity.Year <= 9999) cm.Parameters.AddWithValue("@DTSActivity", dTSActivity); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - cm.Parameters.AddWithValue("@MachineName", machineName); - cm.Parameters.AddWithValue("@ProcessID", processID); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session.Update", ex); - throw new DbCslaException("Session.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_SessionID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Session.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteSession"; - cm.Parameters.AddWithValue("@SessionID", criteria.SessionID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Session.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int sessionID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Session.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteSession"; - // Input PK Fields - cm.Parameters.AddWithValue("@SessionID", sessionID); - // CSLATODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session.Remove", ex); - throw new DbCslaException("Session.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int sessionID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(sessionID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Session.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _SessionID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int sessionID) - { - _SessionID = sessionID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Session.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsSession"; - cm.Parameters.AddWithValue("@SessionID", _SessionID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Session.DataPortal_Execute", ex); - throw new DbCslaException("Session.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - SessionExtension _SessionExtension = new SessionExtension(); - [Serializable()] - partial class SessionExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - public virtual DateTime DefaultDTSDtart - { - get { return DateTime.Now; } - } - public virtual DateTime DefaultDTSActivity - { - get { return DateTime.Now; } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class SessionConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Session) - { - // Return the ToString value - return ((Session)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create SessionExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Session -// { -// partial class SessionExtension : extensionBase -// { -// // CSLATODO: Override automatic defaults -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public virtual DateTime DefaultDTSDtart -// { -// get { return DateTime.Now; } -// } -// public virtual DateTime DefaultDTSActivity -// { -// get { return DateTime.Now; } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/NewGenerated/SessionInfo.cs b/PROMS/VEPROMS.CSLA.Library/NewGenerated/SessionInfo.cs deleted file mode 100644 index 38d9ff98..00000000 --- a/PROMS/VEPROMS.CSLA.Library/NewGenerated/SessionInfo.cs +++ /dev/null @@ -1,371 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void SessionInfoEvent(object sender); - /// - /// SessionInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(SessionInfoConverter))] - public partial class SessionInfo : ReadOnlyBase, IDisposable - { - public event SessionInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(SessionInfo sessionInfo) - { - if (!_CacheList.Contains(sessionInfo)) _CacheList.Add(sessionInfo); // In AddToCache - } - protected static void RemoveFromCache(SessionInfo sessionInfo) - { - while (_CacheList.Contains(sessionInfo)) _CacheList.Remove(sessionInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - while (_CacheList.Count > 0) // Move SessionInfo(s) from temporary _CacheList to _CacheByPrimaryKey - { - SessionInfo tmp = _CacheList[0]; // Get the first SessionInfo - string pKey = tmp.SessionID.ToString(); - if (!_CacheByPrimaryKey.ContainsKey(pKey)) - { - _CacheByPrimaryKey[pKey] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[pKey].Add(tmp); // Add to Primary Key list - _CacheList.RemoveAt(0); // Remove the first SessionInfo - } - } - internal static void AddList(SessionInfoList lst) - { - foreach (SessionInfo item in lst) AddToCache(item); - } - protected static SessionInfo GetCachedByPrimaryKey(int sessionID) - { - ConvertListToDictionary(); - string key = sessionID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Session _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _SessionID; - [System.ComponentModel.DataObjectField(true, true)] - public int SessionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _SessionID; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - private DateTime _DTSDtart = new DateTime(); - public DateTime DTSDtart - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTSDtart; - } - } - private DateTime? _DTSEnd; - public DateTime? DTSEnd - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTSEnd; - } - } - private DateTime _DTSActivity = new DateTime(); - public DateTime DTSActivity - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTSActivity; - } - } - private string _MachineName = string.Empty; - public string MachineName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _MachineName; - } - } - private int _ProcessID; - public int ProcessID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ProcessID; - } - } - // CSLATODO: Replace base SessionInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current SessionInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // CSLATODO: Check SessionInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current SessionInfo - protected override object GetIdValue() - { - return MySessionInfoUnique; // Absolutely Unique ID - } - #endregion - #region Factory Methods - private static int _SessionInfoUnique = 0; - private static int SessionInfoUnique - { get { return ++_SessionInfoUnique; } } - private int _MySessionInfoUnique = SessionInfoUnique; - public int MySessionInfoUnique // Absolutely Unique ID - Info - { get { return _MySessionInfoUnique; } } - protected SessionInfo() - {/* require use of factory methods */ - AddToCache(this); - } - private bool _Disposed = false; - private static int _CountCreated = 0; - private static int _CountDisposed = 0; - private static int _CountFinalized = 0; - private static int IncrementCountCreated - { get { return ++_CountCreated; } } - private int _CountWhenCreated = IncrementCountCreated; - public static int CountCreated - { get { return _CountCreated; } } - public static int CountNotDisposed - { get { return _CountCreated - _CountDisposed; } } - public static int CountNotFinalized - { get { return _CountCreated - _CountFinalized; } } - ~SessionInfo() - { - _CountFinalized++; - } - public void Dispose() - { - if (_Disposed) return; - _CountDisposed++; - _Disposed = true; - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(SessionID.ToString())) return; - List listSessionInfo = _CacheByPrimaryKey[SessionID.ToString()]; // Get the list of items - while (listSessionInfo.Contains(this)) listSessionInfo.Remove(this); // Remove the item from the list - if (listSessionInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(SessionID.ToString()); // remove the list - } - public virtual Session Get() - { - return _Editable = Session.Get(_SessionID); - } - public static void Refresh(Session tmp) - { - string key = tmp.SessionID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (SessionInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Session tmp) - { - _UserID = tmp.UserID; - _DTSDtart = tmp.DTSDtart; - _DTSEnd = tmp.DTSEnd; - _DTSActivity = tmp.DTSActivity; - _MachineName = tmp.MachineName; - _ProcessID = tmp.ProcessID; - _SessionInfoExtension.Refresh(this); - OnChange();// raise an event - } - public static SessionInfo Get(int sessionID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Session"); - try - { - SessionInfo tmp = GetCachedByPrimaryKey(sessionID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(sessionID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up SessionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on SessionInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal SessionInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] SessionInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("SessionInfo.Constructor", ex); - throw new DbCslaException("SessionInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _SessionID; - public int SessionID - { get { return _SessionID; } } - public PKCriteria(int sessionID) - { - _SessionID = sessionID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] SessionInfo.ReadData", GetHashCode()); - try - { - _SessionID = dr.GetInt32("SessionID"); - _UserID = dr.GetString("UserID"); - _DTSDtart = dr.GetDateTime("DTSDtart"); - if (!dr.IsDBNull(dr.GetOrdinal("DTSEnd"))) _DTSEnd = dr.GetDateTime("DTSEnd"); - _DTSActivity = dr.GetDateTime("DTSActivity"); - _MachineName = dr.GetString("MachineName"); - _ProcessID = dr.GetInt32("ProcessID"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("SessionInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("SessionInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] SessionInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getSession"; - cm.Parameters.AddWithValue("@SessionID", criteria.SessionID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("SessionInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("SessionInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - SessionInfoExtension _SessionInfoExtension = new SessionInfoExtension(); - [Serializable()] - partial class SessionInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(SessionInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class SessionInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is SessionInfo) - { - // Return the ToString value - return ((SessionInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/NewGenerated/SessionInfoList.cs b/PROMS/VEPROMS.CSLA.Library/NewGenerated/SessionInfoList.cs deleted file mode 100644 index 75d8c7c0..00000000 --- a/PROMS/VEPROMS.CSLA.Library/NewGenerated/SessionInfoList.cs +++ /dev/null @@ -1,225 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// SessionInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(SessionInfoListConverter))] - public partial class SessionInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (SessionInfo tmp in this) - { - tmp.Changed += new SessionInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - private bool _Disposed = false; - private static int _CountCreated = 0; - private static int _CountDisposed = 0; - private static int _CountFinalized = 0; - private static int IncrementCountCreated - { get { return ++_CountCreated; } } - private int _CountWhenCreated = IncrementCountCreated; - public static int CountCreated - { get { return _CountCreated; } } - public static int CountNotDisposed - { get { return _CountCreated - _CountDisposed; } } - public static int CountNotFinalized - { get { return _CountCreated - _CountFinalized; } } - ~SessionInfoList() - { - _CountFinalized++; - } - public void Dispose() - { - if (_Disposed) return; - _CountDisposed++; - _Disposed = true; - foreach (SessionInfo tmp in this) - { - tmp.Changed -= new SessionInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static SessionInfoList _SessionInfoList = null; - /// - /// Return a list of all SessionInfo. - /// - public static SessionInfoList Get() - { - try - { - if (_SessionInfoList != null) - return _SessionInfoList; - SessionInfoList tmp = DataPortal.Fetch(); - SessionInfo.AddList(tmp); - tmp.AddEvents(); - _SessionInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on SessionInfoList.Get", ex); - } - } - /// - /// Reset the list of all SessionInfo. - /// - public static void Reset() - { - _SessionInfoList = null; - } - // CSLATODO: Add alternative gets - - //public static SessionInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on SessionInfoList.Get", ex); - // } - //} - private SessionInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] SessionInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getSessions"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new SessionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("SessionInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("SessionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - SessionInfoListPropertyDescriptor pd = new SessionInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class SessionInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private SessionInfo Item { get { return (SessionInfo)_Item; } } - public SessionInfoListPropertyDescriptor(SessionInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class SessionInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is SessionInfoList) - { - // Return department and department role separated by comma. - return ((SessionInfoList)value).Items.Count.ToString() + " Sessions"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/NewGenerated/addSession.SQL b/PROMS/VEPROMS.CSLA.Library/NewGenerated/addSession.SQL deleted file mode 100644 index 84ed266e..00000000 --- a/PROMS/VEPROMS.CSLA.Library/NewGenerated/addSession.SQL +++ /dev/null @@ -1,55 +0,0 @@ - -/****** Object: StoredProcedure [addSession] ******/ -IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[addSession]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1) - DROP PROCEDURE [addSession]; -GO - -CREATE PROCEDURE [dbo].[addSession] - -( - @UserID nvarchar(100), - @DTSDtart datetime, - @DTSEnd datetime=null, - @DTSActivity datetime, - @MachineName nvarchar(100), - @ProcessID int, - @newSessionID int output, - @newLastChanged timestamp output -) -WITH EXECUTE AS OWNER -AS -BEGIN TRY -- Try Block - BEGIN TRANSACTION - INSERT INTO [Sessions] - ( - [UserID], - [DTSDtart], - [DTSEnd], - [DTSActivity], - [MachineName], - [ProcessID] - ) - VALUES - ( - @UserID, - @DTSDtart, - @DTSEnd, - @DTSActivity, - @MachineName, - @ProcessID - ) - SELECT @newSessionID= SCOPE_IDENTITY() - SELECT @newLastChanged=[LastChanged] - FROM [Sessions] WHERE [SessionID]=@newSessionID - 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: addSession Succeeded' -ELSE PRINT 'Procedure Creation: addSession Error on Creation' -GO diff --git a/PROMS/VEPROMS.CSLA.Library/NewGenerated/deleteSession.SQL b/PROMS/VEPROMS.CSLA.Library/NewGenerated/deleteSession.SQL deleted file mode 100644 index 19689e7f..00000000 --- a/PROMS/VEPROMS.CSLA.Library/NewGenerated/deleteSession.SQL +++ /dev/null @@ -1,29 +0,0 @@ - -/****** Object: StoredProcedure [deleteSession] ******/ -IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[deleteSession]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1) - DROP PROCEDURE [deleteSession]; -GO - -CREATE PROCEDURE [dbo].[deleteSession] - -( - @SessionID int -) -WITH EXECUTE AS OWNER -AS -BEGIN TRY -- Try Block - BEGIN TRANSACTION - DELETE [Sessions] - WHERE [SessionID] = @SessionID - 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: deleteSession Succeeded' -ELSE PRINT 'Procedure Creation: deleteSession Error on Creation' -GO diff --git a/PROMS/VEPROMS.CSLA.Library/NewGenerated/existsSession.SQL b/PROMS/VEPROMS.CSLA.Library/NewGenerated/existsSession.SQL deleted file mode 100644 index 461fdec8..00000000 --- a/PROMS/VEPROMS.CSLA.Library/NewGenerated/existsSession.SQL +++ /dev/null @@ -1,21 +0,0 @@ - -/****** Object: StoredProcedure [existsSession] ******/ -IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[existsSession]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1) - DROP PROCEDURE [existsSession]; -GO - -CREATE PROCEDURE [dbo].[existsSession] - -( - @SessionID int -) -WITH EXECUTE AS OWNER -AS - SELECT COUNT(*) - FROM [Sessions] WHERE [SessionID]=@SessionID - RETURN -GO --- Display the status of Proc creation -IF (@@Error = 0) PRINT 'Procedure Creation: existsSession Succeeded' -ELSE PRINT 'Procedure Creation: existsSession Error on Creation' -GO diff --git a/PROMS/VEPROMS.CSLA.Library/NewGenerated/getSession.SQL b/PROMS/VEPROMS.CSLA.Library/NewGenerated/getSession.SQL deleted file mode 100644 index eb9cf136..00000000 --- a/PROMS/VEPROMS.CSLA.Library/NewGenerated/getSession.SQL +++ /dev/null @@ -1,30 +0,0 @@ - -/****** Object: StoredProcedure [getSession] ******/ -IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[getSession]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1) - DROP PROCEDURE [getSession]; -GO - -CREATE PROCEDURE [dbo].[getSession] - -( - @SessionID int -) -WITH EXECUTE AS OWNER -AS - SELECT - [SessionID], - [UserID], - [DTSDtart], - [DTSEnd], - [DTSActivity], - [LastChanged], - [MachineName], - [ProcessID] - FROM [Sessions] - WHERE [SessionID]=@SessionID - RETURN -GO --- Display the status of Proc creation -IF (@@Error = 0) PRINT 'Procedure Creation: getSession Succeeded' -ELSE PRINT 'Procedure Creation: getSession Error on Creation' -GO diff --git a/PROMS/VEPROMS.CSLA.Library/NewGenerated/getSessions.SQL b/PROMS/VEPROMS.CSLA.Library/NewGenerated/getSessions.SQL deleted file mode 100644 index 5fd39159..00000000 --- a/PROMS/VEPROMS.CSLA.Library/NewGenerated/getSessions.SQL +++ /dev/null @@ -1,26 +0,0 @@ - -/****** Object: StoredProcedure [getSessions] ******/ -IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[getSessions]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1) - DROP PROCEDURE [getSessions]; -GO - -CREATE PROCEDURE [dbo].[getSessions] - -WITH EXECUTE AS OWNER -AS - SELECT - [SessionID], - [UserID], - [DTSDtart], - [DTSEnd], - [DTSActivity], - [LastChanged], - [MachineName], - [ProcessID] - FROM [Sessions] - RETURN -GO --- Display the status of Proc creation -IF (@@Error = 0) PRINT 'Procedure Creation: getSessions Succeeded' -ELSE PRINT 'Procedure Creation: getSessions Error on Creation' -GO diff --git a/PROMS/VEPROMS.CSLA.Library/NewGenerated/purgeData.SQL b/PROMS/VEPROMS.CSLA.Library/NewGenerated/purgeData.SQL deleted file mode 100644 index eff19871..00000000 --- a/PROMS/VEPROMS.CSLA.Library/NewGenerated/purgeData.SQL +++ /dev/null @@ -1,26 +0,0 @@ - -/****** Object: StoredProcedure [purgeData] ******/ -IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[purgeData]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1) - DROP PROCEDURE [purgeData]; -GO - -CREATE PROCEDURE [dbo].[purgeData] - -WITH EXECUTE AS OWNER -AS -BEGIN TRY -- Try Block - BEGIN TRANSACTION - delete from [Sessions] - dbcc checkident([Sessions],reseed,0) - 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: purgeData Succeeded' -ELSE PRINT 'Procedure Creation: purgeData Error on Creation' -GO diff --git a/PROMS/VEPROMS.CSLA.Library/NewGenerated/updateSession.SQL b/PROMS/VEPROMS.CSLA.Library/NewGenerated/updateSession.SQL deleted file mode 100644 index fd23b06d..00000000 --- a/PROMS/VEPROMS.CSLA.Library/NewGenerated/updateSession.SQL +++ /dev/null @@ -1,55 +0,0 @@ - -/****** Object: StoredProcedure [updateSession] ******/ -IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[updateSession]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1) - DROP PROCEDURE [updateSession]; -GO - -CREATE PROCEDURE [dbo].[updateSession] - -( - @SessionID int, - @UserID nvarchar(100), - @DTSDtart datetime, - @DTSEnd datetime=null, - @DTSActivity datetime, - @LastChanged timestamp, - @MachineName nvarchar(100), - @ProcessID int, - @newLastChanged timestamp output -) -WITH EXECUTE AS OWNER -AS -BEGIN TRY -- Try Block - BEGIN TRANSACTION - UPDATE [Sessions] - SET - [UserID]=@UserID, - [DTSDtart]=@DTSDtart, - [DTSEnd]=@DTSEnd, - [DTSActivity]=@DTSActivity, - [MachineName]=@MachineName, - [ProcessID]=@ProcessID - WHERE [SessionID]=@SessionID AND [LastChanged]=@LastChanged - IF @@ROWCOUNT = 0 - BEGIN - IF NOT exists(select * from [Sessions] WHERE [SessionID]=@SessionID) - RAISERROR('Session record has been deleted by another user', 16, 1) - ELSE - RAISERROR('Session has been edited by another user', 16, 1) - END - - SELECT @newLastChanged=[LastChanged] - FROM [Sessions] WHERE [SessionID]=@SessionID - - 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: updateSession Succeeded' -ELSE PRINT 'Procedure Creation: updateSession Error on Creation' -GO diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Annotation.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Annotation.cs deleted file mode 100644 index 5b2cf069..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Annotation.cs +++ /dev/null @@ -1,1123 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Annotation Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(AnnotationConverter))] - public partial class Annotation : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshAnnotations = new List(); - private void AddToRefreshList(List refreshAnnotations) - { - if (IsDirty) - refreshAnnotations.Add(this); - } - private void BuildRefreshList() - { - _RefreshAnnotations = new List(); - AddToRefreshList(_RefreshAnnotations); - } - private void ProcessRefreshList() - { - foreach (Annotation tmp in _RefreshAnnotations) - { - AnnotationInfo.Refresh(tmp); - if (tmp._MyAnnotationType != null) AnnotationTypeInfo.Refresh(tmp._MyAnnotationType); - if (tmp._MyItem != null) ItemInfo.Refresh(tmp._MyItem); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Annotation annotation) - { - if (!_CacheList.Contains(annotation)) _CacheList.Add(annotation); // In AddToCache - } - protected static void RemoveFromCache(Annotation annotation) - { - while (_CacheList.Contains(annotation)) _CacheList.Remove(annotation); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (Annotation tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.AnnotationID.ToString())) - { - _CacheByPrimaryKey[tmp.AnnotationID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.AnnotationID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (Annotation tmp in remove) - RemoveFromCache(tmp); - } - protected static Annotation GetCachedByPrimaryKey(int annotationID) - { - ConvertListToDictionary(); - string key = annotationID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextAnnotationID = -1; - public static int NextAnnotationID - { - get { return _nextAnnotationID--; } - } - private int _AnnotationID; - [System.ComponentModel.DataObjectField(true, true)] - public int AnnotationID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AnnotationID; - } - } - private int _ItemID; - public int ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem != null) _ItemID = _MyItem.ItemID; - return _ItemID; - } - } - private Item _MyItem; - public Item MyItem - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem == null && _ItemID != 0) _MyItem = Item.Get(_ItemID); - return _MyItem; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyItem != value) - { - _MyItem = value; - PropertyHasChanged(); - } - } - } - private int _TypeID; - public int TypeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyAnnotationType != null) _TypeID = _MyAnnotationType.TypeID; - return _TypeID; - } - } - private AnnotationType _MyAnnotationType; - public AnnotationType MyAnnotationType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyAnnotationType == null && _TypeID != 0) _MyAnnotationType = AnnotationType.Get(_TypeID); - return _MyAnnotationType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyAnnotationType != value) - { - _MyAnnotationType = value; - PropertyHasChanged(); - } - } - } - private string _RtfText = string.Empty; - public string RtfText - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RtfText; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_RtfText != value) - { - _RtfText = value; - PropertyHasChanged(); - } - } - } - private string _SearchText = string.Empty; - public string SearchText - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _SearchText; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_SearchText != value) - { - _SearchText = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - public override bool IsDirty - { - get { return base.IsDirty || (_MyAnnotationType == null ? false : _MyAnnotationType.IsDirty) || (_MyItem == null ? false : _MyItem.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyAnnotationType == null ? true : _MyAnnotationType.IsValid) && (_MyItem == null ? true : _MyItem.IsValid); } - } - // TODO: Replace base Annotation.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Annotation - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check Annotation.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Annotation - protected override object GetIdValue() - { - return _AnnotationID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyItem != null && (hasBrokenRules = _MyItem.HasBrokenRules) != null) return hasBrokenRules; - if (_MyAnnotationType != null && (hasBrokenRules = _MyAnnotationType.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyItemRequired, "MyItem"); - ValidationRules.AddRule(MyAnnotationTypeRequired, "MyAnnotationType"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("RtfText", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("SearchText", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _AnnotationExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _AnnotationExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - private static bool MyItemRequired(Annotation target, Csla.Validation.RuleArgs e) - { - if (target._ItemID == 0 && target._MyItem == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - private static bool MyAnnotationTypeRequired(Annotation target, Csla.Validation.RuleArgs e) - { - if (target._TypeID == 0 && target._MyAnnotationType == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(AnnotationID, ""); - //AuthorizationRules.AllowRead(ItemID, ""); - //AuthorizationRules.AllowRead(TypeID, ""); - //AuthorizationRules.AllowRead(RtfText, ""); - //AuthorizationRules.AllowRead(SearchText, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(ItemID, ""); - //AuthorizationRules.AllowWrite(TypeID, ""); - //AuthorizationRules.AllowWrite(RtfText, ""); - //AuthorizationRules.AllowWrite(SearchText, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - _AnnotationExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _AnnotationExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _AnnotationUnique = 0; - protected static int AnnotationUnique - { get { return ++_AnnotationUnique; } } - private int _MyAnnotationUnique = AnnotationUnique; - public int MyAnnotationUnique - { get { return _MyAnnotationUnique; } } - protected Annotation() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(AnnotationID.ToString())) - { - List listAnnotation = _CacheByPrimaryKey[AnnotationID.ToString()]; // Get the list of items - while (listAnnotation.Contains(this)) listAnnotation.Remove(this); // Remove the item from the list - if (listAnnotation.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(AnnotationID.ToString()); // remove the list - } - } - public static Annotation New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Annotation"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Annotation.New", ex); - } - } - public static Annotation New(Item myItem, AnnotationType myAnnotationType) - { - Annotation tmp = Annotation.New(); - tmp.MyItem = myItem; - tmp.MyAnnotationType = myAnnotationType; - return tmp; - } - public static Annotation New(Item myItem, AnnotationType myAnnotationType, string rtfText, string searchText, string config, DateTime dts, string userID) - { - Annotation tmp = Annotation.New(); - tmp.MyItem = myItem; - tmp.MyAnnotationType = myAnnotationType; - tmp.RtfText = rtfText; - tmp.SearchText = searchText; - tmp.Config = config; - tmp.DTS = dts; - tmp.UserID = userID; - return tmp; - } - public static Annotation MakeAnnotation(Item myItem, AnnotationType myAnnotationType, string rtfText, string searchText, string config, DateTime dts, string userID) - { - Annotation tmp = Annotation.New(myItem, myAnnotationType, rtfText, searchText, config, dts, userID); - if (tmp.IsSavable) - { - Annotation tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Annotation New(Item myItem, AnnotationType myAnnotationType, string rtfText, string searchText, string config) - { - Annotation tmp = Annotation.New(); - tmp.MyItem = myItem; - tmp.MyAnnotationType = myAnnotationType; - tmp.RtfText = rtfText; - tmp.SearchText = searchText; - tmp.Config = config; - return tmp; - } - public static Annotation MakeAnnotation(Item myItem, AnnotationType myAnnotationType, string rtfText, string searchText, string config) - { - Annotation tmp = Annotation.New(myItem, myAnnotationType, rtfText, searchText, config); - if (tmp.IsSavable) - { - Annotation tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Annotation Get(int annotationID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Annotation"); - try - { - Annotation tmp = GetCachedByPrimaryKey(annotationID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(annotationID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Annotation - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Annotation.Get", ex); - } - } - public static Annotation Get(SafeDataReader dr) - { - if (dr.Read()) return new Annotation(dr); - return null; - } - internal Annotation(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int annotationID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Annotation"); - try - { - DataPortal.Delete(new PKCriteria(annotationID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Annotation.Delete", ex); - } - } - public override Annotation Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Annotation"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Annotation"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Annotation"); - try - { - BuildRefreshList(); - Annotation annotation = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(annotation);//Refresh the item in AllList - ProcessRefreshList(); - return annotation; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _AnnotationID; - public int AnnotationID - { get { return _AnnotationID; } } - public PKCriteria(int annotationID) - { - _AnnotationID = annotationID; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _AnnotationID = NextAnnotationID; - // Database Defaults - _DTS = _AnnotationExtension.DefaultDTS; - _UserID = _AnnotationExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Annotation.ReadData", GetHashCode()); - try - { - _AnnotationID = dr.GetInt32("AnnotationID"); - _ItemID = dr.GetInt32("ItemID"); - _TypeID = dr.GetInt32("TypeID"); - _RtfText = dr.GetString("RtfText"); - _SearchText = dr.GetString("SearchText"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Annotation.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Annotation.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Annotation.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotation"; - cm.Parameters.AddWithValue("@AnnotationID", criteria.AnnotationID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Annotation.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Annotation.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Annotation.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Annotation.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Annotation.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyAnnotationType != null) _MyAnnotationType.Update(); - if (_MyItem != null) _MyItem.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addAnnotation"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ItemID", ItemID); - cm.Parameters.AddWithValue("@TypeID", TypeID); - cm.Parameters.AddWithValue("@RtfText", _RtfText); - cm.Parameters.AddWithValue("@SearchText", _SearchText); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - // Output Calculated Columns - SqlParameter param_AnnotationID = new SqlParameter("@newAnnotationID", SqlDbType.Int); - param_AnnotationID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_AnnotationID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _AnnotationID = (int)cm.Parameters["@newAnnotationID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Annotation.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Annotation.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Annotation.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int annotationID, Item myItem, AnnotationType myAnnotationType, string rtfText, string searchText, string config, DateTime dts, string userID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Annotation.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addAnnotation"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ItemID", myItem.ItemID); - cm.Parameters.AddWithValue("@TypeID", myAnnotationType.TypeID); - cm.Parameters.AddWithValue("@RtfText", rtfText); - cm.Parameters.AddWithValue("@SearchText", searchText); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - // Output Calculated Columns - SqlParameter param_AnnotationID = new SqlParameter("@newAnnotationID", SqlDbType.Int); - param_AnnotationID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_AnnotationID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - annotationID = (int)cm.Parameters["@newAnnotationID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Annotation.Add", ex); - throw new DbCslaException("Annotation.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Annotation.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Annotation.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Annotation.SQLUpdate", GetHashCode()); - try - { - if (_MyAnnotationType != null) _MyAnnotationType.Update(); - if (_MyItem != null) _MyItem.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateAnnotation"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@AnnotationID", _AnnotationID); - cm.Parameters.AddWithValue("@ItemID", ItemID); - cm.Parameters.AddWithValue("@TypeID", TypeID); - cm.Parameters.AddWithValue("@RtfText", _RtfText); - cm.Parameters.AddWithValue("@SearchText", _SearchText); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Annotation.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Annotation.Add(cn, ref _AnnotationID, _MyItem, _MyAnnotationType, _RtfText, _SearchText, _Config, _DTS, _UserID); - else - _LastChanged = Annotation.Update(cn, ref _AnnotationID, _MyItem, _MyAnnotationType, _RtfText, _SearchText, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int annotationID, Item myItem, AnnotationType myAnnotationType, string rtfText, string searchText, string config, DateTime dts, string userID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Annotation.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateAnnotation"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@AnnotationID", annotationID); - cm.Parameters.AddWithValue("@ItemID", myItem.ItemID); - cm.Parameters.AddWithValue("@TypeID", myAnnotationType.TypeID); - cm.Parameters.AddWithValue("@RtfText", rtfText); - cm.Parameters.AddWithValue("@SearchText", searchText); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Annotation.Update", ex); - throw new DbCslaException("Annotation.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_AnnotationID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Annotation.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteAnnotation"; - cm.Parameters.AddWithValue("@AnnotationID", criteria.AnnotationID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Annotation.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Annotation.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int annotationID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Annotation.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteAnnotation"; - // Input PK Fields - cm.Parameters.AddWithValue("@AnnotationID", annotationID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Annotation.Remove", ex); - throw new DbCslaException("Annotation.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int annotationID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(annotationID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Annotation.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _AnnotationID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int annotationID) - { - _AnnotationID = annotationID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Annotation.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsAnnotation"; - cm.Parameters.AddWithValue("@AnnotationID", _AnnotationID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Annotation.DataPortal_Execute", ex); - throw new DbCslaException("Annotation.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - AnnotationExtension _AnnotationExtension = new AnnotationExtension(); - [Serializable()] - partial class AnnotationExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class AnnotationConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Annotation) - { - // Return the ToString value - return ((Annotation)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create AnnotationExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Annotation -// { -// partial class AnnotationExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationInfo.cs deleted file mode 100644 index 93229620..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationInfo.cs +++ /dev/null @@ -1,477 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void AnnotationInfoEvent(object sender); - /// - /// AnnotationInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(AnnotationInfoConverter))] - public partial class AnnotationInfo : ReadOnlyBase, IDisposable - { - public event AnnotationInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(AnnotationInfo annotationInfo) - { - if (!_CacheList.Contains(annotationInfo)) _CacheList.Add(annotationInfo); // In AddToCache - } - protected static void RemoveFromCache(AnnotationInfo annotationInfo) - { - while (_CacheList.Contains(annotationInfo)) _CacheList.Remove(annotationInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (AnnotationInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.AnnotationID.ToString())) - { - _CacheByPrimaryKey[tmp.AnnotationID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.AnnotationID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (AnnotationInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(AnnotationInfoList lst) - { - foreach (AnnotationInfo item in lst) AddToCache(item); - } - protected static AnnotationInfo GetCachedByPrimaryKey(int annotationID) - { - ConvertListToDictionary(); - string key = annotationID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Annotation _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _AnnotationID; - [System.ComponentModel.DataObjectField(true, true)] - public int AnnotationID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AnnotationID; - } - } - private int _ItemID; - public int ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem != null) _ItemID = _MyItem.ItemID; - return _ItemID; - } - } - private ItemInfo _MyItem; - public ItemInfo MyItem - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem == null && _ItemID != 0) _MyItem = ItemInfo.Get(_ItemID); - return _MyItem; - } - } - private int _TypeID; - public int TypeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyAnnotationType != null) _TypeID = _MyAnnotationType.TypeID; - return _TypeID; - } - } - private AnnotationTypeInfo _MyAnnotationType; - public AnnotationTypeInfo MyAnnotationType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyAnnotationType == null && _TypeID != 0) _MyAnnotationType = AnnotationTypeInfo.Get(_TypeID); - return _MyAnnotationType; - } - } - private string _RtfText = string.Empty; - public string RtfText - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RtfText; - } - } - private string _SearchText = string.Empty; - public string SearchText - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _SearchText; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - // TODO: Replace base AnnotationInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current AnnotationInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check AnnotationInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current AnnotationInfo - protected override object GetIdValue() - { - return _AnnotationID; - } - #endregion - #region Factory Methods - private static int _AnnotationInfoUnique = 0; - private static int AnnotationInfoUnique - { get { return ++_AnnotationInfoUnique; } } - private int _MyAnnotationInfoUnique = AnnotationInfoUnique; - public int MyAnnotationInfoUnique - { get { return _MyAnnotationInfoUnique; } } - protected AnnotationInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(AnnotationID.ToString())) return; - List listAnnotationInfo = _CacheByPrimaryKey[AnnotationID.ToString()]; // Get the list of items - while (listAnnotationInfo.Contains(this)) listAnnotationInfo.Remove(this); // Remove the item from the list - if (listAnnotationInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(AnnotationID.ToString()); // remove the list - } - public virtual Annotation Get() - { - return _Editable = Annotation.Get(_AnnotationID); - } - public static void Refresh(Annotation tmp) - { - string key = tmp.AnnotationID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (AnnotationInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Annotation tmp) - { - if (_ItemID != tmp.ItemID) - { - if (MyItem != null) MyItem.RefreshItemAnnotations(); // Update List for old value - _ItemID = tmp.ItemID; // Update the value - } - _MyItem = null; // Reset list so that the next line gets a new list - if (MyItem != null) MyItem.RefreshItemAnnotations(); // Update List for new value - if (_TypeID != tmp.TypeID) - { - if (MyAnnotationType != null) MyAnnotationType.RefreshAnnotationTypeAnnotations(); // Update List for old value - _TypeID = tmp.TypeID; // Update the value - } - _MyAnnotationType = null; // Reset list so that the next line gets a new list - if (MyAnnotationType != null) MyAnnotationType.RefreshAnnotationTypeAnnotations(); // Update List for new value - _RtfText = tmp.RtfText; - _SearchText = tmp.SearchText; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _AnnotationInfoExtension.Refresh(this); - if (_MyItem != null) - { - _MyItem.Dispose();// Dispose related value - _MyItem = null;// Reset related value - } - if (_MyAnnotationType != null) - { - _MyAnnotationType.Dispose();// Dispose related value - _MyAnnotationType = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(AnnotationTypeAnnotation tmp) - { - string key = tmp.AnnotationID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (AnnotationInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(AnnotationTypeAnnotation tmp) - { - if (_ItemID != tmp.ItemID) - { - if (MyItem != null) MyItem.RefreshItemAnnotations(); // Update List for old value - _ItemID = tmp.ItemID; // Update the value - } - _MyItem = null; // Reset list so that the next line gets a new list - if (MyItem != null) MyItem.RefreshItemAnnotations(); // Update List for new value - _RtfText = tmp.RtfText; - _SearchText = tmp.SearchText; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _AnnotationInfoExtension.Refresh(this); - if (_MyItem != null) - { - _MyItem.Dispose();// Dispose related value - _MyItem = null;// Reset related value - } - if (_MyAnnotationType != null) - { - _MyAnnotationType.Dispose();// Dispose related value - _MyAnnotationType = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(ItemAnnotation tmp) - { - string key = tmp.AnnotationID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (AnnotationInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ItemAnnotation tmp) - { - if (_TypeID != tmp.TypeID) - { - if (MyAnnotationType != null) MyAnnotationType.RefreshAnnotationTypeAnnotations(); // Update List for old value - _TypeID = tmp.TypeID; // Update the value - } - _MyAnnotationType = null; // Reset list so that the next line gets a new list - if (MyAnnotationType != null) MyAnnotationType.RefreshAnnotationTypeAnnotations(); // Update List for new value - _RtfText = tmp.RtfText; - _SearchText = tmp.SearchText; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _AnnotationInfoExtension.Refresh(this); - if (_MyItem != null) - { - _MyItem.Dispose();// Dispose related value - _MyItem = null;// Reset related value - } - if (_MyAnnotationType != null) - { - _MyAnnotationType.Dispose();// Dispose related value - _MyAnnotationType = null;// Reset related value - } - OnChange();// raise an event - } - public static AnnotationInfo Get(int annotationID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Annotation"); - try - { - AnnotationInfo tmp = GetCachedByPrimaryKey(annotationID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(annotationID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up AnnotationInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal AnnotationInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationInfo.Constructor", ex); - throw new DbCslaException("AnnotationInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _AnnotationID; - public int AnnotationID - { get { return _AnnotationID; } } - public PKCriteria(int annotationID) - { - _AnnotationID = annotationID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationInfo.ReadData", GetHashCode()); - try - { - _AnnotationID = dr.GetInt32("AnnotationID"); - _ItemID = dr.GetInt32("ItemID"); - _TypeID = dr.GetInt32("TypeID"); - _RtfText = dr.GetString("RtfText"); - _SearchText = dr.GetString("SearchText"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotation"; - cm.Parameters.AddWithValue("@AnnotationID", criteria.AnnotationID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - AnnotationInfoExtension _AnnotationInfoExtension = new AnnotationInfoExtension(); - [Serializable()] - partial class AnnotationInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(AnnotationInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class AnnotationInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is AnnotationInfo) - { - // Return the ToString value - return ((AnnotationInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationInfoList.cs deleted file mode 100644 index 07442abd..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationInfoList.cs +++ /dev/null @@ -1,312 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// AnnotationInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(AnnotationInfoListConverter))] - public partial class AnnotationInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (AnnotationInfo tmp in this) - { - tmp.Changed += new AnnotationInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (AnnotationInfo tmp in this) - { - tmp.Changed -= new AnnotationInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static AnnotationInfoList _AnnotationInfoList = null; - /// - /// Return a list of all projects. - /// - public static AnnotationInfoList Get() - { - try - { - if (_AnnotationInfoList != null) - return _AnnotationInfoList; - AnnotationInfoList tmp = DataPortal.Fetch(); - AnnotationInfo.AddList(tmp); - tmp.AddEvents(); - _AnnotationInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static AnnotationInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on AnnotationInfoList.Get", ex); - // } - //} - public static AnnotationInfoList GetByTypeID(int typeID) - { - try - { - AnnotationInfoList tmp = DataPortal.Fetch(new TypeIDCriteria(typeID)); - AnnotationInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationInfoList.GetByTypeID", ex); - } - } - public static AnnotationInfoList GetByItemID(int itemID) - { - try - { - AnnotationInfoList tmp = DataPortal.Fetch(new ItemIDCriteria(itemID)); - AnnotationInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationInfoList.GetByItemID", ex); - } - } - private AnnotationInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotations"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new AnnotationInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("AnnotationInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class TypeIDCriteria - { - public TypeIDCriteria(int typeID) - { - _TypeID = typeID; - } - private int _TypeID; - public int TypeID - { - get { return _TypeID; } - set { _TypeID = value; } - } - } - private void DataPortal_Fetch(TypeIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationInfoList.DataPortal_FetchTypeID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationsByTypeID"; - cm.Parameters.AddWithValue("@TypeID", criteria.TypeID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new AnnotationInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationInfoList.DataPortal_FetchTypeID", ex); - throw new DbCslaException("AnnotationInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ItemIDCriteria - { - public ItemIDCriteria(int itemID) - { - _ItemID = itemID; - } - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - private void DataPortal_Fetch(ItemIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationInfoList.DataPortal_FetchItemID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationsByItemID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new AnnotationInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationInfoList.DataPortal_FetchItemID", ex); - throw new DbCslaException("AnnotationInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - AnnotationInfoListPropertyDescriptor pd = new AnnotationInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class AnnotationInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private AnnotationInfo Item { get { return (AnnotationInfo)_Item; } } - public AnnotationInfoListPropertyDescriptor(AnnotationInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class AnnotationInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is AnnotationInfoList) - { - // Return department and department role separated by comma. - return ((AnnotationInfoList)value).Items.Count.ToString() + " Annotations"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationType.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationType.cs deleted file mode 100644 index adb76aa2..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationType.cs +++ /dev/null @@ -1,1144 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// AnnotationType Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(AnnotationTypeConverter))] - public partial class AnnotationType : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshAnnotationTypes = new List(); - private List _RefreshAnnotationTypeAnnotations = new List(); - private void AddToRefreshList(List refreshAnnotationTypes, List refreshAnnotationTypeAnnotations) - { - if (IsDirty) - refreshAnnotationTypes.Add(this); - if (_AnnotationTypeAnnotations != null && _AnnotationTypeAnnotations.IsDirty) - { - foreach (AnnotationTypeAnnotation tmp in _AnnotationTypeAnnotations) - { - if (tmp.IsDirty) refreshAnnotationTypeAnnotations.Add(tmp); - } - } - } - private void BuildRefreshList() - { - _RefreshAnnotationTypes = new List(); - _RefreshAnnotationTypeAnnotations = new List(); - AddToRefreshList(_RefreshAnnotationTypes, _RefreshAnnotationTypeAnnotations); - } - private void ProcessRefreshList() - { - foreach (AnnotationType tmp in _RefreshAnnotationTypes) - { - AnnotationTypeInfo.Refresh(tmp); - } - foreach (AnnotationTypeAnnotation tmp in _RefreshAnnotationTypeAnnotations) - { - AnnotationInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(AnnotationType annotationType) - { - if (!_CacheList.Contains(annotationType)) _CacheList.Add(annotationType); // In AddToCache - } - protected static void RemoveFromCache(AnnotationType annotationType) - { - while (_CacheList.Contains(annotationType)) _CacheList.Remove(annotationType); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static Dictionary> _CacheByName = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (AnnotationType tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.TypeID.ToString())) - { - _CacheByPrimaryKey[tmp.TypeID.ToString()] = new List(); // Add new list for PrimaryKey - _CacheByName[tmp.Name.ToString()] = new List(); // Add new list for Name - } - _CacheByPrimaryKey[tmp.TypeID.ToString()].Add(tmp); // Add to Primary Key list - _CacheByName[tmp.Name.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); - } - foreach (AnnotationType tmp in remove) - RemoveFromCache(tmp); - } - protected static AnnotationType GetCachedByPrimaryKey(int typeID) - { - ConvertListToDictionary(); - string key = typeID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - protected static AnnotationType GetCachedByName(string name) - { - ConvertListToDictionary(); - string key = name.ToString(); - if (_CacheByName.ContainsKey(key)) return _CacheByName[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextTypeID = -1; - public static int NextTypeID - { - get { return _nextTypeID--; } - } - private int _TypeID; - [System.ComponentModel.DataObjectField(true, true)] - public int TypeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _TypeID; - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Name != value) - { - _Name = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _AnnotationTypeAnnotationCount = 0; - /// - /// Count of AnnotationTypeAnnotations for this AnnotationType - /// - public int AnnotationTypeAnnotationCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AnnotationTypeAnnotationCount; - } - } - private AnnotationTypeAnnotations _AnnotationTypeAnnotations = null; - /// - /// Related Field - /// - [TypeConverter(typeof(AnnotationTypeAnnotationsConverter))] - public AnnotationTypeAnnotations AnnotationTypeAnnotations - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_AnnotationTypeAnnotationCount > 0 && _AnnotationTypeAnnotations == null) - _AnnotationTypeAnnotations = AnnotationTypeAnnotations.GetByTypeID(TypeID); - else if (_AnnotationTypeAnnotations == null) - _AnnotationTypeAnnotations = AnnotationTypeAnnotations.New(); - return _AnnotationTypeAnnotations; - } - } - public override bool IsDirty - { - get { return base.IsDirty || (_AnnotationTypeAnnotations == null ? false : _AnnotationTypeAnnotations.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_AnnotationTypeAnnotations == null ? true : _AnnotationTypeAnnotations.IsValid); } - } - // TODO: Replace base AnnotationType.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current AnnotationType - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check AnnotationType.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current AnnotationType - protected override object GetIdValue() - { - return _TypeID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_AnnotationTypeAnnotations != null && (hasBrokenRules = _AnnotationTypeAnnotations.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "Name"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _AnnotationTypeExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _AnnotationTypeExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(TypeID, ""); - //AuthorizationRules.AllowRead(Name, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(Name, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - _AnnotationTypeExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _AnnotationTypeExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - /// - /// determines if related records (Foreign Keys) will keep this Item from being deleted - /// - public bool CanDelete - { - get - { - // Check to make sure that there are not any related records - int usedByCount = 0; - usedByCount += _AnnotationTypeAnnotationCount; - return (usedByCount == 0); - } - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _AnnotationTypeUnique = 0; - protected static int AnnotationTypeUnique - { get { return ++_AnnotationTypeUnique; } } - private int _MyAnnotationTypeUnique = AnnotationTypeUnique; - public int MyAnnotationTypeUnique - { get { return _MyAnnotationTypeUnique; } } - protected AnnotationType() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(TypeID.ToString())) - { - List listAnnotationType = _CacheByPrimaryKey[TypeID.ToString()]; // Get the list of items - while (listAnnotationType.Contains(this)) listAnnotationType.Remove(this); // Remove the item from the list - if (listAnnotationType.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(TypeID.ToString()); // remove the list - } - string myKey; - myKey = null; - foreach (string key in _CacheByName.Keys) - if (_CacheByName[key].Contains(this)) - myKey = key; - if (myKey != null) - { - List listAnnotationType = _CacheByName[myKey]; // Get the list of items - listAnnotationType.Remove(this); // Remove the item from the list - if (listAnnotationType.Count == 0) //If there are no items left in the list - _CacheByName.Remove(myKey); // remove the list - } - } - public static AnnotationType New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a AnnotationType"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationType.New", ex); - } - } - public static AnnotationType New(string name) - { - AnnotationType tmp = AnnotationType.New(); - tmp.Name = name; - return tmp; - } - public static AnnotationType New(string name, string config, DateTime dts, string userID) - { - AnnotationType tmp = AnnotationType.New(); - tmp.Name = name; - tmp.Config = config; - tmp.DTS = dts; - tmp.UserID = userID; - return tmp; - } - public static AnnotationType MakeAnnotationType(string name, string config, DateTime dts, string userID) - { - AnnotationType tmp = AnnotationType.New(name, config, dts, userID); - if (tmp.IsSavable) - { - AnnotationType tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static AnnotationType New(string name, string config) - { - AnnotationType tmp = AnnotationType.New(); - tmp.Name = name; - tmp.Config = config; - return tmp; - } - public static AnnotationType MakeAnnotationType(string name, string config) - { - AnnotationType tmp = AnnotationType.New(name, config); - if (tmp.IsSavable) - { - AnnotationType tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static AnnotationType Get(int typeID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a AnnotationType"); - try - { - AnnotationType tmp = GetCachedByPrimaryKey(typeID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(typeID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up AnnotationType - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationType.Get", ex); - } - } - public static AnnotationType GetByName(string name) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a AnnotationType"); - try - { - AnnotationType tmp = GetCachedByName(name); - if (tmp == null) - { - tmp = DataPortal.Fetch(new NameCriteria(name)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up AnnotationType - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationType.GetByName", ex); - } - } - public static AnnotationType Get(SafeDataReader dr) - { - if (dr.Read()) return new AnnotationType(dr); - return null; - } - internal AnnotationType(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int typeID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a AnnotationType"); - try - { - DataPortal.Delete(new PKCriteria(typeID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationType.Delete", ex); - } - } - public override AnnotationType Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a AnnotationType"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a AnnotationType"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a AnnotationType"); - try - { - BuildRefreshList(); - AnnotationType annotationType = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(annotationType);//Refresh the item in AllList - ProcessRefreshList(); - return annotationType; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _TypeID; - public int TypeID - { get { return _TypeID; } } - public PKCriteria(int typeID) - { - _TypeID = typeID; - } - } - [Serializable()] - private class NameCriteria - { - private string _Name; - public string Name - { get { return _Name; } } - public NameCriteria(string name) - { - _Name = name; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _TypeID = NextTypeID; - // Database Defaults - _DTS = _AnnotationTypeExtension.DefaultDTS; - _UserID = _AnnotationTypeExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationType.ReadData", GetHashCode()); - try - { - _TypeID = dr.GetInt32("TypeID"); - _Name = dr.GetString("Name"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _AnnotationTypeAnnotationCount = dr.GetInt32("AnnotationCount"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationType.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationType.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationType.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationType"; - cm.Parameters.AddWithValue("@TypeID", criteria.TypeID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _AnnotationTypeAnnotations = AnnotationTypeAnnotations.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationType.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationType.DataPortal_Fetch", ex); - } - } - private void DataPortal_Fetch(NameCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationType.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationTypeByName"; - cm.Parameters.AddWithValue("@Name", criteria.Name); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationType.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationType.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationType.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationType.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationType.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addAnnotationType"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@Name", _Name); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - // Output Calculated Columns - SqlParameter param_TypeID = new SqlParameter("@newTypeID", SqlDbType.Int); - param_TypeID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_TypeID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _TypeID = (int)cm.Parameters["@newTypeID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_AnnotationTypeAnnotations != null) _AnnotationTypeAnnotations.Update(this); - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationType.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationType.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationType.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int typeID, string name, string config, DateTime dts, string userID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationType.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addAnnotationType"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@Name", name); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - // Output Calculated Columns - SqlParameter param_TypeID = new SqlParameter("@newTypeID", SqlDbType.Int); - param_TypeID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_TypeID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - typeID = (int)cm.Parameters["@newTypeID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationType.Add", ex); - throw new DbCslaException("AnnotationType.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationType.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationType.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationType.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateAnnotationType"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@TypeID", _TypeID); - cm.Parameters.AddWithValue("@Name", _Name); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - if (_AnnotationTypeAnnotations != null) _AnnotationTypeAnnotations.Update(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationType.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = AnnotationType.Add(cn, ref _TypeID, _Name, _Config, _DTS, _UserID); - else - _LastChanged = AnnotationType.Update(cn, ref _TypeID, _Name, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - if (_AnnotationTypeAnnotations != null) _AnnotationTypeAnnotations.Update(this); - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int typeID, string name, string config, DateTime dts, string userID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationType.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateAnnotationType"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@TypeID", typeID); - cm.Parameters.AddWithValue("@Name", name); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationType.Update", ex); - throw new DbCslaException("AnnotationType.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_TypeID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationType.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteAnnotationType"; - cm.Parameters.AddWithValue("@TypeID", criteria.TypeID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationType.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationType.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int typeID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationType.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteAnnotationType"; - // Input PK Fields - cm.Parameters.AddWithValue("@TypeID", typeID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationType.Remove", ex); - throw new DbCslaException("AnnotationType.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int typeID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(typeID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationType.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _TypeID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int typeID) - { - _TypeID = typeID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationType.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsAnnotationType"; - cm.Parameters.AddWithValue("@TypeID", _TypeID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationType.DataPortal_Execute", ex); - throw new DbCslaException("AnnotationType.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - AnnotationTypeExtension _AnnotationTypeExtension = new AnnotationTypeExtension(); - [Serializable()] - partial class AnnotationTypeExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class AnnotationTypeConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is AnnotationType) - { - // Return the ToString value - return ((AnnotationType)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create AnnotationTypeExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class AnnotationType -// { -// partial class AnnotationTypeExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationTypeAnnotation.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationTypeAnnotation.cs deleted file mode 100644 index 4a9d793c..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationTypeAnnotation.cs +++ /dev/null @@ -1,550 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// AnnotationTypeAnnotation Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(AnnotationTypeAnnotationConverter))] - public partial class AnnotationTypeAnnotation : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _AnnotationID; - [System.ComponentModel.DataObjectField(true, true)] - public int AnnotationID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyAnnotation != null) _AnnotationID = _MyAnnotation.AnnotationID; - return _AnnotationID; - } - } - private Annotation _MyAnnotation; - [System.ComponentModel.DataObjectField(true, true)] - public Annotation MyAnnotation - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyAnnotation == null && _AnnotationID != 0) _MyAnnotation = Annotation.Get(_AnnotationID); - return _MyAnnotation; - } - } - private int _ItemID; - public int ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem != null) _ItemID = _MyItem.ItemID; - return _ItemID; - } - } - private Item _MyItem; - public Item MyItem - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem == null && _ItemID != 0) _MyItem = Item.Get(_ItemID); - return _MyItem; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyItem != value) - { - _MyItem = value; - PropertyHasChanged(); - } - } - } - private string _RtfText = string.Empty; - public string RtfText - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RtfText; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_RtfText != value) - { - _RtfText = value; - PropertyHasChanged(); - } - } - } - private string _SearchText = string.Empty; - public string SearchText - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _SearchText; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_SearchText != value) - { - _SearchText = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int? _Item_PreviousID; - public int? Item_PreviousID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Item_PreviousID; - } - } - private int _Item_ContentID; - public int Item_ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Item_ContentID; - } - } - private DateTime _Item_DTS = new DateTime(); - public DateTime Item_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Item_DTS; - } - } - private string _Item_UserID = string.Empty; - public string Item_UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Item_UserID; - } - } - // TODO: Check AnnotationTypeAnnotation.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current AnnotationTypeAnnotation - protected override object GetIdValue() - { - return _AnnotationID; - } - // TODO: Replace base AnnotationTypeAnnotation.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current AnnotationTypeAnnotation - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyItem == null ? false : _MyItem.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyItem == null ? true : _MyItem.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyItem != null && (hasBrokenRules = _MyItem.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyItemRequired, "MyItem"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("RtfText", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("SearchText", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - private static bool MyItemRequired(AnnotationTypeAnnotation target, Csla.Validation.RuleArgs e) - { - if (target._ItemID == 0 && target._MyItem == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(AnnotationID, ""); - //AuthorizationRules.AllowRead(ItemID, ""); - //AuthorizationRules.AllowWrite(ItemID, ""); - //AuthorizationRules.AllowRead(RtfText, ""); - //AuthorizationRules.AllowWrite(RtfText, ""); - //AuthorizationRules.AllowRead(SearchText, ""); - //AuthorizationRules.AllowWrite(SearchText, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static AnnotationTypeAnnotation New(Item myItem) - { - return new AnnotationTypeAnnotation(myItem); - } - internal static AnnotationTypeAnnotation Get(SafeDataReader dr) - { - return new AnnotationTypeAnnotation(dr); - } - public AnnotationTypeAnnotation() - { - MarkAsChild(); - _AnnotationID = Annotation.NextAnnotationID; - _DTS = _AnnotationTypeAnnotationExtension.DefaultDTS; - _UserID = _AnnotationTypeAnnotationExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private AnnotationTypeAnnotation(Item myItem) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _DTS = _AnnotationTypeAnnotationExtension.DefaultDTS; - _UserID = _AnnotationTypeAnnotationExtension.DefaultUserID; - _MyItem = myItem; - ValidationRules.CheckRules(); - } - internal AnnotationTypeAnnotation(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationTypeAnnotation.FetchDR", GetHashCode()); - try - { - _AnnotationID = dr.GetInt32("AnnotationID"); - _ItemID = dr.GetInt32("ItemID"); - _RtfText = dr.GetString("RtfText"); - _SearchText = dr.GetString("SearchText"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _Item_PreviousID = (int?)dr.GetValue("Item_PreviousID"); - _Item_ContentID = dr.GetInt32("Item_ContentID"); - _Item_DTS = dr.GetDateTime("Item_DTS"); - _Item_UserID = dr.GetString("Item_UserID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationTypeAnnotation.FetchDR", ex); - throw new DbCslaException("AnnotationTypeAnnotation.Fetch", ex); - } - MarkOld(); - } - internal void Insert(AnnotationType myAnnotationType) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Annotation.Add(cn, ref _AnnotationID, _MyItem, myAnnotationType, _RtfText, _SearchText, _Config, _DTS, _UserID); - MarkOld(); - } - internal void Update(AnnotationType myAnnotationType) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Annotation.Update(cn, ref _AnnotationID, _MyItem, myAnnotationType, _RtfText, _SearchText, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(AnnotationType myAnnotationType) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Annotation.Remove(cn, _AnnotationID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - AnnotationTypeAnnotationExtension _AnnotationTypeAnnotationExtension = new AnnotationTypeAnnotationExtension(); - [Serializable()] - partial class AnnotationTypeAnnotationExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class AnnotationTypeAnnotationConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is AnnotationTypeAnnotation) - { - // Return the ToString value - return ((AnnotationTypeAnnotation)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create AnnotationTypeAnnotationExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class AnnotationTypeAnnotation -// { -// partial class AnnotationTypeAnnotationExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationTypeAnnotations.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationTypeAnnotations.cs deleted file mode 100644 index b05ade0f..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationTypeAnnotations.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// AnnotationTypeAnnotations Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(AnnotationTypeAnnotationsConverter))] - public partial class AnnotationTypeAnnotations : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public AnnotationTypeAnnotation this[Annotation myAnnotation] - { - get - { - foreach (AnnotationTypeAnnotation annotation in this) - if (annotation.AnnotationID == myAnnotation.AnnotationID) - return annotation; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public AnnotationTypeAnnotation GetItem(Annotation myAnnotation) - { - foreach (AnnotationTypeAnnotation annotation in this) - if (annotation.AnnotationID == myAnnotation.AnnotationID) - return annotation; - return null; - } - public AnnotationTypeAnnotation Add(Item myItem) // One to Many - { - AnnotationTypeAnnotation annotation = AnnotationTypeAnnotation.New(myItem); - this.Add(annotation); - return annotation; - } - public void Remove(Annotation myAnnotation) - { - foreach (AnnotationTypeAnnotation annotation in this) - { - if (annotation.AnnotationID == myAnnotation.AnnotationID) - { - Remove(annotation); - break; - } - } - } - public bool Contains(Annotation myAnnotation) - { - foreach (AnnotationTypeAnnotation annotation in this) - if (annotation.AnnotationID == myAnnotation.AnnotationID) - return true; - return false; - } - public bool ContainsDeleted(Annotation myAnnotation) - { - foreach (AnnotationTypeAnnotation annotation in DeletedList) - if (annotation.AnnotationID == myAnnotation.AnnotationID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (AnnotationTypeAnnotation annotationTypeAnnotation in this) - if ((hasBrokenRules = annotationTypeAnnotation.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static AnnotationTypeAnnotations New() - { - return new AnnotationTypeAnnotations(); - } - internal static AnnotationTypeAnnotations Get(SafeDataReader dr) - { - return new AnnotationTypeAnnotations(dr); - } - public static AnnotationTypeAnnotations GetByTypeID(int typeID) - { - try - { - return DataPortal.Fetch(new TypeIDCriteria(typeID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationTypeAnnotations.GetByTypeID", ex); - } - } - private AnnotationTypeAnnotations() - { - MarkAsChild(); - } - internal AnnotationTypeAnnotations(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(AnnotationTypeAnnotation.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class TypeIDCriteria - { - public TypeIDCriteria(int typeID) - { - _TypeID = typeID; - } - private int _TypeID; - public int TypeID - { - get { return _TypeID; } - set { _TypeID = value; } - } - } - private void DataPortal_Fetch(TypeIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationTypeAnnotations.DataPortal_FetchTypeID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationsByTypeID"; - cm.Parameters.AddWithValue("@TypeID", criteria.TypeID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new AnnotationTypeAnnotation(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationTypeAnnotations.DataPortal_FetchTypeID", ex); - throw new DbCslaException("AnnotationTypeAnnotations.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(AnnotationType annotationType) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (AnnotationTypeAnnotation obj in DeletedList) - obj.DeleteSelf(annotationType);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (AnnotationTypeAnnotation obj in this) - { - if (obj.IsNew) - obj.Insert(annotationType); - else - obj.Update(annotationType); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - AnnotationTypeAnnotationsPropertyDescriptor pd = new AnnotationTypeAnnotationsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class AnnotationTypeAnnotationsPropertyDescriptor : vlnListPropertyDescriptor - { - private AnnotationTypeAnnotation Item { get { return (AnnotationTypeAnnotation)_Item; } } - public AnnotationTypeAnnotationsPropertyDescriptor(AnnotationTypeAnnotations collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class AnnotationTypeAnnotationsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is AnnotationTypeAnnotations) - { - // Return department and department role separated by comma. - return ((AnnotationTypeAnnotations)value).Items.Count.ToString() + " Annotations"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationTypeInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationTypeInfo.cs deleted file mode 100644 index 65643f64..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationTypeInfo.cs +++ /dev/null @@ -1,364 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void AnnotationTypeInfoEvent(object sender); - /// - /// AnnotationTypeInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(AnnotationTypeInfoConverter))] - public partial class AnnotationTypeInfo : ReadOnlyBase, IDisposable - { - public event AnnotationTypeInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(AnnotationTypeInfo annotationTypeInfo) - { - if (!_CacheList.Contains(annotationTypeInfo)) _CacheList.Add(annotationTypeInfo); // In AddToCache - } - protected static void RemoveFromCache(AnnotationTypeInfo annotationTypeInfo) - { - while (_CacheList.Contains(annotationTypeInfo)) _CacheList.Remove(annotationTypeInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (AnnotationTypeInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.TypeID.ToString())) - { - _CacheByPrimaryKey[tmp.TypeID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.TypeID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (AnnotationTypeInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(AnnotationTypeInfoList lst) - { - foreach (AnnotationTypeInfo item in lst) AddToCache(item); - } - protected static AnnotationTypeInfo GetCachedByPrimaryKey(int typeID) - { - ConvertListToDictionary(); - string key = typeID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected AnnotationType _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _TypeID; - [System.ComponentModel.DataObjectField(true, true)] - public int TypeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _TypeID; - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - private int _AnnotationTypeAnnotationCount = 0; - /// - /// Count of AnnotationTypeAnnotations for this AnnotationType - /// - public int AnnotationTypeAnnotationCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AnnotationTypeAnnotationCount; - } - } - private AnnotationInfoList _AnnotationTypeAnnotations = null; - [TypeConverter(typeof(AnnotationInfoListConverter))] - public AnnotationInfoList AnnotationTypeAnnotations - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_AnnotationTypeAnnotationCount < 0 || (_AnnotationTypeAnnotationCount > 0 && _AnnotationTypeAnnotations == null)) - _AnnotationTypeAnnotations = AnnotationInfoList.GetByTypeID(_TypeID); - if (_AnnotationTypeAnnotationCount < 0) - _AnnotationTypeAnnotationCount = _AnnotationTypeAnnotations.Count; - return _AnnotationTypeAnnotations; - } - } - public void RefreshAnnotationTypeAnnotations() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_TypeID.ToString())) - foreach (AnnotationTypeInfo tmp in _CacheByPrimaryKey[_TypeID.ToString()]) - tmp._AnnotationTypeAnnotationCount = -1; // This will cause the data to be requeried - } - // TODO: Replace base AnnotationTypeInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current AnnotationTypeInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check AnnotationTypeInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current AnnotationTypeInfo - protected override object GetIdValue() - { - return _TypeID; - } - #endregion - #region Factory Methods - private static int _AnnotationTypeInfoUnique = 0; - private static int AnnotationTypeInfoUnique - { get { return ++_AnnotationTypeInfoUnique; } } - private int _MyAnnotationTypeInfoUnique = AnnotationTypeInfoUnique; - public int MyAnnotationTypeInfoUnique - { get { return _MyAnnotationTypeInfoUnique; } } - protected AnnotationTypeInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(TypeID.ToString())) return; - List listAnnotationTypeInfo = _CacheByPrimaryKey[TypeID.ToString()]; // Get the list of items - while (listAnnotationTypeInfo.Contains(this)) listAnnotationTypeInfo.Remove(this); // Remove the item from the list - if (listAnnotationTypeInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(TypeID.ToString()); // remove the list - } - public virtual AnnotationType Get() - { - return _Editable = AnnotationType.Get(_TypeID); - } - public static void Refresh(AnnotationType tmp) - { - string key = tmp.TypeID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (AnnotationTypeInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(AnnotationType tmp) - { - _Name = tmp.Name; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _AnnotationTypeInfoExtension.Refresh(this); - OnChange();// raise an event - } - public static AnnotationTypeInfo Get(int typeID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a AnnotationType"); - try - { - AnnotationTypeInfo tmp = GetCachedByPrimaryKey(typeID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(typeID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up AnnotationTypeInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationTypeInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal AnnotationTypeInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationTypeInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationTypeInfo.Constructor", ex); - throw new DbCslaException("AnnotationTypeInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _TypeID; - public int TypeID - { get { return _TypeID; } } - public PKCriteria(int typeID) - { - _TypeID = typeID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationTypeInfo.ReadData", GetHashCode()); - try - { - _TypeID = dr.GetInt32("TypeID"); - _Name = dr.GetString("Name"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _AnnotationTypeAnnotationCount = dr.GetInt32("AnnotationCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationTypeInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationTypeInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationTypeInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationType"; - cm.Parameters.AddWithValue("@TypeID", criteria.TypeID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationTypeInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AnnotationTypeInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - AnnotationTypeInfoExtension _AnnotationTypeInfoExtension = new AnnotationTypeInfoExtension(); - [Serializable()] - partial class AnnotationTypeInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(AnnotationTypeInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class AnnotationTypeInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is AnnotationTypeInfo) - { - // Return the ToString value - return ((AnnotationTypeInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationTypeInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationTypeInfoList.cs deleted file mode 100644 index 7f04a375..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AnnotationTypeInfoList.cs +++ /dev/null @@ -1,198 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// AnnotationTypeInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(AnnotationTypeInfoListConverter))] - public partial class AnnotationTypeInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (AnnotationTypeInfo tmp in this) - { - tmp.Changed += new AnnotationTypeInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (AnnotationTypeInfo tmp in this) - { - tmp.Changed -= new AnnotationTypeInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static AnnotationTypeInfoList _AnnotationTypeInfoList = null; - /// - /// Return a list of all projects. - /// - public static AnnotationTypeInfoList Get() - { - try - { - if (_AnnotationTypeInfoList != null) - return _AnnotationTypeInfoList; - AnnotationTypeInfoList tmp = DataPortal.Fetch(); - AnnotationTypeInfo.AddList(tmp); - tmp.AddEvents(); - _AnnotationTypeInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AnnotationTypeInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static AnnotationTypeInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on AnnotationTypeInfoList.Get", ex); - // } - //} - private AnnotationTypeInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AnnotationTypeInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationTypes"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new AnnotationTypeInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AnnotationTypeInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("AnnotationTypeInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - AnnotationTypeInfoListPropertyDescriptor pd = new AnnotationTypeInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class AnnotationTypeInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private AnnotationTypeInfo Item { get { return (AnnotationTypeInfo)_Item; } } - public AnnotationTypeInfoListPropertyDescriptor(AnnotationTypeInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class AnnotationTypeInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is AnnotationTypeInfoList) - { - // Return department and department role separated by comma. - return ((AnnotationTypeInfoList)value).Items.Count.ToString() + " AnnotationTypes"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Assignment.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Assignment.cs deleted file mode 100644 index c62380cd..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Assignment.cs +++ /dev/null @@ -1,1195 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Assignment Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(AssignmentConverter))] - public partial class Assignment : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshAssignments = new List(); - private void AddToRefreshList(List refreshAssignments) - { - if (IsDirty) - refreshAssignments.Add(this); - } - private void BuildRefreshList() - { - _RefreshAssignments = new List(); - AddToRefreshList(_RefreshAssignments); - } - private void ProcessRefreshList() - { - foreach (Assignment tmp in _RefreshAssignments) - { - AssignmentInfo.Refresh(tmp); - if (tmp._MyFolder != null) FolderInfo.Refresh(tmp._MyFolder); - if (tmp._MyGroup != null) GroupInfo.Refresh(tmp._MyGroup); - if (tmp._MyRole != null) RoleInfo.Refresh(tmp._MyRole); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Assignment assignment) - { - if (!_CacheList.Contains(assignment)) _CacheList.Add(assignment); // In AddToCache - } - protected static void RemoveFromCache(Assignment assignment) - { - while (_CacheList.Contains(assignment)) _CacheList.Remove(assignment); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (Assignment tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.AID.ToString())) - { - _CacheByPrimaryKey[tmp.AID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.AID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (Assignment tmp in remove) - RemoveFromCache(tmp); - } - protected static Assignment GetCachedByPrimaryKey(int aid) - { - ConvertListToDictionary(); - string key = aid.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextAID = -1; - public static int NextAID - { - get { return _nextAID--; } - } - private int _AID; - [System.ComponentModel.DataObjectField(true, true)] - public int AID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AID; - } - } - private int _GID; - public int GID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyGroup != null) _GID = _MyGroup.GID; - return _GID; - } - } - private Group _MyGroup; - public Group MyGroup - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyGroup == null && _GID != 0) _MyGroup = Group.Get(_GID); - return _MyGroup; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyGroup != value) - { - _MyGroup = value; - PropertyHasChanged(); - } - } - } - private int _RID; - public int RID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRole != null) _RID = _MyRole.RID; - return _RID; - } - } - private Role _MyRole; - public Role MyRole - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRole == null && _RID != 0) _MyRole = Role.Get(_RID); - return _MyRole; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyRole != value) - { - _MyRole = value; - PropertyHasChanged(); - } - } - } - private int _FolderID; - public int FolderID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder != null) _FolderID = _MyFolder.FolderID; - return _FolderID; - } - } - private Folder _MyFolder; - public Folder MyFolder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder == null && _FolderID != 0) _MyFolder = Folder.Get(_FolderID); - return _MyFolder; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyFolder != value) - { - _MyFolder = value; - PropertyHasChanged(); - } - } - } - private string _StartDate = string.Empty; - public string StartDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _StartDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _StartDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_StartDate != tmp.ToString()) - { - _StartDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private string _EndDate = string.Empty; - public string EndDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _EndDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _EndDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_EndDate != tmp.ToString()) - { - _EndDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UsrID != value) - { - _UsrID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - public override bool IsDirty - { - get { return base.IsDirty || (_MyFolder == null ? false : _MyFolder.IsDirty) || (_MyGroup == null ? false : _MyGroup.IsDirty) || (_MyRole == null ? false : _MyRole.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid) && (_MyGroup == null ? true : _MyGroup.IsValid) && (_MyRole == null ? true : _MyRole.IsValid); } - } - // TODO: Replace base Assignment.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Assignment - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check Assignment.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Assignment - protected override object GetIdValue() - { - return _AID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyGroup != null && (hasBrokenRules = _MyGroup.HasBrokenRules) != null) return hasBrokenRules; - if (_MyRole != null && (hasBrokenRules = _MyRole.HasBrokenRules) != null) return hasBrokenRules; - if (_MyFolder != null && (hasBrokenRules = _MyFolder.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyGroupRequired, "MyGroup"); - ValidationRules.AddRule(MyRoleRequired, "MyRole"); - ValidationRules.AddRule(MyFolderRequired, "MyFolder"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "StartDate"); - ValidationRules.AddRule(StartDateValid, "StartDate"); - ValidationRules.AddRule(EndDateValid, "EndDate"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UsrID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UsrID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _AssignmentExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _AssignmentExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - private static bool StartDateValid(Assignment target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._StartDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool EndDateValid(Assignment target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._EndDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool MyGroupRequired(Assignment target, Csla.Validation.RuleArgs e) - { - if (target._GID == 0 && target._MyGroup == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - private static bool MyRoleRequired(Assignment target, Csla.Validation.RuleArgs e) - { - if (target._RID == 0 && target._MyRole == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - private static bool MyFolderRequired(Assignment target, Csla.Validation.RuleArgs e) - { - if (target._FolderID == 0 && target._MyFolder == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(AID, ""); - //AuthorizationRules.AllowRead(GID, ""); - //AuthorizationRules.AllowRead(RID, ""); - //AuthorizationRules.AllowRead(FolderID, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UsrID, ""); - //AuthorizationRules.AllowWrite(GID, ""); - //AuthorizationRules.AllowWrite(RID, ""); - //AuthorizationRules.AllowWrite(FolderID, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UsrID, ""); - _AssignmentExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _AssignmentExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _AssignmentUnique = 0; - protected static int AssignmentUnique - { get { return ++_AssignmentUnique; } } - private int _MyAssignmentUnique = AssignmentUnique; - public int MyAssignmentUnique - { get { return _MyAssignmentUnique; } } - protected Assignment() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(AID.ToString())) - { - List listAssignment = _CacheByPrimaryKey[AID.ToString()]; // Get the list of items - while (listAssignment.Contains(this)) listAssignment.Remove(this); // Remove the item from the list - if (listAssignment.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(AID.ToString()); // remove the list - } - } - public static Assignment New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Assignment"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Assignment.New", ex); - } - } - public static Assignment New(Group myGroup, Role myRole, Folder myFolder) - { - Assignment tmp = Assignment.New(); - tmp.MyGroup = myGroup; - tmp.MyRole = myRole; - tmp.MyFolder = myFolder; - return tmp; - } - public static Assignment New(Group myGroup, Role myRole, Folder myFolder, string startDate, string endDate, DateTime dts, string usrID) - { - Assignment tmp = Assignment.New(); - tmp.MyGroup = myGroup; - tmp.MyRole = myRole; - tmp.MyFolder = myFolder; - tmp.StartDate = startDate; - tmp.EndDate = endDate; - tmp.DTS = dts; - tmp.UsrID = usrID; - return tmp; - } - public static Assignment MakeAssignment(Group myGroup, Role myRole, Folder myFolder, string startDate, string endDate, DateTime dts, string usrID) - { - Assignment tmp = Assignment.New(myGroup, myRole, myFolder, startDate, endDate, dts, usrID); - if (tmp.IsSavable) - { - Assignment tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Assignment New(Group myGroup, Role myRole, Folder myFolder, string endDate) - { - Assignment tmp = Assignment.New(); - tmp.MyGroup = myGroup; - tmp.MyRole = myRole; - tmp.MyFolder = myFolder; - tmp.EndDate = endDate; - return tmp; - } - public static Assignment MakeAssignment(Group myGroup, Role myRole, Folder myFolder, string endDate) - { - Assignment tmp = Assignment.New(myGroup, myRole, myFolder, endDate); - if (tmp.IsSavable) - { - Assignment tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Assignment Get(int aid) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Assignment"); - try - { - Assignment tmp = GetCachedByPrimaryKey(aid); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(aid)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Assignment - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Assignment.Get", ex); - } - } - public static Assignment Get(SafeDataReader dr) - { - if (dr.Read()) return new Assignment(dr); - return null; - } - internal Assignment(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int aid) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Assignment"); - try - { - DataPortal.Delete(new PKCriteria(aid)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Assignment.Delete", ex); - } - } - public override Assignment Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Assignment"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Assignment"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Assignment"); - try - { - BuildRefreshList(); - Assignment assignment = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(assignment);//Refresh the item in AllList - ProcessRefreshList(); - return assignment; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _AID; - public int AID - { get { return _AID; } } - public PKCriteria(int aid) - { - _AID = aid; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _AID = NextAID; - // Database Defaults - _StartDate = _AssignmentExtension.DefaultStartDate; - _DTS = _AssignmentExtension.DefaultDTS; - _UsrID = _AssignmentExtension.DefaultUsrID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Assignment.ReadData", GetHashCode()); - try - { - _AID = dr.GetInt32("AID"); - _GID = dr.GetInt32("GID"); - _RID = dr.GetInt32("RID"); - _FolderID = dr.GetInt32("FolderID"); - _StartDate = dr.GetSmartDate("StartDate").Text; - _EndDate = dr.GetSmartDate("EndDate").Text; - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Assignment.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Assignment.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Assignment.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAssignment"; - cm.Parameters.AddWithValue("@AID", criteria.AID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Assignment.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Assignment.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Assignment.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Assignment.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Assignment.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyFolder != null) _MyFolder.Update(); - if (_MyGroup != null) _MyGroup.Update(); - if (_MyRole != null) _MyRole.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addAssignment"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@GID", GID); - cm.Parameters.AddWithValue("@RID", RID); - cm.Parameters.AddWithValue("@FolderID", FolderID); - cm.Parameters.AddWithValue("@StartDate", new SmartDate(_StartDate).DBValue); - cm.Parameters.AddWithValue("@EndDate", new SmartDate(_EndDate).DBValue); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UsrID", _UsrID); - // Output Calculated Columns - SqlParameter param_AID = new SqlParameter("@newAID", SqlDbType.Int); - param_AID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_AID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _AID = (int)cm.Parameters["@newAID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Assignment.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Assignment.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Assignment.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int aid, Group myGroup, Role myRole, Folder myFolder, SmartDate startDate, SmartDate endDate, DateTime dts, string usrID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Assignment.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addAssignment"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@GID", myGroup.GID); - cm.Parameters.AddWithValue("@RID", myRole.RID); - cm.Parameters.AddWithValue("@FolderID", myFolder.FolderID); - cm.Parameters.AddWithValue("@StartDate", startDate.DBValue); - cm.Parameters.AddWithValue("@EndDate", endDate.DBValue); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UsrID", usrID); - // Output Calculated Columns - SqlParameter param_AID = new SqlParameter("@newAID", SqlDbType.Int); - param_AID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_AID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - aid = (int)cm.Parameters["@newAID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Assignment.Add", ex); - throw new DbCslaException("Assignment.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Assignment.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Assignment.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Assignment.SQLUpdate", GetHashCode()); - try - { - if (_MyFolder != null) _MyFolder.Update(); - if (_MyGroup != null) _MyGroup.Update(); - if (_MyRole != null) _MyRole.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateAssignment"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@AID", _AID); - cm.Parameters.AddWithValue("@GID", GID); - cm.Parameters.AddWithValue("@RID", RID); - cm.Parameters.AddWithValue("@FolderID", FolderID); - cm.Parameters.AddWithValue("@StartDate", new SmartDate(_StartDate).DBValue); - cm.Parameters.AddWithValue("@EndDate", new SmartDate(_EndDate).DBValue); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UsrID", _UsrID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Assignment.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Assignment.Add(cn, ref _AID, _MyGroup, _MyRole, _MyFolder, new SmartDate(_StartDate), new SmartDate(_EndDate), _DTS, _UsrID); - else - _LastChanged = Assignment.Update(cn, ref _AID, _MyGroup, _MyRole, _MyFolder, new SmartDate(_StartDate), new SmartDate(_EndDate), _DTS, _UsrID, ref _LastChanged); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int aid, Group myGroup, Role myRole, Folder myFolder, SmartDate startDate, SmartDate endDate, DateTime dts, string usrID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Assignment.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateAssignment"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@AID", aid); - cm.Parameters.AddWithValue("@GID", myGroup.GID); - cm.Parameters.AddWithValue("@RID", myRole.RID); - cm.Parameters.AddWithValue("@FolderID", myFolder.FolderID); - cm.Parameters.AddWithValue("@StartDate", startDate.DBValue); - cm.Parameters.AddWithValue("@EndDate", endDate.DBValue); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UsrID", usrID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Assignment.Update", ex); - throw new DbCslaException("Assignment.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_AID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Assignment.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteAssignment"; - cm.Parameters.AddWithValue("@AID", criteria.AID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Assignment.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Assignment.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int aid) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Assignment.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteAssignment"; - // Input PK Fields - cm.Parameters.AddWithValue("@AID", aid); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Assignment.Remove", ex); - throw new DbCslaException("Assignment.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int aid) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(aid)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Assignment.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _AID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int aid) - { - _AID = aid; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Assignment.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsAssignment"; - cm.Parameters.AddWithValue("@AID", _AID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Assignment.DataPortal_Execute", ex); - throw new DbCslaException("Assignment.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - AssignmentExtension _AssignmentExtension = new AssignmentExtension(); - [Serializable()] - partial class AssignmentExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual string DefaultStartDate - { - get { return DateTime.Now.ToShortDateString(); } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUsrID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class AssignmentConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Assignment) - { - // Return the ToString value - return ((Assignment)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create AssignmentExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Assignment -// { -// partial class AssignmentExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual SmartDate DefaultStartDate -// { -// get { return DateTime.Now.ToShortDateString(); } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUsrID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AssignmentInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/AssignmentInfo.cs deleted file mode 100644 index 28b4bbd4..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AssignmentInfo.cs +++ /dev/null @@ -1,567 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void AssignmentInfoEvent(object sender); - /// - /// AssignmentInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(AssignmentInfoConverter))] - public partial class AssignmentInfo : ReadOnlyBase, IDisposable - { - public event AssignmentInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(AssignmentInfo assignmentInfo) - { - if (!_CacheList.Contains(assignmentInfo)) _CacheList.Add(assignmentInfo); // In AddToCache - } - protected static void RemoveFromCache(AssignmentInfo assignmentInfo) - { - while (_CacheList.Contains(assignmentInfo)) _CacheList.Remove(assignmentInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (AssignmentInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.AID.ToString())) - { - _CacheByPrimaryKey[tmp.AID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.AID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (AssignmentInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(AssignmentInfoList lst) - { - foreach (AssignmentInfo item in lst) AddToCache(item); - } - protected static AssignmentInfo GetCachedByPrimaryKey(int aid) - { - ConvertListToDictionary(); - string key = aid.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Assignment _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _AID; - [System.ComponentModel.DataObjectField(true, true)] - public int AID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AID; - } - } - private int _GID; - public int GID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyGroup != null) _GID = _MyGroup.GID; - return _GID; - } - } - private GroupInfo _MyGroup; - public GroupInfo MyGroup - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyGroup == null && _GID != 0) _MyGroup = GroupInfo.Get(_GID); - return _MyGroup; - } - } - private int _RID; - public int RID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRole != null) _RID = _MyRole.RID; - return _RID; - } - } - private RoleInfo _MyRole; - public RoleInfo MyRole - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRole == null && _RID != 0) _MyRole = RoleInfo.Get(_RID); - return _MyRole; - } - } - private int _FolderID; - public int FolderID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder != null) _FolderID = _MyFolder.FolderID; - return _FolderID; - } - } - private FolderInfo _MyFolder; - public FolderInfo MyFolder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder == null && _FolderID != 0) _MyFolder = FolderInfo.Get(_FolderID); - return _MyFolder; - } - } - private string _StartDate = string.Empty; - public string StartDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _StartDate; - } - } - private string _EndDate = string.Empty; - public string EndDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _EndDate; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - } - // TODO: Replace base AssignmentInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current AssignmentInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check AssignmentInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current AssignmentInfo - protected override object GetIdValue() - { - return _AID; - } - #endregion - #region Factory Methods - private static int _AssignmentInfoUnique = 0; - private static int AssignmentInfoUnique - { get { return ++_AssignmentInfoUnique; } } - private int _MyAssignmentInfoUnique = AssignmentInfoUnique; - public int MyAssignmentInfoUnique - { get { return _MyAssignmentInfoUnique; } } - protected AssignmentInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(AID.ToString())) return; - List listAssignmentInfo = _CacheByPrimaryKey[AID.ToString()]; // Get the list of items - while (listAssignmentInfo.Contains(this)) listAssignmentInfo.Remove(this); // Remove the item from the list - if (listAssignmentInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(AID.ToString()); // remove the list - } - public virtual Assignment Get() - { - return _Editable = Assignment.Get(_AID); - } - public static void Refresh(Assignment tmp) - { - string key = tmp.AID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (AssignmentInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Assignment tmp) - { - if (_GID != tmp.GID) - { - if (MyGroup != null) MyGroup.RefreshGroupAssignments(); // Update List for old value - _GID = tmp.GID; // Update the value - } - _MyGroup = null; // Reset list so that the next line gets a new list - if (MyGroup != null) MyGroup.RefreshGroupAssignments(); // Update List for new value - if (_RID != tmp.RID) - { - if (MyRole != null) MyRole.RefreshRoleAssignments(); // Update List for old value - _RID = tmp.RID; // Update the value - } - _MyRole = null; // Reset list so that the next line gets a new list - if (MyRole != null) MyRole.RefreshRoleAssignments(); // Update List for new value - if (_FolderID != tmp.FolderID) - { - if (MyFolder != null) MyFolder.RefreshFolderAssignments(); // Update List for old value - _FolderID = tmp.FolderID; // Update the value - } - _MyFolder = null; // Reset list so that the next line gets a new list - if (MyFolder != null) MyFolder.RefreshFolderAssignments(); // Update List for new value - _StartDate = tmp.StartDate; - _EndDate = tmp.EndDate; - _DTS = tmp.DTS; - _UsrID = tmp.UsrID; - _AssignmentInfoExtension.Refresh(this); - if (_MyGroup != null) - { - _MyGroup.Dispose();// Dispose related value - _MyGroup = null;// Reset related value - } - if (_MyRole != null) - { - _MyRole.Dispose();// Dispose related value - _MyRole = null;// Reset related value - } - if (_MyFolder != null) - { - _MyFolder.Dispose();// Dispose related value - _MyFolder = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(FolderAssignment tmp) - { - string key = tmp.AID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (AssignmentInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(FolderAssignment tmp) - { - if (_GID != tmp.GID) - { - if (MyGroup != null) MyGroup.RefreshGroupAssignments(); // Update List for old value - _GID = tmp.GID; // Update the value - } - _MyGroup = null; // Reset list so that the next line gets a new list - if (MyGroup != null) MyGroup.RefreshGroupAssignments(); // Update List for new value - if (_RID != tmp.RID) - { - if (MyRole != null) MyRole.RefreshRoleAssignments(); // Update List for old value - _RID = tmp.RID; // Update the value - } - _MyRole = null; // Reset list so that the next line gets a new list - if (MyRole != null) MyRole.RefreshRoleAssignments(); // Update List for new value - _StartDate = tmp.StartDate; - _EndDate = tmp.EndDate; - _DTS = tmp.DTS; - _UsrID = tmp.UsrID; - _AssignmentInfoExtension.Refresh(this); - if (_MyGroup != null) - { - _MyGroup.Dispose();// Dispose related value - _MyGroup = null;// Reset related value - } - if (_MyRole != null) - { - _MyRole.Dispose();// Dispose related value - _MyRole = null;// Reset related value - } - if (_MyFolder != null) - { - _MyFolder.Dispose();// Dispose related value - _MyFolder = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(GroupAssignment tmp) - { - string key = tmp.AID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (AssignmentInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(GroupAssignment tmp) - { - if (_RID != tmp.RID) - { - if (MyRole != null) MyRole.RefreshRoleAssignments(); // Update List for old value - _RID = tmp.RID; // Update the value - } - _MyRole = null; // Reset list so that the next line gets a new list - if (MyRole != null) MyRole.RefreshRoleAssignments(); // Update List for new value - if (_FolderID != tmp.FolderID) - { - if (MyFolder != null) MyFolder.RefreshFolderAssignments(); // Update List for old value - _FolderID = tmp.FolderID; // Update the value - } - _MyFolder = null; // Reset list so that the next line gets a new list - if (MyFolder != null) MyFolder.RefreshFolderAssignments(); // Update List for new value - _StartDate = tmp.StartDate; - _EndDate = tmp.EndDate; - _DTS = tmp.DTS; - _UsrID = tmp.UsrID; - _AssignmentInfoExtension.Refresh(this); - if (_MyGroup != null) - { - _MyGroup.Dispose();// Dispose related value - _MyGroup = null;// Reset related value - } - if (_MyRole != null) - { - _MyRole.Dispose();// Dispose related value - _MyRole = null;// Reset related value - } - if (_MyFolder != null) - { - _MyFolder.Dispose();// Dispose related value - _MyFolder = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(RoleAssignment tmp) - { - string key = tmp.AID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (AssignmentInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(RoleAssignment tmp) - { - if (_GID != tmp.GID) - { - if (MyGroup != null) MyGroup.RefreshGroupAssignments(); // Update List for old value - _GID = tmp.GID; // Update the value - } - _MyGroup = null; // Reset list so that the next line gets a new list - if (MyGroup != null) MyGroup.RefreshGroupAssignments(); // Update List for new value - if (_FolderID != tmp.FolderID) - { - if (MyFolder != null) MyFolder.RefreshFolderAssignments(); // Update List for old value - _FolderID = tmp.FolderID; // Update the value - } - _MyFolder = null; // Reset list so that the next line gets a new list - if (MyFolder != null) MyFolder.RefreshFolderAssignments(); // Update List for new value - _StartDate = tmp.StartDate; - _EndDate = tmp.EndDate; - _DTS = tmp.DTS; - _UsrID = tmp.UsrID; - _AssignmentInfoExtension.Refresh(this); - if (_MyGroup != null) - { - _MyGroup.Dispose();// Dispose related value - _MyGroup = null;// Reset related value - } - if (_MyRole != null) - { - _MyRole.Dispose();// Dispose related value - _MyRole = null;// Reset related value - } - if (_MyFolder != null) - { - _MyFolder.Dispose();// Dispose related value - _MyFolder = null;// Reset related value - } - OnChange();// raise an event - } - public static AssignmentInfo Get(int aid) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Assignment"); - try - { - AssignmentInfo tmp = GetCachedByPrimaryKey(aid); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(aid)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up AssignmentInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AssignmentInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal AssignmentInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssignmentInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AssignmentInfo.Constructor", ex); - throw new DbCslaException("AssignmentInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _AID; - public int AID - { get { return _AID; } } - public PKCriteria(int aid) - { - _AID = aid; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssignmentInfo.ReadData", GetHashCode()); - try - { - _AID = dr.GetInt32("AID"); - _GID = dr.GetInt32("GID"); - _RID = dr.GetInt32("RID"); - _FolderID = dr.GetInt32("FolderID"); - _StartDate = dr.GetSmartDate("StartDate").Text; - _EndDate = dr.GetSmartDate("EndDate").Text; - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AssignmentInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AssignmentInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssignmentInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAssignment"; - cm.Parameters.AddWithValue("@AID", criteria.AID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AssignmentInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("AssignmentInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - AssignmentInfoExtension _AssignmentInfoExtension = new AssignmentInfoExtension(); - [Serializable()] - partial class AssignmentInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(AssignmentInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class AssignmentInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is AssignmentInfo) - { - // Return the ToString value - return ((AssignmentInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AssignmentInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/AssignmentInfoList.cs deleted file mode 100644 index ff4a630a..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/AssignmentInfoList.cs +++ /dev/null @@ -1,369 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// AssignmentInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(AssignmentInfoListConverter))] - public partial class AssignmentInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (AssignmentInfo tmp in this) - { - tmp.Changed += new AssignmentInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (AssignmentInfo tmp in this) - { - tmp.Changed -= new AssignmentInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static AssignmentInfoList _AssignmentInfoList = null; - /// - /// Return a list of all projects. - /// - public static AssignmentInfoList Get() - { - try - { - if (_AssignmentInfoList != null) - return _AssignmentInfoList; - AssignmentInfoList tmp = DataPortal.Fetch(); - AssignmentInfo.AddList(tmp); - tmp.AddEvents(); - _AssignmentInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AssignmentInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static AssignmentInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on AssignmentInfoList.Get", ex); - // } - //} - public static AssignmentInfoList GetByFolderID(int folderID) - { - try - { - AssignmentInfoList tmp = DataPortal.Fetch(new FolderIDCriteria(folderID)); - AssignmentInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AssignmentInfoList.GetByFolderID", ex); - } - } - public static AssignmentInfoList GetByGID(int gid) - { - try - { - AssignmentInfoList tmp = DataPortal.Fetch(new GIDCriteria(gid)); - AssignmentInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AssignmentInfoList.GetByGID", ex); - } - } - public static AssignmentInfoList GetByRID(int rid) - { - try - { - AssignmentInfoList tmp = DataPortal.Fetch(new RIDCriteria(rid)); - AssignmentInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on AssignmentInfoList.GetByRID", ex); - } - } - private AssignmentInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssignmentInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAssignments"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new AssignmentInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AssignmentInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("AssignmentInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class FolderIDCriteria - { - public FolderIDCriteria(int folderID) - { - _FolderID = folderID; - } - private int _FolderID; - public int FolderID - { - get { return _FolderID; } - set { _FolderID = value; } - } - } - private void DataPortal_Fetch(FolderIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssignmentInfoList.DataPortal_FetchFolderID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAssignmentsByFolderID"; - cm.Parameters.AddWithValue("@FolderID", criteria.FolderID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new AssignmentInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AssignmentInfoList.DataPortal_FetchFolderID", ex); - throw new DbCslaException("AssignmentInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class GIDCriteria - { - public GIDCriteria(int gid) - { - _GID = gid; - } - private int _GID; - public int GID - { - get { return _GID; } - set { _GID = value; } - } - } - private void DataPortal_Fetch(GIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssignmentInfoList.DataPortal_FetchGID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAssignmentsByGID"; - cm.Parameters.AddWithValue("@GID", criteria.GID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new AssignmentInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AssignmentInfoList.DataPortal_FetchGID", ex); - throw new DbCslaException("AssignmentInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class RIDCriteria - { - public RIDCriteria(int rid) - { - _RID = rid; - } - private int _RID; - public int RID - { - get { return _RID; } - set { _RID = value; } - } - } - private void DataPortal_Fetch(RIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] AssignmentInfoList.DataPortal_FetchRID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAssignmentsByRID"; - cm.Parameters.AddWithValue("@RID", criteria.RID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new AssignmentInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("AssignmentInfoList.DataPortal_FetchRID", ex); - throw new DbCslaException("AssignmentInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - AssignmentInfoListPropertyDescriptor pd = new AssignmentInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class AssignmentInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private AssignmentInfo Item { get { return (AssignmentInfo)_Item; } } - public AssignmentInfoListPropertyDescriptor(AssignmentInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class AssignmentInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is AssignmentInfoList) - { - // Return department and department role separated by comma. - return ((AssignmentInfoList)value).Items.Count.ToString() + " Assignments"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ChildFolders.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ChildFolders.cs deleted file mode 100644 index 4fe873d8..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ChildFolders.cs +++ /dev/null @@ -1,309 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ChildFolders Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ChildFoldersConverter))] - public partial class ChildFolders : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public new Folder this[int folderID] - { - get - { - foreach (Folder folder in this) - if (folder.FolderID == folderID) - return folder; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public Folder GetItem(int folderID) - { - foreach (Folder folder in this) - if (folder.FolderID == folderID) - return folder; - return null; - } - public Folder Add(Folder myParent, string name, string shortName) // One to Many with unique fields - { - if (!Contains(name)) - { - Folder folder = Folder.New(myParent, name, shortName); - this.Add(folder); - return folder; - } - else - throw new InvalidOperationException("folder already exists"); - } - public void Remove(int folderID) - { - foreach (Folder folder in this) - { - if (folder.FolderID == folderID) - { - Remove(folder); - break; - } - } - } - public bool Contains(int folderID) - { - foreach (Folder folder in this) - if (folder.FolderID == folderID) - return true; - return false; - } - public bool ContainsDeleted(int folderID) - { - foreach (Folder folder in DeletedList) - if (folder.FolderID == folderID) - return true; - return false; - } - public bool Contains(string name) - { - foreach (Folder folder in this) - if (folder.Name == name) - return true; - return false; - } - public bool ContainsDeleted(string name) - { - foreach (Folder folder in DeletedList) - if (folder.Name == name) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (Folder folder in this) - if ((hasBrokenRules = folder.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static ChildFolders New() - { - return new ChildFolders(); - } - internal static ChildFolders Get(SafeDataReader dr, Folder parent) - { - return new ChildFolders(dr, parent); - } - public static ChildFolders GetByParentID(int parentID) - { - try - { - return DataPortal.Fetch(new ParentIDCriteria(parentID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ChildFolders.GetByParentID", ex); - } - } - private ChildFolders() - { - MarkAsChild(); - } - internal ChildFolders(SafeDataReader dr, Folder parent) - { - MarkAsChild(); - Fetch(dr, parent); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr, Folder parent) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(Folder.Get(dr, parent)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ParentIDCriteria - { - public ParentIDCriteria(int parentID) - { - _ParentID = parentID; - } - private int _ParentID; - public int ParentID - { - get { return _ParentID; } - set { _ParentID = value; } - } - } - private void DataPortal_Fetch(ParentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ChildFolders.DataPortal_FetchParentID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getChildFolders"; - cm.Parameters.AddWithValue("@ParentID", criteria.ParentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new Folder(dr, criteria.ParentID)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ChildFolders.DataPortal_FetchParentID", ex); - throw new DbCslaException("ChildFolders.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Folder folder) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (Folder obj in DeletedList) - obj.DeleteSelf(folder);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (Folder obj in this) - { - if (obj.IsNew) - obj.SQLInsert(); - else - obj.SQLUpdate(); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ChildFoldersPropertyDescriptor pd = new ChildFoldersPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ChildFoldersPropertyDescriptor : vlnListPropertyDescriptor - { - private Folder Item { get { return (Folder)_Item; } } - public ChildFoldersPropertyDescriptor(ChildFolders collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ChildFoldersConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ChildFolders) - { - // Return department and department role separated by comma. - return ((ChildFolders)value).Items.Count.ToString() + " Folders"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ChildFormats.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ChildFormats.cs deleted file mode 100644 index 3969d506..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ChildFormats.cs +++ /dev/null @@ -1,309 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ChildFormats Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ChildFormatsConverter))] - public partial class ChildFormats : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public new Format this[int formatID] - { - get - { - foreach (Format format in this) - if (format.FormatID == formatID) - return format; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public Format GetItem(int formatID) - { - foreach (Format format in this) - if (format.FormatID == formatID) - return format; - return null; - } - public Format Add(Format myParent, string name, string data) // One to Many with unique fields - { - if (!Contains(name)) - { - Format format = Format.New(myParent, name, data); - this.Add(format); - return format; - } - else - throw new InvalidOperationException("format already exists"); - } - public void Remove(int formatID) - { - foreach (Format format in this) - { - if (format.FormatID == formatID) - { - Remove(format); - break; - } - } - } - public bool Contains(int formatID) - { - foreach (Format format in this) - if (format.FormatID == formatID) - return true; - return false; - } - public bool ContainsDeleted(int formatID) - { - foreach (Format format in DeletedList) - if (format.FormatID == formatID) - return true; - return false; - } - public bool Contains(string name) - { - foreach (Format format in this) - if (format.Name == name) - return true; - return false; - } - public bool ContainsDeleted(string name) - { - foreach (Format format in DeletedList) - if (format.Name == name) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (Format format in this) - if ((hasBrokenRules = format.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static ChildFormats New() - { - return new ChildFormats(); - } - internal static ChildFormats Get(SafeDataReader dr, Format parent) - { - return new ChildFormats(dr, parent); - } - public static ChildFormats GetByParentID(int parentID) - { - try - { - return DataPortal.Fetch(new ParentIDCriteria(parentID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ChildFormats.GetByParentID", ex); - } - } - private ChildFormats() - { - MarkAsChild(); - } - internal ChildFormats(SafeDataReader dr, Format parent) - { - MarkAsChild(); - Fetch(dr, parent); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr, Format parent) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(Format.Get(dr, parent)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ParentIDCriteria - { - public ParentIDCriteria(int parentID) - { - _ParentID = parentID; - } - private int _ParentID; - public int ParentID - { - get { return _ParentID; } - set { _ParentID = value; } - } - } - private void DataPortal_Fetch(ParentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ChildFormats.DataPortal_FetchParentID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getChildFormats"; - cm.Parameters.AddWithValue("@ParentID", criteria.ParentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new Format(dr, criteria.ParentID)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ChildFormats.DataPortal_FetchParentID", ex); - throw new DbCslaException("ChildFormats.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Format format) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (Format obj in DeletedList) - obj.DeleteSelf(format);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (Format obj in this) - { - if (obj.IsNew) - obj.SQLInsert(); - else - obj.SQLUpdate(); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ChildFormatsPropertyDescriptor pd = new ChildFormatsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ChildFormatsPropertyDescriptor : vlnListPropertyDescriptor - { - private Format Item { get { return (Format)_Item; } } - public ChildFormatsPropertyDescriptor(ChildFormats collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ChildFormatsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ChildFormats) - { - // Return department and department role separated by comma. - return ((ChildFormats)value).Items.Count.ToString() + " Formats"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/CommonRules.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/CommonRules.cs deleted file mode 100644 index b59fd468..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/CommonRules.cs +++ /dev/null @@ -1,40 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -using System.Reflection; -namespace VEPROMS.CSLA.Library -{ - /// - /// CommonRules Generated by MyGeneration using the CSLA Object Mapping template - /// - public static class CommonRules - { - public static bool Required(object target, Csla.Validation.RuleArgs e) - { - PropertyInfo propertyInfoObj = target.GetType().GetProperty(e.PropertyName); - if (propertyInfoObj == null) return true; - if (propertyInfoObj.GetValue(target, null) == null) - { - e.Description = e.PropertyName + " is a required field"; - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Connection.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Connection.cs deleted file mode 100644 index 5744f913..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Connection.cs +++ /dev/null @@ -1,1236 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Connection Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ConnectionConverter))] - public partial class Connection : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshConnections = new List(); - private List _RefreshConnectionFolders = new List(); - private void AddToRefreshList(List refreshConnections, List refreshConnectionFolders) - { - if (IsDirty) - refreshConnections.Add(this); - if (_ConnectionFolders != null && _ConnectionFolders.IsDirty) - { - foreach (ConnectionFolder tmp in _ConnectionFolders) - { - if (tmp.IsDirty) refreshConnectionFolders.Add(tmp); - } - } - } - private void BuildRefreshList() - { - _RefreshConnections = new List(); - _RefreshConnectionFolders = new List(); - AddToRefreshList(_RefreshConnections, _RefreshConnectionFolders); - } - private void ProcessRefreshList() - { - foreach (Connection tmp in _RefreshConnections) - { - ConnectionInfo.Refresh(tmp); - } - foreach (ConnectionFolder tmp in _RefreshConnectionFolders) - { - FolderInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Connection connection) - { - if (!_CacheList.Contains(connection)) _CacheList.Add(connection); // In AddToCache - } - protected static void RemoveFromCache(Connection connection) - { - while (_CacheList.Contains(connection)) _CacheList.Remove(connection); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static Dictionary> _CacheByName = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (Connection tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.DBID.ToString())) - { - _CacheByPrimaryKey[tmp.DBID.ToString()] = new List(); // Add new list for PrimaryKey - _CacheByName[tmp.Name.ToString()] = new List(); // Add new list for Name - } - _CacheByPrimaryKey[tmp.DBID.ToString()].Add(tmp); // Add to Primary Key list - _CacheByName[tmp.Name.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); - } - foreach (Connection tmp in remove) - RemoveFromCache(tmp); - } - protected static Connection GetCachedByPrimaryKey(int dbid) - { - ConvertListToDictionary(); - string key = dbid.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - protected static Connection GetCachedByName(string name) - { - ConvertListToDictionary(); - string key = name.ToString(); - if (_CacheByName.ContainsKey(key)) return _CacheByName[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextDBID = -1; - public static int NextDBID - { - get { return _nextDBID--; } - } - private int _DBID; - [System.ComponentModel.DataObjectField(true, true)] - public int DBID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DBID; - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Name != value) - { - _Name = value; - PropertyHasChanged(); - } - } - } - private string _Title = string.Empty; - public string Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Title; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Title != value) - { - _Title = value; - PropertyHasChanged(); - } - } - } - private string _ConnectionString = string.Empty; - public string ConnectionString - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ConnectionString; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_ConnectionString != value) - { - _ConnectionString = value; - PropertyHasChanged(); - } - } - } - private int _ServerType; - /// - /// 0 SQL Server - /// - public int ServerType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ServerType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_ServerType != value) - { - _ServerType = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UsrID != value) - { - _UsrID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _ConnectionFolderCount = 0; - /// - /// Count of ConnectionFolders for this Connection - /// - public int ConnectionFolderCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ConnectionFolderCount; - } - } - private ConnectionFolders _ConnectionFolders = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ConnectionFoldersConverter))] - public ConnectionFolders ConnectionFolders - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ConnectionFolderCount > 0 && _ConnectionFolders == null) - _ConnectionFolders = ConnectionFolders.GetByDBID(DBID); - else if (_ConnectionFolders == null) - _ConnectionFolders = ConnectionFolders.New(); - return _ConnectionFolders; - } - } - public override bool IsDirty - { - get { return base.IsDirty || (_ConnectionFolders == null ? false : _ConnectionFolders.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_ConnectionFolders == null ? true : _ConnectionFolders.IsValid); } - } - // TODO: Replace base Connection.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Connection - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check Connection.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Connection - protected override object GetIdValue() - { - return _DBID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_ConnectionFolders != null && (hasBrokenRules = _ConnectionFolders.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Title", 510)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("ConnectionString", 510)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UsrID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UsrID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _ConnectionExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _ConnectionExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(DBID, ""); - //AuthorizationRules.AllowRead(Name, ""); - //AuthorizationRules.AllowRead(Title, ""); - //AuthorizationRules.AllowRead(ConnectionString, ""); - //AuthorizationRules.AllowRead(ServerType, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UsrID, ""); - //AuthorizationRules.AllowWrite(Name, ""); - //AuthorizationRules.AllowWrite(Title, ""); - //AuthorizationRules.AllowWrite(ConnectionString, ""); - //AuthorizationRules.AllowWrite(ServerType, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UsrID, ""); - _ConnectionExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _ConnectionExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - /// - /// determines if related records (Foreign Keys) will keep this Item from being deleted - /// - public bool CanDelete - { - get - { - // Check to make sure that there are not any related records - int usedByCount = 0; - usedByCount += _ConnectionFolderCount; - return (usedByCount == 0); - } - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _ConnectionUnique = 0; - protected static int ConnectionUnique - { get { return ++_ConnectionUnique; } } - private int _MyConnectionUnique = ConnectionUnique; - public int MyConnectionUnique - { get { return _MyConnectionUnique; } } - protected Connection() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(DBID.ToString())) - { - List listConnection = _CacheByPrimaryKey[DBID.ToString()]; // Get the list of items - while (listConnection.Contains(this)) listConnection.Remove(this); // Remove the item from the list - if (listConnection.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(DBID.ToString()); // remove the list - } - string myKey; - myKey = null; - foreach (string key in _CacheByName.Keys) - if (_CacheByName[key].Contains(this)) - myKey = key; - if (myKey != null) - { - List listConnection = _CacheByName[myKey]; // Get the list of items - listConnection.Remove(this); // Remove the item from the list - if (listConnection.Count == 0) //If there are no items left in the list - _CacheByName.Remove(myKey); // remove the list - } - } - public static Connection New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Connection"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Connection.New", ex); - } - } - public static Connection New(string name, string title, string connectionString, int serverType, string config, DateTime dts, string usrID) - { - Connection tmp = Connection.New(); - tmp.Name = name; - tmp.Title = title; - tmp.ConnectionString = connectionString; - tmp.ServerType = serverType; - tmp.Config = config; - tmp.DTS = dts; - tmp.UsrID = usrID; - return tmp; - } - public static Connection MakeConnection(string name, string title, string connectionString, int serverType, string config, DateTime dts, string usrID) - { - Connection tmp = Connection.New(name, title, connectionString, serverType, config, dts, usrID); - if (tmp.IsSavable) - { - Connection tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Connection New(string name, string title, string connectionString, string config) - { - Connection tmp = Connection.New(); - tmp.Name = name; - tmp.Title = title; - tmp.ConnectionString = connectionString; - tmp.Config = config; - return tmp; - } - public static Connection MakeConnection(string name, string title, string connectionString, string config) - { - Connection tmp = Connection.New(name, title, connectionString, config); - if (tmp.IsSavable) - { - Connection tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Connection Get(int dbid) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Connection"); - try - { - Connection tmp = GetCachedByPrimaryKey(dbid); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(dbid)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Connection - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Connection.Get", ex); - } - } - public static Connection GetByName(string name) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Connection"); - try - { - Connection tmp = GetCachedByName(name); - if (tmp == null) - { - tmp = DataPortal.Fetch(new NameCriteria(name)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Connection - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Connection.GetByName", ex); - } - } - public static Connection Get(SafeDataReader dr) - { - if (dr.Read()) return new Connection(dr); - return null; - } - internal Connection(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int dbid) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Connection"); - try - { - DataPortal.Delete(new PKCriteria(dbid)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Connection.Delete", ex); - } - } - public override Connection Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Connection"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Connection"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Connection"); - try - { - BuildRefreshList(); - Connection connection = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(connection);//Refresh the item in AllList - ProcessRefreshList(); - return connection; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _DBID; - public int DBID - { get { return _DBID; } } - public PKCriteria(int dbid) - { - _DBID = dbid; - } - } - [Serializable()] - private class NameCriteria - { - private string _Name; - public string Name - { get { return _Name; } } - public NameCriteria(string name) - { - _Name = name; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _DBID = NextDBID; - // Database Defaults - _ServerType = _ConnectionExtension.DefaultServerType; - _DTS = _ConnectionExtension.DefaultDTS; - _UsrID = _ConnectionExtension.DefaultUsrID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.ReadData", GetHashCode()); - try - { - _DBID = dr.GetInt32("DBID"); - _Name = dr.GetString("Name"); - _Title = dr.GetString("Title"); - _ConnectionString = dr.GetString("ConnectionString"); - _ServerType = dr.GetInt32("ServerType"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _ConnectionFolderCount = dr.GetInt32("FolderCount"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Connection.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getConnection"; - cm.Parameters.AddWithValue("@DBID", criteria.DBID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _ConnectionFolders = ConnectionFolders.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Connection.DataPortal_Fetch", ex); - } - } - private void DataPortal_Fetch(NameCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getConnectionByName"; - cm.Parameters.AddWithValue("@Name", criteria.Name); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Connection.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Connection.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addConnection"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@Name", _Name); - cm.Parameters.AddWithValue("@Title", _Title); - cm.Parameters.AddWithValue("@ConnectionString", _ConnectionString); - cm.Parameters.AddWithValue("@ServerType", _ServerType); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UsrID", _UsrID); - // Output Calculated Columns - SqlParameter param_DBID = new SqlParameter("@newDBID", SqlDbType.Int); - param_DBID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_DBID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _DBID = (int)cm.Parameters["@newDBID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_ConnectionFolders != null) _ConnectionFolders.Update(this); - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Connection.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int dbid, string name, string title, string connectionString, int serverType, string config, DateTime dts, string usrID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addConnection"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@Name", name); - cm.Parameters.AddWithValue("@Title", title); - cm.Parameters.AddWithValue("@ConnectionString", connectionString); - cm.Parameters.AddWithValue("@ServerType", serverType); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UsrID", usrID); - // Output Calculated Columns - SqlParameter param_DBID = new SqlParameter("@newDBID", SqlDbType.Int); - param_DBID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_DBID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - dbid = (int)cm.Parameters["@newDBID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.Add", ex); - throw new DbCslaException("Connection.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateConnection"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@DBID", _DBID); - cm.Parameters.AddWithValue("@Name", _Name); - cm.Parameters.AddWithValue("@Title", _Title); - cm.Parameters.AddWithValue("@ConnectionString", _ConnectionString); - cm.Parameters.AddWithValue("@ServerType", _ServerType); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UsrID", _UsrID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - if (_ConnectionFolders != null) _ConnectionFolders.Update(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Connection.Add(cn, ref _DBID, _Name, _Title, _ConnectionString, _ServerType, _Config, _DTS, _UsrID); - else - _LastChanged = Connection.Update(cn, ref _DBID, _Name, _Title, _ConnectionString, _ServerType, _Config, _DTS, _UsrID, ref _LastChanged); - MarkOld(); - } - if (_ConnectionFolders != null) _ConnectionFolders.Update(this); - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int dbid, string name, string title, string connectionString, int serverType, string config, DateTime dts, string usrID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateConnection"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@DBID", dbid); - cm.Parameters.AddWithValue("@Name", name); - cm.Parameters.AddWithValue("@Title", title); - cm.Parameters.AddWithValue("@ConnectionString", connectionString); - cm.Parameters.AddWithValue("@ServerType", serverType); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UsrID", usrID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.Update", ex); - throw new DbCslaException("Connection.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_DBID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteConnection"; - cm.Parameters.AddWithValue("@DBID", criteria.DBID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Connection.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int dbid) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteConnection"; - // Input PK Fields - cm.Parameters.AddWithValue("@DBID", dbid); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.Remove", ex); - throw new DbCslaException("Connection.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int dbid) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(dbid)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Connection.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _DBID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int dbid) - { - _DBID = dbid; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Connection.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsConnection"; - cm.Parameters.AddWithValue("@DBID", _DBID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection.DataPortal_Execute", ex); - throw new DbCslaException("Connection.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - ConnectionExtension _ConnectionExtension = new ConnectionExtension(); - [Serializable()] - partial class ConnectionExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultServerType - { - get { return 1; } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUsrID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ConnectionConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Connection) - { - // Return the ToString value - return ((Connection)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ConnectionExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Connection -// { -// partial class ConnectionExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultServerType -// { -// get { return 1; } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUsrID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ConnectionFolder.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ConnectionFolder.cs deleted file mode 100644 index 14a2e92b..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ConnectionFolder.cs +++ /dev/null @@ -1,614 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ConnectionFolder Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ConnectionFolderConverter))] - public partial class ConnectionFolder : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _FolderID; - [System.ComponentModel.DataObjectField(true, true)] - public int FolderID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder != null) _FolderID = _MyFolder.FolderID; - return _FolderID; - } - } - private Folder _MyFolder; - [System.ComponentModel.DataObjectField(true, true)] - public Folder MyFolder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder == null && _FolderID != 0) _MyFolder = Folder.Get(_FolderID); - return _MyFolder; - } - } - private int _ParentID; - public int ParentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyParent != null) _ParentID = _MyParent.FolderID; - return _ParentID; - } - } - private Folder _MyParent; - public Folder MyParent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyParent == null && _ParentID != _FolderID) _MyParent = Folder.Get(_ParentID); - return _MyParent; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyParent != value) - { - _MyParent = value; - PropertyHasChanged(); - } - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Name != value) - { - _Name = value; - PropertyHasChanged(); - } - } - } - private string _Title = string.Empty; - public string Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Title; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Title != value) - { - _Title = value; - PropertyHasChanged(); - } - } - } - private string _ShortName = string.Empty; - public string ShortName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ShortName; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_ShortName != value) - { - _ShortName = value; - PropertyHasChanged(); - } - } - } - private int? _FormatID; - public int? FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat != null) _FormatID = _MyFormat.FormatID; - return _FormatID; - } - } - private Format _MyFormat; - public Format MyFormat - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat == null && _FormatID != null) _MyFormat = Format.Get((int)_FormatID); - return _MyFormat; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if ((_MyFormat == null ? _FormatID : (int?)_MyFormat.FormatID) != (value == null ? null : (int?)value.FormatID)) - { - _MyFormat = value; - _FormatID = (value == null ? null : (int?)value.FormatID); - PropertyHasChanged(); - } - } - } - private double? _ManualOrder; - public double? ManualOrder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ManualOrder; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_ManualOrder != value) - { - _ManualOrder = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UsrID != value) - { - _UsrID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - // TODO: Check ConnectionFolder.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ConnectionFolder - protected override object GetIdValue() - { - return _FolderID; - } - // TODO: Replace base ConnectionFolder.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ConnectionFolder - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyFolder == null ? false : _MyFolder.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyFolder != null && (hasBrokenRules = _MyFolder.HasBrokenRules) != null) return hasBrokenRules; - if (_MyFormat != null && (hasBrokenRules = _MyFormat.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyFolderRequired, "MyFolder"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "Name"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Title", 510)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "ShortName"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("ShortName", 20)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UsrID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UsrID", 100)); - // TODO: Add other validation rules - } - private static bool MyFolderRequired(ConnectionFolder target, Csla.Validation.RuleArgs e) - { - if (target._ParentID == 0 && target._MyFolder == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(FolderID, ""); - //AuthorizationRules.AllowRead(ParentID, ""); - //AuthorizationRules.AllowWrite(ParentID, ""); - //AuthorizationRules.AllowRead(Name, ""); - //AuthorizationRules.AllowWrite(Name, ""); - //AuthorizationRules.AllowRead(Title, ""); - //AuthorizationRules.AllowWrite(Title, ""); - //AuthorizationRules.AllowRead(ShortName, ""); - //AuthorizationRules.AllowWrite(ShortName, ""); - //AuthorizationRules.AllowRead(FormatID, ""); - //AuthorizationRules.AllowWrite(FormatID, ""); - //AuthorizationRules.AllowRead(ManualOrder, ""); - //AuthorizationRules.AllowWrite(ManualOrder, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UsrID, ""); - //AuthorizationRules.AllowWrite(UsrID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static ConnectionFolder New(Folder myParent, string name, string shortName) - { - return new ConnectionFolder(myParent, name, shortName); - } - internal static ConnectionFolder Get(SafeDataReader dr) - { - return new ConnectionFolder(dr); - } - public ConnectionFolder() - { - MarkAsChild(); - _FolderID = Folder.NextFolderID; - _ParentID = _ConnectionFolderExtension.DefaultParentID; - _DTS = _ConnectionFolderExtension.DefaultDTS; - _UsrID = _ConnectionFolderExtension.DefaultUsrID; - ValidationRules.CheckRules(); - } - private ConnectionFolder(Folder myParent, string name, string shortName) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _ParentID = _ConnectionFolderExtension.DefaultParentID; - _DTS = _ConnectionFolderExtension.DefaultDTS; - _UsrID = _ConnectionFolderExtension.DefaultUsrID; - _MyParent = myParent; - _Name = name; - _ShortName = shortName; - ValidationRules.CheckRules(); - } - internal ConnectionFolder(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionFolder.FetchDR", GetHashCode()); - try - { - _FolderID = dr.GetInt32("FolderID"); - _ParentID = dr.GetInt32("ParentID"); - _Name = dr.GetString("Name"); - _Title = dr.GetString("Title"); - _ShortName = dr.GetString("ShortName"); - _FormatID = (int?)dr.GetValue("FormatID"); - _ManualOrder = (double?)dr.GetValue("ManualOrder"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionFolder.FetchDR", ex); - throw new DbCslaException("ConnectionFolder.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Connection myConnection) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Folder.Add(cn, ref _FolderID, Folder.Get(_ParentID), myConnection, _Name, _Title, _ShortName, _MyFormat, _ManualOrder, _Config, _DTS, _UsrID); - MarkOld(); - } - internal void Update(Connection myConnection) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Folder.Update(cn, ref _FolderID, Folder.Get(_ParentID), myConnection, _Name, _Title, _ShortName, _MyFormat, _ManualOrder, _Config, _DTS, _UsrID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Connection myConnection) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Folder.Remove(cn, _FolderID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - ConnectionFolderExtension _ConnectionFolderExtension = new ConnectionFolderExtension(); - [Serializable()] - partial class ConnectionFolderExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultParentID - { - get { return 1; } - } - public virtual int DefaultDBID - { - get { return 1; } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUsrID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ConnectionFolderConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ConnectionFolder) - { - // Return the ToString value - return ((ConnectionFolder)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ConnectionFolderExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ConnectionFolder -// { -// partial class ConnectionFolderExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultParentID -// { -// get { return 1; } -// } -// public virtual int DefaultDBID -// { -// get { return 1; } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUsrID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ConnectionFolders.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ConnectionFolders.cs deleted file mode 100644 index 722fbc92..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ConnectionFolders.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ConnectionFolders Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ConnectionFoldersConverter))] - public partial class ConnectionFolders : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public ConnectionFolder this[Folder myFolder] - { - get - { - foreach (ConnectionFolder folder in this) - if (folder.FolderID == myFolder.FolderID) - return folder; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public ConnectionFolder GetItem(Folder myFolder) - { - foreach (ConnectionFolder folder in this) - if (folder.FolderID == myFolder.FolderID) - return folder; - return null; - } - public ConnectionFolder Add(Folder myParent, string name, string shortName) // One to Many - { - ConnectionFolder folder = ConnectionFolder.New(myParent, name, shortName); - this.Add(folder); - return folder; - } - public void Remove(Folder myFolder) - { - foreach (ConnectionFolder folder in this) - { - if (folder.FolderID == myFolder.FolderID) - { - Remove(folder); - break; - } - } - } - public bool Contains(Folder myFolder) - { - foreach (ConnectionFolder folder in this) - if (folder.FolderID == myFolder.FolderID) - return true; - return false; - } - public bool ContainsDeleted(Folder myFolder) - { - foreach (ConnectionFolder folder in DeletedList) - if (folder.FolderID == myFolder.FolderID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (ConnectionFolder connectionFolder in this) - if ((hasBrokenRules = connectionFolder.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static ConnectionFolders New() - { - return new ConnectionFolders(); - } - internal static ConnectionFolders Get(SafeDataReader dr) - { - return new ConnectionFolders(dr); - } - public static ConnectionFolders GetByDBID(int dbid) - { - try - { - return DataPortal.Fetch(new DBIDCriteria(dbid)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ConnectionFolders.GetByDBID", ex); - } - } - private ConnectionFolders() - { - MarkAsChild(); - } - internal ConnectionFolders(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(ConnectionFolder.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class DBIDCriteria - { - public DBIDCriteria(int dbid) - { - _DBID = dbid; - } - private int _DBID; - public int DBID - { - get { return _DBID; } - set { _DBID = value; } - } - } - private void DataPortal_Fetch(DBIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionFolders.DataPortal_FetchDBID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFoldersByDBID"; - cm.Parameters.AddWithValue("@DBID", criteria.DBID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new ConnectionFolder(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionFolders.DataPortal_FetchDBID", ex); - throw new DbCslaException("ConnectionFolders.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Connection connection) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (ConnectionFolder obj in DeletedList) - obj.DeleteSelf(connection);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (ConnectionFolder obj in this) - { - if (obj.IsNew) - obj.Insert(connection); - else - obj.Update(connection); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ConnectionFoldersPropertyDescriptor pd = new ConnectionFoldersPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ConnectionFoldersPropertyDescriptor : vlnListPropertyDescriptor - { - private ConnectionFolder Item { get { return (ConnectionFolder)_Item; } } - public ConnectionFoldersPropertyDescriptor(ConnectionFolders collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ConnectionFoldersConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ConnectionFolders) - { - // Return department and department role separated by comma. - return ((ConnectionFolders)value).Items.Count.ToString() + " Folders"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ConnectionInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ConnectionInfo.cs deleted file mode 100644 index 74808061..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ConnectionInfo.cs +++ /dev/null @@ -1,400 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void ConnectionInfoEvent(object sender); - /// - /// ConnectionInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ConnectionInfoConverter))] - public partial class ConnectionInfo : ReadOnlyBase, IDisposable - { - public event ConnectionInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(ConnectionInfo connectionInfo) - { - if (!_CacheList.Contains(connectionInfo)) _CacheList.Add(connectionInfo); // In AddToCache - } - protected static void RemoveFromCache(ConnectionInfo connectionInfo) - { - while (_CacheList.Contains(connectionInfo)) _CacheList.Remove(connectionInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (ConnectionInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.DBID.ToString())) - { - _CacheByPrimaryKey[tmp.DBID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.DBID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (ConnectionInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(ConnectionInfoList lst) - { - foreach (ConnectionInfo item in lst) AddToCache(item); - } - protected static ConnectionInfo GetCachedByPrimaryKey(int dbid) - { - ConvertListToDictionary(); - string key = dbid.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Connection _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _DBID; - [System.ComponentModel.DataObjectField(true, true)] - public int DBID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DBID; - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - } - private string _Title = string.Empty; - public string Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Title; - } - } - private string _ConnectionString = string.Empty; - public string ConnectionString - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ConnectionString; - } - } - private int _ServerType; - /// - /// 0 SQL Server - /// - public int ServerType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ServerType; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - } - private int _ConnectionFolderCount = 0; - /// - /// Count of ConnectionFolders for this Connection - /// - public int ConnectionFolderCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ConnectionFolderCount; - } - } - private FolderInfoList _ConnectionFolders = null; - [TypeConverter(typeof(FolderInfoListConverter))] - public FolderInfoList ConnectionFolders - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ConnectionFolderCount < 0 || (_ConnectionFolderCount > 0 && _ConnectionFolders == null)) - _ConnectionFolders = FolderInfoList.GetByDBID(_DBID); - if (_ConnectionFolderCount < 0) - _ConnectionFolderCount = _ConnectionFolders.Count; - return _ConnectionFolders; - } - } - public void RefreshConnectionFolders() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_DBID.ToString())) - foreach (ConnectionInfo tmp in _CacheByPrimaryKey[_DBID.ToString()]) - tmp._ConnectionFolderCount = -1; // This will cause the data to be requeried - } - // TODO: Replace base ConnectionInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ConnectionInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check ConnectionInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ConnectionInfo - protected override object GetIdValue() - { - return _DBID; - } - #endregion - #region Factory Methods - private static int _ConnectionInfoUnique = 0; - private static int ConnectionInfoUnique - { get { return ++_ConnectionInfoUnique; } } - private int _MyConnectionInfoUnique = ConnectionInfoUnique; - public int MyConnectionInfoUnique - { get { return _MyConnectionInfoUnique; } } - protected ConnectionInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(DBID.ToString())) return; - List listConnectionInfo = _CacheByPrimaryKey[DBID.ToString()]; // Get the list of items - while (listConnectionInfo.Contains(this)) listConnectionInfo.Remove(this); // Remove the item from the list - if (listConnectionInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(DBID.ToString()); // remove the list - } - public virtual Connection Get() - { - return _Editable = Connection.Get(_DBID); - } - public static void Refresh(Connection tmp) - { - string key = tmp.DBID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ConnectionInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Connection tmp) - { - _Name = tmp.Name; - _Title = tmp.Title; - _ConnectionString = tmp.ConnectionString; - _ServerType = tmp.ServerType; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UsrID = tmp.UsrID; - _ConnectionInfoExtension.Refresh(this); - OnChange();// raise an event - } - public static ConnectionInfo Get(int dbid) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Connection"); - try - { - ConnectionInfo tmp = GetCachedByPrimaryKey(dbid); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(dbid)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ConnectionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ConnectionInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal ConnectionInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionInfo.Constructor", ex); - throw new DbCslaException("ConnectionInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _DBID; - public int DBID - { get { return _DBID; } } - public PKCriteria(int dbid) - { - _DBID = dbid; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionInfo.ReadData", GetHashCode()); - try - { - _DBID = dr.GetInt32("DBID"); - _Name = dr.GetString("Name"); - _Title = dr.GetString("Title"); - _ConnectionString = dr.GetString("ConnectionString"); - _ServerType = dr.GetInt32("ServerType"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - _ConnectionFolderCount = dr.GetInt32("FolderCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ConnectionInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getConnection"; - cm.Parameters.AddWithValue("@DBID", criteria.DBID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ConnectionInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - ConnectionInfoExtension _ConnectionInfoExtension = new ConnectionInfoExtension(); - [Serializable()] - partial class ConnectionInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(ConnectionInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class ConnectionInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ConnectionInfo) - { - // Return the ToString value - return ((ConnectionInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ConnectionInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ConnectionInfoList.cs deleted file mode 100644 index 31d27679..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ConnectionInfoList.cs +++ /dev/null @@ -1,198 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// ConnectionInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ConnectionInfoListConverter))] - public partial class ConnectionInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (ConnectionInfo tmp in this) - { - tmp.Changed += new ConnectionInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (ConnectionInfo tmp in this) - { - tmp.Changed -= new ConnectionInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static ConnectionInfoList _ConnectionInfoList = null; - /// - /// Return a list of all projects. - /// - public static ConnectionInfoList Get() - { - try - { - if (_ConnectionInfoList != null) - return _ConnectionInfoList; - ConnectionInfoList tmp = DataPortal.Fetch(); - ConnectionInfo.AddList(tmp); - tmp.AddEvents(); - _ConnectionInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ConnectionInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static ConnectionInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on ConnectionInfoList.Get", ex); - // } - //} - private ConnectionInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ConnectionInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getConnections"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new ConnectionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ConnectionInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ConnectionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ConnectionInfoListPropertyDescriptor pd = new ConnectionInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ConnectionInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private ConnectionInfo Item { get { return (ConnectionInfo)_Item; } } - public ConnectionInfoListPropertyDescriptor(ConnectionInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ConnectionInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ConnectionInfoList) - { - // Return department and department role separated by comma. - return ((ConnectionInfoList)value).Items.Count.ToString() + " Connections"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Content.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Content.cs deleted file mode 100644 index 2dc2d6f6..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Content.cs +++ /dev/null @@ -1,1422 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Content Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ContentConverter))] - public partial class Content : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshContents = new List(); - private List _RefreshContentDetails = new List(); - private List _RefreshContentItems = new List(); - private List _RefreshContentParts = new List(); - private List _RefreshContentRoUsages = new List(); - private List _RefreshContentTransitions = new List(); - private void AddToRefreshList(List refreshContents, List refreshContentDetails, List refreshContentItems, List refreshContentParts, List refreshContentRoUsages, List refreshContentTransitions) - { - if (IsDirty) - refreshContents.Add(this); - if (_ContentDetails != null && _ContentDetails.IsDirty) - { - foreach (ContentDetail tmp in _ContentDetails) - { - if (tmp.IsDirty) refreshContentDetails.Add(tmp); - } - } - if (_ContentItems != null && _ContentItems.IsDirty) - { - foreach (ContentItem tmp in _ContentItems) - { - if (tmp.IsDirty) refreshContentItems.Add(tmp); - } - } - if (_ContentParts != null && _ContentParts.IsDirty) - { - foreach (ContentPart tmp in _ContentParts) - { - if (tmp.IsDirty) refreshContentParts.Add(tmp); - } - } - if (_ContentRoUsages != null && _ContentRoUsages.IsDirty) - { - foreach (ContentRoUsage tmp in _ContentRoUsages) - { - if (tmp.IsDirty) refreshContentRoUsages.Add(tmp); - } - } - if (_ContentTransitions != null && _ContentTransitions.IsDirty) - { - foreach (ContentTransition tmp in _ContentTransitions) - { - if (tmp.IsDirty) refreshContentTransitions.Add(tmp); - } - } - } - private void BuildRefreshList() - { - _RefreshContents = new List(); - _RefreshContentDetails = new List(); - _RefreshContentItems = new List(); - _RefreshContentParts = new List(); - _RefreshContentRoUsages = new List(); - _RefreshContentTransitions = new List(); - AddToRefreshList(_RefreshContents, _RefreshContentDetails, _RefreshContentItems, _RefreshContentParts, _RefreshContentRoUsages, _RefreshContentTransitions); - } - private void ProcessRefreshList() - { - foreach (Content tmp in _RefreshContents) - { - ContentInfo.Refresh(tmp); - if (tmp._MyFormat != null) FormatInfo.Refresh(tmp._MyFormat); - } - foreach (ContentDetail tmp in _RefreshContentDetails) - { - DetailInfo.Refresh(tmp); - } - foreach (ContentItem tmp in _RefreshContentItems) - { - ItemInfo.Refresh(tmp); - } - foreach (ContentPart tmp in _RefreshContentParts) - { - PartInfo.Refresh(this, tmp); - } - foreach (ContentRoUsage tmp in _RefreshContentRoUsages) - { - RoUsageInfo.Refresh(tmp); - } - foreach (ContentTransition tmp in _RefreshContentTransitions) - { - TransitionInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Content content) - { - if (!_CacheList.Contains(content)) _CacheList.Add(content); // In AddToCache - } - protected static void RemoveFromCache(Content content) - { - while (_CacheList.Contains(content)) _CacheList.Remove(content); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (Content tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ContentID.ToString())) - { - _CacheByPrimaryKey[tmp.ContentID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ContentID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (Content tmp in remove) - RemoveFromCache(tmp); - } - protected static Content GetCachedByPrimaryKey(int contentID) - { - ConvertListToDictionary(); - string key = contentID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextContentID = -1; - public static int NextContentID - { - get { return _nextContentID--; } - } - private int _ContentID; - [System.ComponentModel.DataObjectField(true, true)] - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentID; - } - } - private string _Number = string.Empty; - public string Number - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Number; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Number != value) - { - _Number = value; - PropertyHasChanged(); - } - } - } - private string _Text = string.Empty; - public string Text - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Text; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Text != value) - { - _Text = value; - PropertyHasChanged(); - } - } - } - private int? _Type; - /// - /// 0 - Procedure, 10000 - Section, 20000 Step - /// - public int? Type - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Type; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_Type != value) - { - _Type = value; - PropertyHasChanged(); - } - } - } - private int? _FormatID; - public int? FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat != null) _FormatID = _MyFormat.FormatID; - return _FormatID; - } - } - private Format _MyFormat; - public Format MyFormat - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat == null && _FormatID != null) _MyFormat = Format.Get((int)_FormatID); - return _MyFormat; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if ((_MyFormat == null ? _FormatID : (int?)_MyFormat.FormatID) != (value == null ? null : (int?)value.FormatID)) - { - _MyFormat = value; - _FormatID = (value == null ? null : (int?)value.FormatID); - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _ContentDetailCount = 0; - /// - /// Count of ContentDetails for this Content - /// - public int ContentDetailCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentDetailCount; - } - } - private ContentDetails _ContentDetails = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ContentDetailsConverter))] - public ContentDetails ContentDetails - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ContentDetailCount > 0 && _ContentDetails == null) - _ContentDetails = ContentDetails.GetByContentID(ContentID); - else if (_ContentDetails == null) - _ContentDetails = ContentDetails.New(); - return _ContentDetails; - } - } - private int _ContentEntryCount = 0; - /// - /// Count of ContentEntries for this Content - /// - public int ContentEntryCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentEntryCount; - } - } - private Entry _MyEntry = null; - /// - /// Related Field - /// - [TypeConverter(typeof(EntryConverter))] - public Entry MyEntry - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyEntry == null) _MyEntry = Entry.New(this); - return _MyEntry; - } - } - private int _ContentItemCount = 0; - /// - /// Count of ContentItems for this Content - /// - public int ContentItemCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentItemCount; - } - } - private ContentItems _ContentItems = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ContentItemsConverter))] - public ContentItems ContentItems - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ContentItemCount > 0 && _ContentItems == null) - _ContentItems = ContentItems.GetByContentID(ContentID); - else if (_ContentItems == null) - _ContentItems = ContentItems.New(); - return _ContentItems; - } - } - private int _ContentPartCount = 0; - /// - /// Count of ContentParts for this Content - /// - public int ContentPartCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentPartCount; - } - } - private ContentParts _ContentParts = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ContentPartsConverter))] - public ContentParts ContentParts - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ContentPartCount > 0 && _ContentParts == null) - _ContentParts = ContentParts.GetByContentID(ContentID); - else if (_ContentParts == null) - _ContentParts = ContentParts.New(); - return _ContentParts; - } - } - private int _ContentRoUsageCount = 0; - /// - /// Count of ContentRoUsages for this Content - /// - public int ContentRoUsageCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentRoUsageCount; - } - } - private ContentRoUsages _ContentRoUsages = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ContentRoUsagesConverter))] - public ContentRoUsages ContentRoUsages - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ContentRoUsageCount > 0 && _ContentRoUsages == null) - _ContentRoUsages = ContentRoUsages.GetByContentID(ContentID); - else if (_ContentRoUsages == null) - _ContentRoUsages = ContentRoUsages.New(); - return _ContentRoUsages; - } - } - private int _ContentTransitionCount = 0; - /// - /// Count of ContentTransitions for this Content - /// - public int ContentTransitionCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentTransitionCount; - } - } - private ContentTransitions _ContentTransitions = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ContentTransitionsConverter))] - public ContentTransitions ContentTransitions - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ContentTransitionCount > 0 && _ContentTransitions == null) - _ContentTransitions = ContentTransitions.GetByFromID(ContentID); - else if (_ContentTransitions == null) - _ContentTransitions = ContentTransitions.New(); - return _ContentTransitions; - } - } - private int _ContentZContentCount = 0; - /// - /// Count of ContentZContents for this Content - /// - public int ContentZContentCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentZContentCount; - } - } - private ZContent _MyZContent = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ZContentConverter))] - public ZContent MyZContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyZContent == null) _MyZContent = ZContent.New(this); - return _MyZContent; - } - } - public override bool IsDirty - { - get { return base.IsDirty || (_ContentDetails == null ? false : _ContentDetails.IsDirty) || (_MyEntry == null ? false : _MyEntry.IsDirty) || (_ContentItems == null ? false : _ContentItems.IsDirty) || (_ContentParts == null ? false : _ContentParts.IsDirty) || (_ContentRoUsages == null ? false : _ContentRoUsages.IsDirty) || (_ContentTransitions == null ? false : _ContentTransitions.IsDirty) || (_MyZContent == null ? false : _MyZContent.IsDirty) || (_MyFormat == null ? false : _MyFormat.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_ContentDetails == null ? true : _ContentDetails.IsValid) && (_MyEntry == null ? true : _MyEntry.IsValid) && (_ContentItems == null ? true : _ContentItems.IsValid) && (_ContentParts == null ? true : _ContentParts.IsValid) && (_ContentRoUsages == null ? true : _ContentRoUsages.IsValid) && (_ContentTransitions == null ? true : _ContentTransitions.IsValid) && (_MyZContent == null ? true : _MyZContent.IsValid) && (_MyFormat == null ? true : _MyFormat.IsValid); } - } - // TODO: Replace base Content.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Content - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check Content.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Content - protected override object GetIdValue() - { - return _ContentID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_ContentItems != null && (hasBrokenRules = _ContentItems.HasBrokenRules) != null) return hasBrokenRules; - if (_ContentDetails != null && (hasBrokenRules = _ContentDetails.HasBrokenRules) != null) return hasBrokenRules; - if (_MyEntry != null && (hasBrokenRules = _MyEntry.HasBrokenRules) != null) return hasBrokenRules; - if (_ContentParts != null && (hasBrokenRules = _ContentParts.HasBrokenRules) != null) return hasBrokenRules; - if (_ContentRoUsages != null && (hasBrokenRules = _ContentRoUsages.HasBrokenRules) != null) return hasBrokenRules; - if (_ContentTransitions != null && (hasBrokenRules = _ContentTransitions.HasBrokenRules) != null) return hasBrokenRules; - if (_MyZContent != null && (hasBrokenRules = _MyZContent.HasBrokenRules) != null) return hasBrokenRules; - if (_MyFormat != null && (hasBrokenRules = _MyFormat.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Number", 30)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Text", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _ContentExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _ContentExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ContentID, ""); - //AuthorizationRules.AllowRead(Number, ""); - //AuthorizationRules.AllowRead(Text, ""); - //AuthorizationRules.AllowRead(Type, ""); - //AuthorizationRules.AllowRead(FormatID, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(Number, ""); - //AuthorizationRules.AllowWrite(Text, ""); - //AuthorizationRules.AllowWrite(Type, ""); - //AuthorizationRules.AllowWrite(FormatID, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - _ContentExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _ContentExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - /// - /// determines if related records (Foreign Keys) will keep this Item from being deleted - /// - public bool CanDelete - { - get - { - // Check to make sure that there are not any related records - int usedByCount = 0; - usedByCount += _ContentDetailCount; - usedByCount += _ContentEntryCount; - usedByCount += _ContentItemCount; - usedByCount += _ContentPartCount; - usedByCount += _ContentRoUsageCount; - usedByCount += _ContentTransitionCount; - usedByCount += _ContentZContentCount; - return (usedByCount == 0); - } - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _ContentUnique = 0; - protected static int ContentUnique - { get { return ++_ContentUnique; } } - private int _MyContentUnique = ContentUnique; - public int MyContentUnique - { get { return _MyContentUnique; } } - protected Content() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(ContentID.ToString())) - { - List listContent = _CacheByPrimaryKey[ContentID.ToString()]; // Get the list of items - while (listContent.Contains(this)) listContent.Remove(this); // Remove the item from the list - if (listContent.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(ContentID.ToString()); // remove the list - } - } - public static Content New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Content"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Content.New", ex); - } - } - public static Content New(string number, string text, int? type, Format myFormat, string config, DateTime dts, string userID) - { - Content tmp = Content.New(); - tmp.Number = number; - tmp.Text = text; - tmp.Type = type; - tmp.MyFormat = myFormat; - tmp.Config = config; - tmp.DTS = dts; - tmp.UserID = userID; - return tmp; - } - public static Content MakeContent(string number, string text, int? type, Format myFormat, string config, DateTime dts, string userID) - { - Content tmp = Content.New(number, text, type, myFormat, config, dts, userID); - if (tmp.IsSavable) - { - Content tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Content New(string number, string text, int? type, Format myFormat, string config) - { - Content tmp = Content.New(); - tmp.Number = number; - tmp.Text = text; - tmp.Type = type; - tmp.MyFormat = myFormat; - tmp.Config = config; - return tmp; - } - public static Content MakeContent(string number, string text, int? type, Format myFormat, string config) - { - Content tmp = Content.New(number, text, type, myFormat, config); - if (tmp.IsSavable) - { - Content tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Content Get(int contentID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Content"); - try - { - Content tmp = GetCachedByPrimaryKey(contentID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(contentID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Content - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Content.Get", ex); - } - } - public static Content Get(SafeDataReader dr) - { - if (dr.Read()) return new Content(dr); - return null; - } - internal Content(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int contentID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Content"); - try - { - DataPortal.Delete(new PKCriteria(contentID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Content.Delete", ex); - } - } - public override Content Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Content"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Content"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Content"); - try - { - BuildRefreshList(); - Content content = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(content);//Refresh the item in AllList - ProcessRefreshList(); - return content; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _ContentID; - public int ContentID - { get { return _ContentID; } } - public PKCriteria(int contentID) - { - _ContentID = contentID; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _ContentID = NextContentID; - // Database Defaults - _DTS = _ContentExtension.DefaultDTS; - _UserID = _ContentExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Content.ReadData", GetHashCode()); - try - { - _ContentID = dr.GetInt32("ContentID"); - _Number = dr.GetString("Number"); - _Text = dr.GetString("Text"); - _Type = (int?)dr.GetValue("Type"); - _FormatID = (int?)dr.GetValue("FormatID"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _ContentDetailCount = dr.GetInt32("DetailCount"); - _ContentEntryCount = dr.GetInt32("EntryCount"); - _ContentItemCount = dr.GetInt32("ItemCount"); - _ContentPartCount = dr.GetInt32("PartCount"); - _ContentRoUsageCount = dr.GetInt32("RoUsageCount"); - _ContentTransitionCount = dr.GetInt32("TransitionCount"); - _ContentZContentCount = dr.GetInt32("ZContentCount"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Content.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Content.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Content.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getContent"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _ContentDetails = ContentDetails.Get(dr); - // load child objects - dr.NextResult(); - _MyEntry = Entry.Get(dr); - // load child objects - dr.NextResult(); - _ContentItems = ContentItems.Get(dr); - // load child objects - dr.NextResult(); - _ContentParts = ContentParts.Get(dr); - // load child objects - dr.NextResult(); - _ContentRoUsages = ContentRoUsages.Get(dr); - // load child objects - dr.NextResult(); - _ContentTransitions = ContentTransitions.Get(dr); - // load child objects - dr.NextResult(); - _MyZContent = ZContent.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Content.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Content.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Content.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Content.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Content.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyFormat != null) _MyFormat.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addContent"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@Number", _Number); - cm.Parameters.AddWithValue("@Text", _Text); - cm.Parameters.AddWithValue("@Type", _Type); - cm.Parameters.AddWithValue("@FormatID", FormatID); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - // Output Calculated Columns - SqlParameter param_ContentID = new SqlParameter("@newContentID", SqlDbType.Int); - param_ContentID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_ContentID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _ContentID = (int)cm.Parameters["@newContentID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_ContentItems != null) _ContentItems.Update(this); - if (_ContentDetails != null) _ContentDetails.Update(this); - if (_MyEntry != null) _MyEntry.Update(this); - if (_ContentParts != null) _ContentParts.Update(this); - if (_ContentRoUsages != null) _ContentRoUsages.Update(this); - if (_ContentTransitions != null) _ContentTransitions.Update(this); - if (_MyZContent != null) _MyZContent.Update(this); - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Content.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Content.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Content.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int contentID, string number, string text, int? type, Format myFormat, string config, DateTime dts, string userID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Content.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addContent"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@Number", number); - cm.Parameters.AddWithValue("@Text", text); - cm.Parameters.AddWithValue("@Type", type); - if (myFormat != null) cm.Parameters.AddWithValue("@FormatID", myFormat.FormatID); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - // Output Calculated Columns - SqlParameter param_ContentID = new SqlParameter("@newContentID", SqlDbType.Int); - param_ContentID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_ContentID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - contentID = (int)cm.Parameters["@newContentID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Content.Add", ex); - throw new DbCslaException("Content.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Content.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Content.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Content.SQLUpdate", GetHashCode()); - try - { - if (_MyFormat != null) _MyFormat.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateContent"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@ContentID", _ContentID); - cm.Parameters.AddWithValue("@Number", _Number); - cm.Parameters.AddWithValue("@Text", _Text); - cm.Parameters.AddWithValue("@Type", _Type); - cm.Parameters.AddWithValue("@FormatID", FormatID); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - if (_ContentItems != null) _ContentItems.Update(this); - if (_ContentDetails != null) _ContentDetails.Update(this); - if (_MyEntry != null) _MyEntry.Update(this); - if (_ContentParts != null) _ContentParts.Update(this); - if (_ContentRoUsages != null) _ContentRoUsages.Update(this); - if (_ContentTransitions != null) _ContentTransitions.Update(this); - if (_MyZContent != null) _MyZContent.Update(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Content.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Content.Add(cn, ref _ContentID, _Number, _Text, _Type, _MyFormat, _Config, _DTS, _UserID); - else - _LastChanged = Content.Update(cn, ref _ContentID, _Number, _Text, _Type, _MyFormat, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - if (_ContentItems != null) _ContentItems.Update(this); - if (_ContentDetails != null) _ContentDetails.Update(this); - if (_MyEntry != null) _MyEntry.Update(this); - if (_ContentParts != null) _ContentParts.Update(this); - if (_ContentRoUsages != null) _ContentRoUsages.Update(this); - if (_ContentTransitions != null) _ContentTransitions.Update(this); - if (_MyZContent != null) _MyZContent.Update(this); - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int contentID, string number, string text, int? type, Format myFormat, string config, DateTime dts, string userID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Content.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateContent"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", contentID); - cm.Parameters.AddWithValue("@Number", number); - cm.Parameters.AddWithValue("@Text", text); - cm.Parameters.AddWithValue("@Type", type); - if (myFormat != null) cm.Parameters.AddWithValue("@FormatID", myFormat.FormatID); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Content.Update", ex); - throw new DbCslaException("Content.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_ContentID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Content.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteContent"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Content.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Content.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int contentID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Content.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteContent"; - // Input PK Fields - cm.Parameters.AddWithValue("@ContentID", contentID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Content.Remove", ex); - throw new DbCslaException("Content.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int contentID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(contentID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Content.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _ContentID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int contentID) - { - _ContentID = contentID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Content.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsContent"; - cm.Parameters.AddWithValue("@ContentID", _ContentID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Content.DataPortal_Execute", ex); - throw new DbCslaException("Content.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - ContentExtension _ContentExtension = new ContentExtension(); - [Serializable()] - partial class ContentExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ContentConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Content) - { - // Return the ToString value - return ((Content)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ContentExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Content -// { -// partial class ContentExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentDetail.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentDetail.cs deleted file mode 100644 index fd8a3418..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentDetail.cs +++ /dev/null @@ -1,458 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ContentDetail Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ContentDetailConverter))] - public partial class ContentDetail : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _DetailID; - [System.ComponentModel.DataObjectField(true, true)] - public int DetailID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDetail != null) _DetailID = _MyDetail.DetailID; - return _DetailID; - } - } - private Detail _MyDetail; - [System.ComponentModel.DataObjectField(true, true)] - public Detail MyDetail - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDetail == null && _DetailID != 0) _MyDetail = Detail.Get(_DetailID); - return _MyDetail; - } - } - private int _ItemType; - public int ItemType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_ItemType != value) - { - _ItemType = value; - PropertyHasChanged(); - } - } - } - private string _Text = string.Empty; - public string Text - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Text; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Text != value) - { - _Text = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - // TODO: Check ContentDetail.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ContentDetail - protected override object GetIdValue() - { - return _DetailID; - } - // TODO: Replace base ContentDetail.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ContentDetail - //public override string ToString() - //{ - // return base.ToString(); - //} - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "Text"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Text", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(DetailID, ""); - //AuthorizationRules.AllowRead(ItemType, ""); - //AuthorizationRules.AllowWrite(ItemType, ""); - //AuthorizationRules.AllowRead(Text, ""); - //AuthorizationRules.AllowWrite(Text, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static ContentDetail New(int itemType, string text) - { - return new ContentDetail(itemType, text); - } - internal static ContentDetail Get(SafeDataReader dr) - { - return new ContentDetail(dr); - } - public ContentDetail() - { - MarkAsChild(); - _DetailID = Detail.NextDetailID; - _DTS = _ContentDetailExtension.DefaultDTS; - _UserID = _ContentDetailExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private ContentDetail(int itemType, string text) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _DTS = _ContentDetailExtension.DefaultDTS; - _UserID = _ContentDetailExtension.DefaultUserID; - _ItemType = itemType; - _Text = text; - ValidationRules.CheckRules(); - } - internal ContentDetail(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentDetail.FetchDR", GetHashCode()); - try - { - _DetailID = dr.GetInt32("DetailID"); - _ItemType = dr.GetInt32("ItemType"); - _Text = dr.GetString("Text"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentDetail.FetchDR", ex); - throw new DbCslaException("ContentDetail.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Content myContent) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Detail.Add(cn, ref _DetailID, myContent, _ItemType, _Text, _Config, _DTS, _UserID); - MarkOld(); - } - internal void Update(Content myContent) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Detail.Update(cn, ref _DetailID, myContent, _ItemType, _Text, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Content myContent) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Detail.Remove(cn, _DetailID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - ContentDetailExtension _ContentDetailExtension = new ContentDetailExtension(); - [Serializable()] - partial class ContentDetailExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ContentDetailConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ContentDetail) - { - // Return the ToString value - return ((ContentDetail)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ContentDetailExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ContentDetail -// { -// partial class ContentDetailExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentDetails.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentDetails.cs deleted file mode 100644 index 071c3bac..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentDetails.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ContentDetails Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ContentDetailsConverter))] - public partial class ContentDetails : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public ContentDetail this[Detail myDetail] - { - get - { - foreach (ContentDetail detail in this) - if (detail.DetailID == myDetail.DetailID) - return detail; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public ContentDetail GetItem(Detail myDetail) - { - foreach (ContentDetail detail in this) - if (detail.DetailID == myDetail.DetailID) - return detail; - return null; - } - public ContentDetail Add(int itemType, string text) // One to Many - { - ContentDetail detail = ContentDetail.New(itemType, text); - this.Add(detail); - return detail; - } - public void Remove(Detail myDetail) - { - foreach (ContentDetail detail in this) - { - if (detail.DetailID == myDetail.DetailID) - { - Remove(detail); - break; - } - } - } - public bool Contains(Detail myDetail) - { - foreach (ContentDetail detail in this) - if (detail.DetailID == myDetail.DetailID) - return true; - return false; - } - public bool ContainsDeleted(Detail myDetail) - { - foreach (ContentDetail detail in DeletedList) - if (detail.DetailID == myDetail.DetailID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (ContentDetail contentDetail in this) - if ((hasBrokenRules = contentDetail.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static ContentDetails New() - { - return new ContentDetails(); - } - internal static ContentDetails Get(SafeDataReader dr) - { - return new ContentDetails(dr); - } - public static ContentDetails GetByContentID(int contentID) - { - try - { - return DataPortal.Fetch(new ContentIDCriteria(contentID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentDetails.GetByContentID", ex); - } - } - private ContentDetails() - { - MarkAsChild(); - } - internal ContentDetails(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(ContentDetail.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ContentIDCriteria - { - public ContentIDCriteria(int contentID) - { - _ContentID = contentID; - } - private int _ContentID; - public int ContentID - { - get { return _ContentID; } - set { _ContentID = value; } - } - } - private void DataPortal_Fetch(ContentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentDetails.DataPortal_FetchContentID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDetailsByContentID"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new ContentDetail(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentDetails.DataPortal_FetchContentID", ex); - throw new DbCslaException("ContentDetails.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Content content) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (ContentDetail obj in DeletedList) - obj.DeleteSelf(content);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (ContentDetail obj in this) - { - if (obj.IsNew) - obj.Insert(content); - else - obj.Update(content); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ContentDetailsPropertyDescriptor pd = new ContentDetailsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ContentDetailsPropertyDescriptor : vlnListPropertyDescriptor - { - private ContentDetail Item { get { return (ContentDetail)_Item; } } - public ContentDetailsPropertyDescriptor(ContentDetails collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ContentDetailsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ContentDetails) - { - // Return department and department role separated by comma. - return ((ContentDetails)value).Items.Count.ToString() + " Details"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentInfo.cs deleted file mode 100644 index 13462b31..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentInfo.cs +++ /dev/null @@ -1,662 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void ContentInfoEvent(object sender); - /// - /// ContentInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ContentInfoConverter))] - public partial class ContentInfo : ReadOnlyBase, IDisposable - { - public event ContentInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(ContentInfo contentInfo) - { - if (!_CacheList.Contains(contentInfo)) _CacheList.Add(contentInfo); // In AddToCache - } - protected static void RemoveFromCache(ContentInfo contentInfo) - { - while (_CacheList.Contains(contentInfo)) _CacheList.Remove(contentInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (ContentInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ContentID.ToString())) - { - _CacheByPrimaryKey[tmp.ContentID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ContentID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (ContentInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(ContentInfoList lst) - { - foreach (ContentInfo item in lst) AddToCache(item); - } - protected static ContentInfo GetCachedByPrimaryKey(int contentID) - { - ConvertListToDictionary(); - string key = contentID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Content _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _ContentID; - [System.ComponentModel.DataObjectField(true, true)] - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentID; - } - } - private string _Number = string.Empty; - public string Number - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Number; - } - } - private string _Text = string.Empty; - public string Text - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Text; - } - } - private int? _Type; - /// - /// 0 - Procedure, 10000 - Section, 20000 Step - /// - public int? Type - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Type; - } - } - private int? _FormatID; - public int? FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat != null) _FormatID = _MyFormat.FormatID; - return _FormatID; - } - } - private FormatInfo _MyFormat; - public FormatInfo MyFormat - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat == null && _FormatID != null) _MyFormat = FormatInfo.Get((int)_FormatID); - return _MyFormat; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - private int _ContentDetailCount = 0; - /// - /// Count of ContentDetails for this Content - /// - public int ContentDetailCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentDetailCount; - } - } - private DetailInfoList _ContentDetails = null; - [TypeConverter(typeof(DetailInfoListConverter))] - public DetailInfoList ContentDetails - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ContentDetailCount < 0 || (_ContentDetailCount > 0 && _ContentDetails == null)) - _ContentDetails = DetailInfoList.GetByContentID(_ContentID); - if (_ContentDetailCount < 0) - _ContentDetailCount = _ContentDetails.Count; - return _ContentDetails; - } - } - public void RefreshContentDetails() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ContentID.ToString())) - foreach (ContentInfo tmp in _CacheByPrimaryKey[_ContentID.ToString()]) - tmp._ContentDetailCount = -1; // This will cause the data to be requeried - } - private int _ContentEntryCount = 0; - /// - /// Count of ContentEntries for this Content - /// - public int ContentEntryCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentEntryCount; - } - } - private EntryInfo _MyEntry = null; - [TypeConverter(typeof(EntryInfoConverter))] - public EntryInfo MyEntry - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ContentEntryCount != 0 && _MyEntry == null) - { - _MyEntry = EntryInfo.Get(_ContentID); - _ContentEntryCount = _MyEntry == null ? 0 : 1; - } - return _MyEntry; - } - } - private int _ContentItemCount = 0; - /// - /// Count of ContentItems for this Content - /// - public int ContentItemCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentItemCount; - } - } - private ItemInfoList _ContentItems = null; - [TypeConverter(typeof(ItemInfoListConverter))] - public ItemInfoList ContentItems - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ContentItemCount < 0 || (_ContentItemCount > 0 && _ContentItems == null)) - _ContentItems = ItemInfoList.GetByContentID(_ContentID); - if (_ContentItemCount < 0) - _ContentItemCount = _ContentItems.Count; - return _ContentItems; - } - } - public void RefreshContentItems() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ContentID.ToString())) - foreach (ContentInfo tmp in _CacheByPrimaryKey[_ContentID.ToString()]) - tmp._ContentItemCount = -1; // This will cause the data to be requeried - } - private int _ContentPartCount = 0; - /// - /// Count of ContentParts for this Content - /// - public int ContentPartCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentPartCount; - } - } - private PartInfoList _ContentParts = null; - [TypeConverter(typeof(PartInfoListConverter))] - public PartInfoList ContentParts - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ContentPartCount < 0 || (_ContentPartCount > 0 && _ContentParts == null)) - _ContentParts = PartInfoList.GetByContentID(_ContentID); - if (_ContentPartCount < 0) - _ContentPartCount = _ContentParts.Count; - return _ContentParts; - } - } - public void RefreshContentParts() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ContentID.ToString())) - foreach (ContentInfo tmp in _CacheByPrimaryKey[_ContentID.ToString()]) - tmp._ContentPartCount = -1; // This will cause the data to be requeried - } - private int _ContentRoUsageCount = 0; - /// - /// Count of ContentRoUsages for this Content - /// - public int ContentRoUsageCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentRoUsageCount; - } - } - private RoUsageInfoList _ContentRoUsages = null; - [TypeConverter(typeof(RoUsageInfoListConverter))] - public RoUsageInfoList ContentRoUsages - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ContentRoUsageCount < 0 || (_ContentRoUsageCount > 0 && _ContentRoUsages == null)) - _ContentRoUsages = RoUsageInfoList.GetByContentID(_ContentID); - if (_ContentRoUsageCount < 0) - _ContentRoUsageCount = _ContentRoUsages.Count; - return _ContentRoUsages; - } - } - public void RefreshContentRoUsages() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ContentID.ToString())) - foreach (ContentInfo tmp in _CacheByPrimaryKey[_ContentID.ToString()]) - tmp._ContentRoUsageCount = -1; // This will cause the data to be requeried - } - private int _ContentTransitionCount = 0; - /// - /// Count of ContentTransitions for this Content - /// - public int ContentTransitionCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentTransitionCount; - } - } - private TransitionInfoList _ContentTransitions = null; - [TypeConverter(typeof(TransitionInfoListConverter))] - public TransitionInfoList ContentTransitions - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ContentTransitionCount < 0 || (_ContentTransitionCount > 0 && _ContentTransitions == null)) - _ContentTransitions = TransitionInfoList.GetByFromID(_ContentID); - if (_ContentTransitionCount < 0) - _ContentTransitionCount = _ContentTransitions.Count; - return _ContentTransitions; - } - } - public void RefreshContentTransitions() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ContentID.ToString())) - foreach (ContentInfo tmp in _CacheByPrimaryKey[_ContentID.ToString()]) - tmp._ContentTransitionCount = -1; // This will cause the data to be requeried - } - private int _ContentZContentCount = 0; - /// - /// Count of ContentZContents for this Content - /// - public int ContentZContentCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ContentZContentCount; - } - } - private ZContentInfo _MyZContent = null; - [TypeConverter(typeof(ZContentInfoConverter))] - public ZContentInfo MyZContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ContentZContentCount != 0 && _MyZContent == null) - { - _MyZContent = ZContentInfo.Get(_ContentID); - _ContentZContentCount = _MyZContent == null ? 0 : 1; - } - return _MyZContent; - } - } - // TODO: Replace base ContentInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ContentInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check ContentInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ContentInfo - protected override object GetIdValue() - { - return _ContentID; - } - #endregion - #region Factory Methods - private static int _ContentInfoUnique = 0; - private static int ContentInfoUnique - { get { return ++_ContentInfoUnique; } } - private int _MyContentInfoUnique = ContentInfoUnique; - public int MyContentInfoUnique - { get { return _MyContentInfoUnique; } } - protected ContentInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(ContentID.ToString())) return; - List listContentInfo = _CacheByPrimaryKey[ContentID.ToString()]; // Get the list of items - while (listContentInfo.Contains(this)) listContentInfo.Remove(this); // Remove the item from the list - if (listContentInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(ContentID.ToString()); // remove the list - } - public virtual Content Get() - { - return _Editable = Content.Get(_ContentID); - } - public static void Refresh(Content tmp) - { - string key = tmp.ContentID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ContentInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Content tmp) - { - _Number = tmp.Number; - _Text = tmp.Text; - _Type = tmp.Type; - if (_FormatID != tmp.FormatID) - { - if (MyFormat != null) MyFormat.RefreshFormatContents(); // Update List for old value - _FormatID = tmp.FormatID; // Update the value - } - _MyFormat = null; // Reset list so that the next line gets a new list - if (MyFormat != null) MyFormat.RefreshFormatContents(); // Update List for new value - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _ContentInfoExtension.Refresh(this); - if (_MyFormat != null) - { - _MyFormat.Dispose();// Dispose related value - _MyFormat = null;// Reset related value - } - if (_MyEntry != null) - { - _MyEntry.Dispose();// Dispose related value - _MyEntry = null;// Reset related value - } - _ContentEntryCount = -1;// Reset Count - if (_MyZContent != null) - { - _MyZContent.Dispose();// Dispose related value - _MyZContent = null;// Reset related value - } - _ContentZContentCount = -1;// Reset Count - OnChange();// raise an event - } - public static void Refresh(FormatContent tmp) - { - string key = tmp.ContentID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ContentInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(FormatContent tmp) - { - _Number = tmp.Number; - _Text = tmp.Text; - _Type = tmp.Type; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _ContentInfoExtension.Refresh(this); - if (_MyFormat != null) - { - _MyFormat.Dispose();// Dispose related value - _MyFormat = null;// Reset related value - } - if (_MyEntry != null) - { - _MyEntry.Dispose();// Dispose related value - _MyEntry = null;// Reset related value - } - _ContentEntryCount = -1;// Reset Count - if (_MyZContent != null) - { - _MyZContent.Dispose();// Dispose related value - _MyZContent = null;// Reset related value - } - _ContentZContentCount = -1;// Reset Count - OnChange();// raise an event - } - public static ContentInfo Get(int contentID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Content"); - try - { - ContentInfo tmp = GetCachedByPrimaryKey(contentID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(contentID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ContentInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal ContentInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentInfo.Constructor", ex); - throw new DbCslaException("ContentInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _ContentID; - public int ContentID - { get { return _ContentID; } } - public PKCriteria(int contentID) - { - _ContentID = contentID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentInfo.ReadData", GetHashCode()); - try - { - _ContentID = dr.GetInt32("ContentID"); - _Number = dr.GetString("Number"); - _Text = dr.GetString("Text"); - _Type = (int?)dr.GetValue("Type"); - _FormatID = (int?)dr.GetValue("FormatID"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _ContentDetailCount = dr.GetInt32("DetailCount"); - _ContentEntryCount = dr.GetInt32("EntryCount"); - _ContentItemCount = dr.GetInt32("ItemCount"); - _ContentPartCount = dr.GetInt32("PartCount"); - _ContentRoUsageCount = dr.GetInt32("RoUsageCount"); - _ContentTransitionCount = dr.GetInt32("TransitionCount"); - _ContentZContentCount = dr.GetInt32("ZContentCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ContentInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getContent"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ContentInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - ContentInfoExtension _ContentInfoExtension = new ContentInfoExtension(); - [Serializable()] - partial class ContentInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(ContentInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class ContentInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ContentInfo) - { - // Return the ToString value - return ((ContentInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentInfoList.cs deleted file mode 100644 index d4dc4da8..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentInfoList.cs +++ /dev/null @@ -1,255 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// ContentInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ContentInfoListConverter))] - public partial class ContentInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (ContentInfo tmp in this) - { - tmp.Changed += new ContentInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (ContentInfo tmp in this) - { - tmp.Changed -= new ContentInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static ContentInfoList _ContentInfoList = null; - /// - /// Return a list of all projects. - /// - public static ContentInfoList Get() - { - try - { - if (_ContentInfoList != null) - return _ContentInfoList; - ContentInfoList tmp = DataPortal.Fetch(); - ContentInfo.AddList(tmp); - tmp.AddEvents(); - _ContentInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static ContentInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on ContentInfoList.Get", ex); - // } - //} - public static ContentInfoList GetByFormatID(int? formatID) - { - try - { - ContentInfoList tmp = DataPortal.Fetch(new FormatIDCriteria(formatID)); - ContentInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentInfoList.GetByFormatID", ex); - } - } - private ContentInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getContents"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new ContentInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ContentInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class FormatIDCriteria - { - public FormatIDCriteria(int? formatID) - { - _FormatID = formatID; - } - private int? _FormatID; - public int? FormatID - { - get { return _FormatID; } - set { _FormatID = value; } - } - } - private void DataPortal_Fetch(FormatIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentInfoList.DataPortal_FetchFormatID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getContentsByFormatID"; - cm.Parameters.AddWithValue("@FormatID", criteria.FormatID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new ContentInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentInfoList.DataPortal_FetchFormatID", ex); - throw new DbCslaException("ContentInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ContentInfoListPropertyDescriptor pd = new ContentInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ContentInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private ContentInfo Item { get { return (ContentInfo)_Item; } } - public ContentInfoListPropertyDescriptor(ContentInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ContentInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ContentInfoList) - { - // Return department and department role separated by comma. - return ((ContentInfoList)value).Items.Count.ToString() + " Contents"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentItem.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentItem.cs deleted file mode 100644 index 3b7aeb06..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentItem.cs +++ /dev/null @@ -1,409 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ContentItem Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ContentItemConverter))] - public partial class ContentItem : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _ItemID; - [System.ComponentModel.DataObjectField(true, true)] - public int ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem != null) _ItemID = _MyItem.ItemID; - return _ItemID; - } - } - private Item _MyItem; - [System.ComponentModel.DataObjectField(true, true)] - public Item MyItem - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem == null && _ItemID != 0) _MyItem = Item.Get(_ItemID); - return _MyItem; - } - } - private int? _PreviousID; - public int? PreviousID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyPrevious != null) _PreviousID = _MyPrevious.ItemID; - return _PreviousID; - } - } - private Item _MyPrevious; - public Item MyPrevious - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyPrevious == null && _PreviousID != null) _MyPrevious = Item.Get((int)_PreviousID); - return _MyPrevious; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if ((_MyPrevious == null ? _PreviousID : (int?)_MyPrevious.ItemID) != (value == null ? null : (int?)value.ItemID)) - { - _MyPrevious = value; - _PreviousID = (value == null ? null : (int?)value.ItemID); - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - // TODO: Check ContentItem.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ContentItem - protected override object GetIdValue() - { - return _ItemID; - } - // TODO: Replace base ContentItem.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ContentItem - //public override string ToString() - //{ - // return base.ToString(); - //} - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyItem != null && (hasBrokenRules = _MyItem.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ItemID, ""); - //AuthorizationRules.AllowRead(PreviousID, ""); - //AuthorizationRules.AllowWrite(PreviousID, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static ContentItem New() - { - return new ContentItem(); - } - internal static ContentItem Get(SafeDataReader dr) - { - return new ContentItem(dr); - } - public ContentItem() - { - MarkAsChild(); - _ItemID = Item.NextItemID; - _DTS = _ContentItemExtension.DefaultDTS; - _UserID = _ContentItemExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - internal ContentItem(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentItem.FetchDR", GetHashCode()); - try - { - _ItemID = dr.GetInt32("ItemID"); - _PreviousID = (int?)dr.GetValue("PreviousID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentItem.FetchDR", ex); - throw new DbCslaException("ContentItem.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Content myContent) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Item.Add(cn, ref _ItemID, Item.Get((int)_PreviousID), myContent, _DTS, _UserID); - MarkOld(); - } - internal void Update(Content myContent) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Item.Update(cn, ref _ItemID, Item.Get((int)_PreviousID), myContent, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Content myContent) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Item.Remove(cn, _ItemID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - ContentItemExtension _ContentItemExtension = new ContentItemExtension(); - [Serializable()] - partial class ContentItemExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ContentItemConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ContentItem) - { - // Return the ToString value - return ((ContentItem)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ContentItemExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ContentItem -// { -// partial class ContentItemExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentItems.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentItems.cs deleted file mode 100644 index d4069fc9..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentItems.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ContentItems Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ContentItemsConverter))] - public partial class ContentItems : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public ContentItem this[Item myItem] - { - get - { - foreach (ContentItem item in this) - if (item.ItemID == myItem.ItemID) - return item; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public ContentItem GetItem(Item myItem) - { - foreach (ContentItem item in this) - if (item.ItemID == myItem.ItemID) - return item; - return null; - } - public ContentItem Add() // One to Many - { - ContentItem item = ContentItem.New(); - this.Add(item); - return item; - } - public void Remove(Item myItem) - { - foreach (ContentItem item in this) - { - if (item.ItemID == myItem.ItemID) - { - Remove(item); - break; - } - } - } - public bool Contains(Item myItem) - { - foreach (ContentItem item in this) - if (item.ItemID == myItem.ItemID) - return true; - return false; - } - public bool ContainsDeleted(Item myItem) - { - foreach (ContentItem item in DeletedList) - if (item.ItemID == myItem.ItemID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (ContentItem contentItem in this) - if ((hasBrokenRules = contentItem.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static ContentItems New() - { - return new ContentItems(); - } - internal static ContentItems Get(SafeDataReader dr) - { - return new ContentItems(dr); - } - public static ContentItems GetByContentID(int contentID) - { - try - { - return DataPortal.Fetch(new ContentIDCriteria(contentID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentItems.GetByContentID", ex); - } - } - private ContentItems() - { - MarkAsChild(); - } - internal ContentItems(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(ContentItem.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ContentIDCriteria - { - public ContentIDCriteria(int contentID) - { - _ContentID = contentID; - } - private int _ContentID; - public int ContentID - { - get { return _ContentID; } - set { _ContentID = value; } - } - } - private void DataPortal_Fetch(ContentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentItems.DataPortal_FetchContentID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getItemsByContentID"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new ContentItem(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentItems.DataPortal_FetchContentID", ex); - throw new DbCslaException("ContentItems.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Content content) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (ContentItem obj in DeletedList) - obj.DeleteSelf(content);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (ContentItem obj in this) - { - if (obj.IsNew) - obj.Insert(content); - else - obj.Update(content); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ContentItemsPropertyDescriptor pd = new ContentItemsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ContentItemsPropertyDescriptor : vlnListPropertyDescriptor - { - private ContentItem Item { get { return (ContentItem)_Item; } } - public ContentItemsPropertyDescriptor(ContentItems collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ContentItemsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ContentItems) - { - // Return department and department role separated by comma. - return ((ContentItems)value).Items.Count.ToString() + " Items"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentPart.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentPart.cs deleted file mode 100644 index 71935b96..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentPart.cs +++ /dev/null @@ -1,464 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ContentPart Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ContentPartConverter))] - public partial class ContentPart : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _FromType; - [System.ComponentModel.DataObjectField(true, true)] - public int FromType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FromType; - } - } - private int _ItemID; - public int ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem != null) _ItemID = _MyItem.ItemID; - return _ItemID; - } - } - private Item _MyItem; - public Item MyItem - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem == null && _ItemID != 0) _MyItem = Item.Get(_ItemID); - return _MyItem; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyItem != value) - { - _MyItem = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int? _Item_PreviousID; - public int? Item_PreviousID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Item_PreviousID; - } - } - private int _Item_ContentID; - public int Item_ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Item_ContentID; - } - } - private DateTime _Item_DTS = new DateTime(); - public DateTime Item_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Item_DTS; - } - } - private string _Item_UserID = string.Empty; - public string Item_UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Item_UserID; - } - } - // TODO: Check ContentPart.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ContentPart - protected override object GetIdValue() - { - return _FromType; - } - // TODO: Replace base ContentPart.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ContentPart - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyItem == null ? false : _MyItem.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyItem == null ? true : _MyItem.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyItem != null && (hasBrokenRules = _MyItem.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyItemRequired, "MyItem"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - private static bool MyItemRequired(ContentPart target, Csla.Validation.RuleArgs e) - { - if (target._ItemID == 0 && target._MyItem == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(FromType, ""); - //AuthorizationRules.AllowRead(ItemID, ""); - //AuthorizationRules.AllowWrite(ItemID, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static ContentPart New(int fromType, Item myItem) - { - return new ContentPart(fromType, myItem); - } - internal static ContentPart Get(SafeDataReader dr) - { - return new ContentPart(dr); - } - public ContentPart() - { - MarkAsChild(); - - _DTS = _ContentPartExtension.DefaultDTS; - _UserID = _ContentPartExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private ContentPart(int fromType, Item myItem) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _DTS = _ContentPartExtension.DefaultDTS; - _UserID = _ContentPartExtension.DefaultUserID; - _FromType = fromType; - _MyItem = myItem; - ValidationRules.CheckRules(); - } - internal ContentPart(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentPart.FetchDR", GetHashCode()); - try - { - _FromType = dr.GetInt32("FromType"); - _ItemID = dr.GetInt32("ItemID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _Item_PreviousID = (int?)dr.GetValue("Item_PreviousID"); - _Item_ContentID = dr.GetInt32("Item_ContentID"); - _Item_DTS = dr.GetDateTime("Item_DTS"); - _Item_UserID = dr.GetString("Item_UserID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentPart.FetchDR", ex); - throw new DbCslaException("ContentPart.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Content myContent) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Part.Add(cn, myContent, _FromType, _MyItem, _DTS, _UserID); - MarkOld(); - } - internal void Update(Content myContent) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Part.Update(cn, myContent, _FromType, _MyItem, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Content myContent) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Part.Remove(cn, myContent.ContentID, _FromType); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - ContentPartExtension _ContentPartExtension = new ContentPartExtension(); - [Serializable()] - partial class ContentPartExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ContentPartConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ContentPart) - { - // Return the ToString value - return ((ContentPart)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ContentPartExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ContentPart -// { -// partial class ContentPartExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentParts.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentParts.cs deleted file mode 100644 index 66bccb98..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentParts.cs +++ /dev/null @@ -1,295 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ContentParts Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ContentPartsConverter))] - public partial class ContentParts : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public new ContentPart this[int fromType] - { - get - { - foreach (ContentPart part in this) - if (part.FromType == fromType) - return part; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public ContentPart GetItem(int fromType) - { - foreach (ContentPart part in this) - if (part.FromType == fromType) - return part; - return null; - } - public ContentPart Add(int fromType, Item myItem) // One to Many with unique fields - { - if (!Contains(fromType)) - { - ContentPart part = ContentPart.New(fromType, myItem); - this.Add(part); - return part; - } - else - throw new InvalidOperationException("part already exists"); - } - public void Remove(int fromType) - { - foreach (ContentPart part in this) - { - if (part.FromType == fromType) - { - Remove(part); - break; - } - } - } - public bool Contains(int fromType) - { - foreach (ContentPart part in this) - if (part.FromType == fromType) - return true; - return false; - } - public bool ContainsDeleted(int fromType) - { - foreach (ContentPart part in DeletedList) - if (part.FromType == fromType) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (ContentPart contentPart in this) - if ((hasBrokenRules = contentPart.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static ContentParts New() - { - return new ContentParts(); - } - internal static ContentParts Get(SafeDataReader dr) - { - return new ContentParts(dr); - } - public static ContentParts GetByContentID(int contentID) - { - try - { - return DataPortal.Fetch(new ContentIDCriteria(contentID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentParts.GetByContentID", ex); - } - } - private ContentParts() - { - MarkAsChild(); - } - internal ContentParts(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(ContentPart.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ContentIDCriteria - { - public ContentIDCriteria(int contentID) - { - _ContentID = contentID; - } - private int _ContentID; - public int ContentID - { - get { return _ContentID; } - set { _ContentID = value; } - } - } - private void DataPortal_Fetch(ContentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentParts.DataPortal_FetchContentID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPartsByContentID"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new ContentPart(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentParts.DataPortal_FetchContentID", ex); - throw new DbCslaException("ContentParts.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Content content) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (ContentPart obj in DeletedList) - obj.DeleteSelf(content);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (ContentPart obj in this) - { - if (obj.IsNew) - obj.Insert(content); - else - obj.Update(content); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ContentPartsPropertyDescriptor pd = new ContentPartsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ContentPartsPropertyDescriptor : vlnListPropertyDescriptor - { - private ContentPart Item { get { return (ContentPart)_Item; } } - public ContentPartsPropertyDescriptor(ContentParts collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ContentPartsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ContentParts) - { - // Return department and department role separated by comma. - return ((ContentParts)value).Items.Count.ToString() + " Parts"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentRoUsage.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentRoUsage.cs deleted file mode 100644 index 24726558..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentRoUsage.cs +++ /dev/null @@ -1,555 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ContentRoUsage Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ContentRoUsageConverter))] - public partial class ContentRoUsage : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _ROUsageID; - [System.ComponentModel.DataObjectField(true, true)] - public int ROUsageID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRoUsage != null) _ROUsageID = _MyRoUsage.ROUsageID; - return _ROUsageID; - } - } - private RoUsage _MyRoUsage; - [System.ComponentModel.DataObjectField(true, true)] - public RoUsage MyRoUsage - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRoUsage == null && _ROUsageID != 0) _MyRoUsage = RoUsage.Get(_ROUsageID); - return _MyRoUsage; - } - } - private string _ROID = string.Empty; - public string ROID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_ROID != value) - { - _ROID = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _RODbID; - public int RODbID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRODb != null) _RODbID = _MyRODb.RODbID; - return _RODbID; - } - } - private RODb _MyRODb; - public RODb MyRODb - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRODb == null && _RODbID != 0) _MyRODb = RODb.Get(_RODbID); - return _MyRODb; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyRODb != value) - { - _MyRODb = value; - PropertyHasChanged(); - } - } - } - private string _RODb_ROName = string.Empty; - /// - /// Hook for future - to allow the user to select multiple RO Databases assocaiated with on DocVersion - /// - public string RODb_ROName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RODb_ROName; - } - } - private string _RODb_FolderPath = string.Empty; - /// - /// Path to the RO database - /// - public string RODb_FolderPath - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RODb_FolderPath; - } - } - private string _RODb_DBConnectionString = string.Empty; - /// - /// Connection String - Default could just be the full path and name of the database - /// - public string RODb_DBConnectionString - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RODb_DBConnectionString; - } - } - private DateTime _RODb_DTS = new DateTime(); - public DateTime RODb_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RODb_DTS; - } - } - private string _RODb_UserID = string.Empty; - public string RODb_UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RODb_UserID; - } - } - // TODO: Check ContentRoUsage.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ContentRoUsage - protected override object GetIdValue() - { - return _ROUsageID; - } - // TODO: Replace base ContentRoUsage.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ContentRoUsage - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyRODb == null ? false : _MyRODb.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyRODb == null ? true : _MyRODb.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyRODb != null && (hasBrokenRules = _MyRODb.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "ROID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("ROID", 16)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - ValidationRules.AddRule(MyRODbRequired, "MyRODb"); - // TODO: Add other validation rules - } - private static bool MyRODbRequired(ContentRoUsage target, Csla.Validation.RuleArgs e) - { - if (target._RODbID == 0 && target._MyRODb == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ROUsageID, ""); - //AuthorizationRules.AllowRead(ROID, ""); - //AuthorizationRules.AllowWrite(ROID, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - //AuthorizationRules.AllowRead(RODbID, ""); - //AuthorizationRules.AllowWrite(RODbID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static ContentRoUsage New(string roid, RODb myRODb) - { - return new ContentRoUsage(roid, myRODb); - } - internal static ContentRoUsage Get(SafeDataReader dr) - { - return new ContentRoUsage(dr); - } - public ContentRoUsage() - { - MarkAsChild(); - _ROUsageID = RoUsage.NextROUsageID; - _DTS = _ContentRoUsageExtension.DefaultDTS; - _UserID = _ContentRoUsageExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private ContentRoUsage(string roid, RODb myRODb) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _DTS = _ContentRoUsageExtension.DefaultDTS; - _UserID = _ContentRoUsageExtension.DefaultUserID; - _ROID = roid; - _MyRODb = myRODb; - ValidationRules.CheckRules(); - } - internal ContentRoUsage(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentRoUsage.FetchDR", GetHashCode()); - try - { - _ROUsageID = dr.GetInt32("ROUsageID"); - _ROID = dr.GetString("ROID"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _RODbID = dr.GetInt32("RODbID"); - _RODb_ROName = dr.GetString("RODb_ROName"); - _RODb_FolderPath = dr.GetString("RODb_FolderPath"); - _RODb_DBConnectionString = dr.GetString("RODb_DBConnectionString"); - _RODb_DTS = dr.GetDateTime("RODb_DTS"); - _RODb_UserID = dr.GetString("RODb_UserID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentRoUsage.FetchDR", ex); - throw new DbCslaException("ContentRoUsage.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Content myContent) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = RoUsage.Add(cn, ref _ROUsageID, myContent, _ROID, _Config, _DTS, _UserID, _MyRODb); - MarkOld(); - } - internal void Update(Content myContent) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = RoUsage.Update(cn, ref _ROUsageID, myContent, _ROID, _Config, _DTS, _UserID, ref _LastChanged, _MyRODb); - MarkOld(); - } - internal void DeleteSelf(Content myContent) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - RoUsage.Remove(cn, _ROUsageID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - ContentRoUsageExtension _ContentRoUsageExtension = new ContentRoUsageExtension(); - [Serializable()] - partial class ContentRoUsageExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultContentID - { - get { return 0; } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ContentRoUsageConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ContentRoUsage) - { - // Return the ToString value - return ((ContentRoUsage)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ContentRoUsageExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ContentRoUsage -// { -// partial class ContentRoUsageExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultContentID -// { -// get { return 0; } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentRoUsages.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentRoUsages.cs deleted file mode 100644 index ecac510e..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentRoUsages.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ContentRoUsages Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ContentRoUsagesConverter))] - public partial class ContentRoUsages : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public ContentRoUsage this[RoUsage myRoUsage] - { - get - { - foreach (ContentRoUsage roUsage in this) - if (roUsage.ROUsageID == myRoUsage.ROUsageID) - return roUsage; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public ContentRoUsage GetItem(RoUsage myRoUsage) - { - foreach (ContentRoUsage roUsage in this) - if (roUsage.ROUsageID == myRoUsage.ROUsageID) - return roUsage; - return null; - } - public ContentRoUsage Add(string roid, RODb myRODb) // One to Many - { - ContentRoUsage roUsage = ContentRoUsage.New(roid, myRODb); - this.Add(roUsage); - return roUsage; - } - public void Remove(RoUsage myRoUsage) - { - foreach (ContentRoUsage roUsage in this) - { - if (roUsage.ROUsageID == myRoUsage.ROUsageID) - { - Remove(roUsage); - break; - } - } - } - public bool Contains(RoUsage myRoUsage) - { - foreach (ContentRoUsage roUsage in this) - if (roUsage.ROUsageID == myRoUsage.ROUsageID) - return true; - return false; - } - public bool ContainsDeleted(RoUsage myRoUsage) - { - foreach (ContentRoUsage roUsage in DeletedList) - if (roUsage.ROUsageID == myRoUsage.ROUsageID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (ContentRoUsage contentRoUsage in this) - if ((hasBrokenRules = contentRoUsage.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static ContentRoUsages New() - { - return new ContentRoUsages(); - } - internal static ContentRoUsages Get(SafeDataReader dr) - { - return new ContentRoUsages(dr); - } - public static ContentRoUsages GetByContentID(int contentID) - { - try - { - return DataPortal.Fetch(new ContentIDCriteria(contentID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentRoUsages.GetByContentID", ex); - } - } - private ContentRoUsages() - { - MarkAsChild(); - } - internal ContentRoUsages(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(ContentRoUsage.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ContentIDCriteria - { - public ContentIDCriteria(int contentID) - { - _ContentID = contentID; - } - private int _ContentID; - public int ContentID - { - get { return _ContentID; } - set { _ContentID = value; } - } - } - private void DataPortal_Fetch(ContentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentRoUsages.DataPortal_FetchContentID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRoUsagesByContentID"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new ContentRoUsage(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentRoUsages.DataPortal_FetchContentID", ex); - throw new DbCslaException("ContentRoUsages.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Content content) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (ContentRoUsage obj in DeletedList) - obj.DeleteSelf(content);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (ContentRoUsage obj in this) - { - if (obj.IsNew) - obj.Insert(content); - else - obj.Update(content); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ContentRoUsagesPropertyDescriptor pd = new ContentRoUsagesPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ContentRoUsagesPropertyDescriptor : vlnListPropertyDescriptor - { - private ContentRoUsage Item { get { return (ContentRoUsage)_Item; } } - public ContentRoUsagesPropertyDescriptor(ContentRoUsages collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ContentRoUsagesConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ContentRoUsages) - { - // Return department and department role separated by comma. - return ((ContentRoUsages)value).Items.Count.ToString() + " RoUsages"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentTransition.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentTransition.cs deleted file mode 100644 index 68616915..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentTransition.cs +++ /dev/null @@ -1,618 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ContentTransition Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ContentTransitionConverter))] - public partial class ContentTransition : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _TransitionID; - [System.ComponentModel.DataObjectField(true, true)] - public int TransitionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyTransition != null) _TransitionID = _MyTransition.TransitionID; - return _TransitionID; - } - } - private Transition _MyTransition; - [System.ComponentModel.DataObjectField(true, true)] - public Transition MyTransition - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyTransition == null && _TransitionID != 0) _MyTransition = Transition.Get(_TransitionID); - return _MyTransition; - } - } - private int _ToID; - /// - /// StructureID - /// - public int ToID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItemToID != null) _ToID = _MyItemToID.ItemID; - return _ToID; - } - } - private Item _MyItemToID; - public Item MyItemToID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItemToID == null && _ToID != 0) _MyItemToID = Item.Get(_ToID); - return _MyItemToID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyItemToID != value) - { - _MyItemToID = value; - PropertyHasChanged(); - } - } - } - private int _RangeID; - public int RangeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItemRangeID != null) _RangeID = _MyItemRangeID.ItemID; - return _RangeID; - } - } - private Item _MyItemRangeID; - public Item MyItemRangeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItemRangeID == null && _RangeID != 0) _MyItemRangeID = Item.Get(_RangeID); - return _MyItemRangeID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyItemRangeID != value) - { - _MyItemRangeID = value; - PropertyHasChanged(); - } - } - } - private int _TranType; - public int TranType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _TranType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_TranType != value) - { - _TranType = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int? _Item_RangeID_PreviousID; - public int? Item_RangeID_PreviousID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Item_RangeID_PreviousID; - } - } - private int _Item_RangeID_ContentID; - public int Item_RangeID_ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Item_RangeID_ContentID; - } - } - private DateTime _Item_RangeID_DTS = new DateTime(); - public DateTime Item_RangeID_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Item_RangeID_DTS; - } - } - private string _Item_RangeID_UserID = string.Empty; - public string Item_RangeID_UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Item_RangeID_UserID; - } - } - private int? _Item_ToID_PreviousID; - public int? Item_ToID_PreviousID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Item_ToID_PreviousID; - } - } - private int _Item_ToID_ContentID; - public int Item_ToID_ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Item_ToID_ContentID; - } - } - private DateTime _Item_ToID_DTS = new DateTime(); - public DateTime Item_ToID_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Item_ToID_DTS; - } - } - private string _Item_ToID_UserID = string.Empty; - public string Item_ToID_UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Item_ToID_UserID; - } - } - // TODO: Check ContentTransition.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ContentTransition - protected override object GetIdValue() - { - return _TransitionID; - } - // TODO: Replace base ContentTransition.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ContentTransition - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyItemToID == null ? false : _MyItemToID.IsDirty) || (_MyItemRangeID == null ? false : _MyItemRangeID.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyItemToID == null ? true : _MyItemToID.IsValid) && (_MyItemRangeID == null ? true : _MyItemRangeID.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyItemToID != null && (hasBrokenRules = _MyItemToID.HasBrokenRules) != null) return hasBrokenRules; - if (_MyItemRangeID != null && (hasBrokenRules = _MyItemRangeID.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyItemToIDRequired, "MyItemToID"); - ValidationRules.AddRule(MyItemRangeIDRequired, "MyItemRangeID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - private static bool MyItemToIDRequired(ContentTransition target, Csla.Validation.RuleArgs e) - { - if (target._ToID == 0 && target._MyItemToID == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - private static bool MyItemRangeIDRequired(ContentTransition target, Csla.Validation.RuleArgs e) - { - if (target._RangeID == 0 && target._MyItemRangeID == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(TransitionID, ""); - //AuthorizationRules.AllowRead(ToID, ""); - //AuthorizationRules.AllowWrite(ToID, ""); - //AuthorizationRules.AllowRead(RangeID, ""); - //AuthorizationRules.AllowWrite(RangeID, ""); - //AuthorizationRules.AllowRead(TranType, ""); - //AuthorizationRules.AllowWrite(TranType, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static ContentTransition New(Item myItemToID, Item myItemRangeID) - { - return new ContentTransition(myItemToID, myItemRangeID); - } - internal static ContentTransition Get(SafeDataReader dr) - { - return new ContentTransition(dr); - } - public ContentTransition() - { - MarkAsChild(); - _TransitionID = Transition.NextTransitionID; - _TranType = _ContentTransitionExtension.DefaultTranType; - _DTS = _ContentTransitionExtension.DefaultDTS; - _UserID = _ContentTransitionExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private ContentTransition(Item myItemToID, Item myItemRangeID) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _TranType = _ContentTransitionExtension.DefaultTranType; - _DTS = _ContentTransitionExtension.DefaultDTS; - _UserID = _ContentTransitionExtension.DefaultUserID; - _MyItemToID = myItemToID; - _MyItemRangeID = myItemRangeID; - ValidationRules.CheckRules(); - } - internal ContentTransition(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentTransition.FetchDR", GetHashCode()); - try - { - _TransitionID = dr.GetInt32("TransitionID"); - _ToID = dr.GetInt32("ToID"); - _RangeID = dr.GetInt32("RangeID"); - _TranType = dr.GetInt32("TranType"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _Item_RangeID_PreviousID = (int?)dr.GetValue("Item_RangeID_PreviousID"); - _Item_RangeID_ContentID = dr.GetInt32("Item_RangeID_ContentID"); - _Item_RangeID_DTS = dr.GetDateTime("Item_RangeID_DTS"); - _Item_RangeID_UserID = dr.GetString("Item_RangeID_UserID"); - _Item_ToID_PreviousID = (int?)dr.GetValue("Item_ToID_PreviousID"); - _Item_ToID_ContentID = dr.GetInt32("Item_ToID_ContentID"); - _Item_ToID_DTS = dr.GetDateTime("Item_ToID_DTS"); - _Item_ToID_UserID = dr.GetString("Item_ToID_UserID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentTransition.FetchDR", ex); - throw new DbCslaException("ContentTransition.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Content myContent) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Transition.Add(cn, ref _TransitionID, myContent, _MyItemToID, _MyItemRangeID, _TranType, _Config, _DTS, _UserID); - MarkOld(); - } - internal void Update(Content myContent) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Transition.Update(cn, ref _TransitionID, myContent, _MyItemToID, _MyItemRangeID, _TranType, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Content myContent) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Transition.Remove(cn, _TransitionID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - ContentTransitionExtension _ContentTransitionExtension = new ContentTransitionExtension(); - [Serializable()] - partial class ContentTransitionExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultTranType - { - get { return 0; } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ContentTransitionConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ContentTransition) - { - // Return the ToString value - return ((ContentTransition)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ContentTransitionExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ContentTransition -// { -// partial class ContentTransitionExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultTranType -// { -// get { return 0; } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentTransitions.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentTransitions.cs deleted file mode 100644 index 0d8270e4..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ContentTransitions.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ContentTransitions Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ContentTransitionsConverter))] - public partial class ContentTransitions : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public ContentTransition this[Transition myTransition] - { - get - { - foreach (ContentTransition transition in this) - if (transition.TransitionID == myTransition.TransitionID) - return transition; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public ContentTransition GetItem(Transition myTransition) - { - foreach (ContentTransition transition in this) - if (transition.TransitionID == myTransition.TransitionID) - return transition; - return null; - } - public ContentTransition Add(Item myItemToID, Item myItemRangeID) // One to Many - { - ContentTransition transition = ContentTransition.New(myItemToID, myItemRangeID); - this.Add(transition); - return transition; - } - public void Remove(Transition myTransition) - { - foreach (ContentTransition transition in this) - { - if (transition.TransitionID == myTransition.TransitionID) - { - Remove(transition); - break; - } - } - } - public bool Contains(Transition myTransition) - { - foreach (ContentTransition transition in this) - if (transition.TransitionID == myTransition.TransitionID) - return true; - return false; - } - public bool ContainsDeleted(Transition myTransition) - { - foreach (ContentTransition transition in DeletedList) - if (transition.TransitionID == myTransition.TransitionID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (ContentTransition contentTransition in this) - if ((hasBrokenRules = contentTransition.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static ContentTransitions New() - { - return new ContentTransitions(); - } - internal static ContentTransitions Get(SafeDataReader dr) - { - return new ContentTransitions(dr); - } - public static ContentTransitions GetByFromID(int fromID) - { - try - { - return DataPortal.Fetch(new FromIDCriteria(fromID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ContentTransitions.GetByFromID", ex); - } - } - private ContentTransitions() - { - MarkAsChild(); - } - internal ContentTransitions(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(ContentTransition.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class FromIDCriteria - { - public FromIDCriteria(int fromID) - { - _FromID = fromID; - } - private int _FromID; - public int FromID - { - get { return _FromID; } - set { _FromID = value; } - } - } - private void DataPortal_Fetch(FromIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ContentTransitions.DataPortal_FetchFromID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getTransitionsByFromID"; - cm.Parameters.AddWithValue("@FromID", criteria.FromID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new ContentTransition(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ContentTransitions.DataPortal_FetchFromID", ex); - throw new DbCslaException("ContentTransitions.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Content content) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (ContentTransition obj in DeletedList) - obj.DeleteSelf(content);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (ContentTransition obj in this) - { - if (obj.IsNew) - obj.Insert(content); - else - obj.Update(content); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ContentTransitionsPropertyDescriptor pd = new ContentTransitionsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ContentTransitionsPropertyDescriptor : vlnListPropertyDescriptor - { - private ContentTransition Item { get { return (ContentTransition)_Item; } } - public ContentTransitionsPropertyDescriptor(ContentTransitions collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ContentTransitionsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ContentTransitions) - { - // Return department and department role separated by comma. - return ((ContentTransitions)value).Items.Count.ToString() + " Transitions"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Database.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Database.cs deleted file mode 100644 index 92120328..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Database.cs +++ /dev/null @@ -1,138 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Diagnostics; -namespace VEPROMS.CSLA.Library -{ - /// - /// Database Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public static partial class Database - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - public static void LogException(string s, Exception ex) - { - int i = 0; - Console.WriteLine("Error - {0}", s); - for (; ex != null; ex = ex.InnerException) - { - Console.WriteLine("{0}{1} - {2}", "".PadLeft(++i * 2), ex.GetType().ToString(), ex.Message); - } - } - private static bool _LoggingInfo = false; // By default don't log info - public static bool LoggingInfo - { - get { return _LoggingInfo; } - set { _LoggingInfo = value; } - } - static System.Diagnostics.Process _CurrentProcess = System.Diagnostics.Process.GetCurrentProcess(); - public static void LogInfo(string s, int hashCode) - { - if (_LoggingInfo) - Console.WriteLine("{0} MB {1}", _CurrentProcess.WorkingSet64 / 1000000, string.Format(s, hashCode)); - } - public static void LogDebug(string s, int hashCode) - { - if (_LoggingInfo) - Console.WriteLine("{0} MB {1}", _CurrentProcess.WorkingSet64 / 1000000, string.Format(s, hashCode)); - } - public static string VEPROMS_Connection - { - get - { - DateTime.Today.ToLongDateString(); - ConnectionStringSettings cs = ConfigurationManager.ConnectionStrings["VEPROMS"]; - if (cs == null) - { - throw new ApplicationException("Database.cs Could not find connection VEPROMS"); - } - return cs.ConnectionString; - } - } - public static SqlConnection VEPROMS_SqlConnection - { - get - { - string strConn = VEPROMS_Connection; // If failure - Fail (Don't try to catch) - // Attempt to make a connection - try - { - SqlConnection cn = new SqlConnection(strConn); - cn.Open(); - return cn; - } - catch (SqlException exsql) - { - const string strAttachError = "An attempt to attach an auto-named database for file "; - if (exsql.Message.StartsWith(strAttachError)) - {// Check to see if the file is missing - string sFile = exsql.Message.Substring(strAttachError.Length); - sFile = sFile.Substring(0, sFile.IndexOf(" failed")); - // "An attempt to attach an auto-named database for file failed" - if (strConn.ToLower().IndexOf("user instance=true") < 0) - { - throw new ApplicationException("Connection String missing attribute: User Instance=True"); - } - if (System.IO.File.Exists(sFile)) - { - throw new ApplicationException("Database file " + sFile + " Cannot be opened\r\n", exsql); - } - else - { - throw new FileNotFoundException("Database file " + sFile + " Not Found", exsql); - } - } - else - { - throw new ApplicationException("Failure on Connect", exsql); - } - } - catch (Exception ex)// Throw Application Exception on Failure - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Connection Error", ex); - throw new ApplicationException("Failure on Connect", ex); - } - } - } - public static void PurgeData() - { - try - { - SqlConnection cn = VEPROMS_SqlConnection; - SqlCommand cmd = new SqlCommand("purgedata", cn); - cmd.CommandType = CommandType.StoredProcedure; - cmd.CommandTimeout = 0; - cmd.ExecuteNonQuery(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Purge Error", ex); - throw new ApplicationException("Failure on Purge", ex); - } - } - } - public class DbCslaException : Exception - { - internal DbCslaException(string message, Exception innerException) : base(message, innerException) { ;} - internal DbCslaException(string message) : base(message) { ;} - internal DbCslaException() : base() { ;} - } // Class -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Detail.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Detail.cs deleted file mode 100644 index ddffe616..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Detail.cs +++ /dev/null @@ -1,1070 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Detail Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DetailConverter))] - public partial class Detail : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshDetails = new List(); - private void AddToRefreshList(List refreshDetails) - { - if (IsDirty) - refreshDetails.Add(this); - } - private void BuildRefreshList() - { - _RefreshDetails = new List(); - AddToRefreshList(_RefreshDetails); - } - private void ProcessRefreshList() - { - foreach (Detail tmp in _RefreshDetails) - { - DetailInfo.Refresh(tmp); - if (tmp._MyContent != null) ContentInfo.Refresh(tmp._MyContent); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Detail detail) - { - if (!_CacheList.Contains(detail)) _CacheList.Add(detail); // In AddToCache - } - protected static void RemoveFromCache(Detail detail) - { - while (_CacheList.Contains(detail)) _CacheList.Remove(detail); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (Detail tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.DetailID.ToString())) - { - _CacheByPrimaryKey[tmp.DetailID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.DetailID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (Detail tmp in remove) - RemoveFromCache(tmp); - } - protected static Detail GetCachedByPrimaryKey(int detailID) - { - ConvertListToDictionary(); - string key = detailID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextDetailID = -1; - public static int NextDetailID - { - get { return _nextDetailID--; } - } - private int _DetailID; - [System.ComponentModel.DataObjectField(true, true)] - public int DetailID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DetailID; - } - } - private int _ContentID; - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _ContentID = _MyContent.ContentID; - return _ContentID; - } - } - private Content _MyContent; - public Content MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _ContentID != 0) _MyContent = Content.Get(_ContentID); - return _MyContent; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyContent != value) - { - _MyContent = value; - PropertyHasChanged(); - } - } - } - private int _ItemType; - public int ItemType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_ItemType != value) - { - _ItemType = value; - PropertyHasChanged(); - } - } - } - private string _Text = string.Empty; - public string Text - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Text; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Text != value) - { - _Text = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - public override bool IsDirty - { - get { return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid); } - } - // TODO: Replace base Detail.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Detail - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check Detail.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Detail - protected override object GetIdValue() - { - return _DetailID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyContent != null && (hasBrokenRules = _MyContent.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyContentRequired, "MyContent"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "Text"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Text", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _DetailExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _DetailExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - private static bool MyContentRequired(Detail target, Csla.Validation.RuleArgs e) - { - if (target._ContentID == 0 && target._MyContent == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(DetailID, ""); - //AuthorizationRules.AllowRead(ContentID, ""); - //AuthorizationRules.AllowRead(ItemType, ""); - //AuthorizationRules.AllowRead(Text, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(ContentID, ""); - //AuthorizationRules.AllowWrite(ItemType, ""); - //AuthorizationRules.AllowWrite(Text, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - _DetailExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _DetailExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _DetailUnique = 0; - protected static int DetailUnique - { get { return ++_DetailUnique; } } - private int _MyDetailUnique = DetailUnique; - public int MyDetailUnique - { get { return _MyDetailUnique; } } - protected Detail() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(DetailID.ToString())) - { - List listDetail = _CacheByPrimaryKey[DetailID.ToString()]; // Get the list of items - while (listDetail.Contains(this)) listDetail.Remove(this); // Remove the item from the list - if (listDetail.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(DetailID.ToString()); // remove the list - } - } - public static Detail New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Detail"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Detail.New", ex); - } - } - public static Detail New(Content myContent, int itemType, string text) - { - Detail tmp = Detail.New(); - tmp.MyContent = myContent; - tmp.ItemType = itemType; - tmp.Text = text; - return tmp; - } - public static Detail New(Content myContent, int itemType, string text, string config, DateTime dts, string userID) - { - Detail tmp = Detail.New(); - tmp.MyContent = myContent; - tmp.ItemType = itemType; - tmp.Text = text; - tmp.Config = config; - tmp.DTS = dts; - tmp.UserID = userID; - return tmp; - } - public static Detail MakeDetail(Content myContent, int itemType, string text, string config, DateTime dts, string userID) - { - Detail tmp = Detail.New(myContent, itemType, text, config, dts, userID); - if (tmp.IsSavable) - { - Detail tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Detail New(Content myContent, int itemType, string text, string config) - { - Detail tmp = Detail.New(); - tmp.MyContent = myContent; - tmp.ItemType = itemType; - tmp.Text = text; - tmp.Config = config; - return tmp; - } - public static Detail MakeDetail(Content myContent, int itemType, string text, string config) - { - Detail tmp = Detail.New(myContent, itemType, text, config); - if (tmp.IsSavable) - { - Detail tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Detail Get(int detailID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Detail"); - try - { - Detail tmp = GetCachedByPrimaryKey(detailID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(detailID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Detail - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Detail.Get", ex); - } - } - public static Detail Get(SafeDataReader dr) - { - if (dr.Read()) return new Detail(dr); - return null; - } - internal Detail(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int detailID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Detail"); - try - { - DataPortal.Delete(new PKCriteria(detailID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Detail.Delete", ex); - } - } - public override Detail Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Detail"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Detail"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Detail"); - try - { - BuildRefreshList(); - Detail detail = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(detail);//Refresh the item in AllList - ProcessRefreshList(); - return detail; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _DetailID; - public int DetailID - { get { return _DetailID; } } - public PKCriteria(int detailID) - { - _DetailID = detailID; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _DetailID = NextDetailID; - // Database Defaults - _DTS = _DetailExtension.DefaultDTS; - _UserID = _DetailExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Detail.ReadData", GetHashCode()); - try - { - _DetailID = dr.GetInt32("DetailID"); - _ContentID = dr.GetInt32("ContentID"); - _ItemType = dr.GetInt32("ItemType"); - _Text = dr.GetString("Text"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Detail.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Detail.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Detail.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDetail"; - cm.Parameters.AddWithValue("@DetailID", criteria.DetailID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Detail.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Detail.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Detail.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Detail.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Detail.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyContent != null) _MyContent.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addDetail"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", ContentID); - cm.Parameters.AddWithValue("@ItemType", _ItemType); - cm.Parameters.AddWithValue("@Text", _Text); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - // Output Calculated Columns - SqlParameter param_DetailID = new SqlParameter("@newDetailID", SqlDbType.Int); - param_DetailID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_DetailID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _DetailID = (int)cm.Parameters["@newDetailID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Detail.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Detail.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Detail.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int detailID, Content myContent, int itemType, string text, string config, DateTime dts, string userID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Detail.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addDetail"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", myContent.ContentID); - cm.Parameters.AddWithValue("@ItemType", itemType); - cm.Parameters.AddWithValue("@Text", text); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - // Output Calculated Columns - SqlParameter param_DetailID = new SqlParameter("@newDetailID", SqlDbType.Int); - param_DetailID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_DetailID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - detailID = (int)cm.Parameters["@newDetailID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Detail.Add", ex); - throw new DbCslaException("Detail.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Detail.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Detail.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Detail.SQLUpdate", GetHashCode()); - try - { - if (_MyContent != null) _MyContent.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateDetail"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@DetailID", _DetailID); - cm.Parameters.AddWithValue("@ContentID", ContentID); - cm.Parameters.AddWithValue("@ItemType", _ItemType); - cm.Parameters.AddWithValue("@Text", _Text); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Detail.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Detail.Add(cn, ref _DetailID, _MyContent, _ItemType, _Text, _Config, _DTS, _UserID); - else - _LastChanged = Detail.Update(cn, ref _DetailID, _MyContent, _ItemType, _Text, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int detailID, Content myContent, int itemType, string text, string config, DateTime dts, string userID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Detail.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateDetail"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@DetailID", detailID); - cm.Parameters.AddWithValue("@ContentID", myContent.ContentID); - cm.Parameters.AddWithValue("@ItemType", itemType); - cm.Parameters.AddWithValue("@Text", text); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Detail.Update", ex); - throw new DbCslaException("Detail.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_DetailID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Detail.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteDetail"; - cm.Parameters.AddWithValue("@DetailID", criteria.DetailID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Detail.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Detail.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int detailID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Detail.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteDetail"; - // Input PK Fields - cm.Parameters.AddWithValue("@DetailID", detailID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Detail.Remove", ex); - throw new DbCslaException("Detail.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int detailID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(detailID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Detail.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _DetailID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int detailID) - { - _DetailID = detailID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Detail.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsDetail"; - cm.Parameters.AddWithValue("@DetailID", _DetailID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Detail.DataPortal_Execute", ex); - throw new DbCslaException("Detail.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - DetailExtension _DetailExtension = new DetailExtension(); - [Serializable()] - partial class DetailExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class DetailConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Detail) - { - // Return the ToString value - return ((Detail)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create DetailExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Detail -// { -// partial class DetailExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DetailInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/DetailInfo.cs deleted file mode 100644 index ef781538..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DetailInfo.cs +++ /dev/null @@ -1,397 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void DetailInfoEvent(object sender); - /// - /// DetailInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DetailInfoConverter))] - public partial class DetailInfo : ReadOnlyBase, IDisposable - { - public event DetailInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(DetailInfo detailInfo) - { - if (!_CacheList.Contains(detailInfo)) _CacheList.Add(detailInfo); // In AddToCache - } - protected static void RemoveFromCache(DetailInfo detailInfo) - { - while (_CacheList.Contains(detailInfo)) _CacheList.Remove(detailInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (DetailInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.DetailID.ToString())) - { - _CacheByPrimaryKey[tmp.DetailID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.DetailID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (DetailInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(DetailInfoList lst) - { - foreach (DetailInfo item in lst) AddToCache(item); - } - protected static DetailInfo GetCachedByPrimaryKey(int detailID) - { - ConvertListToDictionary(); - string key = detailID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Detail _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _DetailID; - [System.ComponentModel.DataObjectField(true, true)] - public int DetailID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DetailID; - } - } - private int _ContentID; - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _ContentID = _MyContent.ContentID; - return _ContentID; - } - } - private ContentInfo _MyContent; - public ContentInfo MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _ContentID != 0) _MyContent = ContentInfo.Get(_ContentID); - return _MyContent; - } - } - private int _ItemType; - public int ItemType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemType; - } - } - private string _Text = string.Empty; - public string Text - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Text; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - // TODO: Replace base DetailInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current DetailInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check DetailInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current DetailInfo - protected override object GetIdValue() - { - return _DetailID; - } - #endregion - #region Factory Methods - private static int _DetailInfoUnique = 0; - private static int DetailInfoUnique - { get { return ++_DetailInfoUnique; } } - private int _MyDetailInfoUnique = DetailInfoUnique; - public int MyDetailInfoUnique - { get { return _MyDetailInfoUnique; } } - protected DetailInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(DetailID.ToString())) return; - List listDetailInfo = _CacheByPrimaryKey[DetailID.ToString()]; // Get the list of items - while (listDetailInfo.Contains(this)) listDetailInfo.Remove(this); // Remove the item from the list - if (listDetailInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(DetailID.ToString()); // remove the list - } - public virtual Detail Get() - { - return _Editable = Detail.Get(_DetailID); - } - public static void Refresh(Detail tmp) - { - string key = tmp.DetailID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (DetailInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Detail tmp) - { - if (_ContentID != tmp.ContentID) - { - if (MyContent != null) MyContent.RefreshContentDetails(); // Update List for old value - _ContentID = tmp.ContentID; // Update the value - } - _MyContent = null; // Reset list so that the next line gets a new list - if (MyContent != null) MyContent.RefreshContentDetails(); // Update List for new value - _ItemType = tmp.ItemType; - _Text = tmp.Text; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _DetailInfoExtension.Refresh(this); - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(ContentDetail tmp) - { - string key = tmp.DetailID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (DetailInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ContentDetail tmp) - { - _ItemType = tmp.ItemType; - _Text = tmp.Text; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _DetailInfoExtension.Refresh(this); - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - OnChange();// raise an event - } - public static DetailInfo Get(int detailID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Detail"); - try - { - DetailInfo tmp = GetCachedByPrimaryKey(detailID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(detailID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up DetailInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DetailInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal DetailInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DetailInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfo.Constructor", ex); - throw new DbCslaException("DetailInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _DetailID; - public int DetailID - { get { return _DetailID; } } - public PKCriteria(int detailID) - { - _DetailID = detailID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DetailInfo.ReadData", GetHashCode()); - try - { - _DetailID = dr.GetInt32("DetailID"); - _ContentID = dr.GetInt32("ContentID"); - _ItemType = dr.GetInt32("ItemType"); - _Text = dr.GetString("Text"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DetailInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DetailInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDetail"; - cm.Parameters.AddWithValue("@DetailID", criteria.DetailID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DetailInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - DetailInfoExtension _DetailInfoExtension = new DetailInfoExtension(); - [Serializable()] - partial class DetailInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(DetailInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class DetailInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DetailInfo) - { - // Return the ToString value - return ((DetailInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DetailInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/DetailInfoList.cs deleted file mode 100644 index 229d6851..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DetailInfoList.cs +++ /dev/null @@ -1,255 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// DetailInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DetailInfoListConverter))] - public partial class DetailInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (DetailInfo tmp in this) - { - tmp.Changed += new DetailInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (DetailInfo tmp in this) - { - tmp.Changed -= new DetailInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static DetailInfoList _DetailInfoList = null; - /// - /// Return a list of all projects. - /// - public static DetailInfoList Get() - { - try - { - if (_DetailInfoList != null) - return _DetailInfoList; - DetailInfoList tmp = DataPortal.Fetch(); - DetailInfo.AddList(tmp); - tmp.AddEvents(); - _DetailInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DetailInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static DetailInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on DetailInfoList.Get", ex); - // } - //} - public static DetailInfoList GetByContentID(int contentID) - { - try - { - DetailInfoList tmp = DataPortal.Fetch(new ContentIDCriteria(contentID)); - DetailInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DetailInfoList.GetByContentID", ex); - } - } - private DetailInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DetailInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDetails"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new DetailInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("DetailInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ContentIDCriteria - { - public ContentIDCriteria(int contentID) - { - _ContentID = contentID; - } - private int _ContentID; - public int ContentID - { - get { return _ContentID; } - set { _ContentID = value; } - } - } - private void DataPortal_Fetch(ContentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DetailInfoList.DataPortal_FetchContentID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDetailsByContentID"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new DetailInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DetailInfoList.DataPortal_FetchContentID", ex); - throw new DbCslaException("DetailInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - DetailInfoListPropertyDescriptor pd = new DetailInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class DetailInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private DetailInfo Item { get { return (DetailInfo)_Item; } } - public DetailInfoListPropertyDescriptor(DetailInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class DetailInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DetailInfoList) - { - // Return department and department role separated by comma. - return ((DetailInfoList)value).Items.Count.ToString() + " Details"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersion.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersion.cs deleted file mode 100644 index dc19b6ee..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersion.cs +++ /dev/null @@ -1,1260 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// DocVersion Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DocVersionConverter))] - public partial class DocVersion : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshDocVersions = new List(); - private List _RefreshDocVersionDocVersionROFsts = new List(); - private void AddToRefreshList(List refreshDocVersions, List refreshDocVersionDocVersionROFsts) - { - if (IsDirty) - refreshDocVersions.Add(this); - if (_DocVersionDocVersionROFsts != null && _DocVersionDocVersionROFsts.IsDirty) - { - foreach (DocVersionDocVersionROFst tmp in _DocVersionDocVersionROFsts) - { - if (tmp.IsDirty) refreshDocVersionDocVersionROFsts.Add(tmp); - } - } - } - private void BuildRefreshList() - { - _RefreshDocVersions = new List(); - _RefreshDocVersionDocVersionROFsts = new List(); - AddToRefreshList(_RefreshDocVersions, _RefreshDocVersionDocVersionROFsts); - } - private void ProcessRefreshList() - { - foreach (DocVersion tmp in _RefreshDocVersions) - { - DocVersionInfo.Refresh(tmp); - if (tmp._MyFolder != null) FolderInfo.Refresh(tmp._MyFolder); - if (tmp._MyFormat != null) FormatInfo.Refresh(tmp._MyFormat); - if (tmp._MyItem != null) ItemInfo.Refresh(tmp._MyItem); - } - foreach (DocVersionDocVersionROFst tmp in _RefreshDocVersionDocVersionROFsts) - { - DocVersionROFstInfo.Refresh(this, tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(DocVersion docVersion) - { - if (!_CacheList.Contains(docVersion)) _CacheList.Add(docVersion); // In AddToCache - } - protected static void RemoveFromCache(DocVersion docVersion) - { - while (_CacheList.Contains(docVersion)) _CacheList.Remove(docVersion); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (DocVersion tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.VersionID.ToString())) - { - _CacheByPrimaryKey[tmp.VersionID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.VersionID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (DocVersion tmp in remove) - RemoveFromCache(tmp); - } - protected static DocVersion GetCachedByPrimaryKey(int versionID) - { - ConvertListToDictionary(); - string key = versionID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextVersionID = -1; - public static int NextVersionID - { - get { return _nextVersionID--; } - } - private int _VersionID; - [System.ComponentModel.DataObjectField(true, true)] - public int VersionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _VersionID; - } - } - private int _FolderID; - public int FolderID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder != null) _FolderID = _MyFolder.FolderID; - return _FolderID; - } - } - private Folder _MyFolder; - public Folder MyFolder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder == null && _FolderID != 0) _MyFolder = Folder.Get(_FolderID); - return _MyFolder; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyFolder != value) - { - _MyFolder = value; - PropertyHasChanged(); - } - } - } - private int _VersionType; - /// - /// 0 Working Draft, 1 Temporary, 128 Revision, 129 Approved (Greater than 127 - non editable) - /// - public int VersionType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _VersionType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_VersionType != value) - { - _VersionType = value; - PropertyHasChanged(); - } - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Name != value) - { - _Name = value; - PropertyHasChanged(); - } - } - } - private string _Title = string.Empty; - public string Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Title; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Title != value) - { - _Title = value; - PropertyHasChanged(); - } - } - } - private int? _ItemID; - public int? ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem != null) _ItemID = _MyItem.ItemID; - return _ItemID; - } - } - private Item _MyItem; - public Item MyItem - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem == null && _ItemID != null) _MyItem = Item.Get((int)_ItemID); - return _MyItem; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if ((_MyItem == null ? _ItemID : (int?)_MyItem.ItemID) != (value == null ? null : (int?)value.ItemID)) - { - _MyItem = value; - _ItemID = (value == null ? null : (int?)value.ItemID); - PropertyHasChanged(); - } - } - } - private int? _FormatID; - public int? FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat != null) _FormatID = _MyFormat.FormatID; - return _FormatID; - } - } - private Format _MyFormat; - public Format MyFormat - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat == null && _FormatID != null) _MyFormat = Format.Get((int)_FormatID); - return _MyFormat; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if ((_MyFormat == null ? _FormatID : (int?)_MyFormat.FormatID) != (value == null ? null : (int?)value.FormatID)) - { - _MyFormat = value; - _FormatID = (value == null ? null : (int?)value.FormatID); - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _DocVersionDocVersionROFstCount = 0; - /// - /// Count of DocVersionDocVersionROFsts for this DocVersion - /// - public int DocVersionDocVersionROFstCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocVersionDocVersionROFstCount; - } - } - private DocVersionDocVersionROFsts _DocVersionDocVersionROFsts = null; - /// - /// Related Field - /// - [TypeConverter(typeof(DocVersionDocVersionROFstsConverter))] - public DocVersionDocVersionROFsts DocVersionDocVersionROFsts - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_DocVersionDocVersionROFstCount > 0 && _DocVersionDocVersionROFsts == null) - _DocVersionDocVersionROFsts = DocVersionDocVersionROFsts.GetByVersionID(VersionID); - else if (_DocVersionDocVersionROFsts == null) - _DocVersionDocVersionROFsts = DocVersionDocVersionROFsts.New(); - return _DocVersionDocVersionROFsts; - } - } - public override bool IsDirty - { - get { return base.IsDirty || (_DocVersionDocVersionROFsts == null ? false : _DocVersionDocVersionROFsts.IsDirty) || (_MyFolder == null ? false : _MyFolder.IsDirty) || (_MyFormat == null ? false : _MyFormat.IsDirty) || (_MyItem == null ? false : _MyItem.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_DocVersionDocVersionROFsts == null ? true : _DocVersionDocVersionROFsts.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid) && (_MyFormat == null ? true : _MyFormat.IsValid) && (_MyItem == null ? true : _MyItem.IsValid); } - } - // TODO: Replace base DocVersion.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current DocVersion - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check DocVersion.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current DocVersion - protected override object GetIdValue() - { - return _VersionID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_DocVersionDocVersionROFsts != null && (hasBrokenRules = _DocVersionDocVersionROFsts.HasBrokenRules) != null) return hasBrokenRules; - if (_MyFolder != null && (hasBrokenRules = _MyFolder.HasBrokenRules) != null) return hasBrokenRules; - if (_MyItem != null && (hasBrokenRules = _MyItem.HasBrokenRules) != null) return hasBrokenRules; - if (_MyFormat != null && (hasBrokenRules = _MyFormat.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyFolderRequired, "MyFolder"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "Name"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Title", 510)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _DocVersionExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _DocVersionExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - private static bool MyFolderRequired(DocVersion target, Csla.Validation.RuleArgs e) - { - if (target._FolderID == 0 && target._MyFolder == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(VersionID, ""); - //AuthorizationRules.AllowRead(FolderID, ""); - //AuthorizationRules.AllowRead(VersionType, ""); - //AuthorizationRules.AllowRead(Name, ""); - //AuthorizationRules.AllowRead(Title, ""); - //AuthorizationRules.AllowRead(ItemID, ""); - //AuthorizationRules.AllowRead(FormatID, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(FolderID, ""); - //AuthorizationRules.AllowWrite(VersionType, ""); - //AuthorizationRules.AllowWrite(Name, ""); - //AuthorizationRules.AllowWrite(Title, ""); - //AuthorizationRules.AllowWrite(ItemID, ""); - //AuthorizationRules.AllowWrite(FormatID, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - _DocVersionExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _DocVersionExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - /// - /// determines if related records (Foreign Keys) will keep this Item from being deleted - /// - public bool CanDelete - { - get - { - // Check to make sure that there are not any related records - int usedByCount = 0; - usedByCount += _DocVersionDocVersionROFstCount; - return (usedByCount == 0); - } - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _DocVersionUnique = 0; - protected static int DocVersionUnique - { get { return ++_DocVersionUnique; } } - private int _MyDocVersionUnique = DocVersionUnique; - public int MyDocVersionUnique - { get { return _MyDocVersionUnique; } } - protected DocVersion() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(VersionID.ToString())) - { - List listDocVersion = _CacheByPrimaryKey[VersionID.ToString()]; // Get the list of items - while (listDocVersion.Contains(this)) listDocVersion.Remove(this); // Remove the item from the list - if (listDocVersion.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(VersionID.ToString()); // remove the list - } - } - public static DocVersion New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a DocVersion"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersion.New", ex); - } - } - public static DocVersion New(Folder myFolder, string name) - { - DocVersion tmp = DocVersion.New(); - tmp.MyFolder = myFolder; - tmp.Name = name; - return tmp; - } - public static DocVersion New(Folder myFolder, int versionType, string name, string title, Item myItem, Format myFormat, string config, DateTime dts, string userID) - { - DocVersion tmp = DocVersion.New(); - tmp.MyFolder = myFolder; - tmp.VersionType = versionType; - tmp.Name = name; - tmp.Title = title; - tmp.MyItem = myItem; - tmp.MyFormat = myFormat; - tmp.Config = config; - tmp.DTS = dts; - tmp.UserID = userID; - return tmp; - } - public static DocVersion MakeDocVersion(Folder myFolder, int versionType, string name, string title, Item myItem, Format myFormat, string config, DateTime dts, string userID) - { - DocVersion tmp = DocVersion.New(myFolder, versionType, name, title, myItem, myFormat, config, dts, userID); - if (tmp.IsSavable) - { - DocVersion tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static DocVersion New(Folder myFolder, string name, string title, Item myItem, Format myFormat, string config) - { - DocVersion tmp = DocVersion.New(); - tmp.MyFolder = myFolder; - tmp.Name = name; - tmp.Title = title; - tmp.MyItem = myItem; - tmp.MyFormat = myFormat; - tmp.Config = config; - return tmp; - } - public static DocVersion MakeDocVersion(Folder myFolder, string name, string title, Item myItem, Format myFormat, string config) - { - DocVersion tmp = DocVersion.New(myFolder, name, title, myItem, myFormat, config); - if (tmp.IsSavable) - { - DocVersion tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static DocVersion Get(int versionID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a DocVersion"); - try - { - DocVersion tmp = GetCachedByPrimaryKey(versionID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(versionID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up DocVersion - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersion.Get", ex); - } - } - public static DocVersion Get(SafeDataReader dr) - { - if (dr.Read()) return new DocVersion(dr); - return null; - } - internal DocVersion(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int versionID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a DocVersion"); - try - { - DataPortal.Delete(new PKCriteria(versionID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersion.Delete", ex); - } - } - public override DocVersion Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a DocVersion"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a DocVersion"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a DocVersion"); - try - { - BuildRefreshList(); - DocVersion docVersion = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(docVersion);//Refresh the item in AllList - ProcessRefreshList(); - return docVersion; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _VersionID; - public int VersionID - { get { return _VersionID; } } - public PKCriteria(int versionID) - { - _VersionID = versionID; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _VersionID = NextVersionID; - // Database Defaults - _VersionType = _DocVersionExtension.DefaultVersionType; - _DTS = _DocVersionExtension.DefaultDTS; - _UserID = _DocVersionExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersion.ReadData", GetHashCode()); - try - { - _VersionID = dr.GetInt32("VersionID"); - _FolderID = dr.GetInt32("FolderID"); - _VersionType = dr.GetInt32("VersionType"); - _Name = dr.GetString("Name"); - _Title = dr.GetString("Title"); - _ItemID = (int?)dr.GetValue("ItemID"); - _FormatID = (int?)dr.GetValue("FormatID"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _DocVersionDocVersionROFstCount = dr.GetInt32("DocVersionROFstCount"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersion.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocVersion.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersion.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocVersion"; - cm.Parameters.AddWithValue("@VersionID", criteria.VersionID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _DocVersionDocVersionROFsts = DocVersionDocVersionROFsts.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersion.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocVersion.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersion.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocVersion.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersion.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyFolder != null) _MyFolder.Update(); - if (_MyFormat != null) _MyFormat.Update(); - if (_MyItem != null) _MyItem.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addDocVersion"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@FolderID", FolderID); - cm.Parameters.AddWithValue("@VersionType", _VersionType); - cm.Parameters.AddWithValue("@Name", _Name); - cm.Parameters.AddWithValue("@Title", _Title); - cm.Parameters.AddWithValue("@ItemID", ItemID); - cm.Parameters.AddWithValue("@FormatID", FormatID); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - // Output Calculated Columns - SqlParameter param_VersionID = new SqlParameter("@newVersionID", SqlDbType.Int); - param_VersionID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_VersionID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _VersionID = (int)cm.Parameters["@newVersionID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_DocVersionDocVersionROFsts != null) _DocVersionDocVersionROFsts.Update(this); - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersion.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersion.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocVersion.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int versionID, Folder myFolder, int versionType, string name, string title, Item myItem, Format myFormat, string config, DateTime dts, string userID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersion.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addDocVersion"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@FolderID", myFolder.FolderID); - cm.Parameters.AddWithValue("@VersionType", versionType); - cm.Parameters.AddWithValue("@Name", name); - cm.Parameters.AddWithValue("@Title", title); - if (myItem != null) cm.Parameters.AddWithValue("@ItemID", myItem.ItemID); - if (myFormat != null) cm.Parameters.AddWithValue("@FormatID", myFormat.FormatID); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - // Output Calculated Columns - SqlParameter param_VersionID = new SqlParameter("@newVersionID", SqlDbType.Int); - param_VersionID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_VersionID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - versionID = (int)cm.Parameters["@newVersionID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersion.Add", ex); - throw new DbCslaException("DocVersion.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersion.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersion.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersion.SQLUpdate", GetHashCode()); - try - { - if (_MyFolder != null) _MyFolder.Update(); - if (_MyFormat != null) _MyFormat.Update(); - if (_MyItem != null) _MyItem.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateDocVersion"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@VersionID", _VersionID); - cm.Parameters.AddWithValue("@FolderID", FolderID); - cm.Parameters.AddWithValue("@VersionType", _VersionType); - cm.Parameters.AddWithValue("@Name", _Name); - cm.Parameters.AddWithValue("@Title", _Title); - cm.Parameters.AddWithValue("@ItemID", ItemID); - cm.Parameters.AddWithValue("@FormatID", FormatID); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - if (_DocVersionDocVersionROFsts != null) _DocVersionDocVersionROFsts.Update(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersion.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = DocVersion.Add(cn, ref _VersionID, _MyFolder, _VersionType, _Name, _Title, _MyItem, _MyFormat, _Config, _DTS, _UserID); - else - _LastChanged = DocVersion.Update(cn, ref _VersionID, _MyFolder, _VersionType, _Name, _Title, _MyItem, _MyFormat, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - if (_DocVersionDocVersionROFsts != null) _DocVersionDocVersionROFsts.Update(this); - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int versionID, Folder myFolder, int versionType, string name, string title, Item myItem, Format myFormat, string config, DateTime dts, string userID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersion.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateDocVersion"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@VersionID", versionID); - cm.Parameters.AddWithValue("@FolderID", myFolder.FolderID); - cm.Parameters.AddWithValue("@VersionType", versionType); - cm.Parameters.AddWithValue("@Name", name); - cm.Parameters.AddWithValue("@Title", title); - if (myItem != null) cm.Parameters.AddWithValue("@ItemID", myItem.ItemID); - if (myFormat != null) cm.Parameters.AddWithValue("@FormatID", myFormat.FormatID); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersion.Update", ex); - throw new DbCslaException("DocVersion.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_VersionID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersion.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteDocVersion"; - cm.Parameters.AddWithValue("@VersionID", criteria.VersionID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersion.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocVersion.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int versionID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersion.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteDocVersion"; - // Input PK Fields - cm.Parameters.AddWithValue("@VersionID", versionID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersion.Remove", ex); - throw new DbCslaException("DocVersion.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int versionID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(versionID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersion.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _VersionID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int versionID) - { - _VersionID = versionID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersion.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsDocVersion"; - cm.Parameters.AddWithValue("@VersionID", _VersionID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersion.DataPortal_Execute", ex); - throw new DbCslaException("DocVersion.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - DocVersionExtension _DocVersionExtension = new DocVersionExtension(); - [Serializable()] - partial class DocVersionExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultVersionType - { - get { return 0; } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class DocVersionConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DocVersion) - { - // Return the ToString value - return ((DocVersion)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create DocVersionExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class DocVersion -// { -// partial class DocVersionExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultVersionType -// { -// get { return 0; } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionDocVersionROFst.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionDocVersionROFst.cs deleted file mode 100644 index 69b87e07..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionDocVersionROFst.cs +++ /dev/null @@ -1,423 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// DocVersionDocVersionROFst Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DocVersionDocVersionROFstConverter))] - public partial class DocVersionDocVersionROFst : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _ROFstID; - [System.ComponentModel.DataObjectField(true, true)] - public int ROFstID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROFst != null) _ROFstID = _MyROFst.ROFstID; - } - } - private ROFst _MyROFst; - [System.ComponentModel.DataObjectField(true, true)] - public ROFst MyROFst - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFst.Get(_ROFstID); - return _MyROFst; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _ROFst_RODbID; - public int ROFst_RODbID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFst_RODbID; - } - } - private byte[] _ROFst_ROFST; - public byte[] ROFst_ROFST - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFst_ROFST; - } - } - private DateTime _ROFst_DTS = new DateTime(); - public DateTime ROFst_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFst_DTS; - } - } - private string _ROFst_UserID = string.Empty; - public string ROFst_UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFst_UserID; - } - } - // TODO: Check DocVersionDocVersionROFst.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current DocVersionDocVersionROFst - protected override object GetIdValue() - { - return _ROFstID; - } - // TODO: Replace base DocVersionDocVersionROFst.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current DocVersionDocVersionROFst - //public override string ToString() - //{ - // return base.ToString(); - //} - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ROFstID, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static DocVersionDocVersionROFst New(ROFst myROFst) - { - return new DocVersionDocVersionROFst(myROFst); - } - internal static DocVersionDocVersionROFst Get(SafeDataReader dr) - { - return new DocVersionDocVersionROFst(dr); - } - public DocVersionDocVersionROFst() - { - MarkAsChild(); - - _DTS = _DocVersionDocVersionROFstExtension.DefaultDTS; - _UserID = _DocVersionDocVersionROFstExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private DocVersionDocVersionROFst(ROFst myROFst) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _DTS = _DocVersionDocVersionROFstExtension.DefaultDTS; - _UserID = _DocVersionDocVersionROFstExtension.DefaultUserID; - _MyROFst = myROFst; - ValidationRules.CheckRules(); - } - internal DocVersionDocVersionROFst(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionDocVersionROFst.FetchDR", GetHashCode()); - try - { - _ROFstID = dr.GetInt32("ROFstID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _ROFst_RODbID = dr.GetInt32("ROFst_RODbID"); - _ROFst_ROFST = (byte[])dr.GetValue("ROFst_ROFST"); - _ROFst_DTS = dr.GetDateTime("ROFst_DTS"); - _ROFst_UserID = dr.GetString("ROFst_UserID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionDocVersionROFst.FetchDR", ex); - throw new DbCslaException("DocVersionDocVersionROFst.Fetch", ex); - } - MarkOld(); - } - internal void Insert(DocVersion myDocVersion) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = DocVersionROFst.Add(cn, myDocVersion, _MyROFst, _DTS, _UserID); - MarkOld(); - } - internal void Update(DocVersion myDocVersion) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = DocVersionROFst.Update(cn, myDocVersion, _MyROFst, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(DocVersion myDocVersion) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - DocVersionROFst.Remove(cn, myDocVersion.VersionID, _ROFstID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - DocVersionDocVersionROFstExtension _DocVersionDocVersionROFstExtension = new DocVersionDocVersionROFstExtension(); - [Serializable()] - partial class DocVersionDocVersionROFstExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class DocVersionDocVersionROFstConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DocVersionDocVersionROFst) - { - // Return the ToString value - return ((DocVersionDocVersionROFst)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create DocVersionDocVersionROFstExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class DocVersionDocVersionROFst -// { -// partial class DocVersionDocVersionROFstExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionDocVersionROFsts.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionDocVersionROFsts.cs deleted file mode 100644 index d9808498..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionDocVersionROFsts.cs +++ /dev/null @@ -1,295 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// DocVersionDocVersionROFsts Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DocVersionDocVersionROFstsConverter))] - public partial class DocVersionDocVersionROFsts : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // Many To Many - public DocVersionDocVersionROFst this[ROFst myROFst] - { - get - { - foreach (DocVersionDocVersionROFst docVersionROFst in this) - if (docVersionROFst.ROFstID == myROFst.ROFstID) - return docVersionROFst; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public DocVersionDocVersionROFst GetItem(ROFst myROFst) - { - foreach (DocVersionDocVersionROFst docVersionROFst in this) - if (docVersionROFst.ROFstID == myROFst.ROFstID) - return docVersionROFst; - return null; - } - public DocVersionDocVersionROFst Add(ROFst myROFst)// Many to Many with required fields - { - if (!Contains(myROFst)) - { - DocVersionDocVersionROFst docVersionROFst = DocVersionDocVersionROFst.New(myROFst); - this.Add(docVersionROFst); - return docVersionROFst; - } - else - throw new InvalidOperationException("docVersionROFst already exists"); - } - public void Remove(ROFst myROFst) - { - foreach (DocVersionDocVersionROFst docVersionROFst in this) - { - if (docVersionROFst.ROFstID == myROFst.ROFstID) - { - Remove(docVersionROFst); - break; - } - } - } - public bool Contains(ROFst myROFst) - { - foreach (DocVersionDocVersionROFst docVersionROFst in this) - if (docVersionROFst.ROFstID == myROFst.ROFstID) - return true; - return false; - } - public bool ContainsDeleted(ROFst myROFst) - { - foreach (DocVersionDocVersionROFst docVersionROFst in DeletedList) - if (docVersionROFst.ROFstID == myROFst.ROFstID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (DocVersionDocVersionROFst docVersionDocVersionROFst in this) - if ((hasBrokenRules = docVersionDocVersionROFst.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static DocVersionDocVersionROFsts New() - { - return new DocVersionDocVersionROFsts(); - } - internal static DocVersionDocVersionROFsts Get(SafeDataReader dr) - { - return new DocVersionDocVersionROFsts(dr); - } - public static DocVersionDocVersionROFsts GetByVersionID(int versionID) - { - try - { - return DataPortal.Fetch(new VersionIDCriteria(versionID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersionDocVersionROFsts.GetByVersionID", ex); - } - } - private DocVersionDocVersionROFsts() - { - MarkAsChild(); - } - internal DocVersionDocVersionROFsts(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(DocVersionDocVersionROFst.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class VersionIDCriteria - { - public VersionIDCriteria(int versionID) - { - _VersionID = versionID; - } - private int _VersionID; - public int VersionID - { - get { return _VersionID; } - set { _VersionID = value; } - } - } - private void DataPortal_Fetch(VersionIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionDocVersionROFsts.DataPortal_FetchVersionID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocVersionROFstsByVersionID"; - cm.Parameters.AddWithValue("@VersionID", criteria.VersionID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new DocVersionDocVersionROFst(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionDocVersionROFsts.DataPortal_FetchVersionID", ex); - throw new DbCslaException("DocVersionDocVersionROFsts.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(DocVersion docVersion) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (DocVersionDocVersionROFst obj in DeletedList) - obj.DeleteSelf(docVersion);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (DocVersionDocVersionROFst obj in this) - { - if (obj.IsNew) - obj.Insert(docVersion); - else - obj.Update(docVersion); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - DocVersionDocVersionROFstsPropertyDescriptor pd = new DocVersionDocVersionROFstsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class DocVersionDocVersionROFstsPropertyDescriptor : vlnListPropertyDescriptor - { - private DocVersionDocVersionROFst Item { get { return (DocVersionDocVersionROFst)_Item; } } - public DocVersionDocVersionROFstsPropertyDescriptor(DocVersionDocVersionROFsts collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class DocVersionDocVersionROFstsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DocVersionDocVersionROFsts) - { - // Return department and department role separated by comma. - return ((DocVersionDocVersionROFsts)value).Items.Count.ToString() + " DocVersionROFsts"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionInfo.cs deleted file mode 100644 index 47aae191..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionInfo.cs +++ /dev/null @@ -1,632 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void DocVersionInfoEvent(object sender); - /// - /// DocVersionInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DocVersionInfoConverter))] - public partial class DocVersionInfo : ReadOnlyBase, IDisposable - { - public event DocVersionInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(DocVersionInfo docVersionInfo) - { - if (!_CacheList.Contains(docVersionInfo)) _CacheList.Add(docVersionInfo); // In AddToCache - } - protected static void RemoveFromCache(DocVersionInfo docVersionInfo) - { - while (_CacheList.Contains(docVersionInfo)) _CacheList.Remove(docVersionInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (DocVersionInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.VersionID.ToString())) - { - _CacheByPrimaryKey[tmp.VersionID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.VersionID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (DocVersionInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(DocVersionInfoList lst) - { - foreach (DocVersionInfo item in lst) AddToCache(item); - } - protected static DocVersionInfo GetCachedByPrimaryKey(int versionID) - { - ConvertListToDictionary(); - string key = versionID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected DocVersion _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _VersionID; - [System.ComponentModel.DataObjectField(true, true)] - public int VersionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _VersionID; - } - } - private int _FolderID; - public int FolderID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder != null) _FolderID = _MyFolder.FolderID; - return _FolderID; - } - } - private FolderInfo _MyFolder; - public FolderInfo MyFolder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder == null && _FolderID != 0) _MyFolder = FolderInfo.Get(_FolderID); - return _MyFolder; - } - } - private int _VersionType; - /// - /// 0 Working Draft, 1 Temporary, 128 Revision, 129 Approved (Greater than 127 - non editable) - /// - public int VersionType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _VersionType; - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - } - private string _Title = string.Empty; - public string Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Title; - } - } - private int? _ItemID; - public int? ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem != null) _ItemID = _MyItem.ItemID; - return _ItemID; - } - } - private ItemInfo _MyItem; - public ItemInfo MyItem - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem == null && _ItemID != null) _MyItem = ItemInfo.Get((int)_ItemID); - return _MyItem; - } - } - private int? _FormatID; - public int? FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat != null) _FormatID = _MyFormat.FormatID; - return _FormatID; - } - } - private FormatInfo _MyFormat; - public FormatInfo MyFormat - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat == null && _FormatID != null) _MyFormat = FormatInfo.Get((int)_FormatID); - return _MyFormat; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - private int _DocVersionDocVersionROFstCount = 0; - /// - /// Count of DocVersionDocVersionROFsts for this DocVersion - /// - public int DocVersionDocVersionROFstCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocVersionDocVersionROFstCount; - } - } - private DocVersionROFstInfoList _DocVersionDocVersionROFsts = null; - [TypeConverter(typeof(DocVersionROFstInfoListConverter))] - public DocVersionROFstInfoList DocVersionDocVersionROFsts - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_DocVersionDocVersionROFstCount < 0 || (_DocVersionDocVersionROFstCount > 0 && _DocVersionDocVersionROFsts == null)) - _DocVersionDocVersionROFsts = DocVersionROFstInfoList.GetByVersionID(_VersionID); - if (_DocVersionDocVersionROFstCount < 0) - _DocVersionDocVersionROFstCount = _DocVersionDocVersionROFsts.Count; - return _DocVersionDocVersionROFsts; - } - } - public void RefreshDocVersionDocVersionROFsts() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_VersionID.ToString())) - foreach (DocVersionInfo tmp in _CacheByPrimaryKey[_VersionID.ToString()]) - tmp._DocVersionDocVersionROFstCount = -1; // This will cause the data to be requeried - } - // TODO: Replace base DocVersionInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current DocVersionInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check DocVersionInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current DocVersionInfo - protected override object GetIdValue() - { - return _VersionID; - } - #endregion - #region Factory Methods - private static int _DocVersionInfoUnique = 0; - private static int DocVersionInfoUnique - { get { return ++_DocVersionInfoUnique; } } - private int _MyDocVersionInfoUnique = DocVersionInfoUnique; - public int MyDocVersionInfoUnique - { get { return _MyDocVersionInfoUnique; } } - protected DocVersionInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(VersionID.ToString())) return; - List listDocVersionInfo = _CacheByPrimaryKey[VersionID.ToString()]; // Get the list of items - while (listDocVersionInfo.Contains(this)) listDocVersionInfo.Remove(this); // Remove the item from the list - if (listDocVersionInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(VersionID.ToString()); // remove the list - } - public virtual DocVersion Get() - { - return _Editable = DocVersion.Get(_VersionID); - } - public static void Refresh(DocVersion tmp) - { - string key = tmp.VersionID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (DocVersionInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(DocVersion tmp) - { - if (_FolderID != tmp.FolderID) - { - if (MyFolder != null) MyFolder.RefreshFolderDocVersions(); // Update List for old value - _FolderID = tmp.FolderID; // Update the value - } - _MyFolder = null; // Reset list so that the next line gets a new list - if (MyFolder != null) MyFolder.RefreshFolderDocVersions(); // Update List for new value - _VersionType = tmp.VersionType; - _Name = tmp.Name; - _Title = tmp.Title; - if (_ItemID != tmp.ItemID) - { - if (MyItem != null) MyItem.RefreshItemDocVersions(); // Update List for old value - _ItemID = tmp.ItemID; // Update the value - } - _MyItem = null; // Reset list so that the next line gets a new list - if (MyItem != null) MyItem.RefreshItemDocVersions(); // Update List for new value - if (_FormatID != tmp.FormatID) - { - if (MyFormat != null) MyFormat.RefreshFormatDocVersions(); // Update List for old value - _FormatID = tmp.FormatID; // Update the value - } - _MyFormat = null; // Reset list so that the next line gets a new list - if (MyFormat != null) MyFormat.RefreshFormatDocVersions(); // Update List for new value - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _DocVersionInfoExtension.Refresh(this); - if (_MyFolder != null) - { - _MyFolder.Dispose();// Dispose related value - _MyFolder = null;// Reset related value - } - if (_MyItem != null) - { - _MyItem.Dispose();// Dispose related value - _MyItem = null;// Reset related value - } - if (_MyFormat != null) - { - _MyFormat.Dispose();// Dispose related value - _MyFormat = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(FolderDocVersion tmp) - { - string key = tmp.VersionID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (DocVersionInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(FolderDocVersion tmp) - { - _VersionType = tmp.VersionType; - _Name = tmp.Name; - _Title = tmp.Title; - if (_ItemID != tmp.ItemID) - { - if (MyItem != null) MyItem.RefreshItemDocVersions(); // Update List for old value - _ItemID = tmp.ItemID; // Update the value - } - _MyItem = null; // Reset list so that the next line gets a new list - if (MyItem != null) MyItem.RefreshItemDocVersions(); // Update List for new value - if (_FormatID != tmp.FormatID) - { - if (MyFormat != null) MyFormat.RefreshFormatDocVersions(); // Update List for old value - _FormatID = tmp.FormatID; // Update the value - } - _MyFormat = null; // Reset list so that the next line gets a new list - if (MyFormat != null) MyFormat.RefreshFormatDocVersions(); // Update List for new value - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _DocVersionInfoExtension.Refresh(this); - if (_MyFolder != null) - { - _MyFolder.Dispose();// Dispose related value - _MyFolder = null;// Reset related value - } - if (_MyItem != null) - { - _MyItem.Dispose();// Dispose related value - _MyItem = null;// Reset related value - } - if (_MyFormat != null) - { - _MyFormat.Dispose();// Dispose related value - _MyFormat = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(FormatDocVersion tmp) - { - string key = tmp.VersionID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (DocVersionInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(FormatDocVersion tmp) - { - if (_FolderID != tmp.FolderID) - { - if (MyFolder != null) MyFolder.RefreshFolderDocVersions(); // Update List for old value - _FolderID = tmp.FolderID; // Update the value - } - _MyFolder = null; // Reset list so that the next line gets a new list - if (MyFolder != null) MyFolder.RefreshFolderDocVersions(); // Update List for new value - _VersionType = tmp.VersionType; - _Name = tmp.Name; - _Title = tmp.Title; - if (_ItemID != tmp.ItemID) - { - if (MyItem != null) MyItem.RefreshItemDocVersions(); // Update List for old value - _ItemID = tmp.ItemID; // Update the value - } - _MyItem = null; // Reset list so that the next line gets a new list - if (MyItem != null) MyItem.RefreshItemDocVersions(); // Update List for new value - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _DocVersionInfoExtension.Refresh(this); - if (_MyFolder != null) - { - _MyFolder.Dispose();// Dispose related value - _MyFolder = null;// Reset related value - } - if (_MyItem != null) - { - _MyItem.Dispose();// Dispose related value - _MyItem = null;// Reset related value - } - if (_MyFormat != null) - { - _MyFormat.Dispose();// Dispose related value - _MyFormat = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(ItemDocVersion tmp) - { - string key = tmp.VersionID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (DocVersionInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ItemDocVersion tmp) - { - if (_FolderID != tmp.FolderID) - { - if (MyFolder != null) MyFolder.RefreshFolderDocVersions(); // Update List for old value - _FolderID = tmp.FolderID; // Update the value - } - _MyFolder = null; // Reset list so that the next line gets a new list - if (MyFolder != null) MyFolder.RefreshFolderDocVersions(); // Update List for new value - _VersionType = tmp.VersionType; - _Name = tmp.Name; - _Title = tmp.Title; - if (_FormatID != tmp.FormatID) - { - if (MyFormat != null) MyFormat.RefreshFormatDocVersions(); // Update List for old value - _FormatID = tmp.FormatID; // Update the value - } - _MyFormat = null; // Reset list so that the next line gets a new list - if (MyFormat != null) MyFormat.RefreshFormatDocVersions(); // Update List for new value - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _DocVersionInfoExtension.Refresh(this); - if (_MyFolder != null) - { - _MyFolder.Dispose();// Dispose related value - _MyFolder = null;// Reset related value - } - if (_MyItem != null) - { - _MyItem.Dispose();// Dispose related value - _MyItem = null;// Reset related value - } - if (_MyFormat != null) - { - _MyFormat.Dispose();// Dispose related value - _MyFormat = null;// Reset related value - } - OnChange();// raise an event - } - public static DocVersionInfo Get(int versionID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a DocVersion"); - try - { - DocVersionInfo tmp = GetCachedByPrimaryKey(versionID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(versionID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up DocVersionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersionInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal DocVersionInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionInfo.Constructor", ex); - throw new DbCslaException("DocVersionInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _VersionID; - public int VersionID - { get { return _VersionID; } } - public PKCriteria(int versionID) - { - _VersionID = versionID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionInfo.ReadData", GetHashCode()); - try - { - _VersionID = dr.GetInt32("VersionID"); - _FolderID = dr.GetInt32("FolderID"); - _VersionType = dr.GetInt32("VersionType"); - _Name = dr.GetString("Name"); - _Title = dr.GetString("Title"); - _ItemID = (int?)dr.GetValue("ItemID"); - _FormatID = (int?)dr.GetValue("FormatID"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _DocVersionDocVersionROFstCount = dr.GetInt32("DocVersionROFstCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocVersionInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocVersion"; - cm.Parameters.AddWithValue("@VersionID", criteria.VersionID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocVersionInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - DocVersionInfoExtension _DocVersionInfoExtension = new DocVersionInfoExtension(); - [Serializable()] - partial class DocVersionInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(DocVersionInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class DocVersionInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DocVersionInfo) - { - // Return the ToString value - return ((DocVersionInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionInfoList.cs deleted file mode 100644 index 2ee6798b..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionInfoList.cs +++ /dev/null @@ -1,369 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// DocVersionInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DocVersionInfoListConverter))] - public partial class DocVersionInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (DocVersionInfo tmp in this) - { - tmp.Changed += new DocVersionInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (DocVersionInfo tmp in this) - { - tmp.Changed -= new DocVersionInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static DocVersionInfoList _DocVersionInfoList = null; - /// - /// Return a list of all projects. - /// - public static DocVersionInfoList Get() - { - try - { - if (_DocVersionInfoList != null) - return _DocVersionInfoList; - DocVersionInfoList tmp = DataPortal.Fetch(); - DocVersionInfo.AddList(tmp); - tmp.AddEvents(); - _DocVersionInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersionInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static DocVersionInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on DocVersionInfoList.Get", ex); - // } - //} - public static DocVersionInfoList GetByFolderID(int folderID) - { - try - { - DocVersionInfoList tmp = DataPortal.Fetch(new FolderIDCriteria(folderID)); - DocVersionInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersionInfoList.GetByFolderID", ex); - } - } - public static DocVersionInfoList GetByFormatID(int? formatID) - { - try - { - DocVersionInfoList tmp = DataPortal.Fetch(new FormatIDCriteria(formatID)); - DocVersionInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersionInfoList.GetByFormatID", ex); - } - } - public static DocVersionInfoList GetByItemID(int? itemID) - { - try - { - DocVersionInfoList tmp = DataPortal.Fetch(new ItemIDCriteria(itemID)); - DocVersionInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersionInfoList.GetByItemID", ex); - } - } - private DocVersionInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocVersions"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new DocVersionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("DocVersionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class FolderIDCriteria - { - public FolderIDCriteria(int folderID) - { - _FolderID = folderID; - } - private int _FolderID; - public int FolderID - { - get { return _FolderID; } - set { _FolderID = value; } - } - } - private void DataPortal_Fetch(FolderIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionInfoList.DataPortal_FetchFolderID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocVersionsByFolderID"; - cm.Parameters.AddWithValue("@FolderID", criteria.FolderID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new DocVersionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionInfoList.DataPortal_FetchFolderID", ex); - throw new DbCslaException("DocVersionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class FormatIDCriteria - { - public FormatIDCriteria(int? formatID) - { - _FormatID = formatID; - } - private int? _FormatID; - public int? FormatID - { - get { return _FormatID; } - set { _FormatID = value; } - } - } - private void DataPortal_Fetch(FormatIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionInfoList.DataPortal_FetchFormatID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocVersionsByFormatID"; - cm.Parameters.AddWithValue("@FormatID", criteria.FormatID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new DocVersionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionInfoList.DataPortal_FetchFormatID", ex); - throw new DbCslaException("DocVersionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ItemIDCriteria - { - public ItemIDCriteria(int? itemID) - { - _ItemID = itemID; - } - private int? _ItemID; - public int? ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - private void DataPortal_Fetch(ItemIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionInfoList.DataPortal_FetchItemID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocVersionsByItemID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new DocVersionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionInfoList.DataPortal_FetchItemID", ex); - throw new DbCslaException("DocVersionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - DocVersionInfoListPropertyDescriptor pd = new DocVersionInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class DocVersionInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private DocVersionInfo Item { get { return (DocVersionInfo)_Item; } } - public DocVersionInfoListPropertyDescriptor(DocVersionInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class DocVersionInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DocVersionInfoList) - { - // Return department and department role separated by comma. - return ((DocVersionInfoList)value).Items.Count.ToString() + " DocVersions"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionROFst.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionROFst.cs deleted file mode 100644 index 76fe5a16..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionROFst.cs +++ /dev/null @@ -1,968 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// DocVersionROFst Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DocVersionROFstConverter))] - public partial class DocVersionROFst : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshDocVersionROFsts = new List(); - private void AddToRefreshList(List refreshDocVersionROFsts) - { - if (IsDirty) - refreshDocVersionROFsts.Add(this); - } - private void BuildRefreshList() - { - _RefreshDocVersionROFsts = new List(); - AddToRefreshList(_RefreshDocVersionROFsts); - } - private void ProcessRefreshList() - { - foreach (DocVersionROFst tmp in _RefreshDocVersionROFsts) - { - DocVersionROFstInfo.Refresh(tmp); - if (tmp._MyDocVersion != null) DocVersionInfo.Refresh(tmp._MyDocVersion); - if (tmp._MyROFst != null) ROFstInfo.Refresh(tmp._MyROFst); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(DocVersionROFst docVersionROFst) - { - if (!_CacheList.Contains(docVersionROFst)) _CacheList.Add(docVersionROFst); // In AddToCache - } - protected static void RemoveFromCache(DocVersionROFst docVersionROFst) - { - while (_CacheList.Contains(docVersionROFst)) _CacheList.Remove(docVersionROFst); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (DocVersionROFst tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.VersionID.ToString() + "_" + tmp.ROFstID.ToString())) - { - _CacheByPrimaryKey[tmp.VersionID.ToString() + "_" + tmp.ROFstID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.VersionID.ToString() + "_" + tmp.ROFstID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (DocVersionROFst tmp in remove) - RemoveFromCache(tmp); - } - protected static DocVersionROFst GetCachedByPrimaryKey(int versionID, int rOFstID) - { - ConvertListToDictionary(); - string key = versionID.ToString() + "_" + rOFstID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _VersionID; - [System.ComponentModel.DataObjectField(true, true)] - public int VersionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDocVersion != null) _VersionID = _MyDocVersion.VersionID; - return _VersionID; - } - } - private DocVersion _MyDocVersion; - [System.ComponentModel.DataObjectField(true, true)] - public DocVersion MyDocVersion - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDocVersion == null && _VersionID != 0) _MyDocVersion = DocVersion.Get(_VersionID); - return _MyDocVersion; - } - } - private int _ROFstID; - [System.ComponentModel.DataObjectField(true, true)] - public int ROFstID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROFst != null) _ROFstID = _MyROFst.ROFstID; - return _ROFstID; - } - } - private ROFst _MyROFst; - [System.ComponentModel.DataObjectField(true, true)] - public ROFst MyROFst - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFst.Get(_ROFstID); - return _MyROFst; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - public override bool IsDirty - { - get { return base.IsDirty || (_MyDocVersion == null ? false : _MyDocVersion.IsDirty) || (_MyROFst == null ? false : _MyROFst.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyDocVersion == null ? true : _MyDocVersion.IsValid) && (_MyROFst == null ? true : _MyROFst.IsValid); } - } - // TODO: Replace base DocVersionROFst.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current DocVersionROFst - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check DocVersionROFst.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current DocVersionROFst - protected override object GetIdValue() - { - return (_VersionID.ToString() + "." + _ROFstID.ToString()).GetHashCode(); - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _DocVersionROFstExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _DocVersionROFstExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(VersionID, ""); - //AuthorizationRules.AllowRead(ROFstID, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - _DocVersionROFstExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _DocVersionROFstExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _DocVersionROFstUnique = 0; - protected static int DocVersionROFstUnique - { get { return ++_DocVersionROFstUnique; } } - private int _MyDocVersionROFstUnique = DocVersionROFstUnique; - public int MyDocVersionROFstUnique - { get { return _MyDocVersionROFstUnique; } } - protected DocVersionROFst() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(VersionID.ToString() + "_" + ROFstID.ToString())) - { - List listDocVersionROFst = _CacheByPrimaryKey[VersionID.ToString() + "_" + ROFstID.ToString()]; // Get the list of items - while (listDocVersionROFst.Contains(this)) listDocVersionROFst.Remove(this); // Remove the item from the list - if (listDocVersionROFst.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(VersionID.ToString() + "_" + ROFstID.ToString()); // remove the list - } - } - public static DocVersionROFst New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a DocVersionROFst"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersionROFst.New", ex); - } - } - public static DocVersionROFst New(DocVersion myDocVersion, ROFst myROFst) - { - DocVersionROFst tmp = DocVersionROFst.New(); - tmp._MyDocVersion = myDocVersion; - tmp._MyROFst = myROFst; - return tmp; - } - public static DocVersionROFst MakeDocVersionROFst(DocVersion myDocVersion, ROFst myROFst) - { - DocVersionROFst tmp = DocVersionROFst.New(myDocVersion, myROFst); - if (tmp.IsSavable) - { - DocVersionROFst tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static DocVersionROFst New(DocVersion myDocVersion, ROFst myROFst, DateTime dts, string userID) - { - DocVersionROFst tmp = DocVersionROFst.New(); - tmp._MyDocVersion = myDocVersion; - tmp._MyROFst = myROFst; - tmp.DTS = dts; - tmp.UserID = userID; - return tmp; - } - public static DocVersionROFst MakeDocVersionROFst(DocVersion myDocVersion, ROFst myROFst, DateTime dts, string userID) - { - DocVersionROFst tmp = DocVersionROFst.New(myDocVersion, myROFst, dts, userID); - if (tmp.IsSavable) - { - DocVersionROFst tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static DocVersionROFst Get(int versionID, int rOFstID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a DocVersionROFst"); - try - { - DocVersionROFst tmp = GetCachedByPrimaryKey(versionID, rOFstID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(versionID, rOFstID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up DocVersionROFst - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersionROFst.Get", ex); - } - } - public static DocVersionROFst Get(SafeDataReader dr) - { - if (dr.Read()) return new DocVersionROFst(dr); - return null; - } - internal DocVersionROFst(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int versionID, int rOFstID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a DocVersionROFst"); - try - { - DataPortal.Delete(new PKCriteria(versionID, rOFstID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersionROFst.Delete", ex); - } - } - public override DocVersionROFst Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a DocVersionROFst"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a DocVersionROFst"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a DocVersionROFst"); - try - { - BuildRefreshList(); - DocVersionROFst docVersionROFst = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(docVersionROFst);//Refresh the item in AllList - ProcessRefreshList(); - return docVersionROFst; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _VersionID; - public int VersionID - { get { return _VersionID; } } - private int _ROFstID; - public int ROFstID - { get { return _ROFstID; } } - public PKCriteria(int versionID, int rOFstID) - { - _VersionID = versionID; - _ROFstID = rOFstID; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - - // Database Defaults - _DTS = _DocVersionROFstExtension.DefaultDTS; - _UserID = _DocVersionROFstExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFst.ReadData", GetHashCode()); - try - { - _VersionID = dr.GetInt32("VersionID"); - _ROFstID = dr.GetInt32("ROFstID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFst.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocVersionROFst.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFst.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocVersionROFst"; - cm.Parameters.AddWithValue("@VersionID", criteria.VersionID); - cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFst.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocVersionROFst.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFst.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocVersionROFst.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFst.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyDocVersion != null) _MyDocVersion.Update(); - if (_MyROFst != null) _MyROFst.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addDocVersionROFst"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@VersionID", VersionID); - cm.Parameters.AddWithValue("@ROFstID", ROFstID); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFst.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFst.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocVersionROFst.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, DocVersion myDocVersion, ROFst myROFst, DateTime dts, string userID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFst.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addDocVersionROFst"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@VersionID", myDocVersion.VersionID); - cm.Parameters.AddWithValue("@ROFstID", myROFst.ROFstID); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFst.Add", ex); - throw new DbCslaException("DocVersionROFst.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFst.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFst.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFst.SQLUpdate", GetHashCode()); - try - { - if (_MyDocVersion != null) _MyDocVersion.Update(); - if (_MyROFst != null) _MyROFst.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateDocVersionROFst"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@VersionID", VersionID); - cm.Parameters.AddWithValue("@ROFstID", ROFstID); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFst.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = DocVersionROFst.Add(cn, _MyDocVersion, _MyROFst, _DTS, _UserID); - else - _LastChanged = DocVersionROFst.Update(cn, _MyDocVersion, _MyROFst, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, DocVersion myDocVersion, ROFst myROFst, DateTime dts, string userID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFst.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateDocVersionROFst"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@VersionID", myDocVersion.VersionID); - cm.Parameters.AddWithValue("@ROFstID", myROFst.ROFstID); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFst.Update", ex); - throw new DbCslaException("DocVersionROFst.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_VersionID, _ROFstID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFst.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteDocVersionROFst"; - cm.Parameters.AddWithValue("@VersionID", criteria.VersionID); - cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFst.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocVersionROFst.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int versionID, int rOFstID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFst.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteDocVersionROFst"; - // Input PK Fields - cm.Parameters.AddWithValue("@VersionID", versionID); - cm.Parameters.AddWithValue("@ROFstID", rOFstID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFst.Remove", ex); - throw new DbCslaException("DocVersionROFst.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int versionID, int rOFstID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(versionID, rOFstID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersionROFst.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _VersionID; - private int _ROFstID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int versionID, int rOFstID) - { - _VersionID = versionID; - _ROFstID = rOFstID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFst.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsDocVersionROFst"; - cm.Parameters.AddWithValue("@VersionID", _VersionID); - cm.Parameters.AddWithValue("@ROFstID", _ROFstID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFst.DataPortal_Execute", ex); - throw new DbCslaException("DocVersionROFst.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - DocVersionROFstExtension _DocVersionROFstExtension = new DocVersionROFstExtension(); - [Serializable()] - partial class DocVersionROFstExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class DocVersionROFstConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DocVersionROFst) - { - // Return the ToString value - return ((DocVersionROFst)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create DocVersionROFstExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class DocVersionROFst -// { -// partial class DocVersionROFstExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionROFstInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionROFstInfo.cs deleted file mode 100644 index 272e22de..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionROFstInfo.cs +++ /dev/null @@ -1,408 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void DocVersionROFstInfoEvent(object sender); - /// - /// DocVersionROFstInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DocVersionROFstInfoConverter))] - public partial class DocVersionROFstInfo : ReadOnlyBase, IDisposable - { - public event DocVersionROFstInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(DocVersionROFstInfo docVersionROFstInfo) - { - if (!_CacheList.Contains(docVersionROFstInfo)) _CacheList.Add(docVersionROFstInfo); // In AddToCache - } - protected static void RemoveFromCache(DocVersionROFstInfo docVersionROFstInfo) - { - while (_CacheList.Contains(docVersionROFstInfo)) _CacheList.Remove(docVersionROFstInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (DocVersionROFstInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.VersionID.ToString() + "_" + tmp.ROFstID.ToString())) - { - _CacheByPrimaryKey[tmp.VersionID.ToString() + "_" + tmp.ROFstID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.VersionID.ToString() + "_" + tmp.ROFstID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (DocVersionROFstInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(DocVersionROFstInfoList lst) - { - foreach (DocVersionROFstInfo item in lst) AddToCache(item); - } - protected static DocVersionROFstInfo GetCachedByPrimaryKey(int versionID, int rOFstID) - { - ConvertListToDictionary(); - string key = versionID.ToString() + "_" + rOFstID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected DocVersionROFst _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _VersionID; - [System.ComponentModel.DataObjectField(true, true)] - public int VersionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDocVersion != null) _VersionID = _MyDocVersion.VersionID; - return _VersionID; - } - } - private DocVersionInfo _MyDocVersion; - [System.ComponentModel.DataObjectField(true, true)] - public DocVersionInfo MyDocVersion - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDocVersion == null && _VersionID != 0) _MyDocVersion = DocVersionInfo.Get(_VersionID); - return _MyDocVersion; - } - } - private int _ROFstID; - [System.ComponentModel.DataObjectField(true, true)] - public int ROFstID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROFst != null) _ROFstID = _MyROFst.ROFstID; - return _ROFstID; - } - } - private ROFstInfo _MyROFst; - [System.ComponentModel.DataObjectField(true, true)] - public ROFstInfo MyROFst - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.Get(_ROFstID); - return _MyROFst; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - // TODO: Replace base DocVersionROFstInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current DocVersionROFstInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check DocVersionROFstInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current DocVersionROFstInfo - protected override object GetIdValue() - { - return (_VersionID.ToString() + "." + _ROFstID.ToString()).GetHashCode(); - } - #endregion - #region Factory Methods - private static int _DocVersionROFstInfoUnique = 0; - private static int DocVersionROFstInfoUnique - { get { return ++_DocVersionROFstInfoUnique; } } - private int _MyDocVersionROFstInfoUnique = DocVersionROFstInfoUnique; - public int MyDocVersionROFstInfoUnique - { get { return _MyDocVersionROFstInfoUnique; } } - protected DocVersionROFstInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(VersionID.ToString() + "_" + ROFstID.ToString())) return; - List listDocVersionROFstInfo = _CacheByPrimaryKey[VersionID.ToString() + "_" + ROFstID.ToString()]; // Get the list of items - while (listDocVersionROFstInfo.Contains(this)) listDocVersionROFstInfo.Remove(this); // Remove the item from the list - if (listDocVersionROFstInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(VersionID.ToString() + "_" + ROFstID.ToString()); // remove the list - } - public virtual DocVersionROFst Get() - { - return _Editable = DocVersionROFst.Get(_VersionID, _ROFstID); - } - public static void Refresh(DocVersionROFst tmp) - { - string key = tmp.VersionID.ToString() + "_" + tmp.ROFstID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (DocVersionROFstInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(DocVersionROFst tmp) - { - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _DocVersionROFstInfoExtension.Refresh(this); - if (_MyDocVersion != null) - { - _MyDocVersion.Dispose();// Dispose related value - _MyDocVersion = null;// Reset related value - } - if (_MyROFst != null) - { - _MyROFst.Dispose();// Dispose related value - _MyROFst = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(DocVersion myDocVersion, DocVersionDocVersionROFst tmp) - { - string key = myDocVersion.VersionID.ToString() + "_" + tmp.ROFstID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (DocVersionROFstInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(DocVersionDocVersionROFst tmp) - { - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _DocVersionROFstInfoExtension.Refresh(this); - if (_MyDocVersion != null) - { - _MyDocVersion.Dispose();// Dispose related value - _MyDocVersion = null;// Reset related value - } - if (_MyROFst != null) - { - _MyROFst.Dispose();// Dispose related value - _MyROFst = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(ROFst myROFst, ROFstDocVersionROFst tmp) - { - string key = tmp.VersionID.ToString() + "_" + myROFst.ROFstID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (DocVersionROFstInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ROFstDocVersionROFst tmp) - { - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _DocVersionROFstInfoExtension.Refresh(this); - if (_MyDocVersion != null) - { - _MyDocVersion.Dispose();// Dispose related value - _MyDocVersion = null;// Reset related value - } - if (_MyROFst != null) - { - _MyROFst.Dispose();// Dispose related value - _MyROFst = null;// Reset related value - } - OnChange();// raise an event - } - public static DocVersionROFstInfo Get(int versionID, int rOFstID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a DocVersionROFst"); - try - { - DocVersionROFstInfo tmp = GetCachedByPrimaryKey(versionID, rOFstID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(versionID, rOFstID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up DocVersionROFstInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersionROFstInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal DocVersionROFstInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFstInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFstInfo.Constructor", ex); - throw new DbCslaException("DocVersionROFstInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _VersionID; - public int VersionID - { get { return _VersionID; } } - private int _ROFstID; - public int ROFstID - { get { return _ROFstID; } } - public PKCriteria(int versionID, int rOFstID) - { - _VersionID = versionID; - _ROFstID = rOFstID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFstInfo.ReadData", GetHashCode()); - try - { - _VersionID = dr.GetInt32("VersionID"); - _ROFstID = dr.GetInt32("ROFstID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFstInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocVersionROFstInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFstInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocVersionROFst"; - cm.Parameters.AddWithValue("@VersionID", criteria.VersionID); - cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFstInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocVersionROFstInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - DocVersionROFstInfoExtension _DocVersionROFstInfoExtension = new DocVersionROFstInfoExtension(); - [Serializable()] - partial class DocVersionROFstInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(DocVersionROFstInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class DocVersionROFstInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DocVersionROFstInfo) - { - // Return the ToString value - return ((DocVersionROFstInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionROFstInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionROFstInfoList.cs deleted file mode 100644 index 913a1f55..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocVersionROFstInfoList.cs +++ /dev/null @@ -1,312 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// DocVersionROFstInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DocVersionROFstInfoListConverter))] - public partial class DocVersionROFstInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (DocVersionROFstInfo tmp in this) - { - tmp.Changed += new DocVersionROFstInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (DocVersionROFstInfo tmp in this) - { - tmp.Changed -= new DocVersionROFstInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static DocVersionROFstInfoList _DocVersionROFstInfoList = null; - /// - /// Return a list of all projects. - /// - public static DocVersionROFstInfoList Get() - { - try - { - if (_DocVersionROFstInfoList != null) - return _DocVersionROFstInfoList; - DocVersionROFstInfoList tmp = DataPortal.Fetch(); - DocVersionROFstInfo.AddList(tmp); - tmp.AddEvents(); - _DocVersionROFstInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersionROFstInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static DocVersionROFstInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on DocVersionROFstInfoList.Get", ex); - // } - //} - public static DocVersionROFstInfoList GetByVersionID(int versionID) - { - try - { - DocVersionROFstInfoList tmp = DataPortal.Fetch(new VersionIDCriteria(versionID)); - DocVersionROFstInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersionROFstInfoList.GetByVersionID", ex); - } - } - public static DocVersionROFstInfoList GetByROFstID(int rOFstID) - { - try - { - DocVersionROFstInfoList tmp = DataPortal.Fetch(new ROFstIDCriteria(rOFstID)); - DocVersionROFstInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocVersionROFstInfoList.GetByROFstID", ex); - } - } - private DocVersionROFstInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFstInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocVersionROFsts"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new DocVersionROFstInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFstInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("DocVersionROFstInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class VersionIDCriteria - { - public VersionIDCriteria(int versionID) - { - _VersionID = versionID; - } - private int _VersionID; - public int VersionID - { - get { return _VersionID; } - set { _VersionID = value; } - } - } - private void DataPortal_Fetch(VersionIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFstInfoList.DataPortal_FetchVersionID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocVersionROFstsByVersionID"; - cm.Parameters.AddWithValue("@VersionID", criteria.VersionID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new DocVersionROFstInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFstInfoList.DataPortal_FetchVersionID", ex); - throw new DbCslaException("DocVersionROFstInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ROFstIDCriteria - { - public ROFstIDCriteria(int rOFstID) - { - _ROFstID = rOFstID; - } - private int _ROFstID; - public int ROFstID - { - get { return _ROFstID; } - set { _ROFstID = value; } - } - } - private void DataPortal_Fetch(ROFstIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocVersionROFstInfoList.DataPortal_FetchROFstID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocVersionROFstsByROFstID"; - cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new DocVersionROFstInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocVersionROFstInfoList.DataPortal_FetchROFstID", ex); - throw new DbCslaException("DocVersionROFstInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - DocVersionROFstInfoListPropertyDescriptor pd = new DocVersionROFstInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class DocVersionROFstInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private DocVersionROFstInfo Item { get { return (DocVersionROFstInfo)_Item; } } - public DocVersionROFstInfoListPropertyDescriptor(DocVersionROFstInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class DocVersionROFstInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DocVersionROFstInfoList) - { - // Return department and department role separated by comma. - return ((DocVersionROFstInfoList)value).Items.Count.ToString() + " DocVersionROFsts"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Document.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Document.cs deleted file mode 100644 index cb398069..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Document.cs +++ /dev/null @@ -1,1108 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Document Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DocumentConverter))] - public partial class Document : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshDocuments = new List(); - private List _RefreshDocumentEntries = new List(); - private void AddToRefreshList(List refreshDocuments, List refreshDocumentEntries) - { - if (IsDirty) - refreshDocuments.Add(this); - if (_DocumentEntries != null && _DocumentEntries.IsDirty) - { - foreach (DocumentEntry tmp in _DocumentEntries) - { - if (tmp.IsDirty) refreshDocumentEntries.Add(tmp); - } - } - } - private void BuildRefreshList() - { - _RefreshDocuments = new List(); - _RefreshDocumentEntries = new List(); - AddToRefreshList(_RefreshDocuments, _RefreshDocumentEntries); - } - private void ProcessRefreshList() - { - foreach (Document tmp in _RefreshDocuments) - { - DocumentInfo.Refresh(tmp); - } - foreach (DocumentEntry tmp in _RefreshDocumentEntries) - { - EntryInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Document document) - { - if (!_CacheList.Contains(document)) _CacheList.Add(document); // In AddToCache - } - protected static void RemoveFromCache(Document document) - { - while (_CacheList.Contains(document)) _CacheList.Remove(document); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (Document tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.DocID.ToString())) - { - _CacheByPrimaryKey[tmp.DocID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.DocID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (Document tmp in remove) - RemoveFromCache(tmp); - } - protected static Document GetCachedByPrimaryKey(int docID) - { - ConvertListToDictionary(); - string key = docID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextDocID = -1; - public static int NextDocID - { - get { return _nextDocID--; } - } - private int _DocID; - [System.ComponentModel.DataObjectField(true, true)] - public int DocID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocID; - } - } - private string _LibTitle = string.Empty; - public string LibTitle - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _LibTitle; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_LibTitle != value) - { - _LibTitle = value; - PropertyHasChanged(); - } - } - } - private byte[] _DocContent; - /// - /// Actual content of a Word Document (RTF, DOC or XML Format) - /// - public byte[] DocContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocContent; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DocContent != value) - { - _DocContent = value; - PropertyHasChanged(); - } - } - } - private string _DocAscii = string.Empty; - /// - /// Used for searching - /// - public string DocAscii - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocAscii; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_DocAscii != value) - { - _DocAscii = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _DocumentEntryCount = 0; - /// - /// Count of DocumentEntries for this Document - /// - public int DocumentEntryCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocumentEntryCount; - } - } - private DocumentEntries _DocumentEntries = null; - /// - /// Related Field - /// - [TypeConverter(typeof(DocumentEntriesConverter))] - public DocumentEntries DocumentEntries - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_DocumentEntryCount > 0 && _DocumentEntries == null) - _DocumentEntries = DocumentEntries.GetByDocID(DocID); - else if (_DocumentEntries == null) - _DocumentEntries = DocumentEntries.New(); - return _DocumentEntries; - } - } - public override bool IsDirty - { - get { return base.IsDirty || (_DocumentEntries == null ? false : _DocumentEntries.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_DocumentEntries == null ? true : _DocumentEntries.IsValid); } - } - // TODO: Replace base Document.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Document - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check Document.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Document - protected override object GetIdValue() - { - return _DocID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_DocumentEntries != null && (hasBrokenRules = _DocumentEntries.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("LibTitle", 1024)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("DocAscii", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _DocumentExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _DocumentExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(DocID, ""); - //AuthorizationRules.AllowRead(LibTitle, ""); - //AuthorizationRules.AllowRead(DocContent, ""); - //AuthorizationRules.AllowRead(DocAscii, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(LibTitle, ""); - //AuthorizationRules.AllowWrite(DocContent, ""); - //AuthorizationRules.AllowWrite(DocAscii, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - _DocumentExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _DocumentExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - /// - /// determines if related records (Foreign Keys) will keep this Item from being deleted - /// - public bool CanDelete - { - get - { - // Check to make sure that there are not any related records - int usedByCount = 0; - usedByCount += _DocumentEntryCount; - return (usedByCount == 0); - } - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _DocumentUnique = 0; - protected static int DocumentUnique - { get { return ++_DocumentUnique; } } - private int _MyDocumentUnique = DocumentUnique; - public int MyDocumentUnique - { get { return _MyDocumentUnique; } } - protected Document() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(DocID.ToString())) - { - List listDocument = _CacheByPrimaryKey[DocID.ToString()]; // Get the list of items - while (listDocument.Contains(this)) listDocument.Remove(this); // Remove the item from the list - if (listDocument.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(DocID.ToString()); // remove the list - } - } - public static Document New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Document"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Document.New", ex); - } - } - public static Document New(string libTitle, byte[] docContent, string docAscii, string config, DateTime dts, string userID) - { - Document tmp = Document.New(); - tmp.LibTitle = libTitle; - tmp.DocContent = docContent; - tmp.DocAscii = docAscii; - tmp.Config = config; - tmp.DTS = dts; - tmp.UserID = userID; - return tmp; - } - public static Document MakeDocument(string libTitle, byte[] docContent, string docAscii, string config, DateTime dts, string userID) - { - Document tmp = Document.New(libTitle, docContent, docAscii, config, dts, userID); - if (tmp.IsSavable) - { - Document tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Document New(string libTitle, byte[] docContent, string docAscii, string config) - { - Document tmp = Document.New(); - tmp.LibTitle = libTitle; - tmp.DocContent = docContent; - tmp.DocAscii = docAscii; - tmp.Config = config; - return tmp; - } - public static Document MakeDocument(string libTitle, byte[] docContent, string docAscii, string config) - { - Document tmp = Document.New(libTitle, docContent, docAscii, config); - if (tmp.IsSavable) - { - Document tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Document Get(int docID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Document"); - try - { - Document tmp = GetCachedByPrimaryKey(docID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(docID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Document - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Document.Get", ex); - } - } - public static Document Get(SafeDataReader dr) - { - if (dr.Read()) return new Document(dr); - return null; - } - internal Document(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int docID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Document"); - try - { - DataPortal.Delete(new PKCriteria(docID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Document.Delete", ex); - } - } - public override Document Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Document"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Document"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Document"); - try - { - BuildRefreshList(); - Document document = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(document);//Refresh the item in AllList - ProcessRefreshList(); - return document; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _DocID; - public int DocID - { get { return _DocID; } } - public PKCriteria(int docID) - { - _DocID = docID; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _DocID = NextDocID; - // Database Defaults - _DTS = _DocumentExtension.DefaultDTS; - _UserID = _DocumentExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Document.ReadData", GetHashCode()); - try - { - _DocID = dr.GetInt32("DocID"); - _LibTitle = dr.GetString("LibTitle"); - _DocContent = (byte[])dr.GetValue("DocContent"); - _DocAscii = dr.GetString("DocAscii"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _DocumentEntryCount = dr.GetInt32("EntryCount"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Document.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Document.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Document.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocument"; - cm.Parameters.AddWithValue("@DocID", criteria.DocID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _DocumentEntries = DocumentEntries.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Document.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Document.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Document.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Document.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Document.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addDocument"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@LibTitle", _LibTitle); - cm.Parameters.AddWithValue("@DocContent", _DocContent); - cm.Parameters.AddWithValue("@DocAscii", _DocAscii); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - // Output Calculated Columns - SqlParameter param_DocID = new SqlParameter("@newDocID", SqlDbType.Int); - param_DocID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_DocID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _DocID = (int)cm.Parameters["@newDocID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_DocumentEntries != null) _DocumentEntries.Update(this); - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Document.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Document.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Document.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int docID, string libTitle, byte[] docContent, string docAscii, string config, DateTime dts, string userID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Document.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addDocument"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@LibTitle", libTitle); - cm.Parameters.AddWithValue("@DocContent", docContent); - cm.Parameters.AddWithValue("@DocAscii", docAscii); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - // Output Calculated Columns - SqlParameter param_DocID = new SqlParameter("@newDocID", SqlDbType.Int); - param_DocID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_DocID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - docID = (int)cm.Parameters["@newDocID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Document.Add", ex); - throw new DbCslaException("Document.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Document.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Document.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Document.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateDocument"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@DocID", _DocID); - cm.Parameters.AddWithValue("@LibTitle", _LibTitle); - cm.Parameters.AddWithValue("@DocContent", _DocContent); - cm.Parameters.AddWithValue("@DocAscii", _DocAscii); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - if (_DocumentEntries != null) _DocumentEntries.Update(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Document.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Document.Add(cn, ref _DocID, _LibTitle, _DocContent, _DocAscii, _Config, _DTS, _UserID); - else - _LastChanged = Document.Update(cn, ref _DocID, _LibTitle, _DocContent, _DocAscii, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - if (_DocumentEntries != null) _DocumentEntries.Update(this); - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int docID, string libTitle, byte[] docContent, string docAscii, string config, DateTime dts, string userID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Document.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateDocument"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@DocID", docID); - cm.Parameters.AddWithValue("@LibTitle", libTitle); - cm.Parameters.AddWithValue("@DocContent", docContent); - cm.Parameters.AddWithValue("@DocAscii", docAscii); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Document.Update", ex); - throw new DbCslaException("Document.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_DocID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Document.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteDocument"; - cm.Parameters.AddWithValue("@DocID", criteria.DocID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Document.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Document.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int docID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Document.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteDocument"; - // Input PK Fields - cm.Parameters.AddWithValue("@DocID", docID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Document.Remove", ex); - throw new DbCslaException("Document.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int docID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(docID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Document.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _DocID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int docID) - { - _DocID = docID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Document.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsDocument"; - cm.Parameters.AddWithValue("@DocID", _DocID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Document.DataPortal_Execute", ex); - throw new DbCslaException("Document.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - DocumentExtension _DocumentExtension = new DocumentExtension(); - [Serializable()] - partial class DocumentExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class DocumentConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Document) - { - // Return the ToString value - return ((Document)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create DocumentExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Document -// { -// partial class DocumentExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocumentEntries.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocumentEntries.cs deleted file mode 100644 index 4485f12d..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocumentEntries.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// DocumentEntries Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DocumentEntriesConverter))] - public partial class DocumentEntries : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public DocumentEntry this[Entry myEntry] - { - get - { - foreach (DocumentEntry entry in this) - if (entry.ContentID == myEntry.ContentID) - return entry; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public DocumentEntry GetItem(Entry myEntry) - { - foreach (DocumentEntry entry in this) - if (entry.ContentID == myEntry.ContentID) - return entry; - return null; - } - public DocumentEntry Add(Entry myEntry) // One to Many - { - DocumentEntry entry = DocumentEntry.New(myEntry); - this.Add(entry); - return entry; - } - public void Remove(Entry myEntry) - { - foreach (DocumentEntry entry in this) - { - if (entry.ContentID == myEntry.ContentID) - { - Remove(entry); - break; - } - } - } - public bool Contains(Entry myEntry) - { - foreach (DocumentEntry entry in this) - if (entry.ContentID == myEntry.ContentID) - return true; - return false; - } - public bool ContainsDeleted(Entry myEntry) - { - foreach (DocumentEntry entry in DeletedList) - if (entry.ContentID == myEntry.ContentID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (DocumentEntry documentEntry in this) - if ((hasBrokenRules = documentEntry.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static DocumentEntries New() - { - return new DocumentEntries(); - } - internal static DocumentEntries Get(SafeDataReader dr) - { - return new DocumentEntries(dr); - } - public static DocumentEntries GetByDocID(int docID) - { - try - { - return DataPortal.Fetch(new DocIDCriteria(docID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocumentEntries.GetByDocID", ex); - } - } - private DocumentEntries() - { - MarkAsChild(); - } - internal DocumentEntries(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(DocumentEntry.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class DocIDCriteria - { - public DocIDCriteria(int docID) - { - _DocID = docID; - } - private int _DocID; - public int DocID - { - get { return _DocID; } - set { _DocID = value; } - } - } - private void DataPortal_Fetch(DocIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentEntries.DataPortal_FetchDocID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getEntriesByDocID"; - cm.Parameters.AddWithValue("@DocID", criteria.DocID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new DocumentEntry(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentEntries.DataPortal_FetchDocID", ex); - throw new DbCslaException("DocumentEntries.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Document document) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (DocumentEntry obj in DeletedList) - obj.DeleteSelf(document);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (DocumentEntry obj in this) - { - if (obj.IsNew) - obj.Insert(document); - else - obj.Update(document); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - DocumentEntriesPropertyDescriptor pd = new DocumentEntriesPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class DocumentEntriesPropertyDescriptor : vlnListPropertyDescriptor - { - private DocumentEntry Item { get { return (DocumentEntry)_Item; } } - public DocumentEntriesPropertyDescriptor(DocumentEntries collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class DocumentEntriesConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DocumentEntries) - { - // Return department and department role separated by comma. - return ((DocumentEntries)value).Items.Count.ToString() + " Entries"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocumentEntry.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocumentEntry.cs deleted file mode 100644 index bc29e416..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocumentEntry.cs +++ /dev/null @@ -1,457 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// DocumentEntry Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DocumentEntryConverter))] - public partial class DocumentEntry : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _ContentID; - [System.ComponentModel.DataObjectField(true, true)] - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyEntry != null) _ContentID = _MyEntry.ContentID; - return _ContentID; - } - } - private Entry _MyEntry; - [System.ComponentModel.DataObjectField(true, true)] - public Entry MyEntry - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyEntry == null && _ContentID != 0) _MyEntry = Entry.Get(_ContentID); - return _MyEntry; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private string _Content_Number = string.Empty; - public string Content_Number - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Number; - } - } - private string _Content_Text = string.Empty; - public string Content_Text - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Text; - } - } - private int? _Content_Type; - /// - /// 0 - Procedure, 10000 - Section, 20000 Step - /// - public int? Content_Type - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Type; - } - } - private int? _Content_FormatID; - public int? Content_FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_FormatID; - } - } - private string _Content_Config = string.Empty; - public string Content_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Config; - } - } - private DateTime _Content_DTS = new DateTime(); - public DateTime Content_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_DTS; - } - } - private string _Content_UserID = string.Empty; - public string Content_UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_UserID; - } - } - // TODO: Check DocumentEntry.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current DocumentEntry - protected override object GetIdValue() - { - return _ContentID; - } - // TODO: Replace base DocumentEntry.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current DocumentEntry - //public override string ToString() - //{ - // return base.ToString(); - //} - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ContentID, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static DocumentEntry New(Entry myEntry) - { - return new DocumentEntry(myEntry); - } - internal static DocumentEntry Get(SafeDataReader dr) - { - return new DocumentEntry(dr); - } - public DocumentEntry() - { - MarkAsChild(); - - _DTS = _DocumentEntryExtension.DefaultDTS; - _UserID = _DocumentEntryExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private DocumentEntry(Entry myEntry) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _DTS = _DocumentEntryExtension.DefaultDTS; - _UserID = _DocumentEntryExtension.DefaultUserID; - _MyEntry = myEntry; - ValidationRules.CheckRules(); - } - internal DocumentEntry(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentEntry.FetchDR", GetHashCode()); - try - { - _ContentID = dr.GetInt32("ContentID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _Content_Number = dr.GetString("Content_Number"); - _Content_Text = dr.GetString("Content_Text"); - _Content_Type = (int?)dr.GetValue("Content_Type"); - _Content_FormatID = (int?)dr.GetValue("Content_FormatID"); - _Content_Config = dr.GetString("Content_Config"); - _Content_DTS = dr.GetDateTime("Content_DTS"); - _Content_UserID = dr.GetString("Content_UserID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentEntry.FetchDR", ex); - throw new DbCslaException("DocumentEntry.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Document myDocument) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Entry.Add(cn, _MyEntry.MyContent, myDocument, _DTS, _UserID); - MarkOld(); - } - internal void Update(Document myDocument) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Entry.Update(cn, _MyEntry.MyContent, myDocument, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Document myDocument) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Entry.Remove(cn, _ContentID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - DocumentEntryExtension _DocumentEntryExtension = new DocumentEntryExtension(); - [Serializable()] - partial class DocumentEntryExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class DocumentEntryConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DocumentEntry) - { - // Return the ToString value - return ((DocumentEntry)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create DocumentEntryExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class DocumentEntry -// { -// partial class DocumentEntryExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocumentInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocumentInfo.cs deleted file mode 100644 index df013431..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocumentInfo.cs +++ /dev/null @@ -1,392 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void DocumentInfoEvent(object sender); - /// - /// DocumentInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DocumentInfoConverter))] - public partial class DocumentInfo : ReadOnlyBase, IDisposable - { - public event DocumentInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(DocumentInfo documentInfo) - { - if (!_CacheList.Contains(documentInfo)) _CacheList.Add(documentInfo); // In AddToCache - } - protected static void RemoveFromCache(DocumentInfo documentInfo) - { - while (_CacheList.Contains(documentInfo)) _CacheList.Remove(documentInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (DocumentInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.DocID.ToString())) - { - _CacheByPrimaryKey[tmp.DocID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.DocID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (DocumentInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(DocumentInfoList lst) - { - foreach (DocumentInfo item in lst) AddToCache(item); - } - protected static DocumentInfo GetCachedByPrimaryKey(int docID) - { - ConvertListToDictionary(); - string key = docID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Document _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _DocID; - [System.ComponentModel.DataObjectField(true, true)] - public int DocID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocID; - } - } - private string _LibTitle = string.Empty; - public string LibTitle - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _LibTitle; - } - } - private byte[] _DocContent; - /// - /// Actual content of a Word Document (RTF, DOC or XML Format) - /// - public byte[] DocContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocContent; - } - } - private string _DocAscii = string.Empty; - /// - /// Used for searching - /// - public string DocAscii - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocAscii; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - private int _DocumentEntryCount = 0; - /// - /// Count of DocumentEntries for this Document - /// - public int DocumentEntryCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocumentEntryCount; - } - } - private EntryInfoList _DocumentEntries = null; - [TypeConverter(typeof(EntryInfoListConverter))] - public EntryInfoList DocumentEntries - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_DocumentEntryCount < 0 || (_DocumentEntryCount > 0 && _DocumentEntries == null)) - _DocumentEntries = EntryInfoList.GetByDocID(_DocID); - if (_DocumentEntryCount < 0) - _DocumentEntryCount = _DocumentEntries.Count; - return _DocumentEntries; - } - } - public void RefreshDocumentEntries() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_DocID.ToString())) - foreach (DocumentInfo tmp in _CacheByPrimaryKey[_DocID.ToString()]) - tmp._DocumentEntryCount = -1; // This will cause the data to be requeried - } - // TODO: Replace base DocumentInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current DocumentInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check DocumentInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current DocumentInfo - protected override object GetIdValue() - { - return _DocID; - } - #endregion - #region Factory Methods - private static int _DocumentInfoUnique = 0; - private static int DocumentInfoUnique - { get { return ++_DocumentInfoUnique; } } - private int _MyDocumentInfoUnique = DocumentInfoUnique; - public int MyDocumentInfoUnique - { get { return _MyDocumentInfoUnique; } } - protected DocumentInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(DocID.ToString())) return; - List listDocumentInfo = _CacheByPrimaryKey[DocID.ToString()]; // Get the list of items - while (listDocumentInfo.Contains(this)) listDocumentInfo.Remove(this); // Remove the item from the list - if (listDocumentInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(DocID.ToString()); // remove the list - } - public virtual Document Get() - { - return _Editable = Document.Get(_DocID); - } - public static void Refresh(Document tmp) - { - string key = tmp.DocID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (DocumentInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Document tmp) - { - _LibTitle = tmp.LibTitle; - _DocContent = tmp.DocContent; - _DocAscii = tmp.DocAscii; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _DocumentInfoExtension.Refresh(this); - OnChange();// raise an event - } - public static DocumentInfo Get(int docID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Document"); - try - { - DocumentInfo tmp = GetCachedByPrimaryKey(docID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(docID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up DocumentInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocumentInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal DocumentInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfo.Constructor", ex); - throw new DbCslaException("DocumentInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _DocID; - public int DocID - { get { return _DocID; } } - public PKCriteria(int docID) - { - _DocID = docID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfo.ReadData", GetHashCode()); - try - { - _DocID = dr.GetInt32("DocID"); - _LibTitle = dr.GetString("LibTitle"); - _DocContent = (byte[])dr.GetValue("DocContent"); - _DocAscii = dr.GetString("DocAscii"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _DocumentEntryCount = dr.GetInt32("EntryCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocumentInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocument"; - cm.Parameters.AddWithValue("@DocID", criteria.DocID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("DocumentInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - DocumentInfoExtension _DocumentInfoExtension = new DocumentInfoExtension(); - [Serializable()] - partial class DocumentInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(DocumentInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class DocumentInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DocumentInfo) - { - // Return the ToString value - return ((DocumentInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocumentInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocumentInfoList.cs deleted file mode 100644 index ff96c69d..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/DocumentInfoList.cs +++ /dev/null @@ -1,198 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// DocumentInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(DocumentInfoListConverter))] - public partial class DocumentInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (DocumentInfo tmp in this) - { - tmp.Changed += new DocumentInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (DocumentInfo tmp in this) - { - tmp.Changed -= new DocumentInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static DocumentInfoList _DocumentInfoList = null; - /// - /// Return a list of all projects. - /// - public static DocumentInfoList Get() - { - try - { - if (_DocumentInfoList != null) - return _DocumentInfoList; - DocumentInfoList tmp = DataPortal.Fetch(); - DocumentInfo.AddList(tmp); - tmp.AddEvents(); - _DocumentInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on DocumentInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static DocumentInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on DocumentInfoList.Get", ex); - // } - //} - private DocumentInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] DocumentInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocuments"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new DocumentInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("DocumentInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("DocumentInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - DocumentInfoListPropertyDescriptor pd = new DocumentInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class DocumentInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private DocumentInfo Item { get { return (DocumentInfo)_Item; } } - public DocumentInfoListPropertyDescriptor(DocumentInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class DocumentInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is DocumentInfoList) - { - // Return department and department role separated by comma. - return ((DocumentInfoList)value).Items.Count.ToString() + " Documents"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Entry.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Entry.cs deleted file mode 100644 index 38d96df3..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Entry.cs +++ /dev/null @@ -1,982 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Entry Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(EntryConverter))] - public partial class Entry : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshEntries = new List(); - private void AddToRefreshList(List refreshEntries) - { - if (IsDirty) - refreshEntries.Add(this); - } - private void BuildRefreshList() - { - _RefreshEntries = new List(); - AddToRefreshList(_RefreshEntries); - } - private void ProcessRefreshList() - { - foreach (Entry tmp in _RefreshEntries) - { - EntryInfo.Refresh(tmp); - if (tmp._MyDocument != null) DocumentInfo.Refresh(tmp._MyDocument); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Entry entry) - { - if (!_CacheList.Contains(entry)) _CacheList.Add(entry); // In AddToCache - } - protected static void RemoveFromCache(Entry entry) - { - while (_CacheList.Contains(entry)) _CacheList.Remove(entry); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (Entry tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ContentID.ToString())) - { - _CacheByPrimaryKey[tmp.ContentID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ContentID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (Entry tmp in remove) - RemoveFromCache(tmp); - } - protected static Entry GetCachedByPrimaryKey(int contentID) - { - ConvertListToDictionary(); - string key = contentID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _ContentID; - [System.ComponentModel.DataObjectField(true, true)] - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _ContentID = _MyContent.ContentID; - return _ContentID; - } - } - private Content _MyContent; - [System.ComponentModel.DataObjectField(true, true)] - public Content MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _ContentID != 0) _MyContent = Content.Get(_ContentID); - return _MyContent; - } - } - private int _DocID; - public int DocID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDocument != null) _DocID = _MyDocument.DocID; - return _DocID; - } - } - private Document _MyDocument; - public Document MyDocument - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDocument == null && _DocID != 0) _MyDocument = Document.Get(_DocID); - return _MyDocument; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyDocument != value) - { - _MyDocument = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - public override bool IsDirty - { - get { return base.IsDirty || (_MyDocument == null ? false : _MyDocument.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyDocument == null ? true : _MyDocument.IsValid); } - } - // TODO: Replace base Entry.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Entry - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check Entry.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Entry - protected override object GetIdValue() - { - return _ContentID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyDocument != null && (hasBrokenRules = _MyDocument.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyDocumentRequired, "MyDocument"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _EntryExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _EntryExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - private static bool MyDocumentRequired(Entry target, Csla.Validation.RuleArgs e) - { - if (target._DocID == 0 && target._MyDocument == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ContentID, ""); - //AuthorizationRules.AllowRead(DocID, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(DocID, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - _EntryExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _EntryExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _EntryUnique = 0; - protected static int EntryUnique - { get { return ++_EntryUnique; } } - private int _MyEntryUnique = EntryUnique; - public int MyEntryUnique - { get { return _MyEntryUnique; } } - protected Entry() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(ContentID.ToString())) - { - List listEntry = _CacheByPrimaryKey[ContentID.ToString()]; // Get the list of items - while (listEntry.Contains(this)) listEntry.Remove(this); // Remove the item from the list - if (listEntry.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(ContentID.ToString()); // remove the list - } - } - public static Entry New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Entry"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Entry.New", ex); - } - } - public static Entry New(Content myContent, Document myDocument) - { - Entry tmp = Entry.New(); - tmp._MyContent = myContent; - tmp.MyDocument = myDocument; - return tmp; - } - public static Entry MakeEntry(Content myContent, Document myDocument) - { - Entry tmp = Entry.New(myContent, myDocument); - if (tmp.IsSavable) - { - Entry tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Entry New(Content myContent, Document myDocument, DateTime dts, string userID) - { - Entry tmp = Entry.New(); - tmp._MyContent = myContent; - tmp.MyDocument = myDocument; - tmp.DTS = dts; - tmp.UserID = userID; - return tmp; - } - public static Entry MakeEntry(Content myContent, Document myDocument, DateTime dts, string userID) - { - Entry tmp = Entry.New(myContent, myDocument, dts, userID); - if (tmp.IsSavable) - { - Entry tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Entry New(Content myContent) - { - Entry tmp = Entry.New(); - tmp._MyContent = myContent; - tmp.MarkClean(); - tmp.MarkAsChild(); - return tmp; - } - public static Entry Get(int contentID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Entry"); - try - { - Entry tmp = GetCachedByPrimaryKey(contentID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(contentID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Entry - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Entry.Get", ex); - } - } - public static Entry Get(SafeDataReader dr) - { - if (dr.Read()) return new Entry(dr); - return null; - } - internal Entry(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int contentID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Entry"); - try - { - DataPortal.Delete(new PKCriteria(contentID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Entry.Delete", ex); - } - } - public override Entry Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Entry"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Entry"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Entry"); - try - { - BuildRefreshList(); - Entry entry = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(entry);//Refresh the item in AllList - ProcessRefreshList(); - return entry; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _ContentID; - public int ContentID - { get { return _ContentID; } } - public PKCriteria(int contentID) - { - _ContentID = contentID; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - - // Database Defaults - _DTS = _EntryExtension.DefaultDTS; - _UserID = _EntryExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Entry.ReadData", GetHashCode()); - try - { - _ContentID = dr.GetInt32("ContentID"); - _DocID = dr.GetInt32("DocID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Entry.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Entry.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Entry.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getEntry"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Entry.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Entry.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Entry.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Entry.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Entry.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyDocument != null) _MyDocument.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addEntry"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", ContentID); - cm.Parameters.AddWithValue("@DocID", DocID); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Entry.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Entry.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Entry.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, Content myContent, Document myDocument, DateTime dts, string userID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Entry.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addEntry"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", myContent.ContentID); - cm.Parameters.AddWithValue("@DocID", myDocument.DocID); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Entry.Add", ex); - throw new DbCslaException("Entry.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Entry.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Entry.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Entry.SQLUpdate", GetHashCode()); - try - { - if (_MyDocument != null) _MyDocument.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateEntry"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@ContentID", ContentID); - cm.Parameters.AddWithValue("@DocID", DocID); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Entry.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update(Content content) - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Entry.Add(cn, content, MyDocument, _DTS, _UserID); - else - _LastChanged = Entry.Update(cn, content, MyDocument, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, Content myContent, Document myDocument, DateTime dts, string userID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Entry.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateEntry"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", myContent.ContentID); - cm.Parameters.AddWithValue("@DocID", myDocument.DocID); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Entry.Update", ex); - throw new DbCslaException("Entry.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_ContentID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Entry.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteEntry"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Entry.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Entry.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int contentID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Entry.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteEntry"; - // Input PK Fields - cm.Parameters.AddWithValue("@ContentID", contentID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Entry.Remove", ex); - throw new DbCslaException("Entry.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int contentID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(contentID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Entry.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _ContentID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int contentID) - { - _ContentID = contentID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Entry.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsEntry"; - cm.Parameters.AddWithValue("@ContentID", _ContentID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Entry.DataPortal_Execute", ex); - throw new DbCslaException("Entry.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - EntryExtension _EntryExtension = new EntryExtension(); - [Serializable()] - partial class EntryExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class EntryConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Entry) - { - // Return the ToString value - return ((Entry)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create EntryExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Entry -// { -// partial class EntryExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/EntryInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/EntryInfo.cs deleted file mode 100644 index f8886485..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/EntryInfo.cs +++ /dev/null @@ -1,383 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void EntryInfoEvent(object sender); - /// - /// EntryInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(EntryInfoConverter))] - public partial class EntryInfo : ReadOnlyBase, IDisposable - { - public event EntryInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(EntryInfo entryInfo) - { - if (!_CacheList.Contains(entryInfo)) _CacheList.Add(entryInfo); // In AddToCache - } - protected static void RemoveFromCache(EntryInfo entryInfo) - { - while (_CacheList.Contains(entryInfo)) _CacheList.Remove(entryInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (EntryInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ContentID.ToString())) - { - _CacheByPrimaryKey[tmp.ContentID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ContentID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (EntryInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(EntryInfoList lst) - { - foreach (EntryInfo item in lst) AddToCache(item); - } - protected static EntryInfo GetCachedByPrimaryKey(int contentID) - { - ConvertListToDictionary(); - string key = contentID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Entry _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _ContentID; - [System.ComponentModel.DataObjectField(true, true)] - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _ContentID = _MyContent.ContentID; - return _ContentID; - } - } - private ContentInfo _MyContent; - [System.ComponentModel.DataObjectField(true, true)] - public ContentInfo MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _ContentID != 0) _MyContent = ContentInfo.Get(_ContentID); - return _MyContent; - } - } - private int _DocID; - public int DocID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDocument != null) _DocID = _MyDocument.DocID; - return _DocID; - } - } - private DocumentInfo _MyDocument; - public DocumentInfo MyDocument - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDocument == null && _DocID != 0) _MyDocument = DocumentInfo.Get(_DocID); - return _MyDocument; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - // TODO: Replace base EntryInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current EntryInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check EntryInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current EntryInfo - protected override object GetIdValue() - { - return _ContentID; - } - #endregion - #region Factory Methods - private static int _EntryInfoUnique = 0; - private static int EntryInfoUnique - { get { return ++_EntryInfoUnique; } } - private int _MyEntryInfoUnique = EntryInfoUnique; - public int MyEntryInfoUnique - { get { return _MyEntryInfoUnique; } } - protected EntryInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(ContentID.ToString())) return; - List listEntryInfo = _CacheByPrimaryKey[ContentID.ToString()]; // Get the list of items - while (listEntryInfo.Contains(this)) listEntryInfo.Remove(this); // Remove the item from the list - if (listEntryInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(ContentID.ToString()); // remove the list - } - public virtual Entry Get() - { - return _Editable = Entry.Get(_ContentID); - } - public static void Refresh(Entry tmp) - { - string key = tmp.ContentID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (EntryInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Entry tmp) - { - if (_DocID != tmp.DocID) - { - if (MyDocument != null) MyDocument.RefreshDocumentEntries(); // Update List for old value - _DocID = tmp.DocID; // Update the value - } - _MyDocument = null; // Reset list so that the next line gets a new list - if (MyDocument != null) MyDocument.RefreshDocumentEntries(); // Update List for new value - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _EntryInfoExtension.Refresh(this); - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - if (_MyDocument != null) - { - _MyDocument.Dispose();// Dispose related value - _MyDocument = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(DocumentEntry tmp) - { - string key = tmp.ContentID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (EntryInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(DocumentEntry tmp) - { - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _EntryInfoExtension.Refresh(this); - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - if (_MyDocument != null) - { - _MyDocument.Dispose();// Dispose related value - _MyDocument = null;// Reset related value - } - OnChange();// raise an event - } - public static EntryInfo Get(int contentID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Entry"); - try - { - EntryInfo tmp = GetCachedByPrimaryKey(contentID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(contentID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up EntryInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on EntryInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal EntryInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfo.Constructor", ex); - throw new DbCslaException("EntryInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _ContentID; - public int ContentID - { get { return _ContentID; } } - public PKCriteria(int contentID) - { - _ContentID = contentID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfo.ReadData", GetHashCode()); - try - { - _ContentID = dr.GetInt32("ContentID"); - _DocID = dr.GetInt32("DocID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("EntryInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getEntry"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("EntryInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - EntryInfoExtension _EntryInfoExtension = new EntryInfoExtension(); - [Serializable()] - partial class EntryInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(EntryInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class EntryInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is EntryInfo) - { - // Return the ToString value - return ((EntryInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/EntryInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/EntryInfoList.cs deleted file mode 100644 index 4825d65b..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/EntryInfoList.cs +++ /dev/null @@ -1,312 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// EntryInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(EntryInfoListConverter))] - public partial class EntryInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (EntryInfo tmp in this) - { - tmp.Changed += new EntryInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (EntryInfo tmp in this) - { - tmp.Changed -= new EntryInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static EntryInfoList _EntryInfoList = null; - /// - /// Return a list of all projects. - /// - public static EntryInfoList Get() - { - try - { - if (_EntryInfoList != null) - return _EntryInfoList; - EntryInfoList tmp = DataPortal.Fetch(); - EntryInfo.AddList(tmp); - tmp.AddEvents(); - _EntryInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on EntryInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static EntryInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on EntryInfoList.Get", ex); - // } - //} - public static EntryInfoList GetByContentID(int contentID) - { - try - { - EntryInfoList tmp = DataPortal.Fetch(new ContentIDCriteria(contentID)); - EntryInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on EntryInfoList.GetByContentID", ex); - } - } - public static EntryInfoList GetByDocID(int docID) - { - try - { - EntryInfoList tmp = DataPortal.Fetch(new DocIDCriteria(docID)); - EntryInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on EntryInfoList.GetByDocID", ex); - } - } - private EntryInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getEntries"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new EntryInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("EntryInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ContentIDCriteria - { - public ContentIDCriteria(int contentID) - { - _ContentID = contentID; - } - private int _ContentID; - public int ContentID - { - get { return _ContentID; } - set { _ContentID = value; } - } - } - private void DataPortal_Fetch(ContentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfoList.DataPortal_FetchContentID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getEntriesByContentID"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new EntryInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfoList.DataPortal_FetchContentID", ex); - throw new DbCslaException("EntryInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class DocIDCriteria - { - public DocIDCriteria(int docID) - { - _DocID = docID; - } - private int _DocID; - public int DocID - { - get { return _DocID; } - set { _DocID = value; } - } - } - private void DataPortal_Fetch(DocIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] EntryInfoList.DataPortal_FetchDocID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getEntriesByDocID"; - cm.Parameters.AddWithValue("@DocID", criteria.DocID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new EntryInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("EntryInfoList.DataPortal_FetchDocID", ex); - throw new DbCslaException("EntryInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - EntryInfoListPropertyDescriptor pd = new EntryInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class EntryInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private EntryInfo Item { get { return (EntryInfo)_Item; } } - public EntryInfoListPropertyDescriptor(EntryInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class EntryInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is EntryInfoList) - { - // Return department and department role separated by comma. - return ((EntryInfoList)value).Items.Count.ToString() + " Entries"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Folder.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Folder.cs deleted file mode 100644 index fbf54664..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Folder.cs +++ /dev/null @@ -1,1506 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Folder Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FolderConverter))] - public partial class Folder : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshFolders = new List(); - private List _RefreshFolderAssignments = new List(); - private List _RefreshFolderDocVersions = new List(); - private void AddToRefreshList(List refreshFolders, List refreshFolderAssignments, List refreshFolderDocVersions) - { - if (IsDirty) - refreshFolders.Add(this); - if (_FolderAssignments != null && _FolderAssignments.IsDirty) - { - foreach (FolderAssignment tmp in _FolderAssignments) - { - if (tmp.IsDirty) refreshFolderAssignments.Add(tmp); - } - } - if (_FolderDocVersions != null && _FolderDocVersions.IsDirty) - { - foreach (FolderDocVersion tmp in _FolderDocVersions) - { - if (tmp.IsDirty) refreshFolderDocVersions.Add(tmp); - } - } - if (_ChildFolders != null && _ChildFolders.IsDirty) - { - foreach (Folder tmp in _ChildFolders) - { - tmp.AddToRefreshList(refreshFolders, refreshFolderAssignments, refreshFolderDocVersions); - } - } - } - private void BuildRefreshList() - { - _RefreshFolders = new List(); - _RefreshFolderAssignments = new List(); - _RefreshFolderDocVersions = new List(); - AddToRefreshList(_RefreshFolders, _RefreshFolderAssignments, _RefreshFolderDocVersions); - } - private void ProcessRefreshList() - { - foreach (Folder tmp in _RefreshFolders) - { - FolderInfo.Refresh(tmp); - if (tmp._MyConnection != null) ConnectionInfo.Refresh(tmp._MyConnection); - if (tmp._MyFormat != null) FormatInfo.Refresh(tmp._MyFormat); - } - foreach (FolderAssignment tmp in _RefreshFolderAssignments) - { - AssignmentInfo.Refresh(tmp); - } - foreach (FolderDocVersion tmp in _RefreshFolderDocVersions) - { - DocVersionInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Folder folder) - { - if (!_CacheList.Contains(folder)) _CacheList.Add(folder); // In AddToCache - } - protected static void RemoveFromCache(Folder folder) - { - while (_CacheList.Contains(folder)) _CacheList.Remove(folder); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static Dictionary> _CacheByParentID_Name = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (Folder tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.FolderID.ToString())) - { - _CacheByPrimaryKey[tmp.FolderID.ToString()] = new List(); // Add new list for PrimaryKey - _CacheByParentID_Name[tmp.ParentID.ToString() + "_" + tmp.Name.ToString()] = new List(); // Add new list for ParentID_Name - } - _CacheByPrimaryKey[tmp.FolderID.ToString()].Add(tmp); // Add to Primary Key list - _CacheByParentID_Name[tmp.ParentID.ToString() + "_" + tmp.Name.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); - } - foreach (Folder tmp in remove) - RemoveFromCache(tmp); - } - protected static Folder GetCachedByPrimaryKey(int folderID) - { - ConvertListToDictionary(); - string key = folderID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - protected static Folder GetCachedByParentID_Name(int parentID, string name) - { - ConvertListToDictionary(); - string key = parentID.ToString() + "_" + name.ToString(); - if (_CacheByParentID_Name.ContainsKey(key)) return _CacheByParentID_Name[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextFolderID = -1; - public static int NextFolderID - { - get { return _nextFolderID--; } - } - private int _FolderID; - [System.ComponentModel.DataObjectField(true, true)] - public int FolderID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FolderID; - } - } - private int _ParentID; - public int ParentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyParent != null) _ParentID = _MyParent.FolderID; - return _ParentID; - } - } - private Folder _MyParent; - public Folder MyParent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyParent == null && _ParentID != _FolderID) _MyParent = Folder.Get(_ParentID); - return _MyParent; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyParent != value) - { - _MyParent = value; - PropertyHasChanged(); - } - } - } - private int _DBID; - public int DBID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyConnection != null) _DBID = _MyConnection.DBID; - return _DBID; - } - } - private Connection _MyConnection; - public Connection MyConnection - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyConnection == null && _DBID != 0) _MyConnection = Connection.Get(_DBID); - return _MyConnection; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyConnection != value) - { - _MyConnection = value; - PropertyHasChanged(); - } - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Name != value) - { - _Name = value; - PropertyHasChanged(); - } - } - } - private string _Title = string.Empty; - public string Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Title; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Title != value) - { - _Title = value; - PropertyHasChanged(); - } - } - } - private string _ShortName = string.Empty; - public string ShortName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ShortName; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_ShortName != value) - { - _ShortName = value; - PropertyHasChanged(); - } - } - } - private int? _FormatID; - public int? FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat != null) _FormatID = _MyFormat.FormatID; - return _FormatID; - } - } - private Format _MyFormat; - public Format MyFormat - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat == null && _FormatID != null) _MyFormat = Format.Get((int)_FormatID); - return _MyFormat; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if ((_MyFormat == null ? _FormatID : (int?)_MyFormat.FormatID) != (value == null ? null : (int?)value.FormatID)) - { - _MyFormat = value; - _FormatID = (value == null ? null : (int?)value.FormatID); - PropertyHasChanged(); - } - } - } - private double? _ManualOrder; - public double? ManualOrder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ManualOrder; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_ManualOrder != value) - { - _ManualOrder = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UsrID != value) - { - _UsrID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _FolderAssignmentCount = 0; - /// - /// Count of FolderAssignments for this Folder - /// - public int FolderAssignmentCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FolderAssignmentCount; - } - } - private FolderAssignments _FolderAssignments = null; - /// - /// Related Field - /// - [TypeConverter(typeof(FolderAssignmentsConverter))] - public FolderAssignments FolderAssignments - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_FolderAssignmentCount > 0 && _FolderAssignments == null) - _FolderAssignments = FolderAssignments.GetByFolderID(FolderID); - else if (_FolderAssignments == null) - _FolderAssignments = FolderAssignments.New(); - return _FolderAssignments; - } - } - private int _FolderDocVersionCount = 0; - /// - /// Count of FolderDocVersions for this Folder - /// - public int FolderDocVersionCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FolderDocVersionCount; - } - } - private FolderDocVersions _FolderDocVersions = null; - /// - /// Related Field - /// - [TypeConverter(typeof(FolderDocVersionsConverter))] - public FolderDocVersions FolderDocVersions - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_FolderDocVersionCount > 0 && _FolderDocVersions == null) - _FolderDocVersions = FolderDocVersions.GetByFolderID(FolderID); - else if (_FolderDocVersions == null) - _FolderDocVersions = FolderDocVersions.New(); - return _FolderDocVersions; - } - } - private int _ChildFolderCount = 0; - /// - /// Count of ChildFolders for this Folder - /// - public int ChildFolderCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ChildFolderCount; - } - } - private ChildFolders _ChildFolders = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ChildFoldersConverter))] - public ChildFolders ChildFolders - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ChildFolderCount > 0 && _ChildFolders == null) - _ChildFolders = ChildFolders.GetByParentID(FolderID); - else if (_ChildFolders == null) - _ChildFolders = ChildFolders.New(); - return _ChildFolders; - } - } - public override bool IsDirty - { - get { return base.IsDirty || (_FolderAssignments == null ? false : _FolderAssignments.IsDirty) || (_FolderDocVersions == null ? false : _FolderDocVersions.IsDirty) || (_ChildFolders == null ? false : _ChildFolders.IsDirty) || (_MyConnection == null ? false : _MyConnection.IsDirty) || (_MyFormat == null ? false : _MyFormat.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_FolderAssignments == null ? true : _FolderAssignments.IsValid) && (_FolderDocVersions == null ? true : _FolderDocVersions.IsValid) && (_ChildFolders == null ? true : _ChildFolders.IsValid) && (_MyConnection == null ? true : _MyConnection.IsValid) && (_MyFormat == null ? true : _MyFormat.IsValid); } - } - // TODO: Replace base Folder.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Folder - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check Folder.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Folder - protected override object GetIdValue() - { - return _FolderID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_FolderAssignments != null && (hasBrokenRules = _FolderAssignments.HasBrokenRules) != null) return hasBrokenRules; - if (_FolderDocVersions != null && (hasBrokenRules = _FolderDocVersions.HasBrokenRules) != null) return hasBrokenRules; - if (_ChildFolders != null && (hasBrokenRules = _ChildFolders.HasBrokenRules) != null) return hasBrokenRules; - if (_MyConnection != null && (hasBrokenRules = _MyConnection.HasBrokenRules) != null) return hasBrokenRules; - if (_MyFormat != null && (hasBrokenRules = _MyFormat.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyConnectionRequired, "MyConnection"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "Name"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Title", 510)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "ShortName"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("ShortName", 20)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UsrID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UsrID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _FolderExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _FolderExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - private static bool MyConnectionRequired(Folder target, Csla.Validation.RuleArgs e) - { - if (target._DBID == 0 && target._MyConnection == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(FolderID, ""); - //AuthorizationRules.AllowRead(ParentID, ""); - //AuthorizationRules.AllowRead(DBID, ""); - //AuthorizationRules.AllowRead(Name, ""); - //AuthorizationRules.AllowRead(Title, ""); - //AuthorizationRules.AllowRead(ShortName, ""); - //AuthorizationRules.AllowRead(FormatID, ""); - //AuthorizationRules.AllowRead(ManualOrder, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UsrID, ""); - //AuthorizationRules.AllowWrite(ParentID, ""); - //AuthorizationRules.AllowWrite(DBID, ""); - //AuthorizationRules.AllowWrite(Name, ""); - //AuthorizationRules.AllowWrite(Title, ""); - //AuthorizationRules.AllowWrite(ShortName, ""); - //AuthorizationRules.AllowWrite(FormatID, ""); - //AuthorizationRules.AllowWrite(ManualOrder, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UsrID, ""); - _FolderExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _FolderExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - /// - /// determines if related records (Foreign Keys) will keep this Item from being deleted - /// - public bool CanDelete - { - get - { - // Check to make sure that there are not any related records - int usedByCount = 0; - usedByCount += _FolderAssignmentCount; - usedByCount += _FolderDocVersionCount; - usedByCount += _ChildFolderCount; - return (usedByCount == 0); - } - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _FolderUnique = 0; - protected static int FolderUnique - { get { return ++_FolderUnique; } } - private int _MyFolderUnique = FolderUnique; - public int MyFolderUnique - { get { return _MyFolderUnique; } } - protected Folder() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(FolderID.ToString())) - { - List listFolder = _CacheByPrimaryKey[FolderID.ToString()]; // Get the list of items - while (listFolder.Contains(this)) listFolder.Remove(this); // Remove the item from the list - if (listFolder.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(FolderID.ToString()); // remove the list - } - string myKey; - myKey = null; - foreach (string key in _CacheByParentID_Name.Keys) - if (_CacheByParentID_Name[key].Contains(this)) - myKey = key; - if (myKey != null) - { - List listFolder = _CacheByParentID_Name[myKey]; // Get the list of items - listFolder.Remove(this); // Remove the item from the list - if (listFolder.Count == 0) //If there are no items left in the list - _CacheByParentID_Name.Remove(myKey); // remove the list - } - } - public static Folder New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Folder"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Folder.New", ex); - } - } - public static Folder New(Folder myParent, string name, string shortName) - { - Folder tmp = Folder.New(); - tmp.MyParent = myParent; - tmp.Name = name; - tmp.ShortName = shortName; - return tmp; - } - public static Folder New(Folder myParent, Connection myConnection, string name, string title, string shortName, Format myFormat, double? manualOrder, string config, DateTime dts, string usrID) - { - Folder tmp = Folder.New(); - tmp.MyParent = myParent; - tmp.MyConnection = myConnection; - tmp.Name = name; - tmp.Title = title; - tmp.ShortName = shortName; - tmp.MyFormat = myFormat; - tmp.ManualOrder = manualOrder; - tmp.Config = config; - tmp.DTS = dts; - tmp.UsrID = usrID; - return tmp; - } - public static Folder MakeFolder(Folder myParent, Connection myConnection, string name, string title, string shortName, Format myFormat, double? manualOrder, string config, DateTime dts, string usrID) - { - Folder tmp = Folder.New(myParent, myConnection, name, title, shortName, myFormat, manualOrder, config, dts, usrID); - if (tmp.IsSavable) - { - Folder tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Folder New(Folder myParent, Connection myConnection, string name, string title, string shortName, Format myFormat, double? manualOrder, string config) - { - Folder tmp = Folder.New(); - tmp.MyParent = myParent; - tmp.MyConnection = myConnection; - tmp.Name = name; - tmp.Title = title; - tmp.ShortName = shortName; - tmp.MyFormat = myFormat; - tmp.ManualOrder = manualOrder; - tmp.Config = config; - return tmp; - } - public static Folder MakeFolder(Folder myParent, Connection myConnection, string name, string title, string shortName, Format myFormat, double? manualOrder, string config) - { - Folder tmp = Folder.New(myParent, myConnection, name, title, shortName, myFormat, manualOrder, config); - if (tmp.IsSavable) - { - Folder tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Folder Get(int folderID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Folder"); - try - { - Folder tmp = GetCachedByPrimaryKey(folderID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(folderID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Folder - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Folder.Get", ex); - } - } - public static Folder GetByParentID_Name(int parentID, string name) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Folder"); - try - { - Folder tmp = GetCachedByParentID_Name(parentID, name); - if (tmp == null) - { - tmp = DataPortal.Fetch(new ParentID_NameCriteria(parentID, name)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Folder - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Folder.GetByParentID_Name", ex); - } - } - public static Folder Get(SafeDataReader dr, Folder parent) - { - if (dr.Read()) return new Folder(dr, parent); - return null; - } - internal Folder(SafeDataReader dr) - { - ReadData(dr); - } - private Folder(SafeDataReader dr, Folder parent) - { - ReadData(dr); - MarkAsChild(); - } - internal Folder(SafeDataReader dr, int parentID) - { - ReadData(dr); - MarkAsChild(); - } - public static void Delete(int folderID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Folder"); - try - { - DataPortal.Delete(new PKCriteria(folderID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Folder.Delete", ex); - } - } - public override Folder Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Folder"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Folder"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Folder"); - try - { - BuildRefreshList(); - Folder folder = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(folder);//Refresh the item in AllList - ProcessRefreshList(); - return folder; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _FolderID; - public int FolderID - { get { return _FolderID; } } - public PKCriteria(int folderID) - { - _FolderID = folderID; - } - } - [Serializable()] - private class ParentID_NameCriteria - { - private int _ParentID; - public int ParentID - { get { return _ParentID; } } - private string _Name; - public string Name - { get { return _Name; } } - public ParentID_NameCriteria(int parentID, string name) - { - _ParentID = parentID; - _Name = name; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _FolderID = NextFolderID; - // Database Defaults - _ParentID = _FolderExtension.DefaultParentID; - _DBID = _FolderExtension.DefaultDBID; - _DTS = _FolderExtension.DefaultDTS; - _UsrID = _FolderExtension.DefaultUsrID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Folder.ReadData", GetHashCode()); - try - { - _FolderID = dr.GetInt32("FolderID"); - _ParentID = dr.GetInt32("ParentID"); - _DBID = dr.GetInt32("DBID"); - _Name = dr.GetString("Name"); - _Title = dr.GetString("Title"); - _ShortName = dr.GetString("ShortName"); - _FormatID = (int?)dr.GetValue("FormatID"); - _ManualOrder = (double?)dr.GetValue("ManualOrder"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _FolderAssignmentCount = dr.GetInt32("AssignmentCount"); - _FolderDocVersionCount = dr.GetInt32("DocVersionCount"); - _ChildFolderCount = dr.GetInt32("ChildCount"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Folder.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Folder.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Folder.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFolder"; - cm.Parameters.AddWithValue("@FolderID", criteria.FolderID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _FolderAssignments = FolderAssignments.Get(dr); - // load child objects - dr.NextResult(); - _FolderDocVersions = FolderDocVersions.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Folder.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Folder.DataPortal_Fetch", ex); - } - } - private void DataPortal_Fetch(ParentID_NameCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Folder.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFolderByParentID_Name"; - cm.Parameters.AddWithValue("@ParentID", criteria.ParentID); - cm.Parameters.AddWithValue("@Name", criteria.Name); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Folder.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Folder.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Folder.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Folder.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Folder.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyConnection != null) _MyConnection.Update(); - if (_MyFormat != null) _MyFormat.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addFolder"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ParentID", ParentID); - cm.Parameters.AddWithValue("@DBID", DBID); - cm.Parameters.AddWithValue("@Name", _Name); - cm.Parameters.AddWithValue("@Title", _Title); - cm.Parameters.AddWithValue("@ShortName", _ShortName); - cm.Parameters.AddWithValue("@FormatID", FormatID); - cm.Parameters.AddWithValue("@ManualOrder", _ManualOrder); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UsrID", _UsrID); - // Output Calculated Columns - SqlParameter param_FolderID = new SqlParameter("@newFolderID", SqlDbType.Int); - param_FolderID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_FolderID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _FolderID = (int)cm.Parameters["@newFolderID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_FolderAssignments != null) _FolderAssignments.Update(this); - if (_FolderDocVersions != null) _FolderDocVersions.Update(this); - if (_ChildFolders != null) _ChildFolders.Update(this); - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Folder.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Folder.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Folder.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int folderID, Folder myParent, Connection myConnection, string name, string title, string shortName, Format myFormat, double? manualOrder, string config, DateTime dts, string usrID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Folder.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addFolder"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ParentID", myParent.FolderID); - cm.Parameters.AddWithValue("@DBID", myConnection.DBID); - cm.Parameters.AddWithValue("@Name", name); - cm.Parameters.AddWithValue("@Title", title); - cm.Parameters.AddWithValue("@ShortName", shortName); - if (myFormat != null) cm.Parameters.AddWithValue("@FormatID", myFormat.FormatID); - cm.Parameters.AddWithValue("@ManualOrder", manualOrder); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UsrID", usrID); - // Output Calculated Columns - SqlParameter param_FolderID = new SqlParameter("@newFolderID", SqlDbType.Int); - param_FolderID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_FolderID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - folderID = (int)cm.Parameters["@newFolderID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Folder.Add", ex); - throw new DbCslaException("Folder.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Folder.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Folder.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Folder.SQLUpdate", GetHashCode()); - try - { - if (_MyConnection != null) _MyConnection.Update(); - if (_MyFormat != null) _MyFormat.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateFolder"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@FolderID", _FolderID); - cm.Parameters.AddWithValue("@ParentID", ParentID); - cm.Parameters.AddWithValue("@DBID", DBID); - cm.Parameters.AddWithValue("@Name", _Name); - cm.Parameters.AddWithValue("@Title", _Title); - cm.Parameters.AddWithValue("@ShortName", _ShortName); - cm.Parameters.AddWithValue("@FormatID", FormatID); - cm.Parameters.AddWithValue("@ManualOrder", _ManualOrder); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UsrID", _UsrID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - if (_FolderAssignments != null) _FolderAssignments.Update(this); - if (_FolderDocVersions != null) _FolderDocVersions.Update(this); - if (_ChildFolders != null) _ChildFolders.Update(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Folder.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Folder.Add(cn, ref _FolderID, _MyParent, _MyConnection, _Name, _Title, _ShortName, _MyFormat, _ManualOrder, _Config, _DTS, _UsrID); - else - _LastChanged = Folder.Update(cn, ref _FolderID, _MyParent, _MyConnection, _Name, _Title, _ShortName, _MyFormat, _ManualOrder, _Config, _DTS, _UsrID, ref _LastChanged); - MarkOld(); - } - if (_FolderAssignments != null) _FolderAssignments.Update(this); - if (_FolderDocVersions != null) _FolderDocVersions.Update(this); - if (_ChildFolders != null) _ChildFolders.Update(this); - } - internal void DeleteSelf(Folder folder) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Folder.Remove(cn, _FolderID); - MarkNew(); - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int folderID, Folder myParent, Connection myConnection, string name, string title, string shortName, Format myFormat, double? manualOrder, string config, DateTime dts, string usrID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Folder.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateFolder"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@FolderID", folderID); - cm.Parameters.AddWithValue("@ParentID", myParent.FolderID); - cm.Parameters.AddWithValue("@DBID", myConnection.DBID); - cm.Parameters.AddWithValue("@Name", name); - cm.Parameters.AddWithValue("@Title", title); - cm.Parameters.AddWithValue("@ShortName", shortName); - if (myFormat != null) cm.Parameters.AddWithValue("@FormatID", myFormat.FormatID); - cm.Parameters.AddWithValue("@ManualOrder", manualOrder); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UsrID", usrID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Folder.Update", ex); - throw new DbCslaException("Folder.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_FolderID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Folder.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteFolder"; - cm.Parameters.AddWithValue("@FolderID", criteria.FolderID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Folder.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Folder.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int folderID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Folder.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteFolder"; - // Input PK Fields - cm.Parameters.AddWithValue("@FolderID", folderID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Folder.Remove", ex); - throw new DbCslaException("Folder.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int folderID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(folderID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Folder.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _FolderID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int folderID) - { - _FolderID = folderID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Folder.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsFolder"; - cm.Parameters.AddWithValue("@FolderID", _FolderID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Folder.DataPortal_Execute", ex); - throw new DbCslaException("Folder.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - FolderExtension _FolderExtension = new FolderExtension(); - [Serializable()] - partial class FolderExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultParentID - { - get { return 1; } - } - public virtual int DefaultDBID - { - get { return 1; } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUsrID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class FolderConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Folder) - { - // Return the ToString value - return ((Folder)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create FolderExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Folder -// { -// partial class FolderExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultParentID -// { -// get { return 1; } -// } -// public virtual int DefaultDBID -// { -// get { return 1; } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUsrID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderAssignment.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderAssignment.cs deleted file mode 100644 index bed984bb..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderAssignment.cs +++ /dev/null @@ -1,671 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// FolderAssignment Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FolderAssignmentConverter))] - public partial class FolderAssignment : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _AID; - [System.ComponentModel.DataObjectField(true, true)] - public int AID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyAssignment != null) _AID = _MyAssignment.AID; - return _AID; - } - } - private Assignment _MyAssignment; - [System.ComponentModel.DataObjectField(true, true)] - public Assignment MyAssignment - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyAssignment == null && _AID != 0) _MyAssignment = Assignment.Get(_AID); - return _MyAssignment; - } - } - private int _GID; - public int GID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyGroup != null) _GID = _MyGroup.GID; - return _GID; - } - } - private Group _MyGroup; - public Group MyGroup - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyGroup == null && _GID != 0) _MyGroup = Group.Get(_GID); - return _MyGroup; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyGroup != value) - { - _MyGroup = value; - PropertyHasChanged(); - } - } - } - private int _RID; - public int RID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRole != null) _RID = _MyRole.RID; - return _RID; - } - } - private Role _MyRole; - public Role MyRole - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRole == null && _RID != 0) _MyRole = Role.Get(_RID); - return _MyRole; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyRole != value) - { - _MyRole = value; - PropertyHasChanged(); - } - } - } - private string _StartDate = string.Empty; - public string StartDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _StartDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _StartDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_StartDate != tmp.ToString()) - { - _StartDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private string _EndDate = string.Empty; - public string EndDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _EndDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _EndDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_EndDate != tmp.ToString()) - { - _EndDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UsrID != value) - { - _UsrID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private string _Group_GroupName = string.Empty; - public string Group_GroupName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Group_GroupName; - } - } - private int? _Group_GroupType; - public int? Group_GroupType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Group_GroupType; - } - } - private string _Group_Config = string.Empty; - public string Group_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Group_Config; - } - } - private DateTime _Group_DTS = new DateTime(); - public DateTime Group_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Group_DTS; - } - } - private string _Group_UsrID = string.Empty; - public string Group_UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Group_UsrID; - } - } - private string _Role_Name = string.Empty; - public string Role_Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Role_Name; - } - } - private string _Role_Title = string.Empty; - public string Role_Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Role_Title; - } - } - private DateTime _Role_DTS = new DateTime(); - public DateTime Role_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Role_DTS; - } - } - private string _Role_UsrID = string.Empty; - public string Role_UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Role_UsrID; - } - } - // TODO: Check FolderAssignment.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current FolderAssignment - protected override object GetIdValue() - { - return _AID; - } - // TODO: Replace base FolderAssignment.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current FolderAssignment - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyGroup == null ? false : _MyGroup.IsDirty) || (_MyRole == null ? false : _MyRole.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyGroup == null ? true : _MyGroup.IsValid) && (_MyRole == null ? true : _MyRole.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyGroup != null && (hasBrokenRules = _MyGroup.HasBrokenRules) != null) return hasBrokenRules; - if (_MyRole != null && (hasBrokenRules = _MyRole.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyGroupRequired, "MyGroup"); - ValidationRules.AddRule(MyRoleRequired, "MyRole"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "StartDate"); - ValidationRules.AddRule(StartDateValid, "StartDate"); - ValidationRules.AddRule(EndDateValid, "EndDate"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UsrID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UsrID", 100)); - // TODO: Add other validation rules - } - private static bool StartDateValid(FolderAssignment target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._StartDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool EndDateValid(FolderAssignment target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._EndDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool MyGroupRequired(FolderAssignment target, Csla.Validation.RuleArgs e) - { - if (target._GID == 0 && target._MyGroup == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - private static bool MyRoleRequired(FolderAssignment target, Csla.Validation.RuleArgs e) - { - if (target._RID == 0 && target._MyRole == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(AID, ""); - //AuthorizationRules.AllowRead(GID, ""); - //AuthorizationRules.AllowWrite(GID, ""); - //AuthorizationRules.AllowRead(RID, ""); - //AuthorizationRules.AllowWrite(RID, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UsrID, ""); - //AuthorizationRules.AllowWrite(UsrID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static FolderAssignment New(Group myGroup, Role myRole) - { - return new FolderAssignment(myGroup, myRole); - } - internal static FolderAssignment Get(SafeDataReader dr) - { - return new FolderAssignment(dr); - } - public FolderAssignment() - { - MarkAsChild(); - _AID = Assignment.NextAID; - _StartDate = _FolderAssignmentExtension.DefaultStartDate; - _DTS = _FolderAssignmentExtension.DefaultDTS; - _UsrID = _FolderAssignmentExtension.DefaultUsrID; - ValidationRules.CheckRules(); - } - private FolderAssignment(Group myGroup, Role myRole) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _StartDate = _FolderAssignmentExtension.DefaultStartDate; - _DTS = _FolderAssignmentExtension.DefaultDTS; - _UsrID = _FolderAssignmentExtension.DefaultUsrID; - _MyGroup = myGroup; - _MyRole = myRole; - ValidationRules.CheckRules(); - } - internal FolderAssignment(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FolderAssignment.FetchDR", GetHashCode()); - try - { - _AID = dr.GetInt32("AID"); - _GID = dr.GetInt32("GID"); - _RID = dr.GetInt32("RID"); - _StartDate = dr.GetSmartDate("StartDate").Text; - _EndDate = dr.GetSmartDate("EndDate").Text; - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _Group_GroupName = dr.GetString("Group_GroupName"); - _Group_GroupType = (int?)dr.GetValue("Group_GroupType"); - _Group_Config = dr.GetString("Group_Config"); - _Group_DTS = dr.GetDateTime("Group_DTS"); - _Group_UsrID = dr.GetString("Group_UsrID"); - _Role_Name = dr.GetString("Role_Name"); - _Role_Title = dr.GetString("Role_Title"); - _Role_DTS = dr.GetDateTime("Role_DTS"); - _Role_UsrID = dr.GetString("Role_UsrID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FolderAssignment.FetchDR", ex); - throw new DbCslaException("FolderAssignment.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Folder myFolder) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Assignment.Add(cn, ref _AID, _MyGroup, _MyRole, myFolder, new SmartDate(_StartDate), new SmartDate(_EndDate), _DTS, _UsrID); - MarkOld(); - } - internal void Update(Folder myFolder) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Assignment.Update(cn, ref _AID, _MyGroup, _MyRole, myFolder, new SmartDate(_StartDate), new SmartDate(_EndDate), _DTS, _UsrID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Folder myFolder) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Assignment.Remove(cn, _AID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - FolderAssignmentExtension _FolderAssignmentExtension = new FolderAssignmentExtension(); - [Serializable()] - partial class FolderAssignmentExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual string DefaultStartDate - { - get { return DateTime.Now.ToShortDateString(); } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUsrID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class FolderAssignmentConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is FolderAssignment) - { - // Return the ToString value - return ((FolderAssignment)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create FolderAssignmentExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class FolderAssignment -// { -// partial class FolderAssignmentExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual SmartDate DefaultStartDate -// { -// get { return DateTime.Now.ToShortDateString(); } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUsrID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderAssignments.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderAssignments.cs deleted file mode 100644 index 7184e3be..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderAssignments.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// FolderAssignments Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FolderAssignmentsConverter))] - public partial class FolderAssignments : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public FolderAssignment this[Assignment myAssignment] - { - get - { - foreach (FolderAssignment assignment in this) - if (assignment.AID == myAssignment.AID) - return assignment; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public FolderAssignment GetItem(Assignment myAssignment) - { - foreach (FolderAssignment assignment in this) - if (assignment.AID == myAssignment.AID) - return assignment; - return null; - } - public FolderAssignment Add(Group myGroup, Role myRole) // One to Many - { - FolderAssignment assignment = FolderAssignment.New(myGroup, myRole); - this.Add(assignment); - return assignment; - } - public void Remove(Assignment myAssignment) - { - foreach (FolderAssignment assignment in this) - { - if (assignment.AID == myAssignment.AID) - { - Remove(assignment); - break; - } - } - } - public bool Contains(Assignment myAssignment) - { - foreach (FolderAssignment assignment in this) - if (assignment.AID == myAssignment.AID) - return true; - return false; - } - public bool ContainsDeleted(Assignment myAssignment) - { - foreach (FolderAssignment assignment in DeletedList) - if (assignment.AID == myAssignment.AID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (FolderAssignment folderAssignment in this) - if ((hasBrokenRules = folderAssignment.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static FolderAssignments New() - { - return new FolderAssignments(); - } - internal static FolderAssignments Get(SafeDataReader dr) - { - return new FolderAssignments(dr); - } - public static FolderAssignments GetByFolderID(int folderID) - { - try - { - return DataPortal.Fetch(new FolderIDCriteria(folderID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on FolderAssignments.GetByFolderID", ex); - } - } - private FolderAssignments() - { - MarkAsChild(); - } - internal FolderAssignments(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(FolderAssignment.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class FolderIDCriteria - { - public FolderIDCriteria(int folderID) - { - _FolderID = folderID; - } - private int _FolderID; - public int FolderID - { - get { return _FolderID; } - set { _FolderID = value; } - } - } - private void DataPortal_Fetch(FolderIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FolderAssignments.DataPortal_FetchFolderID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAssignmentsByFolderID"; - cm.Parameters.AddWithValue("@FolderID", criteria.FolderID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new FolderAssignment(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FolderAssignments.DataPortal_FetchFolderID", ex); - throw new DbCslaException("FolderAssignments.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Folder folder) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (FolderAssignment obj in DeletedList) - obj.DeleteSelf(folder);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (FolderAssignment obj in this) - { - if (obj.IsNew) - obj.Insert(folder); - else - obj.Update(folder); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - FolderAssignmentsPropertyDescriptor pd = new FolderAssignmentsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class FolderAssignmentsPropertyDescriptor : vlnListPropertyDescriptor - { - private FolderAssignment Item { get { return (FolderAssignment)_Item; } } - public FolderAssignmentsPropertyDescriptor(FolderAssignments collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class FolderAssignmentsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is FolderAssignments) - { - // Return department and department role separated by comma. - return ((FolderAssignments)value).Items.Count.ToString() + " Assignments"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderDocVersion.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderDocVersion.cs deleted file mode 100644 index 03f3908f..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderDocVersion.cs +++ /dev/null @@ -1,563 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// FolderDocVersion Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FolderDocVersionConverter))] - public partial class FolderDocVersion : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _VersionID; - [System.ComponentModel.DataObjectField(true, true)] - public int VersionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDocVersion != null) _VersionID = _MyDocVersion.VersionID; - return _VersionID; - } - } - private DocVersion _MyDocVersion; - [System.ComponentModel.DataObjectField(true, true)] - public DocVersion MyDocVersion - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDocVersion == null && _VersionID != 0) _MyDocVersion = DocVersion.Get(_VersionID); - return _MyDocVersion; - } - } - private int _VersionType; - /// - /// 0 Working Draft, 1 Temporary, 128 Revision, 129 Approved (Greater than 127 - non editable) - /// - public int VersionType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _VersionType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_VersionType != value) - { - _VersionType = value; - PropertyHasChanged(); - } - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Name != value) - { - _Name = value; - PropertyHasChanged(); - } - } - } - private string _Title = string.Empty; - public string Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Title; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Title != value) - { - _Title = value; - PropertyHasChanged(); - } - } - } - private int? _ItemID; - public int? ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem != null) _ItemID = _MyItem.ItemID; - return _ItemID; - } - } - private Item _MyItem; - public Item MyItem - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem == null && _ItemID != null) _MyItem = Item.Get((int)_ItemID); - return _MyItem; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if ((_MyItem == null ? _ItemID : (int?)_MyItem.ItemID) != (value == null ? null : (int?)value.ItemID)) - { - _MyItem = value; - _ItemID = (value == null ? null : (int?)value.ItemID); - PropertyHasChanged(); - } - } - } - private int? _FormatID; - public int? FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat != null) _FormatID = _MyFormat.FormatID; - return _FormatID; - } - } - private Format _MyFormat; - public Format MyFormat - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat == null && _FormatID != null) _MyFormat = Format.Get((int)_FormatID); - return _MyFormat; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if ((_MyFormat == null ? _FormatID : (int?)_MyFormat.FormatID) != (value == null ? null : (int?)value.FormatID)) - { - _MyFormat = value; - _FormatID = (value == null ? null : (int?)value.FormatID); - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - // TODO: Check FolderDocVersion.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current FolderDocVersion - protected override object GetIdValue() - { - return _VersionID; - } - // TODO: Replace base FolderDocVersion.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current FolderDocVersion - //public override string ToString() - //{ - // return base.ToString(); - //} - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyItem != null && (hasBrokenRules = _MyItem.HasBrokenRules) != null) return hasBrokenRules; - if (_MyFormat != null && (hasBrokenRules = _MyFormat.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "Name"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Title", 510)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(VersionID, ""); - //AuthorizationRules.AllowRead(VersionType, ""); - //AuthorizationRules.AllowWrite(VersionType, ""); - //AuthorizationRules.AllowRead(Name, ""); - //AuthorizationRules.AllowWrite(Name, ""); - //AuthorizationRules.AllowRead(Title, ""); - //AuthorizationRules.AllowWrite(Title, ""); - //AuthorizationRules.AllowRead(ItemID, ""); - //AuthorizationRules.AllowWrite(ItemID, ""); - //AuthorizationRules.AllowRead(FormatID, ""); - //AuthorizationRules.AllowWrite(FormatID, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static FolderDocVersion New(string name) - { - return new FolderDocVersion(name); - } - internal static FolderDocVersion Get(SafeDataReader dr) - { - return new FolderDocVersion(dr); - } - public FolderDocVersion() - { - MarkAsChild(); - _VersionID = DocVersion.NextVersionID; - _VersionType = _FolderDocVersionExtension.DefaultVersionType; - _DTS = _FolderDocVersionExtension.DefaultDTS; - _UserID = _FolderDocVersionExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private FolderDocVersion(string name) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _VersionType = _FolderDocVersionExtension.DefaultVersionType; - _DTS = _FolderDocVersionExtension.DefaultDTS; - _UserID = _FolderDocVersionExtension.DefaultUserID; - _Name = name; - ValidationRules.CheckRules(); - } - internal FolderDocVersion(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FolderDocVersion.FetchDR", GetHashCode()); - try - { - _VersionID = dr.GetInt32("VersionID"); - _VersionType = dr.GetInt32("VersionType"); - _Name = dr.GetString("Name"); - _Title = dr.GetString("Title"); - _ItemID = (int?)dr.GetValue("ItemID"); - _FormatID = (int?)dr.GetValue("FormatID"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FolderDocVersion.FetchDR", ex); - throw new DbCslaException("FolderDocVersion.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Folder myFolder) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = DocVersion.Add(cn, ref _VersionID, myFolder, _VersionType, _Name, _Title, _MyItem, _MyFormat, _Config, _DTS, _UserID); - MarkOld(); - } - internal void Update(Folder myFolder) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = DocVersion.Update(cn, ref _VersionID, myFolder, _VersionType, _Name, _Title, _MyItem, _MyFormat, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Folder myFolder) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - DocVersion.Remove(cn, _VersionID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - FolderDocVersionExtension _FolderDocVersionExtension = new FolderDocVersionExtension(); - [Serializable()] - partial class FolderDocVersionExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultVersionType - { - get { return 0; } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class FolderDocVersionConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is FolderDocVersion) - { - // Return the ToString value - return ((FolderDocVersion)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create FolderDocVersionExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class FolderDocVersion -// { -// partial class FolderDocVersionExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultVersionType -// { -// get { return 0; } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderDocVersions.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderDocVersions.cs deleted file mode 100644 index 8bfbdd5c..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderDocVersions.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// FolderDocVersions Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FolderDocVersionsConverter))] - public partial class FolderDocVersions : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public FolderDocVersion this[DocVersion myDocVersion] - { - get - { - foreach (FolderDocVersion docVersion in this) - if (docVersion.VersionID == myDocVersion.VersionID) - return docVersion; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public FolderDocVersion GetItem(DocVersion myDocVersion) - { - foreach (FolderDocVersion docVersion in this) - if (docVersion.VersionID == myDocVersion.VersionID) - return docVersion; - return null; - } - public FolderDocVersion Add(string name) // One to Many - { - FolderDocVersion docVersion = FolderDocVersion.New(name); - this.Add(docVersion); - return docVersion; - } - public void Remove(DocVersion myDocVersion) - { - foreach (FolderDocVersion docVersion in this) - { - if (docVersion.VersionID == myDocVersion.VersionID) - { - Remove(docVersion); - break; - } - } - } - public bool Contains(DocVersion myDocVersion) - { - foreach (FolderDocVersion docVersion in this) - if (docVersion.VersionID == myDocVersion.VersionID) - return true; - return false; - } - public bool ContainsDeleted(DocVersion myDocVersion) - { - foreach (FolderDocVersion docVersion in DeletedList) - if (docVersion.VersionID == myDocVersion.VersionID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (FolderDocVersion folderDocVersion in this) - if ((hasBrokenRules = folderDocVersion.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static FolderDocVersions New() - { - return new FolderDocVersions(); - } - internal static FolderDocVersions Get(SafeDataReader dr) - { - return new FolderDocVersions(dr); - } - public static FolderDocVersions GetByFolderID(int folderID) - { - try - { - return DataPortal.Fetch(new FolderIDCriteria(folderID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on FolderDocVersions.GetByFolderID", ex); - } - } - private FolderDocVersions() - { - MarkAsChild(); - } - internal FolderDocVersions(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(FolderDocVersion.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class FolderIDCriteria - { - public FolderIDCriteria(int folderID) - { - _FolderID = folderID; - } - private int _FolderID; - public int FolderID - { - get { return _FolderID; } - set { _FolderID = value; } - } - } - private void DataPortal_Fetch(FolderIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FolderDocVersions.DataPortal_FetchFolderID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocVersionsByFolderID"; - cm.Parameters.AddWithValue("@FolderID", criteria.FolderID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new FolderDocVersion(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FolderDocVersions.DataPortal_FetchFolderID", ex); - throw new DbCslaException("FolderDocVersions.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Folder folder) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (FolderDocVersion obj in DeletedList) - obj.DeleteSelf(folder);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (FolderDocVersion obj in this) - { - if (obj.IsNew) - obj.Insert(folder); - else - obj.Update(folder); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - FolderDocVersionsPropertyDescriptor pd = new FolderDocVersionsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class FolderDocVersionsPropertyDescriptor : vlnListPropertyDescriptor - { - private FolderDocVersion Item { get { return (FolderDocVersion)_Item; } } - public FolderDocVersionsPropertyDescriptor(FolderDocVersions collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class FolderDocVersionsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is FolderDocVersions) - { - // Return department and department role separated by comma. - return ((FolderDocVersions)value).Items.Count.ToString() + " DocVersions"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderInfo.cs deleted file mode 100644 index a8e7fd3e..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderInfo.cs +++ /dev/null @@ -1,662 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void FolderInfoEvent(object sender); - /// - /// FolderInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FolderInfoConverter))] - public partial class FolderInfo : ReadOnlyBase, IDisposable - { - public event FolderInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(FolderInfo folderInfo) - { - if (!_CacheList.Contains(folderInfo)) _CacheList.Add(folderInfo); // In AddToCache - } - protected static void RemoveFromCache(FolderInfo folderInfo) - { - while (_CacheList.Contains(folderInfo)) _CacheList.Remove(folderInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (FolderInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.FolderID.ToString())) - { - _CacheByPrimaryKey[tmp.FolderID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.FolderID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (FolderInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(FolderInfoList lst) - { - foreach (FolderInfo item in lst) AddToCache(item); - } - protected static FolderInfo GetCachedByPrimaryKey(int folderID) - { - ConvertListToDictionary(); - string key = folderID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Folder _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _FolderID; - [System.ComponentModel.DataObjectField(true, true)] - public int FolderID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FolderID; - } - } - private int _ParentID; - public int ParentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyParent != null) _ParentID = _MyParent.FolderID; - return _ParentID; - } - } - private FolderInfo _MyParent; - public FolderInfo MyParent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyParent == null && _ParentID != _FolderID) _MyParent = FolderInfo.Get(_ParentID); - return _MyParent; - } - } - private int _DBID; - public int DBID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyConnection != null) _DBID = _MyConnection.DBID; - return _DBID; - } - } - private ConnectionInfo _MyConnection; - public ConnectionInfo MyConnection - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyConnection == null && _DBID != 0) _MyConnection = ConnectionInfo.Get(_DBID); - return _MyConnection; - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - } - private string _Title = string.Empty; - public string Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Title; - } - } - private string _ShortName = string.Empty; - public string ShortName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ShortName; - } - } - private int? _FormatID; - public int? FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat != null) _FormatID = _MyFormat.FormatID; - return _FormatID; - } - } - private FormatInfo _MyFormat; - public FormatInfo MyFormat - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat == null && _FormatID != null) _MyFormat = FormatInfo.Get((int)_FormatID); - return _MyFormat; - } - } - private double? _ManualOrder; - public double? ManualOrder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ManualOrder; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - } - private int _FolderAssignmentCount = 0; - /// - /// Count of FolderAssignments for this Folder - /// - public int FolderAssignmentCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FolderAssignmentCount; - } - } - private AssignmentInfoList _FolderAssignments = null; - [TypeConverter(typeof(AssignmentInfoListConverter))] - public AssignmentInfoList FolderAssignments - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_FolderAssignmentCount < 0 || (_FolderAssignmentCount > 0 && _FolderAssignments == null)) - _FolderAssignments = AssignmentInfoList.GetByFolderID(_FolderID); - if (_FolderAssignmentCount < 0) - _FolderAssignmentCount = _FolderAssignments.Count; - return _FolderAssignments; - } - } - public void RefreshFolderAssignments() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_FolderID.ToString())) - foreach (FolderInfo tmp in _CacheByPrimaryKey[_FolderID.ToString()]) - tmp._FolderAssignmentCount = -1; // This will cause the data to be requeried - } - private int _FolderDocVersionCount = 0; - /// - /// Count of FolderDocVersions for this Folder - /// - public int FolderDocVersionCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FolderDocVersionCount; - } - } - private DocVersionInfoList _FolderDocVersions = null; - [TypeConverter(typeof(DocVersionInfoListConverter))] - public DocVersionInfoList FolderDocVersions - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_FolderDocVersionCount < 0 || (_FolderDocVersionCount > 0 && _FolderDocVersions == null)) - _FolderDocVersions = DocVersionInfoList.GetByFolderID(_FolderID); - if (_FolderDocVersionCount < 0) - _FolderDocVersionCount = _FolderDocVersions.Count; - return _FolderDocVersions; - } - } - public void RefreshFolderDocVersions() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_FolderID.ToString())) - foreach (FolderInfo tmp in _CacheByPrimaryKey[_FolderID.ToString()]) - tmp._FolderDocVersionCount = -1; // This will cause the data to be requeried - } - private int _ChildFolderCount = 0; - /// - /// Count of ChildFolders for this Folder - /// - public int ChildFolderCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ChildFolderCount; - } - } - private FolderInfoList _ChildFolders = null; - [TypeConverter(typeof(FolderInfoListConverter))] - public FolderInfoList ChildFolders - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ChildFolderCount < 0 || (_ChildFolderCount > 0 && _ChildFolders == null)) - _ChildFolders = FolderInfoList.GetChildren(_FolderID); - if (_ChildFolderCount < 0) - _ChildFolderCount = _ChildFolders.Count; - return _ChildFolders; - } - } - public void RefreshChildFolders() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_FolderID.ToString())) - foreach (FolderInfo tmp in _CacheByPrimaryKey[_FolderID.ToString()]) - tmp._ChildFolderCount = -1; // This will cause the data to be requeried - } - // TODO: Replace base FolderInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current FolderInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check FolderInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current FolderInfo - protected override object GetIdValue() - { - return _FolderID; - } - #endregion - #region Factory Methods - private static int _FolderInfoUnique = 0; - private static int FolderInfoUnique - { get { return ++_FolderInfoUnique; } } - private int _MyFolderInfoUnique = FolderInfoUnique; - public int MyFolderInfoUnique - { get { return _MyFolderInfoUnique; } } - protected FolderInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(FolderID.ToString())) return; - List listFolderInfo = _CacheByPrimaryKey[FolderID.ToString()]; // Get the list of items - while (listFolderInfo.Contains(this)) listFolderInfo.Remove(this); // Remove the item from the list - if (listFolderInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(FolderID.ToString()); // remove the list - } - public virtual Folder Get() - { - return _Editable = Folder.Get(_FolderID); - } - public static void Refresh(Folder tmp) - { - string key = tmp.FolderID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (FolderInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Folder tmp) - { - if (_ParentID != tmp.ParentID) - { - if (MyParent != null) MyParent.RefreshChildFolders(); // Update List for old value - _ParentID = tmp.ParentID; // Update the value - } - _MyParent = null; // Reset list so that the next line gets a new list - if (MyParent != null) MyParent.RefreshChildFolders(); // Update List for new value - if (_DBID != tmp.DBID) - { - if (MyConnection != null) MyConnection.RefreshConnectionFolders(); // Update List for old value - _DBID = tmp.DBID; // Update the value - } - _MyConnection = null; // Reset list so that the next line gets a new list - if (MyConnection != null) MyConnection.RefreshConnectionFolders(); // Update List for new value - _Name = tmp.Name; - _Title = tmp.Title; - _ShortName = tmp.ShortName; - if (_FormatID != tmp.FormatID) - { - if (MyFormat != null) MyFormat.RefreshFormatFolders(); // Update List for old value - _FormatID = tmp.FormatID; // Update the value - } - _MyFormat = null; // Reset list so that the next line gets a new list - if (MyFormat != null) MyFormat.RefreshFormatFolders(); // Update List for new value - _ManualOrder = tmp.ManualOrder; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UsrID = tmp.UsrID; - _FolderInfoExtension.Refresh(this); - if (_MyParent != null) - { - _MyParent.Dispose();// Dispose related value - _MyParent = null;// Reset related value - } - if (_MyConnection != null) - { - _MyConnection.Dispose();// Dispose related value - _MyConnection = null;// Reset related value - } - if (_MyFormat != null) - { - _MyFormat.Dispose();// Dispose related value - _MyFormat = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(ConnectionFolder tmp) - { - string key = tmp.FolderID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (FolderInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ConnectionFolder tmp) - { - if (_ParentID != tmp.ParentID) - { - if (MyParent != null) MyParent.RefreshChildFolders(); // Update List for old value - _ParentID = tmp.ParentID; // Update the value - } - _MyParent = null; // Reset list so that the next line gets a new list - if (MyParent != null) MyParent.RefreshChildFolders(); // Update List for new value - _Name = tmp.Name; - _Title = tmp.Title; - _ShortName = tmp.ShortName; - if (_FormatID != tmp.FormatID) - { - if (MyFormat != null) MyFormat.RefreshFormatFolders(); // Update List for old value - _FormatID = tmp.FormatID; // Update the value - } - _MyFormat = null; // Reset list so that the next line gets a new list - if (MyFormat != null) MyFormat.RefreshFormatFolders(); // Update List for new value - _ManualOrder = tmp.ManualOrder; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UsrID = tmp.UsrID; - _FolderInfoExtension.Refresh(this); - if (_MyParent != null) - { - _MyParent.Dispose();// Dispose related value - _MyParent = null;// Reset related value - } - if (_MyConnection != null) - { - _MyConnection.Dispose();// Dispose related value - _MyConnection = null;// Reset related value - } - if (_MyFormat != null) - { - _MyFormat.Dispose();// Dispose related value - _MyFormat = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(FormatFolder tmp) - { - string key = tmp.FolderID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (FolderInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(FormatFolder tmp) - { - if (_ParentID != tmp.ParentID) - { - if (MyParent != null) MyParent.RefreshChildFolders(); // Update List for old value - _ParentID = tmp.ParentID; // Update the value - } - _MyParent = null; // Reset list so that the next line gets a new list - if (MyParent != null) MyParent.RefreshChildFolders(); // Update List for new value - if (_DBID != tmp.DBID) - { - if (MyConnection != null) MyConnection.RefreshConnectionFolders(); // Update List for old value - _DBID = tmp.DBID; // Update the value - } - _MyConnection = null; // Reset list so that the next line gets a new list - if (MyConnection != null) MyConnection.RefreshConnectionFolders(); // Update List for new value - _Name = tmp.Name; - _Title = tmp.Title; - _ShortName = tmp.ShortName; - _ManualOrder = tmp.ManualOrder; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UsrID = tmp.UsrID; - _FolderInfoExtension.Refresh(this); - if (_MyParent != null) - { - _MyParent.Dispose();// Dispose related value - _MyParent = null;// Reset related value - } - if (_MyConnection != null) - { - _MyConnection.Dispose();// Dispose related value - _MyConnection = null;// Reset related value - } - if (_MyFormat != null) - { - _MyFormat.Dispose();// Dispose related value - _MyFormat = null;// Reset related value - } - OnChange();// raise an event - } - public static FolderInfo Get(int folderID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Folder"); - try - { - FolderInfo tmp = GetCachedByPrimaryKey(folderID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(folderID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up FolderInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on FolderInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal FolderInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FolderInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FolderInfo.Constructor", ex); - throw new DbCslaException("FolderInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _FolderID; - public int FolderID - { get { return _FolderID; } } - public PKCriteria(int folderID) - { - _FolderID = folderID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FolderInfo.ReadData", GetHashCode()); - try - { - _FolderID = dr.GetInt32("FolderID"); - _ParentID = dr.GetInt32("ParentID"); - _DBID = dr.GetInt32("DBID"); - _Name = dr.GetString("Name"); - _Title = dr.GetString("Title"); - _ShortName = dr.GetString("ShortName"); - _FormatID = (int?)dr.GetValue("FormatID"); - _ManualOrder = (double?)dr.GetValue("ManualOrder"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - _FolderAssignmentCount = dr.GetInt32("AssignmentCount"); - _FolderDocVersionCount = dr.GetInt32("DocVersionCount"); - _ChildFolderCount = dr.GetInt32("ChildCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FolderInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("FolderInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FolderInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFolder"; - cm.Parameters.AddWithValue("@FolderID", criteria.FolderID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FolderInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("FolderInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - FolderInfoExtension _FolderInfoExtension = new FolderInfoExtension(); - [Serializable()] - partial class FolderInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(FolderInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class FolderInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is FolderInfo) - { - // Return the ToString value - return ((FolderInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderInfoList.cs deleted file mode 100644 index 3239b29d..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FolderInfoList.cs +++ /dev/null @@ -1,369 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// FolderInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FolderInfoListConverter))] - public partial class FolderInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (FolderInfo tmp in this) - { - tmp.Changed += new FolderInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (FolderInfo tmp in this) - { - tmp.Changed -= new FolderInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static FolderInfoList _FolderInfoList = null; - /// - /// Return a list of all projects. - /// - public static FolderInfoList Get() - { - try - { - if (_FolderInfoList != null) - return _FolderInfoList; - FolderInfoList tmp = DataPortal.Fetch(); - FolderInfo.AddList(tmp); - tmp.AddEvents(); - _FolderInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on FolderInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static FolderInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on FolderInfoList.Get", ex); - // } - //} - public static FolderInfoList GetChildren(int parentID) - { - try - { - FolderInfoList tmp = DataPortal.Fetch(new ParentIDCriteria(parentID)); - FolderInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on FolderInfoList.GetChildren", ex); - } - } - public static FolderInfoList GetByDBID(int dbid) - { - try - { - FolderInfoList tmp = DataPortal.Fetch(new DBIDCriteria(dbid)); - FolderInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on FolderInfoList.GetByDBID", ex); - } - } - public static FolderInfoList GetByFormatID(int? formatID) - { - try - { - FolderInfoList tmp = DataPortal.Fetch(new FormatIDCriteria(formatID)); - FolderInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on FolderInfoList.GetByFormatID", ex); - } - } - private FolderInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FolderInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFolders"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new FolderInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FolderInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("FolderInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ParentIDCriteria - { - public ParentIDCriteria(int parentID) - { - _ParentID = parentID; - } - private int _ParentID; - public int ParentID - { - get { return _ParentID; } - set { _ParentID = value; } - } - } - private void DataPortal_Fetch(ParentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FolderInfoList.DataPortal_FetchParentID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getChildFolders"; - cm.Parameters.AddWithValue("@ParentID", criteria.ParentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new FolderInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FolderInfoList.DataPortal_FetchParentID", ex); - throw new DbCslaException("FolderInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class DBIDCriteria - { - public DBIDCriteria(int dbid) - { - _DBID = dbid; - } - private int _DBID; - public int DBID - { - get { return _DBID; } - set { _DBID = value; } - } - } - private void DataPortal_Fetch(DBIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FolderInfoList.DataPortal_FetchDBID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFoldersByDBID"; - cm.Parameters.AddWithValue("@DBID", criteria.DBID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new FolderInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FolderInfoList.DataPortal_FetchDBID", ex); - throw new DbCslaException("FolderInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class FormatIDCriteria - { - public FormatIDCriteria(int? formatID) - { - _FormatID = formatID; - } - private int? _FormatID; - public int? FormatID - { - get { return _FormatID; } - set { _FormatID = value; } - } - } - private void DataPortal_Fetch(FormatIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FolderInfoList.DataPortal_FetchFormatID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFoldersByFormatID"; - cm.Parameters.AddWithValue("@FormatID", criteria.FormatID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new FolderInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FolderInfoList.DataPortal_FetchFormatID", ex); - throw new DbCslaException("FolderInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - FolderInfoListPropertyDescriptor pd = new FolderInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class FolderInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private FolderInfo Item { get { return (FolderInfo)_Item; } } - public FolderInfoListPropertyDescriptor(FolderInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class FolderInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is FolderInfoList) - { - // Return department and department role separated by comma. - return ((FolderInfoList)value).Items.Count.ToString() + " Folders"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Format.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Format.cs deleted file mode 100644 index 5cde382a..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Format.cs +++ /dev/null @@ -1,1426 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Format Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FormatConverter))] - public partial class Format : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshFormats = new List(); - private List _RefreshFormatContents = new List(); - private List _RefreshFormatDocVersions = new List(); - private List _RefreshFormatFolders = new List(); - private void AddToRefreshList(List refreshFormats, List refreshFormatContents, List refreshFormatDocVersions, List refreshFormatFolders) - { - if (IsDirty) - refreshFormats.Add(this); - if (_FormatContents != null && _FormatContents.IsDirty) - { - foreach (FormatContent tmp in _FormatContents) - { - if (tmp.IsDirty) refreshFormatContents.Add(tmp); - } - } - if (_FormatDocVersions != null && _FormatDocVersions.IsDirty) - { - foreach (FormatDocVersion tmp in _FormatDocVersions) - { - if (tmp.IsDirty) refreshFormatDocVersions.Add(tmp); - } - } - if (_FormatFolders != null && _FormatFolders.IsDirty) - { - foreach (FormatFolder tmp in _FormatFolders) - { - if (tmp.IsDirty) refreshFormatFolders.Add(tmp); - } - } - if (_ChildFormats != null && _ChildFormats.IsDirty) - { - foreach (Format tmp in _ChildFormats) - { - tmp.AddToRefreshList(refreshFormats, refreshFormatContents, refreshFormatDocVersions, refreshFormatFolders); - } - } - } - private void BuildRefreshList() - { - _RefreshFormats = new List(); - _RefreshFormatContents = new List(); - _RefreshFormatDocVersions = new List(); - _RefreshFormatFolders = new List(); - AddToRefreshList(_RefreshFormats, _RefreshFormatContents, _RefreshFormatDocVersions, _RefreshFormatFolders); - } - private void ProcessRefreshList() - { - foreach (Format tmp in _RefreshFormats) - { - FormatInfo.Refresh(tmp); - } - foreach (FormatContent tmp in _RefreshFormatContents) - { - ContentInfo.Refresh(tmp); - } - foreach (FormatDocVersion tmp in _RefreshFormatDocVersions) - { - DocVersionInfo.Refresh(tmp); - } - foreach (FormatFolder tmp in _RefreshFormatFolders) - { - FolderInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Format format) - { - if (!_CacheList.Contains(format)) _CacheList.Add(format); // In AddToCache - } - protected static void RemoveFromCache(Format format) - { - while (_CacheList.Contains(format)) _CacheList.Remove(format); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static Dictionary> _CacheByParentID_Name = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (Format tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.FormatID.ToString())) - { - _CacheByPrimaryKey[tmp.FormatID.ToString()] = new List(); // Add new list for PrimaryKey - _CacheByParentID_Name[tmp.ParentID.ToString() + "_" + tmp.Name.ToString()] = new List(); // Add new list for ParentID_Name - } - _CacheByPrimaryKey[tmp.FormatID.ToString()].Add(tmp); // Add to Primary Key list - _CacheByParentID_Name[tmp.ParentID.ToString() + "_" + tmp.Name.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); - } - foreach (Format tmp in remove) - RemoveFromCache(tmp); - } - protected static Format GetCachedByPrimaryKey(int formatID) - { - ConvertListToDictionary(); - string key = formatID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - protected static Format GetCachedByParentID_Name(int parentID, string name) - { - ConvertListToDictionary(); - string key = parentID.ToString() + "_" + name.ToString(); - if (_CacheByParentID_Name.ContainsKey(key)) return _CacheByParentID_Name[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextFormatID = -1; - public static int NextFormatID - { - get { return _nextFormatID--; } - } - private int _FormatID; - [System.ComponentModel.DataObjectField(true, true)] - public int FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FormatID; - } - } - private int _ParentID; - public int ParentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyParent != null) _ParentID = _MyParent.FormatID; - return _ParentID; - } - } - private Format _MyParent; - public Format MyParent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyParent == null && _ParentID != _FormatID) _MyParent = Format.Get(_ParentID); - return _MyParent; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyParent != value) - { - _MyParent = value; - PropertyHasChanged(); - } - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Name != value) - { - _Name = value; - PropertyHasChanged(); - } - } - } - private string _Description = string.Empty; - public string Description - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Description; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Description != value) - { - _Description = value; - PropertyHasChanged(); - } - } - } - private string _Data = string.Empty; - public string Data - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Data; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Data != value) - { - _Data = value; - PropertyHasChanged(); - } - } - } - private string _GenMac = string.Empty; - public string GenMac - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _GenMac; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_GenMac != value) - { - _GenMac = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _FormatContentCount = 0; - /// - /// Count of FormatContents for this Format - /// - public int FormatContentCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FormatContentCount; - } - } - private FormatContents _FormatContents = null; - /// - /// Related Field - /// - [TypeConverter(typeof(FormatContentsConverter))] - public FormatContents FormatContents - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_FormatContentCount > 0 && _FormatContents == null) - _FormatContents = FormatContents.GetByFormatID(FormatID); - else if (_FormatContents == null) - _FormatContents = FormatContents.New(); - return _FormatContents; - } - } - private int _FormatDocVersionCount = 0; - /// - /// Count of FormatDocVersions for this Format - /// - public int FormatDocVersionCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FormatDocVersionCount; - } - } - private FormatDocVersions _FormatDocVersions = null; - /// - /// Related Field - /// - [TypeConverter(typeof(FormatDocVersionsConverter))] - public FormatDocVersions FormatDocVersions - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_FormatDocVersionCount > 0 && _FormatDocVersions == null) - _FormatDocVersions = FormatDocVersions.GetByFormatID(FormatID); - else if (_FormatDocVersions == null) - _FormatDocVersions = FormatDocVersions.New(); - return _FormatDocVersions; - } - } - private int _FormatFolderCount = 0; - /// - /// Count of FormatFolders for this Format - /// - public int FormatFolderCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FormatFolderCount; - } - } - private FormatFolders _FormatFolders = null; - /// - /// Related Field - /// - [TypeConverter(typeof(FormatFoldersConverter))] - public FormatFolders FormatFolders - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_FormatFolderCount > 0 && _FormatFolders == null) - _FormatFolders = FormatFolders.GetByFormatID(FormatID); - else if (_FormatFolders == null) - _FormatFolders = FormatFolders.New(); - return _FormatFolders; - } - } - private int _ChildFormatCount = 0; - /// - /// Count of ChildFormats for this Format - /// - public int ChildFormatCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ChildFormatCount; - } - } - private ChildFormats _ChildFormats = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ChildFormatsConverter))] - public ChildFormats ChildFormats - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ChildFormatCount > 0 && _ChildFormats == null) - _ChildFormats = ChildFormats.GetByParentID(FormatID); - else if (_ChildFormats == null) - _ChildFormats = ChildFormats.New(); - return _ChildFormats; - } - } - public override bool IsDirty - { - get { return base.IsDirty || (_FormatContents == null ? false : _FormatContents.IsDirty) || (_FormatDocVersions == null ? false : _FormatDocVersions.IsDirty) || (_FormatFolders == null ? false : _FormatFolders.IsDirty) || (_ChildFormats == null ? false : _ChildFormats.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_FormatContents == null ? true : _FormatContents.IsValid) && (_FormatDocVersions == null ? true : _FormatDocVersions.IsValid) && (_FormatFolders == null ? true : _FormatFolders.IsValid) && (_ChildFormats == null ? true : _ChildFormats.IsValid); } - } - // TODO: Replace base Format.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Format - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check Format.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Format - protected override object GetIdValue() - { - return _FormatID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_FormatFolders != null && (hasBrokenRules = _FormatFolders.HasBrokenRules) != null) return hasBrokenRules; - if (_FormatContents != null && (hasBrokenRules = _FormatContents.HasBrokenRules) != null) return hasBrokenRules; - if (_FormatDocVersions != null && (hasBrokenRules = _FormatDocVersions.HasBrokenRules) != null) return hasBrokenRules; - if (_ChildFormats != null && (hasBrokenRules = _ChildFormats.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "Name"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 20)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Description", 250)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "Data"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Data", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("GenMac", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _FormatExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _FormatExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(FormatID, ""); - //AuthorizationRules.AllowRead(ParentID, ""); - //AuthorizationRules.AllowRead(Name, ""); - //AuthorizationRules.AllowRead(Description, ""); - //AuthorizationRules.AllowRead(Data, ""); - //AuthorizationRules.AllowRead(GenMac, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(ParentID, ""); - //AuthorizationRules.AllowWrite(Name, ""); - //AuthorizationRules.AllowWrite(Description, ""); - //AuthorizationRules.AllowWrite(Data, ""); - //AuthorizationRules.AllowWrite(GenMac, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - _FormatExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _FormatExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - /// - /// determines if related records (Foreign Keys) will keep this Item from being deleted - /// - public bool CanDelete - { - get - { - // Check to make sure that there are not any related records - int usedByCount = 0; - usedByCount += _FormatContentCount; - usedByCount += _FormatDocVersionCount; - usedByCount += _FormatFolderCount; - usedByCount += _ChildFormatCount; - return (usedByCount == 0); - } - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _FormatUnique = 0; - protected static int FormatUnique - { get { return ++_FormatUnique; } } - private int _MyFormatUnique = FormatUnique; - public int MyFormatUnique - { get { return _MyFormatUnique; } } - protected Format() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(FormatID.ToString())) - { - List listFormat = _CacheByPrimaryKey[FormatID.ToString()]; // Get the list of items - while (listFormat.Contains(this)) listFormat.Remove(this); // Remove the item from the list - if (listFormat.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(FormatID.ToString()); // remove the list - } - string myKey; - myKey = null; - foreach (string key in _CacheByParentID_Name.Keys) - if (_CacheByParentID_Name[key].Contains(this)) - myKey = key; - if (myKey != null) - { - List listFormat = _CacheByParentID_Name[myKey]; // Get the list of items - listFormat.Remove(this); // Remove the item from the list - if (listFormat.Count == 0) //If there are no items left in the list - _CacheByParentID_Name.Remove(myKey); // remove the list - } - } - public static Format New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Format"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Format.New", ex); - } - } - public static Format New(Format myParent, string name, string data) - { - Format tmp = Format.New(); - tmp.MyParent = myParent; - tmp.Name = name; - tmp.Data = data; - return tmp; - } - public static Format New(Format myParent, string name, string description, string data, string genMac, DateTime dts, string userID) - { - Format tmp = Format.New(); - tmp.MyParent = myParent; - tmp.Name = name; - tmp.Description = description; - tmp.Data = data; - tmp.GenMac = genMac; - tmp.DTS = dts; - tmp.UserID = userID; - return tmp; - } - public static Format MakeFormat(Format myParent, string name, string description, string data, string genMac, DateTime dts, string userID) - { - Format tmp = Format.New(myParent, name, description, data, genMac, dts, userID); - if (tmp.IsSavable) - { - Format tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Format New(Format myParent, string name, string description, string data, string genMac) - { - Format tmp = Format.New(); - tmp.MyParent = myParent; - tmp.Name = name; - tmp.Description = description; - tmp.Data = data; - tmp.GenMac = genMac; - return tmp; - } - public static Format MakeFormat(Format myParent, string name, string description, string data, string genMac) - { - Format tmp = Format.New(myParent, name, description, data, genMac); - if (tmp.IsSavable) - { - Format tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Format Get(int formatID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Format"); - try - { - Format tmp = GetCachedByPrimaryKey(formatID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(formatID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Format - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Format.Get", ex); - } - } - public static Format GetByParentID_Name(int parentID, string name) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Format"); - try - { - Format tmp = GetCachedByParentID_Name(parentID, name); - if (tmp == null) - { - tmp = DataPortal.Fetch(new ParentID_NameCriteria(parentID, name)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Format - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Format.GetByParentID_Name", ex); - } - } - public static Format Get(SafeDataReader dr, Format parent) - { - if (dr.Read()) return new Format(dr, parent); - return null; - } - internal Format(SafeDataReader dr) - { - ReadData(dr); - } - private Format(SafeDataReader dr, Format parent) - { - ReadData(dr); - MarkAsChild(); - } - internal Format(SafeDataReader dr, int parentID) - { - ReadData(dr); - MarkAsChild(); - } - public static void Delete(int formatID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Format"); - try - { - DataPortal.Delete(new PKCriteria(formatID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Format.Delete", ex); - } - } - public override Format Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Format"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Format"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Format"); - try - { - BuildRefreshList(); - Format format = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(format);//Refresh the item in AllList - ProcessRefreshList(); - return format; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _FormatID; - public int FormatID - { get { return _FormatID; } } - public PKCriteria(int formatID) - { - _FormatID = formatID; - } - } - [Serializable()] - private class ParentID_NameCriteria - { - private int _ParentID; - public int ParentID - { get { return _ParentID; } } - private string _Name; - public string Name - { get { return _Name; } } - public ParentID_NameCriteria(int parentID, string name) - { - _ParentID = parentID; - _Name = name; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _FormatID = NextFormatID; - // Database Defaults - _ParentID = _FormatExtension.DefaultParentID; - _DTS = _FormatExtension.DefaultDTS; - _UserID = _FormatExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Format.ReadData", GetHashCode()); - try - { - _FormatID = dr.GetInt32("FormatID"); - _ParentID = dr.GetInt32("ParentID"); - _Name = dr.GetString("Name"); - _Description = dr.GetString("Description"); - _Data = dr.GetString("Data"); - _GenMac = dr.GetString("GenMac"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _FormatContentCount = dr.GetInt32("ContentCount"); - _FormatDocVersionCount = dr.GetInt32("DocVersionCount"); - _FormatFolderCount = dr.GetInt32("FolderCount"); - _ChildFormatCount = dr.GetInt32("ChildCount"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Format.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Format.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Format.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFormat"; - cm.Parameters.AddWithValue("@FormatID", criteria.FormatID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _FormatContents = FormatContents.Get(dr); - // load child objects - dr.NextResult(); - _FormatDocVersions = FormatDocVersions.Get(dr); - // load child objects - dr.NextResult(); - _FormatFolders = FormatFolders.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Format.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Format.DataPortal_Fetch", ex); - } - } - private void DataPortal_Fetch(ParentID_NameCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Format.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFormatByParentID_Name"; - cm.Parameters.AddWithValue("@ParentID", criteria.ParentID); - cm.Parameters.AddWithValue("@Name", criteria.Name); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Format.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Format.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Format.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Format.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Format.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addFormat"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ParentID", ParentID); - cm.Parameters.AddWithValue("@Name", _Name); - cm.Parameters.AddWithValue("@Description", _Description); - cm.Parameters.AddWithValue("@Data", _Data); - cm.Parameters.AddWithValue("@GenMac", _GenMac); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - // Output Calculated Columns - SqlParameter param_FormatID = new SqlParameter("@newFormatID", SqlDbType.Int); - param_FormatID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_FormatID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _FormatID = (int)cm.Parameters["@newFormatID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_FormatFolders != null) _FormatFolders.Update(this); - if (_FormatContents != null) _FormatContents.Update(this); - if (_FormatDocVersions != null) _FormatDocVersions.Update(this); - if (_ChildFormats != null) _ChildFormats.Update(this); - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Format.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Format.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Format.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int formatID, Format myParent, string name, string description, string data, string genMac, DateTime dts, string userID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Format.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addFormat"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ParentID", myParent.FormatID); - cm.Parameters.AddWithValue("@Name", name); - cm.Parameters.AddWithValue("@Description", description); - cm.Parameters.AddWithValue("@Data", data); - cm.Parameters.AddWithValue("@GenMac", genMac); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - // Output Calculated Columns - SqlParameter param_FormatID = new SqlParameter("@newFormatID", SqlDbType.Int); - param_FormatID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_FormatID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - formatID = (int)cm.Parameters["@newFormatID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Format.Add", ex); - throw new DbCslaException("Format.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Format.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Format.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Format.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateFormat"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@FormatID", _FormatID); - cm.Parameters.AddWithValue("@ParentID", ParentID); - cm.Parameters.AddWithValue("@Name", _Name); - cm.Parameters.AddWithValue("@Description", _Description); - cm.Parameters.AddWithValue("@Data", _Data); - cm.Parameters.AddWithValue("@GenMac", _GenMac); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - if (_FormatFolders != null) _FormatFolders.Update(this); - if (_FormatContents != null) _FormatContents.Update(this); - if (_FormatDocVersions != null) _FormatDocVersions.Update(this); - if (_ChildFormats != null) _ChildFormats.Update(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Format.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Format.Add(cn, ref _FormatID, _MyParent, _Name, _Description, _Data, _GenMac, _DTS, _UserID); - else - _LastChanged = Format.Update(cn, ref _FormatID, _MyParent, _Name, _Description, _Data, _GenMac, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - if (_FormatFolders != null) _FormatFolders.Update(this); - if (_FormatContents != null) _FormatContents.Update(this); - if (_FormatDocVersions != null) _FormatDocVersions.Update(this); - if (_ChildFormats != null) _ChildFormats.Update(this); - } - internal void DeleteSelf(Format format) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Format.Remove(cn, _FormatID); - MarkNew(); - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int formatID, Format myParent, string name, string description, string data, string genMac, DateTime dts, string userID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Format.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateFormat"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@FormatID", formatID); - cm.Parameters.AddWithValue("@ParentID", myParent.FormatID); - cm.Parameters.AddWithValue("@Name", name); - cm.Parameters.AddWithValue("@Description", description); - cm.Parameters.AddWithValue("@Data", data); - cm.Parameters.AddWithValue("@GenMac", genMac); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Format.Update", ex); - throw new DbCslaException("Format.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_FormatID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Format.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteFormat"; - cm.Parameters.AddWithValue("@FormatID", criteria.FormatID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Format.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Format.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int formatID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Format.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteFormat"; - // Input PK Fields - cm.Parameters.AddWithValue("@FormatID", formatID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Format.Remove", ex); - throw new DbCslaException("Format.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int formatID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(formatID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Format.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _FormatID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int formatID) - { - _FormatID = formatID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Format.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsFormat"; - cm.Parameters.AddWithValue("@FormatID", _FormatID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Format.DataPortal_Execute", ex); - throw new DbCslaException("Format.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - FormatExtension _FormatExtension = new FormatExtension(); - [Serializable()] - partial class FormatExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultParentID - { - get { return 1; } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class FormatConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Format) - { - // Return the ToString value - return ((Format)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create FormatExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Format -// { -// partial class FormatExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultParentID -// { -// get { return 1; } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatContent.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatContent.cs deleted file mode 100644 index 3a8441a6..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatContent.cs +++ /dev/null @@ -1,474 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// FormatContent Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FormatContentConverter))] - public partial class FormatContent : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _ContentID; - [System.ComponentModel.DataObjectField(true, true)] - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _ContentID = _MyContent.ContentID; - return _ContentID; - } - } - private Content _MyContent; - [System.ComponentModel.DataObjectField(true, true)] - public Content MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _ContentID != 0) _MyContent = Content.Get(_ContentID); - return _MyContent; - } - } - private string _Number = string.Empty; - public string Number - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Number; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Number != value) - { - _Number = value; - PropertyHasChanged(); - } - } - } - private string _Text = string.Empty; - public string Text - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Text; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Text != value) - { - _Text = value; - PropertyHasChanged(); - } - } - } - private int? _Type; - /// - /// 0 - Procedure, 10000 - Section, 20000 Step - /// - public int? Type - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Type; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_Type != value) - { - _Type = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - // TODO: Check FormatContent.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current FormatContent - protected override object GetIdValue() - { - return _ContentID; - } - // TODO: Replace base FormatContent.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current FormatContent - //public override string ToString() - //{ - // return base.ToString(); - //} - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Number", 30)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Text", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ContentID, ""); - //AuthorizationRules.AllowRead(Number, ""); - //AuthorizationRules.AllowWrite(Number, ""); - //AuthorizationRules.AllowRead(Text, ""); - //AuthorizationRules.AllowWrite(Text, ""); - //AuthorizationRules.AllowRead(Type, ""); - //AuthorizationRules.AllowWrite(Type, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static FormatContent New() - { - return new FormatContent(); - } - internal static FormatContent Get(SafeDataReader dr) - { - return new FormatContent(dr); - } - public FormatContent() - { - MarkAsChild(); - _ContentID = Content.NextContentID; - _DTS = _FormatContentExtension.DefaultDTS; - _UserID = _FormatContentExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - internal FormatContent(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FormatContent.FetchDR", GetHashCode()); - try - { - _ContentID = dr.GetInt32("ContentID"); - _Number = dr.GetString("Number"); - _Text = dr.GetString("Text"); - _Type = (int?)dr.GetValue("Type"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FormatContent.FetchDR", ex); - throw new DbCslaException("FormatContent.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Format myFormat) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Content.Add(cn, ref _ContentID, _Number, _Text, _Type, myFormat, _Config, _DTS, _UserID); - MarkOld(); - } - internal void Update(Format myFormat) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Content.Update(cn, ref _ContentID, _Number, _Text, _Type, myFormat, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Format myFormat) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Content.Remove(cn, _ContentID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - FormatContentExtension _FormatContentExtension = new FormatContentExtension(); - [Serializable()] - partial class FormatContentExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class FormatContentConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is FormatContent) - { - // Return the ToString value - return ((FormatContent)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create FormatContentExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class FormatContent -// { -// partial class FormatContentExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatContents.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatContents.cs deleted file mode 100644 index 9b957a92..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatContents.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// FormatContents Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FormatContentsConverter))] - public partial class FormatContents : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public FormatContent this[Content myContent] - { - get - { - foreach (FormatContent content in this) - if (content.ContentID == myContent.ContentID) - return content; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public FormatContent GetItem(Content myContent) - { - foreach (FormatContent content in this) - if (content.ContentID == myContent.ContentID) - return content; - return null; - } - public FormatContent Add() // One to Many - { - FormatContent content = FormatContent.New(); - this.Add(content); - return content; - } - public void Remove(Content myContent) - { - foreach (FormatContent content in this) - { - if (content.ContentID == myContent.ContentID) - { - Remove(content); - break; - } - } - } - public bool Contains(Content myContent) - { - foreach (FormatContent content in this) - if (content.ContentID == myContent.ContentID) - return true; - return false; - } - public bool ContainsDeleted(Content myContent) - { - foreach (FormatContent content in DeletedList) - if (content.ContentID == myContent.ContentID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (FormatContent formatContent in this) - if ((hasBrokenRules = formatContent.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static FormatContents New() - { - return new FormatContents(); - } - internal static FormatContents Get(SafeDataReader dr) - { - return new FormatContents(dr); - } - public static FormatContents GetByFormatID(int formatID) - { - try - { - return DataPortal.Fetch(new FormatIDCriteria(formatID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on FormatContents.GetByFormatID", ex); - } - } - private FormatContents() - { - MarkAsChild(); - } - internal FormatContents(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(FormatContent.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class FormatIDCriteria - { - public FormatIDCriteria(int formatID) - { - _FormatID = formatID; - } - private int _FormatID; - public int FormatID - { - get { return _FormatID; } - set { _FormatID = value; } - } - } - private void DataPortal_Fetch(FormatIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FormatContents.DataPortal_FetchFormatID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getContentsByFormatID"; - cm.Parameters.AddWithValue("@FormatID", criteria.FormatID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new FormatContent(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FormatContents.DataPortal_FetchFormatID", ex); - throw new DbCslaException("FormatContents.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Format format) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (FormatContent obj in DeletedList) - obj.DeleteSelf(format);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (FormatContent obj in this) - { - if (obj.IsNew) - obj.Insert(format); - else - obj.Update(format); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - FormatContentsPropertyDescriptor pd = new FormatContentsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class FormatContentsPropertyDescriptor : vlnListPropertyDescriptor - { - private FormatContent Item { get { return (FormatContent)_Item; } } - public FormatContentsPropertyDescriptor(FormatContents collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class FormatContentsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is FormatContents) - { - // Return department and department role separated by comma. - return ((FormatContents)value).Items.Count.ToString() + " Contents"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatDocVersion.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatDocVersion.cs deleted file mode 100644 index dcb0150a..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatDocVersion.cs +++ /dev/null @@ -1,681 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// FormatDocVersion Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FormatDocVersionConverter))] - public partial class FormatDocVersion : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _VersionID; - [System.ComponentModel.DataObjectField(true, true)] - public int VersionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDocVersion != null) _VersionID = _MyDocVersion.VersionID; - return _VersionID; - } - } - private DocVersion _MyDocVersion; - [System.ComponentModel.DataObjectField(true, true)] - public DocVersion MyDocVersion - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDocVersion == null && _VersionID != 0) _MyDocVersion = DocVersion.Get(_VersionID); - return _MyDocVersion; - } - } - private int _FolderID; - public int FolderID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder != null) _FolderID = _MyFolder.FolderID; - return _FolderID; - } - } - private Folder _MyFolder; - public Folder MyFolder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder == null && _FolderID != 0) _MyFolder = Folder.Get(_FolderID); - return _MyFolder; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyFolder != value) - { - _MyFolder = value; - PropertyHasChanged(); - } - } - } - private int _VersionType; - /// - /// 0 Working Draft, 1 Temporary, 128 Revision, 129 Approved (Greater than 127 - non editable) - /// - public int VersionType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _VersionType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_VersionType != value) - { - _VersionType = value; - PropertyHasChanged(); - } - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Name != value) - { - _Name = value; - PropertyHasChanged(); - } - } - } - private string _Title = string.Empty; - public string Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Title; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Title != value) - { - _Title = value; - PropertyHasChanged(); - } - } - } - private int? _ItemID; - public int? ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem != null) _ItemID = _MyItem.ItemID; - return _ItemID; - } - } - private Item _MyItem; - public Item MyItem - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem == null && _ItemID != null) _MyItem = Item.Get((int)_ItemID); - return _MyItem; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if ((_MyItem == null ? _ItemID : (int?)_MyItem.ItemID) != (value == null ? null : (int?)value.ItemID)) - { - _MyItem = value; - _ItemID = (value == null ? null : (int?)value.ItemID); - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _Folder_ParentID; - public int Folder_ParentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_ParentID; - } - } - private int _Folder_DBID; - public int Folder_DBID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_DBID; - } - } - private string _Folder_Name = string.Empty; - public string Folder_Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_Name; - } - } - private string _Folder_Title = string.Empty; - public string Folder_Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_Title; - } - } - private string _Folder_ShortName = string.Empty; - public string Folder_ShortName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_ShortName; - } - } - private int? _Folder_FormatID; - public int? Folder_FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_FormatID; - } - } - private double? _Folder_ManualOrder; - public double? Folder_ManualOrder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_ManualOrder; - } - } - private string _Folder_Config = string.Empty; - public string Folder_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_Config; - } - } - private DateTime _Folder_DTS = new DateTime(); - public DateTime Folder_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_DTS; - } - } - private string _Folder_UsrID = string.Empty; - public string Folder_UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_UsrID; - } - } - // TODO: Check FormatDocVersion.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current FormatDocVersion - protected override object GetIdValue() - { - return _VersionID; - } - // TODO: Replace base FormatDocVersion.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current FormatDocVersion - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyFolder == null ? false : _MyFolder.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyFolder != null && (hasBrokenRules = _MyFolder.HasBrokenRules) != null) return hasBrokenRules; - if (_MyItem != null && (hasBrokenRules = _MyItem.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyFolderRequired, "MyFolder"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "Name"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Title", 510)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - private static bool MyFolderRequired(FormatDocVersion target, Csla.Validation.RuleArgs e) - { - if (target._FolderID == 0 && target._MyFolder == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(VersionID, ""); - //AuthorizationRules.AllowRead(FolderID, ""); - //AuthorizationRules.AllowWrite(FolderID, ""); - //AuthorizationRules.AllowRead(VersionType, ""); - //AuthorizationRules.AllowWrite(VersionType, ""); - //AuthorizationRules.AllowRead(Name, ""); - //AuthorizationRules.AllowWrite(Name, ""); - //AuthorizationRules.AllowRead(Title, ""); - //AuthorizationRules.AllowWrite(Title, ""); - //AuthorizationRules.AllowRead(ItemID, ""); - //AuthorizationRules.AllowWrite(ItemID, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static FormatDocVersion New(Folder myFolder, string name) - { - return new FormatDocVersion(myFolder, name); - } - internal static FormatDocVersion Get(SafeDataReader dr) - { - return new FormatDocVersion(dr); - } - public FormatDocVersion() - { - MarkAsChild(); - _VersionID = DocVersion.NextVersionID; - _VersionType = _FormatDocVersionExtension.DefaultVersionType; - _DTS = _FormatDocVersionExtension.DefaultDTS; - _UserID = _FormatDocVersionExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private FormatDocVersion(Folder myFolder, string name) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _VersionType = _FormatDocVersionExtension.DefaultVersionType; - _DTS = _FormatDocVersionExtension.DefaultDTS; - _UserID = _FormatDocVersionExtension.DefaultUserID; - _MyFolder = myFolder; - _Name = name; - ValidationRules.CheckRules(); - } - internal FormatDocVersion(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FormatDocVersion.FetchDR", GetHashCode()); - try - { - _VersionID = dr.GetInt32("VersionID"); - _FolderID = dr.GetInt32("FolderID"); - _VersionType = dr.GetInt32("VersionType"); - _Name = dr.GetString("Name"); - _Title = dr.GetString("Title"); - _ItemID = (int?)dr.GetValue("ItemID"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _Folder_ParentID = dr.GetInt32("Folder_ParentID"); - _Folder_DBID = dr.GetInt32("Folder_DBID"); - _Folder_Name = dr.GetString("Folder_Name"); - _Folder_Title = dr.GetString("Folder_Title"); - _Folder_ShortName = dr.GetString("Folder_ShortName"); - _Folder_FormatID = (int?)dr.GetValue("Folder_FormatID"); - _Folder_ManualOrder = (double?)dr.GetValue("Folder_ManualOrder"); - _Folder_Config = dr.GetString("Folder_Config"); - _Folder_DTS = dr.GetDateTime("Folder_DTS"); - _Folder_UsrID = dr.GetString("Folder_UsrID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FormatDocVersion.FetchDR", ex); - throw new DbCslaException("FormatDocVersion.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Format myFormat) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = DocVersion.Add(cn, ref _VersionID, _MyFolder, _VersionType, _Name, _Title, _MyItem, myFormat, _Config, _DTS, _UserID); - MarkOld(); - } - internal void Update(Format myFormat) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = DocVersion.Update(cn, ref _VersionID, _MyFolder, _VersionType, _Name, _Title, _MyItem, myFormat, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Format myFormat) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - DocVersion.Remove(cn, _VersionID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - FormatDocVersionExtension _FormatDocVersionExtension = new FormatDocVersionExtension(); - [Serializable()] - partial class FormatDocVersionExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultVersionType - { - get { return 0; } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class FormatDocVersionConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is FormatDocVersion) - { - // Return the ToString value - return ((FormatDocVersion)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create FormatDocVersionExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class FormatDocVersion -// { -// partial class FormatDocVersionExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultVersionType -// { -// get { return 0; } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatDocVersions.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatDocVersions.cs deleted file mode 100644 index d51663f1..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatDocVersions.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// FormatDocVersions Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FormatDocVersionsConverter))] - public partial class FormatDocVersions : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public FormatDocVersion this[DocVersion myDocVersion] - { - get - { - foreach (FormatDocVersion docVersion in this) - if (docVersion.VersionID == myDocVersion.VersionID) - return docVersion; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public FormatDocVersion GetItem(DocVersion myDocVersion) - { - foreach (FormatDocVersion docVersion in this) - if (docVersion.VersionID == myDocVersion.VersionID) - return docVersion; - return null; - } - public FormatDocVersion Add(Folder myFolder, string name) // One to Many - { - FormatDocVersion docVersion = FormatDocVersion.New(myFolder, name); - this.Add(docVersion); - return docVersion; - } - public void Remove(DocVersion myDocVersion) - { - foreach (FormatDocVersion docVersion in this) - { - if (docVersion.VersionID == myDocVersion.VersionID) - { - Remove(docVersion); - break; - } - } - } - public bool Contains(DocVersion myDocVersion) - { - foreach (FormatDocVersion docVersion in this) - if (docVersion.VersionID == myDocVersion.VersionID) - return true; - return false; - } - public bool ContainsDeleted(DocVersion myDocVersion) - { - foreach (FormatDocVersion docVersion in DeletedList) - if (docVersion.VersionID == myDocVersion.VersionID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (FormatDocVersion formatDocVersion in this) - if ((hasBrokenRules = formatDocVersion.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static FormatDocVersions New() - { - return new FormatDocVersions(); - } - internal static FormatDocVersions Get(SafeDataReader dr) - { - return new FormatDocVersions(dr); - } - public static FormatDocVersions GetByFormatID(int formatID) - { - try - { - return DataPortal.Fetch(new FormatIDCriteria(formatID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on FormatDocVersions.GetByFormatID", ex); - } - } - private FormatDocVersions() - { - MarkAsChild(); - } - internal FormatDocVersions(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(FormatDocVersion.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class FormatIDCriteria - { - public FormatIDCriteria(int formatID) - { - _FormatID = formatID; - } - private int _FormatID; - public int FormatID - { - get { return _FormatID; } - set { _FormatID = value; } - } - } - private void DataPortal_Fetch(FormatIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FormatDocVersions.DataPortal_FetchFormatID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocVersionsByFormatID"; - cm.Parameters.AddWithValue("@FormatID", criteria.FormatID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new FormatDocVersion(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FormatDocVersions.DataPortal_FetchFormatID", ex); - throw new DbCslaException("FormatDocVersions.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Format format) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (FormatDocVersion obj in DeletedList) - obj.DeleteSelf(format);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (FormatDocVersion obj in this) - { - if (obj.IsNew) - obj.Insert(format); - else - obj.Update(format); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - FormatDocVersionsPropertyDescriptor pd = new FormatDocVersionsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class FormatDocVersionsPropertyDescriptor : vlnListPropertyDescriptor - { - private FormatDocVersion Item { get { return (FormatDocVersion)_Item; } } - public FormatDocVersionsPropertyDescriptor(FormatDocVersions collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class FormatDocVersionsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is FormatDocVersions) - { - // Return department and department role separated by comma. - return ((FormatDocVersions)value).Items.Count.ToString() + " DocVersions"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatFolder.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatFolder.cs deleted file mode 100644 index 2fbf77be..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatFolder.cs +++ /dev/null @@ -1,698 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// FormatFolder Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FormatFolderConverter))] - public partial class FormatFolder : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _FolderID; - [System.ComponentModel.DataObjectField(true, true)] - public int FolderID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder != null) _FolderID = _MyFolder.FolderID; - return _FolderID; - } - } - private Folder _MyFolder; - [System.ComponentModel.DataObjectField(true, true)] - public Folder MyFolder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder == null && _FolderID != 0) _MyFolder = Folder.Get(_FolderID); - return _MyFolder; - } - } - private int _ParentID; - public int ParentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyParent != null) _ParentID = _MyParent.FolderID; - return _ParentID; - } - } - private Folder _MyParent; - public Folder MyParent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyParent == null && _ParentID != _FolderID) _MyParent = Folder.Get(_ParentID); - return _MyParent; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyParent != value) - { - _MyParent = value; - PropertyHasChanged(); - } - } - } - private int _DBID; - public int DBID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyConnection != null) _DBID = _MyConnection.DBID; - return _DBID; - } - } - private Connection _MyConnection; - public Connection MyConnection - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyConnection == null && _DBID != 0) _MyConnection = Connection.Get(_DBID); - return _MyConnection; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyConnection != value) - { - _MyConnection = value; - PropertyHasChanged(); - } - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Name != value) - { - _Name = value; - PropertyHasChanged(); - } - } - } - private string _Title = string.Empty; - public string Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Title; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Title != value) - { - _Title = value; - PropertyHasChanged(); - } - } - } - private string _ShortName = string.Empty; - public string ShortName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ShortName; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_ShortName != value) - { - _ShortName = value; - PropertyHasChanged(); - } - } - } - private double? _ManualOrder; - public double? ManualOrder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ManualOrder; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_ManualOrder != value) - { - _ManualOrder = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UsrID != value) - { - _UsrID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private string _Connection_Name = string.Empty; - public string Connection_Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Connection_Name; - } - } - private string _Connection_Title = string.Empty; - public string Connection_Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Connection_Title; - } - } - private string _Connection_ConnectionString = string.Empty; - public string Connection_ConnectionString - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Connection_ConnectionString; - } - } - private int _Connection_ServerType; - /// - /// 0 SQL Server - /// - public int Connection_ServerType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Connection_ServerType; - } - } - private string _Connection_Config = string.Empty; - public string Connection_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Connection_Config; - } - } - private DateTime _Connection_DTS = new DateTime(); - public DateTime Connection_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Connection_DTS; - } - } - private string _Connection_UsrID = string.Empty; - public string Connection_UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Connection_UsrID; - } - } - // TODO: Check FormatFolder.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current FormatFolder - protected override object GetIdValue() - { - return _FolderID; - } - // TODO: Replace base FormatFolder.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current FormatFolder - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyFolder == null ? false : _MyFolder.IsDirty) || (_MyConnection == null ? false : _MyConnection.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid) && (_MyConnection == null ? true : _MyConnection.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyFolder != null && (hasBrokenRules = _MyFolder.HasBrokenRules) != null) return hasBrokenRules; - if (_MyConnection != null && (hasBrokenRules = _MyConnection.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyFolderRequired, "MyFolder"); - ValidationRules.AddRule(MyConnectionRequired, "MyConnection"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "Name"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Title", 510)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "ShortName"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("ShortName", 20)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UsrID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UsrID", 100)); - // TODO: Add other validation rules - } - private static bool MyFolderRequired(FormatFolder target, Csla.Validation.RuleArgs e) - { - if (target._ParentID == 0 && target._MyFolder == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - private static bool MyConnectionRequired(FormatFolder target, Csla.Validation.RuleArgs e) - { - if (target._DBID == 0 && target._MyConnection == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(FolderID, ""); - //AuthorizationRules.AllowRead(ParentID, ""); - //AuthorizationRules.AllowWrite(ParentID, ""); - //AuthorizationRules.AllowRead(DBID, ""); - //AuthorizationRules.AllowWrite(DBID, ""); - //AuthorizationRules.AllowRead(Name, ""); - //AuthorizationRules.AllowWrite(Name, ""); - //AuthorizationRules.AllowRead(Title, ""); - //AuthorizationRules.AllowWrite(Title, ""); - //AuthorizationRules.AllowRead(ShortName, ""); - //AuthorizationRules.AllowWrite(ShortName, ""); - //AuthorizationRules.AllowRead(ManualOrder, ""); - //AuthorizationRules.AllowWrite(ManualOrder, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UsrID, ""); - //AuthorizationRules.AllowWrite(UsrID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static FormatFolder New(Folder myParent, string name, string shortName) - { - return new FormatFolder(myParent, name, shortName); - } - internal static FormatFolder Get(SafeDataReader dr) - { - return new FormatFolder(dr); - } - public FormatFolder() - { - MarkAsChild(); - _FolderID = Folder.NextFolderID; - _ParentID = _FormatFolderExtension.DefaultParentID; - _DBID = _FormatFolderExtension.DefaultDBID; - _DTS = _FormatFolderExtension.DefaultDTS; - _UsrID = _FormatFolderExtension.DefaultUsrID; - ValidationRules.CheckRules(); - } - private FormatFolder(Folder myParent, string name, string shortName) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _ParentID = _FormatFolderExtension.DefaultParentID; - _DBID = _FormatFolderExtension.DefaultDBID; - _DTS = _FormatFolderExtension.DefaultDTS; - _UsrID = _FormatFolderExtension.DefaultUsrID; - _MyParent = myParent; - _Name = name; - _ShortName = shortName; - ValidationRules.CheckRules(); - } - internal FormatFolder(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FormatFolder.FetchDR", GetHashCode()); - try - { - _FolderID = dr.GetInt32("FolderID"); - _ParentID = dr.GetInt32("ParentID"); - _DBID = dr.GetInt32("DBID"); - _Name = dr.GetString("Name"); - _Title = dr.GetString("Title"); - _ShortName = dr.GetString("ShortName"); - _ManualOrder = (double?)dr.GetValue("ManualOrder"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _Connection_Name = dr.GetString("Connection_Name"); - _Connection_Title = dr.GetString("Connection_Title"); - _Connection_ConnectionString = dr.GetString("Connection_ConnectionString"); - _Connection_ServerType = dr.GetInt32("Connection_ServerType"); - _Connection_Config = dr.GetString("Connection_Config"); - _Connection_DTS = dr.GetDateTime("Connection_DTS"); - _Connection_UsrID = dr.GetString("Connection_UsrID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FormatFolder.FetchDR", ex); - throw new DbCslaException("FormatFolder.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Format myFormat) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Folder.Add(cn, ref _FolderID, Folder.Get(_ParentID), _MyConnection, _Name, _Title, _ShortName, myFormat, _ManualOrder, _Config, _DTS, _UsrID); - MarkOld(); - } - internal void Update(Format myFormat) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Folder.Update(cn, ref _FolderID, Folder.Get(_ParentID), _MyConnection, _Name, _Title, _ShortName, myFormat, _ManualOrder, _Config, _DTS, _UsrID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Format myFormat) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Folder.Remove(cn, _FolderID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - FormatFolderExtension _FormatFolderExtension = new FormatFolderExtension(); - [Serializable()] - partial class FormatFolderExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultParentID - { - get { return 1; } - } - public virtual int DefaultDBID - { - get { return 1; } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUsrID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class FormatFolderConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is FormatFolder) - { - // Return the ToString value - return ((FormatFolder)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create FormatFolderExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class FormatFolder -// { -// partial class FormatFolderExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultParentID -// { -// get { return 1; } -// } -// public virtual int DefaultDBID -// { -// get { return 1; } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUsrID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatFolders.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatFolders.cs deleted file mode 100644 index e7eae2c4..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatFolders.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// FormatFolders Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FormatFoldersConverter))] - public partial class FormatFolders : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public FormatFolder this[Folder myFolder] - { - get - { - foreach (FormatFolder folder in this) - if (folder.FolderID == myFolder.FolderID) - return folder; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public FormatFolder GetItem(Folder myFolder) - { - foreach (FormatFolder folder in this) - if (folder.FolderID == myFolder.FolderID) - return folder; - return null; - } - public FormatFolder Add(Folder myParent, string name, string shortName) // One to Many - { - FormatFolder folder = FormatFolder.New(myParent, name, shortName); - this.Add(folder); - return folder; - } - public void Remove(Folder myFolder) - { - foreach (FormatFolder folder in this) - { - if (folder.FolderID == myFolder.FolderID) - { - Remove(folder); - break; - } - } - } - public bool Contains(Folder myFolder) - { - foreach (FormatFolder folder in this) - if (folder.FolderID == myFolder.FolderID) - return true; - return false; - } - public bool ContainsDeleted(Folder myFolder) - { - foreach (FormatFolder folder in DeletedList) - if (folder.FolderID == myFolder.FolderID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (FormatFolder formatFolder in this) - if ((hasBrokenRules = formatFolder.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static FormatFolders New() - { - return new FormatFolders(); - } - internal static FormatFolders Get(SafeDataReader dr) - { - return new FormatFolders(dr); - } - public static FormatFolders GetByFormatID(int formatID) - { - try - { - return DataPortal.Fetch(new FormatIDCriteria(formatID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on FormatFolders.GetByFormatID", ex); - } - } - private FormatFolders() - { - MarkAsChild(); - } - internal FormatFolders(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(FormatFolder.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class FormatIDCriteria - { - public FormatIDCriteria(int formatID) - { - _FormatID = formatID; - } - private int _FormatID; - public int FormatID - { - get { return _FormatID; } - set { _FormatID = value; } - } - } - private void DataPortal_Fetch(FormatIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FormatFolders.DataPortal_FetchFormatID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFoldersByFormatID"; - cm.Parameters.AddWithValue("@FormatID", criteria.FormatID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new FormatFolder(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FormatFolders.DataPortal_FetchFormatID", ex); - throw new DbCslaException("FormatFolders.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Format format) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (FormatFolder obj in DeletedList) - obj.DeleteSelf(format);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (FormatFolder obj in this) - { - if (obj.IsNew) - obj.Insert(format); - else - obj.Update(format); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - FormatFoldersPropertyDescriptor pd = new FormatFoldersPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class FormatFoldersPropertyDescriptor : vlnListPropertyDescriptor - { - private FormatFolder Item { get { return (FormatFolder)_Item; } } - public FormatFoldersPropertyDescriptor(FormatFolders collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class FormatFoldersConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is FormatFolders) - { - // Return department and department role separated by comma. - return ((FormatFolders)value).Items.Count.ToString() + " Folders"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatInfo.cs deleted file mode 100644 index d620ce93..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatInfo.cs +++ /dev/null @@ -1,521 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void FormatInfoEvent(object sender); - /// - /// FormatInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FormatInfoConverter))] - public partial class FormatInfo : ReadOnlyBase, IDisposable - { - public event FormatInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(FormatInfo formatInfo) - { - if (!_CacheList.Contains(formatInfo)) _CacheList.Add(formatInfo); // In AddToCache - } - protected static void RemoveFromCache(FormatInfo formatInfo) - { - while (_CacheList.Contains(formatInfo)) _CacheList.Remove(formatInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (FormatInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.FormatID.ToString())) - { - _CacheByPrimaryKey[tmp.FormatID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.FormatID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (FormatInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(FormatInfoList lst) - { - foreach (FormatInfo item in lst) AddToCache(item); - } - protected static FormatInfo GetCachedByPrimaryKey(int formatID) - { - ConvertListToDictionary(); - string key = formatID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Format _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _FormatID; - [System.ComponentModel.DataObjectField(true, true)] - public int FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FormatID; - } - } - private int _ParentID; - public int ParentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyParent != null) _ParentID = _MyParent.FormatID; - return _ParentID; - } - } - private FormatInfo _MyParent; - public FormatInfo MyParent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyParent == null && _ParentID != _FormatID) _MyParent = FormatInfo.Get(_ParentID); - return _MyParent; - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - } - private string _Description = string.Empty; - public string Description - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Description; - } - } - private string _Data = string.Empty; - public string Data - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Data; - } - } - private string _GenMac = string.Empty; - public string GenMac - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _GenMac; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - private int _FormatContentCount = 0; - /// - /// Count of FormatContents for this Format - /// - public int FormatContentCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FormatContentCount; - } - } - private ContentInfoList _FormatContents = null; - [TypeConverter(typeof(ContentInfoListConverter))] - public ContentInfoList FormatContents - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_FormatContentCount < 0 || (_FormatContentCount > 0 && _FormatContents == null)) - _FormatContents = ContentInfoList.GetByFormatID(_FormatID); - if (_FormatContentCount < 0) - _FormatContentCount = _FormatContents.Count; - return _FormatContents; - } - } - public void RefreshFormatContents() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_FormatID.ToString())) - foreach (FormatInfo tmp in _CacheByPrimaryKey[_FormatID.ToString()]) - tmp._FormatContentCount = -1; // This will cause the data to be requeried - } - private int _FormatDocVersionCount = 0; - /// - /// Count of FormatDocVersions for this Format - /// - public int FormatDocVersionCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FormatDocVersionCount; - } - } - private DocVersionInfoList _FormatDocVersions = null; - [TypeConverter(typeof(DocVersionInfoListConverter))] - public DocVersionInfoList FormatDocVersions - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_FormatDocVersionCount < 0 || (_FormatDocVersionCount > 0 && _FormatDocVersions == null)) - _FormatDocVersions = DocVersionInfoList.GetByFormatID(_FormatID); - if (_FormatDocVersionCount < 0) - _FormatDocVersionCount = _FormatDocVersions.Count; - return _FormatDocVersions; - } - } - public void RefreshFormatDocVersions() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_FormatID.ToString())) - foreach (FormatInfo tmp in _CacheByPrimaryKey[_FormatID.ToString()]) - tmp._FormatDocVersionCount = -1; // This will cause the data to be requeried - } - private int _FormatFolderCount = 0; - /// - /// Count of FormatFolders for this Format - /// - public int FormatFolderCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FormatFolderCount; - } - } - private FolderInfoList _FormatFolders = null; - [TypeConverter(typeof(FolderInfoListConverter))] - public FolderInfoList FormatFolders - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_FormatFolderCount < 0 || (_FormatFolderCount > 0 && _FormatFolders == null)) - _FormatFolders = FolderInfoList.GetByFormatID(_FormatID); - if (_FormatFolderCount < 0) - _FormatFolderCount = _FormatFolders.Count; - return _FormatFolders; - } - } - public void RefreshFormatFolders() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_FormatID.ToString())) - foreach (FormatInfo tmp in _CacheByPrimaryKey[_FormatID.ToString()]) - tmp._FormatFolderCount = -1; // This will cause the data to be requeried - } - private int _ChildFormatCount = 0; - /// - /// Count of ChildFormats for this Format - /// - public int ChildFormatCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ChildFormatCount; - } - } - private FormatInfoList _ChildFormats = null; - [TypeConverter(typeof(FormatInfoListConverter))] - public FormatInfoList ChildFormats - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ChildFormatCount < 0 || (_ChildFormatCount > 0 && _ChildFormats == null)) - _ChildFormats = FormatInfoList.GetChildren(_FormatID); - if (_ChildFormatCount < 0) - _ChildFormatCount = _ChildFormats.Count; - return _ChildFormats; - } - } - public void RefreshChildFormats() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_FormatID.ToString())) - foreach (FormatInfo tmp in _CacheByPrimaryKey[_FormatID.ToString()]) - tmp._ChildFormatCount = -1; // This will cause the data to be requeried - } - // TODO: Replace base FormatInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current FormatInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check FormatInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current FormatInfo - protected override object GetIdValue() - { - return _FormatID; - } - #endregion - #region Factory Methods - private static int _FormatInfoUnique = 0; - private static int FormatInfoUnique - { get { return ++_FormatInfoUnique; } } - private int _MyFormatInfoUnique = FormatInfoUnique; - public int MyFormatInfoUnique - { get { return _MyFormatInfoUnique; } } - protected FormatInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(FormatID.ToString())) return; - List listFormatInfo = _CacheByPrimaryKey[FormatID.ToString()]; // Get the list of items - while (listFormatInfo.Contains(this)) listFormatInfo.Remove(this); // Remove the item from the list - if (listFormatInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(FormatID.ToString()); // remove the list - } - public virtual Format Get() - { - return _Editable = Format.Get(_FormatID); - } - public static void Refresh(Format tmp) - { - string key = tmp.FormatID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (FormatInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Format tmp) - { - if (_ParentID != tmp.ParentID) - { - if (MyParent != null) MyParent.RefreshChildFormats(); // Update List for old value - _ParentID = tmp.ParentID; // Update the value - } - _MyParent = null; // Reset list so that the next line gets a new list - if (MyParent != null) MyParent.RefreshChildFormats(); // Update List for new value - _Name = tmp.Name; - _Description = tmp.Description; - _Data = tmp.Data; - _GenMac = tmp.GenMac; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _FormatInfoExtension.Refresh(this); - if (_MyParent != null) - { - _MyParent.Dispose();// Dispose related value - _MyParent = null;// Reset related value - } - OnChange();// raise an event - } - public static FormatInfo Get(int formatID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Format"); - try - { - FormatInfo tmp = GetCachedByPrimaryKey(formatID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(formatID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up FormatInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on FormatInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal FormatInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FormatInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FormatInfo.Constructor", ex); - throw new DbCslaException("FormatInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _FormatID; - public int FormatID - { get { return _FormatID; } } - public PKCriteria(int formatID) - { - _FormatID = formatID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FormatInfo.ReadData", GetHashCode()); - try - { - _FormatID = dr.GetInt32("FormatID"); - _ParentID = dr.GetInt32("ParentID"); - _Name = dr.GetString("Name"); - _Description = dr.GetString("Description"); - _Data = dr.GetString("Data"); - _GenMac = dr.GetString("GenMac"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _FormatContentCount = dr.GetInt32("ContentCount"); - _FormatDocVersionCount = dr.GetInt32("DocVersionCount"); - _FormatFolderCount = dr.GetInt32("FolderCount"); - _ChildFormatCount = dr.GetInt32("ChildCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FormatInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("FormatInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FormatInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFormat"; - cm.Parameters.AddWithValue("@FormatID", criteria.FormatID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FormatInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("FormatInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - FormatInfoExtension _FormatInfoExtension = new FormatInfoExtension(); - [Serializable()] - partial class FormatInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(FormatInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class FormatInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is FormatInfo) - { - // Return the ToString value - return ((FormatInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatInfoList.cs deleted file mode 100644 index e7ec741b..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/FormatInfoList.cs +++ /dev/null @@ -1,255 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// FormatInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(FormatInfoListConverter))] - public partial class FormatInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (FormatInfo tmp in this) - { - tmp.Changed += new FormatInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (FormatInfo tmp in this) - { - tmp.Changed -= new FormatInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static FormatInfoList _FormatInfoList = null; - /// - /// Return a list of all projects. - /// - public static FormatInfoList Get() - { - try - { - if (_FormatInfoList != null) - return _FormatInfoList; - FormatInfoList tmp = DataPortal.Fetch(); - FormatInfo.AddList(tmp); - tmp.AddEvents(); - _FormatInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on FormatInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static FormatInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on FormatInfoList.Get", ex); - // } - //} - public static FormatInfoList GetChildren(int parentID) - { - try - { - FormatInfoList tmp = DataPortal.Fetch(new ParentIDCriteria(parentID)); - FormatInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on FormatInfoList.GetChildren", ex); - } - } - private FormatInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FormatInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getFormats"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new FormatInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FormatInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("FormatInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ParentIDCriteria - { - public ParentIDCriteria(int parentID) - { - _ParentID = parentID; - } - private int _ParentID; - public int ParentID - { - get { return _ParentID; } - set { _ParentID = value; } - } - } - private void DataPortal_Fetch(ParentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] FormatInfoList.DataPortal_FetchParentID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getChildFormats"; - cm.Parameters.AddWithValue("@ParentID", criteria.ParentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new FormatInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("FormatInfoList.DataPortal_FetchParentID", ex); - throw new DbCslaException("FormatInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - FormatInfoListPropertyDescriptor pd = new FormatInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class FormatInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private FormatInfo Item { get { return (FormatInfo)_Item; } } - public FormatInfoListPropertyDescriptor(FormatInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class FormatInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is FormatInfoList) - { - // Return department and department role separated by comma. - return ((FormatInfoList)value).Items.Count.ToString() + " Formats"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Generated.zip b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Generated.zip deleted file mode 100644 index 26fe22ed985c91a737d47429b58a2b068c529ee3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 55665 zcmZ77LzE`b0wwA+|Fmt}HY#mb+IFRF+qP}nuC#62=(@LG>rG;^)~@pF+9Ml7uW{@n=z0U`Z+Dr9SG=WO6?VP`98YidVtj6I&Zz@9VQ;1ZU z*Xfwo=Va<)%FQhFl7If>2v(ncO6`KTM=R-Yg~RS!L^n}h6B&|sJ$ zU;a5Eh;bs|uqp42E!wMqKPr6#9W&<;>$AipuGarA?_{bFmKoJz6#3zxv3N*g;!pfI z6;^a<R94KsuFK1(Sg|;!5-J2z9 z(xZV4t!eDjUd9(bhDl28PdYz&$w2Ahl~J9FLT0K#Hzg{$0GP~_85tz@djlqeJieT0Gpf~5fx1h$oGojEO0BQgI?B%ZSruJs z1G>OWNo4{G2-&WDNlID6$SoSS5n$ezYrG*zW+>^^H2pn*eu*kK6hmpEL>ae1&C_7R zVLIUJ(M(ZLRf0t3MX+o{oD8ABjUjZBRwooOaJd~3)4xZ};`w}~Ezp2HQ+B?;Kx$=t z!YY6yP4uS$qKKg5ikcor1*Pd@R$lGYlLrJero_hpL*6hhrlW|%}psz12t^DXn<1*SxGw*vN?ZY}BFhX_Hq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e}5zb0G^NhdioEyQeQ9t diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Group.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Group.cs deleted file mode 100644 index 7da64e38..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Group.cs +++ /dev/null @@ -1,1222 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Group Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(GroupConverter))] - public partial class Group : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshGroups = new List(); - private List _RefreshGroupAssignments = new List(); - private List _RefreshGroupMemberships = new List(); - private void AddToRefreshList(List refreshGroups, List refreshGroupAssignments, List refreshGroupMemberships) - { - if (IsDirty) - refreshGroups.Add(this); - if (_GroupAssignments != null && _GroupAssignments.IsDirty) - { - foreach (GroupAssignment tmp in _GroupAssignments) - { - if (tmp.IsDirty) refreshGroupAssignments.Add(tmp); - } - } - if (_GroupMemberships != null && _GroupMemberships.IsDirty) - { - foreach (GroupMembership tmp in _GroupMemberships) - { - if (tmp.IsDirty) refreshGroupMemberships.Add(tmp); - } - } - } - private void BuildRefreshList() - { - _RefreshGroups = new List(); - _RefreshGroupAssignments = new List(); - _RefreshGroupMemberships = new List(); - AddToRefreshList(_RefreshGroups, _RefreshGroupAssignments, _RefreshGroupMemberships); - } - private void ProcessRefreshList() - { - foreach (Group tmp in _RefreshGroups) - { - GroupInfo.Refresh(tmp); - } - foreach (GroupAssignment tmp in _RefreshGroupAssignments) - { - AssignmentInfo.Refresh(tmp); - } - foreach (GroupMembership tmp in _RefreshGroupMemberships) - { - MembershipInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Group group) - { - if (!_CacheList.Contains(group)) _CacheList.Add(group); // In AddToCache - } - protected static void RemoveFromCache(Group group) - { - while (_CacheList.Contains(group)) _CacheList.Remove(group); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static Dictionary> _CacheByGroupName = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (Group tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.GID.ToString())) - { - _CacheByPrimaryKey[tmp.GID.ToString()] = new List(); // Add new list for PrimaryKey - _CacheByGroupName[tmp.GroupName.ToString()] = new List(); // Add new list for GroupName - } - _CacheByPrimaryKey[tmp.GID.ToString()].Add(tmp); // Add to Primary Key list - _CacheByGroupName[tmp.GroupName.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); - } - foreach (Group tmp in remove) - RemoveFromCache(tmp); - } - protected static Group GetCachedByPrimaryKey(int gid) - { - ConvertListToDictionary(); - string key = gid.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - protected static Group GetCachedByGroupName(string groupName) - { - ConvertListToDictionary(); - string key = groupName.ToString(); - if (_CacheByGroupName.ContainsKey(key)) return _CacheByGroupName[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextGID = -1; - public static int NextGID - { - get { return _nextGID--; } - } - private int _GID; - [System.ComponentModel.DataObjectField(true, true)] - public int GID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _GID; - } - } - private string _GroupName = string.Empty; - public string GroupName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _GroupName; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_GroupName != value) - { - _GroupName = value; - PropertyHasChanged(); - } - } - } - private int? _GroupType; - public int? GroupType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _GroupType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_GroupType != value) - { - _GroupType = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UsrID != value) - { - _UsrID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _GroupAssignmentCount = 0; - /// - /// Count of GroupAssignments for this Group - /// - public int GroupAssignmentCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _GroupAssignmentCount; - } - } - private GroupAssignments _GroupAssignments = null; - /// - /// Related Field - /// - [TypeConverter(typeof(GroupAssignmentsConverter))] - public GroupAssignments GroupAssignments - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_GroupAssignmentCount > 0 && _GroupAssignments == null) - _GroupAssignments = GroupAssignments.GetByGID(GID); - else if (_GroupAssignments == null) - _GroupAssignments = GroupAssignments.New(); - return _GroupAssignments; - } - } - private int _GroupMembershipCount = 0; - /// - /// Count of GroupMemberships for this Group - /// - public int GroupMembershipCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _GroupMembershipCount; - } - } - private GroupMemberships _GroupMemberships = null; - /// - /// Related Field - /// - [TypeConverter(typeof(GroupMembershipsConverter))] - public GroupMemberships GroupMemberships - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_GroupMembershipCount > 0 && _GroupMemberships == null) - _GroupMemberships = GroupMemberships.GetByGID(GID); - else if (_GroupMemberships == null) - _GroupMemberships = GroupMemberships.New(); - return _GroupMemberships; - } - } - public override bool IsDirty - { - get { return base.IsDirty || (_GroupAssignments == null ? false : _GroupAssignments.IsDirty) || (_GroupMemberships == null ? false : _GroupMemberships.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_GroupAssignments == null ? true : _GroupAssignments.IsValid) && (_GroupMemberships == null ? true : _GroupMemberships.IsValid); } - } - // TODO: Replace base Group.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Group - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check Group.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Group - protected override object GetIdValue() - { - return _GID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_GroupAssignments != null && (hasBrokenRules = _GroupAssignments.HasBrokenRules) != null) return hasBrokenRules; - if (_GroupMemberships != null && (hasBrokenRules = _GroupMemberships.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "GroupName"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("GroupName", 50)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UsrID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UsrID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _GroupExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _GroupExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(GID, ""); - //AuthorizationRules.AllowRead(GroupName, ""); - //AuthorizationRules.AllowRead(GroupType, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UsrID, ""); - //AuthorizationRules.AllowWrite(GroupName, ""); - //AuthorizationRules.AllowWrite(GroupType, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UsrID, ""); - _GroupExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _GroupExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - /// - /// determines if related records (Foreign Keys) will keep this Item from being deleted - /// - public bool CanDelete - { - get - { - // Check to make sure that there are not any related records - int usedByCount = 0; - usedByCount += _GroupAssignmentCount; - usedByCount += _GroupMembershipCount; - return (usedByCount == 0); - } - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _GroupUnique = 0; - protected static int GroupUnique - { get { return ++_GroupUnique; } } - private int _MyGroupUnique = GroupUnique; - public int MyGroupUnique - { get { return _MyGroupUnique; } } - protected Group() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(GID.ToString())) - { - List listGroup = _CacheByPrimaryKey[GID.ToString()]; // Get the list of items - while (listGroup.Contains(this)) listGroup.Remove(this); // Remove the item from the list - if (listGroup.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(GID.ToString()); // remove the list - } - string myKey; - myKey = null; - foreach (string key in _CacheByGroupName.Keys) - if (_CacheByGroupName[key].Contains(this)) - myKey = key; - if (myKey != null) - { - List listGroup = _CacheByGroupName[myKey]; // Get the list of items - listGroup.Remove(this); // Remove the item from the list - if (listGroup.Count == 0) //If there are no items left in the list - _CacheByGroupName.Remove(myKey); // remove the list - } - } - public static Group New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Group"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Group.New", ex); - } - } - public static Group New(string groupName) - { - Group tmp = Group.New(); - tmp.GroupName = groupName; - return tmp; - } - public static Group New(string groupName, int? groupType, string config, DateTime dts, string usrID) - { - Group tmp = Group.New(); - tmp.GroupName = groupName; - tmp.GroupType = groupType; - tmp.Config = config; - tmp.DTS = dts; - tmp.UsrID = usrID; - return tmp; - } - public static Group MakeGroup(string groupName, int? groupType, string config, DateTime dts, string usrID) - { - Group tmp = Group.New(groupName, groupType, config, dts, usrID); - if (tmp.IsSavable) - { - Group tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Group New(string groupName, int? groupType, string config) - { - Group tmp = Group.New(); - tmp.GroupName = groupName; - tmp.GroupType = groupType; - tmp.Config = config; - return tmp; - } - public static Group MakeGroup(string groupName, int? groupType, string config) - { - Group tmp = Group.New(groupName, groupType, config); - if (tmp.IsSavable) - { - Group tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Group Get(int gid) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Group"); - try - { - Group tmp = GetCachedByPrimaryKey(gid); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(gid)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Group - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Group.Get", ex); - } - } - public static Group GetByGroupName(string groupName) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Group"); - try - { - Group tmp = GetCachedByGroupName(groupName); - if (tmp == null) - { - tmp = DataPortal.Fetch(new GroupNameCriteria(groupName)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Group - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Group.GetByGroupName", ex); - } - } - public static Group Get(SafeDataReader dr) - { - if (dr.Read()) return new Group(dr); - return null; - } - internal Group(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int gid) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Group"); - try - { - DataPortal.Delete(new PKCriteria(gid)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Group.Delete", ex); - } - } - public override Group Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Group"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Group"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Group"); - try - { - BuildRefreshList(); - Group group = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(group);//Refresh the item in AllList - ProcessRefreshList(); - return group; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _GID; - public int GID - { get { return _GID; } } - public PKCriteria(int gid) - { - _GID = gid; - } - } - [Serializable()] - private class GroupNameCriteria - { - private string _GroupName; - public string GroupName - { get { return _GroupName; } } - public GroupNameCriteria(string groupName) - { - _GroupName = groupName; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _GID = NextGID; - // Database Defaults - _DTS = _GroupExtension.DefaultDTS; - _UsrID = _GroupExtension.DefaultUsrID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Group.ReadData", GetHashCode()); - try - { - _GID = dr.GetInt32("GID"); - _GroupName = dr.GetString("GroupName"); - _GroupType = (int?)dr.GetValue("GroupType"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _GroupAssignmentCount = dr.GetInt32("AssignmentCount"); - _GroupMembershipCount = dr.GetInt32("MembershipCount"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Group.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Group.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Group.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getGroup"; - cm.Parameters.AddWithValue("@GID", criteria.GID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _GroupAssignments = GroupAssignments.Get(dr); - // load child objects - dr.NextResult(); - _GroupMemberships = GroupMemberships.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Group.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Group.DataPortal_Fetch", ex); - } - } - private void DataPortal_Fetch(GroupNameCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Group.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getGroupByGroupName"; - cm.Parameters.AddWithValue("@GroupName", criteria.GroupName); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Group.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Group.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Group.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Group.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Group.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addGroup"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@GroupName", _GroupName); - cm.Parameters.AddWithValue("@GroupType", _GroupType); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UsrID", _UsrID); - // Output Calculated Columns - SqlParameter param_GID = new SqlParameter("@newGID", SqlDbType.Int); - param_GID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_GID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _GID = (int)cm.Parameters["@newGID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_GroupAssignments != null) _GroupAssignments.Update(this); - if (_GroupMemberships != null) _GroupMemberships.Update(this); - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Group.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Group.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Group.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int gid, string groupName, int? groupType, string config, DateTime dts, string usrID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Group.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addGroup"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@GroupName", groupName); - cm.Parameters.AddWithValue("@GroupType", groupType); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UsrID", usrID); - // Output Calculated Columns - SqlParameter param_GID = new SqlParameter("@newGID", SqlDbType.Int); - param_GID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_GID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - gid = (int)cm.Parameters["@newGID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Group.Add", ex); - throw new DbCslaException("Group.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Group.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Group.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Group.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateGroup"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@GID", _GID); - cm.Parameters.AddWithValue("@GroupName", _GroupName); - cm.Parameters.AddWithValue("@GroupType", _GroupType); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UsrID", _UsrID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - if (_GroupAssignments != null) _GroupAssignments.Update(this); - if (_GroupMemberships != null) _GroupMemberships.Update(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Group.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Group.Add(cn, ref _GID, _GroupName, _GroupType, _Config, _DTS, _UsrID); - else - _LastChanged = Group.Update(cn, ref _GID, _GroupName, _GroupType, _Config, _DTS, _UsrID, ref _LastChanged); - MarkOld(); - } - if (_GroupAssignments != null) _GroupAssignments.Update(this); - if (_GroupMemberships != null) _GroupMemberships.Update(this); - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int gid, string groupName, int? groupType, string config, DateTime dts, string usrID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Group.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateGroup"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@GID", gid); - cm.Parameters.AddWithValue("@GroupName", groupName); - cm.Parameters.AddWithValue("@GroupType", groupType); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UsrID", usrID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Group.Update", ex); - throw new DbCslaException("Group.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_GID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Group.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteGroup"; - cm.Parameters.AddWithValue("@GID", criteria.GID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Group.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Group.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int gid) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Group.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteGroup"; - // Input PK Fields - cm.Parameters.AddWithValue("@GID", gid); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Group.Remove", ex); - throw new DbCslaException("Group.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int gid) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(gid)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Group.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _GID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int gid) - { - _GID = gid; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Group.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsGroup"; - cm.Parameters.AddWithValue("@GID", _GID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Group.DataPortal_Execute", ex); - throw new DbCslaException("Group.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - GroupExtension _GroupExtension = new GroupExtension(); - [Serializable()] - partial class GroupExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUsrID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class GroupConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Group) - { - // Return the ToString value - return ((Group)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create GroupExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Group -// { -// partial class GroupExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUsrID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupAssignment.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupAssignment.cs deleted file mode 100644 index 6db324b0..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupAssignment.cs +++ /dev/null @@ -1,721 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// GroupAssignment Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(GroupAssignmentConverter))] - public partial class GroupAssignment : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _AID; - [System.ComponentModel.DataObjectField(true, true)] - public int AID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyAssignment != null) _AID = _MyAssignment.AID; - return _AID; - } - } - private Assignment _MyAssignment; - [System.ComponentModel.DataObjectField(true, true)] - public Assignment MyAssignment - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyAssignment == null && _AID != 0) _MyAssignment = Assignment.Get(_AID); - return _MyAssignment; - } - } - private int _RID; - public int RID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRole != null) _RID = _MyRole.RID; - return _RID; - } - } - private Role _MyRole; - public Role MyRole - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRole == null && _RID != 0) _MyRole = Role.Get(_RID); - return _MyRole; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyRole != value) - { - _MyRole = value; - PropertyHasChanged(); - } - } - } - private int _FolderID; - public int FolderID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder != null) _FolderID = _MyFolder.FolderID; - return _FolderID; - } - } - private Folder _MyFolder; - public Folder MyFolder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder == null && _FolderID != 0) _MyFolder = Folder.Get(_FolderID); - return _MyFolder; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyFolder != value) - { - _MyFolder = value; - PropertyHasChanged(); - } - } - } - private string _StartDate = string.Empty; - public string StartDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _StartDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _StartDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_StartDate != tmp.ToString()) - { - _StartDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private string _EndDate = string.Empty; - public string EndDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _EndDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _EndDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_EndDate != tmp.ToString()) - { - _EndDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UsrID != value) - { - _UsrID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _Folder_ParentID; - public int Folder_ParentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_ParentID; - } - } - private int _Folder_DBID; - public int Folder_DBID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_DBID; - } - } - private string _Folder_Name = string.Empty; - public string Folder_Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_Name; - } - } - private string _Folder_Title = string.Empty; - public string Folder_Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_Title; - } - } - private string _Folder_ShortName = string.Empty; - public string Folder_ShortName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_ShortName; - } - } - private int? _Folder_FormatID; - public int? Folder_FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_FormatID; - } - } - private double? _Folder_ManualOrder; - public double? Folder_ManualOrder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_ManualOrder; - } - } - private string _Folder_Config = string.Empty; - public string Folder_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_Config; - } - } - private DateTime _Folder_DTS = new DateTime(); - public DateTime Folder_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_DTS; - } - } - private string _Folder_UsrID = string.Empty; - public string Folder_UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_UsrID; - } - } - private string _Role_Name = string.Empty; - public string Role_Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Role_Name; - } - } - private string _Role_Title = string.Empty; - public string Role_Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Role_Title; - } - } - private DateTime _Role_DTS = new DateTime(); - public DateTime Role_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Role_DTS; - } - } - private string _Role_UsrID = string.Empty; - public string Role_UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Role_UsrID; - } - } - // TODO: Check GroupAssignment.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current GroupAssignment - protected override object GetIdValue() - { - return _AID; - } - // TODO: Replace base GroupAssignment.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current GroupAssignment - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyRole == null ? false : _MyRole.IsDirty) || (_MyFolder == null ? false : _MyFolder.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyRole == null ? true : _MyRole.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyRole != null && (hasBrokenRules = _MyRole.HasBrokenRules) != null) return hasBrokenRules; - if (_MyFolder != null && (hasBrokenRules = _MyFolder.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyRoleRequired, "MyRole"); - ValidationRules.AddRule(MyFolderRequired, "MyFolder"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "StartDate"); - ValidationRules.AddRule(StartDateValid, "StartDate"); - ValidationRules.AddRule(EndDateValid, "EndDate"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UsrID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UsrID", 100)); - // TODO: Add other validation rules - } - private static bool StartDateValid(GroupAssignment target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._StartDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool EndDateValid(GroupAssignment target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._EndDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool MyRoleRequired(GroupAssignment target, Csla.Validation.RuleArgs e) - { - if (target._RID == 0 && target._MyRole == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - private static bool MyFolderRequired(GroupAssignment target, Csla.Validation.RuleArgs e) - { - if (target._FolderID == 0 && target._MyFolder == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(AID, ""); - //AuthorizationRules.AllowRead(RID, ""); - //AuthorizationRules.AllowWrite(RID, ""); - //AuthorizationRules.AllowRead(FolderID, ""); - //AuthorizationRules.AllowWrite(FolderID, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UsrID, ""); - //AuthorizationRules.AllowWrite(UsrID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static GroupAssignment New(Role myRole, Folder myFolder) - { - return new GroupAssignment(myRole, myFolder); - } - internal static GroupAssignment Get(SafeDataReader dr) - { - return new GroupAssignment(dr); - } - public GroupAssignment() - { - MarkAsChild(); - _AID = Assignment.NextAID; - _StartDate = _GroupAssignmentExtension.DefaultStartDate; - _DTS = _GroupAssignmentExtension.DefaultDTS; - _UsrID = _GroupAssignmentExtension.DefaultUsrID; - ValidationRules.CheckRules(); - } - private GroupAssignment(Role myRole, Folder myFolder) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _StartDate = _GroupAssignmentExtension.DefaultStartDate; - _DTS = _GroupAssignmentExtension.DefaultDTS; - _UsrID = _GroupAssignmentExtension.DefaultUsrID; - _MyRole = myRole; - _MyFolder = myFolder; - ValidationRules.CheckRules(); - } - internal GroupAssignment(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] GroupAssignment.FetchDR", GetHashCode()); - try - { - _AID = dr.GetInt32("AID"); - _RID = dr.GetInt32("RID"); - _FolderID = dr.GetInt32("FolderID"); - _StartDate = dr.GetSmartDate("StartDate").Text; - _EndDate = dr.GetSmartDate("EndDate").Text; - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _Folder_ParentID = dr.GetInt32("Folder_ParentID"); - _Folder_DBID = dr.GetInt32("Folder_DBID"); - _Folder_Name = dr.GetString("Folder_Name"); - _Folder_Title = dr.GetString("Folder_Title"); - _Folder_ShortName = dr.GetString("Folder_ShortName"); - _Folder_FormatID = (int?)dr.GetValue("Folder_FormatID"); - _Folder_ManualOrder = (double?)dr.GetValue("Folder_ManualOrder"); - _Folder_Config = dr.GetString("Folder_Config"); - _Folder_DTS = dr.GetDateTime("Folder_DTS"); - _Folder_UsrID = dr.GetString("Folder_UsrID"); - _Role_Name = dr.GetString("Role_Name"); - _Role_Title = dr.GetString("Role_Title"); - _Role_DTS = dr.GetDateTime("Role_DTS"); - _Role_UsrID = dr.GetString("Role_UsrID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("GroupAssignment.FetchDR", ex); - throw new DbCslaException("GroupAssignment.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Group myGroup) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Assignment.Add(cn, ref _AID, myGroup, _MyRole, _MyFolder, new SmartDate(_StartDate), new SmartDate(_EndDate), _DTS, _UsrID); - MarkOld(); - } - internal void Update(Group myGroup) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Assignment.Update(cn, ref _AID, myGroup, _MyRole, _MyFolder, new SmartDate(_StartDate), new SmartDate(_EndDate), _DTS, _UsrID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Group myGroup) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Assignment.Remove(cn, _AID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - GroupAssignmentExtension _GroupAssignmentExtension = new GroupAssignmentExtension(); - [Serializable()] - partial class GroupAssignmentExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual string DefaultStartDate - { - get { return DateTime.Now.ToShortDateString(); } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUsrID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class GroupAssignmentConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is GroupAssignment) - { - // Return the ToString value - return ((GroupAssignment)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create GroupAssignmentExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class GroupAssignment -// { -// partial class GroupAssignmentExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual SmartDate DefaultStartDate -// { -// get { return DateTime.Now.ToShortDateString(); } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUsrID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupAssignments.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupAssignments.cs deleted file mode 100644 index 03944b15..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupAssignments.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// GroupAssignments Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(GroupAssignmentsConverter))] - public partial class GroupAssignments : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public GroupAssignment this[Assignment myAssignment] - { - get - { - foreach (GroupAssignment assignment in this) - if (assignment.AID == myAssignment.AID) - return assignment; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public GroupAssignment GetItem(Assignment myAssignment) - { - foreach (GroupAssignment assignment in this) - if (assignment.AID == myAssignment.AID) - return assignment; - return null; - } - public GroupAssignment Add(Role myRole, Folder myFolder) // One to Many - { - GroupAssignment assignment = GroupAssignment.New(myRole, myFolder); - this.Add(assignment); - return assignment; - } - public void Remove(Assignment myAssignment) - { - foreach (GroupAssignment assignment in this) - { - if (assignment.AID == myAssignment.AID) - { - Remove(assignment); - break; - } - } - } - public bool Contains(Assignment myAssignment) - { - foreach (GroupAssignment assignment in this) - if (assignment.AID == myAssignment.AID) - return true; - return false; - } - public bool ContainsDeleted(Assignment myAssignment) - { - foreach (GroupAssignment assignment in DeletedList) - if (assignment.AID == myAssignment.AID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (GroupAssignment groupAssignment in this) - if ((hasBrokenRules = groupAssignment.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static GroupAssignments New() - { - return new GroupAssignments(); - } - internal static GroupAssignments Get(SafeDataReader dr) - { - return new GroupAssignments(dr); - } - public static GroupAssignments GetByGID(int gid) - { - try - { - return DataPortal.Fetch(new GIDCriteria(gid)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on GroupAssignments.GetByGID", ex); - } - } - private GroupAssignments() - { - MarkAsChild(); - } - internal GroupAssignments(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(GroupAssignment.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class GIDCriteria - { - public GIDCriteria(int gid) - { - _GID = gid; - } - private int _GID; - public int GID - { - get { return _GID; } - set { _GID = value; } - } - } - private void DataPortal_Fetch(GIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] GroupAssignments.DataPortal_FetchGID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAssignmentsByGID"; - cm.Parameters.AddWithValue("@GID", criteria.GID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new GroupAssignment(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("GroupAssignments.DataPortal_FetchGID", ex); - throw new DbCslaException("GroupAssignments.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Group group) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (GroupAssignment obj in DeletedList) - obj.DeleteSelf(group);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (GroupAssignment obj in this) - { - if (obj.IsNew) - obj.Insert(group); - else - obj.Update(group); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - GroupAssignmentsPropertyDescriptor pd = new GroupAssignmentsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class GroupAssignmentsPropertyDescriptor : vlnListPropertyDescriptor - { - private GroupAssignment Item { get { return (GroupAssignment)_Item; } } - public GroupAssignmentsPropertyDescriptor(GroupAssignments collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class GroupAssignmentsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is GroupAssignments) - { - // Return department and department role separated by comma. - return ((GroupAssignments)value).Items.Count.ToString() + " Assignments"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupInfo.cs deleted file mode 100644 index 08715aaf..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupInfo.cs +++ /dev/null @@ -1,409 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void GroupInfoEvent(object sender); - /// - /// GroupInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(GroupInfoConverter))] - public partial class GroupInfo : ReadOnlyBase, IDisposable - { - public event GroupInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(GroupInfo groupInfo) - { - if (!_CacheList.Contains(groupInfo)) _CacheList.Add(groupInfo); // In AddToCache - } - protected static void RemoveFromCache(GroupInfo groupInfo) - { - while (_CacheList.Contains(groupInfo)) _CacheList.Remove(groupInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (GroupInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.GID.ToString())) - { - _CacheByPrimaryKey[tmp.GID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.GID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (GroupInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(GroupInfoList lst) - { - foreach (GroupInfo item in lst) AddToCache(item); - } - protected static GroupInfo GetCachedByPrimaryKey(int gid) - { - ConvertListToDictionary(); - string key = gid.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Group _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _GID; - [System.ComponentModel.DataObjectField(true, true)] - public int GID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _GID; - } - } - private string _GroupName = string.Empty; - public string GroupName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _GroupName; - } - } - private int? _GroupType; - public int? GroupType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _GroupType; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - } - private int _GroupAssignmentCount = 0; - /// - /// Count of GroupAssignments for this Group - /// - public int GroupAssignmentCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _GroupAssignmentCount; - } - } - private AssignmentInfoList _GroupAssignments = null; - [TypeConverter(typeof(AssignmentInfoListConverter))] - public AssignmentInfoList GroupAssignments - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_GroupAssignmentCount < 0 || (_GroupAssignmentCount > 0 && _GroupAssignments == null)) - _GroupAssignments = AssignmentInfoList.GetByGID(_GID); - if (_GroupAssignmentCount < 0) - _GroupAssignmentCount = _GroupAssignments.Count; - return _GroupAssignments; - } - } - public void RefreshGroupAssignments() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_GID.ToString())) - foreach (GroupInfo tmp in _CacheByPrimaryKey[_GID.ToString()]) - tmp._GroupAssignmentCount = -1; // This will cause the data to be requeried - } - private int _GroupMembershipCount = 0; - /// - /// Count of GroupMemberships for this Group - /// - public int GroupMembershipCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _GroupMembershipCount; - } - } - private MembershipInfoList _GroupMemberships = null; - [TypeConverter(typeof(MembershipInfoListConverter))] - public MembershipInfoList GroupMemberships - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_GroupMembershipCount < 0 || (_GroupMembershipCount > 0 && _GroupMemberships == null)) - _GroupMemberships = MembershipInfoList.GetByGID(_GID); - if (_GroupMembershipCount < 0) - _GroupMembershipCount = _GroupMemberships.Count; - return _GroupMemberships; - } - } - public void RefreshGroupMemberships() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_GID.ToString())) - foreach (GroupInfo tmp in _CacheByPrimaryKey[_GID.ToString()]) - tmp._GroupMembershipCount = -1; // This will cause the data to be requeried - } - // TODO: Replace base GroupInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current GroupInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check GroupInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current GroupInfo - protected override object GetIdValue() - { - return _GID; - } - #endregion - #region Factory Methods - private static int _GroupInfoUnique = 0; - private static int GroupInfoUnique - { get { return ++_GroupInfoUnique; } } - private int _MyGroupInfoUnique = GroupInfoUnique; - public int MyGroupInfoUnique - { get { return _MyGroupInfoUnique; } } - protected GroupInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(GID.ToString())) return; - List listGroupInfo = _CacheByPrimaryKey[GID.ToString()]; // Get the list of items - while (listGroupInfo.Contains(this)) listGroupInfo.Remove(this); // Remove the item from the list - if (listGroupInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(GID.ToString()); // remove the list - } - public virtual Group Get() - { - return _Editable = Group.Get(_GID); - } - public static void Refresh(Group tmp) - { - string key = tmp.GID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (GroupInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Group tmp) - { - _GroupName = tmp.GroupName; - _GroupType = tmp.GroupType; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UsrID = tmp.UsrID; - _GroupInfoExtension.Refresh(this); - OnChange();// raise an event - } - public static GroupInfo Get(int gid) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Group"); - try - { - GroupInfo tmp = GetCachedByPrimaryKey(gid); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(gid)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up GroupInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on GroupInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal GroupInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] GroupInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("GroupInfo.Constructor", ex); - throw new DbCslaException("GroupInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _GID; - public int GID - { get { return _GID; } } - public PKCriteria(int gid) - { - _GID = gid; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] GroupInfo.ReadData", GetHashCode()); - try - { - _GID = dr.GetInt32("GID"); - _GroupName = dr.GetString("GroupName"); - _GroupType = (int?)dr.GetValue("GroupType"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - _GroupAssignmentCount = dr.GetInt32("AssignmentCount"); - _GroupMembershipCount = dr.GetInt32("MembershipCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("GroupInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("GroupInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] GroupInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getGroup"; - cm.Parameters.AddWithValue("@GID", criteria.GID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("GroupInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("GroupInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - GroupInfoExtension _GroupInfoExtension = new GroupInfoExtension(); - [Serializable()] - partial class GroupInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(GroupInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class GroupInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is GroupInfo) - { - // Return the ToString value - return ((GroupInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupInfoList.cs deleted file mode 100644 index c90417fb..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupInfoList.cs +++ /dev/null @@ -1,198 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// GroupInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(GroupInfoListConverter))] - public partial class GroupInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (GroupInfo tmp in this) - { - tmp.Changed += new GroupInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (GroupInfo tmp in this) - { - tmp.Changed -= new GroupInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static GroupInfoList _GroupInfoList = null; - /// - /// Return a list of all projects. - /// - public static GroupInfoList Get() - { - try - { - if (_GroupInfoList != null) - return _GroupInfoList; - GroupInfoList tmp = DataPortal.Fetch(); - GroupInfo.AddList(tmp); - tmp.AddEvents(); - _GroupInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on GroupInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static GroupInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on GroupInfoList.Get", ex); - // } - //} - private GroupInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] GroupInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getGroups"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new GroupInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("GroupInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("GroupInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - GroupInfoListPropertyDescriptor pd = new GroupInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class GroupInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private GroupInfo Item { get { return (GroupInfo)_Item; } } - public GroupInfoListPropertyDescriptor(GroupInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class GroupInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is GroupInfoList) - { - // Return department and department role separated by comma. - return ((GroupInfoList)value).Items.Count.ToString() + " Groups"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupMembership.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupMembership.cs deleted file mode 100644 index 1e5460e3..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupMembership.cs +++ /dev/null @@ -1,692 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// GroupMembership Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(GroupMembershipConverter))] - public partial class GroupMembership : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _UGID; - [System.ComponentModel.DataObjectField(true, true)] - public int UGID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyMembership != null) _UGID = _MyMembership.UGID; - return _UGID; - } - } - private Membership _MyMembership; - [System.ComponentModel.DataObjectField(true, true)] - public Membership MyMembership - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyMembership == null && _UGID != 0) _MyMembership = Membership.Get(_UGID); - return _MyMembership; - } - } - private int _UID; - public int UID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyUser != null) _UID = _MyUser.UID; - return _UID; - } - } - private User _MyUser; - public User MyUser - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyUser == null && _UID != 0) _MyUser = User.Get(_UID); - return _MyUser; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyUser != value) - { - _MyUser = value; - PropertyHasChanged(); - } - } - } - private string _StartDate = string.Empty; - public string StartDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _StartDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _StartDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_StartDate != tmp.ToString()) - { - _StartDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private string _EndDate = string.Empty; - public string EndDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _EndDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _EndDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_EndDate != tmp.ToString()) - { - _EndDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UsrID != value) - { - _UsrID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private string _User_UserID = string.Empty; - public string User_UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _User_UserID; - } - } - private string _User_FirstName = string.Empty; - public string User_FirstName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _User_FirstName; - } - } - private string _User_MiddleName = string.Empty; - public string User_MiddleName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _User_MiddleName; - } - } - private string _User_LastName = string.Empty; - public string User_LastName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _User_LastName; - } - } - private string _User_Suffix = string.Empty; - public string User_Suffix - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _User_Suffix; - } - } - private string _User_CourtesyTitle = string.Empty; - public string User_CourtesyTitle - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _User_CourtesyTitle; - } - } - private string _User_PhoneNumber = string.Empty; - public string User_PhoneNumber - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _User_PhoneNumber; - } - } - private string _User_CFGName = string.Empty; - public string User_CFGName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _User_CFGName; - } - } - private string _User_UserLogin = string.Empty; - public string User_UserLogin - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _User_UserLogin; - } - } - private string _User_UserName = string.Empty; - public string User_UserName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _User_UserName; - } - } - private string _User_Config = string.Empty; - public string User_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _User_Config; - } - } - private DateTime _User_DTS = new DateTime(); - public DateTime User_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _User_DTS; - } - } - private string _User_UsrID = string.Empty; - public string User_UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _User_UsrID; - } - } - // TODO: Check GroupMembership.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current GroupMembership - protected override object GetIdValue() - { - return _UGID; - } - // TODO: Replace base GroupMembership.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current GroupMembership - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyUser == null ? false : _MyUser.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyUser == null ? true : _MyUser.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyUser != null && (hasBrokenRules = _MyUser.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyUserRequired, "MyUser"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "StartDate"); - ValidationRules.AddRule(StartDateValid, "StartDate"); - ValidationRules.AddRule(EndDateValid, "EndDate"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UsrID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UsrID", 100)); - // TODO: Add other validation rules - } - private static bool StartDateValid(GroupMembership target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._StartDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool EndDateValid(GroupMembership target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._EndDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool MyUserRequired(GroupMembership target, Csla.Validation.RuleArgs e) - { - if (target._UID == 0 && target._MyUser == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(UGID, ""); - //AuthorizationRules.AllowRead(UID, ""); - //AuthorizationRules.AllowWrite(UID, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UsrID, ""); - //AuthorizationRules.AllowWrite(UsrID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static GroupMembership New(User myUser) - { - return new GroupMembership(myUser); - } - internal static GroupMembership Get(SafeDataReader dr) - { - return new GroupMembership(dr); - } - public GroupMembership() - { - MarkAsChild(); - _UGID = Membership.NextUGID; - _StartDate = _GroupMembershipExtension.DefaultStartDate; - _DTS = _GroupMembershipExtension.DefaultDTS; - _UsrID = _GroupMembershipExtension.DefaultUsrID; - ValidationRules.CheckRules(); - } - private GroupMembership(User myUser) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _StartDate = _GroupMembershipExtension.DefaultStartDate; - _DTS = _GroupMembershipExtension.DefaultDTS; - _UsrID = _GroupMembershipExtension.DefaultUsrID; - _MyUser = myUser; - ValidationRules.CheckRules(); - } - internal GroupMembership(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] GroupMembership.FetchDR", GetHashCode()); - try - { - _UGID = dr.GetInt32("UGID"); - _UID = dr.GetInt32("UID"); - _StartDate = dr.GetSmartDate("StartDate").Text; - _EndDate = dr.GetSmartDate("EndDate").Text; - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _User_UserID = dr.GetString("User_UserID"); - _User_FirstName = dr.GetString("User_FirstName"); - _User_MiddleName = dr.GetString("User_MiddleName"); - _User_LastName = dr.GetString("User_LastName"); - _User_Suffix = dr.GetString("User_Suffix"); - _User_CourtesyTitle = dr.GetString("User_CourtesyTitle"); - _User_PhoneNumber = dr.GetString("User_PhoneNumber"); - _User_CFGName = dr.GetString("User_CFGName"); - _User_UserLogin = dr.GetString("User_UserLogin"); - _User_UserName = dr.GetString("User_UserName"); - _User_Config = dr.GetString("User_Config"); - _User_DTS = dr.GetDateTime("User_DTS"); - _User_UsrID = dr.GetString("User_UsrID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("GroupMembership.FetchDR", ex); - throw new DbCslaException("GroupMembership.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Group myGroup) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Membership.Add(cn, ref _UGID, _MyUser, myGroup, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID); - MarkOld(); - } - internal void Update(Group myGroup) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Membership.Update(cn, ref _UGID, _MyUser, myGroup, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Group myGroup) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Membership.Remove(cn, _UGID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - GroupMembershipExtension _GroupMembershipExtension = new GroupMembershipExtension(); - [Serializable()] - partial class GroupMembershipExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual string DefaultStartDate - { - get { return DateTime.Now.ToShortDateString(); } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUsrID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class GroupMembershipConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is GroupMembership) - { - // Return the ToString value - return ((GroupMembership)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create GroupMembershipExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class GroupMembership -// { -// partial class GroupMembershipExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual SmartDate DefaultStartDate -// { -// get { return DateTime.Now.ToShortDateString(); } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUsrID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupMemberships.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupMemberships.cs deleted file mode 100644 index 8de03e73..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/GroupMemberships.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// GroupMemberships Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(GroupMembershipsConverter))] - public partial class GroupMemberships : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public GroupMembership this[Membership myMembership] - { - get - { - foreach (GroupMembership membership in this) - if (membership.UGID == myMembership.UGID) - return membership; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public GroupMembership GetItem(Membership myMembership) - { - foreach (GroupMembership membership in this) - if (membership.UGID == myMembership.UGID) - return membership; - return null; - } - public GroupMembership Add(User myUser) // One to Many - { - GroupMembership membership = GroupMembership.New(myUser); - this.Add(membership); - return membership; - } - public void Remove(Membership myMembership) - { - foreach (GroupMembership membership in this) - { - if (membership.UGID == myMembership.UGID) - { - Remove(membership); - break; - } - } - } - public bool Contains(Membership myMembership) - { - foreach (GroupMembership membership in this) - if (membership.UGID == myMembership.UGID) - return true; - return false; - } - public bool ContainsDeleted(Membership myMembership) - { - foreach (GroupMembership membership in DeletedList) - if (membership.UGID == myMembership.UGID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (GroupMembership groupMembership in this) - if ((hasBrokenRules = groupMembership.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static GroupMemberships New() - { - return new GroupMemberships(); - } - internal static GroupMemberships Get(SafeDataReader dr) - { - return new GroupMemberships(dr); - } - public static GroupMemberships GetByGID(int gid) - { - try - { - return DataPortal.Fetch(new GIDCriteria(gid)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on GroupMemberships.GetByGID", ex); - } - } - private GroupMemberships() - { - MarkAsChild(); - } - internal GroupMemberships(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(GroupMembership.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class GIDCriteria - { - public GIDCriteria(int gid) - { - _GID = gid; - } - private int _GID; - public int GID - { - get { return _GID; } - set { _GID = value; } - } - } - private void DataPortal_Fetch(GIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] GroupMemberships.DataPortal_FetchGID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getMembershipsByGID"; - cm.Parameters.AddWithValue("@GID", criteria.GID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new GroupMembership(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("GroupMemberships.DataPortal_FetchGID", ex); - throw new DbCslaException("GroupMemberships.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Group group) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (GroupMembership obj in DeletedList) - obj.DeleteSelf(group);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (GroupMembership obj in this) - { - if (obj.IsNew) - obj.Insert(group); - else - obj.Update(group); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - GroupMembershipsPropertyDescriptor pd = new GroupMembershipsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class GroupMembershipsPropertyDescriptor : vlnListPropertyDescriptor - { - private GroupMembership Item { get { return (GroupMembership)_Item; } } - public GroupMembershipsPropertyDescriptor(GroupMemberships collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class GroupMembershipsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is GroupMemberships) - { - // Return department and department role separated by comma. - return ((GroupMemberships)value).Items.Count.ToString() + " Memberships"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Item.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Item.cs deleted file mode 100644 index 07cc77d7..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Item.cs +++ /dev/null @@ -1,1345 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Item Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ItemConverter))] - public partial class Item : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshItems = new List(); - private List _RefreshItemAnnotations = new List(); - private List _RefreshItemDocVersions = new List(); - private List _RefreshItemParts = new List(); - private List _RefreshItemTransitions_RangeID = new List(); - private List _RefreshItemTransitions_ToID = new List(); - private void AddToRefreshList(List refreshItems, List refreshItemAnnotations, List refreshItemDocVersions, List refreshItemParts, List refreshItemTransitions_RangeID, List refreshItemTransitions_ToID) - { - if (IsDirty) - refreshItems.Add(this); - if (_ItemAnnotations != null && _ItemAnnotations.IsDirty) - { - foreach (ItemAnnotation tmp in _ItemAnnotations) - { - if (tmp.IsDirty) refreshItemAnnotations.Add(tmp); - } - } - if (_ItemDocVersions != null && _ItemDocVersions.IsDirty) - { - foreach (ItemDocVersion tmp in _ItemDocVersions) - { - if (tmp.IsDirty) refreshItemDocVersions.Add(tmp); - } - } - if (_NextItems != null && _NextItems.IsDirty) - { - foreach (Item tmp in _NextItems) - { - tmp.AddToRefreshList(refreshItems, refreshItemAnnotations, refreshItemDocVersions, refreshItemParts, refreshItemTransitions_RangeID, refreshItemTransitions_ToID); - } - } - if (_ItemParts != null && _ItemParts.IsDirty) - { - foreach (ItemPart tmp in _ItemParts) - { - if (tmp.IsDirty) refreshItemParts.Add(tmp); - } - } - if (_ItemTransitions_RangeID != null && _ItemTransitions_RangeID.IsDirty) - { - foreach (ItemTransition_RangeID tmp in _ItemTransitions_RangeID) - { - if (tmp.IsDirty) refreshItemTransitions_RangeID.Add(tmp); - } - } - if (_ItemTransitions_ToID != null && _ItemTransitions_ToID.IsDirty) - { - foreach (ItemTransition_ToID tmp in _ItemTransitions_ToID) - { - if (tmp.IsDirty) refreshItemTransitions_ToID.Add(tmp); - } - } - } - private void BuildRefreshList() - { - _RefreshItems = new List(); - _RefreshItemAnnotations = new List(); - _RefreshItemDocVersions = new List(); - _RefreshItemParts = new List(); - _RefreshItemTransitions_RangeID = new List(); - _RefreshItemTransitions_ToID = new List(); - AddToRefreshList(_RefreshItems, _RefreshItemAnnotations, _RefreshItemDocVersions, _RefreshItemParts, _RefreshItemTransitions_RangeID, _RefreshItemTransitions_ToID); - } - private void ProcessRefreshList() - { - foreach (Item tmp in _RefreshItems) - { - ItemInfo.Refresh(tmp); - if (tmp._MyContent != null) ContentInfo.Refresh(tmp._MyContent); - } - foreach (ItemAnnotation tmp in _RefreshItemAnnotations) - { - AnnotationInfo.Refresh(tmp); - } - foreach (ItemDocVersion tmp in _RefreshItemDocVersions) - { - DocVersionInfo.Refresh(tmp); - } - foreach (ItemPart tmp in _RefreshItemParts) - { - PartInfo.Refresh(tmp); - } - foreach (ItemTransition_RangeID tmp in _RefreshItemTransitions_RangeID) - { - TransitionInfo.Refresh(tmp); - } - foreach (ItemTransition_ToID tmp in _RefreshItemTransitions_ToID) - { - TransitionInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Item item) - { - if (!_CacheList.Contains(item)) _CacheList.Add(item); // In AddToCache - } - protected static void RemoveFromCache(Item item) - { - while (_CacheList.Contains(item)) _CacheList.Remove(item); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (Item tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ItemID.ToString())) - { - _CacheByPrimaryKey[tmp.ItemID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ItemID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (Item tmp in remove) - RemoveFromCache(tmp); - } - protected static Item GetCachedByPrimaryKey(int itemID) - { - ConvertListToDictionary(); - string key = itemID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextItemID = -1; - public static int NextItemID - { - get { return _nextItemID--; } - } - private int _ItemID; - [System.ComponentModel.DataObjectField(true, true)] - public int ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemID; - } - } - private int? _PreviousID; - public int? PreviousID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyPrevious != null) _PreviousID = _MyPrevious.ItemID; - return _PreviousID; - } - } - private Item _MyPrevious; - public Item MyPrevious - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyPrevious == null && _PreviousID != null) _MyPrevious = Item.Get((int)_PreviousID); - return _MyPrevious; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if ((_MyPrevious == null ? _PreviousID : (int?)_MyPrevious.ItemID) != (value == null ? null : (int?)value.ItemID)) - { - _MyPrevious = value; - _PreviousID = (value == null ? null : (int?)value.ItemID); - PropertyHasChanged(); - } - } - } - private int _ContentID; - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _ContentID = _MyContent.ContentID; - return _ContentID; - } - } - private Content _MyContent; - public Content MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _ContentID != 0) _MyContent = Content.Get(_ContentID); - return _MyContent; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyContent != value) - { - _MyContent = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _ItemAnnotationCount = 0; - /// - /// Count of ItemAnnotations for this Item - /// - public int ItemAnnotationCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemAnnotationCount; - } - } - private ItemAnnotations _ItemAnnotations = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ItemAnnotationsConverter))] - public ItemAnnotations ItemAnnotations - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ItemAnnotationCount > 0 && _ItemAnnotations == null) - _ItemAnnotations = ItemAnnotations.GetByItemID(ItemID); - else if (_ItemAnnotations == null) - _ItemAnnotations = ItemAnnotations.New(); - return _ItemAnnotations; - } - } - private int _ItemDocVersionCount = 0; - /// - /// Count of ItemDocVersions for this Item - /// - public int ItemDocVersionCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemDocVersionCount; - } - } - private ItemDocVersions _ItemDocVersions = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ItemDocVersionsConverter))] - public ItemDocVersions ItemDocVersions - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ItemDocVersionCount > 0 && _ItemDocVersions == null) - _ItemDocVersions = ItemDocVersions.GetByItemID(ItemID); - else if (_ItemDocVersions == null) - _ItemDocVersions = ItemDocVersions.New(); - return _ItemDocVersions; - } - } - private int _NextItemCount = 0; - /// - /// Count of NextItems for this Item - /// - public int NextItemCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _NextItemCount; - } - } - private NextItems _NextItems = null; - /// - /// Related Field - /// - [TypeConverter(typeof(NextItemsConverter))] - public NextItems NextItems - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_NextItemCount > 0 && _NextItems == null) - _NextItems = NextItems.GetByPreviousID(ItemID); - else if (_NextItems == null) - _NextItems = NextItems.New(); - return _NextItems; - } - } - private int _ItemPartCount = 0; - /// - /// Count of ItemParts for this Item - /// - public int ItemPartCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemPartCount; - } - } - private ItemParts _ItemParts = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ItemPartsConverter))] - public ItemParts ItemParts - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ItemPartCount > 0 && _ItemParts == null) - _ItemParts = ItemParts.GetByItemID(ItemID); - else if (_ItemParts == null) - _ItemParts = ItemParts.New(); - return _ItemParts; - } - } - private int _ItemTransition_RangeIDCount = 0; - /// - /// Count of ItemTransitions for this Item - /// - public int ItemTransition_RangeIDCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemTransition_RangeIDCount; - } - } - private ItemTransitions_RangeID _ItemTransitions_RangeID = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ItemTransitions_RangeIDConverter))] - public ItemTransitions_RangeID ItemTransitions_RangeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ItemTransition_RangeIDCount > 0 && _ItemTransitions_RangeID == null) - _ItemTransitions_RangeID = ItemTransitions_RangeID.GetByRangeID(ItemID); - else if (_ItemTransitions_RangeID == null) - _ItemTransitions_RangeID = ItemTransitions_RangeID.New(); - return _ItemTransitions_RangeID; - } - } - private int _ItemTransition_ToIDCount = 0; - /// - /// Count of ItemTransitions for this Item - /// - public int ItemTransition_ToIDCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemTransition_ToIDCount; - } - } - private ItemTransitions_ToID _ItemTransitions_ToID = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ItemTransitions_ToIDConverter))] - public ItemTransitions_ToID ItemTransitions_ToID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ItemTransition_ToIDCount > 0 && _ItemTransitions_ToID == null) - _ItemTransitions_ToID = ItemTransitions_ToID.GetByToID(ItemID); - else if (_ItemTransitions_ToID == null) - _ItemTransitions_ToID = ItemTransitions_ToID.New(); - return _ItemTransitions_ToID; - } - } - public override bool IsDirty - { - get { return base.IsDirty || (_ItemAnnotations == null ? false : _ItemAnnotations.IsDirty) || (_ItemDocVersions == null ? false : _ItemDocVersions.IsDirty) || (_NextItems == null ? false : _NextItems.IsDirty) || (_ItemParts == null ? false : _ItemParts.IsDirty) || (_ItemTransitions_RangeID == null ? false : _ItemTransitions_RangeID.IsDirty) || (_ItemTransitions_ToID == null ? false : _ItemTransitions_ToID.IsDirty) || (_MyContent == null ? false : _MyContent.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_ItemAnnotations == null ? true : _ItemAnnotations.IsValid) && (_ItemDocVersions == null ? true : _ItemDocVersions.IsValid) && (_NextItems == null ? true : _NextItems.IsValid) && (_ItemParts == null ? true : _ItemParts.IsValid) && (_ItemTransitions_RangeID == null ? true : _ItemTransitions_RangeID.IsValid) && (_ItemTransitions_ToID == null ? true : _ItemTransitions_ToID.IsValid) && (_MyContent == null ? true : _MyContent.IsValid); } - } - // TODO: Replace base Item.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Item - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check Item.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Item - protected override object GetIdValue() - { - return _ItemID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_ItemAnnotations != null && (hasBrokenRules = _ItemAnnotations.HasBrokenRules) != null) return hasBrokenRules; - if (_ItemDocVersions != null && (hasBrokenRules = _ItemDocVersions.HasBrokenRules) != null) return hasBrokenRules; - if (_NextItems != null && (hasBrokenRules = _NextItems.HasBrokenRules) != null) return hasBrokenRules; - if (_ItemParts != null && (hasBrokenRules = _ItemParts.HasBrokenRules) != null) return hasBrokenRules; - if (_ItemTransitions_RangeID != null && (hasBrokenRules = _ItemTransitions_RangeID.HasBrokenRules) != null) return hasBrokenRules; - if (_ItemTransitions_ToID != null && (hasBrokenRules = _ItemTransitions_ToID.HasBrokenRules) != null) return hasBrokenRules; - if (_MyContent != null && (hasBrokenRules = _MyContent.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyContentRequired, "MyContent"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _ItemExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _ItemExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - private static bool MyContentRequired(Item target, Csla.Validation.RuleArgs e) - { - if (target._ContentID == 0 && target._MyContent == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ItemID, ""); - //AuthorizationRules.AllowRead(PreviousID, ""); - //AuthorizationRules.AllowRead(ContentID, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(PreviousID, ""); - //AuthorizationRules.AllowWrite(ContentID, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - _ItemExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _ItemExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - /// - /// determines if related records (Foreign Keys) will keep this Item from being deleted - /// - public bool CanDelete - { - get - { - // Check to make sure that there are not any related records - int usedByCount = 0; - usedByCount += _ItemAnnotationCount; - usedByCount += _ItemDocVersionCount; - usedByCount += _ItemPartCount; - usedByCount += _ItemTransition_RangeIDCount; - usedByCount += _ItemTransition_ToIDCount; - usedByCount += _NextItemCount; - return (usedByCount == 0); - } - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _ItemUnique = 0; - protected static int ItemUnique - { get { return ++_ItemUnique; } } - private int _MyItemUnique = ItemUnique; - public int MyItemUnique - { get { return _MyItemUnique; } } - protected Item() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(ItemID.ToString())) - { - List listItem = _CacheByPrimaryKey[ItemID.ToString()]; // Get the list of items - while (listItem.Contains(this)) listItem.Remove(this); // Remove the item from the list - if (listItem.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(ItemID.ToString()); // remove the list - } - } - public static Item New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Item"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Item.New", ex); - } - } - public static Item New(Content myContent) - { - Item tmp = Item.New(); - tmp.MyContent = myContent; - return tmp; - } - public static Item New(Item myPrevious, Content myContent, DateTime dts, string userID) - { - Item tmp = Item.New(); - tmp.MyPrevious = myPrevious; - tmp.MyContent = myContent; - tmp.DTS = dts; - tmp.UserID = userID; - return tmp; - } - public static Item MakeItem(Item myPrevious, Content myContent, DateTime dts, string userID) - { - Item tmp = Item.New(myPrevious, myContent, dts, userID); - if (tmp.IsSavable) - { - Item tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Item New(Item myPrevious, Content myContent) - { - Item tmp = Item.New(); - tmp.MyPrevious = myPrevious; - tmp.MyContent = myContent; - return tmp; - } - public static Item MakeItem(Item myPrevious, Content myContent) - { - Item tmp = Item.New(myPrevious, myContent); - if (tmp.IsSavable) - { - Item tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Item Get(int itemID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Item"); - try - { - Item tmp = GetCachedByPrimaryKey(itemID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(itemID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Item - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Item.Get", ex); - } - } - public static Item Get(SafeDataReader dr, Item previous) - { - if (dr.Read()) return new Item(dr, previous); - return null; - } - internal Item(SafeDataReader dr) - { - ReadData(dr); - } - private Item(SafeDataReader dr, Item previous) - { - ReadData(dr); - MarkAsChild(); - } - internal Item(SafeDataReader dr, int parentID) - { - ReadData(dr); - MarkAsChild(); - } - public static void Delete(int itemID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Item"); - try - { - DataPortal.Delete(new PKCriteria(itemID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Item.Delete", ex); - } - } - public override Item Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Item"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Item"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Item"); - try - { - BuildRefreshList(); - Item item = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(item);//Refresh the item in AllList - ProcessRefreshList(); - return item; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _ItemID; - public int ItemID - { get { return _ItemID; } } - public PKCriteria(int itemID) - { - _ItemID = itemID; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _ItemID = NextItemID; - // Database Defaults - _DTS = _ItemExtension.DefaultDTS; - _UserID = _ItemExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.ReadData", GetHashCode()); - try - { - _ItemID = dr.GetInt32("ItemID"); - _PreviousID = (int?)dr.GetValue("PreviousID"); - _ContentID = dr.GetInt32("ContentID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _ItemAnnotationCount = dr.GetInt32("AnnotationCount"); - _ItemDocVersionCount = dr.GetInt32("DocVersionCount"); - _NextItemCount = dr.GetInt32("NextCount"); - _ItemPartCount = dr.GetInt32("PartCount"); - _ItemTransition_RangeIDCount = dr.GetInt32("Transition_RangeIDCount"); - _ItemTransition_ToIDCount = dr.GetInt32("Transition_ToIDCount"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Item.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getItem"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _ItemAnnotations = ItemAnnotations.Get(dr); - // load child objects - dr.NextResult(); - _ItemDocVersions = ItemDocVersions.Get(dr); - // load child objects - dr.NextResult(); - _ItemParts = ItemParts.Get(dr); - // load child objects - dr.NextResult(); - _ItemTransitions_RangeID = ItemTransitions_RangeID.Get(dr); - // load child objects - dr.NextResult(); - _ItemTransitions_ToID = ItemTransitions_ToID.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Item.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Item.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyContent != null) _MyContent.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addItem"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@PreviousID", PreviousID); - cm.Parameters.AddWithValue("@ContentID", ContentID); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - // Output Calculated Columns - SqlParameter param_ItemID = new SqlParameter("@newItemID", SqlDbType.Int); - param_ItemID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_ItemID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _ItemID = (int)cm.Parameters["@newItemID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_ItemAnnotations != null) _ItemAnnotations.Update(this); - if (_ItemDocVersions != null) _ItemDocVersions.Update(this); - if (_NextItems != null) _NextItems.Update(this); - if (_ItemParts != null) _ItemParts.Update(this); - if (_ItemTransitions_RangeID != null) _ItemTransitions_RangeID.Update(this); - if (_ItemTransitions_ToID != null) _ItemTransitions_ToID.Update(this); - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Item.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int itemID, Item myPrevious, Content myContent, DateTime dts, string userID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addItem"; - // Input All Fields - Except Calculated Columns - if (myPrevious != null) cm.Parameters.AddWithValue("@PreviousID", myPrevious.ItemID); - cm.Parameters.AddWithValue("@ContentID", myContent.ContentID); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - // Output Calculated Columns - SqlParameter param_ItemID = new SqlParameter("@newItemID", SqlDbType.Int); - param_ItemID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_ItemID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - itemID = (int)cm.Parameters["@newItemID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.Add", ex); - throw new DbCslaException("Item.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.SQLUpdate", GetHashCode()); - try - { - if (_MyContent != null) _MyContent.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateItem"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@ItemID", _ItemID); - cm.Parameters.AddWithValue("@PreviousID", PreviousID); - cm.Parameters.AddWithValue("@ContentID", ContentID); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - if (_ItemAnnotations != null) _ItemAnnotations.Update(this); - if (_ItemDocVersions != null) _ItemDocVersions.Update(this); - if (_NextItems != null) _NextItems.Update(this); - if (_ItemParts != null) _ItemParts.Update(this); - if (_ItemTransitions_RangeID != null) _ItemTransitions_RangeID.Update(this); - if (_ItemTransitions_ToID != null) _ItemTransitions_ToID.Update(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Item.Add(cn, ref _ItemID, _MyPrevious, _MyContent, _DTS, _UserID); - else - _LastChanged = Item.Update(cn, ref _ItemID, _MyPrevious, _MyContent, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - if (_ItemAnnotations != null) _ItemAnnotations.Update(this); - if (_ItemDocVersions != null) _ItemDocVersions.Update(this); - if (_NextItems != null) _NextItems.Update(this); - if (_ItemParts != null) _ItemParts.Update(this); - if (_ItemTransitions_RangeID != null) _ItemTransitions_RangeID.Update(this); - if (_ItemTransitions_ToID != null) _ItemTransitions_ToID.Update(this); - } - internal void DeleteSelf(Item item) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Item.Remove(cn, _ItemID); - MarkNew(); - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int itemID, Item myPrevious, Content myContent, DateTime dts, string userID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateItem"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ItemID", itemID); - if (myPrevious != null) cm.Parameters.AddWithValue("@PreviousID", myPrevious.ItemID); - cm.Parameters.AddWithValue("@ContentID", myContent.ContentID); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.Update", ex); - throw new DbCslaException("Item.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_ItemID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteItem"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Item.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int itemID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteItem"; - // Input PK Fields - cm.Parameters.AddWithValue("@ItemID", itemID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.Remove", ex); - throw new DbCslaException("Item.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int itemID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(itemID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Item.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _ItemID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int itemID) - { - _ItemID = itemID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Item.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsItem"; - cm.Parameters.AddWithValue("@ItemID", _ItemID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Item.DataPortal_Execute", ex); - throw new DbCslaException("Item.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - ItemExtension _ItemExtension = new ItemExtension(); - [Serializable()] - partial class ItemExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ItemConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Item) - { - // Return the ToString value - return ((Item)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ItemExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Item -// { -// partial class ItemExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemAnnotation.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemAnnotation.cs deleted file mode 100644 index b0cbd41b..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemAnnotation.cs +++ /dev/null @@ -1,550 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ItemAnnotation Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ItemAnnotationConverter))] - public partial class ItemAnnotation : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _AnnotationID; - [System.ComponentModel.DataObjectField(true, true)] - public int AnnotationID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyAnnotation != null) _AnnotationID = _MyAnnotation.AnnotationID; - return _AnnotationID; - } - } - private Annotation _MyAnnotation; - [System.ComponentModel.DataObjectField(true, true)] - public Annotation MyAnnotation - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyAnnotation == null && _AnnotationID != 0) _MyAnnotation = Annotation.Get(_AnnotationID); - return _MyAnnotation; - } - } - private int _TypeID; - public int TypeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyAnnotationType != null) _TypeID = _MyAnnotationType.TypeID; - return _TypeID; - } - } - private AnnotationType _MyAnnotationType; - public AnnotationType MyAnnotationType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyAnnotationType == null && _TypeID != 0) _MyAnnotationType = AnnotationType.Get(_TypeID); - return _MyAnnotationType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyAnnotationType != value) - { - _MyAnnotationType = value; - PropertyHasChanged(); - } - } - } - private string _RtfText = string.Empty; - public string RtfText - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RtfText; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_RtfText != value) - { - _RtfText = value; - PropertyHasChanged(); - } - } - } - private string _SearchText = string.Empty; - public string SearchText - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _SearchText; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_SearchText != value) - { - _SearchText = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private string _AnnotationType_Name = string.Empty; - public string AnnotationType_Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AnnotationType_Name; - } - } - private string _AnnotationType_Config = string.Empty; - public string AnnotationType_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AnnotationType_Config; - } - } - private DateTime _AnnotationType_DTS = new DateTime(); - public DateTime AnnotationType_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AnnotationType_DTS; - } - } - private string _AnnotationType_UserID = string.Empty; - public string AnnotationType_UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _AnnotationType_UserID; - } - } - // TODO: Check ItemAnnotation.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ItemAnnotation - protected override object GetIdValue() - { - return _AnnotationID; - } - // TODO: Replace base ItemAnnotation.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ItemAnnotation - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyAnnotationType == null ? false : _MyAnnotationType.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyAnnotationType == null ? true : _MyAnnotationType.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyAnnotationType != null && (hasBrokenRules = _MyAnnotationType.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyAnnotationTypeRequired, "MyAnnotationType"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("RtfText", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("SearchText", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - private static bool MyAnnotationTypeRequired(ItemAnnotation target, Csla.Validation.RuleArgs e) - { - if (target._TypeID == 0 && target._MyAnnotationType == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(AnnotationID, ""); - //AuthorizationRules.AllowRead(TypeID, ""); - //AuthorizationRules.AllowWrite(TypeID, ""); - //AuthorizationRules.AllowRead(RtfText, ""); - //AuthorizationRules.AllowWrite(RtfText, ""); - //AuthorizationRules.AllowRead(SearchText, ""); - //AuthorizationRules.AllowWrite(SearchText, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static ItemAnnotation New(AnnotationType myAnnotationType) - { - return new ItemAnnotation(myAnnotationType); - } - internal static ItemAnnotation Get(SafeDataReader dr) - { - return new ItemAnnotation(dr); - } - public ItemAnnotation() - { - MarkAsChild(); - _AnnotationID = Annotation.NextAnnotationID; - _DTS = _ItemAnnotationExtension.DefaultDTS; - _UserID = _ItemAnnotationExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private ItemAnnotation(AnnotationType myAnnotationType) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _DTS = _ItemAnnotationExtension.DefaultDTS; - _UserID = _ItemAnnotationExtension.DefaultUserID; - _MyAnnotationType = myAnnotationType; - ValidationRules.CheckRules(); - } - internal ItemAnnotation(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemAnnotation.FetchDR", GetHashCode()); - try - { - _AnnotationID = dr.GetInt32("AnnotationID"); - _TypeID = dr.GetInt32("TypeID"); - _RtfText = dr.GetString("RtfText"); - _SearchText = dr.GetString("SearchText"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _AnnotationType_Name = dr.GetString("AnnotationType_Name"); - _AnnotationType_Config = dr.GetString("AnnotationType_Config"); - _AnnotationType_DTS = dr.GetDateTime("AnnotationType_DTS"); - _AnnotationType_UserID = dr.GetString("AnnotationType_UserID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemAnnotation.FetchDR", ex); - throw new DbCslaException("ItemAnnotation.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Item myItem) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Annotation.Add(cn, ref _AnnotationID, myItem, _MyAnnotationType, _RtfText, _SearchText, _Config, _DTS, _UserID); - MarkOld(); - } - internal void Update(Item myItem) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Annotation.Update(cn, ref _AnnotationID, myItem, _MyAnnotationType, _RtfText, _SearchText, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Item myItem) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Annotation.Remove(cn, _AnnotationID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - ItemAnnotationExtension _ItemAnnotationExtension = new ItemAnnotationExtension(); - [Serializable()] - partial class ItemAnnotationExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ItemAnnotationConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ItemAnnotation) - { - // Return the ToString value - return ((ItemAnnotation)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ItemAnnotationExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ItemAnnotation -// { -// partial class ItemAnnotationExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemAnnotations.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemAnnotations.cs deleted file mode 100644 index 6a595bc4..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemAnnotations.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ItemAnnotations Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ItemAnnotationsConverter))] - public partial class ItemAnnotations : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public ItemAnnotation this[Annotation myAnnotation] - { - get - { - foreach (ItemAnnotation annotation in this) - if (annotation.AnnotationID == myAnnotation.AnnotationID) - return annotation; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public ItemAnnotation GetItem(Annotation myAnnotation) - { - foreach (ItemAnnotation annotation in this) - if (annotation.AnnotationID == myAnnotation.AnnotationID) - return annotation; - return null; - } - public ItemAnnotation Add(AnnotationType myAnnotationType) // One to Many - { - ItemAnnotation annotation = ItemAnnotation.New(myAnnotationType); - this.Add(annotation); - return annotation; - } - public void Remove(Annotation myAnnotation) - { - foreach (ItemAnnotation annotation in this) - { - if (annotation.AnnotationID == myAnnotation.AnnotationID) - { - Remove(annotation); - break; - } - } - } - public bool Contains(Annotation myAnnotation) - { - foreach (ItemAnnotation annotation in this) - if (annotation.AnnotationID == myAnnotation.AnnotationID) - return true; - return false; - } - public bool ContainsDeleted(Annotation myAnnotation) - { - foreach (ItemAnnotation annotation in DeletedList) - if (annotation.AnnotationID == myAnnotation.AnnotationID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (ItemAnnotation itemAnnotation in this) - if ((hasBrokenRules = itemAnnotation.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static ItemAnnotations New() - { - return new ItemAnnotations(); - } - internal static ItemAnnotations Get(SafeDataReader dr) - { - return new ItemAnnotations(dr); - } - public static ItemAnnotations GetByItemID(int itemID) - { - try - { - return DataPortal.Fetch(new ItemIDCriteria(itemID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemAnnotations.GetByItemID", ex); - } - } - private ItemAnnotations() - { - MarkAsChild(); - } - internal ItemAnnotations(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(ItemAnnotation.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ItemIDCriteria - { - public ItemIDCriteria(int itemID) - { - _ItemID = itemID; - } - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - private void DataPortal_Fetch(ItemIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemAnnotations.DataPortal_FetchItemID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAnnotationsByItemID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new ItemAnnotation(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemAnnotations.DataPortal_FetchItemID", ex); - throw new DbCslaException("ItemAnnotations.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Item item) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (ItemAnnotation obj in DeletedList) - obj.DeleteSelf(item);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (ItemAnnotation obj in this) - { - if (obj.IsNew) - obj.Insert(item); - else - obj.Update(item); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ItemAnnotationsPropertyDescriptor pd = new ItemAnnotationsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ItemAnnotationsPropertyDescriptor : vlnListPropertyDescriptor - { - private ItemAnnotation Item { get { return (ItemAnnotation)_Item; } } - public ItemAnnotationsPropertyDescriptor(ItemAnnotations collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ItemAnnotationsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ItemAnnotations) - { - // Return department and department role separated by comma. - return ((ItemAnnotations)value).Items.Count.ToString() + " Annotations"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemDocVersion.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemDocVersion.cs deleted file mode 100644 index c7de8343..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemDocVersion.cs +++ /dev/null @@ -1,681 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ItemDocVersion Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ItemDocVersionConverter))] - public partial class ItemDocVersion : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _VersionID; - [System.ComponentModel.DataObjectField(true, true)] - public int VersionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDocVersion != null) _VersionID = _MyDocVersion.VersionID; - return _VersionID; - } - } - private DocVersion _MyDocVersion; - [System.ComponentModel.DataObjectField(true, true)] - public DocVersion MyDocVersion - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDocVersion == null && _VersionID != 0) _MyDocVersion = DocVersion.Get(_VersionID); - return _MyDocVersion; - } - } - private int _FolderID; - public int FolderID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder != null) _FolderID = _MyFolder.FolderID; - return _FolderID; - } - } - private Folder _MyFolder; - public Folder MyFolder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder == null && _FolderID != 0) _MyFolder = Folder.Get(_FolderID); - return _MyFolder; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyFolder != value) - { - _MyFolder = value; - PropertyHasChanged(); - } - } - } - private int _VersionType; - /// - /// 0 Working Draft, 1 Temporary, 128 Revision, 129 Approved (Greater than 127 - non editable) - /// - public int VersionType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _VersionType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_VersionType != value) - { - _VersionType = value; - PropertyHasChanged(); - } - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Name != value) - { - _Name = value; - PropertyHasChanged(); - } - } - } - private string _Title = string.Empty; - public string Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Title; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Title != value) - { - _Title = value; - PropertyHasChanged(); - } - } - } - private int? _FormatID; - public int? FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat != null) _FormatID = _MyFormat.FormatID; - return _FormatID; - } - } - private Format _MyFormat; - public Format MyFormat - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFormat == null && _FormatID != null) _MyFormat = Format.Get((int)_FormatID); - return _MyFormat; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if ((_MyFormat == null ? _FormatID : (int?)_MyFormat.FormatID) != (value == null ? null : (int?)value.FormatID)) - { - _MyFormat = value; - _FormatID = (value == null ? null : (int?)value.FormatID); - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _Folder_ParentID; - public int Folder_ParentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_ParentID; - } - } - private int _Folder_DBID; - public int Folder_DBID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_DBID; - } - } - private string _Folder_Name = string.Empty; - public string Folder_Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_Name; - } - } - private string _Folder_Title = string.Empty; - public string Folder_Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_Title; - } - } - private string _Folder_ShortName = string.Empty; - public string Folder_ShortName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_ShortName; - } - } - private int? _Folder_FormatID; - public int? Folder_FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_FormatID; - } - } - private double? _Folder_ManualOrder; - public double? Folder_ManualOrder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_ManualOrder; - } - } - private string _Folder_Config = string.Empty; - public string Folder_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_Config; - } - } - private DateTime _Folder_DTS = new DateTime(); - public DateTime Folder_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_DTS; - } - } - private string _Folder_UsrID = string.Empty; - public string Folder_UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_UsrID; - } - } - // TODO: Check ItemDocVersion.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ItemDocVersion - protected override object GetIdValue() - { - return _VersionID; - } - // TODO: Replace base ItemDocVersion.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ItemDocVersion - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyFolder == null ? false : _MyFolder.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyFolder != null && (hasBrokenRules = _MyFolder.HasBrokenRules) != null) return hasBrokenRules; - if (_MyFormat != null && (hasBrokenRules = _MyFormat.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyFolderRequired, "MyFolder"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "Name"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Title", 510)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - private static bool MyFolderRequired(ItemDocVersion target, Csla.Validation.RuleArgs e) - { - if (target._FolderID == 0 && target._MyFolder == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(VersionID, ""); - //AuthorizationRules.AllowRead(FolderID, ""); - //AuthorizationRules.AllowWrite(FolderID, ""); - //AuthorizationRules.AllowRead(VersionType, ""); - //AuthorizationRules.AllowWrite(VersionType, ""); - //AuthorizationRules.AllowRead(Name, ""); - //AuthorizationRules.AllowWrite(Name, ""); - //AuthorizationRules.AllowRead(Title, ""); - //AuthorizationRules.AllowWrite(Title, ""); - //AuthorizationRules.AllowRead(FormatID, ""); - //AuthorizationRules.AllowWrite(FormatID, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static ItemDocVersion New(Folder myFolder, string name) - { - return new ItemDocVersion(myFolder, name); - } - internal static ItemDocVersion Get(SafeDataReader dr) - { - return new ItemDocVersion(dr); - } - public ItemDocVersion() - { - MarkAsChild(); - _VersionID = DocVersion.NextVersionID; - _VersionType = _ItemDocVersionExtension.DefaultVersionType; - _DTS = _ItemDocVersionExtension.DefaultDTS; - _UserID = _ItemDocVersionExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private ItemDocVersion(Folder myFolder, string name) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _VersionType = _ItemDocVersionExtension.DefaultVersionType; - _DTS = _ItemDocVersionExtension.DefaultDTS; - _UserID = _ItemDocVersionExtension.DefaultUserID; - _MyFolder = myFolder; - _Name = name; - ValidationRules.CheckRules(); - } - internal ItemDocVersion(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemDocVersion.FetchDR", GetHashCode()); - try - { - _VersionID = dr.GetInt32("VersionID"); - _FolderID = dr.GetInt32("FolderID"); - _VersionType = dr.GetInt32("VersionType"); - _Name = dr.GetString("Name"); - _Title = dr.GetString("Title"); - _FormatID = (int?)dr.GetValue("FormatID"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _Folder_ParentID = dr.GetInt32("Folder_ParentID"); - _Folder_DBID = dr.GetInt32("Folder_DBID"); - _Folder_Name = dr.GetString("Folder_Name"); - _Folder_Title = dr.GetString("Folder_Title"); - _Folder_ShortName = dr.GetString("Folder_ShortName"); - _Folder_FormatID = (int?)dr.GetValue("Folder_FormatID"); - _Folder_ManualOrder = (double?)dr.GetValue("Folder_ManualOrder"); - _Folder_Config = dr.GetString("Folder_Config"); - _Folder_DTS = dr.GetDateTime("Folder_DTS"); - _Folder_UsrID = dr.GetString("Folder_UsrID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemDocVersion.FetchDR", ex); - throw new DbCslaException("ItemDocVersion.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Item myItem) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = DocVersion.Add(cn, ref _VersionID, _MyFolder, _VersionType, _Name, _Title, myItem, _MyFormat, _Config, _DTS, _UserID); - MarkOld(); - } - internal void Update(Item myItem) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = DocVersion.Update(cn, ref _VersionID, _MyFolder, _VersionType, _Name, _Title, myItem, _MyFormat, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Item myItem) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - DocVersion.Remove(cn, _VersionID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - ItemDocVersionExtension _ItemDocVersionExtension = new ItemDocVersionExtension(); - [Serializable()] - partial class ItemDocVersionExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultVersionType - { - get { return 0; } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ItemDocVersionConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ItemDocVersion) - { - // Return the ToString value - return ((ItemDocVersion)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ItemDocVersionExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ItemDocVersion -// { -// partial class ItemDocVersionExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultVersionType -// { -// get { return 0; } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemDocVersions.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemDocVersions.cs deleted file mode 100644 index bc9e6e1d..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemDocVersions.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ItemDocVersions Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ItemDocVersionsConverter))] - public partial class ItemDocVersions : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public ItemDocVersion this[DocVersion myDocVersion] - { - get - { - foreach (ItemDocVersion docVersion in this) - if (docVersion.VersionID == myDocVersion.VersionID) - return docVersion; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public ItemDocVersion GetItem(DocVersion myDocVersion) - { - foreach (ItemDocVersion docVersion in this) - if (docVersion.VersionID == myDocVersion.VersionID) - return docVersion; - return null; - } - public ItemDocVersion Add(Folder myFolder, string name) // One to Many - { - ItemDocVersion docVersion = ItemDocVersion.New(myFolder, name); - this.Add(docVersion); - return docVersion; - } - public void Remove(DocVersion myDocVersion) - { - foreach (ItemDocVersion docVersion in this) - { - if (docVersion.VersionID == myDocVersion.VersionID) - { - Remove(docVersion); - break; - } - } - } - public bool Contains(DocVersion myDocVersion) - { - foreach (ItemDocVersion docVersion in this) - if (docVersion.VersionID == myDocVersion.VersionID) - return true; - return false; - } - public bool ContainsDeleted(DocVersion myDocVersion) - { - foreach (ItemDocVersion docVersion in DeletedList) - if (docVersion.VersionID == myDocVersion.VersionID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (ItemDocVersion itemDocVersion in this) - if ((hasBrokenRules = itemDocVersion.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static ItemDocVersions New() - { - return new ItemDocVersions(); - } - internal static ItemDocVersions Get(SafeDataReader dr) - { - return new ItemDocVersions(dr); - } - public static ItemDocVersions GetByItemID(int itemID) - { - try - { - return DataPortal.Fetch(new ItemIDCriteria(itemID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemDocVersions.GetByItemID", ex); - } - } - private ItemDocVersions() - { - MarkAsChild(); - } - internal ItemDocVersions(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(ItemDocVersion.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ItemIDCriteria - { - public ItemIDCriteria(int itemID) - { - _ItemID = itemID; - } - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - private void DataPortal_Fetch(ItemIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemDocVersions.DataPortal_FetchItemID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocVersionsByItemID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new ItemDocVersion(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemDocVersions.DataPortal_FetchItemID", ex); - throw new DbCslaException("ItemDocVersions.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Item item) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (ItemDocVersion obj in DeletedList) - obj.DeleteSelf(item);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (ItemDocVersion obj in this) - { - if (obj.IsNew) - obj.Insert(item); - else - obj.Update(item); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ItemDocVersionsPropertyDescriptor pd = new ItemDocVersionsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ItemDocVersionsPropertyDescriptor : vlnListPropertyDescriptor - { - private ItemDocVersion Item { get { return (ItemDocVersion)_Item; } } - public ItemDocVersionsPropertyDescriptor(ItemDocVersions collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ItemDocVersionsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ItemDocVersions) - { - // Return department and department role separated by comma. - return ((ItemDocVersions)value).Items.Count.ToString() + " DocVersions"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemInfo.cs deleted file mode 100644 index 6a730092..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemInfo.cs +++ /dev/null @@ -1,610 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void ItemInfoEvent(object sender); - /// - /// ItemInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ItemInfoConverter))] - public partial class ItemInfo : ReadOnlyBase, IDisposable - { - public event ItemInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(ItemInfo itemInfo) - { - if (!_CacheList.Contains(itemInfo)) _CacheList.Add(itemInfo); // In AddToCache - } - protected static void RemoveFromCache(ItemInfo itemInfo) - { - while (_CacheList.Contains(itemInfo)) _CacheList.Remove(itemInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (ItemInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ItemID.ToString())) - { - _CacheByPrimaryKey[tmp.ItemID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ItemID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (ItemInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(ItemInfoList lst) - { - foreach (ItemInfo item in lst) AddToCache(item); - } - protected static ItemInfo GetCachedByPrimaryKey(int itemID) - { - ConvertListToDictionary(); - string key = itemID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Item _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _ItemID; - [System.ComponentModel.DataObjectField(true, true)] - public int ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemID; - } - } - private int? _PreviousID; - public int? PreviousID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyPrevious != null) _PreviousID = _MyPrevious.ItemID; - return _PreviousID; - } - } - private ItemInfo _MyPrevious; - public ItemInfo MyPrevious - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyPrevious == null && _PreviousID != null) _MyPrevious = ItemInfo.Get((int)_PreviousID); - return _MyPrevious; - } - } - private int _ContentID; - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _ContentID = _MyContent.ContentID; - return _ContentID; - } - } - private ContentInfo _MyContent; - public ContentInfo MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _ContentID != 0) _MyContent = ContentInfo.Get(_ContentID); - return _MyContent; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - private int _ItemAnnotationCount = 0; - /// - /// Count of ItemAnnotations for this Item - /// - public int ItemAnnotationCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemAnnotationCount; - } - } - private AnnotationInfoList _ItemAnnotations = null; - [TypeConverter(typeof(AnnotationInfoListConverter))] - public AnnotationInfoList ItemAnnotations - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ItemAnnotationCount < 0 || (_ItemAnnotationCount > 0 && _ItemAnnotations == null)) - _ItemAnnotations = AnnotationInfoList.GetByItemID(_ItemID); - if (_ItemAnnotationCount < 0) - _ItemAnnotationCount = _ItemAnnotations.Count; - return _ItemAnnotations; - } - } - public void RefreshItemAnnotations() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ItemID.ToString())) - foreach (ItemInfo tmp in _CacheByPrimaryKey[_ItemID.ToString()]) - tmp._ItemAnnotationCount = -1; // This will cause the data to be requeried - } - private int _ItemDocVersionCount = 0; - /// - /// Count of ItemDocVersions for this Item - /// - public int ItemDocVersionCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemDocVersionCount; - } - } - private DocVersionInfoList _ItemDocVersions = null; - [TypeConverter(typeof(DocVersionInfoListConverter))] - public DocVersionInfoList ItemDocVersions - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ItemDocVersionCount < 0 || (_ItemDocVersionCount > 0 && _ItemDocVersions == null)) - _ItemDocVersions = DocVersionInfoList.GetByItemID(_ItemID); - if (_ItemDocVersionCount < 0) - _ItemDocVersionCount = _ItemDocVersions.Count; - return _ItemDocVersions; - } - } - public void RefreshItemDocVersions() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ItemID.ToString())) - foreach (ItemInfo tmp in _CacheByPrimaryKey[_ItemID.ToString()]) - tmp._ItemDocVersionCount = -1; // This will cause the data to be requeried - } - private int _NextItemCount = 0; - /// - /// Count of NextItems for this Item - /// - public int NextItemCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _NextItemCount; - } - } - private ItemInfoList _NextItems = null; - [TypeConverter(typeof(ItemInfoListConverter))] - public ItemInfoList NextItems - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_NextItemCount < 0 || (_NextItemCount > 0 && _NextItems == null)) - _NextItems = ItemInfoList.GetNext(_ItemID); - if (_NextItemCount < 0) - _NextItemCount = _NextItems.Count; - return _NextItems; - } - } - public void RefreshNextItems() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ItemID.ToString())) - foreach (ItemInfo tmp in _CacheByPrimaryKey[_ItemID.ToString()]) - tmp._NextItemCount = -1; // This will cause the data to be requeried - } - private int _ItemPartCount = 0; - /// - /// Count of ItemParts for this Item - /// - public int ItemPartCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemPartCount; - } - } - private PartInfoList _ItemParts = null; - [TypeConverter(typeof(PartInfoListConverter))] - public PartInfoList ItemParts - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ItemPartCount < 0 || (_ItemPartCount > 0 && _ItemParts == null)) - _ItemParts = PartInfoList.GetByItemID(_ItemID); - if (_ItemPartCount < 0) - _ItemPartCount = _ItemParts.Count; - return _ItemParts; - } - } - public void RefreshItemParts() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ItemID.ToString())) - foreach (ItemInfo tmp in _CacheByPrimaryKey[_ItemID.ToString()]) - tmp._ItemPartCount = -1; // This will cause the data to be requeried - } - private int _ItemTransition_RangeIDCount = 0; - /// - /// Count of ItemTransitions for this Item - /// - public int ItemTransition_RangeIDCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemTransition_RangeIDCount; - } - } - private TransitionInfoList _ItemTransitions_RangeID = null; - [TypeConverter(typeof(TransitionInfoListConverter))] - public TransitionInfoList ItemTransitions_RangeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ItemTransition_RangeIDCount < 0 || (_ItemTransition_RangeIDCount > 0 && _ItemTransitions_RangeID == null)) - _ItemTransitions_RangeID = TransitionInfoList.GetByRangeID(_ItemID); - if (_ItemTransition_RangeIDCount < 0) - _ItemTransition_RangeIDCount = _ItemTransitions_RangeID.Count; - return _ItemTransitions_RangeID; - } - } - public void RefreshItemTransitions_RangeID() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ItemID.ToString())) - foreach (ItemInfo tmp in _CacheByPrimaryKey[_ItemID.ToString()]) - tmp._ItemTransition_RangeIDCount = -1; // This will cause the data to be requeried - } - private int _ItemTransition_ToIDCount = 0; - /// - /// Count of ItemTransitions for this Item - /// - public int ItemTransition_ToIDCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ItemTransition_ToIDCount; - } - } - private TransitionInfoList _ItemTransitions_ToID = null; - [TypeConverter(typeof(TransitionInfoListConverter))] - public TransitionInfoList ItemTransitions_ToID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ItemTransition_ToIDCount < 0 || (_ItemTransition_ToIDCount > 0 && _ItemTransitions_ToID == null)) - _ItemTransitions_ToID = TransitionInfoList.GetByToID(_ItemID); - if (_ItemTransition_ToIDCount < 0) - _ItemTransition_ToIDCount = _ItemTransitions_ToID.Count; - return _ItemTransitions_ToID; - } - } - public void RefreshItemTransitions_ToID() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ItemID.ToString())) - foreach (ItemInfo tmp in _CacheByPrimaryKey[_ItemID.ToString()]) - tmp._ItemTransition_ToIDCount = -1; // This will cause the data to be requeried - } - // TODO: Replace base ItemInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ItemInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check ItemInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ItemInfo - protected override object GetIdValue() - { - return _ItemID; - } - #endregion - #region Factory Methods - private static int _ItemInfoUnique = 0; - private static int ItemInfoUnique - { get { return ++_ItemInfoUnique; } } - private int _MyItemInfoUnique = ItemInfoUnique; - public int MyItemInfoUnique - { get { return _MyItemInfoUnique; } } - protected ItemInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(ItemID.ToString())) return; - List listItemInfo = _CacheByPrimaryKey[ItemID.ToString()]; // Get the list of items - while (listItemInfo.Contains(this)) listItemInfo.Remove(this); // Remove the item from the list - if (listItemInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(ItemID.ToString()); // remove the list - } - public virtual Item Get() - { - return _Editable = Item.Get(_ItemID); - } - public static void Refresh(Item tmp) - { - string key = tmp.ItemID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ItemInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Item tmp) - { - if (_PreviousID != tmp.PreviousID) - { - if (MyPrevious != null) MyPrevious.RefreshNextItems(); // Update List for old value - _PreviousID = tmp.PreviousID; // Update the value - } - _MyPrevious = null; // Reset list so that the next line gets a new list - if (MyPrevious != null) MyPrevious.RefreshNextItems(); // Update List for new value - if (_ContentID != tmp.ContentID) - { - if (MyContent != null) MyContent.RefreshContentItems(); // Update List for old value - _ContentID = tmp.ContentID; // Update the value - } - _MyContent = null; // Reset list so that the next line gets a new list - if (MyContent != null) MyContent.RefreshContentItems(); // Update List for new value - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _ItemInfoExtension.Refresh(this); - if (_MyPrevious != null) - { - _MyPrevious.Dispose();// Dispose related value - _MyPrevious = null;// Reset related value - } - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(ContentItem tmp) - { - string key = tmp.ItemID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ItemInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ContentItem tmp) - { - if (_PreviousID != tmp.PreviousID) - { - if (MyPrevious != null) MyPrevious.RefreshNextItems(); // Update List for old value - _PreviousID = tmp.PreviousID; // Update the value - } - _MyPrevious = null; // Reset list so that the next line gets a new list - if (MyPrevious != null) MyPrevious.RefreshNextItems(); // Update List for new value - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _ItemInfoExtension.Refresh(this); - if (_MyPrevious != null) - { - _MyPrevious.Dispose();// Dispose related value - _MyPrevious = null;// Reset related value - } - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - OnChange();// raise an event - } - public static ItemInfo Get(int itemID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Item"); - try - { - ItemInfo tmp = GetCachedByPrimaryKey(itemID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(itemID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ItemInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal ItemInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfo.Constructor", ex); - throw new DbCslaException("ItemInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _ItemID; - public int ItemID - { get { return _ItemID; } } - public PKCriteria(int itemID) - { - _ItemID = itemID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.ReadData", GetHashCode()); - try - { - _ItemID = dr.GetInt32("ItemID"); - _PreviousID = (int?)dr.GetValue("PreviousID"); - _ContentID = dr.GetInt32("ContentID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _ItemAnnotationCount = dr.GetInt32("AnnotationCount"); - _ItemDocVersionCount = dr.GetInt32("DocVersionCount"); - _NextItemCount = dr.GetInt32("NextCount"); - _ItemPartCount = dr.GetInt32("PartCount"); - _ItemTransition_RangeIDCount = dr.GetInt32("Transition_RangeIDCount"); - _ItemTransition_ToIDCount = dr.GetInt32("Transition_ToIDCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ItemInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getItem"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ItemInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - ItemInfoExtension _ItemInfoExtension = new ItemInfoExtension(); - [Serializable()] - partial class ItemInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(ItemInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class ItemInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ItemInfo) - { - // Return the ToString value - return ((ItemInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemInfoList.cs deleted file mode 100644 index 9797584e..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemInfoList.cs +++ /dev/null @@ -1,312 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// ItemInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ItemInfoListConverter))] - public partial class ItemInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (ItemInfo tmp in this) - { - tmp.Changed += new ItemInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (ItemInfo tmp in this) - { - tmp.Changed -= new ItemInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static ItemInfoList _ItemInfoList = null; - /// - /// Return a list of all projects. - /// - public static ItemInfoList Get() - { - try - { - if (_ItemInfoList != null) - return _ItemInfoList; - ItemInfoList tmp = DataPortal.Fetch(); - ItemInfo.AddList(tmp); - tmp.AddEvents(); - _ItemInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static ItemInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on ItemInfoList.Get", ex); - // } - //} - public static ItemInfoList GetNext(int? previousID) - { - try - { - ItemInfoList tmp = DataPortal.Fetch(new PreviousIDCriteria(previousID)); - ItemInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetNext", ex); - } - } - public static ItemInfoList GetByContentID(int contentID) - { - try - { - ItemInfoList tmp = DataPortal.Fetch(new ContentIDCriteria(contentID)); - ItemInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemInfoList.GetByContentID", ex); - } - } - private ItemInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getItems"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new ItemInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class PreviousIDCriteria - { - public PreviousIDCriteria(int? previousID) - { - _PreviousID = previousID; - } - private int? _PreviousID; - public int? PreviousID - { - get { return _PreviousID; } - set { _PreviousID = value; } - } - } - private void DataPortal_Fetch(PreviousIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfoList.DataPortal_FetchPreviousID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getNextItems"; - cm.Parameters.AddWithValue("@PreviousID", criteria.PreviousID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new ItemInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfoList.DataPortal_FetchPreviousID", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ContentIDCriteria - { - public ContentIDCriteria(int contentID) - { - _ContentID = contentID; - } - private int _ContentID; - public int ContentID - { - get { return _ContentID; } - set { _ContentID = value; } - } - } - private void DataPortal_Fetch(ContentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemInfoList.DataPortal_FetchContentID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getItemsByContentID"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new ItemInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemInfoList.DataPortal_FetchContentID", ex); - throw new DbCslaException("ItemInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ItemInfoListPropertyDescriptor pd = new ItemInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ItemInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private ItemInfo Item { get { return (ItemInfo)_Item; } } - public ItemInfoListPropertyDescriptor(ItemInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ItemInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ItemInfoList) - { - // Return department and department role separated by comma. - return ((ItemInfoList)value).Items.Count.ToString() + " Items"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemPart.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemPart.cs deleted file mode 100644 index f277ce4e..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemPart.cs +++ /dev/null @@ -1,470 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ItemPart Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ItemPartConverter))] - public partial class ItemPart : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _ContentID; - [System.ComponentModel.DataObjectField(true, true)] - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _ContentID = _MyContent.ContentID; - return _ContentID; - } - } - private Content _MyContent; - [System.ComponentModel.DataObjectField(true, true)] - public Content MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _ContentID != 0) _MyContent = Content.Get(_ContentID); - return _MyContent; - } - } - private int _FromType; - [System.ComponentModel.DataObjectField(true, true)] - public int FromType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FromType; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private string _Content_Number = string.Empty; - public string Content_Number - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Number; - } - } - private string _Content_Text = string.Empty; - public string Content_Text - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Text; - } - } - private int? _Content_Type; - /// - /// 0 - Procedure, 10000 - Section, 20000 Step - /// - public int? Content_Type - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Type; - } - } - private int? _Content_FormatID; - public int? Content_FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_FormatID; - } - } - private string _Content_Config = string.Empty; - public string Content_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Config; - } - } - private DateTime _Content_DTS = new DateTime(); - public DateTime Content_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_DTS; - } - } - private string _Content_UserID = string.Empty; - public string Content_UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_UserID; - } - } - // TODO: Check ItemPart.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ItemPart - protected override object GetIdValue() - { - return (((((_ContentID.ToString() + _FromType.ToString()).GetHashCode().ToString()).GetHashCode().ToString()).GetHashCode().ToString()).GetHashCode().ToString()).GetHashCode(); - } - // TODO: Replace base ItemPart.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ItemPart - //public override string ToString() - //{ - // return base.ToString(); - //} - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ContentID, ""); - //AuthorizationRules.AllowRead(FromType, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static ItemPart New(Content myContent, int fromType) - { - return new ItemPart(myContent, fromType); - } - internal static ItemPart Get(SafeDataReader dr) - { - return new ItemPart(dr); - } - public ItemPart() - { - MarkAsChild(); - - _DTS = _ItemPartExtension.DefaultDTS; - _UserID = _ItemPartExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private ItemPart(Content myContent, int fromType) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _DTS = _ItemPartExtension.DefaultDTS; - _UserID = _ItemPartExtension.DefaultUserID; - _MyContent = myContent; - _FromType = fromType; - ValidationRules.CheckRules(); - } - internal ItemPart(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemPart.FetchDR", GetHashCode()); - try - { - _ContentID = dr.GetInt32("ContentID"); - _FromType = dr.GetInt32("FromType"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _Content_Number = dr.GetString("Content_Number"); - _Content_Text = dr.GetString("Content_Text"); - _Content_Type = (int?)dr.GetValue("Content_Type"); - _Content_FormatID = (int?)dr.GetValue("Content_FormatID"); - _Content_Config = dr.GetString("Content_Config"); - _Content_DTS = dr.GetDateTime("Content_DTS"); - _Content_UserID = dr.GetString("Content_UserID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemPart.FetchDR", ex); - throw new DbCslaException("ItemPart.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Item myItem) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Part.Add(cn, _MyContent, _FromType, myItem, _DTS, _UserID); - MarkOld(); - } - internal void Update(Item myItem) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Part.Update(cn, _MyContent, _FromType, myItem, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Item myItem) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Part.Remove(cn, _ContentID, _FromType); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - ItemPartExtension _ItemPartExtension = new ItemPartExtension(); - [Serializable()] - partial class ItemPartExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ItemPartConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ItemPart) - { - // Return the ToString value - return ((ItemPart)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ItemPartExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ItemPart -// { -// partial class ItemPartExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemParts.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemParts.cs deleted file mode 100644 index 69039767..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemParts.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ItemParts Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ItemPartsConverter))] - public partial class ItemParts : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public ItemPart this[Content myContent, int fromType] - { - get - { - foreach (ItemPart part in this) - if (part.ContentID == myContent.ContentID && part.FromType == fromType) - return part; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public ItemPart GetItem(Content myContent, int fromType) - { - foreach (ItemPart part in this) - if (part.ContentID == myContent.ContentID && part.FromType == fromType) - return part; - return null; - } - public ItemPart Add(Content myContent, int fromType) // One to Many - { - ItemPart part = ItemPart.New(myContent, fromType); - this.Add(part); - return part; - } - public void Remove(Content myContent, int fromType) - { - foreach (ItemPart part in this) - { - if (part.ContentID == myContent.ContentID && part.FromType == fromType) - { - Remove(part); - break; - } - } - } - public bool Contains(Content myContent, int fromType) - { - foreach (ItemPart part in this) - if (part.ContentID == myContent.ContentID && part.FromType == fromType) - return true; - return false; - } - public bool ContainsDeleted(Content myContent, int fromType) - { - foreach (ItemPart part in DeletedList) - if (part.ContentID == myContent.ContentID && part.FromType == fromType) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (ItemPart itemPart in this) - if ((hasBrokenRules = itemPart.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static ItemParts New() - { - return new ItemParts(); - } - internal static ItemParts Get(SafeDataReader dr) - { - return new ItemParts(dr); - } - public static ItemParts GetByItemID(int itemID) - { - try - { - return DataPortal.Fetch(new ItemIDCriteria(itemID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemParts.GetByItemID", ex); - } - } - private ItemParts() - { - MarkAsChild(); - } - internal ItemParts(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(ItemPart.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ItemIDCriteria - { - public ItemIDCriteria(int itemID) - { - _ItemID = itemID; - } - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - private void DataPortal_Fetch(ItemIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemParts.DataPortal_FetchItemID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPartsByItemID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new ItemPart(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemParts.DataPortal_FetchItemID", ex); - throw new DbCslaException("ItemParts.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Item item) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (ItemPart obj in DeletedList) - obj.DeleteSelf(item);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (ItemPart obj in this) - { - if (obj.IsNew) - obj.Insert(item); - else - obj.Update(item); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ItemPartsPropertyDescriptor pd = new ItemPartsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ItemPartsPropertyDescriptor : vlnListPropertyDescriptor - { - private ItemPart Item { get { return (ItemPart)_Item; } } - public ItemPartsPropertyDescriptor(ItemParts collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ItemPartsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ItemParts) - { - // Return department and department role separated by comma. - return ((ItemParts)value).Items.Count.ToString() + " Parts"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemTransition_RangeID.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemTransition_RangeID.cs deleted file mode 100644 index 77122eb3..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemTransition_RangeID.cs +++ /dev/null @@ -1,600 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ItemTransition_RangeID Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ItemTransition_RangeIDConverter))] - public partial class ItemTransition_RangeID : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _TransitionID; - [System.ComponentModel.DataObjectField(true, true)] - public int TransitionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyTransition != null) _TransitionID = _MyTransition.TransitionID; - return _TransitionID; - } - } - private Transition _MyTransition; - [System.ComponentModel.DataObjectField(true, true)] - public Transition MyTransition - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyTransition == null && _TransitionID != 0) _MyTransition = Transition.Get(_TransitionID); - return _MyTransition; - } - } - private int _FromID; - public int FromID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _FromID = _MyContent.ContentID; - return _FromID; - } - } - private Content _MyContent; - public Content MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _FromID != 0) _MyContent = Content.Get(_FromID); - return _MyContent; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyContent != value) - { - _MyContent = value; - PropertyHasChanged(); - } - } - } - private int _ToID; - /// - /// StructureID - /// - public int ToID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItemToID != null) _ToID = _MyItemToID.ItemID; - return _ToID; - } - } - private Item _MyItemToID; - public Item MyItemToID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItemToID == null && _ToID != 0) _MyItemToID = Item.Get(_ToID); - return _MyItemToID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyItemToID != value) - { - _MyItemToID = value; - PropertyHasChanged(); - } - } - } - private int _TranType; - public int TranType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _TranType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_TranType != value) - { - _TranType = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private string _Content_Number = string.Empty; - public string Content_Number - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Number; - } - } - private string _Content_Text = string.Empty; - public string Content_Text - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Text; - } - } - private int? _Content_Type; - /// - /// 0 - Procedure, 10000 - Section, 20000 Step - /// - public int? Content_Type - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Type; - } - } - private int? _Content_FormatID; - public int? Content_FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_FormatID; - } - } - private string _Content_Config = string.Empty; - public string Content_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Config; - } - } - private DateTime _Content_DTS = new DateTime(); - public DateTime Content_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_DTS; - } - } - private string _Content_UserID = string.Empty; - public string Content_UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_UserID; - } - } - // TODO: Check ItemTransition_RangeID.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ItemTransition_RangeID - protected override object GetIdValue() - { - return _TransitionID; - } - // TODO: Replace base ItemTransition_RangeID.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ItemTransition_RangeID - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyContent != null && (hasBrokenRules = _MyContent.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyContentRequired, "MyContent"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - private static bool MyContentRequired(ItemTransition_RangeID target, Csla.Validation.RuleArgs e) - { - if (target._FromID == 0 && target._MyContent == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(TransitionID, ""); - //AuthorizationRules.AllowRead(FromID, ""); - //AuthorizationRules.AllowWrite(FromID, ""); - //AuthorizationRules.AllowRead(ToID, ""); - //AuthorizationRules.AllowWrite(ToID, ""); - //AuthorizationRules.AllowRead(TranType, ""); - //AuthorizationRules.AllowWrite(TranType, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static ItemTransition_RangeID New(Content myContent, Item myItemToID) - { - return new ItemTransition_RangeID(myContent, myItemToID); - } - internal static ItemTransition_RangeID Get(SafeDataReader dr) - { - return new ItemTransition_RangeID(dr); - } - public ItemTransition_RangeID() - { - MarkAsChild(); - _TransitionID = Transition.NextTransitionID; - _TranType = _ItemTransition_RangeIDExtension.DefaultTranType; - _DTS = _ItemTransition_RangeIDExtension.DefaultDTS; - _UserID = _ItemTransition_RangeIDExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private ItemTransition_RangeID(Content myContent, Item myItemToID) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _TranType = _ItemTransition_RangeIDExtension.DefaultTranType; - _DTS = _ItemTransition_RangeIDExtension.DefaultDTS; - _UserID = _ItemTransition_RangeIDExtension.DefaultUserID; - _MyContent = myContent; - _MyItemToID = myItemToID; - ValidationRules.CheckRules(); - } - internal ItemTransition_RangeID(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemTransition_RangeID.FetchDR", GetHashCode()); - try - { - _TransitionID = dr.GetInt32("TransitionID"); - _FromID = dr.GetInt32("FromID"); - _ToID = dr.GetInt32("ToID"); - _TranType = dr.GetInt32("TranType"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _Content_Number = dr.GetString("Content_Number"); - _Content_Text = dr.GetString("Content_Text"); - _Content_Type = (int?)dr.GetValue("Content_Type"); - _Content_FormatID = (int?)dr.GetValue("Content_FormatID"); - _Content_Config = dr.GetString("Content_Config"); - _Content_DTS = dr.GetDateTime("Content_DTS"); - _Content_UserID = dr.GetString("Content_UserID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemTransition_RangeID.FetchDR", ex); - throw new DbCslaException("ItemTransition_RangeID.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Item myItemRangeID) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Transition.Add(cn, ref _TransitionID, _MyContent, _MyItemToID, myItemRangeID, _TranType, _Config, _DTS, _UserID); - MarkOld(); - } - internal void Update(Item myItemRangeID) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Transition.Update(cn, ref _TransitionID, _MyContent, _MyItemToID, myItemRangeID, _TranType, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Item myItemRangeID) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Transition.Remove(cn, _TransitionID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - ItemTransition_RangeIDExtension _ItemTransition_RangeIDExtension = new ItemTransition_RangeIDExtension(); - [Serializable()] - partial class ItemTransition_RangeIDExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultTranType - { - get { return 0; } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ItemTransition_RangeIDConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ItemTransition_RangeID) - { - // Return the ToString value - return ((ItemTransition_RangeID)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ItemTransition_RangeIDExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ItemTransition_RangeID -// { -// partial class ItemTransition_RangeIDExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultTranType -// { -// get { return 0; } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemTransition_ToID.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemTransition_ToID.cs deleted file mode 100644 index c2dddb61..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemTransition_ToID.cs +++ /dev/null @@ -1,597 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ItemTransition_ToID Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ItemTransition_ToIDConverter))] - public partial class ItemTransition_ToID : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _TransitionID; - [System.ComponentModel.DataObjectField(true, true)] - public int TransitionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyTransition != null) _TransitionID = _MyTransition.TransitionID; - return _TransitionID; - } - } - private Transition _MyTransition; - [System.ComponentModel.DataObjectField(true, true)] - public Transition MyTransition - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyTransition == null && _TransitionID != 0) _MyTransition = Transition.Get(_TransitionID); - return _MyTransition; - } - } - private int _FromID; - public int FromID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _FromID = _MyContent.ContentID; - return _FromID; - } - } - private Content _MyContent; - public Content MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _FromID != 0) _MyContent = Content.Get(_FromID); - return _MyContent; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyContent != value) - { - _MyContent = value; - PropertyHasChanged(); - } - } - } - private int _RangeID; - public int RangeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItemRangeID != null) _RangeID = _MyItemRangeID.ItemID; - return _RangeID; - } - } - private Item _MyItemRangeID; - public Item MyItemRangeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItemRangeID == null && _RangeID != 0) _MyItemRangeID = Item.Get(_RangeID); - return _MyItemRangeID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyItemRangeID != value) - { - _MyItemRangeID = value; - PropertyHasChanged(); - } - } - } - private int _TranType; - public int TranType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _TranType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_TranType != value) - { - _TranType = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private string _Content_Number = string.Empty; - public string Content_Number - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Number; - } - } - private string _Content_Text = string.Empty; - public string Content_Text - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Text; - } - } - private int? _Content_Type; - /// - /// 0 - Procedure, 10000 - Section, 20000 Step - /// - public int? Content_Type - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Type; - } - } - private int? _Content_FormatID; - public int? Content_FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_FormatID; - } - } - private string _Content_Config = string.Empty; - public string Content_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Config; - } - } - private DateTime _Content_DTS = new DateTime(); - public DateTime Content_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_DTS; - } - } - private string _Content_UserID = string.Empty; - public string Content_UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_UserID; - } - } - // TODO: Check ItemTransition_ToID.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ItemTransition_ToID - protected override object GetIdValue() - { - return _TransitionID; - } - // TODO: Replace base ItemTransition_ToID.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ItemTransition_ToID - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyContent != null && (hasBrokenRules = _MyContent.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyContentRequired, "MyContent"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - private static bool MyContentRequired(ItemTransition_ToID target, Csla.Validation.RuleArgs e) - { - if (target._FromID == 0 && target._MyContent == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(TransitionID, ""); - //AuthorizationRules.AllowRead(FromID, ""); - //AuthorizationRules.AllowWrite(FromID, ""); - //AuthorizationRules.AllowRead(RangeID, ""); - //AuthorizationRules.AllowWrite(RangeID, ""); - //AuthorizationRules.AllowRead(TranType, ""); - //AuthorizationRules.AllowWrite(TranType, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static ItemTransition_ToID New(Content myContent, Item myItemRangeID) - { - return new ItemTransition_ToID(myContent, myItemRangeID); - } - internal static ItemTransition_ToID Get(SafeDataReader dr) - { - return new ItemTransition_ToID(dr); - } - public ItemTransition_ToID() - { - MarkAsChild(); - _TransitionID = Transition.NextTransitionID; - _TranType = _ItemTransition_ToIDExtension.DefaultTranType; - _DTS = _ItemTransition_ToIDExtension.DefaultDTS; - _UserID = _ItemTransition_ToIDExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private ItemTransition_ToID(Content myContent, Item myItemRangeID) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _TranType = _ItemTransition_ToIDExtension.DefaultTranType; - _DTS = _ItemTransition_ToIDExtension.DefaultDTS; - _UserID = _ItemTransition_ToIDExtension.DefaultUserID; - _MyContent = myContent; - _MyItemRangeID = myItemRangeID; - ValidationRules.CheckRules(); - } - internal ItemTransition_ToID(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemTransition_ToID.FetchDR", GetHashCode()); - try - { - _TransitionID = dr.GetInt32("TransitionID"); - _FromID = dr.GetInt32("FromID"); - _RangeID = dr.GetInt32("RangeID"); - _TranType = dr.GetInt32("TranType"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _Content_Number = dr.GetString("Content_Number"); - _Content_Text = dr.GetString("Content_Text"); - _Content_Type = (int?)dr.GetValue("Content_Type"); - _Content_FormatID = (int?)dr.GetValue("Content_FormatID"); - _Content_Config = dr.GetString("Content_Config"); - _Content_DTS = dr.GetDateTime("Content_DTS"); - _Content_UserID = dr.GetString("Content_UserID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemTransition_ToID.FetchDR", ex); - throw new DbCslaException("ItemTransition_ToID.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Item myItemToID) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Transition.Add(cn, ref _TransitionID, _MyContent, myItemToID, _MyItemRangeID, _TranType, _Config, _DTS, _UserID); - MarkOld(); - } - internal void Update(Item myItemToID) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Transition.Update(cn, ref _TransitionID, _MyContent, myItemToID, _MyItemRangeID, _TranType, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Item myItemToID) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Transition.Remove(cn, _TransitionID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - ItemTransition_ToIDExtension _ItemTransition_ToIDExtension = new ItemTransition_ToIDExtension(); - [Serializable()] - partial class ItemTransition_ToIDExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultTranType - { - get { return 0; } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ItemTransition_ToIDConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ItemTransition_ToID) - { - // Return the ToString value - return ((ItemTransition_ToID)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ItemTransition_ToIDExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ItemTransition_ToID -// { -// partial class ItemTransition_ToIDExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultTranType -// { -// get { return 0; } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemTransitions_RangeID.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemTransitions_RangeID.cs deleted file mode 100644 index d827f228..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemTransitions_RangeID.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ItemTransitions_RangeID Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ItemTransitions_RangeIDConverter))] - public partial class ItemTransitions_RangeID : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public ItemTransition_RangeID this[Transition myTransition] - { - get - { - foreach (ItemTransition_RangeID transition in this) - if (transition.TransitionID == myTransition.TransitionID) - return transition; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public ItemTransition_RangeID GetItem(Transition myTransition) - { - foreach (ItemTransition_RangeID transition in this) - if (transition.TransitionID == myTransition.TransitionID) - return transition; - return null; - } - public ItemTransition_RangeID Add(Content myContent, Item myItemToID) // One to Many - { - ItemTransition_RangeID transition = ItemTransition_RangeID.New(myContent, myItemToID); - this.Add(transition); - return transition; - } - public void Remove(Transition myTransition) - { - foreach (ItemTransition_RangeID transition in this) - { - if (transition.TransitionID == myTransition.TransitionID) - { - Remove(transition); - break; - } - } - } - public bool Contains(Transition myTransition) - { - foreach (ItemTransition_RangeID transition in this) - if (transition.TransitionID == myTransition.TransitionID) - return true; - return false; - } - public bool ContainsDeleted(Transition myTransition) - { - foreach (ItemTransition_RangeID transition in DeletedList) - if (transition.TransitionID == myTransition.TransitionID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (ItemTransition_RangeID itemTransitionRangeID in this) - if ((hasBrokenRules = itemTransitionRangeID.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static ItemTransitions_RangeID New() - { - return new ItemTransitions_RangeID(); - } - internal static ItemTransitions_RangeID Get(SafeDataReader dr) - { - return new ItemTransitions_RangeID(dr); - } - public static ItemTransitions_RangeID GetByRangeID(int rangeID) - { - try - { - return DataPortal.Fetch(new RangeIDCriteria(rangeID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemTransitions_RangeID.GetByRangeID", ex); - } - } - private ItemTransitions_RangeID() - { - MarkAsChild(); - } - internal ItemTransitions_RangeID(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(ItemTransition_RangeID.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class RangeIDCriteria - { - public RangeIDCriteria(int rangeID) - { - _RangeID = rangeID; - } - private int _RangeID; - public int RangeID - { - get { return _RangeID; } - set { _RangeID = value; } - } - } - private void DataPortal_Fetch(RangeIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemTransitions_RangeID.DataPortal_FetchRangeID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getTransitionsByRangeID"; - cm.Parameters.AddWithValue("@RangeID", criteria.RangeID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new ItemTransition_RangeID(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemTransitions_RangeID.DataPortal_FetchRangeID", ex); - throw new DbCslaException("ItemTransitions_RangeID.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Item item) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (ItemTransition_RangeID obj in DeletedList) - obj.DeleteSelf(item);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (ItemTransition_RangeID obj in this) - { - if (obj.IsNew) - obj.Insert(item); - else - obj.Update(item); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ItemTransitions_RangeIDPropertyDescriptor pd = new ItemTransitions_RangeIDPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ItemTransitions_RangeIDPropertyDescriptor : vlnListPropertyDescriptor - { - private ItemTransition_RangeID Item { get { return (ItemTransition_RangeID)_Item; } } - public ItemTransitions_RangeIDPropertyDescriptor(ItemTransitions_RangeID collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ItemTransitions_RangeIDConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ItemTransitions_RangeID) - { - // Return department and department role separated by comma. - return ((ItemTransitions_RangeID)value).Items.Count.ToString() + " Transitions_RangeID"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemTransitions_ToID.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemTransitions_ToID.cs deleted file mode 100644 index 2d92fffd..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ItemTransitions_ToID.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ItemTransitions_ToID Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ItemTransitions_ToIDConverter))] - public partial class ItemTransitions_ToID : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public ItemTransition_ToID this[Transition myTransition] - { - get - { - foreach (ItemTransition_ToID transition in this) - if (transition.TransitionID == myTransition.TransitionID) - return transition; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public ItemTransition_ToID GetItem(Transition myTransition) - { - foreach (ItemTransition_ToID transition in this) - if (transition.TransitionID == myTransition.TransitionID) - return transition; - return null; - } - public ItemTransition_ToID Add(Content myContent, Item myItemRangeID) // One to Many - { - ItemTransition_ToID transition = ItemTransition_ToID.New(myContent, myItemRangeID); - this.Add(transition); - return transition; - } - public void Remove(Transition myTransition) - { - foreach (ItemTransition_ToID transition in this) - { - if (transition.TransitionID == myTransition.TransitionID) - { - Remove(transition); - break; - } - } - } - public bool Contains(Transition myTransition) - { - foreach (ItemTransition_ToID transition in this) - if (transition.TransitionID == myTransition.TransitionID) - return true; - return false; - } - public bool ContainsDeleted(Transition myTransition) - { - foreach (ItemTransition_ToID transition in DeletedList) - if (transition.TransitionID == myTransition.TransitionID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (ItemTransition_ToID itemTransitionToID in this) - if ((hasBrokenRules = itemTransitionToID.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static ItemTransitions_ToID New() - { - return new ItemTransitions_ToID(); - } - internal static ItemTransitions_ToID Get(SafeDataReader dr) - { - return new ItemTransitions_ToID(dr); - } - public static ItemTransitions_ToID GetByToID(int toID) - { - try - { - return DataPortal.Fetch(new ToIDCriteria(toID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ItemTransitions_ToID.GetByToID", ex); - } - } - private ItemTransitions_ToID() - { - MarkAsChild(); - } - internal ItemTransitions_ToID(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(ItemTransition_ToID.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ToIDCriteria - { - public ToIDCriteria(int toID) - { - _ToID = toID; - } - private int _ToID; - public int ToID - { - get { return _ToID; } - set { _ToID = value; } - } - } - private void DataPortal_Fetch(ToIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ItemTransitions_ToID.DataPortal_FetchToID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getTransitionsByToID"; - cm.Parameters.AddWithValue("@ToID", criteria.ToID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new ItemTransition_ToID(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ItemTransitions_ToID.DataPortal_FetchToID", ex); - throw new DbCslaException("ItemTransitions_ToID.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Item item) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (ItemTransition_ToID obj in DeletedList) - obj.DeleteSelf(item);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (ItemTransition_ToID obj in this) - { - if (obj.IsNew) - obj.Insert(item); - else - obj.Update(item); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ItemTransitions_ToIDPropertyDescriptor pd = new ItemTransitions_ToIDPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ItemTransitions_ToIDPropertyDescriptor : vlnListPropertyDescriptor - { - private ItemTransition_ToID Item { get { return (ItemTransition_ToID)_Item; } } - public ItemTransitions_ToIDPropertyDescriptor(ItemTransitions_ToID collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ItemTransitions_ToIDConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ItemTransitions_ToID) - { - // Return department and department role separated by comma. - return ((ItemTransitions_ToID)value).Items.Count.ToString() + " Transitions_ToID"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Membership.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Membership.cs deleted file mode 100644 index 039c31a5..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Membership.cs +++ /dev/null @@ -1,1173 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Membership Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(MembershipConverter))] - public partial class Membership : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshMemberships = new List(); - private void AddToRefreshList(List refreshMemberships) - { - if (IsDirty) - refreshMemberships.Add(this); - } - private void BuildRefreshList() - { - _RefreshMemberships = new List(); - AddToRefreshList(_RefreshMemberships); - } - private void ProcessRefreshList() - { - foreach (Membership tmp in _RefreshMemberships) - { - MembershipInfo.Refresh(tmp); - if (tmp._MyGroup != null) GroupInfo.Refresh(tmp._MyGroup); - if (tmp._MyUser != null) UserInfo.Refresh(tmp._MyUser); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Membership membership) - { - if (!_CacheList.Contains(membership)) _CacheList.Add(membership); // In AddToCache - } - protected static void RemoveFromCache(Membership membership) - { - while (_CacheList.Contains(membership)) _CacheList.Remove(membership); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (Membership tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.UGID.ToString())) - { - _CacheByPrimaryKey[tmp.UGID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.UGID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (Membership tmp in remove) - RemoveFromCache(tmp); - } - protected static Membership GetCachedByPrimaryKey(int ugid) - { - ConvertListToDictionary(); - string key = ugid.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextUGID = -1; - public static int NextUGID - { - get { return _nextUGID--; } - } - private int _UGID; - [System.ComponentModel.DataObjectField(true, true)] - public int UGID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UGID; - } - } - private int _UID; - public int UID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyUser != null) _UID = _MyUser.UID; - return _UID; - } - } - private User _MyUser; - public User MyUser - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyUser == null && _UID != 0) _MyUser = User.Get(_UID); - return _MyUser; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyUser != value) - { - _MyUser = value; - PropertyHasChanged(); - } - } - } - private int _GID; - public int GID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyGroup != null) _GID = _MyGroup.GID; - return _GID; - } - } - private Group _MyGroup; - public Group MyGroup - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyGroup == null && _GID != 0) _MyGroup = Group.Get(_GID); - return _MyGroup; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyGroup != value) - { - _MyGroup = value; - PropertyHasChanged(); - } - } - } - private string _StartDate = string.Empty; - public string StartDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _StartDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _StartDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_StartDate != tmp.ToString()) - { - _StartDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private string _EndDate = string.Empty; - public string EndDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _EndDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _EndDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_EndDate != tmp.ToString()) - { - _EndDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UsrID != value) - { - _UsrID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - public override bool IsDirty - { - get { return base.IsDirty || (_MyGroup == null ? false : _MyGroup.IsDirty) || (_MyUser == null ? false : _MyUser.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyGroup == null ? true : _MyGroup.IsValid) && (_MyUser == null ? true : _MyUser.IsValid); } - } - // TODO: Replace base Membership.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Membership - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check Membership.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Membership - protected override object GetIdValue() - { - return _UGID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyUser != null && (hasBrokenRules = _MyUser.HasBrokenRules) != null) return hasBrokenRules; - if (_MyGroup != null && (hasBrokenRules = _MyGroup.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyUserRequired, "MyUser"); - ValidationRules.AddRule(MyGroupRequired, "MyGroup"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "StartDate"); - ValidationRules.AddRule(StartDateValid, "StartDate"); - ValidationRules.AddRule(EndDateValid, "EndDate"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UsrID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UsrID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _MembershipExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _MembershipExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - private static bool StartDateValid(Membership target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._StartDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool EndDateValid(Membership target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._EndDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool MyUserRequired(Membership target, Csla.Validation.RuleArgs e) - { - if (target._UID == 0 && target._MyUser == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - private static bool MyGroupRequired(Membership target, Csla.Validation.RuleArgs e) - { - if (target._GID == 0 && target._MyGroup == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(UGID, ""); - //AuthorizationRules.AllowRead(UID, ""); - //AuthorizationRules.AllowRead(GID, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UsrID, ""); - //AuthorizationRules.AllowWrite(UID, ""); - //AuthorizationRules.AllowWrite(GID, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UsrID, ""); - _MembershipExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _MembershipExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _MembershipUnique = 0; - protected static int MembershipUnique - { get { return ++_MembershipUnique; } } - private int _MyMembershipUnique = MembershipUnique; - public int MyMembershipUnique - { get { return _MyMembershipUnique; } } - protected Membership() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(UGID.ToString())) - { - List listMembership = _CacheByPrimaryKey[UGID.ToString()]; // Get the list of items - while (listMembership.Contains(this)) listMembership.Remove(this); // Remove the item from the list - if (listMembership.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(UGID.ToString()); // remove the list - } - } - public static Membership New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Membership"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Membership.New", ex); - } - } - public static Membership New(User myUser, Group myGroup) - { - Membership tmp = Membership.New(); - tmp.MyUser = myUser; - tmp.MyGroup = myGroup; - return tmp; - } - public static Membership New(User myUser, Group myGroup, string startDate, string endDate, string config, DateTime dts, string usrID) - { - Membership tmp = Membership.New(); - tmp.MyUser = myUser; - tmp.MyGroup = myGroup; - tmp.StartDate = startDate; - tmp.EndDate = endDate; - tmp.Config = config; - tmp.DTS = dts; - tmp.UsrID = usrID; - return tmp; - } - public static Membership MakeMembership(User myUser, Group myGroup, string startDate, string endDate, string config, DateTime dts, string usrID) - { - Membership tmp = Membership.New(myUser, myGroup, startDate, endDate, config, dts, usrID); - if (tmp.IsSavable) - { - Membership tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Membership New(User myUser, Group myGroup, string endDate, string config) - { - Membership tmp = Membership.New(); - tmp.MyUser = myUser; - tmp.MyGroup = myGroup; - tmp.EndDate = endDate; - tmp.Config = config; - return tmp; - } - public static Membership MakeMembership(User myUser, Group myGroup, string endDate, string config) - { - Membership tmp = Membership.New(myUser, myGroup, endDate, config); - if (tmp.IsSavable) - { - Membership tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Membership Get(int ugid) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Membership"); - try - { - Membership tmp = GetCachedByPrimaryKey(ugid); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(ugid)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Membership - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Membership.Get", ex); - } - } - public static Membership Get(SafeDataReader dr) - { - if (dr.Read()) return new Membership(dr); - return null; - } - internal Membership(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int ugid) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Membership"); - try - { - DataPortal.Delete(new PKCriteria(ugid)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Membership.Delete", ex); - } - } - public override Membership Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Membership"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Membership"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Membership"); - try - { - BuildRefreshList(); - Membership membership = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(membership);//Refresh the item in AllList - ProcessRefreshList(); - return membership; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _UGID; - public int UGID - { get { return _UGID; } } - public PKCriteria(int ugid) - { - _UGID = ugid; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _UGID = NextUGID; - // Database Defaults - _StartDate = _MembershipExtension.DefaultStartDate; - _DTS = _MembershipExtension.DefaultDTS; - _UsrID = _MembershipExtension.DefaultUsrID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Membership.ReadData", GetHashCode()); - try - { - _UGID = dr.GetInt32("UGID"); - _UID = dr.GetInt32("UID"); - _GID = dr.GetInt32("GID"); - _StartDate = dr.GetSmartDate("StartDate").Text; - _EndDate = dr.GetSmartDate("EndDate").Text; - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Membership.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Membership.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Membership.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getMembership"; - cm.Parameters.AddWithValue("@UGID", criteria.UGID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Membership.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Membership.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Membership.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Membership.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Membership.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyGroup != null) _MyGroup.Update(); - if (_MyUser != null) _MyUser.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addMembership"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@UID", UID); - cm.Parameters.AddWithValue("@GID", GID); - cm.Parameters.AddWithValue("@StartDate", new SmartDate(_StartDate).DBValue); - cm.Parameters.AddWithValue("@EndDate", new SmartDate(_EndDate).DBValue); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UsrID", _UsrID); - // Output Calculated Columns - SqlParameter param_UGID = new SqlParameter("@newUGID", SqlDbType.Int); - param_UGID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_UGID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _UGID = (int)cm.Parameters["@newUGID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Membership.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Membership.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Membership.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int ugid, User myUser, Group myGroup, SmartDate startDate, SmartDate endDate, string config, DateTime dts, string usrID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Membership.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addMembership"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@UID", myUser.UID); - cm.Parameters.AddWithValue("@GID", myGroup.GID); - cm.Parameters.AddWithValue("@StartDate", startDate.DBValue); - cm.Parameters.AddWithValue("@EndDate", endDate.DBValue); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UsrID", usrID); - // Output Calculated Columns - SqlParameter param_UGID = new SqlParameter("@newUGID", SqlDbType.Int); - param_UGID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_UGID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - ugid = (int)cm.Parameters["@newUGID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Membership.Add", ex); - throw new DbCslaException("Membership.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Membership.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Membership.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Membership.SQLUpdate", GetHashCode()); - try - { - if (_MyGroup != null) _MyGroup.Update(); - if (_MyUser != null) _MyUser.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateMembership"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@UGID", _UGID); - cm.Parameters.AddWithValue("@UID", UID); - cm.Parameters.AddWithValue("@GID", GID); - cm.Parameters.AddWithValue("@StartDate", new SmartDate(_StartDate).DBValue); - cm.Parameters.AddWithValue("@EndDate", new SmartDate(_EndDate).DBValue); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UsrID", _UsrID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Membership.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Membership.Add(cn, ref _UGID, _MyUser, _MyGroup, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID); - else - _LastChanged = Membership.Update(cn, ref _UGID, _MyUser, _MyGroup, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID, ref _LastChanged); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int ugid, User myUser, Group myGroup, SmartDate startDate, SmartDate endDate, string config, DateTime dts, string usrID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Membership.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateMembership"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@UGID", ugid); - cm.Parameters.AddWithValue("@UID", myUser.UID); - cm.Parameters.AddWithValue("@GID", myGroup.GID); - cm.Parameters.AddWithValue("@StartDate", startDate.DBValue); - cm.Parameters.AddWithValue("@EndDate", endDate.DBValue); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UsrID", usrID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Membership.Update", ex); - throw new DbCslaException("Membership.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_UGID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Membership.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteMembership"; - cm.Parameters.AddWithValue("@UGID", criteria.UGID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Membership.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Membership.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int ugid) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Membership.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteMembership"; - // Input PK Fields - cm.Parameters.AddWithValue("@UGID", ugid); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Membership.Remove", ex); - throw new DbCslaException("Membership.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int ugid) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(ugid)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Membership.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _UGID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int ugid) - { - _UGID = ugid; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Membership.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsMembership"; - cm.Parameters.AddWithValue("@UGID", _UGID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Membership.DataPortal_Execute", ex); - throw new DbCslaException("Membership.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - MembershipExtension _MembershipExtension = new MembershipExtension(); - [Serializable()] - partial class MembershipExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual string DefaultStartDate - { - get { return DateTime.Now.ToShortDateString(); } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUsrID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class MembershipConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Membership) - { - // Return the ToString value - return ((Membership)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create MembershipExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Membership -// { -// partial class MembershipExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual SmartDate DefaultStartDate -// { -// get { return DateTime.Now.ToShortDateString(); } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUsrID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/MembershipInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/MembershipInfo.cs deleted file mode 100644 index 7139e7ac..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/MembershipInfo.cs +++ /dev/null @@ -1,477 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void MembershipInfoEvent(object sender); - /// - /// MembershipInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(MembershipInfoConverter))] - public partial class MembershipInfo : ReadOnlyBase, IDisposable - { - public event MembershipInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(MembershipInfo membershipInfo) - { - if (!_CacheList.Contains(membershipInfo)) _CacheList.Add(membershipInfo); // In AddToCache - } - protected static void RemoveFromCache(MembershipInfo membershipInfo) - { - while (_CacheList.Contains(membershipInfo)) _CacheList.Remove(membershipInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (MembershipInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.UGID.ToString())) - { - _CacheByPrimaryKey[tmp.UGID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.UGID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (MembershipInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(MembershipInfoList lst) - { - foreach (MembershipInfo item in lst) AddToCache(item); - } - protected static MembershipInfo GetCachedByPrimaryKey(int ugid) - { - ConvertListToDictionary(); - string key = ugid.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Membership _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _UGID; - [System.ComponentModel.DataObjectField(true, true)] - public int UGID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UGID; - } - } - private int _UID; - public int UID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyUser != null) _UID = _MyUser.UID; - return _UID; - } - } - private UserInfo _MyUser; - public UserInfo MyUser - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyUser == null && _UID != 0) _MyUser = UserInfo.Get(_UID); - return _MyUser; - } - } - private int _GID; - public int GID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyGroup != null) _GID = _MyGroup.GID; - return _GID; - } - } - private GroupInfo _MyGroup; - public GroupInfo MyGroup - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyGroup == null && _GID != 0) _MyGroup = GroupInfo.Get(_GID); - return _MyGroup; - } - } - private string _StartDate = string.Empty; - public string StartDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _StartDate; - } - } - private string _EndDate = string.Empty; - public string EndDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _EndDate; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - } - // TODO: Replace base MembershipInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current MembershipInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check MembershipInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current MembershipInfo - protected override object GetIdValue() - { - return _UGID; - } - #endregion - #region Factory Methods - private static int _MembershipInfoUnique = 0; - private static int MembershipInfoUnique - { get { return ++_MembershipInfoUnique; } } - private int _MyMembershipInfoUnique = MembershipInfoUnique; - public int MyMembershipInfoUnique - { get { return _MyMembershipInfoUnique; } } - protected MembershipInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(UGID.ToString())) return; - List listMembershipInfo = _CacheByPrimaryKey[UGID.ToString()]; // Get the list of items - while (listMembershipInfo.Contains(this)) listMembershipInfo.Remove(this); // Remove the item from the list - if (listMembershipInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(UGID.ToString()); // remove the list - } - public virtual Membership Get() - { - return _Editable = Membership.Get(_UGID); - } - public static void Refresh(Membership tmp) - { - string key = tmp.UGID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (MembershipInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Membership tmp) - { - if (_UID != tmp.UID) - { - if (MyUser != null) MyUser.RefreshUserMemberships(); // Update List for old value - _UID = tmp.UID; // Update the value - } - _MyUser = null; // Reset list so that the next line gets a new list - if (MyUser != null) MyUser.RefreshUserMemberships(); // Update List for new value - if (_GID != tmp.GID) - { - if (MyGroup != null) MyGroup.RefreshGroupMemberships(); // Update List for old value - _GID = tmp.GID; // Update the value - } - _MyGroup = null; // Reset list so that the next line gets a new list - if (MyGroup != null) MyGroup.RefreshGroupMemberships(); // Update List for new value - _StartDate = tmp.StartDate; - _EndDate = tmp.EndDate; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UsrID = tmp.UsrID; - _MembershipInfoExtension.Refresh(this); - if (_MyUser != null) - { - _MyUser.Dispose();// Dispose related value - _MyUser = null;// Reset related value - } - if (_MyGroup != null) - { - _MyGroup.Dispose();// Dispose related value - _MyGroup = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(GroupMembership tmp) - { - string key = tmp.UGID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (MembershipInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(GroupMembership tmp) - { - if (_UID != tmp.UID) - { - if (MyUser != null) MyUser.RefreshUserMemberships(); // Update List for old value - _UID = tmp.UID; // Update the value - } - _MyUser = null; // Reset list so that the next line gets a new list - if (MyUser != null) MyUser.RefreshUserMemberships(); // Update List for new value - _StartDate = tmp.StartDate; - _EndDate = tmp.EndDate; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UsrID = tmp.UsrID; - _MembershipInfoExtension.Refresh(this); - if (_MyUser != null) - { - _MyUser.Dispose();// Dispose related value - _MyUser = null;// Reset related value - } - if (_MyGroup != null) - { - _MyGroup.Dispose();// Dispose related value - _MyGroup = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(UserMembership tmp) - { - string key = tmp.UGID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (MembershipInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(UserMembership tmp) - { - if (_GID != tmp.GID) - { - if (MyGroup != null) MyGroup.RefreshGroupMemberships(); // Update List for old value - _GID = tmp.GID; // Update the value - } - _MyGroup = null; // Reset list so that the next line gets a new list - if (MyGroup != null) MyGroup.RefreshGroupMemberships(); // Update List for new value - _StartDate = tmp.StartDate; - _EndDate = tmp.EndDate; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UsrID = tmp.UsrID; - _MembershipInfoExtension.Refresh(this); - if (_MyUser != null) - { - _MyUser.Dispose();// Dispose related value - _MyUser = null;// Reset related value - } - if (_MyGroup != null) - { - _MyGroup.Dispose();// Dispose related value - _MyGroup = null;// Reset related value - } - OnChange();// raise an event - } - public static MembershipInfo Get(int ugid) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Membership"); - try - { - MembershipInfo tmp = GetCachedByPrimaryKey(ugid); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(ugid)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up MembershipInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on MembershipInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal MembershipInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] MembershipInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("MembershipInfo.Constructor", ex); - throw new DbCslaException("MembershipInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _UGID; - public int UGID - { get { return _UGID; } } - public PKCriteria(int ugid) - { - _UGID = ugid; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] MembershipInfo.ReadData", GetHashCode()); - try - { - _UGID = dr.GetInt32("UGID"); - _UID = dr.GetInt32("UID"); - _GID = dr.GetInt32("GID"); - _StartDate = dr.GetSmartDate("StartDate").Text; - _EndDate = dr.GetSmartDate("EndDate").Text; - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("MembershipInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("MembershipInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] MembershipInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getMembership"; - cm.Parameters.AddWithValue("@UGID", criteria.UGID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("MembershipInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("MembershipInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - MembershipInfoExtension _MembershipInfoExtension = new MembershipInfoExtension(); - [Serializable()] - partial class MembershipInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(MembershipInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class MembershipInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is MembershipInfo) - { - // Return the ToString value - return ((MembershipInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/MembershipInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/MembershipInfoList.cs deleted file mode 100644 index 3672a6ed..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/MembershipInfoList.cs +++ /dev/null @@ -1,312 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// MembershipInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(MembershipInfoListConverter))] - public partial class MembershipInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (MembershipInfo tmp in this) - { - tmp.Changed += new MembershipInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (MembershipInfo tmp in this) - { - tmp.Changed -= new MembershipInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static MembershipInfoList _MembershipInfoList = null; - /// - /// Return a list of all projects. - /// - public static MembershipInfoList Get() - { - try - { - if (_MembershipInfoList != null) - return _MembershipInfoList; - MembershipInfoList tmp = DataPortal.Fetch(); - MembershipInfo.AddList(tmp); - tmp.AddEvents(); - _MembershipInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on MembershipInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static MembershipInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on MembershipInfoList.Get", ex); - // } - //} - public static MembershipInfoList GetByGID(int gid) - { - try - { - MembershipInfoList tmp = DataPortal.Fetch(new GIDCriteria(gid)); - MembershipInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on MembershipInfoList.GetByGID", ex); - } - } - public static MembershipInfoList GetByUID(int uid) - { - try - { - MembershipInfoList tmp = DataPortal.Fetch(new UIDCriteria(uid)); - MembershipInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on MembershipInfoList.GetByUID", ex); - } - } - private MembershipInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] MembershipInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getMemberships"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new MembershipInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("MembershipInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("MembershipInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class GIDCriteria - { - public GIDCriteria(int gid) - { - _GID = gid; - } - private int _GID; - public int GID - { - get { return _GID; } - set { _GID = value; } - } - } - private void DataPortal_Fetch(GIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] MembershipInfoList.DataPortal_FetchGID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getMembershipsByGID"; - cm.Parameters.AddWithValue("@GID", criteria.GID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new MembershipInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("MembershipInfoList.DataPortal_FetchGID", ex); - throw new DbCslaException("MembershipInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class UIDCriteria - { - public UIDCriteria(int uid) - { - _UID = uid; - } - private int _UID; - public int UID - { - get { return _UID; } - set { _UID = value; } - } - } - private void DataPortal_Fetch(UIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] MembershipInfoList.DataPortal_FetchUID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getMembershipsByUID"; - cm.Parameters.AddWithValue("@UID", criteria.UID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new MembershipInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("MembershipInfoList.DataPortal_FetchUID", ex); - throw new DbCslaException("MembershipInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - MembershipInfoListPropertyDescriptor pd = new MembershipInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class MembershipInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private MembershipInfo Item { get { return (MembershipInfo)_Item; } } - public MembershipInfoListPropertyDescriptor(MembershipInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class MembershipInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is MembershipInfoList) - { - // Return department and department role separated by comma. - return ((MembershipInfoList)value).Items.Count.ToString() + " Memberships"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/NextItems.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/NextItems.cs deleted file mode 100644 index 03cb1ee7..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/NextItems.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// NextItems Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(NextItemsConverter))] - public partial class NextItems : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public new Item this[int itemID] - { - get - { - foreach (Item item in this) - if (item.ItemID == itemID) - return item; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public Item GetItem(int itemID) - { - foreach (Item item in this) - if (item.ItemID == itemID) - return item; - return null; - } - public Item Add(Content myContent) // One to Many - { - Item item = Item.New(myContent); - this.Add(item); - return item; - } - public void Remove(int itemID) - { - foreach (Item item in this) - { - if (item.ItemID == itemID) - { - Remove(item); - break; - } - } - } - public bool Contains(int itemID) - { - foreach (Item item in this) - if (item.ItemID == itemID) - return true; - return false; - } - public bool ContainsDeleted(int itemID) - { - foreach (Item item in DeletedList) - if (item.ItemID == itemID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (Item item in this) - if ((hasBrokenRules = item.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static NextItems New() - { - return new NextItems(); - } - internal static NextItems Get(SafeDataReader dr, Item parent) - { - return new NextItems(dr, parent); - } - public static NextItems GetByPreviousID(int previousID) - { - try - { - return DataPortal.Fetch(new PreviousIDCriteria(previousID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on NextItems.GetByPreviousID", ex); - } - } - private NextItems() - { - MarkAsChild(); - } - internal NextItems(SafeDataReader dr, Item parent) - { - MarkAsChild(); - Fetch(dr, parent); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr, Item parent) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(Item.Get(dr, parent)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class PreviousIDCriteria - { - public PreviousIDCriteria(int previousID) - { - _PreviousID = previousID; - } - private int _PreviousID; - public int PreviousID - { - get { return _PreviousID; } - set { _PreviousID = value; } - } - } - private void DataPortal_Fetch(PreviousIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] NextItems.DataPortal_FetchPreviousID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getNextItems"; - cm.Parameters.AddWithValue("@PreviousID", criteria.PreviousID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new Item(dr, criteria.PreviousID)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("NextItems.DataPortal_FetchPreviousID", ex); - throw new DbCslaException("NextItems.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Item item) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (Item obj in DeletedList) - obj.DeleteSelf(item);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (Item obj in this) - { - if (obj.IsNew) - obj.SQLInsert(); - else - obj.SQLUpdate(); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - NextItemsPropertyDescriptor pd = new NextItemsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class NextItemsPropertyDescriptor : vlnListPropertyDescriptor - { - private Item Item { get { return (Item)_Item; } } - public NextItemsPropertyDescriptor(NextItems collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class NextItemsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is NextItems) - { - // Return department and department role separated by comma. - return ((NextItems)value).Items.Count.ToString() + " Items"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Part.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Part.cs deleted file mode 100644 index c687501f..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Part.cs +++ /dev/null @@ -1,1005 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Part Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(PartConverter))] - public partial class Part : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshParts = new List(); - private void AddToRefreshList(List refreshParts) - { - if (IsDirty) - refreshParts.Add(this); - } - private void BuildRefreshList() - { - _RefreshParts = new List(); - AddToRefreshList(_RefreshParts); - } - private void ProcessRefreshList() - { - foreach (Part tmp in _RefreshParts) - { - PartInfo.Refresh(tmp); - if (tmp._MyContent != null) ContentInfo.Refresh(tmp._MyContent); - if (tmp._MyItem != null) ItemInfo.Refresh(tmp._MyItem); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Part part) - { - if (!_CacheList.Contains(part)) _CacheList.Add(part); // In AddToCache - } - protected static void RemoveFromCache(Part part) - { - while (_CacheList.Contains(part)) _CacheList.Remove(part); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (Part tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ContentID.ToString() + "_" + tmp.FromType.ToString())) - { - _CacheByPrimaryKey[tmp.ContentID.ToString() + "_" + tmp.FromType.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ContentID.ToString() + "_" + tmp.FromType.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (Part tmp in remove) - RemoveFromCache(tmp); - } - protected static Part GetCachedByPrimaryKey(int contentID, int fromType) - { - ConvertListToDictionary(); - string key = contentID.ToString() + "_" + fromType.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _ContentID; - [System.ComponentModel.DataObjectField(true, true)] - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _ContentID = _MyContent.ContentID; - return _ContentID; - } - } - private Content _MyContent; - [System.ComponentModel.DataObjectField(true, true)] - public Content MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _ContentID != 0) _MyContent = Content.Get(_ContentID); - return _MyContent; - } - } - private int _FromType; - [System.ComponentModel.DataObjectField(true, true)] - public int FromType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FromType; - } - } - private int _ItemID; - public int ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem != null) _ItemID = _MyItem.ItemID; - return _ItemID; - } - } - private Item _MyItem; - public Item MyItem - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem == null && _ItemID != 0) _MyItem = Item.Get(_ItemID); - return _MyItem; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyItem != value) - { - _MyItem = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - public override bool IsDirty - { - get { return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirty) || (_MyItem == null ? false : _MyItem.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid) && (_MyItem == null ? true : _MyItem.IsValid); } - } - // TODO: Replace base Part.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Part - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check Part.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Part - protected override object GetIdValue() - { - return (_ContentID.ToString() + "." + _FromType.ToString()).GetHashCode(); - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyItem != null && (hasBrokenRules = _MyItem.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyItemRequired, "MyItem"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _PartExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _PartExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - private static bool MyItemRequired(Part target, Csla.Validation.RuleArgs e) - { - if (target._ItemID == 0 && target._MyItem == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ContentID, ""); - //AuthorizationRules.AllowRead(FromType, ""); - //AuthorizationRules.AllowRead(ItemID, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(ItemID, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - _PartExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _PartExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _PartUnique = 0; - protected static int PartUnique - { get { return ++_PartUnique; } } - private int _MyPartUnique = PartUnique; - public int MyPartUnique - { get { return _MyPartUnique; } } - protected Part() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(ContentID.ToString() + "_" + FromType.ToString())) - { - List listPart = _CacheByPrimaryKey[ContentID.ToString() + "_" + FromType.ToString()]; // Get the list of items - while (listPart.Contains(this)) listPart.Remove(this); // Remove the item from the list - if (listPart.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(ContentID.ToString() + "_" + FromType.ToString()); // remove the list - } - } - public static Part New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Part"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Part.New", ex); - } - } - public static Part New(Content myContent, int fromType, Item myItem) - { - Part tmp = Part.New(); - tmp._MyContent = myContent; - tmp._FromType = fromType; - tmp.MyItem = myItem; - return tmp; - } - public static Part MakePart(Content myContent, int fromType, Item myItem) - { - Part tmp = Part.New(myContent, fromType, myItem); - if (tmp.IsSavable) - { - Part tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Part New(Content myContent, int fromType, Item myItem, DateTime dts, string userID) - { - Part tmp = Part.New(); - tmp._MyContent = myContent; - tmp._FromType = fromType; - tmp.MyItem = myItem; - tmp.DTS = dts; - tmp.UserID = userID; - return tmp; - } - public static Part MakePart(Content myContent, int fromType, Item myItem, DateTime dts, string userID) - { - Part tmp = Part.New(myContent, fromType, myItem, dts, userID); - if (tmp.IsSavable) - { - Part tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Part Get(int contentID, int fromType) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Part"); - try - { - Part tmp = GetCachedByPrimaryKey(contentID, fromType); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(contentID, fromType)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Part - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Part.Get", ex); - } - } - public static Part Get(SafeDataReader dr) - { - if (dr.Read()) return new Part(dr); - return null; - } - internal Part(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int contentID, int fromType) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Part"); - try - { - DataPortal.Delete(new PKCriteria(contentID, fromType)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Part.Delete", ex); - } - } - public override Part Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Part"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Part"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Part"); - try - { - BuildRefreshList(); - Part part = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(part);//Refresh the item in AllList - ProcessRefreshList(); - return part; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _ContentID; - public int ContentID - { get { return _ContentID; } } - private int _FromType; - public int FromType - { get { return _FromType; } } - public PKCriteria(int contentID, int fromType) - { - _ContentID = contentID; - _FromType = fromType; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - - // Database Defaults - _DTS = _PartExtension.DefaultDTS; - _UserID = _PartExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Part.ReadData", GetHashCode()); - try - { - _ContentID = dr.GetInt32("ContentID"); - _FromType = dr.GetInt32("FromType"); - _ItemID = dr.GetInt32("ItemID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Part.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Part.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Part.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPart"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - cm.Parameters.AddWithValue("@FromType", criteria.FromType); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Part.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Part.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Part.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Part.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Part.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyContent != null) _MyContent.Update(); - if (_MyItem != null) _MyItem.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addPart"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", ContentID); - cm.Parameters.AddWithValue("@FromType", _FromType); - cm.Parameters.AddWithValue("@ItemID", ItemID); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Part.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Part.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Part.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, Content myContent, int fromType, Item myItem, DateTime dts, string userID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Part.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addPart"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", myContent.ContentID); - cm.Parameters.AddWithValue("@FromType", fromType); - cm.Parameters.AddWithValue("@ItemID", myItem.ItemID); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Part.Add", ex); - throw new DbCslaException("Part.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Part.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Part.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Part.SQLUpdate", GetHashCode()); - try - { - if (_MyContent != null) _MyContent.Update(); - if (_MyItem != null) _MyItem.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updatePart"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@ContentID", ContentID); - cm.Parameters.AddWithValue("@FromType", _FromType); - cm.Parameters.AddWithValue("@ItemID", ItemID); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Part.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Part.Add(cn, _MyContent, _FromType, _MyItem, _DTS, _UserID); - else - _LastChanged = Part.Update(cn, _MyContent, _FromType, _MyItem, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, Content myContent, int fromType, Item myItem, DateTime dts, string userID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Part.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updatePart"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", myContent.ContentID); - cm.Parameters.AddWithValue("@FromType", fromType); - cm.Parameters.AddWithValue("@ItemID", myItem.ItemID); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Part.Update", ex); - throw new DbCslaException("Part.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_ContentID, _FromType)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Part.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deletePart"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - cm.Parameters.AddWithValue("@FromType", criteria.FromType); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Part.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Part.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int contentID, int fromType) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Part.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deletePart"; - // Input PK Fields - cm.Parameters.AddWithValue("@ContentID", contentID); - cm.Parameters.AddWithValue("@FromType", fromType); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Part.Remove", ex); - throw new DbCslaException("Part.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int contentID, int fromType) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(contentID, fromType)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Part.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _ContentID; - private int _FromType; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int contentID, int fromType) - { - _ContentID = contentID; - _FromType = fromType; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Part.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsPart"; - cm.Parameters.AddWithValue("@ContentID", _ContentID); - cm.Parameters.AddWithValue("@FromType", _FromType); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Part.DataPortal_Execute", ex); - throw new DbCslaException("Part.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - PartExtension _PartExtension = new PartExtension(); - [Serializable()] - partial class PartExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class PartConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Part) - { - // Return the ToString value - return ((Part)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create PartExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Part -// { -// partial class PartExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/PartInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/PartInfo.cs deleted file mode 100644 index daeb276a..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/PartInfo.cs +++ /dev/null @@ -1,431 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void PartInfoEvent(object sender); - /// - /// PartInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(PartInfoConverter))] - public partial class PartInfo : ReadOnlyBase, IDisposable - { - public event PartInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(PartInfo partInfo) - { - if (!_CacheList.Contains(partInfo)) _CacheList.Add(partInfo); // In AddToCache - } - protected static void RemoveFromCache(PartInfo partInfo) - { - while (_CacheList.Contains(partInfo)) _CacheList.Remove(partInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (PartInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ContentID.ToString() + "_" + tmp.FromType.ToString())) - { - _CacheByPrimaryKey[tmp.ContentID.ToString() + "_" + tmp.FromType.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ContentID.ToString() + "_" + tmp.FromType.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (PartInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(PartInfoList lst) - { - foreach (PartInfo item in lst) AddToCache(item); - } - protected static PartInfo GetCachedByPrimaryKey(int contentID, int fromType) - { - ConvertListToDictionary(); - string key = contentID.ToString() + "_" + fromType.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Part _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _ContentID; - [System.ComponentModel.DataObjectField(true, true)] - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _ContentID = _MyContent.ContentID; - return _ContentID; - } - } - private ContentInfo _MyContent; - [System.ComponentModel.DataObjectField(true, true)] - public ContentInfo MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _ContentID != 0) _MyContent = ContentInfo.Get(_ContentID); - return _MyContent; - } - } - private int _FromType; - [System.ComponentModel.DataObjectField(true, true)] - public int FromType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FromType; - } - } - private int _ItemID; - public int ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem != null) _ItemID = _MyItem.ItemID; - return _ItemID; - } - } - private ItemInfo _MyItem; - public ItemInfo MyItem - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItem == null && _ItemID != 0) _MyItem = ItemInfo.Get(_ItemID); - return _MyItem; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - // TODO: Replace base PartInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current PartInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check PartInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current PartInfo - protected override object GetIdValue() - { - return (_ContentID.ToString() + "." + _FromType.ToString()).GetHashCode(); - } - #endregion - #region Factory Methods - private static int _PartInfoUnique = 0; - private static int PartInfoUnique - { get { return ++_PartInfoUnique; } } - private int _MyPartInfoUnique = PartInfoUnique; - public int MyPartInfoUnique - { get { return _MyPartInfoUnique; } } - protected PartInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(ContentID.ToString() + "_" + FromType.ToString())) return; - List listPartInfo = _CacheByPrimaryKey[ContentID.ToString() + "_" + FromType.ToString()]; // Get the list of items - while (listPartInfo.Contains(this)) listPartInfo.Remove(this); // Remove the item from the list - if (listPartInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(ContentID.ToString() + "_" + FromType.ToString()); // remove the list - } - public virtual Part Get() - { - return _Editable = Part.Get(_ContentID, _FromType); - } - public static void Refresh(Part tmp) - { - string key = tmp.ContentID.ToString() + "_" + tmp.FromType.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (PartInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Part tmp) - { - if (_ItemID != tmp.ItemID) - { - if (MyItem != null) MyItem.RefreshItemParts(); // Update List for old value - _ItemID = tmp.ItemID; // Update the value - } - _MyItem = null; // Reset list so that the next line gets a new list - if (MyItem != null) MyItem.RefreshItemParts(); // Update List for new value - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _PartInfoExtension.Refresh(this); - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - if (_MyItem != null) - { - _MyItem.Dispose();// Dispose related value - _MyItem = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(Content myContent, ContentPart tmp) - { - string key = myContent.ContentID.ToString() + "_" + tmp.FromType.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (PartInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ContentPart tmp) - { - if (_ItemID != tmp.ItemID) - { - if (MyItem != null) MyItem.RefreshItemParts(); // Update List for old value - _ItemID = tmp.ItemID; // Update the value - } - _MyItem = null; // Reset list so that the next line gets a new list - if (MyItem != null) MyItem.RefreshItemParts(); // Update List for new value - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _PartInfoExtension.Refresh(this); - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - if (_MyItem != null) - { - _MyItem.Dispose();// Dispose related value - _MyItem = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(ItemPart tmp) - { - string key = tmp.ContentID.ToString() + "_" + tmp.FromType.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (PartInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ItemPart tmp) - { - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _PartInfoExtension.Refresh(this); - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - if (_MyItem != null) - { - _MyItem.Dispose();// Dispose related value - _MyItem = null;// Reset related value - } - OnChange();// raise an event - } - public static PartInfo Get(int contentID, int fromType) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Part"); - try - { - PartInfo tmp = GetCachedByPrimaryKey(contentID, fromType); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(contentID, fromType)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up PartInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on PartInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal PartInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] PartInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("PartInfo.Constructor", ex); - throw new DbCslaException("PartInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _ContentID; - public int ContentID - { get { return _ContentID; } } - private int _FromType; - public int FromType - { get { return _FromType; } } - public PKCriteria(int contentID, int fromType) - { - _ContentID = contentID; - _FromType = fromType; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] PartInfo.ReadData", GetHashCode()); - try - { - _ContentID = dr.GetInt32("ContentID"); - _FromType = dr.GetInt32("FromType"); - _ItemID = dr.GetInt32("ItemID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("PartInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("PartInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] PartInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPart"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - cm.Parameters.AddWithValue("@FromType", criteria.FromType); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("PartInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("PartInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - PartInfoExtension _PartInfoExtension = new PartInfoExtension(); - [Serializable()] - partial class PartInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(PartInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class PartInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is PartInfo) - { - // Return the ToString value - return ((PartInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/PartInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/PartInfoList.cs deleted file mode 100644 index 1b78f5a0..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/PartInfoList.cs +++ /dev/null @@ -1,312 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// PartInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(PartInfoListConverter))] - public partial class PartInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (PartInfo tmp in this) - { - tmp.Changed += new PartInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (PartInfo tmp in this) - { - tmp.Changed -= new PartInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static PartInfoList _PartInfoList = null; - /// - /// Return a list of all projects. - /// - public static PartInfoList Get() - { - try - { - if (_PartInfoList != null) - return _PartInfoList; - PartInfoList tmp = DataPortal.Fetch(); - PartInfo.AddList(tmp); - tmp.AddEvents(); - _PartInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on PartInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static PartInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on PartInfoList.Get", ex); - // } - //} - public static PartInfoList GetByContentID(int contentID) - { - try - { - PartInfoList tmp = DataPortal.Fetch(new ContentIDCriteria(contentID)); - PartInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on PartInfoList.GetByContentID", ex); - } - } - public static PartInfoList GetByItemID(int itemID) - { - try - { - PartInfoList tmp = DataPortal.Fetch(new ItemIDCriteria(itemID)); - PartInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on PartInfoList.GetByItemID", ex); - } - } - private PartInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] PartInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getParts"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new PartInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("PartInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("PartInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ContentIDCriteria - { - public ContentIDCriteria(int contentID) - { - _ContentID = contentID; - } - private int _ContentID; - public int ContentID - { - get { return _ContentID; } - set { _ContentID = value; } - } - } - private void DataPortal_Fetch(ContentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] PartInfoList.DataPortal_FetchContentID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPartsByContentID"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new PartInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("PartInfoList.DataPortal_FetchContentID", ex); - throw new DbCslaException("PartInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ItemIDCriteria - { - public ItemIDCriteria(int itemID) - { - _ItemID = itemID; - } - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - } - private void DataPortal_Fetch(ItemIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] PartInfoList.DataPortal_FetchItemID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPartsByItemID"; - cm.Parameters.AddWithValue("@ItemID", criteria.ItemID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new PartInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("PartInfoList.DataPortal_FetchItemID", ex); - throw new DbCslaException("PartInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - PartInfoListPropertyDescriptor pd = new PartInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class PartInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private PartInfo Item { get { return (PartInfo)_Item; } } - public PartInfoListPropertyDescriptor(PartInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class PartInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is PartInfoList) - { - // Return department and department role separated by comma. - return ((PartInfoList)value).Items.Count.ToString() + " Parts"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Permission.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Permission.cs deleted file mode 100644 index 6913dca7..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Permission.cs +++ /dev/null @@ -1,1251 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Permission Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(PermissionConverter))] - public partial class Permission : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshPermissions = new List(); - private void AddToRefreshList(List refreshPermissions) - { - if (IsDirty) - refreshPermissions.Add(this); - } - private void BuildRefreshList() - { - _RefreshPermissions = new List(); - AddToRefreshList(_RefreshPermissions); - } - private void ProcessRefreshList() - { - foreach (Permission tmp in _RefreshPermissions) - { - PermissionInfo.Refresh(tmp); - if (tmp._MyRole != null) RoleInfo.Refresh(tmp._MyRole); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Permission permission) - { - if (!_CacheList.Contains(permission)) _CacheList.Add(permission); // In AddToCache - } - protected static void RemoveFromCache(Permission permission) - { - while (_CacheList.Contains(permission)) _CacheList.Remove(permission); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (Permission tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.PID.ToString())) - { - _CacheByPrimaryKey[tmp.PID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.PID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (Permission tmp in remove) - RemoveFromCache(tmp); - } - protected static Permission GetCachedByPrimaryKey(int pid) - { - ConvertListToDictionary(); - string key = pid.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextPID = -1; - public static int NextPID - { - get { return _nextPID--; } - } - private int _PID; - [System.ComponentModel.DataObjectField(true, true)] - public int PID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _PID; - } - } - private int _RID; - public int RID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRole != null) _RID = _MyRole.RID; - return _RID; - } - } - private Role _MyRole; - public Role MyRole - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRole == null && _RID != 0) _MyRole = Role.Get(_RID); - return _MyRole; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyRole != value) - { - _MyRole = value; - PropertyHasChanged(); - } - } - } - private int _PermLevel; - /// - /// 0 - None, 1 - Security, 2 - System, 3 - RO, 4 - Procdures, 5 - Sections, 6 - Steps, 7 - Comments - /// - public int PermLevel - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _PermLevel; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_PermLevel != value) - { - _PermLevel = value; - PropertyHasChanged(); - } - } - } - private int _VersionType; - /// - /// 0 - None, 1 - Working Draft, 2 - Approved, (3 - All) - /// - public int VersionType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _VersionType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_VersionType != value) - { - _VersionType = value; - PropertyHasChanged(); - } - } - } - private int _PermValue; - /// - /// 1 - Read, 2 - Write, 4 - Create, 8 - Delete (15 - All) - /// - public int PermValue - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _PermValue; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_PermValue != value) - { - _PermValue = value; - PropertyHasChanged(); - } - } - } - private int _PermAD; - /// - /// 0 - Allow, 1 - Deny - /// - public int PermAD - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _PermAD; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_PermAD != value) - { - _PermAD = value; - PropertyHasChanged(); - } - } - } - private string _StartDate = string.Empty; - public string StartDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _StartDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _StartDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_StartDate != tmp.ToString()) - { - _StartDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private string _EndDate = string.Empty; - public string EndDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _EndDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _EndDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_EndDate != tmp.ToString()) - { - _EndDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UsrID != value) - { - _UsrID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - public override bool IsDirty - { - get { return base.IsDirty || (_MyRole == null ? false : _MyRole.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyRole == null ? true : _MyRole.IsValid); } - } - // TODO: Replace base Permission.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Permission - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check Permission.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Permission - protected override object GetIdValue() - { - return _PID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyRole != null && (hasBrokenRules = _MyRole.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyRoleRequired, "MyRole"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "StartDate"); - ValidationRules.AddRule(StartDateValid, "StartDate"); - ValidationRules.AddRule(EndDateValid, "EndDate"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UsrID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UsrID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _PermissionExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _PermissionExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - private static bool StartDateValid(Permission target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._StartDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool EndDateValid(Permission target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._EndDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool MyRoleRequired(Permission target, Csla.Validation.RuleArgs e) - { - if (target._RID == 0 && target._MyRole == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(PID, ""); - //AuthorizationRules.AllowRead(RID, ""); - //AuthorizationRules.AllowRead(PermLevel, ""); - //AuthorizationRules.AllowRead(VersionType, ""); - //AuthorizationRules.AllowRead(PermValue, ""); - //AuthorizationRules.AllowRead(PermAD, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UsrID, ""); - //AuthorizationRules.AllowWrite(RID, ""); - //AuthorizationRules.AllowWrite(PermLevel, ""); - //AuthorizationRules.AllowWrite(VersionType, ""); - //AuthorizationRules.AllowWrite(PermValue, ""); - //AuthorizationRules.AllowWrite(PermAD, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UsrID, ""); - _PermissionExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _PermissionExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _PermissionUnique = 0; - protected static int PermissionUnique - { get { return ++_PermissionUnique; } } - private int _MyPermissionUnique = PermissionUnique; - public int MyPermissionUnique - { get { return _MyPermissionUnique; } } - protected Permission() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(PID.ToString())) - { - List listPermission = _CacheByPrimaryKey[PID.ToString()]; // Get the list of items - while (listPermission.Contains(this)) listPermission.Remove(this); // Remove the item from the list - if (listPermission.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(PID.ToString()); // remove the list - } - } - public static Permission New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Permission"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Permission.New", ex); - } - } - public static Permission New(Role myRole, int permLevel, int versionType, int permValue) - { - Permission tmp = Permission.New(); - tmp.MyRole = myRole; - tmp.PermLevel = permLevel; - tmp.VersionType = versionType; - tmp.PermValue = permValue; - return tmp; - } - public static Permission New(Role myRole, int permLevel, int versionType, int permValue, int permAD, string startDate, string endDate, string config, DateTime dts, string usrID) - { - Permission tmp = Permission.New(); - tmp.MyRole = myRole; - tmp.PermLevel = permLevel; - tmp.VersionType = versionType; - tmp.PermValue = permValue; - tmp.PermAD = permAD; - tmp.StartDate = startDate; - tmp.EndDate = endDate; - tmp.Config = config; - tmp.DTS = dts; - tmp.UsrID = usrID; - return tmp; - } - public static Permission MakePermission(Role myRole, int permLevel, int versionType, int permValue, int permAD, string startDate, string endDate, string config, DateTime dts, string usrID) - { - Permission tmp = Permission.New(myRole, permLevel, versionType, permValue, permAD, startDate, endDate, config, dts, usrID); - if (tmp.IsSavable) - { - Permission tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Permission New(Role myRole, int permLevel, int versionType, int permValue, string endDate, string config) - { - Permission tmp = Permission.New(); - tmp.MyRole = myRole; - tmp.PermLevel = permLevel; - tmp.VersionType = versionType; - tmp.PermValue = permValue; - tmp.EndDate = endDate; - tmp.Config = config; - return tmp; - } - public static Permission MakePermission(Role myRole, int permLevel, int versionType, int permValue, string endDate, string config) - { - Permission tmp = Permission.New(myRole, permLevel, versionType, permValue, endDate, config); - if (tmp.IsSavable) - { - Permission tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Permission Get(int pid) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Permission"); - try - { - Permission tmp = GetCachedByPrimaryKey(pid); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(pid)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Permission - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Permission.Get", ex); - } - } - public static Permission Get(SafeDataReader dr) - { - if (dr.Read()) return new Permission(dr); - return null; - } - internal Permission(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int pid) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Permission"); - try - { - DataPortal.Delete(new PKCriteria(pid)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Permission.Delete", ex); - } - } - public override Permission Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Permission"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Permission"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Permission"); - try - { - BuildRefreshList(); - Permission permission = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(permission);//Refresh the item in AllList - ProcessRefreshList(); - return permission; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _PID; - public int PID - { get { return _PID; } } - public PKCriteria(int pid) - { - _PID = pid; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _PID = NextPID; - // Database Defaults - _PermAD = _PermissionExtension.DefaultPermAD; - _StartDate = _PermissionExtension.DefaultStartDate; - _DTS = _PermissionExtension.DefaultDTS; - _UsrID = _PermissionExtension.DefaultUsrID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Permission.ReadData", GetHashCode()); - try - { - _PID = dr.GetInt32("PID"); - _RID = dr.GetInt32("RID"); - _PermLevel = dr.GetInt32("PermLevel"); - _VersionType = dr.GetInt32("VersionType"); - _PermValue = dr.GetInt32("PermValue"); - _PermAD = dr.GetInt32("PermAD"); - _StartDate = dr.GetSmartDate("StartDate").Text; - _EndDate = dr.GetSmartDate("EndDate").Text; - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Permission.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Permission.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Permission.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPermission"; - cm.Parameters.AddWithValue("@PID", criteria.PID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Permission.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Permission.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Permission.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Permission.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Permission.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyRole != null) _MyRole.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addPermission"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@RID", RID); - cm.Parameters.AddWithValue("@PermLevel", _PermLevel); - cm.Parameters.AddWithValue("@VersionType", _VersionType); - cm.Parameters.AddWithValue("@PermValue", _PermValue); - cm.Parameters.AddWithValue("@PermAD", _PermAD); - cm.Parameters.AddWithValue("@StartDate", new SmartDate(_StartDate).DBValue); - cm.Parameters.AddWithValue("@EndDate", new SmartDate(_EndDate).DBValue); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UsrID", _UsrID); - // Output Calculated Columns - SqlParameter param_PID = new SqlParameter("@newPID", SqlDbType.Int); - param_PID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_PID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _PID = (int)cm.Parameters["@newPID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Permission.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Permission.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Permission.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int pid, Role myRole, int permLevel, int versionType, int permValue, int permAD, SmartDate startDate, SmartDate endDate, string config, DateTime dts, string usrID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Permission.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addPermission"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@RID", myRole.RID); - cm.Parameters.AddWithValue("@PermLevel", permLevel); - cm.Parameters.AddWithValue("@VersionType", versionType); - cm.Parameters.AddWithValue("@PermValue", permValue); - cm.Parameters.AddWithValue("@PermAD", permAD); - cm.Parameters.AddWithValue("@StartDate", startDate.DBValue); - cm.Parameters.AddWithValue("@EndDate", endDate.DBValue); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UsrID", usrID); - // Output Calculated Columns - SqlParameter param_PID = new SqlParameter("@newPID", SqlDbType.Int); - param_PID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_PID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - pid = (int)cm.Parameters["@newPID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Permission.Add", ex); - throw new DbCslaException("Permission.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Permission.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Permission.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Permission.SQLUpdate", GetHashCode()); - try - { - if (_MyRole != null) _MyRole.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updatePermission"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@PID", _PID); - cm.Parameters.AddWithValue("@RID", RID); - cm.Parameters.AddWithValue("@PermLevel", _PermLevel); - cm.Parameters.AddWithValue("@VersionType", _VersionType); - cm.Parameters.AddWithValue("@PermValue", _PermValue); - cm.Parameters.AddWithValue("@PermAD", _PermAD); - cm.Parameters.AddWithValue("@StartDate", new SmartDate(_StartDate).DBValue); - cm.Parameters.AddWithValue("@EndDate", new SmartDate(_EndDate).DBValue); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UsrID", _UsrID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Permission.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Permission.Add(cn, ref _PID, _MyRole, _PermLevel, _VersionType, _PermValue, _PermAD, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID); - else - _LastChanged = Permission.Update(cn, ref _PID, _MyRole, _PermLevel, _VersionType, _PermValue, _PermAD, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID, ref _LastChanged); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int pid, Role myRole, int permLevel, int versionType, int permValue, int permAD, SmartDate startDate, SmartDate endDate, string config, DateTime dts, string usrID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Permission.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updatePermission"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@PID", pid); - cm.Parameters.AddWithValue("@RID", myRole.RID); - cm.Parameters.AddWithValue("@PermLevel", permLevel); - cm.Parameters.AddWithValue("@VersionType", versionType); - cm.Parameters.AddWithValue("@PermValue", permValue); - cm.Parameters.AddWithValue("@PermAD", permAD); - cm.Parameters.AddWithValue("@StartDate", startDate.DBValue); - cm.Parameters.AddWithValue("@EndDate", endDate.DBValue); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UsrID", usrID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Permission.Update", ex); - throw new DbCslaException("Permission.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_PID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Permission.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deletePermission"; - cm.Parameters.AddWithValue("@PID", criteria.PID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Permission.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Permission.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int pid) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Permission.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deletePermission"; - // Input PK Fields - cm.Parameters.AddWithValue("@PID", pid); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Permission.Remove", ex); - throw new DbCslaException("Permission.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int pid) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(pid)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Permission.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _PID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int pid) - { - _PID = pid; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Permission.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsPermission"; - cm.Parameters.AddWithValue("@PID", _PID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Permission.DataPortal_Execute", ex); - throw new DbCslaException("Permission.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - PermissionExtension _PermissionExtension = new PermissionExtension(); - [Serializable()] - partial class PermissionExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultPermAD - { - get { return 0; } - } - public virtual string DefaultStartDate - { - get { return DateTime.Now.ToShortDateString(); } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUsrID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class PermissionConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Permission) - { - // Return the ToString value - return ((Permission)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create PermissionExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Permission -// { -// partial class PermissionExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultPermAD -// { -// get { return 0; } -// } -// public virtual SmartDate DefaultStartDate -// { -// get { return DateTime.Now.ToShortDateString(); } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUsrID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/PermissionInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/PermissionInfo.cs deleted file mode 100644 index 09e8d172..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/PermissionInfo.cs +++ /dev/null @@ -1,457 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void PermissionInfoEvent(object sender); - /// - /// PermissionInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(PermissionInfoConverter))] - public partial class PermissionInfo : ReadOnlyBase, IDisposable - { - public event PermissionInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(PermissionInfo permissionInfo) - { - if (!_CacheList.Contains(permissionInfo)) _CacheList.Add(permissionInfo); // In AddToCache - } - protected static void RemoveFromCache(PermissionInfo permissionInfo) - { - while (_CacheList.Contains(permissionInfo)) _CacheList.Remove(permissionInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (PermissionInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.PID.ToString())) - { - _CacheByPrimaryKey[tmp.PID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.PID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (PermissionInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(PermissionInfoList lst) - { - foreach (PermissionInfo item in lst) AddToCache(item); - } - protected static PermissionInfo GetCachedByPrimaryKey(int pid) - { - ConvertListToDictionary(); - string key = pid.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Permission _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _PID; - [System.ComponentModel.DataObjectField(true, true)] - public int PID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _PID; - } - } - private int _RID; - public int RID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRole != null) _RID = _MyRole.RID; - return _RID; - } - } - private RoleInfo _MyRole; - public RoleInfo MyRole - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRole == null && _RID != 0) _MyRole = RoleInfo.Get(_RID); - return _MyRole; - } - } - private int _PermLevel; - /// - /// 0 - None, 1 - Security, 2 - System, 3 - RO, 4 - Procdures, 5 - Sections, 6 - Steps, 7 - Comments - /// - public int PermLevel - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _PermLevel; - } - } - private int _VersionType; - /// - /// 0 - None, 1 - Working Draft, 2 - Approved, (3 - All) - /// - public int VersionType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _VersionType; - } - } - private int _PermValue; - /// - /// 1 - Read, 2 - Write, 4 - Create, 8 - Delete (15 - All) - /// - public int PermValue - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _PermValue; - } - } - private int _PermAD; - /// - /// 0 - Allow, 1 - Deny - /// - public int PermAD - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _PermAD; - } - } - private string _StartDate = string.Empty; - public string StartDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _StartDate; - } - } - private string _EndDate = string.Empty; - public string EndDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _EndDate; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - } - // TODO: Replace base PermissionInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current PermissionInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check PermissionInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current PermissionInfo - protected override object GetIdValue() - { - return _PID; - } - #endregion - #region Factory Methods - private static int _PermissionInfoUnique = 0; - private static int PermissionInfoUnique - { get { return ++_PermissionInfoUnique; } } - private int _MyPermissionInfoUnique = PermissionInfoUnique; - public int MyPermissionInfoUnique - { get { return _MyPermissionInfoUnique; } } - protected PermissionInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(PID.ToString())) return; - List listPermissionInfo = _CacheByPrimaryKey[PID.ToString()]; // Get the list of items - while (listPermissionInfo.Contains(this)) listPermissionInfo.Remove(this); // Remove the item from the list - if (listPermissionInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(PID.ToString()); // remove the list - } - public virtual Permission Get() - { - return _Editable = Permission.Get(_PID); - } - public static void Refresh(Permission tmp) - { - string key = tmp.PID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (PermissionInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Permission tmp) - { - if (_RID != tmp.RID) - { - if (MyRole != null) MyRole.RefreshRolePermissions(); // Update List for old value - _RID = tmp.RID; // Update the value - } - _MyRole = null; // Reset list so that the next line gets a new list - if (MyRole != null) MyRole.RefreshRolePermissions(); // Update List for new value - _PermLevel = tmp.PermLevel; - _VersionType = tmp.VersionType; - _PermValue = tmp.PermValue; - _PermAD = tmp.PermAD; - _StartDate = tmp.StartDate; - _EndDate = tmp.EndDate; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UsrID = tmp.UsrID; - _PermissionInfoExtension.Refresh(this); - if (_MyRole != null) - { - _MyRole.Dispose();// Dispose related value - _MyRole = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(RolePermission tmp) - { - string key = tmp.PID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (PermissionInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(RolePermission tmp) - { - _PermLevel = tmp.PermLevel; - _VersionType = tmp.VersionType; - _PermValue = tmp.PermValue; - _PermAD = tmp.PermAD; - _StartDate = tmp.StartDate; - _EndDate = tmp.EndDate; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UsrID = tmp.UsrID; - _PermissionInfoExtension.Refresh(this); - if (_MyRole != null) - { - _MyRole.Dispose();// Dispose related value - _MyRole = null;// Reset related value - } - OnChange();// raise an event - } - public static PermissionInfo Get(int pid) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Permission"); - try - { - PermissionInfo tmp = GetCachedByPrimaryKey(pid); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(pid)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up PermissionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on PermissionInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal PermissionInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] PermissionInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("PermissionInfo.Constructor", ex); - throw new DbCslaException("PermissionInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _PID; - public int PID - { get { return _PID; } } - public PKCriteria(int pid) - { - _PID = pid; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] PermissionInfo.ReadData", GetHashCode()); - try - { - _PID = dr.GetInt32("PID"); - _RID = dr.GetInt32("RID"); - _PermLevel = dr.GetInt32("PermLevel"); - _VersionType = dr.GetInt32("VersionType"); - _PermValue = dr.GetInt32("PermValue"); - _PermAD = dr.GetInt32("PermAD"); - _StartDate = dr.GetSmartDate("StartDate").Text; - _EndDate = dr.GetSmartDate("EndDate").Text; - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("PermissionInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("PermissionInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] PermissionInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPermission"; - cm.Parameters.AddWithValue("@PID", criteria.PID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("PermissionInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("PermissionInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - PermissionInfoExtension _PermissionInfoExtension = new PermissionInfoExtension(); - [Serializable()] - partial class PermissionInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(PermissionInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class PermissionInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is PermissionInfo) - { - // Return the ToString value - return ((PermissionInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/PermissionInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/PermissionInfoList.cs deleted file mode 100644 index 6b4500fd..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/PermissionInfoList.cs +++ /dev/null @@ -1,255 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// PermissionInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(PermissionInfoListConverter))] - public partial class PermissionInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (PermissionInfo tmp in this) - { - tmp.Changed += new PermissionInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (PermissionInfo tmp in this) - { - tmp.Changed -= new PermissionInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static PermissionInfoList _PermissionInfoList = null; - /// - /// Return a list of all projects. - /// - public static PermissionInfoList Get() - { - try - { - if (_PermissionInfoList != null) - return _PermissionInfoList; - PermissionInfoList tmp = DataPortal.Fetch(); - PermissionInfo.AddList(tmp); - tmp.AddEvents(); - _PermissionInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on PermissionInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static PermissionInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on PermissionInfoList.Get", ex); - // } - //} - public static PermissionInfoList GetByRID(int rid) - { - try - { - PermissionInfoList tmp = DataPortal.Fetch(new RIDCriteria(rid)); - PermissionInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on PermissionInfoList.GetByRID", ex); - } - } - private PermissionInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] PermissionInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPermissions"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new PermissionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("PermissionInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("PermissionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class RIDCriteria - { - public RIDCriteria(int rid) - { - _RID = rid; - } - private int _RID; - public int RID - { - get { return _RID; } - set { _RID = value; } - } - } - private void DataPortal_Fetch(RIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] PermissionInfoList.DataPortal_FetchRID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPermissionsByRID"; - cm.Parameters.AddWithValue("@RID", criteria.RID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new PermissionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("PermissionInfoList.DataPortal_FetchRID", ex); - throw new DbCslaException("PermissionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - PermissionInfoListPropertyDescriptor pd = new PermissionInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class PermissionInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private PermissionInfo Item { get { return (PermissionInfo)_Item; } } - public PermissionInfoListPropertyDescriptor(PermissionInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class PermissionInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is PermissionInfoList) - { - // Return department and department role separated by comma. - return ((PermissionInfoList)value).Items.Count.ToString() + " Permissions"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/PropertyDescriptor.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/PropertyDescriptor.cs deleted file mode 100644 index 3543e884..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/PropertyDescriptor.cs +++ /dev/null @@ -1,231 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// PropertyDescriptor Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - public partial class vlnListPropertyDescriptor : PropertyDescriptor - { - protected object _Item = null; - public vlnListPropertyDescriptor(System.Collections.IList collection, int index) - : base("#" + index.ToString(), null) - { _Item = collection[index]; } - public override bool CanResetValue(object component) - { return true; } - public override Type ComponentType - { get { return _Item.GetType(); } } - public override object GetValue(object component) - { return _Item; } - public override bool IsReadOnly - { get { return false; } } - public override Type PropertyType - { get { return _Item.GetType(); } } - public override void ResetValue(object component) - { ;} - public override bool ShouldSerializeValue(object component) - { return true; } - public override void SetValue(object component, object value) - { /*_Item = value*/;} - //public override AttributeCollection Attributes - //{ get { return new AttributeCollection(null); } } - public override string DisplayName - { get { return _Item.ToString(); } } - public override string Description - { get { return _Item.ToString(); } } - public override string Name - { get { return _Item.ToString(); } } - } // Class - public interface IVEHasBrokenRules - { - IVEHasBrokenRules HasBrokenRules { get; } - BrokenRulesCollection BrokenRules { get; } - } -} // Namespace -// The following are samples of ToString overrides -// public partial class Annotation -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class AnnotationInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class AnnotationType -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class AnnotationTypeAnnotation -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class AnnotationTypeInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class Assignment -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class AssignmentInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class Connection -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ConnectionFolder -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ConnectionInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class Content -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ContentDetail -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ContentItem -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ContentPart -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ContentRoUsage -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ContentTransition -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ContentInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class Detail -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class DetailInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class Document -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class DocumentEntry -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class DocumentInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class DocVersionROFst -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class DocVersionROFstInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class DocVersion -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class DocVersionDocVersionROFst -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class DocVersionInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class Entry -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class EntryInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class Folder -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class FolderAssignment -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class FolderDocVersion -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class FolderInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class Format -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class FormatContent -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class FormatDocVersion -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class FormatFolder -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class FormatInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class Group -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class GroupAssignment -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class GroupMembership -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class GroupInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class Item -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ItemAnnotation -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ItemDocVersion -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ItemPart -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ItemTransition_RangeID -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ItemTransition_ToID -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ItemInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class Membership -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class MembershipInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class Part -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class PartInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class Permission -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class PermissionInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class RODb -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class RODbROFst -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class RODbROImage -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class RODbRoUsage -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class RODbInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ROFstImage -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ROFstImageInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ROFst -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ROFstDocVersionROFst -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ROFstROFstImage -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ROFstInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ROImage -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ROImageROFstImage -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ROImageInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class Role -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class RoleAssignment -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class RolePermission -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class RoleInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class RoUsage -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class RoUsageInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class Transition -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class TransitionInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class User -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class UserMembership -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class UserInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ZContent -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ZContentInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ZTransition -// { public override string ToString() { return string.Format("{0}", _Name); } } -// public partial class ZTransitionInfo -// { public override string ToString() { return string.Format("{0}", _Name); } } \ No newline at end of file diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODb.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODb.cs deleted file mode 100644 index febd474c..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODb.cs +++ /dev/null @@ -1,1192 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// RODb Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RODbConverter))] - public partial class RODb : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshRODbs = new List(); - private List _RefreshRODbROFsts = new List(); - private List _RefreshRODbROImages = new List(); - private List _RefreshRODbRoUsages = new List(); - private void AddToRefreshList(List refreshRODbs, List refreshRODbROFsts, List refreshRODbROImages, List refreshRODbRoUsages) - { - if (IsDirty) - refreshRODbs.Add(this); - if (_RODbROFsts != null && _RODbROFsts.IsDirty) - { - foreach (RODbROFst tmp in _RODbROFsts) - { - if (tmp.IsDirty) refreshRODbROFsts.Add(tmp); - } - } - if (_RODbROImages != null && _RODbROImages.IsDirty) - { - foreach (RODbROImage tmp in _RODbROImages) - { - if (tmp.IsDirty) refreshRODbROImages.Add(tmp); - } - } - if (_RODbRoUsages != null && _RODbRoUsages.IsDirty) - { - foreach (RODbRoUsage tmp in _RODbRoUsages) - { - if (tmp.IsDirty) refreshRODbRoUsages.Add(tmp); - } - } - } - private void BuildRefreshList() - { - _RefreshRODbs = new List(); - _RefreshRODbROFsts = new List(); - _RefreshRODbROImages = new List(); - _RefreshRODbRoUsages = new List(); - AddToRefreshList(_RefreshRODbs, _RefreshRODbROFsts, _RefreshRODbROImages, _RefreshRODbRoUsages); - } - private void ProcessRefreshList() - { - foreach (RODb tmp in _RefreshRODbs) - { - RODbInfo.Refresh(tmp); - } - foreach (RODbROFst tmp in _RefreshRODbROFsts) - { - ROFstInfo.Refresh(tmp); - } - foreach (RODbROImage tmp in _RefreshRODbROImages) - { - ROImageInfo.Refresh(tmp); - } - foreach (RODbRoUsage tmp in _RefreshRODbRoUsages) - { - RoUsageInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(RODb rODb) - { - if (!_CacheList.Contains(rODb)) _CacheList.Add(rODb); // In AddToCache - } - protected static void RemoveFromCache(RODb rODb) - { - while (_CacheList.Contains(rODb)) _CacheList.Remove(rODb); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (RODb tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.RODbID.ToString())) - { - _CacheByPrimaryKey[tmp.RODbID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.RODbID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (RODb tmp in remove) - RemoveFromCache(tmp); - } - protected static RODb GetCachedByPrimaryKey(int rODbID) - { - ConvertListToDictionary(); - string key = rODbID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextRODbID = -1; - public static int NextRODbID - { - get { return _nextRODbID--; } - } - private int _RODbID; - [System.ComponentModel.DataObjectField(true, true)] - public int RODbID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RODbID; - } - } - private string _ROName = string.Empty; - /// - /// Hook for future - to allow the user to select multiple RO Databases assocaiated with on DocVersion - /// - public string ROName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROName; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_ROName != value) - { - _ROName = value; - PropertyHasChanged(); - } - } - } - private string _FolderPath = string.Empty; - /// - /// Path to the RO database - /// - public string FolderPath - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FolderPath; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_FolderPath != value) - { - _FolderPath = value; - PropertyHasChanged(); - } - } - } - private string _DBConnectionString = string.Empty; - /// - /// Connection String - Default could just be the full path and name of the database - /// - public string DBConnectionString - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DBConnectionString; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_DBConnectionString != value) - { - _DBConnectionString = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _RODbROFstCount = 0; - /// - /// Count of RODbROFsts for this RODb - /// - public int RODbROFstCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RODbROFstCount; - } - } - private RODbROFsts _RODbROFsts = null; - /// - /// Related Field - /// - [TypeConverter(typeof(RODbROFstsConverter))] - public RODbROFsts RODbROFsts - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_RODbROFstCount > 0 && _RODbROFsts == null) - _RODbROFsts = RODbROFsts.GetByRODbID(RODbID); - else if (_RODbROFsts == null) - _RODbROFsts = RODbROFsts.New(); - return _RODbROFsts; - } - } - private int _RODbROImageCount = 0; - /// - /// Count of RODbROImages for this RODb - /// - public int RODbROImageCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RODbROImageCount; - } - } - private RODbROImages _RODbROImages = null; - /// - /// Related Field - /// - [TypeConverter(typeof(RODbROImagesConverter))] - public RODbROImages RODbROImages - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_RODbROImageCount > 0 && _RODbROImages == null) - _RODbROImages = RODbROImages.GetByRODbID(RODbID); - else if (_RODbROImages == null) - _RODbROImages = RODbROImages.New(); - return _RODbROImages; - } - } - private int _RODbRoUsageCount = 0; - /// - /// Count of RODbRoUsages for this RODb - /// - public int RODbRoUsageCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RODbRoUsageCount; - } - } - private RODbRoUsages _RODbRoUsages = null; - /// - /// Related Field - /// - [TypeConverter(typeof(RODbRoUsagesConverter))] - public RODbRoUsages RODbRoUsages - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_RODbRoUsageCount > 0 && _RODbRoUsages == null) - _RODbRoUsages = RODbRoUsages.GetByRODbID(RODbID); - else if (_RODbRoUsages == null) - _RODbRoUsages = RODbRoUsages.New(); - return _RODbRoUsages; - } - } - public override bool IsDirty - { - get { return base.IsDirty || (_RODbROFsts == null ? false : _RODbROFsts.IsDirty) || (_RODbROImages == null ? false : _RODbROImages.IsDirty) || (_RODbRoUsages == null ? false : _RODbRoUsages.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_RODbROFsts == null ? true : _RODbROFsts.IsValid) && (_RODbROImages == null ? true : _RODbROImages.IsValid) && (_RODbRoUsages == null ? true : _RODbRoUsages.IsValid); } - } - // TODO: Replace base RODb.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current RODb - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check RODb.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current RODb - protected override object GetIdValue() - { - return _RODbID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_RODbRoUsages != null && (hasBrokenRules = _RODbRoUsages.HasBrokenRules) != null) return hasBrokenRules; - if (_RODbROFsts != null && (hasBrokenRules = _RODbROFsts.HasBrokenRules) != null) return hasBrokenRules; - if (_RODbROImages != null && (hasBrokenRules = _RODbROImages.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "ROName"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("ROName", 255)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "FolderPath"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("FolderPath", 255)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "DBConnectionString"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("DBConnectionString", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _RODbExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _RODbExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(RODbID, ""); - //AuthorizationRules.AllowRead(ROName, ""); - //AuthorizationRules.AllowRead(FolderPath, ""); - //AuthorizationRules.AllowRead(DBConnectionString, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(ROName, ""); - //AuthorizationRules.AllowWrite(FolderPath, ""); - //AuthorizationRules.AllowWrite(DBConnectionString, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - _RODbExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _RODbExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - /// - /// determines if related records (Foreign Keys) will keep this Item from being deleted - /// - public bool CanDelete - { - get - { - // Check to make sure that there are not any related records - int usedByCount = 0; - usedByCount += _RODbROFstCount; - usedByCount += _RODbROImageCount; - usedByCount += _RODbRoUsageCount; - return (usedByCount == 0); - } - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _RODbUnique = 0; - protected static int RODbUnique - { get { return ++_RODbUnique; } } - private int _MyRODbUnique = RODbUnique; - public int MyRODbUnique - { get { return _MyRODbUnique; } } - protected RODb() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(RODbID.ToString())) - { - List listRODb = _CacheByPrimaryKey[RODbID.ToString()]; // Get the list of items - while (listRODb.Contains(this)) listRODb.Remove(this); // Remove the item from the list - if (listRODb.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(RODbID.ToString()); // remove the list - } - } - public static RODb New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a RODb"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on RODb.New", ex); - } - } - public static RODb New(string rOName, string folderPath, string dBConnectionString) - { - RODb tmp = RODb.New(); - tmp.ROName = rOName; - tmp.FolderPath = folderPath; - tmp.DBConnectionString = dBConnectionString; - return tmp; - } - public static RODb MakeRODb(string rOName, string folderPath, string dBConnectionString) - { - RODb tmp = RODb.New(rOName, folderPath, dBConnectionString); - if (tmp.IsSavable) - { - RODb tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static RODb New(string rOName, string folderPath, string dBConnectionString, DateTime dts, string userID) - { - RODb tmp = RODb.New(); - tmp.ROName = rOName; - tmp.FolderPath = folderPath; - tmp.DBConnectionString = dBConnectionString; - tmp.DTS = dts; - tmp.UserID = userID; - return tmp; - } - public static RODb MakeRODb(string rOName, string folderPath, string dBConnectionString, DateTime dts, string userID) - { - RODb tmp = RODb.New(rOName, folderPath, dBConnectionString, dts, userID); - if (tmp.IsSavable) - { - RODb tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static RODb Get(int rODbID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a RODb"); - try - { - RODb tmp = GetCachedByPrimaryKey(rODbID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(rODbID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up RODb - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RODb.Get", ex); - } - } - public static RODb Get(SafeDataReader dr) - { - if (dr.Read()) return new RODb(dr); - return null; - } - internal RODb(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int rODbID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a RODb"); - try - { - DataPortal.Delete(new PKCriteria(rODbID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on RODb.Delete", ex); - } - } - public override RODb Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a RODb"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a RODb"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a RODb"); - try - { - BuildRefreshList(); - RODb rODb = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(rODb);//Refresh the item in AllList - ProcessRefreshList(); - return rODb; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _RODbID; - public int RODbID - { get { return _RODbID; } } - public PKCriteria(int rODbID) - { - _RODbID = rODbID; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _RODbID = NextRODbID; - // Database Defaults - _DTS = _RODbExtension.DefaultDTS; - _UserID = _RODbExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODb.ReadData", GetHashCode()); - try - { - _RODbID = dr.GetInt32("RODbID"); - _ROName = dr.GetString("ROName"); - _FolderPath = dr.GetString("FolderPath"); - _DBConnectionString = dr.GetString("DBConnectionString"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _RODbROFstCount = dr.GetInt32("ROFstCount"); - _RODbROImageCount = dr.GetInt32("ROImageCount"); - _RODbRoUsageCount = dr.GetInt32("RoUsageCount"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODb.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RODb.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODb.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRODb"; - cm.Parameters.AddWithValue("@RODbID", criteria.RODbID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _RODbROFsts = RODbROFsts.Get(dr); - // load child objects - dr.NextResult(); - _RODbROImages = RODbROImages.Get(dr); - // load child objects - dr.NextResult(); - _RODbRoUsages = RODbRoUsages.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODb.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RODb.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODb.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RODb.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODb.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addRODb"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ROName", _ROName); - cm.Parameters.AddWithValue("@FolderPath", _FolderPath); - cm.Parameters.AddWithValue("@DBConnectionString", _DBConnectionString); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - // Output Calculated Columns - SqlParameter param_RODbID = new SqlParameter("@newRODbID", SqlDbType.Int); - param_RODbID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_RODbID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _RODbID = (int)cm.Parameters["@newRODbID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_RODbRoUsages != null) _RODbRoUsages.Update(this); - if (_RODbROFsts != null) _RODbROFsts.Update(this); - if (_RODbROImages != null) _RODbROImages.Update(this); - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODb.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODb.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RODb.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int rODbID, string rOName, string folderPath, string dBConnectionString, DateTime dts, string userID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODb.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addRODb"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ROName", rOName); - cm.Parameters.AddWithValue("@FolderPath", folderPath); - cm.Parameters.AddWithValue("@DBConnectionString", dBConnectionString); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - // Output Calculated Columns - SqlParameter param_RODbID = new SqlParameter("@newRODbID", SqlDbType.Int); - param_RODbID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_RODbID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - rODbID = (int)cm.Parameters["@newRODbID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODb.Add", ex); - throw new DbCslaException("RODb.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODb.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODb.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODb.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateRODb"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@RODbID", _RODbID); - cm.Parameters.AddWithValue("@ROName", _ROName); - cm.Parameters.AddWithValue("@FolderPath", _FolderPath); - cm.Parameters.AddWithValue("@DBConnectionString", _DBConnectionString); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - if (_RODbRoUsages != null) _RODbRoUsages.Update(this); - if (_RODbROFsts != null) _RODbROFsts.Update(this); - if (_RODbROImages != null) _RODbROImages.Update(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODb.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = RODb.Add(cn, ref _RODbID, _ROName, _FolderPath, _DBConnectionString, _DTS, _UserID); - else - _LastChanged = RODb.Update(cn, ref _RODbID, _ROName, _FolderPath, _DBConnectionString, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - if (_RODbRoUsages != null) _RODbRoUsages.Update(this); - if (_RODbROFsts != null) _RODbROFsts.Update(this); - if (_RODbROImages != null) _RODbROImages.Update(this); - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int rODbID, string rOName, string folderPath, string dBConnectionString, DateTime dts, string userID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODb.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateRODb"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@RODbID", rODbID); - cm.Parameters.AddWithValue("@ROName", rOName); - cm.Parameters.AddWithValue("@FolderPath", folderPath); - cm.Parameters.AddWithValue("@DBConnectionString", dBConnectionString); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODb.Update", ex); - throw new DbCslaException("RODb.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_RODbID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODb.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteRODb"; - cm.Parameters.AddWithValue("@RODbID", criteria.RODbID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODb.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RODb.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int rODbID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODb.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteRODb"; - // Input PK Fields - cm.Parameters.AddWithValue("@RODbID", rODbID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODb.Remove", ex); - throw new DbCslaException("RODb.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int rODbID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(rODbID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RODb.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _RODbID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int rODbID) - { - _RODbID = rODbID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODb.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsRODb"; - cm.Parameters.AddWithValue("@RODbID", _RODbID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODb.DataPortal_Execute", ex); - throw new DbCslaException("RODb.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - RODbExtension _RODbExtension = new RODbExtension(); - [Serializable()] - partial class RODbExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class RODbConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RODb) - { - // Return the ToString value - return ((RODb)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create RODbExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class RODb -// { -// partial class RODbExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbInfo.cs deleted file mode 100644 index ad776452..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbInfo.cs +++ /dev/null @@ -1,452 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void RODbInfoEvent(object sender); - /// - /// RODbInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RODbInfoConverter))] - public partial class RODbInfo : ReadOnlyBase, IDisposable - { - public event RODbInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(RODbInfo rODbInfo) - { - if (!_CacheList.Contains(rODbInfo)) _CacheList.Add(rODbInfo); // In AddToCache - } - protected static void RemoveFromCache(RODbInfo rODbInfo) - { - while (_CacheList.Contains(rODbInfo)) _CacheList.Remove(rODbInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (RODbInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.RODbID.ToString())) - { - _CacheByPrimaryKey[tmp.RODbID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.RODbID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (RODbInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(RODbInfoList lst) - { - foreach (RODbInfo item in lst) AddToCache(item); - } - protected static RODbInfo GetCachedByPrimaryKey(int rODbID) - { - ConvertListToDictionary(); - string key = rODbID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected RODb _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _RODbID; - [System.ComponentModel.DataObjectField(true, true)] - public int RODbID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RODbID; - } - } - private string _ROName = string.Empty; - /// - /// Hook for future - to allow the user to select multiple RO Databases assocaiated with on DocVersion - /// - public string ROName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROName; - } - } - private string _FolderPath = string.Empty; - /// - /// Path to the RO database - /// - public string FolderPath - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FolderPath; - } - } - private string _DBConnectionString = string.Empty; - /// - /// Connection String - Default could just be the full path and name of the database - /// - public string DBConnectionString - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DBConnectionString; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - private int _RODbROFstCount = 0; - /// - /// Count of RODbROFsts for this RODb - /// - public int RODbROFstCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RODbROFstCount; - } - } - private ROFstInfoList _RODbROFsts = null; - [TypeConverter(typeof(ROFstInfoListConverter))] - public ROFstInfoList RODbROFsts - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_RODbROFstCount < 0 || (_RODbROFstCount > 0 && _RODbROFsts == null)) - _RODbROFsts = ROFstInfoList.GetByRODbID(_RODbID); - if (_RODbROFstCount < 0) - _RODbROFstCount = _RODbROFsts.Count; - return _RODbROFsts; - } - } - public void RefreshRODbROFsts() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_RODbID.ToString())) - foreach (RODbInfo tmp in _CacheByPrimaryKey[_RODbID.ToString()]) - tmp._RODbROFstCount = -1; // This will cause the data to be requeried - } - private int _RODbROImageCount = 0; - /// - /// Count of RODbROImages for this RODb - /// - public int RODbROImageCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RODbROImageCount; - } - } - private ROImageInfoList _RODbROImages = null; - [TypeConverter(typeof(ROImageInfoListConverter))] - public ROImageInfoList RODbROImages - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_RODbROImageCount < 0 || (_RODbROImageCount > 0 && _RODbROImages == null)) - _RODbROImages = ROImageInfoList.GetByRODbID(_RODbID); - if (_RODbROImageCount < 0) - _RODbROImageCount = _RODbROImages.Count; - return _RODbROImages; - } - } - public void RefreshRODbROImages() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_RODbID.ToString())) - foreach (RODbInfo tmp in _CacheByPrimaryKey[_RODbID.ToString()]) - tmp._RODbROImageCount = -1; // This will cause the data to be requeried - } - private int _RODbRoUsageCount = 0; - /// - /// Count of RODbRoUsages for this RODb - /// - public int RODbRoUsageCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RODbRoUsageCount; - } - } - private RoUsageInfoList _RODbRoUsages = null; - [TypeConverter(typeof(RoUsageInfoListConverter))] - public RoUsageInfoList RODbRoUsages - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_RODbRoUsageCount < 0 || (_RODbRoUsageCount > 0 && _RODbRoUsages == null)) - _RODbRoUsages = RoUsageInfoList.GetByRODbID(_RODbID); - if (_RODbRoUsageCount < 0) - _RODbRoUsageCount = _RODbRoUsages.Count; - return _RODbRoUsages; - } - } - public void RefreshRODbRoUsages() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_RODbID.ToString())) - foreach (RODbInfo tmp in _CacheByPrimaryKey[_RODbID.ToString()]) - tmp._RODbRoUsageCount = -1; // This will cause the data to be requeried - } - // TODO: Replace base RODbInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current RODbInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check RODbInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current RODbInfo - protected override object GetIdValue() - { - return _RODbID; - } - #endregion - #region Factory Methods - private static int _RODbInfoUnique = 0; - private static int RODbInfoUnique - { get { return ++_RODbInfoUnique; } } - private int _MyRODbInfoUnique = RODbInfoUnique; - public int MyRODbInfoUnique - { get { return _MyRODbInfoUnique; } } - protected RODbInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(RODbID.ToString())) return; - List listRODbInfo = _CacheByPrimaryKey[RODbID.ToString()]; // Get the list of items - while (listRODbInfo.Contains(this)) listRODbInfo.Remove(this); // Remove the item from the list - if (listRODbInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(RODbID.ToString()); // remove the list - } - public virtual RODb Get() - { - return _Editable = RODb.Get(_RODbID); - } - public static void Refresh(RODb tmp) - { - string key = tmp.RODbID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (RODbInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(RODb tmp) - { - _ROName = tmp.ROName; - _FolderPath = tmp.FolderPath; - _DBConnectionString = tmp.DBConnectionString; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _RODbInfoExtension.Refresh(this); - OnChange();// raise an event - } - public static RODbInfo Get(int rODbID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a RODb"); - try - { - RODbInfo tmp = GetCachedByPrimaryKey(rODbID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(rODbID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up RODbInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RODbInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal RODbInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODbInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODbInfo.Constructor", ex); - throw new DbCslaException("RODbInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _RODbID; - public int RODbID - { get { return _RODbID; } } - public PKCriteria(int rODbID) - { - _RODbID = rODbID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODbInfo.ReadData", GetHashCode()); - try - { - _RODbID = dr.GetInt32("RODbID"); - _ROName = dr.GetString("ROName"); - _FolderPath = dr.GetString("FolderPath"); - _DBConnectionString = dr.GetString("DBConnectionString"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _RODbROFstCount = dr.GetInt32("ROFstCount"); - _RODbROImageCount = dr.GetInt32("ROImageCount"); - _RODbRoUsageCount = dr.GetInt32("RoUsageCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODbInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RODbInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODbInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRODb"; - cm.Parameters.AddWithValue("@RODbID", criteria.RODbID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODbInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RODbInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - RODbInfoExtension _RODbInfoExtension = new RODbInfoExtension(); - [Serializable()] - partial class RODbInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(RODbInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class RODbInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RODbInfo) - { - // Return the ToString value - return ((RODbInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbInfoList.cs deleted file mode 100644 index 7e667913..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbInfoList.cs +++ /dev/null @@ -1,198 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// RODbInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RODbInfoListConverter))] - public partial class RODbInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (RODbInfo tmp in this) - { - tmp.Changed += new RODbInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (RODbInfo tmp in this) - { - tmp.Changed -= new RODbInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static RODbInfoList _RODbInfoList = null; - /// - /// Return a list of all projects. - /// - public static RODbInfoList Get() - { - try - { - if (_RODbInfoList != null) - return _RODbInfoList; - RODbInfoList tmp = DataPortal.Fetch(); - RODbInfo.AddList(tmp); - tmp.AddEvents(); - _RODbInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RODbInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static RODbInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on RODbInfoList.Get", ex); - // } - //} - private RODbInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODbInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRODbs"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new RODbInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODbInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("RODbInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - RODbInfoListPropertyDescriptor pd = new RODbInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class RODbInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private RODbInfo Item { get { return (RODbInfo)_Item; } } - public RODbInfoListPropertyDescriptor(RODbInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class RODbInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RODbInfoList) - { - // Return department and department role separated by comma. - return ((RODbInfoList)value).Items.Count.ToString() + " RODbs"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbROFst.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbROFst.cs deleted file mode 100644 index ac88ec3d..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbROFst.cs +++ /dev/null @@ -1,405 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// RODbROFst Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RODbROFstConverter))] - public partial class RODbROFst : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _ROFstID; - [System.ComponentModel.DataObjectField(true, true)] - public int ROFstID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROFst != null) _ROFstID = _MyROFst.ROFstID; - return _ROFstID; - } - } - private ROFst _MyROFst; - [System.ComponentModel.DataObjectField(true, true)] - public ROFst MyROFst - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFst.Get(_ROFstID); - return _MyROFst; - } - } - private byte[] _ROFST; - public byte[] ROFST - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFST; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_ROFST != value) - { - _ROFST = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - // TODO: Check RODbROFst.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current RODbROFst - protected override object GetIdValue() - { - return _ROFstID; - } - // TODO: Replace base RODbROFst.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current RODbROFst - //public override string ToString() - //{ - // return base.ToString(); - //} - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ROFstID, ""); - //AuthorizationRules.AllowRead(ROFST, ""); - //AuthorizationRules.AllowWrite(ROFST, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static RODbROFst New(byte[] rofst) - { - return new RODbROFst(rofst); - } - internal static RODbROFst Get(SafeDataReader dr) - { - return new RODbROFst(dr); - } - public RODbROFst() - { - MarkAsChild(); - _ROFstID = ROFst.NextROFstID; - _DTS = _RODbROFstExtension.DefaultDTS; - _UserID = _RODbROFstExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private RODbROFst(byte[] rofst) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _DTS = _RODbROFstExtension.DefaultDTS; - _UserID = _RODbROFstExtension.DefaultUserID; - _ROFST = rofst; - ValidationRules.CheckRules(); - } - internal RODbROFst(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODbROFst.FetchDR", GetHashCode()); - try - { - _ROFstID = dr.GetInt32("ROFstID"); - _ROFST = (byte[])dr.GetValue("ROFST"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODbROFst.FetchDR", ex); - throw new DbCslaException("RODbROFst.Fetch", ex); - } - MarkOld(); - } - internal void Insert(RODb myRODb) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = ROFst.Add(cn, ref _ROFstID, myRODb, _ROFST, _DTS, _UserID); - MarkOld(); - } - internal void Update(RODb myRODb) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = ROFst.Update(cn, ref _ROFstID, myRODb, _ROFST, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(RODb myRODb) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - ROFst.Remove(cn, _ROFstID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - RODbROFstExtension _RODbROFstExtension = new RODbROFstExtension(); - [Serializable()] - partial class RODbROFstExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class RODbROFstConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RODbROFst) - { - // Return the ToString value - return ((RODbROFst)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create RODbROFstExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class RODbROFst -// { -// partial class RODbROFstExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbROFsts.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbROFsts.cs deleted file mode 100644 index 8bfa1074..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbROFsts.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// RODbROFsts Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RODbROFstsConverter))] - public partial class RODbROFsts : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public RODbROFst this[ROFst myROFst] - { - get - { - foreach (RODbROFst rOFst in this) - if (rOFst.ROFstID == myROFst.ROFstID) - return rOFst; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public RODbROFst GetItem(ROFst myROFst) - { - foreach (RODbROFst rOFst in this) - if (rOFst.ROFstID == myROFst.ROFstID) - return rOFst; - return null; - } - public RODbROFst Add(byte[] rofst) // One to Many - { - RODbROFst rOFst = RODbROFst.New(rofst); - this.Add(rOFst); - return rOFst; - } - public void Remove(ROFst myROFst) - { - foreach (RODbROFst rOFst in this) - { - if (rOFst.ROFstID == myROFst.ROFstID) - { - Remove(rOFst); - break; - } - } - } - public bool Contains(ROFst myROFst) - { - foreach (RODbROFst rOFst in this) - if (rOFst.ROFstID == myROFst.ROFstID) - return true; - return false; - } - public bool ContainsDeleted(ROFst myROFst) - { - foreach (RODbROFst rOFst in DeletedList) - if (rOFst.ROFstID == myROFst.ROFstID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (RODbROFst rODbROFst in this) - if ((hasBrokenRules = rODbROFst.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static RODbROFsts New() - { - return new RODbROFsts(); - } - internal static RODbROFsts Get(SafeDataReader dr) - { - return new RODbROFsts(dr); - } - public static RODbROFsts GetByRODbID(int rODbID) - { - try - { - return DataPortal.Fetch(new RODbIDCriteria(rODbID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on RODbROFsts.GetByRODbID", ex); - } - } - private RODbROFsts() - { - MarkAsChild(); - } - internal RODbROFsts(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(RODbROFst.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class RODbIDCriteria - { - public RODbIDCriteria(int rODbID) - { - _RODbID = rODbID; - } - private int _RODbID; - public int RODbID - { - get { return _RODbID; } - set { _RODbID = value; } - } - } - private void DataPortal_Fetch(RODbIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODbROFsts.DataPortal_FetchRODbID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROFstsByRODbID"; - cm.Parameters.AddWithValue("@RODbID", criteria.RODbID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new RODbROFst(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODbROFsts.DataPortal_FetchRODbID", ex); - throw new DbCslaException("RODbROFsts.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(RODb rODb) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (RODbROFst obj in DeletedList) - obj.DeleteSelf(rODb);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (RODbROFst obj in this) - { - if (obj.IsNew) - obj.Insert(rODb); - else - obj.Update(rODb); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - RODbROFstsPropertyDescriptor pd = new RODbROFstsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class RODbROFstsPropertyDescriptor : vlnListPropertyDescriptor - { - private RODbROFst Item { get { return (RODbROFst)_Item; } } - public RODbROFstsPropertyDescriptor(RODbROFsts collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class RODbROFstsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RODbROFsts) - { - // Return department and department role separated by comma. - return ((RODbROFsts)value).Items.Count.ToString() + " ROFsts"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbROImage.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbROImage.cs deleted file mode 100644 index dd0f9a67..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbROImage.cs +++ /dev/null @@ -1,433 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// RODbROImage Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RODbROImageConverter))] - public partial class RODbROImage : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _ImageID; - [System.ComponentModel.DataObjectField(true, true)] - public int ImageID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROImage != null) _ImageID = _MyROImage.ImageID; - return _ImageID; - } - } - private ROImage _MyROImage; - [System.ComponentModel.DataObjectField(true, true)] - public ROImage MyROImage - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROImage == null && _ImageID != 0) _MyROImage = ROImage.Get(_ImageID); - return _MyROImage; - } - } - private string _FileName = string.Empty; - public string FileName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FileName; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_FileName != value) - { - _FileName = value; - PropertyHasChanged(); - } - } - } - private byte[] _Content; - public byte[] Content - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_Content != value) - { - _Content = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - // TODO: Check RODbROImage.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current RODbROImage - protected override object GetIdValue() - { - return _ImageID; - } - // TODO: Replace base RODbROImage.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current RODbROImage - //public override string ToString() - //{ - // return base.ToString(); - //} - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "FileName"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("FileName", 255)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ImageID, ""); - //AuthorizationRules.AllowRead(FileName, ""); - //AuthorizationRules.AllowWrite(FileName, ""); - //AuthorizationRules.AllowRead(Content, ""); - //AuthorizationRules.AllowWrite(Content, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static RODbROImage New(string fileName, byte[] content) - { - return new RODbROImage(fileName, content); - } - internal static RODbROImage Get(SafeDataReader dr) - { - return new RODbROImage(dr); - } - public RODbROImage() - { - MarkAsChild(); - _ImageID = ROImage.NextImageID; - _DTS = _RODbROImageExtension.DefaultDTS; - _UserID = _RODbROImageExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private RODbROImage(string fileName, byte[] content) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _DTS = _RODbROImageExtension.DefaultDTS; - _UserID = _RODbROImageExtension.DefaultUserID; - _FileName = fileName; - _Content = content; - ValidationRules.CheckRules(); - } - internal RODbROImage(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODbROImage.FetchDR", GetHashCode()); - try - { - _ImageID = dr.GetInt32("ImageID"); - _FileName = dr.GetString("FileName"); - _Content = (byte[])dr.GetValue("Content"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODbROImage.FetchDR", ex); - throw new DbCslaException("RODbROImage.Fetch", ex); - } - MarkOld(); - } - internal void Insert(RODb myRODb) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = ROImage.Add(cn, ref _ImageID, myRODb, _FileName, _Content, _DTS, _UserID); - MarkOld(); - } - internal void Update(RODb myRODb) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = ROImage.Update(cn, ref _ImageID, myRODb, _FileName, _Content, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(RODb myRODb) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - ROImage.Remove(cn, _ImageID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - RODbROImageExtension _RODbROImageExtension = new RODbROImageExtension(); - [Serializable()] - partial class RODbROImageExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class RODbROImageConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RODbROImage) - { - // Return the ToString value - return ((RODbROImage)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create RODbROImageExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class RODbROImage -// { -// partial class RODbROImageExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbROImages.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbROImages.cs deleted file mode 100644 index 4b89aa9b..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbROImages.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// RODbROImages Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RODbROImagesConverter))] - public partial class RODbROImages : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public RODbROImage this[ROImage myROImage] - { - get - { - foreach (RODbROImage rOImage in this) - if (rOImage.ImageID == myROImage.ImageID) - return rOImage; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public RODbROImage GetItem(ROImage myROImage) - { - foreach (RODbROImage rOImage in this) - if (rOImage.ImageID == myROImage.ImageID) - return rOImage; - return null; - } - public RODbROImage Add(string fileName, byte[] content) // One to Many - { - RODbROImage rOImage = RODbROImage.New(fileName, content); - this.Add(rOImage); - return rOImage; - } - public void Remove(ROImage myROImage) - { - foreach (RODbROImage rOImage in this) - { - if (rOImage.ImageID == myROImage.ImageID) - { - Remove(rOImage); - break; - } - } - } - public bool Contains(ROImage myROImage) - { - foreach (RODbROImage rOImage in this) - if (rOImage.ImageID == myROImage.ImageID) - return true; - return false; - } - public bool ContainsDeleted(ROImage myROImage) - { - foreach (RODbROImage rOImage in DeletedList) - if (rOImage.ImageID == myROImage.ImageID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (RODbROImage rODbROImage in this) - if ((hasBrokenRules = rODbROImage.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static RODbROImages New() - { - return new RODbROImages(); - } - internal static RODbROImages Get(SafeDataReader dr) - { - return new RODbROImages(dr); - } - public static RODbROImages GetByRODbID(int rODbID) - { - try - { - return DataPortal.Fetch(new RODbIDCriteria(rODbID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on RODbROImages.GetByRODbID", ex); - } - } - private RODbROImages() - { - MarkAsChild(); - } - internal RODbROImages(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(RODbROImage.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class RODbIDCriteria - { - public RODbIDCriteria(int rODbID) - { - _RODbID = rODbID; - } - private int _RODbID; - public int RODbID - { - get { return _RODbID; } - set { _RODbID = value; } - } - } - private void DataPortal_Fetch(RODbIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODbROImages.DataPortal_FetchRODbID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROImagesByRODbID"; - cm.Parameters.AddWithValue("@RODbID", criteria.RODbID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new RODbROImage(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODbROImages.DataPortal_FetchRODbID", ex); - throw new DbCslaException("RODbROImages.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(RODb rODb) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (RODbROImage obj in DeletedList) - obj.DeleteSelf(rODb);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (RODbROImage obj in this) - { - if (obj.IsNew) - obj.Insert(rODb); - else - obj.Update(rODb); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - RODbROImagesPropertyDescriptor pd = new RODbROImagesPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class RODbROImagesPropertyDescriptor : vlnListPropertyDescriptor - { - private RODbROImage Item { get { return (RODbROImage)_Item; } } - public RODbROImagesPropertyDescriptor(RODbROImages collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class RODbROImagesConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RODbROImages) - { - // Return department and department role separated by comma. - return ((RODbROImages)value).Items.Count.ToString() + " ROImages"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbRoUsage.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbRoUsage.cs deleted file mode 100644 index 6db52d37..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbRoUsage.cs +++ /dev/null @@ -1,570 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// RODbRoUsage Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RODbRoUsageConverter))] - public partial class RODbRoUsage : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _ROUsageID; - [System.ComponentModel.DataObjectField(true, true)] - public int ROUsageID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRoUsage != null) _ROUsageID = _MyRoUsage.ROUsageID; - return _ROUsageID; - } - } - private RoUsage _MyRoUsage; - [System.ComponentModel.DataObjectField(true, true)] - public RoUsage MyRoUsage - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRoUsage == null && _ROUsageID != 0) _MyRoUsage = RoUsage.Get(_ROUsageID); - return _MyRoUsage; - } - } - private int _ContentID; - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _ContentID = _MyContent.ContentID; - return _ContentID; - } - } - private Content _MyContent; - public Content MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _ContentID != 0) _MyContent = Content.Get(_ContentID); - return _MyContent; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyContent != value) - { - _MyContent = value; - PropertyHasChanged(); - } - } - } - private string _ROID = string.Empty; - public string ROID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_ROID != value) - { - _ROID = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private string _Content_Number = string.Empty; - public string Content_Number - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Number; - } - } - private string _Content_Text = string.Empty; - public string Content_Text - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Text; - } - } - private int? _Content_Type; - /// - /// 0 - Procedure, 10000 - Section, 20000 Step - /// - public int? Content_Type - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Type; - } - } - private int? _Content_FormatID; - public int? Content_FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_FormatID; - } - } - private string _Content_Config = string.Empty; - public string Content_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_Config; - } - } - private DateTime _Content_DTS = new DateTime(); - public DateTime Content_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_DTS; - } - } - private string _Content_UserID = string.Empty; - public string Content_UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content_UserID; - } - } - // TODO: Check RODbRoUsage.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current RODbRoUsage - protected override object GetIdValue() - { - return _ROUsageID; - } - // TODO: Replace base RODbRoUsage.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current RODbRoUsage - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyContent != null && (hasBrokenRules = _MyContent.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyContentRequired, "MyContent"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "ROID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("ROID", 16)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - private static bool MyContentRequired(RODbRoUsage target, Csla.Validation.RuleArgs e) - { - if (target._ContentID == 0 && target._MyContent == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ROUsageID, ""); - //AuthorizationRules.AllowRead(ContentID, ""); - //AuthorizationRules.AllowWrite(ContentID, ""); - //AuthorizationRules.AllowRead(ROID, ""); - //AuthorizationRules.AllowWrite(ROID, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static RODbRoUsage New(string roid) - { - return new RODbRoUsage(roid); - } - internal static RODbRoUsage Get(SafeDataReader dr) - { - return new RODbRoUsage(dr); - } - public RODbRoUsage() - { - MarkAsChild(); - _ROUsageID = RoUsage.NextROUsageID; - _ContentID = _RODbRoUsageExtension.DefaultContentID; - _DTS = _RODbRoUsageExtension.DefaultDTS; - _UserID = _RODbRoUsageExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private RODbRoUsage(string roid) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _ContentID = _RODbRoUsageExtension.DefaultContentID; - _DTS = _RODbRoUsageExtension.DefaultDTS; - _UserID = _RODbRoUsageExtension.DefaultUserID; - _ROID = roid; - ValidationRules.CheckRules(); - } - internal RODbRoUsage(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODbRoUsage.FetchDR", GetHashCode()); - try - { - _ROUsageID = dr.GetInt32("ROUsageID"); - _ContentID = dr.GetInt32("ContentID"); - _ROID = dr.GetString("ROID"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _Content_Number = dr.GetString("Content_Number"); - _Content_Text = dr.GetString("Content_Text"); - _Content_Type = (int?)dr.GetValue("Content_Type"); - _Content_FormatID = (int?)dr.GetValue("Content_FormatID"); - _Content_Config = dr.GetString("Content_Config"); - _Content_DTS = dr.GetDateTime("Content_DTS"); - _Content_UserID = dr.GetString("Content_UserID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODbRoUsage.FetchDR", ex); - throw new DbCslaException("RODbRoUsage.Fetch", ex); - } - MarkOld(); - } - internal void Insert(RODb myRODb) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = RoUsage.Add(cn, ref _ROUsageID, _MyContent, _ROID, _Config, _DTS, _UserID, myRODb); - MarkOld(); - } - internal void Update(RODb myRODb) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = RoUsage.Update(cn, ref _ROUsageID, _MyContent, _ROID, _Config, _DTS, _UserID, ref _LastChanged, myRODb); - MarkOld(); - } - internal void DeleteSelf(RODb myRODb) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - RoUsage.Remove(cn, _ROUsageID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - RODbRoUsageExtension _RODbRoUsageExtension = new RODbRoUsageExtension(); - [Serializable()] - partial class RODbRoUsageExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultContentID - { - get { return 0; } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class RODbRoUsageConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RODbRoUsage) - { - // Return the ToString value - return ((RODbRoUsage)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create RODbRoUsageExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class RODbRoUsage -// { -// partial class RODbRoUsageExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultContentID -// { -// get { return 0; } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbRoUsages.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbRoUsages.cs deleted file mode 100644 index 4e5a4c3b..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RODbRoUsages.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// RODbRoUsages Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RODbRoUsagesConverter))] - public partial class RODbRoUsages : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public RODbRoUsage this[RoUsage myRoUsage] - { - get - { - foreach (RODbRoUsage roUsage in this) - if (roUsage.ROUsageID == myRoUsage.ROUsageID) - return roUsage; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public RODbRoUsage GetItem(RoUsage myRoUsage) - { - foreach (RODbRoUsage roUsage in this) - if (roUsage.ROUsageID == myRoUsage.ROUsageID) - return roUsage; - return null; - } - public RODbRoUsage Add(string roid) // One to Many - { - RODbRoUsage roUsage = RODbRoUsage.New(roid); - this.Add(roUsage); - return roUsage; - } - public void Remove(RoUsage myRoUsage) - { - foreach (RODbRoUsage roUsage in this) - { - if (roUsage.ROUsageID == myRoUsage.ROUsageID) - { - Remove(roUsage); - break; - } - } - } - public bool Contains(RoUsage myRoUsage) - { - foreach (RODbRoUsage roUsage in this) - if (roUsage.ROUsageID == myRoUsage.ROUsageID) - return true; - return false; - } - public bool ContainsDeleted(RoUsage myRoUsage) - { - foreach (RODbRoUsage roUsage in DeletedList) - if (roUsage.ROUsageID == myRoUsage.ROUsageID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (RODbRoUsage rODbRoUsage in this) - if ((hasBrokenRules = rODbRoUsage.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static RODbRoUsages New() - { - return new RODbRoUsages(); - } - internal static RODbRoUsages Get(SafeDataReader dr) - { - return new RODbRoUsages(dr); - } - public static RODbRoUsages GetByRODbID(int rODbID) - { - try - { - return DataPortal.Fetch(new RODbIDCriteria(rODbID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on RODbRoUsages.GetByRODbID", ex); - } - } - private RODbRoUsages() - { - MarkAsChild(); - } - internal RODbRoUsages(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(RODbRoUsage.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class RODbIDCriteria - { - public RODbIDCriteria(int rODbID) - { - _RODbID = rODbID; - } - private int _RODbID; - public int RODbID - { - get { return _RODbID; } - set { _RODbID = value; } - } - } - private void DataPortal_Fetch(RODbIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RODbRoUsages.DataPortal_FetchRODbID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRoUsagesByRODbID"; - cm.Parameters.AddWithValue("@RODbID", criteria.RODbID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new RODbRoUsage(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RODbRoUsages.DataPortal_FetchRODbID", ex); - throw new DbCslaException("RODbRoUsages.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(RODb rODb) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (RODbRoUsage obj in DeletedList) - obj.DeleteSelf(rODb);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (RODbRoUsage obj in this) - { - if (obj.IsNew) - obj.Insert(rODb); - else - obj.Update(rODb); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - RODbRoUsagesPropertyDescriptor pd = new RODbRoUsagesPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class RODbRoUsagesPropertyDescriptor : vlnListPropertyDescriptor - { - private RODbRoUsage Item { get { return (RODbRoUsage)_Item; } } - public RODbRoUsagesPropertyDescriptor(RODbRoUsages collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class RODbRoUsagesConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RODbRoUsages) - { - // Return department and department role separated by comma. - return ((RODbRoUsages)value).Items.Count.ToString() + " RoUsages"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFst.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFst.cs deleted file mode 100644 index f3e4d7c5..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFst.cs +++ /dev/null @@ -1,1114 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ROFst Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ROFstConverter))] - public partial class ROFst : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshROFsts = new List(); - private List _RefreshROFstDocVersionROFsts = new List(); - private List _RefreshROFstROFstImages = new List(); - private void AddToRefreshList(List refreshROFsts, List refreshROFstDocVersionROFsts, List refreshROFstROFstImages) - { - if (IsDirty) - refreshROFsts.Add(this); - if (_ROFstDocVersionROFsts != null && _ROFstDocVersionROFsts.IsDirty) - { - foreach (ROFstDocVersionROFst tmp in _ROFstDocVersionROFsts) - { - if (tmp.IsDirty) refreshROFstDocVersionROFsts.Add(tmp); - } - } - if (_ROFstROFstImages != null && _ROFstROFstImages.IsDirty) - { - foreach (ROFstROFstImage tmp in _ROFstROFstImages) - { - if (tmp.IsDirty) refreshROFstROFstImages.Add(tmp); - } - } - } - private void BuildRefreshList() - { - _RefreshROFsts = new List(); - _RefreshROFstDocVersionROFsts = new List(); - _RefreshROFstROFstImages = new List(); - AddToRefreshList(_RefreshROFsts, _RefreshROFstDocVersionROFsts, _RefreshROFstROFstImages); - } - private void ProcessRefreshList() - { - foreach (ROFst tmp in _RefreshROFsts) - { - ROFstInfo.Refresh(tmp); - if (tmp._MyRODb != null) RODbInfo.Refresh(tmp._MyRODb); - } - foreach (ROFstDocVersionROFst tmp in _RefreshROFstDocVersionROFsts) - { - DocVersionROFstInfo.Refresh(this, tmp); - } - foreach (ROFstROFstImage tmp in _RefreshROFstROFstImages) - { - ROFstImageInfo.Refresh(this, tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(ROFst rOFst) - { - if (!_CacheList.Contains(rOFst)) _CacheList.Add(rOFst); // In AddToCache - } - protected static void RemoveFromCache(ROFst rOFst) - { - while (_CacheList.Contains(rOFst)) _CacheList.Remove(rOFst); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (ROFst tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ROFstID.ToString())) - { - _CacheByPrimaryKey[tmp.ROFstID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ROFstID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (ROFst tmp in remove) - RemoveFromCache(tmp); - } - protected static ROFst GetCachedByPrimaryKey(int rOFstID) - { - ConvertListToDictionary(); - string key = rOFstID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextROFstID = -1; - public static int NextROFstID - { - get { return _nextROFstID--; } - } - private int _ROFstID; - [System.ComponentModel.DataObjectField(true, true)] - public int ROFstID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFstID; - } - } - private int _RODbID; - public int RODbID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRODb != null) _RODbID = _MyRODb.RODbID; - return _RODbID; - } - } - private RODb _MyRODb; - public RODb MyRODb - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRODb == null && _RODbID != 0) _MyRODb = RODb.Get(_RODbID); - return _MyRODb; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyRODb != value) - { - _MyRODb = value; - PropertyHasChanged(); - } - } - } - private byte[] _ROFST; - public byte[] ROFST - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFST; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_ROFST != value) - { - _ROFST = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _ROFstDocVersionROFstCount = 0; - /// - /// Count of ROFstDocVersionROFsts for this ROFst - /// - public int ROFstDocVersionROFstCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFstDocVersionROFstCount; - } - } - private ROFstDocVersionROFsts _ROFstDocVersionROFsts = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ROFstDocVersionROFstsConverter))] - public ROFstDocVersionROFsts ROFstDocVersionROFsts - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - // TODO: See if this fixed after docversion changes. - // if (_ROFstDocVersionROFstCount > 0 && _ROFstDocVersionROFsts == null) - _ROFstDocVersionROFsts = ROFstDocVersionROFsts.GetByROFstID(ROFstID); - // TODO: This should be uncommented after docversion changes: - //else if (_ROFstDocVersionROFsts == null) - // _ROFstDocVersionROFsts = ROFstDocVersionROFsts.New(); - return _ROFstDocVersionROFsts; - } - } - private int _ROFstROFstImageCount = 0; - /// - /// Count of ROFstROFstImages for this ROFst - /// - public int ROFstROFstImageCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFstROFstImageCount; - } - } - private ROFstROFstImages _ROFstROFstImages = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ROFstROFstImagesConverter))] - public ROFstROFstImages ROFstROFstImages - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ROFstROFstImageCount > 0 && _ROFstROFstImages == null) - _ROFstROFstImages = ROFstROFstImages.GetByROFstID(ROFstID); - else if (_ROFstROFstImages == null) - _ROFstROFstImages = ROFstROFstImages.New(); - return _ROFstROFstImages; - } - } - public override bool IsDirty - { - get { return base.IsDirty || (_ROFstDocVersionROFsts == null ? false : _ROFstDocVersionROFsts.IsDirty) || (_ROFstROFstImages == null ? false : _ROFstROFstImages.IsDirty) || (_MyRODb == null ? false : _MyRODb.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_ROFstDocVersionROFsts == null ? true : _ROFstDocVersionROFsts.IsValid) && (_ROFstROFstImages == null ? true : _ROFstROFstImages.IsValid) && (_MyRODb == null ? true : _MyRODb.IsValid); } - } - // TODO: Replace base ROFst.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ROFst - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check ROFst.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ROFst - protected override object GetIdValue() - { - return _ROFstID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_ROFstDocVersionROFsts != null && (hasBrokenRules = _ROFstDocVersionROFsts.HasBrokenRules) != null) return hasBrokenRules; - if (_ROFstROFstImages != null && (hasBrokenRules = _ROFstROFstImages.HasBrokenRules) != null) return hasBrokenRules; - if (_MyRODb != null && (hasBrokenRules = _MyRODb.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyRODbRequired, "MyRODb"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _ROFstExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _ROFstExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - private static bool MyRODbRequired(ROFst target, Csla.Validation.RuleArgs e) - { - if (target._RODbID == 0 && target._MyRODb == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ROFstID, ""); - //AuthorizationRules.AllowRead(RODbID, ""); - //AuthorizationRules.AllowRead(ROFST, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(RODbID, ""); - //AuthorizationRules.AllowWrite(ROFST, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - _ROFstExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _ROFstExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - /// - /// determines if related records (Foreign Keys) will keep this Item from being deleted - /// - public bool CanDelete - { - get - { - // Check to make sure that there are not any related records - int usedByCount = 0; - usedByCount += _ROFstDocVersionROFstCount; - usedByCount += _ROFstROFstImageCount; - return (usedByCount == 0); - } - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _ROFstUnique = 0; - protected static int ROFstUnique - { get { return ++_ROFstUnique; } } - private int _MyROFstUnique = ROFstUnique; - public int MyROFstUnique - { get { return _MyROFstUnique; } } - protected ROFst() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(ROFstID.ToString())) - { - List listROFst = _CacheByPrimaryKey[ROFstID.ToString()]; // Get the list of items - while (listROFst.Contains(this)) listROFst.Remove(this); // Remove the item from the list - if (listROFst.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(ROFstID.ToString()); // remove the list - } - } - public static ROFst New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a ROFst"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFst.New", ex); - } - } - public static ROFst New(RODb myRODb, byte[] rofst) - { - ROFst tmp = ROFst.New(); - tmp.MyRODb = myRODb; - tmp.ROFST = rofst; - return tmp; - } - public static ROFst MakeROFst(RODb myRODb, byte[] rofst) - { - ROFst tmp = ROFst.New(myRODb, rofst); - if (tmp.IsSavable) - { - ROFst tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static ROFst New(RODb myRODb, byte[] rofst, DateTime dts, string userID) - { - ROFst tmp = ROFst.New(); - tmp.MyRODb = myRODb; - tmp.ROFST = rofst; - tmp.DTS = dts; - tmp.UserID = userID; - return tmp; - } - public static ROFst MakeROFst(RODb myRODb, byte[] rofst, DateTime dts, string userID) - { - ROFst tmp = ROFst.New(myRODb, rofst, dts, userID); - if (tmp.IsSavable) - { - ROFst tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static ROFst Get(int rOFstID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a ROFst"); - try - { - ROFst tmp = GetCachedByPrimaryKey(rOFstID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(rOFstID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ROFst - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFst.Get", ex); - } - } - public static ROFst Get(SafeDataReader dr) - { - if (dr.Read()) return new ROFst(dr); - return null; - } - internal ROFst(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int rOFstID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a ROFst"); - try - { - DataPortal.Delete(new PKCriteria(rOFstID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFst.Delete", ex); - } - } - public override ROFst Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a ROFst"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a ROFst"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a ROFst"); - try - { - BuildRefreshList(); - ROFst rOFst = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(rOFst);//Refresh the item in AllList - ProcessRefreshList(); - return rOFst; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _ROFstID; - public int ROFstID - { get { return _ROFstID; } } - public PKCriteria(int rOFstID) - { - _ROFstID = rOFstID; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _ROFstID = NextROFstID; - // Database Defaults - _DTS = _ROFstExtension.DefaultDTS; - _UserID = _ROFstExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.ReadData", GetHashCode()); - try - { - _ROFstID = dr.GetInt32("ROFstID"); - _RODbID = dr.GetInt32("RODbID"); - _ROFST = (byte[])dr.GetValue("ROFST"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _ROFstDocVersionROFstCount = dr.GetInt32("DocVersionROFstCount"); - _ROFstROFstImageCount = dr.GetInt32("ROFstImageCount"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFst.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROFst.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROFst"; - cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _ROFstDocVersionROFsts = ROFstDocVersionROFsts.Get(dr); - // load child objects - dr.NextResult(); - _ROFstROFstImages = ROFstROFstImages.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFst.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROFst.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFst.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROFst.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyRODb != null) _MyRODb.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addROFst"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@RODbID", RODbID); - cm.Parameters.AddWithValue("@ROFST", _ROFST); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - // Output Calculated Columns - SqlParameter param_ROFstID = new SqlParameter("@newROFstID", SqlDbType.Int); - param_ROFstID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_ROFstID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _ROFstID = (int)cm.Parameters["@newROFstID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_ROFstDocVersionROFsts != null) _ROFstDocVersionROFsts.Update(this); - if (_ROFstROFstImages != null) _ROFstROFstImages.Update(this); - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFst.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROFst.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int rOFstID, RODb myRODb, byte[] rofst, DateTime dts, string userID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addROFst"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@RODbID", myRODb.RODbID); - cm.Parameters.AddWithValue("@ROFST", rofst); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - // Output Calculated Columns - SqlParameter param_ROFstID = new SqlParameter("@newROFstID", SqlDbType.Int); - param_ROFstID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_ROFstID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - rOFstID = (int)cm.Parameters["@newROFstID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFst.Add", ex); - throw new DbCslaException("ROFst.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFst.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.SQLUpdate", GetHashCode()); - try - { - if (_MyRODb != null) _MyRODb.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateROFst"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@ROFstID", _ROFstID); - cm.Parameters.AddWithValue("@RODbID", RODbID); - cm.Parameters.AddWithValue("@ROFST", _ROFST); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - if (_ROFstDocVersionROFsts != null) _ROFstDocVersionROFsts.Update(this); - if (_ROFstROFstImages != null) _ROFstROFstImages.Update(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFst.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = ROFst.Add(cn, ref _ROFstID, _MyRODb, _ROFST, _DTS, _UserID); - else - _LastChanged = ROFst.Update(cn, ref _ROFstID, _MyRODb, _ROFST, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - if (_ROFstDocVersionROFsts != null) _ROFstDocVersionROFsts.Update(this); - if (_ROFstROFstImages != null) _ROFstROFstImages.Update(this); - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int rOFstID, RODb myRODb, byte[] rofst, DateTime dts, string userID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateROFst"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ROFstID", rOFstID); - cm.Parameters.AddWithValue("@RODbID", myRODb.RODbID); - cm.Parameters.AddWithValue("@ROFST", rofst); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFst.Update", ex); - throw new DbCslaException("ROFst.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_ROFstID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteROFst"; - cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFst.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROFst.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int rOFstID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteROFst"; - // Input PK Fields - cm.Parameters.AddWithValue("@ROFstID", rOFstID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFst.Remove", ex); - throw new DbCslaException("ROFst.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int rOFstID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(rOFstID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFst.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _ROFstID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int rOFstID) - { - _ROFstID = rOFstID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFst.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsROFst"; - cm.Parameters.AddWithValue("@ROFstID", _ROFstID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFst.DataPortal_Execute", ex); - throw new DbCslaException("ROFst.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - ROFstExtension _ROFstExtension = new ROFstExtension(); - [Serializable()] - partial class ROFstExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ROFstConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ROFst) - { - // Return the ToString value - return ((ROFst)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ROFstExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ROFst -// { -// partial class ROFstExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstDocVersionROFst.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstDocVersionROFst.cs deleted file mode 100644 index c1623abe..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstDocVersionROFst.cs +++ /dev/null @@ -1,477 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ROFstDocVersionROFst Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ROFstDocVersionROFstConverter))] - public partial class ROFstDocVersionROFst : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _VersionID; - [System.ComponentModel.DataObjectField(true, true)] - public int VersionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDocVersion != null) _VersionID = _MyDocVersion.VersionID; - return _VersionID; - } - } - private DocVersion _MyDocVersion; - [System.ComponentModel.DataObjectField(true, true)] - public DocVersion MyDocVersion - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyDocVersion == null && _VersionID != 0) _MyDocVersion = DocVersion.Get(_VersionID); - return _MyDocVersion; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _DocVersion_FolderID; - public int DocVersion_FolderID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocVersion_FolderID; - } - } - private int _DocVersion_VersionType; - /// - /// 0 Working Draft, 1 Temporary, 128 Revision, 129 Approved (Greater than 127 - non editable) - /// - public int DocVersion_VersionType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocVersion_VersionType; - } - } - private string _DocVersion_Name = string.Empty; - public string DocVersion_Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocVersion_Name; - } - } - private string _DocVersion_Title = string.Empty; - public string DocVersion_Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocVersion_Title; - } - } - private int? _DocVersion_ItemID; - public int? DocVersion_ItemID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocVersion_ItemID; - } - } - private int? _DocVersion_FormatID; - public int? DocVersion_FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocVersion_FormatID; - } - } - private string _DocVersion_Config = string.Empty; - public string DocVersion_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocVersion_Config; - } - } - private DateTime _DocVersion_DTS = new DateTime(); - public DateTime DocVersion_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocVersion_DTS; - } - } - private string _DocVersion_UserID = string.Empty; - public string DocVersion_UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DocVersion_UserID; - } - } - // TODO: Check ROFstDocVersionROFst.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ROFstDocVersionROFst - protected override object GetIdValue() - { - return _VersionID; - } - // TODO: Replace base ROFstDocVersionROFst.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ROFstDocVersionROFst - //public override string ToString() - //{ - // return base.ToString(); - //} - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(VersionID, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static ROFstDocVersionROFst New(DocVersion myDocVersion) - { - return new ROFstDocVersionROFst(myDocVersion); - } - internal static ROFstDocVersionROFst Get(SafeDataReader dr) - { - return new ROFstDocVersionROFst(dr); - } - public ROFstDocVersionROFst() - { - MarkAsChild(); - - _DTS = _ROFstDocVersionROFstExtension.DefaultDTS; - _UserID = _ROFstDocVersionROFstExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private ROFstDocVersionROFst(DocVersion myDocVersion) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _DTS = _ROFstDocVersionROFstExtension.DefaultDTS; - _UserID = _ROFstDocVersionROFstExtension.DefaultUserID; - _MyDocVersion = myDocVersion; - ValidationRules.CheckRules(); - } - internal ROFstDocVersionROFst(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstDocVersionROFst.FetchDR", GetHashCode()); - try - { - _VersionID = dr.GetInt32("VersionID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _DocVersion_FolderID = dr.GetInt32("DocVersion_FolderID"); - _DocVersion_VersionType = dr.GetInt32("DocVersion_VersionType"); - _DocVersion_Name = dr.GetString("DocVersion_Name"); - _DocVersion_Title = dr.GetString("DocVersion_Title"); - _DocVersion_ItemID = (int?)dr.GetValue("DocVersion_ItemID"); - _DocVersion_FormatID = (int?)dr.GetValue("DocVersion_FormatID"); - _DocVersion_Config = dr.GetString("DocVersion_Config"); - _DocVersion_DTS = dr.GetDateTime("DocVersion_DTS"); - _DocVersion_UserID = dr.GetString("DocVersion_UserID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstDocVersionROFst.FetchDR", ex); - throw new DbCslaException("ROFstDocVersionROFst.Fetch", ex); - } - MarkOld(); - } - internal void Insert(ROFst myROFst) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = DocVersionROFst.Add(cn, _MyDocVersion, myROFst, _DTS, _UserID); - MarkOld(); - } - internal void Update(ROFst myROFst) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = DocVersionROFst.Update(cn, _MyDocVersion, myROFst, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(ROFst myROFst) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - DocVersionROFst.Remove(cn, _VersionID, myROFst.ROFstID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - ROFstDocVersionROFstExtension _ROFstDocVersionROFstExtension = new ROFstDocVersionROFstExtension(); - [Serializable()] - partial class ROFstDocVersionROFstExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ROFstDocVersionROFstConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ROFstDocVersionROFst) - { - // Return the ToString value - return ((ROFstDocVersionROFst)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ROFstDocVersionROFstExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ROFstDocVersionROFst -// { -// partial class ROFstDocVersionROFstExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstDocVersionROFsts.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstDocVersionROFsts.cs deleted file mode 100644 index ba178831..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstDocVersionROFsts.cs +++ /dev/null @@ -1,295 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ROFstDocVersionROFsts Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ROFstDocVersionROFstsConverter))] - public partial class ROFstDocVersionROFsts : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // Many To Many - public ROFstDocVersionROFst this[DocVersion myDocVersion] - { - get - { - foreach (ROFstDocVersionROFst docVersionROFst in this) - if (docVersionROFst.VersionID == myDocVersion.VersionID) - return docVersionROFst; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public ROFstDocVersionROFst GetItem(DocVersion myDocVersion) - { - foreach (ROFstDocVersionROFst docVersionROFst in this) - if (docVersionROFst.VersionID == myDocVersion.VersionID) - return docVersionROFst; - return null; - } - public ROFstDocVersionROFst Add(DocVersion myDocVersion)// Many to Many with required fields - { - if (!Contains(myDocVersion)) - { - ROFstDocVersionROFst docVersionROFst = ROFstDocVersionROFst.New(myDocVersion); - this.Add(docVersionROFst); - return docVersionROFst; - } - else - throw new InvalidOperationException("docVersionROFst already exists"); - } - public void Remove(DocVersion myDocVersion) - { - foreach (ROFstDocVersionROFst docVersionROFst in this) - { - if (docVersionROFst.VersionID == myDocVersion.VersionID) - { - Remove(docVersionROFst); - break; - } - } - } - public bool Contains(DocVersion myDocVersion) - { - foreach (ROFstDocVersionROFst docVersionROFst in this) - if (docVersionROFst.VersionID == myDocVersion.VersionID) - return true; - return false; - } - public bool ContainsDeleted(DocVersion myDocVersion) - { - foreach (ROFstDocVersionROFst docVersionROFst in DeletedList) - if (docVersionROFst.VersionID == myDocVersion.VersionID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (ROFstDocVersionROFst rOFstDocVersionROFst in this) - if ((hasBrokenRules = rOFstDocVersionROFst.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static ROFstDocVersionROFsts New() - { - return new ROFstDocVersionROFsts(); - } - internal static ROFstDocVersionROFsts Get(SafeDataReader dr) - { - return new ROFstDocVersionROFsts(dr); - } - public static ROFstDocVersionROFsts GetByROFstID(int rOFstID) - { - try - { - return DataPortal.Fetch(new ROFstIDCriteria(rOFstID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFstDocVersionROFsts.GetByROFstID", ex); - } - } - private ROFstDocVersionROFsts() - { - MarkAsChild(); - } - internal ROFstDocVersionROFsts(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(ROFstDocVersionROFst.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ROFstIDCriteria - { - public ROFstIDCriteria(int rOFstID) - { - _ROFstID = rOFstID; - } - private int _ROFstID; - public int ROFstID - { - get { return _ROFstID; } - set { _ROFstID = value; } - } - } - private void DataPortal_Fetch(ROFstIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstDocVersionROFsts.DataPortal_FetchROFstID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getDocVersionROFstsByROFstID"; - cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new ROFstDocVersionROFst(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstDocVersionROFsts.DataPortal_FetchROFstID", ex); - throw new DbCslaException("ROFstDocVersionROFsts.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(ROFst rOFst) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (ROFstDocVersionROFst obj in DeletedList) - obj.DeleteSelf(rOFst);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (ROFstDocVersionROFst obj in this) - { - if (obj.IsNew) - obj.Insert(rOFst); - else - obj.Update(rOFst); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ROFstDocVersionROFstsPropertyDescriptor pd = new ROFstDocVersionROFstsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ROFstDocVersionROFstsPropertyDescriptor : vlnListPropertyDescriptor - { - private ROFstDocVersionROFst Item { get { return (ROFstDocVersionROFst)_Item; } } - public ROFstDocVersionROFstsPropertyDescriptor(ROFstDocVersionROFsts collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ROFstDocVersionROFstsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ROFstDocVersionROFsts) - { - // Return department and department role separated by comma. - return ((ROFstDocVersionROFsts)value).Items.Count.ToString() + " DocVersionROFsts"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstImage.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstImage.cs deleted file mode 100644 index e112ed68..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstImage.cs +++ /dev/null @@ -1,968 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ROFstImage Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ROFstImageConverter))] - public partial class ROFstImage : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshROFstImages = new List(); - private void AddToRefreshList(List refreshROFstImages) - { - if (IsDirty) - refreshROFstImages.Add(this); - } - private void BuildRefreshList() - { - _RefreshROFstImages = new List(); - AddToRefreshList(_RefreshROFstImages); - } - private void ProcessRefreshList() - { - foreach (ROFstImage tmp in _RefreshROFstImages) - { - ROFstImageInfo.Refresh(tmp); - if (tmp._MyROFst != null) ROFstInfo.Refresh(tmp._MyROFst); - if (tmp._MyROImage != null) ROImageInfo.Refresh(tmp._MyROImage); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(ROFstImage rOFstImage) - { - if (!_CacheList.Contains(rOFstImage)) _CacheList.Add(rOFstImage); // In AddToCache - } - protected static void RemoveFromCache(ROFstImage rOFstImage) - { - while (_CacheList.Contains(rOFstImage)) _CacheList.Remove(rOFstImage); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (ROFstImage tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ROFstID.ToString() + "_" + tmp.ImageID.ToString())) - { - _CacheByPrimaryKey[tmp.ROFstID.ToString() + "_" + tmp.ImageID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ROFstID.ToString() + "_" + tmp.ImageID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (ROFstImage tmp in remove) - RemoveFromCache(tmp); - } - protected static ROFstImage GetCachedByPrimaryKey(int rOFstID, int imageID) - { - ConvertListToDictionary(); - string key = rOFstID.ToString() + "_" + imageID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _ROFstID; - [System.ComponentModel.DataObjectField(true, true)] - public int ROFstID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROFst != null) _ROFstID = _MyROFst.ROFstID; - return _ROFstID; - } - } - private ROFst _MyROFst; - [System.ComponentModel.DataObjectField(true, true)] - public ROFst MyROFst - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFst.Get(_ROFstID); - return _MyROFst; - } - } - private int _ImageID; - [System.ComponentModel.DataObjectField(true, true)] - public int ImageID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROImage != null) _ImageID = _MyROImage.ImageID; - return _ImageID; - } - } - private ROImage _MyROImage; - [System.ComponentModel.DataObjectField(true, true)] - public ROImage MyROImage - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROImage == null && _ImageID != 0) _MyROImage = ROImage.Get(_ImageID); - return _MyROImage; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - public override bool IsDirty - { - get { return base.IsDirty || (_MyROFst == null ? false : _MyROFst.IsDirty) || (_MyROImage == null ? false : _MyROImage.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyROFst == null ? true : _MyROFst.IsValid) && (_MyROImage == null ? true : _MyROImage.IsValid); } - } - // TODO: Replace base ROFstImage.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ROFstImage - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check ROFstImage.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ROFstImage - protected override object GetIdValue() - { - return (_ROFstID.ToString() + "." + _ImageID.ToString()).GetHashCode(); - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _ROFstImageExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _ROFstImageExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ROFstID, ""); - //AuthorizationRules.AllowRead(ImageID, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - _ROFstImageExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _ROFstImageExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _ROFstImageUnique = 0; - protected static int ROFstImageUnique - { get { return ++_ROFstImageUnique; } } - private int _MyROFstImageUnique = ROFstImageUnique; - public int MyROFstImageUnique - { get { return _MyROFstImageUnique; } } - protected ROFstImage() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(ROFstID.ToString() + "_" + ImageID.ToString())) - { - List listROFstImage = _CacheByPrimaryKey[ROFstID.ToString() + "_" + ImageID.ToString()]; // Get the list of items - while (listROFstImage.Contains(this)) listROFstImage.Remove(this); // Remove the item from the list - if (listROFstImage.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(ROFstID.ToString() + "_" + ImageID.ToString()); // remove the list - } - } - public static ROFstImage New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a ROFstImage"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFstImage.New", ex); - } - } - public static ROFstImage New(ROFst myROFst, ROImage myROImage) - { - ROFstImage tmp = ROFstImage.New(); - tmp._MyROFst = myROFst; - tmp._MyROImage = myROImage; - return tmp; - } - public static ROFstImage MakeROFstImage(ROFst myROFst, ROImage myROImage) - { - ROFstImage tmp = ROFstImage.New(myROFst, myROImage); - if (tmp.IsSavable) - { - ROFstImage tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static ROFstImage New(ROFst myROFst, ROImage myROImage, DateTime dts, string userID) - { - ROFstImage tmp = ROFstImage.New(); - tmp._MyROFst = myROFst; - tmp._MyROImage = myROImage; - tmp.DTS = dts; - tmp.UserID = userID; - return tmp; - } - public static ROFstImage MakeROFstImage(ROFst myROFst, ROImage myROImage, DateTime dts, string userID) - { - ROFstImage tmp = ROFstImage.New(myROFst, myROImage, dts, userID); - if (tmp.IsSavable) - { - ROFstImage tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static ROFstImage Get(int rOFstID, int imageID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a ROFstImage"); - try - { - ROFstImage tmp = GetCachedByPrimaryKey(rOFstID, imageID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(rOFstID, imageID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ROFstImage - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFstImage.Get", ex); - } - } - public static ROFstImage Get(SafeDataReader dr) - { - if (dr.Read()) return new ROFstImage(dr); - return null; - } - internal ROFstImage(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int rOFstID, int imageID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a ROFstImage"); - try - { - DataPortal.Delete(new PKCriteria(rOFstID, imageID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFstImage.Delete", ex); - } - } - public override ROFstImage Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a ROFstImage"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a ROFstImage"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a ROFstImage"); - try - { - BuildRefreshList(); - ROFstImage rOFstImage = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(rOFstImage);//Refresh the item in AllList - ProcessRefreshList(); - return rOFstImage; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _ROFstID; - public int ROFstID - { get { return _ROFstID; } } - private int _ImageID; - public int ImageID - { get { return _ImageID; } } - public PKCriteria(int rOFstID, int imageID) - { - _ROFstID = rOFstID; - _ImageID = imageID; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - - // Database Defaults - _DTS = _ROFstImageExtension.DefaultDTS; - _UserID = _ROFstImageExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImage.ReadData", GetHashCode()); - try - { - _ROFstID = dr.GetInt32("ROFstID"); - _ImageID = dr.GetInt32("ImageID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImage.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROFstImage.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImage.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROFstImage"; - cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID); - cm.Parameters.AddWithValue("@ImageID", criteria.ImageID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImage.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROFstImage.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImage.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROFstImage.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImage.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyROFst != null) _MyROFst.Update(); - if (_MyROImage != null) _MyROImage.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addROFstImage"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ROFstID", ROFstID); - cm.Parameters.AddWithValue("@ImageID", ImageID); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImage.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImage.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROFstImage.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ROFst myROFst, ROImage myROImage, DateTime dts, string userID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImage.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addROFstImage"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ROFstID", myROFst.ROFstID); - cm.Parameters.AddWithValue("@ImageID", myROImage.ImageID); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImage.Add", ex); - throw new DbCslaException("ROFstImage.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImage.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImage.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImage.SQLUpdate", GetHashCode()); - try - { - if (_MyROFst != null) _MyROFst.Update(); - if (_MyROImage != null) _MyROImage.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateROFstImage"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@ROFstID", ROFstID); - cm.Parameters.AddWithValue("@ImageID", ImageID); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImage.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = ROFstImage.Add(cn, _MyROFst, _MyROImage, _DTS, _UserID); - else - _LastChanged = ROFstImage.Update(cn, _MyROFst, _MyROImage, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ROFst myROFst, ROImage myROImage, DateTime dts, string userID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImage.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateROFstImage"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ROFstID", myROFst.ROFstID); - cm.Parameters.AddWithValue("@ImageID", myROImage.ImageID); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImage.Update", ex); - throw new DbCslaException("ROFstImage.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_ROFstID, _ImageID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImage.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteROFstImage"; - cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID); - cm.Parameters.AddWithValue("@ImageID", criteria.ImageID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImage.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROFstImage.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int rOFstID, int imageID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImage.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteROFstImage"; - // Input PK Fields - cm.Parameters.AddWithValue("@ROFstID", rOFstID); - cm.Parameters.AddWithValue("@ImageID", imageID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImage.Remove", ex); - throw new DbCslaException("ROFstImage.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int rOFstID, int imageID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(rOFstID, imageID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFstImage.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _ROFstID; - private int _ImageID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int rOFstID, int imageID) - { - _ROFstID = rOFstID; - _ImageID = imageID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImage.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsROFstImage"; - cm.Parameters.AddWithValue("@ROFstID", _ROFstID); - cm.Parameters.AddWithValue("@ImageID", _ImageID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImage.DataPortal_Execute", ex); - throw new DbCslaException("ROFstImage.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - ROFstImageExtension _ROFstImageExtension = new ROFstImageExtension(); - [Serializable()] - partial class ROFstImageExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ROFstImageConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ROFstImage) - { - // Return the ToString value - return ((ROFstImage)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ROFstImageExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ROFstImage -// { -// partial class ROFstImageExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstImageInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstImageInfo.cs deleted file mode 100644 index da5d8fd1..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstImageInfo.cs +++ /dev/null @@ -1,408 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void ROFstImageInfoEvent(object sender); - /// - /// ROFstImageInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ROFstImageInfoConverter))] - public partial class ROFstImageInfo : ReadOnlyBase, IDisposable - { - public event ROFstImageInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(ROFstImageInfo rOFstImageInfo) - { - if (!_CacheList.Contains(rOFstImageInfo)) _CacheList.Add(rOFstImageInfo); // In AddToCache - } - protected static void RemoveFromCache(ROFstImageInfo rOFstImageInfo) - { - while (_CacheList.Contains(rOFstImageInfo)) _CacheList.Remove(rOFstImageInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (ROFstImageInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ROFstID.ToString() + "_" + tmp.ImageID.ToString())) - { - _CacheByPrimaryKey[tmp.ROFstID.ToString() + "_" + tmp.ImageID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ROFstID.ToString() + "_" + tmp.ImageID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (ROFstImageInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(ROFstImageInfoList lst) - { - foreach (ROFstImageInfo item in lst) AddToCache(item); - } - protected static ROFstImageInfo GetCachedByPrimaryKey(int rOFstID, int imageID) - { - ConvertListToDictionary(); - string key = rOFstID.ToString() + "_" + imageID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected ROFstImage _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _ROFstID; - [System.ComponentModel.DataObjectField(true, true)] - public int ROFstID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROFst != null) _ROFstID = _MyROFst.ROFstID; - return _ROFstID; - } - } - private ROFstInfo _MyROFst; - [System.ComponentModel.DataObjectField(true, true)] - public ROFstInfo MyROFst - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFstInfo.Get(_ROFstID); - return _MyROFst; - } - } - private int _ImageID; - [System.ComponentModel.DataObjectField(true, true)] - public int ImageID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROImage != null) _ImageID = _MyROImage.ImageID; - return _ImageID; - } - } - private ROImageInfo _MyROImage; - [System.ComponentModel.DataObjectField(true, true)] - public ROImageInfo MyROImage - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROImage == null && _ImageID != 0) _MyROImage = ROImageInfo.Get(_ImageID); - return _MyROImage; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - // TODO: Replace base ROFstImageInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ROFstImageInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check ROFstImageInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ROFstImageInfo - protected override object GetIdValue() - { - return (_ROFstID.ToString() + "." + _ImageID.ToString()).GetHashCode(); - } - #endregion - #region Factory Methods - private static int _ROFstImageInfoUnique = 0; - private static int ROFstImageInfoUnique - { get { return ++_ROFstImageInfoUnique; } } - private int _MyROFstImageInfoUnique = ROFstImageInfoUnique; - public int MyROFstImageInfoUnique - { get { return _MyROFstImageInfoUnique; } } - protected ROFstImageInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(ROFstID.ToString() + "_" + ImageID.ToString())) return; - List listROFstImageInfo = _CacheByPrimaryKey[ROFstID.ToString() + "_" + ImageID.ToString()]; // Get the list of items - while (listROFstImageInfo.Contains(this)) listROFstImageInfo.Remove(this); // Remove the item from the list - if (listROFstImageInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(ROFstID.ToString() + "_" + ImageID.ToString()); // remove the list - } - public virtual ROFstImage Get() - { - return _Editable = ROFstImage.Get(_ROFstID, _ImageID); - } - public static void Refresh(ROFstImage tmp) - { - string key = tmp.ROFstID.ToString() + "_" + tmp.ImageID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ROFstImageInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ROFstImage tmp) - { - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _ROFstImageInfoExtension.Refresh(this); - if (_MyROFst != null) - { - _MyROFst.Dispose();// Dispose related value - _MyROFst = null;// Reset related value - } - if (_MyROImage != null) - { - _MyROImage.Dispose();// Dispose related value - _MyROImage = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(ROFst myROFst, ROFstROFstImage tmp) - { - string key = myROFst.ROFstID.ToString() + "_" + tmp.ImageID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ROFstImageInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ROFstROFstImage tmp) - { - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _ROFstImageInfoExtension.Refresh(this); - if (_MyROFst != null) - { - _MyROFst.Dispose();// Dispose related value - _MyROFst = null;// Reset related value - } - if (_MyROImage != null) - { - _MyROImage.Dispose();// Dispose related value - _MyROImage = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(ROImage myROImage, ROImageROFstImage tmp) - { - string key = tmp.ROFstID.ToString() + "_" + myROImage.ImageID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ROFstImageInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ROImageROFstImage tmp) - { - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _ROFstImageInfoExtension.Refresh(this); - if (_MyROFst != null) - { - _MyROFst.Dispose();// Dispose related value - _MyROFst = null;// Reset related value - } - if (_MyROImage != null) - { - _MyROImage.Dispose();// Dispose related value - _MyROImage = null;// Reset related value - } - OnChange();// raise an event - } - public static ROFstImageInfo Get(int rOFstID, int imageID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a ROFstImage"); - try - { - ROFstImageInfo tmp = GetCachedByPrimaryKey(rOFstID, imageID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(rOFstID, imageID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ROFstImageInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFstImageInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal ROFstImageInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImageInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImageInfo.Constructor", ex); - throw new DbCslaException("ROFstImageInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _ROFstID; - public int ROFstID - { get { return _ROFstID; } } - private int _ImageID; - public int ImageID - { get { return _ImageID; } } - public PKCriteria(int rOFstID, int imageID) - { - _ROFstID = rOFstID; - _ImageID = imageID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImageInfo.ReadData", GetHashCode()); - try - { - _ROFstID = dr.GetInt32("ROFstID"); - _ImageID = dr.GetInt32("ImageID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImageInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROFstImageInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImageInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROFstImage"; - cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID); - cm.Parameters.AddWithValue("@ImageID", criteria.ImageID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImageInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROFstImageInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - ROFstImageInfoExtension _ROFstImageInfoExtension = new ROFstImageInfoExtension(); - [Serializable()] - partial class ROFstImageInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(ROFstImageInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class ROFstImageInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ROFstImageInfo) - { - // Return the ToString value - return ((ROFstImageInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstImageInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstImageInfoList.cs deleted file mode 100644 index 42da0b0a..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstImageInfoList.cs +++ /dev/null @@ -1,312 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// ROFstImageInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ROFstImageInfoListConverter))] - public partial class ROFstImageInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (ROFstImageInfo tmp in this) - { - tmp.Changed += new ROFstImageInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (ROFstImageInfo tmp in this) - { - tmp.Changed -= new ROFstImageInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static ROFstImageInfoList _ROFstImageInfoList = null; - /// - /// Return a list of all projects. - /// - public static ROFstImageInfoList Get() - { - try - { - if (_ROFstImageInfoList != null) - return _ROFstImageInfoList; - ROFstImageInfoList tmp = DataPortal.Fetch(); - ROFstImageInfo.AddList(tmp); - tmp.AddEvents(); - _ROFstImageInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFstImageInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static ROFstImageInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on ROFstImageInfoList.Get", ex); - // } - //} - public static ROFstImageInfoList GetByROFstID(int rOFstID) - { - try - { - ROFstImageInfoList tmp = DataPortal.Fetch(new ROFstIDCriteria(rOFstID)); - ROFstImageInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFstImageInfoList.GetByROFstID", ex); - } - } - public static ROFstImageInfoList GetByImageID(int imageID) - { - try - { - ROFstImageInfoList tmp = DataPortal.Fetch(new ImageIDCriteria(imageID)); - ROFstImageInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFstImageInfoList.GetByImageID", ex); - } - } - private ROFstImageInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImageInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROFstImages"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new ROFstImageInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImageInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ROFstImageInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ROFstIDCriteria - { - public ROFstIDCriteria(int rOFstID) - { - _ROFstID = rOFstID; - } - private int _ROFstID; - public int ROFstID - { - get { return _ROFstID; } - set { _ROFstID = value; } - } - } - private void DataPortal_Fetch(ROFstIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImageInfoList.DataPortal_FetchROFstID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROFstImagesByROFstID"; - cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new ROFstImageInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImageInfoList.DataPortal_FetchROFstID", ex); - throw new DbCslaException("ROFstImageInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ImageIDCriteria - { - public ImageIDCriteria(int imageID) - { - _ImageID = imageID; - } - private int _ImageID; - public int ImageID - { - get { return _ImageID; } - set { _ImageID = value; } - } - } - private void DataPortal_Fetch(ImageIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstImageInfoList.DataPortal_FetchImageID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROFstImagesByImageID"; - cm.Parameters.AddWithValue("@ImageID", criteria.ImageID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new ROFstImageInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstImageInfoList.DataPortal_FetchImageID", ex); - throw new DbCslaException("ROFstImageInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ROFstImageInfoListPropertyDescriptor pd = new ROFstImageInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ROFstImageInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private ROFstImageInfo Item { get { return (ROFstImageInfo)_Item; } } - public ROFstImageInfoListPropertyDescriptor(ROFstImageInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ROFstImageInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ROFstImageInfoList) - { - // Return department and department role separated by comma. - return ((ROFstImageInfoList)value).Items.Count.ToString() + " ROFstImages"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstInfo.cs deleted file mode 100644 index c730a80a..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstInfo.cs +++ /dev/null @@ -1,441 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void ROFstInfoEvent(object sender); - /// - /// ROFstInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ROFstInfoConverter))] - public partial class ROFstInfo : ReadOnlyBase, IDisposable - { - public event ROFstInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(ROFstInfo rOFstInfo) - { - if (!_CacheList.Contains(rOFstInfo)) _CacheList.Add(rOFstInfo); // In AddToCache - } - protected static void RemoveFromCache(ROFstInfo rOFstInfo) - { - while (_CacheList.Contains(rOFstInfo)) _CacheList.Remove(rOFstInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (ROFstInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ROFstID.ToString())) - { - _CacheByPrimaryKey[tmp.ROFstID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ROFstID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (ROFstInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(ROFstInfoList lst) - { - foreach (ROFstInfo item in lst) AddToCache(item); - } - protected static ROFstInfo GetCachedByPrimaryKey(int rOFstID) - { - ConvertListToDictionary(); - string key = rOFstID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected ROFst _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _ROFstID; - [System.ComponentModel.DataObjectField(true, true)] - public int ROFstID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFstID; - } - } - private int _RODbID; - public int RODbID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRODb != null) _RODbID = _MyRODb.RODbID; - return _RODbID; - } - } - private RODbInfo _MyRODb; - public RODbInfo MyRODb - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRODb == null && _RODbID != 0) _MyRODb = RODbInfo.Get(_RODbID); - return _MyRODb; - } - } - private byte[] _ROFST; - public byte[] ROFST - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFST; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - private int _ROFstDocVersionROFstCount = 0; - /// - /// Count of ROFstDocVersionROFsts for this ROFst - /// - public int ROFstDocVersionROFstCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFstDocVersionROFstCount; - } - } - private DocVersionROFstInfoList _ROFstDocVersionROFsts = null; - [TypeConverter(typeof(DocVersionROFstInfoListConverter))] - public DocVersionROFstInfoList ROFstDocVersionROFsts - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ROFstDocVersionROFstCount < 0 || (_ROFstDocVersionROFstCount > 0 && _ROFstDocVersionROFsts == null)) - _ROFstDocVersionROFsts = DocVersionROFstInfoList.GetByROFstID(_ROFstID); - if (_ROFstDocVersionROFstCount < 0) - _ROFstDocVersionROFstCount = _ROFstDocVersionROFsts.Count; - return _ROFstDocVersionROFsts; - } - } - public void RefreshROFstDocVersionROFsts() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ROFstID.ToString())) - foreach (ROFstInfo tmp in _CacheByPrimaryKey[_ROFstID.ToString()]) - tmp._ROFstDocVersionROFstCount = -1; // This will cause the data to be requeried - } - private int _ROFstROFstImageCount = 0; - /// - /// Count of ROFstROFstImages for this ROFst - /// - public int ROFstROFstImageCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFstROFstImageCount; - } - } - private ROFstImageInfoList _ROFstROFstImages = null; - [TypeConverter(typeof(ROFstImageInfoListConverter))] - public ROFstImageInfoList ROFstROFstImages - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ROFstROFstImageCount < 0 || (_ROFstROFstImageCount > 0 && _ROFstROFstImages == null)) - _ROFstROFstImages = ROFstImageInfoList.GetByROFstID(_ROFstID); - if (_ROFstROFstImageCount < 0) - _ROFstROFstImageCount = _ROFstROFstImages.Count; - return _ROFstROFstImages; - } - } - public void RefreshROFstROFstImages() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ROFstID.ToString())) - foreach (ROFstInfo tmp in _CacheByPrimaryKey[_ROFstID.ToString()]) - tmp._ROFstROFstImageCount = -1; // This will cause the data to be requeried - } - // TODO: Replace base ROFstInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ROFstInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check ROFstInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ROFstInfo - protected override object GetIdValue() - { - return _ROFstID; - } - #endregion - #region Factory Methods - private static int _ROFstInfoUnique = 0; - private static int ROFstInfoUnique - { get { return ++_ROFstInfoUnique; } } - private int _MyROFstInfoUnique = ROFstInfoUnique; - public int MyROFstInfoUnique - { get { return _MyROFstInfoUnique; } } - protected ROFstInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(ROFstID.ToString())) return; - List listROFstInfo = _CacheByPrimaryKey[ROFstID.ToString()]; // Get the list of items - while (listROFstInfo.Contains(this)) listROFstInfo.Remove(this); // Remove the item from the list - if (listROFstInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(ROFstID.ToString()); // remove the list - } - public virtual ROFst Get() - { - return _Editable = ROFst.Get(_ROFstID); - } - public static void Refresh(ROFst tmp) - { - string key = tmp.ROFstID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ROFstInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ROFst tmp) - { - if (_RODbID != tmp.RODbID) - { - if (MyRODb != null) MyRODb.RefreshRODbROFsts(); // Update List for old value - _RODbID = tmp.RODbID; // Update the value - } - _MyRODb = null; // Reset list so that the next line gets a new list - if (MyRODb != null) MyRODb.RefreshRODbROFsts(); // Update List for new value - _ROFST = tmp.ROFST; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _ROFstInfoExtension.Refresh(this); - if (_MyRODb != null) - { - _MyRODb.Dispose();// Dispose related value - _MyRODb = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(RODbROFst tmp) - { - string key = tmp.ROFstID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ROFstInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(RODbROFst tmp) - { - _ROFST = tmp.ROFST; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _ROFstInfoExtension.Refresh(this); - if (_MyRODb != null) - { - _MyRODb.Dispose();// Dispose related value - _MyRODb = null;// Reset related value - } - OnChange();// raise an event - } - public static ROFstInfo Get(int rOFstID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a ROFst"); - try - { - ROFstInfo tmp = GetCachedByPrimaryKey(rOFstID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(rOFstID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ROFstInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFstInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal ROFstInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstInfo.Constructor", ex); - throw new DbCslaException("ROFstInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _ROFstID; - public int ROFstID - { get { return _ROFstID; } } - public PKCriteria(int rOFstID) - { - _ROFstID = rOFstID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstInfo.ReadData", GetHashCode()); - try - { - _ROFstID = dr.GetInt32("ROFstID"); - _RODbID = dr.GetInt32("RODbID"); - _ROFST = (byte[])dr.GetValue("ROFST"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _ROFstDocVersionROFstCount = dr.GetInt32("DocVersionROFstCount"); - _ROFstROFstImageCount = dr.GetInt32("ROFstImageCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROFstInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROFst"; - cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROFstInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - ROFstInfoExtension _ROFstInfoExtension = new ROFstInfoExtension(); - [Serializable()] - partial class ROFstInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(ROFstInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class ROFstInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ROFstInfo) - { - // Return the ToString value - return ((ROFstInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstInfoList.cs deleted file mode 100644 index 2585534d..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstInfoList.cs +++ /dev/null @@ -1,255 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// ROFstInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ROFstInfoListConverter))] - public partial class ROFstInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (ROFstInfo tmp in this) - { - tmp.Changed += new ROFstInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (ROFstInfo tmp in this) - { - tmp.Changed -= new ROFstInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static ROFstInfoList _ROFstInfoList = null; - /// - /// Return a list of all projects. - /// - public static ROFstInfoList Get() - { - try - { - if (_ROFstInfoList != null) - return _ROFstInfoList; - ROFstInfoList tmp = DataPortal.Fetch(); - ROFstInfo.AddList(tmp); - tmp.AddEvents(); - _ROFstInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFstInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static ROFstInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on ROFstInfoList.Get", ex); - // } - //} - public static ROFstInfoList GetByRODbID(int rODbID) - { - try - { - ROFstInfoList tmp = DataPortal.Fetch(new RODbIDCriteria(rODbID)); - ROFstInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFstInfoList.GetByRODbID", ex); - } - } - private ROFstInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROFsts"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new ROFstInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ROFstInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class RODbIDCriteria - { - public RODbIDCriteria(int rODbID) - { - _RODbID = rODbID; - } - private int _RODbID; - public int RODbID - { - get { return _RODbID; } - set { _RODbID = value; } - } - } - private void DataPortal_Fetch(RODbIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstInfoList.DataPortal_FetchRODbID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROFstsByRODbID"; - cm.Parameters.AddWithValue("@RODbID", criteria.RODbID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new ROFstInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstInfoList.DataPortal_FetchRODbID", ex); - throw new DbCslaException("ROFstInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ROFstInfoListPropertyDescriptor pd = new ROFstInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ROFstInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private ROFstInfo Item { get { return (ROFstInfo)_Item; } } - public ROFstInfoListPropertyDescriptor(ROFstInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ROFstInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ROFstInfoList) - { - // Return department and department role separated by comma. - return ((ROFstInfoList)value).Items.Count.ToString() + " ROFsts"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstROFstImage.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstROFstImage.cs deleted file mode 100644 index 0ccf4dc8..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstROFstImage.cs +++ /dev/null @@ -1,434 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ROFstROFstImage Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ROFstROFstImageConverter))] - public partial class ROFstROFstImage : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _ImageID; - [System.ComponentModel.DataObjectField(true, true)] - public int ImageID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROImage != null) _ImageID = _MyROImage.ImageID; - return _ImageID; - } - } - private ROImage _MyROImage; - [System.ComponentModel.DataObjectField(true, true)] - public ROImage MyROImage - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROImage == null && _ImageID != 0) _MyROImage = ROImage.Get(_ImageID); - return _MyROImage; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _ROImage_RODbID; - public int ROImage_RODbID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROImage_RODbID; - } - } - private string _ROImage_FileName = string.Empty; - public string ROImage_FileName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROImage_FileName; - } - } - private byte[] _ROImage_Content; - public byte[] ROImage_Content - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROImage_Content; - } - } - private DateTime _ROImage_DTS = new DateTime(); - public DateTime ROImage_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROImage_DTS; - } - } - private string _ROImage_UserID = string.Empty; - public string ROImage_UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROImage_UserID; - } - } - // TODO: Check ROFstROFstImage.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ROFstROFstImage - protected override object GetIdValue() - { - return _ImageID; - } - // TODO: Replace base ROFstROFstImage.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ROFstROFstImage - //public override string ToString() - //{ - // return base.ToString(); - //} - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ImageID, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static ROFstROFstImage New(ROImage myROImage) - { - return new ROFstROFstImage(myROImage); - } - internal static ROFstROFstImage Get(SafeDataReader dr) - { - return new ROFstROFstImage(dr); - } - public ROFstROFstImage() - { - MarkAsChild(); - - _DTS = _ROFstROFstImageExtension.DefaultDTS; - _UserID = _ROFstROFstImageExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private ROFstROFstImage(ROImage myROImage) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _DTS = _ROFstROFstImageExtension.DefaultDTS; - _UserID = _ROFstROFstImageExtension.DefaultUserID; - _MyROImage = myROImage; - ValidationRules.CheckRules(); - } - internal ROFstROFstImage(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstROFstImage.FetchDR", GetHashCode()); - try - { - _ImageID = dr.GetInt32("ImageID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _ROImage_RODbID = dr.GetInt32("ROImage_RODbID"); - _ROImage_FileName = dr.GetString("ROImage_FileName"); - _ROImage_Content = (byte[])dr.GetValue("ROImage_Content"); - _ROImage_DTS = dr.GetDateTime("ROImage_DTS"); - _ROImage_UserID = dr.GetString("ROImage_UserID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstROFstImage.FetchDR", ex); - throw new DbCslaException("ROFstROFstImage.Fetch", ex); - } - MarkOld(); - } - internal void Insert(ROFst myROFst) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = ROFstImage.Add(cn, myROFst, _MyROImage, _DTS, _UserID); - MarkOld(); - } - internal void Update(ROFst myROFst) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = ROFstImage.Update(cn, myROFst, _MyROImage, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(ROFst myROFst) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - ROFstImage.Remove(cn, myROFst.ROFstID, _ImageID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - ROFstROFstImageExtension _ROFstROFstImageExtension = new ROFstROFstImageExtension(); - [Serializable()] - partial class ROFstROFstImageExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ROFstROFstImageConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ROFstROFstImage) - { - // Return the ToString value - return ((ROFstROFstImage)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ROFstROFstImageExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ROFstROFstImage -// { -// partial class ROFstROFstImageExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstROFstImages.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstROFstImages.cs deleted file mode 100644 index 97b81357..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROFstROFstImages.cs +++ /dev/null @@ -1,295 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ROFstROFstImages Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ROFstROFstImagesConverter))] - public partial class ROFstROFstImages : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // Many To Many - public ROFstROFstImage this[ROImage myROImage] - { - get - { - foreach (ROFstROFstImage rOFstImage in this) - if (rOFstImage.ImageID == myROImage.ImageID) - return rOFstImage; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public ROFstROFstImage GetItem(ROImage myROImage) - { - foreach (ROFstROFstImage rOFstImage in this) - if (rOFstImage.ImageID == myROImage.ImageID) - return rOFstImage; - return null; - } - public ROFstROFstImage Add(ROImage myROImage)// Many to Many with required fields - { - if (!Contains(myROImage)) - { - ROFstROFstImage rOFstImage = ROFstROFstImage.New(myROImage); - this.Add(rOFstImage); - return rOFstImage; - } - else - throw new InvalidOperationException("rOFstImage already exists"); - } - public void Remove(ROImage myROImage) - { - foreach (ROFstROFstImage rOFstImage in this) - { - if (rOFstImage.ImageID == myROImage.ImageID) - { - Remove(rOFstImage); - break; - } - } - } - public bool Contains(ROImage myROImage) - { - foreach (ROFstROFstImage rOFstImage in this) - if (rOFstImage.ImageID == myROImage.ImageID) - return true; - return false; - } - public bool ContainsDeleted(ROImage myROImage) - { - foreach (ROFstROFstImage rOFstImage in DeletedList) - if (rOFstImage.ImageID == myROImage.ImageID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (ROFstROFstImage rOFstROFstImage in this) - if ((hasBrokenRules = rOFstROFstImage.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static ROFstROFstImages New() - { - return new ROFstROFstImages(); - } - internal static ROFstROFstImages Get(SafeDataReader dr) - { - return new ROFstROFstImages(dr); - } - public static ROFstROFstImages GetByROFstID(int rOFstID) - { - try - { - return DataPortal.Fetch(new ROFstIDCriteria(rOFstID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROFstROFstImages.GetByROFstID", ex); - } - } - private ROFstROFstImages() - { - MarkAsChild(); - } - internal ROFstROFstImages(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(ROFstROFstImage.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ROFstIDCriteria - { - public ROFstIDCriteria(int rOFstID) - { - _ROFstID = rOFstID; - } - private int _ROFstID; - public int ROFstID - { - get { return _ROFstID; } - set { _ROFstID = value; } - } - } - private void DataPortal_Fetch(ROFstIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROFstROFstImages.DataPortal_FetchROFstID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROFstImagesByROFstID"; - cm.Parameters.AddWithValue("@ROFstID", criteria.ROFstID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new ROFstROFstImage(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROFstROFstImages.DataPortal_FetchROFstID", ex); - throw new DbCslaException("ROFstROFstImages.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(ROFst rOFst) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (ROFstROFstImage obj in DeletedList) - obj.DeleteSelf(rOFst);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (ROFstROFstImage obj in this) - { - if (obj.IsNew) - obj.Insert(rOFst); - else - obj.Update(rOFst); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ROFstROFstImagesPropertyDescriptor pd = new ROFstROFstImagesPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ROFstROFstImagesPropertyDescriptor : vlnListPropertyDescriptor - { - private ROFstROFstImage Item { get { return (ROFstROFstImage)_Item; } } - public ROFstROFstImagesPropertyDescriptor(ROFstROFstImages collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ROFstROFstImagesConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ROFstROFstImages) - { - // Return department and department role separated by comma. - return ((ROFstROFstImages)value).Items.Count.ToString() + " ROFstImages"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImage.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImage.cs deleted file mode 100644 index 8be16bc0..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImage.cs +++ /dev/null @@ -1,1094 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ROImage Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ROImageConverter))] - public partial class ROImage : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshROImages = new List(); - private List _RefreshROImageROFstImages = new List(); - private void AddToRefreshList(List refreshROImages, List refreshROImageROFstImages) - { - if (IsDirty) - refreshROImages.Add(this); - if (_ROImageROFstImages != null && _ROImageROFstImages.IsDirty) - { - foreach (ROImageROFstImage tmp in _ROImageROFstImages) - { - if (tmp.IsDirty) refreshROImageROFstImages.Add(tmp); - } - } - } - private void BuildRefreshList() - { - _RefreshROImages = new List(); - _RefreshROImageROFstImages = new List(); - AddToRefreshList(_RefreshROImages, _RefreshROImageROFstImages); - } - private void ProcessRefreshList() - { - foreach (ROImage tmp in _RefreshROImages) - { - ROImageInfo.Refresh(tmp); - if (tmp._MyRODb != null) RODbInfo.Refresh(tmp._MyRODb); - } - foreach (ROImageROFstImage tmp in _RefreshROImageROFstImages) - { - ROFstImageInfo.Refresh(this, tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(ROImage rOImage) - { - if (!_CacheList.Contains(rOImage)) _CacheList.Add(rOImage); // In AddToCache - } - protected static void RemoveFromCache(ROImage rOImage) - { - while (_CacheList.Contains(rOImage)) _CacheList.Remove(rOImage); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (ROImage tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ImageID.ToString())) - { - _CacheByPrimaryKey[tmp.ImageID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ImageID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (ROImage tmp in remove) - RemoveFromCache(tmp); - } - protected static ROImage GetCachedByPrimaryKey(int imageID) - { - ConvertListToDictionary(); - string key = imageID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextImageID = -1; - public static int NextImageID - { - get { return _nextImageID--; } - } - private int _ImageID; - [System.ComponentModel.DataObjectField(true, true)] - public int ImageID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ImageID; - } - } - private int _RODbID; - public int RODbID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRODb != null) _RODbID = _MyRODb.RODbID; - return _RODbID; - } - } - private RODb _MyRODb; - public RODb MyRODb - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRODb == null && _RODbID != 0) _MyRODb = RODb.Get(_RODbID); - return _MyRODb; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyRODb != value) - { - _MyRODb = value; - PropertyHasChanged(); - } - } - } - private string _FileName = string.Empty; - public string FileName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FileName; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_FileName != value) - { - _FileName = value; - PropertyHasChanged(); - } - } - } - private byte[] _Content; - public byte[] Content - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_Content != value) - { - _Content = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _ROImageROFstImageCount = 0; - /// - /// Count of ROImageROFstImages for this ROImage - /// - public int ROImageROFstImageCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROImageROFstImageCount; - } - } - private ROImageROFstImages _ROImageROFstImages = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ROImageROFstImagesConverter))] - public ROImageROFstImages ROImageROFstImages - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ROImageROFstImageCount > 0 && _ROImageROFstImages == null) - _ROImageROFstImages = ROImageROFstImages.GetByImageID(ImageID); - else if (_ROImageROFstImages == null) - _ROImageROFstImages = ROImageROFstImages.New(); - return _ROImageROFstImages; - } - } - public override bool IsDirty - { - get { return base.IsDirty || (_ROImageROFstImages == null ? false : _ROImageROFstImages.IsDirty) || (_MyRODb == null ? false : _MyRODb.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_ROImageROFstImages == null ? true : _ROImageROFstImages.IsValid) && (_MyRODb == null ? true : _MyRODb.IsValid); } - } - // TODO: Replace base ROImage.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ROImage - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check ROImage.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ROImage - protected override object GetIdValue() - { - return _ImageID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_ROImageROFstImages != null && (hasBrokenRules = _ROImageROFstImages.HasBrokenRules) != null) return hasBrokenRules; - if (_MyRODb != null && (hasBrokenRules = _MyRODb.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyRODbRequired, "MyRODb"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "FileName"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("FileName", 255)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _ROImageExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _ROImageExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - private static bool MyRODbRequired(ROImage target, Csla.Validation.RuleArgs e) - { - if (target._RODbID == 0 && target._MyRODb == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ImageID, ""); - //AuthorizationRules.AllowRead(RODbID, ""); - //AuthorizationRules.AllowRead(FileName, ""); - //AuthorizationRules.AllowRead(Content, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(RODbID, ""); - //AuthorizationRules.AllowWrite(FileName, ""); - //AuthorizationRules.AllowWrite(Content, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - _ROImageExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _ROImageExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - /// - /// determines if related records (Foreign Keys) will keep this Item from being deleted - /// - public bool CanDelete - { - get - { - // Check to make sure that there are not any related records - int usedByCount = 0; - usedByCount += _ROImageROFstImageCount; - return (usedByCount == 0); - } - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _ROImageUnique = 0; - protected static int ROImageUnique - { get { return ++_ROImageUnique; } } - private int _MyROImageUnique = ROImageUnique; - public int MyROImageUnique - { get { return _MyROImageUnique; } } - protected ROImage() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(ImageID.ToString())) - { - List listROImage = _CacheByPrimaryKey[ImageID.ToString()]; // Get the list of items - while (listROImage.Contains(this)) listROImage.Remove(this); // Remove the item from the list - if (listROImage.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(ImageID.ToString()); // remove the list - } - } - public static ROImage New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a ROImage"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROImage.New", ex); - } - } - public static ROImage New(RODb myRODb, string fileName, byte[] content) - { - ROImage tmp = ROImage.New(); - tmp.MyRODb = myRODb; - tmp.FileName = fileName; - tmp.Content = content; - return tmp; - } - public static ROImage MakeROImage(RODb myRODb, string fileName, byte[] content) - { - ROImage tmp = ROImage.New(myRODb, fileName, content); - if (tmp.IsSavable) - { - ROImage tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static ROImage New(RODb myRODb, string fileName, byte[] content, DateTime dts, string userID) - { - ROImage tmp = ROImage.New(); - tmp.MyRODb = myRODb; - tmp.FileName = fileName; - tmp.Content = content; - tmp.DTS = dts; - tmp.UserID = userID; - return tmp; - } - public static ROImage MakeROImage(RODb myRODb, string fileName, byte[] content, DateTime dts, string userID) - { - ROImage tmp = ROImage.New(myRODb, fileName, content, dts, userID); - if (tmp.IsSavable) - { - ROImage tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static ROImage Get(int imageID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a ROImage"); - try - { - ROImage tmp = GetCachedByPrimaryKey(imageID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(imageID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ROImage - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROImage.Get", ex); - } - } - public static ROImage Get(SafeDataReader dr) - { - if (dr.Read()) return new ROImage(dr); - return null; - } - internal ROImage(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int imageID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a ROImage"); - try - { - DataPortal.Delete(new PKCriteria(imageID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROImage.Delete", ex); - } - } - public override ROImage Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a ROImage"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a ROImage"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a ROImage"); - try - { - BuildRefreshList(); - ROImage rOImage = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(rOImage);//Refresh the item in AllList - ProcessRefreshList(); - return rOImage; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _ImageID; - public int ImageID - { get { return _ImageID; } } - public PKCriteria(int imageID) - { - _ImageID = imageID; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _ImageID = NextImageID; - // Database Defaults - _DTS = _ROImageExtension.DefaultDTS; - _UserID = _ROImageExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImage.ReadData", GetHashCode()); - try - { - _ImageID = dr.GetInt32("ImageID"); - _RODbID = dr.GetInt32("RODbID"); - _FileName = dr.GetString("FileName"); - _Content = (byte[])dr.GetValue("Content"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _ROImageROFstImageCount = dr.GetInt32("ROFstImageCount"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImage.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROImage.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImage.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROImage"; - cm.Parameters.AddWithValue("@ImageID", criteria.ImageID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _ROImageROFstImages = ROImageROFstImages.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImage.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROImage.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImage.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROImage.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImage.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyRODb != null) _MyRODb.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addROImage"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@RODbID", RODbID); - cm.Parameters.AddWithValue("@FileName", _FileName); - cm.Parameters.AddWithValue("@Content", _Content); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - // Output Calculated Columns - SqlParameter param_ImageID = new SqlParameter("@newImageID", SqlDbType.Int); - param_ImageID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_ImageID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _ImageID = (int)cm.Parameters["@newImageID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_ROImageROFstImages != null) _ROImageROFstImages.Update(this); - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImage.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImage.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROImage.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int imageID, RODb myRODb, string fileName, byte[] content, DateTime dts, string userID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImage.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addROImage"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@RODbID", myRODb.RODbID); - cm.Parameters.AddWithValue("@FileName", fileName); - cm.Parameters.AddWithValue("@Content", content); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - // Output Calculated Columns - SqlParameter param_ImageID = new SqlParameter("@newImageID", SqlDbType.Int); - param_ImageID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_ImageID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - imageID = (int)cm.Parameters["@newImageID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImage.Add", ex); - throw new DbCslaException("ROImage.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImage.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImage.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImage.SQLUpdate", GetHashCode()); - try - { - if (_MyRODb != null) _MyRODb.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateROImage"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@ImageID", _ImageID); - cm.Parameters.AddWithValue("@RODbID", RODbID); - cm.Parameters.AddWithValue("@FileName", _FileName); - cm.Parameters.AddWithValue("@Content", _Content); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - if (_ROImageROFstImages != null) _ROImageROFstImages.Update(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImage.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = ROImage.Add(cn, ref _ImageID, _MyRODb, _FileName, _Content, _DTS, _UserID); - else - _LastChanged = ROImage.Update(cn, ref _ImageID, _MyRODb, _FileName, _Content, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - if (_ROImageROFstImages != null) _ROImageROFstImages.Update(this); - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int imageID, RODb myRODb, string fileName, byte[] content, DateTime dts, string userID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImage.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateROImage"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ImageID", imageID); - cm.Parameters.AddWithValue("@RODbID", myRODb.RODbID); - cm.Parameters.AddWithValue("@FileName", fileName); - cm.Parameters.AddWithValue("@Content", content); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImage.Update", ex); - throw new DbCslaException("ROImage.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_ImageID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImage.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteROImage"; - cm.Parameters.AddWithValue("@ImageID", criteria.ImageID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImage.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROImage.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int imageID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImage.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteROImage"; - // Input PK Fields - cm.Parameters.AddWithValue("@ImageID", imageID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImage.Remove", ex); - throw new DbCslaException("ROImage.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int imageID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(imageID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROImage.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _ImageID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int imageID) - { - _ImageID = imageID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImage.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsROImage"; - cm.Parameters.AddWithValue("@ImageID", _ImageID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImage.DataPortal_Execute", ex); - throw new DbCslaException("ROImage.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - ROImageExtension _ROImageExtension = new ROImageExtension(); - [Serializable()] - partial class ROImageExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ROImageConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ROImage) - { - // Return the ToString value - return ((ROImage)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ROImageExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ROImage -// { -// partial class ROImageExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImageInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImageInfo.cs deleted file mode 100644 index dcee318b..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImageInfo.cs +++ /dev/null @@ -1,419 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void ROImageInfoEvent(object sender); - /// - /// ROImageInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ROImageInfoConverter))] - public partial class ROImageInfo : ReadOnlyBase, IDisposable - { - public event ROImageInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(ROImageInfo rOImageInfo) - { - if (!_CacheList.Contains(rOImageInfo)) _CacheList.Add(rOImageInfo); // In AddToCache - } - protected static void RemoveFromCache(ROImageInfo rOImageInfo) - { - while (_CacheList.Contains(rOImageInfo)) _CacheList.Remove(rOImageInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (ROImageInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ImageID.ToString())) - { - _CacheByPrimaryKey[tmp.ImageID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ImageID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (ROImageInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(ROImageInfoList lst) - { - foreach (ROImageInfo item in lst) AddToCache(item); - } - protected static ROImageInfo GetCachedByPrimaryKey(int imageID) - { - ConvertListToDictionary(); - string key = imageID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected ROImage _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _ImageID; - [System.ComponentModel.DataObjectField(true, true)] - public int ImageID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ImageID; - } - } - private int _RODbID; - public int RODbID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRODb != null) _RODbID = _MyRODb.RODbID; - return _RODbID; - } - } - private RODbInfo _MyRODb; - public RODbInfo MyRODb - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRODb == null && _RODbID != 0) _MyRODb = RODbInfo.Get(_RODbID); - return _MyRODb; - } - } - private string _FileName = string.Empty; - public string FileName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FileName; - } - } - private byte[] _Content; - public byte[] Content - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Content; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - private int _ROImageROFstImageCount = 0; - /// - /// Count of ROImageROFstImages for this ROImage - /// - public int ROImageROFstImageCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROImageROFstImageCount; - } - } - private ROFstImageInfoList _ROImageROFstImages = null; - [TypeConverter(typeof(ROFstImageInfoListConverter))] - public ROFstImageInfoList ROImageROFstImages - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_ROImageROFstImageCount < 0 || (_ROImageROFstImageCount > 0 && _ROImageROFstImages == null)) - _ROImageROFstImages = ROFstImageInfoList.GetByImageID(_ImageID); - if (_ROImageROFstImageCount < 0) - _ROImageROFstImageCount = _ROImageROFstImages.Count; - return _ROImageROFstImages; - } - } - public void RefreshROImageROFstImages() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_ImageID.ToString())) - foreach (ROImageInfo tmp in _CacheByPrimaryKey[_ImageID.ToString()]) - tmp._ROImageROFstImageCount = -1; // This will cause the data to be requeried - } - // TODO: Replace base ROImageInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ROImageInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check ROImageInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ROImageInfo - protected override object GetIdValue() - { - return _ImageID; - } - #endregion - #region Factory Methods - private static int _ROImageInfoUnique = 0; - private static int ROImageInfoUnique - { get { return ++_ROImageInfoUnique; } } - private int _MyROImageInfoUnique = ROImageInfoUnique; - public int MyROImageInfoUnique - { get { return _MyROImageInfoUnique; } } - protected ROImageInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(ImageID.ToString())) return; - List listROImageInfo = _CacheByPrimaryKey[ImageID.ToString()]; // Get the list of items - while (listROImageInfo.Contains(this)) listROImageInfo.Remove(this); // Remove the item from the list - if (listROImageInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(ImageID.ToString()); // remove the list - } - public virtual ROImage Get() - { - return _Editable = ROImage.Get(_ImageID); - } - public static void Refresh(ROImage tmp) - { - string key = tmp.ImageID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ROImageInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ROImage tmp) - { - if (_RODbID != tmp.RODbID) - { - if (MyRODb != null) MyRODb.RefreshRODbROImages(); // Update List for old value - _RODbID = tmp.RODbID; // Update the value - } - _MyRODb = null; // Reset list so that the next line gets a new list - if (MyRODb != null) MyRODb.RefreshRODbROImages(); // Update List for new value - _FileName = tmp.FileName; - _Content = tmp.Content; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _ROImageInfoExtension.Refresh(this); - if (_MyRODb != null) - { - _MyRODb.Dispose();// Dispose related value - _MyRODb = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(RODbROImage tmp) - { - string key = tmp.ImageID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ROImageInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(RODbROImage tmp) - { - _FileName = tmp.FileName; - _Content = tmp.Content; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _ROImageInfoExtension.Refresh(this); - if (_MyRODb != null) - { - _MyRODb.Dispose();// Dispose related value - _MyRODb = null;// Reset related value - } - OnChange();// raise an event - } - public static ROImageInfo Get(int imageID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a ROImage"); - try - { - ROImageInfo tmp = GetCachedByPrimaryKey(imageID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(imageID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ROImageInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROImageInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal ROImageInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImageInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImageInfo.Constructor", ex); - throw new DbCslaException("ROImageInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _ImageID; - public int ImageID - { get { return _ImageID; } } - public PKCriteria(int imageID) - { - _ImageID = imageID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImageInfo.ReadData", GetHashCode()); - try - { - _ImageID = dr.GetInt32("ImageID"); - _RODbID = dr.GetInt32("RODbID"); - _FileName = dr.GetString("FileName"); - _Content = (byte[])dr.GetValue("Content"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _ROImageROFstImageCount = dr.GetInt32("ROFstImageCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImageInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROImageInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImageInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROImage"; - cm.Parameters.AddWithValue("@ImageID", criteria.ImageID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImageInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ROImageInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - ROImageInfoExtension _ROImageInfoExtension = new ROImageInfoExtension(); - [Serializable()] - partial class ROImageInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(ROImageInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class ROImageInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ROImageInfo) - { - // Return the ToString value - return ((ROImageInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImageInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImageInfoList.cs deleted file mode 100644 index dc4cdceb..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImageInfoList.cs +++ /dev/null @@ -1,259 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// ROImageInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ROImageInfoListConverter))] - public partial class ROImageInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (ROImageInfo tmp in this) - { - tmp.Changed += new ROImageInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (ROImageInfo tmp in this) - { - tmp.Changed -= new ROImageInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static ROImageInfoList _ROImageInfoList = null; - /// - /// Return a list of all projects. - /// - public static ROImageInfoList Get() - { - try - { - if (_ROImageInfoList != null) - return _ROImageInfoList; - ROImageInfoList tmp = DataPortal.Fetch(); - ROImageInfo.AddList(tmp); - tmp.AddEvents(); - _ROImageInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROImageInfoList.Get", ex); - } - } - public static void Reset() - { - _ROImageInfoList = null; - } - // TODO: Add alternative gets - - //public static ROImageInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on ROImageInfoList.Get", ex); - // } - //} - public static ROImageInfoList GetByRODbID(int rODbID) - { - try - { - ROImageInfoList tmp = DataPortal.Fetch(new RODbIDCriteria(rODbID)); - ROImageInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROImageInfoList.GetByRODbID", ex); - } - } - private ROImageInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImageInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROImages"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new ROImageInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImageInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("ROImageInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class RODbIDCriteria - { - public RODbIDCriteria(int rODbID) - { - _RODbID = rODbID; - } - private int _RODbID; - public int RODbID - { - get { return _RODbID; } - set { _RODbID = value; } - } - } - private void DataPortal_Fetch(RODbIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImageInfoList.DataPortal_FetchRODbID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROImagesByRODbID"; - cm.Parameters.AddWithValue("@RODbID", criteria.RODbID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new ROImageInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImageInfoList.DataPortal_FetchRODbID", ex); - throw new DbCslaException("ROImageInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ROImageInfoListPropertyDescriptor pd = new ROImageInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ROImageInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private ROImageInfo Item { get { return (ROImageInfo)_Item; } } - public ROImageInfoListPropertyDescriptor(ROImageInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ROImageInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ROImageInfoList) - { - // Return department and department role separated by comma. - return ((ROImageInfoList)value).Items.Count.ToString() + " ROImages"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImageROFstImage.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImageROFstImage.cs deleted file mode 100644 index f8e5d5a9..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImageROFstImage.cs +++ /dev/null @@ -1,424 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ROImageROFstImage Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ROImageROFstImageConverter))] - public partial class ROImageROFstImage : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _ROFstID; - [System.ComponentModel.DataObjectField(true, true)] - public int ROFstID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROFst != null) _ROFstID = _MyROFst.ROFstID; - return _ROFstID; - } - } - private ROFst _MyROFst; - [System.ComponentModel.DataObjectField(true, true)] - public ROFst MyROFst - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyROFst == null && _ROFstID != 0) _MyROFst = ROFst.Get(_ROFstID); - return _MyROFst; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _ROFst_RODbID; - public int ROFst_RODbID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFst_RODbID; - } - } - private byte[] _ROFst_ROFST; - public byte[] ROFst_ROFST - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFst_ROFST; - } - } - private DateTime _ROFst_DTS = new DateTime(); - public DateTime ROFst_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFst_DTS; - } - } - private string _ROFst_UserID = string.Empty; - public string ROFst_UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROFst_UserID; - } - } - // TODO: Check ROImageROFstImage.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ROImageROFstImage - protected override object GetIdValue() - { - return _ROFstID; - } - // TODO: Replace base ROImageROFstImage.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ROImageROFstImage - //public override string ToString() - //{ - // return base.ToString(); - //} - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ROFstID, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static ROImageROFstImage New(ROFst myROFst) - { - return new ROImageROFstImage(myROFst); - } - internal static ROImageROFstImage Get(SafeDataReader dr) - { - return new ROImageROFstImage(dr); - } - public ROImageROFstImage() - { - MarkAsChild(); - - _DTS = _ROImageROFstImageExtension.DefaultDTS; - _UserID = _ROImageROFstImageExtension.DefaultUserID; - ValidationRules.CheckRules(); - } - private ROImageROFstImage(ROFst myROFst) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _DTS = _ROImageROFstImageExtension.DefaultDTS; - _UserID = _ROImageROFstImageExtension.DefaultUserID; - _MyROFst = myROFst; - ValidationRules.CheckRules(); - } - internal ROImageROFstImage(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImageROFstImage.FetchDR", GetHashCode()); - try - { - _ROFstID = dr.GetInt32("ROFstID"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _ROFst_RODbID = dr.GetInt32("ROFst_RODbID"); - _ROFst_ROFST = (byte[])dr.GetValue("ROFst_ROFST"); - _ROFst_DTS = dr.GetDateTime("ROFst_DTS"); - _ROFst_UserID = dr.GetString("ROFst_UserID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImageROFstImage.FetchDR", ex); - throw new DbCslaException("ROImageROFstImage.Fetch", ex); - } - MarkOld(); - } - internal void Insert(ROImage myROImage) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = ROFstImage.Add(cn, _MyROFst, myROImage, _DTS, _UserID); - MarkOld(); - } - internal void Update(ROImage myROImage) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = ROFstImage.Update(cn, _MyROFst, myROImage, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(ROImage myROImage) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - ROFstImage.Remove(cn, _ROFstID, myROImage.ImageID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - ROImageROFstImageExtension _ROImageROFstImageExtension = new ROImageROFstImageExtension(); - [Serializable()] - partial class ROImageROFstImageExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ROImageROFstImageConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ROImageROFstImage) - { - // Return the ToString value - return ((ROImageROFstImage)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ROImageROFstImageExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ROImageROFstImage -// { -// partial class ROImageROFstImageExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImageROFstImages.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImageROFstImages.cs deleted file mode 100644 index da228194..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ROImageROFstImages.cs +++ /dev/null @@ -1,295 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ROImageROFstImages Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ROImageROFstImagesConverter))] - public partial class ROImageROFstImages : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // Many To Many - public ROImageROFstImage this[ROFst myROFst] - { - get - { - foreach (ROImageROFstImage rOFstImage in this) - if (rOFstImage.ROFstID == myROFst.ROFstID) - return rOFstImage; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public ROImageROFstImage GetItem(ROFst myROFst) - { - foreach (ROImageROFstImage rOFstImage in this) - if (rOFstImage.ROFstID == myROFst.ROFstID) - return rOFstImage; - return null; - } - public ROImageROFstImage Add(ROFst myROFst)// Many to Many with required fields - { - if (!Contains(myROFst)) - { - ROImageROFstImage rOFstImage = ROImageROFstImage.New(myROFst); - this.Add(rOFstImage); - return rOFstImage; - } - else - throw new InvalidOperationException("rOFstImage already exists"); - } - public void Remove(ROFst myROFst) - { - foreach (ROImageROFstImage rOFstImage in this) - { - if (rOFstImage.ROFstID == myROFst.ROFstID) - { - Remove(rOFstImage); - break; - } - } - } - public bool Contains(ROFst myROFst) - { - foreach (ROImageROFstImage rOFstImage in this) - if (rOFstImage.ROFstID == myROFst.ROFstID) - return true; - return false; - } - public bool ContainsDeleted(ROFst myROFst) - { - foreach (ROImageROFstImage rOFstImage in DeletedList) - if (rOFstImage.ROFstID == myROFst.ROFstID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (ROImageROFstImage rOImageROFstImage in this) - if ((hasBrokenRules = rOImageROFstImage.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static ROImageROFstImages New() - { - return new ROImageROFstImages(); - } - internal static ROImageROFstImages Get(SafeDataReader dr) - { - return new ROImageROFstImages(dr); - } - public static ROImageROFstImages GetByImageID(int imageID) - { - try - { - return DataPortal.Fetch(new ImageIDCriteria(imageID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ROImageROFstImages.GetByImageID", ex); - } - } - private ROImageROFstImages() - { - MarkAsChild(); - } - internal ROImageROFstImages(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(ROImageROFstImage.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ImageIDCriteria - { - public ImageIDCriteria(int imageID) - { - _ImageID = imageID; - } - private int _ImageID; - public int ImageID - { - get { return _ImageID; } - set { _ImageID = value; } - } - } - private void DataPortal_Fetch(ImageIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ROImageROFstImages.DataPortal_FetchImageID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getROFstImagesByImageID"; - cm.Parameters.AddWithValue("@ImageID", criteria.ImageID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new ROImageROFstImage(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ROImageROFstImages.DataPortal_FetchImageID", ex); - throw new DbCslaException("ROImageROFstImages.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(ROImage rOImage) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (ROImageROFstImage obj in DeletedList) - obj.DeleteSelf(rOImage);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (ROImageROFstImage obj in this) - { - if (obj.IsNew) - obj.Insert(rOImage); - else - obj.Update(rOImage); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - ROImageROFstImagesPropertyDescriptor pd = new ROImageROFstImagesPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class ROImageROFstImagesPropertyDescriptor : vlnListPropertyDescriptor - { - private ROImageROFstImage Item { get { return (ROImageROFstImage)_Item; } } - public ROImageROFstImagesPropertyDescriptor(ROImageROFstImages collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class ROImageROFstImagesConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ROImageROFstImages) - { - // Return department and department role separated by comma. - return ((ROImageROFstImages)value).Items.Count.ToString() + " ROFstImages"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoUsage.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoUsage.cs deleted file mode 100644 index 9cfda9a0..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoUsage.cs +++ /dev/null @@ -1,1103 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// RoUsage Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RoUsageConverter))] - public partial class RoUsage : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshRoUsages = new List(); - private void AddToRefreshList(List refreshRoUsages) - { - if (IsDirty) - refreshRoUsages.Add(this); - } - private void BuildRefreshList() - { - _RefreshRoUsages = new List(); - AddToRefreshList(_RefreshRoUsages); - } - private void ProcessRefreshList() - { - foreach (RoUsage tmp in _RefreshRoUsages) - { - RoUsageInfo.Refresh(tmp); - if (tmp._MyContent != null) ContentInfo.Refresh(tmp._MyContent); - if (tmp._MyRODb != null) RODbInfo.Refresh(tmp._MyRODb); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(RoUsage roUsage) - { - if (!_CacheList.Contains(roUsage)) _CacheList.Add(roUsage); // In AddToCache - } - protected static void RemoveFromCache(RoUsage roUsage) - { - while (_CacheList.Contains(roUsage)) _CacheList.Remove(roUsage); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (RoUsage tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ROUsageID.ToString())) - { - _CacheByPrimaryKey[tmp.ROUsageID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ROUsageID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (RoUsage tmp in remove) - RemoveFromCache(tmp); - } - protected static RoUsage GetCachedByPrimaryKey(int rOUsageID) - { - ConvertListToDictionary(); - string key = rOUsageID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextROUsageID = -1; - public static int NextROUsageID - { - get { return _nextROUsageID--; } - } - private int _ROUsageID; - [System.ComponentModel.DataObjectField(true, true)] - public int ROUsageID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROUsageID; - } - } - private int _ContentID; - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _ContentID = _MyContent.ContentID; - return _ContentID; - } - } - private Content _MyContent; - public Content MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _ContentID != 0) _MyContent = Content.Get(_ContentID); - return _MyContent; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyContent != value) - { - _MyContent = value; - PropertyHasChanged(); - } - } - } - private string _ROID = string.Empty; - public string ROID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_ROID != value) - { - _ROID = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _RODbID; - public int RODbID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRODb != null) _RODbID = _MyRODb.RODbID; - return _RODbID; - } - } - private RODb _MyRODb; - public RODb MyRODb - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRODb == null && _RODbID != 0) _MyRODb = RODb.Get(_RODbID); - return _MyRODb; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyRODb != value) - { - _MyRODb = value; - PropertyHasChanged(); - } - } - } - public override bool IsDirty - { - get { return base.IsDirty || (_MyContent == null ? false : _MyContent.IsDirty) || (_MyRODb == null ? false : _MyRODb.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyContent == null ? true : _MyContent.IsValid) && (_MyRODb == null ? true : _MyRODb.IsValid); } - } - // TODO: Replace base RoUsage.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current RoUsage - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check RoUsage.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current RoUsage - protected override object GetIdValue() - { - return _ROUsageID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyContent != null && (hasBrokenRules = _MyContent.HasBrokenRules) != null) return hasBrokenRules; - if (_MyRODb != null && (hasBrokenRules = _MyRODb.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyContentRequired, "MyContent"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "ROID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("ROID", 16)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - ValidationRules.AddRule(MyRODbRequired, "MyRODb"); - //ValidationRules.AddDependantProperty("x", "y"); - _RoUsageExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _RoUsageExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - private static bool MyContentRequired(RoUsage target, Csla.Validation.RuleArgs e) - { - if (target._ContentID == 0 && target._MyContent == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - private static bool MyRODbRequired(RoUsage target, Csla.Validation.RuleArgs e) - { - if (target._RODbID == 0 && target._MyRODb == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ROUsageID, ""); - //AuthorizationRules.AllowRead(ContentID, ""); - //AuthorizationRules.AllowRead(ROID, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowRead(RODbID, ""); - //AuthorizationRules.AllowWrite(ContentID, ""); - //AuthorizationRules.AllowWrite(ROID, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - //AuthorizationRules.AllowWrite(RODbID, ""); - _RoUsageExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _RoUsageExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _RoUsageUnique = 0; - protected static int RoUsageUnique - { get { return ++_RoUsageUnique; } } - private int _MyRoUsageUnique = RoUsageUnique; - public int MyRoUsageUnique - { get { return _MyRoUsageUnique; } } - protected RoUsage() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(ROUsageID.ToString())) - { - List listRoUsage = _CacheByPrimaryKey[ROUsageID.ToString()]; // Get the list of items - while (listRoUsage.Contains(this)) listRoUsage.Remove(this); // Remove the item from the list - if (listRoUsage.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(ROUsageID.ToString()); // remove the list - } - } - public static RoUsage New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a RoUsage"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on RoUsage.New", ex); - } - } - public static RoUsage New(string roid, RODb myRODb) - { - RoUsage tmp = RoUsage.New(); - tmp.ROID = roid; - tmp.MyRODb = myRODb; - return tmp; - } - public static RoUsage New(Content myContent, string roid, string config, DateTime dts, string userID, RODb myRODb) - { - RoUsage tmp = RoUsage.New(); - tmp.MyContent = myContent; - tmp.ROID = roid; - tmp.Config = config; - tmp.DTS = dts; - tmp.UserID = userID; - tmp.MyRODb = myRODb; - return tmp; - } - public static RoUsage MakeRoUsage(Content myContent, string roid, string config, DateTime dts, string userID, RODb myRODb) - { - RoUsage tmp = RoUsage.New(myContent, roid, config, dts, userID, myRODb); - if (tmp.IsSavable) - { - RoUsage tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static RoUsage New(Content myContent, string roid, string config, RODb myRODb) - { - RoUsage tmp = RoUsage.New(); - tmp.MyContent = myContent; - tmp.ROID = roid; - tmp.Config = config; - tmp.MyRODb = myRODb; - return tmp; - } - public static RoUsage MakeRoUsage(Content myContent, string roid, string config, RODb myRODb) - { - RoUsage tmp = RoUsage.New(myContent, roid, config, myRODb); - if (tmp.IsSavable) - { - RoUsage tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static RoUsage Get(int rOUsageID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a RoUsage"); - try - { - RoUsage tmp = GetCachedByPrimaryKey(rOUsageID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(rOUsageID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up RoUsage - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RoUsage.Get", ex); - } - } - public static RoUsage Get(SafeDataReader dr) - { - if (dr.Read()) return new RoUsage(dr); - return null; - } - internal RoUsage(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int rOUsageID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a RoUsage"); - try - { - DataPortal.Delete(new PKCriteria(rOUsageID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on RoUsage.Delete", ex); - } - } - public override RoUsage Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a RoUsage"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a RoUsage"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a RoUsage"); - try - { - BuildRefreshList(); - RoUsage roUsage = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(roUsage);//Refresh the item in AllList - ProcessRefreshList(); - return roUsage; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _ROUsageID; - public int ROUsageID - { get { return _ROUsageID; } } - public PKCriteria(int rOUsageID) - { - _ROUsageID = rOUsageID; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _ROUsageID = NextROUsageID; - // Database Defaults - _ContentID = _RoUsageExtension.DefaultContentID; - _DTS = _RoUsageExtension.DefaultDTS; - _UserID = _RoUsageExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsage.ReadData", GetHashCode()); - try - { - _ROUsageID = dr.GetInt32("ROUsageID"); - _ContentID = dr.GetInt32("ContentID"); - _ROID = dr.GetString("ROID"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _RODbID = dr.GetInt32("RODbID"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsage.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RoUsage.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsage.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRoUsage"; - cm.Parameters.AddWithValue("@ROUsageID", criteria.ROUsageID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsage.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RoUsage.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsage.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RoUsage.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsage.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyContent != null) _MyContent.Update(); - if (_MyRODb != null) _MyRODb.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addRoUsage"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", ContentID); - cm.Parameters.AddWithValue("@ROID", _ROID); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@RODbID", RODbID); - // Output Calculated Columns - SqlParameter param_ROUsageID = new SqlParameter("@newROUsageID", SqlDbType.Int); - param_ROUsageID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_ROUsageID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _ROUsageID = (int)cm.Parameters["@newROUsageID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsage.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsage.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RoUsage.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int rOUsageID, Content myContent, string roid, string config, DateTime dts, string userID, RODb myRODb) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsage.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addRoUsage"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", myContent.ContentID); - cm.Parameters.AddWithValue("@ROID", roid); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@RODbID", myRODb.RODbID); - // Output Calculated Columns - SqlParameter param_ROUsageID = new SqlParameter("@newROUsageID", SqlDbType.Int); - param_ROUsageID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_ROUsageID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - rOUsageID = (int)cm.Parameters["@newROUsageID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsage.Add", ex); - throw new DbCslaException("RoUsage.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsage.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsage.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsage.SQLUpdate", GetHashCode()); - try - { - if (_MyContent != null) _MyContent.Update(); - if (_MyRODb != null) _MyRODb.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateRoUsage"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@ROUsageID", _ROUsageID); - cm.Parameters.AddWithValue("@ContentID", ContentID); - cm.Parameters.AddWithValue("@ROID", _ROID); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - cm.Parameters.AddWithValue("@RODbID", RODbID); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsage.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = RoUsage.Add(cn, ref _ROUsageID, _MyContent, _ROID, _Config, _DTS, _UserID, _MyRODb); - else - _LastChanged = RoUsage.Update(cn, ref _ROUsageID, _MyContent, _ROID, _Config, _DTS, _UserID, ref _LastChanged, _MyRODb); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int rOUsageID, Content myContent, string roid, string config, DateTime dts, string userID, ref byte[] lastChanged, RODb myRODb) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsage.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateRoUsage"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ROUsageID", rOUsageID); - cm.Parameters.AddWithValue("@ContentID", myContent.ContentID); - cm.Parameters.AddWithValue("@ROID", roid); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - cm.Parameters.AddWithValue("@RODbID", myRODb.RODbID); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsage.Update", ex); - throw new DbCslaException("RoUsage.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_ROUsageID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsage.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteRoUsage"; - cm.Parameters.AddWithValue("@ROUsageID", criteria.ROUsageID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsage.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RoUsage.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int rOUsageID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsage.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteRoUsage"; - // Input PK Fields - cm.Parameters.AddWithValue("@ROUsageID", rOUsageID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsage.Remove", ex); - throw new DbCslaException("RoUsage.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int rOUsageID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(rOUsageID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RoUsage.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _ROUsageID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int rOUsageID) - { - _ROUsageID = rOUsageID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsage.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsRoUsage"; - cm.Parameters.AddWithValue("@ROUsageID", _ROUsageID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsage.DataPortal_Execute", ex); - throw new DbCslaException("RoUsage.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - RoUsageExtension _RoUsageExtension = new RoUsageExtension(); - [Serializable()] - partial class RoUsageExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultContentID - { - get { return 0; } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class RoUsageConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RoUsage) - { - // Return the ToString value - return ((RoUsage)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create RoUsageExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class RoUsage -// { -// partial class RoUsageExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultContentID -// { -// get { return 0; } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoUsageInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoUsageInfo.cs deleted file mode 100644 index 6cae7319..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoUsageInfo.cs +++ /dev/null @@ -1,464 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void RoUsageInfoEvent(object sender); - /// - /// RoUsageInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RoUsageInfoConverter))] - public partial class RoUsageInfo : ReadOnlyBase, IDisposable - { - public event RoUsageInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(RoUsageInfo roUsageInfo) - { - if (!_CacheList.Contains(roUsageInfo)) _CacheList.Add(roUsageInfo); // In AddToCache - } - protected static void RemoveFromCache(RoUsageInfo roUsageInfo) - { - while (_CacheList.Contains(roUsageInfo)) _CacheList.Remove(roUsageInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (RoUsageInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ROUsageID.ToString())) - { - _CacheByPrimaryKey[tmp.ROUsageID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ROUsageID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (RoUsageInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(RoUsageInfoList lst) - { - foreach (RoUsageInfo item in lst) AddToCache(item); - } - protected static RoUsageInfo GetCachedByPrimaryKey(int rOUsageID) - { - ConvertListToDictionary(); - string key = rOUsageID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected RoUsage _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _ROUsageID; - [System.ComponentModel.DataObjectField(true, true)] - public int ROUsageID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROUsageID; - } - } - private int _ContentID; - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _ContentID = _MyContent.ContentID; - return _ContentID; - } - } - private ContentInfo _MyContent; - public ContentInfo MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _ContentID != 0) _MyContent = ContentInfo.Get(_ContentID); - return _MyContent; - } - } - private string _ROID = string.Empty; - public string ROID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _ROID; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - private int _RODbID; - public int RODbID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRODb != null) _RODbID = _MyRODb.RODbID; - return _RODbID; - } - } - private RODbInfo _MyRODb; - public RODbInfo MyRODb - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyRODb == null && _RODbID != 0) _MyRODb = RODbInfo.Get(_RODbID); - return _MyRODb; - } - } - // TODO: Replace base RoUsageInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current RoUsageInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check RoUsageInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current RoUsageInfo - protected override object GetIdValue() - { - return _ROUsageID; - } - #endregion - #region Factory Methods - private static int _RoUsageInfoUnique = 0; - private static int RoUsageInfoUnique - { get { return ++_RoUsageInfoUnique; } } - private int _MyRoUsageInfoUnique = RoUsageInfoUnique; - public int MyRoUsageInfoUnique - { get { return _MyRoUsageInfoUnique; } } - protected RoUsageInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(ROUsageID.ToString())) return; - List listRoUsageInfo = _CacheByPrimaryKey[ROUsageID.ToString()]; // Get the list of items - while (listRoUsageInfo.Contains(this)) listRoUsageInfo.Remove(this); // Remove the item from the list - if (listRoUsageInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(ROUsageID.ToString()); // remove the list - } - public virtual RoUsage Get() - { - return _Editable = RoUsage.Get(_ROUsageID); - } - public static void Refresh(RoUsage tmp) - { - string key = tmp.ROUsageID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (RoUsageInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(RoUsage tmp) - { - if (_ContentID != tmp.ContentID) - { - if (MyContent != null) MyContent.RefreshContentRoUsages(); // Update List for old value - _ContentID = tmp.ContentID; // Update the value - } - _MyContent = null; // Reset list so that the next line gets a new list - if (MyContent != null) MyContent.RefreshContentRoUsages(); // Update List for new value - _ROID = tmp.ROID; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - if (_RODbID != tmp.RODbID) - { - if (MyRODb != null) MyRODb.RefreshRODbRoUsages(); // Update List for old value - _RODbID = tmp.RODbID; // Update the value - } - _MyRODb = null; // Reset list so that the next line gets a new list - if (MyRODb != null) MyRODb.RefreshRODbRoUsages(); // Update List for new value - _RoUsageInfoExtension.Refresh(this); - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - if (_MyRODb != null) - { - _MyRODb.Dispose();// Dispose related value - _MyRODb = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(ContentRoUsage tmp) - { - string key = tmp.ROUsageID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (RoUsageInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ContentRoUsage tmp) - { - _ROID = tmp.ROID; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - if (_RODbID != tmp.RODbID) - { - if (MyRODb != null) MyRODb.RefreshRODbRoUsages(); // Update List for old value - _RODbID = tmp.RODbID; // Update the value - } - _MyRODb = null; // Reset list so that the next line gets a new list - if (MyRODb != null) MyRODb.RefreshRODbRoUsages(); // Update List for new value - _RoUsageInfoExtension.Refresh(this); - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - if (_MyRODb != null) - { - _MyRODb.Dispose();// Dispose related value - _MyRODb = null;// Reset related value - } - OnChange();// raise an event - } - public static void Refresh(RODbRoUsage tmp) - { - string key = tmp.ROUsageID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (RoUsageInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(RODbRoUsage tmp) - { - if (_ContentID != tmp.ContentID) - { - if (MyContent != null) MyContent.RefreshContentRoUsages(); // Update List for old value - _ContentID = tmp.ContentID; // Update the value - } - _MyContent = null; // Reset list so that the next line gets a new list - if (MyContent != null) MyContent.RefreshContentRoUsages(); // Update List for new value - _ROID = tmp.ROID; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _RoUsageInfoExtension.Refresh(this); - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - if (_MyRODb != null) - { - _MyRODb.Dispose();// Dispose related value - _MyRODb = null;// Reset related value - } - OnChange();// raise an event - } - public static RoUsageInfo Get(int rOUsageID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a RoUsage"); - try - { - RoUsageInfo tmp = GetCachedByPrimaryKey(rOUsageID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(rOUsageID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up RoUsageInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RoUsageInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal RoUsageInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsageInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsageInfo.Constructor", ex); - throw new DbCslaException("RoUsageInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _ROUsageID; - public int ROUsageID - { get { return _ROUsageID; } } - public PKCriteria(int rOUsageID) - { - _ROUsageID = rOUsageID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsageInfo.ReadData", GetHashCode()); - try - { - _ROUsageID = dr.GetInt32("ROUsageID"); - _ContentID = dr.GetInt32("ContentID"); - _ROID = dr.GetString("ROID"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _RODbID = dr.GetInt32("RODbID"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsageInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RoUsageInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsageInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRoUsage"; - cm.Parameters.AddWithValue("@ROUsageID", criteria.ROUsageID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsageInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RoUsageInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - RoUsageInfoExtension _RoUsageInfoExtension = new RoUsageInfoExtension(); - [Serializable()] - partial class RoUsageInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(RoUsageInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class RoUsageInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RoUsageInfo) - { - // Return the ToString value - return ((RoUsageInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoUsageInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoUsageInfoList.cs deleted file mode 100644 index 0ab6aec7..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoUsageInfoList.cs +++ /dev/null @@ -1,312 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// RoUsageInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RoUsageInfoListConverter))] - public partial class RoUsageInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (RoUsageInfo tmp in this) - { - tmp.Changed += new RoUsageInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (RoUsageInfo tmp in this) - { - tmp.Changed -= new RoUsageInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static RoUsageInfoList _RoUsageInfoList = null; - /// - /// Return a list of all projects. - /// - public static RoUsageInfoList Get() - { - try - { - if (_RoUsageInfoList != null) - return _RoUsageInfoList; - RoUsageInfoList tmp = DataPortal.Fetch(); - RoUsageInfo.AddList(tmp); - tmp.AddEvents(); - _RoUsageInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RoUsageInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static RoUsageInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on RoUsageInfoList.Get", ex); - // } - //} - public static RoUsageInfoList GetByContentID(int contentID) - { - try - { - RoUsageInfoList tmp = DataPortal.Fetch(new ContentIDCriteria(contentID)); - RoUsageInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RoUsageInfoList.GetByContentID", ex); - } - } - public static RoUsageInfoList GetByRODbID(int rODbID) - { - try - { - RoUsageInfoList tmp = DataPortal.Fetch(new RODbIDCriteria(rODbID)); - RoUsageInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RoUsageInfoList.GetByRODbID", ex); - } - } - private RoUsageInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsageInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRoUsages"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new RoUsageInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsageInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("RoUsageInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ContentIDCriteria - { - public ContentIDCriteria(int contentID) - { - _ContentID = contentID; - } - private int _ContentID; - public int ContentID - { - get { return _ContentID; } - set { _ContentID = value; } - } - } - private void DataPortal_Fetch(ContentIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsageInfoList.DataPortal_FetchContentID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRoUsagesByContentID"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new RoUsageInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsageInfoList.DataPortal_FetchContentID", ex); - throw new DbCslaException("RoUsageInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class RODbIDCriteria - { - public RODbIDCriteria(int rODbID) - { - _RODbID = rODbID; - } - private int _RODbID; - public int RODbID - { - get { return _RODbID; } - set { _RODbID = value; } - } - } - private void DataPortal_Fetch(RODbIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoUsageInfoList.DataPortal_FetchRODbID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRoUsagesByRODbID"; - cm.Parameters.AddWithValue("@RODbID", criteria.RODbID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new RoUsageInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoUsageInfoList.DataPortal_FetchRODbID", ex); - throw new DbCslaException("RoUsageInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - RoUsageInfoListPropertyDescriptor pd = new RoUsageInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class RoUsageInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private RoUsageInfo Item { get { return (RoUsageInfo)_Item; } } - public RoUsageInfoListPropertyDescriptor(RoUsageInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class RoUsageInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RoUsageInfoList) - { - // Return department and department role separated by comma. - return ((RoUsageInfoList)value).Items.Count.ToString() + " RoUsages"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Role.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Role.cs deleted file mode 100644 index e537da3e..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Role.cs +++ /dev/null @@ -1,1191 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Role Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RoleConverter))] - public partial class Role : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshRoles = new List(); - private List _RefreshRoleAssignments = new List(); - private List _RefreshRolePermissions = new List(); - private void AddToRefreshList(List refreshRoles, List refreshRoleAssignments, List refreshRolePermissions) - { - if (IsDirty) - refreshRoles.Add(this); - if (_RoleAssignments != null && _RoleAssignments.IsDirty) - { - foreach (RoleAssignment tmp in _RoleAssignments) - { - if (tmp.IsDirty) refreshRoleAssignments.Add(tmp); - } - } - if (_RolePermissions != null && _RolePermissions.IsDirty) - { - foreach (RolePermission tmp in _RolePermissions) - { - if (tmp.IsDirty) refreshRolePermissions.Add(tmp); - } - } - } - private void BuildRefreshList() - { - _RefreshRoles = new List(); - _RefreshRoleAssignments = new List(); - _RefreshRolePermissions = new List(); - AddToRefreshList(_RefreshRoles, _RefreshRoleAssignments, _RefreshRolePermissions); - } - private void ProcessRefreshList() - { - foreach (Role tmp in _RefreshRoles) - { - RoleInfo.Refresh(tmp); - } - foreach (RoleAssignment tmp in _RefreshRoleAssignments) - { - AssignmentInfo.Refresh(tmp); - } - foreach (RolePermission tmp in _RefreshRolePermissions) - { - PermissionInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Role role) - { - if (!_CacheList.Contains(role)) _CacheList.Add(role); // In AddToCache - } - protected static void RemoveFromCache(Role role) - { - while (_CacheList.Contains(role)) _CacheList.Remove(role); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static Dictionary> _CacheByName = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (Role tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.RID.ToString())) - { - _CacheByPrimaryKey[tmp.RID.ToString()] = new List(); // Add new list for PrimaryKey - _CacheByName[tmp.Name.ToString()] = new List(); // Add new list for Name - } - _CacheByPrimaryKey[tmp.RID.ToString()].Add(tmp); // Add to Primary Key list - _CacheByName[tmp.Name.ToString()].Add(tmp); // Unique Index - remove.Add(tmp); - } - foreach (Role tmp in remove) - RemoveFromCache(tmp); - } - protected static Role GetCachedByPrimaryKey(int rid) - { - ConvertListToDictionary(); - string key = rid.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - protected static Role GetCachedByName(string name) - { - ConvertListToDictionary(); - string key = name.ToString(); - if (_CacheByName.ContainsKey(key)) return _CacheByName[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextRID = -1; - public static int NextRID - { - get { return _nextRID--; } - } - private int _RID; - [System.ComponentModel.DataObjectField(true, true)] - public int RID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RID; - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Name != value) - { - _Name = value; - PropertyHasChanged(); - } - } - } - private string _Title = string.Empty; - public string Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Title; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Title != value) - { - _Title = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UsrID != value) - { - _UsrID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _RoleAssignmentCount = 0; - /// - /// Count of RoleAssignments for this Role - /// - public int RoleAssignmentCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RoleAssignmentCount; - } - } - private RoleAssignments _RoleAssignments = null; - /// - /// Related Field - /// - [TypeConverter(typeof(RoleAssignmentsConverter))] - public RoleAssignments RoleAssignments - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_RoleAssignmentCount > 0 && _RoleAssignments == null) - _RoleAssignments = RoleAssignments.GetByRID(RID); - else if (_RoleAssignments == null) - _RoleAssignments = RoleAssignments.New(); - return _RoleAssignments; - } - } - private int _RolePermissionCount = 0; - /// - /// Count of RolePermissions for this Role - /// - public int RolePermissionCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RolePermissionCount; - } - } - private RolePermissions _RolePermissions = null; - /// - /// Related Field - /// - [TypeConverter(typeof(RolePermissionsConverter))] - public RolePermissions RolePermissions - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_RolePermissionCount > 0 && _RolePermissions == null) - _RolePermissions = RolePermissions.GetByRID(RID); - else if (_RolePermissions == null) - _RolePermissions = RolePermissions.New(); - return _RolePermissions; - } - } - public override bool IsDirty - { - get { return base.IsDirty || (_RoleAssignments == null ? false : _RoleAssignments.IsDirty) || (_RolePermissions == null ? false : _RolePermissions.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_RoleAssignments == null ? true : _RoleAssignments.IsValid) && (_RolePermissions == null ? true : _RolePermissions.IsValid); } - } - // TODO: Replace base Role.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Role - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check Role.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Role - protected override object GetIdValue() - { - return _RID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_RoleAssignments != null && (hasBrokenRules = _RoleAssignments.HasBrokenRules) != null) return hasBrokenRules; - if (_RolePermissions != null && (hasBrokenRules = _RolePermissions.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "Name"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 50)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "Title"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Title", 250)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UsrID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UsrID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _RoleExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _RoleExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(RID, ""); - //AuthorizationRules.AllowRead(Name, ""); - //AuthorizationRules.AllowRead(Title, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UsrID, ""); - //AuthorizationRules.AllowWrite(Name, ""); - //AuthorizationRules.AllowWrite(Title, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UsrID, ""); - _RoleExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _RoleExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - /// - /// determines if related records (Foreign Keys) will keep this Item from being deleted - /// - public bool CanDelete - { - get - { - // Check to make sure that there are not any related records - int usedByCount = 0; - usedByCount += _RoleAssignmentCount; - usedByCount += _RolePermissionCount; - return (usedByCount == 0); - } - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _RoleUnique = 0; - protected static int RoleUnique - { get { return ++_RoleUnique; } } - private int _MyRoleUnique = RoleUnique; - public int MyRoleUnique - { get { return _MyRoleUnique; } } - protected Role() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(RID.ToString())) - { - List listRole = _CacheByPrimaryKey[RID.ToString()]; // Get the list of items - while (listRole.Contains(this)) listRole.Remove(this); // Remove the item from the list - if (listRole.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(RID.ToString()); // remove the list - } - string myKey; - myKey = null; - foreach (string key in _CacheByName.Keys) - if (_CacheByName[key].Contains(this)) - myKey = key; - if (myKey != null) - { - List listRole = _CacheByName[myKey]; // Get the list of items - listRole.Remove(this); // Remove the item from the list - if (listRole.Count == 0) //If there are no items left in the list - _CacheByName.Remove(myKey); // remove the list - } - } - public static Role New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Role"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Role.New", ex); - } - } - public static Role New(string name, string title) - { - Role tmp = Role.New(); - tmp.Name = name; - tmp.Title = title; - return tmp; - } - public static Role MakeRole(string name, string title) - { - Role tmp = Role.New(name, title); - if (tmp.IsSavable) - { - Role tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Role New(string name, string title, DateTime dts, string usrID) - { - Role tmp = Role.New(); - tmp.Name = name; - tmp.Title = title; - tmp.DTS = dts; - tmp.UsrID = usrID; - return tmp; - } - public static Role MakeRole(string name, string title, DateTime dts, string usrID) - { - Role tmp = Role.New(name, title, dts, usrID); - if (tmp.IsSavable) - { - Role tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Role Get(int rid) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Role"); - try - { - Role tmp = GetCachedByPrimaryKey(rid); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(rid)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Role - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Role.Get", ex); - } - } - public static Role GetByName(string name) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Role"); - try - { - Role tmp = GetCachedByName(name); - if (tmp == null) - { - tmp = DataPortal.Fetch(new NameCriteria(name)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Role - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Role.GetByName", ex); - } - } - public static Role Get(SafeDataReader dr) - { - if (dr.Read()) return new Role(dr); - return null; - } - internal Role(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int rid) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Role"); - try - { - DataPortal.Delete(new PKCriteria(rid)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Role.Delete", ex); - } - } - public override Role Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Role"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Role"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Role"); - try - { - BuildRefreshList(); - Role role = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(role);//Refresh the item in AllList - ProcessRefreshList(); - return role; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _RID; - public int RID - { get { return _RID; } } - public PKCriteria(int rid) - { - _RID = rid; - } - } - [Serializable()] - private class NameCriteria - { - private string _Name; - public string Name - { get { return _Name; } } - public NameCriteria(string name) - { - _Name = name; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _RID = NextRID; - // Database Defaults - _DTS = _RoleExtension.DefaultDTS; - _UsrID = _RoleExtension.DefaultUsrID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.ReadData", GetHashCode()); - try - { - _RID = dr.GetInt32("RID"); - _Name = dr.GetString("Name"); - _Title = dr.GetString("Title"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _RoleAssignmentCount = dr.GetInt32("AssignmentCount"); - _RolePermissionCount = dr.GetInt32("PermissionCount"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Role.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRole"; - cm.Parameters.AddWithValue("@RID", criteria.RID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _RoleAssignments = RoleAssignments.Get(dr); - // load child objects - dr.NextResult(); - _RolePermissions = RolePermissions.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Role.DataPortal_Fetch", ex); - } - } - private void DataPortal_Fetch(NameCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRoleByName"; - cm.Parameters.AddWithValue("@Name", criteria.Name); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Role.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Role.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addRole"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@Name", _Name); - cm.Parameters.AddWithValue("@Title", _Title); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UsrID", _UsrID); - // Output Calculated Columns - SqlParameter param_RID = new SqlParameter("@newRID", SqlDbType.Int); - param_RID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_RID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _RID = (int)cm.Parameters["@newRID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_RoleAssignments != null) _RoleAssignments.Update(this); - if (_RolePermissions != null) _RolePermissions.Update(this); - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Role.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int rid, string name, string title, DateTime dts, string usrID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addRole"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@Name", name); - cm.Parameters.AddWithValue("@Title", title); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UsrID", usrID); - // Output Calculated Columns - SqlParameter param_RID = new SqlParameter("@newRID", SqlDbType.Int); - param_RID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_RID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - rid = (int)cm.Parameters["@newRID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.Add", ex); - throw new DbCslaException("Role.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateRole"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@RID", _RID); - cm.Parameters.AddWithValue("@Name", _Name); - cm.Parameters.AddWithValue("@Title", _Title); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UsrID", _UsrID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - if (_RoleAssignments != null) _RoleAssignments.Update(this); - if (_RolePermissions != null) _RolePermissions.Update(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Role.Add(cn, ref _RID, _Name, _Title, _DTS, _UsrID); - else - _LastChanged = Role.Update(cn, ref _RID, _Name, _Title, _DTS, _UsrID, ref _LastChanged); - MarkOld(); - } - if (_RoleAssignments != null) _RoleAssignments.Update(this); - if (_RolePermissions != null) _RolePermissions.Update(this); - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int rid, string name, string title, DateTime dts, string usrID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateRole"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@RID", rid); - cm.Parameters.AddWithValue("@Name", name); - cm.Parameters.AddWithValue("@Title", title); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UsrID", usrID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.Update", ex); - throw new DbCslaException("Role.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_RID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteRole"; - cm.Parameters.AddWithValue("@RID", criteria.RID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Role.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int rid) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteRole"; - // Input PK Fields - cm.Parameters.AddWithValue("@RID", rid); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.Remove", ex); - throw new DbCslaException("Role.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int rid) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(rid)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Role.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _RID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int rid) - { - _RID = rid; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Role.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsRole"; - cm.Parameters.AddWithValue("@RID", _RID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Role.DataPortal_Execute", ex); - throw new DbCslaException("Role.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - RoleExtension _RoleExtension = new RoleExtension(); - [Serializable()] - partial class RoleExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUsrID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class RoleConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Role) - { - // Return the ToString value - return ((Role)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create RoleExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Role -// { -// partial class RoleExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUsrID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoleAssignment.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoleAssignment.cs deleted file mode 100644 index 8c9010c6..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoleAssignment.cs +++ /dev/null @@ -1,731 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// RoleAssignment Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RoleAssignmentConverter))] - public partial class RoleAssignment : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _AID; - [System.ComponentModel.DataObjectField(true, true)] - public int AID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyAssignment != null) _AID = _MyAssignment.AID; - return _AID; - } - } - private Assignment _MyAssignment; - [System.ComponentModel.DataObjectField(true, true)] - public Assignment MyAssignment - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyAssignment == null && _AID != 0) _MyAssignment = Assignment.Get(_AID); - return _MyAssignment; - } - } - private int _GID; - public int GID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyGroup != null) _GID = _MyGroup.GID; - return _GID; - } - } - private Group _MyGroup; - public Group MyGroup - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyGroup == null && _GID != 0) _MyGroup = Group.Get(_GID); - return _MyGroup; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyGroup != value) - { - _MyGroup = value; - PropertyHasChanged(); - } - } - } - private int _FolderID; - public int FolderID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder != null) _FolderID = _MyFolder.FolderID; - return _FolderID; - } - } - private Folder _MyFolder; - public Folder MyFolder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyFolder == null && _FolderID != 0) _MyFolder = Folder.Get(_FolderID); - return _MyFolder; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyFolder != value) - { - _MyFolder = value; - PropertyHasChanged(); - } - } - } - private string _StartDate = string.Empty; - public string StartDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _StartDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _StartDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_StartDate != tmp.ToString()) - { - _StartDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private string _EndDate = string.Empty; - public string EndDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _EndDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _EndDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_EndDate != tmp.ToString()) - { - _EndDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UsrID != value) - { - _UsrID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _Folder_ParentID; - public int Folder_ParentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_ParentID; - } - } - private int _Folder_DBID; - public int Folder_DBID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_DBID; - } - } - private string _Folder_Name = string.Empty; - public string Folder_Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_Name; - } - } - private string _Folder_Title = string.Empty; - public string Folder_Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_Title; - } - } - private string _Folder_ShortName = string.Empty; - public string Folder_ShortName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_ShortName; - } - } - private int? _Folder_FormatID; - public int? Folder_FormatID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_FormatID; - } - } - private double? _Folder_ManualOrder; - public double? Folder_ManualOrder - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_ManualOrder; - } - } - private string _Folder_Config = string.Empty; - public string Folder_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_Config; - } - } - private DateTime _Folder_DTS = new DateTime(); - public DateTime Folder_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_DTS; - } - } - private string _Folder_UsrID = string.Empty; - public string Folder_UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Folder_UsrID; - } - } - private string _Group_GroupName = string.Empty; - public string Group_GroupName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Group_GroupName; - } - } - private int? _Group_GroupType; - public int? Group_GroupType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Group_GroupType; - } - } - private string _Group_Config = string.Empty; - public string Group_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Group_Config; - } - } - private DateTime _Group_DTS = new DateTime(); - public DateTime Group_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Group_DTS; - } - } - private string _Group_UsrID = string.Empty; - public string Group_UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Group_UsrID; - } - } - // TODO: Check RoleAssignment.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current RoleAssignment - protected override object GetIdValue() - { - return _AID; - } - // TODO: Replace base RoleAssignment.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current RoleAssignment - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyGroup == null ? false : _MyGroup.IsDirty) || (_MyFolder == null ? false : _MyFolder.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyGroup == null ? true : _MyGroup.IsValid) && (_MyFolder == null ? true : _MyFolder.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyGroup != null && (hasBrokenRules = _MyGroup.HasBrokenRules) != null) return hasBrokenRules; - if (_MyFolder != null && (hasBrokenRules = _MyFolder.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyGroupRequired, "MyGroup"); - ValidationRules.AddRule(MyFolderRequired, "MyFolder"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "StartDate"); - ValidationRules.AddRule(StartDateValid, "StartDate"); - ValidationRules.AddRule(EndDateValid, "EndDate"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UsrID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UsrID", 100)); - // TODO: Add other validation rules - } - private static bool StartDateValid(RoleAssignment target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._StartDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool EndDateValid(RoleAssignment target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._EndDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool MyGroupRequired(RoleAssignment target, Csla.Validation.RuleArgs e) - { - if (target._GID == 0 && target._MyGroup == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - private static bool MyFolderRequired(RoleAssignment target, Csla.Validation.RuleArgs e) - { - if (target._FolderID == 0 && target._MyFolder == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(AID, ""); - //AuthorizationRules.AllowRead(GID, ""); - //AuthorizationRules.AllowWrite(GID, ""); - //AuthorizationRules.AllowRead(FolderID, ""); - //AuthorizationRules.AllowWrite(FolderID, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UsrID, ""); - //AuthorizationRules.AllowWrite(UsrID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static RoleAssignment New(Group myGroup, Folder myFolder) - { - return new RoleAssignment(myGroup, myFolder); - } - internal static RoleAssignment Get(SafeDataReader dr) - { - return new RoleAssignment(dr); - } - public RoleAssignment() - { - MarkAsChild(); - _AID = Assignment.NextAID; - _StartDate = _RoleAssignmentExtension.DefaultStartDate; - _DTS = _RoleAssignmentExtension.DefaultDTS; - _UsrID = _RoleAssignmentExtension.DefaultUsrID; - ValidationRules.CheckRules(); - } - private RoleAssignment(Group myGroup, Folder myFolder) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _StartDate = _RoleAssignmentExtension.DefaultStartDate; - _DTS = _RoleAssignmentExtension.DefaultDTS; - _UsrID = _RoleAssignmentExtension.DefaultUsrID; - _MyGroup = myGroup; - _MyFolder = myFolder; - ValidationRules.CheckRules(); - } - internal RoleAssignment(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoleAssignment.FetchDR", GetHashCode()); - try - { - _AID = dr.GetInt32("AID"); - _GID = dr.GetInt32("GID"); - _FolderID = dr.GetInt32("FolderID"); - _StartDate = dr.GetSmartDate("StartDate").Text; - _EndDate = dr.GetSmartDate("EndDate").Text; - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _Folder_ParentID = dr.GetInt32("Folder_ParentID"); - _Folder_DBID = dr.GetInt32("Folder_DBID"); - _Folder_Name = dr.GetString("Folder_Name"); - _Folder_Title = dr.GetString("Folder_Title"); - _Folder_ShortName = dr.GetString("Folder_ShortName"); - _Folder_FormatID = (int?)dr.GetValue("Folder_FormatID"); - _Folder_ManualOrder = (double?)dr.GetValue("Folder_ManualOrder"); - _Folder_Config = dr.GetString("Folder_Config"); - _Folder_DTS = dr.GetDateTime("Folder_DTS"); - _Folder_UsrID = dr.GetString("Folder_UsrID"); - _Group_GroupName = dr.GetString("Group_GroupName"); - _Group_GroupType = (int?)dr.GetValue("Group_GroupType"); - _Group_Config = dr.GetString("Group_Config"); - _Group_DTS = dr.GetDateTime("Group_DTS"); - _Group_UsrID = dr.GetString("Group_UsrID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoleAssignment.FetchDR", ex); - throw new DbCslaException("RoleAssignment.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Role myRole) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Assignment.Add(cn, ref _AID, _MyGroup, myRole, _MyFolder, new SmartDate(_StartDate), new SmartDate(_EndDate), _DTS, _UsrID); - MarkOld(); - } - internal void Update(Role myRole) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Assignment.Update(cn, ref _AID, _MyGroup, myRole, _MyFolder, new SmartDate(_StartDate), new SmartDate(_EndDate), _DTS, _UsrID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Role myRole) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Assignment.Remove(cn, _AID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - RoleAssignmentExtension _RoleAssignmentExtension = new RoleAssignmentExtension(); - [Serializable()] - partial class RoleAssignmentExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual string DefaultStartDate - { - get { return DateTime.Now.ToShortDateString(); } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUsrID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class RoleAssignmentConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RoleAssignment) - { - // Return the ToString value - return ((RoleAssignment)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create RoleAssignmentExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class RoleAssignment -// { -// partial class RoleAssignmentExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual SmartDate DefaultStartDate -// { -// get { return DateTime.Now.ToShortDateString(); } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUsrID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoleAssignments.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoleAssignments.cs deleted file mode 100644 index c62cf51a..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoleAssignments.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// RoleAssignments Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RoleAssignmentsConverter))] - public partial class RoleAssignments : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public RoleAssignment this[Assignment myAssignment] - { - get - { - foreach (RoleAssignment assignment in this) - if (assignment.AID == myAssignment.AID) - return assignment; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public RoleAssignment GetItem(Assignment myAssignment) - { - foreach (RoleAssignment assignment in this) - if (assignment.AID == myAssignment.AID) - return assignment; - return null; - } - public RoleAssignment Add(Group myGroup, Folder myFolder) // One to Many - { - RoleAssignment assignment = RoleAssignment.New(myGroup, myFolder); - this.Add(assignment); - return assignment; - } - public void Remove(Assignment myAssignment) - { - foreach (RoleAssignment assignment in this) - { - if (assignment.AID == myAssignment.AID) - { - Remove(assignment); - break; - } - } - } - public bool Contains(Assignment myAssignment) - { - foreach (RoleAssignment assignment in this) - if (assignment.AID == myAssignment.AID) - return true; - return false; - } - public bool ContainsDeleted(Assignment myAssignment) - { - foreach (RoleAssignment assignment in DeletedList) - if (assignment.AID == myAssignment.AID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (RoleAssignment roleAssignment in this) - if ((hasBrokenRules = roleAssignment.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static RoleAssignments New() - { - return new RoleAssignments(); - } - internal static RoleAssignments Get(SafeDataReader dr) - { - return new RoleAssignments(dr); - } - public static RoleAssignments GetByRID(int rid) - { - try - { - return DataPortal.Fetch(new RIDCriteria(rid)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on RoleAssignments.GetByRID", ex); - } - } - private RoleAssignments() - { - MarkAsChild(); - } - internal RoleAssignments(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(RoleAssignment.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class RIDCriteria - { - public RIDCriteria(int rid) - { - _RID = rid; - } - private int _RID; - public int RID - { - get { return _RID; } - set { _RID = value; } - } - } - private void DataPortal_Fetch(RIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoleAssignments.DataPortal_FetchRID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getAssignmentsByRID"; - cm.Parameters.AddWithValue("@RID", criteria.RID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new RoleAssignment(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoleAssignments.DataPortal_FetchRID", ex); - throw new DbCslaException("RoleAssignments.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Role role) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (RoleAssignment obj in DeletedList) - obj.DeleteSelf(role);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (RoleAssignment obj in this) - { - if (obj.IsNew) - obj.Insert(role); - else - obj.Update(role); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - RoleAssignmentsPropertyDescriptor pd = new RoleAssignmentsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class RoleAssignmentsPropertyDescriptor : vlnListPropertyDescriptor - { - private RoleAssignment Item { get { return (RoleAssignment)_Item; } } - public RoleAssignmentsPropertyDescriptor(RoleAssignments collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class RoleAssignmentsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RoleAssignments) - { - // Return department and department role separated by comma. - return ((RoleAssignments)value).Items.Count.ToString() + " Assignments"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoleInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoleInfo.cs deleted file mode 100644 index 546d8cd1..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoleInfo.cs +++ /dev/null @@ -1,398 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void RoleInfoEvent(object sender); - /// - /// RoleInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RoleInfoConverter))] - public partial class RoleInfo : ReadOnlyBase, IDisposable - { - public event RoleInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(RoleInfo roleInfo) - { - if (!_CacheList.Contains(roleInfo)) _CacheList.Add(roleInfo); // In AddToCache - } - protected static void RemoveFromCache(RoleInfo roleInfo) - { - while (_CacheList.Contains(roleInfo)) _CacheList.Remove(roleInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (RoleInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.RID.ToString())) - { - _CacheByPrimaryKey[tmp.RID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.RID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (RoleInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(RoleInfoList lst) - { - foreach (RoleInfo item in lst) AddToCache(item); - } - protected static RoleInfo GetCachedByPrimaryKey(int rid) - { - ConvertListToDictionary(); - string key = rid.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Role _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _RID; - [System.ComponentModel.DataObjectField(true, true)] - public int RID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RID; - } - } - private string _Name = string.Empty; - public string Name - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Name; - } - } - private string _Title = string.Empty; - public string Title - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Title; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - } - private int _RoleAssignmentCount = 0; - /// - /// Count of RoleAssignments for this Role - /// - public int RoleAssignmentCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RoleAssignmentCount; - } - } - private AssignmentInfoList _RoleAssignments = null; - [TypeConverter(typeof(AssignmentInfoListConverter))] - public AssignmentInfoList RoleAssignments - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_RoleAssignmentCount < 0 || (_RoleAssignmentCount > 0 && _RoleAssignments == null)) - _RoleAssignments = AssignmentInfoList.GetByRID(_RID); - if (_RoleAssignmentCount < 0) - _RoleAssignmentCount = _RoleAssignments.Count; - return _RoleAssignments; - } - } - public void RefreshRoleAssignments() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_RID.ToString())) - foreach (RoleInfo tmp in _CacheByPrimaryKey[_RID.ToString()]) - tmp._RoleAssignmentCount = -1; // This will cause the data to be requeried - } - private int _RolePermissionCount = 0; - /// - /// Count of RolePermissions for this Role - /// - public int RolePermissionCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _RolePermissionCount; - } - } - private PermissionInfoList _RolePermissions = null; - [TypeConverter(typeof(PermissionInfoListConverter))] - public PermissionInfoList RolePermissions - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_RolePermissionCount < 0 || (_RolePermissionCount > 0 && _RolePermissions == null)) - _RolePermissions = PermissionInfoList.GetByRID(_RID); - if (_RolePermissionCount < 0) - _RolePermissionCount = _RolePermissions.Count; - return _RolePermissions; - } - } - public void RefreshRolePermissions() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_RID.ToString())) - foreach (RoleInfo tmp in _CacheByPrimaryKey[_RID.ToString()]) - tmp._RolePermissionCount = -1; // This will cause the data to be requeried - } - // TODO: Replace base RoleInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current RoleInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check RoleInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current RoleInfo - protected override object GetIdValue() - { - return _RID; - } - #endregion - #region Factory Methods - private static int _RoleInfoUnique = 0; - private static int RoleInfoUnique - { get { return ++_RoleInfoUnique; } } - private int _MyRoleInfoUnique = RoleInfoUnique; - public int MyRoleInfoUnique - { get { return _MyRoleInfoUnique; } } - protected RoleInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(RID.ToString())) return; - List listRoleInfo = _CacheByPrimaryKey[RID.ToString()]; // Get the list of items - while (listRoleInfo.Contains(this)) listRoleInfo.Remove(this); // Remove the item from the list - if (listRoleInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(RID.ToString()); // remove the list - } - public virtual Role Get() - { - return _Editable = Role.Get(_RID); - } - public static void Refresh(Role tmp) - { - string key = tmp.RID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (RoleInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Role tmp) - { - _Name = tmp.Name; - _Title = tmp.Title; - _DTS = tmp.DTS; - _UsrID = tmp.UsrID; - _RoleInfoExtension.Refresh(this); - OnChange();// raise an event - } - public static RoleInfo Get(int rid) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Role"); - try - { - RoleInfo tmp = GetCachedByPrimaryKey(rid); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(rid)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up RoleInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RoleInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal RoleInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoleInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoleInfo.Constructor", ex); - throw new DbCslaException("RoleInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _RID; - public int RID - { get { return _RID; } } - public PKCriteria(int rid) - { - _RID = rid; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoleInfo.ReadData", GetHashCode()); - try - { - _RID = dr.GetInt32("RID"); - _Name = dr.GetString("Name"); - _Title = dr.GetString("Title"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - _RoleAssignmentCount = dr.GetInt32("AssignmentCount"); - _RolePermissionCount = dr.GetInt32("PermissionCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoleInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RoleInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoleInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRole"; - cm.Parameters.AddWithValue("@RID", criteria.RID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoleInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("RoleInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - RoleInfoExtension _RoleInfoExtension = new RoleInfoExtension(); - [Serializable()] - partial class RoleInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(RoleInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class RoleInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RoleInfo) - { - // Return the ToString value - return ((RoleInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoleInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoleInfoList.cs deleted file mode 100644 index 5101de2c..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RoleInfoList.cs +++ /dev/null @@ -1,198 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// RoleInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RoleInfoListConverter))] - public partial class RoleInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (RoleInfo tmp in this) - { - tmp.Changed += new RoleInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (RoleInfo tmp in this) - { - tmp.Changed -= new RoleInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static RoleInfoList _RoleInfoList = null; - /// - /// Return a list of all projects. - /// - public static RoleInfoList Get() - { - try - { - if (_RoleInfoList != null) - return _RoleInfoList; - RoleInfoList tmp = DataPortal.Fetch(); - RoleInfo.AddList(tmp); - tmp.AddEvents(); - _RoleInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on RoleInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static RoleInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on RoleInfoList.Get", ex); - // } - //} - private RoleInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RoleInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getRoles"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new RoleInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RoleInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("RoleInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - RoleInfoListPropertyDescriptor pd = new RoleInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class RoleInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private RoleInfo Item { get { return (RoleInfo)_Item; } } - public RoleInfoListPropertyDescriptor(RoleInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class RoleInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RoleInfoList) - { - // Return department and department role separated by comma. - return ((RoleInfoList)value).Items.Count.ToString() + " Roles"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RolePermission.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RolePermission.cs deleted file mode 100644 index 23f47a52..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RolePermission.cs +++ /dev/null @@ -1,619 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// RolePermission Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RolePermissionConverter))] - public partial class RolePermission : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _PID; - [System.ComponentModel.DataObjectField(true, true)] - public int PID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyPermission != null) _PID = _MyPermission.PID; - return _PID; - } - } - private Permission _MyPermission; - [System.ComponentModel.DataObjectField(true, true)] - public Permission MyPermission - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyPermission == null && _PID != 0) _MyPermission = Permission.Get(_PID); - return _MyPermission; - } - } - private int _PermLevel; - /// - /// 0 - None, 1 - Security, 2 - System, 3 - RO, 4 - Procdures, 5 - Sections, 6 - Steps, 7 - Comments - /// - public int PermLevel - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _PermLevel; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_PermLevel != value) - { - _PermLevel = value; - PropertyHasChanged(); - } - } - } - private int _VersionType; - /// - /// 0 - None, 1 - Working Draft, 2 - Approved, (3 - All) - /// - public int VersionType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _VersionType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_VersionType != value) - { - _VersionType = value; - PropertyHasChanged(); - } - } - } - private int _PermValue; - /// - /// 1 - Read, 2 - Write, 4 - Create, 8 - Delete (15 - All) - /// - public int PermValue - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _PermValue; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_PermValue != value) - { - _PermValue = value; - PropertyHasChanged(); - } - } - } - private int _PermAD; - /// - /// 0 - Allow, 1 - Deny - /// - public int PermAD - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _PermAD; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_PermAD != value) - { - _PermAD = value; - PropertyHasChanged(); - } - } - } - private string _StartDate = string.Empty; - public string StartDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _StartDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _StartDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_StartDate != tmp.ToString()) - { - _StartDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private string _EndDate = string.Empty; - public string EndDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _EndDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _EndDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_EndDate != tmp.ToString()) - { - _EndDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UsrID != value) - { - _UsrID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - // TODO: Check RolePermission.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current RolePermission - protected override object GetIdValue() - { - return _PID; - } - // TODO: Replace base RolePermission.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current RolePermission - //public override string ToString() - //{ - // return base.ToString(); - //} - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "StartDate"); - ValidationRules.AddRule(StartDateValid, "StartDate"); - ValidationRules.AddRule(EndDateValid, "EndDate"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UsrID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UsrID", 100)); - // TODO: Add other validation rules - } - private static bool StartDateValid(RolePermission target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._StartDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool EndDateValid(RolePermission target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._EndDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(PID, ""); - //AuthorizationRules.AllowRead(PermLevel, ""); - //AuthorizationRules.AllowWrite(PermLevel, ""); - //AuthorizationRules.AllowRead(VersionType, ""); - //AuthorizationRules.AllowWrite(VersionType, ""); - //AuthorizationRules.AllowRead(PermValue, ""); - //AuthorizationRules.AllowWrite(PermValue, ""); - //AuthorizationRules.AllowRead(PermAD, ""); - //AuthorizationRules.AllowWrite(PermAD, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UsrID, ""); - //AuthorizationRules.AllowWrite(UsrID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static RolePermission New(int permLevel, int versionType, int permValue) - { - return new RolePermission(permLevel, versionType, permValue); - } - internal static RolePermission Get(SafeDataReader dr) - { - return new RolePermission(dr); - } - public RolePermission() - { - MarkAsChild(); - _PID = Permission.NextPID; - _PermAD = _RolePermissionExtension.DefaultPermAD; - _StartDate = _RolePermissionExtension.DefaultStartDate; - _DTS = _RolePermissionExtension.DefaultDTS; - _UsrID = _RolePermissionExtension.DefaultUsrID; - ValidationRules.CheckRules(); - } - private RolePermission(int permLevel, int versionType, int permValue) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _PermAD = _RolePermissionExtension.DefaultPermAD; - _StartDate = _RolePermissionExtension.DefaultStartDate; - _DTS = _RolePermissionExtension.DefaultDTS; - _UsrID = _RolePermissionExtension.DefaultUsrID; - _PermLevel = permLevel; - _VersionType = versionType; - _PermValue = permValue; - ValidationRules.CheckRules(); - } - internal RolePermission(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RolePermission.FetchDR", GetHashCode()); - try - { - _PID = dr.GetInt32("PID"); - _PermLevel = dr.GetInt32("PermLevel"); - _VersionType = dr.GetInt32("VersionType"); - _PermValue = dr.GetInt32("PermValue"); - _PermAD = dr.GetInt32("PermAD"); - _StartDate = dr.GetSmartDate("StartDate").Text; - _EndDate = dr.GetSmartDate("EndDate").Text; - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RolePermission.FetchDR", ex); - throw new DbCslaException("RolePermission.Fetch", ex); - } - MarkOld(); - } - internal void Insert(Role myRole) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Permission.Add(cn, ref _PID, myRole, _PermLevel, _VersionType, _PermValue, _PermAD, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID); - MarkOld(); - } - internal void Update(Role myRole) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Permission.Update(cn, ref _PID, myRole, _PermLevel, _VersionType, _PermValue, _PermAD, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(Role myRole) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Permission.Remove(cn, _PID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - RolePermissionExtension _RolePermissionExtension = new RolePermissionExtension(); - [Serializable()] - partial class RolePermissionExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultPermAD - { - get { return 0; } - } - public virtual string DefaultStartDate - { - get { return DateTime.Now.ToShortDateString(); } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUsrID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class RolePermissionConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RolePermission) - { - // Return the ToString value - return ((RolePermission)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create RolePermissionExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class RolePermission -// { -// partial class RolePermissionExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultPermAD -// { -// get { return 0; } -// } -// public virtual SmartDate DefaultStartDate -// { -// get { return DateTime.Now.ToShortDateString(); } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUsrID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RolePermissions.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/RolePermissions.cs deleted file mode 100644 index 00e2aec8..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/RolePermissions.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// RolePermissions Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(RolePermissionsConverter))] - public partial class RolePermissions : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public RolePermission this[Permission myPermission] - { - get - { - foreach (RolePermission permission in this) - if (permission.PID == myPermission.PID) - return permission; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public RolePermission GetItem(Permission myPermission) - { - foreach (RolePermission permission in this) - if (permission.PID == myPermission.PID) - return permission; - return null; - } - public RolePermission Add(int permLevel, int versionType, int permValue) // One to Many - { - RolePermission permission = RolePermission.New(permLevel, versionType, permValue); - this.Add(permission); - return permission; - } - public void Remove(Permission myPermission) - { - foreach (RolePermission permission in this) - { - if (permission.PID == myPermission.PID) - { - Remove(permission); - break; - } - } - } - public bool Contains(Permission myPermission) - { - foreach (RolePermission permission in this) - if (permission.PID == myPermission.PID) - return true; - return false; - } - public bool ContainsDeleted(Permission myPermission) - { - foreach (RolePermission permission in DeletedList) - if (permission.PID == myPermission.PID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (RolePermission rolePermission in this) - if ((hasBrokenRules = rolePermission.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static RolePermissions New() - { - return new RolePermissions(); - } - internal static RolePermissions Get(SafeDataReader dr) - { - return new RolePermissions(dr); - } - public static RolePermissions GetByRID(int rid) - { - try - { - return DataPortal.Fetch(new RIDCriteria(rid)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on RolePermissions.GetByRID", ex); - } - } - private RolePermissions() - { - MarkAsChild(); - } - internal RolePermissions(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(RolePermission.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class RIDCriteria - { - public RIDCriteria(int rid) - { - _RID = rid; - } - private int _RID; - public int RID - { - get { return _RID; } - set { _RID = value; } - } - } - private void DataPortal_Fetch(RIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] RolePermissions.DataPortal_FetchRID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getPermissionsByRID"; - cm.Parameters.AddWithValue("@RID", criteria.RID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new RolePermission(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("RolePermissions.DataPortal_FetchRID", ex); - throw new DbCslaException("RolePermissions.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(Role role) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (RolePermission obj in DeletedList) - obj.DeleteSelf(role);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (RolePermission obj in this) - { - if (obj.IsNew) - obj.Insert(role); - else - obj.Update(role); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - RolePermissionsPropertyDescriptor pd = new RolePermissionsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class RolePermissionsPropertyDescriptor : vlnListPropertyDescriptor - { - private RolePermission Item { get { return (RolePermission)_Item; } } - public RolePermissionsPropertyDescriptor(RolePermissions collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class RolePermissionsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is RolePermissions) - { - // Return department and department role separated by comma. - return ((RolePermissions)value).Items.Count.ToString() + " Permissions"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Transition.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/Transition.cs deleted file mode 100644 index 4e5e7798..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/Transition.cs +++ /dev/null @@ -1,1199 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// Transition Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(TransitionConverter))] - public partial class Transition : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshTransitions = new List(); - private void AddToRefreshList(List refreshTransitions) - { - if (IsDirty) - refreshTransitions.Add(this); - } - private void BuildRefreshList() - { - _RefreshTransitions = new List(); - AddToRefreshList(_RefreshTransitions); - } - private void ProcessRefreshList() - { - foreach (Transition tmp in _RefreshTransitions) - { - TransitionInfo.Refresh(tmp); - if (tmp._MyContent != null) ContentInfo.Refresh(tmp._MyContent); - if (tmp._MyItemRangeID != null) ItemInfo.Refresh(tmp._MyItemRangeID); - if (tmp._MyItemToID != null) ItemInfo.Refresh(tmp._MyItemToID); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(Transition transition) - { - if (!_CacheList.Contains(transition)) _CacheList.Add(transition); // In AddToCache - } - protected static void RemoveFromCache(Transition transition) - { - while (_CacheList.Contains(transition)) _CacheList.Remove(transition); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (Transition tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.TransitionID.ToString())) - { - _CacheByPrimaryKey[tmp.TransitionID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.TransitionID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (Transition tmp in remove) - RemoveFromCache(tmp); - } - protected static Transition GetCachedByPrimaryKey(int transitionID) - { - ConvertListToDictionary(); - string key = transitionID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextTransitionID = -1; - public static int NextTransitionID - { - get { return _nextTransitionID--; } - } - private int _TransitionID; - [System.ComponentModel.DataObjectField(true, true)] - public int TransitionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _TransitionID; - } - } - private int _FromID; - public int FromID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _FromID = _MyContent.ContentID; - return _FromID; - } - } - private Content _MyContent; - public Content MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _FromID != 0) _MyContent = Content.Get(_FromID); - return _MyContent; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyContent != value) - { - _MyContent = value; - PropertyHasChanged(); - } - } - } - private int _ToID; - /// - /// StructureID - /// - public int ToID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItemToID != null) _ToID = _MyItemToID.ItemID; - return _ToID; - } - } - private Item _MyItemToID; - public Item MyItemToID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItemToID == null && _ToID != 0) _MyItemToID = Item.Get(_ToID); - return _MyItemToID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyItemToID != value) - { - _MyItemToID = value; - PropertyHasChanged(); - } - } - } - private int _RangeID; - public int RangeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItemRangeID != null) _RangeID = _MyItemRangeID.ItemID; - return _RangeID; - } - } - private Item _MyItemRangeID; - public Item MyItemRangeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItemRangeID == null && _RangeID != 0) _MyItemRangeID = Item.Get(_RangeID); - return _MyItemRangeID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyItemRangeID != value) - { - _MyItemRangeID = value; - PropertyHasChanged(); - } - } - } - private int _TranType; - public int TranType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _TranType; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_TranType != value) - { - _TranType = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _TransitionZTransitionCount = 0; - /// - /// Count of TransitionZTransitions for this Transition - /// - public int TransitionZTransitionCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _TransitionZTransitionCount; - } - } - private ZTransition _MyZTransition = null; - /// - /// Related Field - /// - [TypeConverter(typeof(ZTransitionConverter))] - public ZTransition MyZTransition - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyZTransition == null) _MyZTransition = ZTransition.New(this); - return _MyZTransition; - } - } - public override bool IsDirty - { - get { return base.IsDirty || (_MyZTransition == null ? false : _MyZTransition.IsDirty) || (_MyContent == null ? false : _MyContent.IsDirty) || (_MyItemRangeID == null ? false : _MyItemRangeID.IsDirty) || (_MyItemToID == null ? false : _MyItemToID.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyZTransition == null ? true : _MyZTransition.IsValid) && (_MyContent == null ? true : _MyContent.IsValid) && (_MyItemRangeID == null ? true : _MyItemRangeID.IsValid) && (_MyItemToID == null ? true : _MyItemToID.IsValid); } - } - // TODO: Replace base Transition.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current Transition - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check Transition.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current Transition - protected override object GetIdValue() - { - return _TransitionID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyZTransition != null && (hasBrokenRules = _MyZTransition.HasBrokenRules) != null) return hasBrokenRules; - if (_MyContent != null && (hasBrokenRules = _MyContent.HasBrokenRules) != null) return hasBrokenRules; - if (_MyItemToID != null && (hasBrokenRules = _MyItemToID.HasBrokenRules) != null) return hasBrokenRules; - if (_MyItemRangeID != null && (hasBrokenRules = _MyItemRangeID.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyContentRequired, "MyContent"); - ValidationRules.AddRule(MyItemToIDRequired, "MyItemToID"); - ValidationRules.AddRule(MyItemRangeIDRequired, "MyItemRangeID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _TransitionExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _TransitionExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - private static bool MyContentRequired(Transition target, Csla.Validation.RuleArgs e) - { - if (target._FromID == 0 && target._MyContent == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - private static bool MyItemToIDRequired(Transition target, Csla.Validation.RuleArgs e) - { - if (target._ToID == 0 && target._MyItemToID == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - private static bool MyItemRangeIDRequired(Transition target, Csla.Validation.RuleArgs e) - { - if (target._RangeID == 0 && target._MyItemRangeID == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(TransitionID, ""); - //AuthorizationRules.AllowRead(FromID, ""); - //AuthorizationRules.AllowRead(ToID, ""); - //AuthorizationRules.AllowRead(RangeID, ""); - //AuthorizationRules.AllowRead(TranType, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowWrite(FromID, ""); - //AuthorizationRules.AllowWrite(ToID, ""); - //AuthorizationRules.AllowWrite(RangeID, ""); - //AuthorizationRules.AllowWrite(TranType, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - _TransitionExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _TransitionExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - /// - /// determines if related records (Foreign Keys) will keep this Item from being deleted - /// - public bool CanDelete - { - get - { - // Check to make sure that there are not any related records - int usedByCount = 0; - usedByCount += _TransitionZTransitionCount; - return (usedByCount == 0); - } - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _TransitionUnique = 0; - protected static int TransitionUnique - { get { return ++_TransitionUnique; } } - private int _MyTransitionUnique = TransitionUnique; - public int MyTransitionUnique - { get { return _MyTransitionUnique; } } - protected Transition() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(TransitionID.ToString())) - { - List listTransition = _CacheByPrimaryKey[TransitionID.ToString()]; // Get the list of items - while (listTransition.Contains(this)) listTransition.Remove(this); // Remove the item from the list - if (listTransition.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(TransitionID.ToString()); // remove the list - } - } - public static Transition New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Transition"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Transition.New", ex); - } - } - public static Transition New(Content myContent, Item myItemToID, Item myItemRangeID) - { - Transition tmp = Transition.New(); - tmp.MyContent = myContent; - tmp.MyItemToID = myItemToID; - tmp.MyItemRangeID = myItemRangeID; - return tmp; - } - public static Transition New(Content myContent, Item myItemToID, Item myItemRangeID, int tranType, string config, DateTime dts, string userID) - { - Transition tmp = Transition.New(); - tmp.MyContent = myContent; - tmp.MyItemToID = myItemToID; - tmp.MyItemRangeID = myItemRangeID; - tmp.TranType = tranType; - tmp.Config = config; - tmp.DTS = dts; - tmp.UserID = userID; - return tmp; - } - public static Transition MakeTransition(Content myContent, Item myItemToID, Item myItemRangeID, int tranType, string config, DateTime dts, string userID) - { - Transition tmp = Transition.New(myContent, myItemToID, myItemRangeID, tranType, config, dts, userID); - if (tmp.IsSavable) - { - Transition tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Transition New(Content myContent, Item myItemToID, Item myItemRangeID, string config) - { - Transition tmp = Transition.New(); - tmp.MyContent = myContent; - tmp.MyItemToID = myItemToID; - tmp.MyItemRangeID = myItemRangeID; - tmp.Config = config; - return tmp; - } - public static Transition MakeTransition(Content myContent, Item myItemToID, Item myItemRangeID, string config) - { - Transition tmp = Transition.New(myContent, myItemToID, myItemRangeID, config); - if (tmp.IsSavable) - { - Transition tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static Transition Get(int transitionID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a Transition"); - try - { - Transition tmp = GetCachedByPrimaryKey(transitionID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(transitionID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up Transition - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Transition.Get", ex); - } - } - public static Transition Get(SafeDataReader dr) - { - if (dr.Read()) return new Transition(dr); - return null; - } - internal Transition(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int transitionID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Transition"); - try - { - DataPortal.Delete(new PKCriteria(transitionID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on Transition.Delete", ex); - } - } - public override Transition Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a Transition"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a Transition"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a Transition"); - try - { - BuildRefreshList(); - Transition transition = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(transition);//Refresh the item in AllList - ProcessRefreshList(); - return transition; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _TransitionID; - public int TransitionID - { get { return _TransitionID; } } - public PKCriteria(int transitionID) - { - _TransitionID = transitionID; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _TransitionID = NextTransitionID; - // Database Defaults - _TranType = _TransitionExtension.DefaultTranType; - _DTS = _TransitionExtension.DefaultDTS; - _UserID = _TransitionExtension.DefaultUserID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Transition.ReadData", GetHashCode()); - try - { - _TransitionID = dr.GetInt32("TransitionID"); - _FromID = dr.GetInt32("FromID"); - _ToID = dr.GetInt32("ToID"); - _RangeID = dr.GetInt32("RangeID"); - _TranType = dr.GetInt32("TranType"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _TransitionZTransitionCount = dr.GetInt32("ZTransitionCount"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Transition.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Transition.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Transition.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getTransition"; - cm.Parameters.AddWithValue("@TransitionID", criteria.TransitionID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _MyZTransition = ZTransition.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Transition.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Transition.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Transition.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Transition.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Transition.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - if (_MyContent != null) _MyContent.Update(); - if (_MyItemRangeID != null) _MyItemRangeID.Update(); - if (_MyItemToID != null) _MyItemToID.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addTransition"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@FromID", FromID); - cm.Parameters.AddWithValue("@ToID", ToID); - cm.Parameters.AddWithValue("@RangeID", RangeID); - cm.Parameters.AddWithValue("@TranType", _TranType); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - // Output Calculated Columns - SqlParameter param_TransitionID = new SqlParameter("@newTransitionID", SqlDbType.Int); - param_TransitionID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_TransitionID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _TransitionID = (int)cm.Parameters["@newTransitionID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_MyZTransition != null) _MyZTransition.Update(this); - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Transition.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Transition.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Transition.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int transitionID, Content myContent, Item myItemToID, Item myItemRangeID, int tranType, string config, DateTime dts, string userID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Transition.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addTransition"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@FromID", myContent.ContentID); - cm.Parameters.AddWithValue("@ToID", myItemToID.ItemID); - cm.Parameters.AddWithValue("@RangeID", myItemRangeID.ItemID); - cm.Parameters.AddWithValue("@TranType", tranType); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - // Output Calculated Columns - SqlParameter param_TransitionID = new SqlParameter("@newTransitionID", SqlDbType.Int); - param_TransitionID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_TransitionID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - transitionID = (int)cm.Parameters["@newTransitionID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Transition.Add", ex); - throw new DbCslaException("Transition.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Transition.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Transition.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Transition.SQLUpdate", GetHashCode()); - try - { - if (_MyContent != null) _MyContent.Update(); - if (_MyItemRangeID != null) _MyItemRangeID.Update(); - if (_MyItemToID != null) _MyItemToID.Update(); - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateTransition"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@TransitionID", _TransitionID); - cm.Parameters.AddWithValue("@FromID", FromID); - cm.Parameters.AddWithValue("@ToID", ToID); - cm.Parameters.AddWithValue("@RangeID", RangeID); - cm.Parameters.AddWithValue("@TranType", _TranType); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - if (_MyZTransition != null) _MyZTransition.Update(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Transition.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = Transition.Add(cn, ref _TransitionID, _MyContent, _MyItemToID, _MyItemRangeID, _TranType, _Config, _DTS, _UserID); - else - _LastChanged = Transition.Update(cn, ref _TransitionID, _MyContent, _MyItemToID, _MyItemRangeID, _TranType, _Config, _DTS, _UserID, ref _LastChanged); - MarkOld(); - } - if (_MyZTransition != null) _MyZTransition.Update(this); - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int transitionID, Content myContent, Item myItemToID, Item myItemRangeID, int tranType, string config, DateTime dts, string userID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Transition.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateTransition"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@TransitionID", transitionID); - cm.Parameters.AddWithValue("@FromID", myContent.ContentID); - cm.Parameters.AddWithValue("@ToID", myItemToID.ItemID); - cm.Parameters.AddWithValue("@RangeID", myItemRangeID.ItemID); - cm.Parameters.AddWithValue("@TranType", tranType); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Transition.Update", ex); - throw new DbCslaException("Transition.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_TransitionID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Transition.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteTransition"; - cm.Parameters.AddWithValue("@TransitionID", criteria.TransitionID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Transition.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("Transition.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int transitionID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Transition.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteTransition"; - // Input PK Fields - cm.Parameters.AddWithValue("@TransitionID", transitionID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Transition.Remove", ex); - throw new DbCslaException("Transition.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int transitionID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(transitionID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on Transition.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _TransitionID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int transitionID) - { - _TransitionID = transitionID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] Transition.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsTransition"; - cm.Parameters.AddWithValue("@TransitionID", _TransitionID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Transition.DataPortal_Execute", ex); - throw new DbCslaException("Transition.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - TransitionExtension _TransitionExtension = new TransitionExtension(); - [Serializable()] - partial class TransitionExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual int DefaultTranType - { - get { return 0; } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class TransitionConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is Transition) - { - // Return the ToString value - return ((Transition)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create TransitionExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class Transition -// { -// partial class TransitionExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual int DefaultTranType -// { -// get { return 0; } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/TransitionInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/TransitionInfo.cs deleted file mode 100644 index 60e3a203..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/TransitionInfo.cs +++ /dev/null @@ -1,622 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void TransitionInfoEvent(object sender); - /// - /// TransitionInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(TransitionInfoConverter))] - public partial class TransitionInfo : ReadOnlyBase, IDisposable - { - public event TransitionInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(TransitionInfo transitionInfo) - { - if (!_CacheList.Contains(transitionInfo)) _CacheList.Add(transitionInfo); // In AddToCache - } - protected static void RemoveFromCache(TransitionInfo transitionInfo) - { - while (_CacheList.Contains(transitionInfo)) _CacheList.Remove(transitionInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (TransitionInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.TransitionID.ToString())) - { - _CacheByPrimaryKey[tmp.TransitionID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.TransitionID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (TransitionInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(TransitionInfoList lst) - { - foreach (TransitionInfo item in lst) AddToCache(item); - } - protected static TransitionInfo GetCachedByPrimaryKey(int transitionID) - { - ConvertListToDictionary(); - string key = transitionID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected Transition _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _TransitionID; - [System.ComponentModel.DataObjectField(true, true)] - public int TransitionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _TransitionID; - } - } - private int _FromID; - public int FromID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _FromID = _MyContent.ContentID; - return _FromID; - } - } - private ContentInfo _MyContent; - public ContentInfo MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _FromID != 0) _MyContent = ContentInfo.Get(_FromID); - return _MyContent; - } - } - private int _ToID; - /// - /// StructureID - /// - public int ToID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItemToID != null) _ToID = _MyItemToID.ItemID; - return _ToID; - } - } - private ItemInfo _MyItemToID; - public ItemInfo MyItemToID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItemToID == null && _ToID != 0) _MyItemToID = ItemInfo.Get(_ToID); - return _MyItemToID; - } - } - private int _RangeID; - public int RangeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItemRangeID != null) _RangeID = _MyItemRangeID.ItemID; - return _RangeID; - } - } - private ItemInfo _MyItemRangeID; - public ItemInfo MyItemRangeID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyItemRangeID == null && _RangeID != 0) _MyItemRangeID = ItemInfo.Get(_RangeID); - return _MyItemRangeID; - } - } - private int _TranType; - public int TranType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _TranType; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - private int _TransitionZTransitionCount = 0; - /// - /// Count of TransitionZTransitions for this Transition - /// - public int TransitionZTransitionCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _TransitionZTransitionCount; - } - } - private ZTransitionInfo _MyZTransition = null; - [TypeConverter(typeof(ZTransitionInfoConverter))] - public ZTransitionInfo MyZTransition - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_TransitionZTransitionCount != 0 && _MyZTransition == null) - { - _MyZTransition = ZTransitionInfo.Get(_TransitionID); - _TransitionZTransitionCount = _MyZTransition == null ? 0 : 1; - } - return _MyZTransition; - } - } - // TODO: Replace base TransitionInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current TransitionInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check TransitionInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current TransitionInfo - protected override object GetIdValue() - { - return _TransitionID; - } - #endregion - #region Factory Methods - private static int _TransitionInfoUnique = 0; - private static int TransitionInfoUnique - { get { return ++_TransitionInfoUnique; } } - private int _MyTransitionInfoUnique = TransitionInfoUnique; - public int MyTransitionInfoUnique - { get { return _MyTransitionInfoUnique; } } - protected TransitionInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(TransitionID.ToString())) return; - List listTransitionInfo = _CacheByPrimaryKey[TransitionID.ToString()]; // Get the list of items - while (listTransitionInfo.Contains(this)) listTransitionInfo.Remove(this); // Remove the item from the list - if (listTransitionInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(TransitionID.ToString()); // remove the list - } - public virtual Transition Get() - { - return _Editable = Transition.Get(_TransitionID); - } - public static void Refresh(Transition tmp) - { - string key = tmp.TransitionID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (TransitionInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(Transition tmp) - { - if (_FromID != tmp.FromID) - { - if (MyContent != null) MyContent.RefreshContentTransitions(); // Update List for old value - _FromID = tmp.FromID; // Update the value - } - _MyContent = null; // Reset list so that the next line gets a new list - if (MyContent != null) MyContent.RefreshContentTransitions(); // Update List for new value - if (_ToID != tmp.ToID) - { - if (MyItemToID != null) MyItemToID.RefreshItemTransitions_ToID(); // Update List for old value - _ToID = tmp.ToID; // Update the value - } - _MyItemToID = null; // Reset list so that the next line gets a new list - if (MyItemToID != null) MyItemToID.RefreshItemTransitions_ToID(); // Update List for new value - if (_RangeID != tmp.RangeID) - { - if (MyItemRangeID != null) MyItemRangeID.RefreshItemTransitions_RangeID(); // Update List for old value - _RangeID = tmp.RangeID; // Update the value - } - _MyItemRangeID = null; // Reset list so that the next line gets a new list - if (MyItemRangeID != null) MyItemRangeID.RefreshItemTransitions_RangeID(); // Update List for new value - _TranType = tmp.TranType; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _TransitionInfoExtension.Refresh(this); - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - if (_MyItemToID != null) - { - _MyItemToID.Dispose();// Dispose related value - _MyItemToID = null;// Reset related value - } - if (_MyItemRangeID != null) - { - _MyItemRangeID.Dispose();// Dispose related value - _MyItemRangeID = null;// Reset related value - } - if (_MyZTransition != null) - { - _MyZTransition.Dispose();// Dispose related value - _MyZTransition = null;// Reset related value - } - _TransitionZTransitionCount = -1;// Reset Count - OnChange();// raise an event - } - public static void Refresh(ContentTransition tmp) - { - string key = tmp.TransitionID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (TransitionInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ContentTransition tmp) - { - if (_ToID != tmp.ToID) - { - if (MyItemToID != null) MyItemToID.RefreshItemTransitions_ToID(); // Update List for old value - _ToID = tmp.ToID; // Update the value - } - _MyItemToID = null; // Reset list so that the next line gets a new list - if (MyItemToID != null) MyItemToID.RefreshItemTransitions_ToID(); // Update List for new value - if (_RangeID != tmp.RangeID) - { - if (MyItemRangeID != null) MyItemRangeID.RefreshItemTransitions_RangeID(); // Update List for old value - _RangeID = tmp.RangeID; // Update the value - } - _MyItemRangeID = null; // Reset list so that the next line gets a new list - if (MyItemRangeID != null) MyItemRangeID.RefreshItemTransitions_RangeID(); // Update List for new value - _TranType = tmp.TranType; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _TransitionInfoExtension.Refresh(this); - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - if (_MyItemToID != null) - { - _MyItemToID.Dispose();// Dispose related value - _MyItemToID = null;// Reset related value - } - if (_MyItemRangeID != null) - { - _MyItemRangeID.Dispose();// Dispose related value - _MyItemRangeID = null;// Reset related value - } - if (_MyZTransition != null) - { - _MyZTransition.Dispose();// Dispose related value - _MyZTransition = null;// Reset related value - } - _TransitionZTransitionCount = -1;// Reset Count - OnChange();// raise an event - } - public static void Refresh(ItemTransition_RangeID tmp) - { - string key = tmp.TransitionID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (TransitionInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ItemTransition_RangeID tmp) - { - if (_FromID != tmp.FromID) - { - if (MyContent != null) MyContent.RefreshContentTransitions(); // Update List for old value - _FromID = tmp.FromID; // Update the value - } - _MyContent = null; // Reset list so that the next line gets a new list - if (MyContent != null) MyContent.RefreshContentTransitions(); // Update List for new value - if (_ToID != tmp.ToID) - { - if (MyItemToID != null) MyItemToID.RefreshItemTransitions_ToID(); // Update List for old value - _ToID = tmp.ToID; // Update the value - } - _MyItemToID = null; // Reset list so that the next line gets a new list - if (MyItemToID != null) MyItemToID.RefreshItemTransitions_ToID(); // Update List for new value - _TranType = tmp.TranType; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _TransitionInfoExtension.Refresh(this); - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - if (_MyItemToID != null) - { - _MyItemToID.Dispose();// Dispose related value - _MyItemToID = null;// Reset related value - } - if (_MyItemRangeID != null) - { - _MyItemRangeID.Dispose();// Dispose related value - _MyItemRangeID = null;// Reset related value - } - if (_MyZTransition != null) - { - _MyZTransition.Dispose();// Dispose related value - _MyZTransition = null;// Reset related value - } - _TransitionZTransitionCount = -1;// Reset Count - OnChange();// raise an event - } - public static void Refresh(ItemTransition_ToID tmp) - { - string key = tmp.TransitionID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (TransitionInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ItemTransition_ToID tmp) - { - if (_FromID != tmp.FromID) - { - if (MyContent != null) MyContent.RefreshContentTransitions(); // Update List for old value - _FromID = tmp.FromID; // Update the value - } - _MyContent = null; // Reset list so that the next line gets a new list - if (MyContent != null) MyContent.RefreshContentTransitions(); // Update List for new value - if (_RangeID != tmp.RangeID) - { - if (MyItemRangeID != null) MyItemRangeID.RefreshItemTransitions_RangeID(); // Update List for old value - _RangeID = tmp.RangeID; // Update the value - } - _MyItemRangeID = null; // Reset list so that the next line gets a new list - if (MyItemRangeID != null) MyItemRangeID.RefreshItemTransitions_RangeID(); // Update List for new value - _TranType = tmp.TranType; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UserID = tmp.UserID; - _TransitionInfoExtension.Refresh(this); - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - if (_MyItemToID != null) - { - _MyItemToID.Dispose();// Dispose related value - _MyItemToID = null;// Reset related value - } - if (_MyItemRangeID != null) - { - _MyItemRangeID.Dispose();// Dispose related value - _MyItemRangeID = null;// Reset related value - } - if (_MyZTransition != null) - { - _MyZTransition.Dispose();// Dispose related value - _MyZTransition = null;// Reset related value - } - _TransitionZTransitionCount = -1;// Reset Count - OnChange();// raise an event - } - public static TransitionInfo Get(int transitionID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a Transition"); - try - { - TransitionInfo tmp = GetCachedByPrimaryKey(transitionID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(transitionID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up TransitionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on TransitionInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal TransitionInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] TransitionInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("TransitionInfo.Constructor", ex); - throw new DbCslaException("TransitionInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _TransitionID; - public int TransitionID - { get { return _TransitionID; } } - public PKCriteria(int transitionID) - { - _TransitionID = transitionID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] TransitionInfo.ReadData", GetHashCode()); - try - { - _TransitionID = dr.GetInt32("TransitionID"); - _FromID = dr.GetInt32("FromID"); - _ToID = dr.GetInt32("ToID"); - _RangeID = dr.GetInt32("RangeID"); - _TranType = dr.GetInt32("TranType"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UserID = dr.GetString("UserID"); - _TransitionZTransitionCount = dr.GetInt32("ZTransitionCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("TransitionInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("TransitionInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] TransitionInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getTransition"; - cm.Parameters.AddWithValue("@TransitionID", criteria.TransitionID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("TransitionInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("TransitionInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - TransitionInfoExtension _TransitionInfoExtension = new TransitionInfoExtension(); - [Serializable()] - partial class TransitionInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(TransitionInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class TransitionInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is TransitionInfo) - { - // Return the ToString value - return ((TransitionInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/TransitionInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/TransitionInfoList.cs deleted file mode 100644 index 0ee8f648..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/TransitionInfoList.cs +++ /dev/null @@ -1,369 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// TransitionInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(TransitionInfoListConverter))] - public partial class TransitionInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (TransitionInfo tmp in this) - { - tmp.Changed += new TransitionInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (TransitionInfo tmp in this) - { - tmp.Changed -= new TransitionInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static TransitionInfoList _TransitionInfoList = null; - /// - /// Return a list of all projects. - /// - public static TransitionInfoList Get() - { - try - { - if (_TransitionInfoList != null) - return _TransitionInfoList; - TransitionInfoList tmp = DataPortal.Fetch(); - TransitionInfo.AddList(tmp); - tmp.AddEvents(); - _TransitionInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on TransitionInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static TransitionInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on TransitionInfoList.Get", ex); - // } - //} - public static TransitionInfoList GetByFromID(int fromID) - { - try - { - TransitionInfoList tmp = DataPortal.Fetch(new FromIDCriteria(fromID)); - TransitionInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on TransitionInfoList.GetByFromID", ex); - } - } - public static TransitionInfoList GetByRangeID(int rangeID) - { - try - { - TransitionInfoList tmp = DataPortal.Fetch(new RangeIDCriteria(rangeID)); - TransitionInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on TransitionInfoList.GetByRangeID", ex); - } - } - public static TransitionInfoList GetByToID(int toID) - { - try - { - TransitionInfoList tmp = DataPortal.Fetch(new ToIDCriteria(toID)); - TransitionInfo.AddList(tmp); - tmp.AddEvents(); - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on TransitionInfoList.GetByToID", ex); - } - } - private TransitionInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] TransitionInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getTransitions"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new TransitionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("TransitionInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("TransitionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class FromIDCriteria - { - public FromIDCriteria(int fromID) - { - _FromID = fromID; - } - private int _FromID; - public int FromID - { - get { return _FromID; } - set { _FromID = value; } - } - } - private void DataPortal_Fetch(FromIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] TransitionInfoList.DataPortal_FetchFromID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getTransitionsByFromID"; - cm.Parameters.AddWithValue("@FromID", criteria.FromID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new TransitionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("TransitionInfoList.DataPortal_FetchFromID", ex); - throw new DbCslaException("TransitionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class RangeIDCriteria - { - public RangeIDCriteria(int rangeID) - { - _RangeID = rangeID; - } - private int _RangeID; - public int RangeID - { - get { return _RangeID; } - set { _RangeID = value; } - } - } - private void DataPortal_Fetch(RangeIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] TransitionInfoList.DataPortal_FetchRangeID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getTransitionsByRangeID"; - cm.Parameters.AddWithValue("@RangeID", criteria.RangeID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new TransitionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("TransitionInfoList.DataPortal_FetchRangeID", ex); - throw new DbCslaException("TransitionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class ToIDCriteria - { - public ToIDCriteria(int toID) - { - _ToID = toID; - } - private int _ToID; - public int ToID - { - get { return _ToID; } - set { _ToID = value; } - } - } - private void DataPortal_Fetch(ToIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] TransitionInfoList.DataPortal_FetchToID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getTransitionsByToID"; - cm.Parameters.AddWithValue("@ToID", criteria.ToID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new TransitionInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("TransitionInfoList.DataPortal_FetchToID", ex); - throw new DbCslaException("TransitionInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - TransitionInfoListPropertyDescriptor pd = new TransitionInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class TransitionInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private TransitionInfo Item { get { return (TransitionInfo)_Item; } } - public TransitionInfoListPropertyDescriptor(TransitionInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class TransitionInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is TransitionInfoList) - { - // Return department and department role separated by comma. - return ((TransitionInfoList)value).Items.Count.ToString() + " Transitions"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/User.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/User.cs deleted file mode 100644 index 6d964d1a..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/User.cs +++ /dev/null @@ -1,1333 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// User Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(UserConverter))] - public partial class User : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshUsers = new List(); - private List _RefreshUserMemberships = new List(); - private void AddToRefreshList(List refreshUsers, List refreshUserMemberships) - { - if (IsDirty) - refreshUsers.Add(this); - if (_UserMemberships != null && _UserMemberships.IsDirty) - { - foreach (UserMembership tmp in _UserMemberships) - { - if (tmp.IsDirty) refreshUserMemberships.Add(tmp); - } - } - } - private void BuildRefreshList() - { - _RefreshUsers = new List(); - _RefreshUserMemberships = new List(); - AddToRefreshList(_RefreshUsers, _RefreshUserMemberships); - } - private void ProcessRefreshList() - { - foreach (User tmp in _RefreshUsers) - { - UserInfo.Refresh(tmp); - } - foreach (UserMembership tmp in _RefreshUserMemberships) - { - MembershipInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(User user) - { - if (!_CacheList.Contains(user)) _CacheList.Add(user); // In AddToCache - } - protected static void RemoveFromCache(User user) - { - while (_CacheList.Contains(user)) _CacheList.Remove(user); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (User tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.UID.ToString())) - { - _CacheByPrimaryKey[tmp.UID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.UID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (User tmp in remove) - RemoveFromCache(tmp); - } - protected static User GetCachedByPrimaryKey(int uid) - { - ConvertListToDictionary(); - string key = uid.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private static int _nextUID = -1; - public static int NextUID - { - get { return _nextUID--; } - } - private int _UID; - [System.ComponentModel.DataObjectField(true, true)] - public int UID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UID; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserID != value) - { - _UserID = value; - PropertyHasChanged(); - } - } - } - private string _FirstName = string.Empty; - public string FirstName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FirstName; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_FirstName != value) - { - _FirstName = value; - PropertyHasChanged(); - } - } - } - private string _MiddleName = string.Empty; - public string MiddleName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _MiddleName; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_MiddleName != value) - { - _MiddleName = value; - PropertyHasChanged(); - } - } - } - private string _LastName = string.Empty; - public string LastName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _LastName; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_LastName != value) - { - _LastName = value; - PropertyHasChanged(); - } - } - } - private string _Suffix = string.Empty; - public string Suffix - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Suffix; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Suffix != value) - { - _Suffix = value; - PropertyHasChanged(); - } - } - } - private string _CourtesyTitle = string.Empty; - public string CourtesyTitle - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _CourtesyTitle; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_CourtesyTitle != value) - { - _CourtesyTitle = value; - PropertyHasChanged(); - } - } - } - private string _PhoneNumber = string.Empty; - public string PhoneNumber - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _PhoneNumber; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_PhoneNumber != value) - { - _PhoneNumber = value; - PropertyHasChanged(); - } - } - } - private string _CFGName = string.Empty; - public string CFGName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _CFGName; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_CFGName != value) - { - _CFGName = value; - PropertyHasChanged(); - } - } - } - private string _UserLogin = string.Empty; - public string UserLogin - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserLogin; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserLogin != value) - { - _UserLogin = value; - PropertyHasChanged(); - } - } - } - private string _UserName = string.Empty; - public string UserName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserName; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UserName != value) - { - _UserName = value; - PropertyHasChanged(); - } - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UsrID != value) - { - _UsrID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private int _UserMembershipCount = 0; - /// - /// Count of UserMemberships for this User - /// - public int UserMembershipCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserMembershipCount; - } - } - private UserMemberships _UserMemberships = null; - /// - /// Related Field - /// - [TypeConverter(typeof(UserMembershipsConverter))] - public UserMemberships UserMemberships - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_UserMembershipCount > 0 && _UserMemberships == null) - _UserMemberships = UserMemberships.GetByUID(UID); - else if (_UserMemberships == null) - _UserMemberships = UserMemberships.New(); - return _UserMemberships; - } - } - public override bool IsDirty - { - get { return base.IsDirty || (_UserMemberships == null ? false : _UserMemberships.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_UserMemberships == null ? true : _UserMemberships.IsValid); } - } - // TODO: Replace base User.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current User - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check User.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current User - protected override object GetIdValue() - { - return _UID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_UserMemberships != null && (hasBrokenRules = _UserMemberships.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UserID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserID", 100)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("FirstName", 50)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("MiddleName", 50)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("LastName", 50)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Suffix", 10)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("CourtesyTitle", 10)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("PhoneNumber", 30)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("CFGName", 8)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserLogin", 10)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UserName", 32)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UsrID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UsrID", 100)); - //ValidationRules.AddDependantProperty("x", "y"); - _UserExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _UserExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(UID, ""); - //AuthorizationRules.AllowRead(UserID, ""); - //AuthorizationRules.AllowRead(FirstName, ""); - //AuthorizationRules.AllowRead(MiddleName, ""); - //AuthorizationRules.AllowRead(LastName, ""); - //AuthorizationRules.AllowRead(Suffix, ""); - //AuthorizationRules.AllowRead(CourtesyTitle, ""); - //AuthorizationRules.AllowRead(PhoneNumber, ""); - //AuthorizationRules.AllowRead(CFGName, ""); - //AuthorizationRules.AllowRead(UserLogin, ""); - //AuthorizationRules.AllowRead(UserName, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowRead(UsrID, ""); - //AuthorizationRules.AllowWrite(UserID, ""); - //AuthorizationRules.AllowWrite(FirstName, ""); - //AuthorizationRules.AllowWrite(MiddleName, ""); - //AuthorizationRules.AllowWrite(LastName, ""); - //AuthorizationRules.AllowWrite(Suffix, ""); - //AuthorizationRules.AllowWrite(CourtesyTitle, ""); - //AuthorizationRules.AllowWrite(PhoneNumber, ""); - //AuthorizationRules.AllowWrite(CFGName, ""); - //AuthorizationRules.AllowWrite(UserLogin, ""); - //AuthorizationRules.AllowWrite(UserName, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowWrite(UsrID, ""); - _UserExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _UserExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - /// - /// determines if related records (Foreign Keys) will keep this Item from being deleted - /// - public bool CanDelete - { - get - { - // Check to make sure that there are not any related records - int usedByCount = 0; - usedByCount += _UserMembershipCount; - return (usedByCount == 0); - } - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _UserUnique = 0; - protected static int UserUnique - { get { return ++_UserUnique; } } - private int _MyUserUnique = UserUnique; - public int MyUserUnique - { get { return _MyUserUnique; } } - protected User() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(UID.ToString())) - { - List listUser = _CacheByPrimaryKey[UID.ToString()]; // Get the list of items - while (listUser.Contains(this)) listUser.Remove(this); // Remove the item from the list - if (listUser.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(UID.ToString()); // remove the list - } - } - public static User New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a User"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on User.New", ex); - } - } - public static User New(string userID, string firstName, string middleName, string lastName, string suffix, string courtesyTitle, string phoneNumber, string cFGName, string userLogin, string userName, string config, DateTime dts, string usrID) - { - User tmp = User.New(); - tmp.UserID = userID; - tmp.FirstName = firstName; - tmp.MiddleName = middleName; - tmp.LastName = lastName; - tmp.Suffix = suffix; - tmp.CourtesyTitle = courtesyTitle; - tmp.PhoneNumber = phoneNumber; - tmp.CFGName = cFGName; - tmp.UserLogin = userLogin; - tmp.UserName = userName; - tmp.Config = config; - tmp.DTS = dts; - tmp.UsrID = usrID; - return tmp; - } - public static User MakeUser(string userID, string firstName, string middleName, string lastName, string suffix, string courtesyTitle, string phoneNumber, string cFGName, string userLogin, string userName, string config, DateTime dts, string usrID) - { - User tmp = User.New(userID, firstName, middleName, lastName, suffix, courtesyTitle, phoneNumber, cFGName, userLogin, userName, config, dts, usrID); - if (tmp.IsSavable) - { - User tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static User New(string firstName, string middleName, string lastName, string suffix, string courtesyTitle, string phoneNumber, string cFGName, string userLogin, string userName, string config) - { - User tmp = User.New(); - tmp.FirstName = firstName; - tmp.MiddleName = middleName; - tmp.LastName = lastName; - tmp.Suffix = suffix; - tmp.CourtesyTitle = courtesyTitle; - tmp.PhoneNumber = phoneNumber; - tmp.CFGName = cFGName; - tmp.UserLogin = userLogin; - tmp.UserName = userName; - tmp.Config = config; - return tmp; - } - public static User MakeUser(string firstName, string middleName, string lastName, string suffix, string courtesyTitle, string phoneNumber, string cFGName, string userLogin, string userName, string config) - { - User tmp = User.New(firstName, middleName, lastName, suffix, courtesyTitle, phoneNumber, cFGName, userLogin, userName, config); - if (tmp.IsSavable) - { - User tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static User Get(int uid) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a User"); - try - { - User tmp = GetCachedByPrimaryKey(uid); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(uid)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up User - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on User.Get", ex); - } - } - public static User Get(SafeDataReader dr) - { - if (dr.Read()) return new User(dr); - return null; - } - internal User(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int uid) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a User"); - try - { - DataPortal.Delete(new PKCriteria(uid)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on User.Delete", ex); - } - } - public override User Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a User"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a User"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a User"); - try - { - BuildRefreshList(); - User user = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(user);//Refresh the item in AllList - ProcessRefreshList(); - return user; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _UID; - public int UID - { get { return _UID; } } - public PKCriteria(int uid) - { - _UID = uid; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - _UID = NextUID; - // Database Defaults - _UserID = _UserExtension.DefaultUserID; - _DTS = _UserExtension.DefaultDTS; - _UsrID = _UserExtension.DefaultUsrID; - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] User.ReadData", GetHashCode()); - try - { - _UID = dr.GetInt32("UID"); - _UserID = dr.GetString("UserID"); - _FirstName = dr.GetString("FirstName"); - _MiddleName = dr.GetString("MiddleName"); - _LastName = dr.GetString("LastName"); - _Suffix = dr.GetString("Suffix"); - _CourtesyTitle = dr.GetString("CourtesyTitle"); - _PhoneNumber = dr.GetString("PhoneNumber"); - _CFGName = dr.GetString("CFGName"); - _UserLogin = dr.GetString("UserLogin"); - _UserName = dr.GetString("UserName"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _UserMembershipCount = dr.GetInt32("MembershipCount"); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("User.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("User.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] User.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getUser"; - cm.Parameters.AddWithValue("@UID", criteria.UID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - // load child objects - dr.NextResult(); - _UserMemberships = UserMemberships.Get(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("User.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("User.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("User.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("User.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] User.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addUser"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@FirstName", _FirstName); - cm.Parameters.AddWithValue("@MiddleName", _MiddleName); - cm.Parameters.AddWithValue("@LastName", _LastName); - cm.Parameters.AddWithValue("@Suffix", _Suffix); - cm.Parameters.AddWithValue("@CourtesyTitle", _CourtesyTitle); - cm.Parameters.AddWithValue("@PhoneNumber", _PhoneNumber); - cm.Parameters.AddWithValue("@CFGName", _CFGName); - cm.Parameters.AddWithValue("@UserLogin", _UserLogin); - cm.Parameters.AddWithValue("@UserName", _UserName); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UsrID", _UsrID); - // Output Calculated Columns - SqlParameter param_UID = new SqlParameter("@newUID", SqlDbType.Int); - param_UID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_UID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _UID = (int)cm.Parameters["@newUID"].Value; - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_UserMemberships != null) _UserMemberships.Update(this); - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] User.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("User.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("User.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, ref int uid, string userID, string firstName, string middleName, string lastName, string suffix, string courtesyTitle, string phoneNumber, string cFGName, string userLogin, string userName, string config, DateTime dts, string usrID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] User.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addUser"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@FirstName", firstName); - cm.Parameters.AddWithValue("@MiddleName", middleName); - cm.Parameters.AddWithValue("@LastName", lastName); - cm.Parameters.AddWithValue("@Suffix", suffix); - cm.Parameters.AddWithValue("@CourtesyTitle", courtesyTitle); - cm.Parameters.AddWithValue("@PhoneNumber", phoneNumber); - cm.Parameters.AddWithValue("@CFGName", cFGName); - cm.Parameters.AddWithValue("@UserLogin", userLogin); - cm.Parameters.AddWithValue("@UserName", userName); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UsrID", usrID); - // Output Calculated Columns - SqlParameter param_UID = new SqlParameter("@newUID", SqlDbType.Int); - param_UID.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_UID); - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - uid = (int)cm.Parameters["@newUID"].Value; - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("User.Add", ex); - throw new DbCslaException("User.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] User.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("User.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] User.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateUser"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@UID", _UID); - cm.Parameters.AddWithValue("@UserID", _UserID); - cm.Parameters.AddWithValue("@FirstName", _FirstName); - cm.Parameters.AddWithValue("@MiddleName", _MiddleName); - cm.Parameters.AddWithValue("@LastName", _LastName); - cm.Parameters.AddWithValue("@Suffix", _Suffix); - cm.Parameters.AddWithValue("@CourtesyTitle", _CourtesyTitle); - cm.Parameters.AddWithValue("@PhoneNumber", _PhoneNumber); - cm.Parameters.AddWithValue("@CFGName", _CFGName); - cm.Parameters.AddWithValue("@UserLogin", _UserLogin); - cm.Parameters.AddWithValue("@UserName", _UserName); - cm.Parameters.AddWithValue("@Config", _Config); - if (_DTS.Year >= 1753 && _DTS.Year <= 9999) cm.Parameters.AddWithValue("@DTS", _DTS); - cm.Parameters.AddWithValue("@UsrID", _UsrID); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - if (_UserMemberships != null) _UserMemberships.Update(this); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("User.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update() - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = User.Add(cn, ref _UID, _UserID, _FirstName, _MiddleName, _LastName, _Suffix, _CourtesyTitle, _PhoneNumber, _CFGName, _UserLogin, _UserName, _Config, _DTS, _UsrID); - else - _LastChanged = User.Update(cn, ref _UID, _UserID, _FirstName, _MiddleName, _LastName, _Suffix, _CourtesyTitle, _PhoneNumber, _CFGName, _UserLogin, _UserName, _Config, _DTS, _UsrID, ref _LastChanged); - MarkOld(); - } - if (_UserMemberships != null) _UserMemberships.Update(this); - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, ref int uid, string userID, string firstName, string middleName, string lastName, string suffix, string courtesyTitle, string phoneNumber, string cFGName, string userLogin, string userName, string config, DateTime dts, string usrID, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] User.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateUser"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@UID", uid); - cm.Parameters.AddWithValue("@UserID", userID); - cm.Parameters.AddWithValue("@FirstName", firstName); - cm.Parameters.AddWithValue("@MiddleName", middleName); - cm.Parameters.AddWithValue("@LastName", lastName); - cm.Parameters.AddWithValue("@Suffix", suffix); - cm.Parameters.AddWithValue("@CourtesyTitle", courtesyTitle); - cm.Parameters.AddWithValue("@PhoneNumber", phoneNumber); - cm.Parameters.AddWithValue("@CFGName", cFGName); - cm.Parameters.AddWithValue("@UserLogin", userLogin); - cm.Parameters.AddWithValue("@UserName", userName); - cm.Parameters.AddWithValue("@Config", config); - if (dts.Year >= 1753 && dts.Year <= 9999) cm.Parameters.AddWithValue("@DTS", dts); - cm.Parameters.AddWithValue("@UsrID", usrID); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("User.Update", ex); - throw new DbCslaException("User.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_UID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] User.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteUser"; - cm.Parameters.AddWithValue("@UID", criteria.UID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("User.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("User.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int uid) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] User.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteUser"; - // Input PK Fields - cm.Parameters.AddWithValue("@UID", uid); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("User.Remove", ex); - throw new DbCslaException("User.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int uid) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(uid)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on User.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _UID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int uid) - { - _UID = uid; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] User.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsUser"; - cm.Parameters.AddWithValue("@UID", _UID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("User.DataPortal_Execute", ex); - throw new DbCslaException("User.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - UserExtension _UserExtension = new UserExtension(); - [Serializable()] - partial class UserExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual string DefaultUserID - { - get { return Environment.UserName.ToUpper(); } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUsrID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class UserConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is User) - { - // Return the ToString value - return ((User)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create UserExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class User -// { -// partial class UserExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual string DefaultUserID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUsrID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/UserInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/UserInfo.cs deleted file mode 100644 index 98d4bbb1..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/UserInfo.cs +++ /dev/null @@ -1,463 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void UserInfoEvent(object sender); - /// - /// UserInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(UserInfoConverter))] - public partial class UserInfo : ReadOnlyBase, IDisposable - { - public event UserInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(UserInfo userInfo) - { - if (!_CacheList.Contains(userInfo)) _CacheList.Add(userInfo); // In AddToCache - } - protected static void RemoveFromCache(UserInfo userInfo) - { - while (_CacheList.Contains(userInfo)) _CacheList.Remove(userInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (UserInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.UID.ToString())) - { - _CacheByPrimaryKey[tmp.UID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.UID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (UserInfo tmp in remove) - RemoveFromCache(tmp); - } - internal static void AddList(UserInfoList lst) - { - foreach (UserInfo item in lst) AddToCache(item); - } - protected static UserInfo GetCachedByPrimaryKey(int uid) - { - ConvertListToDictionary(); - string key = uid.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected User _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _UID; - [System.ComponentModel.DataObjectField(true, true)] - public int UID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UID; - } - } - private string _UserID = string.Empty; - public string UserID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserID; - } - } - private string _FirstName = string.Empty; - public string FirstName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _FirstName; - } - } - private string _MiddleName = string.Empty; - public string MiddleName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _MiddleName; - } - } - private string _LastName = string.Empty; - public string LastName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _LastName; - } - } - private string _Suffix = string.Empty; - public string Suffix - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Suffix; - } - } - private string _CourtesyTitle = string.Empty; - public string CourtesyTitle - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _CourtesyTitle; - } - } - private string _PhoneNumber = string.Empty; - public string PhoneNumber - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _PhoneNumber; - } - } - private string _CFGName = string.Empty; - public string CFGName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _CFGName; - } - } - private string _UserLogin = string.Empty; - public string UserLogin - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserLogin; - } - } - private string _UserName = string.Empty; - public string UserName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserName; - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - } - private int _UserMembershipCount = 0; - /// - /// Count of UserMemberships for this User - /// - public int UserMembershipCount - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UserMembershipCount; - } - } - private MembershipInfoList _UserMemberships = null; - [TypeConverter(typeof(MembershipInfoListConverter))] - public MembershipInfoList UserMemberships - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_UserMembershipCount < 0 || (_UserMembershipCount > 0 && _UserMemberships == null)) - _UserMemberships = MembershipInfoList.GetByUID(_UID); - if (_UserMembershipCount < 0) - _UserMembershipCount = _UserMemberships.Count; - return _UserMemberships; - } - } - public void RefreshUserMemberships() - { - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(_UID.ToString())) - foreach (UserInfo tmp in _CacheByPrimaryKey[_UID.ToString()]) - tmp._UserMembershipCount = -1; // This will cause the data to be requeried - } - // TODO: Replace base UserInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current UserInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check UserInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current UserInfo - protected override object GetIdValue() - { - return _UID; - } - #endregion - #region Factory Methods - private static int _UserInfoUnique = 0; - private static int UserInfoUnique - { get { return ++_UserInfoUnique; } } - private int _MyUserInfoUnique = UserInfoUnique; - public int MyUserInfoUnique - { get { return _MyUserInfoUnique; } } - protected UserInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(UID.ToString())) return; - List listUserInfo = _CacheByPrimaryKey[UID.ToString()]; // Get the list of items - while (listUserInfo.Contains(this)) listUserInfo.Remove(this); // Remove the item from the list - if (listUserInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(UID.ToString()); // remove the list - } - public virtual User Get() - { - return _Editable = User.Get(_UID); - } - public static void Refresh(User tmp) - { - string key = tmp.UID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (UserInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(User tmp) - { - _UserID = tmp.UserID; - _FirstName = tmp.FirstName; - _MiddleName = tmp.MiddleName; - _LastName = tmp.LastName; - _Suffix = tmp.Suffix; - _CourtesyTitle = tmp.CourtesyTitle; - _PhoneNumber = tmp.PhoneNumber; - _CFGName = tmp.CFGName; - _UserLogin = tmp.UserLogin; - _UserName = tmp.UserName; - _Config = tmp.Config; - _DTS = tmp.DTS; - _UsrID = tmp.UsrID; - _UserInfoExtension.Refresh(this); - OnChange();// raise an event - } - public static UserInfo Get(int uid) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a User"); - try - { - UserInfo tmp = GetCachedByPrimaryKey(uid); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(uid)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up UserInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on UserInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal UserInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] UserInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("UserInfo.Constructor", ex); - throw new DbCslaException("UserInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _UID; - public int UID - { get { return _UID; } } - public PKCriteria(int uid) - { - _UID = uid; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] UserInfo.ReadData", GetHashCode()); - try - { - _UID = dr.GetInt32("UID"); - _UserID = dr.GetString("UserID"); - _FirstName = dr.GetString("FirstName"); - _MiddleName = dr.GetString("MiddleName"); - _LastName = dr.GetString("LastName"); - _Suffix = dr.GetString("Suffix"); - _CourtesyTitle = dr.GetString("CourtesyTitle"); - _PhoneNumber = dr.GetString("PhoneNumber"); - _CFGName = dr.GetString("CFGName"); - _UserLogin = dr.GetString("UserLogin"); - _UserName = dr.GetString("UserName"); - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - _UserMembershipCount = dr.GetInt32("MembershipCount"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("UserInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("UserInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] UserInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getUser"; - cm.Parameters.AddWithValue("@UID", criteria.UID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("UserInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("UserInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - UserInfoExtension _UserInfoExtension = new UserInfoExtension(); - [Serializable()] - partial class UserInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(UserInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class UserInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is UserInfo) - { - // Return the ToString value - return ((UserInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/UserInfoList.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/UserInfoList.cs deleted file mode 100644 index fb63966c..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/UserInfoList.cs +++ /dev/null @@ -1,198 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - /// - /// UserInfoList Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(UserInfoListConverter))] - public partial class UserInfoList : ReadOnlyListBase, ICustomTypeDescriptor, IDisposable - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - internal new IList Items - { get { return base.Items; } } - public void AddEvents() - { - foreach (UserInfo tmp in this) - { - tmp.Changed += new UserInfoEvent(tmp_Changed); - } - } - void tmp_Changed(object sender) - { - for (int i = 0; i < Count; i++) - { - if (base[i] == sender) - this.OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, i)); - } - } - public void Dispose() - { - foreach (UserInfo tmp in this) - { - tmp.Changed -= new UserInfoEvent(tmp_Changed); - } - } - #endregion - #region Factory Methods - public static UserInfoList _UserInfoList = null; - /// - /// Return a list of all projects. - /// - public static UserInfoList Get() - { - try - { - if (_UserInfoList != null) - return _UserInfoList; - UserInfoList tmp = DataPortal.Fetch(); - UserInfo.AddList(tmp); - tmp.AddEvents(); - _UserInfoList = tmp; - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on UserInfoList.Get", ex); - } - } - // TODO: Add alternative gets - - //public static UserInfoList Get() - //{ - // try - // { - // return DataPortal.Fetch(new FilteredCriteria()); - // } - // catch (Exception ex) - // { - // throw new DbCslaException("Error on UserInfoList.Get", ex); - // } - //} - private UserInfoList() - { /* require use of factory methods */ } - #endregion - #region Data Access Portal - private void DataPortal_Fetch() - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] UserInfoList.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getUsers"; - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - IsReadOnly = false; - while (dr.Read()) this.Add(new UserInfo(dr)); - IsReadOnly = true; - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("UserInfoList.DataPortal_Fetch", ex); - throw new DbCslaException("UserInfoList.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - UserInfoListPropertyDescriptor pd = new UserInfoListPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class UserInfoListPropertyDescriptor : vlnListPropertyDescriptor - { - private UserInfo Item { get { return (UserInfo)_Item; } } - public UserInfoListPropertyDescriptor(UserInfoList collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class UserInfoListConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is UserInfoList) - { - // Return department and department role separated by comma. - return ((UserInfoList)value).Items.Count.ToString() + " Users"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/UserMembership.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/UserMembership.cs deleted file mode 100644 index efcb755c..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/UserMembership.cs +++ /dev/null @@ -1,612 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// UserMembership Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(UserMembershipConverter))] - public partial class UserMembership : BusinessBase, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _UGID; - [System.ComponentModel.DataObjectField(true, true)] - public int UGID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyMembership != null) _UGID = _MyMembership.UGID; - return _UGID; - } - } - private Membership _MyMembership; - [System.ComponentModel.DataObjectField(true, true)] - public Membership MyMembership - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyMembership == null && _UGID != 0) _MyMembership = Membership.Get(_UGID); - return _MyMembership; - } - } - private int _GID; - public int GID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyGroup != null) _GID = _MyGroup.GID; - return _GID; - } - } - private Group _MyGroup; - public Group MyGroup - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyGroup == null && _GID != 0) _MyGroup = Group.Get(_GID); - return _MyGroup; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_MyGroup != value) - { - _MyGroup = value; - PropertyHasChanged(); - } - } - } - private string _StartDate = string.Empty; - public string StartDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _StartDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _StartDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_StartDate != tmp.ToString()) - { - _StartDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private string _EndDate = string.Empty; - public string EndDate - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _EndDate; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - _EndDate = value; - try - { - SmartDate tmp = new SmartDate(value); - if (_EndDate != tmp.ToString()) - { - _EndDate = tmp.ToString(); - // TODO: Any Cross Property Validation - } - } - catch - { - } - PropertyHasChanged(); - } - } - private string _Config = string.Empty; - public string Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Config; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Config != value) - { - _Config = value; - PropertyHasChanged(); - } - } - } - private DateTime _DTS = new DateTime(); - public DateTime DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _DTS; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (_DTS != value) - { - _DTS = value; - PropertyHasChanged(); - } - } - } - private string _UsrID = string.Empty; - public string UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _UsrID; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_UsrID != value) - { - _UsrID = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - private string _Group_GroupName = string.Empty; - public string Group_GroupName - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Group_GroupName; - } - } - private int? _Group_GroupType; - public int? Group_GroupType - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Group_GroupType; - } - } - private string _Group_Config = string.Empty; - public string Group_Config - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Group_Config; - } - } - private DateTime _Group_DTS = new DateTime(); - public DateTime Group_DTS - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Group_DTS; - } - } - private string _Group_UsrID = string.Empty; - public string Group_UsrID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Group_UsrID; - } - } - // TODO: Check UserMembership.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current UserMembership - protected override object GetIdValue() - { - return _UGID; - } - // TODO: Replace base UserMembership.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current UserMembership - //public override string ToString() - //{ - // return base.ToString(); - //} - public override bool IsDirty - { - get { return base.IsDirty || (_MyGroup == null ? false : _MyGroup.IsDirty); } - } - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid) && (_MyGroup == null ? true : _MyGroup.IsValid); } - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if (BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - if (_MyGroup != null && (hasBrokenRules = _MyGroup.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule(MyGroupRequired, "MyGroup"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "StartDate"); - ValidationRules.AddRule(StartDateValid, "StartDate"); - ValidationRules.AddRule(EndDateValid, "EndDate"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Config", 1073741823)); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "UsrID"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("UsrID", 100)); - // TODO: Add other validation rules - } - private static bool StartDateValid(UserMembership target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._StartDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool EndDateValid(UserMembership target, Csla.Validation.RuleArgs e) - { - try - { - DateTime tmp = SmartDate.StringToDate(target._EndDate); - } - catch - { - e.Description = "Invalid Date"; - return false; - } - return true; - } - private static bool MyGroupRequired(UserMembership target, Csla.Validation.RuleArgs e) - { - if (target._GID == 0 && target._MyGroup == null) // Required field missing - { - e.Description = "Required"; - return false; - } - return true; - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(UGID, ""); - //AuthorizationRules.AllowRead(GID, ""); - //AuthorizationRules.AllowWrite(GID, ""); - //AuthorizationRules.AllowRead(StartDate, ""); - //AuthorizationRules.AllowWrite(StartDate, ""); - //AuthorizationRules.AllowRead(EndDate, ""); - //AuthorizationRules.AllowWrite(EndDate, ""); - //AuthorizationRules.AllowRead(Config, ""); - //AuthorizationRules.AllowWrite(Config, ""); - //AuthorizationRules.AllowRead(DTS, ""); - //AuthorizationRules.AllowWrite(DTS, ""); - //AuthorizationRules.AllowRead(UsrID, ""); - //AuthorizationRules.AllowWrite(UsrID, ""); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - internal static UserMembership New(Group myGroup) - { - return new UserMembership(myGroup); - } - internal static UserMembership Get(SafeDataReader dr) - { - return new UserMembership(dr); - } - public UserMembership() - { - MarkAsChild(); - _UGID = Membership.NextUGID; - _StartDate = _UserMembershipExtension.DefaultStartDate; - _DTS = _UserMembershipExtension.DefaultDTS; - _UsrID = _UserMembershipExtension.DefaultUsrID; - ValidationRules.CheckRules(); - } - private UserMembership(Group myGroup) - { - MarkAsChild(); - // TODO: Add any initialization & defaults - _StartDate = _UserMembershipExtension.DefaultStartDate; - _DTS = _UserMembershipExtension.DefaultDTS; - _UsrID = _UserMembershipExtension.DefaultUsrID; - _MyGroup = myGroup; - ValidationRules.CheckRules(); - } - internal UserMembership(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - private void Fetch(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] UserMembership.FetchDR", GetHashCode()); - try - { - _UGID = dr.GetInt32("UGID"); - _GID = dr.GetInt32("GID"); - _StartDate = dr.GetSmartDate("StartDate").Text; - _EndDate = dr.GetSmartDate("EndDate").Text; - _Config = dr.GetString("Config"); - _DTS = dr.GetDateTime("DTS"); - _UsrID = dr.GetString("UsrID"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - _Group_GroupName = dr.GetString("Group_GroupName"); - _Group_GroupType = (int?)dr.GetValue("Group_GroupType"); - _Group_Config = dr.GetString("Group_Config"); - _Group_DTS = dr.GetDateTime("Group_DTS"); - _Group_UsrID = dr.GetString("Group_UsrID"); - } - catch (Exception ex) // FKItem Fetch - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("UserMembership.FetchDR", ex); - throw new DbCslaException("UserMembership.Fetch", ex); - } - MarkOld(); - } - internal void Insert(User myUser) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Membership.Add(cn, ref _UGID, myUser, _MyGroup, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID); - MarkOld(); - } - internal void Update(User myUser) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - _LastChanged = Membership.Update(cn, ref _UGID, myUser, _MyGroup, new SmartDate(_StartDate), new SmartDate(_EndDate), _Config, _DTS, _UsrID, ref _LastChanged); - MarkOld(); - } - internal void DeleteSelf(User myUser) - { - // if we're not dirty then don't update the database - if (!this.IsDirty) return; - // if we're new then don't update the database - if (this.IsNew) return; - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - Membership.Remove(cn, _UGID); - MarkNew(); - } - #endregion - // Standard Default Code - #region extension - UserMembershipExtension _UserMembershipExtension = new UserMembershipExtension(); - [Serializable()] - partial class UserMembershipExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - public virtual string DefaultStartDate - { - get { return DateTime.Now.ToShortDateString(); } - } - public virtual DateTime DefaultDTS - { - get { return DateTime.Now; } - } - public virtual string DefaultUsrID - { - get { return Environment.UserName.ToUpper(); } - } - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class UserMembershipConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is UserMembership) - { - // Return the ToString value - return ((UserMembership)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create UserMembershipExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class UserMembership -// { -// partial class UserMembershipExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public virtual SmartDate DefaultStartDate -// { -// get { return DateTime.Now.ToShortDateString(); } -// } -// public virtual DateTime DefaultDTS -// { -// get { return DateTime.Now; } -// } -// public virtual string DefaultUsrID -// { -// get { return Environment.UserName.ToUpper(); } -// } -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/UserMemberships.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/UserMemberships.cs deleted file mode 100644 index 3b80a2b0..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/UserMemberships.cs +++ /dev/null @@ -1,290 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// UserMemberships Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(UserMembershipsConverter))] - public partial class UserMemberships : BusinessListBase, ICustomTypeDescriptor, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - // One To Many - public UserMembership this[Membership myMembership] - { - get - { - foreach (UserMembership membership in this) - if (membership.UGID == myMembership.UGID) - return membership; - return null; - } - } - public new System.Collections.Generic.IList Items - { - get { return base.Items; } - } - public UserMembership GetItem(Membership myMembership) - { - foreach (UserMembership membership in this) - if (membership.UGID == myMembership.UGID) - return membership; - return null; - } - public UserMembership Add(Group myGroup) // One to Many - { - UserMembership membership = UserMembership.New(myGroup); - this.Add(membership); - return membership; - } - public void Remove(Membership myMembership) - { - foreach (UserMembership membership in this) - { - if (membership.UGID == myMembership.UGID) - { - Remove(membership); - break; - } - } - } - public bool Contains(Membership myMembership) - { - foreach (UserMembership membership in this) - if (membership.UGID == myMembership.UGID) - return true; - return false; - } - public bool ContainsDeleted(Membership myMembership) - { - foreach (UserMembership membership in DeletedList) - if (membership.UGID == myMembership.UGID) - return true; - return false; - } - #endregion - #region ValidationRules - public IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - foreach (UserMembership userMembership in this) - if ((hasBrokenRules = userMembership.HasBrokenRules) != null) return hasBrokenRules; - return hasBrokenRules; - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - #endregion - #region Factory Methods - internal static UserMemberships New() - { - return new UserMemberships(); - } - internal static UserMemberships Get(SafeDataReader dr) - { - return new UserMemberships(dr); - } - public static UserMemberships GetByUID(int uid) - { - try - { - return DataPortal.Fetch(new UIDCriteria(uid)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on UserMemberships.GetByUID", ex); - } - } - private UserMemberships() - { - MarkAsChild(); - } - internal UserMemberships(SafeDataReader dr) - { - MarkAsChild(); - Fetch(dr); - } - #endregion - #region Data Access Portal - // called to load data from the database - private void Fetch(SafeDataReader dr) - { - this.RaiseListChangedEvents = false; - while (dr.Read()) - this.Add(UserMembership.Get(dr)); - this.RaiseListChangedEvents = true; - } - [Serializable()] - private class UIDCriteria - { - public UIDCriteria(int uid) - { - _UID = uid; - } - private int _UID; - public int UID - { - get { return _UID; } - set { _UID = value; } - } - } - private void DataPortal_Fetch(UIDCriteria criteria) - { - this.RaiseListChangedEvents = false; - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] UserMemberships.DataPortal_FetchUID", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getMembershipsByUID"; - cm.Parameters.AddWithValue("@UID", criteria.UID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - while (dr.Read()) this.Add(new UserMembership(dr)); - } - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("UserMemberships.DataPortal_FetchUID", ex); - throw new DbCslaException("UserMemberships.DataPortal_Fetch", ex); - } - this.RaiseListChangedEvents = true; - } - internal void Update(User user) - { - this.RaiseListChangedEvents = false; - try - { - // update (thus deleting) any deleted child objects - foreach (UserMembership obj in DeletedList) - obj.DeleteSelf(user);// Deletes related record - // now that they are deleted, remove them from memory too - DeletedList.Clear(); - // add/update any current child objects - foreach (UserMembership obj in this) - { - if (obj.IsNew) - obj.Insert(user); - else - obj.Update(user); - } - } - finally - { - this.RaiseListChangedEvents = true; - } - } - #endregion - #region ICustomTypeDescriptor impl - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - /// - /// Called to get the properties of this type. Returns properties with certain - /// attributes. this restriction is not implemented here. - /// - /// - /// - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - /// - /// Called to get the properties of this type. - /// - /// - public PropertyDescriptorCollection GetProperties() - { - // Create a collection object to hold property descriptors - PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - for (int i = 0; i < this.Items.Count; i++) - { - // Create a property descriptor for the item and add to the property descriptor collection - UserMembershipsPropertyDescriptor pd = new UserMembershipsPropertyDescriptor(this, i); - pds.Add(pd); - } - // return the property descriptor collection - return pds; - } - #endregion - } // Class - #region Property Descriptor - /// - /// Summary description for CollectionPropertyDescriptor. - /// - public partial class UserMembershipsPropertyDescriptor : vlnListPropertyDescriptor - { - private UserMembership Item { get { return (UserMembership)_Item; } } - public UserMembershipsPropertyDescriptor(UserMemberships collection, int index) : base(collection, index) { ;} - } - #endregion - #region Converter - internal class UserMembershipsConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is UserMemberships) - { - // Return department and department role separated by comma. - return ((UserMemberships)value).Items.Count.ToString() + " Memberships"; - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ZContent.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ZContent.cs deleted file mode 100644 index c8e38d85..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ZContent.cs +++ /dev/null @@ -1,857 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ZContent Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ZContentConverter))] - public partial class ZContent : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshZContents = new List(); - private void AddToRefreshList(List refreshZContents) - { - if (IsDirty) - refreshZContents.Add(this); - } - private void BuildRefreshList() - { - _RefreshZContents = new List(); - AddToRefreshList(_RefreshZContents); - } - private void ProcessRefreshList() - { - foreach (ZContent tmp in _RefreshZContents) - { - ZContentInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(ZContent zContent) - { - if (!_CacheList.Contains(zContent)) _CacheList.Add(zContent); // In AddToCache - } - protected static void RemoveFromCache(ZContent zContent) - { - while (_CacheList.Contains(zContent)) _CacheList.Remove(zContent); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (ZContent tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ContentID.ToString())) - { - _CacheByPrimaryKey[tmp.ContentID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ContentID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (ZContent tmp in remove) - RemoveFromCache(tmp); - } - protected static ZContent GetCachedByPrimaryKey(int contentID) - { - ConvertListToDictionary(); - string key = contentID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _ContentID; - [System.ComponentModel.DataObjectField(true, true)] - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _ContentID = _MyContent.ContentID; - return _ContentID; - } - } - private Content _MyContent; - [System.ComponentModel.DataObjectField(true, true)] - public Content MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _ContentID != 0) _MyContent = Content.Get(_ContentID); - return _MyContent; - } - } - private string _OldStepSequence = string.Empty; - public string OldStepSequence - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _OldStepSequence; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_OldStepSequence != value) - { - _OldStepSequence = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid); } - } - // TODO: Replace base ZContent.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ZContent - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check ZContent.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ZContent - protected override object GetIdValue() - { - return _ContentID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "OldStepSequence"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("OldStepSequence", 32)); - //ValidationRules.AddDependantProperty("x", "y"); - _ZContentExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _ZContentExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(ContentID, ""); - //AuthorizationRules.AllowRead(OldStepSequence, ""); - //AuthorizationRules.AllowWrite(OldStepSequence, ""); - _ZContentExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _ZContentExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _ZContentUnique = 0; - protected static int ZContentUnique - { get { return ++_ZContentUnique; } } - private int _MyZContentUnique = ZContentUnique; - public int MyZContentUnique - { get { return _MyZContentUnique; } } - protected ZContent() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(ContentID.ToString())) - { - List listZContent = _CacheByPrimaryKey[ContentID.ToString()]; // Get the list of items - while (listZContent.Contains(this)) listZContent.Remove(this); // Remove the item from the list - if (listZContent.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(ContentID.ToString()); // remove the list - } - } - public static ZContent New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a ZContent"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ZContent.New", ex); - } - } - public static ZContent New(Content myContent, string oldStepSequence) - { - ZContent tmp = ZContent.New(); - tmp._MyContent = myContent; - tmp.OldStepSequence = oldStepSequence; - return tmp; - } - public static ZContent MakeZContent(Content myContent, string oldStepSequence) - { - ZContent tmp = ZContent.New(myContent, oldStepSequence); - if (tmp.IsSavable) - { - ZContent tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static ZContent New(Content myContent) - { - ZContent tmp = ZContent.New(); - tmp._MyContent = myContent; - tmp.MarkClean(); - tmp.MarkAsChild(); - return tmp; - } - public static ZContent Get(int contentID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a ZContent"); - try - { - ZContent tmp = GetCachedByPrimaryKey(contentID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(contentID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ZContent - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ZContent.Get", ex); - } - } - public static ZContent Get(SafeDataReader dr) - { - if (dr.Read()) return new ZContent(dr); - return null; - } - internal ZContent(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int contentID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a ZContent"); - try - { - DataPortal.Delete(new PKCriteria(contentID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ZContent.Delete", ex); - } - } - public override ZContent Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a ZContent"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a ZContent"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a ZContent"); - try - { - BuildRefreshList(); - ZContent zContent = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(zContent);//Refresh the item in AllList - ProcessRefreshList(); - return zContent; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _ContentID; - public int ContentID - { get { return _ContentID; } } - public PKCriteria(int contentID) - { - _ContentID = contentID; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - - // Database Defaults - - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZContent.ReadData", GetHashCode()); - try - { - _ContentID = dr.GetInt32("ContentID"); - _OldStepSequence = dr.GetString("OldStepSequence"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZContent.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ZContent.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZContent.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getZContent"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZContent.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ZContent.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZContent.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ZContent.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZContent.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addZContent"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", ContentID); - cm.Parameters.AddWithValue("@OldStepSequence", _OldStepSequence); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZContent.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZContent.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ZContent.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, Content myContent, string oldStepSequence) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZContent.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addZContent"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", myContent.ContentID); - cm.Parameters.AddWithValue("@OldStepSequence", oldStepSequence); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZContent.Add", ex); - throw new DbCslaException("ZContent.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZContent.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZContent.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZContent.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateZContent"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@ContentID", ContentID); - cm.Parameters.AddWithValue("@OldStepSequence", _OldStepSequence); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZContent.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update(Content content) - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = ZContent.Add(cn, content, _OldStepSequence); - else - _LastChanged = ZContent.Update(cn, content, _OldStepSequence, ref _LastChanged); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, Content myContent, string oldStepSequence, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZContent.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateZContent"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@ContentID", myContent.ContentID); - cm.Parameters.AddWithValue("@OldStepSequence", oldStepSequence); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZContent.Update", ex); - throw new DbCslaException("ZContent.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_ContentID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZContent.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteZContent"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZContent.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ZContent.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int contentID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZContent.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteZContent"; - // Input PK Fields - cm.Parameters.AddWithValue("@ContentID", contentID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZContent.Remove", ex); - throw new DbCslaException("ZContent.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int contentID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(contentID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ZContent.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _ContentID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int contentID) - { - _ContentID = contentID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZContent.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsZContent"; - cm.Parameters.AddWithValue("@ContentID", _ContentID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZContent.DataPortal_Execute", ex); - throw new DbCslaException("ZContent.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - ZContentExtension _ZContentExtension = new ZContentExtension(); - [Serializable()] - partial class ZContentExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ZContentConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ZContent) - { - // Return the ToString value - return ((ZContent)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ZContentExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ZContent -// { -// partial class ZContentExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ZContentInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ZContentInfo.cs deleted file mode 100644 index 3603bdba..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ZContentInfo.cs +++ /dev/null @@ -1,310 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void ZContentInfoEvent(object sender); - /// - /// ZContentInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ZContentInfoConverter))] - public partial class ZContentInfo : ReadOnlyBase, IDisposable - { - public event ZContentInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(ZContentInfo zContentInfo) - { - if (!_CacheList.Contains(zContentInfo)) _CacheList.Add(zContentInfo); // In AddToCache - } - protected static void RemoveFromCache(ZContentInfo zContentInfo) - { - while (_CacheList.Contains(zContentInfo)) _CacheList.Remove(zContentInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (ZContentInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.ContentID.ToString())) - { - _CacheByPrimaryKey[tmp.ContentID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.ContentID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (ZContentInfo tmp in remove) - RemoveFromCache(tmp); - } - protected static ZContentInfo GetCachedByPrimaryKey(int contentID) - { - ConvertListToDictionary(); - string key = contentID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected ZContent _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _ContentID; - [System.ComponentModel.DataObjectField(true, true)] - public int ContentID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent != null) _ContentID = _MyContent.ContentID; - return _ContentID; - } - } - private ContentInfo _MyContent; - [System.ComponentModel.DataObjectField(true, true)] - public ContentInfo MyContent - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyContent == null && _ContentID != 0) _MyContent = ContentInfo.Get(_ContentID); - return _MyContent; - } - } - private string _OldStepSequence = string.Empty; - public string OldStepSequence - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _OldStepSequence; - } - } - // TODO: Replace base ZContentInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ZContentInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check ZContentInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ZContentInfo - protected override object GetIdValue() - { - return _ContentID; - } - #endregion - #region Factory Methods - private static int _ZContentInfoUnique = 0; - private static int ZContentInfoUnique - { get { return ++_ZContentInfoUnique; } } - private int _MyZContentInfoUnique = ZContentInfoUnique; - public int MyZContentInfoUnique - { get { return _MyZContentInfoUnique; } } - protected ZContentInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(ContentID.ToString())) return; - List listZContentInfo = _CacheByPrimaryKey[ContentID.ToString()]; // Get the list of items - while (listZContentInfo.Contains(this)) listZContentInfo.Remove(this); // Remove the item from the list - if (listZContentInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(ContentID.ToString()); // remove the list - } - public virtual ZContent Get() - { - return _Editable = ZContent.Get(_ContentID); - } - public static void Refresh(ZContent tmp) - { - string key = tmp.ContentID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ZContentInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ZContent tmp) - { - _OldStepSequence = tmp.OldStepSequence; - _ZContentInfoExtension.Refresh(this); - if (_MyContent != null) - { - _MyContent.Dispose();// Dispose related value - _MyContent = null;// Reset related value - } - OnChange();// raise an event - } - public static ZContentInfo Get(int contentID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a ZContent"); - try - { - ZContentInfo tmp = GetCachedByPrimaryKey(contentID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(contentID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ZContentInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ZContentInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal ZContentInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZContentInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZContentInfo.Constructor", ex); - throw new DbCslaException("ZContentInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _ContentID; - public int ContentID - { get { return _ContentID; } } - public PKCriteria(int contentID) - { - _ContentID = contentID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZContentInfo.ReadData", GetHashCode()); - try - { - _ContentID = dr.GetInt32("ContentID"); - _OldStepSequence = dr.GetString("OldStepSequence"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZContentInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ZContentInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZContentInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getZContent"; - cm.Parameters.AddWithValue("@ContentID", criteria.ContentID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZContentInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ZContentInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - ZContentInfoExtension _ZContentInfoExtension = new ZContentInfoExtension(); - [Serializable()] - partial class ZContentInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(ZContentInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class ZContentInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ZContentInfo) - { - // Return the ToString value - return ((ZContentInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ZTransition.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ZTransition.cs deleted file mode 100644 index df5ac8a6..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ZTransition.cs +++ /dev/null @@ -1,857 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -using Csla.Validation; -namespace VEPROMS.CSLA.Library -{ - /// - /// ZTransition Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ZTransitionConverter))] - public partial class ZTransition : BusinessBase, IDisposable, IVEHasBrokenRules - { - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Refresh - private List _RefreshZTransitions = new List(); - private void AddToRefreshList(List refreshZTransitions) - { - if (IsDirty) - refreshZTransitions.Add(this); - } - private void BuildRefreshList() - { - _RefreshZTransitions = new List(); - AddToRefreshList(_RefreshZTransitions); - } - private void ProcessRefreshList() - { - foreach (ZTransition tmp in _RefreshZTransitions) - { - ZTransitionInfo.Refresh(tmp); - } - } - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(ZTransition zTransition) - { - if (!_CacheList.Contains(zTransition)) _CacheList.Add(zTransition); // In AddToCache - } - protected static void RemoveFromCache(ZTransition zTransition) - { - while (_CacheList.Contains(zTransition)) _CacheList.Remove(zTransition); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (ZTransition tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.TransitionID.ToString())) - { - _CacheByPrimaryKey[tmp.TransitionID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.TransitionID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (ZTransition tmp in remove) - RemoveFromCache(tmp); - } - protected static ZTransition GetCachedByPrimaryKey(int transitionID) - { - ConvertListToDictionary(); - string key = transitionID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - private int _TransitionID; - [System.ComponentModel.DataObjectField(true, true)] - public int TransitionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyTransition != null) _TransitionID = _MyTransition.TransitionID; - return _TransitionID; - } - } - private Transition _MyTransition; - [System.ComponentModel.DataObjectField(true, true)] - public Transition MyTransition - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyTransition == null && _TransitionID != 0) _MyTransition = Transition.Get(_TransitionID); - return _MyTransition; - } - } - private string _Oldto = string.Empty; - public string Oldto - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Oldto; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - set - { - if (value == null) value = string.Empty; - if (_Oldto != value) - { - _Oldto = value; - PropertyHasChanged(); - } - } - } - private byte[] _LastChanged = new byte[8];//timestamp - public override bool IsValid - { - get { return (IsNew && !IsDirty ? true : base.IsValid); } - } - // TODO: Replace base ZTransition.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ZTransition - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check ZTransition.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ZTransition - protected override object GetIdValue() - { - return _TransitionID; - } - #endregion - #region ValidationRules - [NonSerialized] - private bool _CheckingBrokenRules = false; - public IVEHasBrokenRules HasBrokenRules - { - get - { - if (_CheckingBrokenRules) return null; - if ((IsDirty || !IsNew) && BrokenRulesCollection.Count > 0) return this; - try - { - _CheckingBrokenRules = true; - IVEHasBrokenRules hasBrokenRules = null; - return hasBrokenRules; - } - finally - { - _CheckingBrokenRules = false; - } - } - } - public BrokenRulesCollection BrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = HasBrokenRules; - if (this.Equals(hasBrokenRules)) return BrokenRulesCollection; - return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null); - } - } - protected override void AddBusinessRules() - { - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringRequired, "Oldto"); - ValidationRules.AddRule( - Csla.Validation.CommonRules.StringMaxLength, - new Csla.Validation.CommonRules.MaxLengthRuleArgs("Oldto", 32)); - //ValidationRules.AddDependantProperty("x", "y"); - _ZTransitionExtension.AddValidationRules(ValidationRules); - // TODO: Add other validation rules - } - protected override void AddInstanceBusinessRules() - { - _ZTransitionExtension.AddInstanceValidationRules(ValidationRules); - // TODO: Add other validation rules - } - // Sample data comparison validation rule - //private bool StartDateGTEndDate(object target, Csla.Validation.RuleArgs e) - //{ - // if (_started > _ended) - // { - // e.Description = "Start date can't be after end date"; - // return false; - // } - // else - // return true; - //} - #endregion - #region Authorization Rules - protected override void AddAuthorizationRules() - { - //TODO: Who can read/write which fields - //AuthorizationRules.AllowRead(TransitionID, ""); - //AuthorizationRules.AllowRead(Oldto, ""); - //AuthorizationRules.AllowWrite(Oldto, ""); - _ZTransitionExtension.AddAuthorizationRules(AuthorizationRules); - } - protected override void AddInstanceAuthorizationRules() - { - //TODO: Who can read/write which fields - _ZTransitionExtension.AddInstanceAuthorizationRules(AuthorizationRules); - } - public static bool CanAddObject() - { - // TODO: Can Add Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - public static bool CanGetObject() - { - // TODO: CanGet Authorization - return true; - } - public static bool CanDeleteObject() - { - // TODO: CanDelete Authorization - //bool result = false; - //if (Csla.ApplicationContext.User.IsInRole("ProjectManager"))result = true; - //if (Csla.ApplicationContext.User.IsInRole("Administrator"))result = true; - //return result; - return true; - } - public static bool CanEditObject() - { - // TODO: CanEdit Authorization - //return Csla.ApplicationContext.User.IsInRole("ProjectManager"); - return true; - } - #endregion - #region Factory Methods - public int CurrentEditLevel - { get { return EditLevel; } } - private static int _ZTransitionUnique = 0; - protected static int ZTransitionUnique - { get { return ++_ZTransitionUnique; } } - private int _MyZTransitionUnique = ZTransitionUnique; - public int MyZTransitionUnique - { get { return _MyZTransitionUnique; } } - protected ZTransition() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromDictionaries(); - } - private void RemoveFromDictionaries() - { - RemoveFromCache(this); - if (_CacheByPrimaryKey.ContainsKey(TransitionID.ToString())) - { - List listZTransition = _CacheByPrimaryKey[TransitionID.ToString()]; // Get the list of items - while (listZTransition.Contains(this)) listZTransition.Remove(this); // Remove the item from the list - if (listZTransition.Count == 0) //If there are no items left in the list - _CacheByPrimaryKey.Remove(TransitionID.ToString()); // remove the list - } - } - public static ZTransition New() - { - if (!CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a ZTransition"); - try - { - return DataPortal.Create(); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ZTransition.New", ex); - } - } - public static ZTransition New(Transition myTransition, string oldto) - { - ZTransition tmp = ZTransition.New(); - tmp._MyTransition = myTransition; - tmp.Oldto = oldto; - return tmp; - } - public static ZTransition MakeZTransition(Transition myTransition, string oldto) - { - ZTransition tmp = ZTransition.New(myTransition, oldto); - if (tmp.IsSavable) - { - ZTransition tmp2 = tmp; - tmp = tmp2.Save(); - tmp2.Dispose(); - } - else - { - Csla.Validation.BrokenRulesCollection brc = tmp.ValidationRules.GetBrokenRules(); - tmp._ErrorMessage = "Failed Validation:"; - foreach (Csla.Validation.BrokenRule br in brc) - { - tmp._ErrorMessage += "\r\n\tFailure: " + br.RuleName; - } - } - return tmp; - } - public static ZTransition New(Transition myTransition) - { - ZTransition tmp = ZTransition.New(); - tmp._MyTransition = myTransition; - tmp.MarkClean(); - tmp.MarkAsChild(); - return tmp; - } - public static ZTransition Get(int transitionID) - { - if (!CanGetObject()) - throw new System.Security.SecurityException("User not authorized to view a ZTransition"); - try - { - ZTransition tmp = GetCachedByPrimaryKey(transitionID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(transitionID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ZTransition - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ZTransition.Get", ex); - } - } - public static ZTransition Get(SafeDataReader dr) - { - if (dr.Read()) return new ZTransition(dr); - return null; - } - internal ZTransition(SafeDataReader dr) - { - ReadData(dr); - } - public static void Delete(int transitionID) - { - if (!CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a ZTransition"); - try - { - DataPortal.Delete(new PKCriteria(transitionID)); - } - catch (Exception ex) - { - throw new DbCslaException("Error on ZTransition.Delete", ex); - } - } - public override ZTransition Save() - { - if (IsDeleted && !CanDeleteObject()) - throw new System.Security.SecurityException("User not authorized to remove a ZTransition"); - else if (IsNew && !CanAddObject()) - throw new System.Security.SecurityException("User not authorized to add a ZTransition"); - else if (!CanEditObject()) - throw new System.Security.SecurityException("User not authorized to update a ZTransition"); - try - { - BuildRefreshList(); - ZTransition zTransition = base.Save(); - RemoveFromDictionaries(); // if save is successful remove the previous Folder from the cache - AddToCache(zTransition);//Refresh the item in AllList - ProcessRefreshList(); - return zTransition; - } - catch (Exception ex) - { - throw new DbCslaException("Error on CSLA Save", ex); - } - } - #endregion - #region Data Access Portal - [Serializable()] - protected class PKCriteria - { - private int _TransitionID; - public int TransitionID - { get { return _TransitionID; } } - public PKCriteria(int transitionID) - { - _TransitionID = transitionID; - } - } - // TODO: If Create needs to access DB - It should not be marked RunLocal - [RunLocal()] - private new void DataPortal_Create() - { - - // Database Defaults - - // TODO: Add any defaults that are necessary - ValidationRules.CheckRules(); - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZTransition.ReadData", GetHashCode()); - try - { - _TransitionID = dr.GetInt32("TransitionID"); - _Oldto = dr.GetString("oldto"); - dr.GetBytes("LastChanged", 0, _LastChanged, 0, 8); - MarkOld(); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZTransition.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ZTransition.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZTransition.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getZTransition"; - cm.Parameters.AddWithValue("@TransitionID", criteria.TransitionID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZTransition.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ZTransition.DataPortal_Fetch", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Insert() - { - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLInsert(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZTransition.DataPortal_Insert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ZTransition.DataPortal_Insert", ex); - } - finally - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZTransition.DataPortal_Insert", GetHashCode()); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLInsert() - { - if (!this.IsDirty) return; - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addZTransition"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@TransitionID", TransitionID); - cm.Parameters.AddWithValue("@Oldto", _Oldto); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - MarkOld(); - // update child objects - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZTransition.SQLInsert", GetHashCode()); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZTransition.SQLInsert", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ZTransition.SQLInsert", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Add(SqlConnection cn, Transition myTransition, string oldto) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZTransition.Add", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "addZTransition"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@TransitionID", myTransition.TransitionID); - cm.Parameters.AddWithValue("@Oldto", oldto); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZTransition.Add", ex); - throw new DbCslaException("ZTransition.Add", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_Update() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZTransition.DataPortal_Update", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - SQLUpdate(); - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZTransition.DataPortal_Update", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - [Transactional(TransactionalTypes.TransactionScope)] - internal void SQLUpdate() - { - if (!IsDirty) return; // If not dirty - nothing to do - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZTransition.SQLUpdate", GetHashCode()); - try - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (base.IsDirty) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateZTransition"; - // All Fields including Calculated Fields - cm.Parameters.AddWithValue("@TransitionID", TransitionID); - cm.Parameters.AddWithValue("@Oldto", _Oldto); - cm.Parameters.AddWithValue("@LastChanged", _LastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - _LastChanged = (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - MarkOld(); - // use the open connection to update child objects - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZTransition.SQLUpdate", ex); - _ErrorMessage = ex.Message; - if (!ex.Message.EndsWith("has been edited by another user.")) throw ex; - } - } - internal void Update(Transition transition) - { - if (!this.IsDirty) return; - if (base.IsDirty) - { - SqlConnection cn = (SqlConnection)ApplicationContext.LocalContext["cn"]; - if (IsNew) - _LastChanged = ZTransition.Add(cn, transition, _Oldto); - else - _LastChanged = ZTransition.Update(cn, transition, _Oldto, ref _LastChanged); - MarkOld(); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static byte[] Update(SqlConnection cn, Transition myTransition, string oldto, ref byte[] lastChanged) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZTransition.Update", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "updateZTransition"; - // Input All Fields - Except Calculated Columns - cm.Parameters.AddWithValue("@TransitionID", myTransition.TransitionID); - cm.Parameters.AddWithValue("@Oldto", oldto); - cm.Parameters.AddWithValue("@LastChanged", lastChanged); - // Output Calculated Columns - SqlParameter param_LastChanged = new SqlParameter("@newLastChanged", SqlDbType.Timestamp); - param_LastChanged.Direction = ParameterDirection.Output; - cm.Parameters.Add(param_LastChanged); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - // Save all values being returned from the Procedure - return (byte[])cm.Parameters["@newLastChanged"].Value; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZTransition.Update", ex); - throw new DbCslaException("ZTransition.Update", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - protected override void DataPortal_DeleteSelf() - { - DataPortal_Delete(new PKCriteria(_TransitionID)); - } - [Transactional(TransactionalTypes.TransactionScope)] - private void DataPortal_Delete(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZTransition.DataPortal_Delete", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteZTransition"; - cm.Parameters.AddWithValue("@TransitionID", criteria.TransitionID); - cm.ExecuteNonQuery(); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZTransition.DataPortal_Delete", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ZTransition.DataPortal_Delete", ex); - } - } - [Transactional(TransactionalTypes.TransactionScope)] - public static void Remove(SqlConnection cn, int transitionID) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZTransition.Remove", 0); - try - { - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "deleteZTransition"; - // Input PK Fields - cm.Parameters.AddWithValue("@TransitionID", transitionID); - // TODO: Define any additional output parameters - cm.ExecuteNonQuery(); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZTransition.Remove", ex); - throw new DbCslaException("ZTransition.Remove", ex); - } - } - #endregion - #region Exists - public static bool Exists(int transitionID) - { - ExistsCommand result; - try - { - result = DataPortal.Execute(new ExistsCommand(transitionID)); - return result.Exists; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ZTransition.Exists", ex); - } - } - [Serializable()] - private class ExistsCommand : CommandBase - { - private int _TransitionID; - private bool _exists; - public bool Exists - { - get { return _exists; } - } - public ExistsCommand(int transitionID) - { - _TransitionID = transitionID; - } - protected override void DataPortal_Execute() - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZTransition.DataPortal_Execute", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - cn.Open(); - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "existsZTransition"; - cm.Parameters.AddWithValue("@TransitionID", _TransitionID); - int count = (int)cm.ExecuteScalar(); - _exists = (count > 0); - } - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZTransition.DataPortal_Execute", ex); - throw new DbCslaException("ZTransition.DataPortal_Execute", ex); - } - } - } - #endregion - // Standard Default Code - #region extension - ZTransitionExtension _ZTransitionExtension = new ZTransitionExtension(); - [Serializable()] - partial class ZTransitionExtension : extensionBase - { - } - [Serializable()] - class extensionBase - { - // Default Values - // Authorization Rules - public virtual void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Instance Authorization Rules - public virtual void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) - { - // Needs to be overriden to add new authorization rules - } - // Validation Rules - public virtual void AddValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - // InstanceValidation Rules - public virtual void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) - { - // Needs to be overriden to add new validation rules - } - } - #endregion - } // Class - #region Converter - internal class ZTransitionConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ZTransition) - { - // Return the ToString value - return ((ZTransition)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace - - -//// The following is a sample Extension File. You can use it to create ZTransitionExt.cs -//using System; -//using System.Collections.Generic; -//using System.Text; -//using Csla; - -//namespace VEPROMS.CSLA.Library -//{ -// public partial class ZTransition -// { -// partial class ZTransitionExtension : extensionBase -// { -// // TODO: Override automatic defaults -// public new void AddAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowRead(Dbid, ""); -// } -// public new void AddInstanceAuthorizationRules(Csla.Security.AuthorizationRules rules) -// { -// //rules.AllowInstanceRead(Dbid, ""); -// } -// public new void AddValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddRule( -// Csla.Validation.CommonRules.StringMaxLength, -// new Csla.Validation.CommonRules.MaxLengthRuleArgs("Name", 100)); -// } -// public new void AddInstanceValidationRules(Csla.Validation.ValidationRules rules) -// { -// rules.AddInstanceRule(/* Instance Validation Rule */); -// } -// } -// } -//} diff --git a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ZTransitionInfo.cs b/PROMS/VEPROMS.CSLA.Library/OldGenerated/ZTransitionInfo.cs deleted file mode 100644 index e00436b6..00000000 --- a/PROMS/VEPROMS.CSLA.Library/OldGenerated/ZTransitionInfo.cs +++ /dev/null @@ -1,310 +0,0 @@ -// ======================================================================== -// Copyright 2007 - Volian Enterprises, Inc. All rights reserved. -// Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE -// ------------------------------------------------------------------------ -// $Workfile: $ $Revision: $ -// $Author: $ $Date: $ -// -// $History: $ -// ======================================================================== - -using System; -using System.Data; -using System.Data.SqlClient; -using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -using System.Collections.Generic; -namespace VEPROMS.CSLA.Library -{ - public delegate void ZTransitionInfoEvent(object sender); - /// - /// ZTransitionInfo Generated by MyGeneration using the CSLA Object Mapping template - /// - [Serializable()] - [TypeConverter(typeof(ZTransitionInfoConverter))] - public partial class ZTransitionInfo : ReadOnlyBase, IDisposable - { - public event ZTransitionInfoEvent Changed; - private void OnChange() - { - if (Changed != null) Changed(this); - } - #region Log4Net - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #endregion - #region Collection - private static List _CacheList = new List(); - protected static void AddToCache(ZTransitionInfo zTransitionInfo) - { - if (!_CacheList.Contains(zTransitionInfo)) _CacheList.Add(zTransitionInfo); // In AddToCache - } - protected static void RemoveFromCache(ZTransitionInfo zTransitionInfo) - { - while (_CacheList.Contains(zTransitionInfo)) _CacheList.Remove(zTransitionInfo); // In RemoveFromCache - } - private static Dictionary> _CacheByPrimaryKey = new Dictionary>(); - private static void ConvertListToDictionary() - { - List remove = new List(); - foreach (ZTransitionInfo tmp in _CacheList) - { - if (!_CacheByPrimaryKey.ContainsKey(tmp.TransitionID.ToString())) - { - _CacheByPrimaryKey[tmp.TransitionID.ToString()] = new List(); // Add new list for PrimaryKey - } - _CacheByPrimaryKey[tmp.TransitionID.ToString()].Add(tmp); // Add to Primary Key list - remove.Add(tmp); - } - foreach (ZTransitionInfo tmp in remove) - RemoveFromCache(tmp); - } - protected static ZTransitionInfo GetCachedByPrimaryKey(int transitionID) - { - ConvertListToDictionary(); - string key = transitionID.ToString(); - if (_CacheByPrimaryKey.ContainsKey(key)) return _CacheByPrimaryKey[key][0]; - return null; - } - #endregion - #region Business Methods - private string _ErrorMessage = string.Empty; - public string ErrorMessage - { - get { return _ErrorMessage; } - } - protected ZTransition _Editable; - private IVEHasBrokenRules HasBrokenRules - { - get - { - IVEHasBrokenRules hasBrokenRules = null; - if (_Editable != null) - hasBrokenRules = _Editable.HasBrokenRules; - return hasBrokenRules; - } - } - private int _TransitionID; - [System.ComponentModel.DataObjectField(true, true)] - public int TransitionID - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyTransition != null) _TransitionID = _MyTransition.TransitionID; - return _TransitionID; - } - } - private TransitionInfo _MyTransition; - [System.ComponentModel.DataObjectField(true, true)] - public TransitionInfo MyTransition - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - if (_MyTransition == null && _TransitionID != 0) _MyTransition = TransitionInfo.Get(_TransitionID); - return _MyTransition; - } - } - private string _Oldto = string.Empty; - public string Oldto - { - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - get - { - return _Oldto; - } - } - // TODO: Replace base ZTransitionInfo.ToString function as necessary - /// - /// Overrides Base ToString - /// - /// A string representation of current ZTransitionInfo - //public override string ToString() - //{ - // return base.ToString(); - //} - // TODO: Check ZTransitionInfo.GetIdValue to assure that the ID returned is unique - /// - /// Overrides Base GetIdValue - Used internally by CSLA to determine equality - /// - /// A Unique ID for the current ZTransitionInfo - protected override object GetIdValue() - { - return _TransitionID; - } - #endregion - #region Factory Methods - private static int _ZTransitionInfoUnique = 0; - private static int ZTransitionInfoUnique - { get { return ++_ZTransitionInfoUnique; } } - private int _MyZTransitionInfoUnique = ZTransitionInfoUnique; - public int MyZTransitionInfoUnique - { get { return _MyZTransitionInfoUnique; } } - protected ZTransitionInfo() - {/* require use of factory methods */ - AddToCache(this); - } - public void Dispose() - { - RemoveFromCache(this); - if (!_CacheByPrimaryKey.ContainsKey(TransitionID.ToString())) return; - List listZTransitionInfo = _CacheByPrimaryKey[TransitionID.ToString()]; // Get the list of items - while (listZTransitionInfo.Contains(this)) listZTransitionInfo.Remove(this); // Remove the item from the list - if (listZTransitionInfo.Count == 0) // If there are no items left in the list - _CacheByPrimaryKey.Remove(TransitionID.ToString()); // remove the list - } - public virtual ZTransition Get() - { - return _Editable = ZTransition.Get(_TransitionID); - } - public static void Refresh(ZTransition tmp) - { - string key = tmp.TransitionID.ToString(); - ConvertListToDictionary(); - if (_CacheByPrimaryKey.ContainsKey(key)) - foreach (ZTransitionInfo tmpInfo in _CacheByPrimaryKey[key]) - tmpInfo.RefreshFields(tmp); - } - protected virtual void RefreshFields(ZTransition tmp) - { - _Oldto = tmp.Oldto; - _ZTransitionInfoExtension.Refresh(this); - if (_MyTransition != null) - { - _MyTransition.Dispose();// Dispose related value - _MyTransition = null;// Reset related value - } - OnChange();// raise an event - } - public static ZTransitionInfo Get(int transitionID) - { - //if (!CanGetObject()) - // throw new System.Security.SecurityException("User not authorized to view a ZTransition"); - try - { - ZTransitionInfo tmp = GetCachedByPrimaryKey(transitionID); - if (tmp == null) - { - tmp = DataPortal.Fetch(new PKCriteria(transitionID)); - AddToCache(tmp); - } - if (tmp.ErrorMessage == "No Record Found") - { - tmp.Dispose(); // Clean-up ZTransitionInfo - tmp = null; - } - return tmp; - } - catch (Exception ex) - { - throw new DbCslaException("Error on ZTransitionInfo.Get", ex); - } - } - #endregion - #region Data Access Portal - internal ZTransitionInfo(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZTransitionInfo.Constructor", GetHashCode()); - try - { - ReadData(dr); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZTransitionInfo.Constructor", ex); - throw new DbCslaException("ZTransitionInfo.Constructor", ex); - } - } - [Serializable()] - protected class PKCriteria - { - private int _TransitionID; - public int TransitionID - { get { return _TransitionID; } } - public PKCriteria(int transitionID) - { - _TransitionID = transitionID; - } - } - private void ReadData(SafeDataReader dr) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZTransitionInfo.ReadData", GetHashCode()); - try - { - _TransitionID = dr.GetInt32("TransitionID"); - _Oldto = dr.GetString("oldto"); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZTransitionInfo.ReadData", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ZTransitionInfo.ReadData", ex); - } - } - private void DataPortal_Fetch(PKCriteria criteria) - { - if (_MyLog.IsDebugEnabled) _MyLog.DebugFormat("[{0}] ZTransitionInfo.DataPortal_Fetch", GetHashCode()); - try - { - using (SqlConnection cn = Database.VEPROMS_SqlConnection) - { - ApplicationContext.LocalContext["cn"] = cn; - using (SqlCommand cm = cn.CreateCommand()) - { - cm.CommandType = CommandType.StoredProcedure; - cm.CommandText = "getZTransition"; - cm.Parameters.AddWithValue("@TransitionID", criteria.TransitionID); - using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader())) - { - if (!dr.Read()) - { - _ErrorMessage = "No Record Found"; - return; - } - ReadData(dr); - } - } - // removing of item only needed for local data portal - if (ApplicationContext.ExecutionLocation == ApplicationContext.ExecutionLocations.Client) - ApplicationContext.LocalContext.Remove("cn"); - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("ZTransitionInfo.DataPortal_Fetch", ex); - _ErrorMessage = ex.Message; - throw new DbCslaException("ZTransitionInfo.DataPortal_Fetch", ex); - } - } - #endregion - // Standard Refresh - #region extension - ZTransitionInfoExtension _ZTransitionInfoExtension = new ZTransitionInfoExtension(); - [Serializable()] - partial class ZTransitionInfoExtension : extensionBase { } - [Serializable()] - class extensionBase - { - // Default Refresh - public virtual void Refresh(ZTransitionInfo tmp) { } - } - #endregion - } // Class - #region Converter - internal class ZTransitionInfoConverter : ExpandableObjectConverter - { - public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) - { - if (destType == typeof(string) && value is ZTransitionInfo) - { - // Return the ToString value - return ((ZTransitionInfo)value).ToString(); - } - return base.ConvertTo(context, culture, value, destType); - } - } - #endregion -} // Namespace diff --git a/PROMS/VG/VG.csproj.bak b/PROMS/VG/VG.csproj.bak deleted file mode 100644 index 20bff441..00000000 --- a/PROMS/VG/VG.csproj.bak +++ /dev/null @@ -1,174 +0,0 @@ - - - - Local - 8.0.50727 - 2.0 - {52D74078-3822-410E-889B-464BD21AAB9E} - SAK - SAK - SAK - SAK - Debug - AnyCPU - - - - - VG - - - JScript - Grid - IE50 - false - Library - VG - OnBuildSuccess - - - - - - - v4.6.1 - 2.0 - - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - x86 - false - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - false - - - true - bin\Demo\ - DEBUG;TRACE - 285212672 - full - x86 - prompt - false - - - true - bin\Debug\ - DEBUG;TRACE - 285212672 - full - x86 - prompt - false - - - bin\Release\ - TRACE - 285212672 - true - - - x86 - prompt - false - - - true - bin\Demo\ - TRACE;DEMO - 285212672 - full - x86 - prompt - false - - - - - ..\..\..\Production\Proms3rdPartyLibraries\iTechSharp\itextsharp.dll - - - System - - - - System.Data - - - - System.Drawing - - - - System.XML - - - - - Code - - - - Code - - - - - - - - {aeee9fd1-6892-45e2-a67e-418c06d46ff9} - Volian.Base.Library - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/Volian.Controls.Library/DSOTabPanel - Copy.cs b/PROMS/Volian.Controls.Library/DSOTabPanel - Copy.cs deleted file mode 100644 index 654ff1b3..00000000 --- a/PROMS/Volian.Controls.Library/DSOTabPanel - Copy.cs +++ /dev/null @@ -1,665 +0,0 @@ -using System; -using System.ComponentModel; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using System.Drawing; -using System.Windows.Forms; -using VEPROMS.CSLA.Library; -using Volian.Controls.Library; -using System.Reflection; -using LBWordLibrary; - -namespace Volian.Controls.Library -{ - public partial class DSOTabPanel : DevComponents.DotNetBar.PanelDockContainer - { - #region Private Fields - private DisplayTabControl _MyDisplayTabControl; - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private AxDSOFramer.AxFramerControl _MyDSOFramer; - private TransparentPanel _MyTransparentPanel; - private static int _Count = 0; - private DocumentInfo _MyDocumentInfo; - private int _MyCount; - private DisplayTabItem _MyDisplayTabItem; - private DSOFile _DSOFile; - public static int MSWordLimit = 10; - #endregion - #region Public Properties - private String _SearchString; - public String SearchString - { - get { return _SearchString; } - set { _SearchString = value; FindSearchString(); } - } - /// - /// Count of DSO Pages open. Limited to 18 in DisplayTabControl - /// - public static int Count - { - get { return _Count; } - set { _Count = value; } - } - /// - /// Pointer to the related DisplayTabItem - /// - public DisplayTabItem MyDisplayTabItem - { - get { return _MyDisplayTabItem; } - set - { - _MyDisplayTabItem = value; - _MyDisplayTabItem.Visible = false; - _MyDisplayTabItem.Visible = true; - } - } - /// - /// DocumentInfo record for the Word document - /// - public DocumentInfo MyDocumentInfo - { - get { return _MyDocumentInfo; } - } - /// - /// Temporary Word file used for editing. - /// - internal DSOFile MyDSOFile - { - get - { - if (_DSOFile == null) - _DSOFile = new DSOFile(_MyDocumentInfo); - return _DSOFile; - } - } - /// - /// Dirty status. Only saved if dirty. - /// - public bool IsDirty - { - get - { - if (_MyDSOFramer == null) return false; - LBDocumentClass doc = new LBDocumentClass(_MyDSOFramer.ActiveDocument); - return !doc.Saved; - } - } - private bool _OverrideClose = false; - public bool OverrideClose - { - get { return _OverrideClose; } - set { _OverrideClose = value; } - } - public E_ViewMode PanelViewEditMode = E_ViewMode.Edit; - #endregion - //private frmPG _frm = null; - #region Constructors - private Timer _RefreshTimer; - private ItemInfo _ItemInfo; - private bool _AllowedToEdit; - public DSOTabPanel(DocumentInfo documentInfo, DisplayTabControl myDisplayTabControl, ItemInfo itemInfo, bool allowedToEdit) - { - _MyDisplayTabControl = myDisplayTabControl; - _ItemInfo = itemInfo; - _AllowedToEdit = allowedToEdit; - InitializeComponent(); - SetupDSOTabPanel(); - _MyDocumentInfo = documentInfo; - SetupDSO(); - _RefreshTimer = new Timer(); // Enabled is false and interval is 1/10th of second. - ClientSizeChanged += new EventHandler(DSOTabPanel_ClientSizeChanged); - _RefreshTimer.Tick += new EventHandler(_RefreshTimer_Tick); - //_frm = new frmPG(_MyDSOFramer); - //_frm.Show(); - } - void _RefreshTimer_Tick(object sender, EventArgs e) - { - _RefreshTimer.Enabled = false; - if(_MyDSOFramer != null) - _MyDSOFramer.Focus(); - } - void DSOTabPanel_ClientSizeChanged(object sender, EventArgs e) - { - _RefreshTimer.Enabled = false; // This assures that interval is used from last event. - _RefreshTimer.Enabled = true; - } - #endregion - #region Private Methods - private void SetupDSOTabPanel() - { - Dock = System.Windows.Forms.DockStyle.Fill; // Automatically Fill the panel - } - private void SetupDSO() - { - _Count++; // Increment the count of open Word documents (Limit = MSWordLimit) - _MyCount = _Count; - this._MyTransparentPanel = new TransparentPanel(); - this._MyDSOFramer = new AxDSOFramer.AxFramerControl(); - ((System.ComponentModel.ISupportInitialize)(this._MyDSOFramer)).BeginInit(); - this.Controls.Add(this._MyDSOFramer); - this.Controls.Add(this._MyTransparentPanel); // A transparent panel is added over top of the DSO Framer window so that - // the related tab can be activated when the user clicks on a Word Document. Since the Word document is actually running - // in a different thread, it does not behave properly with focus events. - this.components.Add(this._MyDSOFramer); - this.components.Add(this._MyTransparentPanel); - this._MyTransparentPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this._MyTransparentPanel.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this._MyTransparentPanel.ForeColor = System.Drawing.Color.Brown; // This is the color used to show InActive on the right side on the Word - // document menu line. - //this._MyTransPanel.Location = new System.Drawing.Point(0, 0); - //this._MyTransPanel.Name = "transPanel1"; - //this._MyTransPanel.Size = new System.Drawing.Size(370, 423); - //this._MyTransPanel.TabIndex = 1; - this._MyTransparentPanel.Click += new EventHandler(_MyTransparentPanel_Click); - this._MyDSOFramer.Dock = System.Windows.Forms.DockStyle.Fill; - //System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WordDSOTab)); - //this._DSOFramer.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("_FC.OcxState"))); - ((System.ComponentModel.ISupportInitialize)(this._MyDSOFramer)).EndInit(); - try - { - try - { - this._MyDSOFramer.Open(MyDSOFile.MyFile.FullName); - //this._MyDSOFramer.Open(MyDSOFile.MyFile.FullName,false,"Word.Document","",""); - } - catch (Exception ex) - { - _MyLog.Warn("dso fraimer error", ex); // put exception message in the error log - System.IO.FileStream fs = MyDSOFile.MyFile.Create(); - using (DocumentAuditInfoList dail = DocumentAuditInfoList.Get(MyDocumentInfo.DocID)) - { - if (dail.Count > 0) - { - //DocumentAuditInfo dai = dail[0]; - //foreach (DocumentAuditInfo tmpa in dail) - //{ - // if (tmpa.DTS > dai.DTS) dai = tmpa; - //} - if(MessageBox.Show("Do you want to revert to a previous version?", "Error in MS Word section", - MessageBoxButtons.YesNo, MessageBoxIcon.Question)==DialogResult.Yes) - { - //fs.Write(dai.DocContent, 0, dai.DocContent.Length); - using (Document myDoc = Document.Get(MyDocumentInfo.DocID)) - { - myDoc.RestoreWordDoc(_ItemInfo); - _DSOFile = null; - _MyDocumentInfo = DocumentInfo.Get(MyDocumentInfo.DocID); - } - } - - } - else - MessageBox.Show("Reverting to Blank Document", "Error in MS Word section", - MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - } - fs.Close(); - this._MyDSOFramer.Open(MyDSOFile.MyFile.FullName); - } - LBDocumentClass doc = new LBDocumentClass(_MyDSOFramer.ActiveDocument); - Console.WriteLine("Version {0}", doc.Application.Version); - float ver; - if (!float.TryParse(doc.Application.Version, out ver)) - ver = 12.0F; - this._MyDSOFramer.Menubar = ver < 12.0F; - this._MyDSOFramer.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFileClose, false); - this._MyDSOFramer.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFileNew, false); - this._MyDSOFramer.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFilePageSetup, false); - this._MyDSOFramer.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFilePrint, false); - this._MyDSOFramer.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFilePrintPreview, false); - this._MyDSOFramer.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFileProperties, false); - this._MyDSOFramer.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFileSave, false); - this._MyDSOFramer.set_EnableFileCommand(DSOFramer.dsoFileCommandType.dsoFileSaveAs, false); - this._MyDSOFramer.Titlebar = false; - //if (_MyCount < 20) - // this._MyDSOFramer.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow; - //this._MyDSOFramer.BeforeDocumentClosed += new AxDSOFramer._DFramerCtlEvents_BeforeDocumentClosedEventHandler(_MyDSOFramer_BeforeDocumentClosed); - //this._MyDSOFramer.OnSaveCompleted += new AxDSOFramer._DFramerCtlEvents_OnSaveCompletedEventHandler(_MyDSOFramer_OnSaveCompleted); - //this._MyDSOFramer.LostFocus += new EventHandler(_MyDSOFramer_LostFocus); - //this._MyDSOFramer.GotFocus += new EventHandler(_MyDSOFramer_GotFocus); - //this._MyDSOFramer.Enter += new EventHandler(_MyDSOFramer_Enter); - //this._MyDSOFramer.Leave += new EventHandler(_MyDSOFramer_Leave); - //this._MyDSOFramer.OnActivationChange += new AxDSOFramer._DFramerCtlEvents_OnActivationChangeEventHandler(_MyDSOFramer_OnActivationChange); - this.Enter += new EventHandler(DSOTabPanel_Enter); - //this.Leave += new EventHandler(DSOTabPanel_Leave); - //this.GotFocus += new EventHandler(DSOTabPanel_GotFocus); - //this.LostFocus += new EventHandler(DSOTabPanel_LostFocus); - Application.DoEvents(); - // The following line corrects Symbol characters in MSWord Sections - // CheckForSymbolCharacters(doc); - InitializeWordDocument(doc); - FindSearchString(); - } - catch (Exception ex) - { - string message = ShowException(ex); - Console.WriteLine("\r\n-------------\r\n{0}{1}{2}\r\n-------------\r\n", MyDSOFile.MyFile.FullName, ex.GetType().Name, message); - // TODO: Should output a message - // TODO: Should try to do a direct open using Word. - } - } - public void FixSymbolCharacters() - { - CheckForSymbolCharacters(new LBDocumentClass(_MyDSOFramer.ActiveDocument)); - } - private void CheckForSymbolCharacters(LBDocumentClass doc) - { - string fontHasSymbolCharacters = doc.FontHasSymbolCharacters; - if (fontHasSymbolCharacters != null) - { - // do a string for the log message, depending if this is a libdoc. - string msg = null; - if (MyDocumentInfo.LibTitle == null || MyDocumentInfo.LibTitle == "") - { - if (MyDocumentInfo.DocumentEntryCount>0) - msg = string.Format("Procedure = {0}, Section {1}", MyDocumentInfo.DocumentEntries[0].MyContent.ContentItems[0].MyProcedure, MyDocumentInfo.DocumentEntries[0].MyContent.ContentItems[0].DisplayText); - else - msg = string.Format("Procedure and Section can't be determined"); - } - else - msg = string.Format("Library Document: {0}", MyDocumentInfo.LibTitle); - if (doc.AttemptToFixASymbolCharacter()) // font is installed correctly, 'fix' this file. - { - //MessageBox.Show(string.Format("This document uses the font {0}, which previously had an error.\r\nThe program will attempt to fix the problem for this Word section.", fontHasSymbolCharacters), - // "Font Being Corrected", MessageBoxButtons.OK); - doc.FixSymbolCharacters(); - _MyLog.Info(string.Format("Font problem being fixed in Font: {0}, {1}.",fontHasSymbolCharacters, msg)); - } - else - { - MessageBox.Show(string.Format("This document uses the font {0}, which has an error.\r\n\r\nReinstall this font.", fontHasSymbolCharacters), - "Reinstall Font", MessageBoxButtons.OK); - _MyLog.Info(string.Format("Font problem found in Font: {0}, {1}.",fontHasSymbolCharacters, msg)); - } - } - } - - private void InitializeWordDocument(LBDocumentClass doc) - { - if (MyDocumentInfo.Config == null || MyDocumentInfo.Config == "" && MyDocumentInfo.DocumentEntryCount > 0) - { - DocStyle ds = MyDocumentInfo.DocumentEntries[0].MyContent.ContentItems[0].MyDocStyle; - // this will cause an error and goto the Catch if the family or size is null, - // Westinghouse needs it to to this - at least for now - //if (ds.Font.Family != null) doc.Application.Selection.Font.Name = ds.Font.Family; - //if (ds.Font.Size != null) doc.Application.Selection.Font.Size = (float)ds.Font.Size; - doc.Application.Selection.Font.Name = ds.Font.Family; - doc.Application.Selection.Font.Size = (float)ds.Font.Size; - doc.Application.Selection.ParagraphFormat.SpaceBefore = 0; - doc.Application.Selection.ParagraphFormat.SpaceAfter = 0; - doc.Application.Selection.ParagraphFormat.LineSpacingRule = LBWdLineSpacing.wdLineSpaceExactly; - doc.Application.Selection.ParagraphFormat.LineSpacing = 72 / 6; // for 6 LPI - MSWordToPDF.AdjustMargins(ds, doc, false); - } - if (doc.ActiveWindow.ActivePane.View.Zoom.Percentage < 40) - doc.ActiveWindow.ActivePane.View.Zoom.Percentage = 100; - } - public void FindSearchString() - { - if (SearchString == null) return; - // Get the Document - LBDocumentClass wordDoc = new LBDocumentClass(_MyDSOFramer.ActiveDocument); - //LBSelection sel = wordDoc.Application.Selection; - LBFind find = wordDoc.Application.Selection.Find; - find.ClearFormatting(); - bool wildCards = SearchString.Contains("?") || SearchString.Contains("*"); - bool found = find.Execute(SearchString, false, false, wildCards, false, false, true, LBWdFindWrap.wdFindContinue, null, null, null, false, false, false, false); - //Console.WriteLine("find = {0}", found); - } - /// - /// Text will either replace current selection or be inserted at the current cursor position if no selection - /// - /// - public void InsertText(string txt) - { - if (txt == null || txt.Length == 0) return; //nothing to insert - // Get the Document - LBDocumentClass wordDoc = new LBDocumentClass(_MyDSOFramer.ActiveDocument); - //This will get the selected range or just the current cursor position - LBSelection sel = wordDoc.Application.Selection; - // This will replace the selection or insert at current position - sel.Text = txt; - } - - public string GetSelectedString() - { - LBDocumentClass wordDoc = new LBDocumentClass(_MyDSOFramer.ActiveDocument); - //This will get the selected range or just the current cursor position - LBSelection sel = wordDoc.Application.Selection; - // if the start & end are the same, nothing is selected: - if (sel.Start == sel.End) return null; - return sel.Text; - } - - private string ShowException(Exception ex) - { - string sep = "\r\n "; - StringBuilder sb = new StringBuilder(); - do - { - sb.Append(sep + ex.Message); - sep += " "; - ex = ex.InnerException; - } while (ex != null); - return sb.ToString(); - } - - //void _MyDSOFramer_Leave(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSO Leave {0}", this.MyDocumentInfo.DocID); - //} - - //void _MyDSOFramer_Enter(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSO Enter {0}", this.MyDocumentInfo.DocID); - //} - - //void _MyDSOFramer_GotFocus(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSO Got Focus {0}",this.MyDocumentInfo.DocID); - //} - - //void _MyDSOFramer_LostFocus(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSO Lost Focus {0}", this.MyDocumentInfo.DocID); - //} - public void EnterPanel() - { - DSOTabPanel_Enter(this, new EventArgs()); - } - //void DSOTabPanel_LostFocus(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSOTabPanel_LostFocus {0} DocID {1} Index {2} {3}", _In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName); - //} - //void DSOTabPanel_GotFocus(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSOTabPanel_GotFocus {0} DocID {1} Index {2} {3}", _In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName); - //} - #endregion - #region Event Handlers - /// - /// Display MyTransparentPanel over the DSOPanel so that the Word "Inactive" appears in the upper right hand corner. - /// - public void InActive() - { - _MyTransparentPanel.BringToFront(); - } - /// - /// Force this item to be selected when the transparent window is clicked. - /// This will in-turn send the Transparent Panel to back and make the DSO Panel - /// editable. - /// - /// - /// - void _MyTransparentPanel_Click(object sender, EventArgs e) - { - this.Select(); - } - ///// - ///// If the user presses the save button, tell the file to save it's contents to the database - ///// - ///// - ///// - //void _MyDSOFramer_OnSaveCompleted(object sender, AxDSOFramer._DFramerCtlEvents_OnSaveCompletedEvent e) - //{ - // _MyLog.WarnFormat("_MyDSOFramer_OnSaveCompleted"); - // Volian.Base.Library.vlnStackTrace.ShowStack("_MyDSOFramer_OnSaveCompleted"); - // SaveDSO_Phase2(); - //} - - private void SaveDSO_Phase2() - { - // Unfortunately, the only way to handle view mode for DSO Framer is to not save. - if (PanelViewEditMode == E_ViewMode.View) - { - MessageBox.Show("Currently in VIEW mode,\r\n cannot Save " + _MyDisplayTabItem.Tooltip); - return; - } - LBDocumentClass doc = new LBDocumentClass(_MyDSOFramer.ActiveDocument); - while (doc.Saved = false) - Application.DoEvents(); - string tmp = GetReflectiveProperty(_MyDSOFramer.ActiveDocument, "FullName"); - if (System.IO.File.Exists(tmp)) - MyDSOFile.FullName = tmp; - else - _MyLog.FatalFormat("File does not exist {0}\r\nFile was {1}", tmp, MyDSOFile.FullName); - // if this was a library document, ask user if it should be saved for all usages. - bool cvtLibDoc = false; - if (MyDisplayTabItem.MyItemInfo != null) // B2016-131 if myiteminfo is null then the lib doc is not referenced, so just save the changes - don't generate a pdf - { - EntryInfo myei = MyDisplayTabItem.MyItemInfo.MyContent.MyEntry; - if (myei != null && myei.MyDocument != null && myei.MyDocument.LibTitle != null && myei.MyDocument.LibTitle != "") - { - DialogResult ans = MessageBox.Show("Save as Library Document for all usages?", "Document Save", MessageBoxButtons.YesNo); - if (ans == DialogResult.No) cvtLibDoc = true; - } - } - MyDSOFile.SaveFile(doc.Length, doc.Ascii, MyDisplayTabItem.MyItemInfo, cvtLibDoc, StatusChanged); - if (cvtLibDoc) - { - MyDisplayTabItem.Text = MyDisplayTabItem.MyItemInfo.TabTitle; - MyDisplayTabItem.Tooltip = MyDisplayTabItem.MyItemInfo.TabToolTip; - MyDisplayTabItem.SetPrivateTooltip(MyDisplayTabItem.MyItemInfo.TabToolTip); - } - } - public void StatusChanged(VolianStatusType type, int count, string text) - { - if (Parent != null && Parent.Parent != null && Parent.Parent.Parent is DisplayTabControl) - { - DisplayTabControl tc = Parent.Parent.Parent as DisplayTabControl; - tc.ONStatusChanged(this, new DisplayTabControlStatusEventArgs(type, count, text)); - } - } - ///// - ///// Before a document closes check to see if it's contents should be saved. - ///// - ///// - ///// - //void _MyDSOFramer_BeforeDocumentClosed(object sender, AxDSOFramer._DFramerCtlEvents_BeforeDocumentClosedEvent e) - //{ - // SaveDSOPhase1(); - //} - - private void SaveDSO_Phase1() - { - try - { - if (!IsBeingDeleted) - SaveDirty(); - this.Enter -= new EventHandler(DSOTabPanel_Enter); - // this.Leave -= new EventHandler(DSOTabPanel_Leave); - // SaveDirty(); // SaveDirty happens in CloseDSO(bool) - } - catch (Exception ex) - { - _MyLog.Warn("Before Closing Document ", ex); - } - } - public static bool IgnoreEnter = false; - private bool _In_DSOTabPanel_Enter=false; - /// - /// When a Word document is selected make sure it's tab is activated and - /// the SelectedItem for the DisplayTabControl is updated. - /// - /// - /// - private void DSOTabPanel_Enter(object sender, EventArgs e) - { - if (IgnoreEnter) return; - _MyTransparentPanel.SendToBack(); - - // Set whether this worddoc is in view/edit mode by checking whether the - // procedure is in view/edit mode (based on the steppanel. This occurs on - // the enter event so that the mode is determined any time this panel becomes - // active. - // find steptabpanel and its view/edit. If it doesn't have a steptabpanel - // use default - edit. Later when we have ownership, need to use that. - PanelViewEditMode = E_ViewMode.Edit; // default to edit - if (MyDisplayTabItem.MyItemInfo != null) // lib doc with no associated active procedure defaults to edit - { - StepTabPanel stpanel = _MyDisplayTabControl.GetProcedureTabPanel(MyDisplayTabItem.MyItemInfo); - PanelViewEditMode = (stpanel == null) ? E_ViewMode.Edit : stpanel.MyStepPanel.VwMode; - } - try - { - //_MyDSOFramer.EventsEnabled = true; - _MyDSOFramer.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow; - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.ErrorFormat("DSOTabPage_Enter", ex); - } - if (_In_DSOTabPanel_Enter) return; - //vlnStackTrace.ShowStack("DSOTabPanel_Enter {0} DocID {1} Index {2} {3}",_In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName); - _In_DSOTabPanel_Enter = true; - if (MyDisplayTabItem.MyItemInfo != null) - _MyDisplayTabControl.OnItemSelectedChanged(this,new ItemSelectedChangedEventArgs(MyDisplayTabItem.MyItemInfo)); - _MyDSOFramer.Focus(); - _In_DSOTabPanel_Enter = false; - _MyDisplayTabControl.SelectedDisplayTabItem = MyDisplayTabItem; - } - #endregion - #region Public Methods - /// - /// Save the contents of the Word Document to a file - /// and save the file to the database - /// - /// - public bool SaveDSO() - { - bool result = true; - try - { - _MyDSOFramer.Save(); - SaveDSO_Phase2(); - //_MyDSOFramer_OnSaveCompleted(this, null); - // These are handled in the method above - //LBDocumentClass doc = new LBDocumentClass(_MyDSOFramer.ActiveDocument); - //MyDSOFile.FullName = GetReflectiveProperty(_MyDSOFramer.ActiveDocument, "FullName"); - //MyDSOFile.SaveFile(doc.Length, doc.Ascii); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("SaveDSO", ex); - MessageBox.Show(ex.Message, "Error Saving Document", MessageBoxButtons.OK, MessageBoxIcon.Error); - result = false; - } - return result; - } - /// - /// Check to see if a Word document should be saved. If it is dirty ask the user if the - /// changes should be changed. Save the changes if the user says "yes". - /// - /// - public bool SaveDirty() - { - if (OverrideClose) - return false; - if (IsDirty) - { - // Unfortunately, the only way to handle view mode for DSO Framer is to not save. - if (PanelViewEditMode == E_ViewMode.View || !_AllowedToEdit) - { - MessageBox.Show("Currently in VIEW mode,\r\n cannot Save " + _MyDisplayTabItem.Tooltip); - return false; - } - //if (MessageBox.Show("Save changes to " + _MyDisplayTabItem.MyItemInfo.TabTitle + "\r\n" + _MyDisplayTabItem.MyItemInfo.TabToolTip, "Document has Changed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - if (MessageBox.Show("Save changes to " + _MyDisplayTabItem.Text + "\r\n" + _MyDisplayTabItem.Tooltip, "Document has Changed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - return SaveDSO(); - return false; - } - return true; - } - private bool _IsBeingDeleted = false; - public bool IsBeingDeleted - { - get { return _IsBeingDeleted; } - set { _IsBeingDeleted = value; } - } - /// - /// Cleans-up the DSO Framer window - /// - /// - public bool CloseDSO() - { - return CloseDSO(false); - } - /// - /// Cleans-up the DSO Framer window - /// - /// - /// - public bool CloseDSO(bool force) - { - _MyLog.Debug("CloseDSO"); - bool result = true; - try - { - if (_MyDSOFramer != null) - { - SaveDSO_Phase1(); - _MyDSOFramer.Close(); - Controls.Remove(_MyDSOFramer); - components.Remove(_MyDSOFramer); - _MyDSOFramer.Dispose(); - _MyDSOFramer = null; - _Count--; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("SaveDSO - " + this.Name, ex); - result = false; - } - return result; - } - /// - /// Activates the current DSO Framer window (Word) - /// - public void Activate() - { - try - { - this._MyDSOFramer.Activate(); - if (_MyCount <= MSWordLimit) - this._MyDSOFramer.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow; - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Activate", ex); - } - } - #endregion - #region DocumentProperties - - private string GetReflectiveProperty(object objectToInspect, string propertyName) - { - string returnString = ""; - //To use reflection on an object, you - // first need to get an instance - // of that object's type. - Type objectType = objectToInspect.GetType(); - //After you have the object's type, you can get - // information on that type. In this case, we're - // asking the type to tell us all the - // properties that it contains. - PropertyInfo[] properties = objectType.GetProperties(); - //You can then use the PropertyInfo array - // to loop through each property of the type. - foreach (PropertyInfo property in properties) - { - //The interest part of this code - // is the GetValue method. This method - // returns the value of the property. - if(property.Name == propertyName) - return property.GetValue(objectToInspect, null).ToString(); - } - return null; - } - #endregion - public override string ToString() - { - return string.Format("DSOTabPanel Document {0}", MyDocumentInfo.DocID); - } - } -} diff --git a/PROMS/Volian.Controls.Library/DSOTabPanel.Designer - Copy.cs b/PROMS/Volian.Controls.Library/DSOTabPanel.Designer - Copy.cs deleted file mode 100644 index 8d3455ab..00000000 --- a/PROMS/Volian.Controls.Library/DSOTabPanel.Designer - Copy.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace Volian.Controls.Library -{ - partial class DSOTabPanel - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } - - #endregion - } -} diff --git a/PROMS/Volian.Controls.Library/DSOTabPanel.cs.bak b/PROMS/Volian.Controls.Library/DSOTabPanel.cs.bak deleted file mode 100644 index 85662058..00000000 --- a/PROMS/Volian.Controls.Library/DSOTabPanel.cs.bak +++ /dev/null @@ -1,695 +0,0 @@ -using System; -using System.ComponentModel; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using System.Drawing; -using System.Windows.Forms; -using VEPROMS.CSLA.Library; -using Volian.Controls.Library; -using System.Reflection; -using LBWordLibrary; - -namespace Volian.Controls.Library -{ - public partial class DSOTabPanel : DevComponents.DotNetBar.PanelDockContainer - { - #region Private Fields - private DisplayTabControl _MyDisplayTabControl; - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private AxEDWordLib.AxEDWord _MyEdWord; // B2017-133 Edraw DSO Framer Replacement - private TransparentPanel _MyTransparentPanel; - private static int _Count = 0; - private DocumentInfo _MyDocumentInfo; - private int _MyCount; - private DisplayTabItem _MyDisplayTabItem; - private DSOFile _DSOFile; - public static int MSWordLimit = 10; - #endregion - #region Public Properties - private String _SearchString; - public String SearchString - { - get { return _SearchString; } - set { _SearchString = value; FindSearchString(); } - } - /// - /// Count of DSO Pages open. Limited to 18 in DisplayTabControl - /// - public static int Count - { - get { return _Count; } - set { _Count = value; } - } - /// - /// Pointer to the related DisplayTabItem - /// - public DisplayTabItem MyDisplayTabItem - { - get { return _MyDisplayTabItem; } - set - { - _MyDisplayTabItem = value; - _MyDisplayTabItem.Visible = false; - _MyDisplayTabItem.Visible = true; - } - } - /// - /// DocumentInfo record for the Word document - /// - public DocumentInfo MyDocumentInfo - { - get { return _MyDocumentInfo; } - } - /// - /// Temporary Word file used for editing. - /// - internal DSOFile MyDSOFile - { - get - { - if (_DSOFile == null) - _DSOFile = new DSOFile(_MyDocumentInfo); - return _DSOFile; - } - } - /// - /// Dirty status. Only saved if dirty. - /// - public bool IsDirty - { - get - { - if (_MyEdWord == null) return false; // B2017-133 Edraw Is Dirty Property - return _MyEdWord.IsDirty(); - //LBDocumentClass doc = new LBDocumentClass(_MyEdWord.ActiveDocument()); - //return !doc.Saved; - } - } - private bool _OverrideClose = false; - public bool OverrideClose - { - get { return _OverrideClose; } - set { _OverrideClose = value; } - } - public E_ViewMode PanelViewEditMode = E_ViewMode.Edit; - #endregion - //private frmPG _frm = null; - #region Constructors - private Timer _RefreshTimer; - private ItemInfo _ItemInfo; - private bool _AllowedToEdit; - public DSOTabPanel(DocumentInfo documentInfo, DisplayTabControl myDisplayTabControl, ItemInfo itemInfo, bool allowedToEdit) - { - _MyDisplayTabControl = myDisplayTabControl; - _ItemInfo = itemInfo; - _AllowedToEdit = allowedToEdit; - InitializeComponent(); - SetupDSOTabPanel(); - _MyDocumentInfo = documentInfo; - SetupDSO(); - _RefreshTimer = new Timer(); // Enabled is false and interval is 1/10th of second. - _RefreshTimer.Interval = 1000;// B2017-133 Edraw - ClientSizeChanged += new EventHandler(DSOTabPanel_ClientSizeChanged); - _RefreshTimer.Tick += new EventHandler(_RefreshTimer_Tick); - _MyEdWord.BeforeDocumentClosed += _MyEdWord_BeforeDocumentClosed;// B2017-133 Edraw - _MyEdWord.BeforeDocumentOpened += _MyEdWord_BeforeDocumentOpened;// B2017-133 Edraw - _MyEdWord.BeforeDocumentSaved += _MyEdWord_BeforeDocumentSaved;// B2017-133 Edraw - //_frm = new frmPG(_MyDSOFramer); - //_frm.Show(); - } - void _MyEdWord_BeforeDocumentSaved(object sender, EventArgs e)// B2017-133 Edraw - { - SaveDSO(); - } - //void DisableWordCommands()// B2017-133 Edraw - // { - // _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableClose, true); - // _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableNew, true); - // _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisablePrint, true); - // _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisablePrintPreview, true); - // _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisablePrintQuick, true); - // _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableSave, true); - // _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableSaveAs, true); - // _MyEdWord.DisableStandardCommand(EDWordLib.CommandType.cmdTypeSave, true); - // _MyEdWord.DisableStandardCommand(EDWordLib.CommandType.cmdTypeClose, true); - // _MyEdWord.DisableStandardCommand(EDWordLib.CommandType.cmdTypePrint, true); - // _MyEdWord.DisableSaveHotKey(true); - // _MyEdWord.DisablePrintHotKey(true); - // } - void _MyEdWord_BeforeDocumentOpened(object sender, EventArgs e)// B2017-133 Edraw - { - _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableClose, true); - _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableNew, true); - _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisablePrint, true); - _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisablePrintPreview, true); - _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisablePrintQuick, true); - _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableSave, true); - _MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableSaveAs, true); - _MyEdWord.DisableStandardCommand(EDWordLib.CommandType.cmdTypeSave, true); - _MyEdWord.DisableStandardCommand(EDWordLib.CommandType.cmdTypeClose, true); - _MyEdWord.DisableStandardCommand(EDWordLib.CommandType.cmdTypePrint, true); - _MyEdWord.DisableSaveHotKey(true); - _MyEdWord.DisablePrintHotKey(true); - } - void _MyEdWord_BeforeDocumentClosed(object sender, EventArgs e)// B2017-133 Edraw - { - Console.WriteLine("B2017-133 Edraw Before Document Closed"); - } - void _RefreshTimer_Tick(object sender, EventArgs e) - { - _RefreshTimer.Enabled = false; - if (_MyEdWord != null)// B2017-133 Edraw - { - _MyEdWord.Focus(); - _MyEdWord.GotoItem(EDWordLib.WdGoToItem.wdGoToStart, EDWordLib.WdGoToDirection.wdGoToFirst); - //_MyEdWord.BringToFront(); - //_MyEdWord.EndInit(); - } - } - void DSOTabPanel_ClientSizeChanged(object sender, EventArgs e) - { - _RefreshTimer.Enabled = false; // This assures that interval is used from last event. - _RefreshTimer.Enabled = true; - } - #endregion - #region Private Methods - private void SetupDSOTabPanel() - { - Dock = System.Windows.Forms.DockStyle.Fill; // Automatically Fill the panel - } - private void SetupDSO() - { - _Count++; // Increment the count of open Word documents (Limit = MSWordLimit) - _MyCount = _Count; - this._MyTransparentPanel = new TransparentPanel(); - this._MyEdWord = new AxEDWordLib.AxEDWord();// B2017-133 Edraw - _MyEdWord.BeginInit(); - this.Controls.Add(this._MyEdWord); - this.Controls.Add(this._MyTransparentPanel); // A transparent panel is added over top of the DSO Framer window so that - // the related tab can be activated when the user clicks on a Word Document. Since the Word document is actually running - // in a different thread, it does not behave properly with focus events. - this.components.Add(this._MyEdWord);// B2017-133 Edraw - this.components.Add(this._MyTransparentPanel); - this._MyTransparentPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this._MyTransparentPanel.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this._MyTransparentPanel.ForeColor = System.Drawing.Color.Brown; // This is the color used to show InActive on the right side on the Word - // document menu line. - //this._MyTransPanel.Location = new System.Drawing.Point(0, 0); - //this._MyTransPanel.Name = "transPanel1"; - //this._MyTransPanel.Size = new System.Drawing.Size(370, 423); - //this._MyTransPanel.TabIndex = 1; - this._MyTransparentPanel.Click += new EventHandler(_MyTransparentPanel_Click); - this._MyEdWord.Dock = System.Windows.Forms.DockStyle.Fill; - //System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WordDSOTab)); - //this._DSOFramer.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("_FC.OcxState"))); - try - { - try - { - this._MyEdWord.LicenseName = "Volian7573291802";// B2017-133 Edraw - this._MyEdWord.LicenseCode = "EDW8-5527-1201-AB8A";// B2017-133 Edraw - //_MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableSave, true); - //_MyEdWord.DisableFileCommand(EDWordLib.WdUIType.wdUIDisableSaveAs, true); - //_MyEdWord.DisableStandardCommand(EDWordLib.CommandType.cmdTypeSave, true); - //DisableWordCommands(); - this._MyEdWord.Open(MyDSOFile.MyFile.FullName); - } - catch (Exception ex) - { - System.IO.FileStream fs = MyDSOFile.MyFile.Create(); - using (DocumentAuditInfoList dail = DocumentAuditInfoList.Get(MyDocumentInfo.DocID)) - { - if (dail.Count > 0) - { - //DocumentAuditInfo dai = dail[0]; - //foreach (DocumentAuditInfo tmpa in dail) - //{ - // if (tmpa.DTS > dai.DTS) dai = tmpa; - //} - if(MessageBox.Show("Do you want to revert to a previous version?", "Error in MS Word section", - MessageBoxButtons.YesNo, MessageBoxIcon.Question)==DialogResult.Yes) - { - //fs.Write(dai.DocContent, 0, dai.DocContent.Length); - using (Document myDoc = Document.Get(MyDocumentInfo.DocID)) - { - myDoc.RestoreWordDoc(_ItemInfo); - _DSOFile = null; - _MyDocumentInfo = DocumentInfo.Get(MyDocumentInfo.DocID); - } - } - - } - else - MessageBox.Show("Reverting to Blank Document", "Error in MS Word section", - MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - } - fs.Close(); - this._MyEdWord.Open(MyDSOFile.MyFile.FullName);// B2017-133 Edraw - } - LBDocumentClass doc = new LBDocumentClass(_MyEdWord.ActiveDocument()); - Console.WriteLine("Version {0}", doc.Application.Version); - float ver; - if (!float.TryParse(doc.Application.Version, out ver)) - ver = 12.0F; - this.Enter += new EventHandler(DSOTabPanel_Enter); - Application.DoEvents(); - // The following line corrects Symbol characters in MSWord Sections - // CheckForSymbolCharacters(doc); - InitializeWordDocument(doc); - FindSearchString(); - } - catch (Exception ex) - { - string message = ShowException(ex); - Console.WriteLine("\r\n-------------\r\n{0}{1}{2}\r\n-------------\r\n", MyDSOFile.MyFile.FullName, ex.GetType().Name, message); - // TODO: Should output a message - // TODO: Should try to do a direct open using Word. - } - } - public void FixSymbolCharacters() - { - CheckForSymbolCharacters(new LBDocumentClass(_MyEdWord.ActiveDocument()));// B2017-133 Edraw - } - private void CheckForSymbolCharacters(LBDocumentClass doc) - { - string fontHasSymbolCharacters = doc.FontHasSymbolCharacters; - if (fontHasSymbolCharacters != null) - { - // do a string for the log message, depending if this is a libdoc. - string msg = null; - if (MyDocumentInfo.LibTitle == null || MyDocumentInfo.LibTitle == "") - { - if (MyDocumentInfo.DocumentEntryCount>0) - msg = string.Format("Procedure = {0}, Section {1}", MyDocumentInfo.DocumentEntries[0].MyContent.ContentItems[0].MyProcedure, MyDocumentInfo.DocumentEntries[0].MyContent.ContentItems[0].DisplayText); - else - msg = string.Format("Procedure and Section can't be determined"); - } - else - msg = string.Format("Library Document: {0}", MyDocumentInfo.LibTitle); - if (doc.AttemptToFixASymbolCharacter()) // font is installed correctly, 'fix' this file. - { - //MessageBox.Show(string.Format("This document uses the font {0}, which previously had an error.\r\nThe program will attempt to fix the problem for this Word section.", fontHasSymbolCharacters), - // "Font Being Corrected", MessageBoxButtons.OK); - doc.FixSymbolCharacters(); - _MyLog.Info(string.Format("Font problem being fixed in Font: {0}, {1}.",fontHasSymbolCharacters, msg)); - } - else - { - MessageBox.Show(string.Format("This document uses the font {0}, which has an error.\r\n\r\nReinstall this font.", fontHasSymbolCharacters), - "Reinstall Font", MessageBoxButtons.OK); - _MyLog.Info(string.Format("Font problem found in Font: {0}, {1}.",fontHasSymbolCharacters, msg)); - } - } - } - - private void InitializeWordDocument(LBDocumentClass doc) - { - if (MyDocumentInfo.Config == null || MyDocumentInfo.Config == "" && MyDocumentInfo.DocumentEntryCount > 0) - { - DocStyle ds = MyDocumentInfo.DocumentEntries[0].MyContent.ContentItems[0].MyDocStyle; - // this will cause an error and goto the Catch if the family or size is null, - // Westinghouse needs it to to this - at least for now - //if (ds.Font.Family != null) doc.Application.Selection.Font.Name = ds.Font.Family; - //if (ds.Font.Size != null) doc.Application.Selection.Font.Size = (float)ds.Font.Size; - doc.Application.Selection.Font.Name = ds.Font.Family; - doc.Application.Selection.Font.Size = (float)ds.Font.Size; - doc.Application.Selection.ParagraphFormat.SpaceBefore = 0; - doc.Application.Selection.ParagraphFormat.SpaceAfter = 0; - doc.Application.Selection.ParagraphFormat.LineSpacingRule = LBWdLineSpacing.wdLineSpaceExactly; - doc.Application.Selection.ParagraphFormat.LineSpacing = 72 / 6; // for 6 LPI - MSWordToPDF.AdjustMargins(ds, doc, false); - } - if (doc.ActiveWindow.ActivePane.View.Zoom.Percentage < 40) - doc.ActiveWindow.ActivePane.View.Zoom.Percentage = 100; - } - public void FindSearchString() - { - if (SearchString == null) return; - // Get the Document - LBDocumentClass wordDoc = new LBDocumentClass(_MyEdWord.ActiveDocument()); - //LBSelection sel = wordDoc.Application.Selection; - LBFind find = wordDoc.Application.Selection.Find; - find.ClearFormatting(); - bool wildCards = SearchString.Contains("?") || SearchString.Contains("*"); - bool found = find.Execute(SearchString, false, false, wildCards, false, false, true, LBWdFindWrap.wdFindContinue, null, null, null, false, false, false, false); - //Console.WriteLine("find = {0}", found); - } - /// - /// Text will either replace current selection or be inserted at the current cursor position if no selection - /// - /// - public void InsertText(string txt) - { - if (txt == null || txt.Length == 0) return; //nothing to insert - // Get the Document - LBDocumentClass wordDoc = new LBDocumentClass(_MyEdWord.ActiveDocument()); - //This will get the selected range or just the current cursor position - LBSelection sel = wordDoc.Application.Selection; - // This will replace the selection or insert at current position - sel.Text = txt; - } - - public string GetSelectedString() - { - LBDocumentClass wordDoc = new LBDocumentClass(_MyEdWord.ActiveDocument()); - //This will get the selected range or just the current cursor position - LBSelection sel = wordDoc.Application.Selection; - // if the start & end are the same, nothing is selected: - if (sel.Start == sel.End) return null; - return sel.Text; - } - - private string ShowException(Exception ex) - { - string sep = "\r\n "; - StringBuilder sb = new StringBuilder(); - do - { - sb.Append(sep + ex.Message); - sep += " "; - ex = ex.InnerException; - } while (ex != null); - return sb.ToString(); - } - - //void _MyDSOFramer_Leave(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSO Leave {0}", this.MyDocumentInfo.DocID); - //} - - //void _MyDSOFramer_Enter(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSO Enter {0}", this.MyDocumentInfo.DocID); - //} - - //void _MyDSOFramer_GotFocus(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSO Got Focus {0}",this.MyDocumentInfo.DocID); - //} - - //void _MyDSOFramer_LostFocus(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSO Lost Focus {0}", this.MyDocumentInfo.DocID); - //} - public void EnterPanel() - { - DSOTabPanel_Enter(this, new EventArgs()); - } - //void DSOTabPanel_LostFocus(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSOTabPanel_LostFocus {0} DocID {1} Index {2} {3}", _In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName); - //} - //void DSOTabPanel_GotFocus(object sender, EventArgs e) - //{ - // vlnStackTrace.ShowStack("DSOTabPanel_GotFocus {0} DocID {1} Index {2} {3}", _In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName); - //} - #endregion - #region Event Handlers - /// - /// Display MyTransparentPanel over the DSOPanel so that the Word "Inactive" appears in the upper right hand corner. - /// - public void InActive() - { - _MyTransparentPanel.BringToFront(); - } - /// - /// Force this item to be selected when the transparent window is clicked. - /// This will in-turn send the Transparent Panel to back and make the DSO Panel - /// editable. - /// - /// - /// - void _MyTransparentPanel_Click(object sender, EventArgs e) - { - this.Select(); - } - ///// - ///// If the user presses the save button, tell the file to save it's contents to the database - ///// - ///// - ///// - //void _MyDSOFramer_OnSaveCompleted(object sender, AxDSOFramer._DFramerCtlEvents_OnSaveCompletedEvent e) - //{ - // _MyLog.WarnFormat("_MyDSOFramer_OnSaveCompleted"); - // Volian.Base.Library.vlnStackTrace.ShowStack("_MyDSOFramer_OnSaveCompleted"); - // SaveDSO_Phase2(); - //} - - private void SaveDSO_Phase2() - { - // Unfortunately, the only way to handle view mode for DSO Framer is to not save. - if (PanelViewEditMode == E_ViewMode.View) - { - MessageBox.Show("Currently in VIEW mode,\r\n cannot Save " + _MyDisplayTabItem.Tooltip); - return; - } - LBDocumentClass doc = new LBDocumentClass(_MyEdWord.ActiveDocument()); - //while (doc.Saved = false) - // Application.DoEvents(); - string tmp = GetReflectiveProperty(_MyEdWord.ActiveDocument(), "FullName"); - if (System.IO.File.Exists(tmp)) - MyDSOFile.FullName = tmp; - else - _MyLog.FatalFormat("File does not exist {0}\r\nFile was {1}", tmp, MyDSOFile.FullName); - // if this was a library document, ask user if it should be saved for all usages. - bool cvtLibDoc = false; - if (MyDisplayTabItem.MyItemInfo != null) // B2016-131 if myiteminfo is null then the lib doc is not referenced, so just save the changes - don't generate a pdf - { - EntryInfo myei = MyDisplayTabItem.MyItemInfo.MyContent.MyEntry; - if (myei != null && myei.MyDocument != null && myei.MyDocument.LibTitle != null && myei.MyDocument.LibTitle != "") - { - DialogResult ans = MessageBox.Show("Save as Library Document for all usages?", "Document Save", MessageBoxButtons.YesNo); - if (ans == DialogResult.No) cvtLibDoc = true; - } - } - MyDSOFile.SaveFile(doc.Length, doc.Ascii, MyDisplayTabItem.MyItemInfo, cvtLibDoc, StatusChanged); - if (cvtLibDoc) - { - MyDisplayTabItem.Text = MyDisplayTabItem.MyItemInfo.TabTitle; - MyDisplayTabItem.Tooltip = MyDisplayTabItem.MyItemInfo.TabToolTip; - MyDisplayTabItem.SetPrivateTooltip(MyDisplayTabItem.MyItemInfo.TabToolTip); - } - } - public void StatusChanged(VolianStatusType type, int count, string text) - { - if (Parent != null && Parent.Parent != null && Parent.Parent.Parent is DisplayTabControl) - { - DisplayTabControl tc = Parent.Parent.Parent as DisplayTabControl; - tc.ONStatusChanged(this, new DisplayTabControlStatusEventArgs(type, count, text)); - } - } - ///// - ///// Before a document closes check to see if it's contents should be saved. - ///// - ///// - ///// - //void _MyDSOFramer_BeforeDocumentClosed(object sender, AxDSOFramer._DFramerCtlEvents_BeforeDocumentClosedEvent e) - //{ - // SaveDSOPhase1(); - //} - - private void SaveDSO_Phase1() - { - try - { - if (!IsBeingDeleted) - SaveDirty(); - this.Enter -= new EventHandler(DSOTabPanel_Enter); - // this.Leave -= new EventHandler(DSOTabPanel_Leave); - // SaveDirty(); // SaveDirty happens in CloseDSO(bool) - } - catch (Exception ex) - { - _MyLog.Warn("Before Closing Document ", ex); - } - } - /// - /// Save the contents of the Word Document to a file - /// and save the file to the database - /// - /// - public bool SaveDSO() - { - bool result = true; - try - { - bool stat = _MyEdWord.Save();// B2017-133 Edraw - Console.WriteLine("Save = {0}", stat); - SaveDSO_Phase2(); - //_MyDSOFramer_OnSaveCompleted(this, null); - // These are handled in the method above - //LBDocumentClass doc = new LBDocumentClass(_MyDSOFramer.ActiveDocument); - //MyDSOFile.FullName = GetReflectiveProperty(_MyDSOFramer.ActiveDocument, "FullName"); - //MyDSOFile.SaveFile(doc.Length, doc.Ascii); - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("SaveDSO", ex); - MessageBox.Show(ex.Message, "Error Saving Document", MessageBoxButtons.OK, MessageBoxIcon.Error); - result = false; - } - return result; - } - /// - /// Check to see if a Word document should be saved. If it is dirty ask the user if the - /// changes should be changed. Save the changes if the user says "yes". - /// - /// - public bool SaveDirty() - { - if (OverrideClose) - return false; - if (IsDirty) - { - // Unfortunately, the only way to handle view mode for DSO Framer is to not save. - if (PanelViewEditMode == E_ViewMode.View || !_AllowedToEdit) - { - MessageBox.Show("Currently in VIEW mode,\r\n cannot Save " + _MyDisplayTabItem.Tooltip); - return false; - } - //if (MessageBox.Show("Save changes to " + _MyDisplayTabItem.MyItemInfo.TabTitle + "\r\n" + _MyDisplayTabItem.MyItemInfo.TabToolTip, "Document has Changed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - if (MessageBox.Show("Save changes to " + _MyDisplayTabItem.Text + "\r\n" + _MyDisplayTabItem.Tooltip, "Document has Changed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - return SaveDSO(); - return false; - } - return true; - } - public static bool IgnoreEnter = false; - private bool _In_DSOTabPanel_Enter=false; - /// - /// When a Word document is selected make sure it's tab is activated and - /// the SelectedItem for the DisplayTabControl is updated. - /// - /// - /// - private void DSOTabPanel_Enter(object sender, EventArgs e) - { - if (IgnoreEnter) return; - _MyTransparentPanel.SendToBack(); - - // Set whether this worddoc is in view/edit mode by checking whether the - // procedure is in view/edit mode (based on the steppanel. This occurs on - // the enter event so that the mode is determined any time this panel becomes - // active. - // find steptabpanel and its view/edit. If it doesn't have a steptabpanel - // use default - edit. Later when we have ownership, need to use that. - PanelViewEditMode = E_ViewMode.Edit; // default to edit - if (MyDisplayTabItem.MyItemInfo != null) // lib doc with no associated active procedure defaults to edit - { - StepTabPanel stpanel = _MyDisplayTabControl.GetProcedureTabPanel(MyDisplayTabItem.MyItemInfo); - PanelViewEditMode = (stpanel == null) ? E_ViewMode.Edit : stpanel.MyStepPanel.VwMode; - } - try - { - //_MyDSOFramer.EventsEnabled = true; - //_MyEdWord.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow; - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.ErrorFormat("DSOTabPage_Enter", ex); - } - if (_In_DSOTabPanel_Enter) return; - //vlnStackTrace.ShowStack("DSOTabPanel_Enter {0} DocID {1} Index {2} {3}",_In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName); - _In_DSOTabPanel_Enter = true; - if (MyDisplayTabItem.MyItemInfo != null) - _MyDisplayTabControl.OnItemSelectedChanged(this,new ItemSelectedChangedEventArgs(MyDisplayTabItem.MyItemInfo)); - _MyEdWord.Focus(); - _In_DSOTabPanel_Enter = false; - _MyDisplayTabControl.SelectedDisplayTabItem = MyDisplayTabItem; - } - #endregion - #region Public Methods - private bool _IsBeingDeleted = false; - public bool IsBeingDeleted - { - get { return _IsBeingDeleted; } - set { _IsBeingDeleted = value; } - } - /// - /// Cleans-up the DSO Framer window - /// - /// - public bool CloseDSO() - { - return CloseDSO(false); - } - /// - /// Cleans-up the DSO Framer window - /// - /// - /// - public bool CloseDSO(bool force) - { - _MyLog.Debug("CloseDSO"); - bool result = true; - try - { - if (_MyEdWord != null) - { - SaveDSO_Phase1(); - _MyEdWord.CloseDoc(); - Controls.Remove(_MyEdWord); - components.Remove(_MyEdWord); - _MyEdWord.Dispose(); - _MyEdWord = null; - _Count--; - } - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("SaveDSO - " + this.Name, ex); - result = false; - } - return result; - } - /// - /// Activates the current DSO Framer window (Word) - /// - public void Activate() - { - try - { - //this._MyEdWord.Activate(); - //if (_MyCount <= MSWordLimit) - // this._MyEdWord.FrameHookPolicy = DSOFramer.dsoFrameHookPolicy.dsoResetNow; - } - catch (Exception ex) - { - if (_MyLog.IsErrorEnabled) _MyLog.Error("Activate", ex); - } - } - #endregion - #region DocumentProperties - - private string GetReflectiveProperty(object objectToInspect, string propertyName) - { - string returnString = ""; - //To use reflection on an object, you - // first need to get an instance - // of that object's type. - Type objectType = objectToInspect.GetType(); - //After you have the object's type, you can get - // information on that type. In this case, we're - // asking the type to tell us all the - // properties that it contains. - PropertyInfo[] properties = objectType.GetProperties(); - //You can then use the PropertyInfo array - // to loop through each property of the type. - foreach (PropertyInfo property in properties) - { - //The interest part of this code - // is the GetValue method. This method - // returns the value of the property. - if(property.Name == propertyName) - return property.GetValue(objectToInspect, null).ToString(); - } - return null; - } - #endregion - public override string ToString() - { - return string.Format("DSOTabPanel Document {0}", MyDocumentInfo.DocID); - } - } -} diff --git a/PROMS/Volian.Controls.Library/DisplayHistory.cs.bak b/PROMS/Volian.Controls.Library/DisplayHistory.cs.bak deleted file mode 100644 index a5404609..00000000 --- a/PROMS/Volian.Controls.Library/DisplayHistory.cs.bak +++ /dev/null @@ -1,1031 +0,0 @@ -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; -using System.Text.RegularExpressions; - -namespace Volian.Controls.Library -{ - public partial class DisplayHistory : UserControl - { - #region Events - public event DisplayHistoryReportEvent ChronologyPrintRequest; - public event DisplayHistoryReportEvent SummaryPrintRequest; - private void OnChronologyPrintRequest(DisplayHistoryReportEventArgs args) - { - if (ChronologyPrintRequest != null) - ChronologyPrintRequest(this, args); - } - private void OnSummaryPrintRequest(DisplayHistoryReportEventArgs args) - { - if (SummaryPrintRequest != null) - SummaryPrintRequest(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); - } - public event AnnotationRestoredHandler AnnotationRestored; - private void OnAnnotationRestored(AnnotationInfo restoredAnnotationInfo, ItemInfo currentItem) - { - if (AnnotationRestored != null) AnnotationRestored(restoredAnnotationInfo, currentItem); - } - #endregion - private ContentAuditInfoList _ChronologyAuditList; - private ContentAuditInfoList _SummaryAuditList; - private AnnotationAuditInfoList _AnnotationList; - private ProcedureInfo _MyProcedureInfo; - public ProcedureInfo MyProcedureInfo - { - get { return _MyProcedureInfo; } - set - { - if (value is ProcedureInfo && _MyProcedureInfo is ProcedureInfo && value.ItemID == _MyProcedureInfo.ItemID) - return; - _MyProcedureInfo = value; - if (value == null) return; - SetRevDate(MyProcedureInfo.DTS); - if (_MyProcedureInfo != null && this.Visible) - WalkProcedure(); - } - } - private void SetRevDate(DateTime dts) - { - MyRevDate = dts; - RefreshRequired = true; - } - private ItemInfo _MyItemInfo; - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - set - { - if (value is ItemInfo && _MyItemInfo is ItemInfo && value.ItemID == _MyItemInfo.ItemID) - return; - _MyItemInfo = value; - if (_MyItemInfo != null) - { - MyProcedureInfo = _MyItemInfo.MyProcedure; - this.Visible = true; - UpdateHistory(); - if (this.lbChanges.Visible && RefreshRequired) - { - WalkProcedure(); - } - } - else - this.Visible = false; - } - } - private EditItem _MyEditItem; - public EditItem MyEditItem - { - get { return _MyEditItem; } - set - { - _MyEditItem = value; - if (value != null) - MyItemInfo = value.MyItemInfo; - else - MyItemInfo = null; - } - } - public void RefreshList() - { - if (MyEditItem == null) - this.Visible = false; - if (this.Visible) - { - WalkProcedure(); - UpdateHistory(); - } - } - private int _ApplDisplayMode = -1; - public int ApplDisplayMode - { - get { return _ApplDisplayMode; } - set - { - if (MyProcedureInfo == null) return; - _ApplDisplayMode = value; - RefreshRequired = true; - if (_ApplDisplayMode > 0) - { - MyProcedureInfo.MyProcedure.MyContent.RefreshContentDetails(); - ProcedureConfig cfg = MyProcedureInfo.MyConfig as ProcedureConfig; - cfg.SelectedSlave = value; - if (cfg.Print_RevDate == null || cfg.Print_RevDate == string.Empty) - SetRevDate(MyProcedureInfo.DTS); - else - SetRevDate(DateTime.Parse(cfg.Print_RevDate)); - } - else - { - DateTime minDts = DateTime.MaxValue; - for (int j = 1; j <= MyProcedureInfo.MyDocVersion.DocVersionConfig.Unit_Count; j++) - { - ProcedureConfig cfg = MyProcedureInfo.MyConfig as ProcedureConfig; - cfg.SelectedSlave = j; - if (cfg.Print_RevDate != null && cfg.Print_RevDate != string.Empty) - { - if (DateTime.Parse(cfg.Print_RevDate) < minDts && DateTime.Parse(cfg.Print_RevDate) > MyProcedureInfo.DTS) - minDts = DateTime.Parse(cfg.Print_RevDate); - } - else - minDts = MyProcedureInfo.DTS; - } - SetRevDate(minDts); - } - } - } - private DateTime _MyRevDate; - public DateTime MyRevDate - { - get { return _MyRevDate; } - set { _MyRevDate = value; } - } - private bool RefreshRequired = false; - public DisplayHistory() - { - InitializeComponent(); - myRTB.FormatFont = null; - RefreshRequired = true; - //tabControl1.SelectedTab = tabItem2;// Start with Change List - } - private void lbChanges_VisibleChanged(object sender, System.EventArgs e) - { - if (ApplDisplayMode == -1) - { - ApplDisplayMode = 0; - } - if (RefreshRequired) - { - Console.WriteLine("before walkprocedure - {0}", DateTime.Now.ToLongTimeString()); - WalkProcedure(); - Console.WriteLine("after walkprocedure - {0}", DateTime.Now.ToLongTimeString()); - } - } - - private void lbChanges_SelectedIndexChanged(object sender, EventArgs e) - { - if (lbChanges.SelectedIndex > -1) - { - ContentAuditInfo cai = lbChanges.SelectedItem as ContentAuditInfo; - if (cai != null) - { - if (cai.DeleteStatus > 0) - MessageBox.Show("This item has been deleted.","Deleted Item",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); - else - OnHistorySelectionChanged(new DisplayHistoryEventArgs(cai.ItemID)); - } - 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(); - tvAudits.Nodes.Clear(); - if (MyItemInfo == null) - { - this.Cursor = Cursors.Default; - return; - } - MyItemInfo.RefreshItemAnnotations(); - #endregion - //if (AnnotationOnly) - //{ - #region annotation deleted - //annotation deleted by itemid - TreeNode annotationDeleted = null; - AnnotationAuditInfoList aail = AnnotationAuditInfoList.GetByItemID(MyItemInfo.ItemID); - foreach (AnnotationAuditInfo aai in aail) - { - TreeNode tn = null; - if (aai.DeleteStatus > 0) - { - if (annotationDeleted == null) - annotationDeleted = tvAudits.Nodes.Add("Deleted Annotations"); - if (tn == null) - { - AnnotationTypeInfo ati = AnnotationTypeInfo.Get(aai.TypeID); - tn = annotationDeleted.Nodes.Add(ati.Name); - } - TreeNode cn = tn.Nodes.Add(aai.ListString()); - cn.Tag = aai; - } - } - //end annotation deleted - #endregion - #region annotation changes - //annotation change by annotationid - TreeNode annotationHistory = null; - if (MyItemInfo.ItemAnnotationCount > 0) - { - foreach (AnnotationInfo ai in MyItemInfo.ItemAnnotations) - { - TreeNode tn = null; - aail = AnnotationAuditInfoList.GetByAnnotationID(ai.AnnotationID); - foreach (AnnotationAuditInfo aai in aail) - { - if (aai.DTS != ai.DTS) - { - if (annotationHistory == null) - annotationHistory = tvAudits.Nodes.Add("Annotation History"); - if (tn == null) - tn = annotationHistory.Nodes.Add(string.Format("{0} - {1}", ai.MyAnnotationType.Name, ai.SearchText)); - TreeNode cn = tn.Nodes.Add(aai.ToString()); - cn.Tag = aai; - } - } - } - } - //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) - { - if (cai.DeleteStatus == 0) - { - if (cai.Type == 20008) - { - GridAuditInfoList gail = GridAuditInfoList.Get(cai.ContentID); - foreach (GridAuditInfo gai in gail) - { - if (gai.DeleteStatus == 0) - { - if (contentHistory == null) - contentHistory = tvAudits.Nodes.Add("Content Changes"); //contentHistory = tvAudits.Nodes.Add("Content History"); - TreeNode tn = contentHistory.Nodes.Add(gai.ToString()); - tn.Tag = gai; - } - } - break; - } - else if (cai.DTS != ci.DTS) - { - if (contentHistory == null) - contentHistory = tvAudits.Nodes.Add("Content Changes"); //contentHistory = tvAudits.Nodes.Add("Content History"); - TreeNode tn = contentHistory.Nodes.Add(cai.ListString()); - tn.Tag = cai; - } - } - } - //end content changes - #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 - if (deletedItems == null) - deletedItems = tvAudits.Nodes.Add("Deleted Items"); - TreeNode tnn = deletedItems.Nodes.Add(iai.ToString()); - tnn.Tag = iai; - #endregion - } - //Console.WriteLine("UpdateHistory: {0} seconds",TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalSeconds); - this.Cursor = Cursors.Default; - } - private void WalkProcedure() - { - //return; - this.ParentForm.Cursor = Cursors.WaitCursor; - Application.DoEvents(); - //DateTime start = DateTime.Now; - //Console.WriteLine(start); - lbChanges.Items.Clear(); - if (MyProcedureInfo == null) - { - this.Cursor = Cursors.Default; - btnViewSummaryReport.Enabled = btnViewChronologyReport.Enabled = lbChanges.Items.Count > 0; - return; - } - ContentAuditInfoList cail2; - ContentAuditInfoList cail3; - AnnotationAuditInfoList aail2; - if (ApplDisplayMode > 0) - { - cail2 = ContentAuditInfoList.GetChronologyByUnit(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID, false, ApplDisplayMode); - cail3 = ContentAuditInfoList.GetSummaryByUnit(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID, false, ApplDisplayMode); - aail2 = AnnotationAuditInfoList.GetChronologyByUnit(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID, ApplDisplayMode); - } - else - { - cail2 = ContentAuditInfoList.GetChronology(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID, false); - cail3 = ContentAuditInfoList.GetSummary(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID, false); - aail2 = AnnotationAuditInfoList.GetChronology(MyProcedureInfo.ItemID, MyProcedureInfo.ItemID); - } - //Console.WriteLine("WalkProcedure cail2: {0} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalSeconds); - _ChronologyAuditList = cail2; - _SummaryAuditList = cail3; - //Console.WriteLine("WalkProcedure aail2: {0} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalSeconds); - _AnnotationList = aail2; - foreach (ContentAuditInfo cai in cail2) - { - if (cai.DTS > MyRevDate || cai.ActionWhen > MyRevDate) - { - string itemTitle = FixPath(cai.Path); - lbChanges.Items.Add(cai); - } - } - foreach (AnnotationAuditInfo aai in aail2) - { - string stepnum = string.Empty; - foreach (ContentAuditInfo cai in cail2) - { - if (cai.ContentID == aai.IContentID) - { - stepnum = FixPath(cai.Path); - break; - } - } - if (stepnum == string.Empty) - { - ItemInfo iii = aai.MyItemInfo; - if(iii != null) - stepnum = FixPath(iii.SearchPath); - } - if (aai.DTS > MyRevDate) - lbChanges.Items.Add(aai); - } - //Console.WriteLine("WalkProcedure fini: {0} seconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalSeconds); - this.ParentForm.Cursor = Cursors.Default; - btnViewSummaryReport.Enabled = btnViewChronologyReport.Enabled = lbChanges.Items.Count > 0; - RefreshRequired = false; - return; - #region oldstuff - //string itemType = string.Empty; - //lbChanges.Items.Clear(); - //ItemInfo myproc = _MyItemInfo.MyProcedure; - //ItemInfo ii = myproc; - //int lenNumber = myproc.DisplayNumber.Length + 2; - //if (ii == null) return; - //while (ii != null && ii.MyProcedure.ItemID == myproc.ItemID) - //{ - // itemType = ii.IsCaution ? "Caution for" : ii.IsNote ? "Note for" : ii.IsStep ? "Step" : "Item"; - // //items - // if (ii.IsItemNew) - // { - // lbChanges.Items.Add(string.Format("{4} {0} added by {1} on {2} @ {3}", ii.ShortPath.Substring(lenNumber), ii.UserID, ii.DTS.ToShortDateString(), ii.DTS.ToShortTimeString(), itemType)); - // //int k = lbChanges.Items.Add(string.Format("{0} @ {1} - {2}", "Item Added", ii.DTS.ToString(), ii.DisplayText)); - // //ListViewItem lvi = new ListViewItem("Item Added"); - // //lvi.SubItems.Add(ii.ItemID.ToString()); - // //lvi.SubItems.Add(ii.DTS.ToString()); - // //lvi.SubItems.Add(ii.DisplayText); - // //lvi.SubItems.Add(ii.ShortPath.Substring(lenNumber)); - // //listView1.Items.Add(lvi); - // if (ii.IsItemChanged) - // { - // ContentAuditInfoList cail = ContentAuditInfoList.Get(ii.ContentID); - // if (cail.Count > 0) - // { - // foreach (ContentAuditInfo cai in cail) - // { - // if (cai.Text != string.Empty) - // { - // lbChanges.Items.Add(string.Format("{4} {0} changed by {1} on {2} @ {3}", ii.ShortPath.Substring(lenNumber), ii.MyContent.UserID, ii.MyContent.DTS.ToShortDateString(), ii.MyContent.DTS.ToShortTimeString(), itemType)); - // } - // } - // } - // } - // } - // else if (ii.IsItemChanged) - // { - // //Results.Add(ii); - // lbChanges.Items.Add(string.Format("{4} {0} changed by {1} on {2} @ {3}", ii.ShortPath.Substring(lenNumber), ii.MyContent.UserID, ii.MyContent.DTS.ToShortDateString(), ii.MyContent.DTS.ToShortTimeString(), itemType)); - // //int k = lbChanges.Items.Add(string.Format("{0} @ {1} - {2}", "Content Changed", ii.DTS.ToString(), ii.DisplayText)); - // //ListViewItem lvi = new ListViewItem("Item Changed"); - // //lvi.SubItems.Add(ii.ItemID.ToString()); - // //lvi.SubItems.Add(ii.MyContent.DTS.ToString()); - // //lvi.SubItems.Add(ii.DisplayText); - // //lvi.SubItems.Add(ii.ShortPath.Substring(lenNumber)); - // //listView1.Items.Add(lvi); - // } - // ItemAuditInfoList iail = ItemAuditInfoList.Get(ii.ItemID); - // foreach (ItemAuditInfo iai in iail) - // { - // if (iai.DeleteStatus > 0 && iai.Level == 1) - // { - // lbChanges.Items.Add(string.Format("{4} after {0} deleted by {1} on {2} @ {3}", ii.ShortPath.Substring(lenNumber), iai.UserID, iai.DTS.ToShortDateString(), iai.DTS.ToShortTimeString(), itemType)); - // //int k = lbChanges.Items.Add(string.Format("{0} @ {1} - {2}", "Item Deleted", ii.DTS.ToString(), "TODO: figure out how to get iai.DisplayText")); - // //ListViewItem lvi = new ListViewItem("Item Deleted"); - // //lvi.SubItems.Add(iai.ItemID.ToString()); - // //lvi.SubItems.Add(iai.DTS.ToString()); //iai.MyContent.DTS.ToString() - // //lvi.SubItems.Add("TODO: figure out how to get iai.DisplayText"); //TODO: figure out how to get iai.DisplayText - // //lvi.SubItems.Add("After " + ii.ShortPath.Substring(lenNumber)); - // } - // else - // { - // PartAuditInfoList pail = null; - // pail = PartAuditInfoList.GetByItemID(iai.ItemID); - // if (pail.Count > 0) - // { - // foreach (PartAuditInfo pai in pail) - // { - // itemType = pai.FromType == 3 ? "Caution for" : pai.FromType == 4 ? "Note for" : pai.FromType == 6 ? "Step" : "Item" + pai.FromType.ToString(); - // lbChanges.Items.Add(string.Format("{4} {0} deleted by {1} on {2} @ {3}", ii.ShortPath.Substring(lenNumber), iai.UserID, iai.DTS.ToShortDateString(), iai.DTS.ToShortTimeString(), itemType)); - // } - // } - // } - // } - // //annotations - // if (ii.ItemAnnotations != null) - // { - // foreach (AnnotationInfo ai in ii.ItemAnnotations) - // { - // if (ai.IsAnnotationNew) - // { - // int k = lbChanges.Items.Add(string.Format("{0} @ {1} - {2}", "Annotation Added", ai.DTS.ToString(), ai.SearchText)); - // //ListViewItem lvi = new ListViewItem("Annotation Added"); - // //lvi.SubItems.Add(ai.AnnotationID.ToString()); - // //lvi.SubItems.Add(ai.DTS.ToString()); - // //lvi.SubItems.Add(ai.SearchText); - // //lvi.SubItems.Add(ii.ShortPath.Substring(lenNumber)); - // //listView1.Items.Add(lvi); - // } - // else - // { - // int k = lbChanges.Items.Add(string.Format("{0} @ {1} - {2}", "Annotation Changed", ai.DTS.ToString(), ai.SearchText)); - // //ListViewItem lvi = new ListViewItem("Annotation Changed"); - // //lvi.SubItems.Add(ai.AnnotationID.ToString()); - // //lvi.SubItems.Add(ai.DTS.ToString()); - // //lvi.SubItems.Add(ai.SearchText); - // //lvi.SubItems.Add(ii.ShortPath.Substring(lenNumber)); - // //listView1.Items.Add(lvi); - // } - // } - // AnnotationAuditInfoList aail = AnnotationAuditInfoList.GetByItemID(ii.ItemID); - // foreach (AnnotationAuditInfo aai in aail) - // { - // if (aai.DeleteStatus > 0) - // { - // int k = lbChanges.Items.Add(string.Format("{0} @ {1} - {2}", "Annotation Deleted", aai.DTS.ToString(), aai.SearchText)); - // //ListViewItem lvi = new ListViewItem("Annotation Deleted"); - // //lvi.SubItems.Add(aai.AnnotationID.ToString()); - // //lvi.SubItems.Add(aai.DTS.ToString()); - // //lvi.SubItems.Add(aai.SearchText); - // //lvi.SubItems.Add(ii.ShortPath.Substring(lenNumber)); - // //listView1.Items.Add(lvi); - // } - // } - // } - // //content changes - // //ContentAuditInfoList cail = ContentAuditInfoList.Get(ii.MyContent.ContentID); - // //foreach (ContentAuditInfo cai in cail) - // //{ - // // int k = lbChanges.Items.Add(string.Format("{0} @ {1} - {2}", "Content Changed", cai.DTS.ToString(), cai.Text)); - // //ListViewItem lvi = new ListViewItem("Content Changed"); - // //lvi.SubItems.Add(cai.ContentID.ToString()); - // //lvi.SubItems.Add(cai.DTS.ToString()); - // //lvi.SubItems.Add(cai.Text); - // //lvi.SubItems.Add(ii.ShortPath.Substring(lenNumber)); - // //listView1.Items.Add(lvi); - // //} - // ii = ii.SearchNext; - //} - //btnViewSummaryReport.Enabled = btnViewChronologyReport.Enabled = lbChanges.Items.Count > 0; - //RefreshRequired = false; - #endregion - } - private static string FixPath(string path) - { - string itemTitle = Regex.Replace(path, "^..+?\\u0007", ""); - itemTitle = itemTitle.Replace("\x11", itemTitle[0] == '\x11' ? "" : " - ").Replace("\\u8209?", "-"); - return itemTitle; - } - private void btnViewChronologyReport_Click(object sender, EventArgs e) - { - RefreshList(); - //if (lbChanges.Items.Count > 0) - //{ - //jcb added 20120425 to suppress annotations in report - _AnnotationList = AnnotationAuditInfoList.GetChronology(0, 0); - //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)); - //} - } - private void btnViewSummaryReport_Click(object sender, EventArgs e) - { - RefreshList(); - //if (lbChanges.Items.Count > 0) - //{ - //jcb added 20120425 to suppress annotations in report - _AnnotationList = AnnotationAuditInfoList.GetChronology(0, 0); - //added setting selected slave in order for reports to replace unit number,etc jcb 20101010 - MyItemInfo.MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = ApplDisplayMode; - OnSummaryPrintRequest(new DisplayHistoryReportEventArgs(Volian.Base.Library.VlnSettings.TemporaryFolder + @"\MySummary.pdf", MyItemInfo.MyProcedure, _SummaryAuditList, _AnnotationList)); - //} - } - private void btnRefresh_Click(object sender, EventArgs e) - { - RefreshList(); - } - private void btnRestore_Click(object sender, EventArgs e) - { - TreeNode tn = tvAudits.SelectedNode; - if (tn.Tag is ContentAuditInfo) - { - ContentAuditInfo cai = tn.Tag as ContentAuditInfo; - if (MessageBox.Show(this, "Do you want to restore this content change?", "Confirm Content Change Restore", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes) - { - ContentInfo ci = ContentInfo.RestoreContent(cai); - RefreshRequired = true; - UpdateHistory(); - myRTB.Clear(); - myVFG.Clear(); - MyEditItem.SetAllTabs(); - } - } - if (tn.Tag is ItemAuditInfo) - { - ItemAuditInfo iai = tn.Tag as ItemAuditInfo; - if (MessageBox.Show(this, string.Format("Do you want to restore this {0}?",iai.ItemType), string.Format("Confirm {0} Restore",iai.ItemType), MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes) - { - //Console.WriteLine("DisplayHistory.btnRestore_Click @ {0}", DateTime.Now); - ItemInfo ii = null; - if (iai.Level == 2) - { - ii = MyItemInfo.RestoreItem(iai); - - //_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) - ii = SectionInfo.Get(ii.ItemID); - else if (ii.IsProcedure) - ii = ProcedureInfo.Get(ii.ItemID); - if (nextItem != null) - { - switch (nextItem.MyChildRelation) - { - case ChildRelation.None: - break; - case ChildRelation.After: - MyEditItem.AddChildAfter(ii, nextItem); - break; - case ChildRelation.Before: - MyEditItem.AddChildBefore(ii, nextItem); - break; - case ChildRelation.RNO: - MyEditItem.AddChildRNO(ii, nextItem); - break; - default: - break; - } - } - else - { - switch ((E_FromType)ii.ItemParts[0].FromType) - { - case E_FromType.Caution: - MyEditItem.AddChildBefore(ii, nextItem); - break; - case E_FromType.Note: - MyEditItem.AddChildBefore(ii, nextItem); - break; - case E_FromType.Procedure: - MyEditItem.AddChildAfter(ii, nextItem); - break; - case E_FromType.RNO: - MyEditItem.AddChildRNO(ii, nextItem); - break; - case E_FromType.Section: - MyEditItem.AddChildAfter(ii, nextItem); - break; - case E_FromType.Step: - MyEditItem.AddChildAfter(ii, nextItem); - break; - case E_FromType.Table: - MyEditItem.AddChildAfter(ii, nextItem); - break; - default: - MyEditItem.AddChildAfter(ii, nextItem); - break; - } - } - } - else - { - ii = MyItemInfo.RestoreSibling(iai); - if (ii.IsStep) - ii = StepInfo.Get(ii.ItemID); - else if (ii.IsSection) - ii = SectionInfo.Get(ii.ItemID); - else if (ii.IsProcedure) - ii = ProcedureInfo.Get(ii.ItemID); - EditItem nextItem = iai.Level == 0 ? MyEditItem : MyEditItem.MyNextEditItem; - switch (MyEditItem.MyChildRelation) - { - case ChildRelation.None: - break; - case ChildRelation.After: - MyEditItem.ActiveParent.AddChildAfter(ii, nextItem); - break; - case ChildRelation.Before: - MyEditItem.ActiveParent.AddChildBefore(ii, nextItem); - break; - case ChildRelation.RNO: - MyEditItem.ActiveParent.AddChildRNO(ii, nextItem); - break; - default: - break; - } - ii.UpdateTransitionText(); - } - if(MyEditItem.MyPreviousEditItem != null) - MyEditItem.MyPreviousEditItem.SetAllTabs(); - else - MyEditItem.SetAllTabs(); - RefreshRequired = true; - UpdateHistory(); - myRTB.Clear(); - myVFG.Clear(); - } - } - if (tn.Tag is AnnotationAuditInfo) - { - AnnotationAuditInfo aai = tn.Tag as AnnotationAuditInfo; - if (MessageBox.Show(this, "Do you want to restore this annotation?", "Confirm Annotation Restore", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes) - { - AnnotationInfo ai = AnnotationInfo.RestoreAnnotation(aai); - OnAnnotationRestored(ai, ai.MyItem); - RefreshRequired = true; - UpdateHistory(); - myRTB.Clear(); - myVFG.Clear(); - } - } - if (tn.Tag is GridAuditInfo) - { - GridAuditInfo gai = tn.Tag as GridAuditInfo; - if (MessageBox.Show(this, "Do you want to restore this table?", "Confirm Table Restore", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes) - { - ContentAuditInfo cai = ContentAuditInfo.Get(gai.ContentAuditID); - ContentInfo ci = ContentInfo.RestoreContent(cai); - RefreshRequired = true; - UpdateHistory(); - myRTB.Clear(); - myVFG.Clear(); - } - } - } - private void DisplayTagRTF(TreeNode tn) - { - if (tn.Tag != null) - { - if (tn.Tag is GridAuditInfo) - { - btnRestore.Enabled = true; - GridAuditInfo gai = tn.Tag as GridAuditInfo; - myVFG.Visible = true; - myVFG.BringToFront(); - panel1.Invalidate(new Rectangle(0, 0, myVFG.Width + 4, 4)); - panel1.Invalidate(new Rectangle(0, 0, 4, myVFG.Height + 4)); - myRTB.Visible = false; - panel1.Visible = false; - using (StringReader sr = new StringReader(gai.Data)) - { - myVFG.ReadXml(sr); - sr.Close(); - } - panel1.Visible = true; - return; - } - if (tn.Tag is ContentAuditInfo) - { - btnRestore.Enabled = true; - myVFG.Clear(); - ContentAuditInfo cai = tn.Tag as ContentAuditInfo; - GridAuditInfoList gail = GridAuditInfoList.Get(cai.ContentID); - if (gail.Count > 0) - { - foreach (GridAuditInfo gai in gail) - { - if (gai.DTS == cai.DTS) - { - myVFG.Visible = true; - myVFG.BringToFront(); - myRTB.Visible = false; - using (StringReader sr = new StringReader(gai.Data)) - { - myVFG.ReadXml(sr); - sr.Close(); - } - return; - } - } - } - else - { - 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); - } - } - if (tn.Tag is ItemAuditInfo) - { - btnRestore.Enabled = true; - ItemAuditInfo iai = tn.Tag as ItemAuditInfo; - ContentAuditInfoList cail = ContentAuditInfoList.Get(iai.ContentID); - foreach (ContentAuditInfo cai in cail) - { - 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); - } - } - } - if (tn.Tag is AnnotationAuditInfo) - { - btnRestore.Enabled = true; - AnnotationAuditInfo iai = tn.Tag as AnnotationAuditInfo; - myRTB.Font = new Font("Arial", 12, FontStyle.Regular); - myRTB.Rtf = iai.RtfText; - //myRTB.Rtf = iai.RtfText; - } - } - else - { - btnRestore.Enabled = false; - myRTB.Clear(); - myVFG.Clear(); - } - } - private void tvAudits_AfterSelect(object sender, TreeViewEventArgs e) - { - DisplayTagRTF(e.Node); - } - private void DisplayHistory_Resize(object sender, EventArgs e) - { - tvAudits.Height = ((tcpDetail.Height - btnRestore.Height) / 4) * 3; - } - - private void DisplayHistory_VisibleChanged(object sender, EventArgs e) - { - //this.tabControl1.SelectedTab = tabItem2; - //if(this.lbChanges.Visible)this.RefreshList(); - //add jcb 20121008 - //if (this.lbChanges.Visible && RefreshRequired) - // WalkProcedure(); - //end jcb 20121008 - } - public void RefreshChangeList() - { - myTimer.Enabled = false; - myTimer.Enabled = true; - } - private void myTimer_Tick(object sender, System.EventArgs e) - { - myTimer.Enabled = false; - if (this.lbChanges.Visible) - this.tabControl1.SelectedTab = tabItem2; - UpdateHistory(); - RefreshRequired = true; - } - - } - - public delegate void ItemRestoredHandler(ItemInfo restoredItemInfo); - public delegate void AnnotationRestoredHandler(AnnotationInfo restoredAnnotationInfo, ItemInfo currentItem); - public delegate void DisplayHistoryReportEvent(object sender, DisplayHistoryReportEventArgs args); - public delegate void DisplayHistoryEvent(object sender, DisplayHistoryEventArgs args); - public class DisplayHistoryReportEventArgs - { - private string _ReportName; - public string ReportTitle - { - get { return _ReportName; } - set { _ReportName = value; } - } - private ProcedureInfo _ProcedureInfo; - public ProcedureInfo ProcedureInfo - { - get { return _ProcedureInfo; } - set { _ProcedureInfo = value; } - } - private ContentAuditInfoList _AuditList; - public ContentAuditInfoList AuditList - { - get { return _AuditList; } - set { _AuditList = value; } - } - private AnnotationAuditInfoList _AnnotationList; - public AnnotationAuditInfoList AnnotationList - { - get { return _AnnotationList; } - set { _AnnotationList = value; } - } - - public DisplayHistoryReportEventArgs(string reportName, ProcedureInfo procedureInfo, ContentAuditInfoList auditList, AnnotationAuditInfoList annotationList) - { - _ReportName = reportName; - _ProcedureInfo = procedureInfo; - _AuditList = auditList; - _AnnotationList = annotationList; - } - } - public class DisplayHistoryEventArgs - { - private int _ItemID; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - public DisplayHistoryEventArgs(int itemID) - { - _ItemID = itemID; - } - } -} - diff --git a/PROMS/Volian.Controls.Library/DisplayRO.cs.bak b/PROMS/Volian.Controls.Library/DisplayRO.cs.bak deleted file mode 100644 index cea4a255..00000000 --- a/PROMS/Volian.Controls.Library/DisplayRO.cs.bak +++ /dev/null @@ -1,885 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Text; -using System.IO; -using System.Windows.Forms; -using VEPROMS.CSLA.Library; -using XYPlots; -using DevComponents.DotNetBar; - -namespace Volian.Controls.Library -{ - public partial class DisplayRO : UserControl - { - #region Properties - private DisplayTabControl _TabControl; - - public DisplayTabControl TabControl - { - get { return _TabControl; } - set { _TabControl = value; } - } - private ROFstInfo _CurROFST = null; - private ROFstInfo _MyROFST; - public ROFstInfo MyROFST - { - get { return _MyROFST; } - set - { - if (!Visible) return; // don't reset anything if the form is invisible. - _MyROFST = value; // define the tree nodes based on this rofst - LoadTree(); - } - } - private RoUsageInfo _CurROLink; - public RoUsageInfo CurROLink - { - get { return _CurROLink; } - set - { - if (!Visible) return; // don't reset anything if the form is invisible. - if (value != null) // modify - set the controls to the current ro - { - if (_CurROLink == value) return; - _CurROLink = value; - _SavCurROLink = _CurROLink; - UpdateROTree(); - } - else // insert - clear out controls - { - _CurROLink = value; - tbROValue.Text = null; - lbROId.Text = ""; - tvROFST.SelectedNode = null; - btnSaveRO.Enabled = btnCancelRO.Enabled = false; - } - } - } - private RoUsageInfo _SavCurROLink; - private StepRTB _MyRTB; - public StepRTB MyRTB - { - get { return _MyRTB; } - set - { - if (!Visible) return; - if (_MyRTB != null) - { - _MyRTB.LinkChanged -= new StepRTBLinkEvent(_MyRTB_LinkChanged); - _MyRTB.SelectionChanged -= new EventHandler(_MyRTB_SelectionChanged); - } - if (value == null) return; - _MyRTB = value; - _MyRTB.LinkChanged += new StepRTBLinkEvent(_MyRTB_LinkChanged); - _MyRTB.SelectionChanged+=new EventHandler(_MyRTB_SelectionChanged); - if (_MyRTB.MyLinkText == null) - { - CurROLink = null; - _SavCurROLink = null; - } - } - } - - void _MyRTB_SelectionChanged(object sender, EventArgs e) - { - lbFound.SelectionMode = SelectionMode.None; - lbFound.DataSource = null; - //Spin through ROs looking for the selected text - string lookFor = _MyRTB.SelectedText; - List children = _MyROFST.ROFSTLookup.GetRosByValue(lookFor); - if (children != null) - { - lbFound.Visible = true; - lbFound.DataSource = children.ToArray(); - lbFound.SelectionMode = SelectionMode.One; - lbFound.SelectedIndex = -1; - } - else - lbFound.Visible = false; - } - - void _MyRTB_LinkChanged(object sender, StepPanelLinkEventArgs args) - { - if (_MyRTB.MyLinkText == null) - CurROLink = null; - else - { - CurROLink = args.MyLinkText.MyRoUsageInfo; - } - } - - private DocVersionInfo _Mydvi; - - public DocVersionInfo Mydvi - { - get { return _Mydvi; } - set { _Mydvi = value; } - } - - - private ProgressBarItem _ProgressBar; - - public ProgressBarItem ProgressBar - { - get { return _ProgressBar; } - set { _ProgressBar = value; } - } - - //public int ProgBarMax - //{ - // get { return _ProgressBar.Maximum; } - // set { _ProgressBar.Maximum = value; } - //} - - //public int ProgBarValue - //{ - // get { return _ProgressBar.Value; } - // set { _ProgressBar.Value = value; } - //} - - //public string ProgBarText - //{ - // get { return _ProgressBar.Text; } - // set - // { - // _ProgressBar.TextVisible = true; - // _ProgressBar.Text = value; - // } - //} - - #endregion - #region Constructors - public DisplayRO() - { - InitializeComponent(); - _ProgressBar = null; - panelRoValue.BackColor = Color.Cornsilk; - panelValue.BackColor = Color.Cornsilk; - } - #endregion - #region Events - ROFSTLookup.rochild selectedChld; - private void tvROFST_AfterSelect(object sender, TreeViewEventArgs e) - { - tbROValue.Text = null; - lbROId.Text = ""; - btnCancelRO.Enabled = false; - btnSaveRO.Enabled = false; - btnPreviewRO.Enabled = false; - - if (e.Node.Tag is ROFSTLookup.rochild) - { - ROFSTLookup.rochild chld = (ROFSTLookup.rochild)e.Node.Tag; - selectedChld = chld; - if (chld.value != null) - { - RoUsageInfo SavROLink = null; - if (_SavCurROLink != null) - SavROLink = _SavCurROLink; ; - lbROId.Text = chld.appid; - btnSaveRO.Enabled = ((_SavCurROLink == null) || !(chld.roid.Equals(SavROLink))); - btnCancelRO.Enabled = ((_SavCurROLink != null) && !(chld.roid.Equals(SavROLink))); - switch (chld.type) - { - case 1: // standard (regular) text RO type - tbROValue.Text = chld.value; - btnPreviewRO.Enabled = false; - break; - case 2: // Table RO type - tbROValue.Text = "(Table)"; - btnPreviewRO.Enabled = true; - break; - case 4: // X/Y Plot RO type - tbROValue.Text = "(Graph)"; - btnPreviewRO.Enabled = true; - break; - case 8: // Intergrated Graphics RO type - tbROValue.Text = "(Image)"; - btnPreviewRO.Enabled = true; - break; - } - } - } - - - //if (e.Node.Tag is ROFST.rochild) - //{ - // ROFST.rochild chld = (ROFST.rochild)e.Node.Tag; - // if (chld.type == 1 && chld.value != null) - // { - // string SavROLink = ""; - // if (_SavCurROLink != null) - // SavROLink = _SavCurROLink.Substring(_SavCurROLink.IndexOf(' ') + 1, 12); - // tbROValue.Text = chld.value; - // btnSaveRO.Enabled = ((_SavCurROLink == null) || !(chld.roid.Equals(SavROLink))); - // btnCancelRO.Enabled = ((_SavCurROLink != null) && !(chld.roid.Equals(SavROLink))); - // } - // //else - // //{ - // // tbROValue.Text = null; - // // btnCancelRO.Enabled = btnSaveRO.Enabled = false; - // //} - //} - ////else - ////{ - //// tbROValue.Text = null; - //// btnCancelRO.Enabled = btnSaveRO.Enabled = false; - ////} - - } - - private void tvROFST_BeforeExpand(object sender, TreeViewCancelEventArgs e) - { - LoadChildren(e.Node); - } - private void LoadChildren(TreeNode tn) - { - object tag = tn.Tag; - if (tn.FirstNode != null && tn.FirstNode.Text != "VLN_DUMMY_FOR_TREE") return; // already loaded. - if (tn.FirstNode != null && tn.FirstNode.Text == "VLN_DUMMY_FOR_TREE") tn.FirstNode.Remove(); - ROFSTLookup.rochild[] chld = null; - - if (tn.Tag is ROFSTLookup.rodbi) - { - ROFSTLookup.rodbi db = (ROFSTLookup.rodbi)tn.Tag; - chld = db.children; - } - else if (tn.Tag is ROFSTLookup.rochild) - { - ROFSTLookup.rochild ch = (ROFSTLookup.rochild)tn.Tag; - chld = ch.children; - } - else - { - Console.WriteLine("error - no type"); - return; - } - // if children, add dummy node - if (chld != null && chld.Length > 0) - { - ProgressBar_Initialize(chld.Length, tn.Text); - for (int i = 0; i < chld.Length; i++) - { - ProgressBar_SetValue(i); - TreeNode tmp = null; - // if this is a group, i.e. type 0, add a dummy node - if (chld[i].type == 0 && chld[i].children == null) - //skip it. - // TODO: KBR how to handle this? - //Console.WriteLine("ro junk"); - continue; - else if (/*chld[i].type == 1 && */ chld[i].value == null) - { - tmp = new TreeNode(chld[i].title); - tmp.Tag = chld[i]; - tn.Nodes.Add(tmp); - TreeNode sub = new TreeNode("VLN_DUMMY_FOR_TREE"); - tmp.Nodes.Add(sub); - } - //else if (chld[i].type == 2 && chld[i].value == null) // table - //{ - // if ((_MyRTB.MyItemInfo.MyContent.Type % 10000) == (int)E_FromType.Table) - // { - // tmp = new TreeNode(chld[i].title); - // tmp.Tag = chld[i]; - // tn.Nodes.Add(tmp); - // TreeNode sub = new TreeNode("VLN_DUMMY_FOR_TREE"); - // tmp.Nodes.Add(sub); - // } - //} - else - { - tmp = new TreeNode(chld[i].title); - tmp.Tag = chld[i]; - tn.Nodes.Add(tmp); - } - } - } - ProgressBar_Clear(); - } - private void LoadTree() - { - if (_MyROFST == null) return; - if (_MyROFST == _CurROFST) return; - tvROFST.Nodes.Clear(); - _CurROFST = _MyROFST; - for (int i = 0; i < _MyROFST.ROFSTLookup.myHdr.myDbs.Length; i++) - { - TreeNode tn = new TreeNode(_MyROFST.ROFSTLookup.myHdr.myDbs[i].dbiTitle); - tn.Tag = _MyROFST.ROFSTLookup.myHdr.myDbs[i]; - tvROFST.Nodes.Add(tn); - AddDummyGroup(_MyROFST.ROFSTLookup.myHdr.myDbs[i], tn); - } - } - private void AddDummyGroup(ROFSTLookup.rodbi rodbi, TreeNode tn) - { - if (rodbi.children != null && rodbi.children.Length > 0) - { - TreeNode tmp = new TreeNode("VLN_DUMMY_FOR_TREE"); - tn.Nodes.Add(tmp); - } - } - private void UpdateROTree() - { - // walk down from root of tree, expanding values in the string - // that represents the ro link. - //string tmpstr = _CurROLink; - //int sp = tmpstr.IndexOf(" "); // because parse of ro info is wrong!! - //int rousageid = System.Convert.ToInt32(tmpstr.Substring(0, sp)); - ExpandTree(_CurROLink.ROID);// tmpstr.Substring(sp + 1, tmpstr.Length - sp - 1); - } - - private void ExpandTree(string roid) - { - string db = roid.Substring(0, 4); - bool multValSel = false; - if (roid.Length == 16) - multValSel = true; - - ROFSTLookup.rochild rochld = MyROFST.ROFSTLookup.GetRoChild(roid.Substring(0, 12).ToUpper()); - // use this to walk up tree until database - this is used to expand tree. - List path = new List(); - int myid = rochld.ID; - while (myid > 0) - { - path.Insert(0, myid); - myid = rochld.ParentID; - rochld = MyROFST.ROFSTLookup.GetRoChildFromID(myid); - if (rochld.ID == -1) myid = -1; - } - TreeNode tnExpand = null; - int titm = System.Convert.ToInt32(db); - // find database first - foreach (TreeNode tn in tvROFST.Nodes) - { - ROFSTLookup.rodbi thisdb = (ROFSTLookup.rodbi)tn.Tag; - if (thisdb.dbiID == titm) - { - LoadChildren(tn); - tnExpand = tn; - break; - } - } - if (tnExpand == null) return; // something went wrong? - // use the path id list to load/find the treeview's nodes. - foreach (int citm in path) - { - if (citm != System.Convert.ToInt32(db)) - { - LoadChildren(tnExpand); - tnExpand.Expand(); - foreach (TreeNode tn in tnExpand.Nodes) - { - ROFSTLookup.rochild chld = (ROFSTLookup.rochild)tn.Tag; - if (chld.ID == citm) - { - tnExpand = tn; - break; - } - } - } - } - - //if (tnExpand != null) tvROFST.SelectedNode = tnExpand; - - if (tnExpand != null) - { - // If a multiple return value, try to select the proper node - if (multValSel) - { - LoadChildren(tnExpand); - tnExpand.Expand(); - foreach (TreeNode tn in tnExpand.Nodes) - { - ROFSTLookup.rochild chld = (ROFSTLookup.rochild)tn.Tag; - if (chld.roid == roid) - { - tnExpand = tn; - break; - } - } - } - tvROFST.SelectedNode = tnExpand; - } - } - private void btnSaveRO_Click(object sender, EventArgs e) - { - if (tbROValue.Text == null || tbROValue.Text == "") - { - MessageBox.Show("Must select an RO Value from the tree."); - return; - } - Object obj = tvROFST.SelectedNode.Tag; - if (obj is ROFSTLookup.rochild) - { - ROFSTLookup.rochild roch = (ROFSTLookup.rochild)obj; - DisplayTabItem dti = _TabControl.SelectedDisplayTabItem; //.OpenItem(_ItemInfo); // open the corresponding procedure text - if (dti.MyDSOTabPanel != null) // A Word Document tab is the active tab - { - ROFSTLookup.rodbi[] dbs = MyROFST.ROFSTLookup.GetRODatabaseList(); - ROFSTLookup.rodbi db = dbs[int.Parse(roch.roid.Substring(0, 4))-1]; - string accPrefix = db.dbiAP.Replace(_Mydvi.DocVersionConfig.RODefaults_graphicsprefix,"IG"); - accPrefix = accPrefix.Replace(_Mydvi.DocVersionConfig.RODefaults_setpointprefix, "SP"); -// string accPrefix = (roch.type == 8) ? _Mydvi.DocVersionConfig.RODefaults_graphicsprefix : _Mydvi.DocVersionConfig.RODefaults_setpointprefix; - string AccPageID = string.Format("<{0}-{1}>", accPrefix, roch.appid);// makes for example - Console.WriteLine(AccPageID); - //string AccPageID = string.Format("{0} <{1}-{2}>", ConvertSymbolsAndStuff(selectedChld.value), accPrefix, roch.appid); // value and accesory ID - //string AccPageID = string.Format("{0} {1}", ConvertSymbolsAndStuff(selectedChld.value), string.Format(@"#Link:ReferencedObject: {0} {1}", roch.roid, _MyROFST.MyRODb.RODbID)); // value and link reference - //if (MessageBox.Show(AccPageID,"Place on Windows Clipboard?",MessageBoxButtons.YesNo) == DialogResult.Yes) - // Clipboard.SetText(AccPageID); - - // Insert the RO text at the current cursor position in the word document - // NOTE: assuming any type of RO can be put in an Accessory (MSWord) Document - if (dti.MyDSOTabPanel != null) - dti.MyDSOTabPanel.InsertText(AccPageID); - } - else if (_MyRTB != null) // a Procedure Steps section tab is active - { - _MyRTB.inRoAdd = true; - if (CheckROSelection(roch)) // check for RO type is valid for this type of step/substep - { - // the roid may be 12 or 16 chars long, with the last 4 set if there is unit specific - // menuing. Pad to 12 to store in the rousage table. - string padroid = (roch.roid.Length <= 12) ? roch.roid + "0000" : roch.roid; - string linktxt = string.Format(@"#Link:ReferencedObject: {0} {1}", padroid, _MyROFST.MyRODb.RODbID); - // Resolve symbols and scientific notation in the RO return value - string valtxt = ConvertSymbolsAndStuff(selectedChld.value); - _MyRTB.InsertRO(valtxt, linktxt); - _MyRTB.Select(_MyRTB.SelectionStart + valtxt.Length + linktxt.Length, 0); - _MyRTB.SaveText(); - _MyRTB.Focus(); - } - _MyRTB.inRoAdd = false; - btnSaveRO.Enabled = btnCancelRO.Enabled = btnPreviewRO.Enabled = false; - _SavCurROLink = null; - CurROLink = null; - } - //else // we're in an Word attachment - //{ - // string accPrefix = (roch.type == 8) ? _Mydvi.DocVersionConfig.RODefaults_graphicsprefix : _Mydvi.DocVersionConfig.RODefaults_setpointprefix; - // string AccPageID = string.Format("<{0}-{1}>", accPrefix, roch.appid); - // //TODO: CAN WE AUTOMATICALLY PLACE RO ONTO WORD ATTACHEMNT? - // //if (MessageBox.Show(AccPageID,"Place on Windows Clipboard?",MessageBoxButtons.YesNo) == DialogResult.Yes) - // // Clipboard.SetText(AccPageID); - // if (dti.MyDSOTabPanel != null) - // dti.MyDSOTabPanel.InsertText(AccPageID); - //} - } - } - - private bool CheckROSelection(ROFSTLookup.rochild selectedRO) - { - bool goodToGo = true; - bool replacingRO = (_SavCurROLink != null); - string insrpl = (replacingRO) ? "Cannot Replace" : "Cannot Insert"; - string errormsg = ""; - switch (selectedRO.type) - { - case 1: // regular text RO - if (_MyRTB.MyItemInfo.IsFigure) - { - errormsg = (replacingRO) ? "a Figure with a non-figure." : "a text RO in a Figure type."; - goodToGo = false; - } - break; - case 2: // table RO - if (_MyRTB.MyItemInfo.IsFigure) - { - errormsg = (replacingRO) ? "a Figure with a non-figure." : "a table into a Figure type."; - goodToGo = false; - } - else if (!_MyRTB.MyItemInfo.IsTable) - { - errormsg = (replacingRO) ? "a non-table RO with a Table RO." : "a table into a non-table type."; - //TODO: Prompt user to insert a new Table substep type and place this RO into it - goodToGo = false; - } - break; - case 4: // X/Y Plot RO type - if (!_MyRTB.MyItemInfo.IsAccPages) - { - errormsg = (replacingRO) ? "a non-X/Y Plot RO with an X/Y Plot RO." : "an X/Y Plot RO in an non-Accessory Page type."; - //TODO: Prompt user to insert a new substep type that handles x/y Plots and place this RO into it - goodToGo = false; - } - break; - case 8: // figure (intergrated graphics) - if (!_MyRTB.MyItemInfo.IsFigure && !_MyRTB.MyItemInfo.IsAccPages) - { - errormsg = (replacingRO) ? "a graphics RO with a non-graphcis RO." : "a Graphics RO in an non-Figure or a non-Accessory Page type."; - //TODO: Prompt user to insert a new substep type that handles x/y Plots and place this RO into it - goodToGo = false; - } - break; - } - if (!goodToGo) - MessageBox.Show(string.Format("{0} {1}", insrpl, errormsg), (replacingRO)?"Invalid RO Replacement":"Invalid RO Insert"); - return goodToGo; - } - - private void btnCancelRO_Click(object sender, EventArgs e) - { - _CurROLink = _SavCurROLink; - btnCancelRO.Enabled = false; - UpdateROTree(); - } - - private void btnPreviewRO_Click(object sender, EventArgs e) - { - if (selectedChld.type == 8) // integrated graphic - { - string fname = selectedChld.value.Substring(0, selectedChld.value.IndexOf('\n')); - int thedot = fname.LastIndexOf('.'); - if (thedot == -1 || (thedot != (fname.Length - 4))) - fname += string.Format(".{0}", MyROFST.MyRODb.RODbConfig.GetDefaultGraphicExtension()); - ROImageInfo tmp = ROImageInfo.GetByROFstID_FileName(MyROFST.ROFstID, fname); - - if (tmp !=null) - { - PreviewROImage pvROImg = new PreviewROImage(tmp.Content, selectedChld.title); - pvROImg.ShowDialog(); - } - else - MessageBox.Show("Cannot Find Image Data"); - } - else if (selectedChld.type == 2) // table - { - PreviewMultiLineRO pmlROTable = new PreviewMultiLineRO(selectedChld.value, selectedChld.title); - pmlROTable.ShowDialog(); - } - else if (selectedChld.type == 4) // x/y plot - { - //PreviewMultiLineRO pmlROTable = new PreviewMultiLineRO(selectedChld.value, selectedChld.title); - //pmlROTable.ShowDialog(); // This will show the graph commands - this.Cursor = Cursors.WaitCursor; - // TemporaryFolder is magical. It will automatically (behind the scenes) build a path to a temporary - // folder on the user's machine. It does this only the first time it's reference (GET), after that - // it uses what it has. - string pdfname = TemporaryFolder; //@"G:\debugdat\testplot\"; - pdfname += "\\" + selectedChld.appid + ".pdf"; - //if (File.Exists(pdfname)) - // File.Delete(pdfname); - XYPlot ROGraph = new XYPlot(selectedChld.value, pdfname); - this.Cursor = Cursors.Default; - - // Run an internet browser window - WebBrowser wb = new WebBrowser(pdfname); - wb.TitleText = selectedChld.title; - wb.ShowDialog();// .Show(); - - // Run the default PDF reader - //System.Diagnostics.Process ActRdr = System.Diagnostics.Process.Start(pdfname); - //ActRdr.WaitForExit(); - - // Wait for the PDF viewing process to close then delete the temporary file - // wait for a one minute max - if (!WaitToDeleteFile(pdfname,1)) - MessageBox.Show(string.Format("The PDF viewer was holding this file open: \n\n{0}",pdfname),"Cannot Delete Temporary File"); - } - } - private void ProgressBar_Initialize(int max, string desc) - { - if (_ProgressBar != null) - { - _ProgressBar.Maximum = max; - _ProgressBar.Text = desc; - _ProgressBar.TextVisible = true; - } - } - - private void ProgressBar_SetValue(int curval) - { - if (_ProgressBar != null) - { - _ProgressBar.Value = curval; - } - } - - private void ProgressBar_Clear() - { - if (_ProgressBar != null) - { - _ProgressBar.Text = ""; - _ProgressBar.Maximum = 0; - _ProgressBar.Value = 0; - _ProgressBar.TextVisible = false; - } - } - - #region Utils - private string ConvertSymbolsAndStuff(string instr) - { - string outstr = instr; - - outstr = outstr.Replace("`", @"\'b0"); // convert backquote to degree - left over from DOS days. - outstr = outstr.Replace("\xa0", @"\u160?"); // hardspace - outstr = outstr.Replace("\xb0", @"\'b0"); // degree - outstr = outstr.Replace("\x7f", @"\u916?"); // delta - outstr = outstr.Replace("\x2265", @"\u8805?"); // greater than or equal - outstr = outstr.Replace("\x2264", @"\u8804?"); // less than or equal - outstr = outstr.Replace("\xB1", @"\'b1"); // plus minus - outstr = outstr.Replace("\x3A3", @"\u931?"); // sigma - outstr = outstr.Replace("\x3C4", @"\u947?"); // gamma - outstr = outstr.Replace("\xBD", @"\'bd"); // half - outstr = outstr.Replace("\x25A0", @"\u9604?"); // accum 2584 - outstr = outstr.Replace("\x7", @"\u9679?"); // bullet 25CF - outstr = outstr.Replace("\x2248", @"\u8776?"); // approx eq - outstr = outstr.Replace("\x2261", @"\u8773?"); // similar eq 2245 - outstr = outstr.Replace("\xF7", @"\'f7"); // division - outstr = outstr.Replace("\x221A", @"\u8730?"); // square root - outstr = outstr.Replace("\x393", @"\u961?"); // rho 3C1 - outstr = outstr.Replace("\x3C0", @"\u960?"); // pi - outstr = outstr.Replace("\xb5", @"\u956?"); // micro 3BC (try e6, if not work try 109) - outstr = outstr.Replace("\x3B4", @"\u948?"); // lower case delta - outstr = outstr.Replace("\x3C3", @"\u963?"); // lower case sigma - outstr = outstr.Replace("\xBC", @"\'bc"); // quarter - outstr = outstr.Replace("\x3C6", @"\'d8"); // dist zero, D8 - outstr = outstr.Replace("\xC9", @"\u274?"); // energy, 112 - outstr = outstr.Replace("\xEC", @"\'ec"); // grave - outstr = outstr.Replace("\x2502", @"\u9474?"); // bar - outstr = outstr.Replace("\x3B5", @"\u949?"); // epsilon - outstr = outstr.Replace("\x398", @"\u952?"); // theta, 3B8 - outstr = outstr.Replace("\x221E", @"\u8857?"); // dot in oval, 2299 - outstr = outstr.Replace("\xBF", @"\u964?"); // tau, 3C4 - outstr = outstr.Replace("\x2310", @"\u9830?"); // diamond, 2666 - outstr = outstr.Replace("\x2192", @"\u8594?"); - outstr = outstr.Replace("\x2190", @"\u8592?"); - outstr = outstr.Replace("\x2191", @"\u8593?"); - outstr = outstr.Replace("\x2193", @"\u8595?"); - outstr = outstr.Replace("\x2207", @"\u8711?"); - // DisplayTODO: DO WE NEED TO CHECK WHETHER TO REPLACE ^ CHARACTER FOR SETPOINTS? - //if (DoCaret) s2 = s2.Replace("^", @"\u916"); - outstr = outstr.Replace("^", @"\u916"); - - outstr = ConvertDOSSuperAndSubScripts(outstr); - - outstr = ConvertFortranFormatToScienctificNotation(outstr); - - return outstr; - } - private string ConvertFortranFormatToScienctificNotation(string str) - { - string outstr = ""; - int orglen = str.Length; - int cnt = 0; - int ptr; - - int nbytes; - int tstr, tstr2, rptr, start = 0; - - while (cnt < orglen) - { - // position up to the the next number, sign, or period - ptr = str.IndexOfAny("+-0123456789.".ToCharArray(), cnt); - if (ptr == -1) - { - outstr += str.Substring(cnt); - break; // jump out of while loop - nothing else to process - } - if ((ptr - cnt) > 0) - { - outstr += str.Substring(cnt, ptr - cnt); - cnt = ptr; - } - - if (cnt > start && str[cnt - 1] == '\'') - { - //B2003-053: only remove the single quote character - // if str ptr is not at the end of the string or - // the next char (after the str ptr) is not a space - // or newline... (as per Paul Linn on 7/17/03) - int len = orglen - cnt; - if (len <= 1 || str[cnt + 1] == ' ' || str[cnt + 1] == '\n') - start = cnt; - else - start = cnt - 1; - } - else start = cnt; - tstr = cnt; - - //Skip preceeding signs - if (str[cnt] == '+' || str[cnt] == '-') - cnt++; - - cnt = NextNonNumber(str, cnt); - if (str[cnt] == '.') - { - cnt = NextNonNumber(str, cnt + 1); - if (cnt >= str.Length) //jsj bug fix - { - outstr += str.Substring(tstr); - break; // jump out of while loop - nothing else to process - } - if (str[start] == '\'') - { - start++; - } - else if (str[cnt] == 'E' && cnt > tstr) - { - nbytes = (cnt - tstr); // don't include the 'E' - outstr += str.Substring(tstr, nbytes); - cnt++; - - rptr = outstr.Length - 1; - while (outstr[rptr] == '0') rptr--; - if (outstr[rptr] != '.') rptr++; - if (rptr < (outstr.Length - 1)) - outstr = outstr.Substring(0, rptr + 1); // trim trailing 0's - - int poutstr = 0; - if (outstr[poutstr] == '+' || outstr[poutstr] == '-') poutstr++; - if (!outstr[poutstr].Equals("1")) - { - outstr += "x1"; - } - outstr += "0\\super "; - - tstr2 = cnt; - if (str[cnt] == '+' || str[cnt] == '-') cnt++; - cnt = NextNonNumber(str, cnt); - - if (str[cnt] == '.' && char.IsDigit(str, cnt + 1)) - cnt = NextNonNumber(str, cnt + 1); - - nbytes = cnt - tstr2; // +1; - outstr += str.Substring(tstr2, nbytes); - outstr += "\\nosupersub "; - - if (!char.IsLetterOrDigit(str, cnt) && !char.IsWhiteSpace(str, cnt)) - return (str.Substring(tstr)); - } - } - else - { - outstr += str.Substring(start, cnt - start + 1); - cnt++; - } - } - return (outstr); - } - - private int NextNonNumber(string str, int cnt) - { - int rtn = 0; - string tstr = str.Substring(cnt); - int len = tstr.Length; - while (rtn < len && char.IsDigit(tstr,rtn)) rtn++; - return rtn + cnt; - } - - private string ConvertDOSSuperAndSubScripts(string instr) - { - string outstr = ""; - string tstr = instr; - int cnt = 0; - int ptr = 0; - bool issupper=false, issub = false; - - while (tstr != null && (ptr = tstr.IndexOfAny("#~".ToCharArray(), cnt)) >= 0) - { - if (ptr > cnt) - outstr += tstr.Substring(cnt, ptr - cnt); - switch (tstr[ptr]) - { - case '#': - if (issub || issupper) - outstr += "\\nosupersub "; - else - outstr += "\\super "; - issupper = !issupper; - issub = false; - break; - case '~': - if (issupper || issub) - outstr += "\\nosupersub "; - else - outstr += "\\sub "; - issub = !issub; - issupper = false; - break; - } - cnt = ptr + 1; - if (cnt >= tstr.Length) - tstr = null; - else - tstr = instr.Substring(cnt); - cnt = 0; - } - if (tstr != null) - outstr += tstr; - return outstr; - } - - private static string _TemporaryFolder = null; - public static string TemporaryFolder - { - get - { - if (_TemporaryFolder == null) - { - // This will create a Temp\VE-PROMS folder in the LocalSettings Folder. - //XP - C:\Documents and Settings\{user}\Local Settings\Application Data\Temp\VE-PROMS - //Vista - C:\Users\{user}\AppData\Local\Temp\VE-PROMS - _TemporaryFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Temp"; - if (!Directory.Exists(TemporaryFolder)) Directory.CreateDirectory(TemporaryFolder); - _TemporaryFolder += @"\VE-PROMS"; - if (!Directory.Exists(TemporaryFolder)) Directory.CreateDirectory(TemporaryFolder); - } - return _TemporaryFolder; - } - } - - /// - /// Keep trying to delete the given file until successful OR until MaxMinutes has elasped - /// - /// File to delete (including path) - /// Maxium Minutes to keep trying - /// - private static bool WaitToDeleteFile(string fname, int MaxMinutes) - { - bool deletedfile = false; - DateTime dt_start = DateTime.Now; - DateTime dt_loop = dt_start; - int mins_start = dt_start.Minute; - int mins_loop = dt_loop.Minute; - while (!deletedfile && ((mins_loop - mins_start) < MaxMinutes)) - { - try - { - dt_loop = DateTime.Now; - File.Delete(fname); - deletedfile = true; - } - catch - { - continue; // The process is still holding file, try again. - } - } - return deletedfile; - } - - #endregion // utils - - private void lbROId_DoubleClick(object sender, EventArgs e) - { - // TODO: This is hard-coded to particular folders - //System.Diagnostics.Process.Start(@"C:\VE-PROMS.NET\BIN\RoEditor.EXE",@"c:\Plant\hlp\vehlp\ro " + CurROLink.ROID); - string roapp = Environment.GetEnvironmentVariable("roapp"); - string roloc = "\"" + _MyROFST.MyRODb.FolderPath + "\""; - System.Diagnostics.Process.Start(roapp, roloc + " " + CurROLink.ROID); - } - #endregion - - private void lbFound_SelectedValueChanged(object sender, EventArgs e) - { - ROFSTLookup.roChild child = lbFound.SelectedValue as ROFSTLookup.roChild; - if (child != null) - { - ExpandTree(child.MyChild.roid); - } - } - } -} diff --git a/PROMS/Volian.Controls.Library/DisplayRTBSimple.cs b/PROMS/Volian.Controls.Library/DisplayRTBSimple.cs deleted file mode 100644 index b7a2a361..00000000 --- a/PROMS/Volian.Controls.Library/DisplayRTBSimple.cs +++ /dev/null @@ -1,293 +0,0 @@ -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; -using System.Reflection; - -namespace Volian.Controls.Library -{ - public partial class StepRTBSimple : RichTextBox, IStepRTB - { - #region Fields - private RTBItem _MyRTBItem; - private IContainer _Container = null; - private ItemInfo _MyItemInfo; - private Size _AdjustSize; - private Rectangle _ContentsRectangle; - private E_EditPrintMode _EpMode; - private string _MyClassName; - private E_ViewMode _VwMode; - #endregion - #region RTB 4.1 Not being used - //[DllImport("kernel32.dll", CharSet = CharSet.Auto)] - //static extern IntPtr LoadLibrary(string lpFileName); - - //protected override CreateParams CreateParams - //{ - // get - // { - // CreateParams prams = base.CreateParams; - // if (LoadLibrary("msftedit.dll") != IntPtr.Zero) - // { - // //prams.ExStyle |= 0x020; // transparent - // prams.ClassName = "RICHEDIT50W"; - // } - // return prams; - // } - //} - - //[DllImport("kernel32.dll", CharSet = CharSet.Auto)] - //static extern IntPtr LoadLibrary(string lpFileName); - - //protected override CreateParams CreateParams - //{ - // get - // { - // CreateParams prams = base.CreateParams; - // if (LoadLibrary("riched20.dll") != IntPtr.Zero) - // { - // //prams.ExStyle |= 0x020; // transparent - // prams.ClassName = "RICHEDIT20W"; - // } - // return prams; - // } - //} - #endregion - #region Events - /// - /// Occurs in response to Link GoTo - /// - public event StepRTBLinkEvent LinkGoTo; - /// - /// Checks to see if the LinkGoTo event is handled and launches it. - /// - /// - /// - private void OnLinkGoTo(object sender, StepPanelLinkEventArgs args) - { - if (LinkGoTo != null) LinkGoTo(sender, args); - } - /// - /// Occurs when a content or format change causes the box to get taller or shorter - /// - public event StepRTBEvent HeightChanged; - /// - /// Checks to see if the HeightChanged event is handled and launches it - /// - /// - /// - private void OnHeightChanged(object sender, EventArgs args) - { - if (HeightChanged != null) HeightChanged(sender, args); - } - #endregion - #region Properties - /// - /// ItemInfo object associated with the control - /// - /// - /// - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - set - { - _MyItemInfo = value; - if (value != null) - { - //// TIMING: DisplayItem.TimeIt("rtbMyItem Start"); - //if (value.ItemID == 90) - // if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat(value.MyContent.Text); - string txt = _MyItemInfo.MyContent.Text; - txt = txt.Replace("\n", "\r\n\\par "); - //txt = Regex.Replace(txt, "(.){([0-9]*){([0-9 ]*)}}",FixTransition); - //txt = Regex.Replace(txt, @"(.)\\v TRAN", FixTransition); - MatchCollection mc = Regex.Matches(txt, @"(.)\\v (TRAN|ReferencedObject)\\v0 ([^\\]*)\\v ([^\\]*)\\v0"); - //string[] parts = Regex.Split(txt, "(.){{(.*)}{(.*)}}"); - if (mc.Count > 0) - { - int lastIndex = 0; - foreach (Match m in mc) - { - if(m.Index > lastIndex) AddRtf(txt.Substring(lastIndex,m.Index - lastIndex)); - string linkUrl = "Link:" + ((LinkType)Convert.ToInt32(m.Groups[1].Value[0])).ToString() + ":" + m.Groups[4].Value; - string linkValue = (m.Groups[2].Value == "TRAN" ? FixTransition(m) : m.Groups[3].Value); - if (CreateParams.ClassName == "RICHEDIT50W") - AddLink50(linkUrl, linkValue); - else - AddLink20(linkUrl, linkValue); - //AddRtf(string.Format("{0} \\v ReferencedObject - {1} \\v0",ROValue,ROID)); - lastIndex = m.Index + m.Length; - } - AddRtf(txt.Substring(lastIndex, txt.Length - lastIndex)); - } - else - { - AddRtf(txt); - } - //// TIMING: DisplayItem.TimeIt("rtbMyItem End"); - } - } - } - public RTBItem MyRTBItem - { - get { return _MyRTBItem; } - set { _MyRTBItem = value; } - } - public Size AdjustSize - { - get { return _AdjustSize; } - set { _AdjustSize = value; } - } - public Rectangle ContentsRectangle - { - get { return _ContentsRectangle; } - set { _ContentsRectangle = value; } - } - public E_EditPrintMode EpMode - { - get { return _EpMode; } - set { _EpMode = value; } - } - public string MyClassName - { - get { return _MyClassName; } - set { _MyClassName = value; } - } - public E_ViewMode VwMode - { - get { return _VwMode; } - set { _VwMode = value; } - } - #endregion - #region Private Methods - private string FixTransition(Match match) - { - //int transitionID = Convert.ToInt32(match.Groups[2].Value); - int transitionID = Convert.ToInt32(match.Groups[4].Value.Split(" ".ToCharArray())[1]); - // Find the transition - foreach (TransitionInfo ti in _MyItemInfo.MyContent.ContentTransitions) - { - if (ti.TransitionID == transitionID) - { - string path = ti.PathTo.Replace(" Section PROCEDURE STEPS ", ", "); - path = path.Replace(" Section PROCEDURE STEPS", ""); - return path; - } - } - return match.Value; - } - /// - /// Adds the text and hypertext link and sets the style to link - /// - /// URL - Uniform Resource Locator (Address) - /// Text descibing location - private void AddLink20(string linkUrl, string linkValue) - { - this.DetectUrls = false; - RTBAPI.CharFormatTwo charFormat = RTBAPI.GetCharFormat(this, RTBAPI.RTBSelection.SCF_SELECTION); - int position = SelectionStart = this.TextLength; - SelectionLength = 0; - SelectedRtf = @"{\rtf1\ansi " + linkValue + @"\v #" + linkUrl + @"\v0}"; - Select(position, linkValue.Length + linkUrl.Length + 1); - // Protect the link text to avoid manual changes - charFormat.dwMask = RTBAPI.CharFormatMasks.CFM_LINK | RTBAPI.CharFormatMasks.CFM_PROTECTED; - charFormat.dwEffects = RTBAPI.CharFormatEffects.CFE_LINK | RTBAPI.CharFormatEffects.CFE_PROTECTED; - RTBAPI.SetCharFormat((RichTextBox)this, RTBAPI.RTBSelection.SCF_SELECTION, charFormat); - this.SelectionStart = this.TextLength; - this.SelectionLength = 0; - } - /// - /// Adds a hypertext link to the Rich Text - /// - /// URL - Uniform Resource Locator (Address) - /// Text descibing location - private void AddLink50(string linkUrl, string linkValue) - { - this.DetectUrls = false; - int position = SelectionStart = this.TextLength; - SelectionLength = 0; - SelectedRtf = string.Format(@"{{\rtf\field{{\*\fldinst{{HYPERLINK ""www.volian.com #{0}"" }}}}{{\fldrslt{{\cf2\ul {1}}}}}}}", linkUrl, linkValue); - this.SelectionStart = this.TextLength; - this.SelectionLength = 0; - } - /// - /// Adds Rich Text - /// - /// this is any text and can include RTF commands or not - private void AddRtf(string rtf) - { - this.SelectedRtf = @"{\rtf1 " + rtf + "}"; - } - /// - /// Used by the constructors to do any standard configuration - /// - private void SetUp() - { - BorderStyle = System.Windows.Forms.BorderStyle.None; - this.DetectUrls = true; - //ContextMenuStrip = this.contextMenuStrip1; - //ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None; - //this.TextChanged += new EventHandler(VERichTextBox_TextChanged); - this.ContentsResized += new ContentsResizedEventHandler(StepRTBSimple_ContentsResized); - //if (Text != "") ResizeForText(); - this.LinkClicked += new LinkClickedEventHandler(StepRTBSimple_LinkClicked); - } - - void StepRTBSimple_LinkClicked(object sender, LinkClickedEventArgs args) - { - OnLinkGoTo(sender, new StepPanelLinkEventArgs(_MyRTBItem, args.LinkText)); - } - #endregion - #region Constructors - public StepRTBSimple() - { - InitializeComponent(); - SetUp(); - } - public StepRTBSimple(IContainer container) - { - container.Add(this); - InitializeComponent(); - _Container = container; - SetUp(); - } - #endregion - #region Event Handlers - void StepRTBSimple_ContentsResized(object sender, ContentsResizedEventArgs e) - { - this.Height = e.NewRectangle.Height; - OnHeightChanged(sender, new EventArgs()); - } - #endregion - } - [TypeConverter(typeof(ExpandableObjectConverter))] - public interface IStepRTB - { - event StepRTBEvent HeightChanged; - ItemInfo MyItemInfo { get; set;} - RTBItem MyRTBItem { get; set;} - Size AdjustSize { get; set; } - Rectangle ContentsRectangle { get; set; } - E_EditPrintMode EpMode { get; set; } - string MyClassName { get; set; } - E_ViewMode VwMode { get; set; } - // In addition to the HeightChanged event and the MyItem property - // the constructors below should be created - // public DisplayRTBSimple() - // public DisplayRTBSimple(IContainer container) - } - public enum LinkType : int - { - ReferencedObject = 21, - Transition = 9516, - TransitionRange = 9574 - } - -} diff --git a/PROMS/Volian.Controls.Library/DisplayRTBSimple.designer.cs b/PROMS/Volian.Controls.Library/DisplayRTBSimple.designer.cs deleted file mode 100644 index 81063654..00000000 --- a/PROMS/Volian.Controls.Library/DisplayRTBSimple.designer.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace Volian.Controls.Library -{ - partial class StepRTBSimple - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } - - #endregion - } -} diff --git a/PROMS/Volian.Controls.Library/DisplayReports.cs.bak b/PROMS/Volian.Controls.Library/DisplayReports.cs.bak deleted file mode 100644 index b70c54af..00000000 --- a/PROMS/Volian.Controls.Library/DisplayReports.cs.bak +++ /dev/null @@ -1,987 +0,0 @@ -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 VEPROMS.CSLA.Library; -using DevComponents.DotNetBar; -using DevComponents.AdvTree; -using System.Text.RegularExpressions; -using Volian.Base.Library; - - -namespace Volian.Controls.Library -{ - public partial class DisplayReports : UserControl - { - #region Events - public event DisplayReportsEvent PrintRequest; - private void OnPrintRequest(DisplayReportsEventArgs args) - { - if (PrintRequest != null) - PrintRequest(this, args); - } - #endregion - private List lstCheckedDocVersions = new List(); - private List lstCheckedROs = new List(); - private List lstReportResults = new List(); - private List ROList = new List(); - private List lstROObj = new List(); - private int _MyRODbID; - private string DocVersionList - { - get - { - // append list of document versions to search - if (lstCheckedDocVersions.Count > 0) - { - string strRtnStr = ""; - // get list of doc versions to search - foreach (DocVersionInfo dvi in lstCheckedDocVersions) - { - strRtnStr += string.Format(",{0}", dvi.VersionID.ToString()); - } - return strRtnStr.Substring(1); - } - return ""; - } - } - private DocVersionInfo _MyDocVersion; - public DocVersionInfo Mydocversion - { - get { return _MyDocVersion; } - set - { - _MyDocVersion = value; - if (_MyDocVersion != null) - { - if (_MyDocVersion.DocVersionAssociationCount > 0) - { - // if the count variable is not consistent with the actual list count, - // do a refresh. There was a bug, B2012-040, that was not reproducable.. - // so this is an attempt to fix it. - if (_MyDocVersion.DocVersionAssociations.Count == 0) - { - _MyDocVersion.RefreshDocVersionAssociations(); - if (_MyDocVersion.DocVersionAssociations.Count == 0) return; - } - MyROFSTLookup = _MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(_MyDocVersion); - _MyRODbID = _MyDocVersion.DocVersionAssociations[0].MyROFst.RODbID; - } - } - } - } - private ROFSTLookup _MyROFSTLookup; - public ROFSTLookup MyROFSTLookup - { - get { return _MyROFSTLookup; } - set - { - //if (!Visible) return; // don't reset anything if the form is invisible. - _MyROFSTLookup = value; // define the tree nodes based on this rofst - advTreeROFillIn(true); - //LoadROComboTree(); - } - } - - private ItemInfoList _ReportResult; - public ItemInfoList ReportResult - { - get { return _ReportResult; } - set - { - _ReportResult = value; - } - } - - - private void GenerateROList() - { - string rtnStr = ""; - ROFSTLookup.rochild[] chld = null; - ROFSTLookup.rochild ch; - ROList.Clear(); - foreach (object rolkup in lstCheckedROs) - { - if (rolkup == null) // All Referenced Objects selected, return list of RO databases - { - foreach (ROFSTLookup.rodbi rodbi in _MyROFSTLookup.GetRODatabaseList()) - { - rtnStr = _MyRODbID.ToString() + ":" + string.Format("{0}", rodbi.dbiID.ToString("X4")); - ROList.Add(rtnStr); - } - continue; - } - else if (rolkup is ROFSTLookup.rodbi) - rtnStr = _MyRODbID.ToString() + ":" + string.Format("{0}", ((ROFSTLookup.rodbi)rolkup).dbiID.ToString("X4")); - else if (rolkup is ROFSTLookup.rochild) - { - ch = (ROFSTLookup.rochild)rolkup; - chld = ch.children; - rtnStr = _MyRODbID.ToString() + ":" + GetROChildren(rolkup).TrimEnd(','); - } - //else if (rolkup is ROFSTLookup.rogrp) - // Console.WriteLine("RO Group"); - //else if (rolkup is ROFSTLookup.roHdr) - // Console.WriteLine("RO Header"); - ROList.Add(rtnStr); - } - } - - // same function as GetROsToSearch in DisplaySearch.cs - private string GetROChildren(object roObj) - { - ROFSTLookup.rochild chld = (ROFSTLookup.rochild)roObj; - string rtnstr = ""; - if (chld.children == null) // get a single ROID - { - rtnstr += string.Format("{0}", chld.roid); - if (rtnstr.Length == 12) rtnstr += "0000"; // last four digits are used for multiple return values - } - else if (!cbxROUsage.Checked && chld.children[0].ParentID == 0) - { - rtnstr += string.Format("{0},", chld.roid); // doing a RO Summary or RO Complete report - don't want children that are multiple return values - } - else - { // spin through the child list and get the ROIDs. - // if the child has children, then call this function recursivly - foreach (ROFSTLookup.rochild roc in chld.children) - { - // Don't get the children if we are doing a RO Summary or RO Complete report & children are the multiple return values - if (roc.children != null && (cbxROUsage.Checked || roc.children[0].ParentID != 0)) - rtnstr += GetROChildren(roc); - else - rtnstr += string.Format("{0},", roc.roid); - } - } - return rtnstr; - } - private string GetListOfROs(bool keepRODbID) - { - string rtnStr = ""; - string strRODbID = ""; - int cnt = 0; - foreach (string rostr in ROList) - { - int ndxOf = rostr.IndexOf(":"); - if (ndxOf > 0) - { - string tstr = rostr.Substring(0, ndxOf + 1); - if (tstr != strRODbID && keepRODbID) - { - strRODbID = tstr; - rtnStr += rostr; - } - else - rtnStr += rostr.Substring(ndxOf + 1); - } - else - rtnStr += rostr; - if (rtnStr.EndsWith(",")) rtnStr = rtnStr.Substring(0, rtnStr.Length - 1); - if (++cnt < ROList.Count) - rtnStr += ","; - } - return rtnStr; - } - public DisplayReports() - { - InitializeComponent(); - EnableOrDisablePrintButton(); - cmbxROUsageSort.SelectedIndex = 0; - tabTransitionReports.Visible = false; - cbxComplete.Enabled = true; - cbxSummary.Enabled = true; - if (cbxROUsage.Checked) - cbxIncldMissingROs.Text = "Include Missing ROs (red ? in the editor)"; - else if (cbxComplete.Checked) - cbxIncldMissingROs.Text = "Include Empty RO Fields"; - cbxIncldMissingROs.Checked = false;// !cbxSummary.Checked; - cbxIncldMissingROs.Visible = cbxROUsage.Checked || cbxComplete.Checked; - } - - public void SelectReferencedObjectTab() - { - tabROReports.PerformClick(); - } - - private void AddSelectedROChildren(DevComponents.AdvTree.NodeCollection chldrn) - { - if (chldrn.Count > 0) - { - foreach (DevComponents.AdvTree.Node n in chldrn) - { - if (n.Checked) - lstCheckedROs.Add(n.Tag); - else - AddSelectedROChildren(n.Nodes); - } - } - } - private void BuildCheckedROsList() - { - lstCheckedROs.Clear(); - if (advTreeRO.Nodes.Count == 0) return; - DevComponents.AdvTree.Node node = advTreeRO.Nodes[0]; - if (node.Checked) // top node (all Referenced Objects) selected - lstCheckedROs.Add(node.Tag); - else - AddSelectedROChildren(node.Nodes); - } - - private void EnableOrDisablePrintButton() - { - switch (tctrlReports.SelectedTabIndex) - { - case 0: // Transition Reports - btnPrintReport.Enabled = (lstCheckedDocVersions.Count > 0); - break; - case 1: // Referenced Objects Reports - BuildCheckedROsList(); // this list is sent to the report generator - if (cbxROUsage.Checked) - btnPrintReport.Enabled = (lstCheckedDocVersions.Count > 0 && lstCheckedROs.Count > 0); - else - btnPrintReport.Enabled = ((cbxComplete.Checked || cbxSummary.Checked) && lstCheckedROs.Count > 0); - break; - } - if (cbxROUsage.Checked) - cbxIncldMissingROs.Text = "Include Missing ROs (red ? in the editor)"; - else if (cbxComplete.Checked) - cbxIncldMissingROs.Text = "Include Empty RO Fields"; - //cbxIncldMissingROs.Checked = cbxROUsage.Checked || cbxComplete.Checked; - cbxIncldMissingROs.Visible = cbxROUsage.Checked || cbxComplete.Checked; - } - - private void tabTransitionReports_Click(object sender, EventArgs e) - { - xpSetToReport.Enabled = true; - xpSetToReport.Expanded = true; - xpSelROs.Expanded = false; - xpSelROs.Enabled = false; - EnableOrDisablePrintButton(); - } - - private void tabROReports_Click(object sender, EventArgs e) - { - xpSetToReport.Enabled = cbxROUsage.Checked; - xpSetToReport.Expanded = cbxROUsage.Checked; - cmbxROUsageSort.Enabled = cbxROUsage.Checked; - xpSelROs.Enabled = true; - xpSelROs.Expanded = true; - cbxIncldMissingROs.Checked = false;// !cbxSummary.Checked; - EnableOrDisablePrintButton(); - } - - private void cbxROUsage_CheckedChanged(object sender, EventArgs e) - { - xpSetToReport.Enabled = cbxROUsage.Checked; - xpSetToReport.Expanded = cbxROUsage.Checked; - cmbxROUsageSort.Enabled = cbxROUsage.Checked; - // reset the RO tree and clear anything that was selected - advTreeROFillIn(true); - lstCheckedROs.Clear(); - cbxIncldMissingROs.Checked = false;// !cbxSummary.Checked; - EnableOrDisablePrintButton(); - } - #region Procedure List - private DevComponents.AdvTree.Node NewAdvTreeNode(string nodetext, bool selectable, bool chxbxvisable) - { - DevComponents.AdvTree.Node newnode; - newnode = new DevComponents.AdvTree.Node(); - newnode.Text = nodetext; - newnode.Selectable = selectable; - newnode.CheckBoxAlignment = DevComponents.AdvTree.eCellPartAlignment.NearCenter; - newnode.CheckBoxStyle = eCheckBoxStyle.CheckBox; - newnode.CheckBoxThreeState = false; - newnode.CheckBoxVisible = chxbxvisable; - return newnode; - } - - - public void advTreeProcSetsFillIn(bool blSeachTabClicked) - { - DevComponents.AdvTree.Node topnode = null; - int cntnd = 0; - VETreeNode vtn = VETreeNode.GetFolder(1); - FolderInfo fi = vtn.VEObject as FolderInfo; - int fiCount = fi.ChildFolderCount; - advTreeProcSets.Nodes.Clear(); - lstCheckedDocVersions.Clear(); - topnode = new DevComponents.AdvTree.Node(); - topnode.Text = "Available Procedure Sets"; - topnode.Tag = fi; - advTreeProcSets.Nodes.Add(topnode); - //advTreeProcSets.AfterNodeInsert += new TreeNodeCollectionEventHandler(advTreeProcSets_AfterNodeInsert); - - - foreach (FolderInfo fic in fi.ChildFolders) - { - DevComponents.AdvTree.Node newnode = new DevComponents.AdvTree.Node(); - newnode.Text = fic.ToString(); - newnode.Tag = fic; - - //int tmp; - //if (topnode == null) - //{ - // newnode.Text = "Available Procedure Sets"; - // tmp = advTreeProcSets.Nodes.Add(newnode); - // topnode = newnode; - //} - //else - //{ - // newnode.Selectable = true; - // newnode.CheckBoxAlignment = DevComponents.AdvTree.eCellPartAlignment.NearCenter; - // newnode.CheckBoxStyle = eCheckBoxStyle.CheckBox; - // newnode.CheckBoxThreeState = false; - // newnode.CheckBoxVisible = true; - // tmp = topnode.Nodes.Add(newnode); - //} - cntnd++; - if (fic.ChildFolderCount > 0 || fic.FolderDocVersionCount > 0) // allow for '+' for tree expansion - { - DevComponents.AdvTree.Node tnt = new DevComponents.AdvTree.Node(); - tnt.Text = "VLN_DUMMY"; - newnode.Nodes.Add(tnt); - topnode.Nodes.Add(newnode); - } - } - - // if nothing was added to the tree, just put in the node above the docversions... - if (advTreeProcSets.Nodes.Count == 0) - { - cntnd++; - fi = Mydocversion.MyFolder; - topnode = new DevComponents.AdvTree.Node(); - topnode.Text = fi.ToString(); - advTreeProcSets.Nodes.Add(topnode); - topnode.Tag = fi; - } - - advTreeProcSets.BeforeExpand += new DevComponents.AdvTree.AdvTreeNodeCancelEventHandler(advTreeProcSets_BeforeExpand); - - // position to the procedure set in the tree if we have a procedure open - if (Mydocversion != null) - advTreeProcSetsPreSelect(); - else - advTreeProcSets.Nodes[0].SelectedCell = advTreeProcSets.Nodes[0].Cells[0]; // select the first node - fixes cosmetic problem - - //if (blSeachTabClicked) - // cbxTextSearchText.Focus(); // set initial focus to enter search text - } - void advTreeProcSets_BeforeExpand(object sender, DevComponents.AdvTree.AdvTreeNodeCancelEventArgs e) - { - DevComponents.AdvTree.Node par = e.Node; - // get first child's text, if it has one & if the text is VLN_DUMMY, load children - DevComponents.AdvTree.Node tn = null; - if (par.Nodes.Count > 0) tn = par.Nodes[0]; - if (tn.Text == "VLN_DUMMY") // expand this - { - par.Nodes.Clear(); - Object obj = par.Tag; - if (!(obj is FolderInfo)) return; // should always be folderinfo on expand - FolderInfo fi = (FolderInfo)obj; - if (fi.ChildFolderCount > 0) - { - foreach (FolderInfo fic in fi.ChildFolders) - { - DevComponents.AdvTree.Node newnode = new DevComponents.AdvTree.Node(); - newnode.Text = fic.ToString(); - newnode.Tag = fic; - par.Nodes.Add(newnode); - if (fic.HasChildren) // allow for '+' for tree expansion - { - DevComponents.AdvTree.Node tnt = new DevComponents.AdvTree.Node(); - tnt.Text = "VLN_DUMMY"; - newnode.Nodes.Add(tnt); - } - } - } - else if (fi.FolderDocVersionCount > 0) - { - foreach (DocVersionInfo dv in fi.FolderDocVersions) - { - DevComponents.AdvTree.Node newnode = new DevComponents.AdvTree.Node(); - newnode.Text = dv.ToString(); - newnode.Tag = dv; - newnode.Selectable = true; - newnode.CheckBoxAlignment = DevComponents.AdvTree.eCellPartAlignment.NearCenter; - newnode.CheckBoxStyle = eCheckBoxStyle.CheckBox; - newnode.CheckBoxThreeState = false; - newnode.CheckBoxVisible = true; - par.Nodes.Add(newnode); - } - } - } - } - private void advTreeProcSets_AfterCheck(object sender, DevComponents.AdvTree.AdvTreeCellEventArgs e) - { - DevComponents.AdvTree.Node n = advTreeProcSets.SelectedNode; - if (n.Checked) - { - n.Style = DevComponents.AdvTree.NodeStyles.Apple; - lstCheckedDocVersions.Add((DocVersionInfo)n.Tag); - if (lstCheckedDocVersions.Count == 1)//Mydocversion == null) - { - Mydocversion = (DocVersionInfo)n.Tag; - } - } - else - { - n.Style = null; - lstCheckedDocVersions.Remove((DocVersionInfo)n.Tag); - if (lstCheckedDocVersions.Count == 1) - { - if (Mydocversion != lstCheckedDocVersions[0]) - { - Mydocversion = lstCheckedDocVersions[0]; - } - } - else - { - if (lstCheckedDocVersions.Count == 0) - Mydocversion = null; - // do this if either none, or more than one procedure set selected - //advTreeStepTypes.Nodes.Clear(); - //lstCheckedStepTypes.Clear(); - //lstCheckedStepTypesStr.Clear(); - //Node newnode = new DevComponents.AdvTree.Node(); - //newnode.Text = "....select a procedure set for types to appear..."; - //advTreeStepTypes.Nodes.Add(newnode); - //buildStepTypePannelTitle(); - } - } - //// Enable the RO combo list only if at least one procedure set node - //// is selected - //cmboTreeROs.Enabled = (lstCheckedDocVersions.Count > 0); - //gpFindROs.Enabled = cmboTreeROs.Enabled; - - //SetupContextMenu(); - - //buildSetToSearchPanelTitle(); - EnableOrDisablePrintButton(); - } - private void advTreeProcSets_AfterNodeSelect(object sender, AdvTreeNodeEventArgs e) - { - DevComponents.AdvTree.Node n = advTreeProcSets.SelectedNode; - } - private void advTreeProcSetsPreSelect() - { - bool keeplooking = true; - //build a stack (bread crumb trail) of where is procedure set came from within the tree. - Stack crumbs = new Stack(); - - crumbs.Push(Mydocversion.Name); // ex: "working draft" - crumbs.Push(Mydocversion.MyFolder.Name); // ex: "Emergency Procedures" - FolderInfo fi = Mydocversion.MyFolder.MyParent; - while (fi != null) - { - if (fi.MyParent != null) - crumbs.Push(fi.Name); - fi = fi.MyParent; - } - crumbs.Push(advTreeProcSets.Nodes[0].Text); //top node of my tree - - // now walk the tree, looking for the node names we saved in the stack. - NodeCollection monkeys = advTreeProcSets.Nodes; - while (keeplooking) - { - Node climber = LookInTree(monkeys, crumbs.Pop()); - keeplooking = (climber != null && crumbs.Count > 0); - if (keeplooking) - monkeys = climber.Nodes; - if (!keeplooking && climber != null) - { - climber.Checked = true; - } - } - } - private Node LookInTree(NodeCollection monkeys, string bananna) - { - Node foundit = null; - foreach (Node chimp in monkeys) - { - if (chimp.Text.Equals(bananna)) - { - foundit = chimp; - // need to select the node (cell) for it to be checked - chimp.SelectedCell = chimp.Cells[0]; - if (chimp.Nodes.Count > 0) - chimp.Expand(); - break; - } - chimp.Collapse(); - } - return foundit; - } - #endregion - #region RO Tree - public void advTreeROFillIn(bool blSeachTabClicked) - { - DevComponents.AdvTree.Node topnode = null; - advTreeRO.Nodes.Clear(); - if (_MyROFSTLookup == null) return; - advTreeRO.BeforeExpand +=new AdvTreeNodeCancelEventHandler(advTreeRO_BeforeExpand); - advTreeRO.AfterExpand += new AdvTreeNodeEventHandler(advTreeRO_AfterExpandorCollapse); - advTreeRO.AfterCollapse += new AdvTreeNodeEventHandler(advTreeRO_AfterExpandorCollapse); - topnode = new DevComponents.AdvTree.Node(); - topnode.Text = "All Referenced Objects"; - topnode.Tag = null; - topnode.CheckBoxVisible = true; - advTreeRO.Nodes.Add(topnode); - - for (int i = 0; i < _MyROFSTLookup.myHdr.myDbs.Length; i++) - { - DevComponents.AdvTree.Node tn = new DevComponents.AdvTree.Node(); - tn.Text = _MyROFSTLookup.myHdr.myDbs[i].dbiTitle; - tn.Tag = _MyROFSTLookup.myHdr.myDbs[i]; - tn.CheckBoxVisible = true; - topnode.Nodes.Add(tn); - AddDummyGroup(_MyROFSTLookup.myHdr.myDbs[i], tn); - } - - - //foreach (FolderInfo fic in fi.ChildFolders) - //{ - // DevComponents.AdvTree.Node newnode = new DevComponents.AdvTree.Node(); - // newnode.Text = fic.ToString(); - // newnode.Tag = fic; - - // cntnd++; - // if (fic.ChildFolderCount > 0 || fic.FolderDocVersionCount > 0) // allow for '+' for tree expansion - // { - // DevComponents.AdvTree.Node tnt = new DevComponents.AdvTree.Node(); - // tnt.Text = "VLN_DUMMY"; - // newnode.Nodes.Add(tnt); - // topnode.Nodes.Add(newnode); - // } - //} - - //// if nothing was added to the tree, just put in the node above the docversions... - //if (advTreeProcSets.Nodes.Count == 0) - //{ - // cntnd++; - // fi = Mydocversion.MyFolder; - // topnode = new DevComponents.AdvTree.Node(); - // topnode.Text = fi.ToString(); - // advTreeProcSets.Nodes.Add(topnode); - // topnode.Tag = fi; - //} - - //advTreeProcSets.BeforeExpand += new DevComponents.AdvTree.AdvTreeNodeCancelEventHandler(advTreeProcSets_BeforeExpand); - - //// position to the procedure set in the tree if we have a procedure open - //if (Mydocversion != null) - // advTreeProcSetsPreSelect(); - //else - // advTreeProcSets.Nodes[0].SelectedCell = advTreeProcSets.Nodes[0].Cells[0]; // select the first node - fixes cosmetic problem - - //if (blSeachTabClicked) - // cbxTextSearchText.Focus(); // set initial focus to enter search text - } - - private void AddDummyGroup(ROFSTLookup.rodbi rodbi, DevComponents.AdvTree.Node tn) - { - if (rodbi.children != null && rodbi.children.Length > 0) - { - DevComponents.AdvTree.Node tmp = new DevComponents.AdvTree.Node(); - tmp.Text = "VLN_DUMMY_FOR_TREE"; - tn.Nodes.Add(tmp); - } - } - private void advTreeRO_BeforeExpand(object sender, DevComponents.AdvTree.AdvTreeNodeCancelEventArgs e) - { - LoadChildren(e.Node); - } - - private void LoadChildren(DevComponents.AdvTree.Node tn) - { - object tag = tn.Tag; - if (tn.HasChildNodes && tn.Nodes[0].Text != "VLN_DUMMY_FOR_TREE") return; // already loaded. - if (tn.HasChildNodes && tn.Nodes[0].Text == "VLN_DUMMY_FOR_TREE") tn.Nodes[0].Remove(); - ROFSTLookup.rochild[] chld = null; - - if (tn.Tag is ROFSTLookup.rodbi) - { - ROFSTLookup.rodbi db = (ROFSTLookup.rodbi)tn.Tag; - chld = db.children; - } - else if (tn.Tag is ROFSTLookup.rochild) - { - ROFSTLookup.rochild ch = (ROFSTLookup.rochild)tn.Tag; - chld = ch.children; - } - else - { - Console.WriteLine("error - no type"); - return; - } - // if children, add dummy node - if (chld != null && chld.Length > 0) - { - //ProgressBar_Initialize(chld.Length, tn.Text); - for (int i = 0; i < chld.Length; i++) - { - //ProgressBar_SetValue(i); - DevComponents.AdvTree.Node tmp = null; - // if this is a group, i.e. type 0, add a dummy node - if (chld[i].type == 0 && chld[i].children == null) - //skip it. - // TODO: KBR how to handle this? - //Console.WriteLine("ro junk"); - continue; - else if (chld[i].value == null && (cbxROUsage.Checked || chld[i].children[0].ParentID != 0)) - { - tmp = new DevComponents.AdvTree.Node(); - tmp.Text = chld[i].title; - tmp.Tag = chld[i]; - tmp.CheckBoxVisible = true; - int index = FindIndex(tn.Nodes, tmp.Text); - tn.Nodes.Insert(index, tmp); - DevComponents.AdvTree.Node sub = new DevComponents.AdvTree.Node(); - sub.Text = "VLN_DUMMY_FOR_TREE"; - tmp.Nodes.Add(sub); - } - else - { - tmp = new DevComponents.AdvTree.Node(); - tmp.Text = chld[i].title; - tmp.Tag = chld[i]; - tmp.CheckBoxVisible = true; - int index = FindIndex(tn.Nodes, tmp.Text); - tn.Nodes.Insert(index, tmp); - } - } - } - //ProgressBar_Clear(); - } - void advTreeRO_AfterExpandorCollapse(object sender, AdvTreeNodeEventArgs e) - { - Node bottomNode = BottomTreeNode(advTreeRO.Nodes); - Node lastNode = advTreeRO.Nodes[advTreeRO.Nodes.Count - 1]; - int top = advTreeRO.Nodes[0].Bounds.Top; - int bottom = bottomNode.Bounds.Bottom + 5; - int hScrollBarHeight = advTreeRO.HScrollBar != null ? advTreeRO.HScrollBar.Height : 0; - bottom = bottomNode.Bounds.Bottom + 5; - advTreeRO.Size = new Size(advTreeRO.Size.Width, Math.Min(525, bottom - top + hScrollBarHeight)); - if (advTreeRO.VScrollBar != null && bottom < advTreeRO.Size.Height) - { - int yLookFor = (bottom - advTreeRO.Size.Height) + 2 * hScrollBarHeight; - Node topNode = FindTreeNodeAt(advTreeRO.Nodes, yLookFor); - if (topNode != null) - topNode.EnsureVisible(); - } - } - private Node FindTreeNodeAt(NodeCollection nodes, int y) - { - foreach (Node node in nodes) - { - if (node.Bounds.Top <= y && node.Bounds.Bottom >= y) - return node; - if (node.Bounds.Top > y) - { - if (node.PrevNode != null && node.PrevNode.Expanded) - return FindTreeNodeAt(node.PrevNode.Nodes, y); - return node; - } - } - return null; - } - private Node BottomTreeNode(NodeCollection nodes) - { - Node bottomNode = nodes[nodes.Count - 1]; // Return bottom node in collection - if (bottomNode.Expanded) // If expanded return bottom child - return BottomTreeNode(bottomNode.Nodes); - return bottomNode; - } - private int FindIndex(NodeCollection nodes, string value) - { - int index = 0; - foreach (Node node in nodes) - { - if (GreaterValue(node.Text, value)) return index; - index++; - } - return index; - } - //private static Regex _RegExGetNumber = new Regex(@"^ *[+-]?[.,0-9]+(E[+-]?[0-9]+)?"); - private bool GreaterValue(string value1, string value2) - { - return DisplayRO.GreaterValue(value1, value2); - // Match match1 = _RegExGetNumber.Match(value1); - // Match match2 = _RegExGetNumber.Match(value2); - // if (match1.Success && match2.Success) // Compare the numeric value - // { - // double dbl1 = double.Parse(match1.ToString()); - // double dbl2 = double.Parse(match2.ToString()); - // return dbl1 > dbl2; - // } - // return String.Compare(value1, value2, true) > 0; - } - - - #endregion - - private void DisplayReports_Load(object sender, EventArgs e) - { - tabTransitionReports.PerformClick(); - } - - // when a node is checked (selected) then uncheck any of its children - private void UncheckChildren(DevComponents.AdvTree.NodeCollection chldrn) - { - if (chldrn.Count > 0) - { - foreach (DevComponents.AdvTree.Node n in chldrn) - { - if (n.Checked) - n.Checked = false; - else - UncheckChildren(n.Nodes); - } - } - } - // when a node is checked (selected), uncheck the parents, grand parents, great grand parents, etc. - private void UncheckParents(DevComponents.AdvTree.Node pNode) - { - while (pNode != null) - { - if (pNode.Checked) pNode.Checked = false; - pNode = pNode.Parent; - } - } - - private void advTreeRO_AfterCheck(object sender, AdvTreeCellEventArgs e) - { - DevComponents.AdvTree.Node n = advTreeRO.SelectedNode; - if (n.Checked) - { - UncheckChildren(n.Nodes); - UncheckParents(n.Parent); - } - - EnableOrDisablePrintButton(); - } - - private void cbxTransToProcs_CheckedChanged(object sender, EventArgs e) - { - EnableOrDisablePrintButton(); - } - - private void cbxTransFromProcs_CheckedChanged(object sender, EventArgs e) - { - EnableOrDisablePrintButton(); - } - - private void cbxComplete_CheckedChanged(object sender, EventArgs e) - { - cbxIncldMissingROs.Checked = false;// !cbxSummary.Checked; - EnableOrDisablePrintButton(); - } - - private void cbxSummary_CheckedChanged(object sender, EventArgs e) - { - EnableOrDisablePrintButton(); - } - private string BuildRODataFile(string ROList) - { - DocVersionInfo MyDVI = Mydocversion; - string roDataFile = "PRINT.TMP"; - - if (VlnSettings.ReleaseMode.Equals("DEMO")) - { - MessageBox.Show("Referenced Object Reports not available in the Demo version.", "PROMS Demo Version"); - return ""; - } - //string roapp = Environment.GetEnvironmentVariable("roapp"); - string roapp = Volian.Base.Library.ExeInfo.GetROEditorPath(); // get the path to the RO Editor Executable - if (roapp == null) - { - MessageBox.Show("Could not find path to Ro Editor, check 'roapp' environment variable"); - return ""; - } - if (MyDVI == null || MyDVI.DocVersionAssociationCount < 1) - { - MessageBox.Show("Could not find associated path for ro data.","No RO Data", MessageBoxButtons.OK, MessageBoxIcon.Information); - return ""; - } - //string roloc = "\"" + MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath + "\" " + "\"" + ROList + "\""; - if (!Directory.Exists(MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath)) - { - MessageBox.Show(string.Format("RO Database directory does not exist: {0}", MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath)); - return ""; - } - string cmpRptExePath = roapp.Substring(0, roapp.LastIndexOf("\\")) + "\\CmpRpt.exe "; - roDataFile = MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath + "\\" + roDataFile; - try - { - - if (File.Exists(roDataFile)) File.Delete(roDataFile); - Application.DoEvents(); - string fname = VlnSettings.TemporaryFolder + "\\ROCompleteRprt.txt"; - FileInfo fi = new FileInfo(fname); - using (StreamWriter sw = fi.CreateText()) - { - sw.Write(ROList); - sw.Close(); - } - string roloc = "\"" + MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath + "\" \"/f=" + fname + "\""; - System.Diagnostics.Process p = System.Diagnostics.Process.Start(cmpRptExePath, roloc); - // need to wait, sometimes the Print.tmp file that is generated is not available - p.WaitForExit(); // without arguments, this will wait indefinately - Application.DoEvents(); - } - catch (Exception ex) - { - while (ex.InnerException != null) - ex = ex.InnerException; - string tmpmsg = ex.Message; - MessageBox.Show(tmpmsg, "RO Report Error: " + ex.GetType().Name); - } - return roDataFile; - } - private void btnPrintReport_Click(object sender, EventArgs e) - { - Cursor curcur = Cursor; - Cursor = Cursors.WaitCursor; - if (cbxSummary.Checked) // RO Summary Report - { - GenerateROList(); - OnPrintRequest(new DisplayReportsEventArgs("RO Summary Report", "RO Summary Report", MyROFSTLookup, ROList)); - } - else if (cbxComplete.Checked) // Complete RO Report - { - GenerateROList(); - string ROList = GetListOfROs(false);//don't include the RODbID in the RO list - string roDataFile = BuildRODataFile(ROList); - OnPrintRequest(new DisplayReportsEventArgs("Complete RO Report", "Complete RO Report", roDataFile, MyROFSTLookup, cbxComplete.Checked, this.Mydocversion.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta, cbxIncldMissingROs.Checked)); - } - else if (cbxROUsage.Checked) - { - bool usageSortedByProcedure = (cmbxROUsageSort.SelectedIndex == 1); - GenerateROList(); - string SearchString = GetListOfROs(true);// Include the RODbID in the RO list - ItemInfoList SearchResults = ItemInfoList.GetListFromROReport(DocVersionList, "", SearchString, ""); - if (!usageSortedByProcedure) // sort on ROs - { - Csla.SortedBindingList sortedResults = new Csla.SortedBindingList(SearchResults); - sortedResults.ApplySort("FoundROID", ListSortDirection.Ascending); - OnPrintRequest(new DisplayReportsEventArgs("Referenced Objects Usage By RO", "RO Usage", sortedResults, usageSortedByProcedure,cbxIncldMissingROs.Checked)); - } - else - OnPrintRequest(new DisplayReportsEventArgs("Referenced Objects Usage By Procedure", "RO Usage", SearchResults, usageSortedByProcedure,cbxIncldMissingROs.Checked)); - } - else if (cbxTransFromProcs.Checked) - { - } - else if (cbxTransToProcs.Checked) - { - } - Cursor = curcur; - } - - } - public class DisplayReportsEventArgs - { - private string _ReportTitle; - public string ReportTitle - { - get { return _ReportTitle; } - set { _ReportTitle = value; } - } - private string _TypesSelected; - public string TypesSelected - { - get { return _TypesSelected; } - set { _TypesSelected = value; } - } - private ICollection _MyItemInfoList; - public ICollection MyItemInfoList - { - get { return _MyItemInfoList; } - set { _MyItemInfoList = value; } - } - private bool _SortUsageByProcedure; - public bool SortUsageByProcedure - { - get { return _SortUsageByProcedure; } - set { _SortUsageByProcedure = value; } - } - private string _RODataFile = ""; - public string RODataFile - { - get { return _RODataFile; } - set { _RODataFile = value; } - } - private bool _CompleteROReport = true; - public bool CompleteROReport - { - get { return _CompleteROReport; } - set { _CompleteROReport = value; } - } - private ROFSTLookup _rofstLookup; - public ROFSTLookup RofstLookup - { - get { return _rofstLookup; } - set { _rofstLookup = value; } - } - private List _ROListForReport; - - public List ROListForReport - { - get { return _ROListForReport; } - set { _ROListForReport = value; } - } - private bool _IncludeMissingROs = true; - - public bool IncludeMissingROs - { - get { return _IncludeMissingROs; } - set { _IncludeMissingROs = value; } - } - private bool _ConvertCaretToDelta = true; - - public bool ConvertCaretToDelta - { - get { return _ConvertCaretToDelta; } - set { _ConvertCaretToDelta = value; } - } - private bool _IncludeEmptyROFields = true; - - public bool IncludeEmptyROFields - { - get { return _IncludeEmptyROFields; } - set { _IncludeEmptyROFields = value; } - } - public DisplayReportsEventArgs(string reportTitle, string typesSelected, ICollection myItemInfoList, bool sortByProcedure, bool includeMissingROs) - { - // RO Usage Report - _ReportTitle = reportTitle; - _TypesSelected = typesSelected; - _MyItemInfoList = myItemInfoList; - _SortUsageByProcedure = sortByProcedure; - _IncludeMissingROs = includeMissingROs; - - } - public DisplayReportsEventArgs(string reportTitle, string typesSelected, string roDataFile, ROFSTLookup rofstLookUp, bool completeROReport, bool convertCaretToDelta, bool includeEmptyROFields) - { - _ReportTitle = reportTitle; - _TypesSelected = typesSelected; - _RODataFile = roDataFile; - _CompleteROReport = completeROReport; - _ConvertCaretToDelta = convertCaretToDelta; - _rofstLookup = rofstLookUp; - _IncludeEmptyROFields = includeEmptyROFields; - } - public DisplayReportsEventArgs(string reportTitle, string typesSelected, ROFSTLookup rofstLookUp, List roListForReport) - { - // RO Summary Report - _ReportTitle = reportTitle; - _TypesSelected = typesSelected; - _rofstLookup = rofstLookUp; - _ROListForReport = roListForReport; - } - } - public delegate void DisplayReportsEvent(object sender, DisplayReportsEventArgs args); -} diff --git a/PROMS/Volian.Controls.Library/DisplaySearch.cs.bak b/PROMS/Volian.Controls.Library/DisplaySearch.cs.bak deleted file mode 100644 index bc2a3bbe..00000000 --- a/PROMS/Volian.Controls.Library/DisplaySearch.cs.bak +++ /dev/null @@ -1,1738 +0,0 @@ -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 DevComponents.DotNetBar; -using DevComponents.AdvTree; -using Volian.Base.Library; -using System.Text.RegularExpressions; - -namespace Volian.Controls.Library -{ - public partial class DisplaySearch : UserControl - { - #region Events - public event DisplaySearchEvent PrintRequest; - private void OnPrintRequest(DisplaySearchEventArgs args) - { - if (PrintRequest != null) - PrintRequest(this, args); - } - #endregion - #region Properties - private string _strSrchText = ""; - private List lstCheckedDocVersions = new List(); - private List lstCheckedStepTypes = new List(); - private List lstCheckedStepTypesStr = new List(); - private AnnotationDetails _AnnotationDetails = null; - ItemInfo _ItemInfo = null; - private DisplayTabControl _TabControl; - private DocVersionInfo _MyDocVersion; - private Color saveXpSetToSearchColor; - private Color saveXpStepTypeTitleColor; - private Color saveGpSrchAnnoTextColor; - private Color saveGpSrchTextColor; - private Color saveGpFindROsColor; - private Color saveGrpPanSearchResults; - private ItemInfoList _SearchResults; - public ItemInfoList SearchResults - { - get { return _SearchResults; } - set - { - _SearchResults = value; - if (value != null) // Don't select an item from the list when it is updated - _SearchResults.ListChanged += new ListChangedEventHandler(_SearchResults_ListChanged); - DisplayResults(); - } - } - void _SearchResults_ListChanged(object sender, ListChangedEventArgs e) - { - lbSrchResults.SelectedIndex = -1; // Don't select an item from the new list - } - - private string _DisplayMember = "SearchPath"; - - //public string Status - //{ - // get { return tsslStatus.Text; } - // set { tsslStatus.Text = value; Application.DoEvents(); } - //} - - private bool _OpenDocFromSearch; - - public bool OpenDocFromSearch - { - get { return _OpenDocFromSearch; } - //set { _OpenDocFromSearch = value; } - } - public DocVersionInfo Mydocversion - { - get { return _MyDocVersion; } - set - { - _MyDocVersion = value; - if (_MyDocVersion != null) - { - if (_MyDocVersion.DocVersionAssociationCount > 0) - { - // if the count variable is not consistent with the actual list count, - // do a refresh. There was a bug, B2012-040, that was not reproducable.. - // so this is an attempt to fix it. - if (_MyDocVersion.DocVersionAssociations.Count == 0) - { - _MyDocVersion.RefreshDocVersionAssociations(); - if (_MyDocVersion.DocVersionAssociations.Count == 0) return; - } - MyROFSTLookup = _MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(_MyDocVersion); - _MyRODbID = _MyDocVersion.DocVersionAssociations[0].MyROFst.RODbID; - } - } - } - } - - private ROFSTLookup _MyROFSTLookup; - public ROFSTLookup MyROFSTLookup - { - get { return _MyROFSTLookup; } - set - { - //if (!Visible) return; // don't reset anything if the form is invisible. - _MyROFSTLookup = value; // define the tree nodes based on this rofst - LoadROComboTree(); - } - } - private bool _LoadingList = false; - public bool LoadingList - { - get { return _LoadingList; } - set { _LoadingList = value; } - } - - private int LastResultsMouseOverIndex = -1; - - private ProgressBarItem _ProgressBar; - - public ProgressBarItem ProgressBar - { - get { return _ProgressBar; } - set { _ProgressBar = value; } - } - #endregion - - #region setup - public DisplaySearch() - { - InitializeComponent(); - LoadSearchTextListBox(); - saveXpSetToSearchColor = xpSetToSearch.TitleStyle.BackColor1.Color; - saveXpStepTypeTitleColor = xpStepTypes.TitleStyle.BackColor1.Color; - saveGpSrchAnnoTextColor = gpSrchAnnoText.Style.BackColor; - saveGpSrchTextColor = gpSrchText.Style.BackColor; - saveGpFindROsColor = gpFindROs.Style.BackColor; - gpSrchText.Style.BackColor = Color.Yellow; - saveGrpPanSearchResults = grpPanSearchResults.Style.BackColor; - - // start out with the procedure and type selection windows colasped - xpSetToSearch.Expanded = false; - xpStepTypes.Expanded = false; - rbtnSrchTxt.Checked = true; - gpSrchAnnoText.Enabled = true; - cmbResultsStyle.Enabled = false; - } - private void LoadSearchTextListBox() - { - // Setup SearchText Combo - cbxTextSearchText.Items.Clear(); - if (Properties.Settings.Default["SearchList"] != null && Properties.Settings.Default.SearchList.Count > 0) - { - foreach (string str in Properties.Settings.Default.SearchList) - cbxTextSearchText.Items.Add(str); - } - // Setup SearchAnnotation Combo - cbxTextSearchAnnotation.Items.Clear(); - if (Properties.Settings.Default["SearchAList"] != null && Properties.Settings.Default.SearchAList.Count > 0) - { - foreach (string str in Properties.Settings.Default.SearchAList) - cbxTextSearchAnnotation.Items.Add(str); - } - } - - private DevComponents.AdvTree.Node NewAdvTreeNode(string nodetext, bool selectable, bool chxbxvisable) - { - DevComponents.AdvTree.Node newnode; - newnode = new DevComponents.AdvTree.Node(); - newnode.Text = nodetext; - newnode.Selectable = selectable; - newnode.CheckBoxAlignment = DevComponents.AdvTree.eCellPartAlignment.NearCenter; - newnode.CheckBoxStyle = eCheckBoxStyle.CheckBox; - newnode.CheckBoxThreeState = false; - newnode.CheckBoxVisible = chxbxvisable; - return newnode; - } - - public void advTreeStepTypesFillIn() - { - DevComponents.AdvTree.Node topnode = new DevComponents.AdvTree.Node(); - advTreeStepTypes.Nodes.Clear(); - lstCheckedStepTypes.Clear(); - lstCheckedStepTypesStr.Clear(); - topnode.Text = "Types"; - advTreeStepTypes.Nodes.Add(topnode); - - FormatData fmtdata = _MyDocVersion.ActiveFormat.PlantFormat.FormatData; - List lstSrchStpTypes = fmtdata.GetSearchableSteps(); // list of searchable step types - if (lstSrchStpTypes != null && lstSrchStpTypes.Count > 0) - { - DevComponents.AdvTree.Node newnode; - advTreeStepTypes.Nodes.Clear(); - // Add a dummy node for searching Accessory Sections (MS Word sections) - //newnode = new DevComponents.AdvTree.Node(); - //newnode.Text = "Accessory Sections"; - //newnode.Selectable = true; - //newnode.CheckBoxAlignment = DevComponents.AdvTree.eCellPartAlignment.NearCenter; - //newnode.CheckBoxStyle = eCheckBoxStyle.CheckBox; - //newnode.CheckBoxThreeState = false; - //newnode.CheckBoxVisible = true; - newnode = NewAdvTreeNode("Accessory Sections", true, true); - advTreeStepTypes.Nodes.Add(newnode); - foreach (StepDataRetval sdr in lstSrchStpTypes) - { - StepDataList sdl = fmtdata.StepDataList; ; - StepData sd = sdl[sdr.Index]; // get the step type record - string parentName = sd.ParentType; // this gets the parent of the this step/substep type - - //Console.WriteLine("{0} {1} - {2}", parentName,sd.Type,sdr.Name); - //newnode = new DevComponents.AdvTree.Node(); - //newnode.Text = sdr.Name; - //newnode.Name = sd.Type; // this needed for the FindNodeByName() function - //newnode.Tag = sd; - //newnode.Selectable = true; - //newnode.CheckBoxAlignment = DevComponents.AdvTree.eCellPartAlignment.NearCenter; - //newnode.CheckBoxStyle = eCheckBoxStyle.CheckBox; - //newnode.CheckBoxThreeState = false; - //newnode.CheckBoxVisible = true; - if (parentName.Equals("Base")) - { - newnode = NewAdvTreeNode(sdr.Name, true, true); - newnode.Tag = sd; - newnode.Name = sd.Type; - DevComponents.AdvTree.Node pnode = NewAdvTreeNode(sd.Type, true, false); //create parent node (non selectable) - pnode.Name = sd.Type; - pnode.Nodes.Add(newnode); - pnode.Nodes.Sort(); - advTreeStepTypes.Nodes.Add(pnode); - } - else - { - newnode = NewAdvTreeNode(sdr.Name, true, true); - newnode.Name = sd.Type; // this needed for the FindNodeByName() function - newnode.Tag = sd; - - // if the parent node exists in the tree, then add the new node to that parent - // else, it is a parent node, so add it as a new parent - - DevComponents.AdvTree.Node parnode = advTreeStepTypes.FindNodeByName(parentName); - // Group by High Level Steps, Substeps, Cautions, Notes, Figures, Tables - while (!parentName.Equals("Base") && !parentName.Equals("Substep") && !parentName.Equals("High") && - !parentName.Equals("Caution") && !parentName.Equals("Note") && !parentName.Equals("Table") && - !parentName.Equals("Figure")) - { - StepData tmpsd = (StepData)parnode.Tag; - parentName = tmpsd.ParentType; - parnode = advTreeStepTypes.FindNodeByName(parentName); - } - if (parnode != null) - { - parnode.Nodes.Add(newnode); - parnode.Nodes.Sort(); // sort the second level of the tree - } - else - advTreeStepTypes.Nodes.Add(newnode); - } - } - advTreeStepTypes.Nodes.Sort(); // sort the first level of the tree - } - buildStepTypePannelTitle(); - } - - public void advTreeProcSetsFillIn(bool blSeachTabClicked) - { - DevComponents.AdvTree.Node topnode = null; - int cntnd = 0; - VETreeNode vtn = VETreeNode.GetFolder(1); - FolderInfo fi = vtn.VEObject as FolderInfo; - int fiCount = fi.ChildFolderCount; - advTreeProcSets.Nodes.Clear(); - lstCheckedDocVersions.Clear(); - topnode = new DevComponents.AdvTree.Node(); - topnode.Text = "Available Procedure Sets"; - topnode.Tag = fi; - advTreeProcSets.Nodes.Add(topnode); - //advTreeProcSets.AfterNodeInsert += new TreeNodeCollectionEventHandler(advTreeProcSets_AfterNodeInsert); - - - foreach (FolderInfo fic in fi.ChildFolders) - { - DevComponents.AdvTree.Node newnode = new DevComponents.AdvTree.Node(); - newnode.Text = fic.ToString(); - newnode.Tag = fic; - - //int tmp; - //if (topnode == null) - //{ - // newnode.Text = "Available Procedure Sets"; - // tmp = advTreeProcSets.Nodes.Add(newnode); - // topnode = newnode; - //} - //else - //{ - // newnode.Selectable = true; - // newnode.CheckBoxAlignment = DevComponents.AdvTree.eCellPartAlignment.NearCenter; - // newnode.CheckBoxStyle = eCheckBoxStyle.CheckBox; - // newnode.CheckBoxThreeState = false; - // newnode.CheckBoxVisible = true; - // tmp = topnode.Nodes.Add(newnode); - //} - cntnd++; - if (fic.ChildFolderCount > 0 || fic.FolderDocVersionCount > 0) // allow for '+' for tree expansion - { - DevComponents.AdvTree.Node tnt = new DevComponents.AdvTree.Node(); - tnt.Text = "VLN_DUMMY"; - newnode.Nodes.Add(tnt); - topnode.Nodes.Add(newnode); - } - } - - // if nothing was added to the tree, just put in the node above the docversions... - if (advTreeProcSets.Nodes.Count == 0) - { - cntnd++; - fi = Mydocversion.MyFolder; - topnode = new DevComponents.AdvTree.Node(); - topnode.Text = fi.ToString(); - advTreeProcSets.Nodes.Add(topnode); - topnode.Tag = fi; - } - - advTreeProcSets.BeforeExpand += new DevComponents.AdvTree.AdvTreeNodeCancelEventHandler(advTreeProcSets_BeforeExpand); - - // position to the procedure set in the tree if we have a procedure open - if (Mydocversion != null) - advTreeProcSetsPreSelect(); - else - advTreeProcSets.Nodes[0].SelectedCell = advTreeProcSets.Nodes[0].Cells[0]; // select the first node - fixes cosmetic problem - - if (blSeachTabClicked) - cbxTextSearchText.Focus(); // set initial focus to enter search text - } - - //void advTreeProcSets_AfterNodeInsert(object sender, TreeNodeCollectionEventArgs e) - //{ - // IVEDrillDownReadOnly tmp = e.Node.Tag as IVEDrillDownReadOnly; - // if (tmp != null) - // { - // Console.WriteLine("Has Children {0} {1}", tmp.HasChildren, tmp.ToString()); - // FolderInfo fi = tmp as FolderInfo; - // //if (fi != null) - // // Console.WriteLine("dvi Count {0}", fi.FolderDocVersionCount); - // } - // vlnStackTrace.ShowStackLocal(e.Node.Text,1,10); - //} - - void advTreeProcSets_BeforeExpand(object sender, DevComponents.AdvTree.AdvTreeNodeCancelEventArgs e) - { - DevComponents.AdvTree.Node par = e.Node; - // get first child's text, if it has one & if the text is VLN_DUMMY, load children - DevComponents.AdvTree.Node tn = null; - if (par.Nodes.Count > 0) tn = par.Nodes[0]; - if (tn.Text == "VLN_DUMMY") // expand this - { - par.Nodes.Clear(); - Object obj = par.Tag; - if (!(obj is FolderInfo)) return; // should always be folderinfo on expand - FolderInfo fi = (FolderInfo)obj; - if (fi.ChildFolderCount > 0) - { - foreach (FolderInfo fic in fi.ChildFolders) - { - DevComponents.AdvTree.Node newnode = new DevComponents.AdvTree.Node(); - newnode.Text = fic.ToString(); - newnode.Tag = fic; - par.Nodes.Add(newnode); - if (fic.HasChildren) // allow for '+' for tree expansion - { - DevComponents.AdvTree.Node tnt = new DevComponents.AdvTree.Node(); - tnt.Text = "VLN_DUMMY"; - newnode.Nodes.Add(tnt); - } - } - } - else if (fi.FolderDocVersionCount > 0) - { - foreach (DocVersionInfo dv in fi.FolderDocVersions) - { - //if ((VersionTypeEnum)dv.VersionType == VersionTypeEnum.WorkingDraft) - //{ - DevComponents.AdvTree.Node newnode = new DevComponents.AdvTree.Node(); - newnode.Text = dv.ToString(); - newnode.Tag = dv; - newnode.Selectable = true; - newnode.CheckBoxAlignment = DevComponents.AdvTree.eCellPartAlignment.NearCenter; - newnode.CheckBoxStyle = eCheckBoxStyle.CheckBox; - newnode.CheckBoxThreeState = false; - newnode.CheckBoxVisible = true; - par.Nodes.Add(newnode); - //} - } - } - } - } - - private Node LookInTree(NodeCollection monkeys, string bananna) - { - Node foundit = null; - foreach (Node chimp in monkeys) - { - if (chimp.Text.Equals(bananna)) - { - foundit = chimp; - // need to select the node (cell) for it to be checked - chimp.SelectedCell = chimp.Cells[0]; - if (chimp.Nodes.Count > 0) - chimp.Expand(); - break; - } - chimp.Collapse(); - } - return foundit; - } - - private void advTreeProcSetsPreSelect() - { - bool keeplooking = true; - //build a stack (bread crumb trail) of where is procedure set came from within the tree. - Stack crumbs = new Stack(); - //crumbs.Push(Mydocversion.Name); // ex: "working draft" - //crumbs.Push(Mydocversion.MyFolder.Name); // ex: "Emergency Procedures" - //crumbs.Push(Mydocversion.MyFolder.MyParent.Name); // ex: "STPNOC-South Texas" - //crumbs.Push(advTreeProcSets.Nodes[0].Text); //top node of my tree - - crumbs.Push(Mydocversion.Name); // ex: "working draft" - crumbs.Push(Mydocversion.MyFolder.Name); // ex: "Emergency Procedures" - FolderInfo fi = Mydocversion.MyFolder.MyParent; - while (fi != null) - { - if (fi.MyParent != null) - crumbs.Push(fi.Name); - fi = fi.MyParent; - } - crumbs.Push(advTreeProcSets.Nodes[0].Text); //top node of my tree - - // now walk the tree, looking for the node names we saved in the stack. - NodeCollection monkeys = advTreeProcSets.Nodes; - while (keeplooking) - { - Node climber = LookInTree(monkeys, crumbs.Pop()); - keeplooking = (climber != null && crumbs.Count > 0); - if (keeplooking) - monkeys = climber.Nodes; - if (!keeplooking && climber != null) - { - climber.Checked = true; - } - } - } - - #endregion - - #region ROFST Combo Tree - private void LoadROComboTree() - { - if (_MyROFSTLookup == null) return; - cmboTreeROs.Nodes.Clear(); - this.cmboTreeROs.AdvTree.BeforeExpand += new DevComponents.AdvTree.AdvTreeNodeCancelEventHandler(this.cmboTreeROs_BeforeExpand); - cmboTreeROs.AdvTree.AfterExpand += new AdvTreeNodeEventHandler(AdvTree_AfterExpandorCollapse); - cmboTreeROs.AdvTree.AfterCollapse += new AdvTreeNodeEventHandler(AdvTree_AfterExpandorCollapse); - for (int i = 0; i < _MyROFSTLookup.myHdr.myDbs.Length; i++) - { - DevComponents.AdvTree.Node tn = new DevComponents.AdvTree.Node(); - tn.Text = _MyROFSTLookup.myHdr.myDbs[i].dbiTitle; - tn.Tag = _MyROFSTLookup.myHdr.myDbs[i]; - cmboTreeROs.Nodes.Add(tn); - AddDummyGroup(_MyROFSTLookup.myHdr.myDbs[i], tn); - } - } - void AdvTree_AfterExpandorCollapse(object sender, AdvTreeNodeEventArgs e) - { - Node bottomNode = BottomTreeNode(cmboTreeROs.AdvTree.Nodes); - Node lastNode = cmboTreeROs.AdvTree.Nodes[cmboTreeROs.AdvTree.Nodes.Count - 1]; - int top = cmboTreeROs.AdvTree.Nodes[0].Bounds.Top; - int bottom = bottomNode.Bounds.Bottom + 5; - int hScrollBarHeight = cmboTreeROs.AdvTree.HScrollBar != null ? cmboTreeROs.AdvTree.HScrollBar.Height : 0; - bottom = bottomNode.Bounds.Bottom + 5; - cmboTreeROs.AdvTree.Size = new Size(cmboTreeROs.AdvTree.Size.Width, Math.Min(525, bottom - top + hScrollBarHeight)); - if (cmboTreeROs.AdvTree.VScrollBar != null && bottom < cmboTreeROs.AdvTree.Size.Height) - { - int yLookFor = (bottom - cmboTreeROs.AdvTree.Size.Height) + 2 * hScrollBarHeight; - Node topNode = FindTreeNodeAt(cmboTreeROs.AdvTree.Nodes, yLookFor); - if (topNode != null) - topNode.EnsureVisible(); - } - } - private Node FindTreeNodeAt(NodeCollection nodes, int y) - { - foreach (Node node in nodes) - { - if (node.Bounds.Top <= y && node.Bounds.Bottom >= y) - return node; - if (node.Bounds.Top > y) - { - if (node.PrevNode != null && node.PrevNode.Expanded) - return FindTreeNodeAt(node.PrevNode.Nodes, y); - return node; - } - } - return null; - } - private Node BottomTreeNode(NodeCollection nodes) - { - Node bottomNode = nodes[nodes.Count - 1]; // Return bottom node in collection - if (bottomNode.Expanded) // If expanded return bottom child - return BottomTreeNode(bottomNode.Nodes); - return bottomNode; - } - private void AddDummyGroup(ROFSTLookup.rodbi rodbi, DevComponents.AdvTree.Node tn) - { - if (rodbi.children != null && rodbi.children.Length > 0) - { - DevComponents.AdvTree.Node tmp = new DevComponents.AdvTree.Node(); - tmp.Text = "VLN_DUMMY_FOR_TREE"; - tn.Nodes.Add(tmp); - } - } - private void cmboTreeROs_BeforeExpand(object sender, DevComponents.AdvTree.AdvTreeNodeCancelEventArgs e) - { - LoadChildren(e.Node); - } - - private void LoadChildren(DevComponents.AdvTree.Node tn) - { - object tag = tn.Tag; - if (tn.HasChildNodes && tn.Nodes[0].Text != "VLN_DUMMY_FOR_TREE") return; // already loaded. - if (tn.HasChildNodes && tn.Nodes[0].Text == "VLN_DUMMY_FOR_TREE") tn.Nodes[0].Remove(); - ROFSTLookup.rochild[] chld = null; - - if (tn.Tag is ROFSTLookup.rodbi) - { - ROFSTLookup.rodbi db = (ROFSTLookup.rodbi)tn.Tag; - chld = db.children; - } - else if (tn.Tag is ROFSTLookup.rochild) - { - ROFSTLookup.rochild ch = (ROFSTLookup.rochild)tn.Tag; - chld = ch.children; - } - else - { - Console.WriteLine("error - no type"); - return; - } - // if children, add dummy node - if (chld != null && chld.Length > 0) - { - ProgressBar_Initialize(chld.Length, tn.Text); - for (int i = 0; i < chld.Length; i++) - { - ProgressBar_SetValue(i); - DevComponents.AdvTree.Node tmp = null; - // if this is a group, i.e. type 0, add a dummy node - if (chld[i].type == 0 && chld[i].children == null) - //skip it. - // TODO: KBR how to handle this? - //Console.WriteLine("ro junk"); - continue; - else if (chld[i].value == null) - { - tmp = new DevComponents.AdvTree.Node(); - tmp.Text = chld[i].title; - tmp.Tag = chld[i]; - tn.Nodes.Add(tmp); - DevComponents.AdvTree.Node sub = new DevComponents.AdvTree.Node(); - sub.Text = "VLN_DUMMY_FOR_TREE"; - tmp.Nodes.Add(sub); - } - else - { - tmp = new DevComponents.AdvTree.Node(); - tmp.Text = chld[i].title; - tmp.Tag = chld[i]; - int index = FindIndex(tn.Nodes, tmp.Text); - tn.Nodes.Insert(index, tmp); - //tn.Nodes.Add(tmp); - } - } - } - ProgressBar_Clear(); - } - - private int FindIndex(NodeCollection nodes, string value) - { - int index = 0; - foreach (Node node in nodes) - { - if (GreaterValue(node.Text, value)) return index; - index++; - } - return index; - } - private static Regex _RegExGetNumber = new Regex(@"^ *[+-]?[.,0-9]+(E[+-]?[0-9]+)?"); - private bool GreaterValue(string value1, string value2) - { - Match match1 = _RegExGetNumber.Match(value1); - Match match2 = _RegExGetNumber.Match(value2); - if (match1.Success && match2.Success) // Compare the numeric value - { - double dbl1 = double.Parse(match1.ToString()); - double dbl2 = double.Parse(match2.ToString()); - return dbl1 > dbl2; - } - return String.Compare(value1, value2, true) > 0; - } - - private void cmboTreeROs_SelectedIndexChanged(object sender, EventArgs e) - { - if (cmboTreeROs.SelectedIndex == -1 || cmboTreeROs.SelectedNode.Tag is ROFSTLookup.rodbi) - cbxFndUnLnkROVals.Enabled = false; - else if (cmboTreeROs.SelectedNode.Tag is ROFSTLookup.rochild) - { - ROFSTLookup.rochild ro = (ROFSTLookup.rochild)cmboTreeROs.SelectedNode.Tag; - cbxFndUnLnkROVals.Enabled = (ro.children == null); - } - if (!cbxFndUnLnkROVals.Enabled) - cbxFndUnLnkROVals.Checked = false; - } - - private void gpFindROs_EnabledChanged(object sender, EventArgs e) - { - if (gpFindROs.Enabled) - gpFindROs.Style.BackColor = Color.Yellow; - else - gpFindROs.Style.BackColor = saveGpFindROsColor; - } - - #endregion - - #region Annotation Search - - public void SetupAnnotationSearch(AnnotationDetails annotationDetails, DisplayTabControl tc) - { - _AnnotationDetails = annotationDetails; - List annoTypes = new List(); - annoTypes.Add(new AnnotationTypeSearch("All Annotations", "")); - AnnotationTypeInfoList annoList = AnnotationTypeInfoList.Get(); - foreach (AnnotationTypeInfo ati in annoList) - annoTypes.Add(new AnnotationTypeSearch(ati.Name, ati.TypeID.ToString())); - cbxAnnoTypes.DisplayMember = "Name"; - cbxAnnoTypes.DataSource = annoTypes; - lbSrchResults.MouseMove += new MouseEventHandler(lbSrchResults_MouseMove); - _TabControl = tc; - } - - - private void cbxTextSearchAnnotation_Leave(object sender, EventArgs e) - { - InsertAnnotationSearchCriteria(); - - } - - private void InsertAnnotationSearchCriteria() - { - if (!cbxTextSearchAnnotation.Text.Equals(string.Empty)) - { - string tstr = cbxTextSearchAnnotation.Text; - if (!cbxTextSearchAnnotation.Items.Contains(tstr)) - cbxTextSearchAnnotation.Items.Insert(0, tstr); - } - } - - private void gpSrchAnnoText_EnabledChanged(object sender, EventArgs e) - { - if (gpSrchAnnoText.Enabled) - { - gpSrchAnnoText.Style.BackColor = Color.Yellow; - cbxTextSearchAnnotation.Focus(); - } - else - gpSrchAnnoText.Style.BackColor = saveGpSrchAnnoTextColor; - } - - #endregion - - #region ProgressBar - private void ProgressBar_Initialize(int max, string desc) - { - if (_ProgressBar != null) - { - _ProgressBar.Maximum = max; - _ProgressBar.Text = desc; - _ProgressBar.TextVisible = true; - } - } - - private void ProgressBar_SetValue(int curval) - { - if (_ProgressBar != null) - _ProgressBar.Value = curval; - } - - private void ProgressBar_Clear() - { - if (_ProgressBar != null) - { - _ProgressBar.Text = ""; - _ProgressBar.Maximum = 0; - _ProgressBar.Value = 0; - _ProgressBar.TextVisible = false; - } - } - #endregion - - #region Search Results - private void DisplayResults() - { - _LoadingList = true; - lbSrchResults.DisplayMember = _DisplayMember; - if (_SearchResults != null) - { - if (cbSorted.Checked) - { - Csla.SortedBindingList sortedResults = new Csla.SortedBindingList(_SearchResults); - sortedResults.ApplySort(_DisplayMember, ListSortDirection.Ascending); - lbSrchResults.DataSource = sortedResults; - } - else - //PopulatelbSrcResults(_SearchResults); - lbSrchResults.DataSource = _SearchResults; - grpPanSearchResults.Text = string.Format("Search Results Found: {0}", _SearchResults.Count); - grpPanSearchResults.Style.BackColor = Color.LightGreen;// Color.YellowGreen; Color.DarkSeaGreen; - } - else - { - grpPanSearchResults.Text = "Search Results"; - grpPanSearchResults.Style.BackColor = saveGrpPanSearchResults; - } - // Turn Print and Results display style on/off based on whether there are search results - if (lbSrchResults.Items.Count > 0) - { - btnPrnSrchRslts.Enabled = true; - btnClearSearchResults.Enabled = true; - btnCopySearchResults.Enabled = true; - cmbResultsStyle.Enabled = true; - } - else - { - btnPrnSrchRslts.Enabled = false; - btnClearSearchResults.Enabled = false; - btnCopySearchResults.Enabled = false; - cmbResultsStyle.Enabled = false; - } - - lbSrchResults.SelectedIndex = -1; - LastResultsMouseOverIndex = -1; - _LoadingList = false; - - } - - //private void PopulatelbSrcResults(ICollection _SearchResults) - //{ - // foreach (ItemInfo ii in _SearchResults) - // { - // lbSrchResults.Items.Add(ii); - // } - // Console.WriteLine("{0} Populate", DateTime.Now); - //} - //public void UpdateAnnotationSearchResults() - //{ - // //AnnotationTypeInfo ati = cbxAnnoTypes.SelectedValue as AnnotationTypeInfo; - // //_LoadingList = true; - // //lbSrchResults.DataSource = ati.AnnotationTypeAnnotations; - // //lbSrchResults.SelectedIndex = -1; - // //LastResultsMouseOverIndex = -1; - // //if (lbSrchResults.Items.Count > 0) - // // btnPrnSrchRslts.Enabled = true; - // //else - // // btnPrnSrchRslts.Enabled = false; - // //_LoadingList = false; - //} - private void lbSrchResults_MouseMove(object sender, MouseEventArgs e) - { - int ResultsMouseOverIndex = lbSrchResults.IndexFromPoint(e.Location); - if (ResultsMouseOverIndex != -1 && ResultsMouseOverIndex != LastResultsMouseOverIndex) - { - ItemInfo ii = lbSrchResults.Items[ResultsMouseOverIndex] as ItemInfo; - if (cmbResultsStyle.Text == "Step Path") - toolTip1.SetToolTip(lbSrchResults, ii.DisplayText); // display the text in a tooltip - else - toolTip1.SetToolTip(lbSrchResults, ii.Path); // display location of corresponding procedure text in a tooltip - LastResultsMouseOverIndex = ResultsMouseOverIndex; - } - } - private bool _ProcessingSelectedValueChanged = false; - private void lbSrchResults_SelectedValueChanged(object sender, EventArgs e) - { - if (_LoadingList) return; - if (_ProcessingSelectedValueChanged) return; - _ProcessingSelectedValueChanged = true; - // If the list is being refreshed, then set the selection index to -1 (no selection) - if (_SearchResults.RefreshingList && lbSrchResults.SelectedIndex != -1) - lbSrchResults.SelectedIndex = -1; - else - { - _ItemInfo = lbSrchResults.SelectedValue as ItemInfo; - if ((tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[1]) && (_ItemInfo != null)) - { - _AnnotationDetails.CurrentAnnotation = AnnotationInfo.Get(_ItemInfo.SearchAnnotationID); - if (_AnnotationDetails.CurrentAnnotation != null) - _TabControl.OpenItem(_AnnotationDetails.CurrentAnnotation.MyItem); // open the corresponding procedure text - _AnnotationDetails.FindCurrentAnnotation(); // position to corresponding row in annotation grid - } - else - { - if (_ItemInfo != null) - { - _OpenDocFromSearch = true; - DisplayTabItem dti = _TabControl.OpenItem(_ItemInfo); // open the corresponding procedure text - if (dti != null) - { - if (dti.MyDSOTabPanel != null) - dti.MyDSOTabPanel.SearchString = _strSrchText == null || _strSrchText == "" ? this.cbxTextSearchText.Text : _strSrchText; - if (dti.MyStepTabPanel != null) - dti.MyStepTabPanel.SearchString = _strSrchText == null || _strSrchText == "" ? this.cbxTextSearchText.Text : _strSrchText; - _OpenDocFromSearch = false; - } - } - } - } - _ProcessingSelectedValueChanged = false; - } - - private void cmbResultsStyle_SelectedValueChanged(object sender, EventArgs e) - { - switch (cmbResultsStyle.Text) - { - case "Document Path": - _DisplayMember = "SearchDVPath"; - break; - case "Step Path": - _DisplayMember = "ShortSearchPath"; - break; - case "Annotation Text": - _DisplayMember = "SearchAnnotationText"; - break; - case "Document Text": - _DisplayMember = "DisplayText"; - break; - default: - _DisplayMember = "SearchPath"; - break; - } - DisplayResults(); - } - - private void cbSorted_CheckedChanged(object sender, EventArgs e) - { - Cursor savcursor = Cursor; - Application.DoEvents(); - Cursor = Cursors.WaitCursor; - //Console.WriteLine(string.Format("Checked = {0}", cbSorted.Checked)); - DisplayResults(); - Cursor = savcursor; - } - #endregion - - #region Search - private string DVISearchList - { - get - { - // append list of document versions to search - if (lstCheckedDocVersions.Count > 0) - { - string strRtnStr = ""; - // get list of doc versions to search - foreach (DocVersionInfo dvi in lstCheckedDocVersions) - { - strRtnStr += string.Format(",{0}", dvi.VersionID.ToString()); - } - return strRtnStr.Substring(1); - } - return ""; - } - } - private string TypeSearchList - { - get - { - // append list of step types to search - if (lstCheckedStepTypes.Count > 0) - { - string strRtnStr = ""; - // get list of selected types - foreach (int typ in lstCheckedStepTypes) - { - int tmp = typ; - if (tmp == 0) - tmp = 10000; // this is the accessory page type - else - tmp += 20000; // step/substep types - strRtnStr += string.Format(",{0}", tmp); - } - return strRtnStr.Substring(1); - } - return ""; - } - } - private string TextSearchString - { - get - { - if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[0]) - return ConvertSpecialChars(cbxTextSearchText.Text);//string.Format("{0}", cbxTextSearchText.Text); - return ""; - } - } - private string AnnotationSearchType - { - get - { - if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[1]) - return ((AnnotationTypeSearch)cbxAnnoTypes.SelectedValue).ID; - return ""; - } - } - private string ROSearchList - { - get - { - if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[2]) - { // RO Search - ROFSTLookup.rochild[] chld = null; - ROFSTLookup.rochild ch; - if (cmboTreeROs.SelectedNode != null) - { - if (cbxFndUnLnkROVals.Enabled && cbxFndUnLnkROVals.Checked) - { - ch = (ROFSTLookup.rochild)cmboTreeROs.SelectedNode.Tag; - _strSrchText = string.Format("{0}", ch.value); - return _strSrchText; // append RO Value text to search - } - else - { - if (cmboTreeROs.SelectedNode.Tag is ROFSTLookup.rodbi) - { - ROFSTLookup.rodbi db = (ROFSTLookup.rodbi)cmboTreeROs.SelectedNode.Tag; - return _MyRODbID.ToString() + ":" + string.Format("{0}", db.dbiID.ToString("X4")); - } - else if (cmboTreeROs.SelectedNode.Tag is ROFSTLookup.rochild) - { - ch = (ROFSTLookup.rochild)cmboTreeROs.SelectedNode.Tag; - chld = ch.children; - // build a list of ROs to search - return _MyRODbID.ToString() + ":" + GetROsToSearch(chld); - //return _MyRODbID.ToString() + ":" + ch.roid + "0000," + GetROsToSearch(chld); - //if (strRtnStr.EndsWith(",")) - // strRtnStr = strRtnStr.Substring(0, strRtnStr.Length - 1); - } - } - } - } - return ""; - } - } - - private string ConvertSpecialChars(string str) - { - string rtnVal = str; - if (_MyDocVersion != null) - { - rtnVal = rtnVal.Replace("\u00A0", @"\u160?"); //convert \u00A0 to a hard space (\u00A0 shows as a blank in the search text field) - rtnVal = rtnVal.Replace("\n", ""); - FormatData fmtdata = _MyDocVersion.ActiveFormat.PlantFormat.FormatData; - SymbolList sl = fmtdata.SymbolList; - if (sl != null) - { - foreach (Symbol sym in sl) - { - string rplace = string.Format(sym.Unicode < 256 ? @"\'{0:X2}" : @"\u{0}", sym.Unicode); - rtnVal = rtnVal.Replace(((char)sym.Unicode).ToString(), rplace); - } - } - } - return rtnVal; - } - // Same funtion as GetROChildren in DisplayReport.cs - private string GetROsToSearch(ROFSTLookup.rochild[] chld) - { - string rtnstr = ""; - if (chld == null) // get a single ROID - { - ROFSTLookup.rochild ro = (ROFSTLookup.rochild)cmboTreeROs.SelectedNode.Tag; - rtnstr += string.Format("{0}", ro.roid); - if (rtnstr.Length == 12) rtnstr += "0000"; // last four digits are used for multiple return values - } - else - { // spin through the child list and get the ROIDs. - // if the child has children, then call this function recursivly - foreach (ROFSTLookup.rochild roc in chld) - { - if (roc.children != null) - rtnstr += GetROsToSearch(roc.children); - else - rtnstr += string.Format("{0},", roc.roid); - } - } - return rtnstr; - } - - private void btnSearch_Click(object sender, EventArgs e) - { - DateTime start = DateTime.Now; - Cursor savcursor = Cursor; - // keeps track of index into combo box for results style. This combo box may have 3 or 4 - // items depending on whether annotations exist. - int cmbResultsStyleIndex = -1; - try - { - lbSrchResults.DataSource = null; - lbSrchResults.Items.Clear(); - toolTip1.SetToolTip(lbSrchResults, null); - Cursor = Cursors.WaitCursor; - SearchResults = null; - bool includeRTFformat = false; - bool includeSpecialChars = true; - // Build list of selected types that were searched - string typstr = null; - foreach (string s in lstCheckedStepTypesStr) typstr = typstr == null ? s : typstr + ", " + s; - TypesSelected = "Filtered By: " + ((typstr != null) ? typstr : "All Step Types"); - //TypesSelected = "Step Types Searched: " + ((typstr != null) ? typstr : "all step types"); - //TypesSelected = "Searched Step Types: " + ((typstr != null) ? typstr : "all step types"); - //TypesSelected = (typstr != null) ? "Searched Step Types: " + typstr : "Searched All Step Types"; - string unitPrefix = ""; - if(Mydocversion != null) - unitPrefix = Mydocversion.DocVersionConfig.Unit_ProcedureNumber; - if (unitPrefix.EndsWith("#")) - unitPrefix = unitPrefix.Replace("#", ""); - - if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[0]) // Text Search - { - if (cbxSrchTypeUsage.Checked) // find just the usage of the selected types - { - if (lstCheckedStepTypes.Count == 0) - { - MessageBox.Show("Please select one or more types then press the Search button", "No Types Selected"); - xpStepTypes.Expanded = true; - advTreeStepTypes.Focus(); - xpStepTypes.TitleStyle.BackColor1.Color = Color.Crimson; - } - else - { - //string typstr = null; - //foreach (string s in lstCheckedStepTypesStr) typstr = typstr==null?s:typstr + ", " + s; - //ReportTitle = "Search for Selected Types"; //"Proms - Search by Type: " + typstr; - ReportTitle = "Step Element Report"; //"Proms - Search by Type: " + typstr; - TypesSelected = "Filtered By: " + typstr; - SearchString = null; - SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, "", cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, ItemSearchIncludeLinks.Value, includeRTFformat, includeSpecialChars, unitPrefix); - cmbResultsStyleIndex = 1; //display step locations in results - } - } - else - { - //if (textSearchString.Equals("")) - //{ - // MessageBox.Show("Please enter some search text, then click the Search button", "No Search Text"); - // cbxTextSearchText.Focus(); - //} - //else - //{ - //ReportTitle = string.Format("Proms - {0} Search for '{1}'", cbxBooleanTxtSrch.Checked ? "Boolean" : "Text", TextSearchString); - ReportTitle = string.Format("Search for '{0}'", TextSearchString); - SearchString = TextSearchString; - //TypesSelected = (typstr != null) ? "Searched Step Types: " + typstr : "Searched All Step Types"; - //TypesSelected = "Searched Step Types: " + ((typstr != null) ? typstr : "All Step Types"); - SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, TextSearchString, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, cbxIncROTextSrch.Checked ? ItemSearchIncludeLinks.Value : ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix); - cmbResultsStyleIndex = 3; // display step text in results - //} - } - } - else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[1]) // Annotation Search - { - SearchString = null; - //ReportTitle = string.Format("Proms - Annotation Search for '{0}'", cbxTextSearchAnnotation.Text); - if (cbxTextSearchAnnotation.Text == null || cbxTextSearchAnnotation.Text == "") - { - ReportTitle = string.Format("Find {0}{1}", cbxAnnoTypes.Text, (cbxAnnoTypes.SelectedIndex > 0)?" Annotations" : "" ); - } - else - { - ReportTitle = string.Format("Search {0}{1} For '{2}'", cbxAnnoTypes.Text, (cbxAnnoTypes.SelectedIndex > 0) ? " Annotations" : "", cbxTextSearchAnnotation.Text); - } - //ReportTitle = string.Format("Search Annotations for '{0}'", cbxTextSearchAnnotation.Text); - //string srchStr = ConvertSpecialChars(cbxTextSearchAnnotation.Text);//cbxTextSearchAnnotation.Text; - //TypesSelected = "Searched Step Types: " + ((typstr != null) ? typstr : "All Step Types"); - - //SearchResults = ItemInfoList.GetListFromAnnotationSearch(dviSearchList, typeSearchList, textSearchString, srchStr, cbxCaseSensitiveAnnoText.Checked); - - SearchResults = ItemInfoList.GetListFromAnnotationSearch(DVISearchList, TypeSearchList, AnnotationSearchType, cbxTextSearchAnnotation.Text, cbxCaseSensitiveAnnoText.Checked,unitPrefix); - //UpdateAnnotationSearchResults(); - cmbResultsStyleIndex = 2; // display annotation text in results - } - else if (tabSearchTypes.SelectedTab == tabSearchTypes.Tabs[2]) // RO Search - { - SearchString = null; - //ReportTitle = "Proms - Referenced Object Search"; - ReportTitle = string.Format("Search For Referenced Object:\n{0}", cmboTreeROs.Text); - //TypesSelected = "Searched Step Types: " + ((typstr != null) ? typstr : "All Step Types"); - if (cbxFndUnLnkROVals.Enabled && cbxFndUnLnkROVals.Checked) - { - SearchResults = ItemInfoList.GetListFromTextSearch(DVISearchList, TypeSearchList, ROSearchList, cbxBooleanTxtSrch.Checked ? 2 : cbxCaseSensitive.Checked ? 1 : 0, ItemSearchIncludeLinks.Nothing, includeRTFformat, includeSpecialChars, unitPrefix); - cmbResultsStyleIndex = 3; // display step text in results - } - else - { - SearchResults = ItemInfoList.GetListFromROSearch(DVISearchList, TypeSearchList, ROSearchList, unitPrefix); - cmbResultsStyleIndex = 3; // display step text in results - } - } - AddMessageForEmptyAnnotations(); - if (cmbResultsStyleIndex == 3 && cmbResultsStyle.Items.Count == 3) cmbResultsStyleIndex--; - cmbResultsStyle.SelectedIndex = cmbResultsStyleIndex; - DisplayResults(); - if (SearchResults != null && SearchResults.Count == 0) - { - MessageBox.Show("No Matches Found.", "Search"); - } - } - catch (Exception ex) - { - while (ex.InnerException != null) - ex = ex.InnerException; - string tmpmsg = (cbxBooleanTxtSrch.Checked && ex.Message.Contains("Syntax error") && ex.Message.Contains("full-text search")) ? - "Place \"\" around words that you are searching for, so that parser can better understand what you are trying to find" : - ex.Message; - MessageBox.Show(tmpmsg, "Search Error: " + ex.GetType().Name); - } - finally - { - Cursor = savcursor; - } - Console.WriteLine("{0} Milliseconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalMilliseconds); - //if (VlnSettings.DebugMode) - // MessageBox.Show(string.Format("{0} Milliseconds", TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalMilliseconds)); - } - - private void AddMessageForEmptyAnnotations() - { - bool hasAnnot = false; - foreach (ItemInfo ii in SearchResults) - { - if (ii.ItemAnnotationCount > 0) - { - // RHM - can an iteminfo have an itemannotationcount>0 and not have searchannotationtext. - if (ii.SearchAnnotationText == null) ii.SearchAnnotationText = AnnotationInfo.Get(ii.ItemAnnotations[0].AnnotationID).SearchText; - } - - if (ii.SearchAnnotationText == null) ii.SearchAnnotationText = "None - [" + ii.DisplayText + "]"; - else - { - hasAnnot = true; - } - } - cmbResultsStyle.Items.Clear(); - cmbResultsStyle.Items.Add(comboItem1); - cmbResultsStyle.Items.Add(comboItem2); - if (hasAnnot) cmbResultsStyle.Items.Add(comboItem3); - cmbResultsStyle.Items.Add(comboItem4); - } - - private void cbxTextSearchText_Leave(object sender, EventArgs e) - { - InsertSearchCriteria(); - } - - private void InsertSearchCriteria() - { - if (!cbxTextSearchText.Text.Equals(string.Empty)) - { - string tstr = cbxTextSearchText.Text; - // if its already exists in the list - remove it - if (cbxTextSearchText.Items.Contains(tstr)) - cbxTextSearchText.Items.Remove(tstr); - // Add the new criteria to the top of the list - cbxTextSearchText.Items.Insert(0, tstr); - // set the text to the new criteria - cbxTextSearchText.Text = tstr; - // If there are more than 10 remove the last one - if (cbxTextSearchText.Items.Count > 10) - cbxTextSearchText.Items.RemoveAt(10); - } - } - - private void cbxSrchTypeUsage_CheckedChanged(object sender, EventArgs e) - { - gpSrchText.Enabled = !cbxSrchTypeUsage.Checked; - if (!cbxSrchTypeUsage.Checked) - xpStepTypes.TitleStyle.BackColor1.Color = saveXpStepTypeTitleColor; - else - { - xpStepTypes.Expanded = true; - if (lstCheckedStepTypes.Count == 0) - xpStepTypes.TitleStyle.BackColor1.Color = Color.Crimson; - advTreeStepTypes.Focus(); - - } - } - - private void rbtnSrchTxt_CheckedChanged(object sender, EventArgs e) - { - if (rbtnSrchTxt.Checked) - cbxTextSearchText.Focus(); - - } - - - private void gpSrchText_EnabledChanged(object sender, EventArgs e) - { - if (gpSrchText.Enabled) - gpSrchText.Style.BackColor = cbxBooleanTxtSrch.Checked ? Color.Orange : Color.Yellow; - else - gpSrchText.Style.BackColor = saveGpSrchTextColor; - } - - private void tabStepTypeSearch_Click(object sender, EventArgs e) - { - if (rbtnSrchTxt.Checked) - { - cbxTextSearchText.Focus(); - cbxBooleanTxtSrch_CheckedChanged(sender, e); - } - } - - private void ProcessEnterKey(object sender, KeyPressEventArgs e) - { - if (e.KeyChar == '\r') // enter key pressed - { - e.Handled = true; - btnSearch_Click(sender, e); - if (sender == cbxTextSearchText) - InsertSearchCriteria(); - else - InsertAnnotationSearchCriteria(); - } - } - #endregion - - #region ProcSetSelection - private int _MyRODbID; - private void advTreeProcSets_AfterCheck(object sender, DevComponents.AdvTree.AdvTreeCellEventArgs e) - { - DevComponents.AdvTree.Node n = advTreeProcSets.SelectedNode; - if (n.Checked) - { - n.Style = DevComponents.AdvTree.NodeStyles.Apple; - lstCheckedDocVersions.Add((DocVersionInfo)n.Tag); - if (lstCheckedDocVersions.Count == 1)//Mydocversion == null) - { - Mydocversion = (DocVersionInfo)n.Tag; - advTreeStepTypesFillIn(); - } - } - else - { - n.Style = null; - lstCheckedDocVersions.Remove((DocVersionInfo)n.Tag); - if (lstCheckedDocVersions.Count == 1) - { - if (Mydocversion != lstCheckedDocVersions[0]) - { - Mydocversion = lstCheckedDocVersions[0]; - advTreeStepTypesFillIn(); - } - } - else - { - if (lstCheckedDocVersions.Count == 0) - Mydocversion = null; - // do this if either none, or more than one procedure set selected - advTreeStepTypes.Nodes.Clear(); - lstCheckedStepTypes.Clear(); - lstCheckedStepTypesStr.Clear(); - Node newnode = new DevComponents.AdvTree.Node(); - newnode.Text = "....select a procedure set for types to appear..."; - advTreeStepTypes.Nodes.Add(newnode); - buildStepTypePannelTitle(); - } - } - //// Enable the RO combo list only if at least one procedure set node - //// is selected - //cmboTreeROs.Enabled = (lstCheckedDocVersions.Count > 0); - //gpFindROs.Enabled = cmboTreeROs.Enabled; - - SetupContextMenu(); - - buildSetToSearchPanelTitle(); - } - - - private void xpSetToSearch_ExpandedChanged(object sender, ExpandedChangeEventArgs e) - { - buildSetToSearchPanelTitle(); - } - - private void buildSetToSearchPanelTitle() - { - if (lstCheckedDocVersions.Count == 0) - { - xpSetToSearch.TitleText = string.Format("All Procedure Sets Selected"); - xpSetToSearch.TitleStyle.BackColor1.Color = Color.PapayaWhip; - btnSearch.Enabled = true; - tabSearchTypes.Enabled = true; // enable all the search tabs - // xpSetToSearch.Expanded = true; - // xpSetToSearch.TitleStyle.BackColor1.Color = Color.Crimson; - // btnSearch.Enabled = false; - // tabSearchTypes.Enabled = false; // disable all the search tabs - // //if (xpSetToSearch.Expanded) - // xpSetToSearch.TitleText = "Select Procedure Sets to Search"; - // //else - // // xpSetToSearch.TitleText = "Click Here to Select Procedure Sets"; - - // //xpSetToSearch.TitleStyle.BackColor1.Color = saveXpSetToSearchColor; - } - else //if (lstCheckedDocVersions.Count > 0) - { - // display the number of selected procedure sets whether pannel is expanded or not - xpSetToSearch.TitleText = string.Format("{0} Procedure Sets Selected", lstCheckedDocVersions.Count); - xpSetToSearch.TitleStyle.BackColor1.Color = Color.PapayaWhip; - btnSearch.Enabled = true; - tabSearchTypes.Enabled = true; // enable all the search tabs - } - - } - - private void advTreeProcSets_AfterNodeSelect(object sender, AdvTreeNodeEventArgs e) - { - DevComponents.AdvTree.Node n = advTreeProcSets.SelectedNode; - if (advTreeStepTypes.Nodes.Count == 1 && n.Checked) - { - Mydocversion = (DocVersionInfo)n.Tag; - advTreeStepTypesFillIn(); - } - } - - #endregion - - #region StepTypeSelection - private void advTreeStepTypes_AfterCheck(object sender, DevComponents.AdvTree.AdvTreeCellEventArgs e) - { - xpStepTypes.TitleStyle.BackColor1.Color = saveXpStepTypeTitleColor; - DevComponents.AdvTree.Node n = advTreeStepTypes.SelectedNode; - StepData sd = (StepData)n.Tag; - if (n.Checked) - { - n.Style = DevComponents.AdvTree.NodeStyles.Apple; - if (sd == null) - { - if (!lstCheckedStepTypesStr.Contains("Accessory Sections")) - { - lstCheckedStepTypes.Add(0); //use zero to identify attachment search - lstCheckedStepTypesStr.Add("Accessory Sections"); - } - } - else - { - if (!lstCheckedStepTypesStr.Contains(advTreeStepTypes.SelectedNode.Text)) - { - lstCheckedStepTypes.Add((int)sd.Index); - lstCheckedStepTypesStr.Add(advTreeStepTypes.SelectedNode.Text); - } - } - } - else - { - n.Style = null; - if (sd == null) - { - lstCheckedStepTypesStr.Remove("Accessory Sections"); - lstCheckedStepTypes.Remove(0); - } - else - { - lstCheckedStepTypes.Remove((int)sd.Index); - //lstCheckedStepTypesStr.Remove(sd.Type); - lstCheckedStepTypesStr.Remove(advTreeStepTypes.SelectedNode.Text); - } - } - buildStepTypePannelTitle(); - - } - - private void xpStepTypes_ExpandedChanged(object sender, ExpandedChangeEventArgs e) - { - buildStepTypePannelTitle(); - } - - private void buildStepTypePannelTitle() - { - if (lstCheckedStepTypes.Count == 0) - { - if (xpStepTypes.Expanded) - { - xpStepTypes.TitleText = "Select Step Elements To Search";//"Select Types To Search"; - advTreeStepTypes.Focus(); - advTreeStepTypes.Nodes[0].SelectedCell = advTreeStepTypes.Nodes[0].Cells[0]; - } - else - xpStepTypes.TitleText = "Click Here To Search By Step Element";//"Click Here To Search By Types"; - - xpStepTypes.TitleStyle.BackColor1.Color = saveXpStepTypeTitleColor; - } - else //lstCheckedStepTypes.Count > 0 - { - // show how many selected whether pannel is expanded or not - //xpStepTypes.TitleText = string.Format("{0} Step Styles Selected", lstCheckedStepTypes.Count); - xpStepTypes.TitleText = string.Format("{0} Step Element{0} Selected", lstCheckedStepTypes.Count, (lstCheckedStepTypes.Count > 1)?"s":""); - xpStepTypes.TitleStyle.BackColor1.Color = Color.PapayaWhip; - } - } - - #endregion - - #region ContextMenu - - private void btnSym_Click(object sender, EventArgs e) - { - DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender; - if (cbxTextSearchAnnotation.Focused) - cbxTextSearchAnnotation.SelectedText = (string)b.Text; - else if (cbxTextSearchText.Focused) - cbxTextSearchText.SelectedText = (string)b.Text; - } - - private void cmFndTxtInsHardSp_Click(object sender, EventArgs e) - { - // We use \u00A0 to represent a hard space because it show in the search text field as a blank - // It will get translated to a real hard space character prior to searching - if (cbxTextSearchAnnotation.Focused) - cbxTextSearchAnnotation.SelectedText = "\u00A0"; - else if (cbxTextSearchText.Focused) - cbxTextSearchText.SelectedText = "\u00A0"; - } - - private void SetupContextMenu() - { - galSymbols.SubItems.Clear(); - if (_MyDocVersion != null) - { - FormatData fmtdata = _MyDocVersion.ActiveFormat.PlantFormat.FormatData; - SymbolList sl = fmtdata.SymbolList; - if (sl == null || sl.Count <= 0) - { - MessageBox.Show("No symbols are available, check with administrator"); - return; - } - 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); - galSymbols.SubItems.Add(btnCM); - } - } - } - - private void cmFndTxtCut_Click(object sender, EventArgs e) - { - Clipboard.Clear(); - DataObject myDO = new DataObject(DataFormats.Text, cbxTextSearchAnnotation.Focused ? cbxTextSearchAnnotation.SelectedText : cbxTextSearchText.SelectedText); - Clipboard.SetDataObject(myDO); - // Need to check which combo box activated the context menu so that we know where to take/put selected text - if (cbxTextSearchAnnotation.Focused) - cbxTextSearchAnnotation.SelectedText = ""; - else if (cbxTextSearchText.Focused) - cbxTextSearchText.SelectedText = ""; - - } - - private void cmFndTxtCopy_Click(object sender, EventArgs e) - { - // Need to check which combo box activated the context menu so that we know where to take/put selected text - DataObject myDO = new DataObject(DataFormats.Text, cbxTextSearchAnnotation.Focused ? cbxTextSearchAnnotation.SelectedText : cbxTextSearchText.SelectedText); - if (cbxTextSearchText.Focused || cbxTextSearchAnnotation.Focused) - { - Clipboard.Clear(); - Clipboard.SetDataObject(myDO); - } - } - - private void cmFndTxtPaste_Click(object sender, EventArgs e) - { - // Need to check which combo box activated the context menu so that we know where to take/put selected text - IDataObject myDO = Clipboard.GetDataObject(); - //if (myDO.GetDataPresent(DataFormats.Rtf)) - //{ - // RichTextBox rtb = new RichTextBox(); - // rtb.SelectedRtf = ItemInfo.StripLinks(myDO.GetData(DataFormats.Rtf).ToString()); - - // if (cbxTextSearchAnnotation.Focused) - // cbxTextSearchAnnotation.SelectedText = rtb.Text; - // else if (cbxTextSearchText.Focused) - // cbxTextSearchText.SelectedText = rtb.Text;// .SelectedText;//myDO.GetData(DataFormats.Text,true).ToString(); - //} - //else if (myDO.GetDataPresent(DataFormats.Text)) - if (myDO.GetDataPresent(DataFormats.Text)) - if (cbxTextSearchAnnotation.Focused) - cbxTextSearchAnnotation.SelectedText = Clipboard.GetText(); - else if (cbxTextSearchText.Focused) - cbxTextSearchText.SelectedText = Clipboard.GetText();//myDO.GetData(DataFormats.Text).ToString(); - } - - private void btnCMIFindText_PopupOpen(object sender, PopupOpenEventArgs e) - { - // the context menu is available with just a mouse hover, even if the combo box does not have focus - // ... set the focus to which ever combo box initiated the context menu - if (tabAnnotationSearch.IsSelected) - { - if (!cbxTextSearchAnnotation.Focused) - cbxTextSearchAnnotation.Focus(); - } - else if (tabStepTypeSearch.IsSelected) - { - if (!cbxTextSearchText.Focused) - cbxTextSearchText.Focus(); - } - } - #endregion - private void buttonItem2_Click(object sender, EventArgs e) - { - if (cbxTextSearchAnnotation.Focused) - cbxTextSearchAnnotation.SelectedText = "*"; - else if (cbxTextSearchText.Focused) - cbxTextSearchText.SelectedText = "*"; - - } - private void buttonItem3_Click(object sender, EventArgs e) - { - if (cbxTextSearchAnnotation.Focused) - cbxTextSearchAnnotation.SelectedText = "?"; - else if (cbxTextSearchText.Focused) - cbxTextSearchText.SelectedText = "?"; - - } - private void buttonItem4_Click(object sender, EventArgs e) - { - if (cbxTextSearchAnnotation.Focused) - cbxTextSearchAnnotation.SelectedText = "?*"; - else if (cbxTextSearchText.Focused) - cbxTextSearchText.SelectedText = "?*"; - } - private void cbxBooleanTxtSrch_CheckedChanged(object sender, EventArgs e) - { - // If the Boolean search is not working - run the following two commands in SQL: - // use veproms - // ALTER FULLTEXT INDEX ON Contents START FULL POPULATION - // ALTER FULLTEXT INDEX ON Documents START FULL POPULATION - // use master - //Boolean search uses a list of noise, or STOP, words. This list can be found - // in file: C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\FTData\noiseenu.txt. - // Another file exists in that directory, tsenu.xml, this is a thesaurus. RHM tried - // to use around 2010, but couldn't get it to work for words like 'dg' versus 'diesel generator', - // and 'sg' versus 'steam generator'. - if (cbxBooleanTxtSrch.Checked) - { - gpSrchText.Style.BackColor = Color.Orange; - btnCMIFindText.SubItems[1].SubItems[2].Visible = false; - btnCMIFindText.SubItems[1].SubItems[3].Visible = true; - //cbxCaseSensitive.Checked = false; - //cbxCaseSensitive.Enabled = false; - //cbxIncROTextSrch.Checked = true; - //cbxIncROTextSrch.Enabled = false; - cbxCaseSensitive.Enabled = false; - cbxIncROTextSrch.Enabled = false; - } - else - { - gpSrchText.Style.BackColor = Color.Yellow; - btnCMIFindText.SubItems[1].SubItems[2].Visible = true; - btnCMIFindText.SubItems[1].SubItems[3].Visible = false; - //cbxCaseSensitive.Enabled = true; - //cbxIncROTextSrch.Enabled = true; - cbxCaseSensitive.Enabled = true; - cbxIncROTextSrch.Enabled = true; - } - } - private void cbxBooleanAnoTxtSrch_CheckedChanged(object sender, EventArgs e) - { - if (cbxBooleanAnoTxtSrch.Checked) - { - gpSrchAnnoText.Style.BackColor = Color.Orange; - btnCMIFindText.SubItems[1].SubItems[2].Visible = false; - btnCMIFindText.SubItems[1].SubItems[3].Visible = true; - } - else - { - gpSrchAnnoText.Style.BackColor = Color.Yellow; - btnCMIFindText.SubItems[1].SubItems[2].Visible = true; - btnCMIFindText.SubItems[1].SubItems[3].Visible = false; - } - } - private void btnAND_Click(object sender, EventArgs e) - { - if (cbxTextSearchAnnotation.Focused) - cbxTextSearchAnnotation.SelectedText = " AND "; - else if (cbxTextSearchText.Focused) - cbxTextSearchText.SelectedText = " AND "; - - } - private void btnOR_Click(object sender, EventArgs e) - { - if (cbxTextSearchAnnotation.Focused) - cbxTextSearchAnnotation.SelectedText = " OR "; - else if (cbxTextSearchText.Focused) - cbxTextSearchText.SelectedText = " OR "; - - } - private void btnNOT_Click(object sender, EventArgs e) - { - if (cbxTextSearchAnnotation.Focused) - cbxTextSearchAnnotation.SelectedText = " NOT "; - else if (cbxTextSearchText.Focused) - cbxTextSearchText.SelectedText = " NOT "; - } - private void tabAnnotationSearch_Click(object sender, EventArgs e) - { - cbxAnnoTypes.Focus(); - cbxBooleanAnoTxtSrch_CheckedChanged(sender, e); - } - private void btnClearSearchResults_Click(object sender, EventArgs e) - { - lbSrchResults.DataSource = null; - _SearchResults = null; - DisplayResults(); - } - private void btnCopySearchResults_Click(object sender, EventArgs e) - { - ICollection myList = lbSrchResults.DataSource as ICollection; - StringBuilder sb = new StringBuilder(); - sb.Append("\"Location\"\t\"Type\"\t\"Text\"\t\"High-Level\"\t\"Annotations\""); - foreach (ItemInfo myItem in myList) - { - sb.Append(string.Format("\r\n\"{0}\"\t\"{1}\"\t\"{2}\"\t\"{3}\"", myItem.ShortPath, myItem.ToolTip, - myItem.DisplayText, !myItem.IsSection && !myItem.IsHigh ? myItem.MyHLS.DisplayText : "")); - if (myItem.ItemAnnotationCount > 0) - foreach (AnnotationInfo myAnnotation in myItem.ItemAnnotations) - sb.Append(string.Format("\t\"{0}\"", myAnnotation.SearchText)); - } - Clipboard.Clear(); - Clipboard.SetText(sb.ToString()); - MessageBox.Show("Results Copied to Clipboard", "Copy Results", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - private string _ReportTitle; - public string ReportTitle - { - get { return _ReportTitle; } - set { _ReportTitle = 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 void btnPrnSrchRslts_Click(object sender, EventArgs e) - { - OnPrintRequest(new DisplaySearchEventArgs(ReportTitle, TypesSelected, SearchString, lbSrchResults.DataSource as ICollection)); - } - private void panSearchButtons_Resize(object sender, EventArgs e) - { - cmbResultsStyle.Left = labelX1.Right + 3; - cmbResultsStyle.Width = btnClearSearchResults.Left - cmbResultsStyle.Left - 3; - } - } - #region Annoation Search Type Class - // this class is used to generate the list of annotations to search. - // this also allow us to add a dummy type which is used to search for all annotations - public class AnnotationTypeSearch - { - private string _Name; - public string Name - { - get { return _Name; } - set { _Name = value; } - } - private string _ID; - public string ID - { - get { return _ID; } - set { _ID = value; } - } - public AnnotationTypeSearch(string name, string id) - { - _Name = name; - _ID = id; - } - - } - #endregion - public class DisplaySearchEventArgs - { - private string _ReportTitle; - public string ReportTitle - { - get { return _ReportTitle; } - set { _ReportTitle = 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 _MyItemInfoList; - public ICollection MyItemInfoList - { - get { return _MyItemInfoList; } - set { _MyItemInfoList = value; } - } - public DisplaySearchEventArgs(string reportTitle, string typesSelected, string searchString, ICollection myItemInfoList) - { - _ReportTitle = reportTitle; - _TypesSelected = typesSelected; - _MyItemInfoList = myItemInfoList; - _SearchString = searchString; - } - } - public delegate void DisplaySearchEvent(object sender, DisplaySearchEventArgs args); -} diff --git a/PROMS/Volian.Controls.Library/DisplaySecurity.Designer.cs b/PROMS/Volian.Controls.Library/DisplaySecurity.Designer.cs deleted file mode 100644 index d94f707a..00000000 --- a/PROMS/Volian.Controls.Library/DisplaySecurity.Designer.cs +++ /dev/null @@ -1,45 +0,0 @@ -namespace Volian.Controls.Library -{ - partial class DisplaySecurity - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.SuspendLayout(); - // - // DisplaySecurity - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Name = "DisplaySecurity"; - this.Size = new System.Drawing.Size(933, 646); - this.ResumeLayout(false); - - } - - #endregion - } -} diff --git a/PROMS/Volian.Controls.Library/DisplaySecurity.cs b/PROMS/Volian.Controls.Library/DisplaySecurity.cs deleted file mode 100644 index 29fafbab..00000000 --- a/PROMS/Volian.Controls.Library/DisplaySecurity.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Text; -using System.Windows.Forms; - -namespace Volian.Controls.Library -{ - public partial class DisplaySecurity : UserControl - { - public DisplaySecurity() - { - InitializeComponent(); - } - } -} diff --git a/PROMS/Volian.Controls.Library/DisplaySecurity.resx b/PROMS/Volian.Controls.Library/DisplaySecurity.resx deleted file mode 100644 index 19dc0dd8..00000000 --- a/PROMS/Volian.Controls.Library/DisplaySecurity.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/PROMS/Volian.Controls.Library/DisplayTabItem.cs.bak b/PROMS/Volian.Controls.Library/DisplayTabItem.cs.bak deleted file mode 100644 index 6857c96a..00000000 --- a/PROMS/Volian.Controls.Library/DisplayTabItem.cs.bak +++ /dev/null @@ -1,341 +0,0 @@ -using System; -using System.ComponentModel; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using System.Drawing; -using VEPROMS.CSLA.Library; - -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; - - - #endregion - #region Properties - /// - /// ItemInfo associated with this DisplayTabItem - /// - private int _OwnerID; - public int OwnerID - { - get { return _OwnerID; } - set { _OwnerID = value; } - } - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - //set { _MyItemInfo = value; } - } - /// - /// get Key Either: - /// "Item - " + Procedure ItemID for step pages - /// "Doc - " + DocumentID for Word Documents - /// - public string MyKey - { - get { return _MyKey; } - } - /// - /// Related StepTabPanel for a Step page - /// - public StepTabPanel MyStepTabPanel - { - get { return _MyStepTabPanel; } - set { _MyStepTabPanel = value; } - } - /// - /// Related DSOTabPanle for a Word page - /// - public DSOTabPanel MyDSOTabPanel - { - get { return _MyDSOTabPanel; } - set { _MyDSOTabPanel = value; } - } - private string _MyUserRole; - public string MyUserRole - { - get { return _MyUserRole; } - set { _MyUserRole = value; } - } - /// - /// Current SelectedItemInfo for this page - /// - public ItemInfo SelectedItemInfo - { - get - { - if (_MyStepTabPanel == null) return null; - return _MyStepTabPanel.SelectedItemInfo; - } - set - { - Console.WriteLine("selectediteminfo"); - _MyStepTabPanel.SelectedItemInfo = value; - } - } - /// - /// Current DocumentInfo for this page - only set if library document - /// - public DocumentInfo MyDocumentInfo - { - get { return _MyDocumentInfo; } - } - #endregion - #region Constructors - public DisplayTabItem(IContainer container, DisplayTabControl myDisplayTabControl, ItemInfo myItemInfo, string myKey) - { - _MyItemInfo = myItemInfo; - if(MyItemInfo.MyContent.MyEntry == null) - OwnerID = myDisplayTabControl.MySessionInfo.CheckOutItem(myItemInfo.MyProcedure.ItemID, CheckOutType.Procedure); - else - OwnerID = myDisplayTabControl.MySessionInfo.CheckOutItem(myItemInfo.MyContent.MyEntry.DocID, CheckOutType.Document); - Console.WriteLine("DisplayTabItem"); - _MyKey = myKey; - _MyDisplayTabControl = myDisplayTabControl; - container.Add(this); - InitializeComponent(); - this.Click += new EventHandler(DisplayTabItem_Click); - if (myItemInfo.MyContent.MyEntry == null) - SetupStepTabPanel(); - else - SetupDSOTabPanel(); - SetupSecurity(myItemInfo); - Name = string.Format("DisplayTabItem {0}", myItemInfo.ItemID); - } - private bool MesssageShown = false; - public void SetupSecurity(ItemInfo myItem) - { - UserInfo ui = UserInfo.GetByUserID(OwnerInfo.Get(OwnerID).SessionUserID); - if (ui == null) - { - if (!MesssageShown) - { - System.Windows.Forms.MessageBox.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(); - } - else if (ui.IsAdministrator()) - { - if(_MyStepTabPanel != null) - _MyStepTabPanel.MyStepTabRibbon.SetupAdminMode(); - MyUserRole = Volian.Base.Library.VlnSettings.UserID + " - Administrator"; - } - else if (ui.IsSetAdministrator(myItem.MyDocVersion)) - { - if (_MyStepTabPanel != null) - _MyStepTabPanel.MyStepTabRibbon.SetupSetAdminMode(); - MyUserRole = Volian.Base.Library.VlnSettings.UserID + " - Set Administrator"; - } - else if (ui.IsROEditor(myItem.MyDocVersion)) - { - if (_MyStepTabPanel != null) - _MyStepTabPanel.MyStepTabRibbon.SetupROEditorMode(); - MyUserRole = Volian.Base.Library.VlnSettings.UserID + " - RO Editor"; - } - else if (ui.IsWriter(myItem.MyDocVersion)) - { - if (_MyStepTabPanel != null) - _MyStepTabPanel.MyStepTabRibbon.SetupWriterMode(); - MyUserRole = Volian.Base.Library.VlnSettings.UserID + " - Writer"; - } - else if (ui.IsReviewer(myItem.MyDocVersion)) - { - if (_MyStepTabPanel != null) - _MyStepTabPanel.MyStepTabRibbon.SetupReviewerMode(); - MyUserRole = Volian.Base.Library.VlnSettings.UserID + " - Reviewer"; - } - else - { - if (_MyStepTabPanel != null) - _MyStepTabPanel.MyStepTabRibbon.SetupReviewerMode(); - MyUserRole = Volian.Base.Library.VlnSettings.UserID + " - Reviewer"; - } - } - public DisplayTabItem(IContainer container, DisplayTabControl myDisplayTabControl, DocumentInfo myDocumentInfo, string myKey) - { - _MyKey = myKey; - _MyDisplayTabControl = myDisplayTabControl; - _MyDocumentInfo = myDocumentInfo; - container.Add(this); - InitializeComponent(); - this.Click += new EventHandler(DisplayTabItem_Click); - SetupLibraryDocumentDSOTabPanel(); - Name = string.Format("DisplayTabLibraryDocument {0}", myDocumentInfo.DocID); - } - - protected override void OnDisplayedChanged() - { - //Console.WriteLine("=>=>=>=> OnDisplayedChanged"); - if(_MyStepTabPanel != null) - _MyStepTabPanel.MyStepPanel.DisplayItemChanging = true; - base.OnDisplayedChanged(); - 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 - /// - /// Updates SelectedRTBItem when the user selects a DisplayTabItem - /// - /// - /// - 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; - _MyDisplayTabControl.OnItemSelectedChanged(this,new ItemSelectedChangedEventArgs(MyStepTabPanel.SelectedEditItem)); - } - #endregion - #region private Methods - /// - /// Creates and sets-up a StepTabPanel - /// - private void SetupStepTabPanel() - { - ((System.ComponentModel.ISupportInitialize)(_MyDisplayTabControl.MyBar)).BeginInit(); - _MyDisplayTabControl.MyBar.SuspendLayout(); - _MyStepTabPanel = new StepTabPanel(_MyDisplayTabControl); - // - // tabItem - // - Control = _MyStepTabPanel; - Name = "tabItem Item " + _MyItemInfo.ItemID; - Text = _MyItemInfo.TabTitle; - Tooltip = _Tooltip = _MyItemInfo.TabToolTip.Replace("\u2011", "-"); - MouseMove += new System.Windows.Forms.MouseEventHandler(DisplayTabItem_MouseMove); - LostFocus += new EventHandler(DisplayTabItem_LostFocus); - // - _MyDisplayTabControl.Controls.Add(_MyStepTabPanel); - _MyDisplayTabControl.MyBar.Items.Add(this); - _MyDisplayTabControl.MyBar.Width = 300; // This triggers the bar to resize itself - // - // tabPanel - // - _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) - MyStepTabPanel.MyStepPanel.VwMode = E_ViewMode.View; - //added by jcb 20130718 to support disabling create pdf button when multiunit until user selects a unit - if (dvi.MultiUnitCount > 1) - this.MyStepTabPanel.MyStepTabRibbon.btnPdfCreate.Enabled = false; - else - this.MyStepTabPanel.MyStepTabRibbon.btnPdfCreate.Enabled = true; - //end added by jcb 20130718 - } - void DisplayTabItem_LostFocus(object sender, EventArgs e) - { - if(Tooltip != _Tooltip) - Tooltip = _Tooltip; - } - private string _Tooltip; - public void SetPrivateTooltip(string tt) - { - _Tooltip = tt; - } - void DisplayTabItem_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) - { - string newTooltip = e.Y > 30 ? null : _Tooltip; - if(Tooltip != newTooltip) - Tooltip = newTooltip; - } - /// - /// Creates and sets-up a DSOTabPanel - /// - private void SetupDSOTabPanel() - { - EntryInfo myEntry = _MyItemInfo.MyContent.MyEntry; - _MyDSOTabPanel = new DSOTabPanel(myEntry.MyDocument, _MyDisplayTabControl, _MyItemInfo); - // - // tabItem - // - Control = _MyDSOTabPanel; - Name = "tabItem Item " + _MyItemInfo.ItemID; - Text = _MyItemInfo.TabTitle; - Tooltip = _Tooltip = _MyItemInfo.TabToolTip.Replace("\u2011", "-"); - MouseMove += new System.Windows.Forms.MouseEventHandler(DisplayTabItem_MouseMove); - LostFocus += new EventHandler(DisplayTabItem_LostFocus); - _MyDisplayTabControl.Controls.Add(_MyDSOTabPanel); - DSOTabPanel.IgnoreEnter = true; - //Console.WriteLine("AddRange {0}", Name); - _MyDisplayTabControl.MyBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this}); - // - // tabPanel - // - _MyDisplayTabControl.SelectDisplayTabItem(this); - _MyDSOTabPanel.MyDisplayTabItem = this; - DSOTabPanel.IgnoreEnter = false; - } - private void SetupLibraryDocumentDSOTabPanel() - { - _MyDSOTabPanel = new DSOTabPanel(_MyDocumentInfo, _MyDisplayTabControl, _MyItemInfo); - // - // tabItem - // - Control = _MyDSOTabPanel; - Name = "tabLibraryDocument " + _MyDocumentInfo.DocID; - 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); - DSOTabPanel.IgnoreEnter = true; - _MyDisplayTabControl.MyBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this}); - // - // tabPanel - // - _MyDisplayTabControl.SelectDisplayTabItem(this); - _MyDSOTabPanel.MyDisplayTabItem = this; - DSOTabPanel.IgnoreEnter = false; - } - #endregion - public override string ToString() - { - if (MyDSOTabPanel != null) - return MyDSOTabPanel.ToString(); - if (MyStepTabPanel != null) - return MyStepTabPanel.ToString(); - return "NULL"; - } - } -} diff --git a/PROMS/Volian.Controls.Library/DisplayTags.cs.bak b/PROMS/Volian.Controls.Library/DisplayTags.cs.bak deleted file mode 100644 index 16981591..00000000 --- a/PROMS/Volian.Controls.Library/DisplayTags.cs.bak +++ /dev/null @@ -1,295 +0,0 @@ -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; - - -namespace Volian.Controls.Library -{ - public partial class DisplayTags : UserControl - { - #region Properties - private ItemInfo _CurItemInfo=null; - private bool _Initalizing = false; - private IList _MyStepTypeInd = null; // use to keep track of step types put in step type menu - private StepRTB _NotVisibleRTB = null; - private StepRTB _MyRTB; - public StepRTB MyRTB - { - get { return _MyRTB; } - set - { - if (!Visible) - { - _NotVisibleRTB = value; - return; - } - _NotVisibleRTB = null; - if (value == null) - { - ClearControls(); - return; - } - if (_CurItemInfo != null && _CurItemInfo.ItemID == value.MyItemInfo.ItemID) return; - if (!value.MyItemInfo.IsStep) - { - ClearControls(); - return; - } - _MyRTB = value; - _CurItemInfo = MyRTB.MyItemInfo; - cbChgAll.Checked = !_CurItemInfo.IsHigh; - TagsFillIn(); - } - } - #endregion - #region Constructor - public DisplayTags() - { - InitializeComponent(); - _MyStepTypeInd = new List(); - } - #endregion - #region Initialize Controls - private void ClearControls() - { - cmbCheckoff.Enabled = false; - cbPageBreak.Enabled = false; - cbCAS.Enabled = false; - rbChgBarOff.Enabled = false; - rbChgBarOn.Enabled = false; - listBoxStepTypes.Items.Clear(); - _MyStepTypeInd.Clear(); - } - private bool StepOverRide() - { - ItemInfo myparent = _CurItemInfo.MyActiveParent as ItemInfo; - if (_CurItemInfo.IsRNO && 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() - { - groupPanelChgStepType.Style.BackColor = Color.PaleVioletRed; - } - private void TagsFillIn() - { - _Initalizing = true; - - // do some coloring (didn't work when setting properties) - // don't like: Goldenrod, Gold - groupPanelChgBar.Style.BackColor = Color.Cornsilk; - groupPanelChgStepType.Style.BackColor = Color.Cornsilk; - groupPanelMisc.Style.BackColor = Color.Cornsilk; - groupPanelCheckoff.Style.BackColor = Color.Cornsilk; - cbPageBreak.Enabled = true; // these may have been set to false if non-step item was selected. - cbCAS.Enabled = true; - rbChgBarOff.Enabled = true; - rbChgBarOn.Enabled = true; - - FormatData fmtdata = _CurItemInfo.ActiveFormat.PlantFormat.FormatData; - StepConfig sc = _CurItemInfo.MyConfig as StepConfig; - // in certain cases, the checkbox control should be disabled, check for this stuff now... - int formatSteptype = _CurItemInfo.FormatStepType; - cmbCheckoff.Enabled = true; - if ((_CurItemInfo.IsCaution || _CurItemInfo.IsNote) & !fmtdata.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel) - cmbCheckoff.Enabled = false; - if (_CurItemInfo.IsRNO && sc != null && sc.Step_CheckOffIndex != -1 && !fmtdata.StepDataList[formatSteptype].CheckOffSameAsParent) - cmbCheckoff.Enabled = false; // Checkoffs already assigned to RNO. - if (StepOverRide()) cmbCheckoff.Enabled = false; // Checkoffs already assigned to AER - - if (fmtdata.ProcData.CheckOffData.CheckOffList == null || fmtdata.ProcData.CheckOffData.CheckOffList.Count == 0) - cmbCheckoff.Enabled = false; - - if (sc == null) // if there is no config data, Page Break and CAS check boxes are false - { - cbPageBreak.Checked = false; - cbCAS.Checked = false; - } - else // otherwise, get data from config - { - cbPageBreak.Checked = sc.Step_ManualPagebreak; - cbCAS.Checked = sc.Step_CAS; - } - - if (!(fmtdata.ProcData.CheckOffData.CheckOffList == null) && !(fmtdata.ProcData.CheckOffData.CheckOffList.Count == 0)) - { - foreach (CheckOff co in fmtdata.ProcData.CheckOffData.CheckOffList) - { - cmbCheckoff.Items.Add(co.RightCheckOffPrompt); - } - if (sc.Step_CheckOffIndex != -1) cmbCheckoff.SelectedIndex = sc.Step_CheckOffIndex; - } - - // change bar setting depends on whether step has changed (dts) as compared to date/time off the - // procedure that it's in. - // 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. - rbChgBarOff.Checked = true; - rbChgBarOn.Text = "ON (Override)"; - rbChgBarOff.Text = "OFF"; - - // if there is no override & a change occurred to the text, there is a - // change bar & override sets it to Off. - if (sc.Step_CBOverride == null) - { - if (curDts > _CurItemInfo.MyProcedure.DTS) - { - rbChgBarOn.Checked = true; - rbChgBarOff.Text = "OFF (Override)"; - rbChgBarOn.Text = "ON"; - } - } - else - { - // 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 Override is 'Off' then - if (curDts > _CurItemInfo.MyProcedure.DTS) - { - rbChgBarOff.Checked = (sc.Step_CBOverride == "Off") ? true : false; - rbChgBarOn.Checked = (sc.Step_CBOverride == "On") ? true : false; - rbChgBarOff.Text = "OFF (Override)"; - rbChgBarOn.Text = "ON"; - } - else // if (curDts <= _CurItemInfo.MyProcedure.DTS && sc.Step_CBOverride == "On") - { - // date time stamp says no change bar should be displayed: - rbChgBarOff.Checked = (sc.Step_CBOverride == "On") ? true : false; - rbChgBarOn.Checked = (sc.Step_CBOverride == "Off") ? true : false; - rbChgBarOff.Text = "OFF"; - rbChgBarOn.Text = "ON (Override)"; - } - } - // Walk up tree until this step type's parentType is "Base". Start adding menuitems from this step type. - StepData top = fmtdata.StepDataList[formatSteptype]; - //int tmpi = formatSteptype; - // RNO is a special case in that it has a parent type of high, for formatting, but does not walk - // up tree to define types that it can be changed into.... - if (!_CurItemInfo.IsRNO) top = fmtdata.StepTopUnderBase(top, formatSteptype); - listBoxStepTypes.Items.Clear(); - listBoxStepTypes.SelectedIndex = DoListStepTypes(fmtdata, top, fmtdata.StepDataList[formatSteptype].Type); - lblNoTypeChgReason.Visible = !(listBoxStepTypes.Items.Count>0); - cbChgAll.Enabled = (listBoxStepTypes.Items.Count > 0); - listBoxStepTypes.Visible = (listBoxStepTypes.Items.Count>0); - _Initalizing = false; - } - private int DoListStepTypes(FormatData fmtdata, StepData topType, string curType) - { - int cursel=-1; - List sdl = fmtdata.StepGetLevelTypes(false, topType, ref cursel, curType, _CurItemInfo); - if (sdl==null || sdl.Count==0) - { - if (listBoxStepTypes.Items.Count==0)lblNoTypeChgReason.Text = topType.StepEditData.TypeMenu.NoChgReason; - } - else - { - _MyStepTypeInd.Clear(); - foreach (StepDataRetval sdr in sdl) - { - listBoxStepTypes.Items.Add(sdr.Name); - _MyStepTypeInd.Add(sdr.Index); - } - } - 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; - StepConfig sc = _CurItemInfo.MyConfig as StepConfig; - if (sc == null) return; - sc.Step_ManualPagebreak = cbPageBreak.Checked; - } - private void cbCAS_CheckedChanged(object sender, EventArgs e) - { - if (_Initalizing) return; - StepConfig sc = _CurItemInfo.MyConfig as StepConfig; - if (sc == null) return; - sc.Step_CAS = cbCAS.Checked; - } - private void listBoxStepTypes_SelectedIndexChanged(object sender, EventArgs e) - { - if (_Initalizing) return; - FormatData fmtdata = _CurItemInfo.ActiveFormat.PlantFormat.FormatData; - if (cbChgAll.Checked) - { - ItemInfo startitm = _CurItemInfo.FirstSibling; - while (startitm != null) - { - Content cnt = Content.Get(startitm.MyContent.ContentID); - cnt.Type = 20000 + fmtdata.StepDataList[_MyStepTypeInd[listBoxStepTypes.SelectedIndex]].Index; - cnt.Save(); - startitm = startitm.NextItem; // (startitm.NextItemCount > 0 ? startitm.NextItems[0] : null); - } - } - else - { - Content cnt = Content.Get(_CurItemInfo.MyContent.ContentID); - cnt.Type = 20000 + fmtdata.StepDataList[_MyStepTypeInd[listBoxStepTypes.SelectedIndex]].Index; - cnt.Save(); - } - _MyRTB.MyStepItem.SetAllTabs(); - } - private void groupPanelCheckoff_VisibleChanged(object sender, EventArgs e) - { - if (Visible==true && _NotVisibleRTB != null) MyRTB = _NotVisibleRTB; - } - private void rbChgBarOvrRideOn_CheckedChanged(object sender, EventArgs e) - { - if (_Initalizing) return; - - // if checked, set the config data to 'On'. Otherwise, the 'check' event - // handler for the other control sets the data appropriately. - if (rbChgBarOn.Checked) - { - StepConfig sc = _CurItemInfo.MyConfig as StepConfig; - sc.Step_CBOverride = "On"; - } - } - private void rbChgBarOvrRideOff_CheckedChanged(object sender, EventArgs e) - { - if (_Initalizing) return; - - // if checked, set the config data to 'On'. Otherwise, the 'check' event - // handler for the other control sets the data appropriately. - if (rbChgBarOff.Checked) - { - StepConfig sc = _CurItemInfo.MyConfig as StepConfig; - sc.Step_CBOverride = "Off"; - } - } - #endregion - } -} diff --git a/PROMS/Volian.Controls.Library/DisplayText.cs b/PROMS/Volian.Controls.Library/DisplayText.cs deleted file mode 100644 index b9f35bd5..00000000 --- a/PROMS/Volian.Controls.Library/DisplayText.cs +++ /dev/null @@ -1,2238 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; -using System.Text.RegularExpressions; -using System.Drawing; -using VEPROMS.CSLA.Library; -using Volian.Base.Library; - -namespace Volian.Controls.Library -{ - public class DisplayText - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #region Properties - private E_FieldToEdit _FieldToEdit; - public E_FieldToEdit FieldToEdit - { - get { return _FieldToEdit; } - set { _FieldToEdit = value; } - } - private ItemInfo _MyItemInfo; - private string InfoText - { - get - { - switch (FieldToEdit) - { - case E_FieldToEdit.StepText: - case E_FieldToEdit.Text: - return _MyItemInfo.MyContent.Text; - break; - case E_FieldToEdit.Number: - return _MyItemInfo.MyContent.Number; - break; - } - return string.Empty; - } - } - private Item _MyItem; - private string EditText - { - get - { - switch (FieldToEdit) - { - case E_FieldToEdit.StepText: - case E_FieldToEdit.Text: - return _MyItem.MyContent.Text; - break; - case E_FieldToEdit.Number: - return _MyItem.MyContent.Number; - break; - } - return string.Empty; - } - set - { - switch (FieldToEdit) - { - case E_FieldToEdit.StepText: - case E_FieldToEdit.Text: - _MyItem.MyContent.Text = value; - _MyItem.MyContent.UserID = Volian.Base.Library.VlnSettings.UserID; - _MyItem.MyContent.DTS = DateTime.Now; - break; - case E_FieldToEdit.Number: - _MyItem.MyContent.Number = value; - _MyItem.MyContent.UserID = Volian.Base.Library.VlnSettings.UserID; - _MyItem.MyContent.DTS = DateTime.Now; - break; - default: - break; - } - } - } - // list of 'pieces of text' for this item. Pieces include symbols, ros, - // transitions & plain text. - private List _DisplayTextElementList; - public List DisplayTextElementList - { - get { return _DisplayTextElementList; } - set { _DisplayTextElementList = value; } - } - // dictionary for the font table for this item. Note that this may - // go away (it is not really used). - private Dictionary _dicRtfFontTable; - public Dictionary dicRtfFontTable - { - get { return _dicRtfFontTable; } - set { _dicRtfFontTable = value; } - } - private VE_Font _textFont; // Font from format for this item - public VE_Font TextFont - { - get { return _textFont; } - set { _textFont = value; } - } - private bool PrintingSmartTemplate = false; - public string StartText; - public string OriginalText; // compare for save to see if change for links. - private FormatInfo _MyFormat; - #endregion - #region Constructors - /// - /// DisplayText constructor: - /// Creates a DisplayText object that converts the database text into rtf text - /// Arguments are: - /// ItemInfo itemInfo - the item whose text will be resolved - /// E_EditPrintMode ep_mode - edit or print. - /// E_ViewMode vw_mode - view or edit. - /// bool noEdit - flags whether to edit or not (used to set data in - /// rtb as resolved replacewords for non-active rtb. - /// E_FieldToEdit fieldToEdit - identifies the field to edit (number or text) - /// bool colorLinks - whether to add color to links - /// - public DisplayText(ItemInfo itemInfo, E_EditPrintMode epMode, E_ViewMode vwMode, bool noEdit,E_FieldToEdit fieldToEdit, bool colorLinks, string prefix, string suffix) - { - int profileDepth = ProfileTimer.Push(">>>> DisplayText"); - _FieldToEdit = fieldToEdit; - _MyItemInfo = itemInfo; - OriginalText = InfoText; - if (OriginalText.Contains("Prerequisite") && epMode == E_EditPrintMode.Print) - OriginalText = Regex.Replace(OriginalText, @"\\{Prerequisite Step: .*?\\}", ""); - TextFont = itemInfo.GetItemFont();//GetItemFont(); - // if in print mode, and this is the HLS of a smart template (checklist formats) see if the hls - // splits across 2 lines. - if (itemInfo.IsStep && itemInfo.FormatStepData.UseSmartTemplate && epMode == E_EditPrintMode.Print) - { - int hlslen = (int)(itemInfo.FormatStepData.StepPrintData.HLSLength ?? 66); - List titleLines = Volian.Base.Library.RtfTools.SplitText(OriginalText, hlslen); - if (titleLines.Count > 1) - { - string tmporig = titleLines[0]; - for (int ix = 1; ix < titleLines.Count; ix++) - tmporig = tmporig + @"\par " + titleLines[ix]; - OriginalText = tmporig; - } - } - string text = prefix + OriginalText + suffix; - _MyFormat = itemInfo.ActiveFormat; - - bool tableShouldBeOutlined = false; //(epMode == E_EditPrintMode.Print || vwMode == E_ViewMode.View || noEdit) && - //(_FieldToEdit == E_FieldToEdit.StepText || _FieldToEdit == E_FieldToEdit.Text) && - //(!itemInfo.IsSection && !itemInfo.IsProcedure) && (itemInfo.IsTable || itemInfo.IsFigure); - bool wordsShouldBeReplaced = epMode == E_EditPrintMode.Print || vwMode == E_ViewMode.View || noEdit; - if (_MyFormat == null) - Console.WriteLine(this._MyItemInfo.MyItemInfoUnique); - bool numbersShouldBeFormated = (!_MyFormat.PlantFormat.FormatData.SectData.StepSectionData.FortranFormatNumbers && (epMode == E_EditPrintMode.Print || vwMode == E_ViewMode.View || noEdit)); - int typ = ((int)itemInfo.MyContent.Type) % 10000; - bool tableHasBorder = tableShouldBeOutlined ? itemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[typ].Type.IndexOf(@"Borderless") < 0 : false; - bool ROsShouldBeAdjusted = wordsShouldBeReplaced; // same logical value - bool underlineAfterDashSpace = (itemInfo.FormatStepData == null) ? false : itemInfo.FormatStepData.UnderlineAfterDashSpace; - if (epMode == E_EditPrintMode.Print && _MyItemInfo.IsStep) - { - if (_MyItemInfo.FormatStepData.UseSmartTemplate) - { - // Add 2 spaces before and 1 after if there is prefix so that wrapping in RTB accounts for vertical - // lines (the 2 spaces after the first "\par " command and 1 space before 2nd "\par"). Tried other - // combinations that did not work. - if (_MyItemInfo.FormatStepData.Prefix != null && _MyItemInfo.FormatStepData.Prefix != "") - text = !_MyItemInfo.FormatStepData.Font.FontIsProportional() ? ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Prefix) + @"\par " + text + @"\par " : - @"\par " + text + @"\par "; - if (_MyItemInfo.FormatStepData.Suffix != null && _MyItemInfo.FormatStepData.Suffix != "") - text = text + (!_MyItemInfo.FormatStepData.Font.FontIsProportional() ? ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Suffix) : - @"\par\par\par "); - } - } - // Replace Hard Hyphens with normal hyphen so the PDF search for hyphens will work properly - if (text.Contains(@"\u8209?") && epMode == E_EditPrintMode.Print) - { - // Handle RTF Tokens followed immediately by a hard hyphen - text =Regex.Replace(text, @"(?<=\\[^\\?' \r\n\t]+)\\u8209\?", " -"); - text = text.Replace(@"\u8209?", "-"); - } - _MyStaticItemInfo = _MyItemInfo; - text = CreateRtf(colorLinks, text, tableShouldBeOutlined, wordsShouldBeReplaced, numbersShouldBeFormated, tableHasBorder, ROsShouldBeAdjusted, underlineAfterDashSpace, epMode); - _MyStaticItemInfo = null; - StartText = text; - ProfileTimer.Pop(profileDepth); - } - private static ItemInfo _MyStaticItemInfo = null; // Used to report errors - private string ReplaceLinesWithUnicode(string text) - { - text = text.Replace("\x2500", @"\u9472?"); // Horizontal - text = text.Replace("\x2502", @"\u9474?"); // Vertical - text = text.Replace("\x2514", @"\u9492?"); // Bottom Left Corner - text = text.Replace("\x2518", @"\u9496?"); // Bottom Right Corner - text = text.Replace("\x2534", @"\u9524?"); // Bottom Tee - text = text.Replace("\x250c", @"\u9484?"); // Upper Left Corner - text = text.Replace("\x251c", @"\u9500?"); // Left Tee - text = text.Replace("\x2510", @"\u9488?"); // Upper Right Corner - text = text.Replace("\x252c", @"\u9516?"); // Top Tee - text = text.Replace("\x2524", @"\u9508?"); // Right Tee - text = text.Replace("\x253c", @"\u9532?"); // Plus - return text; - } - - public DisplayText(string text, VE_Font vFont, bool colorLinks) - { - TextFont = vFont; - StartText = CreateRtf(colorLinks, text, false, false, false, false, false, false, E_EditPrintMode.Edit); - } - public DisplayText(ItemInfo itemInfo, string text, bool colorLinks) - { - _FieldToEdit = E_FieldToEdit.Text; - _MyItemInfo = itemInfo; - OriginalText = text; - TextFont = itemInfo.GetItemFont(); - _MyFormat = itemInfo.ActiveFormat; - - bool wordsShouldBeReplaced = true; - bool numbersShouldBeFormated = !_MyFormat.PlantFormat.FormatData.SectData.StepSectionData.FortranFormatNumbers; - int typ = ((int)itemInfo.MyContent.Type) % 10000; - bool ROsShouldBeAdjusted = wordsShouldBeReplaced; // same logical value - bool underlineAfterDashSpace = (itemInfo.FormatStepData == null) ? false : itemInfo.FormatStepData.UnderlineAfterDashSpace; - - text = CreateRtf(colorLinks, text, false, wordsShouldBeReplaced, numbersShouldBeFormated, false, ROsShouldBeAdjusted, underlineAfterDashSpace,E_EditPrintMode.Edit); - StartText = text; - // Shearon Harris Tables are Bold - if (itemInfo.IsTable && (TextFont.Style & E_Style.Bold) == E_Style.Bold) - { - // Strip out Bold OFF commands - text = text.Replace(@"\b0 "," "); - text = text.Replace(@"\b0", ""); - // Insert a Bold ON command at the beginning of the printable text. - StartText = Regex.Replace(text, @"(\\viewkind.*?)(?= |\\u[0-9]+?|\\'[0-9A-F])", @"$1\b"); - } - } - private bool InLinkedText(string text, int idx) - { - MatchCollection mc = Regex.Matches(text, @"", RegexOptions.Singleline); - if (mc.Count == 0) return false; - foreach (Match m in mc) - if (m.Index < idx && m.Index + m.Length > idx) return true; - return (false); - } - private string CreateRtf(bool colorLinks, string text, bool tableShouldBeOutlined, bool wordsShouldBeReplaced, bool numbersShouldBeFormated, bool tableHasBorder, bool ROsShouldBeAdjusted, bool underlineAfterDashSpace, E_EditPrintMode epMode) - { - int profileDepth = ProfileTimer.Push(">>>> CreateRtf"); - // Adjust RO display - if (ROsShouldBeAdjusted) - { - try // Added try/catch because an unresolved RO Link was causing a failure. - { - text = DoROAdjustments(text); - } - catch (Exception ex) - { - if (_MyItemInfo != null) - { - _MyLog.ErrorFormat("<<< ERROR >>> Error doing DoROAdjustments\r\n==>'RO Adjustments Error',{0},'{1}','{2}','{3}'" - , _MyItemInfo.ItemID, _MyItemInfo.MyDocVersion.MyFolder.Name, _MyItemInfo.ShortPath, ex.Message); - } - else - _MyLog.Error("DisplayText.CreateRTF Error doing DoROAdjustments", ex); - - } - } - // if in print mode, view mode, or non-active richtextbox do replace words. Only if in - // actual edit mode are replace words left as is. - // But don't do ReplaceWords if the TurnOffReplaceWords format flag is set - if (wordsShouldBeReplaced && !_MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.TurnOffReplaceWords) - { - int profileDepth1 = ProfileTimer.Push(">>>> DoReplaceWords2"); - text = DoReplaceWords2(text); - ProfileTimer.Pop(profileDepth1); - } - if (_MyItemInfo != null) - { - text = Regex.Replace(text, @"\", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Number, RegexOptions.IgnoreCase); - text = Regex.Replace(text, @"\<(U(-|\\u8209\?)ID)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase); - text = Regex.Replace(text, @"\<(U(-|\\u8209\?)NAME)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Name, RegexOptions.IgnoreCase); - text = Regex.Replace(text, @"\<(U(-|\\u8209\?)TEXT)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Text, RegexOptions.IgnoreCase); - text = Regex.Replace(text, @"\<(U(-|\\u8209\?)NUMBER)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Number, RegexOptions.IgnoreCase); - text = Regex.Replace(text, @"\<(U(-|\\u8209\?)OTHER ID)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Other_Unit_ID, RegexOptions.IgnoreCase); - text = Regex.Replace(text, @"\<(U(-|\\u8209\?)OTHER NAME)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Other_Unit_Name, RegexOptions.IgnoreCase); - text = Regex.Replace(text, @"\<(U(-|\\u8209\?)OTHER TEXT)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Other_Unit_Text, RegexOptions.IgnoreCase); - text = Regex.Replace(text, @"\<(U(-|\\u8209\?)OTHER NUMBER)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Other_Unit_Number, RegexOptions.IgnoreCase); - //text = DoSearchAndReplace(text, "", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ID); - text = text.Replace(@"", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ProcedureSetID); - //text = text.Replace("", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Number); - } - // Adjust RO display - if (ROsShouldBeAdjusted) - text = DoTransitionAdjustments(text, _MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.BoldTransition || (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.BoldTransitionExceptHLS && !_MyItemInfo.IsHigh)); - // add colors around links: - if (colorLinks) - text = DoColorLinks(text); - //Console.WriteLine(text); - // adjust formatting of exponents - if (numbersShouldBeFormated) - text = DoFortranFormat(text); - // determine whether the table/figure should be outlined: - if (tableShouldBeOutlined) - { - OutlineRTFTable myTable = new OutlineRTFTable(text, tableHasBorder); - // if a table has internal line draw characters, we may have to do part of 'OutlineTable' - // to convert dashes and vertical bars to line draw characters. - if (tableHasBorder) myTable.OutlineTable(); - text = myTable.Lines.ToString(); - } - - // if we're working with a grid it won't go thru here. - if (!text.StartsWith(@"{\rtf")) - { - // as a precaution, convert any \~ to \u160?. This is for Hard spaces. see the commentary in the - // save portion of this code for an explanation. - text = text.Replace(@"\~", @"\u160?"); - text = text.Replace("\r\n", @"\line "); // replace a \r\n with a \line instead of a \par - //if (text.IndexOf(@"\line") > -1) - // MessageBox.Show("Found rtf line"); - //text = text.Replace(@"\line", @"\par"); // we don't want to replace the \line part of bug fix B2015-140 - - // Now put symbol (for fixed fonts) or unicode font (proportional) around symbols - // These fonts are VESymbFix & Arial Unicode MS respectively, and the font table - // is actually defined in the StepRTB code. - int indxsym = NextUnicode(text, 0);//text.IndexOf(@"\u"); - while (indxsym != -1) - { - int incrindx = 3; - if (text[indxsym + 2] != 'l') - { - text = text.Insert(indxsym, @"\f1 "); - int indxendsym = text.IndexOfAny(@"\ ?".ToCharArray(), indxsym + 5); - if (indxendsym == -1) // must be end of line: - text = text.Insert(text.Length - 1, @"\f0 "); - else - { - if (text[indxendsym] == '?') indxendsym++; - text = text.Insert(indxendsym, @"\f0 "); // TODO: do I need a space?? - } - incrindx = 5; - } - indxsym = NextUnicode(text, indxsym + incrindx);//text.IndexOf(@"\u", indxsym + incrindx); - } - } - if (underlineAfterDashSpace) - { - // Bug fix: B2015-110 - currently used in Byron and Braidwood formats - // for the screen we need to look for the unicode dash - // for printing we need to look for the keyboard dash character - MatchCollection mc = Regex.Matches(text,((epMode == E_EditPrintMode.Edit)? @"\\u8209\?\\f[0-9]+ " : "- ")); - if (mc.Count > 0) - { - Match m = mc[0]; - if (!InLinkedText(text, m.Index)) - { - string str1 = text.Substring(0, m.Index + m.Length); - string str2 = text.Substring(m.Index + m.Length); - string str3 = ""; - int iTerm = FindUnderlineTerminator(str2); - if (iTerm >= 0) - { - str3 = str2.Substring(iTerm); - str2 = str2.Substring(0, iTerm); - } - str2 = str2.Replace(@"\ulnone ", ""); - str2 = str2.Replace(@"\ulnone", ""); - str2 = str2.Replace(@"\ul ", ""); - str2 = str2.Replace(@"\ul", ""); - text = str1 + @"\ul " + str2 + @"\ulnone " + str3; - } - } - } - text = FixDiffUnitROReplaceWords(text); - ProfileTimer.Pop(profileDepth); - return text; - } - - private string FixDiffUnitROReplaceWords(string text) - { - if (_MyFormat == null) return text; - ReplaceStrList rsl = _MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList; - - // The only way to get an 'empty' list is to have one 'dummy' replacestr, i.e. that has ReplaceWord as an empty string. If the - // ReplaceStrData xml node is empty, it does the inheritance and gets the 'base' format's list. - if (rsl.Count == 1 && (rsl[0].ReplaceWord == null || rsl[0].ReplaceWord == "")) return text; - // Loop through text looking for words to be replaced - List partialReplaceList = new List(); - foreach (ReplaceStr rs in rsl) - { - if (rs.ReplaceWord.Contains("{RO}")) - { - //if (_MyItemInfo.InList(34770,34771,34782,34882,34886,34916,34891,35121,36361)) - // Console.WriteLine("FixDiffUnitROReplaceWords jcb"); - string oldvalue = text; - string replaceWord = rs.ReplaceWord; - string replaceWord2 = Regex.Replace( replaceWord,@"(\{RO\})([0-9,]+)(\{RO\})",@"\\v 0) - { - Match mm = Regex.Match(text, replaceWord2, RegexOptions.IgnoreCase); - return matches[0]; - } - return null; - } - private int FindUnderlineTerminator(string text) - { - int idx = -1; - UnderlineTerminateList utl = _MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.UnderlineTerminateList; - foreach (UnderlineTerminate ut in utl) - { - MatchCollection mc = Regex.Matches(text, "(? 0) - { - Match m = mc[mc.Count - 1]; - if (idx < 0 || idx > m.Index) - idx = m.Index; - } - } - return idx; - } - private string DoSearchAndReplace(string text, string find, string replace) - { - return text.Replace(find, replace); - } - private static string DoColorLinks(string text) - { - string origtext = text; - text = Regex.Replace(text, @"( -1) - { - text = text.Insert(indxend, @"\cf0"); - indxcf = text.IndexOf(@"\v0\cf1", indxend); - } - else - { - indxcf = -1; - _MyLog.WarnFormat("DisplayText.DoColorLinks Failed\r\norgitext:'{0}'\r\ntext'{1}'", origtext, text); - } - } - } - catch (Exception ex) - { - _MyLog.WarnFormat("DisplayText.DoColorLinks Failed\r\norgitext:'{0}'\r\ntext'{1}'", origtext, text); - } - return text; - } - private int NextUnicode(string text, int offset) - { - // Skip Hard Spaces - Match m = Regex.Match(text.Substring(offset), @"\\u[0-9a-fA-F]"); - while(m.Success && text.Substring(offset+m.Index).StartsWith(@"\u160")) - { - offset += m.Index + 5; - m = Regex.Match(text.Substring(offset), @"\\u[0-9a-fA-F]"); - } - if (m.Success) - return m.Index + offset; - return -1; - } - private string DoROAdjustments(string text) - { - Regex regRefObj = new Regex(@"\#Link\:ReferencedObject:([0-9]*|) ([0-9a-zA-Z]*) ([0-9]*)", RegexOptions.Singleline); - string strippedText = StaticStripRtfCommands(text); - // (\\[^v \\]+)* --> look for any rtf commands (first part of lookFor) - // \\v0 --> end of comment - // (\\[^v \\]+)* --> more rtf commands ended by a space - // (.*?) --> smallest anything to that matches this based on what's next - // (\\[^v' \\]+)* --> look for rtf commands but exclude \' before the \v - // \\v(\\[^v \\]+)* --> look for rtf commands after the \v - // if it turns out that if ro's have any embedded unicode characters this needs expanded, such as /u8209? (hard hyphen) - string lookFor = string.Format(@""); - MatchCollection matches = Regex.Matches(text, lookFor); - string prevValue = null; - for (int i = matches.Count - 1; i >= 0; i--) - { - Match m = matches[i]; - if (m != null && m.Groups.Count > 7 && m.Groups[7].ToString() == "ReferencedObject") - { - // if previous processed (next ro) was found, then see if it has an 'and' between it and the previous - //if (prevValue != null) - //{ - // int endIndx = m.Index + m.Length; - // string tr = text.Substring(endIndx).Replace(@"\v0","").TrimStart(); - // if (!tr.ToUpper().StartsWith("AND")) prevValue = null; - //} - int myIndex = m.Groups[4].Index; - int myLength = m.Groups[4].Length; - if (m.Groups[3].Value != " ") - { - myIndex = m.Groups[3].Index; - myLength += m.Groups[3].Length; - } - string gg = text.Substring(myIndex, myLength); - //System.Text.RegularExpressions.Group g = m.Groups[3]; - string beforeRO = StaticStripRtfCommands(text.Substring(0, myIndex)); - string afterRO = StaticStripRtfCommands(text.Substring(myIndex + myLength)); - Match myMatch = regRefObj.Match(m.ToString()); - if(m.ToString().ToUpper().Contains("")) - _MyLog.WarnFormat("Unprocessed RO in {0},({1})",_MyItemInfo.ShortPath,gg); - int dbid = System.Convert.ToInt32(myMatch.Groups[2].Value.Substring(0, 4), 16); - int rodbid = int.Parse(myMatch.Groups[3].Value); - ROFstInfo myROFst = _MyItemInfo.MyDocVersion.GetROFst(rodbid); - bool isSetpoint=myROFst.IsSetpointDB(dbid, _MyItemInfo.MyDocVersion); - string newvalue1 = DoROFormatFlags(gg, beforeRO, afterRO, isSetpoint); - string newvalue = RemoveMultipleUnits(prevValue, newvalue1); - if (!_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.AllUnits) prevValue = newvalue1; - newvalue = DoROReplaceWords(_MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList, newvalue, _MyItemInfo.IsHigh); - if (isSetpoint) newvalue = ReplaceSpaceWithHardspace(newvalue); - if (gg != newvalue) - text = text.Substring(0, myIndex) + newvalue + text.Substring(myIndex + myLength); - } - } - return text; - } - private string DoROReplaceWords(ReplaceStrList replaceStrList, string oldvalue, bool isHigh) - { - int profileDepth = ProfileTimer.Push(">>>> DoROReplaceWords"); - string newvalue = oldvalue; - foreach (ReplaceStr rs in replaceStrList) - { - if (((rs.Flag & E_ReplaceFlags.Setpoint) > 0) || (isHigh && (rs.Flag & E_ReplaceFlags.HLSSetpnt) > 0)) - { - try - { - // Use regular expression to assure that the ReplaceWord is not part of another word - // For VEPROMS_CAL E-0 Step 23 (Reset SI) the word "after" was being changed to "aFTer" - newvalue = Regex.Replace(newvalue, @"(?<=\W|^)" + rs.ReplaceWord + @"(?=\W|$)", rs.ReplaceWith); - //newvalue = newvalue.Replace(rs.ReplaceWord, rs.ReplaceWith); - } - catch (Exception ex) - { - _MyLog.Warn("Problem with regular expression", ex); - } - } - } - //if (oldvalue != newvalue) - // Console.WriteLine("\"{0}\"\r\n\"{1}\"",oldvalue,newvalue); - ProfileTimer.Pop(profileDepth); - return newvalue; - } - // Replace spaces with hardspaces, but DO NOT replace the end of an Rtf Command with a hardspace - private string ReplaceSpaceWithHardspace(string newvalue) - { - string oldvalue = newvalue; - int spindx = newvalue.IndexOf(" "); - int lstindx = -1; - while (spindx >= 0) - { - if (!EndsRtfCommand(newvalue, spindx, lstindx)) - { - newvalue = newvalue.Remove(spindx, 1); - newvalue = newvalue.Insert(spindx, @"\u160?"); - } - lstindx = spindx; - spindx = (spindx + 1 >= newvalue.Length)?spindx = -1: newvalue.IndexOf(" ", spindx+1); - } - return newvalue; - } - - private bool EndsRtfCommand(string str, int spindx, int previndx) - { - // get text from last space to current, or from beginning of string to current: - int start = previndx < 0 ? 0 : previndx+1; - string substring = str.Substring(start, spindx-start); - if (substring.Contains(@"\")) - { - // is space ending an rtf command. - int startCmd = substring.LastIndexOf(@"\"); - string Cmd = substring.Substring(startCmd); - char tst = Cmd[1]; - // consider rtf commands up/dn/b/ul/i - if (tst == 'u' || tst == 'd' || tst == 'b' || tst == 'u' || tst == 'i') return true; - } - return false; - } - private string DoTransitionAdjustments(string text, bool boldTran) - { - int profileDepth = ProfileTimer.Push(">>>> DoTransitionAdjustments"); - bool undtran = _MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.Underline; - string strippedText = StaticStripRtfCommands(text); - string lookFor = string.Format(@""); - MatchCollection matches = Regex.Matches(text, lookFor); - if (matches.Count == 0) - { - ProfileTimer.Pop(profileDepth); - return text; - } - string retstr = text; - for (int i = matches.Count - 1; i >= 0; i--) - { - Match m = matches[i]; - // if this transition text already has a hard space, don't add another. - if (m.Groups[4].Value.Contains("\xA0")) continue; - // if the transition text does not start with a digit, don't add the hardspace. - //if (!Char.IsDigit(m.Groups[3].Value[0])) continue; - if (m != null && m.Groups.Count > 8 && m.Groups[7].ToString().StartsWith("Transition")) - { - if (m.Groups[8].Value != "") // && StepTransition(int.Parse(m.Groups[7].Value))) - { - int myIndex = m.Groups[4].Index; - int myLength = m.Groups[4].Length; - if (m.Groups[3].Value != " ") - { - myIndex = m.Groups[3].Index; - myLength += m.Groups[3].Length; - } - string newvalue = text.Substring(myIndex, myLength); - //System.Text.RegularExpressions.Group g = m.Groups[3]; - string beforeTran = retstr.Substring(0, myIndex); - string afterTran = retstr.Substring(myIndex + myLength); - - // if replacing text in the 'beforeTran' string, then do it here, - // i.e. there is a format flag 'BeforeTrans' that bolds text before the transition - // (in wst formats). - beforeTran = DoBeforeTransFlagSupport(beforeTran, _MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.ReplaceStrList); - //string newvalue = g.ToString(); - // if this is a 'step transition' type, i.e. includes a step number, in addition to other replacements, - // we want to change a space to a hardspace. - if (StepTransition(int.Parse(m.Groups[8].Value))) - { - int indexLastSpace = newvalue.LastIndexOf(' '); - if (indexLastSpace >= 0) - // Use a "\x1" as a token to replace later. Insert the unicode char, whose length is - // more than 1 character was throwing of the regexp Matches index, so that the resulting - // string may have been incorrect. - retstr = beforeTran + (boldTran ? @"\b " : null) + (undtran ? @"\ul " : null) + newvalue.Substring(0, indexLastSpace) + "\x1" + newvalue.Substring(indexLastSpace + 1) + (undtran ? @"\ulnone " : null) + (boldTran ? @"\b0" : null) + afterTran; - else - if (beforeTran.EndsWith(" ")) - retstr = ReplaceLastSpaceWithHardSpace(beforeTran) + (boldTran ? @"\b " : null) + (undtran ? @"\ul " : null) + newvalue + (undtran? @"\ulnone ":null) + (boldTran ? @"\b0" : null) + afterTran; - else - Console.Write("");// Don't know where to put the Hard Space - } - else if (boldTran) - { - retstr = beforeTran + @"\b " + newvalue + @"\b0" + afterTran; - } - } - } - } - ProfileTimer.Pop(profileDepth); - return retstr.Replace("\x1", @"\u160?"); - } - - private string DoBeforeTransFlagSupport(string beforeTran, ReplaceStrList replaceStrList) - { - foreach (ReplaceStr repstr in replaceStrList) - { - if ((repstr.Flag & E_ReplaceFlags.BeforeTrans) > 0) - { - // the beforeTran string ends with the string that starts the transition comment, i.e. - // '\\v -1) - { - string findit = beforeTran.Substring(0, beforeTran.LastIndexOf(@"\v 0 && str[ind - 1] != ' ') - { - if (ind > 5 && str.Substring(0, ind).EndsWith(@"\u160?") || str.Substring(0, ind).ToLower().EndsWith(@"\'a0")) - return str;//Already has a Hard Space - ind = str.LastIndexOf(@"\", ind - 1); - } - // If the previous character is a comma or a space then don't add a Hard Space - if (ind > 1 && (str[ind - 2] == ',' || str[ind - 2] == ' ')) return str; - if (ind <= 0) return str; - - // replace with a 'token' "\x1" instead of a hardspace unicode char. When using a hardspace unicode - // char the string length/contents was thrown off so that the calling method's processing was off - // in terms of regexp matches in string. - return str.Substring(0, ind - 1) + "\x1" + str.Substring(ind); - } - private bool StepTransition(int TransId) - { - if (_MyItemInfo == null) return false; - _MyItemInfo.MyContent.RefreshContentTransitions(); - foreach (TransitionInfo trans in _MyItemInfo.MyContent.ContentTransitions) - if (trans.TransitionID == TransId) - return trans.MyItemToID.IsStep; - return false; - } - private string DoFortranFormat(string text) - { - if (text.IndexOf(@".E") < 0) return text; - // Look for text as n.Ey, where n can be null or a number, and y can be - // positive or negative. This translates into nx10x10y where y is - // superscripted. For example, .E3 -> x103 where 3 is superscripted - // and 10.E5 -> 10x10-5 where 5 is superscripted - string pat = @"(\d*).E([+-]*\d+)"; - string retstr = text; - // for each one that needs translated: - foreach (Match m in Regex.Matches(text, pat)) - { - string fnum = m.Groups[1].Value; - string supnum = m.Groups[2].Value; - string newstr = string.Format(@"{0}x10\up2 {1}\up0 ", fnum, supnum); - retstr = retstr.Replace(m.Value, newstr); - } - return retstr; - } - #endregion - #region SaveData - public bool Save(RichTextBox rtb) - { - //int savSelStart = rtb.SelectionStart; - try - { - //FormatInfo formatInfo = _MyItemInfo.ActiveFormat; - using (_MyItem = _MyItemInfo.Get()) - { - // The following was added to support transitions to un-numbered steps - if (_MyItemInfo.NewTransToUnNumberedItem && rtb.Text.Contains("")) - { - ItemAnnotation ia = _MyItem.ItemAnnotations.Add(AnnotationType.GetByName("Verification Required")); - ia.SearchText = "Transition to Un-Numbered Step"; - _MyItemInfo.NewTransToUnNumberedItem = false; - } - // check for different text, i.e. text from this itm doesn't match - // original text, a change occurred in database, but not from this user. - if (OriginalText != EditText) - { - Console.WriteLine("Save Failed because text changed outside of this edit session."); - return false; - } - string modtext = RtfToDbText(rtb.Rtf).Replace("", "\\\\"); - - // if there are links, we'll need to do extra processing to see if - // there were additions, deletions or modifications. - bool haslinks = ((modtext.IndexOf(@" -1) || (OriginalText != null && OriginalText != "" && OriginalText.IndexOf(@" -1)); - if (haslinks) - { - // Get all links in original list - RtfToDisplayTextElements(OriginalText); - List origList = GetLinkList(DisplayTextElementList); - // now get new text into displaytext elements for comparison for links: - RtfToDisplayTextElements(modtext); - // Compare ro/transition lists and delete or add any to the item for any ros/transitions that have been - // added/deleted or modified. - ProcessRoTranChanges(_MyItem, origList); - EditText = DteToString(); - // if new transitions/ros, we need to 'fix' the string in the embedded link to contain the - // transition or usage record. - Dictionary ctReplacements = BuildCtReplacements(_MyItem.MyContent.ContentTransitions); - Dictionary roUsgReplacements = BuildRoUsgReplacements(_MyItem.MyContent.ContentRoUsages); - _MyItem.DTS = DateTime.Now; - _MyItem.UserID = Volian.Base.Library.VlnSettings.UserID; - // Do the Save once rather than multiple times - _MyItem.Save(); - if (ctReplacements.Count > 0) - { - EditText = FixCtReplacements(EditText, ctReplacements); - // Replace Transition Text - foreach (ContentTransition ct in ctReplacements.Values) - using (TransitionInfo tran = TransitionInfo.Get(ct.TransitionID)) - _MyItem.MyContent.FixTransitionText(tran); - _MyItem.Save(); - } - if (roUsgReplacements.Count > 0) - { - EditText = FixRoUsgReplacements(EditText, roUsgReplacements); - _MyItem.Save(); - } - modtext = EditText; - } - else - { - EditText = modtext; - foreach (Csla.Validation.BrokenRule br in _MyItem.MyContent.BrokenRulesCollection) - { - Console.WriteLine("{0} - {1}", br.Property, br.Description); - } - // Don't update the DTS or User for Text Changes - //_MyItem.DTS = DateTime.Now; - //_MyItem.UserID = Volian.Base.Library.VlnSettings.UserID; - _MyItem.Save(); - } - _MyItem = null; - OriginalText = modtext; - } - if (!_MyItemInfo.IsStep) - { - _MyItemInfo.UpdateTransitionText(); - _MyItemInfo.UpdateROText(); - } - } - catch (Exception ex) - { - Console.WriteLine("DisplayText Save Failed with error: {0} - {1}\r\n{2}", ex.GetType().Name, ex.Message, ex.StackTrace); - return false; - } - //rtb.SelectionStart = savSelStart; - return true; - } - private string DteToString() - { - StringBuilder sret = new StringBuilder(); - foreach (displayTextElement vte in DisplayTextElementList) - { - if (vte.Type == E_TextElementType.Text || vte.Type == E_TextElementType.Symbol) - sret.Append(vte.Text); - else - { - displayLinkElement dle = vte as displayLinkElement; - if (vte != null) sret.Append(dle.TextAndLink); - } - } - string modtext = sret.ToString(); - return modtext; - } - private string FixRoUsgReplacements(string p, Dictionary roUsgReplacements) - { - foreach (int oldid in roUsgReplacements.Keys) - { - p = p.Replace(string.Format("", oldid), roUsgReplacements[oldid].ROUsageID.ToString()); - } - return p; - } - private Dictionary BuildRoUsgReplacements(ContentRoUsages contentRoUsages) - { - Dictionary retval = new Dictionary(); - foreach (ContentRoUsage rou in contentRoUsages) - { - if (rou.ROUsageID < 0) retval.Add(rou.ROUsageID, rou); - } - return retval; - } - private string FixCtReplacements(string p, Dictionary ctReplacements) - { - foreach (int oldid in ctReplacements.Keys) - { - p = p.Replace(string.Format("",oldid),ctReplacements[oldid].TransitionID.ToString()); - } - return p; - } - private Dictionary BuildCtReplacements(ContentTransitions contentTransitions) - { - Dictionary retval = new Dictionary(); - foreach (ContentTransition ct in contentTransitions) - { - if (ct.TransitionID < 0) retval.Add(ct.TransitionID, ct); - } - return retval; - } - private void ProcessRoTranChanges(Item itm, List origList) - { - // go through list. Note that only linked items are in the origList. - // 1) delete any that are in origList but not in the DisplayTextElementList - // (that represents the current text & links) - // 2) add any that are only in DisplayTextElementList - // 3) delete/add for modify? - - // delete first - if in original, but not in current list, delete the one - // in the original list. - foreach (displayLinkElement odte in origList) - { - bool found = false; - foreach (displayTextElement dte in DisplayTextElementList) - { - if (dte.Type == odte.Type) - { - displayLinkElement l_dte = (displayLinkElement)dte; - if (odte.Link == l_dte.Link) - { - found = true; - break; - } - } - } - // remove the link element from the item. - if (!found) - { - // Get record id for ro or trans and then find the associated ro or transition - // in the item's list. remove it. - int recid = -1; - if (odte.Type != E_TextElementType.ReferencedObject) - { - int sp = odte.Link.IndexOf(" ") + 1; // get past tran type - string srecid = odte.Link.Substring(sp, odte.Link.IndexOf(" ", sp) - sp); - recid = System.Convert.ToInt32(srecid); - foreach (ContentTransition ct in itm.MyContent.ContentTransitions) - { - if (ct.TransitionID == recid) - { - itm.MyContent.ContentTransitions.Remove(ct); - break; - } - } - } - else - { - int sp = odte.Link.IndexOf(" "); - //rousageid starts after "ReferencedObject:", i.e. index in link of 17 - string srecid = odte.Link.Substring(17, sp-17); - recid = System.Convert.ToInt32(srecid); - foreach (ContentRoUsage cr in itm.MyContent.ContentRoUsages) - { - if (cr.ROUsageID == recid) - { - itm.MyContent.ContentRoUsages.Remove(cr); - break; - } - } - } - } - } - // now do insert, i.e. in new list, but not in old. - foreach (displayTextElement dte in DisplayTextElementList) - { - bool found = false; - if (dte.Type == E_TextElementType.ReferencedObject || dte.Type == E_TextElementType.Transition || dte.Type == E_TextElementType.TransitionRange) - { - foreach (displayLinkElement odte in origList) - { - if (dte.Type == odte.Type) - { - // if the link is the same, it exists, so no action is required. - displayLinkElement l_dte = (displayLinkElement)dte; - if (odte.Link == l_dte.Link) - { - found = true; - break; - } - } - } - // Insert the link (ro or transition) to the item - if (!found) - { - if (dte.Type == E_TextElementType.ReferencedObject) // do ro - { - displayLinkElement l_dte = (displayLinkElement)dte; - Match m = Regex.Match(l_dte.Link, "([A-Za-z]*):(.*)"); - string linkstr = m.Groups[2].Value; - string[] roparts = linkstr.Split(" ".ToCharArray()); - ContentRoUsage rousg = null; - using (RODb rodb = RODb.GetJustRoDb(Convert.ToInt32(roparts[2]))) - { - rousg = itm.MyContent.ContentRoUsages.Add(roparts[1], rodb); - } - l_dte.Link = l_dte.Link.Replace("", string.Format("", rousg.ROUsageID)); - l_dte.TextAndLink = l_dte.TextAndLink.Replace("", string.Format("", rousg.ROUsageID)); - break; - } - else if (dte.Type == E_TextElementType.TransitionRange || dte.Type == E_TextElementType.Transition) - { - displayLinkElement l_dte = (displayLinkElement)dte; - Match m = Regex.Match(l_dte.Link, "([A-Za-z]*):(.*)"); - string linkstr = m.Groups[2].Value; - string[] tparts = linkstr.Split(" ".ToCharArray()); - int type = System.Convert.ToInt32(tparts[0]); - int tr1 = System.Convert.ToInt32(tparts[2]); // tparts[2] is token for tranid - int tr2 = tr1; - if(tparts.Length > 3) - tr2 = System.Convert.ToInt32(tparts[3]); // tparts[3] is token for rangeid - bool dispose1 = false; - Item itm1 = null; - bool dispose2 = false; - Item itm2 = null; - if (itm.ItemID == tr1) - itm1 = itm; // a transition that points to itself should not dispose - else - { - dispose1 = true; - itm1 = Item.Get(tr1); - } - if (itm.ItemID == tr2) - itm2 = itm; // a transition that points to itself should not dispose - else if (tr1 == tr2) - itm2 = itm1; // if both destinations are the same only dispose the first one - else - { - dispose2 = true; - itm2 = Item.Get(tr2); - } - ContentTransition ct = itm.MyContent.ContentTransitions.Add(itm1, itm2); - //Console.WriteLine("CT {0},{1},{2},{3}", ct.TransitionID, itm.ItemID, itm.MyContent.MyContentUnique, itm.MyContent.ContentTransitions.Count); - ct.TranType = type; - if (dte.Type == E_TextElementType.Transition) - ct.IsRange = 0; - else if (tr1 != tr2) - ct.IsRange = 1; - else - ct.IsRange = 2; - l_dte.Link = l_dte.Link.Replace("", string.Format("", ct.TransitionID)); - l_dte.TextAndLink = l_dte.TextAndLink.Replace("", string.Format("", ct.TransitionID)); - if (dispose2) itm2.Dispose(); - if (dispose1) itm1.Dispose(); - } - } - } - } - } - private List GetLinkList(List locDisplayTextElementList) - { - List retList = new List(); - foreach (displayTextElement vte in locDisplayTextElementList) - { - if (vte.Type == E_TextElementType.ReferencedObject || vte.Type == E_TextElementType.TransitionRange || vte.Type == E_TextElementType.Transition) - { - displayLinkElement tmp = (displayLinkElement)vte; - displayLinkElement copy_vte = new displayLinkElement(); - copy_vte.Type = tmp.Type; - copy_vte.Link = tmp.Link; - copy_vte.Text = tmp.Text; - retList.Add(copy_vte); - } - } - return retList; - } - private void RtfToDisplayTextElements(string text) - { - // get original text into displaytext elements for comparison for links: - if (DisplayTextElementList == null) - DisplayTextElementList = new List(); - else - DisplayTextElementList.Clear(); - - if (text == null || text == "") return; - - string noExtraRtfStr = text; - - int startIndex = 0; - int index = -1; - noExtraRtfStr = noExtraRtfStr.Replace(@"><", @">\v0 \v <"); - while ((index = FindTokenChar(noExtraRtfStr, startIndex)) > -1) - { - // Do any 'plain' text that preceeds the token. - if (index > startIndex) DoTextElement(noExtraRtfStr, startIndex, index); - - if (noExtraRtfStr[index + 1] == 'v') - index = DoLink(noExtraRtfStr, index); - else - index = DoSymbol(noExtraRtfStr, startIndex, index); - startIndex = index; // +1; - if (startIndex >= noExtraRtfStr.Length) break; - } - // Add any remaining text. - if (startIndex < noExtraRtfStr.Length) DoTextElement(noExtraRtfStr, startIndex, index); - } - private string RtfToDbText(string text) - { - // For hardspaces, the windows richtextbox does some 'quirky' things: - // A unicode representation of \u160? is sent INTO the rtb. Coming out, - // that \u160? was translated to a \~ (by the underlying windows rtb). - // Note that if the \~ is sent to the rtb, it is treated as a regular space, - // i.e. no longer a hardspace, and actually is converted to a regular space. - // SO, on the way out, convert any \~ to \u160? - string noExtraRtfStr = text.Replace(@"\~", @"\u160?"); - noExtraRtfStr = noExtraRtfStr.Replace(@"\'a0", @"\u160?"); - - // Check for two links in a row & if found, add separating rtf comment - // commands (these get removed in the richtextbox: - // RHM 20100303 Not sure why this is here. The RichTextBox will always remove it. - //noExtraRtfStr = noExtraRtfStr.Replace(@"[END>\v0 \v -1) noExtraRtfStr = noExtraRtfStr.Replace(@"\'05", "\x05"); - - return noExtraRtfStr; - } - public static string StaticReplaceRTFClause(Match m) - { - try - { - string token = m.Groups[1].Value; - switch (token[1]) - { - case '\\': - return token; - case 'u': - if (Regex.IsMatch(token, @"^\\u[0-9]+$")) - return token; // Special Charcaters - if (Regex.IsMatch(token, @"^\\ulnone ?$")) - return token; - if (Regex.IsMatch(token, @"^\\ul.*$")) - return token; // Underline - if (Regex.IsMatch(token, @"^\\up[0-9] ?$")) - return token; // shift up (superscript) - break; - case 'd': - if (Regex.IsMatch(token, @"^\\dn[0-9] ?$")) - return token; // shift down (subscript) - break; - case '\'': // Special Character - return token; - case 'b': // Bold - return token; - case 'i': // Italics - return token; - case '{': // look for escape for curly braces: - return token; - case '}': - return token; - case 'v': // save link hidden info - if (token == "\\viewkind4 ") break; - if (Regex.IsMatch(token, @"^\\v0? ?$")) - return token; // comment part of link - // If possible show what procedure was being processed. - if(_MyStaticItemInfo == null) - _MyLog.WarnFormat("<<>>\r\n==> Token including Comment not processed '{0}'", token); - else - _MyLog.WarnFormat("<<>>\r\n==> Token including Comment not processed '{0}' in {1},[{2}]", token, _MyStaticItemInfo.ShortPath, _MyStaticItemInfo.ItemID); - break; - case 'l': - if (Regex.IsMatch(token, @"^\\line ?$")) return token; - if (Regex.IsMatch(token, @"^\\li[-0-9]+ ?$")) return token; // line indent - break; - case 'f': - if (Regex.IsMatch(token, @"^\\fi[-0-9]+ ?$")) return token; // first line indent - break; - case 'p': - if (Regex.IsMatch(token, @"^\\par ?$")) return "\r\n"; - //if (token == @"\protect") - // return token; - //if (token == @"\protect0") - // return token; - //if (token.Length >= 6 && token.Substring(0, 6) == "\\par\r\n") return token.Replace("\r\n", " "); - break; - //case 'f': // handle fonts separately because they may or may not have a space after them - // if (token[2] >= '0' && token[2] <= '9') return token; - // break; - } - } - catch (Exception ex) - { - Console.WriteLine("StaticReplaceRTFClause {0} - {1}", ex.GetType().Name, ex.Message); - } - return "";//Strip All - } - private static Regex reg1 = new Regex(@"\\par\r\n(?!\\)"); - private static Regex reg2 = new Regex(@"[\r\n]", RegexOptions.Singleline); // Strip Carriage Returns and Newlines - private static Regex reg3 = new Regex(@"^\{(.*)\}$", RegexOptions.Singleline); // Strip Opening and Closing Braces - private static Regex reg4 = new Regex(@"\{[^{]*?\}", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - private static Regex reg5 = new Regex( @"\{[^{]*?\}", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - private static Regex reg6 = new Regex(@"(\\[^' \\?\r\n\t]+)(?=\\)"); // add space after token if followed by token - private static Regex reg7 = new Regex(@"(\\[^' \\?\r\n\t]+ )"); // take backslash xyz and evaluates them - private static Regex reg8 = new Regex( @"(\\[^' \\?\r\n\t]+) (?=\\)"); // remove space between tokens - private static Regex reg9 = new Regex( @"(\\[^' \\?\r\n\t]+) (?=\r\n)"); // remove space before /r/n - - public string StripRtfCommands(string rtf) - { - // replace \{ & \} with (![ & (!] respectively and then redo at end. The curly braces - // are rtf so were getting removed and/or not handled correctly. - string retval = rtf.Replace(@"\{", @" (!["); - retval = retval.Replace(@"\}", @" (!]"); - - // remove carriage return/newlines after \par commands (these are introduced by rtb - // for hard returns, goes into rtb as \par and comes out as \par\r\n): - retval = reg1.Replace(retval, "\\par "); - retval = retval.Replace("\\v0\r\n", "\\v0 "); // Replace Carriage Return and Newline after comment - retval = reg2.Replace(retval, ""); // Strip Carriage Returns and Newlines - retval = reg3.Replace(retval, "$1"); // Strip Opening and Closing Braces - retval = reg4.Replace(retval, ""); // Strip Clauses - remove anything from curly braces - retval = reg5.Replace(retval, ""); // Strip Clauses - remove anything from curly braces - retval = reg6.Replace(retval, "$1 "); // add space after token if followed by token - retval = reg7.Replace(retval, new MatchEvaluator(StaticReplaceRTFClause)); // take backslash xyz and evaluates them - retval = reg8.Replace(retval, "$1"); // remove space between tokens - retval = reg9.Replace(retval, "$1"); // remove space before /r/n - - //retval = Regex.Replace(retval, @"\\par\r\n(?!\\)", "\\par "); - //retval = retval.Replace("\\v0\r\n", "\\v0 "); // Replace Carriage Return and Newline after comment - //retval = Regex.Replace(retval, @"[\r\n]", "", RegexOptions.Singleline); // Strip Carriage Returns and Newlines - //retval = Regex.Replace(retval, @"^\{(.*)\}$", "$1", RegexOptions.Singleline); // Strip Opening and Closing Braces - //retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - //retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - //retval = Regex.Replace(retval, @"(\\[^' \\?\r\n\t]+)(?=\\)", "$1 "); // add space after token if followed by token - //retval = Regex.Replace(retval, @"(\\[^' \\?\r\n\t]+ )", new MatchEvaluator(StaticReplaceRTFClause)); // take backslash xyz and evaluates them - //retval = Regex.Replace(retval, @"(\\[^' \\?\r\n\t]+) (?=\\)", "$1"); // remove space between tokens - //retval = Regex.Replace(retval, @"(\\[^' \\?\r\n\t]+) (?=\r\n)", "$1"); // remove space before /r/n - - // remove \r\n at end of string if the string has 2 or more characters - if (retval.EndsWith("\r\n")) retval = retval.Remove(retval.Length - 2, 2); - if (retval.Length == 0) return ""; - if (retval.EndsWith(@"\v")) retval = retval.Remove(retval.Length - 2, 2); - retval = _MyItemInfo.RemoveRtfStyles(retval); // RemoveRtfStyles(retval); - retval = retval.Replace(@" (![", @"\{"); - retval = retval.Replace(@" (!]", @"\}"); - retval = retval.TrimEnd(' '); - return retval; - } - -private static Regex sreg1 = new Regex(@"\\par\r\n(?!\\)"); -private static Regex sreg2 = new Regex(@"[\r\n]",RegexOptions.Singleline); // Strip Carriage Returns and Newlines -private static Regex sreg3 = new Regex(@"^\{(.*)\}$", RegexOptions.Singleline); // Strip Opening and Closing Braces -private static Regex sreg4 = new Regex(@"\{[^{]*?\}", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces -private static Regex sreg5 = new Regex(@"\{[^{]*?\}", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces -private static Regex sreg6 = new Regex(@"(\\[^' \\?\r\n\t]+)(?=\\)"); // add space after token if followed by token -private static Regex sreg7 = new Regex(@"(\\[^ \\?\r\n\t]+ )"); // take backslash xyz and evaluates them -private static Regex sreg8 = new Regex(@"(\\[^ \\?\r\n\t]+) (?=\\)"); // remove space between tokens -private static Regex sreg9 = new Regex(@"(\\[^ \\?\r\n\t]+) (?=\r\n)"); // remove space before /r/n - - - // This is used in the DataLoader - public static string StaticStripRtfCommands(string rtf) - { - // replace \{ & \} with (![ & (!] respectively and then redo at end. The curly braces - // are rtf so were getting removed and/or not handled correctly. - string retval = rtf.Replace(@"\{", @" (!["); - retval = retval.Replace(@"\}", @" (!]"); - - // For hardspaces, the windows richtextbox does some 'quirky' things: - // A unicode representation of \u160? is sent INTO the rtb. Coming out, - // that \u160? was translated to a \~ (by the underlying windows rtb). - // Note that if the \~ is sent to the rtb, it is treated as a regular space, - // i.e. no longer a hardspace, and actually is converted to a regular space. - // SO, on the way out, convert any \~ to \u160? - retval = retval.Replace(@"\~", @"\u160?"); - - // remove carriage return/newlines after \par commands (these are introduced by rtb - // for hard returns, goes into rtb as \par and comes out as \par\r\n): - retval = sreg1.Replace(retval, "\\par "); - - retval = retval.Replace("\\v0\r\n", "\\v0 "); // Replace Carriage Return and Newline after comment - retval = sreg2.Replace(retval,""); // Strip Carriage Returns and Newlines - retval = sreg3.Replace(retval, "$1"); // Strip Opening and Closing Braces - retval = sreg4.Replace(retval, ""); // Strip Clauses - remove anything from curly braces - retval = sreg5.Replace(retval, ""); // Strip Clauses - remove anything from curly braces - retval = sreg6.Replace(retval,"$1 "); // add space after token if followed by token - retval = sreg7.Replace(retval, new MatchEvaluator(StaticReplaceRTFClause)); // take backslash xyz and evaluates them - retval = sreg8.Replace(retval, "$1"); // remove space between tokens - retval = sreg9.Replace(retval, "$1"); // remove space before /r/n - - //retval = Regex.Replace(retval, @"\\par\r\n(?!\\)", "\\par "); - ////retval = Regex.Replace(retval, @"\\par\r\n(?=\\)", "\\par"); - - //retval = retval.Replace("\\v0\r\n", "\\v0 "); // Replace Carriage Return and Newline after comment - //retval = Regex.Replace(retval, @"[\r\n]", "", RegexOptions.Singleline); // Strip Carriage Returns and Newlines - //retval = Regex.Replace(retval, @"^\{(.*)\}$", "$1", RegexOptions.Singleline); // Strip Opening and Closing Braces - //retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - //retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - ////retval = Regex.Replace(retval, @"(\\[^ \\?\r\n\t]+)\\f[0-9] ", "$1 "); // remove font command - if next to another command, keep other command and space - //// OLD: The following two lines are replaced by the more generic replace above. - ////retval = Regex.Replace(retval, @"\\v\\f[0-9] ", "\\v "); // remove font command - if next to Comment keep space - ////retval = Regex.Replace(retval, @"\\line\\f[0-9] ", "\\line "); // remove font command - if next to Line keep space - ////retval = Regex.Replace(retval, @"\\f[0-9] ", ""); // remove font command with ending space - ////retval = Regex.Replace(retval, @"\\f[0-9]", ""); // remove font command without ending space - ////retval = Regex.Replace(retval, @"\\par ", "\r\n"); - //retval = Regex.Replace(retval, @"(\\[^' \\?\r\n\t]+)(?=\\)", "$1 "); // add space after token if followed by token - ////retval = Regex.Replace(retval, @"(\\[^ \\?\r\n\t]+)(\\)", "$1 $2"); // take backslash xyz and evaluates them - //retval = Regex.Replace(retval, @"(\\[^ \\?\r\n\t]+ )", new MatchEvaluator(StaticReplaceRTFClause)); // take backslash xyz and evaluates them - //retval = Regex.Replace(retval, @"(\\[^ \\?\r\n\t]+) (?=\\)", "$1"); // remove space between tokens - //retval = Regex.Replace(retval, @"(\\[^ \\?\r\n\t]+) (?=\r\n)", "$1"); // remove space before /r/n - - // remove a space if there is one as the first character or the last character - //if (retval[0] == ' ') retval = retval.Remove(0, 1); - //retval = retval.TrimEnd(' '); - // remove \r\n at end of string if the string has 2 or more characters - if (retval.Length > 1 && retval.Substring(retval.Length - 2, 2) == "\r\n") retval = retval.Remove(retval.Length - 2, 2); - // remove \par at end of string if the string has 4 or more characters - //if (retval.Length > 3 && retval.Substring(retval.Length - 4, 4) == @"\par") retval = retval.Remove(retval.Length - 4, 4); - // remove a space following \r\n - //retval = Regex.Replace(retval, "\r\n ", "\r\n"); - ////if there are still spaces following \r\n, then probable in a table - we need to put the space back - //retval = Regex.Replace(retval, "\r\n ", "\r\n "); - - if (retval.Length == 0) return ""; - if (retval.Length > 1 && retval.Substring(retval.Length - 2, 2) == @"\v") retval = retval.Remove(retval.Length - 2, 2); - //retval = RemoveRtfStyles(retval); - //if (itmInfo != null) - // retval = StaticRemoveRtfStyles(retval, itmInfo); - - retval = retval.Replace(@" (![", @"\{"); - retval = retval.Replace(@" (!]", @"\}"); - retval = retval.TrimEnd(' '); - - // the indent character was translated in the richtextbox, change it back: - if (retval.IndexOf(@"\'05") > -1) retval = retval.Replace(@"\'05", "\x05"); - return retval; - } - #endregion - #region StyleData - //private VE_Font GetItemFont() - //{ - // VE_Font font = null; - // FormatInfo format = _MyItemInfo.ActiveFormat; - // int type = (int)_MyItemInfo.MyContent.Type; - // switch (type/10000) - // { - // case 0: // procedure - // font = format.PlantFormat.FormatData.Font; - // break; - // case 1: // section - // font = format.PlantFormat.FormatData.SectData.SectionHeader.Font; - // break; - // case 2: // step types - // int typindx = type - 20000; // what to do for other types rather than steps - // font = format.PlantFormat.FormatData.StepDataList[typindx].Font; - // break; - // } - // TextFont = font; - // return font; - //} - #endregion - #region DoListElements - private int FindTokenChar(string txt, int startIndex) - { - // 'tokens' are for symbols and links (ro & transitions). symbols are represented by \u - // and links are represented by \v \v0 - bool done = false; - while (!done) - { - int indx = txt.IndexOf('\\', startIndex); - if (indx < 0) return indx; - // see if symbol (but not underline) or another rtf command: has a 'u' - // followed by a non-underline or single quote, and if so, return it. - if (((txt[indx + 1] == 'u' && txt[indx + 2] != 'l' && txt[indx + 2] !='p')) || (txt[indx + 1] == '\'')) return indx; - // see if link - if (txt[indx + 1] == 'v') return indx; //TODO - should have ") != -1) return text; - int transitionID = Convert.ToInt32(link.Split(" ".ToCharArray())[1]); - // Find the transition - if (_MyItemInfo.MyContent.ContentTransitionCount <= 0) - { - // TODO: RHM 20100310 - _MyItemInfo.MyContent.RefreshContentTransitions(); - if (_MyItemInfo.MyContent.ContentTransitionCount <= 0) - return "*Resolved Transition Text*"; - } - foreach (TransitionInfo ti in _MyItemInfo.MyContent.ContentTransitions) - { - if (ti.TransitionID == transitionID) - { - string path = ti.ResolvePathTo(_MyFormat, _MyItemInfo, ti.TranType, ti.MyItemToID, ti.MyItemRangeID); - return path; - } - } - return text; - } - private int DoTran(string text,int index) - { - displayLinkElement vte = new displayLinkElement(); - - // determine if Range by checking for "R" after Transition (otherwise ":") - int linkindx = text.IndexOf(@"#Link", index); - vte.Type = (text[linkindx+16]=='R')?E_TextElementType.TransitionRange:E_TextElementType.Transition; - return DoLinkElements(text, index, vte); - } - - //private int GetLastLower(string stepText) - //{ - // // TO DO: need to check AlwaysUpperCase format setting - this was not yet converted as of 17Jun2010 - // // if (AlwaysUpperCase[steptype]) return (stepText.Length-1); - - // int idx = stepText.Length - 1; - // while (idx >= 0 && !(char.IsLower(stepText[idx]) && stepText[idx] != 's')) idx--; - // if (idx < 0) idx = stepText.Length - 1; // entire string is uppercased set return value to end of string - // return idx; - //} - - //private bool IsSpaceOrHardSpace(char ch) - //{ - // string spaces = @" \u160?"; - // return (spaces.IndexOf(ch) >= 0); - //} - private string DoROFormatFlags(string roText, string beforeRO, string afterRO, bool isSetpoint) - { - string rtnstr = roText; - // The RO text is being changed to match it's context. Since it is changed in reverse order, the text before the RO - // should ignore other RO text. - beforeRO = Regex.Replace(beforeRO, @"\", ""); // Remove any RO Values. - beforeRO = Regex.Replace(beforeRO, @"(\\[^v \\]+)*\\v(\\[^v \\]+)* .*?\\v0(\\[^v \\]+)*( |$)", ""); // Remove Comments - string allUnitAfterRo = afterRO; - afterRO = Regex.Replace(afterRO, @"(\\[^v \\]+)*\\v(\\[^v \\]+)* .*?\\v0(\\[^v \\]+)*( |$)", ""); // Remove Comments - - // Underline all ROs, values and Units - if (isSetpoint && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.UnderlineRo) - { - // TO DO: Need to check if step text is already underlined - if ((_MyItemInfo.FormatStepData.Font.Style & E_Style.Underline) == 0) - rtnstr = @"\ul " + rtnstr + @"\ulnone "; - } - - // UpcaseAllRoUnits - Uppercases ALL ROs units everywhere. - if (isSetpoint && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.UpcaseAllRoUnits) - return UpperCaseUnits(rtnstr); - - //Forces the units for a RO to be uppercased for high level steps - if (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.CapHighRo &&_MyItemInfo.IsHigh) - return UpperCaseUnits(rtnstr); - - // Caps ROs anywhere if no lower case text follows - // and an upper case letter immediately precedes the RO. - - if (isSetpoint && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.CapSPIfLastLower && - !Regex.IsMatch(afterRO, @".*(? 0 && !IsSpaceOrHardSpace(stepText[indx])) indx--; // find character before RO - //while (indx2 <= stepText.Length && !IsSpaceOrHardSpace(stepText[indx2])) indx2++; // find character after RO - - //if (indx >= 0 && char.IsUpper(stepText[indx]) && indx2 > GetLastLower(stepText)) - // doUpCase = true; - return UpperCaseUnits(rtnstr); - } - - // If a RO follows a "- " then it will be uppercased - if (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.UpRoAftrDash && Regex.IsMatch(beforeRO, @".*\\u8209\?( |\\u160\?)")) - { - //int indx = startLinkText - 1; - //while (indx > 0 && !IsSpaceOrHardSpace(stepText[indx])) indx--; // find character before RO - //string prefix = indx >= 7?stepText.Substring(indx-7,8):""; - //doUpCase = (prefix == @"\u8209? "); // Dash character before RO - return UpperCaseUnits(rtnstr); - } - // For Wolf Creek, the "- " should be right before the link. This ro format flag was introduced - // for Wolf Creek only because a problem was found with some of their data that was incorrectly - // processed through the 'UpRoAftrDash' flag. That flag was more general, i.e. upper cased units - // if there was a dash and then a space or hard space anywhere before the RO text. The original - // 16bit flag was more specific. Other plants that were released had the UpRoAftrDash, but - // we didn't want to change their formats since they had gone through testing. - if (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.UpRoImmAftrDashSpace && Regex.IsMatch(beforeRO, @".*\\u8209\?( )")) - return UpperCaseUnits(rtnstr); - - // Uppercase the RO Unit if the previous letter is uppercase - if (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.UpRoIfPrevUpper && char.IsUpper(LastAlpha(beforeRO))) - { - //doUpCase = (char.IsUpper(stepText[startLinkText - 1])); - return UpperCaseUnits(rtnstr); - - } - - //CapFirstLetterInHighRO - Cap only the first letters of the units in a high level RO - // note: used in FLP (Turkey Point) format - if (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.CapFirstLetterInHighRO && _MyItemInfo.IsHigh) - { - int idx = 0; - string tstr = ""; - while (idx < rtnstr.Length && !char.IsLetter(rtnstr[idx])) tstr += rtnstr[idx++].ToString(); - if (idx < rtnstr.Length) - { - tstr += char.ToUpper(rtnstr[idx]).ToString(); - if (idx + 1 < rtnstr.Length) - tstr += rtnstr.Substring(idx + 1); - } - rtnstr = tstr; - } - - return rtnstr; - } - - private string RemoveMultipleUnits(string prevValue, string rtnstr) - { - //In a sequence of RO values, the unit appears with every value - //(e.g., "25 gpm and 30 gpm" vs. "25 and 30 gpm") - if (!_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.AllUnits && prevValue != null) - { - string units = null; - //Match m = Regex.Match(prevValue, "[^0-9]"); - int ind = prevValue.LastIndexOfAny("0123456789".ToCharArray()); - if (ind>=0) - { - string mynum = prevValue.Substring(0, ind+1); - // Handle Hex characters which are part of the Units such as the degree character - if (Regex.IsMatch(mynum, @".*\\'[A-Fa-f0-9]{2,2}$")) - ind -= 4; - units = prevValue.Substring(ind+1); - if (rtnstr.EndsWith(units) && units != "")// Don't do this if there are no units - { - rtnstr = rtnstr.Replace(units, ""); - } - } - } - return rtnstr; - } - /// - /// Uppercase alphabetical strings excluding any RTF token - /// - /// - /// - private string MatchEvaluatorUppercaseROUnits(Match match) - { - if (match.Value[0] == '\\') // If the previous character is a backslash then this is an RTF token - return match.Value; - return match.Value.ToUpper(); - } - Regex _RegExUppercaseROUnits = new Regex("(^|[^a-zA-Z])[a-zA-Z]+"); - private string UpperCaseUnits(string rtnstr) - { - // Uppercase Units - rtnstr = _RegExUppercaseROUnits.Replace(rtnstr, new MatchEvaluator(MatchEvaluatorUppercaseROUnits)); - // After converting the value to uppercase, change X10 to x10 to handle Fortran Formatted numbers - return rtnstr.Replace("X10", "x10"); - } - - // Find the last Alphabetical character - private char LastAlpha(string beforeRO) - { - Match m = Regex.Match(beforeRO, ".*([a-zA-Z])[^a-zA-Z]*"); - if (m.Success) return m.Groups[1].ToString()[0]; - return '\0'; - } - - private int DoLinkElements(string text, int index, displayLinkElement vte) - { - // Find the 'end comment' for this 0 && (endTextIndx < 0 || endTextIndx > endTextIndx2)) - endTextIndx = endTextIndx2; - vte.Text = text.Substring(endStartTknIndx + startAdj, endTextIndx - endStartTknIndx - startAdj); // 4 for \v0 - - // Now get the link part. It can be terminated by a '\v0' or an [END> - int endLinkIndxV = text.IndexOf(@"\v0 ", linkIndx); - if (endLinkIndxV == -1) endLinkIndxV = text.IndexOf(@"\v0", linkIndx); // at end of string - int endLinkIndxE = text.IndexOf(@"[END>", linkIndx); - int endLinkIndx = (endLinkIndxV < endLinkIndxE) ? endLinkIndxV : endLinkIndxE; - vte.Link = text.Substring(linkIndx + 6, endLinkIndx - linkIndx - 6); // 6 for #Link: - - string tmptxt = null; - if (vte.Type != E_TextElementType.ReferencedObject) - { - tmptxt = FixTransition(vte.Link, vte.Text); - vte.Text = tmptxt; - } - //else - //{ - // tmptxt = DoROFormatFlags(vte.Text, text, index, endLinkIndx); - // vte.Text = tmptxt; - //} - - // Now get the entire text & link. Account for various ending possibilities: - // ends with '\v0\'; ends with '\v0 '; ends with '\v0' (end of string); - // ends with '[END>' if two in a row - will have ", endLinkIndx + 3); // get past end of link - int endComment = text.IndexOf(@"\v0", endToken); - - int rettoken = 0; - int retlen = 4; - if (endComment + 3 == text.Length) retlen = 3; - else if (text[endComment + 3] == '\\') retlen = 3; - vte.TextAndLink = text.Substring(index, endComment - index + retlen); - rettoken = endComment + retlen; - if (vte.Type != E_TextElementType.ReferencedObject) - { - if (vte.TextAndLink.Contains("(Resolved Transition Text)")) - vte.TextAndLink = vte.TextAndLink.Replace("(Resolved Transition Text)", tmptxt); - else - if (vte.Text != tmptxt) - vte.Text = tmptxt; - } - DisplayTextElementList.Add(vte); - return rettoken; - } - private int DoSymbol(string text, int startIndex, int index) - { - displayTextElement vte = new displayTextElement(); - vte.Type = E_TextElementType.Symbol; - // symbols are the unicode/rtf command. A symbol can be represented by \'xy or - // in the text from the database \uxyz?. If the \'xy is used the length of the - // symbol number will always be two, otherwise find the index of the '?' to - // find the end. - int endindx = -1; - if (text[index + 1] == '\'') endindx = index + 3; - else endindx = text.IndexOf("?", index); - vte.Text = text.Substring(index, endindx - index + 1); - DisplayTextElementList.Add(vte); - return endindx+1; - } - #endregion - #region ReplaceWords - #region commented out - //private string DoReplaceWords(string Text) - //{ - // ReplaceStrList rsl = _MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList; - // foreach (ReplaceStr rs in rsl) - // { - // if (_MyItemInfo.MyContent.Type < 20000) return Text; // for now only replace in steps. - // bool replaceit = false; - - // if (_MyItemInfo.ItemID == 2557) Console.WriteLine("here"); - // // note that the order of this check is important. Check in this order... - // // background here - // if (_MyItemInfo.IsHigh && (rs.Flag & E_ReplaceFlags.High)>0) replaceit = true; - // else if ((_MyItemInfo.IsTable || _MyItemInfo.IsFigure) && (rs.Flag & E_ReplaceFlags.Table) > 0) replaceit = true; - // else if (_MyItemInfo.IsInRNO && (rs.Flag & E_ReplaceFlags.RNO) > 0) replaceit = true; - // else if (_MyItemInfo.IsCaution && (rs.Flag & E_ReplaceFlags.Caution) > 0) replaceit = true; - // else if (_MyItemInfo.IsNote && (rs.Flag & E_ReplaceFlags.Note) > 0) replaceit = true; - // else if (_MyItemInfo.IsStepPart && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - // //else if (_MyItemInfo.IsInFirstLevelSubStep && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - // else if (_MyItemInfo.IsAccPages & (rs.Flag & E_ReplaceFlags.Attach) > 0) replaceit = true; - - // if (replaceit) - // { - // // CASEINSENS: Do ReplaceWords for all words that match, regardless of case, and replace - // // with the ReplaceWith string as is - // if ((rs.Flag & E_ReplaceFlags.CaseInsens) > 0) - // { - // //string res = ""; - // //string fortest = Text.ToUpper(); - // ////string pat = @"(?<=\W|^)" + rs.ReplaceWord.ToUpper() + @"(?=\W|$)"; - // //// jsj 07Jun2010 HardSpaces defeat replaceword logic - // //string pat = @"(?<=\W|^)(? 0) - // { - // // only in Maine Yankee - we don't need to do this one. - // } - // // CASEINSENSFIRST: Do ReplaceWords for all words that exactly match the ReplaceWord, - // // except the case where the first character may be different - // else if ((rs.Flag & E_ReplaceFlags.CaseInsensFirst) > 0) - // { - // // only used in V.C. Summer - we don't need to do this either. - // } - // else - // { - // // If there are Regex Control Characters '\[]()' prefix them with backslash - // string replaceWord = Regex.Replace(rs.ReplaceWord, @"[[\]\\()]", @"\$0"); - // //string pat = @"(?<=\W|^)" + replaceWord + @"(?=\W|$)"; - // // jsj 07Jun2010 HardSpaces defeat replaceword logic - // //string pat = @"(?<=\W|^)(? 0) replaceit = true; - // else if ((_MyItemInfo.IsTable || _MyItemInfo.IsFigure) && (rs.Flag & E_ReplaceFlags.Table) > 0) replaceit = true; - // else if (_MyItemInfo.IsInRNO && (rs.Flag & E_ReplaceFlags.RNO) > 0) replaceit = true; - // else if (_MyItemInfo.IsCaution && (rs.Flag & E_ReplaceFlags.Caution) > 0) replaceit = true; - // else if (_MyItemInfo.IsNote && (rs.Flag & E_ReplaceFlags.Note) > 0) replaceit = true; - // else if (_MyItemInfo.IsStepPart && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - // //else if (_MyItemInfo.IsInFirstLevelSubStep && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - // else if (_MyItemInfo.IsAccPages & (rs.Flag & E_ReplaceFlags.Attach) > 0) replaceit = true; - - // if (replaceit) - // { - // // CASEINSENS: Do ReplaceWords for all words that match, regardless of case, and replace with the ReplaceWith string as is - // RegexOptions myOptions = (rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase : RegexOptions.None; - // string replaceWord = Regex.Replace(rs.ReplaceWord, @"[[\]\\()]", @"\$0"); - // string pat = @"(?<=\W|^)(? dicReplaceRegex = new Dictionary(); - private static bool? _ProcessReplaceWords; - public static bool ProcessReplaceWords - { - get - { - if (_ProcessReplaceWords == null) - { - string[] parameters = System.Environment.CommandLine.Split(" ".ToCharArray()); - _ProcessReplaceWords = true; - foreach (string parameter in parameters) - { - if (parameter.ToUpper() == "/NRW") - _ProcessReplaceWords = false; - } - } - return (bool) _ProcessReplaceWords; - } - } - private string DoReplaceWords2(string Text) - { - if (!ProcessReplaceWords) return Text; - if (_MyItemInfo.MyContent.Type < 20000) return Text; // for now only replace in steps. - FoundMatches myMatches = new FoundMatches(Text, _MyItemInfo.FormatStepData.Font, _MyItemInfo); - // Exclude Link Text from Replace Word process - myMatches.AddLink(regFindLink, _MyFormat.PlantFormat.FormatData.SectData.ReplaceWordsInROs, _MyItemInfo.MyProcedure.MyDocVersion); - ReplaceStrList rsl = _MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList; - // ReplaceStrData xml node is empty, it does the inheritance and gets the 'base' format's list. - if (rsl.Count==1 && (rsl[0].ReplaceWord == null || rsl[0].ReplaceWord == "")) return Text; - // Loop through text looking for words to be replaced - Dictionary partialReplaceList = new Dictionary(); - Dictionary shouldReplace = new Dictionary(); - //int profileDepth = ProfileTimer.Push(">>>> DoReplaceWords2.ForLoop"); - foreach (ReplaceStr rs in rsl) - { - bool dopartial = (rs.Flag & E_ReplaceFlags.Partials) == E_ReplaceFlags.Partials; - // note that the order of this check is important. Check in this order... - // background here - if (!shouldReplace.ContainsKey(rs.Flag)) - { - //int profileDepth2 = ProfileTimer.Push(">>>> Before ShouldReplaceIt"); - shouldReplace.Add(rs.Flag, ShouldReplaceIt(rs.Flag)); - //ProfileTimer.Pop(profileDepth2); - } - bool replaceit = shouldReplace[rs.Flag]; - - if (replaceit) - { - if (!dicReplaceRegex.ContainsKey(rs)) - { - RegexOptions myOptions = (rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase : RegexOptions.None; - if (dopartial) - { - dicReplaceRegex.Add(rs, new Regex(rs.ReplaceWord, myOptions)); - } - else - { - //int profileDepth3 = ProfileTimer.Push(">>>> DoReplaceWords2.BuildMatch"); - // CASEINSENS: Do ReplaceWords for all words that match, regardless of case, and replace with the ReplaceWith string as is - //RegexOptions myOptions = (rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase & RegexOptions.Singleline : RegexOptions.None & RegexOptions.Singleline; - string replaceWord = Regex.Replace(rs.ReplaceWord, @"[[\]\\()]", @"\$0"); - // if first or last character in replaceword is a non-word character, for example, ',', ')', or '.', - // don't use the \W, i.e. don't bother to look for a non-word character. - string wordMatchBeg = Regex.IsMatch(replaceWord.Substring(0, 1), @"\W") ? "" : @"(?<=\W|^)"; - string wordMatchEnd = Regex.IsMatch(replaceWord.Substring(replaceWord.Length - 1, 1), @"\W") ? "" : @"(?=\W|$)"; - string pat = wordMatchBeg + @"(?>>> DoReplaceWords2.Partial"); - if (!dopartial) myMatches.Add(dicReplaceRegex[rs], rs); - else partialReplaceList.Add(rs, dicReplaceRegex[rs]); - //ProfileTimer.Pop(profileDepth4); - } - catch (Exception ex) - { - Console.WriteLine("{0},'{1}',{2},'{3}'", _MyItemInfo.ActiveFormat.Name, rs.ReplaceWord, ex.GetType().Name, ex.Message); - } - dopartial = false; - } - } - //ProfileTimer.Pop(profileDepth); - //int profileDepth5 = ProfileTimer.Push(">>>> DoReplaceWords2.ReplaceMatches"); - - Text = myMatches.ReplaceMatches(); - //ProfileTimer.Pop(profileDepth5); - Text = Text.Replace(@"\xA0", @"\u160?"); //replace hard space - try - { - foreach (ReplaceStr prs in partialReplaceList.Keys) - Text = partialReplaceList[prs].Replace(Text, prs.ReplaceWith); - } - catch (Exception ex) // Don't crash on a format issue. - { - _MyLog.WarnFormat("{0} - {1}", ex.GetType().Name, ex.Message); - } - return Text; - } - private bool ShouldReplaceIt(E_ReplaceFlags? myFlag) - { - bool replaceit= false; - if (_MyItemInfo.IsHigh && (myFlag & E_ReplaceFlags.High) > 0) - { - replaceit = true; - } - else if ((_MyItemInfo.IsTable || _MyItemInfo.IsFigure) && (myFlag & E_ReplaceFlags.Table) > 0) - { - replaceit = true; - } - else if (_MyItemInfo.IsInRNO && (myFlag & E_ReplaceFlags.RNO) > 0) - { - replaceit = true; - } - else if (_MyItemInfo.IsCaution && (myFlag & E_ReplaceFlags.Caution) > 0) - { - replaceit = true; - } - else if (_MyItemInfo.IsNote && (myFlag & E_ReplaceFlags.Note) > 0) - { - replaceit = true; - } - else if (_MyItemInfo.IsStepPart && !_MyItemInfo.IsHigh && (myFlag & E_ReplaceFlags.Substep) > 0) - { - replaceit = true; - } - //else if (_MyItemInfo.IsInFirstLevelSubStep && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - else if (_MyItemInfo.IsAccPages & (myFlag & E_ReplaceFlags.Attach) > 0) - { - replaceit = true; - } - return replaceit; - } - #region notused - static Regex regFindLink = new Regex(@"\", RegexOptions.Singleline); - private string ReplaceWord(string text, string replace, string with, RegexOptions regexOptions) - { - MatchCollection myMatches = Regex.Matches(text, replace, regexOptions); - MatchCollection myLinks = regFindLink.Matches(text); - for (int i = myMatches.Count - 1; i >= 0; i--) - { - Match myMatch = myMatches[i]; - if (!PartOfLinkText(myMatch, myLinks)) - text = text.Substring(0, myMatch.Index) + with + text.Substring(myMatch.Index + myMatch.Length); - } - return text; - } - - private bool PartOfLinkText(Match myMatch, MatchCollection myLinks) - { - foreach (Match myLink in myLinks) - if (myMatch.Index > myLink.Index && myMatch.Index < (myLink.Index + myLink.Length)) - return true; - return false; - } - #endregion - #endregion - } - #region displayTextElementClass - public enum E_TextElementType : uint - { - Text = 0, - Transition = 1, - TransitionRange = 2, - ReferencedObject = 3, - Symbol = 4 - }; - public class displayTextElement - { - private E_TextElementType _Type; - public E_TextElementType Type - { - get { return _Type; } - set { _Type = value; } - } - protected string _Text; - virtual public string Text - { - get { return _Text; } - set { _Text = value; } - } - } - public class displayLinkElement : displayTextElement - { - private string _Link; - public string Link - { - get { return _Link; } - set { _Link = value; } - } - private string _TextAndLink; - public string TextAndLink - { - get { return _TextAndLink; } - set { _TextAndLink = value; } - } - /// - /// Text - this should parse the text and return the results - /// - override public string Text - { - get - { - if (_TextAndLink != null) - { - Match m = Regex.Match(_TextAndLink, @"", RegexOptions.Singleline); - if(m.Groups[3].Value == " ") - return m.Groups[4].Value; - return m.Groups[3].Value + m.Groups[4].Value; - } - return _Text; - } - set - { - if (_TextAndLink != null) - { - Match m = Regex.Match(_TextAndLink, @"", RegexOptions.Singleline); - int myIndex = m.Groups[4].Index; - int myLength = m.Groups[4].Length; - if (m.Groups[3].Value != " ") - { - myIndex = m.Groups[3].Index; - myLength += m.Groups[3].Length; - } - string gg = _TextAndLink.Substring(myIndex, myLength); - string newvalue = value.Replace("{", @"\{").Replace("}", @"\}"); - _TextAndLink = _TextAndLink.Substring(0, myIndex) + newvalue + _TextAndLink.Substring(myIndex + myLength); - } - _Text = value; - } - } - } - #endregion - public class FoundMatches : SortedList - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private string _Text; - private VE_Font _Font; - private ItemInfo _MyItemInfo; - public FoundMatches(string text, VE_Font font, ItemInfo myItemInfo) - : base() - { - _Text = text; - _Font = font; - _MyItemInfo = myItemInfo; - } - public void Add(Regex myRegEx, ReplaceStr myWord) - { - MatchCollection myMatches = myRegEx.Matches(_Text); - foreach (Match myMatch in myMatches) - Add(myMatch, myWord); - } - public void AddLink(Regex myRegEx, bool replaceWordsInROs, DocVersionInfo myDocVersion) - { - MatchCollection myMatches = myRegEx.Matches(_Text); - foreach (Match myMatch in myMatches) - { - if (!replaceWordsInROs || IsTransition(myMatch.Value) || IsSetpointRO(myMatch.Value, myDocVersion)) - Add(myMatch, null);// Exclude from Replace Words - } - } - private bool IsTransition(string link) - { - return link.Contains("#Link:Transition"); - } - private static Regex regRefObj = new Regex(@"\#Link\:ReferencedObject:([0-9]*) ([0-9a-zA-Z]*) ([0-9]*)", RegexOptions.Singleline); - private static bool IsSetpointRO(string link, DocVersionInfo myDocVersion) - { - Match myMatch = regRefObj.Match(link); - if (myMatch.Success) - { - int dbid = System.Convert.ToInt32(myMatch.Groups[2].Value.Substring(0, 4), 16); - int rodbid = int.Parse(myMatch.Groups[3].Value); - ROFstInfo myROFst = myDocVersion.GetROFst(rodbid); - return myROFst.IsSetpointDB(dbid, myDocVersion); - } - return false; - } - public void Add(Match myMatch, ReplaceStr myWord) - { - // If one already exists for this location, then don't add another. - if (ContainsKey(myMatch.Index)) return; - // Start by Adding it. - base.Add(myMatch.Index, new FoundMatch(myMatch, myWord)); - // Now see what I can do with it. - int index = this.IndexOfKey(myMatch.Index); - if (index > 0) // If this match is contained within the previous match remove it - { - FoundMatch previousMatch = Values[index - 1]; - if (previousMatch.MyMatch.Index + previousMatch.MyMatch.Length > myMatch.Index) - Remove(myMatch.Index); - } // If the next match is contained within this match, remove the next match - while (index < Count - 1 && Values[index + 1].MyMatch.Index < (myMatch.Index + myMatch.Length)) - Remove(Values[index + 1].MyMatch.Index); - } - public bool StartsWith(string text, int index, params string[] examples) - { - foreach (string str in examples) - if (str.Length == index && str == text.Substring(0, str.Length)) return true; - return false; - } - public string ReplaceMatches() - { - int offset = 0; - string text = _Text; - foreach (FoundMatch foundMatch in Values) - { - if (foundMatch.MyWord != null) - { - if (VerifyNoHardSpace(text, foundMatch, offset) && VerifyNoLink(text, foundMatch, offset)) - { - //if(offset != 0 || foundMatch.MyMatch.Index != 0 || !foundMatch.MyWord.ReplaceWith.StartsWith(@"{\par}")) - //{ - if (((foundMatch.MyWord.Flag & E_ReplaceFlags.DiffUnit) == 0) || DiffUnit(foundMatch.MyWord.ReplaceWord,_MyItemInfo,"UNIT ")) - { - string with = foundMatch.MyWord.ReplaceWith; - if (offset == 0 && with.StartsWith(@"{\par}")) - if(StartsWith(text,foundMatch.MyMatch.Index,"",@"\ul ",@"\b ",@"* ",@"* \ul ",@"* \b ",@"*",@"*\ul ",@"*\b ")) - with = with.Replace(@"{\par}", ""); - bool IsBold = ((_Font.Style & E_Style.Bold) == E_Style.Bold) || - (_MyItemInfo.FormatStepData != null && _MyItemInfo.FormatStepData.BoldHighLevel && _MyItemInfo.IsRNOPart && _MyItemInfo.MyParent.IsHigh ); - if (IsBold && with.Contains(@"\b ")) - { - with = with.Replace(@"\b ",""); - with = with.Replace(@"\b0 ",""); - } - bool IsUnderline = (((_Font.Style & E_Style.Underline) == E_Style.Underline) && with.Contains(@"\ul ")); - // handle where replace words replaces a string with 'underline on'string'underline off', for example Point Beach - // had replaced OR's turning underline off in the middle of a transition, "EOP-0 UNIT 1, RACTORE TRIP OR SAFETY INJECTION". - if (!IsUnderline) - { - int repidxulnone = text.LastIndexOf(@"\ulnone", foundMatch.MyMatch.Index + offset); - int repidxst = text.LastIndexOf(@"\ul", foundMatch.MyMatch.Index + offset); - if (repidxulnone > 0) - { - repidxst = text.Substring(repidxulnone + 7, foundMatch.MyMatch.Index + offset - (repidxulnone + 7)).LastIndexOf(@"\ul"); - if (repidxst >= 0) - repidxst += (repidxulnone + 7); - } - if (repidxst >= 0) IsUnderline = true; - } - if (IsUnderline) - { - with = with.Replace(@"\ul ", ""); - with = with.Replace(@"\ulnone ", ""); - } - string preceedingText = text.Substring(0, offset + foundMatch.MyMatch.Index); - int ndxBold = preceedingText.LastIndexOf(@"\b"); - if (ndxBold > -1 && preceedingText.Length>( ndxBold + 2) && preceedingText[ndxBold + 2] != '0' && with.Contains(@"\b ")) - { - with = with.Replace(@"\b ",""); - with = with.Replace(@"\b0 ",""); - } - int ndxULine = preceedingText.LastIndexOf(@"\ul"); - if (ndxULine > -1 && preceedingText[ndxULine + 3] != 'n' && with.Contains(@"\ul ")) - { - with = with.Replace(@"\ul ", ""); - with = with.Replace(@"\ulnone ", ""); - } - - text = text.Substring(0, offset + foundMatch.MyMatch.Index) + with + text.Substring(offset + foundMatch.MyMatch.Index + foundMatch.MyMatch.Length); - //offset += foundMatch.MyWord.ReplaceWith.Length - foundMatch.MyMatch.Length; - offset += with.Length - foundMatch.MyMatch.Length; - } - } - } - } - return text; - } - private bool VerifyNoLink(string text, FoundMatch fndMatch, int offset) - { - if (text.Substring(offset + fndMatch.MyMatch.Index, fndMatch.MyMatch.Length) == "START") - if (fndMatch.MyMatch.Index > 0 && offset + fndMatch.MyMatch.Index + fndMatch.MyMatch.Length < text.Length && - text.Substring(offset + fndMatch.MyMatch.Index - 1, fndMatch.MyMatch.Length + 2) == " _DisplayTextElementList; - public List DisplayTextElementList - { - get { return _DisplayTextElementList; } - set { _DisplayTextElementList = value; } - } - // dictionary for the font table for this item. Note that this may - // go away (it is not really used). - private Dictionary _dicRtfFontTable; - public Dictionary dicRtfFontTable - { - get { return _dicRtfFontTable; } - set { _dicRtfFontTable = value; } - } - private VE_Font _textFont; // Font from format for this item - public VE_Font TextFont - { - get { return _textFont; } - set { _textFont = value; } - } - private bool PrintingSmartTemplate = false; - public string StartText; - public string OriginalText; // compare for save to see if change for links. - private FormatInfo _MyFormat; - #endregion - #region Constructors - /// - /// DisplayText constructor: - /// Creates a DisplayText object that converts the database text into rtf text - /// Arguments are: - /// ItemInfo itemInfo - the item whose text will be resolved - /// E_EditPrintMode ep_mode - edit or print. - /// E_ViewMode vw_mode - view or edit. - /// bool noEdit - flags whether to edit or not (used to set data in - /// rtb as resolved replacewords for non-active rtb. - /// E_FieldToEdit fieldToEdit - identifies the field to edit (number or text) - /// bool colorLinks - whether to add color to links - /// - public DisplayText(ItemInfo itemInfo, E_EditPrintMode epMode, E_ViewMode vwMode, bool noEdit,E_FieldToEdit fieldToEdit, bool colorLinks, string prefix, string suffix) - { - _FieldToEdit = fieldToEdit; - _MyItemInfo = itemInfo; - OriginalText = InfoText; - TextFont = itemInfo.GetItemFont();//GetItemFont(); - // if in print mode, and this is the HLS of a smart template (checklist formats), add a space before and - // after the HLS text - this allows for the vertical bar characters to be added. - //if (itemInfo.IsStep && itemInfo.FormatStepData.UseSmartTemplate && epMode == E_EditPrintMode.Print) Console.WriteLine("here"); - string addSpace = (itemInfo.IsStep && itemInfo.FormatStepData.UseSmartTemplate && epMode == E_EditPrintMode.Print) ? " " : ""; - string text = prefix + addSpace + InfoText + addSpace + suffix; - _MyFormat = itemInfo.ActiveFormat; - - bool tableShouldBeOutlined = (epMode == E_EditPrintMode.Print || vwMode == E_ViewMode.View || noEdit) && - (_FieldToEdit == E_FieldToEdit.StepText || _FieldToEdit == E_FieldToEdit.Text) && - (!itemInfo.IsSection && !itemInfo.IsProcedure) && (itemInfo.IsTable || itemInfo.IsFigure); - bool wordsShouldBeReplaced = epMode == E_EditPrintMode.Print || vwMode == E_ViewMode.View || noEdit; - if (_MyFormat == null) - Console.WriteLine(this._MyItemInfo.MyItemInfoUnique); - bool numbersShouldBeFormated = (!_MyFormat.PlantFormat.FormatData.SectData.StepSectionData.FortranFormatNumbers && (epMode == E_EditPrintMode.Print || vwMode == E_ViewMode.View || noEdit)); - int typ = ((int)itemInfo.MyContent.Type) % 10000; - bool tableHasBorder = tableShouldBeOutlined ? itemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[typ].Type.IndexOf(@"Borderless") < 0 : false; - bool ROsShouldBeAdjusted = wordsShouldBeReplaced; // same logical value - bool underlineAfterDashSpace = (itemInfo.FormatStepData == null) ? false : itemInfo.FormatStepData.UnderlineAfterDashSpace; - if (epMode == E_EditPrintMode.Print && _MyItemInfo.IsStep) - { - if (_MyItemInfo.FormatStepData.UseSmartTemplate) - { - // Add 2 spaces before and 1 after if there is prefix so that wrapping in RTB accounts for vertical - // lines (the 2 spaces after the first "\par " command and 1 space before 2nd "\par"). Tried other - // combinations that did not work. - if (_MyItemInfo.FormatStepData.Prefix != null && _MyItemInfo.FormatStepData.Prefix != "") - text = !_MyItemInfo.FormatStepData.Font.FontIsProportional() ? ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Prefix) + @"\par " + text + @"\par " : - @"\par " + text + @"\par "; - if (_MyItemInfo.FormatStepData.Suffix != null && _MyItemInfo.FormatStepData.Suffix != "") - text = text + (!_MyItemInfo.FormatStepData.Font.FontIsProportional() ? ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Suffix) : - @"\par\par\par "); - } - } - text = CreateRtf(colorLinks, text, tableShouldBeOutlined, wordsShouldBeReplaced, numbersShouldBeFormated, tableHasBorder, ROsShouldBeAdjusted, underlineAfterDashSpace); - - StartText = text; - } - private string ReplaceLinesWithUnicode(string text) - { - text = text.Replace("\x2500", @"\u9472?"); // Horizontal - text = text.Replace("\x2502", @"\u9474?"); // Vertical - text = text.Replace("\x2514", @"\u9492?"); // Bottom Left Corner - text = text.Replace("\x2518", @"\u9496?"); // Bottom Right Corner - text = text.Replace("\x2534", @"\u9524?"); // Bottom Tee - text = text.Replace("\x250c", @"\u9484?"); // Upper Left Corner - text = text.Replace("\x251c", @"\u9500?"); // Left Tee - text = text.Replace("\x2510", @"\u9488?"); // Upper Right Corner - text = text.Replace("\x252c", @"\u9516?"); // Top Tee - text = text.Replace("\x2524", @"\u9508?"); // Right Tee - text = text.Replace("\x253c", @"\u9532?"); // Plus - return text; - } - - public DisplayText(string text, VE_Font vFont, bool colorLinks) - { - TextFont = vFont; - StartText = CreateRtf(colorLinks, text, false, false, false, false, false, false); - } - public DisplayText(ItemInfo itemInfo, string text, bool colorLinks) - { - _FieldToEdit = E_FieldToEdit.Text; - _MyItemInfo = itemInfo; - OriginalText = text; - TextFont = itemInfo.GetItemFont(); - _MyFormat = itemInfo.ActiveFormat; - - bool wordsShouldBeReplaced = true; - bool numbersShouldBeFormated = !_MyFormat.PlantFormat.FormatData.SectData.StepSectionData.FortranFormatNumbers; - int typ = ((int)itemInfo.MyContent.Type) % 10000; - bool ROsShouldBeAdjusted = wordsShouldBeReplaced; // same logical value - bool underlineAfterDashSpace = (itemInfo.FormatStepData == null) ? false : itemInfo.FormatStepData.UnderlineAfterDashSpace; - - text = CreateRtf(colorLinks, text, false, wordsShouldBeReplaced, numbersShouldBeFormated, false, ROsShouldBeAdjusted, underlineAfterDashSpace); - StartText = text; - // Shearon Harris Tables are Bold - if (itemInfo.IsTable && (TextFont.Style & E_Style.Bold) == E_Style.Bold) - { - // Strip out Bold OFF commands - text = text.Replace(@"\b0 "," "); - text = text.Replace(@"\b0", ""); - // Insert a Bold ON command at the beginning of the printable text. - StartText = Regex.Replace(text, @"(\\viewkind.*?)(?= |\\u[0-9]+?|\\'[0-9A-F])", @"$1\b"); - } - } - private bool InLinkedText(string text, int idx) - { - MatchCollection mc = Regex.Matches(text, @""); - if (mc.Count == 0) return false; - foreach (Match m in mc) - if (m.Index < idx && m.Index + m.Length > idx) return true; - return (false); - } - private string CreateRtf(bool colorLinks, string text, bool tableShouldBeOutlined, bool wordsShouldBeReplaced, bool numbersShouldBeFormated, bool tableHasBorder, bool ROsShouldBeAdjusted, bool underlineAfterDashSpace) - { - // Adjust RO display - if (ROsShouldBeAdjusted) - { - try // Added try/catch because an unresolved RO Link was causing a failure. - { - text = DoROAdjustments(text); - } - catch (Exception ex) - { - if (_MyItemInfo != null) - { - _MyLog.ErrorFormat("<<< ERROR >>> Error doing DoROAdjustments\r\n==>'RO Adjustments Error',{0},'{1}','{2}','{3}'" - , _MyItemInfo.ItemID, _MyItemInfo.MyDocVersion.MyFolder.Name, _MyItemInfo.ShortPath, ex.Message); - } - else - _MyLog.Error("DisplayText.CreateRTF Error doing DoROAdjustments", ex); - - } - } - // if in print mode, view mode, or non-active richtextbox do replace words. Only if in - // actual edit mode are replace words left as is. - // But don't do ReplaceWords if the TurnOffReplaceWords format flag is set - if (wordsShouldBeReplaced && !_MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.TurnOffReplaceWords) - text = DoReplaceWords2(text); - if (_MyItemInfo != null) - { - text = Regex.Replace(text, @"\", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Number, RegexOptions.IgnoreCase); - text = Regex.Replace(text, @"\<(U(-|\\u8209\?)ID)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ID, RegexOptions.IgnoreCase); - text = Regex.Replace(text, @"\<(U(-|\\u8209\?)NAME)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Name, RegexOptions.IgnoreCase); - text = Regex.Replace(text, @"\<(U(-|\\u8209\?)TEXT)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Text, RegexOptions.IgnoreCase); - text = Regex.Replace(text, @"\<(U(-|\\u8209\?)NUMBER)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Number, RegexOptions.IgnoreCase); - text = Regex.Replace(text, @"\<(U(-|\\u8209\?)OTHER ID)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Other_Unit_ID, RegexOptions.IgnoreCase); - text = Regex.Replace(text, @"\<(U(-|\\u8209\?)OTHER NAME)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Other_Unit_Name, RegexOptions.IgnoreCase); - text = Regex.Replace(text, @"\<(U(-|\\u8209\?)OTHER TEXT)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Other_Unit_Text, RegexOptions.IgnoreCase); - text = Regex.Replace(text, @"\<(U(-|\\u8209\?)OTHER NUMBER)\>", _MyItemInfo.MyDocVersion.DocVersionConfig.Other_Unit_Number, RegexOptions.IgnoreCase); - //text = DoSearchAndReplace(text, "", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ID); - text = text.Replace(@"", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ProcedureSetID); - //text = text.Replace("", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Number); - } - // Adjust RO display - if (ROsShouldBeAdjusted) - text = DoTransitionAdjustments(text, _MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.BoldTransition || (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.BoldTransitionExceptHLS && !_MyItemInfo.IsHigh)); - // add colors around links: - if (colorLinks) - text = DoColorLinks(text); - //Console.WriteLine(text); - // adjust formatting of exponents - if (numbersShouldBeFormated) - text = DoFortranFormat(text); - // determine whether the table/figure should be outlined: - if (tableShouldBeOutlined) - { - OutlineRTFTable myTable = new OutlineRTFTable(text, tableHasBorder); - // if a table has internal line draw characters, we may have to do part of 'OutlineTable' - // to convert dashes and vertical bars to line draw characters. - if (tableHasBorder) myTable.OutlineTable(); - text = myTable.Lines.ToString(); - } - - // if we're working with a grid it won't go thru here. - if (!text.StartsWith(@"{\rtf")) - { - // as a precaution, convert any \~ to \u160?. This is for Hard spaces. see the commentary in the - // save portion of this code for an explanation. - text = text.Replace(@"\~", @"\u160?"); - text = text.Replace("\r\n", @"\par "); - //if (text.IndexOf(@"\line") > -1) - // MessageBox.Show("Found rtf line"); - text = text.Replace(@"\line", @"\par"); - - // Now put symbol (for fixed fonts) or unicode font (proportional) around symbols - // These fonts are VESymbFix & Arial Unicode MS respectively, and the font table - // is actually defined in the StepRTB code. - int indxsym = NextUnicode(text, 0);//text.IndexOf(@"\u"); - while (indxsym != -1) - { - int incrindx = 3; - if (text[indxsym + 2] != 'l') - { - text = text.Insert(indxsym, @"\f1 "); - int indxendsym = text.IndexOfAny(@"\ ?".ToCharArray(), indxsym + 5); - if (indxendsym == -1) // must be end of line: - text = text.Insert(text.Length - 1, @"\f0 "); - else - { - if (text[indxendsym] == '?') indxendsym++; - text = text.Insert(indxendsym, @"\f0 "); // TODO: do I need a space?? - } - incrindx = 5; - } - indxsym = NextUnicode(text, indxsym + incrindx);//text.IndexOf(@"\u", indxsym + incrindx); - } - } - if (underlineAfterDashSpace) - { - MatchCollection mc = Regex.Matches(text, @"\\u8209\?\\f[0-9]+ "); - if (mc.Count > 0) - { - Match m = mc[0]; - if (!InLinkedText(text, m.Index)) - { - string str1 = text.Substring(0, m.Index + m.Length); - string str2 = text.Substring(m.Index + m.Length); - string str3 = ""; - int iTerm = FindUnderlineTerminator(str2); - if (iTerm >= 0) - { - str3 = str2.Substring(iTerm); - str2 = str2.Substring(0, iTerm); - } - str2 = str2.Replace(@"\ulnone ", ""); - str2 = str2.Replace(@"\ulnone", ""); - str2 = str2.Replace(@"\ul ", ""); - str2 = str2.Replace(@"\ul", ""); - text = str1 + @"\ul " + str2 + @"\ulnone " + str3; - } - } - } - return text; - } - private int FindUnderlineTerminator(string text) - { - int idx = -1; - UnderlineTerminateList utl = _MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.UnderlineTerminateList; - foreach (UnderlineTerminate ut in utl) - { - MatchCollection mc = Regex.Matches(text, "(? 0) - { - Match m = mc[mc.Count - 1]; - if (idx < 0 || idx > m.Index) - idx = m.Index; - } - } - return idx; - } - private string DoSearchAndReplace(string text, string find, string replace) - { - return text.Replace(find, replace); - } - private static string DoColorLinks(string text) - { - string origtext = text; - text = Regex.Replace(text, @"( -1) - { - text = text.Insert(indxend, @"\cf0"); - indxcf = text.IndexOf(@"\v0\cf1", indxend); - } - else - { - indxcf = -1; - _MyLog.WarnFormat("DisplayText.DoColorLinks Failed\r\norgitext:'{0}'\r\ntext'{1}'", origtext, text); - } - } - } - catch (Exception ex) - { - _MyLog.WarnFormat("DisplayText.DoColorLinks Failed\r\norgitext:'{0}'\r\ntext'{1}'", origtext, text); - } - return text; - } - private int NextUnicode(string text, int offset) - { - // Skip Hard Spaces - Match m = Regex.Match(text.Substring(offset), @"\\u[0-9a-fA-F]"); - while(m.Success && text.Substring(offset+m.Index).StartsWith(@"\u160")) - { - offset += m.Index + 5; - m = Regex.Match(text.Substring(offset), @"\\u[0-9a-fA-F]"); - } - if (m.Success) - return m.Index + offset; - return -1; - } - private string DoROAdjustments(string text) - { - Regex regRefObj = new Regex(@"\#Link\:ReferencedObject:([0-9]*|) ([0-9a-zA-Z]*) ([0-9]*)", RegexOptions.Singleline); - string strippedText = StaticStripRtfCommands(text); - // (\\[^v \\]+)* --> look for any rtf commands (first part of lookFor) - // \\v0 --> end of comment - // (\\[^v \\]+)* --> more rtf commands ended by a space - // (.*?) --> smallest anything to that matches this based on what's next - // (\\[^v' \\]+)* --> look for rtf commands but exclude \' before the \v - // \\v(\\[^v \\]+)* --> look for rtf commands after the \v - // if it turns out that if ro's have any embedded unicode characters this needs expanded, such as /u8209? (hard hyphen) - string lookFor = string.Format(@""); - //string lookFor = string.Format(@""); - MatchCollection matches = Regex.Matches(text, lookFor); - string prevValue = null; - for (int i = matches.Count - 1; i >= 0; i--) - { - Match m = matches[i]; - if (m != null && m.Groups.Count > 6 && m.Groups[6].ToString() == "ReferencedObject") - { - // if previous processed (next ro) was found, then see if it has an 'and' between it and the previous - if (prevValue != null) - { - int endIndx = m.Index + m.Length; - string tr = text.Substring(endIndx).Replace(@"\v0","").TrimStart(); - if (!tr.ToUpper().StartsWith("AND")) prevValue = null; - } - System.Text.RegularExpressions.Group g = m.Groups[3]; - string beforeRO = StaticStripRtfCommands(text.Substring(0, g.Index)); - string afterRO = StaticStripRtfCommands(text.Substring(g.Index + g.Length)); - Match myMatch = regRefObj.Match(m.ToString()); - if(m.ToString().ToUpper().Contains("")) - _MyLog.WarnFormat("Unprocessed RO in {0},({1})",_MyItemInfo.ShortPath,g.ToString()); - int dbid = System.Convert.ToInt32(myMatch.Groups[2].Value.Substring(0, 4), 16); - int rodbid = int.Parse(myMatch.Groups[3].Value); - ROFstInfo myROFst = _MyItemInfo.MyDocVersion.GetROFst(rodbid); - bool isSetpoint=myROFst.IsSetpointDB(dbid, _MyItemInfo.MyDocVersion); - string newvalue = DoROFormatFlags(g.ToString(), beforeRO, afterRO, isSetpoint, prevValue); - if (!_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.AllUnits) prevValue = newvalue; - newvalue = DoROReplaceWords(_MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList, newvalue, _MyItemInfo.IsHigh); - if (isSetpoint) newvalue = ReplaceSpaceWithHardspace(newvalue); - if (g.ToString() != newvalue) - text = text.Substring(0, g.Index) + newvalue + text.Substring(g.Index + g.Length); - } - } - return text; - } - private string DoROReplaceWords(ReplaceStrList replaceStrList, string newvalue, bool isHigh) - { - foreach (ReplaceStr rs in replaceStrList) - { - if (((rs.Flag & E_ReplaceFlags.Setpoint) > 0) || (isHigh && (rs.Flag & E_ReplaceFlags.HLSSetpnt) > 0)) - { - newvalue = newvalue.Replace(rs.ReplaceWord, rs.ReplaceWith); - } - } - return newvalue; - } - // Replace spaces with hardspaces, but DO NOT replace the end of an Rtf Command with a hardspace - private string ReplaceSpaceWithHardspace(string newvalue) - { - string oldvalue = newvalue; - int spindx = newvalue.IndexOf(" "); - int lstindx = -1; - while (spindx >= 0) - { - if (!EndsRtfCommand(newvalue, spindx, lstindx)) - { - newvalue = newvalue.Remove(spindx, 1); - newvalue = newvalue.Insert(spindx, @"\u160?"); - } - lstindx = spindx; - spindx = (spindx + 1 >= newvalue.Length)?spindx = -1: newvalue.IndexOf(" ", spindx+1); - } - return newvalue; - } - - private bool EndsRtfCommand(string str, int spindx, int previndx) - { - // get text from last space to current, or from beginning of string to current: - int start = previndx < 0 ? 0 : previndx+1; - string substring = str.Substring(start, spindx-start); - if (substring.Contains(@"\")) - { - // is space ending an rtf command. - int startCmd = substring.LastIndexOf(@"\"); - string Cmd = substring.Substring(startCmd); - char tst = Cmd[1]; - // consider rtf commands up/dn/b/ul/i - if (tst == 'u' || tst == 'd' || tst == 'b' || tst == 'u' || tst == 'i') return true; - } - return false; - } - private string DoTransitionAdjustments(string text, bool boldTran) - { - bool undtran = _MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.Underline; - string strippedText = StaticStripRtfCommands(text); - string lookFor = string.Format(@""); - MatchCollection matches = Regex.Matches(text, lookFor); - if (matches.Count == 0) return text; - string retstr = text; - for (int i = matches.Count - 1; i >= 0; i--) - { - Match m = matches[i]; - // if this transition text already has a hard space, don't add another. - if (m.Groups[3].Value.Contains("\xA0")) continue; - // if the transition text does not start with a digit, don't add the hardspace. - //if (!Char.IsDigit(m.Groups[3].Value[0])) continue; - if (m != null && m.Groups.Count > 7 && m.Groups[6].ToString().StartsWith("Transition")) - { - if (m.Groups[7].Value != "") // && StepTransition(int.Parse(m.Groups[7].Value))) - { - System.Text.RegularExpressions.Group g = m.Groups[3]; - string beforeTran = retstr.Substring(0, g.Index); - string afterTran = retstr.Substring(g.Index + g.Length); - - // if replacing text in the 'beforeTran' string, then do it here, - // i.e. there is a format flag 'BeforeTrans' that bolds text before the transition - // (in wst formats). - beforeTran = DoBeforeTransFlagSupport(beforeTran, _MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.ReplaceStrList); - string newvalue = g.ToString(); - // if this is a 'step transition' type, i.e. includes a step number, in addition to other replacements, - // we want to change a space to a hardspace. - if (StepTransition(int.Parse(m.Groups[7].Value))) - { - int indexLastSpace = newvalue.LastIndexOf(' '); - if (indexLastSpace >= 0) - // Use a "\x1" as a token to replace later. Insert the unicode char, whose length is - // more than 1 character was throwing of the regexp Matches index, so that the resulting - // string may have been incorrect. - retstr = beforeTran + (boldTran ? @"\b " : null) + (undtran ? @"\ul " : null) + newvalue.Substring(0, indexLastSpace) + "\x1" + newvalue.Substring(indexLastSpace + 1) + (undtran ? @"\ulnone " : null) + (boldTran ? @"\b0" : null) + afterTran; - else - if (beforeTran.EndsWith(" ")) - retstr = ReplaceLastSpaceWithHardSpace(beforeTran) + (boldTran ? @"\b " : null) + (undtran ? @"\ul " : null) + newvalue + (undtran? @"\ulnone ":null) + (boldTran ? @"\b0" : null) + afterTran; - else - Console.Write("");// Don't know where to put the Hard Space - } - else if (boldTran) - { - retstr = beforeTran + @"\b " + newvalue + @"\b0" + afterTran; - } - } - } - } - return retstr.Replace("\x1", @"\u160?"); - } - - private string DoBeforeTransFlagSupport(string beforeTran, ReplaceStrList replaceStrList) - { - foreach (ReplaceStr repstr in replaceStrList) - { - if ((repstr.Flag & E_ReplaceFlags.BeforeTrans) > 0) - { - // the beforeTran string ends with the string that starts the transition comment, i.e. - // '\\v -1) - { - string findit = beforeTran.Substring(0, beforeTran.LastIndexOf(@"\v 0 && str[ind - 1] != ' ') - { - if (ind > 5 && str.Substring(0, ind).EndsWith(@"\u160?") || str.Substring(0, ind).ToLower().EndsWith(@"\'a0")) - return str;//Already has a Hard Space - ind = str.LastIndexOf(@"\", ind - 1); - } - // If the previous character is a comma or a space then don't add a Hard Space - if (ind > 1 && (str[ind - 2] == ',' || str[ind - 2] == ' ')) return str; - if (ind <= 0) return str; - - // replace with a 'token' "\x1" instead of a hardspace unicode char. When using a hardspace unicode - // char the string length/contents was thrown off so that the calling method's processing was off - // in terms of regexp matches in string. - return str.Substring(0, ind - 1) + "\x1" + str.Substring(ind); - } - private bool StepTransition(int TransId) - { - if (_MyItemInfo == null) return false; - _MyItemInfo.MyContent.RefreshContentTransitions(); - foreach (TransitionInfo trans in _MyItemInfo.MyContent.ContentTransitions) - if (trans.TransitionID == TransId) - return trans.MyItemToID.IsStep; - return false; - } - private string DoFortranFormat(string text) - { - if (text.IndexOf(@".E") < 0) return text; - // Look for text as n.Ey, where n can be null or a number, and y can be - // positive or negative. This translates into nx10x10y where y is - // superscripted. For example, .E3 -> x103 where 3 is superscripted - // and 10.E5 -> 10x10-5 where 5 is superscripted - string pat = @"(\d*).E([+-]*\d+)"; - string retstr = text; - // for each one that needs translated: - foreach (Match m in Regex.Matches(text, pat)) - { - string fnum = m.Groups[1].Value; - string supnum = m.Groups[2].Value; - string newstr = string.Format(@"{0}x10\up2 {1}\up0 ", fnum, supnum); - retstr = retstr.Replace(m.Value, newstr); - } - return retstr; - } - #endregion - #region SaveData - public bool Save(RichTextBox rtb) - { - //int savSelStart = rtb.SelectionStart; - try - { - //FormatInfo formatInfo = _MyItemInfo.ActiveFormat; - using (_MyItem = _MyItemInfo.Get()) - { - // The following was added to support transitions to un-numbered steps - if (_MyItemInfo.NewTransToUnNumberedItem && rtb.Text.Contains("")) - { - ItemAnnotation ia = _MyItem.ItemAnnotations.Add(AnnotationType.GetByName("Verification Required")); - ia.SearchText = "Transition to Un-Numbered Step"; - _MyItemInfo.NewTransToUnNumberedItem = false; - } - // check for different text, i.e. text from this itm doesn't match - // original text, a change occurred in database, but not from this user. - if (OriginalText != EditText) - { - Console.WriteLine("Save Failed because text changed outside of this edit session."); - return false; - } - string modtext = RtfToDbText(rtb.Rtf).Replace("", "\\\\"); - - // if there are links, we'll need to do extra processing to see if - // there were additions, deletions or modifications. - bool haslinks = ((modtext.IndexOf(@" -1) || (OriginalText != null && OriginalText != "" && OriginalText.IndexOf(@" -1)); - if (haslinks) - { - // Get all links in original list - RtfToDisplayTextElements(OriginalText); - List origList = GetLinkList(DisplayTextElementList); - // now get new text into displaytext elements for comparison for links: - RtfToDisplayTextElements(modtext); - // Compare ro/transition lists and delete or add any to the item for any ros/transitions that have been - // added/deleted or modified. - ProcessRoTranChanges(_MyItem, origList); - EditText = DteToString(); - // if new transitions/ros, we need to 'fix' the string in the embedded link to contain the - // transition or usage record. - Dictionary ctReplacements = BuildCtReplacements(_MyItem.MyContent.ContentTransitions); - Dictionary roUsgReplacements = BuildRoUsgReplacements(_MyItem.MyContent.ContentRoUsages); - _MyItem.DTS = DateTime.Now; - _MyItem.UserID = Volian.Base.Library.VlnSettings.UserID; - // Do the Save once rather than multiple times - _MyItem.Save(); - if (ctReplacements.Count > 0) - { - EditText = FixCtReplacements(EditText, ctReplacements); - // Replace Transition Text - foreach (ContentTransition ct in ctReplacements.Values) - using (TransitionInfo tran = TransitionInfo.Get(ct.TransitionID)) - _MyItem.MyContent.FixTransitionText(tran); - _MyItem.Save(); - } - if (roUsgReplacements.Count > 0) - { - EditText = FixRoUsgReplacements(EditText, roUsgReplacements); - _MyItem.Save(); - } - modtext = EditText; - } - else - { - EditText = modtext; - foreach (Csla.Validation.BrokenRule br in _MyItem.MyContent.BrokenRulesCollection) - { - Console.WriteLine("{0} - {1}", br.Property, br.Description); - } - // Don't update the DTS or User for Text Changes - //_MyItem.DTS = DateTime.Now; - //_MyItem.UserID = Volian.Base.Library.VlnSettings.UserID; - _MyItem.Save(); - } - _MyItem = null; - OriginalText = modtext; - } - if (!_MyItemInfo.IsStep) - _MyItemInfo.UpdateTransitionText(); - } - catch (Exception ex) - { - Console.WriteLine("DisplayText Save Failed with error: {0} - {1}\r\n{2}", ex.GetType().Name, ex.Message, ex.StackTrace); - return false; - } - //rtb.SelectionStart = savSelStart; - return true; - } - private string DteToString() - { - StringBuilder sret = new StringBuilder(); - foreach (displayTextElement vte in DisplayTextElementList) - { - if (vte.Type == E_TextElementType.Text || vte.Type == E_TextElementType.Symbol) - sret.Append(vte.Text); - else - { - displayLinkElement dle = vte as displayLinkElement; - if (vte != null) sret.Append(dle.TextAndLink); - } - } - string modtext = sret.ToString(); - return modtext; - } - private string FixRoUsgReplacements(string p, Dictionary roUsgReplacements) - { - foreach (int oldid in roUsgReplacements.Keys) - { - p = p.Replace(string.Format("", oldid), roUsgReplacements[oldid].ROUsageID.ToString()); - } - return p; - } - private Dictionary BuildRoUsgReplacements(ContentRoUsages contentRoUsages) - { - Dictionary retval = new Dictionary(); - foreach (ContentRoUsage rou in contentRoUsages) - { - if (rou.ROUsageID < 0) retval.Add(rou.ROUsageID, rou); - } - return retval; - } - private string FixCtReplacements(string p, Dictionary ctReplacements) - { - foreach (int oldid in ctReplacements.Keys) - { - p = p.Replace(string.Format("",oldid),ctReplacements[oldid].TransitionID.ToString()); - } - return p; - } - private Dictionary BuildCtReplacements(ContentTransitions contentTransitions) - { - Dictionary retval = new Dictionary(); - foreach (ContentTransition ct in contentTransitions) - { - if (ct.TransitionID < 0) retval.Add(ct.TransitionID, ct); - } - return retval; - } - private void ProcessRoTranChanges(Item itm, List origList) - { - // go through list. Note that only linked items are in the origList. - // 1) delete any that are in origList but not in the DisplayTextElementList - // (that represents the current text & links) - // 2) add any that are only in DisplayTextElementList - // 3) delete/add for modify? - - // delete first - if in original, but not in current list, delete the one - // in the original list. - foreach (displayLinkElement odte in origList) - { - bool found = false; - foreach (displayTextElement dte in DisplayTextElementList) - { - if (dte.Type == odte.Type) - { - displayLinkElement l_dte = (displayLinkElement)dte; - if (odte.Link == l_dte.Link) - { - found = true; - break; - } - } - } - // remove the link element from the item. - if (!found) - { - // Get record id for ro or trans and then find the associated ro or transition - // in the item's list. remove it. - int recid = -1; - if (odte.Type != E_TextElementType.ReferencedObject) - { - int sp = odte.Link.IndexOf(" ") + 1; // get past tran type - string srecid = odte.Link.Substring(sp, odte.Link.IndexOf(" ", sp) - sp); - recid = System.Convert.ToInt32(srecid); - foreach (ContentTransition ct in itm.MyContent.ContentTransitions) - { - if (ct.TransitionID == recid) - { - itm.MyContent.ContentTransitions.Remove(ct); - break; - } - } - } - else - { - int sp = odte.Link.IndexOf(" "); - //rousageid starts after "ReferencedObject:", i.e. index in link of 17 - string srecid = odte.Link.Substring(17, sp-17); - recid = System.Convert.ToInt32(srecid); - foreach (ContentRoUsage cr in itm.MyContent.ContentRoUsages) - { - if (cr.ROUsageID == recid) - { - itm.MyContent.ContentRoUsages.Remove(cr); - break; - } - } - } - } - } - // now do insert, i.e. in new list, but not in old. - foreach (displayTextElement dte in DisplayTextElementList) - { - bool found = false; - if (dte.Type == E_TextElementType.ReferencedObject || dte.Type == E_TextElementType.Transition || dte.Type == E_TextElementType.TransitionRange) - { - foreach (displayLinkElement odte in origList) - { - if (dte.Type == odte.Type) - { - // if the link is the same, it exists, so no action is required. - displayLinkElement l_dte = (displayLinkElement)dte; - if (odte.Link == l_dte.Link) - { - found = true; - break; - } - } - } - // Insert the link (ro or transition) to the item - if (!found) - { - if (dte.Type == E_TextElementType.ReferencedObject) // do ro - { - displayLinkElement l_dte = (displayLinkElement)dte; - Match m = Regex.Match(l_dte.Link, "([A-Za-z]*):(.*)"); - string linkstr = m.Groups[2].Value; - string[] roparts = linkstr.Split(" ".ToCharArray()); - ContentRoUsage rousg = null; - using (RODb rodb = RODb.GetJustRoDb(Convert.ToInt32(roparts[2]))) - { - rousg = itm.MyContent.ContentRoUsages.Add(roparts[1], rodb); - } - l_dte.Link = l_dte.Link.Replace("", string.Format("", rousg.ROUsageID)); - l_dte.TextAndLink = l_dte.TextAndLink.Replace("", string.Format("", rousg.ROUsageID)); - break; - } - else if (dte.Type == E_TextElementType.TransitionRange || dte.Type == E_TextElementType.Transition) - { - displayLinkElement l_dte = (displayLinkElement)dte; - Match m = Regex.Match(l_dte.Link, "([A-Za-z]*):(.*)"); - string linkstr = m.Groups[2].Value; - string[] tparts = linkstr.Split(" ".ToCharArray()); - int type = System.Convert.ToInt32(tparts[0]); - int tr1 = System.Convert.ToInt32(tparts[2]); // tparts[2] is token for tranid - int tr2 = tr1; - if(tparts.Length > 3) - tr2 = System.Convert.ToInt32(tparts[3]); // tparts[3] is token for rangeid - bool dispose1 = false; - Item itm1 = null; - bool dispose2 = false; - Item itm2 = null; - if (itm.ItemID == tr1) - itm1 = itm; // a transition that points to itself should not dispose - else - { - dispose1 = true; - itm1 = Item.Get(tr1); - } - if (itm.ItemID == tr2) - itm2 = itm; // a transition that points to itself should not dispose - else if (tr1 == tr2) - itm2 = itm1; // if both destinations are the same only dispose the first one - else - { - dispose2 = true; - itm2 = Item.Get(tr2); - } - ContentTransition ct = itm.MyContent.ContentTransitions.Add(itm1, itm2); - //Console.WriteLine("CT {0},{1},{2},{3}", ct.TransitionID, itm.ItemID, itm.MyContent.MyContentUnique, itm.MyContent.ContentTransitions.Count); - ct.TranType = type; - if (dte.Type == E_TextElementType.Transition) - ct.IsRange = 0; - else if (tr1 != tr2) - ct.IsRange = 1; - else - ct.IsRange = 2; - l_dte.Link = l_dte.Link.Replace("", string.Format("", ct.TransitionID)); - l_dte.TextAndLink = l_dte.TextAndLink.Replace("", string.Format("", ct.TransitionID)); - if (dispose2) itm2.Dispose(); - if (dispose1) itm1.Dispose(); - } - } - } - } - } - private List GetLinkList(List locDisplayTextElementList) - { - List retList = new List(); - foreach (displayTextElement vte in locDisplayTextElementList) - { - if (vte.Type == E_TextElementType.ReferencedObject || vte.Type == E_TextElementType.TransitionRange || vte.Type == E_TextElementType.Transition) - { - displayLinkElement tmp = (displayLinkElement)vte; - displayLinkElement copy_vte = new displayLinkElement(); - copy_vte.Type = tmp.Type; - copy_vte.Link = tmp.Link; - copy_vte.Text = tmp.Text; - retList.Add(copy_vte); - } - } - return retList; - } - private void RtfToDisplayTextElements(string text) - { - // get original text into displaytext elements for comparison for links: - if (DisplayTextElementList == null) - DisplayTextElementList = new List(); - else - DisplayTextElementList.Clear(); - - if (text == null || text == "") return; - - string noExtraRtfStr = text; - - int startIndex = 0; - int index = -1; - noExtraRtfStr = noExtraRtfStr.Replace(@"><", @">\v0 \v <"); - while ((index = FindTokenChar(noExtraRtfStr, startIndex)) > -1) - { - // Do any 'plain' text that preceeds the token. - if (index > startIndex) DoTextElement(noExtraRtfStr, startIndex, index); - - if (noExtraRtfStr[index + 1] == 'v') - index = DoLink(noExtraRtfStr, index); - else - index = DoSymbol(noExtraRtfStr, startIndex, index); - startIndex = index; // +1; - if (startIndex >= noExtraRtfStr.Length) break; - } - // Add any remaining text. - if (startIndex < noExtraRtfStr.Length) DoTextElement(noExtraRtfStr, startIndex, index); - } - private string RtfToDbText(string text) - { - // For hardspaces, the windows richtextbox does some 'quirky' things: - // A unicode representation of \u160? is sent INTO the rtb. Coming out, - // that \u160? was translated to a \~ (by the underlying windows rtb). - // Note that if the \~ is sent to the rtb, it is treated as a regular space, - // i.e. no longer a hardspace, and actually is converted to a regular space. - // SO, on the way out, convert any \~ to \u160? - string noExtraRtfStr = text.Replace(@"\~", @"\u160?"); - noExtraRtfStr = noExtraRtfStr.Replace(@"\'a0", @"\u160?"); - - // Check for two links in a row & if found, add separating rtf comment - // commands (these get removed in the richtextbox: - // RHM 20100303 Not sure why this is here. The RichTextBox will always remove it. - //noExtraRtfStr = noExtraRtfStr.Replace(@"[END>\v0 \v -1) noExtraRtfStr = noExtraRtfStr.Replace(@"\'05", "\x05"); - - return noExtraRtfStr; - } - public static string StaticReplaceRTFClause(Match m) - { - try - { - string token = m.Groups[1].Value; - switch (token[1]) - { - case '\\': - return token; - case 'u': - if (Regex.IsMatch(token, @"^\\u[0-9]+$")) - return token; // Special Charcaters - if (Regex.IsMatch(token, @"^\\ulnone ?$")) - return token; - if (Regex.IsMatch(token, @"^\\ul.*$")) - return token; // Underline - if (Regex.IsMatch(token, @"^\\up[0-9] ?$")) - return token; // shift up (superscript) - break; - case 'd': - if (Regex.IsMatch(token, @"^\\dn[0-9] ?$")) - return token; // shift down (subscript) - break; - case '\'': // Special Character - return token; - case 'b': // Bold - return token; - case 'i': // Italics - return token; - case '{': // look for escape for curly braces: - return token; - case '}': - return token; - case 'v': // save link hidden info - if (token == "\\viewkind4 ") break; - if (Regex.IsMatch(token, @"^\\v0? ?$")) - return token; // comment part of link - _MyLog.WarnFormat("<<>>\r\n==> Token including Comment not processed '{0}'", token); - break; - case 'l': - if (Regex.IsMatch(token, @"^\\line ?$")) return token; - break; - case 'p': - if (Regex.IsMatch(token, @"^\\par ?$")) return "\r\n"; - //if (token == @"\protect") - // return token; - //if (token == @"\protect0") - // return token; - //if (token.Length >= 6 && token.Substring(0, 6) == "\\par\r\n") return token.Replace("\r\n", " "); - break; - //case 'f': // handle fonts separately because they may or may not have a space after them - // if (token[2] >= '0' && token[2] <= '9') return token; - // break; - } - } - catch (Exception ex) - { - Console.WriteLine("StaticReplaceRTFClause {0} - {1}", ex.GetType().Name, ex.Message); - } - return "";//Strip All - } - public string StripRtfCommands(string rtf) - { - // replace \{ & \} with (![ & (!] respectively and then redo at end. The curly braces - // are rtf so were getting removed and/or not handled correctly. - string retval = rtf.Replace(@"\{", @" (!["); - retval = retval.Replace(@"\}", @" (!]"); - - // remove carriage return/newlines after \par commands (these are introduced by rtb - // for hard returns, goes into rtb as \par and comes out as \par\r\n): - retval = Regex.Replace(retval, @"\\par\r\n(?!\\)", "\\par "); - retval = retval.Replace("\\v0\r\n", "\\v0 "); // Replace Carriage Return and Newline after comment - retval = Regex.Replace(retval, @"[\r\n]", "", RegexOptions.Singleline); // Strip Carriage Returns and Newlines - retval = Regex.Replace(retval, @"^\{(.*)\}$", "$1", RegexOptions.Singleline); // Strip Opening and Closing Braces - retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - retval = Regex.Replace(retval, @"(\\[^' \\?\r\n\t]+)(?=\\)", "$1 "); // add space after token if followed by token - retval = Regex.Replace(retval, @"(\\[^' \\?\r\n\t]+ )", new MatchEvaluator(StaticReplaceRTFClause)); // take backslash xyz and evaluates them - retval = Regex.Replace(retval, @"(\\[^' \\?\r\n\t]+) (?=\\)", "$1"); // remove space between tokens - retval = Regex.Replace(retval, @"(\\[^' \\?\r\n\t]+) (?=\r\n)", "$1"); // remove space before /r/n - // remove \r\n at end of string if the string has 2 or more characters - if (retval.EndsWith("\r\n")) retval = retval.Remove(retval.Length - 2, 2); - if (retval.Length == 0) return ""; - if (retval.EndsWith(@"\v")) retval = retval.Remove(retval.Length - 2, 2); - retval = _MyItemInfo.RemoveRtfStyles(retval); // RemoveRtfStyles(retval); - retval = retval.Replace(@" (![", @"\{"); - retval = retval.Replace(@" (!]", @"\}"); - retval = retval.TrimEnd(' '); - return retval; - } - // This is used in the DataLoader - public static string StaticStripRtfCommands(string rtf) - { - // replace \{ & \} with (![ & (!] respectively and then redo at end. The curly braces - // are rtf so were getting removed and/or not handled correctly. - string retval = rtf.Replace(@"\{", @" (!["); - retval = retval.Replace(@"\}", @" (!]"); - - // For hardspaces, the windows richtextbox does some 'quirky' things: - // A unicode representation of \u160? is sent INTO the rtb. Coming out, - // that \u160? was translated to a \~ (by the underlying windows rtb). - // Note that if the \~ is sent to the rtb, it is treated as a regular space, - // i.e. no longer a hardspace, and actually is converted to a regular space. - // SO, on the way out, convert any \~ to \u160? - retval = retval.Replace(@"\~", @"\u160?"); - - // remove carriage return/newlines after \par commands (these are introduced by rtb - // for hard returns, goes into rtb as \par and comes out as \par\r\n): - retval = Regex.Replace(retval, @"\\par\r\n(?!\\)", "\\par "); - //retval = Regex.Replace(retval, @"\\par\r\n(?=\\)", "\\par"); - - retval = retval.Replace("\\v0\r\n", "\\v0 "); // Replace Carriage Return and Newline after comment - retval = Regex.Replace(retval, @"[\r\n]", "", RegexOptions.Singleline); // Strip Carriage Returns and Newlines - retval = Regex.Replace(retval, @"^\{(.*)\}$", "$1", RegexOptions.Singleline); // Strip Opening and Closing Braces - retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - //retval = Regex.Replace(retval, @"(\\[^ \\?\r\n\t]+)\\f[0-9] ", "$1 "); // remove font command - if next to another command, keep other command and space - // OLD: The following two lines are replaced by the more generic replace above. - //retval = Regex.Replace(retval, @"\\v\\f[0-9] ", "\\v "); // remove font command - if next to Comment keep space - //retval = Regex.Replace(retval, @"\\line\\f[0-9] ", "\\line "); // remove font command - if next to Line keep space - //retval = Regex.Replace(retval, @"\\f[0-9] ", ""); // remove font command with ending space - //retval = Regex.Replace(retval, @"\\f[0-9]", ""); // remove font command without ending space - //retval = Regex.Replace(retval, @"\\par ", "\r\n"); - retval = Regex.Replace(retval, @"(\\[^' \\?\r\n\t]+)(?=\\)", "$1 "); // add space after token if followed by token - //retval = Regex.Replace(retval, @"(\\[^ \\?\r\n\t]+)(\\)", "$1 $2"); // take backslash xyz and evaluates them - retval = Regex.Replace(retval, @"(\\[^ \\?\r\n\t]+ )", new MatchEvaluator(StaticReplaceRTFClause)); // take backslash xyz and evaluates them - retval = Regex.Replace(retval, @"(\\[^ \\?\r\n\t]+) (?=\\)", "$1"); // remove space between tokens - retval = Regex.Replace(retval, @"(\\[^ \\?\r\n\t]+) (?=\r\n)", "$1"); // remove space before /r/n - // remove a space if there is one as the first character or the last character - //if (retval[0] == ' ') retval = retval.Remove(0, 1); - //retval = retval.TrimEnd(' '); - // remove \r\n at end of string if the string has 2 or more characters - if (retval.Length > 1 && retval.Substring(retval.Length - 2, 2) == "\r\n") retval = retval.Remove(retval.Length - 2, 2); - // remove \par at end of string if the string has 4 or more characters - //if (retval.Length > 3 && retval.Substring(retval.Length - 4, 4) == @"\par") retval = retval.Remove(retval.Length - 4, 4); - // remove a space following \r\n - //retval = Regex.Replace(retval, "\r\n ", "\r\n"); - ////if there are still spaces following \r\n, then probable in a table - we need to put the space back - //retval = Regex.Replace(retval, "\r\n ", "\r\n "); - - if (retval.Length == 0) return ""; - if (retval.Length > 1 && retval.Substring(retval.Length - 2, 2) == @"\v") retval = retval.Remove(retval.Length - 2, 2); - //retval = RemoveRtfStyles(retval); - //if (itmInfo != null) - // retval = StaticRemoveRtfStyles(retval, itmInfo); - - retval = retval.Replace(@" (![", @"\{"); - retval = retval.Replace(@" (!]", @"\}"); - retval = retval.TrimEnd(' '); - - // the indent character was translated in the richtextbox, change it back: - if (retval.IndexOf(@"\'05") > -1) retval = retval.Replace(@"\'05", "\x05"); - return retval; - } - #endregion - #region StyleData - //private VE_Font GetItemFont() - //{ - // VE_Font font = null; - // FormatInfo format = _MyItemInfo.ActiveFormat; - // int type = (int)_MyItemInfo.MyContent.Type; - // switch (type/10000) - // { - // case 0: // procedure - // font = format.PlantFormat.FormatData.Font; - // break; - // case 1: // section - // font = format.PlantFormat.FormatData.SectData.SectionHeader.Font; - // break; - // case 2: // step types - // int typindx = type - 20000; // what to do for other types rather than steps - // font = format.PlantFormat.FormatData.StepDataList[typindx].Font; - // break; - // } - // TextFont = font; - // return font; - //} - #endregion - #region DoListElements - private int FindTokenChar(string txt, int startIndex) - { - // 'tokens' are for symbols and links (ro & transitions). symbols are represented by \u - // and links are represented by \v \v0 - bool done = false; - while (!done) - { - int indx = txt.IndexOf('\\', startIndex); - if (indx < 0) return indx; - // see if symbol (but not underline) or another rtf command: has a 'u' - // followed by a non-underline or single quote, and if so, return it. - if (((txt[indx + 1] == 'u' && txt[indx + 2] != 'l' && txt[indx + 2] !='p')) || (txt[indx + 1] == '\'')) return indx; - // see if link - if (txt[indx + 1] == 'v') return indx; //TODO - should have ") != -1) return text; - int transitionID = Convert.ToInt32(link.Split(" ".ToCharArray())[1]); - // Find the transition - if (_MyItemInfo.MyContent.ContentTransitionCount <= 0) - { - // TODO: RHM 20100310 - _MyItemInfo.MyContent.RefreshContentTransitions(); - if (_MyItemInfo.MyContent.ContentTransitionCount <= 0) - return "*Resolved Transition Text*"; - } - foreach (TransitionInfo ti in _MyItemInfo.MyContent.ContentTransitions) - { - if (ti.TransitionID == transitionID) - { - string path = ti.ResolvePathTo(_MyFormat, _MyItemInfo, ti.TranType, ti.MyItemToID, ti.MyItemRangeID); - return path; - } - } - return text; - } - private int DoTran(string text,int index) - { - displayLinkElement vte = new displayLinkElement(); - - // determine if Range by checking for "R" after Transition (otherwise ":") - int linkindx = text.IndexOf(@"#Link", index); - vte.Type = (text[linkindx+16]=='R')?E_TextElementType.TransitionRange:E_TextElementType.Transition; - return DoLinkElements(text, index, vte); - } - - //private int GetLastLower(string stepText) - //{ - // // TO DO: need to check AlwaysUpperCase format setting - this was not yet converted as of 17Jun2010 - // // if (AlwaysUpperCase[steptype]) return (stepText.Length-1); - - // int idx = stepText.Length - 1; - // while (idx >= 0 && !(char.IsLower(stepText[idx]) && stepText[idx] != 's')) idx--; - // if (idx < 0) idx = stepText.Length - 1; // entire string is uppercased set return value to end of string - // return idx; - //} - - //private bool IsSpaceOrHardSpace(char ch) - //{ - // string spaces = @" \u160?"; - // return (spaces.IndexOf(ch) >= 0); - //} - private string DoROFormatFlags(string roText, string beforeRO, string afterRO, bool isSetpoint, string prevValue) - { - string rtnstr = roText; - // The RO text is being changed to match it's context. Since it is changed in reverse order, the text before the RO - // should ignore other RO text. - beforeRO = Regex.Replace(beforeRO, @"\", ""); // Remove any RO Values. - beforeRO = Regex.Replace(beforeRO, @"(\\[^v \\]+)*\\v(\\[^v \\]+)* .*?\\v0(\\[^v \\]+)*( |$)", ""); // Remove Comments - string allUnitAfterRo = afterRO; - afterRO = Regex.Replace(afterRO, @"(\\[^v \\]+)*\\v(\\[^v \\]+)* .*?\\v0(\\[^v \\]+)*( |$)", ""); // Remove Comments - - // Underline all ROs, values and Units - if (isSetpoint && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.UnderlineRo) - { - // TO DO: Need to check if step text is already underlined - if ((_MyItemInfo.FormatStepData.Font.Style & E_Style.Underline) == 0) - rtnstr = @"\ul " + rtnstr + @"\ulnone "; - } - - // UpcaseAllRoUnits - Uppercases ALL ROs units everywhere. - if (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.UpcaseAllRoUnits) - return UpperCaseUnits(rtnstr); - - //Forces the units for a RO to be uppercased for high level steps - if (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.CapHighRo &&_MyItemInfo.IsHigh) - return UpperCaseUnits(rtnstr); - - // Caps ROs anywhere if no lower case text follows - // and an upper case letter immediately precedes the RO. - - if (isSetpoint && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.CapSPIfLastLower && - !Regex.IsMatch(afterRO, @".*(? 0 && !IsSpaceOrHardSpace(stepText[indx])) indx--; // find character before RO - //while (indx2 <= stepText.Length && !IsSpaceOrHardSpace(stepText[indx2])) indx2++; // find character after RO - - //if (indx >= 0 && char.IsUpper(stepText[indx]) && indx2 > GetLastLower(stepText)) - // doUpCase = true; - return UpperCaseUnits(rtnstr); - } - - // If a RO follows a "- " then it will be uppercased - if (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.UpRoAftrDash && Regex.IsMatch(beforeRO, @".*\\u8209\?( |\\u160\?)")) - { - //int indx = startLinkText - 1; - //while (indx > 0 && !IsSpaceOrHardSpace(stepText[indx])) indx--; // find character before RO - //string prefix = indx >= 7?stepText.Substring(indx-7,8):""; - //doUpCase = (prefix == @"\u8209? "); // Dash character before RO - return UpperCaseUnits(rtnstr); - } - // For Wolf Creek, the "- " should be right before the link. This ro format flag was introduced - // for Wolf Creek only because a problem was found with some of their data that was incorrectly - // processed through the 'UpRoAftrDash' flag. That flag was more general, i.e. upper cased units - // if there was a dash and then a space or hard space anywhere before the RO text. The original - // 16bit flag was more specific. Other plants that were released had the UpRoAftrDash, but - // we didn't want to change their formats since they had gone through testing. - if (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.UpRoImmAftrDashSpace && Regex.IsMatch(beforeRO, @".*\\u8209\?( )")) - return UpperCaseUnits(rtnstr); - - // Uppercase the RO Unit if the previous letter is uppercase - if (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.UpRoIfPrevUpper && char.IsUpper(LastAlpha(beforeRO))) - { - //doUpCase = (char.IsUpper(stepText[startLinkText - 1])); - return UpperCaseUnits(rtnstr); - - } - - //CapFirstLetterInHighRO - Cap only the first letters of the units in a high level RO - // note: used in FLP (Turkey Point) format - if (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.CapFirstLetterInHighRO && _MyItemInfo.IsHigh) - { - int idx = 0; - string tstr = ""; - while (idx < rtnstr.Length && !char.IsLetter(rtnstr[idx])) tstr += rtnstr[idx++].ToString(); - if (idx < rtnstr.Length) - { - tstr += char.ToUpper(rtnstr[idx]).ToString(); - if (idx + 1 < rtnstr.Length) - tstr += rtnstr.Substring(idx + 1); - } - rtnstr = tstr; - } - - //In a sequence of RO values, the unit appears with every value - //(e.g., "25 gpm and 30 gpm" vs. "25 and 30 gpm") - if (!_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.AllUnits && prevValue != null) - { - string units = null; - Match m = Regex.Match(prevValue, "[^0-9]"); - if (m.Success) - { - units = prevValue.Substring(m.Index); - if (rtnstr.EndsWith(units)) - { - rtnstr = rtnstr.Replace(units, ""); - } - } - } - return rtnstr; - } - /// - /// Uppercase alphabetical strings excluding any RTF token - /// - /// - /// - private string MatchEvaluatorUppercaseROUnits(Match match) - { - if (match.Value[0] == '\\') // If the previous character is a backslash then this is an RTF token - return match.Value; - return match.Value.ToUpper(); - } - Regex _RegExUppercaseROUnits = new Regex("(^|[^a-zA-Z])[a-zA-Z]+"); - private string UpperCaseUnits(string rtnstr) - { - // Uppercase Units - rtnstr = _RegExUppercaseROUnits.Replace(rtnstr, new MatchEvaluator(MatchEvaluatorUppercaseROUnits)); - // After converting the value to uppercase, change X10 to x10 to handle Fortran Formatted numbers - return rtnstr.Replace("X10", "x10"); - } - - // Find the last Alphabetical character - private char LastAlpha(string beforeRO) - { - Match m = Regex.Match(beforeRO, ".*([a-zA-Z])[^a-zA-Z]*"); - if (m.Success) return m.Groups[1].ToString()[0]; - return '\0'; - } - - private int DoLinkElements(string text, int index, displayLinkElement vte) - { - // Find the 'end comment' for this 0 && (endTextIndx < 0 || endTextIndx > endTextIndx2)) - endTextIndx = endTextIndx2; - vte.Text = text.Substring(endStartTknIndx + startAdj, endTextIndx - endStartTknIndx - startAdj); // 4 for \v0 - - // Now get the link part. It can be terminated by a '\v0' or an [END> - int endLinkIndxV = text.IndexOf(@"\v0 ", linkIndx); - if (endLinkIndxV == -1) endLinkIndxV = text.IndexOf(@"\v0", linkIndx); // at end of string - int endLinkIndxE = text.IndexOf(@"[END>", linkIndx); - int endLinkIndx = (endLinkIndxV < endLinkIndxE) ? endLinkIndxV : endLinkIndxE; - vte.Link = text.Substring(linkIndx + 6, endLinkIndx - linkIndx - 6); // 6 for #Link: - - string tmptxt = null; - if (vte.Type != E_TextElementType.ReferencedObject) - { - tmptxt = FixTransition(vte.Link, vte.Text); - vte.Text = tmptxt; - } - //else - //{ - // tmptxt = DoROFormatFlags(vte.Text, text, index, endLinkIndx); - // vte.Text = tmptxt; - //} - - // Now get the entire text & link. Account for various ending possibilities: - // ends with '\v0\'; ends with '\v0 '; ends with '\v0' (end of string); - // ends with '[END>' if two in a row - will have ", endLinkIndx + 3); // get past end of link - int endComment = text.IndexOf(@"\v0", endToken); - - int rettoken = 0; - int retlen = 4; - if (endComment + 3 == text.Length) retlen = 3; - else if (text[endComment + 3] == '\\') retlen = 3; - vte.TextAndLink = text.Substring(index, endComment - index + retlen); - rettoken = endComment + retlen; - if (vte.Type != E_TextElementType.ReferencedObject) - { - if (vte.TextAndLink.Contains("(Resolved Transition Text)")) - vte.TextAndLink = vte.TextAndLink.Replace("(Resolved Transition Text)", tmptxt); - else - if (vte.Text != tmptxt) - vte.Text = tmptxt; - } - DisplayTextElementList.Add(vte); - return rettoken; - } - private int DoSymbol(string text, int startIndex, int index) - { - displayTextElement vte = new displayTextElement(); - vte.Type = E_TextElementType.Symbol; - // symbols are the unicode/rtf command. A symbol can be represented by \'xy or - // in the text from the database \uxyz?. If the \'xy is used the length of the - // symbol number will always be two, otherwise find the index of the '?' to - // find the end. - int endindx = -1; - if (text[index + 1] == '\'') endindx = index + 3; - else endindx = text.IndexOf("?", index); - vte.Text = text.Substring(index, endindx - index + 1); - DisplayTextElementList.Add(vte); - return endindx+1; - } - #endregion - #region ReplaceWords - #region commented out - //private string DoReplaceWords(string Text) - //{ - // ReplaceStrList rsl = _MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList; - // foreach (ReplaceStr rs in rsl) - // { - // if (_MyItemInfo.MyContent.Type < 20000) return Text; // for now only replace in steps. - // bool replaceit = false; - - // if (_MyItemInfo.ItemID == 2557) Console.WriteLine("here"); - // // note that the order of this check is important. Check in this order... - // // background here - // if (_MyItemInfo.IsHigh && (rs.Flag & E_ReplaceFlags.High)>0) replaceit = true; - // else if ((_MyItemInfo.IsTable || _MyItemInfo.IsFigure) && (rs.Flag & E_ReplaceFlags.Table) > 0) replaceit = true; - // else if (_MyItemInfo.IsInRNO && (rs.Flag & E_ReplaceFlags.RNO) > 0) replaceit = true; - // else if (_MyItemInfo.IsCaution && (rs.Flag & E_ReplaceFlags.Caution) > 0) replaceit = true; - // else if (_MyItemInfo.IsNote && (rs.Flag & E_ReplaceFlags.Note) > 0) replaceit = true; - // else if (_MyItemInfo.IsStepPart && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - // //else if (_MyItemInfo.IsInFirstLevelSubStep && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - // else if (_MyItemInfo.IsAccPages & (rs.Flag & E_ReplaceFlags.Attach) > 0) replaceit = true; - - // if (replaceit) - // { - // // CASEINSENS: Do ReplaceWords for all words that match, regardless of case, and replace - // // with the ReplaceWith string as is - // if ((rs.Flag & E_ReplaceFlags.CaseInsens) > 0) - // { - // //string res = ""; - // //string fortest = Text.ToUpper(); - // ////string pat = @"(?<=\W|^)" + rs.ReplaceWord.ToUpper() + @"(?=\W|$)"; - // //// jsj 07Jun2010 HardSpaces defeat replaceword logic - // //string pat = @"(?<=\W|^)(? 0) - // { - // // only in Maine Yankee - we don't need to do this one. - // } - // // CASEINSENSFIRST: Do ReplaceWords for all words that exactly match the ReplaceWord, - // // except the case where the first character may be different - // else if ((rs.Flag & E_ReplaceFlags.CaseInsensFirst) > 0) - // { - // // only used in V.C. Summer - we don't need to do this either. - // } - // else - // { - // // If there are Regex Control Characters '\[]()' prefix them with backslash - // string replaceWord = Regex.Replace(rs.ReplaceWord, @"[[\]\\()]", @"\$0"); - // //string pat = @"(?<=\W|^)" + replaceWord + @"(?=\W|$)"; - // // jsj 07Jun2010 HardSpaces defeat replaceword logic - // //string pat = @"(?<=\W|^)(? 0) replaceit = true; - // else if ((_MyItemInfo.IsTable || _MyItemInfo.IsFigure) && (rs.Flag & E_ReplaceFlags.Table) > 0) replaceit = true; - // else if (_MyItemInfo.IsInRNO && (rs.Flag & E_ReplaceFlags.RNO) > 0) replaceit = true; - // else if (_MyItemInfo.IsCaution && (rs.Flag & E_ReplaceFlags.Caution) > 0) replaceit = true; - // else if (_MyItemInfo.IsNote && (rs.Flag & E_ReplaceFlags.Note) > 0) replaceit = true; - // else if (_MyItemInfo.IsStepPart && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - // //else if (_MyItemInfo.IsInFirstLevelSubStep && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - // else if (_MyItemInfo.IsAccPages & (rs.Flag & E_ReplaceFlags.Attach) > 0) replaceit = true; - - // if (replaceit) - // { - // // CASEINSENS: Do ReplaceWords for all words that match, regardless of case, and replace with the ReplaceWith string as is - // RegexOptions myOptions = (rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase : RegexOptions.None; - // string replaceWord = Regex.Replace(rs.ReplaceWord, @"[[\]\\()]", @"\$0"); - // string pat = @"(?<=\W|^)(? dicReplaceRegex = new Dictionary(); - private string DoReplaceWords2(string Text) - { - if (_MyItemInfo.MyContent.Type < 20000) return Text; // for now only replace in steps. - FoundMatches myMatches = new FoundMatches(Text,_MyItemInfo.FormatStepData.Font,_MyItemInfo); - // Exclude Link Text from Replace Word process - myMatches.AddLink(regFindLink, _MyFormat.PlantFormat.FormatData.SectData.ReplaceWordsInROs, _MyItemInfo.MyProcedure.MyDocVersion); - ReplaceStrList rsl = _MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList; - - // The only way to get an 'empty' list is to have one 'dummy' replacestr, i.e. that has ReplaceWord as an empty string. If the - // ReplaceStrData xml node is empty, it does the inheritance and gets the 'base' format's list. - if (rsl.Count==1 && (rsl[0].ReplaceWord == null || rsl[0].ReplaceWord == "")) return Text; - // Loop through text looking for words to be replaced - foreach (ReplaceStr rs in rsl) - { - bool replaceit = false; - // note that the order of this check is important. Check in this order... - // background here - if (_MyItemInfo.IsHigh && (rs.Flag & E_ReplaceFlags.High) > 0) replaceit = true; - else if ((_MyItemInfo.IsTable || _MyItemInfo.IsFigure) && (rs.Flag & E_ReplaceFlags.Table) > 0) replaceit = true; - else if (_MyItemInfo.IsInRNO && (rs.Flag & E_ReplaceFlags.RNO) > 0) replaceit = true; - else if (_MyItemInfo.IsCaution && (rs.Flag & E_ReplaceFlags.Caution) > 0) replaceit = true; - else if (_MyItemInfo.IsNote && (rs.Flag & E_ReplaceFlags.Note) > 0) replaceit = true; - else if (_MyItemInfo.IsStepPart && !_MyItemInfo.IsHigh && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - //else if (_MyItemInfo.IsInFirstLevelSubStep && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - else if (_MyItemInfo.IsAccPages & (rs.Flag & E_ReplaceFlags.Attach) > 0) replaceit = true; - - if (replaceit) - { - if (!dicReplaceRegex.ContainsKey(rs)) - { - // CASEINSENS: Do ReplaceWords for all words that match, regardless of case, and replace with the ReplaceWith string as is - //RegexOptions myOptions = (rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase & RegexOptions.Singleline : RegexOptions.None & RegexOptions.Singleline; - RegexOptions myOptions = (rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase: RegexOptions.None; - string replaceWord = Regex.Replace(rs.ReplaceWord, @"[[\]\\()]", @"\$0"); - // if first or last character in replaceword is a non-word character, for example, ',', ')', or '.', - // don't use the \W, i.e. don't bother to look for a non-word character. - string wordMatchBeg = Regex.IsMatch(replaceWord.Substring(0, 1), @"\W") ? "" : @"(?<=\W|^)"; - string wordMatchEnd = Regex.IsMatch(replaceWord.Substring(replaceWord.Length - 1, 1), @"\W") ? "" : @"(?=\W|$)"; - string pat = wordMatchBeg + @"(?", RegexOptions.Singleline); - private string ReplaceWord(string text, string replace, string with, RegexOptions regexOptions) - { - MatchCollection myMatches = Regex.Matches(text, replace, regexOptions); - MatchCollection myLinks = regFindLink.Matches(text); - for (int i = myMatches.Count - 1; i >= 0; i--) - { - Match myMatch = myMatches[i]; - if (!PartOfLinkText(myMatch, myLinks)) - text = text.Substring(0, myMatch.Index) + with + text.Substring(myMatch.Index + myMatch.Length); - } - return text; - } - - private bool PartOfLinkText(Match myMatch, MatchCollection myLinks) - { - foreach (Match myLink in myLinks) - if (myMatch.Index > myLink.Index && myMatch.Index < (myLink.Index + myLink.Length)) - return true; - return false; - } - #endregion - #endregion - } - #region displayTextElementClass - public enum E_TextElementType : uint - { - Text = 0, - Transition = 1, - TransitionRange = 2, - ReferencedObject = 3, - Symbol = 4 - }; - public class displayTextElement - { - private E_TextElementType _Type; - public E_TextElementType Type - { - get { return _Type; } - set { _Type = value; } - } - protected string _Text; - virtual public string Text - { - get { return _Text; } - set { _Text = value; } - } - } - public class displayLinkElement : displayTextElement - { - private string _Link; - public string Link - { - get { return _Link; } - set { _Link = value; } - } - private string _TextAndLink; - public string TextAndLink - { - get { return _TextAndLink; } - set { _TextAndLink = value; } - } - /// - /// Text - this should parse the text and return the results - /// - override public string Text - { - get - { - if (_TextAndLink != null) - { - Match m = Regex.Match(_TextAndLink, @""); - if(m.Groups[3].Value == " ") - return m.Groups[4].Value; - return m.Groups[3].Value + m.Groups[4].Value; - } - return _Text; - } - set - { - if (_TextAndLink != null) - { - Match m = Regex.Match(_TextAndLink, @""); - int myIndex = m.Groups[4].Index; - int myLength = m.Groups[4].Length; - if (m.Groups[3].Value != " ") - { - myIndex = m.Groups[3].Index; - myLength += m.Groups[3].Length; - } - string gg = _TextAndLink.Substring(myIndex, myLength); - string newvalue = value.Replace("{", @"\{").Replace("}", @"\}"); - _TextAndLink = _TextAndLink.Substring(0, myIndex) + newvalue + _TextAndLink.Substring(myIndex + myLength); - } - _Text = value; - } - } - } - #endregion - public class FoundMatches : SortedList - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private string _Text; - private VE_Font _Font; - private ItemInfo _MyItemInfo; - public FoundMatches(string text, VE_Font font, ItemInfo myItemInfo) - : base() - { - _Text = text; - _Font = font; - _MyItemInfo = myItemInfo; - } - public void Add(Regex myRegEx, ReplaceStr myWord) - { - MatchCollection myMatches = myRegEx.Matches(_Text); - foreach (Match myMatch in myMatches) - Add(myMatch, myWord); - } - public void AddLink(Regex myRegEx, bool replaceWordsInROs, DocVersionInfo myDocVersion) - { - MatchCollection myMatches = myRegEx.Matches(_Text); - foreach (Match myMatch in myMatches) - { - if (!replaceWordsInROs || IsTransition(myMatch.Value) || IsSetpointRO(myMatch.Value, myDocVersion)) - Add(myMatch, null);// Exclude from Replace Words - } - } - private bool IsTransition(string link) - { - return link.Contains("#Link:Transition"); - } - private static Regex regRefObj = new Regex(@"\#Link\:ReferencedObject:([0-9]*) ([0-9a-zA-Z]*) ([0-9]*)", RegexOptions.Singleline); - private static bool IsSetpointRO(string link, DocVersionInfo myDocVersion) - { - Match myMatch = regRefObj.Match(link); - if (myMatch.Success) - { - int dbid = System.Convert.ToInt32(myMatch.Groups[2].Value.Substring(0, 4), 16); - int rodbid = int.Parse(myMatch.Groups[3].Value); - ROFstInfo myROFst = myDocVersion.GetROFst(rodbid); - return myROFst.IsSetpointDB(dbid, myDocVersion); - } - return false; - } - public void Add(Match myMatch, ReplaceStr myWord) - { - // If one already exists for this location, then don't add another. - if (ContainsKey(myMatch.Index)) return; - // Start by Adding it. - base.Add(myMatch.Index, new FoundMatch(myMatch, myWord)); - // Now see what I can do with it. - int index = this.IndexOfKey(myMatch.Index); - if (index > 0) // If this match is contained within the previous match remove it - { - FoundMatch previousMatch = Values[index - 1]; - if (previousMatch.MyMatch.Index + previousMatch.MyMatch.Length > myMatch.Index) - Remove(myMatch.Index); - } // If the next match is contained within this match, remove the next match - while (index < Count - 1 && Values[index + 1].MyMatch.Index < (myMatch.Index + myMatch.Length)) - Remove(Values[index + 1].MyMatch.Index); - } - public string ReplaceMatches() - { - int offset = 0; - string text = _Text; - foreach (FoundMatch foundMatch in Values) - { - if (foundMatch.MyWord != null) - { - if (VerifyNoHardSpace(text, foundMatch, offset)) - { - //if(offset != 0 || foundMatch.MyMatch.Index != 0 || !foundMatch.MyWord.ReplaceWith.StartsWith(@"{\par}")) - //{ - string with = foundMatch.MyWord.ReplaceWith; - if (offset == 0 && foundMatch.MyMatch.Index == 0 && with.StartsWith(@"{\par}")) with = with.Replace(@"{\par}", ""); - bool IsBold = ((_Font.Style & E_Style.Bold) == E_Style.Bold) || - (_MyItemInfo.FormatStepData != null && _MyItemInfo.FormatStepData.BoldHighLevel && _MyItemInfo.IsRNOPart && _MyItemInfo.MyParent.IsHigh ); - if (IsBold && with.Contains(@"\b ")) - { - with = with.Replace(@"\b ",""); - with = with.Replace(@"\b0 ",""); - } - bool IsUnderline = (((_Font.Style & E_Style.Underline) == E_Style.Underline) && with.Contains(@"\ul ")); - // handle where replace words replaces a string with 'underline on'string'underline off', for example Point Beach - // had replaced OR's turning underline off in the middle of a transition, "EOP-0 UNIT 1, RACTORE TRIP OR SAFETY INJECTION". - if (!IsUnderline) - { - int repidxulnone = text.LastIndexOf(@"\ulnone", foundMatch.MyMatch.Index + offset); - int repidxst = text.LastIndexOf(@"\ul", foundMatch.MyMatch.Index + offset); - if (repidxulnone > 0) - { - repidxst = text.Substring(repidxulnone + 7, foundMatch.MyMatch.Index + offset - (repidxulnone + 7)).LastIndexOf(@"\ul"); - if (repidxst >= 0) - repidxst += (repidxulnone + 7); - } - if (repidxst >= 0) IsUnderline = true; - } - if (IsUnderline) - { - with = with.Replace(@"\ul ", ""); - with = with.Replace(@"\ulnone ", ""); - } - text = text.Substring(0, offset + foundMatch.MyMatch.Index) + with + text.Substring(offset + foundMatch.MyMatch.Index + foundMatch.MyMatch.Length); - //offset += foundMatch.MyWord.ReplaceWith.Length - foundMatch.MyMatch.Length; - offset += with.Length - foundMatch.MyMatch.Length; - //} - } - } - } - return text; - } - - private bool VerifyNoHardSpace(string text, FoundMatch foundMatch, int offset) - { - string begin = text.Substring(0, offset + foundMatch.MyMatch.Index); - string end = text.Substring(offset + foundMatch.MyMatch.Index + foundMatch.MyMatch.Length); - if (text.StartsWith(@"{\rtf")) - { - // make sure that it is not preceded by \u160? \'a0 or \~ - if(Regex.IsMatch(begin,@"(\\(u160\?|'a0|~)(\\f[0-9]* ?)*(\\fs[0-9]* ?)*)$")) - return false; - // make sure that it is not followed by \u160? \'a0 or \~ - if(Regex.IsMatch(end,@"^((\\f[0-9]* ?)*(\\fs[0-9]* ?)*\\(u160\?|'a0|~))")) - return false; - } - return true; - } - } - public class FoundMatch - { - private Match _MyMatch; - public Match MyMatch - { - get { return _MyMatch; } - set { _MyMatch = value; } - } - private ReplaceStr _MyWord; - public ReplaceStr MyWord - { - get { return _MyWord; } - set { _MyWord = value; } - } - public FoundMatch(Match myMatch, ReplaceStr myWord) - { - _MyMatch = myMatch; - _MyWord = myWord; - } - } - -} diff --git a/PROMS/Volian.Controls.Library/DisplayTextRO.cs b/PROMS/Volian.Controls.Library/DisplayTextRO.cs deleted file mode 100644 index 945c50a0..00000000 --- a/PROMS/Volian.Controls.Library/DisplayTextRO.cs +++ /dev/null @@ -1,1778 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; -using System.Text.RegularExpressions; -using System.Drawing; -using VEPROMS.CSLA.Library; - -namespace Volian.Controls.Library -{ - public class DisplayText - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - #region Properties - private E_FieldToEdit _FieldToEdit; - public E_FieldToEdit FieldToEdit - { - get { return _FieldToEdit; } - set { _FieldToEdit = value; } - } - private ItemInfo _MyItemInfo; - private string InfoText - { - get - { - switch (FieldToEdit) - { - case E_FieldToEdit.StepText: - case E_FieldToEdit.Text: - return _MyItemInfo.MyContent.Text; - break; - case E_FieldToEdit.Number: - return _MyItemInfo.MyContent.Number; - break; - } - return string.Empty; - } - } - private Item _MyItem; - private string EditText - { - get - { - switch (FieldToEdit) - { - case E_FieldToEdit.StepText: - case E_FieldToEdit.Text: - return _MyItem.MyContent.Text; - break; - case E_FieldToEdit.Number: - return _MyItem.MyContent.Number; - break; - } - return string.Empty; - } - set - { - switch (FieldToEdit) - { - case E_FieldToEdit.StepText: - case E_FieldToEdit.Text: - _MyItem.MyContent.Text = value; - _MyItem.MyContent.UserID = Volian.Base.Library.VlnSettings.UserID; - _MyItem.MyContent.DTS = DateTime.Now; - break; - case E_FieldToEdit.Number: - _MyItem.MyContent.Number = value; - _MyItem.MyContent.UserID = Volian.Base.Library.VlnSettings.UserID; - _MyItem.MyContent.DTS = DateTime.Now; - break; - default: - break; - } - } - } - // list of 'pieces of text' for this item. Pieces include symbols, ros, - // transitions & plain text. - private List _DisplayTextElementList; - public List DisplayTextElementList - { - get { return _DisplayTextElementList; } - set { _DisplayTextElementList = value; } - } - // dictionary for the font table for this item. Note that this may - // go away (it is not really used). - private Dictionary _dicRtfFontTable; - public Dictionary dicRtfFontTable - { - get { return _dicRtfFontTable; } - set { _dicRtfFontTable = value; } - } - private VE_Font _textFont; // Font from format for this item - public VE_Font TextFont - { - get { return _textFont; } - set { _textFont = value; } - } - private bool PrintingSmartTemplate = false; - public string StartText; - public string OriginalText; // compare for save to see if change for links. - private FormatInfo _MyFormat; - #endregion - #region Constructors - /// - /// DisplayText constructor: - /// Creates a DisplayText object that converts the database text into rtf text - /// Arguments are: - /// ItemInfo itemInfo - the item whose text will be resolved - /// E_EditPrintMode ep_mode - edit or print. - /// E_ViewMode vw_mode - view or edit. - /// bool noEdit - flags whether to edit or not (used to set data in - /// rtb as resolved replacewords for non-active rtb. - /// E_FieldToEdit fieldToEdit - identifies the field to edit (number or text) - /// bool colorLinks - whether to add color to links - /// - public DisplayText(ItemInfo itemInfo, E_EditPrintMode epMode, E_ViewMode vwMode, bool noEdit,E_FieldToEdit fieldToEdit, bool colorLinks, string prefix, string suffix) - { - _FieldToEdit = fieldToEdit; - _MyItemInfo = itemInfo; - OriginalText = InfoText; - TextFont = itemInfo.GetItemFont();//GetItemFont(); - // if in print mode, and this is the HLS of a smart template (checklist formats), add a space before and - // after the HLS text - this allows for the vertical bar characters to be added. - if (itemInfo.IsStep && itemInfo.FormatStepData.UseSmartTemplate && epMode == E_EditPrintMode.Print) Console.WriteLine("here"); - string addSpace = (itemInfo.IsStep && itemInfo.FormatStepData.UseSmartTemplate && epMode == E_EditPrintMode.Print) ? " " : ""; - string text = prefix + addSpace + InfoText + addSpace + suffix; - _MyFormat = itemInfo.ActiveFormat; - - bool tableShouldBeOutlined = (epMode == E_EditPrintMode.Print || vwMode == E_ViewMode.View || noEdit) && - (_FieldToEdit == E_FieldToEdit.StepText || _FieldToEdit == E_FieldToEdit.Text) && - (!itemInfo.IsSection && !itemInfo.IsProcedure) && (itemInfo.IsTable || itemInfo.IsFigure); - bool wordsShouldBeReplaced = epMode == E_EditPrintMode.Print || vwMode == E_ViewMode.View || noEdit; - if (_MyFormat == null) - Console.WriteLine(this._MyItemInfo.MyItemInfoUnique); - bool numbersShouldBeFormated = (!_MyFormat.PlantFormat.FormatData.SectData.StepSectionData.FortranFormatNumbers && (epMode == E_EditPrintMode.Print || vwMode == E_ViewMode.View || noEdit)); - int typ = ((int)itemInfo.MyContent.Type) % 10000; - bool tableHasBorder = tableShouldBeOutlined ? itemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[typ].Type.IndexOf(@"Borderless") < 0 : false; - bool ROsShouldBeAdjusted = wordsShouldBeReplaced; // same logical value - if (epMode == E_EditPrintMode.Print && _MyItemInfo.IsStep) - { - if (_MyItemInfo.FormatStepData.UseSmartTemplate) - { - // Add 2 spaces before and 1 after if there is prefix so that wrapping in RTB accounts for vertical - // lines (the 2 spaces after the first "\par " command and 1 space before 2nd "\par"). Tried other - // combinations that did not work. - if (_MyItemInfo.FormatStepData.Prefix != null && _MyItemInfo.FormatStepData.Prefix != "") - text = !_MyItemInfo.FormatStepData.Font.FontIsProportional() ? ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Prefix) + @"\par " + text + @"\par " : - @"\par " + text + @"\par "; - if (_MyItemInfo.FormatStepData.Suffix != null && _MyItemInfo.FormatStepData.Suffix != "") - text = text + (!_MyItemInfo.FormatStepData.Font.FontIsProportional() ? ReplaceLinesWithUnicode(_MyItemInfo.FormatStepData.Suffix) : - @"\par\par\par "); - } - } - text = CreateRtf(colorLinks, text, tableShouldBeOutlined, wordsShouldBeReplaced, numbersShouldBeFormated, tableHasBorder, ROsShouldBeAdjusted); - - StartText = text; - } - private string ReplaceLinesWithUnicode(string text) - { - text = text.Replace("\x2500", @"\u9472?"); // Horizontal - text = text.Replace("\x2502", @"\u9474?"); // Vertical - text = text.Replace("\x2514", @"\u9492?"); // Bottom Left Corner - text = text.Replace("\x2518", @"\u9496?"); // Bottom Right Corner - text = text.Replace("\x2534", @"\u9524?"); // Bottom Tee - text = text.Replace("\x250c", @"\u9484?"); // Upper Left Corner - text = text.Replace("\x251c", @"\u9500?"); // Left Tee - text = text.Replace("\x2510", @"\u9488?"); // Upper Right Corner - text = text.Replace("\x252c", @"\u9516?"); // Top Tee - text = text.Replace("\x2524", @"\u9508?"); // Right Tee - text = text.Replace("\x253c", @"\u9532?"); // Plus - return text; - } - - public DisplayText(string text, VE_Font vFont, bool colorLinks) - { - TextFont = vFont; - StartText = CreateRtf(colorLinks, text, false, false, false, false, false); - } - public DisplayText(ItemInfo itemInfo, string text, bool colorLinks) - { - _FieldToEdit = E_FieldToEdit.Text; - _MyItemInfo = itemInfo; - OriginalText = text; - TextFont = itemInfo.GetItemFont(); - _MyFormat = itemInfo.ActiveFormat; - - bool wordsShouldBeReplaced = true; - bool numbersShouldBeFormated = !_MyFormat.PlantFormat.FormatData.SectData.StepSectionData.FortranFormatNumbers; - int typ = ((int)itemInfo.MyContent.Type) % 10000; - bool ROsShouldBeAdjusted = wordsShouldBeReplaced; // same logical value - - text = CreateRtf(colorLinks, text, false, wordsShouldBeReplaced, numbersShouldBeFormated, false, ROsShouldBeAdjusted); - StartText = text; - } - private string CreateRtf(bool colorLinks, string text, bool tableShouldBeOutlined, bool wordsShouldBeReplaced, bool numbersShouldBeFormated, bool tableHasBorder, bool ROsShouldBeAdjusted) - { - // Adjust RO display - if (ROsShouldBeAdjusted) - { - try // Added try/catch because an unresolved RO Link was causing a failure. - { - text = DoROAdjustments(text); - } - catch (Exception ex) - { - if (_MyItemInfo != null) - { - _MyLog.ErrorFormat("<<< ERROR >>> Error doing DoROAdjustments\r\n==>'RO Adjustments Error',{0},'{1}','{2}','{3}'" - , _MyItemInfo.ItemID, _MyItemInfo.MyDocVersion.MyFolder.Name, _MyItemInfo.ShortPath, ex.Message); - } - else - _MyLog.Error("DisplayText.CreateRTF Error doing DoROAdjustments", ex); - - } - } - // if in print mode, view mode, or non-active richtextbox do replace words. Only if in - // actual edit mode are replace words left as is. - // But don't do ReplaceWords if the TurnOffReplaceWords format flag is set - if (wordsShouldBeReplaced && !_MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.TurnOffReplaceWords) - text = DoReplaceWords2(text); - if (_MyItemInfo != null) - { - text = DoSearchAndReplace(text, "", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ID); - text = text.Replace(@"", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_ProcedureSetID); - text = text.Replace("", _MyItemInfo.MyDocVersion.DocVersionConfig.Unit_Number); - } - // Adjust RO display - if (ROsShouldBeAdjusted) - text = DoTransitionAdjustments(text, _MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.BoldTransition || (_MyItemInfo.ActiveFormat.PlantFormat.FormatData.TransData.BoldTransitionExceptHLS && !_MyItemInfo.IsHigh)); - // add colors around links: - if (colorLinks) - text = DoColorLinks(text); - //Console.WriteLine(text); - // adjust formatting of exponents - if (numbersShouldBeFormated) - text = DoFortranFormat(text); - // determine whether the table/figure should be outlined: - if (tableShouldBeOutlined) - { - OutlineRTFTable myTable = new OutlineRTFTable(text, tableHasBorder); - // if a table has internal line draw characters, we may have to do part of 'OutlineTable' - // to convert dashes and vertical bars to line draw characters. - if (tableHasBorder) myTable.OutlineTable(); - text = myTable.Lines.ToString(); - } - - // if we're working with a grid it won't go thru here. - if (!text.StartsWith(@"{\rtf")) - { - // as a precaution, convert any \~ to \u160?. This is for Hard spaces. see the commentary in the - // save portion of this code for an explanation. - text = text.Replace(@"\~", @"\u160?"); - text = text.Replace("\r\n", @"\par "); - //if (text.IndexOf(@"\line") > -1) - // MessageBox.Show("Found rtf line"); - text = text.Replace(@"\line", @"\par"); - - // Now put symbol (for fixed fonts) or unicode font (proportional) around symbols - // These fonts are VESymbFix & Arial Unicode MS respectively, and the font table - // is actually defined in the StepRTB code. - int indxsym = NextUnicode(text, 0);//text.IndexOf(@"\u"); - while (indxsym != -1) - { - int incrindx = 3; - if (text[indxsym + 2] != 'l') - { - text = text.Insert(indxsym, @"\f1 "); - int indxendsym = text.IndexOfAny(@"\ ?".ToCharArray(), indxsym + 5); - if (indxendsym == -1) // must be end of line: - text = text.Insert(text.Length - 1, @"\f0 "); - else - { - if (text[indxendsym] == '?') indxendsym++; - text = text.Insert(indxendsym, @"\f0 "); // TODO: do I need a space?? - } - incrindx = 5; - } - indxsym = NextUnicode(text, indxsym + incrindx);//text.IndexOf(@"\u", indxsym + incrindx); - } - } - return text; - } - - private string DoSearchAndReplace(string text, string find, string replace) - { - return text.Replace(find, replace); - } - private static string DoColorLinks(string text) - { - string origtext = text; - text = Regex.Replace(text, @"( -1) - { - text = text.Insert(indxend, @"\cf0"); - indxcf = text.IndexOf(@"\v0\cf1", indxend); - } - else - { - indxcf = -1; - _MyLog.WarnFormat("DisplayText.DoColorLinks Failed\r\norgitext:'{0}'\r\ntext'{1}'", origtext, text); - } - } - } - catch (Exception ex) - { - _MyLog.WarnFormat("DisplayText.DoColorLinks Failed\r\norgitext:'{0}'\r\ntext'{1}'", origtext, text); - } - return text; - } - private int NextUnicode(string text, int offset) - { - // Skip Hard Spaces - Match m = Regex.Match(text.Substring(offset), @"\\u[0-9a-fA-F]"); - while(m.Success && text.Substring(offset+m.Index).StartsWith(@"\u160")) - { - offset += m.Index + 5; - m = Regex.Match(text.Substring(offset), @"\\u[0-9a-fA-F]"); - } - if (m.Success) - return m.Index + offset; - return -1; - } - private string DoROAdjustments(string text) - { - Regex regRefObj = new Regex(@"\#Link\:ReferencedObject:([0-9]*) ([0-9a-zA-Z]*) ([0-9]*)", RegexOptions.Singleline); - string strippedText = StaticStripRtfCommands(text); - // (\\[^v \\]+)* --> look for any rtf commands (first part of lookFor) - // \\v0 --> end of comment - // (\\[^v \\]+)* --> more rtf commands ended by a space - // (.*?) --> smallest anything to that matches this based on what's next - // (\\[^v' \\]+)* --> look for rtf commands but exclude \' before the \v - // \\v(\\[^v \\]+)* --> look for rtf commands after the \v - // if it turns out that if ro's have any embedded unicode characters this needs expanded, such as /u8209? (hard hyphen) - string lookFor = string.Format(@""); - MatchCollection matches = Regex.Matches(text, lookFor); - for (int i = matches.Count - 1; i >= 0; i--) - { - Match m = matches[i]; - if (m != null && m.Groups.Count > 6 && m.Groups[6].ToString() == "ReferencedObject") - { - System.Text.RegularExpressions.Group g = m.Groups[3]; - Match myMatch = regRefObj.Match(m.ToString()); - int dbid = System.Convert.ToInt32(myMatch.Groups[2].Value.Substring(0, 4), 16); - int rodbid = int.Parse(myMatch.Groups[3].Value); - ROFstInfo myROFst = _MyItemInfo.MyDocVersion.GetROFst(rodbid); - bool isSetpoint = myROFst.IsSetpointDB(dbid); - string beforeRO = StaticStripRtfCommands(text.Substring(0, g.Index)); - string afterRO = StaticStripRtfCommands(text.Substring(g.Index + g.Length)); - string newvalue = DoROFormatFlags(g.ToString(), beforeRO, afterRO, isSetpoint); - newvalue = DoROReplaceWords(_MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList, newvalue, _MyItemInfo.IsHigh); - if (isSetpoint) newvalue = ReplaceSpaceWithHardspace(newvalue); - if (newvalue.Contains("^")) Console.WriteLine("here"); - newvalue = newvalue.Replace("^", @"\u916?"); - if (g.ToString() != newvalue) - text = text.Substring(0, g.Index) + newvalue + text.Substring(g.Index + g.Length); - } - } - return text; - } - private string DoROReplaceWords(ReplaceStrList replaceStrList, string newvalue, bool isHigh) - { - foreach (ReplaceStr rs in replaceStrList) - { - if (((rs.Flag & E_ReplaceFlags.Setpoint) > 0) || (isHigh && (rs.Flag & E_ReplaceFlags.HLSSetpnt) > 0)) - { - newvalue = newvalue.Replace(rs.ReplaceWord, rs.ReplaceWith); - } - } - return newvalue; - } - // Replace spaces with hardspaces, but DO NOT replace the end of an Rtf Command with a hardspace - private string ReplaceSpaceWithHardspace(string newvalue) - { - string oldvalue = newvalue; - int spindx = newvalue.IndexOf(" "); - int lstindx = -1; - while (spindx >= 0) - { - if (!EndsRtfCommand(newvalue, spindx, lstindx)) - { - newvalue = newvalue.Remove(spindx, 1); - newvalue = newvalue.Insert(spindx, @"\u160?"); - } - lstindx = spindx; - spindx = (spindx + 1 >= newvalue.Length)?spindx = -1: newvalue.IndexOf(" ", spindx+1); - } - return newvalue; - } - - private bool EndsRtfCommand(string str, int spindx, int previndx) - { - // get text from last space to current, or from beginning of string to current: - int start = previndx < 0 ? 0 : previndx+1; - string substring = str.Substring(start, spindx-start); - if (substring.Contains(@"\")) - { - // is space ending an rtf command. - int startCmd = substring.LastIndexOf(@"\"); - string Cmd = substring.Substring(startCmd); - char tst = Cmd[1]; - // consider rtf commands up/dn/b/ul/i - if (tst == 'u' || tst == 'd' || tst == 'b' || tst == 'u' || tst == 'i') return true; - } - return false; - } - private string DoTransitionAdjustments(string text, bool boldTran) - { - string strippedText = StaticStripRtfCommands(text); - string lookFor = string.Format(@""); - MatchCollection matches = Regex.Matches(text, lookFor); - if (matches.Count == 0) return text; - string retstr = text; - for (int i = matches.Count - 1; i >= 0; i--) - { - Match m = matches[i]; - // if this transition text already has a hard space, don't add another. - if (m.Groups[3].Value.Contains("\xA0")) continue; - // if the transition text does not start with a digit, don't add the hardspace. - //if (!Char.IsDigit(m.Groups[3].Value[0])) continue; - if (m != null && m.Groups.Count > 7 && m.Groups[6].ToString().StartsWith("Transition")) - { - if (m.Groups[7].Value != "") // && StepTransition(int.Parse(m.Groups[7].Value))) - { - System.Text.RegularExpressions.Group g = m.Groups[3]; - string beforeTran = retstr.Substring(0, g.Index); - string afterTran = retstr.Substring(g.Index + g.Length); - - // if replacing text in the 'beforeTran' string, then do it here, - // i.e. there is a format flag 'BeforeTrans' that bolds text before the transition - // (in wst formats). - beforeTran = DoBeforeTransFlagSupport(beforeTran, _MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.ReplaceStrList); - string newvalue = g.ToString(); - // if this is a 'step transition' type, i.e. includes a step number, in addition to other replacements, - // we want to change a space to a hardspace. - if (StepTransition(int.Parse(m.Groups[7].Value))) - { - int indexLastSpace = newvalue.LastIndexOf(' '); - if (indexLastSpace >= 0) - // Use a "\x1" as a token to replace later. Insert the unicode char, whose length is - // more than 1 character was throwing of the regexp Matches index, so that the resulting - // string may have been incorrect. - retstr = beforeTran + (boldTran ? @"\b " : null) + newvalue.Substring(0, indexLastSpace) + "\x1" + newvalue.Substring(indexLastSpace + 1) + (boldTran ? @"\b0" : null) + afterTran; - else - if (beforeTran.EndsWith(" ")) - retstr = ReplaceLastSpaceWithHardSpace(beforeTran) + (boldTran ? @"\b " : null) + newvalue + (boldTran ? @"\b0" : null) + afterTran; - else - Console.Write("");// Don't know where to put the Hard Space - } - else if (boldTran) - { - retstr = beforeTran + @"\b " + newvalue + @"\b0" + afterTran; - } - } - } - } - return retstr.Replace("\x1", @"\u160?"); - } - - private string DoBeforeTransFlagSupport(string beforeTran, ReplaceStrList replaceStrList) - { - foreach (ReplaceStr repstr in replaceStrList) - { - if ((repstr.Flag & E_ReplaceFlags.BeforeTrans) > 0) - { - // the beforeTran string ends with the string that starts the transition comment, i.e. - // '\\v -1) - { - string findit = beforeTran.Substring(0, beforeTran.LastIndexOf(@"\v 0 && str[ind - 1] != ' ') - { - if (ind > 5 && str.Substring(0, ind).EndsWith(@"\u160?") || str.Substring(0, ind).ToLower().EndsWith(@"\'a0")) - return str;//Already has a Hard Space - ind = str.LastIndexOf(@"\", ind - 1); - } - // If the previous character is a comma or a space then don't add a Hard Space - if (ind > 1 && (str[ind - 2] == ',' || str[ind - 2] == ' ')) return str; - if (ind <= 0) return str; - - // replace with a 'token' "\x1" instead of a hardspace unicode char. When using a hardspace unicode - // char the string length/contents was thrown off so that the calling method's processing was off - // in terms of regexp matches in string. - return str.Substring(0, ind - 1) + "\x1" + str.Substring(ind); - } - private bool StepTransition(int TransId) - { - if (_MyItemInfo == null) return false; - _MyItemInfo.MyContent.RefreshContentTransitions(); - foreach (TransitionInfo trans in _MyItemInfo.MyContent.ContentTransitions) - if (trans.TransitionID == TransId) - return trans.MyItemToID.IsStep; - return false; - } - private string DoFortranFormat(string text) - { - if (text.IndexOf(@".E") < 0) return text; - // Look for text as n.Ey, where n can be null or a number, and y can be - // positive or negative. This translates into nx10x10y where y is - // superscripted. For example, .E3 -> x103 where 3 is superscripted - // and 10.E5 -> 10x10-5 where 5 is superscripted - string pat = @"(\d*).E([+-]*\d+)"; - string retstr = text; - // for each one that needs translated: - foreach (Match m in Regex.Matches(text, pat)) - { - string fnum = m.Groups[1].Value; - string supnum = m.Groups[2].Value; - string newstr = string.Format(@"{0}x10\up2 {1}\up0 ", fnum, supnum); - retstr = retstr.Replace(m.Value, newstr); - } - return retstr; - } - #endregion - #region SaveData - public bool Save(RichTextBox rtb) - { - //int savSelStart = rtb.SelectionStart; - try - { - //FormatInfo formatInfo = _MyItemInfo.ActiveFormat; - using (_MyItem = _MyItemInfo.Get()) - { - // The following was added to support transitions to un-numbered steps - if (_MyItemInfo.NewTransToUnNumberedItem && rtb.Text.Contains("")) - { - ItemAnnotation ia = _MyItem.ItemAnnotations.Add(AnnotationType.GetByName("Verification Required")); - ia.SearchText = "Transition to Un-Numbered Step"; - _MyItemInfo.NewTransToUnNumberedItem = false; - } - // check for different text, i.e. text from this itm doesn't match - // original text, a change occurred in database, but not from this user. - if (OriginalText != EditText) - { - Console.WriteLine("Save Failed because text changed outside of this edit session."); - return false; - } - string modtext = RtfToDbText(rtb.Rtf).Replace("", "\\\\"); - - // if there are links, we'll need to do extra processing to see if - // there were additions, deletions or modifications. - bool haslinks = ((modtext.IndexOf(@" -1) || (OriginalText != null && OriginalText != "" && OriginalText.IndexOf(@" -1)); - if (haslinks) - { - // Get all links in original list - RtfToDisplayTextElements(OriginalText); - List origList = GetLinkList(DisplayTextElementList); - // now get new text into displaytext elements for comparison for links: - RtfToDisplayTextElements(modtext); - // Compare ro/transition lists and delete or add any to the item for any ros/transitions that have been - // added/deleted or modified. - ProcessRoTranChanges(_MyItem, origList); - EditText = DteToString(); - // if new transitions/ros, we need to 'fix' the string in the embedded link to contain the - // transition or usage record. - Dictionary ctReplacements = BuildCtReplacements(_MyItem.MyContent.ContentTransitions); - Dictionary roUsgReplacements = BuildRoUsgReplacements(_MyItem.MyContent.ContentRoUsages); - _MyItem.DTS = DateTime.Now; - _MyItem.UserID = Volian.Base.Library.VlnSettings.UserID; - // Do the Save once rather than multiple times - _MyItem.Save(); - if (ctReplacements.Count > 0) - { - EditText = FixCtReplacements(EditText, ctReplacements); - // Replace Transition Text - foreach (ContentTransition ct in ctReplacements.Values) - using (TransitionInfo tran = TransitionInfo.Get(ct.TransitionID)) - _MyItem.MyContent.FixTransitionText(tran); - _MyItem.Save(); - } - if (roUsgReplacements.Count > 0) - { - EditText = FixRoUsgReplacements(EditText, roUsgReplacements); - _MyItem.Save(); - } - modtext = EditText; - } - else - { - EditText = modtext; - foreach (Csla.Validation.BrokenRule br in _MyItem.MyContent.BrokenRulesCollection) - { - Console.WriteLine("{0} - {1}", br.Property, br.Description); - } - // Don't update the DTS or User for Text Changes - //_MyItem.DTS = DateTime.Now; - //_MyItem.UserID = Volian.Base.Library.VlnSettings.UserID; - _MyItem.Save(); - } - _MyItem = null; - OriginalText = modtext; - } - } - catch (Exception ex) - { - Console.WriteLine("DisplayText Save Failed with error: {0} - {1}\r\n{2}", ex.GetType().Name, ex.Message, ex.StackTrace); - return false; - } - //rtb.SelectionStart = savSelStart; - return true; - } - private string DteToString() - { - StringBuilder sret = new StringBuilder(); - foreach (displayTextElement vte in DisplayTextElementList) - { - if (vte.Type == E_TextElementType.Text || vte.Type == E_TextElementType.Symbol) - sret.Append(vte.Text); - else - { - displayLinkElement dle = vte as displayLinkElement; - if (vte != null) sret.Append(dle.TextAndLink); - } - } - string modtext = sret.ToString(); - return modtext; - } - private string FixRoUsgReplacements(string p, Dictionary roUsgReplacements) - { - foreach (int oldid in roUsgReplacements.Keys) - { - p = p.Replace(string.Format("", oldid), roUsgReplacements[oldid].ROUsageID.ToString()); - } - return p; - } - private Dictionary BuildRoUsgReplacements(ContentRoUsages contentRoUsages) - { - Dictionary retval = new Dictionary(); - foreach (ContentRoUsage rou in contentRoUsages) - { - if (rou.ROUsageID < 0) retval.Add(rou.ROUsageID, rou); - } - return retval; - } - private string FixCtReplacements(string p, Dictionary ctReplacements) - { - foreach (int oldid in ctReplacements.Keys) - { - p = p.Replace(string.Format("",oldid),ctReplacements[oldid].TransitionID.ToString()); - } - return p; - } - private Dictionary BuildCtReplacements(ContentTransitions contentTransitions) - { - Dictionary retval = new Dictionary(); - foreach (ContentTransition ct in contentTransitions) - { - if (ct.TransitionID < 0) retval.Add(ct.TransitionID, ct); - } - return retval; - } - private void ProcessRoTranChanges(Item itm, List origList) - { - // go through list. Note that only linked items are in the origList. - // 1) delete any that are in origList but not in the DisplayTextElementList - // (that represents the current text & links) - // 2) add any that are only in DisplayTextElementList - // 3) delete/add for modify? - - // delete first - if in original, but not in current list, delete the one - // in the original list. - foreach (displayLinkElement odte in origList) - { - bool found = false; - foreach (displayTextElement dte in DisplayTextElementList) - { - if (dte.Type == odte.Type) - { - displayLinkElement l_dte = (displayLinkElement)dte; - if (odte.Link == l_dte.Link) - { - found = true; - break; - } - } - } - // remove the link element from the item. - if (!found) - { - // Get record id for ro or trans and then find the associated ro or transition - // in the item's list. remove it. - int recid = -1; - if (odte.Type != E_TextElementType.ReferencedObject) - { - int sp = odte.Link.IndexOf(" ") + 1; // get past tran type - string srecid = odte.Link.Substring(sp, odte.Link.IndexOf(" ", sp) - sp); - recid = System.Convert.ToInt32(srecid); - foreach (ContentTransition ct in itm.MyContent.ContentTransitions) - { - if (ct.TransitionID == recid) - { - itm.MyContent.ContentTransitions.Remove(ct); - break; - } - } - } - else - { - int sp = odte.Link.IndexOf(" "); - //rousageid starts after "ReferencedObject:", i.e. index in link of 17 - string srecid = odte.Link.Substring(17, sp-17); - recid = System.Convert.ToInt32(srecid); - foreach (ContentRoUsage cr in itm.MyContent.ContentRoUsages) - { - if (cr.ROUsageID == recid) - { - itm.MyContent.ContentRoUsages.Remove(cr); - break; - } - } - } - } - } - // now do insert, i.e. in new list, but not in old. - foreach (displayTextElement dte in DisplayTextElementList) - { - bool found = false; - if (dte.Type == E_TextElementType.ReferencedObject || dte.Type == E_TextElementType.Transition || dte.Type == E_TextElementType.TransitionRange) - { - foreach (displayLinkElement odte in origList) - { - if (dte.Type == odte.Type) - { - // if the link is the same, it exists, so no action is required. - displayLinkElement l_dte = (displayLinkElement)dte; - if (odte.Link == l_dte.Link) - { - found = true; - break; - } - } - } - // Insert the link (ro or transition) to the item - if (!found) - { - if (dte.Type == E_TextElementType.ReferencedObject) // do ro - { - displayLinkElement l_dte = (displayLinkElement)dte; - Match m = Regex.Match(l_dte.Link, "([A-Za-z]*):(.*)"); - string linkstr = m.Groups[2].Value; - string[] roparts = linkstr.Split(" ".ToCharArray()); - ContentRoUsage rousg = null; - using (RODb rodb = RODb.GetJustRoDb(Convert.ToInt32(roparts[2]))) - { - rousg = itm.MyContent.ContentRoUsages.Add(roparts[1], rodb); - } - l_dte.Link = l_dte.Link.Replace("", string.Format("", rousg.ROUsageID)); - l_dte.TextAndLink = l_dte.TextAndLink.Replace("", string.Format("", rousg.ROUsageID)); - break; - } - else if (dte.Type == E_TextElementType.TransitionRange || dte.Type == E_TextElementType.Transition) - { - displayLinkElement l_dte = (displayLinkElement)dte; - Match m = Regex.Match(l_dte.Link, "([A-Za-z]*):(.*)"); - string linkstr = m.Groups[2].Value; - string[] tparts = linkstr.Split(" ".ToCharArray()); - int type = System.Convert.ToInt32(tparts[0]); - int tr1 = System.Convert.ToInt32(tparts[2]); // tparts[2] is token for tranid - int tr2 = tr1; - if(tparts.Length > 3) - tr2 = System.Convert.ToInt32(tparts[3]); // tparts[3] is token for rangeid - bool dispose1 = false; - Item itm1 = null; - bool dispose2 = false; - Item itm2 = null; - if (itm.ItemID == tr1) - itm1 = itm; // a transition that points to itself should not dispose - else - { - dispose1 = true; - itm1 = Item.Get(tr1); - } - if (itm.ItemID == tr2) - itm2 = itm; // a transition that points to itself should not dispose - else if (tr1 == tr2) - itm2 = itm1; // if both destinations are the same only dispose the first one - else - { - dispose2 = true; - itm2 = Item.Get(tr2); - } - ContentTransition ct = itm.MyContent.ContentTransitions.Add(itm1, itm2); - //Console.WriteLine("CT {0},{1},{2},{3}", ct.TransitionID, itm.ItemID, itm.MyContent.MyContentUnique, itm.MyContent.ContentTransitions.Count); - ct.TranType = type; - if (dte.Type == E_TextElementType.Transition) - ct.IsRange = 0; - else if (tr1 != tr2) - ct.IsRange = 1; - else - ct.IsRange = 2; - l_dte.Link = l_dte.Link.Replace("", string.Format("", ct.TransitionID)); - l_dte.TextAndLink = l_dte.TextAndLink.Replace("", string.Format("", ct.TransitionID)); - if (dispose2) itm2.Dispose(); - if (dispose1) itm1.Dispose(); - } - } - } - } - } - private List GetLinkList(List locDisplayTextElementList) - { - List retList = new List(); - foreach (displayTextElement vte in locDisplayTextElementList) - { - if (vte.Type == E_TextElementType.ReferencedObject || vte.Type == E_TextElementType.TransitionRange || vte.Type == E_TextElementType.Transition) - { - displayLinkElement tmp = (displayLinkElement)vte; - displayLinkElement copy_vte = new displayLinkElement(); - copy_vte.Type = tmp.Type; - copy_vte.Link = tmp.Link; - copy_vte.Text = tmp.Text; - retList.Add(copy_vte); - } - } - return retList; - } - private void RtfToDisplayTextElements(string text) - { - // get original text into displaytext elements for comparison for links: - if (DisplayTextElementList == null) - DisplayTextElementList = new List(); - else - DisplayTextElementList.Clear(); - - if (text == null || text == "") return; - - string noExtraRtfStr = text; - - int startIndex = 0; - int index = -1; - noExtraRtfStr = noExtraRtfStr.Replace(@"><", @">\v0 \v <"); - while ((index = FindTokenChar(noExtraRtfStr, startIndex)) > -1) - { - // Do any 'plain' text that preceeds the token. - if (index > startIndex) DoTextElement(noExtraRtfStr, startIndex, index); - - if (noExtraRtfStr[index + 1] == 'v') - index = DoLink(noExtraRtfStr, index); - else - index = DoSymbol(noExtraRtfStr, startIndex, index); - startIndex = index; // +1; - if (startIndex >= noExtraRtfStr.Length) break; - } - // Add any remaining text. - if (startIndex < noExtraRtfStr.Length) DoTextElement(noExtraRtfStr, startIndex, index); - } - private string RtfToDbText(string text) - { - // For hardspaces, the windows richtextbox does some 'quirky' things: - // A unicode representation of \u160? is sent INTO the rtb. Coming out, - // that \u160? was translated to a \~ (by the underlying windows rtb). - // Note that if the \~ is sent to the rtb, it is treated as a regular space, - // i.e. no longer a hardspace, and actually is converted to a regular space. - // SO, on the way out, convert any \~ to \u160? - string noExtraRtfStr = text.Replace(@"\~", @"\u160?"); - noExtraRtfStr = noExtraRtfStr.Replace(@"\'a0", @"\u160?"); - - // Check for two links in a row & if found, add separating rtf comment - // commands (these get removed in the richtextbox: - // RHM 20100303 Not sure why this is here. The RichTextBox will always remove it. - //noExtraRtfStr = noExtraRtfStr.Replace(@"[END>\v0 \v -1) noExtraRtfStr = noExtraRtfStr.Replace(@"\'05", "\x05"); - - return noExtraRtfStr; - } - public static string StaticReplaceRTFClause(Match m) - { - try - { - string token = m.Groups[1].Value; - switch (token[1]) - { - case '\\': - return token; - case 'u': - if (Regex.IsMatch(token, @"^\\u[0-9]+$")) - return token; // Special Charcaters - if (Regex.IsMatch(token, @"^\\ulnone ?$")) - return token; - if (Regex.IsMatch(token, @"^\\ul.*$")) - return token; // Underline - if (Regex.IsMatch(token, @"^\\up[0-9] ?$")) - return token; // shift up (superscript) - break; - case 'd': - if (Regex.IsMatch(token, @"^\\dn[0-9] ?$")) - return token; // shift down (subscript) - break; - case '\'': // Special Character - return token; - case 'b': // Bold - return token; - case 'i': // Italics - return token; - case '{': // look for escape for curly braces: - return token; - case '}': - return token; - case 'v': // save link hidden info - if (Regex.IsMatch(token, @"^\\v0? ?$")) return token; // comment part of link - // end comment may end in space or may end in '\' if another rtf command, - // or may end at end of string. First check for space, keep it in string - // if it is there. - //if (Regex.IsMatch(token, @"\\v0 ")) - // return token; - //if (Regex.IsMatch(token, @"\\v0")) - // return token; - break; - case 'l': - if (Regex.IsMatch(token, @"^\\line ?$")) return token; - break; - case 'p': - if (Regex.IsMatch(token, @"^\\par ?$")) return "\r\n"; - //if (token == @"\protect") - // return token; - //if (token == @"\protect0") - // return token; - //if (token.Length >= 6 && token.Substring(0, 6) == "\\par\r\n") return token.Replace("\r\n", " "); - break; - //case 'f': // handle fonts separately because they may or may not have a space after them - // if (token[2] >= '0' && token[2] <= '9') return token; - // break; - } - } - catch (Exception ex) - { - Console.WriteLine("StaticReplaceRTFClause {0} - {1}", ex.GetType().Name, ex.Message); - } - return "";//Strip All - } - public string StripRtfCommands(string rtf) - { - // replace \{ & \} with (![ & (!] respectively and then redo at end. The curly braces - // are rtf so were getting removed and/or not handled correctly. - string retval = rtf.Replace(@"\{", @"(!["); - retval = retval.Replace(@"\}", @"(!]"); - - // remove carriage return/newlines after \par commands (these are introduced by rtb - // for hard returns, goes into rtb as \par and comes out as \par\r\n): - retval = Regex.Replace(retval, @"\\par\r\n(?!\\)", "\\par "); - retval = Regex.Replace(retval, @"[\r\n]", "", RegexOptions.Singleline); // Strip Carriage Returns and Newlines - retval = Regex.Replace(retval, @"^\{(.*)\}$", "$1", RegexOptions.Singleline); // Strip Opening and Closing Braces - retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - retval = Regex.Replace(retval, @"(\\[^' \\?\r\n\t]+)(?=\\)", "$1 "); // add space after token if followed by token - retval = Regex.Replace(retval, @"(\\[^' \\?\r\n\t]+ )", new MatchEvaluator(StaticReplaceRTFClause)); // take backslash xyz and evaluates them - retval = Regex.Replace(retval, @"(\\[^' \\?\r\n\t]+) (?=\\)", "$1"); // remove space between tokens - retval = Regex.Replace(retval, @"(\\[^' \\?\r\n\t]+) (?=\r\n)", "$1"); // remove space before /r/n - // remove \r\n at end of string if the string has 2 or more characters - if (retval.EndsWith("\r\n")) retval = retval.Remove(retval.Length - 2, 2); - if (retval.Length == 0) return ""; - if (retval.EndsWith(@"\v")) retval = retval.Remove(retval.Length - 2, 2); - retval = _MyItemInfo.RemoveRtfStyles(retval); // RemoveRtfStyles(retval); - retval = retval.Replace(@"(![", @"\{"); - retval = retval.Replace(@"(!]", @"\}"); - retval = retval.TrimEnd(' '); - return retval; - } - // This is used in the DataLoader - public static string StaticStripRtfCommands(string rtf) - { - // replace \{ & \} with (![ & (!] respectively and then redo at end. The curly braces - // are rtf so were getting removed and/or not handled correctly. - string retval = rtf.Replace(@"\{", @"(!["); - retval = retval.Replace(@"\}", @"(!]"); - - // For hardspaces, the windows richtextbox does some 'quirky' things: - // A unicode representation of \u160? is sent INTO the rtb. Coming out, - // that \u160? was translated to a \~ (by the underlying windows rtb). - // Note that if the \~ is sent to the rtb, it is treated as a regular space, - // i.e. no longer a hardspace, and actually is converted to a regular space. - // SO, on the way out, convert any \~ to \u160? - retval = retval.Replace(@"\~", @"\u160?"); - - // remove carriage return/newlines after \par commands (these are introduced by rtb - // for hard returns, goes into rtb as \par and comes out as \par\r\n): - retval = Regex.Replace(retval, @"\\par\r\n(?!\\)", "\\par "); - //retval = Regex.Replace(retval, @"\\par\r\n(?=\\)", "\\par"); - - retval = Regex.Replace(retval, @"[\r\n]", "", RegexOptions.Singleline); // Strip Carriage Returns and Newlines - retval = Regex.Replace(retval, @"^\{(.*)\}$", "$1", RegexOptions.Singleline); // Strip Opening and Closing Braces - retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - //retval = Regex.Replace(retval, @"(\\[^ \\?\r\n\t]+)\\f[0-9] ", "$1 "); // remove font command - if next to another command, keep other command and space - // OLD: The following two lines are replaced by the more generic replace above. - //retval = Regex.Replace(retval, @"\\v\\f[0-9] ", "\\v "); // remove font command - if next to Comment keep space - //retval = Regex.Replace(retval, @"\\line\\f[0-9] ", "\\line "); // remove font command - if next to Line keep space - //retval = Regex.Replace(retval, @"\\f[0-9] ", ""); // remove font command with ending space - //retval = Regex.Replace(retval, @"\\f[0-9]", ""); // remove font command without ending space - //retval = Regex.Replace(retval, @"\\par ", "\r\n"); - retval = Regex.Replace(retval, @"(\\[^' \\?\r\n\t]+)(?=\\)", "$1 "); // add space after token if followed by token - //retval = Regex.Replace(retval, @"(\\[^ \\?\r\n\t]+)(\\)", "$1 $2"); // take backslash xyz and evaluates them - retval = Regex.Replace(retval, @"(\\[^ \\?\r\n\t]+ )", new MatchEvaluator(StaticReplaceRTFClause)); // take backslash xyz and evaluates them - retval = Regex.Replace(retval, @"(\\[^ \\?\r\n\t]+) (?=\\)", "$1"); // remove space between tokens - retval = Regex.Replace(retval, @"(\\[^ \\?\r\n\t]+) (?=\r\n)", "$1"); // remove space before /r/n - // remove a space if there is one as the first character or the last character - //if (retval[0] == ' ') retval = retval.Remove(0, 1); - //retval = retval.TrimEnd(' '); - // remove \r\n at end of string if the string has 2 or more characters - if (retval.Length > 1 && retval.Substring(retval.Length - 2, 2) == "\r\n") retval = retval.Remove(retval.Length - 2, 2); - // remove \par at end of string if the string has 4 or more characters - //if (retval.Length > 3 && retval.Substring(retval.Length - 4, 4) == @"\par") retval = retval.Remove(retval.Length - 4, 4); - // remove a space following \r\n - //retval = Regex.Replace(retval, "\r\n ", "\r\n"); - ////if there are still spaces following \r\n, then probable in a table - we need to put the space back - //retval = Regex.Replace(retval, "\r\n ", "\r\n "); - - if (retval.Length == 0) return ""; - if (retval.Length > 1 && retval.Substring(retval.Length - 2, 2) == @"\v") retval = retval.Remove(retval.Length - 2, 2); - //retval = RemoveRtfStyles(retval); - //if (itmInfo != null) - // retval = StaticRemoveRtfStyles(retval, itmInfo); - - retval = retval.Replace(@"(![", @"\{"); - retval = retval.Replace(@"(!]", @"\}"); - retval = retval.TrimEnd(' '); - - // the indent character was translated in the richtextbox, change it back: - if (retval.IndexOf(@"\'05") > -1) retval = retval.Replace(@"\'05", "\x05"); - return retval; - } - #endregion - #region StyleData - //private VE_Font GetItemFont() - //{ - // VE_Font font = null; - // FormatInfo format = _MyItemInfo.ActiveFormat; - // int type = (int)_MyItemInfo.MyContent.Type; - // switch (type/10000) - // { - // case 0: // procedure - // font = format.PlantFormat.FormatData.Font; - // break; - // case 1: // section - // font = format.PlantFormat.FormatData.SectData.SectionHeader.Font; - // break; - // case 2: // step types - // int typindx = type - 20000; // what to do for other types rather than steps - // font = format.PlantFormat.FormatData.StepDataList[typindx].Font; - // break; - // } - // TextFont = font; - // return font; - //} - #endregion - #region DoListElements - private int FindTokenChar(string txt, int startIndex) - { - // 'tokens' are for symbols and links (ro & transitions). symbols are represented by \u - // and links are represented by \v \v0 - bool done = false; - while (!done) - { - int indx = txt.IndexOf('\\', startIndex); - if (indx < 0) return indx; - // see if symbol (but not underline) or another rtf command: has a 'u' - // followed by a non-underline or single quote, and if so, return it. - if (((txt[indx + 1] == 'u' && txt[indx + 2] != 'l' && txt[indx + 2] !='p')) || (txt[indx + 1] == '\'')) return indx; - // see if link - if (txt[indx + 1] == 'v') return indx; //TODO - should have ") != -1) return text; - int transitionID = Convert.ToInt32(link.Split(" ".ToCharArray())[1]); - // Find the transition - if (_MyItemInfo.MyContent.ContentTransitionCount <= 0) - { - // TODO: RHM 20100310 - _MyItemInfo.MyContent.RefreshContentTransitions(); - if (_MyItemInfo.MyContent.ContentTransitionCount <= 0) - return "*Resolved Transition Text*"; - } - foreach (TransitionInfo ti in _MyItemInfo.MyContent.ContentTransitions) - { - if (ti.TransitionID == transitionID) - { - string path = ti.ResolvePathTo(_MyFormat, _MyItemInfo, ti.TranType, ti.MyItemToID, ti.MyItemRangeID); - return path; - } - } - return text; - } - private int DoTran(string text,int index) - { - displayLinkElement vte = new displayLinkElement(); - - // determine if Range by checking for "R" after Transition (otherwise ":") - int linkindx = text.IndexOf(@"#Link", index); - vte.Type = (text[linkindx+16]=='R')?E_TextElementType.TransitionRange:E_TextElementType.Transition; - return DoLinkElements(text, index, vte); - } - - //private int GetLastLower(string stepText) - //{ - // // TO DO: need to check AlwaysUpperCase format setting - this was not yet converted as of 17Jun2010 - // // if (AlwaysUpperCase[steptype]) return (stepText.Length-1); - - // int idx = stepText.Length - 1; - // while (idx >= 0 && !(char.IsLower(stepText[idx]) && stepText[idx] != 's')) idx--; - // if (idx < 0) idx = stepText.Length - 1; // entire string is uppercased set return value to end of string - // return idx; - //} - - //private bool IsSpaceOrHardSpace(char ch) - //{ - // string spaces = @" \u160?"; - // return (spaces.IndexOf(ch) >= 0); - //} - private string DoROFormatFlags(string roText, string beforeRO, string afterRO, bool isSetpoint) - { - if (_MyItemInfo.ItemID == 357220) Console.WriteLine("here"); - string rtnstr = roText; - // The RO text is being changed to match it's context. Since it is changed in reverse order, the text before the RO - // should ignore other RO text. - beforeRO = Regex.Replace(beforeRO, @"(\\[^v \\]+)*\\v0[^v\\]*\\v(\\[^v \\]+)* #Link:Refer", ""); // Remove any RO Values. - beforeRO = Regex.Replace(beforeRO, @"(\\[^v \\]+)*\\v(\\[^v \\]+)* .*?\\v0(\\[^v \\]+)*( |$)", ""); // Remove Comments - afterRO = Regex.Replace(afterRO, @"(\\[^v \\]+)*\\v(\\[^v \\]+)* .*?\\v0(\\[^v \\]+)*( |$)", ""); // Remove Comments - - // Underline all ROs, values and Units - if (isSetpoint && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.UnderlineRo) - { - // TO DO: Need to check if step text is already underlined - rtnstr = @"\ul " + rtnstr + @"\ulnone "; - } - - // UpcaseAllRoUnits - Uppercases ALL ROs units everywhere. - if (isSetpoint && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.UpcaseAllRoUnits) - return UpperCaseUnits(rtnstr); - - //Forces the units for a RO to be uppercased for high level steps - if (isSetpoint && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.CapHighRo && _MyItemInfo.IsHigh) - return UpperCaseUnits(rtnstr); - - // Caps ROs anywhere if no lower case text follows - // and an upper case letter immediately precedes the RO. - - // 16bit code: - //if((CapSPIfLastLower && (*ptr > firstupper || firstupper==TextBuffer-1)) || - // capit || CheckUpSetpntAftrDash(*ptr) || CheckUpSPIfPrevUpper(*ptr)) - //(void) UpCase(text); - if (isSetpoint && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.CapRoIfLastLower && !Regex.IsMatch(afterRO, "[a-z]") && char.IsUpper(LastAlpha(beforeRO))) - { - //int indx = startLinkText - 1; - //int indx2 = endLinkText + 1; - //while (indx > 0 && !IsSpaceOrHardSpace(stepText[indx])) indx--; // find character before RO - //while (indx2 <= stepText.Length && !IsSpaceOrHardSpace(stepText[indx2])) indx2++; // find character after RO - - //if (indx >= 0 && char.IsUpper(stepText[indx]) && indx2 > GetLastLower(stepText)) - // doUpCase = true; - return UpperCaseUnits(rtnstr); - } - - // If a RO follows a "- " then it will be uppercased - if (isSetpoint && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.UpRoAftrDash && Regex.IsMatch(beforeRO, @".*\\u8209\?( |\\u160\?)$")) - { - //int indx = startLinkText - 1; - //while (indx > 0 && !IsSpaceOrHardSpace(stepText[indx])) indx--; // find character before RO - //string prefix = indx >= 7?stepText.Substring(indx-7,8):""; - //doUpCase = (prefix == @"\u8209? "); // Dash character before RO - return UpperCaseUnits(rtnstr); - } - - // Uppercase the RO Unit if the previous letter is uppercase - if (isSetpoint && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.UpRoIfPrevUpper && char.IsUpper(LastAlpha(beforeRO))) - { - return UpperCaseUnits(rtnstr); - } - - //CapFirstLetterInHighRO - Cap only the first letters of the units in a high level RO - // note: used in FLP (Turkey Point) format - if (isSetpoint && _MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.CapFirstLetterInHighRO && _MyItemInfo.IsHigh) - { - int idx = 0; - string tstr = ""; - while (idx < rtnstr.Length && !char.IsLetter(rtnstr[idx])) tstr += rtnstr[idx++].ToString(); - if (idx < rtnstr.Length) - { - tstr += char.ToUpper(rtnstr[idx]).ToString(); - if (idx + 1 < rtnstr.Length) - tstr += rtnstr.Substring(idx + 1); - } - rtnstr = tstr; - } - - //In a sequence of RO values, the unit appears with every value - //(e.g., "25 gpm and 30 gpm" vs. "25 and 30 gpm") - //if (!_MyItemInfo.ActiveFormat.PlantFormat.FormatData.ROData.AllUnits) - //{ - // int idx = rtnstr.LastIndexOf(' '); - // if (idx > 0) - // { - // StringBuilder sb = new StringBuilder(); - // string lastunit = rtnstr.Substring(idx); // RO unit including preceeding space - // int idx2 = rtnstr.IndexOf(lastunit); - // int si = 0; - // while (idx2 < idx) - // { - // sb.Append(rtnstr.Substring(si, idx2 - si)); - // si = idx2 + lastunit.Length; - // idx2 = rtnstr.IndexOf(lastunit, si); - // } - // sb.Append(rtnstr.Substring(si)); - // rtnstr = sb.ToString(); - // } - //} - - return rtnstr; - } - /// - /// Uppercase alphabetical strings excluding any RTF token - /// - /// - /// - private string MatchEvaluatorUppercaseROUnits(Match match) - { - if (match.Value[0] == '\\') // If the previous character is a backslash then this is an RTF token - return match.Value; - return match.Value.ToUpper(); - } - Regex _RegExUppercaseROUnits = new Regex("(^|[^a-zA-Z])[a-zA-Z]+"); - private string UpperCaseUnits(string rtnstr) - { - // Uppercase Units - rtnstr = _RegExUppercaseROUnits.Replace(rtnstr, new MatchEvaluator(MatchEvaluatorUppercaseROUnits)); - // After converting the value to uppercase, change X10 to x10 to handle Fortran Formatted numbers - return rtnstr.Replace("X10", "x10"); - } - - // Find the last Alphabetical character - private char LastAlpha(string beforeRO) - { - Match m = Regex.Match(beforeRO, ".*([a-zA-Z])[^a-zA-Z]*"); - if (m.Success) return m.Groups[1].ToString()[0]; - return '\0'; - } - - private int DoLinkElements(string text, int index, displayLinkElement vte) - { - // Find the 'end comment' for this 0 && (endTextIndx < 0 || endTextIndx > endTextIndx2)) - endTextIndx = endTextIndx2; - vte.Text = text.Substring(endStartTknIndx + 4, endTextIndx - endStartTknIndx - 4); // 4 for \v0 - - // Now get the link part. It can be terminated by a '\v0' or an [END> - int endLinkIndxV = text.IndexOf(@"\v0 ", linkIndx); - if (endLinkIndxV == -1) endLinkIndxV = text.IndexOf(@"\v0", linkIndx); // at end of string - int endLinkIndxE = text.IndexOf(@"[END>", linkIndx); - int endLinkIndx = (endLinkIndxV < endLinkIndxE) ? endLinkIndxV : endLinkIndxE; - vte.Link = text.Substring(linkIndx + 6, endLinkIndx - linkIndx - 6); // 6 for #Link: - - string tmptxt = null; - if (vte.Type != E_TextElementType.ReferencedObject) - { - tmptxt = FixTransition(vte.Link, vte.Text); - vte.Text = tmptxt; - } - //else - //{ - // tmptxt = DoROFormatFlags(vte.Text, text, index, endLinkIndx); - // vte.Text = tmptxt; - //} - - // Now get the entire text & link. Account for various ending possibilities: - // ends with '\v0\'; ends with '\v0 '; ends with '\v0' (end of string); - // ends with '[END>' if two in a row - will have ", endLinkIndx + 3); // get past end of link - int endComment = text.IndexOf(@"\v0", endToken); - - int rettoken = 0; - int retlen = 4; - if (endComment + 3 == text.Length) retlen = 3; - else if (text[endComment + 3] == '\\') retlen = 3; - vte.TextAndLink = text.Substring(index, endComment - index + retlen); - rettoken = endComment + retlen; - if (vte.Type != E_TextElementType.ReferencedObject) - { - if (vte.TextAndLink.Contains("(Resolved Transition Text)")) - vte.TextAndLink = vte.TextAndLink.Replace("(Resolved Transition Text)", tmptxt); - else - if (vte.Text != tmptxt) - vte.Text = tmptxt; - } - DisplayTextElementList.Add(vte); - return rettoken; - } - private int DoSymbol(string text, int startIndex, int index) - { - displayTextElement vte = new displayTextElement(); - vte.Type = E_TextElementType.Symbol; - // symbols are the unicode/rtf command. A symbol can be represented by \'xy or - // in the text from the database \uxyz?. If the \'xy is used the length of the - // symbol number will always be two, otherwise find the index of the '?' to - // find the end. - int endindx = -1; - if (text[index + 1] == '\'') endindx = index + 3; - else endindx = text.IndexOf("?", index); - vte.Text = text.Substring(index, endindx - index + 1); - DisplayTextElementList.Add(vte); - return endindx+1; - } - #endregion - #region ReplaceWords - #region commented out - //private string DoReplaceWords(string Text) - //{ - // ReplaceStrList rsl = _MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList; - // foreach (ReplaceStr rs in rsl) - // { - // if (_MyItemInfo.MyContent.Type < 20000) return Text; // for now only replace in steps. - // bool replaceit = false; - - // if (_MyItemInfo.ItemID == 2557) Console.WriteLine("here"); - // // note that the order of this check is important. Check in this order... - // // background here - // if (_MyItemInfo.IsHigh && (rs.Flag & E_ReplaceFlags.High)>0) replaceit = true; - // else if ((_MyItemInfo.IsTable || _MyItemInfo.IsFigure) && (rs.Flag & E_ReplaceFlags.Table) > 0) replaceit = true; - // else if (_MyItemInfo.IsInRNO && (rs.Flag & E_ReplaceFlags.RNO) > 0) replaceit = true; - // else if (_MyItemInfo.IsCaution && (rs.Flag & E_ReplaceFlags.Caution) > 0) replaceit = true; - // else if (_MyItemInfo.IsNote && (rs.Flag & E_ReplaceFlags.Note) > 0) replaceit = true; - // else if (_MyItemInfo.IsStepPart && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - // //else if (_MyItemInfo.IsInFirstLevelSubStep && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - // else if (_MyItemInfo.IsAccPages & (rs.Flag & E_ReplaceFlags.Attach) > 0) replaceit = true; - - // if (replaceit) - // { - // // CASEINSENS: Do ReplaceWords for all words that match, regardless of case, and replace - // // with the ReplaceWith string as is - // if ((rs.Flag & E_ReplaceFlags.CaseInsens) > 0) - // { - // //string res = ""; - // //string fortest = Text.ToUpper(); - // ////string pat = @"(?<=\W|^)" + rs.ReplaceWord.ToUpper() + @"(?=\W|$)"; - // //// jsj 07Jun2010 HardSpaces defeat replaceword logic - // //string pat = @"(?<=\W|^)(? 0) - // { - // // only in Maine Yankee - we don't need to do this one. - // } - // // CASEINSENSFIRST: Do ReplaceWords for all words that exactly match the ReplaceWord, - // // except the case where the first character may be different - // else if ((rs.Flag & E_ReplaceFlags.CaseInsensFirst) > 0) - // { - // // only used in V.C. Summer - we don't need to do this either. - // } - // else - // { - // // If there are Regex Control Characters '\[]()' prefix them with backslash - // string replaceWord = Regex.Replace(rs.ReplaceWord, @"[[\]\\()]", @"\$0"); - // //string pat = @"(?<=\W|^)" + replaceWord + @"(?=\W|$)"; - // // jsj 07Jun2010 HardSpaces defeat replaceword logic - // //string pat = @"(?<=\W|^)(? 0) replaceit = true; - // else if ((_MyItemInfo.IsTable || _MyItemInfo.IsFigure) && (rs.Flag & E_ReplaceFlags.Table) > 0) replaceit = true; - // else if (_MyItemInfo.IsInRNO && (rs.Flag & E_ReplaceFlags.RNO) > 0) replaceit = true; - // else if (_MyItemInfo.IsCaution && (rs.Flag & E_ReplaceFlags.Caution) > 0) replaceit = true; - // else if (_MyItemInfo.IsNote && (rs.Flag & E_ReplaceFlags.Note) > 0) replaceit = true; - // else if (_MyItemInfo.IsStepPart && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - // //else if (_MyItemInfo.IsInFirstLevelSubStep && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - // else if (_MyItemInfo.IsAccPages & (rs.Flag & E_ReplaceFlags.Attach) > 0) replaceit = true; - - // if (replaceit) - // { - // // CASEINSENS: Do ReplaceWords for all words that match, regardless of case, and replace with the ReplaceWith string as is - // RegexOptions myOptions = (rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase : RegexOptions.None; - // string replaceWord = Regex.Replace(rs.ReplaceWord, @"[[\]\\()]", @"\$0"); - // string pat = @"(?<=\W|^)(? dicReplaceRegex = new Dictionary(); - private string DoReplaceWords2(string Text) - { - if (_MyItemInfo.MyContent.Type < 20000) return Text; // for now only replace in steps. - FoundMatches myMatches = new FoundMatches(Text); - // Exclude Link Text from Replace Word process - myMatches.AddLink(regFindLink, _MyFormat.PlantFormat.FormatData.SectData.ReplaceWordsInROs, _MyItemInfo.MyProcedure.MyDocVersion); - ReplaceStrList rsl = _MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList; - - // The only way to get an 'empty' list is to have one 'dummy' replacestr, i.e. that has ReplaceWord as an empty string. If the - // ReplaceStrData xml node is empty, it does the inheritance and gets the 'base' format's list. - if (rsl.Count==1 && (rsl[0].ReplaceWord == null || rsl[0].ReplaceWord == "")) return Text; - // Loop through text looking for words to be replaced - foreach (ReplaceStr rs in rsl) - { - bool replaceit = false; - // note that the order of this check is important. Check in this order... - // background here - if (_MyItemInfo.IsHigh && (rs.Flag & E_ReplaceFlags.High) > 0) replaceit = true; - else if ((_MyItemInfo.IsTable || _MyItemInfo.IsFigure) && (rs.Flag & E_ReplaceFlags.Table) > 0) replaceit = true; - else if (_MyItemInfo.IsInRNO && (rs.Flag & E_ReplaceFlags.RNO) > 0) replaceit = true; - else if (_MyItemInfo.IsCaution && (rs.Flag & E_ReplaceFlags.Caution) > 0) replaceit = true; - else if (_MyItemInfo.IsNote && (rs.Flag & E_ReplaceFlags.Note) > 0) replaceit = true; - else if (_MyItemInfo.IsStepPart && !_MyItemInfo.IsHigh && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - //else if (_MyItemInfo.IsInFirstLevelSubStep && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - else if (_MyItemInfo.IsAccPages & (rs.Flag & E_ReplaceFlags.Attach) > 0) replaceit = true; - - if (replaceit) - { - if (!dicReplaceRegex.ContainsKey(rs)) - { - // CASEINSENS: Do ReplaceWords for all words that match, regardless of case, and replace with the ReplaceWith string as is - //RegexOptions myOptions = (rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase & RegexOptions.Singleline : RegexOptions.None & RegexOptions.Singleline; - RegexOptions myOptions = (rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase: RegexOptions.None; - string replaceWord = Regex.Replace(rs.ReplaceWord, @"[[\]\\()]", @"\$0"); - // if first or last character in replaceword is a non-word character, for example, ',', ')', or '.', - // don't use the \W, i.e. don't bother to look for a non-word character. - string wordMatchBeg = Regex.IsMatch(replaceWord.Substring(0, 1), @"\W") ? "" : @"(?<=\W|^)"; - string wordMatchEnd = Regex.IsMatch(replaceWord.Substring(replaceWord.Length - 1, 1), @"\W") ? "" : @"(?=\W|$)"; - string pat = wordMatchBeg + @"(?", RegexOptions.Singleline); - private string ReplaceWord(string text, string replace, string with, RegexOptions regexOptions) - { - MatchCollection myMatches = Regex.Matches(text, replace, regexOptions); - MatchCollection myLinks = regFindLink.Matches(text); - for (int i = myMatches.Count - 1; i >= 0; i--) - { - Match myMatch = myMatches[i]; - if (!PartOfLinkText(myMatch, myLinks)) - text = text.Substring(0, myMatch.Index) + with + text.Substring(myMatch.Index + myMatch.Length); - } - return text; - } - - private bool PartOfLinkText(Match myMatch, MatchCollection myLinks) - { - foreach (Match myLink in myLinks) - if (myMatch.Index > myLink.Index && myMatch.Index < (myLink.Index + myLink.Length)) - return true; - return false; - } - #endregion - #endregion - } - #region displayTextElementClass - public enum E_TextElementType : uint - { - Text = 0, - Transition = 1, - TransitionRange = 2, - ReferencedObject = 3, - Symbol = 4 - }; - public class displayTextElement - { - private E_TextElementType _Type; - public E_TextElementType Type - { - get { return _Type; } - set { _Type = value; } - } - protected string _Text; - virtual public string Text - { - get { return _Text; } - set { _Text = value; } - } - } - public class displayLinkElement : displayTextElement - { - private string _Link; - public string Link - { - get { return _Link; } - set { _Link = value; } - } - private string _TextAndLink; - public string TextAndLink - { - get { return _TextAndLink; } - set { _TextAndLink = value; } - } - /// - /// Text - this should parse the text and return the results - /// - override public string Text - { - get - { - if (_TextAndLink != null) - { - Match m = Regex.Match(_TextAndLink, @""); - return m.Groups[3].ToString(); - } - return _Text; - } - set - { - if (_TextAndLink != null) - { - Match m = Regex.Match(_TextAndLink, @""); - System.Text.RegularExpressions.Group g = m.Groups[3]; - _TextAndLink = _TextAndLink.Substring(0, g.Index) + value + _TextAndLink.Substring(g.Index + g.Length); - } - _Text = value; - } - } - } - #endregion - public class FoundMatches : SortedList - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private string _Text; - public FoundMatches(string text) - : base() - { - _Text = text; - } - public void Add(Regex myRegEx, ReplaceStr myWord) - { - MatchCollection myMatches = myRegEx.Matches(_Text); - foreach (Match myMatch in myMatches) - Add(myMatch, myWord); - } - public void AddLink(Regex myRegEx, bool replaceWordsInROs, DocVersionInfo myDocVersion) - { - MatchCollection myMatches = myRegEx.Matches(_Text); - foreach (Match myMatch in myMatches) - { - if (!replaceWordsInROs || IsTransition(myMatch.Value) || IsSetpointRO(myMatch.Value, myDocVersion)) - Add(myMatch, null);// Exclude from Replace Words - } - } - private bool IsTransition(string link) - { - return link.Contains("#Link:Transition"); - } - private static Regex regRefObj = new Regex(@"\#Link\:ReferencedObject:([0-9]*) ([0-9a-zA-Z]*) ([0-9]*)", RegexOptions.Singleline); - private static bool IsSetpointRO(string link, DocVersionInfo myDocVersion) - { - Match myMatch = regRefObj.Match(link); - if (myMatch.Success) - { - int dbid = System.Convert.ToInt32(myMatch.Groups[2].Value.Substring(0, 4), 16); - int rodbid = int.Parse(myMatch.Groups[3].Value); - ROFstInfo myROFst = myDocVersion.GetROFst(rodbid); - return myROFst.IsSetpointDB(dbid); - } - return false; - } - public void Add(Match myMatch, ReplaceStr myWord) - { - // If one already exists for this location, then don't add another. - if (ContainsKey(myMatch.Index)) return; - // Start by Adding it. - base.Add(myMatch.Index, new FoundMatch(myMatch, myWord)); - // Now see what I can do with it. - int index = this.IndexOfKey(myMatch.Index); - if (index > 0) // If this match is contained within the previous match remove it - { - FoundMatch previousMatch = Values[index - 1]; - if (previousMatch.MyMatch.Index + previousMatch.MyMatch.Length > myMatch.Index) - Remove(myMatch.Index); - } // If the next match is contained within this match, remove the next match - while (index < Count - 1 && Values[index + 1].MyMatch.Index < (myMatch.Index + myMatch.Length)) - Remove(Values[index + 1].MyMatch.Index); - } - public string ReplaceMatches() - { - int offset = 0; - string text = _Text; - foreach (FoundMatch foundMatch in Values) - { - if (foundMatch.MyWord != null) - { - if (VerifyNoHardSpace(text, foundMatch, offset)) - { - if(offset != 0 || foundMatch.MyMatch.Index != 0 || !foundMatch.MyWord.ReplaceWith.StartsWith("{\\par}")) - { - text = text.Substring(0, offset + foundMatch.MyMatch.Index) + foundMatch.MyWord.ReplaceWith + text.Substring(offset + foundMatch.MyMatch.Index + foundMatch.MyMatch.Length); - offset += foundMatch.MyWord.ReplaceWith.Length - foundMatch.MyMatch.Length; - } - } - } - } - return text; - } - - private bool VerifyNoHardSpace(string text, FoundMatch foundMatch, int offset) - { - string begin = text.Substring(0, offset + foundMatch.MyMatch.Index); - string end = text.Substring(offset + foundMatch.MyMatch.Index + foundMatch.MyMatch.Length); - if (text.StartsWith(@"{\rtf")) - { - // make sure that it is not preceded by \u160? \'a0 or \~ - if(Regex.IsMatch(begin,@"(\\(u160\?|'a0|~)(\\f[0-9]* ?)*(\\fs[0-9]* ?)*)$")) - return false; - // make sure that it is not followed by \u160? \'a0 or \~ - if(Regex.IsMatch(end,@"^((\\f[0-9]* ?)*(\\fs[0-9]* ?)*\\(u160\?|'a0|~))")) - return false; - } - return true; - } - } - public class FoundMatch - { - private Match _MyMatch; - public Match MyMatch - { - get { return _MyMatch; } - set { _MyMatch = value; } - } - private ReplaceStr _MyWord; - public ReplaceStr MyWord - { - get { return _MyWord; } - set { _MyWord = value; } - } - public FoundMatch(Match myMatch, ReplaceStr myWord) - { - _MyMatch = myMatch; - _MyWord = myWord; - } - } - -} diff --git a/PROMS/Volian.Controls.Library/EditItem.cs.bak b/PROMS/Volian.Controls.Library/EditItem.cs.bak deleted file mode 100644 index 0132fcb4..00000000 --- a/PROMS/Volian.Controls.Library/EditItem.cs.bak +++ /dev/null @@ -1,2394 +0,0 @@ -using System; -using System.ComponentModel; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using System.Drawing; -using System.Windows.Forms; -using System.Text.RegularExpressions; -using VEPROMS.CSLA.Library; -using Volian.Base.Library; - -namespace Volian.Controls.Library -{ - #region Enums - public enum ChildRelation : int - { - None = 0, - After = 1, - Before = 2, - RNO = 3 - } - public enum E_ChangeBarPosition : int - { - Left = 0, - Right = 1 - } - #endregion - public abstract partial class EditItem : UserControl - { - #region EditItemUnique - //private static int _EditItemUnique = 0; - //private static int EditItemUnique - //{ - // get - // { - // if (_EditItemUnique == 3) - // Console.WriteLine("here"); - // return ++_EditItemUnique; - // } - //} - //private int _MyEditItemUnique = EditItemUnique; - - //public int MyEditItemUnique - //{ - // get {return _MyEditItemUnique; } - //} - #endregion - #region Constructor - public EditItem() - { - InitializeComponent(); - } - - public EditItem(IContainer container) - { - container.Add(this); - InitializeComponent(); - } - #endregion - #region Properties - private bool _RTBLastFocus = true; - public bool RTBLastFocus - { - get { return _RTBLastFocus; } - set { _RTBLastFocus = value; } - } - protected static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - protected ChildRelation _MyChildRelation; - public ChildRelation MyChildRelation - { - get { return _MyChildRelation; } - set { _MyChildRelation = value; } - } - protected bool _Loading = true; - protected EditItem _MyParentEditItem = null; - protected EditItem _MySectionRTBItem; - protected EditItem _MyPreviousEditItem = null; - protected EditItem _MyNextEditItem = null; - private bool _ChildrenLoaded = false; - public bool HasChildren - { - get { return _MyBeforeEditItems != null || _MyRNOEditItems != null || _MyAfterEditItems != null; } - } - internal List _MyBeforeEditItems; - public List MyBeforeEditItems - { - get { return _MyBeforeEditItems; } - set { _MyBeforeEditItems = value; } - } - internal List _MyAfterEditItems; - public List MyAfterEditItems - { - get { return _MyAfterEditItems; } - set { _MyAfterEditItems = value; } - } - internal List _MyRNOEditItems; - public List MyRNOEditItems - { - get { return _MyRNOEditItems; } - set { _MyRNOEditItems = value; } - } - private StepSectionLayoutData _MyStepSectionLayoutData; - public StepSectionLayoutData MyStepSectionLayoutData - { - get { return _MyStepSectionLayoutData; } - set { _MyStepSectionLayoutData = value; } - } - private StepData _MyStepData; - public StepData MyStepData - { - get { return _MyStepData; } - set { _MyStepData = value; } - } - private ItemInfo _MyItemInfo; - private int _ExpandPrefix = 0; - public int ExpandPrefix - { - get { return _ExpandPrefix; } - set { _ExpandPrefix = value; } - } - private int _ExpandSuffix = 0; - public int ExpandSuffix - { - get { return _ExpandSuffix; } - set { _ExpandSuffix = value; } - } - private bool _Colapsing = false; - /// - /// Gets or sets colapsing - /// - public bool Colapsing - { - get { return _Colapsing; } - set { _Colapsing = value; } - } - private bool _Moving = false; - private int _RNOLevel = 0; - private int _SeqLevel = 0; - private int _ContentType; - public int ContentType - { - get { return _ContentType; } - set { _ContentType = value; } - } - private bool _Circle = false; - private bool _CheckOff = false; - private bool _UserCheckOff = false; - private bool _ChangeBar = false; - private StepPanel _MyStepPanel; - public StepPanel MyStepPanel - { - get { return _MyStepPanel; } - set { _MyStepPanel = value; } - } - /// - /// This returns the section or procedure for the current item. - /// If the item is a step or section, it returns the section - /// If it is a procedure, it returns the procedure - /// - public EditItem MySectionRTBItem - { - get - { - if (_MySectionRTBItem == null) - { - if (MyItemInfo.IsSection || MyItemInfo.IsProcedure) _MySectionRTBItem = (RTBItem)this; - else _MySectionRTBItem = _MyParentEditItem.MySectionRTBItem; - } - return _MySectionRTBItem; - } - set { _MySectionRTBItem = value; } - } - /// - /// Gets or Sets ItemInfo - /// - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - set - { - _MyItemInfo = value; - if (VlnSettings.StepTypeToolType) SetToolTip(_MyItemInfo.ToolTip); - ChangeBar = _MyItemInfo.HasChangeBar; - CheckOff co = _MyItemInfo.GetCheckOffStep(); - if (co != null && co.UIMark != null) - { - UserCheckOff = true; - UserCheckOffChar = (char)co.UIMark; - } - // Deal with changes in content data - value.MyContent.Changed += new ContentInfoEvent(MyContent_Changed); - value.MyProcedure.MyContent.Changed += new ContentInfoEvent(MyContent_Changed); - // Deal with change in item data - value.Changed += new ItemInfoEvent(value_Changed); - value.OrdinalChanged += new ItemInfoEvent(value_OrdinalChanged); - } - } - void value_Changed(object sender) - { - ChangeBar = _MyItemInfo.HasChangeBar; - } - protected void MyContent_Changed(object sender) - { - // Update the text to reflect the content change - MyItemInfo.RefreshItemAnnotations(); - ChangeBar = MyItemInfo.HasChangeBar; - CheckOff co = _MyItemInfo.GetCheckOffStep(); - if (co != null && co.UIMark != null) - { - UserCheckOff = true; - UserCheckOffChar = (char)co.UIMark; - } - else - UserCheckOff = false; - RefreshContent(); - - // see if change in subsections to be displayed, i.e. if the user made a change to editable data - // on the section properties form, we may have to display steps or remove steps. By design, - // steps are the first children from a section. Also, this will only occur if the format has - // metasections AND there are subsections. - if (MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections - && MyItemInfo.Sections != null && MyItemInfo.Sections.Count > 0) - { - // find out what the editable flag is to determine if change. - bool showSteps = MyItemInfo.MyConfig is SectionConfig && (MyItemInfo.MyConfig as SectionConfig).SubSection_Edit == "Y"; - if (showSteps && _MyAfterEditItems != null && _MyAfterEditItems.Count > 0 && _MyAfterEditItems[0].MyItemInfo.IsSection) - { - // need to add steps in, i.e. they do not exist in step editor yet. - _MyAfterEditItems[0].AddSiblingBeforeNoDataSave(MyItemInfo.Steps, false); - } - else if (!showSteps && _MyAfterEditItems != null && _MyAfterEditItems.Count > 0 && _MyAfterEditItems[0].MyItemInfo.IsStep) - { - // Remove steps - only want sections. Put in a list for removal. - List remEIs = new List(); - foreach (EditItem ei in _MyAfterEditItems) - { - if (!ei.MyItemInfo.IsSection) remEIs.Add(ei); - } - foreach (EditItem ei1 in remEIs) - { - ei1.RemoveItemWithoutDelete(); - } - remEIs.Clear(); - } - } - } - void value_OrdinalChanged(object sender) - { - RefreshOrdinal(); - } - public EditItem ActiveParent - { - get { return _MyParentEditItem != null ? _MyParentEditItem : _MyPreviousEditItem.ActiveParent; } - } - /// - /// Return the Parent EditItem - /// - private EditItem UpOneEditItem - { - get - { - EditItem tmp = this; - while (tmp != null && tmp.MyParentEditItem == null) tmp = tmp.MyPreviousEditItem; - if (tmp != null) return tmp.MyParentEditItem; - return null; - } - } - private Stack _LastMethods = new Stack(); - //private string _LastMethod = ""; - internal void LastMethodsPush(string str) - { - if(MyStepPanel != null)MyStepPanel._LastAdjust = str; - _LastMethods.Push(str); - } - internal string LastMethodsPop() - { - //MyStepPanel._LastAdjust = ""; - return _LastMethods.Pop(); - } - internal bool LastMethodsEmpty - { - get { return _LastMethods.Count == 0; } - } - /// - /// This should find the item that precedes the current item vertically - /// and then return the Bottom of that item. - /// - /// - internal int FindTop(int bottom) - { - int lastBottomPrev = bottom; // This is necessary if the value of bottom can be negative. - if (_MyPreviousEditItem != null) - lastBottomPrev = _MyPreviousEditItem.BottomMostEditItem.Bottom; - int? bottomRNO = BottomOfParentRNO(); - if (lastBottomPrev > bottom) bottom = (int)(lastBottomPrev); // RHM 20090615 ES02 Step8 - // Moving from Step 8 to the Note preceeding step 8 caused the step 9 to be positioned in the wrong place. - //if (lastBottomParent > bottom) bottom = lastBottomParent; - //if (bottomRNO == null) return bottom; - return (int)max(bottomRNO, bottom); - } - /// - /// The Top of the EditItem - /// - public int ItemTop - { - get { return Top; } - set - { - MyStepPanel.ItemMoving++; - Top = value; - MyStepPanel.ItemMoving--; - } - } - private E_ChangeBarPosition _ChangeBarPosition = E_ChangeBarPosition.Right; - public E_ChangeBarPosition ChangeBarPosition - { - get { return _ChangeBarPosition; } - set { _ChangeBarPosition = value; } - } - /// - /// Sets the next item and adjusts the location, - /// This also sets the previous for the "next" item - /// which adjusts other locations. - /// - public EditItem MyNextEditItem - { - get { return _MyNextEditItem; } - set - { - _MyNextEditItem = value; - if (_MyNextEditItem != null) - { - if (_MyNextEditItem.MyPreviousEditItem != this) - { - _MyNextEditItem.MyPreviousEditItem = this; - MyNextEditItem.Location = new Point(Left, Bottom); - } - } - } - } - /// - /// returns the TopMostChild - /// - public EditItem TopMostEditItem - { - get - { - if (Expanded && _MyBeforeEditItems != null) return _MyBeforeEditItems[0].TopMostEditItem; - return this; - } - } - /// - /// Returns the bottom location (Top + Height) - /// - public new int Bottom - { - get - { - return Top + (Hidden ? 0 : Height); - } - } - private bool _Hidden = false; - public bool Hidden - { - get { return _Hidden; } - set { _Hidden = value; Visible = !value; } - } - /// - /// Bottom most child - /// - public EditItem BottomMostEditItem - { - get - { - EditItem tmpr = null; // BottomMost RNO - //int rnoOffset = 0; - if ((MyExpandingStatus != ExpandingStatus.No || Expanded) && _MyRNOEditItems != null) - { - //rnoOffset = this.Top - _MyRNOEditItems[0].Top; - tmpr = _MyRNOEditItems[_MyRNOEditItems.Count - 1].BottomMostEditItem; - } - EditItem tmpa = this; // BottomMost After - if ((MyExpandingStatus != ExpandingStatus.No || Expanded) & _MyAfterEditItems != null) - tmpa = _MyAfterEditItems[_MyAfterEditItems.Count - 1].BottomMostEditItem; - // return the bottom most of the two results - if (tmpr == null) - return tmpa; - //if (rnoOffset > 0) - //Console.WriteLine("RNO Bottom Offset {0}", rnoOffset); - //if (tmpa.Bottom >= (tmpr.Bottom + rnoOffset)) - if (tmpa.Bottom >= (tmpr.Bottom)) - return tmpa; - return tmpr; - } - } - /// - /// Bottom most child excluding RNOs - /// - public EditItem BottomMostEditItemNoRNOs - { - get - { - EditItem tmpa = this; // BottomMost After - if ((MyExpandingStatus != ExpandingStatus.No || Expanded) & _MyAfterEditItems != null) - tmpa = _MyAfterEditItems[_MyAfterEditItems.Count - 1].BottomMostEditItem; - // return the bottom most - return tmpa; - } - } - /// - /// First sibling - /// - private EditItem FirstSiblingEditItem - { - get - { - EditItem tmp = this; - while (tmp.MyPreviousEditItem != null) - tmp = tmp.MyPreviousEditItem; - return tmp; - } - } - /// - /// Last sibling - /// - private EditItem LastSiblingEditItem - { - get - { - EditItem tmp = this; - while (tmp.MyNextEditItem != null) - tmp = tmp.MyNextEditItem; - return tmp; - } - } - private ExpandingStatus _MyExpandingStatus = ExpandingStatus.No; - /// - /// Sets or Gets expanding status - /// - public ExpandingStatus MyExpandingStatus - { - get { return _MyExpandingStatus; } - set { _MyExpandingStatus = value; } - } - /// - /// Gets the ItemID from the ItemInfo - /// - public int MyID - { - get { return _MyItemInfo == null ? 0 : _MyItemInfo.ItemID; } - } - /// - /// Tracks when a EditItem is moving - /// - public bool Moving - { - get { return _Moving; } - set { _Moving = value; } - } - /// - /// The RNO (Contingency) Level - /// - public int RNOLevel - { - get { return _RNOLevel; } - set { _RNOLevel = value; } - } - /// - /// Sequential Level - Only counts levels of Sequential substeps - /// - public int SeqLevel - { - get { return _SeqLevel; } - set { _SeqLevel = value; } - } - // TODO: This should be changed to get the Circle format from the data - /// - /// Show a circle or not - /// - public bool Circle - { - get { return _Circle; } - set { _Circle = value; } - } - // TODO: This should be changed to get the Checkoff status from the data - /// - /// Has a check-off or not - /// - public bool CheckOff - { - get { return _CheckOff; } - set { _CheckOff = value; } - } - public bool UserCheckOff - { - get { return _UserCheckOff; } - set { _UserCheckOff = value; } - } - private char _UserCheckOffChar; - public char UserCheckOffChar - { - get { return _UserCheckOffChar; } - set { _UserCheckOffChar = value; } - } - // TODO: This should be changed to get the ChangeBar status from the data - /// - /// Has a changebar or not - /// - public bool ChangeBar - { - get { return _ChangeBar; } - set - { - _ChangeBar = value; - this.Invalidate(); - } - } - #endregion // Properties - #region AddItem - /// - /// Adds an item to a list - /// - /// Parent Container - /// EditItem List - public void AddItem(EditItem parentEditItem, ref List siblingEditItems, EditItem nextEditItem, bool addFirstChld) - { - if (siblingEditItems == null) // Create a list of siblings - { - siblingEditItems = new List(); - siblingEditItems.Add(this); - MyParentEditItem = parentEditItem; - } - else // Add to the existing list - { - // add first child, when there are other children already there. This is used - // for metasection editable data changed from off to on so that the first step is located - // in the editor correctly, i.e. right below the section & above the subsections. - if (addFirstChld) - { - EditItem parent = siblingEditItems[0].MyParentEditItem; - siblingEditItems.Insert(0, this); - MyStepPanel.ItemMoving++; - _MyNextEditItem = siblingEditItems[1]; - _MyNextEditItem._MyPreviousEditItem = this; - MyPreviousEditItem = null; - _MyNextEditItem.MyParentEditItem = null; - MyParentEditItem = parent; - MyStepPanel.ItemMoving--; - } - else if (nextEditItem == null) // Add to the end of the list - { - EditItem lastChild = LastChild(siblingEditItems); - siblingEditItems.Add(this); - MyPreviousEditItem = lastChild; - } - else // Add to the middle of the list before a particular item - { - EditItem prevChild = nextEditItem.MyPreviousEditItem; - EditItem parent = nextEditItem.MyParentEditItem; - siblingEditItems.Insert(siblingEditItems.IndexOf(nextEditItem), this); - MyStepPanel.ItemMoving++; - _MyNextEditItem = nextEditItem; - nextEditItem._MyPreviousEditItem = this; - MyPreviousEditItem = prevChild;// If a previous exists - this will adjust the location and width of the EditItem - nextEditItem.MyParentEditItem = null; - MyParentEditItem = parent; // If a parent exists - this will adjust the location and width of the EditItem - //nextEditItem.MyPreviousEditItem = this; - MyStepPanel.ItemMoving--; - } - } - if (MyItemInfo.IsCaution || MyItemInfo.IsNote) - { - EditItem prev = this; - while (prev.MyPreviousEditItem != null) prev = prev.MyPreviousEditItem; - prev.SetAllTabs(); - } - else - SetAllTabs(); - } - // clear tabs, clears then all so that next 'get' will calculate new. - public void SetAllTabs() - { - RefreshTab(); - - if (_MyAfterEditItems != null) foreach (EditItem chld in _MyAfterEditItems) chld.SetAllTabs(); - if (_MyNextEditItem != null) _MyNextEditItem.SetAllTabs(); - // Update the RNO tab if it exists - RHM 20100106 - if (_MyRNOEditItems != null) foreach (EditItem chld in _MyRNOEditItems) chld.SetAllTabs(); - } - /// - /// Add the next item to a list - /// - /// - /// - /// - //public EditItem AddNext(ItemInfo myItemInfo, bool expand) - //{ - // EditItem tmp = new EditItem(myItemInfo, MyStepPanel, MyParentEditItem, ChildRelation.None, expand); - // MyNextEditItem = tmp; - // return tmp; - //} - #endregion - #region RemoveItem - protected void ShowTops(string title) - { - int TopMostY = TopMostEditItem.Top; - int? TopMostParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.TopMostEditItem.Top)); - int? ParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.Top)); - //Console.Write("{0}: TopMostY={1}, TopMostParentY={2}, ParentY = {3}",title, TopMostY, TopMostParentY, ParentY); - Console.Write("{0}{1},{2},{3}", title, TopMostY, TopMostParentY.ToString() ?? "null", ParentY.ToString() ?? "null"); - } - private bool _BeingRemoved = false; - public bool BeingRemoved - { - get { return _BeingRemoved; } - set { _BeingRemoved = value; } - } - public void RemoveItemWithoutDelete() - { - BeingRemoved = true; - int TopMostYBefore = TopMostEditItem.Top; - MyStepPanel._LookupEditItems.Remove(MyID); - EditItem newFocus = null; - int? TopMostParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.TopMostEditItem.Top)); - int? ParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.Top)); - RemoveFromParentsChildList(); - if (MyNextEditItem != null) - { - if (MyPreviousEditItem != null) - { - MyNextEditItem.MyPreviousEditItem = MyPreviousEditItem; - MyPreviousEditItem = null; - newFocus = MyNextEditItem; - } - else - { - MyNextEditItem.MyParentEditItem = MyParentEditItem; - MyParentEditItem = null; - MyNextEditItem.MyPreviousEditItem = null; - newFocus = MyNextEditItem; - } - // Adjust the vertical locations of all of the items below the item deleted - MyNextEditItem.TopMostEditItem.AdjustLocation(); - MyNextEditItem = null; - } - else if (MyPreviousEditItem != null) - { - MyPreviousEditItem.MyNextEditItem = null; - newFocus = MyPreviousEditItem.BottomMostEditItem; - MyPreviousEditItem = null; - } - else - { - newFocus = MyParentEditItem; - MyParentEditItem = null; - } - Dispose(); - if (newFocus != null) - { - newFocus.SetFocus(); - newFocus.SetAllTabs(); - newFocus.AdjustLocation(); - } - } - public void RemoveItem() - { - //Volian.Base.Library.VlnTimer _MyTimer = new VlnTimer(); - BeingRemoved = true; - MyStepPanel.SelectedEditItem = null; // Unselect the item to be deleted - //ShowTops("\r\n"); - int TopMostYBefore = TopMostEditItem.Top; - //_MyTimer.ActiveProcess = "DeleteItem"; - EditItem newFocus = DeleteItem(); - if (newFocus == null) return; - //_MyTimer.ActiveProcess = "SetFocus"; - newFocus.SetFocus(); - //_MyTimer.ActiveProcess = "Dispose"; - Dispose(); - //_MyTimer.ActiveProcess = "SetAllTabs"; - newFocus.SetAllTabs(); - //_MyTimer.ActiveProcess = "TopMostYAfter"; - int TopMostYAfter = newFocus.TopMostEditItem.Top; - if (TopMostYAfter > TopMostYBefore) - newFocus.TopMostEditItem.Top = TopMostYBefore; - //_MyTimer.ActiveProcess = "AdjustLocation"; - newFocus.AdjustLocation(); - //newFocus.ShowTops(""); - //_MyTimer.ShowElapsedTimes("RemoveItem"); - } - public EditItem DeleteItem() - { - //Volian.Base.Library.VlnTimer _MyTimer = new VlnTimer(); - //_MyTimer.ActiveProcess = "_LookupEditItems.Remove"; - MyStepPanel._LookupEditItems.Remove(MyID); - EditItem newFocus = null; - int? TopMostParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.TopMostEditItem.Top)); - int? ParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.Top)); - try - { - //_MyTimer.ActiveProcess = "DeleteItemAndChildren"; - Item.DeleteItemAndChildren(MyItemInfo); - } - catch (System.Data.SqlClient.SqlException ex) - { - HandleSqlExceptionOnDelete(ex); - return null; - } - // Remove EditItems - //_MyTimer.ActiveProcess = "RemoveFromParentsChildList"; - RemoveFromParentsChildList(); - //_MyTimer.ActiveProcess = "MyNextEditItem"; - if (MyNextEditItem != null) - { - if (MyPreviousEditItem != null) - { - MyNextEditItem.MyPreviousEditItem = MyPreviousEditItem; - MyPreviousEditItem = null; - newFocus = MyNextEditItem; - } - else - { - MyNextEditItem.MyParentEditItem = MyParentEditItem; - MyParentEditItem = null; - MyNextEditItem.MyPreviousEditItem = null; - newFocus = MyNextEditItem; - } - // Adjust the vertical locations of all of the items below the item deleted - MyNextEditItem.TopMostEditItem.AdjustLocation(); - MyNextEditItem = null; - } - else if (MyPreviousEditItem != null) - { - MyPreviousEditItem.MyNextEditItem = null; - //newFocus = MyPreviousEditItem.BottomMostEditItem; - // bug fix - when deleting an edit window in the AER, position to the bottom most in the AER - was jumping to RNO - newFocus = MyPreviousEditItem.BottomMostEditItemNoRNOs; - MyPreviousEditItem = null; - //Console.Write(",\"Previous\","); - } - else - { - newFocus = MyParentEditItem; - MyParentEditItem = null; - //Console.Write(",\"Parent\","); - } - //_MyTimer.ShowElapsedTimes("DeleteItem"); - return newFocus; - } - - private void HandleSqlExceptionOnDelete(System.Data.SqlClient.SqlException ex) - { - if (ex.Message.Contains("has External Transitions and has no next step")) - { - using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitions(MyID)) - { - DialogResult ans = MessageBox.Show("Transitions exist to this step and cannot be adjusted automatically." + - "\r\n\r\nDo you want to be placed on the " + (exTrans.Count > 1 ? "first " : "") + "substep with the problem Transition?" + - "\r\n\r\nSubsteps with Problem Transitions" + - exTrans.Summarize(), - "Cannot Delete This Step", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (ans == DialogResult.Yes) - { - MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(exTrans[0].MyContent.ContentItems[0]); - - } - else - SetFocus(); - } - } - else if (ex.Message.Contains("has External Transitions to it's children")) - { - using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(MyID)) - { - DialogResult ans = MessageBox.Show("Transitions exist to substeps of this step and cannot be adjusted automatically." + - "\r\n\r\nDo you want to be placed on the " + (exTrans.Count > 1 ? "first " : "") + "substep with the problem Transition?" + - "\r\n\r\nSubsteps with Problem Transitions:" + - exTrans.Summarize(), - "Cannot Delete This Step", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (ans == DialogResult.Yes) - { - MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(exTrans[0].MyContent.ContentItems[0]); - } - } - } - else - MessageBox.Show(ex.Message, "SQL Exception", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - } - private void RemoveFromParentsChildList() - { - EditItem top = this; - while (top.MyPreviousEditItem != null) top = top.MyPreviousEditItem; - EditItem parentEditItem = top.MyParentEditItem; - if (parentEditItem == null) return; // No parent, nothing to remove. - if (parentEditItem.MyAfterEditItems != null && parentEditItem.MyAfterEditItems.Contains(this)) - { - parentEditItem.MyAfterEditItems.Remove(this); - if (parentEditItem.MyAfterEditItems.Count == 0) - parentEditItem.MyAfterEditItems = null; - } - else if (parentEditItem.MyBeforeEditItems != null && parentEditItem.MyBeforeEditItems.Contains(this)) - { - parentEditItem.MyBeforeEditItems.Remove(this); - if (parentEditItem.MyBeforeEditItems.Count == 0) - parentEditItem.MyBeforeEditItems = null; - } - else if (parentEditItem.MyRNOEditItems != null && parentEditItem.MyRNOEditItems.Contains(this)) - { - parentEditItem.MyRNOEditItems.Remove(this); - if (parentEditItem.MyRNOEditItems.Count == 0) - parentEditItem.MyRNOEditItems = null; - } - if (parentEditItem.MyAfterEditItems == null && parentEditItem.MyBeforeEditItems == null && parentEditItem.MyRNOEditItems == null) - parentEditItem.CanExpand = false; - } - //private void ShowSiblings(string title) - //{ - // Console.WriteLine("---{0} {1}---",title,MyID); - // EditItem top = this; - // while (top.MyPreviousEditItem != null) top = top.MyPreviousEditItem; - // do - // { - // Console.WriteLine("{0} EditItem - {1} {2}", top.MyID == MyID ? "*" : " ", top.MyID, top.MyItemInfo.MyContent.Text); - // top = top.MyNextEditItem; - // } while (top != null); - //} - #endregion - #region Add Children - /// - /// Add a child before (Notes, Cautions, etc.) - /// - /// - /// - public void AddChildBefore(ItemInfo myItemInfo, bool expand) - { - EditItem child = new RTBItem(myItemInfo, MyStepPanel, this, ChildRelation.Before, expand); - } - /// - /// Add a list of children before - /// - /// - /// - public void AddChildBefore(ItemInfoList myItemInfoList, bool expand) - { - if (myItemInfoList != null) - foreach (ItemInfo item in myItemInfoList) - AddChildBefore(item, expand); - } - public EditItem AddChildBefore(ItemInfoList myItemInfoList, EditItem nextEditItem) - { - EditItem child = null; - if (myItemInfoList != null) - foreach (ItemInfo item in myItemInfoList) - child = AddChildBefore(item, nextEditItem); - return child; - } - /// - /// Add an RNO (Contingency) child - /// - /// - /// - public void AddChildRNO(ItemInfo myItemInfo, bool expand) - { - EditItem child = new RTBItem(myItemInfo, MyStepPanel, this, ChildRelation.RNO, expand); - } - /// - /// Add a list of RNO (Contingency) children - /// - /// - /// - public void AddChildRNO(ItemInfoList myItemInfoList, bool expand) - { - if (myItemInfoList != null) - foreach (ItemInfo item in myItemInfoList) - AddChildRNO(item, expand); - } - /// - /// Add a child after - /// - /// - /// - public EditItem AddChildAfter(ItemInfo MyItemInfo, bool expand, bool addFirstChld) - { - EditItem child = null; - //if (MyItemInfo.MyContent.ContentGridCount != 0) - if (MyItemInfo.MyContent.MyGrid != null) - child = new GridItem(MyItemInfo, MyStepPanel, this, ChildRelation.After, expand); - else - child = new RTBItem(MyItemInfo, MyStepPanel, this, ChildRelation.After, expand, addFirstChld); - return child; - } - public EditItem AddChildAfter(ItemInfo MyItemInfo, EditItem nextEditItem) - { - EditItem child = null; - //if (MyItemInfo.MyContent.ContentGridCount != 0) - if (MyItemInfo.MyContent.MyGrid != null) - child = new GridItem(MyItemInfo, MyStepPanel, this, ChildRelation.After, true, nextEditItem); - else - child = new RTBItem(MyItemInfo, MyStepPanel, this, ChildRelation.After, true, nextEditItem); - return child; - } - public EditItem AddChildBefore(ItemInfo MyItemInfo, EditItem nextEditItem) - { - EditItem child = null; - //if (MyItemInfo.MyContent.ContentGridCount != 0) - if(MyItemInfo.MyContent.MyGrid != null) - child = new GridItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem); - else - child = new RTBItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem); - return child; - } - public EditItem AddChildRNO(ItemInfo MyItemInfo, EditItem nextEditItem) - { - // not sure about this, i.e. whether a grid can be added here. - EditItem child = null; - //if (MyItemInfo.MyContent.ContentGridCount != 0) - if (MyItemInfo.MyContent.MyGrid != null) - child = new GridItem(MyItemInfo, MyStepPanel, this, ChildRelation.RNO, true, nextEditItem); - else - child = new RTBItem(MyItemInfo, MyStepPanel, this, ChildRelation.RNO, true, nextEditItem); - return child; - } - /// - /// Adds a sibling after the current EditItem - /// - public void AddSiblingAfter() - { - AddSiblingAfter("", true); - } - public void AddSiblingAfter(string text, bool updateStatus) - { - SaveContents(); - ItemInfo newItemInfo = MyItemInfo.InsertSiblingAfter(text); - DoAddSiblingAfter(newItemInfo, updateStatus); - } - public void AddSiblingAfter(int? type, bool updateStatus) - { - SaveContents(); - ItemInfo newItemInfo = MyItemInfo.InsertSiblingAfter("", "", type); - DoAddSiblingAfter(newItemInfo, updateStatus); - } - private void DoAddSiblingAfter(ItemInfo newItemInfo, bool updateStatus) - { - EditItem newEditItem = null; - switch (_MyChildRelation) - { - case ChildRelation.After: - newEditItem = ActiveParent.AddChildAfter(newItemInfo, MyNextEditItem); - break; - case ChildRelation.Before: - newEditItem = ActiveParent.AddChildBefore(newItemInfo, MyNextEditItem); - break; - case ChildRelation.RNO: - newEditItem = ActiveParent.AddChildRNO(newItemInfo, MyNextEditItem); - break; - default: // Need debug - break; - } - //EditItem newEditItem = ActiveParent.AddChildAfter(newItemInfo, ); - if (updateStatus) - MyStepPanel.SelectedEditItem = newEditItem;//Update Screen - } - protected static int _WatchThis = 1; - public void AddSiblingBefore() - { - AddSiblingBefore("", true); - } - public void AddSiblingBefore(string text, bool updateSelection) - { - // Save RTB text before creating a new item because the process of creating - // a new item will save a change to iteminfo excluding text changes. This - // shouldn't be necessary for adding sibling after because the current step - // doesn't get saved during the insert after because of the MyPrevious field - // is only set on an insert before, which is what saves the item without - // any updates from the richtextbox text. - SaveContents(); - ItemInfo newItemInfo = MyItemInfo.InsertSiblingBefore(text); - EditItem newEditItem = null; - switch (_MyChildRelation) - { - case ChildRelation.After: - newEditItem = ActiveParent.AddChildAfter(newItemInfo, this); - break; - case ChildRelation.Before: - newEditItem = ActiveParent.AddChildBefore(newItemInfo, this); - break; - case ChildRelation.RNO: - newEditItem = ActiveParent.AddChildRNO(newItemInfo, this); - break; - default: // Need debug - break; - } - if (updateSelection) - MyStepPanel.SelectedEditItem = newEditItem;//Update Screen - } - public void AddSiblingBeforeNoDataSave(ItemInfo newItemInfo, bool updateSelection, EditItem tt) - { - EditItem newEditItem = null; - newEditItem = ActiveParent.AddChildBefore(newItemInfo, this); - //switch (_MyChildRelation) - //{ - // case ChildRelation.After: - // newEditItem = ActiveParent.AddChildAfter(newItemInfo, this); - // break; - // case ChildRelation.Before: - // newEditItem = ActiveParent.AddChildBefore(newItemInfo, this); - // break; - // case ChildRelation.RNO: - // newEditItem = ActiveParent.AddChildRNO(newItemInfo, this); - // break; - // default: // Need debug - // break; - //} - if (updateSelection) - MyStepPanel.SelectedEditItem = newEditItem;//Update Screen - } - private bool specialAdd = false; - public void AddSiblingBeforeNoDataSave(ItemInfoList newItemInfos, bool updateSelection) - { - specialAdd = true; - EditItem newEditItem = null; - newEditItem = ActiveParent.AddChildAfter(newItemInfos, false, true); - if (updateSelection) - MyStepPanel.SelectedEditItem = newEditItem;//Update Screen - specialAdd = false; - } - public void AddChild(E_FromType fromType, int type) - { - AddChild("", fromType, type, null); - } - public void AddChild(E_FromType fromType, int type, VlnFlexGrid vfGrid) - { - AddChild("", fromType, type, vfGrid); - } - public void AddChild(string text, E_FromType fromType, int type, VlnFlexGrid vfGrid) - { - if (_MyItemInfo.IsHigh || _MyItemInfo.IsSection) - CanExpand = true; - this.Expanded = true; - _WatchThis = 1; - ItemInfo newItemInfo = MyItemInfo.InsertChild(fromType, type, text); - if (vfGrid != null) - { - string xml = vfGrid.GetXMLData(); - using (Item itm = newItemInfo.Get()) - { - itm.MyContent.MyGrid.Data = xml; - itm.Save(); - // newItemInfo.MyContent.MyGrid.ResetContent(itm.MyContent.MyGrid); // Do I need this? - } - } - // TODO: We need to determine where this will go in the stack of children - EditItem nextItem = GetNextItem(fromType, newItemInfo); - // TODO: May need similar logic if a Table is being added to a step that has substeps - // else if (fromType == E_FromType.Table && ((ItemInfo)newItemInfo.ActiveParent).Steps != null - //&& ((ItemInfo)newItemInfo.ActiveParent).Steps.Count > 0) - // nextItem = MyStepPanel.FindItem(((ItemInfo)newItemInfo.ActiveParent).Steps[0]); - EditItem newEditItem; - switch (fromType) - { - case E_FromType.Caution: - newEditItem = this.AddChildBefore(newItemInfo, nextItem); - break; - case E_FromType.Note: - newEditItem = this.AddChildBefore(newItemInfo, nextItem); - break; - case E_FromType.Procedure: - newEditItem = this.AddChildAfter(newItemInfo, nextItem); - break; - case E_FromType.RNO: - newEditItem = this.AddChildRNO(newItemInfo, nextItem); - break; - case E_FromType.Section: - newEditItem = this.AddChildAfter(newItemInfo, nextItem); - break; - case E_FromType.Step: - newEditItem = this.AddChildAfter(newItemInfo, nextItem); - break; - case E_FromType.Table: - newEditItem = this.AddChildAfter(newItemInfo, nextItem); - break; - default: - newEditItem = this.AddChildAfter(newItemInfo, nextItem); - break; - } - MyStepPanel.SelectedEditItem = newEditItem;//Update Screen - } - public EditItem GetNextItem(E_FromType fromType, ItemInfo newItemInfo) - { - EditItem nextItem = null; - if (newItemInfo.NextItem != null) - nextItem = MyStepPanel.FindItem(newItemInfo.NextItem); - else if (fromType == E_FromType.Table && MyAfterEditItems != null) - nextItem = MyAfterEditItems[0]; - // Cautions come before notes, so if this is a Caution and there are Notes, put this first - else if (fromType == E_FromType.Caution && ((ItemInfo)newItemInfo.ActiveParent).Notes != null - && ((ItemInfo)newItemInfo.ActiveParent).Notes.Count > 0) - nextItem = MyStepPanel.FindItem(((ItemInfo)newItemInfo.ActiveParent).Notes[0]); - return nextItem; - } - /// - /// Add a list of children after - /// - /// - /// - public EditItem AddChildAfter(ItemInfoList myItemInfoList, bool expand, bool addFirstChld) - { - EditItem child = null; - int indx = 0; - if (myItemInfoList != null) - foreach (ItemInfo item in myItemInfoList) - { - if (addFirstChld) - { - // the first time add it as first child, the rest should be done in between. - child = AddChildAfter(item, expand, addFirstChld); - addFirstChld = false; - } - else - child = AddChildAfter(item, this._MyAfterEditItems[indx]); - indx++; - } - return child; - } - public EditItem AddChildAfter(ItemInfoList myItemInfoList, bool expand) - { - EditItem child = null; - if (myItemInfoList != null) - foreach (ItemInfo item in myItemInfoList) - child = AddChildAfter(item, expand, false); - return child; - } - public EditItem AddChildAfter(ItemInfoList myItemInfoList, EditItem nextEditItem) - { - EditItem child = null; - if (myItemInfoList != null) - foreach (ItemInfo item in myItemInfoList) - child = AddChildAfter(item, nextEditItem); - return child; - } - #endregion - #region CopyPaste - public void PasteSiblingBefore(int copyStartID) - { - ItemInfo newItemInfo = MyItemInfo.PasteSiblingBefore(copyStartID); - EditItem newEditItem = null; - switch (_MyChildRelation) - { - case ChildRelation.After: - newEditItem = ActiveParent.AddChildAfter(newItemInfo, this); - break; - case ChildRelation.Before: - newEditItem = ActiveParent.AddChildBefore(newItemInfo, this); - break; - case ChildRelation.RNO: - newEditItem = ActiveParent.AddChildRNO(newItemInfo, this); - break; - default: // Need debug - break; - } - if (newEditItem != null) MyStepPanel.SelectedEditItem = newEditItem;//Update Screen - MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.Before, newItemInfo.MyContent.Type)); - - } - public void PasteSiblingAfter(int copyStartID) - { - ItemInfo newItemInfo = MyItemInfo.PasteSiblingAfter(copyStartID); - EditItem newEditItem = null; - switch (_MyChildRelation) - { - case ChildRelation.After: - newEditItem = ActiveParent.AddChildAfter(newItemInfo, MyNextEditItem); - break; - case ChildRelation.Before: - newEditItem = ActiveParent.AddChildBefore(newItemInfo, MyNextEditItem); - break; - case ChildRelation.RNO: - newEditItem = ActiveParent.AddChildRNO(newItemInfo, MyNextEditItem); - break; - default: // Need debug - break; - } - MyStepPanel.SelectedEditItem = newEditItem;//Update Screen - MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.After, newItemInfo.MyContent.Type)); - - } - public EditItem PasteReplace(int copyStartID) - { - // To allow a Paste Step into an empty (new) step/substep, we need to add a character to the the Text field - // to simulate replacing an existing step - otherwise we will get null references. - if (MyStepPanel.SelectedEditItem.Empty) - MyStepPanel.SelectedEditItem.Empty=false; - MyStepPanel.SelectedEditItem = null; // Unselect the item to be deleted - ChildRelation childRelation = _MyChildRelation; - EditItem newFocus = null; - EditItem nextEditItem = MyNextEditItem; - EditItem prevEditItem = MyPreviousEditItem; - EditItem parentEditItem = ActiveParent; - - int TopMostYBefore = TopMostEditItem.Top; - int? TopMostParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.TopMostEditItem.Top)); - int? ParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.Top)); - ItemInfo newItemInfo = null; - try - { - newItemInfo = Item.PasteReplace(MyItemInfo, copyStartID); - } - catch (System.Data.SqlClient.SqlException ex) - { - HandleSqlExceptionOnDelete(ex); - return this; - } - // Remove the EditItem that was the replaced item. - RemoveFromParentsChildList(); - - if (MyNextEditItem != null) - { - if (MyPreviousEditItem != null) - { - MyNextEditItem.MyPreviousEditItem = MyPreviousEditItem; - MyPreviousEditItem = null; - } - else - { - MyNextEditItem.MyParentEditItem = MyParentEditItem; - MyParentEditItem = null; - MyNextEditItem.MyPreviousEditItem = null; - } - MyNextEditItem = null; - } - else if (MyPreviousEditItem != null) - { - MyPreviousEditItem.MyNextEditItem = null; - newFocus = MyPreviousEditItem; - MyPreviousEditItem = null; - } - else - { - newFocus = MyParentEditItem; - MyParentEditItem = null; - } - - // add copied item to ui where the replaced item was. - EditItem newEditItem = null; - switch (childRelation) - { - case ChildRelation.After: - newEditItem = parentEditItem.AddChildAfter(newItemInfo, nextEditItem); - break; - case ChildRelation.Before: - newEditItem = parentEditItem.AddChildBefore(newItemInfo, nextEditItem); - break; - case ChildRelation.RNO: - newEditItem = parentEditItem.AddChildRNO(newItemInfo, nextEditItem); - break; - default: // Need debug - break; - } - MyStepPanel.SelectedEditItem = newEditItem; //Update Screen - MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.Replace, newItemInfo.MyContent.Type)); - return newEditItem; - } - public void IdentifyChildren(bool highlight) - { - // Highlight children of EditItem: - if (MyAfterEditItems != null) - { - foreach (EditItem sia in MyAfterEditItems) - { - sia.IdentifyMe(highlight); - sia.IdentifyChildren(highlight); - } - } - if (MyBeforeEditItems != null) - { - foreach (EditItem sib in MyBeforeEditItems) - { - sib.IdentifyMe(highlight); - sib.IdentifyChildren(highlight); - } - } - if (MyRNOEditItems != null) - { - foreach (EditItem sir in MyRNOEditItems) - { - sir.IdentifyMe(highlight); - sir.IdentifyChildren(highlight); - } - } - } - #endregion - #region Event Handlers - private string WatchThisIndent - { - get { return "".PadLeft(_WatchThis, '\t'); } - } - protected bool RNOBelow - { - get - { - if (_MyRNOEditItems != null) - { - return _MyRNOEditItems[0].RNOLevel > _MyItemInfo.ColumnMode; - //return _MyRNOEditItems[0].Left == Left; - } - return false; - } - } - protected bool RNORight - { - get - { - if (_MyRNOEditItems != null) - { - return _MyRNOEditItems[0].RNOLevel <= _MyItemInfo.ColumnMode; - //return _MyRNOEditItems[0].Left != Left; - } - return false; - } - } - protected void MoveRNO() - { - if (_MyRNOEditItems != null) - { - if (_MyRNOEditItems[0].TopMostEditItem.Top != Top) - { - //if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("\r\n'Adjust RNO',{0},'Move',{1}", MyID, _RNO[0].MyID); - EditItem rnoTop = _MyRNOEditItems[0].TopMostEditItem; - if (rnoTop.RNOLevel <= _MyItemInfo.ColumnMode) - { - //EditItem tmpBottom = this; - //if (_MyAfterEditItems != null) tmpBottom = _MyAfterEditItems[_MyAfterEditItems.Count - 1].BottomMostEditItem; - MyStepPanel.ItemMoving++; - rnoTop.LastMethodsPush(string.Format("EditItem_Move RNO Right {0}", rnoTop.MyID)); - //rnoTop.Top = tmpBottom.Bottom; - rnoTop.Top = Top; - rnoTop.LastMethodsPop(); - MyStepPanel.ItemMoving--; - } - else - { - MyStepPanel.ItemMoving++; - rnoTop.LastMethodsPush(string.Format("EditItem_Move RNO Below {0} {1} {2}", rnoTop.MyID, BottomMostEditItemNoRNOs.MyID, BottomMostEditItemNoRNOs.Bottom)); - rnoTop.Top = BottomMostEditItemNoRNOs.Bottom; - rnoTop.LastMethodsPop(); - MyStepPanel.ItemMoving--; - } - } - } - } - private bool _TryAgainLater = false; - public bool TryAgainLater - { - get { return _TryAgainLater; } - set { _TryAgainLater = value; } - } - /// - /// Handles movement of the EditItems - /// - /// - /// - private void EditItem_Move(object sender, EventArgs e) - { - int watchThis = _WatchThis; - //if (MyID == 136) - //{ - // vlnStackTrace.ShowStack("{0} Move TO {1}", MyID, Top); - // //vlnStackTrace.ShowStack("{0} Move TO {1} - {2}, BottomMost {3}", MyID, Top, MyPath, BottomMostRTBItem.MyPath); - // //Console.WriteLine("{0} Move TO {1} - {2}, BottomMost {3}", MyID, Top, MyPath, BottomMostRTBItem.MyPath); - //} - //if (MyID > _StartingID) - // Console.WriteLine("{0}--------------- {1} Top = {2} Bottom {3}", WatchThisIndent, MyID, Top, Bottom); - if (MyStepPanel.ItemMoving == 0 && !TryAgainLater) - { - //vlnStackTrace.ScrollInStack(); - return; // If 0 - Indicates scrolling which requires no action. - } - TryAgainLater = false; - //ShowMe("Move"); - if (MyItemInfo == null) - return; - //if (_WatchThis > 0 && MyID > _StartingID) - //{ - - // Console.WriteLine("{0}Start Move {1},{2}", WatchThisIndent, MyID, this); - // if (MyID == _LookForID) - // Console.WriteLine("{0}---------------", WatchThisIndent,MyID, this); - // _WatchThis++; - //} - if (MyExpandingStatus == ExpandingStatus.Expanding) - { - _WatchThis = watchThis; - return; - } - Moving = true; - EditItem tmp = (EditItem)sender; - if (tmp.MyPreviousEditItem == null && tmp.MyParentEditItem == null) - { - _WatchThis = watchThis; - return; - } - if (RNOBelow) // Adjust substeps first - { - //Console.WriteLine("RNOBelow"); - AdjustLocation(); - MoveRNO(); - } - else // Adjust RNO First - { - if (RNORight) - { - //Console.WriteLine("RNORight"); - MoveRNO(); - } - AdjustLocation(); - } - Moving = false; - EditItem btm = BottomMostEditItem; - if (this != btm) - btm.AdjustLocation(); - //if (_WatchThis > 0 && MyID > _StartingID) - //{ - // Console.WriteLine("{0}Finish Move {1},{2}",WatchThisIndent, MyID, this); - //} - _WatchThis = watchThis; - } - /// - /// Adjust the locations when the EditItem is resized - /// - /// - /// - private void EditItem_Resize(object sender, EventArgs e) - { - if (MyItemInfo == null) return; - if (_IgnoreResize) return; - AdjustLocation(); - HandleResize(); - - } - #endregion // Event Handlers - #region Private and Protected Methods - /// - /// Calculates the table location - /// - /// - /// - /// - /// - protected Point TableLocation(EditItem myParentEditItem, StepSectionLayoutData myStepSectionLayoutData, int width) - { - // Should center on parent unless it is a centered table in the AER column - int center = myParentEditItem.ContentLeft + myParentEditItem.ContentWidth / 2; - int rightLimit = myParentEditItem.Right; - // Then should center on the wid Limit - if (MyItemInfo.FormatStepData.Type.Contains("AER") == false && MyItemInfo.RNOLevel == 0) - { - int colR = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColRTable, MyItemInfo.ColumnMode); - - rightLimit += colR * MyItemInfo.ColumnMode; - center += (colR * MyItemInfo.ColumnMode) / 2; - center -= (myParentEditItem.ContentLeft - (int)MyItemInfo.MyDocStyle.Layout.LeftMargin) / 2; - } - - // Calulate the x location - //int x = myParentEditItem.TextLeft; - int x = center - width / 2; - if (x + width > rightLimit) x = rightLimit - width; - int colT = MyStepPanel.ToDisplay((int)myStepSectionLayoutData.ColT); - if (x < colT) x = colT; - int y = FindTop(myParentEditItem.Bottom); - return new Point(x, y); - } - protected void DoMouseWheel(MouseEventArgs e) - { - MyStepPanel.MouseWheel(e); - } - protected void InsertPgBrk() - { - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.btnInsPgBrk_Click(this, new EventArgs()); - } - protected void OpenAnnotations() - { - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.btnAnnots_Click(this, new EventArgs()); - } - protected bool CheckClipboard() - { - return (MyStepPanel.MyStepTabPanel.MyDisplayTabControl.MyCopyStep != null); - } - protected void CopyStep() - { - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.DoCopyStep(); - } - /// - /// Finds the last child in a list - /// - /// - /// - private static EditItem LastChild(List childEditItems) - { - return childEditItems[childEditItems.Count - 1]; - } - /// - /// If the selected EditItem is within the window leave it as it is. - /// If not, scroll so that the selected window is centered. - /// - protected void ScrollToCenter() - { - //vlnStackTrace.ShowStack("CenterScroll {0} Current {1} Top {2} Bottom {3} Limit {4}", _MyItem.ItemID, _Panel.VerticalScroll.Value, Top, Bottom, _Panel.Height);// Show StackTrace - //Console.WriteLine("CenterScroll {0} Current {1} Top {2} Bottom {3} Limit {4}", _MyItem.ItemID, _Panel.VerticalScroll.Value, Top, Bottom, _Panel.Height); - if (Top >= 0 && Bottom <= MyStepPanel.Height) return;// Don't move if within screen. - int scrollValue = MyStepPanel.VerticalScroll.Value + (Top - (MyStepPanel.Height / 2)); // calculate scroll center for the item - //Console.WriteLine("CenterScroll {0} Current {1} New {2} Min {3} Max {4}", _MyItem.ItemID, _Panel.VerticalScroll.Value, scrollValue, _Panel.VerticalScroll.Minimum, _Panel.VerticalScroll.Maximum); - if (scrollValue >= MyStepPanel.VerticalScroll.Minimum && scrollValue <= MyStepPanel.VerticalScroll.Maximum) // If it is within range - MyStepPanel.VerticalScroll.Value = scrollValue; // Center the item - } - - /// - /// Hide a Items Children - Part of colapsing - /// - protected void HideChildren() - { - HideChildren(_MyBeforeEditItems); - HideChildren(_MyRNOEditItems); - HideChildren(_MyAfterEditItems); - } - /// - /// Hide a list of children - Part of colapsing - /// - /// - private void HideChildren(List childEditItems) - { - if (childEditItems != null) - { - foreach (EditItem child in childEditItems) - { - if (child.Expanded) child.HideChildren(); - child.Hidden = true; - } - } - } - /// - /// Unhide an items Children - Part of expanding - /// - /// - protected void UnhideChildren(bool expand) - { - UnhideChildren(_MyBeforeEditItems, expand); - UnhideChildren(_MyRNOEditItems, expand); - UnhideChildren(_MyAfterEditItems, expand); - MatchExpanded(); - - } - /// - /// Unhide a list of children - part of expanding - /// - /// - /// - private void UnhideChildren(List childEditItems, bool expand) - { - if (childEditItems != null) - { - foreach (EditItem child in childEditItems) - { - if (child.Expanded) - child.UnhideChildren(expand); - else if (expand) - child.Expand(expand); - child.Hidden = false; - } - } - } - /// - /// Move children as necessary - /// - protected void AdjustChildren() - { - AdjustChildren(_MyBeforeEditItems); - AdjustChildren(_MyRNOEditItems); - AdjustChildren(_MyAfterEditItems); - } - /// - /// Move a list of children - /// - /// - private void AdjustChildren(List childEditItems) - { - if (childEditItems != null) - { - foreach (EditItem child in childEditItems) - { - child.AdjustLocation(); - if (child.Expanded) child.AdjustChildren(); - } - } - } - /// - /// Expand a list of children - /// - /// - private void ExpandChildren(List childEditItems) - { - if (childEditItems != null) - { - foreach (EditItem child in childEditItems) - { - if (child.CanExpand) - { - child.Expand(true); - } - child.Hidden = false; - } - } - } - /// - /// Expand children - /// - private void ExpandChildren() - { - // Walk though Children performing Expand - ExpandChildren(_MyBeforeEditItems); - ExpandChildren(_MyRNOEditItems); - ExpandChildren(_MyAfterEditItems); - } - private string MyPath - { - get - { - if (MyItemInfo.MyContent.Type >= 20000) - return MyItemInfo.Path.Substring(MyItemInfo.ActiveSection.Path.Length); - return MyItemInfo.MyContent.ToString(); - } - } - private EditItem AEREditItem - { - get - { - if (RNOLevel == 0) return null; - if (MyParentEditItem != null) - { - if (MyParentEditItem.RNOLevel < RNOLevel) - return MyParentEditItem; - else - return MyParentEditItem.AEREditItem; - } - else if (MyPreviousEditItem != null) - { - return MyPreviousEditItem.AEREditItem; - } - //Volian.Base.Library.vlnStackTrace.ShowStackLocal("'AEREditItem',{0},{1}", MyID, MyItemInfo.DBSequence); - return null; - } - } - /// - /// Adjust the Location of all items below the current item. - /// - internal void AdjustLocation() - { - //Console.WriteLine("'AdjustLocation',{0},{1},'{2}'", MyID, MyItemInfo.DBSequence, Volian.Base.Library.vlnStackTrace.CalledFrom4); - if (RNORight) MoveRNO(); // This is needed when an AER is Deleted that has an RNO. - if (RNOLevel > 0 && AEREditItem != null) - AEREditItem.AdjustLocation(); - EditItem nextEditItem = NextDownEditItem; - //if (MyID == 2138) - // Console.WriteLine("2138"); - //if (_WatchThis > 0 && MyID > _StartingID) - //if((nextEditItem == null ? 0 : nextEditItem.MyID) == MyID) - //if(_LookForID.Contains(MyID)) - // Console.WriteLine("{0}AdjustLocation {1},{2},{3} -> {4},{5} ({6}) {7}", WatchThisIndent, MyID, MyItemInfo.Ordinal, MyPath, - // nextEditItem == null ? 0 : nextEditItem.MyID, nextEditItem == null ? 0 : nextEditItem.MyItemInfo.Ordinal, nextEditItem == null ? "Null" : nextEditItem.MyPath, - // _NextDownEditItemPath); - //if (_WatchThis && MyID == 2119) - // Console.WriteLine("I'm here"); - //if (MyID > 2120) - // Console.WriteLine("{0}\t{1}", MyID, nextEditItem == null ? 0 : nextEditItem.MyID); - if (nextEditItem != null) - { - //int bottom = BottomMostEditItem.Bottom; - if (nextEditItem != null) - { - //if (MyID == 2123) - // _LookForID = 2123; - int bottom = nextEditItem.FindTop(Bottom); - if (nextEditItem.Top != bottom) - // if (nextEditItem != null && !nextEditItem.Moving && nextEditItem.Top != bottom) - { - MyStepPanel.ItemMoving++; - nextEditItem.LastMethodsPush(string.Format("AdjustLocation {0}", MyID)); - nextEditItem._NextDownEditItemPath = _NextDownEditItemPath; - nextEditItem.Top = bottom; - // We found that the 64 Bit version of windows did not always set the Top correctly. - // We also found that if we could simply watch for the next time that it was set, we - // could set the Flag "TryAgainLater" the change would propogate the changes through its - // children and siblings. - if (nextEditItem.Top != bottom) - { - nextEditItem.TryAgainLater = true; - _MyLog.InfoFormat("Setting nextEditItem.Top = bottom for ID {0}, ({1}) did not work, TryAgainLater", nextEditItem.MyID, nextEditItem.MyItemInfo.SearchPath); - } - nextEditItem.LastMethodsPop(); - MyStepPanel.ItemMoving--; - } - } - else - { - Console.WriteLine("{0}** No Adjustment next = {1}, moving = {2}", WatchThisIndent, nextEditItem, nextEditItem == null ? false : nextEditItem.Moving); - } - } - } - /// - /// Automatically expands Steps if not currently expanded - /// - internal void AutoExpand() - { - if (CanExpand && Expanded == false)// TODO: May need to do some additional checking for subsections - { - //vlnStackTrace.ShowStack(">AutoExpand ID {0} - Can {1} Expanded {2}", _MyItem.ItemID, CanExpand, Expanded); - Expand(_ContentType >= 20000); - //Console.WriteLine(" - /// Expand an item and it's children - /// If the children have been loaded then just expand them - /// If not, load the children and expand their children etc. - /// - /// normally equal to _Type > = 20000 (Step) - public void Expand(bool expand) - { - //// TIMING: DisplayItem.TimeIt("Expand Start"); - if (_ChildrenLoaded) - { - // Unhide Children - MyExpandingStatus = ExpandingStatus.Showing; - UnhideChildren(expand); - if (ExpandPrefix != 0) - { - MyStepPanel.ItemMoving++; - TopMostEditItem.Top = Top; - MyStepPanel.ItemMoving--; - } - else - TopMostEditItem.AdjustLocation(); - AdjustChildren(); - //if(_Before != null ) - // Top = _Before[_Before.Count - 1].BottomMost.Bottom; - } - else - { - MyExpandingStatus = ExpandingStatus.Expanding; - _ChildrenLoaded = true; - //_Panel.SuspendLayout(); - AddChildBefore(MyItemInfo.Cautions, expand); - AddChildBefore(MyItemInfo.Notes, expand); - AddChildAfter(MyItemInfo.Procedures, expand); - if (MyItemInfo.ItemID == 317) Console.WriteLine("EditItem: id = {0}, ColumnMode = {1}", MyItemInfo.MyItemInfoUnique, MyItemInfo.ColumnMode); - if (MyItemInfo.RNOs != null && MyItemInfo.RNOLevel < MyItemInfo.ColumnMode) - AddChildRNO(MyItemInfo.RNOs, expand); - AddChildAfter(MyItemInfo.Tables, expand); - // get the config item for the steps section. there is an 'editable' - // flag used in metasections to define whether the steps should print. - // this flag can be toggle on the section's properties dialog. - // Only check the flag if the section has subsections because the - // default for the flag is not editable, and this would make non-metasections - // not editable. - bool hasMetaSubs = MyItemInfo.IsSection && MyItemInfo.Sections != null && MyItemInfo.Sections.Count>0; - bool EditSteps = !hasMetaSubs || (MyItemInfo.MyConfig is SectionConfig && (MyItemInfo.MyConfig as SectionConfig).SubSection_Edit == "Y"); - if (EditSteps) AddChildAfter(MyItemInfo.Steps, expand); - - if (MyItemInfo.RNOs != null && MyItemInfo.RNOLevel >= MyItemInfo.ColumnMode) - AddChildRNO(MyItemInfo.RNOs, expand); - AddChildAfter(MyItemInfo.Sections, expand); - MatchExpanded(); - } - MyExpandingStatus = ExpandingStatus.Done; - BottomMostEditItem.AdjustLocation(); - MyExpandingStatus = ExpandingStatus.No; - //// TIMING: DisplayItem.TimeIt("Expand End"); - } - public EditItem BeforeItem - { - get - { - if (_MyAfterEditItems != null) - { - foreach (EditItem EditItem in _MyAfterEditItems) - { - if (EditItem._MyBeforeEditItems != null) - return EditItem.TopMostEditItem; - EditItem beforeItem = EditItem.BeforeItem; - if (beforeItem != null) return beforeItem; - } - } - return null; - } - } - public EditItem ItemAbove - { - get - { - if (_MyChildRelation == ChildRelation.Before) return _MyParentEditItem.ItemAbove; - if (_MyPreviousEditItem != null) return _MyPreviousEditItem.BottomMostEditItem; - if (_MyChildRelation == ChildRelation.After) return _MyParentEditItem; - if (_MyChildRelation == ChildRelation.RNO) return _MyParentEditItem; - return null; - } - } - private static int? max(int? value1, int value2) - { - if (value1 == null || value2 > value1) return value2; - return value1; - } - private static int min(int value1, int value2) - { - if (value2 < value1) return value2; - return value1; - } - public int FindRight() - { - if (!RNORight) return Right; - return _MyRNOEditItems[0].FindRight(); - } - public int? BottomOfParentRNO() - { - int? bottom = null; - EditItem EditItem = this; - if (!MyItemInfo.IsTablePart) - { - if (EditItem._MyChildRelation == ChildRelation.None) - return null; - if (EditItem._MyChildRelation == ChildRelation.After && !RNORight) - return null; - } - while (EditItem != null && EditItem._MyChildRelation != ChildRelation.None && EditItem._MyChildRelation != ChildRelation.After) - EditItem = EditItem.UpOneEditItem; - if (EditItem == null || EditItem._MyChildRelation == ChildRelation.None) - return null; - EditItem parent = EditItem.UpOneEditItem; - int right = FindRight(); - bool centeredTable = (MyItemInfo.IsTablePart && MyItemInfo.FormatStepData.Type.Contains("AER") == false && MyItemInfo.RNOLevel == 0); - while (parent != null && parent.MyItemInfo.IsSection == false && parent._MyChildRelation != ChildRelation.Before) - { - if (parent._MyRNOEditItems != null) - { - if (centeredTable || right > parent._MyRNOEditItems[0].Left) - { - if (parent._MyRNOEditItems[0].BottomMostEditItem.RNOLevel > RNOLevel && RNOLevel < _MyItemInfo.ColumnMode) - bottom = max(bottom, parent._MyRNOEditItems[0].BottomMostEditItem.Bottom); - } - } - parent = parent.UpOneEditItem; - } - return bottom; - } - private string _NextDownEditItemPath = "None"; - /// - /// This finds the next EditItem down. - /// - public EditItem NextDownEditItem - { - get - { - EditItem EditItem = this; - _NextDownEditItemPath = "Path 1"; - // If this item appears before it's parent, and it doesn't have anything below it, return the parent - if (MyNextEditItem == null && MyAfterEditItems == null && FirstSiblingEditItem._MyChildRelation == ChildRelation.Before) - return UpOneEditItem; - _NextDownEditItemPath = "Path 2"; - if (Expanded && _MyAfterEditItems != null)// check to see if there is a _After - return MyAfterEditItems[0].TopMostEditItem;// if there is, go that way - _NextDownEditItemPath = "Path 3"; - if (Expanded && MyRNOEditItems != null && MyItemInfo.RNOLevel >= MyItemInfo.ColumnMode)// check to see if there is a _After - return MyRNOEditItems[0].TopMostEditItem;// if there is, go that way - while (EditItem != null && EditItem.MyNextEditItem == null) // if no Next walk up the parent path - { - bool lastWasRNO = (EditItem._MyChildRelation == ChildRelation.RNO); - EditItem = EditItem.UpOneEditItem; - _NextDownEditItemPath = "Path 4"; - if (EditItem == null) // No Parent - return null; - _NextDownEditItemPath = string.Format("Path 5 {0}, {1}", EditItem.MyExpandingStatus, EditItem.Moving); - if (EditItem.MyExpandingStatus == ExpandingStatus.Expanding || EditItem.Moving) // Parent Expanding or Moving - Wait - return null; - _NextDownEditItemPath = "Path 5 RNO"; - if (EditItem.RNOBelow && !Ancestor(EditItem.MyRNOEditItems[0])) - return EditItem.MyRNOEditItems[0]; - _NextDownEditItemPath = "Path 6"; - if (EditItem.MyNextEditItem == null && EditItem.FirstSiblingEditItem._MyChildRelation == ChildRelation.Before) - return EditItem.UpOneEditItem; - EditItem btm = EditItem.BottomMostEditItem; // Find the Bottom EditItem of this ancestor - EditItem beforeItem = EditItem.BeforeItem; - if (lastWasRNO && beforeItem != null) - { - _NextDownEditItemPath = "Path 7"; - if (beforeItem.ItemAbove.Bottom > this.Bottom) return null; - _NextDownEditItemPath = "Path 8"; - return beforeItem; - } - if (this != btm) // If this is not the bottom, then just adjust things with respect to the bottom - { - EditItem btmNext = btm.NextDownEditItem; - //if (EditItem.MyNextEditItem != null && EditItem.MyNextEditItem.TopMostEditItem.Top != btm.Bottom) - if (btmNext != null) - { - int bottom = btmNext.FindTop(btm.Bottom); - if (btmNext.Top != bottom) - { - MyStepPanel.ItemMoving++; - //EditItem.MyNextEditItem.TopMostEditItem.Top = btm.Bottom; - //Console.WriteLine("{0}***Move in NextDownEditItem {1},{2} From {3} To {4}",WatchThisIndent, btmNext.MyID, btmNext, btmNext.Top, btm.Bottom); - btmNext.LastMethodsPush(string.Format("NextDownEditItem {0} {1}", MyID, EditItem.MyID)); - //ShowMe(string.Format("FindTop = {0}", btmNext.FindTop(btm.Bottom))); - btmNext.Top = bottom; - btmNext.LastMethodsPop(); - MyStepPanel.ItemMoving--; - } - } - _NextDownEditItemPath = string.Format("Path 9 {0}", btm); - return null; // Not the bottom - don't adjust anything else - } - //else - //{ - //} - } - if (EditItem != null) - { - // Need to verify that the bottom of the parents RNO does not excede the bottom of this item. - EditItem next = EditItem.MyNextEditItem.TopMostEditItem; - _NextDownEditItemPath = "Path A"; - //if (Bottom >= (BottomOfParentRNO(next) ?? Bottom)) - return next;// if no _After - check to see if there is a Next - //_NextDownEditItemPath = "Path B"; - //return null; - } - _NextDownEditItemPath = "Path C"; - return null; - } - } - - private bool Ancestor(EditItem EditItem) - { - if (MyID == EditItem.MyID) return true; - if (MyItemInfo.IsHigh) return false; - return UpOneEditItem.Ancestor(EditItem); - } - public override string ToString() - { - return _MyItemInfo == null ? base.ToString() : string.Format("{0},'{1}'", MyID, MyPath); // + "-" + MyItemInfo.MyContent.Text; - } - #endregion - #region Abstract Methods and Properties - public abstract int TableWidth { get; } - public abstract int BorderWidth { get; } - public abstract Point ContentLocation { get; set; } - public abstract string TabFormat { get; set; } - public abstract void AdjustTableWidthAndLocation(); - public abstract void SetToolTip(string tip); - public abstract void RefreshContent(); - //public abstract EditItem MyPreviousEditItem { get; set; } - public abstract int ItemLeft { get; set; } - public abstract int ContentLeft { get; } - public abstract int ContentWidth { get; set; } - public abstract Point ItemLocation { get; set; } - public abstract int ItemWidth { get; set; } - public abstract void RefreshOrdinal(); - public abstract bool Expanded { get; set; } - public abstract void RefreshTab(); - public abstract void SetFocus(); - public abstract void SaveContents(); - public abstract bool CanExpand { get; set; } - public abstract void HandleResize(); - public abstract void MatchExpanded(); - public abstract void ItemSelect(); - public abstract void ItemShow(); - public abstract StepRTB MyStepRTB { get; } - public abstract DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg); - public abstract bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse); - public abstract void PositionToEnd(); - public abstract void PositionToStart(); - public abstract string SelectedTextForFind { get;} - public abstract bool SpellCheckNext(); - public abstract void IdentifyMe(bool highlight); - public abstract void SetActive(); - public abstract bool Empty { get; set; } - //public abstract bool IsEmpty(); - //public abstract void MakeNotEmpty(); - public abstract void RefreshDisplay(bool activeMode); - public abstract void ToggleEditView(E_ViewMode vwMode); - public abstract int TabLeft { get; set; } - public abstract Font TabFont { get; set; } - public abstract string TabText { get; } - public abstract Point TabLocation { get; } - public abstract Font ContentFont { get; set; } - public abstract float ContentTop { get; } - public abstract void SetupHeader(ItemInfo itemInfo); - public abstract void ShowExpanded(); - public abstract void SetText(); - public abstract void SetExpandAndExpander(ItemInfo itemInfo); - public abstract void SaveCurrentAndContents(); - #endregion - protected string _TabFormat; - private static int _WidthAdjust = 5; - protected bool _IgnoreResize = false; - /// - /// Sets the parent and postions the item with respect to the parent - /// - public EditItem MyParentEditItem - { - get { return _MyParentEditItem; } - set - { - LastMethodsPush("set_MyParentRTBItem"); - _MyParentEditItem = value; - if (_MyParentEditItem != null) - { - switch (_MyChildRelation) - { - case ChildRelation.None: // Same as after - case ChildRelation.After: // Procedures, sections, substeps, and tables/figures - // The size depends upon the parent type - int iType = (int)_MyParentEditItem.ContentType; - - switch (iType / 10000) - { - case 0: // Procedure - ItemLocation = new Point(_MyParentEditItem.ItemLocation.X + 20, _MyParentEditItem.Bottom); - ItemWidth = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColT) + MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT); - break; - case 1: // Section - if (this == TopMostEditItem) - ItemLocation = new Point(_MyParentEditItem.ItemLocation.X + 20, _MyParentEditItem.Bottom); - else - TopMostEditItem.ItemLocation = new Point(TopMostEditItem.ItemLocation.X, _MyParentEditItem.Bottom); - //TextWidth = _WidthAdjust + borderWidth + MyStepPanel.ToDisplay(_MyStepSectionLayoutData.WidSTableEdit, Convert.ToInt32(_MyStepSectionLayoutData.PMode) - 1); - ContentWidth = _WidthAdjust + BorderWidth + MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, MyItemInfo.ColumnMode); - break; - case 2: // Step - // if Table then determine width and location based upon it's parent's location - if (MyStepData.Type == "Table" || MyStepData.ParentType == "Table") - { - AdjustTableWidthAndLocation(); - } - else - { - ItemLocation = new Point(_MyParentEditItem.ContentLeft, _MyParentEditItem.Bottom); - ItemWidth = _MyParentEditItem.ContentWidth; - } - break; - } - break; - case ChildRelation.RNO: - // this is set so that TextWidth command below will be correct. TextWidth uses - // the tab start & tab width to calculate the overall width. - TabFormat = ""; // this is set so that TextWidth command below will be correct - _IgnoreResize = true; - ContentWidth = _MyParentEditItem.ContentWidth; - _IgnoreResize = false; - if (RNOLevel <= MyItemInfo.ColumnMode) - { - //int colR = MyStepPanel.ToDisplay(_MyStepSectionLayoutData.ColRTable, Convert.ToInt32(_MyStepSectionLayoutData.PMode) - 1); - int colR = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColRTable, MyItemInfo.ColumnMode); - if (colR - _MyParentEditItem.Width < 0) colR = _MyParentEditItem.Width + 0; - MyStepPanel.ItemMoving++; - //Left = _MyParentRTBItem.ItemLeft + RNOLevel * colR; - //ItemLocation = new Point(_MyParentRTBItem.ItemLeft + RNOLevel * colR, _MyParentRTBItem.Top); - LastMethodsPush(string.Format("set_MyParentRTBItem RNO Right {0}", MyID)); - ItemLocation = new Point(_MyParentEditItem.ItemLeft + RNOLevel * colR, _MyParentEditItem.Top); - int top = _MyParentEditItem.FindTop(_MyParentEditItem.Top); - if (top != _MyParentEditItem.Top) - { - _MyParentEditItem.LastMethodsPush(string.Format("set_MyParentRTBItem RNO Right {0}", MyID)); - _MyParentEditItem.Top = top; - _MyParentEditItem.LastMethodsPop(); - Top = top; - } - LastMethodsPop(); - MyStepPanel.ItemMoving--; - } - else - { - MyStepPanel.ItemMoving++; - LastMethodsPush(string.Format("set_MyParentRTBItem RNO Below {0} {1} {2}", MyID, _MyParentEditItem.BottomMostEditItem.MyID, _MyParentEditItem.BottomMostEditItem.Bottom)); - ContentLocation = new Point(_MyParentEditItem.ContentLeft, _MyParentEditItem.BottomMostEditItem.Bottom); - LastMethodsPop(); - //TextLocation = new Point(_MyParentRTBItem.TextLeft, FindTop(_MyParentRTBItem.Top)); - MyStepPanel.ItemMoving--; - } - // Same size as the Parent - break; - case ChildRelation.Before: // Cautions and Notes - //if(_WatchThis > 0 && MyID > 2111) - // Console.WriteLine("Setting MyParent: \r\n\tParent {0},{1} \r\n\tTopMostItem {2},{3} \r\n\tNext {4}, {5}", _MyParentRTBItem.MyID, _MyParentRTBItem - // ,_MyParentRTBItem.TopMostRTBItem.MyID,_MyParentRTBItem.TopMostRTBItem - // , _MyNextRTBItem == null ? 0 : _MyNextRTBItem.MyID, _MyNextRTBItem == null ? "None" : _MyNextRTBItem.ToString()); - - //Location = new Point(_MyParentRTBItem.Left + 20, max(_MyParentRTBItem.Top, (_MyNextRTBItem == null ? 0 : _MyNextRTBItem.Top )) ?? 0); - _IgnoreResize = true; - Width = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT); - _IgnoreResize = false; - MyStepPanel.ItemMoving++; - //Location = new Point(_MyParentRTBItem.Left + 20, FindTop(_MyParentRTBItem.Top)); - int myTop = MyNextEditItem == null ? _MyParentEditItem.Top : MyNextEditItem.Top; - Location = new Point(_MyParentEditItem.Left + 20, FindTop(myTop)); - MyStepPanel.ItemMoving--; - //_MyParentRTBItem.Top = Bottom; - // Could be a Caution or Note - Need to get WidT - break; - } - } - LastMethodsPop(); - } - } - /// - /// Sets the previous item and adjusts locations - /// - public /*override*/ EditItem MyPreviousEditItem - { - get { return _MyPreviousEditItem; } - set - { - LastMethodsPush("set_MyPreviousRTBItem"); - _MyPreviousEditItem = value; - if (_MyPreviousEditItem != null) - { - _IgnoreResize = true; - if (MyStepData != null && (MyStepData.Type.ToLower().Contains("table") || MyStepData.ParentType.ToLower().Contains("table"))) - { - ItemWidth = TableWidth; - Location = new Point(_MyPreviousEditItem.Left, FindTop(_MyPreviousEditItem.BottomMostEditItem.Bottom)); - } - else if (value.MyItemInfo.IsTablePart) - { - ItemLocation = new Point(value.MyParentEditItem.ContentLeft, value.MyParentEditItem.Bottom); - ItemWidth = value.MyParentEditItem.ContentWidth; - } - else - { - Width = MyPreviousEditItem.Width; - if (TopMostEditItem == this) - Location = new Point(_MyPreviousEditItem.Left, FindTop(_MyPreviousEditItem.BottomMostEditItem.Bottom)); - else - TopMostEditItem.Location = new Point(TopMostEditItem.Left, FindTop(_MyPreviousEditItem.BottomMostEditItem.Bottom)); - } - _IgnoreResize = false; - //ShowMe(""); - //if (MyID > _StartingID) - // Console.WriteLine("{0}-->Setting MyPreviousRTBItem {1},{2},{3},{4},{5},{6},{7}", WatchThisIndent, MyID, this - // , _MyPreviousRTBItem - // ,Top - // , _MyPreviousRTBItem.BottomMostRTBItem.Bottom - // , FindTop(_MyPreviousRTBItem.BottomMostRTBItem.Bottom) - // , _MyPreviousRTBItem.Bottom); - //Location = new Point(_MyPreviousRTBItem.Left, _MyPreviousRTBItem.BottomMostRTBItem.Bottom); - switch (_MyChildRelation) - { - case ChildRelation.None: - break; - case ChildRelation.After: - break; - case ChildRelation.RNO: - break; - case ChildRelation.Before: - //MyStepPanel.ItemMoving++; - //UpOneRTBItem.Top = BottomMostRTBItem.Bottom; - //MyStepPanel.ItemMoving--; - break; - } - if (_MyPreviousEditItem.MyNextEditItem != this) _MyPreviousEditItem.MyNextEditItem = this; - } - LastMethodsPop(); - } - } - protected void SetupEditItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem, bool addFirstChld) - { - //if (itemInfo.ItemID == 10366) Console.WriteLine("Here"); - //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 - TabLeft = 20; - SetupHeader(itemInfo); - this.Paint += new PaintEventHandler(EditItem_Paint); - this.BackColorChanged += new EventHandler(EditItem_BackColorChanged); - this.Move += new EventHandler(EditItem_Move); - this.Resize += new EventHandler(EditItem_Resize); - if (itemInfo != null) - { - ContentType = (int)itemInfo.MyContent.Type; - switch (ContentType / 10000) - { - case 0: // Procedure - ContentFont = myStepPanel.ProcFont;// lblTab.Font = myStepPanel.ProcFont; - TabFont = itemInfo.MyTab.MyFont.WindowsFont; - break; - case 1: // Section - ContentFont = myStepPanel.SectFont;// lblTab.Font = myStepPanel.SectFont; - TabFont = itemInfo.MyTab.MyFont.WindowsFont; - break; - case 2: // Steps - ContentFont = myStepPanel.StepFont;//lblTab.Font = myStepPanel.StepFont; - TabFont = itemInfo.MyTab.MyFont.WindowsFont; - MyStepData = itemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[ContentType % 10000]; - break; - } - //this.Move += new EventHandler(DisplayItem_Move); - } - else - { - if (myStepPanel.MyFont != null) ContentFont = TabFont = myStepPanel.MyFont; - } - if (expand) ShowExpanded(); - MyStepPanel = myStepPanel; - if (itemInfo != null && !myStepPanel._LookupEditItems.ContainsKey(itemInfo.ItemID)) 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, addFirstChld); - break; - case ChildRelation.Before: - AddItem(myParentEditItem, ref myParentEditItem._MyBeforeEditItems, nextEditItem, addFirstChld); - break; - case ChildRelation.RNO: - RNOLevel = myParentEditItem.RNOLevel + 1; - AddItem(myParentEditItem, ref myParentEditItem._MyRNOEditItems, nextEditItem, addFirstChld); - 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"); - } - void MyConfig_PropertyChanged(object sender, PropertyChangedEventArgs e) - { - SaveConfig(); - } - public void SaveConfig() - { - if (!MyItemInfo.MyConfig.IsDirty) return; - using (Item itm = MyItemInfo.Get()) - { - itm.MyContent.Config = MyItemInfo.MyConfig.ToString(); - itm.Save(); - } - MyItemInfo.MyConfig.IsDirty = false; - } - /// - /// If the background changes, change the background of the RichTextBox - /// - /// - /// - void EditItem_BackColorChanged(object sender, EventArgs e) - { - //IdentifyMe(false); - } - // TODO: the format of the circles, Checkoffs and Changebars should come from the format file - /// - /// This adds drawing items to the RTBItem as needed including - /// Circle around the Tab Number - /// Check-Offs - /// Change Bars - /// - /// - /// - private void EditItem_Paint(object sender, PaintEventArgs e) - { - Graphics g = e.Graphics; - g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; - //g.DrawString(lblTab.Text, MyItemInfo.MyTab.MyFont.WindowsFont, Brushes.Red, new RectangleF(new PointF(MyStepPanel.MyStepPanelSettings.NumberLocationX, MyStepPanel.MyStepPanelSettings.NumberLocationY), MyStepPanel.MyStepPanelSettings.NumberSize), StringFormat.GenericDefault); - // adjust x location of label by 7, to position correctly. - //g.DrawString(lblTab.Text, MyItemInfo.MyTab.MyFont.WindowsFont, Brushes.Blue, new RectangleF(new PointF(Convert.ToSingle(lblTab.Location.X-7), Convert.ToSingle(lblTab.Location.Y)), MyStepPanel.MyStepPanelSettings.NumberSize), StringFormat.GenericDefault); - //g.DrawLine(Pens.DarkGreen, lblTab.Location.X-7, 0, lblTab.Location.X-7, this.Height); - //g.DrawLine(Pens.DarkGreen, MyStepRTB.Location.X - 7, 0, MyStepRTB.Location.X - 7, this.Height); - g.DrawString(TabText, MyItemInfo.MyTab.MyFont.WindowsFont, Brushes.Black, new RectangleF(new PointF(Convert.ToSingle(TabLocation.X), Convert.ToSingle(TabLocation.Y)), MyStepPanel.MyStepPanelSettings.NumberSize), StringFormat.GenericDefault); - //g.DrawLine(Pens.DarkGreen, lblTab.Location.X, 0, lblTab.Location.X, this.Height); - //g.DrawLine(Pens.DarkGreen, MyStepRTB.Location.X, 0, MyStepRTB.Location.X, this.Height); - if (Circle) - { - Pen penC = new Pen(MyStepPanel.MyStepPanelSettings.CircleColor, MyStepPanel.MyStepPanelSettings.CircleWeight); - g.DrawArc(penC, TabLeft + 1, 0, MyStepPanel.MyStepPanelSettings.CircleDiameter, MyStepPanel.MyStepPanelSettings.CircleDiameter, 0F, 360F); - } - if (CheckOff) - { - Pen penCO = new Pen(MyStepPanel.MyStepPanelSettings.CheckOffColor, MyStepPanel.MyStepPanelSettings.CheckOffWeight); - g.DrawRectangle(penCO, MyStepPanel.MyStepPanelSettings.CheckOffX, MyStepPanel.MyStepPanelSettings.CheckOffY, MyStepPanel.MyStepPanelSettings.CheckOffSize, MyStepPanel.MyStepPanelSettings.CheckOffSize); - } - if (ChangeBar) - { - Pen penCB = new Pen(MyStepPanel.MyStepPanelSettings.ChangeBarColor, MyStepPanel.MyStepPanelSettings.ChangeBarWeight); - if (ChangeBarPosition == E_ChangeBarPosition.Left) - g.DrawLine(penCB, 0, ContentTop, 0, Height); // left, top, right, bottom. - else - { - float X; - float H; - if (this is GridItem) - { - GridItem gi = this as GridItem; - X = gi.MyFlexGrid.Right+2; - H = gi.MyFlexGrid.Height; - } - else - { - RTBItem ri = this as RTBItem; - X = ri.MyStepRTB.Right+2; - H = ri.MyStepRTB.Height; - } - g.DrawLine(penCB, X, ContentTop, X, ContentTop+H); //Height); - } - } - if (UserCheckOff) - { - PointF location; - if (this is GridItem) - { - GridItem gi = this as GridItem; - location = new PointF(gi.MyFlexGrid.Left + gi.MyFlexGrid.Width + 2, gi.MyFlexGrid.Top); - } - else - { - RTBItem ri = this as RTBItem; - location = new PointF(ri.MyStepRTB.Left + ri.MyStepRTB.Width + 2, ri.MyStepRTB.Top); - } - CheckOff co = MyItemInfo.GetCheckOffStep(); - // There may have been a data change in the setting of which checkoff to use (property - // change in the config data), or whether a checkoff is used at all. Need to set the - // 'UserCheckOff' or 'UserCheckOffChar' properties to reflect that. - if (co != null && co.UIMark != null) - { - UserCheckOffChar = (char)co.UIMark; - Font myFont = new Font("VolianDraw", MyItemInfo.MyTab.MyFont.WindowsFont.Size); - g.DrawString(UserCheckOffChar.ToString(), myFont, Brushes.DarkGreen, new RectangleF(location, MyStepPanel.MyStepPanelSettings.NumberSize), StringFormat.GenericDefault); - } - else if (co == null) UserCheckOff = false; - } - } - } -} diff --git a/PROMS/Volian.Controls.Library/EditItem.cs.org b/PROMS/Volian.Controls.Library/EditItem.cs.org deleted file mode 100644 index f1eff62a..00000000 --- a/PROMS/Volian.Controls.Library/EditItem.cs.org +++ /dev/null @@ -1,3813 +0,0 @@ -using System; -using System.ComponentModel; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using System.Drawing; -using System.Windows.Forms; -using System.Text.RegularExpressions; -using VEPROMS.CSLA.Library; -using Volian.Base.Library; -using JR.Utils.GUI.Forms; - -namespace Volian.Controls.Library -{ - #region Enums - public enum ChildRelation : int - { - None = 0, - After = 1, - Before = 2, - RNO = 3, - SupInfo = 4 - } - public enum E_ChangeBarPosition : int - { - Left = 0, - Right = 1 - } - #endregion - public abstract partial class EditItem : UserControl - { - #region EditItemUnique - //private static int _EditItemUnique = 0; - //private static int EditItemUnique - //{ - // get - // { - // if (_EditItemUnique == 3) - // Console.WriteLine("here"); - // return ++_EditItemUnique; - // } - //} - //private int _MyEditItemUnique = EditItemUnique; - - //public int MyEditItemUnique - //{ - // get {return _MyEditItemUnique; } - //} - #endregion - #region Constructor - public EditItem() - { - InitializeComponent(); - this.Enter += EditItem_Enter; - } - - // This event was added to better control enabling or disabling of the Insert and Copy Step buttons on the ribbon - void EditItem_Enter(object sender, EventArgs e) - { - bool allow = (MyStepPanel.VwMode == E_ViewMode.Edit); - StepTabRibbon str = MyStepPanel.MyStepTabPanel.MyStepTabRibbon; - str.SiblingsButtonsEnabled = allow; - str.InsertButtonsEnabled = allow && !(MyItemInfo.IsProcedure || MyItemInfo.IsSection || MyItemInfo.IsRNOPart || MyItemInfo.IsSupInfoPart); - // do special case for cpystep button: cannot copy an enhanced step: - if (MyItemInfo.IsEnhancedStep) str.SetCopyStepButton(false); - } - - public EditItem(IContainer container) - { - container.Add(this); - InitializeComponent(); - this.Enter += EditItem_Enter; - } - #endregion - #region Properties - private bool _RTBLastFocus = true; - public bool RTBLastFocus - { - get { return _RTBLastFocus; } - set { _RTBLastFocus = value; } - } - protected static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - protected ChildRelation _MyChildRelation; - public ChildRelation MyChildRelation - { - get { return _MyChildRelation; } - set { _MyChildRelation = value; } - } - protected bool _Loading = true; - protected EditItem _MyParentEditItem = null; - protected EditItem _MySectionRTBItem; - protected EditItem _MyPreviousEditItem = null; - protected EditItem _MyNextEditItem = null; - private bool _ChildrenLoaded = false; - public bool HasChildren - { - get { return _MyBeforeEditItems != null || _MyRNOEditItems != null || _MyAfterEditItems != null; } - } - internal List _MyBeforeEditItems; - public List MyBeforeEditItems // MyBeforeEditItems are Cautions & Notes - { - get { return _MyBeforeEditItems; } - set { _MyBeforeEditItems = value; } - } - internal List _MyAfterEditItems; - public List MyAfterEditItems - { - get { return _MyAfterEditItems; } - set { _MyAfterEditItems = value; } - } - internal List _MyRNOEditItems; - public List MyRNOEditItems - { - get { return _MyRNOEditItems; } - set { _MyRNOEditItems = value; } - } - internal List _MySupInfoEditItems; - public List MySupInfoEditItems - { - get { return _MySupInfoEditItems; } - set { _MySupInfoEditItems = value; } - } - private StepSectionLayoutData _MyStepSectionLayoutData; - public StepSectionLayoutData MyStepSectionLayoutData - { - get { return _MyStepSectionLayoutData; } - set { _MyStepSectionLayoutData = value; } - } - private StepData _MyStepData; - public StepData MyStepData - { - get { return _MyStepData; } - set { _MyStepData = value; } - } - private ItemInfo _MyItemInfo; - private int _ExpandPrefix = 0; - public int ExpandPrefix - { - get { return _ExpandPrefix; } - set { _ExpandPrefix = value; } - } - private bool _Colapsing = false; - /// - /// Gets or sets colapsing - /// - public bool Colapsing - { - get { return _Colapsing; } - set { _Colapsing = value; } - } - private bool _Moving = false; - private int _RNOLevel = 0; - private int _SeqLevel = 0; - private int _ContentType; - public int ContentType - { - get { return _ContentType; } - set { _ContentType = value; } - } - private bool _Circle = false; - private bool _CheckOff = false; - private bool _UserCheckOff = false; - private bool _ChangeBar = false; - private StepPanel _MyStepPanel; - public StepPanel MyStepPanel - { - get { return _MyStepPanel; } - set { _MyStepPanel = value; } - } - - private DisplayTags _MyStepPropertiesPanel; - public DisplayTags MyStepPropertiesPanel // gives us access to the Step Properties panel - used with shortcut keystrokes - { - get { return _MyStepPropertiesPanel; } - set { _MyStepPropertiesPanel = value; } - } - - /// - /// This returns the section or procedure for the current item. - /// If the item is a step or section, it returns the section - /// If it is a procedure, it returns the procedure - /// - public EditItem MySectionRTBItem - { - get - { - if (_MySectionRTBItem == null) - { - if (MyItemInfo.IsSection || MyItemInfo.IsProcedure) _MySectionRTBItem = (RTBItem)this; - else _MySectionRTBItem = MyParent.MySectionRTBItem; - } - return _MySectionRTBItem; - } - set { _MySectionRTBItem = value; } - } - /// - /// Gets or Sets ItemInfo - /// - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - set - { - _MyItemInfo = value; - if (VlnSettings.StepTypeToolType) SetToolTip(_MyItemInfo.ToolTip); - ChangeBar = _MyItemInfo.HasChangeBar; - CheckOff co = _MyItemInfo.GetCheckOffStep(); - if (co != null && co.UIMark != null) - { - UserCheckOff = true; - UserCheckOffChar = (char)co.UIMark; - } - // Deal with changes in content data - value.MyContent.Changed += new ContentInfoEvent(MyContent_Changed); - value.MyProcedure.MyContent.Changed += new ContentInfoEvent(MyContent_Changed); - // Deal with change in item data - value.Changed += new ItemInfoEvent(value_Changed); - value.OrdinalChanged += new ItemInfoEvent(value_OrdinalChanged); - // do something like this to draw circle around step numbers - note got NULL reference error on NSP data - //if (value.FormatStepData != null && value.FormatStepData.TabData.IdentPrint.Contains("C0")) Circle = true; - } - } - private bool _ChangeBarForConfigItemChange = true; - - public bool ChangeBarForConfigItemChange - { - get { return _ChangeBarForConfigItemChange; } - set { _ChangeBarForConfigItemChange = value; } - } - - void value_Changed(object sender) - { - ChangeBar = _MyItemInfo.HasChangeBar; - } - protected void MyContent_Changed(object sender) - { - // Update the text to reflect the content change - MyItemInfo.RefreshItemAnnotations(); - ChangeBar = MyItemInfo.HasChangeBar; - CheckOff co = _MyItemInfo.GetCheckOffStep(); - if (co != null && co.UIMark != null) - { - UserCheckOff = true; - UserCheckOffChar = (char)co.UIMark; - } - else - UserCheckOff = false; - RefreshContent(); - - // see if change in subsections to be displayed, i.e. if the user made a change to editable data - // on the section properties form, we may have to display steps or remove steps. By design, - // steps are the first children from a section. Also, this will only occur if the format has - // metasections AND there are subsections. - if (MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections - && MyItemInfo.Sections != null && MyItemInfo.Sections.Count > 0) - { - // find out what the editable flag is to determine if change. - bool showSteps = MyItemInfo.MyConfig is SectionConfig && (MyItemInfo.MyConfig as SectionConfig).SubSection_Edit == "Y"; - if (showSteps && _MyAfterEditItems != null && _MyAfterEditItems.Count > 0 && _MyAfterEditItems[0].MyItemInfo.IsSection) - { - // need to add steps in, i.e. they do not exist in step editor yet. - _MyAfterEditItems[0].AddSiblingBeforeNoDataSave(MyItemInfo.Steps, false); - } - else if (!showSteps && _MyAfterEditItems != null && _MyAfterEditItems.Count > 0 && _MyAfterEditItems[0].MyItemInfo.IsStep) - { - // Remove steps - only want sections. Put in a list for removal. - List remEIs = new List(); - foreach (EditItem ei in _MyAfterEditItems) - { - if (!ei.MyItemInfo.IsSection) remEIs.Add(ei); - } - foreach (EditItem ei1 in remEIs) - { - ei1.RemoveItemWithoutDelete(); - } - remEIs.Clear(); - } - } - } - void value_OrdinalChanged(object sender) - { - RefreshOrdinal(); - } - public EditItem ActiveParent - { - get { return _MyParentEditItem != null ? _MyParentEditItem : _MyPreviousEditItem.ActiveParent; } - } - /// - /// Return the Parent EditItem - /// - private EditItem UpOneEditItem - { - get - { - EditItem tmp = this; - while (tmp != null && tmp.MyParentEditItem == null) tmp = tmp.MyPreviousEditItem; - if (tmp != null) return tmp.MyParentEditItem; - return null; - } - } - private Stack _LastMethods = new Stack(); - //private string _LastMethod = ""; - internal void LastMethodsPush(string str) - { - if(MyStepPanel != null)MyStepPanel._LastAdjust = str; - _LastMethods.Push(str); - } - internal string LastMethodsPop() - { - //MyStepPanel._LastAdjust = ""; - return _LastMethods.Pop(); - } - internal bool LastMethodsEmpty - { - get { return _LastMethods.Count == 0; } - } - // This should find the item that precedes the current item vertically in the supplemental information column - // and then return the Bottom of that item. - // It is used so that an edit item does not overlap in 'y-direction' any preceding items. - internal int? FindTopSupInfo(bool useSuppInfoColBottom) - { - if (MyParentEditItem == null) return null; - // on supplemental info item: parent is item in left column. - // return null if parent does not have previous siblings or parents that have supp info. FindPreviousOrParentSupInfo looks above to - // items that have supinfo. - EditItem prevOrParSupInfo = MyParentEditItem.FindPreviousOrParentSupInfo(); - if (prevOrParSupInfo == null || !prevOrParSupInfo.Visible) - { - // Account for Expanded or collapsed. note that BottomMostEditItem already accounts for - // whether it is expanded or collapsed. - if (MyParentEditItem.MyPreviousEditItem != null) return MyParentEditItem.MyPreviousEditItem.BottomMostEditItem.Bottom; - if (MyParentEditItem.MyBeforeEditItems != null) return MyParentEditItem.MyBeforeEditItems[MyParentEditItem.MyBeforeEditItems.Count - 1].BottomMostEditItem.Bottom; - return (MySectionRTBItem==null)?0:MySectionRTBItem.Bottom; - } - int b1 = prevOrParSupInfo.BottomMostEditItem.Bottom; - int b2 = b1; - if (prevOrParSupInfo.MyParentEditItem.MyItemInfo.StepLevel > MyParentEditItem.MyItemInfo.StepLevel) - b2 = prevOrParSupInfo.MyParentEditItem.LastSiblingEditItem.BottomMostEditItem.Bottom; - - // if the current supinfo's parent (proc step) is same as the lastsibling bottom most, don't use its value - it puts the next step - // down too far: - if (this.MyParentEditItem.MyID == prevOrParSupInfo.MyParentEditItem.LastSiblingEditItem.BottomMostEditItem.MyID) b2 = b1; - // if not in the same HLS, don't use the lastsibling either: - if (this.MyParentEditItem.MyItemInfo.MyHLS.ItemID != prevOrParSupInfo.MyParentEditItem.LastSiblingEditItem.MyItemInfo.MyHLS.ItemID) b2 = b1; - if (useSuppInfoColBottom) - return b1; - else - return Math.Max(b1, b2); // look at both supinfo & parent column to determine bottom - } - // This goes up edititems, looking for the closest in 'y-direction' of any supplemental info items. - EditItem FindPreviousOrParentSupInfo() // current edit item is parent of supplmental info item - { - EditItem prev = this; - // First see if there are any Cautions or Notes before me that have supinfo: - EditItem lastBefore = prev.FindLastBeforeWithSupInfo(); - if (lastBefore != null) return lastBefore.MySupInfoEditItems[0]; - - // There were no Cautions/Notes before me with supinfo, now see if there are previous items with supinfo: - while (prev.MyPreviousEditItem != null) - { - prev = prev.MyPreviousEditItem; - EditItem eiTmp = prev.FindLastSubstepWithSupInfo(); - // check for MySupInfoEditItems as null because the FindLastSubstepWithSupInfo checks for data, but the supinfo step may - // not be displayed yet, i.e. the eiTmp.MySupInfoEditItems has an edititem defined only it if is displayed. - if (eiTmp != null && eiTmp.MySupInfoEditItems != null) return eiTmp.MySupInfoEditItems[0]; - } - // No previous items had supinfo, look up to the parent. But if on first before, i.e. first caution or note, there is nothing before (just the section) - if (prev.MyParentEditItem.MyBeforeEditItems != null && prev.MyParentEditItem.MyBeforeEditItems.Count > 0 && prev.MyParentEditItem.MyBeforeEditItems[0] == prev) - { - EditItem eitmp = null; - // if on a Note/Caution, need to be sure there isn't a step before me with supinfo (don't just assume going to Section) - if (prev.MyParentEditItem.MyPreviousEditItem!=null)eitmp = prev.MyParentEditItem.MyPreviousEditItem.BottomMostEditItem.FindPreviousOrParentSupInfo(); - return eitmp; - } - if (prev.MyParentEditItem.MySupInfoEditItems != null) return prev.MyParentEditItem.MySupInfoEditItems[0]; - if (prev.MyItemInfo.IsSection) return null; - return prev.MyParentEditItem.FindPreviousOrParentSupInfo(); - } - private EditItem FindLastBeforeWithSupInfo() - { - if (MyBeforeEditItems == null || MyBeforeEditItems.Count == 0) return null; - - for (int i = MyBeforeEditItems.Count - 1; i > -1; i--) - { - // Need to look at caution/note (mybeforeedititems) if they have substeps that have supinfo - if (MyBeforeEditItems[i].MySupInfoEditItems != null && MyBeforeEditItems[i].MySupInfoEditItems.Count > 0) return MyBeforeEditItems[i]; - } - return null; - } - // The next 2 methods, FindLastSubstepWithSupInfo, FindLastItemWithSupInfo: - // for the current item, get to its bottommost supplemental info, if any steps/substeps have it. - // - private EditItem FindLastSubstepWithSupInfo() - { - ItemInfo ii = FindLastItemWithSupInfo(MyItemInfo); - if (ii == null) return null; - return GetEditItemFromItemID(ii.ItemID); - } - private ItemInfo FindLastItemWithSupInfo(ItemInfo stp) - { - // first check substeps (& their substeps) of item passed in. - if (stp.Steps != null && stp.Steps.Count > 0) - { - for (int i = stp.Steps.Count - 1; i > -1; i--) - { - ItemInfo tmp = FindLastItemWithSupInfo(stp.Steps[i]); - if (tmp != null) return tmp; - } - } - //now check the step that was passed in. - if (stp.SupInfos != null && stp.SupInfos.Count > 0) return stp; - if (stp.Notes != null && stp.Notes.Count > 0) - { - for (int j = stp.Notes.Count - 1; j > -1; j--) - { - if (stp.Notes[j].SupInfos != null && stp.Notes[j].SupInfos.Count > 0) return stp.Notes[j]; - } - } - if (stp.Cautions != null && stp.Cautions.Count > 0) - { - for (int j = stp.Cautions.Count - 1; j > -1; j--) - { - if (stp.Cautions[j].SupInfos != null && stp.Cautions[j].SupInfos.Count > 0) return stp.Cautions[j]; - } - } - return null; - } - /// - /// This should find the item that precedes the current item vertically - /// and then return the Bottom of that item. - /// - /// - internal int FindTop(int bottom, bool test1) - { - // if on a supplemental info, use special code to find what steps are above the supplemental info - if (MyItemInfo.MyDocStyle != null && MyItemInfo.MyDocStyle.SupplementalInformation) - { - if (MyItemInfo.IsSupInfoPart) - { - int? tmptop = FindTopSupInfo(test1); - return tmptop == null ? bottom : Math.Max(bottom, (int)tmptop); - } - } - int lastBottomPrev = bottom; // This is necessary if the value of bottom can be negative. - if (_MyPreviousEditItem != null) - lastBottomPrev = _MyPreviousEditItem.BottomMostEditItem.Bottom; - int? bottomRNO = BottomOfParentRNO(); - if (lastBottomPrev > bottom) bottom = (int)(lastBottomPrev); // RHM 20090615 ES02 Step8 - // Moving from Step 8 to the Note preceeding step 8 caused the step 9 to be positioned in the wrong place. - //if (lastBottomParent > bottom) bottom = lastBottomParent; - //if (bottomRNO == null) return bottom; - return (int)max(bottomRNO, bottom); - } - internal int FindTop(int bottom) - { - return FindTop(bottom, true); - } - /// - /// The Top of the EditItem - /// - public int ItemTop - { - get { return Top; } - set - { - MyStepPanel.ItemMoving++; - Top = value; - MyStepPanel.ItemMoving--; - } - } - private E_ChangeBarPosition _ChangeBarPosition = E_ChangeBarPosition.Right; - public E_ChangeBarPosition ChangeBarPosition - { - get { return _ChangeBarPosition; } - set { _ChangeBarPosition = value; } - } - /// - /// Sets the next item and adjusts the location, - /// This also sets the previous for the "next" item - /// which adjusts other locations. - /// - public EditItem MyNextEditItem - { - get { return _MyNextEditItem; } - set - { - _MyNextEditItem = value; - if (_MyNextEditItem != null) - { - if (_MyNextEditItem.MyPreviousEditItem != this) - { - _MyNextEditItem.MyPreviousEditItem = this; - MyNextEditItem.Location = new Point(Left, Bottom); - } - } - } - } - /// - /// returns the TopMostChild - /// - public EditItem TopMostEditItem - { - get - { - if (Expanded && _MyBeforeEditItems != null) return _MyBeforeEditItems[0].TopMostEditItem; - return this; - } - } - /// - /// Returns the bottom location (Top + Height) - /// - public new int Bottom - { - get - { - return Top + (Hidden ? 0 : Height); - } - } - private bool _Hidden = false; - public bool Hidden - { - get { return _Hidden; } - set { _Hidden = value; Visible = !value; } - } - /// - /// Bottom most child - /// - public EditItem BottomMostEditItem - { - get - { - EditItem tmpr = null; // BottomMost RNO - //int rnoOffset = 0; - if ((MyExpandingStatus != ExpandingStatus.No || Expanded) && _MyRNOEditItems != null) - { - //rnoOffset = this.Top - _MyRNOEditItems[0].Top; - tmpr = _MyRNOEditItems[_MyRNOEditItems.Count - 1].BottomMostEditItem; - } - EditItem tmpa = this; // BottomMost After - if ((MyExpandingStatus != ExpandingStatus.No || Expanded) & _MyAfterEditItems != null) - tmpa = _MyAfterEditItems[_MyAfterEditItems.Count - 1].BottomMostEditItem; - // return the bottom most of the two results - if (tmpr == null) - return tmpa; - //if (rnoOffset > 0) - //Console.WriteLine("RNO Bottom Offset {0}", rnoOffset); - //if (tmpa.Bottom >= (tmpr.Bottom + rnoOffset)) - if (tmpa.Bottom >= (tmpr.Bottom)) - return tmpa; - return tmpr; - } - } - /// - /// Bottom most child excluding RNOs - /// - public EditItem BottomMostEditItemNoRNOs - { - get - { - EditItem tmpa = this; // BottomMost After - if ((MyExpandingStatus != ExpandingStatus.No || Expanded) & _MyAfterEditItems != null) - tmpa = _MyAfterEditItems[_MyAfterEditItems.Count - 1].BottomMostEditItem; - // return the bottom most - return tmpa; - } - } - /// - /// First sibling - /// - private EditItem FirstSiblingEditItem - { - get - { - EditItem tmp = this; - while (tmp.MyPreviousEditItem != null) - tmp = tmp.MyPreviousEditItem; - return tmp; - } - } - /// - /// Last sibling - /// - private EditItem LastSiblingEditItem - { - get - { - EditItem tmp = this; - while (tmp.MyNextEditItem != null) - tmp = tmp.MyNextEditItem; - return tmp; - } - } - private ExpandingStatus _MyExpandingStatus = ExpandingStatus.No; - /// - /// Sets or Gets expanding status - /// - public ExpandingStatus MyExpandingStatus - { - get { return _MyExpandingStatus; } - set { _MyExpandingStatus = value; } - } - /// - /// Gets the ItemID from the ItemInfo - /// - public int MyID - { - get { return _MyItemInfo == null ? 0 : _MyItemInfo.ItemID; } - } - /// - /// Tracks when a EditItem is moving - /// - public bool Moving - { - get { return _Moving; } - set { _Moving = value; } - } - /// - /// The RNO (Contingency) Level - /// - public int RNOLevel - { - get { return _RNOLevel; } - set { _RNOLevel = value; } - } - /// - /// Sequential Level - Only counts levels of Sequential substeps - /// - public int SeqLevel - { - get { return _SeqLevel; } - set { _SeqLevel = value; } - } - // TODO: This should be changed to get the Circle format from the data - /// - /// Show a circle or not - /// - public bool Circle - { - get { return _Circle; } - set { _Circle = value; } - } - // TODO: This should be changed to get the Checkoff status from the data - /// - /// Has a check-off or not - /// - public bool CheckOff - { - get { return _CheckOff; } - set { _CheckOff = value; } - } - public bool UserCheckOff - { - get { return _UserCheckOff; } - set { _UserCheckOff = value; } - } - private char _UserCheckOffChar; - public char UserCheckOffChar - { - get { return _UserCheckOffChar; } - set { _UserCheckOffChar = value; } - } - // TODO: This should be changed to get the ChangeBar status from the data - /// - /// Has a changebar or not - /// - public bool ChangeBar - { - get { return _ChangeBar; } - set - { - _ChangeBar = value; - this.Invalidate(); - } - } - #endregion // Properties - #region AddItem - /// - /// Adds an item to a list - /// - /// Parent Container - /// EditItem List - public void AddItem(EditItem parentEditItem, ref List siblingEditItems, EditItem nextEditItem, bool addFirstChld) - { - if (siblingEditItems == null) // Create a list of siblings - { - siblingEditItems = new List(); - siblingEditItems.Add(this); - MyParentEditItem = parentEditItem; - } - else // Add to the existing list - { - // add first child, when there are other children already there. This is used - // for metasection editable data changed from off to on so that the first step is located - // in the editor correctly, i.e. right below the section & above the subsections. - if (addFirstChld) - { - EditItem parent = siblingEditItems[0].MyParentEditItem; - siblingEditItems.Insert(0, this); - MyStepPanel.ItemMoving++; - _MyNextEditItem = siblingEditItems[1]; - _MyNextEditItem._MyPreviousEditItem = this; - MyPreviousEditItem = null; - _MyNextEditItem.MyParentEditItem = null; - MyParentEditItem = parent; - MyStepPanel.ItemMoving--; - } - else if (nextEditItem == null) // Add to the end of the list - { - EditItem lastChild = LastChild(siblingEditItems); - siblingEditItems.Add(this); - MyPreviousEditItem = lastChild; - // RHM - The following line was remove for Facing Pages (Supplemental Information) - // ******************************************************************************* - // When MyPreviousEditItem is set, the location and size is set as a side-effect. - // When MyParentEditItem is set, the location and size is set as a side effect. - // Only Previous or Parent should be set, no both. - // ******************************************************************************* - //MyParentEditItem = MyPreviousEditItem.MyParentEditItem; // Farley - part of bug fix B2015-123 alignment of tabs on the edit screen - } - else // Add to the middle of the list before a particular item - { - EditItem prevChild = nextEditItem.MyPreviousEditItem; - EditItem parent = nextEditItem.MyParentEditItem; - if(siblingEditItems.Contains(nextEditItem)) - siblingEditItems.Insert(siblingEditItems.IndexOf(nextEditItem), this); - else - siblingEditItems.Insert(0, this); - MyStepPanel.ItemMoving++; - _MyNextEditItem = nextEditItem; - if(!MyItemInfo.IsNote || !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format || MyPreviousEditItem == null) - nextEditItem._MyPreviousEditItem = this; - MyPreviousEditItem = prevChild;// If a previous exists - this will adjust the location and width of the EditItem - if (MyItemInfo.IsNote && MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && MyPreviousEditItem != null) - nextEditItem.MyPreviousEditItem = this;//Position First Note in Dev Doc Format - if (!MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format || !(nextEditItem.MyItemInfo.IsNote && MyItemInfo.IsCaution)) - { - // RHM 20170216 For Deviation Document don't set MyParentEditItem to null when Type Changes from Caution to Note - nextEditItem.MyParentEditItem = null; - MyParentEditItem = parent; // If a parent exists - this will adjust the location and width of the EditItem - AdjustForDevDocStepHeight(); - } - //nextEditItem.MyPreviousEditItem = this; - MyStepPanel.ItemMoving--; - } - } - if (MyItemInfo.IsCaution || MyItemInfo.IsNote) - { - EditItem prev = this; - while (prev.MyPreviousEditItem != null) prev = prev.MyPreviousEditItem; - prev.SetAllTabs(); - } - else - SetAllTabs(); - } - // clear tabs, clears then all so that next 'get' will calculate new. - public void SetAllTabs() - { - RefreshTab(); - - if (_MyAfterEditItems != null) foreach (EditItem chld in _MyAfterEditItems) chld.SetAllTabs(); - if (_MyNextEditItem != null) _MyNextEditItem.SetAllTabs(); - // Update the RNO tab if it exists - RHM 20100106 - if (_MyRNOEditItems != null) foreach (EditItem chld in _MyRNOEditItems) chld.SetAllTabs(); - if (_MySupInfoEditItems != null) foreach (EditItem chld in _MySupInfoEditItems) chld.SetAllTabs(); - } - /// - /// Add the next item to a list - /// - /// - /// - /// - //public EditItem AddNext(ItemInfo myItemInfo, bool expand) - //{ - // EditItem tmp = new EditItem(myItemInfo, MyStepPanel, MyParentEditItem, ChildRelation.None, expand); - // MyNextEditItem = tmp; - // return tmp; - //} - #endregion - #region RemoveItem - protected void ShowTops(string title) - { - int TopMostY = TopMostEditItem.Top; - int? TopMostParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.TopMostEditItem.Top)); - int? ParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.Top)); - //Console.Write("{0}: TopMostY={1}, TopMostParentY={2}, ParentY = {3}",title, TopMostY, TopMostParentY, ParentY); - Console.Write("{0}{1},{2},{3}", title, TopMostY, TopMostParentY.ToString() ?? "null", ParentY.ToString() ?? "null"); - } - private bool _BeingRemoved = false; - public bool BeingRemoved - { - get { return _BeingRemoved; } - set { _BeingRemoved = value; } - } - public void RemoveItemWithoutDelete() - { - BeingRemoved = true; - int TopMostYBefore = TopMostEditItem.Top; - MyStepPanel._LookupEditItems.Remove(MyID); - EditItem newFocus = null; - int? TopMostParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.TopMostEditItem.Top)); - int? ParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.Top)); - RemoveFromParentsChildList(); - if (MyNextEditItem != null) - { - if (MyPreviousEditItem != null) - { - MyNextEditItem.MyPreviousEditItem = MyPreviousEditItem; - MyPreviousEditItem = null; - newFocus = MyNextEditItem; - } - else - { - MyNextEditItem.MyParentEditItem = MyParentEditItem; - MyParentEditItem = null; - MyNextEditItem.MyPreviousEditItem = null; - newFocus = MyNextEditItem; - } - // Adjust the vertical locations of all of the items below the item deleted - MyNextEditItem.TopMostEditItem.AdjustLocation(); - MyNextEditItem = null; - } - else if (MyPreviousEditItem != null) - { - MyPreviousEditItem.MyNextEditItem = null; - newFocus = MyPreviousEditItem.BottomMostEditItem; - MyPreviousEditItem = null; - } - else - { - newFocus = MyParentEditItem; - MyParentEditItem = null; - } - Dispose(); - if (newFocus != null) - { - newFocus.SetFocus(); - newFocus.SetAllTabs(); - newFocus.AdjustLocation(); - } - } - private static int xOffset = 0; - public void RemoveItem() - { - // if this item has enhanced edititems, remove them: - StepConfig sc = MyItemInfo.MyConfig as StepConfig; - List thisEnhs = null; - if (sc != null) - thisEnhs = sc.MyEnhancedDocuments; - else - { - if (MyItemInfo.IsSection) - { - SectionConfig secc = MyItemInfo.MyConfig as SectionConfig; - if (secc.Section_LnkEnh == "Y") thisEnhs = secc.MyEnhancedDocuments; - } - } - - List enhIds = new List(); - if (thisEnhs != null) - { - foreach (EnhancedDocument ed in thisEnhs) - { - if (ed.Type != 0) enhIds.Add(ed.ItemID); - } - } - BeingRemoved = true; - MyStepPanel.SelectedEditItem = null; // Unselect the item to be deleted - //ShowTops("\r\n"); - int TopMostYBefore = TopMostEditItem.Top; - //_MyTimer.ActiveProcess = "DeleteItem"; - // Add a Panel temporarily so that AutoScroll will not happen during the delete. - Panel pnl = new Panel(); - pnl.Size = new Size(10, 10); - MyStepPanel.Controls.Add(pnl); - pnl.BackColor = Color.Red; - pnl.Location = new Point(xOffset += 15, MyStepPanel.ClientSize.Height + 10); - EditItem newFocus = DeleteItem(); - if (newFocus == null) - { - MyStepPanel.Controls.Remove(pnl); - return; - } - //_MyTimer.ActiveProcess = "SetFocus"; - - int b4topadjust = newFocus.Top; - newFocus.SetFocus(); //shifts edititem to center it - // need to adjust the TopMostYBefore so that it accounts for any shifting that occurred when the - // SetFocus was called. This fixes B2016-040. - b4topadjust -= newFocus.Top; - TopMostYBefore -= b4topadjust; - - //_MyTimer.ActiveProcess = "Dispose"; - Dispose(); - //_MyTimer.ActiveProcess = "SetAllTabs"; - newFocus.SetAllTabs(); - //_MyTimer.ActiveProcess = "TopMostYAfter"; - int TopMostYAfter = newFocus.TopMostEditItem.Top; - if (TopMostYAfter > TopMostYBefore) - newFocus.TopMostEditItem.Top = TopMostYBefore; - //_MyTimer.ActiveProcess = "AdjustLocation"; - newFocus.AdjustLocation(); - //newFocus.ShowTops(""); - //_MyTimer.ShowElapsedTimes("RemoveItem"); - ForceEditItemRefresh(newFocus); - MyStepPanel.Controls.Remove(pnl); - foreach (int enhId in enhIds) - { - ItemInfo ii = ItemInfo.Get(enhId); - bool success = this._MyStepPanel.MyStepTabPanel.MyDisplayTabControl.DeleteRTBItem(ii); - if (!success) - Item.DeleteItemAndChildren(ii); - } - if (MyItemInfo.MyDocStyle != null && MyItemInfo.MyDocStyle.SupplementalInformation) - { - if (newFocus.MyItemInfo.IsInSupInfo) - newFocus.AdjustAllForSupInfoHeight(); - else - { - EditItem prvOrParSupInfo = newFocus.FindPreviousOrParentSupInfo(); - if (prvOrParSupInfo != null) prvOrParSupInfo.AdjustAllForSupInfoHeight(); - } - } - } - - private static void ForceEditItemRefresh(EditItem newFocus) - { - // bug fix - // need to force a refresh from the level above the step that was removed. - // this fixes a problem where the following step/substep wasn't shown on the screen (but was there) - // and fixes a problem where the sequence numbers were off by one - // and fixes a problem where an edit window would end up on top of the ones above it - EditItem ei = newFocus; - while (ei.MyPreviousEditItem != null) ei = ei.MyPreviousEditItem; - if (ei.MyParentEditItem != null && ei.MyParentEditItem.MyItemInfo.IsStep) - ei.MyParentEditItem.Expand(true); - } - public EditItem DeleteItem() - { - //Volian.Base.Library.VlnTimer _MyTimer = new VlnTimer(); - //_MyTimer.ActiveProcess = "_LookupEditItems.Remove"; - MyStepPanel._LookupEditItems.Remove(MyID); - EditItem newFocus = null; - int? TopMostParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.TopMostEditItem.Top)); - int? ParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.Top)); - try - { - //_MyTimer.ActiveProcess = "DeleteItemAndChildren"; - Item.DeleteItemAndChildren(MyItemInfo); - } - catch (System.Data.SqlClient.SqlException ex) - { - HandleSqlExceptionOnDelete(ex); - return null; - } - // Remove EditItems - //_MyTimer.ActiveProcess = "RemoveFromParentsChildList"; - RemoveFromParentsChildList(); - //_MyTimer.ActiveProcess = "MyNextEditItem"; - if (MyNextEditItem != null) - { - if (MyPreviousEditItem != null) - { - MyNextEditItem.MyPreviousEditItem = MyPreviousEditItem; - MyPreviousEditItem = null; - newFocus = MyNextEditItem; - } - else - { - MyNextEditItem.MyParentEditItem = MyParentEditItem; - MyParentEditItem = null; - MyNextEditItem.MyPreviousEditItem = null; - newFocus = MyNextEditItem; - } - // Adjust the vertical locations of all of the items below the item deleted - if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && MyNextEditItem.MyPreviousEditItem == null && - (MyNextEditItem.MyItemInfo.IsNote || MyNextEditItem.MyItemInfo.IsCaution)) - { - MyNextEditItem.MyParentEditItem.Top = (MyNextEditItem.MyParentEditItem.MyPreviousEditItem != null ? - MyNextEditItem.MyParentEditItem.MyPreviousEditItem.FindBottomDevDoc: MyNextEditItem.MyParentEditItem.MyParentEditItem.Bottom); - MyNextEditItem.Top = MyNextEditItem.MyParentEditItem.Top; - MyNextEditItem.AdjustLocation(); - } - else - { - MyNextEditItem.TopMostEditItem.AdjustLocation(); - } - MyNextEditItem = null; - } - else if (MyPreviousEditItem != null) - { - MyPreviousEditItem.MyNextEditItem = null; - //newFocus = MyPreviousEditItem.BottomMostEditItem; - // bug fix - when deleting an edit window in the AER, position to the bottom most in the AER - was jumping to RNO - newFocus = MyPreviousEditItem.BottomMostEditItemNoRNOs; - if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && MyPreviousEditItem.MyNextEditItem == null && - (MyPreviousEditItem.MyItemInfo.IsNote || MyPreviousEditItem.MyItemInfo.IsCaution)) - { - MyPreviousEditItem.MyParent.Top = MyPreviousEditItem.MyParent.MyPreviousEditItem.FindBottomDevDoc; - MyPreviousEditItem.Top = MyPreviousEditItem.MyParent.Top; - MyPreviousEditItem.MyParent.AdjustLocation(); - } - MyPreviousEditItem = null; - //Console.Write(",\"Previous\","); - } - else - { - newFocus = MyParentEditItem; - MyParentEditItem = null; - //Console.Write(",\"Parent\","); - } - //_MyTimer.ShowElapsedTimes("DeleteItem"); - return newFocus; - } - - //private void HandleSqlExceptionOnDelete(System.Data.SqlClient.SqlException ex) - private void HandleSqlExceptionOnDelete(Exception ex) - { - this.MyStepRTB.InsertSymbol(@"\u160?"); // since text was deleted, insert a hard space to prevent a looping effect B2016-082 - using (Item itm = MyStepRTB.MyItemInfo.Get()) - { - Annotation x = Annotation.MakeAnnotation(itm, AnnotationType.GetByName("Verification Required"), null, "A Hard Space was put in to keep the Transitions referencing here valid. \nPlease remove or re-assign these transitions before deleting this step.", null); - } - if (ex.Message.Contains("has External Transitions and has no next step")) - { - using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitions(MyID)) - { - DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this step and cannot be adjusted automatically." + - "\r\n\r\nDo you want to be placed on the " + (exTrans.Count > 1 ? "first " : "") + "substep with the problem Transition?" + - "\r\n\r\nSubsteps with Problem Transitions" + - exTrans.Summarize(), - "Cannot Delete This Step", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (ans == DialogResult.Yes) - { - MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(exTrans[0].MyContent.ContentItems[0]); - } - else - SetFocus(); - } - } - else if (ex.Message.Contains("has External Transitions to Procedure")) - { - using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(MyID)) - { - DialogResult ans = FlexibleMessageBox.Show("Transitions exist to this procedure." + - "\r\n\r\nDo you want to be placed on the " + (exTrans.Count > 1 ? "first " : "") + "substep with the problem Transition?" + - "\r\n\r\nSubsteps with Problem Transitions" + - exTrans.Summarize(), - "Cannot Delete This Procedure", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (ans == DialogResult.Yes) - { - MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(exTrans[0].MyContent.ContentItems[0]); - - } - else - SetFocus(); - } - } - else if (ex.Message.Contains("has External Transitions to it's children")) - { - using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(MyID)) - { - DialogResult ans = FlexibleMessageBox.Show("Transitions exist to substeps of this step and cannot be adjusted automatically." + - "\r\n\r\nDo you want to be placed on the " + (exTrans.Count > 1 ? "first " : "") + "substep with the problem Transition?" + - "\r\n\r\nSubsteps with Problem Transitions:" + - exTrans.Summarize(), - "Cannot Delete This Step", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (ans == DialogResult.Yes) - { - MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(exTrans[0].MyContent.ContentItems[0]); - } - } - } - else - MessageBox.Show(ex.Message, "SQL Exception", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - } - private void RemoveFromParentsChildList() - { - EditItem top = this; - while (top.MyPreviousEditItem != null) top = top.MyPreviousEditItem; - EditItem parentEditItem = top.MyParentEditItem; - if (parentEditItem == null) return; // No parent, nothing to remove. - if (parentEditItem.MyAfterEditItems != null && parentEditItem.MyAfterEditItems.Contains(this)) - { - parentEditItem.MyAfterEditItems.Remove(this); - if (parentEditItem.MyAfterEditItems.Count == 0) - parentEditItem.MyAfterEditItems = null; - } - else if (parentEditItem.MyBeforeEditItems != null && parentEditItem.MyBeforeEditItems.Contains(this)) - { - parentEditItem.MyBeforeEditItems.Remove(this); - if (parentEditItem.MyBeforeEditItems.Count == 0) - parentEditItem.MyBeforeEditItems = null; - } - else if (parentEditItem.MyRNOEditItems != null && parentEditItem.MyRNOEditItems.Contains(this)) - { - parentEditItem.MyRNOEditItems.Remove(this); - if (parentEditItem.MyRNOEditItems.Count == 0) - parentEditItem.MyRNOEditItems = null; - } - else if (parentEditItem.MySupInfoEditItems != null && parentEditItem.MySupInfoEditItems.Contains(this)) - { - parentEditItem.MySupInfoEditItems.Remove(this); - if (parentEditItem.MySupInfoEditItems.Count == 0) - parentEditItem.MySupInfoEditItems = null; - } - if (parentEditItem.MyAfterEditItems == null && parentEditItem.MyBeforeEditItems == null && parentEditItem.MyRNOEditItems == null) - parentEditItem.CanExpand = false; - } - //private void ShowSiblings(string title) - //{ - // Console.WriteLine("---{0} {1}---",title,MyID); - // EditItem top = this; - // while (top.MyPreviousEditItem != null) top = top.MyPreviousEditItem; - // do - // { - // Console.WriteLine("{0} EditItem - {1} {2}", top.MyID == MyID ? "*" : " ", top.MyID, top.MyItemInfo.MyContent.Text); - // top = top.MyNextEditItem; - // } while (top != null); - //} - #endregion - #region Add Children - /// - /// Add a child before (Notes, Cautions, etc.) - /// - /// - /// - public void AddChildBefore(ItemInfo myItemInfo, bool expand) - { - EditItem child = new RTBItem(myItemInfo, MyStepPanel, this, ChildRelation.Before, expand); - } - /// - /// Add a list of children before - /// - /// - /// - public void AddChildBefore(ItemInfoList myItemInfoList, bool expand) - { - if (myItemInfoList != null) - foreach (ItemInfo item in myItemInfoList) - AddChildBefore(item, expand); - } - public EditItem AddChildBefore(ItemInfoList myItemInfoList, EditItem nextEditItem) - { - EditItem child = null; - if (myItemInfoList != null) - foreach (ItemInfo item in myItemInfoList) - child = AddChildBefore(item, nextEditItem); - return child; - } - /// - /// Add an RNO (Contingency) child - /// - /// - /// - public void AddChildRNO(ItemInfo myItemInfo, bool expand) - { - EditItem child = new RTBItem(myItemInfo, MyStepPanel, this, ChildRelation.RNO, expand); - } - public void AddChildSupInfo(ItemInfo myItemInfo, bool expand) - { - EditItem child = new RTBItem(myItemInfo, MyStepPanel, this, ChildRelation.SupInfo, expand); - } - /// - /// Add a list of RNO (Contingency) children - /// - /// - /// - public void AddChildRNO(ItemInfoList myItemInfoList, bool expand) - { - if (myItemInfoList != null) - foreach (ItemInfo item in myItemInfoList) - AddChildRNO(item, expand); - } - public void AddChildSupInfo(ItemInfoList myItemInfoList, bool expand) - { - if (myItemInfoList != null) - foreach (ItemInfo item in myItemInfoList) - AddChildSupInfo(item, expand); - } - /// - /// Add a child after - /// - /// - /// - public EditItem AddChildAfter(ItemInfo MyItemInfo, bool expand, bool addFirstChld) - { - EditItem child = null; - if (MyItemInfo.IsFigure) - child = new ImageItem(MyItemInfo, MyStepPanel, this, ChildRelation.After, expand); - else if (MyItemInfo.IsRtfRaw) - child = new RtfRawItem(MyItemInfo, MyStepPanel, this, ChildRelation.After, expand); - else if (MyItemInfo.MyContent.MyGrid != null) - child = new GridItem(MyItemInfo, MyStepPanel, this, ChildRelation.After, expand); - else - child = new RTBItem(MyItemInfo, MyStepPanel, this, ChildRelation.After, expand, addFirstChld); - return child; - } - public EditItem AddChildAfter(ItemInfo MyItemInfo, EditItem nextEditItem) - { - EditItem child = null; - if (MyItemInfo.IsFigure) - child = new ImageItem(MyItemInfo, MyStepPanel, this, ChildRelation.After, true, nextEditItem, FigInsType); - else if (MyItemInfo.IsRtfRaw) - child = new RtfRawItem(MyItemInfo, MyStepPanel, this, ChildRelation.After, true, nextEditItem); - else if (MyItemInfo.MyContent.MyGrid != null) - child = new GridItem(MyItemInfo, MyStepPanel, this, ChildRelation.After, true, nextEditItem); - else - child = new RTBItem(MyItemInfo, MyStepPanel, this, ChildRelation.After, true, nextEditItem); - return child; - } - public EditItem AddChildBefore(ItemInfo MyItemInfo, EditItem nextEditItem) - { - EditItem child = null; - if (MyItemInfo.IsFigure) - child = new ImageItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem, FigInsType); - else if (MyItemInfo.IsRtfRaw) - child = new RtfRawItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem); - if(MyItemInfo.MyContent.MyGrid != null) - child = new GridItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem); - else - child = new RTBItem(MyItemInfo, MyStepPanel, this, ChildRelation.Before, true, nextEditItem); - return child; - } - public EditItem AddChildRNO(ItemInfo MyItemInfo, EditItem nextEditItem) - { - // not sure about this, i.e. whether a grid can be added here. - EditItem child = null; - //if (MyItemInfo.MyContent.ContentGridCount != 0) - if (MyItemInfo.MyContent.MyGrid != null) - child = new GridItem(MyItemInfo, MyStepPanel, this, ChildRelation.RNO, true, nextEditItem); - else - child = new RTBItem(MyItemInfo, MyStepPanel, this, ChildRelation.RNO, true, nextEditItem); - return child; - } - public EditItem AddChildSupInfo(ItemInfo MyItemInfo, EditItem nextEditItem) - { - EditItem child = null; - if (MyItemInfo.MyContent.MyGrid != null) - child = new GridItem(MyItemInfo, MyStepPanel, this, ChildRelation.SupInfo, true, nextEditItem); - else - child = new RTBItem(MyItemInfo, MyStepPanel, this, ChildRelation.SupInfo, true, nextEditItem); - return child; - } - /// - /// Adds a sibling after the current EditItem - /// - public void AddSiblingAfter() - { - AddSiblingAfter("", true); - } - public void AddSiblingAfter(string text, bool updateStatus) - { - SaveContents(); - ItemInfo newItemInfo = MyItemInfo.InsertSiblingAfter(text); - AddGridIfNeeded(newItemInfo); - AddImageIfNeeded(newItemInfo); - DoAddSiblingAfter(newItemInfo, updateStatus); - if (MyStepPanel.SelectedEditItem is RTBItem) - { - RTBItem rtbi = MyStepPanel.SelectedEditItem as RTBItem; - // see if this step has associated enhanced step(s). If it does, flag it so - // that the enhanced steps get inserted also. - StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config); - if (sc.MyEnhancedDocuments.Count > 0) - { - rtbi.EnhAddFromItemInfo = MyItemInfo; - rtbi.EnhAddType = EnhancedAddTypes.After; - } - } - } - // This logic allows us to do an Insert Before and Insert After while on a Table - // if allowed by the format - private void AddGridIfNeeded(ItemInfo newItemInfo) - { - if (this is GridItem) - { - GridItem gi = this as GridItem; - VlnFlexGrid fg = new VlnFlexGrid(gi.MyFlexGrid.Rows.Count, gi.MyFlexGrid.Cols.Count); - // bug fix B2015136 - // need to copy the font used in the table we are doing the Insert Previous/Next from. - VE_Font vefont = MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Table.Font; - Font GridFont = new Font(vefont.Family, (float)vefont.Size); - fg.Font = GridFont; - using (Item itm = newItemInfo.Get()) - { - itm.MyContent.MyGrid.Data = fg.GetXMLData(); - itm.Save(); - } - } - } - // This logic allows us to do an Insert Before and Insert After while on a Figure - // if allowed by the format. Note that Before/After for figures is only Clipboard (if - // image data exists in clipboard), or file. Doing RO images will be added later if needed - - // this decision was made because of scope. - private void AddImageIfNeeded(ItemInfo newItemInfo) - { - if (this is ImageItem) ImageItem.AddImageIfNeeded(newItemInfo); - } - - public void AddSiblingAfter(int? type, bool updateStatus) - { - SaveContents(); - ItemInfo newItemInfo = MyItemInfo.InsertSiblingAfter("", "", type); - AddGridIfNeeded(newItemInfo); - AddImageIfNeeded(newItemInfo); - DoAddSiblingAfter(newItemInfo, updateStatus); - if (MyStepPanel.SelectedEditItem is RTBItem) - { - RTBItem rtbi = MyStepPanel.SelectedEditItem as RTBItem; - // see if this step has associated enhanced step(s). If it does, flag it so - // that the enhanced steps get inserted also. - StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config); - if (sc.MyEnhancedDocuments.Count > 0) - { - rtbi.EnhAddFromItemInfo = MyItemInfo; - rtbi.EnhAddType = EnhancedAddTypes.After; - } - } - } - private void DoAddSiblingAfter(ItemInfo newItemInfo, bool updateStatus) - { - EditItem newEditItem = null; - switch (_MyChildRelation) - { - case ChildRelation.After: - newEditItem = ActiveParent.AddChildAfter(newItemInfo, MyNextEditItem); - break; - case ChildRelation.Before: - newEditItem = ActiveParent.AddChildBefore(newItemInfo, MyNextEditItem); - break; - case ChildRelation.RNO: - newEditItem = ActiveParent.AddChildRNO(newItemInfo, MyNextEditItem); - break; - case ChildRelation.SupInfo: - newEditItem = ActiveParent.AddChildSupInfo(newItemInfo, MyNextEditItem); - break; - default: // Need debug - break; - } - //EditItem newEditItem = ActiveParent.AddChildAfter(newItemInfo, ); - if (updateStatus) - MyStepPanel.SelectedEditItem = newEditItem;//Update Screen - } - protected static int _WatchThis = 1; - public void AddSiblingBefore() - { - AddSiblingBefore("", true); - } - public void AddSiblingBefore(int? type, bool updateStatus) - { - SaveContents(); - ItemInfo newItemInfo = MyItemInfo.InsertSiblingBefore("", "",type); - AddGridIfNeeded(newItemInfo); - AddImageIfNeeded(newItemInfo); - DoAddSiblingBefore(newItemInfo, updateStatus); - } - public void AddSiblingBefore(string text, bool updateSelection) - { - // Save RTB text before creating a new item because the process of creating - // a new item will save a change to iteminfo excluding text changes. This - // shouldn't be necessary for adding sibling after because the current step - // doesn't get saved during the insert after because of the MyPrevious field - // is only set on an insert before, which is what saves the item without - // any updates from the richtextbox text. - SaveContents(); - ItemInfo newItemInfo = MyItemInfo.InsertSiblingBefore(text); - AddGridIfNeeded(newItemInfo); - AddImageIfNeeded(newItemInfo); - DoAddSiblingBefore(newItemInfo, updateSelection); - if (MyStepPanel.SelectedEditItem is RTBItem) - { - RTBItem rtbi = MyStepPanel.SelectedEditItem as RTBItem; - // see if this step has associated enhanced step(s). If it does, flag it so - // that the enhanced steps get inserted also. - StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config); - if (sc.MyEnhancedDocuments.Count > 0) - { - rtbi.EnhAddFromItemInfo = MyItemInfo; - rtbi.EnhAddType = EnhancedAddTypes.Before; - } - } - } - public void DoAddSiblingBefore(ItemInfo newItemInfo, bool updateSelection) - { - EditItem newEditItem = null; - switch (_MyChildRelation) - { - case ChildRelation.After: - newEditItem = ActiveParent.AddChildAfter(newItemInfo, this); - break; - case ChildRelation.Before: - newEditItem = ActiveParent.AddChildBefore(newItemInfo, this); - break; - case ChildRelation.RNO: - newEditItem = ActiveParent.AddChildRNO(newItemInfo, this); - break; - case ChildRelation.SupInfo: - newEditItem = ActiveParent.AddChildSupInfo(newItemInfo, this); - break; - default: // Need debug - break; - } - if (updateSelection) - MyStepPanel.SelectedEditItem = newEditItem;//Update Screen - } - public void AddSiblingBeforeNoDataSave(ItemInfo newItemInfo, bool updateSelection, EditItem tt) - { - EditItem newEditItem = null; - newEditItem = ActiveParent.AddChildBefore(newItemInfo, this); - //switch (_MyChildRelation) - //{ - // case ChildRelation.After: - // newEditItem = ActiveParent.AddChildAfter(newItemInfo, this); - // break; - // case ChildRelation.Before: - // newEditItem = ActiveParent.AddChildBefore(newItemInfo, this); - // break; - // case ChildRelation.RNO: - // newEditItem = ActiveParent.AddChildRNO(newItemInfo, this); - // break; - // default: // Need debug - // break; - //} - if (updateSelection) - MyStepPanel.SelectedEditItem = newEditItem;//Update Screen - } - private bool specialAdd = false; - public void AddSiblingBeforeNoDataSave(ItemInfoList newItemInfos, bool updateSelection) - { - specialAdd = true; - EditItem newEditItem = null; - newEditItem = ActiveParent.AddChildAfter(newItemInfos, false, true); - if (updateSelection) - MyStepPanel.SelectedEditItem = newEditItem;//Update Screen - specialAdd = false; - } - private ImageItem.E_ImageSource FigInsType = ImageItem.E_ImageSource.None; - public void AddChild(E_FromType fromType, int type, ImageItem.E_ImageSource newSource) - { - FigInsType = newSource; - AddChild("", fromType, type, null); - FigInsType = ImageItem.E_ImageSource.None; - } - public void AddChild(E_FromType fromType, int type) - { - AddChild("", fromType, type, null); - } - public void AddChild(E_FromType fromType, int type, VlnFlexGrid vfGrid) - { - AddChild("", fromType, type, vfGrid); - } - public void AddChild(string text, E_FromType fromType, int type, VlnFlexGrid vfGrid) - { - if ((_MyItemInfo.IsHigh && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format) || _MyItemInfo.IsSection) - CanExpand = true; - this.Expanded = true; - _WatchThis = 1; - ItemInfo newItemInfo = MyItemInfo.InsertChild(fromType, type, text); - if (vfGrid != null) - { - string xml = vfGrid.GetXMLData(); - using (Item itm = newItemInfo.Get()) - { - itm.MyContent.MyGrid.Data = xml; - itm.Save(); - // newItemInfo.MyContent.MyGrid.ResetContent(itm.MyContent.MyGrid); // Do I need this? - } - } - // TODO: We need to determine where this will go in the stack of children - EditItem nextItem = GetNextItem(fromType, newItemInfo); - // TODO: May need similar logic if a Table is being added to a step that has substeps - // else if (fromType == E_FromType.Table && ((ItemInfo)newItemInfo.ActiveParent).Steps != null - //&& ((ItemInfo)newItemInfo.ActiveParent).Steps.Count > 0) - // nextItem = MyStepPanel.FindItem(((ItemInfo)newItemInfo.ActiveParent).Steps[0]); - EditItem newEditItem; - switch (fromType) - { - case E_FromType.Caution: - newEditItem = this.AddChildBefore(newItemInfo, nextItem); - break; - case E_FromType.Note: - newEditItem = this.AddChildBefore(newItemInfo, nextItem); - break; - case E_FromType.Procedure: - newEditItem = this.AddChildAfter(newItemInfo, nextItem); - break; - case E_FromType.RNO: - newEditItem = this.AddChildRNO(newItemInfo, nextItem); - break; - case E_FromType.Section: - newEditItem = this.AddChildAfter(newItemInfo, nextItem); - break; - case E_FromType.Step: - newEditItem = this.AddChildAfter(newItemInfo, nextItem); - break; - case E_FromType.Table: - newEditItem = this.AddChildAfter(newItemInfo, nextItem); - break; - case E_FromType.SupInfo: - newEditItem = this.AddChildSupInfo(newItemInfo, nextItem); - break; - default: - newEditItem = this.AddChildAfter(newItemInfo, nextItem); - break; - } - MyStepPanel.SelectedEditItem = newEditItem;//Update Screen - if (MyStepPanel.SelectedEditItem is RTBItem) - { - RTBItem rtbi = MyStepPanel.SelectedEditItem as RTBItem; - // see if this step has associated enhanced step(s). If it does, flag it so - // that the enhanced steps get inserted also. - EnhancedDocuments cfgeds = null; - if (MyItemInfo.IsStepSection) - { - SectionConfig scfg = MyItemInfo.MyConfig as SectionConfig; - if (scfg.Section_LnkEnh != "Y") return; - cfgeds = scfg.MyEnhancedDocuments; - } - else - { - StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config); - cfgeds = sc.MyEnhancedDocuments; - } - if (cfgeds != null && cfgeds.Count > 0) - { - rtbi.EnhAddFromItemInfo = MyItemInfo; - rtbi.EnhAddType = EnhancedAddTypes.Child; - } - } - } - public EditItem GetNextItem(E_FromType fromType, ItemInfo newItemInfo) - { - EditItem nextItem = null; - if (newItemInfo.NextItem != null) - nextItem = MyStepPanel.FindItem(newItemInfo.NextItem); - else if (fromType == E_FromType.Table && MyAfterEditItems != null) - nextItem = MyAfterEditItems[0]; - // Cautions come before notes, so if this is a Caution and there are Notes, put this first - else if (fromType == E_FromType.Caution && ((ItemInfo)newItemInfo.ActiveParent).Notes != null - && ((ItemInfo)newItemInfo.ActiveParent).Notes.Count > 0) - nextItem = MyStepPanel.FindItem(((ItemInfo)newItemInfo.ActiveParent).Notes[0]); - return nextItem; - } - /// - /// Add a list of children after - /// - /// - /// - public EditItem AddChildAfter(ItemInfoList myItemInfoList, bool expand, bool addFirstChld) - { - EditItem child = null; - int indx = 0; - if (myItemInfoList != null) - foreach (ItemInfo item in myItemInfoList) - { - if (addFirstChld) - { - // the first time add it as first child, the rest should be done in between. - child = AddChildAfter(item, expand, addFirstChld); - addFirstChld = false; - } - else - child = AddChildAfter(item, this._MyAfterEditItems[indx]); - indx++; - } - return child; - } - public EditItem AddChildAfter(ItemInfoList myItemInfoList, bool expand) - { - EditItem child = null; - if (myItemInfoList != null) - foreach (ItemInfo item in myItemInfoList) - child = AddChildAfter(item, expand, false); - return child; - } - public EditItem AddChildAfter(ItemInfoList myItemInfoList, EditItem nextEditItem) - { - EditItem child = null; - if (myItemInfoList != null) - foreach (ItemInfo item in myItemInfoList) - child = AddChildAfter(item, nextEditItem); - return child; - } - #endregion - #region CopyPaste - public void PasteSiblingBefore(int copyStartID) - { - ItemInfo newItemInfo = MyItemInfo.PasteSiblingBefore(copyStartID, GetChangeId(MyItemInfo)); - - if (newItemInfo.ItemID == MyItemInfo.ItemID) return; - - EditItem newEditItem = null; - switch (_MyChildRelation) - { - case ChildRelation.After: - newEditItem = ActiveParent.AddChildAfter(newItemInfo, this); - break; - case ChildRelation.Before: - newEditItem = ActiveParent.AddChildBefore(newItemInfo, this); - break; - case ChildRelation.RNO: - newEditItem = ActiveParent.AddChildRNO(newItemInfo, this); - break; - case ChildRelation.SupInfo: - newEditItem = ActiveParent.AddChildSupInfo(newItemInfo, this); - break; - default: // Need debug - break; - } - if (newEditItem != null) MyStepPanel.SelectedEditItem = newEditItem;//Update Screen - MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.Before, newItemInfo.MyContent.Type)); - - // MyItemInfo is the 'paste from' item, if it has enhanced need to copy and paste the steps in enhanced. - ItemInfo newEnh = newItemInfo.EnhancedPasteItem(copyStartID, MyItemInfo, ItemInfo.EAddpingPart.Before, GetChangeId(MyItemInfo)); - // if enhanced items were created, then see if they need displayed: - if (newEnh != null) AddAllEnhancedItemsToDisplay(newItemInfo); - } - private void AddAllEnhancedItemsToDisplay(ItemInfo newItemInfo) - { - EnhancedDocuments eds = newItemInfo.GetMyEnhancedDocuments(); - if (eds != null && eds.Count > 0) - { - foreach (EnhancedDocument ed in eds) - AddEnhancedItemToDisplayTabItem(ItemInfo.Get(ed.ItemID)); - } - } - public void AddEnhancedItemToDisplayTabItem(ItemInfo newEnh) - { - // if tabcontrol was open for enhanced, display the steps: - ItemInfo proc = newEnh.MyProcedure; // Find procedure Item - string key = "Item - " + proc.ItemID.ToString(); - if (MyStepPanel.MyStepTabPanel.MyDisplayTabControl._MyDisplayTabItems.ContainsKey(key)) - { - DisplayTabItem pg = MyStepPanel.MyStepTabPanel.MyDisplayTabControl._MyDisplayTabItems[key]; - // _MyDisplayTabItems (in line above) had tabs that were closed, so use the next line - // to validate that the tab is still open. - foreach (DisplayTabItem ti in MyStepPanel.MyStepTabPanel.MyDisplayTabControl.MyBar.Items) - { - if (ti == pg) pg.MyStepTabPanel.MyStepPanel.GetEditItem(newEnh); - } - } - } - public void CreateLinksEnhancedSingleItem(ItemInfo srcII, ItemInfo enhII, int enhtype) - { - srcII.DoCreateLinksEnhancedSingleItem(enhII, enhtype); - SetFocus(); - } - public void CreateLinksEnhancedAllInProcedure(ItemInfo srcII, ItemInfo enhII, int enhtype) - { - using (ContentInfoList cil = ContentInfoList.Convert16To32EnhancedContents(srcII.ItemID, enhII.ItemID, enhtype)) - { - foreach (ContentInfo ci in cil) - { - using (Content c = ci.Get()) - { - // first refresh configs because the ContentInfo.Refresh causes events to occur that refresh screen - // and if configs aren't done first, the screen refresh, if based on config data, will not be correct. - foreach (ItemInfo ii in ci.ContentItems) ii.RefreshConfig(); - ContentInfo.Refresh(c); - } - } - } - } - public void UnlinkEnhanced(ItemInfo enhII) - { - enhII.DoUnlinkEnhanced(enhII); - SetFocus(); - } - public ItemInfo AddMissingEnhancedStep(ItemInfo ii, int EnhType) - { - // if the missing enhanced step is a caution or note, check that parent HLS has the needed - // enhanced step to insert the caution/note from. If not, do a message. - if (ii.IsCaution || ii.IsNote) - { - bool canMakeMissingStep = false; - StepConfig sc = ii.MyHLS.MyConfig as StepConfig; - foreach (EnhancedDocument ed in sc.MyEnhancedDocuments) - { - if (EnhType == ed.Type) // the hls has an enhanced linked step of this type, the caution/note can be made: - { - canMakeMissingStep = true; - break; - } - } - if (!canMakeMissingStep) - { - MessageBox.Show("Cannot create the missing enhanced step, the Enhanced Step for the High Level step must be created first."); - return null; - } - } - ItemInfo newEnh = ii.DoAddMissingEnhancedItems(EnhType); - // if enhanced items were created, then see if they need displayed: - if (newEnh != null) AddAllEnhancedItemsToDisplay(MyItemInfo); - SetFocus(); - return newEnh; - } - private string GetChangeId(ItemInfo iiDest) - { - // get the change id for the destination's procedure's change id. - string chgid = null; - if (iiDest.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds) - chgid = MyStepPanel.MyStepTabPanel.MyDisplayTabControl.ItemsChangeIds[iiDest.MyProcedure.ItemID]; - return chgid; - } - public void PasteSiblingAfter(int copyStartID) - { - ItemInfo newItemInfo = MyItemInfo.PasteSiblingAfter(copyStartID, GetChangeId(MyItemInfo)); - if (newItemInfo.ItemID == MyItemInfo.ItemID) return; - EditItem newEditItem = null; - switch (_MyChildRelation) - { - case ChildRelation.After: - newEditItem = ActiveParent.AddChildAfter(newItemInfo, MyNextEditItem); - break; - case ChildRelation.Before: - newEditItem = ActiveParent.AddChildBefore(newItemInfo, MyNextEditItem); - break; - case ChildRelation.RNO: - newEditItem = ActiveParent.AddChildRNO(newItemInfo, MyNextEditItem); - break; - case ChildRelation.SupInfo: - newEditItem = ActiveParent.AddChildSupInfo(newItemInfo, MyNextEditItem); - break; - default: // Need debug - break; - } - MyStepPanel.SelectedEditItem = newEditItem;//Update Screen - MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.After, newItemInfo.MyContent.Type)); - - // MyItemInfo is the 'paste from' item, if it has enhanced need to copy and paste the steps in enhanced. - ItemInfo newEnh = newItemInfo.EnhancedPasteItem(copyStartID, MyItemInfo, ItemInfo.EAddpingPart.After, GetChangeId(MyItemInfo)); - if (newEnh != null) AddAllEnhancedItemsToDisplay(newItemInfo); - } - public void PasteChild(int copyStartID) - { - ItemInfo newItemInfo = MyItemInfo.PasteChild(copyStartID, GetChangeId(MyItemInfo)); - - E_FromType fromType = E_FromType.Step; - if (MyItemInfo.MyContent.Type < 10000) - fromType = E_FromType.Procedure; - else if (MyItemInfo.MyContent.Type < 20000) - fromType = E_FromType.Section; - else if (MyItemInfo.MyContent.Type > 19999) - { - int tmptype = (int)MyItemInfo.MyContent.Type - 20000; - if (MyItemInfo.IsCaution) fromType = E_FromType.Caution; - else if (MyItemInfo.IsNote) fromType = E_FromType.Note; - else if (MyItemInfo.IsTable) fromType = E_FromType.Table; - else if (MyItemInfo.IsRNOPart) fromType = E_FromType.RNO; - else if (MyItemInfo.IsSupInfoPart) fromType = E_FromType.SupInfo; - } - EditItem nextItem = GetNextItem(fromType, newItemInfo); - EditItem newEditItem; - - switch (fromType) - { - case E_FromType.Caution: - newEditItem = this.AddChildBefore(newItemInfo, nextItem); - break; - case E_FromType.Note: - newEditItem = this.AddChildBefore(newItemInfo, nextItem); - break; - case E_FromType.Procedure: - newEditItem = this.AddChildAfter(newItemInfo, nextItem); - break; - case E_FromType.RNO: - newEditItem = this.AddChildRNO(newItemInfo, nextItem); - break; - case E_FromType.Section: - newEditItem = this.AddChildAfter(newItemInfo, nextItem); - break; - case E_FromType.Step: - newEditItem = this.AddChildAfter(newItemInfo, nextItem); - break; - case E_FromType.Table: - newEditItem = this.AddChildAfter(newItemInfo, nextItem); - break; - case E_FromType.SupInfo: - newEditItem = this.AddChildSupInfo(newItemInfo, nextItem); - break; - default: - newEditItem = this.AddChildAfter(newItemInfo, nextItem); - break; - } - MyStepPanel.SelectedEditItem = newEditItem;//Update Screen - - // MyItemInfo is the 'paste from' item, if it has enhanced need to copy and paste the steps in enhanced. - ItemInfo newEnh = newItemInfo.EnhancedPasteItem(copyStartID, MyItemInfo, ItemInfo.EAddpingPart.Child, GetChangeId(MyItemInfo)); - if (newEnh != null) AddAllEnhancedItemsToDisplay(newItemInfo); - } - public EditItem PasteReplace(int copyStartID) - { - // To allow a Paste Step into an empty (new) step/substep, we need to add a character to the the Text field - // to simulate replacing an existing step - otherwise we will get null references. - if (MyStepPanel.SelectedEditItem.Empty) - MyStepPanel.SelectedEditItem.Empty=false; - MyStepPanel.SelectedEditItem = null; // Unselect the item to be deleted - ChildRelation childRelation = _MyChildRelation; - EditItem newFocus = null; - EditItem nextEditItem = MyNextEditItem; - EditItem prevEditItem = MyPreviousEditItem; - EditItem parentEditItem = ActiveParent; - - StepConfig savOrigPasteConfig = MyItemInfo.MyConfig as StepConfig; - int TopMostYBefore = TopMostEditItem.Top; - int? TopMostParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.TopMostEditItem.Top)); - int? ParentY = (MyParentEditItem == null ? null : (int?)(MyParentEditItem.Top)); - ItemInfo newItemInfo = null; - try - { - newItemInfo = Item.PasteReplace(MyItemInfo, copyStartID, GetChangeId(MyItemInfo)); - } - //catch (System.Data.SqlClient.SqlException ex) - catch (Exception ex) - { - if (HandleSqlExceptionOnCopy(ex)) return this; - HandleSqlExceptionOnDelete(ex); - return this; - } - // Remove the EditItem that was the replaced item. - RemoveFromParentsChildList(); - - if (MyNextEditItem != null) - { - if (MyPreviousEditItem != null) - { - MyNextEditItem.MyPreviousEditItem = MyPreviousEditItem; - MyPreviousEditItem = null; - } - else - { - MyNextEditItem.MyParentEditItem = MyParentEditItem; - MyParentEditItem = null; - MyNextEditItem.MyPreviousEditItem = null; - } - MyNextEditItem = null; - } - else if (MyPreviousEditItem != null) - { - MyPreviousEditItem.MyNextEditItem = null; - newFocus = MyPreviousEditItem; - MyPreviousEditItem = null; - } - else - { - newFocus = MyParentEditItem; - MyParentEditItem = null; - } - - // add copied item to ui where the replaced item was. - EditItem newEditItem = null; - switch (childRelation) - { - case ChildRelation.After: - newEditItem = parentEditItem.AddChildAfter(newItemInfo, nextEditItem); - break; - case ChildRelation.Before: - newEditItem = parentEditItem.AddChildBefore(newItemInfo, nextEditItem); - break; - case ChildRelation.RNO: - newEditItem = parentEditItem.AddChildRNO(newItemInfo, nextEditItem); - break; - case ChildRelation.SupInfo: - newEditItem = parentEditItem.AddChildSupInfo(newItemInfo, nextEditItem); - break; - default: // Need debug - break; - } - MyStepPanel.SelectedEditItem = newEditItem; //Update Screen - MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.Replace, newItemInfo.MyContent.Type)); - // MyItemInfo is the 'paste from' item, if it has enhanced need to copy and paste the steps in enhanced. - ItemInfo newEnh = newItemInfo.PasteEnhancedItems(copyStartID, MyItemInfo, ItemInfo.EAddpingPart.Replace, GetChangeId(MyItemInfo)); - if (newEnh != null) AddAllEnhancedItemsToDisplay(newItemInfo); // KBR - I think this won't work for replace!! - return newEditItem; - } - private bool HandleSqlExceptionOnCopy(Exception ex) - { - if (ex.Message.Contains("This step has been deleted")) - { - MessageBox.Show("The step being pasted has been deleted", "Cannot Paste Step", MessageBoxButtons.OK, MessageBoxIcon.Hand); - return true; - } - if(ex.Message.Contains("This current step has been deleted in another session")) - { - MessageBox.Show("The highlighted step has been deleted by another user.", "Cannot Paste Step", MessageBoxButtons.OK, MessageBoxIcon.Hand); - return true; - } - return false; - } - public void IdentifyChildren(bool highlight) - { - // Highlight children of EditItem: - if (MyAfterEditItems != null) - { - foreach (EditItem sia in MyAfterEditItems) - { - sia.IdentifyMe(highlight); - sia.IdentifyChildren(highlight); - } - } - if (MyBeforeEditItems != null) - { - foreach (EditItem sib in MyBeforeEditItems) - { - sib.IdentifyMe(highlight); - sib.IdentifyChildren(highlight); - } - } - if (MyRNOEditItems != null) - { - foreach (EditItem sir in MyRNOEditItems) - { - sir.IdentifyMe(highlight); - sir.IdentifyChildren(highlight); - } - } - if (MySupInfoEditItems != null) - { - foreach (EditItem sis in MySupInfoEditItems) - { - sis.IdentifyMe(highlight); - sis.IdentifyChildren(highlight); - } - } - } - #endregion - #region Event Handlers - private string WatchThisIndent - { - get { return "".PadLeft(_WatchThis, '\t'); } - } - protected bool RNOBelow - { - get - { - if (_MyRNOEditItems != null) - { - return _MyRNOEditItems[0].RNOLevel > _MyItemInfo.ColumnMode; - //return _MyRNOEditItems[0].Left == Left; - } - return false; - } - } - protected bool RNORight - { - get - { - if (_MyRNOEditItems != null) - { - return _MyRNOEditItems[0].RNOLevel <= _MyItemInfo.ColumnMode; - //return _MyRNOEditItems[0].Left != Left; - } - return false; - } - } - protected void MoveRNO() - { - if (_MyRNOEditItems != null) - { - if (_MyRNOEditItems[0].TopMostEditItem.Top != Top) - { - //if(_MyLog.IsDebugEnabled)_MyLog.DebugFormat("\r\n'Adjust RNO',{0},'Move',{1}", MyID, _RNO[0].MyID); - EditItem rnoTop = _MyRNOEditItems[0].TopMostEditItem; - if (rnoTop.RNOLevel <= _MyItemInfo.ColumnMode) - { - //EditItem tmpBottom = this; - //if (_MyAfterEditItems != null) tmpBottom = _MyAfterEditItems[_MyAfterEditItems.Count - 1].BottomMostEditItem; - MyStepPanel.ItemMoving++; - rnoTop.LastMethodsPush(string.Format("EditItem_Move RNO Right {0}", rnoTop.MyID)); - //rnoTop.Top = tmpBottom.Bottom; - if (rnoTop.Top != Top) - rnoTop.Top = Top; - rnoTop.LastMethodsPop(); - MyStepPanel.ItemMoving--; - } - else - { - MyStepPanel.ItemMoving++; - rnoTop.LastMethodsPush(string.Format("EditItem_Move RNO Below {0} {1} {2}", rnoTop.MyID, BottomMostEditItemNoRNOs.MyID, BottomMostEditItemNoRNOs.Bottom)); - if (rnoTop.Top != BottomMostEditItemNoRNOs.Bottom) - rnoTop.Top = BottomMostEditItemNoRNOs.Bottom; - rnoTop.LastMethodsPop(); - MyStepPanel.ItemMoving--; - } - } - } - } - protected void MoveSupInfo() // If the current item has supplemental information, be sure its top location is that of the current item. - { - if (_MySupInfoEditItems != null && _MySupInfoEditItems.Count > 0) - { - EditItem supInfoTop = _MySupInfoEditItems[0].TopMostEditItem; - if (supInfoTop.Top != Top + supInfoTop.SupInfoTopOffset) - { - MyStepPanel.ItemMoving++; - supInfoTop.LastMethodsPush(string.Format("EditItem_Move SupInfo Right {0}", supInfoTop.MyID)); - supInfoTop.Top = Top + supInfoTop.SupInfoTopOffset; - supInfoTop.LastMethodsPop(); - MyStepPanel.ItemMoving--; - } - } - } - private bool _TryAgainLater = false; - public bool TryAgainLater - { - get { return _TryAgainLater; } - set { _TryAgainLater = value; } - } - //static bool _ShowChanges=false; - int _LastTop = 0; - - // Bug Fix: B2017-059 only turn on the spellchecking if the RTB is visible. This controls the number of windows handles created durning spellchecking - private void TurnOnSpellCheckIfVisible() - { - if (MyStepRTB != null) - { - if (this.Top + this.Height > 0 && this.Top < MyStepPanel.Height) - MyStepRTB.SpellCheckStatus = true; - else - MyStepRTB.SpellCheckStatus = false; - } - } - /// - /// Handles movement of the EditItems - /// - /// - /// - // use the following to debug if two steps are to be displayed one right after the other vertically, but they are getting separated, overwritten, - // gaps. See code below at the beginning of EditItem_Move that uses these. - //static EditItem ei_below; - //static EditItem ei_above; - private void EditItem_Move(object sender, EventArgs e) - { - //if (MyID == 205300) ei_above = this; - //if (MyID == 205306) ei_below = this; - //if (ei_below != null && ei_above != null && MyID == ei_below.MyID && ei_below.Top != ei_above.Bottom) Console.WriteLine("here"); - TurnOnSpellCheckIfVisible(); - int newTop = Top - MyStepPanel.TopMostEditItem.Top; - //if(_ShowChanges && _LastTop != newTop && MyItemInfo.InList(134786)) - //Volian.Base.Library.vlnStackTrace.ShowStackLocal(2,10,"\"EditItem_Move\"\t\"\"\t\"{0}\"\t{1}\t{2}\t{3}",MyItemInfo.ShortPath, MyID, Top, _LastTop); - if (_LastTop == newTop) return; - _LastTop = newTop; - int watchThis = _WatchThis; - if (MyStepPanel.ItemMoving == 0 && !TryAgainLater) - { - //vlnStackTrace.ScrollInStack(); - return; // If 0 - Indicates scrolling which requires no action. - } - TryAgainLater = false; - //ShowMe("Move"); - if (MyItemInfo == null) - return; - //if (_WatchThis > 0 && MyID > _StartingID) - //{ - - // Console.WriteLine("{0}Start Move {1},{2}", WatchThisIndent, MyID, this); - // if (MyID == _LookForID) - // Console.WriteLine("{0}---------------", WatchThisIndent,MyID, this); - // _WatchThis++; - //} - if (MyExpandingStatus == ExpandingStatus.Expanding) - { - _WatchThis = watchThis; - return; - } - Moving = true; - EditItem tmp = (EditItem)sender; - if (tmp.MyPreviousEditItem == null && tmp.MyParentEditItem == null) - { - _WatchThis = watchThis; - return; - } - if (RNOBelow) // Adjust substeps first - { - //Console.WriteLine("RNOBelow"); - AdjustLocation(); - MoveRNO(); - } - else // Adjust RNO First - { - if (RNORight) - { - //Console.WriteLine("RNORight"); - MoveRNO(); - } - AdjustLocation(); - } - Moving = false; - EditItem btm = BottomMostEditItem; - EditItem supinfo = null; - if (MySupInfoEditItems != null && MySupInfoEditItems.Count > 0) supinfo = MySupInfoEditItems[0].BottomMostEditItem; - if (supinfo != null && supinfo.Bottom > btm.Bottom) btm = supinfo; - if (this != btm) - btm.AdjustLocation(); - //if (_WatchThis > 0 && MyID > _StartingID) - //{ - // Console.WriteLine("{0}Finish Move {1},{2}",WatchThisIndent, MyID, this); - //} - _WatchThis = watchThis; - } - /// - /// Adjust the locations when the EditItem is resized - /// - /// - /// - private void EditItem_Resize(object sender, EventArgs e) - { - if (MyItemInfo == null) return; - if (_IgnoreResize) return; - AdjustLocation(); - HandleResize(); - AdjustAllForSupInfoHeight(); - } - #endregion // Event Handlers - #region Private and Protected Methods - /// - /// Calculates the table location - /// - /// - /// - /// - /// - protected Point TableLocation(StepSectionLayoutData myStepSectionLayoutData, int width) - { - // bug fix: B2016-111 - myParentEditItem was getting a null reference error when inserting a figure before/after a figure - EditItem myParentEditItem = _MyParentEditItem; - if (myParentEditItem == null) - { - EditItem parentEI = _MyPreviousEditItem; - while (parentEI._MyPreviousEditItem != null) - parentEI = parentEI._MyPreviousEditItem; - myParentEditItem = parentEI._MyParentEditItem; - } - // Should center on parent unless it is a centered table type in the AER column or parent is another table type, then - // walk up until finding a non-table type step'. (B2016-264: insert of centered eq off centered eq was not locating child equation correctly) - EditItem aboveForLocation = myParentEditItem; - if (aboveForLocation.MyItemInfo.IsTable || aboveForLocation.MyItemInfo.IsRtfRaw || aboveForLocation.MyItemInfo.IsFigure) - { - while (aboveForLocation.MyItemInfo.IsFigure || aboveForLocation.MyItemInfo.IsRtfRaw || aboveForLocation.MyItemInfo.IsTable) aboveForLocation = aboveForLocation.MyParentEditItem; - } - - int center = aboveForLocation.ContentLeft + aboveForLocation.ContentWidth / 2; - int rightLimit = aboveForLocation.Right; - // Then should center on the wid Limit - if ((MyItemInfo.FormatStepData.Type.Contains("AER") == false && MyItemInfo.RNOLevel == 0 ) && !MyItemInfo.IsInSupInfo) - { - // B2017-043 COLR is used as a Width - int colR = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColRTable, MyItemInfo.ColumnMode); - rightLimit += colR * MyItemInfo.ColumnMode; - center += (colR * MyItemInfo.ColumnMode) / 2; - center -= (aboveForLocation.ContentLeft - (int)MyItemInfo.MyDocStyle.Layout.LeftMargin) / 2; - } - - // Calulate the x location - //int x = myParentEditItem.TextLeft; - int x = center - width / 2; - if (x + width > rightLimit) x = rightLimit - width; - // B2017-043 account for Horizontal Scroll - int colT =MyStepPanel.DisplayRectangle.X + MyStepPanel.ToDisplay((int)myStepSectionLayoutData.ColT); - if (x < colT) x = colT; - int y = FindTop(myParentEditItem.Bottom); - return new Point(x, y); - } - protected void DoMouseWheel(MouseEventArgs e) - { - MyStepPanel.MouseWheel(e); - } - protected void InsertPgBrk() - { - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.btnInsPgBrk_Click(this, new EventArgs()); - MyStepPropertiesPanel.UpdatePageBreakCheckBox(); // update the checkbox on the Step Properties panel - if (!MyStepRTB.ContainsFocus) - MyStepRTB.Focus(); - } - protected void ToggleChangeBar() - { - MyStepPropertiesPanel.ToggleChangeBar(); // update the checkbox on the Step Properties panel - if (!MyStepRTB.ContainsFocus) - MyStepRTB.Focus(); - } - protected void ToggleContinuousActionSummary() - { - if (MyStepPropertiesPanel != null) // bug fix B2016-256 check for a null reference incase we are not on a step element - MyStepPropertiesPanel.ToggleContActSummary(); // update the checkbox on the Step Properties panel - if (!MyStepRTB.ContainsFocus) - MyStepRTB.Focus(); - } - protected void TogglePlaceKeeper() - { - MyStepPropertiesPanel.TogglePlaceKeeper(); // update the checkbox on the Step Properties panel - if (!MyStepRTB.ContainsFocus) - MyStepRTB.Focus(); - } - protected void TogglePlaceKeeperContAct() - { - MyStepPropertiesPanel.TogglePlaceKeeperContAct(); // update the checkbox on the Step Properties panel - if (!MyStepRTB.ContainsFocus) - MyStepRTB.Focus(); - } - protected void ToggleSuperScript() - { - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.btnSuperscript_Click(this, new EventArgs()); // click the Superscrpt button on the ribbon - if (!MyStepRTB.ContainsFocus) - MyStepRTB.Focus(); - } - protected void ToggleSubScript() - { - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.btnSubscript_Click(this, new EventArgs()); // click the Subscrpt button on the ribbon - if (!MyStepRTB.ContainsFocus) - MyStepRTB.Focus(); - } - protected void OpenAnnotations() - { - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.btnAnnots_Click(this, new EventArgs()); - } - protected bool CheckClipboard() - { - return (MyStepPanel.MyStepTabPanel.MyDisplayTabControl.MyCopyStep != null); - } - protected void CopyStep() - { - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.DoCopyStep(); - } - /// - /// Finds the last child in a list - /// - /// - /// - private static EditItem LastChild(List childEditItems) - { - return childEditItems[childEditItems.Count - 1]; - } - /// - /// If the selected EditItem is within the window leave it as it is. - /// If not, scroll so that the selected window is centered. - /// - protected void ScrollToCenter() - { - //vlnStackTrace.ShowStack("CenterScroll {0} Current {1} Top {2} Bottom {3} Limit {4}", _MyItem.ItemID, _Panel.VerticalScroll.Value, Top, Bottom, _Panel.Height);// Show StackTrace - //Console.WriteLine("CenterScroll {0} Current {1} Top {2} Bottom {3} Limit {4}", _MyItem.ItemID, _Panel.VerticalScroll.Value, Top, Bottom, _Panel.Height); - if (Top >= 0 && Bottom <= MyStepPanel.Height) return;// Don't move if within screen. - int scrollValue = MyStepPanel.VerticalScroll.Value + (Top - (MyStepPanel.Height / 2)); // calculate scroll center for the item - // Limit scroll location within allowable values - scrollValue = Math.Max(MyStepPanel.VerticalScroll.Minimum,Math.Min(MyStepPanel.VerticalScroll.Maximum,scrollValue)); - //Console.WriteLine("CenterScroll {0} Current {1} New {2} Min {3} Max {4}", _MyItem.ItemID, _Panel.VerticalScroll.Value, scrollValue, _Panel.VerticalScroll.Minimum, _Panel.VerticalScroll.Maximum); - //if (scrollValue >= MyStepPanel.VerticalScroll.Minimum && scrollValue <= MyStepPanel.VerticalScroll.Maximum) // If it is within range - MyStepPanel.VerticalScroll.Value = scrollValue; // Center the item - } - - /// - /// Hide a Items Children - Part of colapsing - /// - protected void HideChildren() - { - HideChildren(_MyBeforeEditItems); - HideChildren(_MyRNOEditItems); - HideChildren(_MySupInfoEditItems); - HideChildren(_MyAfterEditItems); - } - /// - /// Hide a list of children - Part of colapsing - /// - /// - private void HideChildren(List childEditItems) - { - if (childEditItems != null) - { - foreach (EditItem child in childEditItems) - { - if (child.Expanded) child.HideChildren(); - child.Hidden = true; - } - } - } - /// - /// Unhide an items Children - Part of expanding - /// - /// - protected void UnhideChildren(bool expand) - { - UnhideChildren(_MyBeforeEditItems, expand); - UnhideChildren(_MyRNOEditItems, expand); - UnhideChildren(_MySupInfoEditItems, expand); - UnhideChildren(_MyAfterEditItems, expand); - MatchExpanded(); - - } - /// - /// Unhide a list of children - part of expanding - /// - /// - /// - private void UnhideChildren(List childEditItems, bool expand) - { - if (childEditItems != null) - { - foreach (EditItem child in childEditItems) - { - if (child.Expanded) - child.UnhideChildren(expand); - else if (expand) - child.Expand(expand); - child.Hidden = false; - } - } - } - /// - /// Move children as necessary - /// - protected void AdjustChildren() - { - AdjustChildren(_MyBeforeEditItems); - AdjustChildren(_MyRNOEditItems); - AdjustChildren(_MySupInfoEditItems); - AdjustChildren(_MyAfterEditItems); - } - /// - /// Move a list of children - /// - /// - private void AdjustChildren(List childEditItems) - { - if (childEditItems != null) - { - foreach (EditItem child in childEditItems) - { - child.AdjustLocation(); - if (child.Expanded) child.AdjustChildren(); - } - } - } - /// - /// Expand a list of children - /// - /// - private void ExpandChildren(List childEditItems) - { - if (childEditItems != null) - { - foreach (EditItem child in childEditItems) - { - if (child.CanExpand) - { - child.Expand(true); - } - child.Hidden = false; - } - } - } - /// - /// Expand children - /// - private void ExpandChildren() - { - // Walk though Children performing Expand - ExpandChildren(_MyBeforeEditItems); - ExpandChildren(_MyRNOEditItems); - ExpandChildren(_MySupInfoEditItems); - ExpandChildren(_MyAfterEditItems); - } - private string MyPath - { - get - { - if (MyItemInfo.MyContent.Type >= 20000) - return MyItemInfo.Path.Substring(MyItemInfo.ActiveSection.Path.Length); - return MyItemInfo.MyContent.ToString(); - } - } - private EditItem AEREditItem - { - get - { - if (RNOLevel == 0) return null; - if (MyParentEditItem != null) - { - if (MyParentEditItem.RNOLevel < RNOLevel) - return MyParentEditItem; - else - return MyParentEditItem.AEREditItem; - } - else if (MyPreviousEditItem != null) - { - return MyPreviousEditItem.AEREditItem; - } - //Volian.Base.Library.vlnStackTrace.ShowStackLocal("'AEREditItem',{0},{1}", MyID, MyItemInfo.DBSequence); - return null; - } - } - /// - /// Adjust the Location of all items below the current item. - /// - internal void AdjustLocation() - { - if (RNORight) MoveRNO(); // This is needed when an AER is Deleted that has an RNO. - MoveSupInfo(); // If the current item has supplemental information, be sure its top location is that of the current item. - if (RNOLevel > 0 && AEREditItem != null) - AEREditItem.AdjustLocation(); - EditItem nextEditItem = NextDownEditItem; - //if(_LookForID.Contains(MyID)) - // Console.WriteLine("{0}AdjustLocation {1},{2},{3} -> {4},{5} ({6}) {7}", WatchThisIndent, MyID, MyItemInfo.Ordinal, MyPath, - // nextEditItem == null ? 0 : nextEditItem.MyID, nextEditItem == null ? 0 : nextEditItem.MyItemInfo.Ordinal, nextEditItem == null ? "Null" : nextEditItem.MyPath, - // _NextDownEditItemPath); - if (nextEditItem != null) - { - if (MyStepPanel.ExpandingHLS != null && nextEditItem.MyItemInfo.IsSection) return; // without this, if next item is section, it crashes on null reference - if (MyStepPanel.ExpandingHLS != null && nextEditItem.MyItemInfo.MyHLS.ItemID != MyStepPanel.ExpandingHLS.ItemID) - return; - int bottom = nextEditItem.FindTop(Bottom); - if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format) - { - if (MyItemInfo.IsCaution || MyItemInfo.IsNote) - { - if (nextEditItem.MyItemInfo.IsHigh || (nextEditItem.MyItemInfo.IsNote && MyItemInfo.IsCaution)) - { - bottom = FirstSiblingEditItem.Top; - } - // RHM 20170216 - // MyParent will walk back MyPrevious to find Parent - // NextDevDocStep will find the first part of a Dev Doc HLS - AdjustForDevDocStepHeight(); - } - } - // SameRowAsParent - Comanche Peak Step Designator - //FormatData fmtdata = MyItemInfo.ActiveFormat.PlantFormat.FormatData; - //int formatSteptype = MyItemInfo.FormatStepType; - //if (fmtdata.StepDataList[formatSteptype].SameRowAsParent) - //if (MyItemInfo.SameRowAsParent && MyItemInfo.IsCaution2) - // bottom = Top; - - // If this is a "TitleWithTextRight", don't move down on the screen but only if it has a - // child, i.e. want the child to be positioned on line, but if no child, move down on screen: - int newTop = bottom; - if (MyItemInfo.IsSupInfoPart) newTop = Math.Max(bottom, nextEditItem.BottomOfStepImmediatelyAbove()); - if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format) // Deviation Document Format - if (MyItemInfo.IsStep && nextEditItem.MyItemInfo.IsStep && nextEditItem.MyItemInfo.MyHLS.ItemID != MyItemInfo.MyHLS.ItemID)// Move from one step to another - newTop = FindBottomDevDoc;// Use the bottom most caution or note - - if (MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.Type == "TitleWithTextRight" && MyItemInfo.HasChildren) newTop = Top; - //This was useful to find the code that was positioning the Deviationn Document steps - //if (MyItemInfo.InList(134782, 134783) || nextEditItem.MyItemInfo.InList(134782, 134783)) - // Console.WriteLine("\"AdjustLocation\"\t\"{0}\"\t\"{1}\"\t{2}\t{3}\t{4}\t{5}", MyItemInfo.ShortPath, nextEditItem.MyItemInfo.ShortPath, nextEditItem.MyID, newTop, FindBottom, FindBottom - Top); - if (nextEditItem.Top != newTop) - { - MyStepPanel.ItemMoving++; - nextEditItem.LastMethodsPush(string.Format("AdjustLocation {0}", MyID)); - nextEditItem._NextDownEditItemPath = _NextDownEditItemPath; - float oldTop = nextEditItem.Top; - nextEditItem.ExpandPrefix = 0;// If I move then I have to move my children when I expand - // it appears that setting the top doesn't always work. The logic below checks to see if it does - // not work and trys some other things so that the EditItem will be moved to the correct place. - // As a last attempt, the EditItem is added to a list to be refreshed from a timer on MyStepPanel. - if (nextEditItem.MySupInfoEditItems != null && nextEditItem.MySupInfoEditItems.Count > 0) newTop = nextEditItem.MySupInfoEditItems[0].FindTop(newTop); - nextEditItem.Top = newTop; - if (nextEditItem.Top != newTop) - { - //_MyLog.InfoFormat("'TryAgainLater',{0},{1},{2},{3},{4},'{5}'", - // oldTop, nextEditItem.Top, newTop, MyStepPanel.Height, nextEditItem.MyID, nextEditItem.MyItemInfo.ShortPath); - nextEditItem.TryAgainLater = true; - } - nextEditItem.LastMethodsPop(); - MyStepPanel.ItemMoving--; - } - } - } - private int _DevDocHeight = 0; // Deviation Document Step Height B2016-123, B2017-020, B2017-021 - public int DevDocHeight - { - get { return _DevDocHeight; } - set { _DevDocHeight = value; } - } - public void TryAgainNow(int bottom) - { - TryToSetTop(bottom-10); - //TryToSetTop(bottom+10); - TryToSetTop(bottom); - } - private void TryToSetTop(int offset) - { - Top = offset; - if (Top != offset) - _MyLog.InfoFormat("Didn't work - Top {0} != offset {1} {2}", Top, offset,MyStepPanel.VerticalScroll.Value); - } - /// - /// Automatically expands Steps if not currently expanded - /// - internal void AutoExpand() - { - if (CanExpand && Expanded == false)// TODO: May need to do some additional checking for subsections - { - if(MyStepPanel.AutoExpand) - Expand((_ContentType >= 20000) || MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format); - else - Expand(false); - //Console.WriteLine(" - /// Expand an item and it's children - /// If the children have been loaded then just expand them - /// If not, load the children and expand their children etc. - /// - /// normally equal to _Type > = 20000 (Step) - public void Expand(bool expand) - { - //// TIMING: DisplayItem.TimeIt("Expand Start"); - if (_ChildrenLoaded) - { - // Unhide Children - MyExpandingStatus = ExpandingStatus.Showing; - UnhideChildren(expand); - if (ExpandPrefix != 0) - { - MyStepPanel.ItemMoving++; - if (TopMostEditItem.Top != Top) - TopMostEditItem.Top = Top; - MyStepPanel.ItemMoving--; - } - else - TopMostEditItem.AdjustLocation(); - //_ShowChanges = true; - AdjustChildren(); - //_ShowChanges = false; - //if(_Before != null ) - // Top = _Before[_Before.Count - 1].BottomMost.Bottom; - } - else - { - if (MyItemInfo.IsHigh) MyStepPanel.ExpandingHLS = MyItemInfo; - MyExpandingStatus = ExpandingStatus.Expanding; - _ChildrenLoaded = true; - //_Panel.SuspendLayout(); - AddChildBefore(MyItemInfo.Cautions, expand); - AddChildBefore(MyItemInfo.Notes, expand); - AddChildAfter(MyItemInfo.Procedures, expand); - if (MyItemInfo.RNOs != null && MyItemInfo.RNOLevel < MyItemInfo.ColumnMode) - AddChildRNO(MyItemInfo.RNOs, expand); - if (MyItemInfo.RNOs != null && ((MyItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds)) - AddChildAfter(MyItemInfo.RNOs, expand); - AddChildSupInfo(MyItemInfo.SupInfos, expand); - AddChildAfter(MyItemInfo.Tables, expand); - // get the config item for the steps section. there is an 'editable' - // flag used in metasections to define whether the steps should print. - // this flag can be toggle on the section's properties dialog. - // Only check the flag if the section has subsections because the - // default for the flag is not editable, and this would make non-metasections - // not editable. - bool hasMetaSubs = MyItemInfo.IsSection && MyItemInfo.Sections != null && MyItemInfo.Sections.Count>0; - bool EditSteps = !hasMetaSubs || (MyItemInfo.MyConfig is SectionConfig && (MyItemInfo.MyConfig as SectionConfig).SubSection_Edit == "Y"); - if (EditSteps) AddChildAfter(MyItemInfo.Steps, expand); - - if (MyItemInfo.RNOs != null && MyItemInfo.RNOLevel >= MyItemInfo.ColumnMode && - !((MyItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds)) - AddChildRNO(MyItemInfo.RNOs, expand); - AddChildAfter(MyItemInfo.Sections, expand); - MatchExpanded(); - if (MyItemInfo.IsHigh) MyStepPanel.ExpandingHLS = null; - } - MyExpandingStatus = ExpandingStatus.Done; - BottomMostEditItem.AdjustLocation(); - MyExpandingStatus = ExpandingStatus.No; - //// TIMING: DisplayItem.TimeIt("Expand End"); - } - public EditItem BeforeItem - { - get - { - if (_MyAfterEditItems != null) - { - foreach (EditItem EditItem in _MyAfterEditItems) - { - if (EditItem._MyBeforeEditItems != null) - return EditItem.TopMostEditItem; - EditItem beforeItem = EditItem.BeforeItem; - if (beforeItem != null) return beforeItem; - } - } - return null; - } - } - public EditItem ItemAbove - { - get - { - if (_MyChildRelation == ChildRelation.Before) return _MyParentEditItem.ItemAbove; - if (_MyPreviousEditItem != null) return _MyPreviousEditItem.BottomMostEditItem; - if (_MyChildRelation == ChildRelation.After) return _MyParentEditItem; - if (_MyChildRelation == ChildRelation.RNO) return _MyParentEditItem; - if (_MyChildRelation == ChildRelation.SupInfo) return _MyParentEditItem; - return null; - } - } - private static int? max(int? value1, int value2) - { - if (value1 == null || value2 > value1) return value2; - return value1; - } - private static int min(int value1, int value2) - { - if (value2 < value1) return value2; - return value1; - } - public int FindRight() - { - if (!RNORight) return Right; - return _MyRNOEditItems[0].FindRight(); - } - public int? BottomOfParentRNO() - { - int? bottom = null; - EditItem EditItem = this; - if (!MyItemInfo.IsTablePart) - { - if (EditItem._MyChildRelation == ChildRelation.None) - return null; - if (EditItem._MyChildRelation == ChildRelation.After && !RNORight) - return null; - } - while (EditItem != null && EditItem._MyChildRelation != ChildRelation.None && EditItem._MyChildRelation != ChildRelation.After) - EditItem = EditItem.UpOneEditItem; - if (EditItem == null || EditItem._MyChildRelation == ChildRelation.None) - return null; - EditItem parent = EditItem.UpOneEditItem; - int right = FindRight(); - bool centeredTable = (MyItemInfo.IsTablePart && MyItemInfo.FormatStepData.Type.Contains("AER") == false && MyItemInfo.RNOLevel == 0); - while (parent != null && parent.MyItemInfo.IsSection == false && parent._MyChildRelation != ChildRelation.Before) - { - if (parent._MyRNOEditItems != null) - { - if (centeredTable || right > parent._MyRNOEditItems[0].Left) - { - if (parent._MyRNOEditItems[0].BottomMostEditItem.RNOLevel > RNOLevel && RNOLevel < _MyItemInfo.ColumnMode) - bottom = max(bottom, parent._MyRNOEditItems[0].BottomMostEditItem.Bottom); - } - } - parent = parent.UpOneEditItem; - } - return bottom; - } - public int? BottomOfParentSupInfo() - { - int? bottom = null; - if (Colapsing) return null; - EditItem parent = this; - while (parent != null && parent.MyItemInfo.IsSection == false && parent._MyChildRelation != ChildRelation.Before) - { - if (parent._MySupInfoEditItems != null) return parent._MySupInfoEditItems[0].BottomMostEditItem.Bottom; - parent = parent.UpOneEditItem; - } - return bottom; - } - private string _NextDownEditItemPath = "None"; - public string NextDownEditItemPath - { - get { return _NextDownEditItemPath; } - } - /// - /// This finds the next EditItem down. - /// - public EditItem NextDownEditItem - { - get - { - EditItem EditItem = this; - _NextDownEditItemPath = "Path 1"; - // If this item appears before it's parent, and it doesn't have anything below it, return the parent - if (MyNextEditItem == null && MyAfterEditItems == null && FirstSiblingEditItem._MyChildRelation == ChildRelation.Before) - return UpOneEditItem; - _NextDownEditItemPath = "Path 2"; - if (Expanded && _MyAfterEditItems != null)// check to see if there is a _After - return MyAfterEditItems[0].TopMostEditItem;// if there is, go that way - _NextDownEditItemPath = "Path 3"; - if (Expanded && MyRNOEditItems != null && MyItemInfo.RNOLevel >= MyItemInfo.ColumnMode)// check to see if there is a _After - return MyRNOEditItems[0].TopMostEditItem;// if there is, go that way - while (EditItem != null && EditItem.MyNextEditItem == null) // if no Next walk up the parent path - { - bool lastWasRNO = (EditItem._MyChildRelation == ChildRelation.RNO); - EditItem = EditItem.UpOneEditItem; - _NextDownEditItemPath = "Path 4"; - if (EditItem == null) // No Parent - return null; - _NextDownEditItemPath = string.Format("Path 5 {0}, {1}", EditItem.MyExpandingStatus, EditItem.Moving); - if (EditItem.MyExpandingStatus == ExpandingStatus.Expanding || EditItem.Moving) // Parent Expanding or Moving - Wait - return null; - _NextDownEditItemPath = "Path 5 RNO"; - if (EditItem.RNOBelow && !Ancestor(EditItem.MyRNOEditItems[0])) - return EditItem.MyRNOEditItems[0]; - _NextDownEditItemPath = "Path 6"; - if (EditItem.MyNextEditItem == null && EditItem.FirstSiblingEditItem._MyChildRelation == ChildRelation.Before) - return EditItem.UpOneEditItem; - EditItem btm = EditItem.BottomMostEditItem; // Find the Bottom EditItem of this ancestor - EditItem beforeItem = EditItem.BeforeItem; - if (lastWasRNO && beforeItem != null) - { - _NextDownEditItemPath = "Path 7"; - if (beforeItem.ItemAbove.Bottom > this.Bottom) return null; - _NextDownEditItemPath = "Path 8"; - return beforeItem; - } - if (this != btm) // If this is not the bottom, then just adjust things with respect to the bottom - { - EditItem btmNext = btm.NextDownEditItem; - //if (EditItem.MyNextEditItem != null && EditItem.MyNextEditItem.TopMostEditItem.Top != btm.Bottom) - if (btmNext != null) - { - int bottom = btmNext.FindTop(btm.Bottom); - if (btmNext.MySupInfoEditItems != null && btmNext.MySupInfoEditItems.Count > 0) - { - int btmSupInfo = btmNext.MySupInfoEditItems[0].FindTop(btm.Bottom); - if (btmSupInfo > bottom) bottom = btmSupInfo; - } - if (btmNext.Top != bottom) - { - MyStepPanel.ItemMoving++; - //EditItem.MyNextEditItem.TopMostEditItem.Top = btm.Bottom; - //Console.WriteLine("{0}***Move in NextDownEditItem {1},{2} From {3} To {4}",WatchThisIndent, btmNext.MyID, btmNext, btmNext.Top, btm.Bottom); - btmNext.LastMethodsPush(string.Format("NextDownEditItem {0} {1}", MyID, EditItem.MyID)); - //ShowMe(string.Format("FindTop = {0}", btmNext.FindTop(btm.Bottom))); - if (btmNext.Top != bottom) - btmNext.Top = bottom; - btmNext.LastMethodsPop(); - MyStepPanel.ItemMoving--; - } - } - _NextDownEditItemPath = string.Format("Path 9 {0}", btm); - return null; // Not the bottom - don't adjust anything else - } - //else - //{ - //} - } - if (EditItem != null) - { - // Need to verify that the bottom of the parents RNO does not excede the bottom of this item. - EditItem next = EditItem.MyNextEditItem.TopMostEditItem; - _NextDownEditItemPath = "Path A"; - //if (Bottom >= (BottomOfParentRNO(next) ?? Bottom)) - return next;// if no _After - check to see if there is a Next - //_NextDownEditItemPath = "Path B"; - //return null; - } - _NextDownEditItemPath = "Path C"; - return null; - } - } - - private bool Ancestor(EditItem EditItem) - { - if (MyID == EditItem.MyID) return true; - if (MyItemInfo.IsHigh) return false; - return UpOneEditItem.Ancestor(EditItem); - } - public override string ToString() - { - return _MyItemInfo == null ? base.ToString() : string.Format("{0},'{1}',{2},{3}", MyID, MyPath, Top, Bottom); // + "-" + MyItemInfo.MyContent.Text; - } - #endregion - #region Abstract Methods and Properties - public abstract int TableWidth { get; } - public abstract int BorderWidth { get; } - public abstract Point ContentLocation { get; set; } - public abstract string TabFormat { get; set; } - public abstract void AdjustTableWidthAndLocation(); - public abstract void SetToolTip(string tip); - public abstract void RefreshContent(); - //public abstract EditItem MyPreviousEditItem { get; set; } - public abstract int ItemLeft { get; set; } - public abstract int ContentLeft { get; } - public abstract int ContentWidth { get; set; } - public abstract Point ItemLocation { get; set; } - public abstract int ItemWidth { get; set; } - public abstract void RefreshOrdinal(); - public abstract bool Expanded { get; set; } - public abstract void RefreshTab(); - public abstract void SetFocus(); - public abstract void SaveContents(); - public abstract bool CanExpand { get; set; } - public abstract void HandleResize(); - public abstract void MatchExpanded(); - public abstract void ItemSelect(); - public abstract void ItemShow(); - public abstract StepRTB MyStepRTB { get; } - public abstract DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg); - public abstract bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse); - public abstract void PositionToEnd(); - public abstract void PositionToStart(); - public abstract string SelectedTextForFind { get;} - public abstract bool SpellCheckNext(); - public abstract void IdentifyMe(bool highlight); - public abstract void SetActive(); - public abstract bool Empty { get; set; } - //public abstract bool IsEmpty(); - //public abstract void MakeNotEmpty(); - public abstract void RefreshDisplay(bool activeMode); - public abstract void ToggleEditView(E_ViewMode vwMode); - public abstract int TabLeft { get; set; } - public abstract Font TabFont { get; set; } - public abstract string TabText { get; } - public abstract Point TabLocation { get; } - public abstract Font ContentFont { get; set; } - public abstract float ContentTop { get; } - public abstract void SetupHeader(ItemInfo itemInfo); - public abstract void ShowExpanded(); - public abstract void SetText(); - public abstract void SetExpandAndExpander(ItemInfo itemInfo); - public abstract void SaveCurrentAndContents(); - #endregion - private int SupInfoTopOffset - { - get - { - return _MyParentEditItem.MyStepRTB.Location.Y - MyStepRTB.Location.Y; - } - } - protected string _TabFormat; - private static int _WidthAdjust = 5; - protected bool _IgnoreResize = false; - private int FindBottomDevDoc // Find Bottom of a Deviation Document Step - { - get - { - int y = BottomMostEditItem.Bottom;// RHM 20170216 Get the bottom most step of a High Level step (RNOs and Substeps) - if (MyParentEditItem == null || MyParentEditItem.MyItemInfo.IsSection) - { - EditItem eitm2 = this; - if (eitm2 != null && eitm2.MyBeforeEditItems != null) - foreach (EditItem eitm2Tmp in eitm2.MyBeforeEditItems) - y = Math.Max(y, eitm2Tmp.Bottom); - return y; - } - y = Math.Max(y, MyParentEditItem.Bottom); - EditItem eitm = MyParentEditItem; - while (eitm != null && !eitm.MyItemInfo.IsHigh) eitm = eitm.MyParent; - if (eitm != null && eitm.MyBeforeEditItems != null) - foreach (EditItem eitmTmp in eitm.MyBeforeEditItems) - y = Math.Max(y, eitmTmp.Bottom); - return y; - } - } - /// - /// Sets the parent and postions the item with respect to the parent - /// - public EditItem MyParentEditItem - { - get { return _MyParentEditItem; } - set - { - LastMethodsPush("set_MyParentRTBItem"); - _MyParentEditItem = value; - if (_MyParentEditItem != null) - { - switch (_MyChildRelation) - { - case ChildRelation.None: // Same as after - case ChildRelation.After: // Procedures, sections, substeps, and tables/figures - // The size depends upon the parent type - int iType = (int)_MyParentEditItem.ContentType; - - switch (iType / 10000) - { - case 0: // Procedure - ItemLocation = new Point(_MyParentEditItem.ItemLocation.X + 20, _MyParentEditItem.Bottom); - int widt = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT); - int wids = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, 0); - int width = Math.Max(widt, wids); - ItemWidth = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColT) + width; - break; - case 1: // Section - if (this == TopMostEditItem) - { - if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format) - { - if (MyPreviousEditItem != null) - { - EditItem ei = MyPreviousEditItem.BottomMostEditItem; - if (ei.MyItemInfo.IsHigh && (ei.MyItemInfo.Cautions !=null || ei.MyItemInfo.Notes!=null)) - { - if (ei.MyItemInfo.Cautions!= null)// Look at cautions - { - EditItem eic = MyStepPanel._LookupEditItems[ei.MyItemInfo.Cautions[0].ItemID].BottomMostEditItem; - if (eic.Bottom > ei.Bottom) ei = eic; - } - if (ei.MyItemInfo.Notes!= null)//Look at notes - { - EditItem ein = MyStepPanel._LookupEditItems[ei.MyItemInfo.Notes[0].ItemID].BottomMostEditItem; - if (ein.Bottom > ei.Bottom) ei = ein; - } - } - // B2017-043 Account for the Horizonal Scroll position when locating the step - ItemLocation = new Point(MyStepPanel.DisplayRectangle.X + MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColS) + 50, ei.Bottom); - } - else - // B2017-043 Account for the Horizonal Scroll position when locating the step - ItemLocation = new Point(MyStepPanel.DisplayRectangle.X + MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColS) + 50, _MyParentEditItem.Bottom); - } - else - ItemLocation = new Point(_MyParentEditItem.ItemLocation.X + 20, _MyParentEditItem.Bottom); - } - else - TopMostEditItem.ItemLocation = new Point(TopMostEditItem.ItemLocation.X, _MyParentEditItem.Bottom); - //TextWidth = _WidthAdjust + borderWidth + MyStepPanel.ToDisplay(_MyStepSectionLayoutData.WidSTableEdit, Convert.ToInt32(_MyStepSectionLayoutData.PMode) - 1); - ContentWidth = _WidthAdjust + BorderWidth + MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, MyItemInfo.ColumnMode); - //ContentWidth = _WidthAdjust + BorderWidth; - //if (MyItemInfo.FormatStepData.WidthOverrideEdit != null && MyItemInfo.FormatStepData.WidthOverrideEdit > 0) - // ContentWidth += MyStepPanel.ToDisplay(MyItemInfo.FormatStepData.WidthOverrideEdit); - //else - // ContentWidth += MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, MyItemInfo.ColumnMode); - break; - case 2: // Step - // if Table then determine width and location based upon it's parent's location - if (MyStepData.Type == "Table" || MyStepData.ParentType == "Table") - { - AdjustTableWidthAndLocation(); - } - else if (MyStepData.Type.Contains("Figure")) - { - AdjustTableWidthAndLocation(); - } - else if (MyItemInfo.IsRtfRaw) - { - AdjustTableWidthAndLocation(); - } - else - { - if (MyItemInfo.FormatStepData.StepLayoutData.AlignWithParentTab) - // Paul Linn made the request on 6/4/12 to align the Component Description & - // Required Position under the Component Number. - ItemLocation = new Point(_MyParentEditItem.ItemLocation.X, _MyParentEditItem.Bottom); - // part of F2017-011, for enhanced backgrounds, always align the TitleWithTextRight and TitleWithTextBelow with the parent tab (on the screen) - else if ((MyItemInfo.FormatStepData.Type == "TitleWithTextRight" || MyItemInfo.FormatStepData.Type == "TitleWithTextBelow") && ((MyItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds)) // align with parent tab if in background document - ItemLocation = new Point(_MyParentEditItem.ItemLocation.X, _MyParentEditItem.Bottom); - else if (MyItemInfo.FormatStepData.Type == "TitleWithTextRight" && (MyItemInfo.Steps == null || MyItemInfo.Steps.Count == 0)) // this code is run for siblings within a HLS (but not last sibling). - ItemLocation = new Point(_MyParentEditItem.ItemLocation.X, _MyParentEditItem.Bottom); - else if (MyItemInfo.MyParent.FormatStepData.Type == "TitleWithTextRight") - ItemLocation = new Point(_MyParentEditItem.ItemLocation.X + _MyParentEditItem.ItemWidth + 10, _MyParentEditItem.ItemLocation.Y); // F2017-011 added 10 to fix positoning of Purpose text on sceen (enhanced backgrounds) - else if (MyItemInfo.MyTab.Offset != 0) - ContentLocation = new Point(_MyParentEditItem.ContentLocation.X + 10, _MyParentEditItem.Bottom); - //ItemLocation = new Point(_MyParentEditItem.ItemLocation.X+10, _MyParentEditItem.Bottom); - else - { - // B2016-134 Fix - If a previous step exists, use it to locate the current step - if (_MyPreviousEditItem != null) - ItemLocation = new Point(_MyParentEditItem.ContentLeft, _MyPreviousEditItem.BottomMostEditItem.Bottom); - else - { - ItemLocation = new Point(_MyParentEditItem.ContentLeft, _MyParentEditItem.Bottom); - // if inserting a substep within supplemental information, then may have to adjust steps too: - if (MyItemInfo.IsInSupInfo) - { - AdjustLocation(); - // find parent of supinfo & adjust its location: - ItemInfo supInfoPart = MyItemInfo; - while (!supInfoPart.IsSupInfoPart) supInfoPart = supInfoPart.MyParent; - EditItem eitmp = MyStepPanel._LookupEditItems[supInfoPart.ItemID]; - eitmp.MyParentEditItem.AdjustLocation(); - } - } - } - bool specialTplSupport = ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd) || - (MyItemInfo.MyDocStyle.LandscapePageList && MyItemInfo.MyDocStyle.ComponentList); - bool wecTplSupport = ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_ChklstEditSize) == E_DocStructStyle.DSS_ChklstEditSize); - if (MyItemInfo.FormatStepData.ReadOnly) - { - Graphics g = CreateGraphics(); - SizeF sz = g.MeasureString(MyItemInfo.MyContent.Text, MyItemInfo.FormatStepData.Font.WindowsFont); - ItemWidth = (int)sz.Width; - } - else if (MyItemInfo.FormatStepData.Type == "TitleWithTextRight" && specialTplSupport) - { - Graphics g = CreateGraphics(); - SizeF sz = g.MeasureString(MyItemInfo.MyContent.Text, MyItemInfo.FormatStepData.Font.WindowsFont); - ItemWidth = (int)sz.Width + 5; - } - else if (MyItemInfo.FormatStepData.Type == "TitleWithTextBelow" && specialTplSupport) - { - ItemWidth = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, 0); - } - else if (wecTplSupport || (MyItemInfo.MyParent.FormatStepData.Type == "TitleWithTextBelow" && specialTplSupport)) - { - ItemWidth = MyParentEditItem.ItemWidth - RTBItem.RTBMargin; - } - else if (MyItemInfo.MyParent.FormatStepData.Type == "TitleWithTextRight" && - ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)) - { - ItemWidth = MyParentEditItem.MyParentEditItem.ContentWidth - MyParentEditItem.ItemWidth; - } - else if (MyItemInfo.MyParent.FormatStepData.Type == "TitleWithTextRight") - { - ItemWidth = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColT) + MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, 0); - ItemWidth = ItemWidth - ItemLocation.X; - } - else if (MyParentEditItem != null && MyParentEditItem.MyItemInfo.FormatStepData.ReadOnly) - ItemWidth = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColT) + MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, 0); - else if (MyItemInfo.MyTab != null && MyItemInfo.MyTab.Offset != 0) - { - // Farley - part of bug fix B2015-123 alignment of tabs on the edit screen (Farly is only one using tab offset) - ContentWidth = _MyParentEditItem.ContentWidth; - int xOffTabNew = (MyItemInfo.MyParent.MyTab != null ? MyItemInfo.MyParent.MyTab.Offset : MyItemInfo.MyParent.OffsetTab) + MyItemInfo.MyTab.Offset; - xOffTabNew += MyItemInfo.MyParent.MyTab == null ? 0 : MyItemInfo.MyParent.MyTab.Offset; - int xIncrement = xOffTabNew - MyItemInfo.MyTab.Offset; - MyStepRTB.Location = new Point(MyStepRTB.Location.X + xIncrement, MyStepRTB.Location.Y); - } - else - ItemWidth = _MyParentEditItem.ContentWidth; - } - break; - } - break; - case ChildRelation.SupInfo: // on a supplemental info item - EditItem high = MyStepPanel._LookupEditItems[MyItemInfo.MyHLS.ItemID]; - if (_MyParentEditItem.MyItemInfo.IsNote || _MyParentEditItem.MyItemInfo.IsCaution) - { - ContentWidth = high.ContentWidth - high.ContentLocation.X; - } - else - ContentWidth = _MyParentEditItem.ContentWidth; - // Currently on the supinfo, so MyParentEditItem is the step the supinfo is related to. - // From this MyParentEditItem, need to find what is the bottom of the 'previous step' on the screen where 'previous step' can be: - // 1) The bottom most EditItem from a caution/note, i.e. MyBeforeEditItems. This must be checked first. - // 2) If there is a MyParentEditItem, use it (only MyParentEditItem or MyPreviousEditItem can be set), if going to parent don't use - // BottomMostEditItem because that will take it onto this step or subsequent substeps. So just use its bottom. Note that there - // are special cases if on a Note/Caution (see below for comments) - // 3) If there is no MyBeforeEditItems & no MyParentEditItems, there must be a MyPreviousEditItems. Use its MyBottomMostEditItem's bottom - // since this previous may have substeps. - int btm = MyParentEditItem.BottomOfStepImmediatelyAbove(); - int topp = FindTop(btm, false); - if (topp != 0) - { - MyStepPanel.ItemMoving++; - _MyParentEditItem.Top = (int)topp; - if (_MyParentEditItem.MyItemInfo.Steps != null && _MyParentEditItem.MyItemInfo.Steps.Count > 0) - { - EditItem chtmp = GetEditItemFromItemID(_MyParentEditItem.MyItemInfo.Steps[0].ItemID); - if (chtmp != null && chtmp._MyParentEditItem != null) - { - chtmp.Top = chtmp._MyParentEditItem.Bottom; - chtmp.AdjustLocation(); - } - } - _MyParentEditItem.AdjustLocation(); - MyStepPanel.ItemMoving--; - } - ContentLocation = new Point(high.ContentLeft + high.Width + 36, (int)_MyParentEditItem.Top + SupInfoTopOffset); // account for Caution/Note tab above caution/note - break; - case ChildRelation.RNO: - // this is set so that TextWidth command below will be correct. TextWidth uses - // the tab start & tab width to calculate the overall width. - TabFormat = ""; // this is set so that TextWidth command below will be correct - _IgnoreResize = true; - // Use the RNOWidthAlt value if it exists instead of the default RNO width - // Note that I needed to add 1 to the ToDisplay() value to be closer to the needed - // width for the screen (this does not affect the printout) - // If in single column, don't make this adjustment: - string[] splitRNOWidthAlt = MyStepSectionLayoutData.RNOWidthAlt.Split(','); - int ovrRNOWidth = (RNOLevel < splitRNOWidthAlt.Length)?MyStepPanel.ToDisplay(float.Parse(splitRNOWidthAlt[RNOLevel])+1) : 0; - if (MyStepSectionLayoutData.RNOWidthAlt != null && ovrRNOWidth > 1 && MyItemInfo.ColumnMode != 0) - ContentWidth = ovrRNOWidth; - else - ContentWidth = _MyParentEditItem.ContentWidth; - _IgnoreResize = false; - if (RNOLevel <= MyItemInfo.ColumnMode) - { - //int colR = MyStepPanel.ToDisplay(_MyStepSectionLayoutData.ColRTable, Convert.ToInt32(_MyStepSectionLayoutData.PMode) - 1); - int colR = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColRTable, MyItemInfo.ColumnMode); - if (colR - _MyParentEditItem.Width < 0) colR = _MyParentEditItem.Width + 0; - MyStepPanel.ItemMoving++; - //Left = _MyParentRTBItem.ItemLeft + RNOLevel * colR; - //ItemLocation = new Point(_MyParentRTBItem.ItemLeft + RNOLevel * colR, _MyParentRTBItem.Top); - LastMethodsPush(string.Format("set_MyParentRTBItem RNO Right {0}", MyID)); - ItemLocation = new Point(_MyParentEditItem.ItemLeft + RNOLevel * colR, _MyParentEditItem.Top); - int top = _MyParentEditItem.FindTop(_MyParentEditItem.Top); - if (top != _MyParentEditItem.Top) - { - _MyParentEditItem.LastMethodsPush(string.Format("set_MyParentRTBItem RNO Right {0}", MyID)); - if (_MyParentEditItem.Top != top) - _MyParentEditItem.Top = top; - _MyParentEditItem.LastMethodsPop(); - Top = top; - } - LastMethodsPop(); - MyStepPanel.ItemMoving--; - } - else - { - MyStepPanel.ItemMoving++; - LastMethodsPush(string.Format("set_MyParentRTBItem RNO Below {0} {1} {2}", MyID, _MyParentEditItem.BottomMostEditItem.MyID, _MyParentEditItem.BottomMostEditItem.Bottom)); - ContentLocation = new Point(_MyParentEditItem.ContentLeft, _MyParentEditItem.BottomMostEditItem.Bottom); - LastMethodsPop(); - //TextLocation = new Point(_MyParentRTBItem.TextLeft, FindTop(_MyParentRTBItem.Top)); - MyStepPanel.ItemMoving--; - } - // Same size as the Parent - break; - case ChildRelation.Before: // Cautions and Notes - //if(_WatchThis > 0 && MyID > 2111) - // Console.WriteLine("Setting MyParent: \r\n\tParent {0},{1} \r\n\tTopMostItem {2},{3} \r\n\tNext {4}, {5}", _MyParentRTBItem.MyID, _MyParentRTBItem - // ,_MyParentRTBItem.TopMostRTBItem.MyID,_MyParentRTBItem.TopMostRTBItem - // , _MyNextRTBItem == null ? 0 : _MyNextRTBItem.MyID, _MyNextRTBItem == null ? "None" : _MyNextRTBItem.ToString()); - - //Location = new Point(_MyParentRTBItem.Left + 20, max(_MyParentRTBItem.Top, (_MyNextRTBItem == null ? 0 : _MyNextRTBItem.Top )) ?? 0); - _IgnoreResize = true; - int spaceToRTB = 23; - _IgnoreResize = false; - MyStepPanel.ItemMoving++; - //Location = new Point(_MyParentRTBItem.Left + 20, FindTop(_MyParentRTBItem.Top)); - int myTop = 0; - if (MyNextEditItem == null) - myTop = _MyParentEditItem.Top; - else - myTop = MyNextEditItem.Top; - - //if (MyItemInfo.SameRowAsParent && MyItemInfo.IsCaution2) - //{ - // if (MyItemInfo.WidthOverride > 0) - // Width = MyStepPanel.ToDisplay(MyItemInfo.WidthOverride) + spaceToRTB; - //} - if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsCaution || MyItemInfo.IsNote)) - { - // B2017-043 account for Horizontal Scroll - int x = MyStepPanel.DisplayRectangle.X + MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT); - int y = Top; - if (MyPreviousEditItem == null || !MyPreviousEditItem.MyItemInfo.IsCaution || !MyItemInfo.IsNote) - y = FindTop(myTop); - // Get the "bottom" number of the longest Caution/Note on the step/substep above so that - // we can position properly on the screen. - // EX. Catawba Deviations E-1 step deviation for step 10 - EditItem eitm = (MyParentEditItem.MyPreviousEditItem != null) ? MyParentEditItem.MyPreviousEditItem : MyParentEditItem.MyParentEditItem; - if (eitm != null && eitm.MyBeforeEditItems != null) - foreach (EditItem eitmTmp in eitm.MyBeforeEditItems) - y = Math.Max(y, eitmTmp.Bottom); - if (MyItemInfo.IsNote) // Move to the right based upon the Width of the Caution which is the same as the width of the note. - { // AdjustChildren width BeforeItem setting Left offset - int width = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT) + spaceToRTB; - x += width + 6;//Account for the width of the Caution in the Deviation Document - } - Location = new Point(x, y); - } - else - Location = new Point(_MyParentEditItem.Left + 20, FindTop(myTop)); - // ip2bck's needed the width to be set slightly differently to get the correct width. - int widthtpl = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT) + spaceToRTB; - if (MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.UseOldTemplate && - ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)) - widthtpl = MyParentEditItem.Width + MyParentEditItem.Left - Left; - Width = widthtpl; // MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT) + spaceToRTB; - MyStepPanel.ItemMoving--; - //_MyParentRTBItem.Top = Bottom; - // Could be a Caution or Note - Need to get WidT - break; - } - } - LastMethodsPop(); - } - } - private int BottomOfStepImmediatelyAbove() - { - int btm = 0; - if (MyBeforeEditItems != null && MyBeforeEditItems.Count > 0) // Notes & Cautions before - btm = MyBeforeEditItems[MyBeforeEditItems.Count - 1].BottomMostEditItem.Bottom; - else - { - // if on a caution or note, (the first one), need to go up to either previous step or the section to find its bottom - // _MyParentEditItem is a way to find that the structure supports this, i.e. there can be a caution or note: - if (_MyParentEditItem != null - && _MyParentEditItem.MyBeforeEditItems != null && _MyParentEditItem.MyBeforeEditItems.Count > 0 // this part checks that there are cautions/notes - && _MyParentEditItem.MyBeforeEditItems[0].MyID == MyID) // first caution or note, i.e. index of MyBeforeItems == 0 - { - if (_MyParentEditItem._MyPreviousEditItem == null) // this part checks for first HLS - btm = _MyParentEditItem._MyParentEditItem.Bottom; // bottom of the section - else - btm = _MyParentEditItem._MyPreviousEditItem.BottomMostEditItem.Bottom; // bottom of previous step - } - else - { - btm = MyParentEditItem != null ? MyParentEditItem.Bottom : MyPreviousEditItem.BottomMostEditItem.Bottom; - } - } - return btm; - } - /// - /// Sets the previous item and adjusts locations - /// - public /*override*/ EditItem MyPreviousEditItem - { - get { return _MyPreviousEditItem; } - set - { - LastMethodsPush("set_MyPreviousRTBItem"); - _MyPreviousEditItem = value; - if (_MyPreviousEditItem != null) - { - _IgnoreResize = true; - // the table code goes through the following, rather than 'istablepart' - if (MyStepData != null && ((MyStepData.Type.ToLower().Contains("table") || MyStepData.ParentType.ToLower().Contains("table")) || - (MyStepData.Type.ToLower().Contains("figure") || MyStepData.ParentType.ToLower().Contains("figure")) || - (MyStepData.Type.ToLower().Contains("equation") || MyStepData.ParentType.ToLower().Contains("equation")))) - { - ItemWidth = TableWidth; - Location = new Point(_MyPreviousEditItem.Left, FindTop(_MyPreviousEditItem.BottomMostEditItem.Bottom)); - } - else if (value.MyItemInfo.IsTablePart) - { - ItemLocation = new Point(value.MyParentEditItem.ContentLeft, value.Bottom); - ItemWidth = value.MyParentEditItem.ContentWidth; - } - else - { - if (MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.ReadOnly) - { - Graphics g = CreateGraphics(); - SizeF sz = g.MeasureString(MyItemInfo.MyContent.Text, MyItemInfo.FormatStepData.Font.WindowsFont); - ItemWidth = (int)sz.Width; - } - else if (MyPreviousEditItem != null && MyPreviousEditItem.MyItemInfo.FormatStepData != null && MyPreviousEditItem.MyItemInfo.FormatStepData.ReadOnly) - ItemWidth = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColT) + MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, 0); - // RHM The following lines were commented-out for Facing Pages (Supplemental Information) to test follow the instructions - //else if (MyItemInfo.MyTab.Offset != 0) // Farley - part of bug fix B2015-123 alignment of tabs on the edit screen (Farly is only one using tab offset) - // ContentWidth = (MyPreviousEditItem.MyItemInfo.MyTab.Offset != 0) ? MyPreviousEditItem.ContentWidth : MyPreviousEditItem.ContentWidth + 10; - else - Width = MyPreviousEditItem.Width; - - if (TopMostEditItem == this) - { - if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && - (MyItemInfo.IsNote || MyItemInfo.IsCaution) && - (MyPreviousEditItem == null || (MyPreviousEditItem.MyItemInfo.IsCaution && MyItemInfo.IsNote))) - //if ((MyItemInfo.SameRowAsParent && MyItemInfo.IsCaution2) || (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsNote || MyItemInfo.IsCaution))) - { - // B2017-043 account for Horizontal Scroll - int x = MyStepPanel.DisplayRectangle.X + MyStepPanel.ToDisplay(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColT); - if (MyItemInfo.IsNote) - x += Width + 6; - //Find first sibling - EditItem prev = _MyPreviousEditItem; - while (prev._MyPreviousEditItem != null) - prev = prev._MyPreviousEditItem; - Location = new Point(x, prev.Top);// Use the top of the first sibling - } - else - { - int top = FindTop(_MyPreviousEditItem.BottomMostEditItem.Bottom); - if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && _MyPreviousEditItem.MyItemInfo.IsHigh) - //if (MyItemInfo.SameRowAsParent || (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && _MyPreviousEditItem.MyItemInfo.IsHigh)) - { - if (_MyPreviousEditItem.MyBeforeEditItems != null) - foreach (EditItem ei in _MyPreviousEditItem.MyBeforeEditItems) - top = Math.Max(top, ei.Bottom); - } - Location = new Point(_MyPreviousEditItem.Left, top); - // B2017-029 only do this if this is a the deviation document - AdjustForDevDocStepHeight(); - AdjustAllForSupInfoHeight(); - } - } - else - TopMostEditItem.Location = new Point(TopMostEditItem.Left, FindTop(_MyPreviousEditItem.BottomMostEditItem.Bottom)); - } - _IgnoreResize = false; - //ShowMe(""); - //if (MyID > _StartingID) - // Console.WriteLine("{0}-->Setting MyPreviousRTBItem {1},{2},{3},{4},{5},{6},{7}", WatchThisIndent, MyID, this - // , _MyPreviousRTBItem - // ,Top - // , _MyPreviousRTBItem.BottomMostRTBItem.Bottom - // , FindTop(_MyPreviousRTBItem.BottomMostRTBItem.Bottom) - // , _MyPreviousRTBItem.Bottom); - //Location = new Point(_MyPreviousRTBItem.Left, _MyPreviousRTBItem.BottomMostRTBItem.Bottom); - switch (_MyChildRelation) - { - case ChildRelation.None: - break; - case ChildRelation.After: - break; - case ChildRelation.RNO: - break; - case ChildRelation.SupInfo: - break; - case ChildRelation.Before: - //MyStepPanel.ItemMoving++; - //UpOneRTBItem.Top = BottomMostRTBItem.Bottom; - //MyStepPanel.ItemMoving--; - break; - } - if (_MyPreviousEditItem.MyNextEditItem != this) _MyPreviousEditItem.MyNextEditItem = this; - } - LastMethodsPop(); - } - } - // AdjustAllForSupInfoHeight & AdjustFOrSupInfoHeight go from current edit item down, adjusting any of the edit items' top - // location to account for any supplemental informations that items may have so that either the step or its supplemental information - // does not overwrite other steps on screen. - private void AdjustAllForSupInfoHeight() - { - EditItem ei = this; - while (ei != null) - { - ei = ei.AdjustForSupInfoHeight(); - } - } - private EditItem AdjustForSupInfoHeight() - { - if (MyStepPanel._LookupEditItems.ContainsKey(MyID) && MyItemInfo.IsInSupInfo) // only do this if it is displayed (in LookupEditItems and in sup info column - { - ItemInfo supInfoPart = MyItemInfo; - while (!supInfoPart.IsSupInfoPart) supInfoPart = supInfoPart.MyParent; - EditItem EIsupInfoPartAbove = MyStepPanel._LookupEditItems[supInfoPart.ItemID]; - - // find first edititem below this (EIWsupInfoBelow) or a sibling or child child that have sup info - // if found, adjust top of this item to the bottommost edititem above this - EditItem EIWsupInfoBelow = null; - EIWsupInfoBelow = EIsupInfoPartAbove.MyParentEditItem.FindFirstChildWithSupInfo(EIsupInfoPartAbove.MyParentEditItem.MyItemInfo); - if (EIWsupInfoBelow == null) - EIWsupInfoBelow = EIsupInfoPartAbove.MyParentEditItem.FindSiblingOrParentSiblingWithSupInfo(EIsupInfoPartAbove.MyParentEditItem.MyItemInfo); - - if (EIWsupInfoBelow != null) // for editiem below, find bottom of step & subinfo column and take the max of these: - { - int bottomOfAboveSupInfoColumn = EIsupInfoPartAbove.BottomMostEditItem.Bottom; - int bottomOfImmediatelyAbove = EIWsupInfoBelow.BottomOfStepImmediatelyAbove(); - MyStepPanel.ItemMoving++; - EIWsupInfoBelow.Top = Math.Max(bottomOfAboveSupInfoColumn, bottomOfImmediatelyAbove); - EIWsupInfoBelow.AdjustLocation(); - MyStepPanel.ItemMoving--; - return EIWsupInfoBelow.MySupInfoEditItems==null?null:EIWsupInfoBelow.MySupInfoEditItems[0]; - } - } - return null; - } - private EditItem CheckForExpanded(EditItem ei) - { - ItemInfo hls = ei.MyItemInfo.MyHLS; - EditItem hlsEI = GetEditItemFromItemID(hls.ItemID); - if (hlsEI==null) return null; - return ei; - } - // FindSiblingOrParentSiblingWithSupInfo will find the next edititem below me on the screen that has a supinfo - private EditItem FindSiblingOrParentSiblingWithSupInfo(ItemInfo itm) - { - if (itm == null || itm.IsProcedure) return null; - if (itm.NextItem == null) - { - return FindSiblingOrParentSiblingWithSupInfo(itm.ActiveParent as ItemInfo); - } - EditItem chldOfNext = null; - // if section, handle notes/cautions on section and if none, look for hls (children of section) - if (itm.NextItem.IsSection) - { - if (itm.NextItem.Steps == null || itm.NextItem.Steps.Count == 0) return null; - chldOfNext = FindFirstCautionOrNoteWithSupInfo(itm.NextItem); - if (chldOfNext != null) return CheckForExpanded(chldOfNext); - chldOfNext = FindFirstChildWithSupInfo(itm.NextItem); - if (chldOfNext != null) return CheckForExpanded(chldOfNext); - return null; - } - // Handle caution/note off of itm.nextitem. See if any of those have supinfos. - chldOfNext = FindFirstCautionOrNoteWithSupInfo(itm.NextItem); - if (chldOfNext != null) return CheckForExpanded(chldOfNext); - - // this is step side (parent) of supinfo part. This step does not have any children with supinfo. - // See if any of my next siblings have supinfo - if (itm.NextItem.SupInfos != null && itm.NextItem.SupInfos.Count > 0) - { - return GetEditItemFromItemID(itm.NextItem.ItemID); - } - // no longer looking at next, go to children. - chldOfNext = FindFirstChildWithSupInfo(itm.NextItem); - if (chldOfNext != null) return CheckForExpanded(chldOfNext); - return FindSiblingOrParentSiblingWithSupInfo(itm.NextItem); - } - // FindFirstChildWithSupinfo finds the first child going down the screen that has a supinfo. It checks for cautions and - // notes first. - private EditItem FindFirstChildWithSupInfo(ItemInfo itm) - { - // If on a caution, see if there are any notes below me on the screen that have supinfo. - if (itm.IsCaution && (itm.ActiveParent as ItemInfo).Notes != null && (itm.ActiveParent as ItemInfo).Notes.Count > 0) - { - foreach (ItemInfo inote in (itm.ActiveParent as ItemInfo).Notes) - { - if (inote.SupInfos != null && inote.SupInfos.Count > 0) - return GetEditItemFromItemID(inote.ItemID); - EditItem chld = FindFirstChildWithSupInfo(inote); - if (chld != null) return CheckForExpanded(chld); - } - } - // if on a caution or note check the step below me, which is really my activeparent (cautions/notes are above their respective parent) - if ((itm.IsCaution || itm.IsNote) && (itm.NextItem == null || itm.NextItemCount == 0) && (itm.ActiveParent as ItemInfo).SupInfos != null && (itm.ActiveParent as ItemInfo).SupInfos.Count > 0) - return GetEditItemFromItemID((itm.ActiveParent as ItemInfo).ItemID); - - // Finally check substeps: - if (itm.Steps == null || itm.Steps.Count == 0) return null; - foreach (ItemInfo ii in itm.Steps) - { - if (ii.SupInfos != null && ii.SupInfos.Count > 0) - return GetEditItemFromItemID(ii.ItemID); - EditItem chld = FindFirstChildWithSupInfo(ii); - if (chld != null) return CheckForExpanded(chld); - } - return null; - } - // FindFirstCautionOrNoteWithSupInfo looks for first caution or note going down the screen that has supInfo - private EditItem FindFirstCautionOrNoteWithSupInfo(ItemInfo itm) - { - if (itm.Cautions != null && itm.Cautions.Count > 0) - { - foreach (ItemInfo ii in itm.Cautions) - { - if (ii.SupInfos != null && ii.SupInfos.Count > 0) - return GetEditItemFromItemID(ii.ItemID); - EditItem chld = FindFirstChildWithSupInfo(ii); - if (chld != null) return CheckForExpanded(chld); - } - } - if (itm.Notes != null && itm.Notes.Count > 0) - { - foreach (ItemInfo ii in itm.Notes) - { - if (ii.SupInfos != null && ii.SupInfos.Count > 0) - return GetEditItemFromItemID(ii.ItemID); - EditItem chld = FindFirstChildWithSupInfo(ii); - if (chld != null) return CheckForExpanded(chld); - } - } - return null; - } - private EditItem GetEditItemFromItemID(int itemid) - { - if (!MyStepPanel._LookupEditItems.ContainsKey(itemid)) return null; - return MyStepPanel._LookupEditItems[itemid]; - } - /// - /// Adjust the height of a Deviation Document Step Including the Cautions and Notes B2016-123, B2017-020, B2017-021 - /// - private void AdjustForDevDocStepHeight() - { - if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && MyParent.MyItemInfo.IsHigh) - { - int bot = MyParent.FindBottomDevDoc; - int DDHeight = bot - FirstSiblingEditItem.Top;//Determine the height of the step including cautions and notes - if (MyParent.DevDocHeight != DDHeight) - { - MyParent.DevDocHeight = DDHeight;// If the height has changed adjust the top of the next item down - EditItem ei = NextDevDocStep;// RHM 20170216 Locate Next Dev Doc Step - if (ei != null) - { - ei.Top = bot; - ei.AdjustLocation(); - } - } - } - } - // RHM 20170216 - Find Next Dev Doc High Level Step - // If caution Exists return caution - // If note exists return note - private EditItem NextDevDocStep - { - get - { - EditItem ei = this; - while (ei != null && !ei.MyItemInfo.IsHigh) ei = ei.MyParent;// Get High Level Step - if(ei != null) ei=ei.MyNextEditItem;// Get Next High Level Step - if (ei != null) - { - if (ei.MyItemInfo.IsHigh && (ei.MyItemInfo.Cautions != null || ei.MyItemInfo.Notes != null)) - { - if (ei.MyItemInfo.Cautions != null)// Look at cautions - { - EditItem eic = MyStepPanel._LookupEditItems[ei.MyItemInfo.Cautions[0].ItemID].BottomMostEditItem; - ei = eic; - } - else if (ei.MyItemInfo.Notes != null)//Look at notes - { - EditItem ein = MyStepPanel._LookupEditItems[ei.MyItemInfo.Notes[0].ItemID].BottomMostEditItem; - ei = ein; - } - } - } - return ei; - } - } - // RHM 20170216 Find Parent by walking up MyPrevious - private EditItem MyParent - { - get - { - if (MyParentEditItem != null) return MyParentEditItem; - return MyPreviousEditItem.MyParent; - } - } - protected void SetupEditItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem, bool addFirstChld) - { - if (myStepPanel.TopMostEditItem == null) myStepPanel.TopMostEditItem = this; - //if (itemInfo.ItemID == 10366) Console.WriteLine("Here"); - //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 - TabLeft = 20; - SetupHeader(itemInfo); - this.Paint += new PaintEventHandler(EditItem_Paint); - this.BackColorChanged += new EventHandler(EditItem_BackColorChanged); - this.Move += new EventHandler(EditItem_Move); - this.Resize += new EventHandler(EditItem_Resize); - if (itemInfo != null) - { - ContentType = (int)itemInfo.MyContent.Type; - switch (ContentType / 10000) - { - case 0: // Procedure - ContentFont = myStepPanel.ProcFont;// lblTab.Font = myStepPanel.ProcFont; - TabFont = itemInfo.MyTab.MyFont.WindowsFont; - break; - case 1: // Section - ContentFont = myStepPanel.SectFont;// lblTab.Font = myStepPanel.SectFont; - TabFont = itemInfo.MyTab.MyFont.WindowsFont; - break; - case 2: // Steps - // Fix for B2016-037: there were ''s in saved content text. This was caused by a bug in code that - // did not resolve these correctly if there was more than 1 in the text. So if, when loading the text, this - // is found, resolve them: - if (itemInfo.MyContent.Text.Contains("")) - { - DisplayText vlntxt = new DisplayText(itemInfo, E_EditPrintMode.Edit, E_ViewMode.Edit, false, E_FieldToEdit.StepText, true, null, null, false); - vlntxt.SetDTS = false; - vlntxt.CleanUpNewIDs(); - vlntxt = null; - } - ContentFont = myStepPanel.StepFont;//lblTab.Font = myStepPanel.StepFont; - if (itemInfo.MyTab != null ) TabFont = itemInfo.MyTab.MyFont.WindowsFont; - MyStepData = itemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[ContentType % 10000]; - break; - } - //this.Move += new EventHandler(DisplayItem_Move); - } - else - { - if (myStepPanel.MyFont != null) ContentFont = TabFont = myStepPanel.MyFont; - } - if (expand) ShowExpanded(); - MyStepPanel = myStepPanel; - if (itemInfo != null && !myStepPanel._LookupEditItems.ContainsKey(itemInfo.ItemID)) 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, addFirstChld); - break; - case ChildRelation.Before: - AddItem(myParentEditItem, ref myParentEditItem._MyBeforeEditItems, nextEditItem, addFirstChld); - break; - case ChildRelation.RNO: - RNOLevel = myParentEditItem.RNOLevel + 1; - AddItem(myParentEditItem, ref myParentEditItem._MyRNOEditItems, nextEditItem, addFirstChld); - break; - case ChildRelation.SupInfo: - AddItem(myParentEditItem, ref myParentEditItem._MySupInfoEditItems, nextEditItem, addFirstChld); - break; - case ChildRelation.None: - break; - } - if (itemInfo != null) - { - // ip2bck's needed the ContentWidth set to get the edit windows to size correctly. - if (itemInfo.IsStep && itemInfo.FormatStepData.Type == "TitleWithTextBelow" && - ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)) - ContentWidth = myParentEditItem.ContentWidth; - if (itemInfo.IsStep && itemInfo.MyParent.IsFigure) - { - ContentWidth = myParentEditItem.MyParentEditItem.ContentWidth; - Left = MyParentEditItem.MyParentEditItem.Left + MyParentEditItem.MyParentEditItem.TabLeft; - } - - if (myChildRelation == ChildRelation.None) - { - if (ContentType == 0 && MyStepSectionLayoutData != null) - { - LastMethodsPush(string.Format("SetupRTBItem {0}", MyID)); - int widt = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidT); - int wids = MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, 0); - ItemWidth = Math.Max(widt, wids); - } - } - } - //// TIMING: DisplayItem.TimeIt("CSLARTB Parent"); - SetText(); - if (itemInfo.IsSupInfoPart) - { - EditItem high = MyStepPanel._LookupEditItems[itemInfo.MyHLS.ItemID]; - ContentLocation = new Point(high.ContentLeft + high.Width + 36, (int)_MyParentEditItem.Top + SupInfoTopOffset); - } - //// 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); - // If on the first Caution/Note and the parent has a previous, for example a caution off of 5th HLS, go to the - // bottom on the previous parent. In the example, the bottom of the 4th HLS. - int btm = myStepPanel.DisplayRectangle.Y; - int top = FindTop(btm); - if (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format) - if (MyItemInfo.IsCaution || MyItemInfo.IsNote) - top = myParentEditItem.TopMostEditItem.Top; - //if ((MyItemInfo.SameRowAsParent && MyItemInfo.IsCaution2) || (MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && (MyItemInfo.IsCaution || MyItemInfo.IsNote))) - // top = myParentEditItem.TopMostEditItem.Top; - if (Top < top) - { - LastMethodsPush("SetupRTBItem"); - MyStepPanel.ItemMoving++; - Top = top; - MyStepPanel.ItemMoving--; - LastMethodsPop(); - } - this.Enabled = this.MyItemInfo.IsApplicable(MyStepPanel.ApplDisplayMode); - _Loading = false; - //// TIMING: DisplayItem.TimeIt("CSLARTB Controls Add"); - } - void MyConfig_PropertyChanged(object sender, PropertyChangedEventArgs e) - { - SaveConfig(); - } - public void SaveConfig() - { - if (!MyItemInfo.MyConfig.IsDirty) return; - using (Item itm = MyItemInfo.Get()) - { - itm.MyContent.Config = MyItemInfo.MyConfig.ToString(); - if (ChangeBarForConfigItemChange) - itm.MyContent.DTS = DateTime.Now; - itm.MyContent.UserID = Volian.Base.Library.VlnSettings.UserID; - itm.Save(); - } - MyItemInfo.MyConfig.IsDirty = false; - } - /// - /// If the background changes, change the background of the RichTextBox - /// - /// - /// - void EditItem_BackColorChanged(object sender, EventArgs e) - { - //IdentifyMe(false); - } - // TODO: the format of the circles, Checkoffs and Changebars should come from the format file - /// - /// This adds drawing items to the RTBItem as needed including - /// Circle around the Tab Number - /// Check-Offs - /// Change Bars - /// - /// - /// - private void EditItem_Paint(object sender, PaintEventArgs e) - { - Graphics g = e.Graphics; - g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; - //g.DrawString(lblTab.Text, MyItemInfo.MyTab.MyFont.WindowsFont, Brushes.Red, new RectangleF(new PointF(MyStepPanel.MyStepPanelSettings.NumberLocationX, MyStepPanel.MyStepPanelSettings.NumberLocationY), MyStepPanel.MyStepPanelSettings.NumberSize), StringFormat.GenericDefault); - // adjust x location of label by 7, to position correctly. - //g.DrawString(lblTab.Text, MyItemInfo.MyTab.MyFont.WindowsFont, Brushes.Blue, new RectangleF(new PointF(Convert.ToSingle(lblTab.Location.X-7), Convert.ToSingle(lblTab.Location.Y)), MyStepPanel.MyStepPanelSettings.NumberSize), StringFormat.GenericDefault); - //g.DrawLine(Pens.DarkGreen, lblTab.Location.X-7, 0, lblTab.Location.X-7, this.Height); - // Show a small E to indicate Enhanced Steps - DVEnhancedDocuments dveds = MyItemInfo.MyDocVersion.DocVersionConfig.MyEnhancedDocuments; - float x = 0; - float y = 0; - foreach (EnhancedDocument ed in MyItemInfo.GetMyEnhancedDocuments()) - { - DVEnhancedDocument dved = dveds.GetByType(ed.Type); - Font fnt = new System.Drawing.Font("Arial", 5); - //g.DrawLine(Pens.DarkGreen, 18, 1, 18, 6); - //g.DrawLine(Pens.DarkGreen, 18, 1, 21, 1); - //g.DrawLine(Pens.DarkGreen, 18, 3, 21, 3); - //g.DrawLine(Pens.DarkGreen, 18, 6, 21, 6); - //g.DrawString("B", fnt, Brushes.Green, new RectangleF(new PointF(0,0), this.Size), StringFormat.GenericDefault); - g.DrawString(dved.PdfToken, fnt, Brushes.Green, new RectangleF(new PointF(x,y), this.Size), StringFormat.GenericDefault); - if (y > 0) - { - x += 18; - y = 0; - } - else - y = 14; - } - //g.DrawLine(Pens.DarkGreen, MyStepRTB.Location.X - 7, 0, MyStepRTB.Location.X - 7, this.Height); - //g.DrawString(TabText, MyItemInfo.MyTab.MyFont.WindowsFont, Brushes.Black, new RectangleF(new PointF(Convert.ToSingle(TabLocation.X), Convert.ToSingle(TabLocation.Y)), MyStepPanel.MyStepPanelSettings.NumberSize), StringFormat.GenericDefault); - Font myWFont = (MyItemInfo.MyTab != null) ? MyItemInfo.MyTab.MyFont.WindowsFont : MyItemInfo.FormatStepData.Font.WindowsFont; - g.DrawString(TabText, myWFont, Brushes.Black, new RectangleF(new PointF(Convert.ToSingle(TabLocation.X), Convert.ToSingle(TabLocation.Y)), this.Size), StringFormat.GenericDefault); - - //g.DrawLine(Pens.DarkGreen, lblTab.Location.X, 0, lblTab.Location.X, this.Height); - //g.DrawLine(Pens.DarkGreen, MyStepRTB.Location.X, 0, MyStepRTB.Location.X, this.Height); - if (Circle) - { - Pen penC = new Pen(MyStepPanel.MyStepPanelSettings.CircleColor, MyStepPanel.MyStepPanelSettings.CircleWeight); - g.DrawArc(penC, TabLeft + 1, 0, MyStepPanel.MyStepPanelSettings.CircleDiameter, MyStepPanel.MyStepPanelSettings.CircleDiameter, 0F, 360F); - } - if (CheckOff) - { - Pen penCO = new Pen(MyStepPanel.MyStepPanelSettings.CheckOffColor, MyStepPanel.MyStepPanelSettings.CheckOffWeight); - g.DrawRectangle(penCO, MyStepPanel.MyStepPanelSettings.CheckOffX, MyStepPanel.MyStepPanelSettings.CheckOffY, MyStepPanel.MyStepPanelSettings.CheckOffSize, MyStepPanel.MyStepPanelSettings.CheckOffSize); - } - if (ChangeBar) - { - Pen penCB = new Pen(MyStepPanel.MyStepPanelSettings.ChangeBarColor, MyStepPanel.MyStepPanelSettings.ChangeBarWeight); - if (ChangeBarPosition == E_ChangeBarPosition.Left) - g.DrawLine(penCB, 0, ContentTop, 0, Height); // left, top, right, bottom. - else - { - float X; - float H; - if (this is GridItem) - { - GridItem gi = this as GridItem; - X = gi.MyFlexGrid.Right+2; - H = gi.MyFlexGrid.Height; - } - else if (this is RtfRawItem) - { - RtfRawItem ri = this as RtfRawItem; - X = ri.MyStepRTB.Right + 4; - H = ri.MyStepRTB.Height; - } - else if (this is ImageItem) - { - ImageItem ii = this as ImageItem; - X = ii.MyPictureBox.Right + 4; - H = ii.MyPictureBox.Height; - } - else - { - RTBItem ri = this as RTBItem; - X = ri.MyStepRTB.Right + 2; - H = ri.MyStepRTB.Height; - } - g.DrawLine(penCB, X, ContentTop, X, ContentTop+H); //Height); - } - } - if (UserCheckOff) - { - PointF location; - if (this is GridItem) - { - GridItem gi = this as GridItem; - location = new PointF(gi.MyFlexGrid.Left + gi.MyFlexGrid.Width + 2, gi.MyFlexGrid.Top); - } - else if (this is RtfRawItem) - { - RtfRawItem rr = this as RtfRawItem; - // SkipSpaces puts the checkoff macro (if specified in the format) next to the step tab - // this is used for Bryon and Braidwood - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.SkipSpaces) - location = new PointF(rr.MyStepRTB.Left - 50, rr.MyStepRTB.Top); - else - location = new PointF(rr.MyStepRTB.Left + rr.MyStepRTB.Width + 2, rr.MyStepRTB.Top); - } - else if (this is ImageItem) - { - ImageItem ii = this as ImageItem; - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.SkipSpaces) - location = new PointF(ii.MyPictureBox.Left - 50, ii.MyPictureBox.Top); - else - location = new PointF(ii.MyPictureBox.Left + ii.MyPictureBox.Width + 2, ii.MyPictureBox.Top); - } - else - { - RTBItem ri = this as RTBItem; - // SkipSpaces puts the checkoff macro (if specified in the format) next to the step tab - // this is used for Bryon and Braidwood - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.SkipSpaces) - location = new PointF(ri.MyStepRTB.Left - 50, ri.MyStepRTB.Top); - else - location = new PointF(ri.MyStepRTB.Left + ri.MyStepRTB.Width + 2, ri.MyStepRTB.Top); - } - CheckOff co = MyItemInfo.GetCheckOffStep(); - // There may have been a data change in the setting of which checkoff to use (property - // change in the config data), or whether a checkoff is used at all. Need to set the - // 'UserCheckOff' or 'UserCheckOffChar' properties to reflect that. - if (co != null && co.UIMark != null) - { - UserCheckOffChar = (char)co.UIMark; - Font myFont = new Font("VolianDraw", MyItemInfo.MyTab.MyFont.WindowsFont.Size); - g.DrawString(UserCheckOffChar.ToString(), myFont, Brushes.DarkGreen, new RectangleF(location, MyStepPanel.MyStepPanelSettings.NumberSize), StringFormat.GenericDefault); - } - else if (co == null) UserCheckOff = false; - } - } - } -} diff --git a/PROMS/Volian.Controls.Library/GridItem.cs.bak b/PROMS/Volian.Controls.Library/GridItem.cs.bak deleted file mode 100644 index 67bfea63..00000000 --- a/PROMS/Volian.Controls.Library/GridItem.cs.bak +++ /dev/null @@ -1,1248 +0,0 @@ -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; - -namespace Volian.Controls.Library -{ - public partial class GridItem : EditItem - { - #region Fields - 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; - /// - /// 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. - /// - public int GridMargin - { - get { return _GridMargin; } - set { _GridMargin = value; } - } - #endregion - - #region Event Handlers - /// - /// Raises an ItemClick event when the user clicks on the Tab - /// - /// - /// - private void lblTab_MouseDown(object sender, MouseEventArgs e) - { - MyStepPanel.OnItemClick(this, new StepPanelEventArgs(this, e)); - } - void MyFlexGrid_Resize(object sender, EventArgs e) - { - if (MyFlexGrid.ReadingXml) return; - this.Size = new Size(MyFlexGrid.Width + GridMargin, MyFlexGrid.Height + GridMargin); - AdjustTableWidthAndLocation(); - AdjustLocation(); - } - void MyFlexGrid_Enter(object sender, EventArgs e) - { - if (MyStepPanel.DisplayItemChanging) return; - MyStepRTB.MyItemInfo = MyItemInfo; // should be in vlnFlexGrid - MyStepPanel.SelectedEditItem = this; - if (MyFlexGrid.IsRoTable) - { - MyFlexGrid.Cols.Fixed = MyFlexGrid.Cols.Count; - MyFlexGrid.Rows.Fixed = MyFlexGrid.Rows.Count; - } - } - void MyFlexGrid_KeyDown(object sender, KeyEventArgs e) - { - switch (e.KeyCode) - { - case Keys.F5: - if (e.Shift) - { - e.Handled = true; - if (!CheckClipboard()) return; // check if 'clipboard' contains a step. - SetMenu("StepPaste"); - } - else if (!e.Control && !e.Alt) - { - e.Handled = true; - CopyStep(); - } - break; - case Keys.Delete: - if (!MyFlexGrid.IsRoTable) - MyFlexGrid.ClearSelectedCellText(); - break; - } - } - void SetMenu(string contentMenu) - { - if (contentMenu == null) - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ClearContextMenu(); - else if (contentMenu == "OpenContextMenu") - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetGridCellContextMenu(); //.SetContextMenu(); - else - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetShortCutContextMenu(contentMenu); - } - void MyFlexGrid_CursorMovement(object sender, VlnFlexGridCursorMovementEventArgs args) - { - MyStepPanel.CursorMovement(this,new Point(0,0), args.Key); - } - void MyStepRTB_LinkModifyTran(object sender, StepPanelLinkEventArgs args) - { - MyStepPanel.OnLinkModifyTran(sender, args); - } - void MyStepRTB_LinkModifyRO(object sender, StepPanelLinkEventArgs args) - { - MyStepPanel.OnLinkModifyRO(sender, args); - } - void MyStepRTB_LinkGoTo(object sender, StepPanelLinkEventArgs args) - { - MyStepPanel.OnLinkClicked(sender, args); - } - void MyStepRTB_CursorKeyPress(object sender, KeyEventArgs args) - { - MyStepPanel.StepCursorKeys(this, args); - } - 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); - int widS = /* _WidthAdjust + borderWidth + */ MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, MyItemInfo.ColumnMode); - int wNew = 70 + widS + colR * MyItemInfo.ColumnMode; - if (wNew > ItemWidth) - { - ItemWidth = wNew; - ItemLocation = TableLocation(MyParentEditItem, MyStepSectionLayoutData, wNew); - } - } - else - { - int newwidth = MyFlexGrid.Width; - if (ItemWidth != newwidth) - { - ItemWidth = newwidth; - ItemLocation = TableLocation(MyParentEditItem, MyStepSectionLayoutData, newwidth); - } - } - } - bool MyStepRTB_IsNotCurrentSelection(object sender, EventArgs args) - { - return 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) - { - MyStepRTB.EditMode = MyStepRTB.Visible; - //Console.WriteLine("MyStepRTB_VisibleChanged {0}", MyStepRTB.Width); - //Console.WriteLine("GridItem: EditMode = {0}", MyStepRTB.EditMode); - } - void MyStepRTB_ReturnToEditor(object sender, EventArgs args) - { - //Console.WriteLine("MyStepRTB_ReturnToEditor"); - MyFlexGrid.Focus(); - MyFlexGrid.StartEditing(); - } - 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(); - } - void MyStepRTB_EditModeChanged(object sender, EventArgs args) - { - //Console.WriteLine("MyStepRTB_EditModeChanged"); - AdjustColorsForEditMode(); - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetRibbonForGrid(); - } - - private void AdjustColorsForEditMode() - { - MyFlexGrid.StyleBackColor = Color.White; - if (MyStepRTB.EditMode) - { - MyFlexGrid.Styles["Focus"].ForeColor = MyFlexGrid.Styles["Focus"].BackColor = - MyFlexGrid.Styles["Highlight"].ForeColor = MyFlexGrid.Styles["Highlight"].BackColor = Color.SkyBlue; - } - else - { - MyFlexGrid.Styles["Focus"].ForeColor = MyFlexGrid.Styles["Highlight"].ForeColor = Color.Black; - MyFlexGrid.Styles["Focus"].BackColor = MyFlexGrid.Styles["Highlight"].BackColor = Color.LightCyan; - } - } - 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 - if (Initializing) return; - if (MyFlexGrid.Selection.IsSingleCell && MyFlexGrid.Row >= 0 && MyFlexGrid.Col >= 0) - { - object obj = MyFlexGrid[MyFlexGrid.Row, MyFlexGrid.Col]; - _OrigRtf = obj == null ? string.Empty : obj.ToString(); - } - } - void MyStepRTB_KeyDown(object sender, KeyEventArgs e) - { - if (!e.Control && !e.Shift && !e.Alt && e.KeyCode == Keys.Escape && MyStepRTB.EditMode) - { - MyStepRTB.Rtf = _OrigRtf; - MyFlexGrid.Select(MyFlexGrid.Selection); - } - } - private string MyFlexGrid_AdjustPastedText(object sender, VlnFlexGridPasteEventArgs args) - { - string tmpForLink = args.Text; - tmpForLink = Regex.Replace(tmpForLink, @"#Link:ReferencedObject:[0-9]+ ", @"#Link:ReferencedObject: "); - tmpForLink = Regex.Replace(tmpForLink, @"#Link:Transition:([0-9]+) [0-9]+ ", @"#Link:Transition:$1 "); - tmpForLink = Regex.Replace(tmpForLink, @"#Link:TransitionRange:([0-9]+) [0-9]+ ", @"#Link:TransitionRange:$1 "); - return tmpForLink; - } - #endregion // Event Handlers - #region Constructors - public GridItem() - { - InitializeComponent(); - } - public GridItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand) - { - InitializeComponent(); - SetupEventHandlers(); - SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, null, false); - } - public GridItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem) - { - InitializeComponent(); - SetupEventHandlers(); - SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, nextEditItem, false); - } - private void SetupEventHandlers() - { - this.MyFlexGrid.Resize += new EventHandler(MyFlexGrid_Resize); - this.MyFlexGrid.Enter += new EventHandler(MyFlexGrid_Enter); - this.MyFlexGrid.CursorMovement += new VlnFlexGridCursorMovementEvent(MyFlexGrid_CursorMovement); - this.MyFlexGrid.OpenAnnotations += new VlnFlexGridEvent(MyFlexGrid_OpenAnnotations); - this.MyFlexGrid.KeyDown +=new KeyEventHandler(MyFlexGrid_KeyDown); - this.MyStepRTB.LinkGoTo += new StepRTBLinkEvent(MyStepRTB_LinkGoTo); - this.MyStepRTB.LinkModifyRO += new StepRTBLinkEvent(MyStepRTB_LinkModifyRO); - this.MyStepRTB.LinkModifyTran += new StepRTBLinkEvent(MyStepRTB_LinkModifyTran); - this.MyStepRTB.CursorKeyPress += new StepRTBCursorKeysEvent(MyStepRTB_CursorKeyPress); - this.MyStepRTB.AdjustTableWidth += new StepRTBTableWidthEvent(MyStepRTB_AdjustTableWidth); - this.MyStepRTB.IsNotCurrentSelection += new StepRTBBooleanEvent(MyStepRTB_IsNotCurrentSelection); - this.MyStepRTB.OpenAnnotations += new StepRTBEvent(MyStepRTB_OpenAnnotations); - this.MyStepRTB.DoMouseWheel += new StepRTBMouseEvent(MyStepRTB_DoMouseWheel); - this.MyStepRTB.DoSaveContents += new StepRTBEvent(MyStepRTB_DoSaveContents); - this.MyStepRTB.VisibleChanged += new EventHandler(MyStepRTB_VisibleChanged); - this.MyStepRTB.ReturnToEditor += new StepRTBEvent(MyStepRTB_ReturnToEditor); - this.MyFlexGrid.Click += new EventHandler(MyFlexGrid_Click); - this.MyStepRTB.EditModeChanged += new StepRTBEvent(MyStepRTB_EditModeChanged); - this.MyStepRTB.KeyDown += new KeyEventHandler(MyStepRTB_KeyDown); - this.MyFlexGrid.SelChange += new EventHandler(MyFlexGrid_SelChange); - this.MyStepRTB.GotFocus += new EventHandler(MyStepRTB_GotFocus); - this.MyStepRTB.RoInsert += new StepRTBRoEvent(MyStepRTB_RoInsert); - this.MyFlexGrid.AdjustPastedText += new VlnFlexGridPasteEvent(MyFlexGrid_AdjustPastedText); - 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); - } - - //void MyStepRTB_EnterKeyPressed(object sender, KeyEventArgs args) - //{ - // args.Handled = true; - // MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ProcessEnterKey(); - //} - - void MyFlexGrid_EnterKeyPressed(object sender, KeyEventArgs args) - { - args.Handled = true; - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ProcessEnterKey(); - } - - void MyStepRTB_OpenContextMenu(object sender, StepRTBLocationEventArgs args) - { - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.OpenContextMenu(args.Location); - } - - void MyStepRTB_SetMenu(object sender, StepRTBMenuEventArgs args) - { - 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"); - if (MyFlexGrid.IsRoTable) - { - MyFlexGrid.Visible = false; - MyFlexGrid.ConvertTableROToGrid(args.ValText, args.RODbID, args.ROID); - 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 - { - int sel = MyStepRTB.SelectionStart + args.ValText.Length;// +args.LinkText.Length;//MyStepRTB.SelectionLength; // Remember where the link is being added - //Console.WriteLine("ValText {0} LinkText {1}", args.ValText, args.LinkText); - //Console.WriteLine("selstart {0} len {1}", MyStepRTB.SelectionStart, args.LinkText.Length); - CellRange cr = MyFlexGrid.Selection; - MyStepRTB.UpdateStepRtb(args.LinkText, args.ValText); - MyFlexGrid.StartEditing(cr.r1, cr.c1); // get back to edit mode - MyStepRTB.Select(sel, 0);// Move cursor to end of LINK - SendKeys.Send("{RIGHT}"); // this will un-select the RO - SendKeys.Flush(); - } - //Console.WriteLine("GridItem - Exit MyStepRTB_RoInsert"); - } - void MyStepRTB_GotFocus(object sender, EventArgs e) - { - RTBLastFocus = true; - } - #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); - if (this.Enabled) - { - _MyDisablePanel.SendToBack(); - _MyDisablePanel.Visible = false; - } - else - { - _MyDisablePanel.Visible = true; - Rectangle rect = new Rectangle(0, 0, this.MyFlexGrid.Width, this.MyFlexGrid.Height); - Bitmap bmp = new Bitmap(this.MyFlexGrid.Width, this.MyFlexGrid.Height); - this.MyFlexGrid.DrawToBitmap(bmp, rect); - using (Graphics gr = Graphics.FromImage(bmp)) - { - 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; - _MyDisablePanel.BackgroundImage = bmp; - _MyDisablePanel.BringToFront(); - } - } - public override Point ContentLocation - { - get { return new Point(Location.X + MyFlexGrid.Left, Location.Y); } - set { Location = new Point(value.X - MyFlexGrid.Left, value.Y); } - } - 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. - if (_MyParentEditItem == null) return; - Point newLocation = TableLocation(_MyParentEditItem, MyStepSectionLayoutData, ItemWidth); - if (!newLocation.Equals(ItemLocation)) ItemLocation = newLocation; - } - public override void SetToolTip(string tip) - { - DevComponents.DotNetBar.SuperTooltipInfo tpi = new DevComponents.DotNetBar.SuperTooltipInfo("", "", tip, null, null, DevComponents.DotNetBar.eTooltipColor.Lemon); - _MyToolTip.MinimumTooltipSize = new Size(0, 24); - _MyToolTip.TooltipDuration = 3; - //_MyToolTip.SetSuperTooltip(MyStepRTB, tpi); - _MyToolTip.SetSuperTooltip(MyFlexGrid, tpi); - } - private bool DoNotRefresh = false; - public override void RefreshContent() - { - if (DoNotRefresh) return; - _ActiveMode = MyFlexGrid.ContainsFocus; - using (Grid myGrid = MyItemInfo.MyContent.MyGrid.Get()) - { - MyItemInfo.MyContent.MyGrid.ResetContent(myGrid); - } - RefreshDisplay(_ActiveMode); - IdentifyMe(false); - } - public override int TableWidth { get { return 0; } } // DONE - public override int ItemLeft - { - get { return Left + lblTab.Left; } - set { Left = value - lblTab.Left; } - } - public override int ContentLeft { get { return Left + MyFlexGrid.Left; } } - public override int ContentWidth - { - get { return MyFlexGrid.Width; } - set - { - Width = value + lblTab.Left + lblTab.Width; - } - } - public override Point ItemLocation - { - get { return new Point(Location.X + lblTab.Left, Location.Y); } - set { Location = new Point(value.X - lblTab.Left, value.Y); } - } - public override int ItemWidth - { - get { return Width - lblTab.Left; } - set - { - Width = GridMargin + value + lblTab.Left; - } - } - public override void RefreshOrdinal() - { - TabFormat = null; // Reset Tab - } - public override bool Expanded - { - get {return !Colapsing;} - set {;} // Tables are always expanded. - } - public override void RefreshTab() { TabFormat = null;} - public override void SetFocus() { MyFlexGrid.Focus();} - public override void SaveContents() - { - if (!MyFlexGrid.IsDirty && !IsSaving) return; - List RtfRoUsageList = new List(); - List RtfTransList = new List(); - - int r = 0; - int c = 0; - int w = MyFlexGrid.Cols.Count; - int h = MyFlexGrid.Rows.Count; - - string srchtxt = MyFlexGrid.GetSearchableText(); - // find the rousages within the grid cell. If this is an ro table, there will only be one usage - // if it is a modify and there will be no usages if it is new (the usage gets created on the save) - if (!MyFlexGrid.IsRoTable) - { - while (r < h) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - if (MyFlexGrid[r, c] != null) - { - // see if there are any links and save these so that any deleted ROs or transitions in the - // steprtb can have associated usages/transitions records removed from the database. - string lookFor = string.Format(@""); - MatchCollection matches = Regex.Matches((string)MyFlexGrid[r, c], lookFor); - for (int i = matches.Count - 1; i >= 0; i--) - { - Match m = matches[i]; - if (m != null && m.Groups.Count > 6 && m.Groups[6].ToString() == "ReferencedObject") - { - Regex regRefObj = new Regex(@"\#Link\:ReferencedObject\:([0-9]*) ([0-9a-zA-Z]*) ([0-9]*)", RegexOptions.Singleline); - Match myMatch = regRefObj.Match(m.Value); - if (myMatch.Success) - { - int usgid = int.Parse(myMatch.Groups[1].Value); - RtfRoUsageList.Add(usgid); - } - } - if (m != null && m.Groups.Count > 6 && m.Groups[6].ToString().StartsWith("Transition")) - { - Regex regRefObj = new Regex(@"\#Link\:Transition[a-zA-Z]*\:([0-9]*) ([0-9]*) ([0-9]*)", RegexOptions.Singleline); - Match myMatch = regRefObj.Match(m.Value); - if (myMatch.Success) - { - int tid = int.Parse(myMatch.Groups[2].Value); - RtfTransList.Add(tid); - } - } - } - } - } - c = c + 1; - if (c == w) - { - c = 0; - r = r + 1; - } - } - } - else - { - // new roid is in flexgrid.roid. Compare to previous, if there was a previous. If there - // is a modify RO, then need to delete the existing rousage record because a new usage - // record will get created that contains the selected ROID. - Regex regRefObj = new Regex(@"\#Link\:ReferencedObject\:([0-9]*) ([0-9a-zA-Z]*) ([0-9]*)", RegexOptions.Singleline); - Match myMatch = regRefObj.Match(MyItemInfo.MyContent.Text); - if (myMatch.Success) - { - int usgid = int.Parse(myMatch.Groups[1].Value); - RoUsageInfo rui = RoUsageInfo.Get(usgid); - if (rui.ROID == MyFlexGrid.ROID)RtfRoUsageList.Add(usgid); - } - } - // compare ro usages & transitions from database and list from grid contents - // if in both lists, don't do anything - // if only in database list, delete usage. - // never will have condition where it is not in database list, but is in steprtb text list (this - // case is handled when ro is inserted. - if (MyItemInfo.MyContent.ContentRoUsages != null) - { - List delRoUsgs = new List(); - foreach (RoUsageInfo ru in MyItemInfo.MyContent.ContentRoUsages) - if (!RtfRoUsageList.Contains(ru.ROUsageID)) delRoUsgs.Add(ru.ROUsageID); - foreach (int dRU in delRoUsgs) RoUsage.Delete(dRU); - } - if (MyItemInfo.MyContent.ContentTransitions != null) - { - List delTrans = new List(); - foreach (TransitionInfo ti in MyItemInfo.MyContent.ContentTransitions) - if (!RtfTransList.Contains(ti.TransitionID)) delTrans.Add(ti.TransitionID); - foreach (int dt in delTrans) Transition.Delete(dt); - } - - bool success = FinishSave(srchtxt); - if (success && !MyFlexGrid.IsRoTable) - { - MyStepRTB.FindAllLinks(); - MyStepRTB.OrigRTF = MyStepRTB.Rtf; - MyStepRTB.ClearUndo(); - } - } - private string DoLinkForRoTable(Item itm) - { - // 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 - // in the grid: - MyFlexGrid.Cols.Fixed = 0; - MyFlexGrid.Rows.Fixed = 0; - MyFlexGrid.StyleBackColor = Color.White; - - 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; - //} - // 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 - // been saved. - if (MyFlexGrid.IsRoTable && MyFlexGrid.ROID != null && itm.MyContent.ContentRoUsageCount < 1) - { - searchableText = string.Format(@"\v\v0 ", searchableText, DoLinkForRoTable(itm)); - //if (itm.MyContent.Text != searchableText) - //{ - itm.MyContent.Text = searchableText; - itm.MyContent.DTS = DateTime.Now; - //} - } - else - { - itm.MyContent.Text = searchableText; - itm.MyContent.DTS = DateTime.Now; - } - if (!MyFlexGrid.IsRoTable)itm.MyContent.Text = searchableText; - itm.Save(); - 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 { ;} } - public override void HandleResize() { ;} // DONE - public override void MatchExpanded() { ;} // DONE - public override void ItemSelect() - { - // Was getting an Error that _MyStepRTB was Disposed RHM 20101217 - if (!MyFlexGrid.Disposing) - { - Focus(); - MyFlexGrid.Focus(); - if (!MyFlexGrid.IsRoTable) // Table ROs are none editable - don't select a table cell - { - MyFlexGrid.Select(0, 0); - MyFlexGrid.FirstEntry = true; // to fix a problem with initial mouse click into table - } - } - else - { - _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) - { - int r = MyFlexGrid.Row; - int c = MyFlexGrid.Col; - - if (!reverse) - { - int w = MyFlexGrid.Cols.Count; - int h = MyFlexGrid.Rows.Count; - while (r < h) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - int ss = MyStepRTB.SelectionStart; - int sl = MyStepRTB.SelectionLength; - MyFlexGrid.StartEditing(); - MyStepRTB.Select(ss, sl); // need to reset selection because startediting positions to end. - if (MyStepRTB.ReadOnly) - { - MessageBox.Show("Cannot replace linked text!", "Find/Replace", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly); - return DialogResult.Yes; - } - string oldRtf = MyStepRTB.Rtf; - DialogResult dr = MyStepRTB.ReplaceText(rpltxt, fndstr, caseSensitive, matchWholeWord, reverse, prompt, fndrpldlg); - if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf; - if (dr == DialogResult.Yes || dr == DialogResult.Cancel) return dr; - } - c = c + 1; - if (c == w) - { - c = 0; - r = r + 1; - } - if (r < h) - { - MyFlexGrid.Select(r, c); - MyStepRTB.Select(0, 0); - } - } - } - else // reverse - { - while (r >= 0) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - int ss = MyStepRTB.SelectionStart; - int sl = MyStepRTB.SelectionLength; - MyFlexGrid.StartEditing(); - MyStepRTB.Select(ss, sl); - if (MyStepRTB.ReadOnly) - { - MessageBox.Show("Cannot replace linked text!", "Find/Replace", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly); - return DialogResult.Yes; - } - string oldRtf = MyStepRTB.Rtf; - DialogResult dr = MyStepRTB.ReplaceText(rpltxt, fndstr, caseSensitive, matchWholeWord, reverse, prompt, fndrpldlg); - if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf; - if (dr == DialogResult.Yes || dr == DialogResult.Cancel) return dr; - } - c = c - 1; - if (c < 0) - { - c = MyFlexGrid.Cols.Count - 1; - r = r - 1; - } - cr = MyFlexGrid.GetMergedRange(r, c); - if (r >= 0 && cr.r1 == r && cr.c1 == c) - { - MyFlexGrid.Select(r, c); - MyFlexGrid.StartEditing(); - MyStepRTB.Select(MyStepRTB.Text.Length, 0); - } - } - } - return DialogResult.No; - } - public override bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse) - { - if (MyFlexGrid.Row < 0) MyFlexGrid.Row = (reverse) ? MyFlexGrid.Rows.Count - 1 : 0; - if (MyFlexGrid.Col < 0) MyFlexGrid.Col = (reverse) ? MyFlexGrid.Cols.Count - 1 : 0; - int r = MyFlexGrid.Row; - int c = MyFlexGrid.Col; - if (!reverse) - { - int w = MyFlexGrid.Cols.Count; - int h = MyFlexGrid.Rows.Count; - while (r < h) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - int ss = MyStepRTB.SelectionStart + MyStepRTB.SelectionLength; - MyFlexGrid.StartEditing(); - MyStepRTB.Select(ss, 0); // need to reset selection because startediting positions to end. - bool scn = MyStepRTB.FindText(str, caseSensitive, matchWholeWord, reverse); - if (scn) return true; - } - c = c + 1; - if (c == w) - { - c = 0; - r = r + 1; - } - if (r < h) - { - MyFlexGrid.Select(r, c); - MyStepRTB.Select(0, 0); - } - } - } - else - { - while (r >= 0) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - int ss = MyStepRTB.SelectionStart; - MyFlexGrid.StartEditing(); - MyStepRTB.Select(ss, 0); - bool scn = MyStepRTB.FindText(str, caseSensitive, matchWholeWord, reverse); - if (scn) return true; - } - c = c - 1; - if (c < 0) - { - c = MyFlexGrid.Cols.Count - 1; - r = r - 1; - } - cr = MyFlexGrid.GetMergedRange(r, c); - if (r >= 0 && cr.r1 == r && cr.c1 == c) - { - MyFlexGrid.Select(r, c); - MyFlexGrid.StartEditing(); - MyStepRTB.Select(MyStepRTB.Text.Length, 0); - } - } - } - return false; - } - public override void PositionToEnd() - { - int r = MyFlexGrid.Rows.Count - 1; - int c = MyFlexGrid.Cols.Count - 1; - MyFlexGrid.Select(r, c); - while (r >= 0) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - MyFlexGrid.StartEditing(); - return; - } - c = c - 1; - if (c < 0) - { - c = MyFlexGrid.Cols.Count - 1; - r = r - 1; - } - if (r >= 0) - { - MyFlexGrid.Select(r, c); - MyStepRTB.Select(MyStepRTB.Text.Length, 0); - } - } - } - public override void PositionToStart() - { - MyFlexGrid.Select(0,0); - MyFlexGrid.StartEditing(); - MyStepRTB.Select(0, 0); - } - public override string SelectedTextForFind - { - get - { - StepRTB srtb = MyStepRTB; - if (srtb.SelectionLength > 0) - { - if (srtb.IsSelectionLinked(srtb.SelectionStart, srtb.SelectionLength)) - return srtb.SelectedText.Substring(0, srtb.SelectedText.IndexOf("#Link")); - else - return srtb.SelectedText; - } - return null; - } - } - public override bool SpellCheckNext() - { - int r = MyFlexGrid.Row; - int c = MyFlexGrid.Col; - int w = MyFlexGrid.Cols.Count; - int h = MyFlexGrid.Rows.Count; - while (r < h) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - MyFlexGrid.Select(r, c); - MyFlexGrid.StartEditing(); - string oldRtf = MyStepRTB.Rtf; - bool scn = MyStepRTB.SpellCheckNext(); - if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf; - if (!scn) return false; - } - c = c + 1; - if (c == w) - { - c = 0; - r = r + 1; - } - } - return true; - } - public override void IdentifyMe(bool highlight) - { - if (highlight) - { - MyFlexGrid.StyleBackColor = Color.Gray; - MyFlexGrid.Styles.Fixed.BackColor = Color.Gray; - } - else - { - MyFlexGrid.Styles.Fixed.BackColor = MyFlexGrid.DefaultFixedBackgroundColor; - MyFlexGrid.StyleBackColor = MyFlexGrid.DefaultCellBackgroundcolor; - if (MyFlexGrid.Focused) // If active Set BackColor to the active color - SetActive(); - else // Otherwise Set the BackColor to either the InactiveColor or the AnnotationColor - { - MyFlexGrid.StyleBackColor = - MyItemInfo.ItemAnnotationCount == 0 ? MyStepPanel.InactiveColor : MyStepPanel.AnnotationColor; - // Turn-off Size adjustment - MyFlexGrid.Cols.Fixed = 0; - MyFlexGrid.Rows.Fixed = 0; - } - } - } - 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 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; - MyFlexGrid.KeyActionTab = KeyActionEnum.MoveAcross; - MyFlexGrid.AdjustGridControlSize(); - // When a grid is read from XML, all of the styles are updated to the values in the XML. - // Thus any specific settings need to be set after the grid is read. - MyFlexGrid.Styles["Highlight"].BackColor = Color.LightCyan; - MyFlexGrid.Styles["Focus"].BackColor = Color.LightCyan; - MyFlexGrid.HighLight = activeMode ? C1.Win.C1FlexGrid.HighLightEnum.Always : C1.Win.C1FlexGrid.HighLightEnum.WithFocus; - MyFlexGrid.VwMode = MyStepPanel.VwMode; - } - public override void ToggleEditView(E_ViewMode vwMode) - { - /* - * TODO: - * 1) SaveContents - */ - RefreshDisplay(false); - MyFlexGrid.VwMode = vwMode; - } - public override int TabLeft { get { return lblTab.Left; } set { lblTab.Left = value; } } - public override Font TabFont { get { return lblTab.Font; } set { lblTab.Font = value; } } - public override string TabText { get { return lblTab.Text; } } - public override Point TabLocation { get { return lblTab.Location; } } - public override Font ContentFont { get { return MyFlexGrid.Font; } set { MyFlexGrid.Font = value; } } // TODO how do we know what font tables are in? - public override float ContentTop { get { return MyFlexGrid.Top; } } - public override void SetupHeader(ItemInfo itemInfo) { ;} // tables do not have headers - public override void ShowExpanded() {;} - public override void SetText() - { - // 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() - { - if (!MyFlexGrid.GetXMLData().Contains("<NewID>")) return; - BasicSave(); - // need to loop thru all pasted cells: for now do all cells. - int w = MyFlexGrid.Cols.Count; - int h = MyFlexGrid.Rows.Count; - int r = 0; - int c = 0; - String Rtf = null; - while (r < h) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - Rtf = (string)MyFlexGrid[r, c]; - if (Rtf != null) - { - int startIndx = 0; - while (Rtf.IndexOf("") > -1) - { - // first find the new link and determine whether it's RO or transition. - int indx = Rtf.IndexOf(@"#Link:ReferencedObject:", startIndx); - if (indx > 0) - { - // only look in the substring limited by the first occurrance of [END>. If there is more - // than one, don't get multiple links in the string. - int endindx = Rtf.IndexOf(@"END>", indx) + 4; - Match mro = Regex.Match(Rtf.Substring(indx, endindx - indx), @"([A-Za-z]*):(.*)\[END>"); - string linkstr = mro.Groups[2].Value; - string[] roparts = linkstr.Split(" ".ToCharArray()); - ContentRoUsage rousg = null; - int oldid = -1; - using (Item itm = MyItemInfo.Get()) - { - using (RODb rodb = RODb.GetJustRoDb(Convert.ToInt32(roparts[2]))) - { - rousg = itm.MyContent.ContentRoUsages.Add(roparts[1], rodb); - } - oldid = rousg.ROUsageID; - int newid = Rtf.IndexOf("", indx); - Rtf = Rtf.Remove(newid, 7); - Rtf = Rtf.Insert(newid, string.Format("", rousg.ROUsageID)); - itm.Save(); - Rtf = Rtf.Replace(string.Format("", oldid), rousg.ROUsageID.ToString()); - itm.Save(); - MyItemInfo.MyContent.RefreshContentRoUsages(); - } - startIndx = endindx; - } - else - { - Match mt = Regex.Match(Rtf, @"#Link:Transition:([0-9]+) "); - if (mt.Length <= 0) mt = Regex.Match(Rtf, @"#Link:TransitionRange:([0-9]+) "); - if (mt.Length > 0) - { - int endtindx = Rtf.IndexOf("END>", mt.Index) + 4; - indx = mt.Index + 6; // get past '#Link:" - Match m = Regex.Match(Rtf.Substring(indx, endtindx - indx), @"([A-Za-z]*):(.*)\[END>"); - bool isSingleTran = true; - if (Rtf.Substring(indx, 16).IndexOf("TransitionRange") >= 0) isSingleTran = false; - string linkstr = m.Groups[2].Value; - string[] tparts = linkstr.Split(" ".ToCharArray()); - int type = System.Convert.ToInt32(tparts[0]); - int tr1 = System.Convert.ToInt32(tparts[2]); // tparts[2] is token for tranid - int tr2 = tr1; - if (tparts.Length > 3) - tr2 = System.Convert.ToInt32(tparts[3]); // tparts[3] is token for rangeid - bool dispose1 = false; - Item itm1 = null; - bool dispose2 = false; - Item itm2 = null; - using (Item itm = MyItemInfo.Get()) - { - if (itm.ItemID == tr1) - itm1 = itm; // a transition that points to itself should not dispose - else - { - dispose1 = true; - itm1 = Item.Get(tr1); - } - if (itm.ItemID == tr2) - itm2 = itm; // a transition that points to itself should not dispose - else if (tr1 == tr2) - itm2 = itm1; // if both destinations are the same only dispose the first one - else - { - dispose2 = true; - itm2 = Item.Get(tr2); - } - ContentTransition ct = itm.MyContent.ContentTransitions.Add(itm1, itm2); - //Console.WriteLine("CT {0},{1},{2},{3}", ct.TransitionID, itm.ItemID, itm.MyContent.MyContentUnique, itm.MyContent.ContentTransitions.Count); - ct.TranType = type; - - if (isSingleTran) - ct.IsRange = 0; - else if (tr1 != tr2) - ct.IsRange = 1; - else - ct.IsRange = 2; - - int oldidt = ct.TransitionID; - int newidt = Rtf.IndexOf("", indx); - Rtf = Rtf.Remove(newidt, 7); - Rtf = Rtf.Insert(newidt, string.Format("", ct.TransitionID)); - //Rtf = Rtf.Replace("", string.Format("", ct.TransitionID)); - itm.Save(); - Rtf = Rtf.Replace(string.Format("", oldidt), ct.TransitionID.ToString()); - itm.Save(); - MyItemInfo.MyContent.RefreshContentTransitions(); - } - if (dispose2) itm2.Dispose(); - if (dispose1) itm1.Dispose(); - } - } - } - MyFlexGrid[r, c] = Rtf; - } - } - c = c + 1; - if (c == w) - { - c = 0; - r = r + 1; - } - } - } - public override void SaveCurrentAndContents() - { - IsSaving = true; - if (MyFlexGrid.Row >= 0 && MyFlexGrid.Col >= 0 && MyStepRTB.EditMode) // Only if a Cell is Selected - { - int row = MyFlexGrid.Row; - int col = MyFlexGrid.Col; - //SaveContents(); - DoNotRefresh = true; - MyStepRTB.Rtf = MyStepRTB.DoNewLinkInGridCell(); - DoNotRefresh = false; - MyFlexGrid.Row = row; - MyFlexGrid.Col = col; - MyFlexGrid[MyFlexGrid.Row, MyFlexGrid.Col] = MyStepRTB.Rtf; - } - if (!MyFlexGrid.IsDirty) return; - SaveContents(); - IsSaving = false; - } - #endregion - #region Miscellaneous Support - internal void SetSearchCell(string SearchString) - { - // Walk thru grid to find first occurance of SearchString and set that cell for - // edit. - int r = 0; - int c = 0; - int w = MyFlexGrid.Cols.Count; - int h = MyFlexGrid.Rows.Count; - while (r < h) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - if (MyFlexGrid[r, c] != null) - { - MyFlexGrid.StartEditing(r, c); - TableCellEditor tce = MyFlexGrid.TableCellEditor; - // note that this method is only used from Search Results. - // The search query will handle the case sensitivity, so - // we can just see if contains the string without considering - // case sensitivity. - if (tce.Text.ToUpper().Contains(SearchString.ToUpper())) - return; - } - } - c = c + 1; - if (c == w) - { - c = 0; - r = r + 1; - } - } - } - - #endregion - } -} diff --git a/PROMS/Volian.Controls.Library/GridItem.cs.org b/PROMS/Volian.Controls.Library/GridItem.cs.org deleted file mode 100644 index 55f48414..00000000 --- a/PROMS/Volian.Controls.Library/GridItem.cs.org +++ /dev/null @@ -1,1312 +0,0 @@ -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; - -namespace Volian.Controls.Library -{ - public partial class GridItem : EditItem - { - #region Fields - 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; - /// - /// 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. - /// - public int GridMargin - { - get { return _GridMargin; } - set { _GridMargin = value; } - } - #endregion - - #region Event Handlers - /// - /// Raises an ItemClick event when the user clicks on the Tab - /// - /// - /// - private void lblTab_MouseDown(object sender, MouseEventArgs e) - { - MyStepPanel.OnItemClick(this, new StepPanelEventArgs(this, e)); - } - void MyFlexGrid_Resize(object sender, EventArgs e) - { - if (MyFlexGrid.ReadingXml) return; - this.Size = new Size(MyFlexGrid.Width + GridMargin, MyFlexGrid.Height + GridMargin); - AdjustTableWidthAndLocation(); - AdjustLocation(); - } - void MyFlexGrid_Enter(object sender, EventArgs e) - { - Console.WriteLine("GridItem MyFlexGrid_Enter"); - if (MyStepPanel.DisplayItemChanging) return; - MyStepRTB.MyItemInfo = MyItemInfo; // should be in vlnFlexGrid - MyStepPanel.SelectedEditItem = this; - if (MyFlexGrid.IsRoTable) - { - MyFlexGrid.Cols.Fixed = MyFlexGrid.Cols.Count; - MyFlexGrid.Rows.Fixed = MyFlexGrid.Rows.Count; - } - } - void MyFlexGrid_KeyDown(object sender, KeyEventArgs e) - { - switch (e.KeyCode) - { - case Keys.F5: - if (e.Shift) - { - e.Handled = true; - if (!CheckClipboard()) return; // check if 'clipboard' contains a step. - SetMenu("StepPaste"); - } - else if (!e.Control && !e.Alt) - { - e.Handled = true; - CopyStep(); - } - break; - case Keys.Delete: - if (!MyFlexGrid.IsRoTable) - MyFlexGrid.ClearSelectedCellText(); - break; - } - } - void SetMenu(string contentMenu) - { - if (contentMenu == null) - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ClearContextMenu(); - else if (contentMenu == "OpenContextMenu") - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetGridCellContextMenu(); //.SetContextMenu(); - else - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetShortCutContextMenu(contentMenu); - } - void MyFlexGrid_CursorMovement(object sender, VlnFlexGridCursorMovementEventArgs args) - { - MyStepPanel.CursorMovement(this,new Point(0,0), args.Key); - } - void MyStepRTB_LinkModifyTran(object sender, StepPanelLinkEventArgs args) - { - MyStepPanel.OnLinkModifyTran(sender, args); - } - void MyStepRTB_LinkModifyRO(object sender, StepPanelLinkEventArgs args) - { - MyStepPanel.OnLinkModifyRO(sender, args); - } - void MyStepRTB_LinkGoTo(object sender, StepPanelLinkEventArgs args) - { - MyStepPanel.OnLinkClicked(sender, args); - } - void MyStepRTB_CursorKeyPress(object sender, KeyEventArgs args) - { - MyStepPanel.StepCursorKeys(this, args); - } - 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); - int widS = /* _WidthAdjust + borderWidth + */ MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, MyItemInfo.ColumnMode); - int wNew = 70 + widS + colR * MyItemInfo.ColumnMode; - if (wNew > ItemWidth) - { - ItemWidth = wNew; - ItemLocation = TableLocation(MyParentEditItem, MyStepSectionLayoutData, wNew); - } - } - else - { - int newwidth = MyFlexGrid.Width; - if (ItemWidth != newwidth) - { - ItemWidth = newwidth; - ItemLocation = TableLocation(MyParentEditItem, MyStepSectionLayoutData, newwidth); - } - } - } - bool MyStepRTB_IsNotCurrentSelection(object sender, EventArgs args) - { - return 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) - { - if (MyStepRTB == null) return; - MyStepRTB.EditMode = MyStepRTB.Visible; - //Console.WriteLine("MyStepRTB_VisibleChanged {0}", MyStepRTB.Width); - //Console.WriteLine("GridItem: EditMode = {0}", MyStepRTB.EditMode); - } - void MyStepRTB_ReturnToEditor(object sender, EventArgs args) - { - //Console.WriteLine("MyStepRTB_ReturnToEditor"); - MyFlexGrid.Focus(); - MyFlexGrid.StartEditing(); - } - void MyFlexGrid_Click(object sender, EventArgs e) - { - MyFlexGrid.Focus(); - Console.WriteLine("GridItem MyFlexGrid_Click {0}, {1}, {2}, {3}", MyFlexGrid.Row, MyFlexGrid.Col, MyStepPanel.Location, MyFlexGrid.TableCellEditor.Location); - //ScrollToCenter(); - //MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ToggleTableDesignButtons(false); - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetRibbonForGrid(); - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetTableButtonsForMergeRangeSelection(); - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetGridContextMenu(); - } - void MyStepRTB_EditModeChanged(object sender, EventArgs args) - { - Console.WriteLine("GridItem MyStepRTB_EditModeChanged"); - AdjustColorsForEditMode(); - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetRibbonForGrid(); - } - - private void AdjustColorsForEditMode() - { - MyFlexGrid.StyleBackColor = Color.White; - if (MyStepRTB.EditMode) - { - MyFlexGrid.Styles["Focus"].ForeColor = MyFlexGrid.Styles["Focus"].BackColor = - MyFlexGrid.Styles["Highlight"].ForeColor = MyFlexGrid.Styles["Highlight"].BackColor = Color.SkyBlue; - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetRibbonForGridCellIndent(); - } - else - { - MyFlexGrid.Styles["Focus"].ForeColor = MyFlexGrid.Styles["Highlight"].ForeColor = Color.Black; - MyFlexGrid.Styles["Focus"].BackColor = MyFlexGrid.Styles["Highlight"].BackColor = Color.LightCyan; - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetRibbonForGridCellIndentClear(); - } - } - private string _OrigRtf; // used to store original rtf to allow for 'escape' key restore - void MyFlexGrid_SelChange(object sender, EventArgs e) - { - Console.WriteLine("GridItem MyFlexGrid_SelChange {0}, {1}, {2}, {3}", MyFlexGrid.Row, MyFlexGrid.Col, MyStepPanel.Location, MyFlexGrid.TableCellEditor.Location); - //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 - if (Initializing) return; - if (MyFlexGrid.Selection.IsSingleCell && MyFlexGrid.Row >= 0 && MyFlexGrid.Col >= 0) - { - object obj = MyFlexGrid[MyFlexGrid.Row, MyFlexGrid.Col]; - _OrigRtf = obj == null ? string.Empty : obj.ToString(); - } - } - void MyStepRTB_KeyDown(object sender, KeyEventArgs e) - { - if (!e.Control && !e.Shift && !e.Alt && e.KeyCode == Keys.Escape && MyStepRTB.EditMode) - { - MyStepRTB.Rtf = _OrigRtf; - MyFlexGrid.Select(MyFlexGrid.Selection); - } - } - private string MyFlexGrid_AdjustPastedText(object sender, VlnFlexGridPasteEventArgs args) - { - string tmpForLink = args.Text; - tmpForLink = Regex.Replace(tmpForLink, @"#Link:ReferencedObject:[0-9]+ ", @"#Link:ReferencedObject: "); - tmpForLink = Regex.Replace(tmpForLink, @"#Link:Transition:([0-9]+) [0-9]+ ", @"#Link:Transition:$1 "); - tmpForLink = Regex.Replace(tmpForLink, @"#Link:TransitionRange:([0-9]+) [0-9]+ ", @"#Link:TransitionRange:$1 "); - return tmpForLink; - } - #endregion // Event Handlers - #region Constructors - public GridItem() - { - InitializeComponent(); - } - public GridItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand) - { - InitializeComponent(); - SetupEventHandlers(); - SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, null, false); - } - public GridItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem) - { - InitializeComponent(); - SetupEventHandlers(); - SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, nextEditItem, false); - } - private void SetupEventHandlers() - { - this.MyFlexGrid.Resize += new EventHandler(MyFlexGrid_Resize); - this.MyFlexGrid.Enter += new EventHandler(MyFlexGrid_Enter); - this.MyFlexGrid.CursorMovement += new VlnFlexGridCursorMovementEvent(MyFlexGrid_CursorMovement); - this.MyFlexGrid.OpenAnnotations += new VlnFlexGridEvent(MyFlexGrid_OpenAnnotations); - this.MyFlexGrid.KeyDown +=new KeyEventHandler(MyFlexGrid_KeyDown); - this.MyStepRTB.LinkGoTo += new StepRTBLinkEvent(MyStepRTB_LinkGoTo); - this.MyStepRTB.LinkModifyRO += new StepRTBLinkEvent(MyStepRTB_LinkModifyRO); - this.MyStepRTB.LinkModifyTran += new StepRTBLinkEvent(MyStepRTB_LinkModifyTran); - this.MyStepRTB.CursorKeyPress += new StepRTBCursorKeysEvent(MyStepRTB_CursorKeyPress); - this.MyStepRTB.AdjustTableWidth += new StepRTBTableWidthEvent(MyStepRTB_AdjustTableWidth); - this.MyStepRTB.IsNotCurrentSelection += new StepRTBBooleanEvent(MyStepRTB_IsNotCurrentSelection); - this.MyStepRTB.OpenAnnotations += new StepRTBEvent(MyStepRTB_OpenAnnotations); - this.MyStepRTB.DoMouseWheel += new StepRTBMouseEvent(MyStepRTB_DoMouseWheel); - this.MyStepRTB.DoSaveContents += new StepRTBEvent(MyStepRTB_DoSaveContents); - this.MyStepRTB.VisibleChanged += new EventHandler(MyStepRTB_VisibleChanged); - this.MyStepRTB.ReturnToEditor += new StepRTBEvent(MyStepRTB_ReturnToEditor); - this.MyFlexGrid.Click += new EventHandler(MyFlexGrid_Click); - this.MyStepRTB.EditModeChanged += new StepRTBEvent(MyStepRTB_EditModeChanged); - this.MyStepRTB.KeyDown += new KeyEventHandler(MyStepRTB_KeyDown); - this.MyFlexGrid.SelChange += new EventHandler(MyFlexGrid_SelChange); - this.MyStepRTB.GotFocus += new EventHandler(MyStepRTB_GotFocus); - this.MyStepRTB.RoInsert += new StepRTBRoEvent(MyStepRTB_RoInsert); - this.MyFlexGrid.AdjustPastedText += new VlnFlexGridPasteEvent(MyFlexGrid_AdjustPastedText); - 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); - } - - //void MyStepRTB_EnterKeyPressed(object sender, KeyEventArgs args) - //{ - // args.Handled = true; - // MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ProcessEnterKey(); - //} - - void MyFlexGrid_EnterKeyPressed(object sender, KeyEventArgs args) - { - args.Handled = true; - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ProcessEnterKey(); - } - - void MyStepRTB_OpenContextMenu(object sender, StepRTBLocationEventArgs args) - { - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.OpenContextMenu(args.Location); - } - - void MyStepRTB_SetMenu(object sender, StepRTBMenuEventArgs args) - { - 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"); - if (MyFlexGrid.IsRoTable) - { - MyFlexGrid.Visible = false; - MyFlexGrid.ConvertTableROToGrid(args.ValText, args.RODbID, args.ROID); - 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 - { - int sel = MyStepRTB.SelectionStart + args.ValText.Length;// +args.LinkText.Length;//MyStepRTB.SelectionLength; // Remember where the link is being added - //Console.WriteLine("ValText {0} LinkText {1}", args.ValText, args.LinkText); - //Console.WriteLine("selstart {0} len {1}", MyStepRTB.SelectionStart, args.LinkText.Length); - CellRange cr = MyFlexGrid.Selection; - MyStepRTB.UpdateStepRtb(args.LinkText, args.ValText); - MyFlexGrid.StartEditing(cr.r1, cr.c1); // get back to edit mode - MyStepRTB.Select(sel, 0);// Move cursor to end of LINK - SendKeys.Send("{RIGHT}"); // this will un-select the RO - SendKeys.Flush(); - } - //Console.WriteLine("GridItem - Exit MyStepRTB_RoInsert"); - } - void MyStepRTB_GotFocus(object sender, EventArgs e) - { - RTBLastFocus = true; - } - #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); - if (this.Enabled) - { - _MyDisablePanel.SendToBack(); - _MyDisablePanel.Visible = false; - } - else - { - _MyDisablePanel.Visible = true; - Rectangle rect = new Rectangle(0, 0, this.MyFlexGrid.Width, this.MyFlexGrid.Height); - Bitmap bmp = new Bitmap(this.MyFlexGrid.Width, this.MyFlexGrid.Height); - this.MyFlexGrid.DrawToBitmap(bmp, rect); - using (Graphics gr = Graphics.FromImage(bmp)) - { - 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; - _MyDisablePanel.BackgroundImage = bmp; - _MyDisablePanel.BringToFront(); - } - } - public override Point ContentLocation - { - get { return new Point(Location.X + MyFlexGrid.Left, Location.Y); } - set { Location = new Point(value.X - MyFlexGrid.Left, value.Y); } - } - 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. - if (_MyParentEditItem == null) return; - Point newLocation = TableLocation(_MyParentEditItem, MyStepSectionLayoutData, ItemWidth); - if (!newLocation.Equals(ItemLocation)) ItemLocation = newLocation; - } - public override void SetToolTip(string tip) - { - DevComponents.DotNetBar.SuperTooltipInfo tpi = new DevComponents.DotNetBar.SuperTooltipInfo("", "", tip, null, null, DevComponents.DotNetBar.eTooltipColor.Lemon); - _MyToolTip.MinimumTooltipSize = new Size(0, 24); - _MyToolTip.TooltipDuration = 3; - //_MyToolTip.SetSuperTooltip(MyStepRTB, tpi); - _MyToolTip.SetSuperTooltip(MyFlexGrid, tpi); - } - private bool DoNotRefresh = false; - public override void RefreshContent() - { - if (DoNotRefresh) return; - Console.WriteLine("GridItem RefreshContent"); - _ActiveMode = MyFlexGrid.ContainsFocus; - using (Grid myGrid = MyItemInfo.MyContent.MyGrid.Get()) - { - MyItemInfo.MyContent.MyGrid.ResetContent(myGrid); - } - RefreshDisplay(_ActiveMode); - IdentifyMe(false); - } - public override int TableWidth { get { return 0; } } // DONE - public override int ItemLeft - { - get { return Left + lblTab.Left; } - set { Left = value - lblTab.Left; } - } - public override int ContentLeft { get { return Left + MyFlexGrid.Left; } } - public override int ContentWidth - { - get { return MyFlexGrid.Width; } - set - { - Width = value + lblTab.Left + lblTab.Width; - } - } - public override Point ItemLocation - { - get { return new Point(Location.X + lblTab.Left, Location.Y); } - set { Location = new Point(value.X - lblTab.Left, value.Y); } - } - public override int ItemWidth - { - get { return Width - lblTab.Left; } - set - { - Width = GridMargin + value + lblTab.Left; - } - } - public override void RefreshOrdinal() - { - TabFormat = null; // Reset Tab - } - public override bool Expanded - { - get {return !Colapsing;} - set {;} // Tables are always expanded. - } - public override void RefreshTab() { TabFormat = null;} - public override void SetFocus() { MyFlexGrid.Focus();} - public override void SaveContents() - { - if (!MyFlexGrid.IsDirty && !IsSaving) return; - List RtfRoUsageList = new List(); - List RtfTransList = new List(); - List RtfTransPageNumList = new List(); - - int r = 0; - int c = 0; - int w = MyFlexGrid.Cols.Count; - int h = MyFlexGrid.Rows.Count; - - string srchtxt = MyFlexGrid.GetSearchableText(); - // find the rousages within the grid cell. If this is an ro table, there will only be one usage - // if it is a modify and there will be no usages if it is new (the usage gets created on the save) - if (!MyFlexGrid.IsRoTable) - { - while (r < h) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - if (MyFlexGrid[r, c] != null) - { - // see if there are any links and save these so that any deleted ROs or transitions in the - // steprtb can have associated usages/transitions records removed from the database. - string lookFor = string.Format(@""); - MatchCollection matches = Regex.Matches((string)MyFlexGrid[r, c], lookFor); - for (int i = matches.Count - 1; i >= 0; i--) - { - Match m = matches[i]; - if (m != null && m.Groups.Count > 7 && m.Groups[7].ToString() == "ReferencedObject") - { - Regex regRefObj = new Regex(@"\#Link\:ReferencedObject\:([0-9]*) ([0-9a-zA-Z]*) ([0-9]*)", RegexOptions.Singleline); - Match myMatch = regRefObj.Match(m.Value); - if (myMatch.Success) - { - int usgid = int.Parse(myMatch.Groups[1].Value); - RtfRoUsageList.Add(usgid); - } - } - if (m != null && m.Groups.Count > 7 && m.Groups[7].ToString().StartsWith("Transition")) - { - Regex regRefObj = new Regex(@"\#Link\:Transition[a-zA-Z]*\:([0-9]*) ([0-9]*) ([0-9]*)", RegexOptions.Singleline); - Match myMatch = regRefObj.Match(m.Value); - if (myMatch.Success) - { - int tid = int.Parse(myMatch.Groups[2].Value); - RtfTransList.Add(tid); - int myIndex = m.Groups[4].Index; - int myLength = m.Groups[4].Length; - if (m.Groups[3].Value != " ") - { - myIndex = m.Groups[3].Index; - myLength += m.Groups[3].Length; - } - string gg = ((string)MyFlexGrid[r, c]).Substring(myIndex, myLength); - if (gg.Contains("(Page ~)")) RtfTransPageNumList.Add(tid); - } - } - } - } - } - c = c + 1; - if (c == w) - { - c = 0; - r = r + 1; - } - } - } - else - { - // new roid is in flexgrid.roid. Compare to previous, if there was a previous. If there - // is a modify RO, then need to delete the existing rousage record because a new usage - // record will get created that contains the selected ROID. - Regex regRefObj = new Regex(@"\#Link\:ReferencedObject\:([0-9]*) ([0-9a-zA-Z]*) ([0-9]*)", RegexOptions.Singleline); - Match myMatch = regRefObj.Match(MyItemInfo.MyContent.Text); - if (myMatch.Success) - { - int usgid = int.Parse(myMatch.Groups[1].Value); - RoUsageInfo rui = RoUsageInfo.Get(usgid); - if (rui.ROID == MyFlexGrid.ROID)RtfRoUsageList.Add(usgid); - } - } - // compare ro usages & transitions from database and list from grid contents - // if in both lists, don't do anything - // if only in database list, delete usage. - // never will have condition where it is not in database list, but is in steprtb text list (this - // case is handled when ro is inserted. - if (MyItemInfo.MyContent.ContentRoUsages != null) - { - List delRoUsgs = new List(); - foreach (RoUsageInfo ru in MyItemInfo.MyContent.ContentRoUsages) - if (!RtfRoUsageList.Contains(ru.ROUsageID)) delRoUsgs.Add(ru.ROUsageID); - foreach (int dRU in delRoUsgs) RoUsage.Delete(dRU); - } - if (MyItemInfo.MyContent.ContentTransitions != null) - { - List delTrans = new List(); - foreach (TransitionInfo ti in MyItemInfo.MyContent.ContentTransitions) - { - if (!RtfTransList.Contains(ti.TransitionID)) delTrans.Add(ti.TransitionID); - else if (RtfTransPageNumList.Contains(ti.TransitionID)) - { - using (Transition t = ti.Get()) - { - t.Config = ""; - t.Save(); - } - } - } - foreach (int dt in delTrans) Transition.Delete(dt); - } - - bool success = FinishSave(srchtxt); - if (success && !MyFlexGrid.IsRoTable) - { - MyStepRTB.FindAllLinks(); - MyStepRTB.OrigRTF = MyStepRTB.Rtf; - MyStepRTB.ClearUndo(); - } - } - private string DoLinkForRoTable(Item itm) - { - // 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 - // in the grid: - MyFlexGrid.Cols.Fixed = 0; - MyFlexGrid.Rows.Fixed = 0; - MyFlexGrid.StyleBackColor = Color.White; - - 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 - // been saved. - if (MyFlexGrid.IsRoTable && MyFlexGrid.ROID != null && itm.MyContent.ContentRoUsageCount < 1) - { - searchableText = string.Format(@"\v\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 - { - itm.MyContent.Text = searchableText; - itm.MyContent.UserID = Volian.Base.Library.VlnSettings.UserID; - itm.MyContent.DTS = DateTime.Now; - } - if (!MyFlexGrid.IsRoTable) itm.MyContent.Text = searchableText; - - // 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 (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 == 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 - - 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 { ;} } - public override void HandleResize() { ;} // DONE - public override void MatchExpanded() { ;} // DONE - public override void ItemSelect() - { - Console.WriteLine("GridItem ItemSelect {0} {1}",MyFlexGrid.Row, MyFlexGrid.Col); - // Was getting an Error that _MyStepRTB was Disposed RHM 20101217 - if (!MyFlexGrid.Disposing) - { - Focus(); - MyFlexGrid.Focus(); - if (!MyFlexGrid.IsRoTable) // Table ROs are none editable - don't select a table cell - { - try - { - MyFlexGrid.Select(0, 0); - MyFlexGrid.FirstEntry = true; // to fix a problem with initial mouse click into table - } - catch (Exception ex) - { - MessageBox.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); - } - } - } - else - { - _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) - { - int r = MyFlexGrid.Row; - int c = MyFlexGrid.Col; - - if (!reverse) - { - int w = MyFlexGrid.Cols.Count; - int h = MyFlexGrid.Rows.Count; - while (r < h) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - int ss = MyStepRTB.SelectionStart; - int sl = MyStepRTB.SelectionLength; - MyFlexGrid.StartEditing(); - MyStepRTB.Select(ss, sl); // need to reset selection because startediting positions to end. - if (MyStepRTB.ReadOnly) - { - MessageBox.Show("Cannot replace linked text!", "Find/Replace", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly); - return DialogResult.Yes; - } - string oldRtf = MyStepRTB.Rtf; - DialogResult dr = MyStepRTB.ReplaceText(rpltxt, fndstr, caseSensitive, matchWholeWord, reverse, prompt, fndrpldlg); - if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf; - if (dr == DialogResult.Yes || dr == DialogResult.Cancel) return dr; - } - c = c + 1; - if (c == w) - { - c = 0; - r = r + 1; - } - if (r < h) - { - MyFlexGrid.Select(r, c); - MyStepRTB.Select(0, 0); - } - } - } - else // reverse - { - while (r >= 0) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - int ss = MyStepRTB.SelectionStart; - int sl = MyStepRTB.SelectionLength; - MyFlexGrid.StartEditing(); - MyStepRTB.Select(ss, sl); - if (MyStepRTB.ReadOnly) - { - MessageBox.Show("Cannot replace linked text!", "Find/Replace", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly); - return DialogResult.Yes; - } - string oldRtf = MyStepRTB.Rtf; - DialogResult dr = MyStepRTB.ReplaceText(rpltxt, fndstr, caseSensitive, matchWholeWord, reverse, prompt, fndrpldlg); - if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf; - if (dr == DialogResult.Yes || dr == DialogResult.Cancel) return dr; - } - c = c - 1; - if (c < 0) - { - c = MyFlexGrid.Cols.Count - 1; - r = r - 1; - } - cr = MyFlexGrid.GetMergedRange(r, c); - if (r >= 0 && cr.r1 == r && cr.c1 == c) - { - MyFlexGrid.Select(r, c); - MyFlexGrid.StartEditing(); - MyStepRTB.Select(MyStepRTB.Text.Length, 0); - } - } - } - return DialogResult.No; - } - public override bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse) - { - if (MyFlexGrid.Row < 0) MyFlexGrid.Row = (reverse) ? MyFlexGrid.Rows.Count - 1 : 0; - if (MyFlexGrid.Col < 0) MyFlexGrid.Col = (reverse) ? MyFlexGrid.Cols.Count - 1 : 0; - int r = MyFlexGrid.Row; - int c = MyFlexGrid.Col; - if (!reverse) - { - int w = MyFlexGrid.Cols.Count; - int h = MyFlexGrid.Rows.Count; - while (r < h) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - int ss = MyStepRTB.SelectionStart + MyStepRTB.SelectionLength; - MyFlexGrid.StartEditing(); - MyStepRTB.Select(ss, 0); // need to reset selection because startediting positions to end. - bool scn = MyStepRTB.FindText(str, caseSensitive, matchWholeWord, reverse); - if (scn) return true; - } - c = c + 1; - if (c == w) - { - c = 0; - r = r + 1; - } - if (r < h) - { - MyFlexGrid.Select(r, c); - MyStepRTB.Select(0, 0); - } - } - } - else - { - while (r >= 0) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - int ss = MyStepRTB.SelectionStart; - MyFlexGrid.StartEditing(); - MyStepRTB.Select(ss, 0); - bool scn = MyStepRTB.FindText(str, caseSensitive, matchWholeWord, reverse); - if (scn) return true; - } - c = c - 1; - if (c < 0) - { - c = MyFlexGrid.Cols.Count - 1; - r = r - 1; - } - cr = MyFlexGrid.GetMergedRange(r, c); - if (r >= 0 && cr.r1 == r && cr.c1 == c) - { - MyFlexGrid.Select(r, c); - MyFlexGrid.StartEditing(); - MyStepRTB.Select(MyStepRTB.Text.Length, 0); - } - } - } - return false; - } - public override void PositionToEnd() - { - int r = MyFlexGrid.Rows.Count - 1; - int c = MyFlexGrid.Cols.Count - 1; - MyFlexGrid.Select(r, c); - while (r >= 0) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - MyFlexGrid.StartEditing(); - return; - } - c = c - 1; - if (c < 0) - { - c = MyFlexGrid.Cols.Count - 1; - r = r - 1; - } - if (r >= 0) - { - MyFlexGrid.Select(r, c); - MyStepRTB.Select(MyStepRTB.Text.Length, 0); - } - } - } - public override void PositionToStart() - { - MyFlexGrid.Select(0,0); - MyFlexGrid.StartEditing(); - MyStepRTB.Select(0, 0); - } - public override string SelectedTextForFind - { - get - { - StepRTB srtb = MyStepRTB; - if (srtb.SelectionLength > 0) - { - if (srtb.IsSelectionLinked(srtb.SelectionStart, srtb.SelectionLength)) - return srtb.SelectedText.Substring(0, srtb.SelectedText.IndexOf("#Link")); - else - return srtb.SelectedText; - } - return null; - } - } - public override bool SpellCheckNext() - { - if (MyFlexGrid.IsRoTable) return true; // skip RO Tables - int r = MyFlexGrid.Row; - int c = MyFlexGrid.Col; - int w = MyFlexGrid.Cols.Count; - int h = MyFlexGrid.Rows.Count; - while (r < h) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - MyFlexGrid.Select(r, c); - MyFlexGrid.StartEditing(); - string oldRtf = MyStepRTB.Rtf; - bool scn = MyStepRTB.SpellCheckNext(); - if (oldRtf != MyStepRTB.Rtf) MyFlexGrid[r, c] = MyStepRTB.Rtf; - if (!scn) return false; - } - c = c + 1; - if (c == w) - { - c = 0; - r = r + 1; - } - } - return true; - } - public override void IdentifyMe(bool highlight) - { - if (highlight) - { - MyFlexGrid.StyleBackColor = Color.Gray; - MyFlexGrid.Styles.Fixed.BackColor = Color.Gray; - } - else - { - MyFlexGrid.Styles.Fixed.BackColor = MyFlexGrid.DefaultFixedBackgroundColor; - MyFlexGrid.StyleBackColor = MyFlexGrid.DefaultCellBackgroundcolor; - if (MyFlexGrid.Focused) // If active Set BackColor to the active color - SetActive(); - else // Otherwise Set the BackColor to either the InactiveColor or the AnnotationColor - { - MyFlexGrid.StyleBackColor = - MyItemInfo.ItemAnnotationCount == 0 ? MyStepPanel.InactiveColor : MyStepPanel.AnnotationColor; - // Turn-off Size adjustment - MyFlexGrid.Cols.Fixed = 0; - MyFlexGrid.Rows.Fixed = 0; - } - } - } - public override void SetActive() - { - Console.WriteLine("GridItem 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 override void RefreshDisplay(bool activeMode) - { - Console.WriteLine("GridItem RefreshDisplay {0}",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; - MyFlexGrid.KeyActionTab = KeyActionEnum.MoveAcross; - MyFlexGrid.AdjustGridControlSize(); - // When a grid is read from XML, all of the styles are updated to the values in the XML. - // Thus any specific settings need to be set after the grid is read. - MyFlexGrid.Styles["Highlight"].BackColor = Color.LightCyan; - MyFlexGrid.Styles["Focus"].BackColor = Color.LightCyan; - MyFlexGrid.HighLight = activeMode ? C1.Win.C1FlexGrid.HighLightEnum.Always : C1.Win.C1FlexGrid.HighLightEnum.WithFocus; - MyFlexGrid.VwMode = MyStepPanel.VwMode; - } - public override void ToggleEditView(E_ViewMode vwMode) - { - /* - * TODO: - * 1) SaveContents - */ - RefreshDisplay(false); - MyFlexGrid.VwMode = vwMode; - } - public override int TabLeft { get { return lblTab.Left; } set { lblTab.Left = value; } } - public override Font TabFont { get { return lblTab.Font; } set { lblTab.Font = value; } } - public override string TabText { get { return lblTab.Text; } } - public override Point TabLocation { get { return lblTab.Location; } } - public override Font ContentFont { get { return MyFlexGrid.Font; } set { MyFlexGrid.Font = value; } } // TODO how do we know what font tables are in? - public override float ContentTop { get { return MyFlexGrid.Top; } } - public override void SetupHeader(ItemInfo itemInfo) { ;} // tables do not have headers - public override void ShowExpanded() {;} - public override void SetText() - { - // 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() - { - if (!MyFlexGrid.GetXMLData().Contains("<NewID>")) return; - BasicSave(); - // need to loop thru all pasted cells: for now do all cells. - int w = MyFlexGrid.Cols.Count; - int h = MyFlexGrid.Rows.Count; - int r = 0; - int c = 0; - String Rtf = null; - while (r < h) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - Rtf = (string)MyFlexGrid[r, c]; - if (Rtf != null) - { - int startIndx = 0; - while (Rtf.IndexOf("") > -1) - { - // first find the new link and determine whether it's RO or transition. - int indx = Rtf.IndexOf(@"#Link:ReferencedObject:", startIndx); - if (indx > 0) - { - // only look in the substring limited by the first occurrance of [END>. If there is more - // than one, don't get multiple links in the string. - int endindx = Rtf.IndexOf(@"END>", indx) + 4; - Match mro = Regex.Match(Rtf.Substring(indx, endindx - indx), @"([A-Za-z]*):(.*)\[END>"); - string linkstr = mro.Groups[2].Value; - string[] roparts = linkstr.Split(" ".ToCharArray()); - ContentRoUsage rousg = null; - int oldid = -1; - using (Item itm = MyItemInfo.Get()) - { - using (RODb rodb = RODb.GetJustRoDb(Convert.ToInt32(roparts[2]))) - { - rousg = itm.MyContent.ContentRoUsages.Add(roparts[1], rodb); - } - oldid = rousg.ROUsageID; - int newid = Rtf.IndexOf("", indx); - Rtf = Rtf.Remove(newid, 7); - Rtf = Rtf.Insert(newid, string.Format("", rousg.ROUsageID)); - itm.Save(); - Rtf = Rtf.Replace(string.Format("", oldid), rousg.ROUsageID.ToString()); - itm.Save(); - MyItemInfo.MyContent.RefreshContentRoUsages(); - } - startIndx = endindx; - } - else - { - Match mt = Regex.Match(Rtf, @"#Link:Transition:([0-9]+) "); - if (mt.Length <= 0) mt = Regex.Match(Rtf, @"#Link:TransitionRange:([0-9]+) "); - if (mt.Length > 0) - { - int endtindx = Rtf.IndexOf("END>", mt.Index) + 4; - indx = mt.Index + 6; // get past '#Link:" - Match m = Regex.Match(Rtf.Substring(indx, endtindx - indx), @"([A-Za-z]*):(.*)\[END>"); - bool isSingleTran = true; - if (Rtf.Substring(indx, 16).IndexOf("TransitionRange") >= 0) isSingleTran = false; - string linkstr = m.Groups[2].Value; - string[] tparts = linkstr.Split(" ".ToCharArray()); - int type = System.Convert.ToInt32(tparts[0]); - int tr1 = System.Convert.ToInt32(tparts[2]); // tparts[2] is token for tranid - int tr2 = tr1; - if (tparts.Length > 3) - tr2 = System.Convert.ToInt32(tparts[3]); // tparts[3] is token for rangeid - bool dispose1 = false; - Item itm1 = null; - bool dispose2 = false; - Item itm2 = null; - using (Item itm = MyItemInfo.Get()) - { - if (itm.ItemID == tr1) - itm1 = itm; // a transition that points to itself should not dispose - else - { - dispose1 = true; - itm1 = Item.Get(tr1); - } - if (itm.ItemID == tr2) - itm2 = itm; // a transition that points to itself should not dispose - else if (tr1 == tr2) - itm2 = itm1; // if both destinations are the same only dispose the first one - else - { - dispose2 = true; - itm2 = Item.Get(tr2); - } - ContentTransition ct = itm.MyContent.ContentTransitions.Add(itm1, itm2); - //Console.WriteLine("CT {0},{1},{2},{3}", ct.TransitionID, itm.ItemID, itm.MyContent.MyContentUnique, itm.MyContent.ContentTransitions.Count); - ct.TranType = type; - - if (isSingleTran) - ct.IsRange = 0; - else if (tr1 != tr2) - ct.IsRange = 1; - else - ct.IsRange = 2; - - int oldidt = ct.TransitionID; - int newidt = Rtf.IndexOf("", indx); - Rtf = Rtf.Remove(newidt, 7); - Rtf = Rtf.Insert(newidt, string.Format("", ct.TransitionID)); - //Rtf = Rtf.Replace("", string.Format("", ct.TransitionID)); - itm.Save(); - Rtf = Rtf.Replace(string.Format("", oldidt), ct.TransitionID.ToString()); - itm.Save(); - MyItemInfo.MyContent.RefreshContentTransitions(); - } - if (dispose2) itm2.Dispose(); - if (dispose1) itm1.Dispose(); - } - } - } - MyFlexGrid[r, c] = Rtf; - } - } - c = c + 1; - if (c == w) - { - c = 0; - r = r + 1; - } - } - } - public override void SaveCurrentAndContents() - { - IsSaving = true; - if (MyFlexGrid.Row >= 0 && MyFlexGrid.Col >= 0 && MyStepRTB.EditMode) // Only if a Cell is Selected - { - int row = MyFlexGrid.Row; - int col = MyFlexGrid.Col; - //SaveContents(); - DoNotRefresh = true; - MyStepRTB.Rtf = MyStepRTB.DoNewLinkInGridCell(); - DoNotRefresh = false; - MyFlexGrid.Row = row; - MyFlexGrid.Col = col; - MyFlexGrid[MyFlexGrid.Row, MyFlexGrid.Col] = MyStepRTB.Rtf; - } - if (!MyFlexGrid.IsDirty) return; - SaveContents(); - IsSaving = false; - } - #endregion - #region Miscellaneous Support - internal void SetSearchCell(string SearchString) - { - // Walk thru grid to find first occurance of SearchString and set that cell for - // edit. - int r = 0; - int c = 0; - int w = MyFlexGrid.Cols.Count; - int h = MyFlexGrid.Rows.Count; - while (r < h) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - if (MyFlexGrid[r, c] != null) - { - MyFlexGrid.StartEditing(r, c); - TableCellEditor tce = MyFlexGrid.TableCellEditor; - // note that this method is only used from Search Results. - // The search query will handle the case sensitivity, so - // we can just see if contains the string without considering - // case sensitivity. - if (tce.Text.ToUpper().Contains(SearchString.ToUpper())) - return; - } - } - c = c + 1; - if (c == w) - { - c = 0; - r = r + 1; - } - } - } - - #endregion - } -} diff --git a/PROMS/Volian.Controls.Library/IEditItem.cs b/PROMS/Volian.Controls.Library/IEditItem.cs deleted file mode 100644 index 44e0f34a..00000000 --- a/PROMS/Volian.Controls.Library/IEditItem.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Windows.Forms; -using VEPROMS.CSLA.Library; - -namespace Volian.Controls.Library -{ - public abstract partial class EditItem - { - public abstract void SetToolTip(string tip); // { ;} - public abstract void RefreshContent(); // { ; } - public abstract EditItem MyParentEditItem { get; set ; } - public abstract EditItem MyPreviousEditItem { get; set; }//{ get { return null; } set { ;} } - public abstract int ItemLeft { get; set; }//{ get { return 0; } set { ;} } - public abstract int TextLeft { get; }//{ get { return 0; } set { ;} } - public abstract int TextWidth { get; set ; }//{ get { return 0; } set { ;} } - public abstract Point ItemLocation { get; set ; }//{ get { return new Point(0, 0); } set { ;} } - public abstract int ItemWidth { get; set ; }//{ get { return 0; } set { ;} } - public abstract void RefreshOrdinal(); // { ;} - public abstract bool Expanded { get; set ; }//{ get { return false; } set { ;} } - public abstract void RefreshTab(); // { ;} - public abstract void SetFocus(); // { ;} - public abstract void SaveContents(); // { ;} - public abstract bool CanExpand { get; set ; }//{ get { return false; } set { ;} } - public abstract void HandleResize(); // { ;} - public abstract void MatchExpanded(); // { ;} - public abstract void ItemSelect(); // { ;} - public abstract void ItemShow(); // { ;} - public abstract StepRTB MyStepRTB { get; } - public abstract DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg); - public abstract bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse); - public abstract void PositionToEnd(); - public abstract string SelecteTextForFind { get;} - public abstract bool SpellCheckNext(); - public abstract void IdentifyMe(bool highlight); - public abstract void SetActive(); - public abstract bool IsEmpty(); - public abstract void MakeNotEmpty(); - public abstract void RefreshDisplay(bool editMode); - public abstract void ToggleEditView(E_ViewMode vwMode); - } -} diff --git a/PROMS/Volian.Controls.Library/OutlineRTFTable.cs b/PROMS/Volian.Controls.Library/OutlineRTFTable.cs deleted file mode 100644 index 11c9e827..00000000 --- a/PROMS/Volian.Controls.Library/OutlineRTFTable.cs +++ /dev/null @@ -1,306 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Text.RegularExpressions; - -namespace Volian.Controls.Library -{ - public class OutlineRTFTable - { - public OutlineRTFTable(string rtf, bool withBorder) - { - Rtf = rtf; - WithBorder = withBorder; - } - private string _Rtf; - public string Rtf - { - get { return _Rtf; } - set { _Rtf = value; } - } - private bool _WithBorder; - public bool WithBorder - { - get { return _WithBorder; } - set { _WithBorder = value; } - } - private RtfLines _Lines; - public RtfLines Lines - { - get - { - if (_Lines == null) - _Lines = new RtfLines(Rtf); - return _Lines; - } - } - public void OutlineTable() - { - int maxWidth = Lines.MaximumWidth;// Determine maximum width - // spaces here if not an outlined table: - Lines.Pad(maxWidth, WithBorder ? @"\u9474?" : " "); // Pad the lines to the appropriate width - Lines.Insert(0, new RtfLine(maxWidth, WithBorder ? @"\u9484?" : " ", WithBorder ? @"\u9472?" : " ", WithBorder ? @"\u9488?" : " ")); // Insert top line - Lines.Add(new RtfLine(maxWidth, WithBorder ? @"\u9492?" : " ", WithBorder ? @"\u9472?" : " ", WithBorder ? @"\u9496?" : " ")); // Insert bottom line - Lines.ReplaceLines(WithBorder); - } - public override string ToString() - { - return Lines.ToString(); - } - } - public class RtfLines : List - { - public static Regex _RegReplaceLine = new Regex(@"\\line((\\[^ \[\]\\\(\)]*) )"); - public RtfLines(string text) - { - // replace RTF \line with crlf - string txt = _RegReplaceLine.Replace(text, "$1\r\n"); - // split text into lines - string[] breaks = { "\r\n" }; - string[] lines = txt.Split(breaks, StringSplitOptions.None); - //string lastLine = lines[lines.Length - 1]; - foreach (string line in lines) - Add(new RtfLine(line.Replace("\\bullet","*"))); - } - public int MaximumWidth - { - get - { - int retval = 0; - foreach (RtfLine myLine in this) - if (myLine.MaximumWidth > retval) retval = myLine.MaximumWidth; - return retval; - } - } - public void Pad(int maxWidth, string edge) - { - foreach (RtfLine myLine in this) - myLine.Pad(maxWidth, edge); - - } - public override string ToString() - { - StringBuilder sb = new StringBuilder(); - string sep = ""; - foreach (RtfLine myLine in this) - { - sb.Append(sep + myLine.ToString()); - sep = "\r\n"; - } - return sb.ToString(); - } - private static Regex _RegRightCheck = new Regex(@"-|\\u9472?|\\u8209\?"); - private static Regex _RegAboveCheck = new Regex(@"\||\\u9474\?|\\u9492\?|\\u9516\?|\\u9532\?|\\u9500\?|\\u9484\?|\\u9524\?|\\u9488\?|\\u9508\?"); - private static Regex _RegLeftCheck = new Regex(@"-|\\u9472\?|\\u9508\?|\\u9516\?|\\u9500\?|\\u9532\?|\\u9484\?|\\u9488\?|\\u9492\?|\\u8209\?"); - private static Regex _RegBelowCheck = new Regex(@"\||\\u9474\?"); - - private static Regex _RegRightCheck1 = new Regex(@"\\u9474\?"); - private static Regex _RegAboveCheck1 = new Regex(@"\\u9472\?|\\u8209\?"); - private static Regex _RegLeftCheck1 = new Regex(@"\\u9474\?"); - private static Regex _RegBelowCheck1 = new Regex(@"\\u9472\?|\\u8209\?"); - - private static Regex _RegHorizontalCheck = new Regex(@"-|\\u9472\?|\\u8209\?"); - private static Regex _RegVerticalCheck = new Regex(@"\||\\u9474\?"); - static private string[] TableCharsU = { - "\x0", // HEX"\x0", // No character - @"\u9472?", // HEX@"\u2500",// - Horizontal line - 16-bit char: '\xC4' - @"\u9474?", // HEX@"\u2502",// | Vertical line - 16-bit char: '\xB3' - @"\u9492?", // HEX@"\u2514",// L Bottom Left corner - 16-bit char: '\xC0' - @"\u9472?", // HEX@"\u2500",// - Horizontal line - 16-bit char: '\xC4' - @"\u9472?", // HEX@"\u2500",// - Horizontal line - 16-bit char: '\xC4' - @"\u9496?", // HEX@"\u2518",// Bottom Right Corner - 16-bit char: '\xD9' - @"\u9524?", // HEX@"\u2534",// Bottom Tee - 16-bit char: '\xC1' - @"\u9474?", // HEX@"\u2502",// | Vertical Bar - 16-bit char: '\xB3' - @"\u9484?", // HEX@"\u250c",// Upper Left corner - 16-bit char: '\xDA' - @"\u9474?", // HEX@"\u2502",// | Vertical Bar - 16-bit char: '\xB3' - @"\u9500?", // HEX@"\u251c",// Left Tee - 16-bit char: '\xC3' - @"\u9488?", // HEX@"\u2510",// Upper Right corner - 16-bit char: '\xBF' - @"\u9516?", // HEX@"\u252c",// T Top Tee - 16-bit char: '\xC2' - @"\u9508?", // HEX@"\u2524",// Right Tee - 16-bit char: '\xB4' - @"\u9532?", // HEX@"\u253c" // + Plus - 16-bit char: '\xC5' - }; - internal void ReplaceLines(bool withBorder) - { - int maxWidth = this[0].Count; - for (int row = 1; row < Count - 1; row++) - { - RtfLine lineAbove = this[row - 1]; - RtfLine line = this[row]; - RtfLine lineBelow = this[row + 1]; - for (int col = 1; col < maxWidth - 1; col++) - { - RtfPiece curPiece = line[col]; - string current = curPiece.Text; - bool horizontal = _RegHorizontalCheck.IsMatch(current); // Horizontal - bool vertical = _RegVerticalCheck.IsMatch(current); // Vertical - if (horizontal || vertical) - { - int index = _RegRightCheck.IsMatch(line[col + 1].Text) || - (horizontal && _RegRightCheck1.IsMatch(line[col + 1].Text)) ? 1 : 0; // Right - index += _RegAboveCheck.IsMatch(lineAbove[col].Text) || - (vertical && _RegAboveCheck1.IsMatch(lineAbove[col].Text)) ? 2 : 0; // Above - index += _RegLeftCheck.IsMatch(line[col - 1].Text) || - (horizontal && _RegLeftCheck1.IsMatch(line[col - 1].Text)) ? 4 : 0; // Left - index += _RegBelowCheck.IsMatch(lineBelow[col].Text) || - (vertical && _RegBelowCheck1.IsMatch(lineBelow[col].Text)) ? 8 : 0; // Below - if (index > 0) - { - curPiece.Text = TableCharsU[index]; - // this connects the lines to the border, so only do it if there is a border - if (withBorder) - { - if (vertical && row == 1) lineAbove[col].Text = TableCharsU[13]; // Upper Tee - if (vertical && row == Count - 2) lineBelow[col].Text = TableCharsU[7]; // Lower Tee - if (horizontal && col == 1) line[col - 1].Text = TableCharsU[11];// Left Tee - if (horizontal && col == maxWidth - 2) line[col + 1].Text = TableCharsU[14];// Right Tee - } - } - } - } - } - } - private void ListItems(string loc, string str) - { - StringBuilder sb = new StringBuilder(string.Format("{0} = @\"", loc)); - string sep = ""; - foreach (char c in str) - { - if (c < 127) - sb.Append(sep + c.ToString()); - else - sb.Append(sep + string.Format("\\u{0}?", (int)c)); - sep = "|"; - } - Console.WriteLine(sb.ToString()); - } - } - public class RtfLine : List - { - private static Regex _RegRtfText = new Regex(@"((\\[^'u ]*|\\up[0-9]|\\ul|\\ulnone)+( |$|(?=\\['u])))?(|\\'[0-9a-fA-F]{2}|\\u[0-9]*\?|[^\\]{1}|$|)"); - public RtfLine(string text) - { - MatchCollection matches = _RegRtfText.Matches(text); - int nextIndex = 0; - foreach (Match match in matches) - { - if (nextIndex != match.Index) // This should never happen - { - throw new Exception(string.Format("\"RtfPiece Missing Content\",{0},{1},\"{2}\",\"{3}\",\"{4}\"", nextIndex, match.Index, text.Substring(nextIndex, match.Index - nextIndex), match.Groups[2].Value, match.Groups[4].Value)); - //Console.WriteLine("\"RtfPiece Missing Content\",{0},{1},\"{2}\",\"{3}\",\"{4}\"", nextIndex, match.Index, text.Substring(nextIndex, match.Index - nextIndex), match.Groups[2].Value, match.Groups[4].Value); - //Console.WriteLine(text.Substring(nextIndex)); - } - nextIndex = match.Index + match.Length; - string rtfPart = match.Groups[1].ToString(); - if (match.Groups[1].ToString().TrimEnd(" ".ToCharArray()).Length + match.Groups[4].ToString().Length > 0) - this.Add(new RtfPiece(match.Groups[1].ToString().TrimEnd(" ".ToCharArray()), match.Groups[4].ToString())); - //if (match.Groups[1].ToString().Length + match.Groups[4].ToString().Length > 0) - // this.Add(new RtfPiece(match.Groups[1].ToString(), match.Groups[4].ToString())); - } - } - public RtfLine(int width, string left, string fill, string right) - { - Add(new RtfPiece("", left)); - for (int i = 0; i < width; i++) this.Add(new RtfPiece("", fill)); // Pad - Add(new RtfPiece("", right)); - } - public int MaximumWidth - { - get - { - int retval = 0; - foreach (RtfPiece myPiece in this) - retval += myPiece.MaximumWidth; - return retval; - } - } - public override string ToString() - { - StringBuilder sb = new StringBuilder(); - foreach (RtfPiece myPiece in this) - sb.Append(myPiece.ToString()); - return sb.ToString(); - } - internal void Pad(int maxWidth, string edge) - { - int pad = maxWidth - MaximumWidth; - this.Insert(0, new RtfPiece("", edge)); // Left Edge - for (int i = 0; i < pad; i++) this.Add(new RtfPiece("", " ")); // Pad - this.Add(new RtfPiece("", edge)); // Right Edge - } - public new RtfPiece this[int index] - { - get - { - int j = 0; - foreach (RtfPiece myPiece in this) - { - if (myPiece.Text != "") - { - if (j == index) return myPiece; - j++; - } - } - return null; - } - } - } - public class RtfPiece - { - private string _Rtf; - public string Rtf - { - get { return _Rtf; } - set { _Rtf = value; } - } - private string _Text = ""; - public string Text - { - get { return _Text; } - set { _Text = value; } - } - public int TextLength - { - get { return Text.Length; } - } - public int MaximumWidth - { - get { return Text == "" ? 0 : 1; } - } - private static Regex _RegStartLink = new Regex(@""); - public RtfPiece(string rtf, string text) - { - _Rtf = rtf; - if (_RegStartLink.IsMatch(text) || _RegEndLink.IsMatch(text)) - _Rtf += (rtf == "" ? "" : " ") + text; - else - { - _Rtf += rtf == "" ? "" : " "; - _Text = text; - } - } - public override string ToString() - { - return _Rtf + _Text; - //string retval = _RegUnicode.Replace(_Text, new MatchEvaluator(RtfUnicodeCharacter)); - //retval = _RegHex.Replace(retval, new MatchEvaluator(RtfHexCharacter)); - //return retval; - } - //private static Regex _RegUnicode = new Regex(@"\\u([0-9ABCDEF]*)\?"); - //internal static string RtfUnicodeCharacter(Match myMatch) - //{ - // string hexStr = myMatch.Groups[1].ToString(); - // int i = int.Parse(hexStr); - // Char schar = Convert.ToChar(i); - // return schar.ToString(); - //} - //private static Regex _RegHex = new Regex(@"\\'([0-9A-Fa-f]{2})"); - //internal static string RtfHexCharacter(Match myMatch) - //{ - // string hexStr = myMatch.Groups[1].ToString(); - // int i = int.Parse(hexStr, System.Globalization.NumberStyles.HexNumber); - // Char schar = Convert.ToChar(i); - // return schar.ToString(); - //} - } -} diff --git a/PROMS/Volian.Controls.Library/RTBAPI - WithSaveHandlesCode.cs b/PROMS/Volian.Controls.Library/RTBAPI - WithSaveHandlesCode.cs deleted file mode 100644 index 6a9ab691..00000000 --- a/PROMS/Volian.Controls.Library/RTBAPI - WithSaveHandlesCode.cs +++ /dev/null @@ -1,1191 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; -using System.Drawing; -using System.Runtime.InteropServices; -using System.ComponentModel; -using System.Security.Permissions; -using Microsoft.Win32.SafeHandles; - -namespace Volian.Controls.Library -{ - public static class RTBAPI - { - #region SendMessage - [DllImport("user32.dll", SetLastError = true)] - private static extern int SendMessage(HandleRef hWndlock, Messages wMsg, Int32 wParam, ref Point pt); - [DllImport("user32.dll", SetLastError = true)] - private static extern int SendMessage(HandleRef hWndlock, Messages wMsg, Int32 wParam, int lParam); - [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] - public static extern int SendMessage(HandleRef hWndlock, Messages wMsg, RTBSelection wParam, ref CharFormat2 cf2); - [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] - public static extern int SendMessage(HandleRef hWndlock, Messages wMsg, int wParam, ref ParaFormat2 pf2); - [DllImport("user32.dll", SetLastError = true)] - private static extern int GetWindowLong (IntPtr hWin, int index); - #region RTB Messages - // EM_AUTOURLDETECT - An EM_AUTOURLDETECT message enables or disables automatic detection of URLs by a rich edit control. - // EM_CANPASTE - The EM_CANPASTE message determines whether a rich edit control can paste a specified clipboard format. - // EM_CANREDO - The EM_CANREDO message determines whether there are any actions in the control redo queue. - // EM_DISPLAYBAND - The EM_DISPLAYBAND message displays a portion of the contents of a rich edit control, as previously formatted for a device using the EM_FORMATRANGE message. - // EM_EXGETSEL - The EM_EXGETSEL message retrieves the starting and ending character positions of the selection in a rich edit control. - // EM_EXLIMITTEXT - The EM_EXLIMITTEXT message sets an upper limit to the amount of text the user can type or paste into a rich edit control. - // EM_EXLINEFROMCHAR - The EM_EXLINEFROMCHAR message determines which line contains the specified character in a rich edit control. - // EM_EXSETSEL - The EM_EXSETSEL message selects a range of characters or COM objects in a Rich Edit control. - // EM_FINDTEXT - The EM_FINDTEXT message finds text within a rich edit control. - // EM_FINDTEXTEX - The EM_FINDTEXTEX message finds text within a rich edit control. - // EM_FINDTEXTEXW - The EM_FINDTEXTEXW message finds Unicode text within a rich edit control. - // EM_FINDTEXTW - The EM_FINDTEXTW message finds Unicode text within a rich edit control. - // EM_FINDWORDBREAK - The EM_FINDWORDBREAK message finds the next word break before or after the specified character position or retrieves information about the character at that position. - // EM_FORMATRANGE - The EM_FORMATRANGE message formats a range of text in a rich edit control for a specific device. - // EM_GETAUTOURLDETECT - The EM_GETAUTOURLDETECT message indicates whether the auto URL detection is turned on in the rich edit control. - // EM_GETBIDIOPTIONS - The EM_GETBIDIOPTIONS message indicates the current state of the bidirectional options in the rich edit control. - // EM_GETCHARFORMAT - The EM_GETCHARFORMAT message determines the character formatting in a rich edit control. - // EM_GETCTFMODEBIAS - An application sends a EM_GETCTFMODEBIAS message to get the Text Services Framework mode bias values for a Rich Edit control. - // EM_GETCTFOPENSTATUS - An application sends an EM_GETCTFOPENSTATUS message to determine if the Text Services Framework (TSF) keyboard is open or closed. - // EM_GETEDITSTYLE - The EM_GETEDITSTYLE message retrieves the current edit style flags. - // EM_GETEVENTMASK - The EM_GETEVENTMASK message retrieves the event mask for a rich edit control. The event mask specifies which notification messages the control sends to its parent window. - // EM_GETHYPHENATEINFO - An application sends an EM_GETHYPHENATEINFO message to get information about hyphenation for a Rich Edit control. - // EM_GETIMECOLOR - The EM_GETIMECOLOR message retrieves the Input Method Editor (IME) composition color. This message is available only in Asian-language versions of the operating system. - // EM_GETIMECOMPMODE - An application sends an EM_GETIMECOMPMODE message to get the current IME mode for a rich edit control. - // EM_GETIMECOMPTEXT - An application sends an EM_GETIMECOMPTEXT message to get the IME composition text. - // EM_GETIMEMODEBIAS - An application sends an EM_GETIMEMODEBIAS message to get the IME mode bias for a Rich Edit control. - // EM_GETIMEOPTIONS - The EM_GETIMEOPTIONS message retrieves the current IME options. This message is available only in Asian-language versions of the operating system. - // EM_GETIMEPROPERTY - An application sends a EM_GETIMEPROPERTY message to get the property and capabilities of the IME associated with the current input locale. - // EM_GETLANGOPTIONS - An application sends an EM_GETLANGOPTIONS message to get a rich edit control's option settings for IME and Asian language support. - // EM_GETOLEINTERFACE - The EM_GETOLEINTERFACE message retrieves an IRichEditOle object that a client can use to access a rich edit control's COM functionality. - // EM_GETOPTIONS - The EM_GETOPTIONS message retrieves rich edit control options. - // EM_GETPAGEROTATE - Deprecated. An application sends an EM_GETPAGEROTATE message to get the text layout for a Rich Edit control. - // EM_GETPARAFORMAT - The EM_GETPARAFORMAT message retrieves the paragraph formatting of the current selection in a rich edit control. - // EM_GETPUNCTUATION - The EM_GETPUNCTUATION message gets the current punctuation characters for the rich edit control. This message is available only in Asian-language versions of the operating system. - // EM_GETREDONAME - An application sends an EM_GETREDONAME message to a rich edit control to retrieve the type of the next action, if any, in the control's redo queue. - // EM_GETSCROLLPOS - An application sends an EM_GETSCROLLPOS message to obtain the current scroll position of the edit control. - // EM_GETSELTEXT - The EM_GETSELTEXT message retrieves the currently selected text in a rich edit control. - // EM_GETTEXTEX - The EM_GETTEXTEX message allows you to get all of the text from the rich edit control in any particular code base you want. - // EM_GETTEXTLENGTHEX - The EM_GETTEXTLENGTHEX message calculates text length in various ways. It is usually called before creating a buffer to receive the text from the control. - // EM_GETTEXTMODE - An application sends an EM_GETTEXTMODE message to get the current text mode and undo level of a rich edit control. - // EM_GETTEXTRANGE - The EM_GETTEXTRANGE message retrieves a specified range of characters from a rich edit control. - // EM_GETTYPOGRAPHYOPTIONS - The EM_GETTYPOGRAPHYOPTIONS message returns the current state of the typography options of a rich edit control. - // EM_GETUNDONAME - Rich Edit 2.0 and later: An application sends an EM_GETUNDONAME message to a rich edit control to retrieve the type of the next undo action, if any. - // EM_GETWORDBREAKPROCEX - The EM_GETWORDBREAKPROCEX message retrieves the address of the currently registered extended word-break procedure. - // EM_GETWORDWRAPMODE - The EM_GETWORDWRAPMODE message gets the current word wrap and word-break options for the rich edit control. This message is available only in Asian-language versions of the operating system. - // EM_GETZOOM - The EM_GETZOOM message gets the current zoom ratio, which is always between 1/64 and 64. - // EM_HIDESELECTION - The EM_HIDESELECTION message hides or shows the selection in a rich edit control. - // EM_ISIME - An application sends a EM_ISIME message to determine if current input locale is an East Asian locale. - // EM_PASTESPECIAL - The EM_PASTESPECIAL message pastes a specific clipboard format in a rich edit control. - // EM_RECONVERSION - The EM_RECONVERSION message invokes the IME reconversion dialog box. - // EM_REDO - Send an EM_REDO message to a rich edit control to redo the next action in the control's redo queue. - // EM_REQUESTRESIZE - The EM_REQUESTRESIZE message forces a rich edit control to send an EN_REQUESTRESIZE notification message to its parent window. - // EM_SELECTIONTYPE - The EM_SELECTIONTYPE message determines the selection type for a rich edit control. - // EM_SETBIDIOPTIONS - The EM_SETBIDIOPTIONS message sets the current state of the bidirectional options in the rich edit control. - // EM_SETBKGNDCOLOR - The EM_SETBKGNDCOLOR message sets the background color for a rich edit control. - // EM_SETCHARFORMAT - The EM_SETCHARFORMAT message sets character formatting in a rich edit control. - // EM_SETCTFMODEBIAS - An application sends an EM_SETCTFMODEBIAS message to set the Text Services Framework (TSF) mode bias for a Rich Edit control. - // EM_SETCTFOPENSTATUS - An application sends an EM_SETCTFOPENSTATUS message to open or close the Text Services Framework (TSF) keyboard. - // EM_SETEDITSTYLE - The EM_SETEDITSTYLE message sets the current edit style flags. - // EM_SETEVENTMASK - The EM_SETEVENTMASK message sets the event mask for a rich edit control. The event mask specifies which notification messages the control sends to its parent window. - // EM_SETFONTSIZE - The EM_SETFONTSIZE message sets the font size for the selected text. - // EM_SETHYPHENATEINFO - An application sends an EM_SETHYPHENATEINFO message to set the way a Rich Edit control does hyphenation. - // EM_SETIMECOLOR - The EM_SETIMECOLOR message sets the IME composition color. This message is available only in Asian-language versions of the operating system. - // EM_SETIMEMODEBIAS - An application sends an EM_SETIMEMODEBIAS message to set the IME mode bias for a Rich Edit control. - // EM_SETIMEOPTIONS - The EM_SETIMEOPTIONS message sets the IME options. This message is available only in Asian-language versions of the operating system. - // EM_SETLANGOPTIONS - An application sends an EM_SETLANGOPTIONS message to set options for IME and Asian language support in a rich edit control. - // EM_SETOLECALLBACK - The EM_SETOLECALLBACK message gives a rich edit control an IRichEditOleCallback object that the control uses to get OLE-related resources and information from the client. - // EM_SETOPTIONS - The EM_SETOPTIONS message sets the options for a rich edit control. - // EM_SETPAGEROTATE - Deprecated. An application sends an EM_SETPAGEROTATE message to set the text layout for a Rich Edit control. - // EM_SETPALETTE - An application sends an EM_SETPALETTE message to change the palette that rich edit uses for its display window. - // EM_SETPARAFORMAT - The EM_SETPARAFORMAT message sets the paragraph formatting for the current selection in a rich edit control. - // EM_SETPUNCTUATION - The EM_SETPUNCTUATION message sets the punctuation characters for a rich edit control. This message is available only in Asian-language versions of the operating system. - // EM_SETSCROLLPOS - An application sends an EM_SETSCROLLPOS message to tell the rich edit control to scroll to a particular point. - // EM_SETTARGETDEVICE - The EM_SETTARGETDEVICE message sets the target device and line width used for "what you see is what you get" (WYSIWYG) formatting in a rich edit control. - // EM_SETTEXTEX - The EM_SETTEXTEX message combines the functionality of WM_SETTEXT and EM_REPLACESEL and adds the ability to set text using a code page and to use either rich text or plain text. - // EM_SETTEXTMODE - An application sends an EM_SETTEXTMODE message to set the text mode or undo level of a rich edit control. The message fails if the control contains any text. - // EM_SETTYPOGRAPHYOPTIONS - The EM_SETTYPOGRAPHYOPTIONS message sets the current state of the typography options of a rich edit control. - // EM_SETUNDOLIMIT - An application sends an EM_SETUNDOLIMIT message to a rich edit control to set the maximum number of actions that can stored in the undo queue. - // EM_SETWORDBREAKPROCEX - The EM_SETWORDBREAKPROCEX message sets the extended word-break procedure. - // EM_SETWORDWRAPMODE - The EM_SETWORDWRAPMODE message sets the word-wrapping and word-breaking options for the rich edit control. This message is available only in Asian-language versions of the operating system. - // EM_SETZOOM - The EM_SETZOOM message sets the zoom ratio anywhere between 1/64 and 64. - // EM_SHOWSCROLLBAR - The EM_SHOWSCROLLBAR message shows or hides one of the scroll bars in the Text Host window. - // EM_STOPGROUPTYPING - An application sends an EM_STOPGROUPTYPING message to a rich edit control to stop the control from collecting additional typing actions into the current undo action. The control stores the next typing action, if any, into a new action in the undo queue. - // EM_STREAMIN - The EM_STREAMIN message replaces the contents of a rich edit control with a stream of data provided by an application defined - // EM_STREAMOUT - The EM_STREAMOUT message causes a rich edit control to pass its contents to an application - #endregion - #endregion - #region Constants - //const int ECOOP_XOR = 0x0004; - - //const int ECO_AUTOWORDSELECTION = 0x00000001; - - - const int WM_USER = 0x0400; - const int GWL_STYLE = -16; - const int WS_HSCROLL = 0x100000; - const int WS_VSCROLL = 0x200000; - - #endregion - #region Enums - public enum Messages : int - { - EM_AUTOURLDETECT = WM_USER + 91, - EM_CANPASTE = WM_USER + 50, - EM_CANREDO = WM_USER + 85, - EM_DISPLAYBAND = WM_USER + 51, - EM_EXGETSEL = WM_USER + 52, - EM_EXLIMITTEXT = WM_USER + 53, - EM_EXLINEFROMCHAR = WM_USER + 54, - EM_EXSETSEL = WM_USER + 55, - EM_FINDTEXT = WM_USER + 56, - EM_FINDTEXTEX = WM_USER + 79, - EM_FINDTEXTEXW = WM_USER + 124, - EM_FINDTEXTW = WM_USER + 123, - EM_FINDWORDBREAK = WM_USER + 76, - EM_FORMATRANGE = WM_USER + 57, - EM_GETAUTOURLDETECT = WM_USER + 92, - EM_GETBIDIOPTIONS = WM_USER + 201, - EM_GETCHARFORMAT = WM_USER + 58, - EM_GETCTFMODEBIAS = WM_USER + 237, - EM_GETCTFOPENSTATUS = WM_USER + 240, - EM_GETEDITSTYLE = WM_USER + 205, - EM_GETEVENTMASK = WM_USER + 59, - EM_GETHYPHENATEINFO = WM_USER + 230, - EM_GETIMECOLOR = WM_USER + 105, - EM_GETIMECOMPMODE = WM_USER + 122, - EM_GETIMECOMPTEXT = WM_USER + 242, - EM_GETIMEMODEBIAS = WM_USER + 127, - EM_GETIMEOPTIONS = WM_USER + 107, - EM_GETIMEPROPERTY = WM_USER + 244, - EM_GETLANGOPTIONS = WM_USER + 121, - EM_GETOLEINTERFACE = WM_USER + 60, - EM_GETOPTIONS = WM_USER + 78, - EM_GETPAGEROTATE = WM_USER + 235, - EM_GETPARAFORMAT = WM_USER + 61, - EM_GETPUNCTUATION = WM_USER + 101, - EM_GETREDONAME = WM_USER + 87, - EM_GETSCROLLPOS = WM_USER + 221, - EM_GETSELTEXT = WM_USER + 62, - EM_GETTEXTEX = WM_USER + 94, - EM_GETTEXTLENGTHEX = WM_USER + 95, - EM_GETTEXTMODE = WM_USER + 90, - EM_GETTEXTRANGE = WM_USER + 75, - EM_GETTYPOGRAPHYOPTIONS = WM_USER + 203, - EM_GETUNDONAME = WM_USER + 86, - EM_GETWORDBREAKPROCEX = WM_USER + 80, - EM_GETWORDWRAPMODE = WM_USER + 103, - EM_GETZOOM = WM_USER + 224, - EM_HIDESELECTION = WM_USER + 63, - EM_ISIME = WM_USER + 243, - EM_PASTESPECIAL = WM_USER + 64, - EM_RECONVERSION = WM_USER + 125, - EM_REDO = WM_USER + 84, - EM_REQUESTRESIZE = WM_USER + 65, - EM_SELECTIONTYPE = WM_USER + 66, - EM_SETBIDIOPTIONS = WM_USER + 200, - EM_SETBKGNDCOLOR = WM_USER + 67, - EM_SETCHARFORMAT = WM_USER + 68, - EM_SETCTFMODEBIAS = WM_USER + 238, - EM_SETCTFOPENSTATUS = WM_USER + 241, - EM_SETEDITSTYLE = WM_USER + 204, - EM_SETEVENTMASK = WM_USER + 69, - EM_SETFONTSIZE = WM_USER + 223, - EM_SETHYPHENATEINFO = WM_USER + 231, - EM_SETIMECOLOR = WM_USER + 104, - EM_SETIMEMODEBIAS = WM_USER + 126, - EM_SETIMEOPTIONS = WM_USER + 106, - EM_SETLANGOPTIONS = WM_USER + 120, - EM_SETOLECALLBACK = WM_USER + 70, - EM_SETOPTIONS = WM_USER + 77, - EM_SETPAGEROTATE = WM_USER + 236, - EM_SETPALETTE = WM_USER + 93, - EM_SETPARAFORMAT = WM_USER + 71, - EM_SETPUNCTUATION = WM_USER + 100, - EM_SETSCROLLPOS = WM_USER + 222, - EM_SETTARGETDEVICE = WM_USER + 72, - EM_SETTEXTEX = WM_USER + 97, - EM_SETTEXTMODE = WM_USER + 89, - EM_SETTYPOGRAPHYOPTIONS = WM_USER + 202, - EM_SETUNDOLIMIT = WM_USER + 82, - EM_SETWORDBREAKPROCEX = WM_USER + 81, - EM_SETWORDWRAPMODE = WM_USER + 102, - EM_SETZOOM = WM_USER + 225, - EM_SHOWSCROLLBAR = WM_USER + 96, - EM_STOPGROUPTYPING = WM_USER + 88, - EM_STREAMIN = WM_USER + 73, - EM_STREAMOUT = WM_USER + 74 - }; - [Flags] - public enum LanguageOptions : int // Options for EM_SETLANGOPTIONS and EM_GETLANGOPTIONS - { - IMF_AUTOKEYBOARD = 0x0001, - IMF_AUTOFONT = 0x0002, - IMF_IMECANCELCOMPLETE = 0x0004, // high completes the comp string when aborting, low cancels. - IMF_IMEALWAYSSENDNOTIFY = 0x0008 - } - public enum TimeCompMode : int // Values for EM_GETIMECOMPMODE - { - ICM_NOTOPEN = 0x0000, - ICM_LEVEL3 = 0x0001, - ICM_LEVEL2 = 0x0002, - ICM_LEVEL2_5 = 0x0003, - ICM_LEVEL2_SUI = 0x0004 - } - [Flags] - public enum EditControlOptions : int // Edit control options - { - ECO_AUTOWORDSELECTION = 0x00000001, - ECO_AUTOVSCROLL = 0x00000040, - ECO_AUTOHSCROLL = 0x00000080, - ECO_NOHIDESEL = 0x00000100, - ECO_READONLY = 0x00000800, - ECO_WANTRETURN = 0x00001000, - ECO_SAVESEL = 0x00008000, - ECO_SELECTIONBAR = 0x01000000, - ECO_VERTICAL = 0x00400000, // FE specific - } - public enum EcoOperations : int // ECO operations - { - ECOOP_SET = 0x0001, - ECOOP_OR = 0x0002, - ECOOP_AND = 0x0003, - ECOOP_XOR = 0x0004 - } - public enum WordBreakFunctionActions : int // new word break function actions - { - WB_CLASSIFY = 3, - WB_MOVEWORDLEFT = 4, - WB_MOVEWORDRIGHT = 5, - WB_LEFTBREAK = 6, - WB_RIGHTBREAK = 7 - } - //#define PC_FOLLOWING 1 - //#define PC_LEADING 2 - //#define PC_OVERFLOW 3 - //#define PC_DELIMITER 4 - //#define WBF_WORDWRAP 0x010 - //#define WBF_WORDBREAK 0x020 - //#define WBF_OVERFLOW 0x040 - //#define WBF_LEVEL1 0x080 - //#define WBF_LEVEL2 0x100 - //#define WBF_CUSTOM 0x200 - /* Word break flags (used with WB_CLASSIFY) */ - //#define WBF_CLASS ((BYTE) 0x0F) - //#define WBF_ISWHITE ((BYTE) 0x10) - //#define WBF_BREAKLINE ((BYTE) 0x20) - //#define WBF_BREAKAFTER ((BYTE) 0x40) - ///* Far East specific flags */ - //#define IMF_FORCENONE 0x0001 - //#define IMF_FORCEENABLE 0x0002 - //#define IMF_FORCEDISABLE 0x0004 - //#define IMF_CLOSESTATUSWINDOW 0x0008 - //#define IMF_VERTICAL 0x0020 - //#define IMF_FORCEACTIVE 0x0040 - //#define IMF_FORCEINACTIVE 0x0080 - //#define IMF_FORCEREMEMBER 0x0100 - //#define IMF_MULTIPLEEDIT 0x0400 - public enum RTBSelection : int - { - SCF_DEFAULT = 0x0000, - SCF_SELECTION = 0x0001, - SCF_WORD = 0x0002, - SCF_ALL = 0x0004, - SCF_USEUIRULES = 0x0008 - } - [Flags] - public enum CharFormatMasks : uint - { - CFM_NONE = 0, - CFM_BOLD = 0x00000001, - CFM_ITALIC = 0x00000002, - CFM_UNDERLINE = 0x00000004, - CFM_STRIKEOUT = 0x00000008, - CFM_PROTECTED = 0x00000010, - CFM_LINK = 0x00000020, // Exchange hyperlink extension - CFM_SIZE = 0x80000000, - CFM_COLOR = 0x40000000, - CFM_FACE = 0x20000000, - CFM_OFFSET = 0x10000000, - CFM_CHARSET = 0x08000000, - CFM_SMALLCAPS = 0x0040, - CFM_ALLCAPS = 0x0080, - CFM_HIDDEN = 0x0100, - CFM_OUTLINE = 0x0200, - CFM_SHADOW = 0x0400, - CFM_EMBOSS = 0x0800, - CFM_IMPRINT = 0x1000, - CFM_DISABLED = 0x2000, - CFM_REVISED = 0x4000, - CFM_BACKCOLOR = 0x04000000, - CFM_LCID = 0x02000000, - CFM_UNDERLINETYPE = 0x00800000, - CFM_WEIGHT = 0x00400000, - CFM_SPACING = 0x00200000, - CFM_KERNING = 0x00100000, - CFM_STYLE = 0x00080000, - CFM_ANIMATION = 0x00040000, - CFM_REVAUTHOR = 0x00008000, - CFM_SUBSCRIPT = 0x00010000, - CFM_SUPERSCRIPT = 0x00020000 - // CFM_SUBorSUPERSCRIPT = 0x00030000 - } - [Flags] - public enum CharFormatEffects : uint - { - CFE_NONE = 0, - CFE_BOLD = 0x0001, - CFE_ITALIC = 0x0002, - CFE_UNDERLINE = 0x0004, - CFE_STRIKEOUT = 0x0008, - CFE_PROTECTED = 0x0010, - CFE_LINK = 0x0020, - CFE_AUTOBACKCOLOR = 0x04000000, // NOTE: this corresponds to CFM_BACKCOLOR, which controls it - CFE_AUTOCOLOR = 0x40000000, // NOTE: this corresponds to CFM_COLOR, which controls it - CFE_SUBSCRIPT = 0x00010000, // Superscript and subscript are - CFE_SUPERSCRIPT = 0x00020000, // mutually exclusive - CFE_SMALLCAPS = 0x0040, - CFE_ALLCAPS = 0x0080, - CFE_HIDDEN = 0x0100, - CFE_OUTLINE = 0x0200, - CFE_SHADOW = 0x0400, - CFE_EMBOSS = 0x0800, - CFE_IMPRINT = 0x1000, - CFE_DISABLED = 0x2000, - CFE_REVISED = 0x4000 - } - public enum CharUnderline : byte - { - CFU_UNDERLINENONE = 0, - CFU_UNDERLINE = 1, - CFU_UNDERLINEWORD = 2, // displayed as ordinary underline - CFU_UNDERLINEDOUBLE = 3, // displayed as ordinary underline - CFU_UNDERLINEDOTTED = 4, - CFU_UNDERLINEDASH = 5, - CFU_UNDERLINEDASHDOT = 6, - CFU_UNDERLINEDASHDOTDOT = 7, - CFU_UNDERLINEWAVE = 8, - CFU_UNDERLINETHICK = 9, - CFU_INVERT = 0xFE // For IME composition fake a selection. - } - [Flags] - public enum ParaFormatMasks : uint - { - PFM_NONE = 0, - PFM_STARTINDENT = 0x00000001, - PFM_RIGHTINDENT = 0x00000002, - PFM_OFFSET = 0x00000004, - PFM_ALIGNMENT = 0x00000008, - PFM_TABSTOPS = 0x00000010, - PFM_NUMBERING = 0x00000020, - PFM_SPACEBEFORE = 0x00000040, - PFM_SPACEAFTER = 0x00000080, - PFM_LINESPACING = 0x00000100, - PFM_RESERVED = 0x00000200, - PFM_STYLE = 0x00000400, - PFM_BORDER = 0x00000800, - PFM_SHADING = 0x00001000, - PFM_NUMBERINGSTYLE = 0x00002000, - PFM_NUMBERINGTAB = 0x00004000, - PFM_NUMBERINGSTART = 0x00008000, - // PFM_DIR = 0x00010000, - PFM_RTLPARA = 0x00010000, - PFM_KEEP = 0x00020000, - PFM_KEEPNEXT = 0x00040000, - PFM_PAGEBREAKBEFORE = 0x00080000, - PFM_NOLINENUMBER = 0x00100000, - PFM_NOWIDOWCONTROL = 0x00200000, - PFM_DONOTHYPHEN = 0x00400000, - PFM_SIDEBYSIDE = 0x00800000, - PFM_TABLEROWDELIMITER = 0x10000000, - PFM_TEXTWRAPPINGBREAK = 0x20000000, - PFM_TABLE = 0x40000000, - PFM_OFFSETINDENT = 0x80000000 - } - public enum ParaFormatEffects : ushort - { - PFE_RTLPARA = 0x0001, - PFE_KEEP = 0x0002, - PFE_KEEPNEXT = 0x0004, - PFE_PAGEBREAKBEFORE = 0x0008, - PFE_NOLINENUMBER = 0x0010, - PFE_NOWIDOWCONTROL = 0x0020, - PFE_DONOTHYPHEN = 0x0040, - PFE_SIDEBYSIDE = 0x0080, - PFE_TABLEROW = 0xc000, /* These 3 options are mutually */ - PFE_TABLECELLEND = 0x8000, /* exclusive and each imply */ - PFE_TABLECELL = 0x4000, /* that para is part of a table*/ - } - public enum ParaAlignment : ushort - { - PFA_LEFT = 1, - PFA_RIGHT = 2, - PFA_CENTER = 3, - PFA_JUSTIFY = 4, - PFA_FULL_INTERWORD = 5 - } - public enum ParaNumbering : ushort - { - PFN_NONE = 0, - PFN_BULLET = 1, - PFN_ARABIC = 2, - PFN_LOWER = 3, - PFN_UPPER = 4, - PFN_LOWERROMAN = 5, - PFN_UPPERROMAN = 6, - PFN_UNI = 7 - } - public enum ParaSpacing : byte - { - PFS_SINGLE = 0, - PFS_ONEANDONEHALF = 1, - PFS_DOUBLE = 2, - PFS_EXACTSINGLEMIN = 3, - PFS_EXACT = 4, - PFS_EXACT20 = 5 - } - [Flags] - public enum E_FontStyle : byte - { - FS_NONE = 0, - FS_BOLD = 0x01, - FS_UNDERLINE = 0x02, - FS_ITALIC = 0x04, - FS_SUPERSCRIPT = 0x08, - FS_SUBSCRIPT = 0x10 - } - #endregion - #region Structures - //struct CharRange - //{ - // public int cpMin; - // public int cpMax; - //} - [StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Auto)] - public struct CharFormat2 - { - public int cbSize; - public uint dwMask; - public uint dwEffects; - public int yHeight; - public int yOffset; - public int crTextColor; - public byte bCharSet; - public byte bPitchAndFamily; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] - public string szFaceName; - public short wWeight; - public short sSpacing; - public int crBackColor; - public int lcid; - public int dwReserved; - public short sStyle; - public short wKerning; - public byte bUnderlineType; - public byte bAnimation; - public byte bRevAuthor; - public byte bReserved1; - } - public class CharFormatTwo - { - public CharFormatTwo(CharFormat2 cf) - { - _CharFormat2 = cf; - } - private CharFormat2 _CharFormat2; - [Browsable(false)] - public CharFormat2 CharFormat2 - { - get { return _CharFormat2; } - } - [Browsable(false)] - public int cbSize - { - get { return _CharFormat2.cbSize; } - set { _CharFormat2.cbSize = value; } - } - [Editor(typeof(FlagEnumUIEditor), typeof(System.Drawing.Design.UITypeEditor))] - public CharFormatMasks dwMask - { - get { return (CharFormatMasks)_CharFormat2.dwMask; } - set { _CharFormat2.dwMask = (uint)value; } - } - [Editor(typeof(FlagEnumUIEditor), typeof(System.Drawing.Design.UITypeEditor))] - public CharFormatEffects dwEffects - { - get { return (CharFormatEffects)_CharFormat2.dwEffects; } - set { _CharFormat2.dwEffects = (uint)value; } - } - public int yHeight - { - get { return _CharFormat2.yHeight; } - set { _CharFormat2.yHeight = value; } - } - public int yOffset - { - get { return _CharFormat2.yOffset; } - set { _CharFormat2.yOffset = value; } - } - private Color Int2Color(int color) - { - return Color.FromArgb(color % 256, (color / 256) % 256, color / (256 * 256)); - } - private int Color2Int(Color color) - { - return color.R + (color.G * 256) + (color.B * 256 * 256); - } - public Color crTextColor - { - get { return Int2Color(_CharFormat2.crTextColor); } - set { _CharFormat2.crTextColor = Color2Int(value); } - } - public byte bCharSet - { - get { return _CharFormat2.bCharSet; } - set { _CharFormat2.bCharSet = value; } - } - public byte bPitchAndFamily - { - get { return _CharFormat2.bPitchAndFamily; } - set { _CharFormat2.bPitchAndFamily = value; } - } - public string szFaceName - { - get { return _CharFormat2.szFaceName; } - set { _CharFormat2.szFaceName = value; } - } - public short wWeight - { - get { return _CharFormat2.wWeight; } - set { _CharFormat2.wWeight = value; } - } - public short sSpacing - { - get { return _CharFormat2.sSpacing; } - set { _CharFormat2.sSpacing = value; } - } - public Color crBackColor - { - get { return Int2Color(_CharFormat2.crBackColor); } - set { _CharFormat2.crBackColor = Color2Int(value); } - } - public int lcid - { - get { return _CharFormat2.lcid; } - set { _CharFormat2.lcid = value; } - } - public int dwReserved - { - get { return _CharFormat2.dwReserved; } - set { _CharFormat2.dwReserved = value; } - } - public short sStyle - { - get { return _CharFormat2.sStyle; } - set { _CharFormat2.sStyle = value; } - } - public short wKerning - { - get { return _CharFormat2.wKerning; } - set { _CharFormat2.wKerning = value; } - } - public CharUnderline bUnderlineType - { - get { return (CharUnderline)_CharFormat2.bUnderlineType; } - set { _CharFormat2.bUnderlineType = (byte)value; } - } - public byte bAnimation - { - get { return _CharFormat2.bAnimation; } - set { _CharFormat2.bAnimation = value; } - } - public byte bRevAuthor - { - get { return _CharFormat2.bRevAuthor; } - set { _CharFormat2.bRevAuthor = value; } - } - public byte bReserved1 - { - get { return _CharFormat2.bReserved1; } - set { _CharFormat2.bReserved1 = value; } - } - } - [StructLayout(LayoutKind.Sequential, Pack = 4)] - public struct ParaFormat2 - { - public int cbSize; - public int dwMask; - public ushort wNumbering; - public short wEffects; - public int dxStartIndent; - public int dxRightIndent; - public int dxOffset; - public short wAlignment; - public short cTabCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - public int[] rgxTabs; - public int dySpaceBefore; - public int dySpaceAfter; - public int dyLineSpacing; - public short sStyle; - public byte bLineSpacingRule; - public byte bOutlineLevel; - public short wShadingWeight; - public short wShadingStyle; - public short wNumberingStart; - public short wNumberingStyle; - public short wNumberingTab; - public short wBorderSpace; - public short wBorderWidth; - public short wBorders; - } - public class ParaFormatTwo - { - private ParaFormat2 _ParaFormat2; - public ParaFormatTwo(ParaFormat2 pf) - { - _ParaFormat2 = pf; - } - public ParaFormat2 ParaFormat2 - { - get { return _ParaFormat2; } - } - public int cbSize - { - get { return _ParaFormat2.cbSize; } - set { _ParaFormat2.cbSize = value; } - } - [Editor(typeof(FlagEnumUIEditor), typeof(System.Drawing.Design.UITypeEditor))] - public ParaFormatMasks dwMask - { - get { return (ParaFormatMasks)_ParaFormat2.dwMask; } - set { _ParaFormat2.dwMask = (int)value; } - } - public ParaNumbering wNumbering - { - get { return (ParaNumbering)_ParaFormat2.wNumbering; } - set { _ParaFormat2.wNumbering = (ushort)value; } - } - public ParaFormatEffects wEffects - { - get { return (ParaFormatEffects)_ParaFormat2.wEffects; } - set { _ParaFormat2.wEffects = (short)value; } - } - public int dxStartIndent - { - get { return _ParaFormat2.dxStartIndent; } - set { _ParaFormat2.dxStartIndent = value; } - } - public int dxRightIndent - { - get { return _ParaFormat2.dxRightIndent; } - set { _ParaFormat2.dxRightIndent = value; } - } - public int dxOffset - { - get { return _ParaFormat2.dxOffset; } - set { _ParaFormat2.dxOffset = value; } - } - public ParaAlignment wAlignment - { - get { return (ParaAlignment)_ParaFormat2.wAlignment; } - set { _ParaFormat2.wAlignment = (short)value; } - } - public short cTabCount - { - get { return _ParaFormat2.cTabCount; } - set { _ParaFormat2.cTabCount = value; } - } - public int[] rgxTabs - { - get { return _ParaFormat2.rgxTabs; } - set { _ParaFormat2.rgxTabs = value; } - } - public int dySpaceBefore - { - get { return _ParaFormat2.dySpaceBefore; } - set { _ParaFormat2.dySpaceBefore = value; } - } - public int dySpaceAfter - { - get { return _ParaFormat2.dySpaceAfter; } - set { _ParaFormat2.dySpaceAfter = value; } - } - public int dyLineSpacing - { - get { return _ParaFormat2.dyLineSpacing; } - set { _ParaFormat2.dyLineSpacing = value; } - } - public short sStyle - { - get { return _ParaFormat2.sStyle; } - set { _ParaFormat2.sStyle = value; } - } - public ParaSpacing bLineSpacingRule - { - get { return (ParaSpacing)_ParaFormat2.bLineSpacingRule; } - set { _ParaFormat2.bLineSpacingRule = (byte)value; } - } - public byte bOutlineLevel - { - get { return _ParaFormat2.bOutlineLevel; } - set { _ParaFormat2.bOutlineLevel = value; } - } - public short wShadingWeight - { - get { return _ParaFormat2.wShadingWeight; } - set { _ParaFormat2.wShadingWeight = value; } - } - public short wShadingStyle - { - get { return _ParaFormat2.wShadingStyle; } - set { _ParaFormat2.wShadingStyle = value; } - } - public short wNumberingStart - { - get { return _ParaFormat2.wNumberingStart; } - set { _ParaFormat2.wNumberingStart = value; } - } - public short wNumberingStyle - { - get { return _ParaFormat2.wNumberingStyle; } - set { _ParaFormat2.wNumberingStyle = value; } - } - public short wNumberingTab - { - get { return _ParaFormat2.wNumberingTab; } - set { _ParaFormat2.wNumberingTab = value; } - } - public short wBorderSpace - { - get { return _ParaFormat2.wBorderSpace; } - set { _ParaFormat2.wBorderSpace = value; } - } - public short wBorderWidth - { - get { return _ParaFormat2.wBorderWidth; } - set { _ParaFormat2.wBorderWidth = value; } - } - public short wBorders - { - get { return _ParaFormat2.wBorders; } - set { _ParaFormat2.wBorders = value; } - } - } - #endregion - #region Static Methods - public static bool HasVertScroll(Control ctl) - { - int dwstyle = GetWindowLong(ctl.Handle, GWL_STYLE); - return (dwstyle & WS_VSCROLL) != 0; - } - public static bool HasHorzScroll(Control ctl) - { - int dwstyle = GetWindowLong(ctl.Handle, GWL_STYLE); - return (dwstyle & WS_HSCROLL) != 0; - } - public static Dictionary myHandles = new Dictionary(); - public static HandleRef getHandleRef(RichTextBox rtb) - { - //if (!myHandles.ContainsKey(rtb.Handle)) - //{ - // myHandles.Add(rtb.Handle, new HandleRef(rtb, rtb.Handle)); - // Console.WriteLine("MyHandles Count = {0}", myHandles.Count); - //} - //return myHandles[rtb.Handle]; - return new HandleRef(rtb, rtb.Handle); - //SafeUnmanagedMemoryHandle sumh = new SafeUnmanagedMemoryHandle(rtb.Handle, true); - //HandleRef href = new HandleRef(rtb, rtb.Handle); - ////SafeUnmanagedMemoryHandle sumh = new SafeUnmanagedMemoryHandle(href.Handle, true); - //return href; - } - public static void SetScrollLocation(RichTextBox richTextBox, Point point) - { - //if (SendMessage(new HandleRef(richTextBox, richTextBox.Handle), Messages.EM_SETSCROLLPOS, 0, ref point) == 0) - if (SendMessage(getHandleRef(richTextBox), Messages.EM_SETSCROLLPOS, 0, ref point) == 0) - throw new Win32Exception(); - } - public static Point GetScrollLocation(RichTextBox richTextBox) - { - Point pt = new Point(); - //if (SendMessage(new HandleRef(richTextBox, richTextBox.Handle), Messages.EM_GETSCROLLPOS, 0, ref pt) == 0) - if (SendMessage(getHandleRef(richTextBox), Messages.EM_GETSCROLLPOS, 0, ref pt) == 0) - throw new Win32Exception(); - return pt; - } - public static void SetBackgroundColor(RichTextBox richTextBox, Color color) - { - int clr = color.R + (color.G * 256) + (color.B * 256 * 256); - //if (SendMessage(new HandleRef(richTextBox, richTextBox.Handle), Messages.EM_SETBKGNDCOLOR, 0, clr) == 0) - if (SendMessage(getHandleRef(richTextBox), Messages.EM_SETBKGNDCOLOR, 0, clr) == 0) - throw new Win32Exception(); - } - public static void SetAuto(RichTextBox richTextBox) - { - //if (SendMessage(new HandleRef(richTextBox, richTextBox.Handle), Messages.EM_SETOPTIONS, (int)EcoOperations.ECOOP_XOR, (int)EditControlOptions.ECO_AUTOWORDSELECTION) == 0) - if (SendMessage(getHandleRef(richTextBox), Messages.EM_SETOPTIONS, (int)EcoOperations.ECOOP_XOR, (int)EditControlOptions.ECO_AUTOWORDSELECTION) == 0) - throw new Win32Exception(); - } - public static ParaFormatTwo GetParaFormat(RichTextBox richTextBox) - { - ParaFormat2 pf = new ParaFormat2(); - pf.cbSize = Marshal.SizeOf(pf); - //if (SendMessage(new HandleRef(richTextBox, richTextBox.Handle), Messages.EM_GETPARAFORMAT, 0, ref pf) == 0) - if (SendMessage(getHandleRef(richTextBox), Messages.EM_GETPARAFORMAT, 0, ref pf) == 0) - throw new Win32Exception(); - return new ParaFormatTwo(pf); - } - public static void SetParaFormat(RichTextBox richTextBox, ParaFormatTwo pft) - { - ParaFormat2 pf2 = pft.ParaFormat2; - //if (SendMessage(new HandleRef(richTextBox, richTextBox.Handle), Messages.EM_SETPARAFORMAT, 0, ref pf2) == 0) - if (SendMessage(getHandleRef(richTextBox), Messages.EM_SETPARAFORMAT, 0, ref pf2) == 0) - { - //if(Marshal.GetLastWin32Error()!=0) - throw new Win32Exception(); - } - } - public static CharFormatTwo GetCharFormat(RichTextBox richTextBox, RTBSelection selection) - { - CharFormat2 cf = new CharFormat2(); - cf.cbSize = Marshal.SizeOf(cf); - //if (SendMessage(new HandleRef(richTextBox, richTextBox.Handle), Messages.EM_GETCHARFORMAT, selection, ref cf) == 0) - if (SendMessage(getHandleRef(richTextBox), Messages.EM_GETCHARFORMAT, selection, ref cf) == 0) - throw new Win32Exception(); - return new CharFormatTwo(cf); - } - public static void SetCharFormat(RichTextBox richTextBox, RTBSelection selection, CharFormatTwo cft) - { - try - { - CharFormat2 cf2 = cft.CharFormat2; - try - { - //HandleRef hr = new HandleRef(richTextBox, richTextBox.Handle); - HandleRef hr = getHandleRef(richTextBox); - } - catch (Exception ex) - { - Console.WriteLine(ex.Message); - } - //if (SendMessage(new HandleRef(richTextBox, richTextBox.Handle), Messages.EM_SETCHARFORMAT, selection, ref cf2) == 0) - if (SendMessage(getHandleRef(richTextBox), Messages.EM_SETCHARFORMAT, selection, ref cf2) == 0) - throw new Win32Exception(); - } - catch (Exception ex) - { - Console.WriteLine("Error on SetCharFormat {0}", ex.Message); - } - - } - public static void SetHighlightColor(RichTextBox richTextBox, RTBSelection selection, Color color) - { - CharFormatTwo cft = GetCharFormat(richTextBox, selection); - cft.crBackColor = color; - cft.dwEffects = 0; - cft.dwMask = 0; - cft.dwMask |= CharFormatMasks.CFM_BACKCOLOR; - SetCharFormat(richTextBox, selection, cft); - } - public static void SetSpaceBefore(RichTextBox richTextBox, int spaceBefore) - { - ParaFormatTwo pft = GetParaFormat(richTextBox); - pft.dwMask = 0; - pft.dwMask |= ParaFormatMasks.PFM_SPACEBEFORE; - // 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.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); - Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(richTextBox.Handle, "SetLineSpacing 1"); - pft.bLineSpacingRule = type; - pft.dwMask = 0; - pft.dwMask |= ParaFormatMasks.PFM_LINESPACING; - 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(); - Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(richTextBox.Handle, "SetLineSpacing 2"); - // 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.dyLineSpacing = Convert.ToInt32(.5 + richTextBox.Font.GetHeight(dpi)) * 1440 / dpi; - Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(richTextBox.Handle, "SetLineSpacing 3"); - SetParaFormat(richTextBox, pft); - Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(richTextBox.Handle, "SetLineSpacing 4"); - } - public static E_FontStyle GetFontStyle(RichTextBox richTextBox) - { - E_FontStyle fs = E_FontStyle.FS_NONE; - CharFormatTwo cft = GetCharFormat(richTextBox, RTBSelection.SCF_SELECTION); - if (((cft.dwMask & CharFormatMasks.CFM_BOLD) == CharFormatMasks.CFM_BOLD) && - ((cft.dwEffects & CharFormatEffects.CFE_BOLD) == CharFormatEffects.CFE_BOLD)) fs |= E_FontStyle.FS_BOLD; - if (((cft.dwMask & CharFormatMasks.CFM_UNDERLINE) == CharFormatMasks.CFM_UNDERLINE) && - ((cft.dwEffects & CharFormatEffects.CFE_UNDERLINE) == CharFormatEffects.CFE_UNDERLINE)) fs |= E_FontStyle.FS_UNDERLINE; - if (((cft.dwMask & CharFormatMasks.CFM_ITALIC) == CharFormatMasks.CFM_ITALIC) && - ((cft.dwEffects & CharFormatEffects.CFE_ITALIC) == CharFormatEffects.CFE_ITALIC)) fs |= E_FontStyle.FS_ITALIC; - if (richTextBox.SelectionCharOffset == -2) fs |= E_FontStyle.FS_SUBSCRIPT; - if (richTextBox.SelectionCharOffset == 2) fs |= E_FontStyle.FS_SUPERSCRIPT; - return fs; - } - public static void SetFontStyle(RichTextBox richTextBox, E_FontStyle fs) - { - CharFormatTwo cft = GetCharFormat(richTextBox, RTBSelection.SCF_SELECTION); - if ((fs & E_FontStyle.FS_BOLD) == E_FontStyle.FS_BOLD) - { - cft.dwEffects |= CharFormatEffects.CFE_BOLD; - cft.dwMask |= CharFormatMasks.CFM_BOLD; - } - if ((fs & E_FontStyle.FS_UNDERLINE) == E_FontStyle.FS_UNDERLINE) - { - cft.dwEffects |= CharFormatEffects.CFE_UNDERLINE; - cft.dwMask |= CharFormatMasks.CFM_UNDERLINE; - } - if ((fs & E_FontStyle.FS_ITALIC) == E_FontStyle.FS_ITALIC) - { - cft.dwEffects |= CharFormatEffects.CFE_ITALIC; - cft.dwMask |= CharFormatMasks.CFM_ITALIC; - } - if ((fs & E_FontStyle.FS_SUBSCRIPT) == E_FontStyle.FS_SUBSCRIPT) - { - richTextBox.SelectionCharOffset = -2; - } - if ((fs & E_FontStyle.FS_SUPERSCRIPT) == E_FontStyle.FS_SUPERSCRIPT) - { - richTextBox.SelectionCharOffset = 2; - } - 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) - { - if (bSet) - richTextBox.SelectionCharOffset = -2; - else - richTextBox.SelectionCharOffset = 0; - } - public static void ToggleSuperscript(bool bSet, RichTextBox richTextBox, RTBSelection selection) - { - if (bSet) - richTextBox.SelectionCharOffset = 2; - else - richTextBox.SelectionCharOffset = 0; - } - public static bool IsBold(RichTextBox richTextBox) - { - CharFormatTwo cft = GetCharFormat(richTextBox, RTBSelection.SCF_SELECTION); - return (((cft.dwMask & CharFormatMasks.CFM_BOLD) == CharFormatMasks.CFM_BOLD) && - ((cft.dwEffects & CharFormatEffects.CFE_BOLD) == CharFormatEffects.CFE_BOLD)); - } - public static void ToggleBold(bool bSet, RichTextBox richTextBox, RTBSelection selection) - { - CharFormatTwo cft = GetCharFormat(richTextBox, selection); - if (bSet) - { - cft.dwEffects = CharFormatEffects.CFE_BOLD; - cft.dwMask = CharFormatMasks.CFM_BOLD; - } - else - { - cft.dwEffects = CharFormatEffects.CFE_NONE; - cft.dwMask = CharFormatMasks.CFM_BOLD; - } - SetCharFormat(richTextBox, selection, cft); - } - public static bool IsUnderline(RichTextBox richTextBox) - { - CharFormatTwo cft = GetCharFormat(richTextBox, RTBSelection.SCF_SELECTION); - return (((cft.dwMask & CharFormatMasks.CFM_UNDERLINE) == CharFormatMasks.CFM_UNDERLINE) && - ((cft.dwEffects & CharFormatEffects.CFE_UNDERLINE) == CharFormatEffects.CFE_UNDERLINE)); - } - public static void ToggleUnderline(bool bSet, RichTextBox richTextBox, RTBSelection selection) - { - CharFormatTwo cft = GetCharFormat(richTextBox, selection); - if (bSet) - { - cft.dwEffects = CharFormatEffects.CFE_UNDERLINE; - cft.dwMask = CharFormatMasks.CFM_UNDERLINE; - } - else - { - cft.dwEffects = CharFormatEffects.CFE_NONE; - cft.dwMask = CharFormatMasks.CFM_UNDERLINE; - } - SetCharFormat(richTextBox, selection, cft); - } - public static bool IsItalic(RichTextBox richTextBox) - { - CharFormatTwo cft = GetCharFormat(richTextBox, RTBSelection.SCF_SELECTION); - return (((cft.dwMask & CharFormatMasks.CFM_ITALIC) == CharFormatMasks.CFM_ITALIC) && - ((cft.dwEffects & CharFormatEffects.CFE_ITALIC) == CharFormatEffects.CFE_ITALIC)); - } - public static void ToggleItalic(bool bSet, RichTextBox richTextBox, RTBSelection selection) - { - CharFormatTwo cft = GetCharFormat(richTextBox, selection); - if (bSet) - { - cft.dwEffects = CharFormatEffects.CFE_ITALIC; - cft.dwMask = CharFormatMasks.CFM_ITALIC; - } - else - { - cft.dwEffects = CharFormatEffects.CFE_NONE; - cft.dwMask = CharFormatMasks.CFM_ITALIC; - } - 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 - } - - - // Demand unmanaged code permission to use this class. - [SecurityPermission(SecurityAction.Demand, UnmanagedCode = true)] - sealed class SafeUnmanagedMemoryHandle : SafeHandleZeroOrMinusOneIsInvalid - { - - // Set ownsHandle to true for the default constructor. - internal SafeUnmanagedMemoryHandle() : base(true) { } - - // Set the handle and set ownsHandle to true. - internal SafeUnmanagedMemoryHandle(IntPtr preexistingHandle, bool ownsHandle) - : base(ownsHandle) - { - SetHandle(preexistingHandle); - } - - // Perform any specific actions to release the - // handle in the ReleaseHandle method. - // Often, you need to use Pinvoke to make - // a call into the Win32 API to release the - // handle. In this case, however, we can use - // the Marshal class to release the unmanaged - // memory. - override protected bool ReleaseHandle() - { - // "handle" is the internal - // value for the IntPtr handle. - - // If the handle was set, - // free it. Return success. - if (handle != IntPtr.Zero) - { - Close(); - - //// Free the handle. - //Marshal.FreeHGlobal(handle); - - //// Set the handle to zero. - //handle = IntPtr.Zero; - - // Return success. - return true; - - } - - // Return false. - return false; - - } - } - -} diff --git a/PROMS/Volian.Controls.Library/RTBItem - Copy.cs b/PROMS/Volian.Controls.Library/RTBItem - Copy.cs deleted file mode 100644 index f3f8cbe4..00000000 --- a/PROMS/Volian.Controls.Library/RTBItem - Copy.cs +++ /dev/null @@ -1,908 +0,0 @@ -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; - -namespace Volian.Controls.Library -{ - #region Enums - public enum ExpandingStatus : int - { - No = 0, - Expanding = 1, - Colapsing = 2, - Hiding = 4, - Showing = 8, - Done = 16 - } - #endregion - public partial class RTBItem : EditItem - { - #region Private Fields - - public Label MyLabel - { get { return lblTab; } } - /// - /// Used to connect the RichTextBox with the menus and toolbars - /// - public override StepRTB MyStepRTB - { - get { return _MyStepRTB; } - } - public override int TableWidth { get { return (int)GetTableWidth(_MyStepRTB.Font, MyItemInfo.MyContent.Text, true); } } - - /// - /// The left edge of the Tab - /// - public override int ItemLeft - { - get { return Left + lblTab.Left; } - set { Left = value - lblTab.Left; } - } - /// - /// The Location of the Tab - /// - public override Point ItemLocation - { - get { return new Point(Location.X + lblTab.Left, Location.Y); } - set { Location = new Point(value.X - lblTab.Left, value.Y); } - } - /// - /// Width of the Tab and RTB - /// - public override int ItemWidth - { - get { return Width - lblTab.Left; } - set - { - Width = CheckOffMargin + RTBMargin + value + lblTab.Left; - } - } - /// - /// Width of the RichTextBox - /// - public override int ContentWidth - { - 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); - } - } - public override int BorderWidth { get { return (_MyStepRTB.Width - _MyStepRTB.ClientRectangle.Width); } } - /// - /// Location of the RichTextBox - /// - public override Point ContentLocation - { - get { return new Point(Location.X + _MyStepRTB.Left, Location.Y); } - set { Location = new Point(value.X - _MyStepRTB.Left, value.Y); } - } - /// - /// Left edge of the RichTextBox - /// - public override int ContentLeft - { - get { return Left + _MyStepRTB.Left; } - } - /// - /// Returns the status of the vlnExpander unless it is in the process of expanding or collapsing - /// If it is colapsing it returns false - /// If it is expanding it returns true - /// - public override bool Expanded - { - get - { - return !Colapsing && (MyExpandingStatus != ExpandingStatus.No || _MyvlnExpander.Expanded); - } - set - { - _MyvlnExpander.Expanded = value; - } - } - - #endregion - #region IEditItem - override public void AdjustTableWidthAndLocation() - { - _MyStepRTB.Font = MyStepData.Font.WindowsFont; - ItemWidth = (int)GetTableWidth(_MyStepRTB.Font, MyItemInfo.MyContent.Text, true); - ItemLocation = new Point(50, _MyParentEditItem.Bottom); - ItemLocation = TableLocation(_MyParentEditItem, MyStepSectionLayoutData, ItemWidth); - } - - override public void SetToolTip(string tip) - { - DevComponents.DotNetBar.SuperTooltipInfo tpi = new DevComponents.DotNetBar.SuperTooltipInfo("", "", tip, null, null, DevComponents.DotNetBar.eTooltipColor.Lemon); - _MyToolTip.MinimumTooltipSize = new Size(0, 24); - _MyToolTip.TooltipDuration = 3; - _MyToolTip.SetSuperTooltip(MyStepRTB, tpi); - } - public override void RefreshContent() - { - MyStepRTB.RefreshDisplay(); - IdentifyMe(false); - SetExpandAndExpander(MyItemInfo); - } - public override void RefreshOrdinal() - { - TabFormat = null; // Reset Tab - } - /// - /// Tab Format used for outputing the Tab - /// - - public override string TabFormat - { - get - { - if (_TabFormat == null) TabFormat = null; // execute 'set' code. - return _TabFormat; - } - set - { - if (MyItemInfo != null) - { - 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; - - lblTab.Text = tabString; - // calculate the width based upon characters per inch considering user's DPI - int cpi = MyItemInfo.IsStep ? (int)MyItemInfo.FormatStepData.TabData.Font.CPI : 12; - - // if the tab ends with a single digit & has a '.' before it, add space for the possibility - // that the number can be two digits, for example... 8.1.9 goes to 8.1.10. We want - // the step windows to line up, so the 8.1.9 has one character more space (lastDigitSingle) - bool lastDigitSingle = Regex.IsMatch(tabString, "^.*[^0-9][0-9] *$"); - lblTab.Width = ((lastDigitSingle ? 1 : 0) + tabString.Length) * MyStepPanel.DPI / cpi; - Invalidate(); - if (MyItemInfo.MyTab.Offset == 0) - { - // 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 - // for hls in background documents - without this, the tab gets overwritten by the rtb. - if (MyItemInfo.FormatStepData == null || MyItemInfo.FormatStepData.TabData.IdentEdit.Contains("{Section Prefix}") || !MyItemInfo.IsHigh || - (MyItemInfo.IsHigh && MyItemInfo.FormatStepData.PageBreakOnStep)) - _MyStepRTB.Left = lblTab.Left + lblTab.Width; - _MyStepRTB.Width = Width - _MyStepRTB.Left - RTBMargin - CheckOffMargin; - } - _TabFormat = value; - } - } - } - - #endregion - #region Properties - private static int _RTBMargin = 3; - /// - /// 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. - /// - public static int RTBMargin - { - get { return _RTBMargin; } - set { _RTBMargin = value; } - } - private int? _CheckOffMargin = null; - /// - /// 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. - /// - public int CheckOffMargin - { - get - { - if (_CheckOffMargin == null) - { - if (MyItemInfo == null) _CheckOffMargin = 0; - else - { - if (!MyItemInfo.IsStep || !MyItemInfo.SectionHasCheckOffs()) _CheckOffMargin = 0; - else - { - Graphics g = CreateGraphics(); - SizeF sz = g.MeasureString("M", MyItemInfo.FormatStepData.Font.WindowsFont); - _CheckOffMargin = (int)sz.Width; - } - } - } - return (int)_CheckOffMargin; - } - set { _CheckOffMargin = value; } - } - #endregion - #region Constructors - public RTBItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand) - { - //// TIMING: DisplayItem.TimeIt("CSLARTB Top"); - InitializeComponent();// TODO: Performance 25% - SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, null, false); - MyStepRTB.TextChanged += new EventHandler(MyStepRTB_TextChanged); - } - public RTBItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, EditItem nextEditItem) - { - //// TIMING: DisplayItem.TimeIt("CSLARTB Top"); - InitializeComponent();// TODO: Performance 25% - SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, nextEditItem, false); - MyStepRTB.TextChanged += new EventHandler(MyStepRTB_TextChanged); - } - public RTBItem(ItemInfo itemInfo, StepPanel myStepPanel, EditItem myParentEditItem, ChildRelation myChildRelation, bool expand, bool addFirstChld) - { - //// 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); - LastMethodsPush("SetupHeader"); - Height = _MyStepRTB.Height + _MyStepRTB.Top + 7; - LastMethodsPop(); - } - void _MyStepRTB_Resize(object sender, EventArgs e) - { - 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(); - lbl.BackColor = System.Drawing.Color.Transparent; - lbl.Location = new System.Drawing.Point(0, 0); - lbl.Name = name; - lbl.Size = new System.Drawing.Size(this.Width, 23); - lbl.Visible = true; - lbl.Font = mTag.MyFont.WindowsFont; - lbl.Text = mTag.CleanText; - lbl.TextAlign = mTag.Justify; - this.Controls.Add(lbl); - } - #endregion - #region EventHandlers - /// - /// When the RichTextBox height changes, change the height of the control to match - /// - /// - /// - 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) - { - LastMethodsPush(string.Format("_StepRTB_HeightChanged {0}", _MyStepRTB.Height)); - this.Height = _MyStepRTB.Height + _MyStepRTB.Top + 7; - LastMethodsPop(); - } - } - /// - /// When a RichTextBox is entered, the selected StepRTB is set - /// - /// - /// - private void _StepRTB_Enter(object sender, EventArgs e) - { - if (MyStepPanel.DisplayItemChanging) return; - //vlnStackTrace.ShowStack("_StepRTB_Enter {0}",this.MyID); - MyStepPanel.SelectedEditItem = this; - } - /// - /// Pass the AttachmentClick event to the StepPanel control. - /// - /// - /// - private void vlnExp_AttachmentClick(object sender, vlnExpanderEventArgs args) - { - if (_MyvlnExpander.AutoTOC) return; - - MyStepPanel.OnAttachmentClicked(sender, new StepPanelAttachmentEventArgs(this)); - } - /// - /// Handle the colape event - /// - /// - /// - private void vlnExp_BeforeColapse(object sender, vlnExpanderEventArgs args) - { - 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 - HideChildren(); - // 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)); - MyStepPanel.ItemMoving++; - Top += (topOffset - topOffsetAfter); - MyStepPanel.ItemMoving--; - LastMethodsPop(); - } - else - AdjustLocation(); - BottomMostEditItem.AdjustLocation(); - Colapsing = false; - Cursor.Current = tmp; - } - /// - /// Handle the expand event - /// - /// - /// - private void vlnExp_BeforeExpand(object sender, vlnExpanderEventArgs args) - { - Cursor tmp = Cursor.Current; - Cursor.Current = Cursors.WaitCursor; - if (!_Loading && MyExpandingStatus == ExpandingStatus.No) - { - if (MyStepPanel.AutoExpand) - Expand((ContentType >= 20000) || MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format); - else - Expand(false); - } - Cursor.Current = tmp; - } - - /// - /// Raises an ItemClick event when the user clicks on the Tab - /// - /// - /// - private void lblTab_MouseDown(object sender, MouseEventArgs e) - { - MyStepPanel.OnItemClick(this, new StepPanelEventArgs(this, e)); - } - /// - /// Handle the LinkGoTO event - /// - /// - /// - private void _MyStepRTB_LinkGoTo(object sender, StepPanelLinkEventArgs args) - { - _MyLog.DebugFormat("_DisplayRTB_LinkGoTo " + args.LinkInfoText); - MyStepPanel.OnLinkClicked(sender, args); - } - void _MyStepRTB_RoInsert(object sender, StepRTBRoEventArgs args) - { - MyStepRTB.UpdateStepRtb(args.LinkText, args.ValText); - } - - /// - /// Raise a OnLinkModifyTran event, when the user chooses to Modify a transition - /// - /// - /// - private void _MyStepRTB_LinkModifyTran(object sender, StepPanelLinkEventArgs args) - { - MyStepPanel.OnLinkModifyTran(sender, args); - } - /// - /// Raise a OnLinkModifyRO event, when the user chooses to modify an RO - /// - /// - /// - private void _MyStepRTB_LinkModifyRO(object sender, StepPanelLinkEventArgs args) - { - MyStepPanel.OnLinkModifyRO(sender, args); - } - 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); - } - //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) - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ClearContextMenu(); - else if (args.MenuGroup == "OpenContextMenu") - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetContextMenu(); - else - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.SetShortCutContextMenu(args.MenuGroup); - } - void _MyStepRTB_AdjustTableWidth(object sender, StepRTBTableWidthEventArgs args) - { - //if ((!_MyItemInfo.IsSection && !_MyItemInfo.IsProcedure) && (_MyItemInfo.IsTable || _MyItemInfo.IsFigure)) - if (MyItemInfo.IsTable || MyItemInfo.IsFigure) - { - if (args.EditMode) - { - // First get ColR - int colR = MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColRTable, MyItemInfo.ColumnMode); - // Second get WidS - int widS = /* _WidthAdjust + borderWidth + */ MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, MyItemInfo.ColumnMode); - //int wNew = MyRTBItem.MyStepPanel.ToDisplay(MyRTBItem.MyStepSectionLayoutData.WidT); - int wNew = 70 + widS + colR * MyItemInfo.ColumnMode; - if (wNew > ItemWidth) - { - ItemWidth = wNew; - ItemLocation = TableLocation(MyParentEditItem, MyStepSectionLayoutData, wNew); - } - } - else - { - int newwidth = (int)GetTableWidth(MyStepRTB.Font, MyStepRTB.Text, false); - if (ItemWidth != newwidth) - { - ItemWidth = newwidth; - ItemLocation = TableLocation(MyParentEditItem, MyStepSectionLayoutData, newwidth); - } - } - } - } - /// - /// Calculate TableWidth based upon the the contents - /// - /// - /// - /// - /// - private float GetTableWidth(Font myFont, string txt, bool addBorder) - { - string[] lines = txt.Split("\n".ToCharArray()); - float max = 0; - using (Graphics g = this.CreateGraphics()) - { - PointF pnt = new PointF(0, 0); - 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. - SizeF siz = g.MeasureString("".PadLeft(lineAdj.Length + (addBorder ? 2 : 0), 'M'), myFont, pnt, StringFormat.GenericTypographic); - float wid = siz.Width; - if (wid > max) - { - max = wid; - } - } - } - float widLimit = (float)MyStepPanel.ToDisplay(MyStepSectionLayoutData.WidSTableEdit, MyItemInfo.ColumnMode); - widLimit += (float)MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColS); - widLimit += (float)MyStepPanel.ToDisplay(MyStepSectionLayoutData.ColRTable, MyItemInfo.ColumnMode); - max += MyStepPanel.MyStepPanelSettings.TableWidthAdjust; - return Math.Min(max, widLimit); - } - bool _MyStepRTB_IsNotCurrentSelection(object sender, System.EventArgs args) - { - return MyStepPanel.SelectedEditItem != this; - } - void _MyStepRTB_OpenAnnotations(object sender, System.EventArgs args) - { - OpenAnnotations(); - } - void _MyStepRTB_InsertPgBrk(object sender, System.EventArgs args) - { - InsertPgBrk(); - } - void _MyStepRTB_EnterKeyPressed(object sender, System.Windows.Forms.KeyEventArgs args) - { - if (!MyItemInfo.IsTablePart) - { - args.Handled = true; - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.ProcessEnterKey(); - } - } - bool _MyStepRTB_CheckClipboard(object sender, System.EventArgs args) - { - return CheckClipboard(); - } - void _MyStepRTB_CopyStep(object sender, System.EventArgs args) - { - CopyStep(); - } - void _MyStepRTB_OpenContextMenu(object sender, StepRTBLocationEventArgs args) - { - MyStepPanel.MyStepTabPanel.MyStepTabRibbon.OpenContextMenu(args.Location); - } - void _MyStepRTB_DoMouseWheel(object sender, System.Windows.Forms.MouseEventArgs args) - { - DoMouseWheel(args); - } - void _MyStepRTB_DoSaveContents(object sender, System.EventArgs args) - { - SaveContents(); - } - #endregion - #region override methods - public override void RefreshTab() - { - TabFormat = null; - SetupHeader(); - } - public override void SetFocus() - { - MyStepRTB.Focus(); - } - public override void SaveContents() - { - MyStepRTB.Visible = false; - while (MyStepRTB.Text.Contains("\\")) - { - int loc = MyStepRTB.Text.IndexOf("\\"); - MyStepRTB.SelectionStart = loc; - MyStepRTB.SelectionLength = 1; - MyStepRTB.SelectedText = ""; - } - SaveText(); - - MyStepRTB.Visible = true; - SaveConfig(); // This may be redundant - } - public void SaveText() - { - if (MyStepRTB.ReadOnly) return; - if (!MyStepRTB.ActiveMode) return; - if (MyStepRTB.MyItemInfo.MyContent.Number != null && !MyStepRTB.IsDirty && MyStepRTB.Text.Contains("(Resolved Transition Text)") == false) return; - 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 (MyStepRTB.MyItemInfo.IsStep && - MyStepRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds - && !this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.EditorialChange) - { - //StepConfig sc = MyStepRTB.MyItemInfo.MyConfig as StepConfig; - if (sc == null) sc = new StepConfig(); - sc.Step_ChangeID = this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.ChgId; - //if (MyStepRTB.MyItemInfo.MyConfig == null) itm.MyContent.Config = sc.ToString(); - } - // 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 (sc != null) - sc.Step_CBOverride = null; // clear the change bar override - MyStepRTB.FindAllLinks(); - MyStepRTB.OrigRTF = MyStepRTB.Rtf; - MyStepRTB.ClearUndo(); - } - } - //public override void SetBackgroundColor() - //{ - // MyStepRTB.SetBackColor(); - //} - public override void IdentifyMe(bool highlight) - { - if (highlight) - MyStepRTB.BackColor = Color.Gray; - else - { - if (MyStepRTB.Focused) // If active Set BackColor to the active color - MyStepRTB.BackColor = MyStepPanel.ActiveColor; - else // Otherwise Set the BackColor to either the InactiveColor or the AnnotationColor - MyStepRTB.BackColor = MyItemInfo.ItemAnnotationCount == 0 ? MyStepPanel.InactiveColor : MyStepPanel.AnnotationColor; - } - } - /// - /// Gets or Sets the ability to expand - /// - public override bool CanExpand - { - get { return _MyvlnExpander.Visible; } - set { _MyvlnExpander.Visible = value; } - } - public override void HandleResize() - { - if (lblHeader != null) lblHeader.Width = this.Width; - } - public override void MatchExpanded() - { - if (!_MyvlnExpander.Expanded) - _MyvlnExpander.ShowExpanded(); - } - /// - /// Sets the focus to this RTBItem and positions the cursor to the begining of the string - /// - public override void ItemSelect() - { - // Was getting an Error that _MyStepRTB was Disposed RHM 20101217 - if (!_MyStepRTB.Disposing && !MyStepRTB.Closed) - { - _MyStepRTB.Focus(); - _MyStepRTB.Select(0, 0); - } - else - { - _MyLog.WarnFormat("Attempt to give Focus to Disposed Object {0}", MyID); - } - // if (CanExpand) AutoExpand(); // Expand the item if you can - ScrollToCenter(); - } - /// - /// Sets the focus to this RTBItem - /// - public override void ItemShow() - { - _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() - { - return; - } - public override string SelectedTextForFind - { - get - { - StepRTB srtb = MyStepRTB; - if (srtb.SelectionLength > 0) - { - if (srtb.IsSelectionLinked(srtb.SelectionStart, srtb.SelectionLength)) - return srtb.SelectedText.Substring(0, srtb.SelectedText.IndexOf("#Link")); - else - return srtb.SelectedText; - } - return null; - } - } - public override bool SpellCheckNext() - { - return 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) - { - SaveContents(); - MyStepRTB.VwMode = vwMode; - MyStepRTB.RefreshDisplay(); - MyStepRTB.SelectionStart = 0; - MyStepRTB.SelectionLength = 0; - } - public override int TabLeft { get { return lblTab.Left; } set { lblTab.Left = value; } } - public override Font TabFont { get { return lblTab.Font; } set { lblTab.Font = value; } } - public override string TabText { get { return lblTab.Text; } } - 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 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); - if (itemInfo.HasHeader) - SetupHeaderFooter(ref lblHeader, "Header", itemInfo.MyHeader); - else - { - // remove header from screen if it exists: - this.Controls.Remove(lblHeader); - lblHeader = null; - } - } - public override void ShowExpanded() - { - _MyvlnExpander.ShowExpanded(); - } - /// - /// Sets the Item and as a result the text for the RichTextBox - /// - public override void SetText() - { - LastMethodsPush("SetText"); - if (MyItemInfo != null) - { - MyStepRTB.MyItemInfo = MyItemInfo; - MyStepRTB.RefreshDisplay(); - IdentifyMe(false); - } - LastMethodsPop(); - } - public override void SetExpandAndExpander(ItemInfo itemInfo) - { - // Don't allow substeps to expand - switch (ContentType / 10000) - { - case 1: // Section can expand - CanExpand = true; - // If a word document set the expander to attachment - _MyvlnExpander.Attachment = !(itemInfo.IsStepSection); - _MyvlnExpander.AutoTOC = itemInfo.IsAutoTOCSection; - //OLD: _MyvlnExpander.Attachment = (itemInfo.MyContent.ContentPartCount == 0); - break; - case 2: // High level steps with children can expand - if(MyStepPanel.AutoExpand) - CanExpand = itemInfo.IsHigh && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format && itemInfo.HasChildren; // TemporaryFormat.IsHigh(item); ; - else - CanExpand = itemInfo.HasChildren; - break; - default://Procedures cannot expand, because they automatically expand - CanExpand = false; - break; - } - } - public override void SaveCurrentAndContents() - { - SaveContents(); - } - #endregion - } -} diff --git a/PROMS/Volian.Controls.Library/RTBItem - Copy.resx b/PROMS/Volian.Controls.Library/RTBItem - Copy.resx deleted file mode 100644 index 93e3f68d..00000000 --- a/PROMS/Volian.Controls.Library/RTBItem - Copy.resx +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - 148, 17 - - - True - - - True - - - True - - \ No newline at end of file diff --git a/PROMS/Volian.Controls.Library/RTBItem.designer - Copy.cs b/PROMS/Volian.Controls.Library/RTBItem.designer - Copy.cs deleted file mode 100644 index fffbff97b235508a4db80c800b79e1dc120c8480..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16162 zcmd5@+fSRx6(8*zRV!_!KJLR;wyua8+(2lv(Xx@kEkT=X5T?l^0_+eLW2o(1Xm|hh zw!hyTj_2a}E@L}tWMO=nIrrO~Gyd;?2Ijt$-)?7E%){T=?u>&fIY(NLvv)d%s#&D0V8)U zP4+FBzuHG(HnH|SzQ4MI{scQ^ty^;l2>-;Y3*hgWE>?8$e}wnvptOfi3-iJ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=!*- zURoH2Lum3GQY8*P(!QS72z?!d8&%Gc4Pf z`50B+Bl9=#!HT9C4(B0lRQf&OV2_%$Ry~YoSapJk##;UiH2wpelCn0a)=H017(Y)D zQAso7>G}-OWKnhJnt4!Ld8Xsp=cz#RVybl3bkY)6q4X-|K=p)m@cJgI1?r+ns#~eH z8&5Bmpiw=?mC5YZ&X5L(ed;~4LyP%M;mnIju6xPJmDFPNHTEY)feHdS= zDt5I?wE*VUPmsqn0 z=`-4TmcCTRB7x;h?|%&`YKKg1wCU7=8I&hQW;lh>p2VUYn^Q}D2CcGYj?ap@xjpn7 zh3-y|{&_KF6UP(ZQHt{Px@#){=~7jldL2dO=hZ_JIu7U=g^c^_pBi` zmate?p!(jztIHaz zuBR{!HIK4gYXPJz&KjI@SKIV-Bo8w|+6SvK=27oDd%XL{nJv4A?9J5Co@>KZm~v@m zkNb8~rB=(h-U@h*_2K1FqgJk`Vd>v#M6ISR?l{%cT8%A_a!&G@V`OUf2K9LlkA98K zx*he@mSM=JvjdxCb>gJVxI2H0B86qJ^Qb%oBtM>1Yo4p?M~!g>W`IiE%O)NXOT*mmEt*I>U41f9mrYW#+gr~nT}AgRlCWL-mlq+B2iO& z`W*9?x{hp_q&XD{ZER>O9JwW+ol;tG)8EptGaBAtV+Akp*x6_1=Z%(G^p~EKq#N)ja@y`(HRN}a{k6x*n#0jGn}ztljFFhmsW(r& z|35ycwoSUvAvNu1%yTTkE9ze-F0`l0HS>O4J$7IuvbOz>IhhM!jL t_J1o~bpwPlIR%I8U->><4x4v57V#?=<%#zQ7*~!U - /// Procedure Item Info - Top ItemInfo - /// - private ItemInfo _MyProcedureItemInfo; - /// - /// This is not correct. There should be a dictionary of Section Layouts - /// - private StepSectionLayoutData _MyStepSectionLayoutData; - /// - /// Lookup Table to convert ItemInfo.ItemID to StepItem - /// - internal Dictionary _LookupStepItems; - public StepItem FindItem(ItemInfo itemInfo) - { - if (itemInfo == null) return null; - if (!_LookupStepItems.ContainsKey(itemInfo.ItemID)) return null; - return _LookupStepItems[itemInfo.ItemID]; - } - /// - /// Currently selected RichTextBox - /// - private StepRTB _SelectedStepRTB = null; - /// - /// Currently selected ItemInfo - /// - internal ItemInfo _SelectedItemInfo; - private int _ItemMoving = 0; - private StepPanelSettings _MyStepPanelSettings; - private int _MaxRNO = -1; // TODO: Need to calculate MaxRNO on a section basis rather than for a panel - private Font _MyFont = null; - private Font _ProcFont = new Font("Arial", 12, FontStyle.Bold); - private Font _SectFont = new Font("Arial", 10, FontStyle.Bold); - private Font _StepFont = new Font("Arial", 10); - private Color _ActiveColor = Color.SkyBlue; -#if (DEBUG) - private Color _InactiveColor = Color.Linen; - private Color _TabColor = Color.Beige; - private Color _PanelColor = Color.LightGray; -#else - private Color _InactiveColor = Color.White; - private Color _TabColor = Color.White; - private Color _PanelColor = Color.White; -#endif - // Whether panel is in view or edit mode. Toggled from steprtb - // or set based on approval/multi-user (these two will be done - // later. - public E_ViewMode PanelViewEditMode = E_ViewMode.Edit; - internal string _LastAdjust=""; - private bool _ShowLines = true; - private Graphics _MyGraphics = null; - private int _DPI = 0; - #endregion - #region Item Events - /// - /// Occurs when the user clicks tab of a StepItem - /// - public event StepPanelEvent ItemClick; - /// - /// Checks to see if the 'ItemClick' event is handled and launches it - /// - /// - /// - internal void OnItemClick(object sender, StepPanelEventArgs args) - { - if (ItemClick != null) ItemClick(sender, args); - } - private bool ItemSelectionChangeShown = false; // This keeps OnItemSelectedChanged from being called twice when an item is selected. - /// - /// Occurs when the selected StepItem changes - /// - public event ItemSelectedChangedEvent ItemSelectedChanged; - /// - /// Checks to see if the 'ItemSelectedChanged' event is handled and launches it - /// - /// - /// - internal void OnItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args) - { - ItemSelectionChangeShown = true;//Remember that you have run already - //vlnStackTrace.ShowStack(string.Format("OnItemSelectedChanged {0}",args.MyItemInfo.ItemID)); - if (ItemSelectedChanged != null) ItemSelectedChanged(sender, args); - } - /// - /// Occurs when the user clicks on the Attachment Expander - /// - public event StepPanelAttachmentEvent AttachmentClicked; - /// - /// Checks to see if the 'AttachmentClicked' event is handled and launches it - /// - /// - /// - internal void OnAttachmentClicked(object sender, StepPanelAttachmentEventArgs args) - { - if (AttachmentClicked != null) AttachmentClicked(sender, args); - else MessageBox.Show(args.MyStepItem.MyItemInfo.MyContent.MyEntry.MyDocument.DocumentTitle, "Unhandled Attachment Click", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - - // Edit/View mode change - public event StepPanelModeChangeEvent ModeChange; - internal void OnModeChange(object sender, StepRTBModeChangeEventArgs args) - { - PanelViewEditMode = args.ViewMode; - ModeChange(sender, args); - } - // various selections from steptabribbon that need to filter up to frmveproms - // such as 'global search', 'bookmarks' - public event StepPanelTabDisplayEvent TabDisplay; - internal void OnTabDisplay(object sender, StepPanelTabDisplayEventArgs args) - { - TabDisplay(sender, args); - } - // close section, if deleting word doc section - public event StepPanelWordSectionCloseEvent WordSectionClose; - internal void OnWordSectionClose(object sender, WordSectionEventArgs args) - { - WordSectionClose(sender, args); - } - // if section deleted, have event to flag in other UI panels - public event StepPanelWordSectionDeletedEvent WordSectionDeleted; - internal void OnWordSectionDeleted(object sender, WordSectionEventArgs args) - { - WordSectionDeleted(sender, args); - } - #endregion - #region Link Events - /// - /// Occurs when the user moves onto or off of a Link - /// - public event StepPanelLinkEvent LinkActiveChanged; - /// - /// Checks to see if the 'LinkActiveChanged' event is handled and launches it - /// - /// - /// - internal void OnLinkActiveChanged(object sender, StepPanelLinkEventArgs args) - { - if (LinkActiveChanged != null) LinkActiveChanged(sender, args); - else MessageBox.Show(args.LinkInfoText, "Unhandled Link Active Changed", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - /// - /// Occurs when the user chooses to Insert a Transition - /// - public event StepPanelLinkEvent LinkInsertTran; - /// - /// Checks to see if the 'LinkInsertTran' event is handled and launches it - /// - /// - /// - internal void OnLinkInsertTran(object sender, StepPanelLinkEventArgs args) - { - if (LinkInsertTran != null) LinkInsertTran(sender, args); - else MessageBox.Show(args.LinkInfoText, "Unhandled Link Insert Tran", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - /// - /// Occurs when the user chooses to Insert an RO - /// - public event StepPanelLinkEvent LinkInsertRO; - /// - /// Checks to see if the 'LinkInsertRO' event is handled and launches it - /// - /// - /// - internal void OnLinkInsertRO(object sender, StepPanelLinkEventArgs args) - { - if (LinkInsertRO != null) LinkInsertRO(sender, args); - else MessageBox.Show(args.LinkInfoText, "Unhandled Link Insert RO", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - /// - /// Occurs when the user clicks a Link - /// - public event StepPanelLinkEvent LinkClicked; - /// - /// Checks to see if the 'LinkClicked' event is handled and launches it - /// - /// - /// - internal void OnLinkClicked(object sender, StepPanelLinkEventArgs args) - { - if (LinkClicked != null) LinkClicked(sender, args); - else MessageBox.Show(args.LinkInfoText, "Unhandled Link Click", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - /// - /// Occurs when the user chooses to modify a Transition - /// - public event StepPanelLinkEvent LinkModifyTran; - /// - /// Checks to see if the 'LinkModifyTran' event is handled and launches it - /// - /// - /// - internal void OnLinkModifyTran(object sender, StepPanelLinkEventArgs args) - { - if (LinkModifyTran != null) LinkModifyTran(sender, args); - else MessageBox.Show(args.LinkInfoText, "Unhandled Link Modify Tran", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - /// - /// Occurs when the user chooses to modify an RO - /// - public event StepPanelLinkEvent LinkModifyRO; - /// - /// Checks to see if the 'LinkModifyRO' event is handled and launches it - /// - /// - /// - internal void OnLinkModifyRO(object sender, StepPanelLinkEventArgs args) - { - if (LinkModifyRO != null) LinkModifyRO(sender, args); - else MessageBox.Show(args.LinkInfoText, "Unhandled Link Modify RO", MessageBoxButtons.OK, MessageBoxIcon.Information); - } - #endregion - #region Constructors - public StepPanel() - { - InitializeComponent(); - this.BackColorChanged += new EventHandler(StepPanel_BackColorChanged); -#if(DEBUG) - this.Paint += new PaintEventHandler(StepPanel_Paint); - this.DoubleClick += new EventHandler(StepPanel_DoubleClick); // Toggles Vertical lines on and off -#else - this.BackColor = Color.White; -#endif - this.AutoScroll = true; - } - public StepPanel(IContainer container) - { - container.Add(this); - InitializeComponent(); - this.BackColorChanged += new EventHandler(StepPanel_BackColorChanged); -#if(DEBUG) - this.Paint += new PaintEventHandler(StepPanel_Paint); // Toggles Vertical lines on and off - this.DoubleClick += new EventHandler(StepPanel_DoubleClick); -#else - this.BackColor = Color.White; -#endif - this.AutoScroll = true; - } - void StepPanel_BackColorChanged(object sender, EventArgs e) - { - // Walk through controls & set colors - InactiveColor = PanelColor = BackColor; - foreach (Control ctrl in Controls) - { - if (ctrl.GetType() == typeof(StepItem)) - { - StepItem rtb = (StepItem)ctrl; - rtb.BackColor = BackColor; - } - } - } - #endregion - #region Private Methods - /// - /// Expands an Item and It's Parents as need to display an item - /// - /// Item to Expand - private void ExpandAsNeeded(ItemInfo myItemInfo) - { - int id = myItemInfo.ItemID; - if (!_LookupStepItems.ContainsKey(id)) // If the item is not currently displayed - ExpandAsNeeded((ItemInfo)myItemInfo.ActiveParent); // Expand it's parent - if (_LookupStepItems.ContainsKey(id)) // Expanding Parent should have added it to _LookupStepItems - { - StepItem itm = _LookupStepItems[id]; - ItemInfo ii = myItemInfo.ActiveParent as ItemInfo; - if (itm.Visible == false && ii != null) - ExpandAsNeeded((ItemInfo)myItemInfo.ActiveParent); - itm.AutoExpand(); // Expand it if it should expand - } - } - #endregion - #region Properties - public StepTabPanel MyStepTabPanel - { get { return Parent as StepTabPanel; } } - /// - /// Procedure Item Info - Top ItemInfo - /// Get and Set - Set stes-up all of the - /// - public ItemInfo MyProcedureItemInfo - { - get { return _MyProcedureItemInfo; } - set - { - //// TIMING: DisplayItem.TimeIt("pMyItem Start"); - _MyProcedureItemInfo = value; - if(value != null) - _MyStepSectionLayoutData = _MyProcedureItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData; - //// TIMING: DisplayItem.TimeIt("pMyItem Layout"); - //this.Layout += new LayoutEventHandler(DisplayPanel_Layout); - //this.Scroll += new ScrollEventHandler(DisplayPanel_Scroll); - //// TIMING: DisplayItem.TimeIt("pMyItem Scroll"); - Controls.Clear(); - _LookupStepItems = new Dictionary(); - //// TIMING: DisplayItem.TimeIt("pMyItem Clear"); - //SuspendLayout(); - StepItem tmpStepItem = new StepItem(_MyProcedureItemInfo, this, null, ChildRelation.None, false); - //ResumeLayout(); - //// TIMING: DisplayItem.TimeIt("pMyItem End"); - } - } - public void Reset() - { - ItemInfo parent = SelectedItemInfo.ActiveParent as ItemInfo; - if (parent != null) ItemInfo.ResetParts(parent.ItemID); // Force data to reload - // The following line actually reloads the procedure item - MyProcedureItemInfo = MyProcedureItemInfo; // see get/set above. - Load Procedure and Sections - // The following line expands the items needed to display SelectedItemInfo - ExpandAsNeeded(SelectedItemInfo); - } - /// - /// Get or Set currently selected RichTextBox (StepRTB) - /// - public StepRTB SelectedStepRTB - { - get { return _SelectedStepRTB; } - set - { - StepRTB lastRTB = _SelectedStepRTB; - if(value != null) - value.BackColor = ActiveColor; // Set the active color - if (_SelectedStepRTB == value) return; // Same - No Change - if (_SelectedStepRTB != null) - { - _SelectedStepRTB.BackColor = InactiveColor; - _SelectedStepRTB.SaveText(); // Save any changes to the text - _SelectedStepRTB.SaveConfig(); // This may be redundant - _SelectedStepRTB.RTBFillIn(false); - _SelectedStepRTB.ViewRTB = true; - } - _SelectedStepRTB = value; - if (value != null) - { - _SelectedStepRTB.ViewRTB = PanelViewEditMode == E_ViewMode.View; - _SelectedStepRTB.RTBFillIn(PanelViewEditMode != E_ViewMode.View); - if (_SelectedItemInfo.ItemID != value.MyItemInfo.ItemID) - SelectedItemInfo = value.MyItemInfo; - } - //vlnStackTrace.ShowStack("_DisplayRTB = {0}", _DisplayRTB.MyItem.ItemID);// Show StackTrace - } - } - /// - /// Gets or Sets the SelectedItemInfo - /// Activates and Expands as necessary - /// - public ItemInfo SelectedItemInfo - { - get { return _SelectedItemInfo; } - set - { - //vlnStackTrace.ShowStack("SelectedItemInfo {0} => {1}",_SelectedItemInfo, value); - _SelectedItemInfo = value; - int id = value.ItemID; - ExpandAsNeeded(value); - // reset the entire step panel if the item isn't found. - if (!_LookupStepItems.ContainsKey(id)) Reset(); - StepItem itm = _LookupStepItems[id]; - ItemSelectionChangeShown = false;//OnItemSelectedChanged has not run yet. - itm.ItemSelect(); - if (!ItemSelectionChangeShown) OnItemSelectedChanged(this, new ItemSelectedChangedEventArgs(itm)); - //vlnStackTrace.ShowStack("_ItemSelected = {0}", _ItemSelected.ItemID);// Show StackTrace - } - } - private bool _DisplayItemChanging = false; - public bool DisplayItemChanging - { - get { return _DisplayItemChanging; } - set { _DisplayItemChanging = value; } - } - /// - /// Returns the SelectedStepItem - /// - public StepItem SelectedStepItem - { - get { return (_SelectedItemInfo != null) ? _LookupStepItems[_SelectedItemInfo.ItemID] : null; } - } - /// - /// Displays the selected StepItem - /// - public void ItemShow() - { - if (_SelectedItemInfo != null) - { - SelectedStepItem.ItemShow(); - OnItemSelectedChanged(this, new ItemSelectedChangedEventArgs(SelectedStepItem)); - } - } - public new void MouseWheel(MouseEventArgs e) - { - base.OnMouseWheel(e); - } - /// - /// Used to track movement other than scrolling - /// 0 - Indicates no other movement - /// > 0 - Indicates that other movement is happening - /// - public int ItemMoving - { - get { return _ItemMoving; } - set { _ItemMoving = value; } - } - /// - /// Lazy loaded StepPanelSettings - /// - public StepPanelSettings MyStepPanelSettings - { - get - { - if (_MyStepPanelSettings == null) _MyStepPanelSettings = new StepPanelSettings(this); - return _MyStepPanelSettings; - } - set { _MyStepPanelSettings = value;} - } - /// - /// Gets or Sets the font for the Panel - /// - public Font MyFont - { - get { return _MyFont; } - set { _ProcFont = _SectFont = _StepFont = _MyFont = value; } - } - /// - /// Gets or sets the font for the Procedure Text - /// - public Font ProcFont - { - get { return _ProcFont; } - set { _ProcFont = value; } - } - /// - /// Gets or sets the font for the Section Text - /// - public Font SectFont - { - get { return _SectFont; } - set { _SectFont = value; } - } - /// - /// Gets or sets the Step Font - /// - public Font StepFont - { - get { return _StepFont; } - set { _StepFont = value; } - } - /// - /// Gets or Sets the Active Color for the Panel - /// - public Color ActiveColor - { - get { return _ActiveColor; } - set { _ActiveColor = value; } - } - /// - /// Gets or sets the InActive Color for the Panel - /// - public Color InactiveColor - { - get { return _InactiveColor; } - set { _InactiveColor = value; } - } - /// - /// Gets or sets the Tab Color - /// - public Color TabColor - { - get { return _TabColor; } - set { _TabColor = value; } - } - /// - /// Gets or sets the Panel Color - /// - public Color PanelColor - { - get { return _PanelColor; } - set { _PanelColor = value; - BackColor = value; - } - } - #endregion - #region DisplayConversions - /// - /// gets a Graphic object for the panel - /// - public Graphics MyGraphics - { - get - { - if (_MyGraphics == null) - _MyGraphics = CreateGraphics(); - return _MyGraphics; - } - } - /// - /// Gets the DPI setting for the current graphics setting - /// - internal int DPI - { - get - { - if (_DPI == 0) - _DPI = Convert.ToInt32(MyGraphics.DpiX); - return _DPI; - } - } - /// - /// Converts an integer value from Twips to Pixels - /// - /// - /// - public int ToDisplay(int value) - { - //return (DPI * value) / 864; - return (DPI * value) / 72; - } - /// - /// Converts an integer? value from Twips to Pixels - /// - /// - /// - public int ToDisplay(int? value) - { - return ToDisplay((int)value); - } - /// - /// Converts an string value from Twips to Pixels - /// - /// - /// - public int ToDisplay(string value) - { - return ToDisplay(Convert.ToInt32(value)); - } - /// - /// Converts a value from a list in a string from Twips to Pixels - /// - /// - /// - public int ToDisplay(string value,int i) - { - string s = value.Split(",".ToCharArray())[i]; - return ToDisplay(s); - } - #endregion - #region Debug Methods - /// - /// Gets or sets ShowLines so that vertical lines are shown for debugging purposes - /// - public bool ShowLines - { - get { return _ShowLines; } - set { _ShowLines = value; } - } - /// - /// Draw a vertical line - /// - /// - /// - private void VerticalLine(Graphics g, int x) - { - Pen bluePen = new Pen(Color.CornflowerBlue,1); - g.DrawLine(bluePen, x, 0, x, this.Height); - } - /// - /// Toggle the vertical lines on and off - /// - /// - /// - private void StepPanel_DoubleClick(object sender, EventArgs e) - { - ShowLines = !ShowLines; - Refresh(); - } - private void StepPanel_Paint(object sender, PaintEventArgs e) - { - if (ShowLines) - { - //int fifth = Height / 5; - //Rectangle r1 = new Rectangle(0, 0, Width, Height - fifth); - ////Brush b = new System.Drawing.Drawing2D.LinearGradientBrush(r1, Color.FromArgb(128, 0, 32), Color.FromArgb(96, 0, 16), 90); - //Brush b = new System.Drawing.Drawing2D.LinearGradientBrush(r1, Color.FromArgb(255,128, 0, 32), Color.FromArgb(255,96, 0, 16),System.Drawing.Drawing2D.LinearGradientMode.Vertical); - //e.Graphics.FillRectangle(b, r1); - //r1 = new Rectangle(0, Height - fifth, Width, fifth); - //b = new System.Drawing.Drawing2D.LinearGradientBrush(r1, Color.FromArgb(255,96, 0, 16), Color.FromArgb(255,128, 0, 32), 90); - //e.Graphics.FillRectangle(b, r1); - //VerticalLine(e.Graphics, 60); - //VerticalLine(e.Graphics, 102); - //VerticalLine(e.Graphics, 415); - } - } - /// - /// Output all of the StepItem controls to the log - /// - private void ListControls() - { - // Walk through the controls and find the next control for each - if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("'Item','Next'"); - foreach (Control control in Controls) - if (control.GetType() == typeof(StepItem)) - { - StepItem rtb = (StepItem)control; - StepItem nxt = rtb.NextDownStepItem; - if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0},{1}", rtb.MyID, nxt == null ? 0 : nxt.MyID); - } - } - #endregion - #region Cursor Movement Methods - /// - /// Finds the Displayed 'top' child for a given item. Used for down arrow. - /// - /// ItemInfo - /// - private ItemInfo TopPart(ItemInfo ii) - { - ExpandAsNeeded(ii); - if (ii.Cautions != null) return TopPart(ii.Cautions[0]); - if (ii.Notes != null) return TopPart(ii.Notes[0]); - return (ii); - } - /// - /// Finds the Displayed 'bottom' child for a given item. Used for up arrow. - /// - /// ItemInfo - /// - private ItemInfo BottomPart(ItemInfo ii) - { - ExpandAsNeeded(ii); - if (ii.RNOs != null && ii.RNOLevel >= ii.ColumnMode) return BottomPart(ii.RNOs[0]); - if (ii.Sections != null) return BottomPart(ii.Sections[0].LastSibling); - if (ii.Steps != null) return BottomPart(ii.Steps[0].LastSibling); - if (ii.Tables != null) return BottomPart(ii.Tables[0].LastSibling); - return ii; - } - /// - /// Supports cursor movement between richtext boxes, including arrow keys/page up,down/ - /// ctrl Home,End - /// - /// StepRTB - /// Point - /// E_ArrowKeys - public void CursorMovement(StepRTB rtb, Point position, E_ArrowKeys arrow) - { - ItemInfo ii = null; - switch (arrow) - { - case E_ArrowKeys.Up: - case E_ArrowKeys.CtrlUp: - ii = ArrowUp(rtb.MyItemInfo); - if (ii != null) SelectedStepRTB = _LookupStepItems[ii.ItemID].MyStepRTB; - break; - case E_ArrowKeys.Down: - case E_ArrowKeys.CtrlDown: - ii = ArrowDown(rtb.MyItemInfo); - if (ii != null) SelectedStepRTB = _LookupStepItems[ii.ItemID].MyStepRTB; - break; - case E_ArrowKeys.Right: - case E_ArrowKeys.CtrlRight: - if (rtb.MyItemInfo.RNOs != null) - SelectedStepRTB = _LookupStepItems[rtb.MyItemInfo.RNOs[0].ItemID].MyStepRTB; - break; - case E_ArrowKeys.Left: - case E_ArrowKeys.CtrlLeft: - if (!rtb.MyItemInfo.IsProcedure) - SelectedStepRTB = _LookupStepItems[rtb.MyItemInfo.MyParent.ItemID].MyStepRTB; - break; - default: - break; - } - } - private ItemInfo ArrowUp(ItemInfo ii) - { - // if on RNO, check display mode (1 column/2 column, etc) and how deep RNO is before going to - // parents substeps. - if (ii.IsRNO && ii.MyParent.Steps != null && ii.RNOLevel >= ii.ColumnMode) return BottomPart(ii.MyParent.Steps[0].LastSibling); - - // If on top note and parent has cautions - go to bottom caution - if (ii.IsNoteStructure && ii.MyParent != null && ii.MyParent.Cautions != null) return BottomPart(ii.MyParent.Cautions[0].LastSibling); - if (ii.IsCautionStructure || ii.IsNoteStructure) - { - if (ii.MyParent.MyPrevious != null) return BottomPart(ii.MyParent.MyPrevious); - return ii.MyParent.MyParent; - } - - // If has note, BottomPart of last sibling of the note - if (ii.Notes != null) return BottomPart(ii.Notes[0].LastSibling); - // If has caution, BottomPart of last sibling of the caution - if (ii.Cautions != null) return BottomPart(ii.Cautions[0].LastSibling); - // If previous sibling, BottomPart of previous sibling - if (ii.MyPrevious != null && ii.IsProcedure == false) return BottomPart(ii.MyPrevious); - // Go to parent until at procedure - if (!ii.IsProcedure) return (ii.MyParent); - return null; - } - private ItemInfo ArrowDown(ItemInfo ii) - { - return ArrowDown(ii, true, true); - } - private ItemInfo ArrowDown(ItemInfo ii, bool lookAtSub, bool lookAtRNO) - { - if (ii.IsSection || ii.IsProcedure) - { - if (lookAtSub && ii.Sections != null) return TopPart(ii.Sections[0]); - if (lookAtSub && ii.Steps != null) return TopPart(ii.Steps[0]); - if (ii.IsSection && ii.NextItems != null) return TopPart(ii.NextItems[0]); - } - else - { - // Subitems - go to top part of subitem - // (the lookAtSub prevented looping within a substep group at same level) - if (lookAtSub && ii.Steps != null) return TopPart(ii.Steps[0]); - if (lookAtSub && ii.Tables != null) return TopPart(ii.Tables[0]); - // RNOs: Use PMode (column) - if (lookAtRNO && ii.RNOs != null && ii.RNOLevel >= ii.ColumnMode) return TopPart(ii.RNOs[0]); - // Nextsibling - go to top part of sibling - // TODO: RHM - NextItems was not null when it should have been after delete of a note below a caution - if (ii.NextItems != null && ii.NextItemCount > 0) return TopPart(ii.NextItems[0]); - // If on caution, if parent has note - go to note - if (ii.IsCautionStructureFirstSib && ii.MyParent.Notes != null) return ii.MyParent.Notes[0]; - // If on caution, if parent !has note or if on note go to parent - if ((ii.IsCautionStructureFirstSib && ii.MyParent.Notes == null) || ii.IsNoteStructureFirstSib) return ii.MyParent; - // Recursively call with parent until at procedure - if (!ii.IsProcedure) return (ArrowDown(ii.MyParent, false, ii.MyParent.RNOLevel==ii.RNOLevel)); - } - return null; - } - internal void StepCursorKeys(StepRTB rtb, KeyEventArgs keyargs) - { - ItemInfo ii = rtb.MyItemInfo; - if (ii.IsSection || ii.IsProcedure) return; - while (!ii.IsHigh) - { - ii = ii.MyParent; - } - switch (keyargs.KeyCode) - { - // for home/end, control key must be pressed too, but this is checked - // before here. - case Keys.Home: - ii = ii.FirstSibling; - break; - case Keys.End: - ii = ii.LastSibling; - break; - case Keys.PageDown: - ii = ii.NextItems == null ? null : ii.NextItems[0]; - break; - case Keys.PageUp: - ii = ii.MyPrevious; - break; - } - if (ii == null) return; - SelectedStepRTB = _LookupStepItems[ii.ItemID].MyStepRTB; - } - #endregion - } - [TypeConverter(typeof(ExpandableObjectConverter))] - public partial class StepPanelSettings - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - public StepPanelSettings(StepPanel panel) - { - _MyStepPanel = panel; - } - public StepPanelSettings() - { - } - private StepPanel _MyStepPanel; - [Browsable(false)] - public StepPanel MyStepPanel - { - get { return _MyStepPanel; } - set { _MyStepPanel = value; } - } - private float _CircleXOffset = -4; - [Category("Circle")] - [DisplayName("Circle Horizontal Offset")] - public float CircleXOffset - { - get { return _CircleXOffset; } - set { _CircleXOffset = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - private float _CircleYOffset = -13; - [Category("Circle")] - [DisplayName("Circle Vertical Offset")] - public float CircleYOffset - { - get { return _CircleYOffset; } - set { _CircleYOffset = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - private Font _CircleFont = new Font("Arial Unicode MS", 23); - [Category("Circle")] - [DisplayName("Circle Font")] - public Font CircleFont - { - get { return _CircleFont; } - set { _CircleFont = value; if(_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - private Color _CircleColor = Color.Black; - [Category("Circle")] - [DisplayName("Circle Color")] - public Color CircleColor - { - get { return _CircleColor; } - set { _CircleColor = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - private int _CircleDiameter = 25; - [Category("Circle")] - [DisplayName("Circle Diameter")] - public int CircleDiameter - { - get { return _CircleDiameter; } - set { _CircleDiameter = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - private int _CircleWeight = 2; - [Category("Circle")] - [DisplayName("Circle Pen Weight")] - public int CircleWeight - { - get { return _CircleWeight; } - set { _CircleWeight = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - private float _NumberLocationX = 20F; - [Category("Number")] - [DisplayName("Number Location X")] - public float NumberLocationX - { - get { return _NumberLocationX; } - set { _NumberLocationX = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - private float _NumberLocationY = 4; - [Category("Number")] - [DisplayName("Number Location Y")] - public float NumberLocationY - { - get { return _NumberLocationY; } - set { _NumberLocationY = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - private SizeF _NumberSize = new SizeF(200F, 23F); - [Category("Number")] - [DisplayName("Number Size")] - public SizeF NumberSize - { - get { return _NumberSize; } - set { _NumberSize = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - private int _TableWidthAdjust = 4; - [Category("Table")] - [DisplayName("Table Width Adjust")] - public int TableWidthAdjust - { - get { return _TableWidthAdjust; } - set { _TableWidthAdjust = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - private int _CheckOffWeight = 1; - [Category("CheckOff")] - [DisplayName("CheckOff Pen Weight")] - public int CheckOffWeight - { - get { return _CheckOffWeight; } - set { _CheckOffWeight = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - private Color _CheckOffColor = Color.Black; - [Category("CheckOff")] - [DisplayName("CheckOff Color")] - public Color CheckOffColor - { - get { return _CheckOffColor; } - set { _CheckOffColor = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - private int _CheckOffSize =12; - [Category("CheckOff")] - [DisplayName("CheckOff Size")] - public int CheckOffSize - { - get { return _CheckOffSize; } - set { _CheckOffSize = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - private int _CheckOffX =0; - [Category("CheckOff")] - [DisplayName("CheckOff X")] - public int CheckOffX - { - get { return _CheckOffX; } - set { _CheckOffX = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - private int _CheckOffY =5; - [Category("CheckOff")] - [DisplayName("CheckOff Y")] - public int CheckOffY - { - get { return _CheckOffY; } - set { _CheckOffY = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - - private int _ChangeBarWeight = 1; - [Category("ChangeBar")] - [DisplayName("ChangeBar Pen Weight")] - public int ChangeBarWeight - { - get { return _ChangeBarWeight; } - set { _ChangeBarWeight = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - private Color _ChangeBarColor = Color.Black; - [Category("ChangeBar")] - [DisplayName("ChangeBar Color")] - public Color ChangeBarColor - { - get { return _ChangeBarColor; } - set { _ChangeBarColor = value; if (_MyStepPanel != null) _MyStepPanel.Refresh(); } - } - } - public partial class StepPanelEventArgs - { - private StepItem _MyStepItem; - public StepItem MyStepItem - { - get { return _MyStepItem; } - set { _MyStepItem = value; } - } - private MouseEventArgs _MyMouseEventArgs; - public MouseEventArgs MyMouseEventArgs - { - get { return _MyMouseEventArgs; } - set { _MyMouseEventArgs = value; } - } - - public StepPanelEventArgs(StepItem myStepItem, MouseEventArgs myMouseEventArgs) - { - _MyStepItem = myStepItem; - _MyMouseEventArgs = myMouseEventArgs; - } - } - public partial class ItemSelectedChangedEventArgs - { - private ItemInfo _MyItemInfo; - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - set { _MyItemInfo = value; } - } - private StepItem _MyStepItem = null; - public StepItem MyStepItem - { - get { return _MyStepItem; } - set { _MyStepItem = value; } - } - public ItemSelectedChangedEventArgs(ItemInfo myItemInfo) - { - _MyItemInfo = myItemInfo; - } - public ItemSelectedChangedEventArgs(StepItem myStepItem) - { - _MyItemInfo = myStepItem.MyItemInfo; - _MyStepItem = myStepItem; - } - } - public partial class StepPanelAttachmentEventArgs - { - private StepItem _MyStepItem; - public StepItem MyStepItem - { - get { return _MyStepItem; } - set { _MyStepItem = value; } - } - public StepPanelAttachmentEventArgs(StepItem myStepItem) - { - _MyStepItem = myStepItem; - } - } - - public partial class StepPanelLinkEventArgs : EventArgs - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private StepItem _LinkedStepItem; - public StepItem LinkedStepItem - { - get { return _LinkedStepItem; } - //set { _LinkedStepItem = value; } - } - private string _LinkInfoText; - public string LinkInfoText - { - get { return _LinkInfoText; } - } - private LinkText _MyLinkText; - public LinkText MyLinkText - { - get { return _MyLinkText;} - } - public StepPanelLinkEventArgs(StepItem linkedStepItem, string linkInfoText) - { - _LinkedStepItem = linkedStepItem; - _LinkInfoText = linkInfoText; - _MyLinkText = new LinkText(_LinkInfoText); - //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("\r\n LinkInfo '{0}'\r\n", linkInfo.LinkText); - } - } - public partial class StepPanelTabDisplayEventArgs : EventArgs - { - private string _PanelTabName; - public string PanelTabName - { - get { return _PanelTabName; } - } - public StepPanelTabDisplayEventArgs(string panelTabname) - { - _PanelTabName = panelTabname; - } - } - public partial class WordSectionEventArgs : EventArgs - { - private SectionInfo _MySectionInfo; - public SectionInfo MySectionInfo - { - get { return _MySectionInfo; } - } - public WordSectionEventArgs(SectionInfo mySectionInfo) - { - _MySectionInfo = mySectionInfo; - } - } - public delegate void StepPanelEvent(object sender, StepPanelEventArgs args); - public delegate void ItemSelectedChangedEvent(object sender, ItemSelectedChangedEventArgs args); - public delegate void StepPanelLinkEvent(object sender, StepPanelLinkEventArgs args); - public delegate void StepPanelAttachmentEvent(object sender, StepPanelAttachmentEventArgs args); - public delegate void StepRTBLinkEvent(object sender, StepPanelLinkEventArgs args); - public delegate void StepPanelModeChangeEvent(object sender, StepRTBModeChangeEventArgs args); - public delegate void StepPanelTabDisplayEvent(object sender, StepPanelTabDisplayEventArgs args); - public delegate void StepPanelWordSectionCloseEvent(object sender, WordSectionEventArgs args); - public delegate void StepPanelWordSectionDeletedEvent(object sender, WordSectionEventArgs args); -} diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs.bak b/PROMS/Volian.Controls.Library/StepRTB.cs.bak deleted file mode 100644 index 3894a208..00000000 --- a/PROMS/Volian.Controls.Library/StepRTB.cs.bak +++ /dev/null @@ -1,3238 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.IO; -using System.Drawing; -using System.Data; -using System.Text; -using System.Windows.Forms; -using System.Runtime.InteropServices; -using System.Text.RegularExpressions; -using VEPROMS.CSLA.Library; -using Volian.Base.Library; - -namespace Volian.Controls.Library -{ - public delegate void StepRTBEvent(object sender, EventArgs args); - public delegate void StepRTBCursorKeysEvent(object sender, KeyEventArgs args); - public delegate void StepRTBCursorMovementEvent(object sender, StepRTBCursorMovementEventArgs args); - public delegate void StepRTBModeChangeEvent(object sender, StepRTBModeChangeEventArgs args); - public delegate void StepRTBMenuEvent(object sender, StepRTBMenuEventArgs args); - public delegate void StepRTBTableWidthEvent(object sender, StepRTBTableWidthEventArgs args); - public delegate bool StepRTBBooleanEvent(object sender, EventArgs args); - public delegate void StepRTBLocationEvent(object sender, StepRTBLocationEventArgs args); - public delegate void StepRTBMouseEvent(object sender, MouseEventArgs args); - public delegate void StepRTBRoEvent(object sender, StepRTBRoEventArgs args); - //public delegate void StepRTBMouseWheelEvent(object sender, MouseEventArgs args); - public partial class StepRTB : RichTextBox // , IStepRTB - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - - #region Events - public event StepRTBRoEvent RoInsert; - public void OnRoInsert(object sender, StepRTBRoEventArgs args) - { - if (RoInsert != null) RoInsert(sender, args); - } - public event StepRTBEvent ReturnToEditor; - public void OnReturnToEditor(object sender, EventArgs args) - { - if (ReturnToEditor != null) ReturnToEditor(sender, args); - } - public event StepRTBEvent EditModeChanged; - public void OnEditModeChanged(object sender, EventArgs args) - { - if (EditModeChanged != null) EditModeChanged(sender, args); - } - public event StepRTBEvent DoSaveContents; - public void OnDoSaveContents(object sender, EventArgs args) - { - if (DoSaveContents != null) DoSaveContents(sender, args); - } - public event StepRTBMouseEvent DoMouseWheel; - public void OnDoMouseWheel(object sender, MouseEventArgs args) - { - if (DoMouseWheel != null) DoMouseWheel(sender, args); - } - public event StepRTBLocationEvent OpenContextMenu; - public void OnOpenContextMenu(object sender, StepRTBLocationEventArgs args) - { - if (OpenContextMenu != null) OpenContextMenu(sender, args); - } - public event StepRTBEvent CopyStep; - public void OnCopyStep(object sender, EventArgs args) - { - if (CopyStep != null) CopyStep(sender, args); - } - public event StepRTBBooleanEvent CheckClipboard; - public bool OnCheckClipboard(object sender, EventArgs args) - { - if (CheckClipboard != null) return CheckClipboard(sender, args); - return false; - } - public event StepRTBCursorKeysEvent EnterKeyPressed; - public void OnEnterKeyPressed(object sender, KeyEventArgs args) - { - if (EnterKeyPressed != null) EnterKeyPressed(sender, args); - } - public event StepRTBEvent InsertPgBrk; - public void OnInsertPgBrk(object sender, EventArgs args) - { - if (InsertPgBrk != null) InsertPgBrk(sender, args); - } - public event StepRTBEvent OpenAnnotations; - public void OnOpenAnnotations(object sender, EventArgs args) - { - if (OpenAnnotations != null) OpenAnnotations(sender, args); - } - public event StepRTBBooleanEvent IsNotCurrentSelection; - public bool OnIsNotCurrentSelection(object sender, EventArgs args) - { - if (IsNotCurrentSelection != null) return IsNotCurrentSelection(sender, args); - return false; - } - public event StepRTBTableWidthEvent AdjustTableWidth; - public void OnAdjustTableWidth(object sender, StepRTBTableWidthEventArgs args) - { - if (AdjustTableWidth != null) AdjustTableWidth(sender, args); - } - public event StepRTBMenuEvent SetMenu; - private void OnSetMenu(object sender, StepRTBMenuEventArgs args) - { - if (SetMenu != null) SetMenu(sender, args); - } - public event StepRTBEvent RTBSelectionChanged; - private void OnRTBSelectionChanged(object sender, EventArgs args) - { - if (RTBSelectionChanged != null) RTBSelectionChanged(sender, args); - } - public event StepRTBEvent LinkLocationsChanged; - private void OnLinkLocationChanged(object sender, EventArgs args) - { - if (LinkLocationsChanged != null) LinkLocationsChanged(sender, args); - } - public event StepRTBEvent RTBRangeStatusChanged; - private void OnRTBRangeStatusChanged(object sender, EventArgs args) - { - if (RTBRangeStatusChanged != null) RTBRangeStatusChanged(sender, args); - } - public event StepRTBCursorKeysEvent CursorKeyPress; - private void OnCursorKeyPress(object sender, KeyEventArgs args) - { - if (CursorKeyPress != null) CursorKeyPress(sender, args); - } - public event StepRTBCursorMovementEvent CursorMovement; - private void OnCursorMovement(object sender, StepRTBCursorMovementEventArgs args) - { - if (CursorMovement != null) CursorMovement(sender, args); - } - //public event StepRTBModeChangeEvent ModeChange; - //private void OnModeChange(object sender, StepRTBModeChangeEventArgs args) - //{ - // //_MyModeChangeEventArgs = args; - // if (ModeChange != null) ModeChange(sender, args); - // else MessageBox.Show("StepRTB - no mode change defined"); - //} - //public event StepRTBMouseWheelEvent MouseWheel; - //private void OnMouseWheel(object sender, MouseEventArgs args) - //{ - // if (MouseWheel != null) MouseWheel(sender, args); - //} - - /// - /// This event is not raised during all the in-between changes for link deletions - /// - public event StepRTBEvent RTBTextChanged; - private void OnRTBTextChanged(object sender, EventArgs args) - { - if (RTBTextChanged != null) RTBTextChanged(sender, args); - } - #endregion - #region Properties and Variables - - public bool IsRoTable - { - get { return (Parent is VlnFlexGrid && (Parent as VlnFlexGrid).IsRoTable); } - } - public bool HasVScroll - { - get - { - return RTBAPI.HasVertScroll(this); - } - - } - public bool HasHScroll - { - get - { - return RTBAPI.HasHorzScroll(this); - } - - } - private bool _EditMode = true; - /// - /// Allows insert of links. If false, don't allow selection of links. - /// - public bool EditMode - { - get { return _EditMode; } - set - { - _EditMode = value; - OnEditModeChanged(this, new EventArgs()); - } - } - private static string _MySymbolFontName; - public static string MySymbolFontName - { - get { return StepRTB._MySymbolFontName; } - set { StepRTB._MySymbolFontName = value; } - } - private static FontFamily _MyFontFamily = null; - public static FontFamily MyFontFamily - { - get { return StepRTB._MyFontFamily; } - set - { - _MyFontFamily = value; - if (value != null) - { - Font font; - if (value.IsStyleAvailable(FontStyle.Regular)) - font = new Font(value, 10); - else if (value.IsStyleAvailable(FontStyle.Bold)) - font = new Font(value, 10, FontStyle.Bold); - else // (value.IsStyleAvailable(FontStyle.Italic)) - font = new Font(value, 10, FontStyle.Italic); - using (StepRTB srtb = new StepRTB()) - { - if (srtb.FontIsFixed(font)) _MySymbolFontName = "VESymbFix"; - else _MySymbolFontName = "Arial Unicode MS"; - } - } - } - } - // use newer rich text box.... - //[DllImport("kernel32.dll", CharSet = CharSet.Auto)] - //static extern IntPtr LoadLibrary(string lpFileName); - //protected override CreateParams CreateParams - //{ - // get - // { - // CreateParams prams = base.CreateParams; - // if (LoadLibrary("msftedit.dll") != IntPtr.Zero) - // { - // //prams.ExStyle |= 0x020; // transparent - - // prams.ClassName = "RICHEDIT50W"; - // } - // return prams; - // } - //} - private E_FieldToEdit _FieldToEdit = E_FieldToEdit.StepText; - public E_FieldToEdit FieldToEdit - { - get { return _FieldToEdit; } - set { _FieldToEdit = value; } - } - private string _RtfPrefix; // contains Font table and styles (bold/underline/italics) for rtb from step style - public string RtfPrefixForSymbols - { - get - { - if (_RtfPrefix == null) - { - StringBuilder selectedRtfSB = new StringBuilder(); - AddFontTable(selectedRtfSB, FormatFont, FontIsFixed(FormatFont)); - _RtfPrefix = selectedRtfSB.ToString(); - } - return _RtfPrefix + @"\f1\fs" + FormatFont.SizeInPoints * 2 + " "; - } - } - public string RtfPrefix - { - get - { - if (_RtfPrefix == null) - { - StringBuilder selectedRtfSB = new StringBuilder(); - AddFontTable(selectedRtfSB, FormatFont, FontIsFixed(FormatFont)); - _RtfPrefix = selectedRtfSB.ToString(); - } - return _RtfPrefix;// +@"{\colortbl ;\red255\green0\blue0;}"; - } - } - // August 5, 2009 - KBR & RHM: - // Insert/Overwrite will be developed later if needed. various issues - // were found during initial development that made its scope larger than - // expected. Problems were related to having overstrike on in the following - // cases: - // 1) left arrow when on link - positions after link - // 2) left arrow and after link - does not move - // 3) shift left arrow does not move past links correctly and also, first - // shift left arrow looks more like insert mode. - // private bool _OverWrite; - // _IsDirty compares the original rtf to the current rtf from the - // richtextbox to see if a change was made. - public bool IsDirty - { - get { return OrigRTF != Rtf; } - } - private bool _InitializingRTB; - private IContainer _Container = null; - private string _MyClassName=string.Empty; - public string MyClassName - { - get { if (_MyClassName == string.Empty)_MyClassName = CreateParams.ClassName; return _MyClassName; } - set { _MyClassName = value; } - } - //private E_EditPrintMode _epMode = E_EditPrintMode.Edit; - //public E_EditPrintMode EpMode - //{ - // get { return _epMode; } - // set { - // if (value == E_EditPrintMode.Print) Console.WriteLine(""); - // _epMode = value; } - //} - private E_ViewMode _vwMode = E_ViewMode.Edit; - public E_ViewMode VwMode - { - get { return _vwMode; } - set { _vwMode = value; } - } - private VE_Font _MyStyleFont; - public VE_Font MyStyleFont - { - get - { - if (_MyStyleFont == null) _MyStyleFont = MyItemInfo.GetItemFont(); - return _MyStyleFont; - } - } - private bool _ActiveMode = false; - public bool ActiveMode - { - get { return _ActiveMode; } - set { _ActiveMode = value; } - } - private ItemInfo _MyItemInfo; - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - set { _MyItemInfo = value; } - } - private string _OrigRTF; - public string OrigRTF - { - get { return _OrigRTF; } - set { _OrigRTF = value; } - } - private Font _FormatFont; - public Font FormatFont - { - get - { - if (_FormatFont == null) - { - Font formatFont; - if(MyItemInfo != null) - formatFont = MyItemInfo.GetItemFont().WindowsFont; // OrigDisplayText.TextFont.WindowsFont; - else - formatFont = Font; - if (MyItemInfo.IsTable || MyItemInfo.IsFigure) - _FormatFont = formatFont; - else - { - //if (VlnSettings.DebugMode || VlnSettings.ProductionMode) - _FormatFont = new Font(MyFontFamily == null ? formatFont.FontFamily : MyFontFamily, formatFont.Size, formatFont.Style); - //else - // _FormatFont = new Font("Bookman Old Style", formatFont.Size, formatFont.Style); - // TODO: Release Mode - //Font = _origDisplayText.TextFont.WindowsFont; // font defined in plant's format - } - } - return _FormatFont; - } - set - { - _FormatFont = value; - } - } - public void SetupRichText(string rtf, VE_Font vFont) - { - FormatFont = vFont.WindowsFont; - DisplayText vlnText = new DisplayText(rtf, vFont, true); - AddRtfText(vlnText.StartText); - ReadOnly = true; - } - - public void RefreshDisplay() - { - if (Disposing) return; - RefreshDisplay(ActiveMode); - } - // RefreshDisplay is used to update the rtb for an entire Item as defined by MyItemInfo. - public void RefreshDisplay(bool activeMode) - { - ActiveMode = activeMode; - OnAdjustTableWidth(this, new StepRTBTableWidthEventArgs(true)); - _InitializingRTB = true; - DisplayText vlntxt = new DisplayText(MyItemInfo, E_EditPrintMode.Edit, VwMode, !ActiveMode, FieldToEdit, true); - //if (_origDisplayText != null && vlntxt.StartText == _origDisplayText.StartText) - //{ - // ReadOnly = !(EpMode == E_EditPrintMode.Edit && VwMode == E_ViewMode.Edit); - // if (!ReadOnly && !edit) ReadOnly = true; - // return; - //} - OrigDisplayText = vlntxt; - - - // RHM 20101201 - Don't reset the text. Calculate the text and compare it with the existing text in AddRTFText - //Text = ""; // Initialize text before add text - // IMPORTANT: SetLineSpacing must be set before Links, otherwise it - // was confusing the 'handle' of the rtf box. - //Console.WriteLine("'font',{0}", Font); - //if(Text == "")SelectionFont = Font; // Initialize SelectionFont - if (MyItemInfo != null) - { - if (MyItemInfo.IsStep) Font = MyFontFamily == null ? MyItemInfo.FormatStepData.Font.WindowsFont:new Font(MyFontFamily, MyItemInfo.FormatStepData.Font.WindowsFont.Size, MyItemInfo.FormatStepData.Font.WindowsFont.Style); - else Font = Font = MyFontFamily == null ? MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont : new Font(MyFontFamily, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont.Size, MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font.WindowsFont.Style); - } - RTBAPI.SetLineSpacing(this, RTBAPI.ParaSpacing.PFS_EXACT); - ReadOnly = VwMode == E_ViewMode.View || ActiveMode == false; - AddRtfText(vlntxt.StartText); - //AddRtfStyles(); - // set readonly based on initial modes, however, these may change if - // user selected view mode. - ClearUndo(); - // RHM: 20101122 - Not sure why the RightMargin is set. The following line was added in Rev 23 - // in May of 2008. - // - // RightMargin = Width; - // - // Normally a the Right Margin is handled by the RichTextBox it defaults to a value of 0. - // - // If the RightMargin is equal to the width of the RichTextBox the word-wrap occurs just beyond - // the visible extent (right edge) of the RichTextBox when it is in view mode. In edit mode it - // wraps within the visible extent. An example of this is Step 24 of ES02 in HLP EOPs. - // - // If the RightMargin is greater than the width of the RichTextBox, the word-wrap occurs beyond - // the visible extent of the RichTextBox for both view and edit modes. - // - // Setting the RightMargin to the Width minus one, accounts for the slight indent (1 pixel) of - // the text within the RichTextBox. - RightMargin = Width > 0 ? Width - 1 : 0; - // figure out if needs outlined, depends on table/figure type - if (!ActiveMode) - { - RemoveEventHandlers(); - OnAdjustTableWidth(this, new StepRTBTableWidthEventArgs(false));// View Mode - SelectAll(); - if (SelectionHangingIndent !=0) SelectionHangingIndent = 0; - int indchar = 0; - string indentToken = MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IndentToken; - if (indentToken == null) indentToken = "\x5"; - while ((indchar = Find(indentToken, indchar, RichTextBoxFinds.None)) >= 0) - { - Point indent = GetPositionFromCharIndex(indchar); - SelectionHangingIndent = indent.X; - indchar++; - } - AddEventHandlers(); - } - //else - //{ - // if (MyRTBItem != null && (_MyItemInfo.IsTable || _MyItemInfo.IsFigure)) - // { - // //MyRTBItem.ItemWidth = (int)MyRTBItem.TableWidth(Font, Text,false); - // MyRTBItem.ItemWidth = MyRTBItem.MyStepPanel.ToDisplay(MyRTBItem.MyStepSectionLayoutData.WidT); - // } - //} - OrigRTF = Rtf; - _InitializingRTB = false; - - AdjustSizeForContents(!ActiveMode); // TODO: this is not quite right yet. - } - private bool _ProcessKeystrokes = true; - public bool ProcessKeystrokes - { - get { return _ProcessKeystrokes; } - set { _ProcessKeystrokes = value; } - } - - //public EnterKeyHandler EnterKeyPressed; - //protected override bool ProcessCmdKey(ref Message msg, Keys keyData) - //{ - // const int WM_KEYDOWN = 0x100; - // const int WM_SYSKEYDOWN = 0x104; - // if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN)) - // { - // switch (keyData) - // { - // case Keys.Control | Keys.V: - // // check for valid data to be inserted: - // return base.ProcessCmdKey(ref msg, keyData); - // default: - // return base.ProcessCmdKey(ref msg, keyData); - // } - // } - // return base.ProcessCmdKey(ref msg, keyData); - //} - private Point ScrollPos - { - get { return RTBAPI.GetScrollLocation(this); } - set { RTBAPI.SetScrollLocation(this, value); } - } - private Rectangle _ContentsRectangle = new Rectangle(0,0,0,0); - public Rectangle ContentsRectangle - { - get - { - if (_ContentsRectangle.X == 0 && _ContentsRectangle.Y == 0 && _ContentsRectangle.Width == 0 && _ContentsRectangle.Height == 0) - _ContentsRectangle = this.ClientRectangle; - return _ContentsRectangle; - } - set - { - _ContentsRectangle = value; - AdjustSizeForContents(false); - } - } - public Size ContentsSize - { - get { return _ContentsRectangle.Size; } - } - private Size _AdjustSize = new Size(0,0); // if 0,0 puts text right next to bottom of box. - public Size AdjustSize - { - get { return _AdjustSize; } - set - { - _AdjustSize = value; - AdjustSizeForContents(false); - } - } - public System.Windows.Forms.AutoScaleMode AutoScaleMode; - private DisplayText _OrigDisplayText; - - public DisplayText OrigDisplayText - { - get { return _OrigDisplayText; } - set { _OrigDisplayText = value; } - } - private RichTextBox _rtbTemp = new RichTextBox(); - private string _MyLinkText; - public string MyLinkText - { - get { return _MyLinkText; } - set - { - //if (value != _MyLinkText) - //{ - // updates to the info panel were not always occurring when the previous two - // lines were active - _MyLinkText = value; - OnLinkChanged(this, new StepPanelLinkEventArgs(_MyLinkText)); - //} - } - } - #endregion - #region Constructors - public StepRTB() - { - InitializeComponent(); - SetUpStepRTB(); - AddEventHandlers(); - } - public StepRTB(IContainer container) - { - container.Add(this); - InitializeComponent(); - _Container = container; - SetUpStepRTB(); - AddEventHandlers(); - } - protected override void OnMouseWheel(MouseEventArgs e) - { - OnDoMouseWheel(this, e); - //MyRTBItem.MyStepPanel.MouseWheel(e); - //base.OnMouseWheel(e); - } - private void RemoveEventHandlers() - { - ContentsResized -= new ContentsResizedEventHandler(StepRTB_ContentsResized); - this.Click -= new EventHandler(StepRTB_Click); - this.KeyPress -= new KeyPressEventHandler(StepRTB_KeyPress); - this.KeyDown -= new KeyEventHandler(StepRTB_KeyDown); - this.KeyUp -= new KeyEventHandler(StepRTB_KeyUp); - this.TextChanged -= new EventHandler(StepRTB_TextChanged); - this.MouseUp -= new MouseEventHandler(StepRTB_MouseUp); - this.MouseDown -= new MouseEventHandler(StepRTB_MouseDown); - this.MouseLeave -= new EventHandler(StepRTB_MouseLeave); - this.SelectionChanged -= new EventHandler(StepRTB_SelectionChanged); - this.ContextMenuStripChanged -= new EventHandler(StepRTB_ContextMenuStripChanged); - this.RTBSelectionChanged -= new StepRTBEvent(StepRTB_RTBSelectionChanged); - } - private void AddEventHandlers() - { - // Always be sure to add the same event handlers to RemoveEventHandlers - BorderStyle = System.Windows.Forms.BorderStyle.None; - this.DetectUrls = true; - ContentsResized += new ContentsResizedEventHandler(StepRTB_ContentsResized); - this.Click +=new EventHandler(StepRTB_Click); - this.KeyPress += new KeyPressEventHandler(StepRTB_KeyPress); - this.KeyDown += new KeyEventHandler(StepRTB_KeyDown); - this.KeyUp += new KeyEventHandler(StepRTB_KeyUp); - this.TextChanged += new EventHandler(StepRTB_TextChanged); - this.MouseUp += new MouseEventHandler(StepRTB_MouseUp); - this.MouseDown += new MouseEventHandler(StepRTB_MouseDown); - this.MouseLeave += new EventHandler(StepRTB_MouseLeave); - this.SelectionChanged +=new EventHandler(StepRTB_SelectionChanged); - this.ContextMenuStripChanged += new EventHandler(StepRTB_ContextMenuStripChanged); - this.RTBSelectionChanged += new StepRTBEvent(StepRTB_RTBSelectionChanged); - } - void StepRTB_RTBSelectionChanged(object sender, EventArgs args) - { - //Console.WriteLine("RTBSelectionChanged id= {0}", MyItemInfo.ItemID); - if (!Focused) Focus(); - } - void StepRTB_ContextMenuStripChanged(object sender, EventArgs e) - { - //Console.WriteLine("********** StepRTB_ContextMenuStripChanged"); - int sublocation = 0; - try - { - //Console.WriteLine("{0}", ContextMenuStrip.GetType().FullName); - OnSetMenu(this, new StepRTBMenuEventArgs(null)); - sublocation = 1; - _ContextMenuStripChanged = true; - sublocation = 2; - _ContextMenuStepRTB = this; - sublocation = 3; - _ContextMenuStrip = ContextMenuStrip; - sublocation = 4; - } - catch(Exception ex) - { - Console.WriteLine("StepRTB_ContextMenuStripChanged {0} - {1} [{2}]", ex.GetType().Name, ex.Message, sublocation); - } - } - private void SetUpStepRTB() - { - DetectUrls = false; - C1SpellChecker2.SetActiveSpellChecking(this, true); - this.Height = 10; // initialize the height to 10, the default height was too big for the cells in grid tables - BorderStyle = System.Windows.Forms.BorderStyle.None; - this.ScrollBars = RichTextBoxScrollBars.None; - this.DetectUrls = true; - } - // An event is needed to set MouseDown to false on mouse leave, because additional rtb's may - // have been exposed based on entering a step, which causes the underlying item/rtb for which - // the mouse event occurs to not be the current rtb. RTB gets selected on MouseDown, MouseEnter - // and MouseUp are - void StepRTB_MouseLeave(object sender, EventArgs e) - { - _MouseDown = false; - } - //void MyConfig_PropertyChanged(object sender, PropertyChangedEventArgs e) - //{ - // SaveConfig(); - //} - private void StepRTB_Click(object sender, EventArgs e) - { - if (ReadOnly) return; - } - void StepRTB_SelectionChanged(object sender, EventArgs e) - { - //Console.WriteLine("StepRTB_SelectionChanged id= {0}", MyItemInfo.ItemID); - if (_InitializingRTB) return; - HandleSelectionChange(); - } - private bool _MouseDown = false; - private bool _ContextMenuStripChanged = false; - private void StepRTB_MouseDown(object sender, MouseEventArgs e) - { - _MouseDown = true; - //Console.WriteLine("vvvvvvvvvv StepRTB Mouse Down id= {0}",MyItemInfo.ItemID); - bool inPsi = this.Parent.FindForm().Name.Contains("frmPSI"); - if (!_ContextMenuStripChanged) - OnSetMenu(this, new StepRTBMenuEventArgs(inPsi?"PSI":"OpenContextMenu")); - _ContextMenuStripChanged = false; - CorrectSelectionAtEndOfLine(); - } - void StepRTB_MouseUp(object sender, MouseEventArgs e) - { - _MouseDown = false; - //Console.WriteLine("^^^^^^^^^^ StepRTB Mouse Up id= {0}", MyItemInfo.ItemID); - - if(this.Focused) // Only HandleSelectionChange if this control has focus. - { - HandleSelectionChange(); - // save our context menu to add to the spell checker's context menu - ThisContextMenuStrip = this.ContextMenuStrip; - } - } - #endregion - #region ApplicationSupport - // Used in StepTabRibbon: - //public void ToggleEditView(E_ViewMode vwMode) - //{ - // OnDoSaveContents(this, new EventArgs()); // SaveText(); - // //ItemInfo tmp = MyItemInfo; - // //MyItemInfo = null; - // //ReadOnly = !ReadOnly; - // //EpMode = ReadOnly ? E_EditPrintMode.Print : E_EditPrintMode.Edit; - // VwMode = vwMode; - // ReadOnly = VwMode == E_ViewMode.View; - // ViewRTB = ReadOnly; - // Clear(); - // RefreshDisplay(!ViewRTB); - // //MyItemInfo = tmp; - // SelectionStart = 0; - // SelectionLength = 0; - // //OnModeChange(this, new StepRTBModeChangeEventArgs(ViewRTB?E_ViewMode.View:E_ViewMode.Edit)); - //} - public void InsertRO(string value, string link) - { - AddRtfLink(value, link); - } - public void InsertTran(string value, string link) - { - AddRtfLink(value, link); - } - public void InsertSymbol(int symbcode) - { - string sym = string.Format(symbcode < 256 ? "\'{0:X2}" : @"\u{0}", symbcode); - if (symbcode < 256) - AddText(((char)symbcode).ToString()); - else - AddSymbol(sym); // Adds font commands around symbol, needed for higher codes - } - public void InsertSymbol(string symbol) - { - AddSymbol(symbol); - } - public void InsertIndent(string indentToken) - { - if (indentToken == null) indentToken = "\x5"; - AddText(indentToken); - } - public void InsertText(string txt) - { - AddText(txt); - } - - private void ToggleCase() - { - char type = 'l'; - // do not change case on linked text - RangeStatus rs = FindRangeStatus(); - string tmp = null; - if (rs != RangeStatus.NoContainedLinks) - { - int start = SelectionStart; - int ostart = SelectionStart; - int end = SelectionStart + SelectionLength; - bool processed = false; - while (!processed && start <= end) - { - foreach (LinkLocation ll in LinkLocations) - { - if (ll.Start >= start && ll.End <= end) - { - processed = true; - if (start < ll.Start) - { - SelectionStart = start; - SelectionLength = ll.Start - start; - } - start = ll.End + 1; - break; - } - } - } - } - string ostring = SelectedText; - if (ostring.Length == 0) return; // nothing selected - if (ostring.Length == 1) - type = char.IsUpper(ostring, 0) ? 'l' : 'U'; - else if ((char.IsUpper(ostring, 0) && char.IsUpper(ostring, 1)) || - (char.IsLower(ostring, 0) && char.IsUpper(ostring, 1))) type = 'l'; // lower case - else if ((char.IsUpper(ostring, 0) && char.IsLower(ostring, 1))) type = 'U'; // upper case - else type = 'T'; // Title case - SetSelectedCase(type); - } - - public void SetSelectedCase(char type) - { - // do not change case on linked text - RangeStatus rs = FindRangeStatus(); - string tmp = null; - if (rs == RangeStatus.NoContainedLinks) - SetCase(type); - else - { - int start = SelectionStart; - int ostart = SelectionStart; - int end = SelectionStart + SelectionLength; - StringBuilder sb = new StringBuilder(); - while (start <= end) - { - bool processed = false; - foreach (LinkLocation ll in LinkLocations) - { - if (ll.Start >= start && ll.End <= end) - { - processed = true; - if (start < ll.Start) - { - SelectionStart = start; - SelectionLength = ll.Start - start; - SetCase(type); - } - start = ll.End + 1; - break; - } - } - // if none were processed, no more links, copy over any remaining text. - if (!processed) - { - SelectionStart = start; - SelectionLength = end-start; - SetCase(type); - start = end + 1; - } - } - SelectionStart = ostart; - SelectionLength = end - ostart; - } - } - - private void SetCase(char type) - { - int ostart = SelectionStart; - int olen = SelectionLength; - string ostring = SelectedText; - string tmp = null; - bool docap = true; - // go character by character. Because of symbols, setting entire - // to upper or lower set symbols incorrectly some of time (depending - // on symbol) . - for (int i = 0; i < olen; i++) - { - SelectionStart = ostart + i; - SelectionLength = 1; - switch (type) - { - case 'l': - if (SelectedText[0] >= 'A' && SelectedText[0] <= 'Z') - SelectedText = SelectedText.ToLower(); - break; - case 'U': - if (SelectedText[0] >= 'a' && SelectedText[0] <= 'z') - SelectedText = SelectedText.ToUpper(); - break; - case 'T': - if (docap && SelectedText[0] >= 'a' && SelectedText[0] <= 'z') - SelectedText = SelectedText.ToUpper(); - else if (!docap && SelectedText[0] >= 'A' && SelectedText[0] <= 'Z') - SelectedText = SelectedText.ToLower(); - docap = ostring[i] == ' '; - break; - } - } - SelectionStart = ostart; - SelectionLength = olen; - } - #endregion - #region AddRtfTextAndStyles - private string _LastRtf = ""; - private bool _lastReadOnly = false; - private void AddRtfText(string txt) - { - //Console.WriteLine("ItemID:{0}", MyItemInfo.ItemID); - //if(MyItemInfo.ItemID==10256) - // Volian.Base.Library.vlnStackTrace.ShowStackLocal("ItemID:{0}", MyItemInfo.ItemID.ToString()); - StringBuilder selectedRtfSB = new StringBuilder(); - AddFontTable(selectedRtfSB, FormatFont, FontIsFixed(FormatFont)); - _RtfPrefix = selectedRtfSB.ToString(); - selectedRtfSB.Append(txt); - string newRtf = selectedRtfSB.ToString() + "}"; - if(newRtf != _LastRtf || ReadOnly != _lastReadOnly) - { - //Console.WriteLine("ItemID:{0}\r\nOld:'{1}'\r\nNew:'{2}'\r\n", MyItemInfo.ItemID, Rtf, newRtf); - this.ContentsResized -=new ContentsResizedEventHandler(StepRTB_ContentsResized); - Text = ""; - this.ContentsResized += new ContentsResizedEventHandler(StepRTB_ContentsResized); - SelectedRtf = _LastRtf = newRtf; - _lastReadOnly = ReadOnly; - } - FindAllLinks(); - if (txt == "") SelectionFont = FormatFont; - } - public void SetTableGridCellRTFPrefix(Font myfont) - { - if (_FormatFont == null) - _FormatFont = myfont; - - if (_RtfPrefix == null) - { - StringBuilder selectedRtfSB = new StringBuilder(); - AddFontTable(selectedRtfSB, myfont, FontIsFixed(myfont)); - _RtfPrefix = selectedRtfSB.ToString(); - } - } - private static void AddFontTable(StringBuilder selectedRtfSB, Font myFont, bool isFixed) - { - StringBuilder sbbeg = new StringBuilder(); - StringBuilder sbend = new StringBuilder(); - if (myFont.Bold) - { - sbbeg.Append(@"\b"); - sbend.Append(@"\b0"); - } - if (myFont.Underline) - { - sbbeg.Append(@"\ul"); - sbend.Insert(0, @"\ulnone"); - } - if (myFont.Italic) - { - sbbeg.Append(@"\i"); - sbend.Insert(0, @"\i0"); - } - selectedRtfSB.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 " + myFont.FontFamily.Name + @";}"); //}\f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}}"; - if (!isFixed) - selectedRtfSB.Append(@"{\f1\fnil\fcharset0 Arial Unicode MS;}}{\colortbl ;\red255\green0\blue0;}"); - else - selectedRtfSB.Append(@"{\f1\fnil\fcharset0 VESymbFix;}}{\colortbl ;\red255\green0\blue0;}"); - selectedRtfSB.Append("\r\n"); - // use styles to construct rtf commands to insert into next line (where \b, etc is) - selectedRtfSB.Append(@"\viewkind4\uc1\pard\sl-240\slmult0" + sbbeg.ToString() + @"\fs" + Convert.ToInt32(myFont.SizeInPoints * 2).ToString() + @" "); // \f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}"; - } - - private bool FontIsFixed(Font myFont) - { - Graphics grph = Graphics.FromHwnd(this.Handle); - SizeF sfW = grph.MeasureString("W", myFont); - SizeF sfE = grph.MeasureString("!", myFont); - if (sfW.Width == sfE.Width) return true; - return false; - } - private void AddRtf(string str) - { - // Because we're inserting rtf with { }, the surrounding styles are not included. Get the font - // style of current position & use it after the insert to set the style. - RTBAPI.E_FontStyle fs = RTBAPI.GetFontStyle(this); - int positionStart = SelectionStart; - SelectedRtf = @"{\rtf1{\fonttbl{\f0\fcharset2 " + this.Font.FontFamily.Name + @";}}\f0\fs" + this.Font.SizeInPoints * 2 + @" " + str + @"}}"; - // Note that SelectedRtf does not contain the inserted text after the previous line. We need - // to determine how long the inserted string is in order to set its style. SelectionStart contains - // the location after the insertion. - int positionAfter = SelectionStart; - Select(positionStart, positionAfter - positionStart); - RTBAPI.SetFontStyle(this, fs); - Select(positionAfter, 0); - } - private void AddText(string str) - { - // See comments in AddRtf(string str) to explain the font style setting - RTBAPI.E_FontStyle fs = RTBAPI.GetFontStyle(this); - int positionStart = SelectionStart; - SelectedText = str; - int positionAfter = SelectionStart; - Select(positionStart, positionAfter - positionStart); - RTBAPI.SetFontStyle(this, fs); - Select(positionAfter, 0); - } - private void AddSymbol(string str) - { - // See comments in AddRtf(string str) to explain the font style setting - RTBAPI.E_FontStyle fs = RTBAPI.GetFontStyle(this); - int position = SelectionStart; - SelectedRtf = RtfPrefixForSymbols + str + @"}"; - Select(position, 1); - RTBAPI.SetFontStyle(this, fs); - Select(position + 1, 0); - SelectionFont = MyItemInfo.GetItemFont().WindowsFont; - } - private string GetAddSymbolText(string symtxt) - { - return (@"{\f0\fs" + this.Font.SizeInPoints * 2 + @" " + symtxt + @"}"); - } - public void AddRtfLink(string linkUrl, string linkValue) - { - if (CreateParams.ClassName == "RICHEDIT50W") - - AddLink50(linkUrl, linkValue); - else - AddLink20(linkUrl, linkValue); - } - public string FontTable - { - get - { - StringBuilder sb = new StringBuilder(); - sb.Append(@"{\fonttbl{\f0\fnil\fcharset2 " + this.Font.FontFamily.Name + @";}"); - if (!FontIsFixed(this.Font)) - sb.Append(@"{\f1\fnil\fcharset0 Arial Unicode MS;}}"); - else - sb.Append(@"{\f1\fnil\fcharset0 VESymbFix;}}"); - return sb.ToString(); - } - } - private string FontSize - { - get - { - Match match = Regex.Match(Rtf, @"\\fs[0-9]*"); - return match.Value; - } - } - - private void AddLink20(string linkValue, string linkUrl) - { - string fonttab = FontTable; - string fontsize = FontSize; - //if (this.DetectUrls) this.DetectUrls = false; - if (SelectionLength > 0)HandleDeleteKeyWithSelectedText(new KeyEventArgs(Keys.None), null); - int position = SelectionStart; - SelectionLength = 0; - linkValue = linkValue.Replace("\\u8209?", "\\f1\\u8209?\\f0 "); - SelectedRtf = @"{\rtf1\ansi"+FontTable+@"{\colortbl ;\red255\green0\blue0;}\v"+FontSize+@" \v0 }"; - this.SelectionLength = 0; - this.SelectionStart = position; - FindAllLinks(); - } - private void AddLink50(string linkValue, string linkUrl) - { - //this.DetectUrls = false; - int position = SelectionStart; - SelectionLength = 0; - SelectedRtf = string.Format(@"{{\rtf\field{{\*\fldinst{{HYPERLINK ""www.volian.com #{0}"" }}}}{{\fldrslt{{\cf2\ul {1}}}}}}}", linkUrl, linkValue); - this.SelectionStart = this.TextLength; - this.SelectionLength = 0; - } - private void AddRtfStyles() - { - if ((OrigDisplayText.TextFont.Style & E_Style.Bold) > 0) - { - this.SelectAll(); - RTBAPI.ToggleBold(true, this, RTBAPI.RTBSelection.SCF_SELECTION); - this.Select(0, 0); - } - // Bug Fix - // The code below was changed to select all of the text and then - // apply the underlining to the selected text, because if the - // the underlining was applied to RTBAPI.RTBSelection.SCF_ALL - // the Links were changed so that they were no longer hidden. - if ((OrigDisplayText.TextFont.Style & E_Style.Underline) > 0) - // RTBAPI.ToggleUnderline(true, this, RTBAPI.RTBSelection.SCF_ALL); - { - this.SelectAll(); - RTBAPI.ToggleUnderline(true, this, RTBAPI.RTBSelection.SCF_SELECTION); - this.Select(0, 0); - } - // Bug Fix - // The code below was changed to select all of the text and then - // apply the italics to the selected text, because if the - // the italics was applied to RTBAPI.RTBSelection.SCF_ALL - // the Links were changed so that they were no longer hidden. - if ((OrigDisplayText.TextFont.Style & E_Style.Italics) > 0) - // RTBAPI.ToggleItalic(true, this, RTBAPI.RTBSelection.SCF_ALL); - { - this.SelectAll(); - RTBAPI.ToggleItalic(true, this, RTBAPI.RTBSelection.SCF_SELECTION); - this.Select(0, 0); - } - } - #endregion - #region HeightSupport - public event StepRTBEvent HeightChanged; - private void OnHeightChanged(object sender, EventArgs args) - { - if (HeightChanged != null) HeightChanged(sender, args); - } - private void AdjustSizeForContents(bool adjustWidth) - { - if (!_InitializingRTB) - { - Size offset = Size - ClientSize; - int widthNew = (this is TableCellEditor) ? Width : (ContentsSize.Width + offset.Width + AdjustSize.Width); - //int widthNew = Width; - //if (!(this is TableCellEditor)) - // widthNew = ContentsSize.Width + offset.Width + AdjustSize.Width; - int heightNew = ContentsSize.Height + offset.Height + AdjustSize.Height; - // Don't make the window narrower unless it has text - RHM - 20100107 - Size szNew = new Size(((Text != "" && adjustWidth) ? widthNew : (widthNew > Width ? widthNew : Width)), heightNew); - if (this.Size != szNew) - { - int heightOld = Height; - //Console.WriteLine("before {0}, {1}, {2}, {3}, {4}", Size, szNew, widthNew, Width, this.GetType().Name); - this.Size = szNew; - //Console.WriteLine("after {0}, {1}, {2}, {3}", Size, szNew, widthNew, Width); - if (heightOld != Height) - OnHeightChanged(this, new EventArgs()); - } - } - } - private float GetStringWidth(string strMeasureString) - { - using (Graphics g = Graphics.FromHwnd(Handle)) - { - return g.MeasureString(strMeasureString, Font).Width; - } - } - private int Ceiling(float f) - { - return (int)(Math.Ceiling(f)); - } - public int MaxTextWidth - { - get - { - int maxWidth = 0; - for (int i = 0; i < TextLength; i++) - { - int w = GetPositionFromCharIndex(i).X; - maxWidth = Math.Max(maxWidth, w); - } - return maxWidth+10; // add 10 to account for the last character - } - } - public void AdjustWidthForContent() - { - int widthNL = Ceiling(GetStringWidth("\n")); - int widthMax = 0; - int widthMaxWW = 0; - int indexStart = 0; - int lineCountFromLines = Lines.Length; - int lineCountFromGet = GetLineFromCharIndex(TextLength)+1; - for (int i = 0; i < Lines.Length; i++) - { - int lineStart = GetLineFromCharIndex(indexStart); - int indexEnd = indexStart + Lines[i].Length; - int lineEnd = GetLineFromCharIndex(indexEnd); - Point pointStart = GetPositionFromCharIndex(indexStart); - Point pointEnd = GetPositionFromCharIndex(indexEnd); - int indexEndPos = GetCharIndexFromPosition(pointEnd); - if (indexEndPos + 1 < indexEnd) // This indicates that the text is wider than the Rich Text Box - { - int w = pointEnd.X + (indexEnd - indexEndPos) * widthNL; - if (w > widthMaxWW) - { - widthMaxWW = w; - } - } - if (lineEnd > lineStart)// this indicates that there was word-wrap on this line. - { - int w = pointEnd.X + Width * (lineEnd - lineStart); - if (w > widthMaxWW) - widthMaxWW = w; - } - else - { - if (pointEnd.X > widthMax) - widthMax = pointEnd.X; - } - indexStart = indexEnd + 1; - } - if (widthMaxWW == 0) - { - int widthBorder = Width - ClientSize.Width; - int w = widthMax + widthNL + widthBorder; - if (Width != w) - { - Width = w; - AdjustWidthForContent();// Try one more time - } - } - else - { - Width = widthMaxWW; - AdjustWidthForContent(); - } - } - public int CalculateHeight() - { - if (this.CreateParams.ClassName == "RICHEDIT50W") - return CalculateHeight50(); - else - return CalculateHeight20(); - } - private int CalculateHeight20() - { - Application.DoEvents(); - int yBottom = GetPositionFromCharIndex(TextLength).Y; - int yTop = GetPositionFromCharIndex(0).Y; - int heightFont = SelectionFont.Height; - int borderSize = this.Height - this.ClientSize.Height; - int heightNext = (yBottom - yTop) + heightFont + borderSize + 2;// 2 pixels - 1 at the top and 1 at the bottom - if (heightNext != Height) - { - Height = heightNext; - - OnHeightChanged(this, new EventArgs()); - ScrollPos = new Point(0, 0); // Scroll to make sure that the first line is displayed as the first line - } - return heightNext; - } - private int CalculateHeight50() - { - Application.DoEvents(); - int heightFont = SelectionFont.Height; - int borderSize = this.Height - this.ClientSize.Height; - int heightNext = (1 + GetLineFromCharIndex(TextLength)) * heightFont + borderSize + 2;// 2 pixels - 1 at the top and 1 at the bottom - return heightNext; - } - #endregion - #region ColorSupport - Not currently used. - //private void SetBackGroundColor(ItemInfo itemInfo) - //{ - // string backcolor = null; - // int type = (int)itemInfo.MyContent.Type; - // FormatInfo formatinfo = itemInfo.ActiveFormat; - // if (type == (int)E_FromType.Procedure) - // backcolor = formatinfo.PlantFormat.FormatData.ProcData.BackColor; - // else if (type == (int)E_FromType.Section) - // backcolor = formatinfo.PlantFormat.FormatData.SectData.BackColor; - // else - // { - // int typindx = (int)itemInfo.MyContent.Type - 20000; // what to do for other types rather than steps - // backcolor = formatinfo.PlantFormat.FormatData.StepDataList[typindx].StepLayoutData.BackColor; - // } - // BackColor = Color.FromName(backcolor); - //} - #endregion - #region EventSupport - #region LinkEvents - private StepPanelLinkEventArgs _MyLinkClickedEventArgs; - public event StepRTBLinkEvent LinkChanged; - private void OnLinkChanged(object sender, StepPanelLinkEventArgs args) - { - _MyLinkClickedEventArgs = args; - if (LinkChanged != null) LinkChanged(sender, args); - } - public event StepRTBLinkEvent LinkGoTo; - private void OnLinkGoTo(object sender, StepPanelLinkEventArgs args) - { - _MyLinkClickedEventArgs = args; - if (LinkGoTo != null) LinkGoTo(sender, args); - } - public event StepRTBLinkEvent LinkModifyTran; - private void OnLinkModifyTran(object sender, StepPanelLinkEventArgs args) - { - _MyLinkClickedEventArgs = args; - if (LinkModifyTran != null) LinkModifyTran(sender, args); - } - public event StepRTBLinkEvent LinkModifyRO; - private void OnLinkModifyRO(object sender, StepPanelLinkEventArgs args) - { - _MyLinkClickedEventArgs = args; - if (LinkModifyRO != null) LinkModifyRO(sender, args); - } - #endregion - #region TextAndContentsEvents - void StepRTB_TextChanged(object sender, EventArgs e) - { - if (_InitializingRTB) return; - // Was setting _IsDirty to true here, but this was getting called from - // 'dotnetbar' when text was NOT Changed. So _IsDirty was made into - // a property and compared original rtf versus current richtextbox's - // rtf. - FindAllLinks(); - } - public void StepRTB_ContentsResized(object sender, ContentsResizedEventArgs e) - { - ContentsRectangle = e.NewRectangle; - } - #endregion - #region Selection Handlers - bool _AdjustingSelection = false; - private bool _ProcessingDelete; - private bool _HandlingCtrlA = false; - private void HandleLocalSelectionChange() - { - //if (MyRTBItem != null && MyRTBItem.MyStepPanel.SelectedStepRTB != this) - if (OnIsNotCurrentSelection(this, new EventArgs())) - return; - - HandleSelectionChange(); - } - private void HandleSelectionChange() - { - if (_HandlingCtrlA) return; - if (!_HandlingCtrlA && this.TextLength == this.SelectionLength && this.SelectedRtf.EndsWith("\\par\r\n}\r\n")) - { - _HandlingCtrlA = true; - SelectAll(); - _HandlingCtrlA = false; - } - //HandleOverWrite(); - //vlnStackTrace.ShowStackLocal("HandleSelectionChangeStack", 1, 10); - bool startingValue = _AdjustingSelection; - if (_IdentifyingLinks || _ProcessingDelete) return; - // If the cursor is beyond the end of the line then move the cursor back one character - if (CorrectSelectionAtEndOfLine()) - return; - if (ProcessKeystrokes) - { - if (!_MouseDown && !_AdjustingSelection) - { - if (_LinkLocations != null) - { - DebugPrint("HSC===================>Beginning: SelectionStart {0}, SelectionLength {1}", SelectionStart, SelectionLength); - _AdjustingSelection = true; - LinkLocation ll = FindLinkLocation(); - LinkLocation llend = null; - if (SelectionLength != 0) - llend = FindLinkLocation(SelectionStart + SelectionLength - 1); - if (ll != null) - { - if (SelectionStart == ll.Start && SelectionLength == 0) - { - if (SelectionStart >= 7) - { - // If the cursor is at the beginning of the line and a link is at the beginning of the line - // then select the link rather than postitioning the cursor at the end of the previous line - if (!_LastWasLeftArrow && GetFirstCharIndexOfCurrentLine() == SelectionStart) - SetSelection(ll); - else - { - DebugPrint("HSC===================>ll Insert: Sel {0}, Length {1}, Link Start {2}, Link Length {3}", SelectionStart, SelectionLength, ll.Start, ll.Length); - SelectionStart = ll.Start - 7; - } - } - } - else if (SelectionStart + SelectionLength > ll.End) // Beyond the end of the starting link - { - int end = SelectionStart + SelectionLength; - if (llend != null) end = llend.End; // If it extends into another link extend the end to the end of that link - DebugPrint("HSC===================>ll After: Sel {0}, Length {1}, Link Start {2}, Link Length {3}", SelectionStart, SelectionLength, ll.Start, ll.Length); - SetSelection(ll.Start, end - ll.Start); - } - else if (SelectionStart >= ll.Start || SelectionLength > 0)// Within the starting link - { - DebugPrint("HSC===================>ll: Sel {0}, Length {1}, Link Start {2}, Link Length {3}", SelectionStart, SelectionLength, ll.Start, ll.Length); - SetSelection(ll); - } - } - else if (llend != null) - { - DebugPrint("HSC===================>llend: Sel {0}, Length {1}, Link Start {2}, Link Length {3}", SelectionStart, SelectionLength, llend.Start, llend.Length); - // Check to see if the beginning starts before the Removing ending Removing starting _AdjustingSelection problem"); - DebugPrint("RS------ SelectionChange > {0}", FindRangeStatus()); - if (SelectionLength > 0 && IsSelectionLinked(SelectionStart, SelectionLength)) - { - if (SelectedText.IndexOf(@"[END>") > 0) MyLinkText = SelectedText.Substring(0, SelectedText.IndexOf(@"[END>")); - else MyLinkText = SelectedText; - } - else - MyLinkText = null; - OnRTBSelectionChanged(this, new EventArgs()); - _LastWasLeftArrow = false; - } - /// - /// If the Selection is beyond the end of the line, move the selection back one character - /// - /// - private bool CorrectSelectionAtEndOfLine() - { - if (SelectionStart > 0 && SelectionLength == 0 && - GetFirstCharIndexFromLine(GetLineFromCharIndex(SelectionStart)) > - GetFirstCharIndexOfCurrentLine()) - { - SelectionStart--; // Move the cursor back one character - return true; - } - return false; - } - - //private void HandleOverWrite() - //{ - // if (!_OverWrite) return; - // if (SelectionLength > 0) return; - // if (SelectionStart == TextLength) return; - // Console.WriteLine("Handle Overwrite, SelectionStart = {0}, SelectionLength = {1}", SelectionStart, SelectionLength); - // SelectionLength = 1; - //} - private bool _CheckSelection = false; - #endregion - #region Delete Handlers - private void HandleDeleteKeyWithSelectedText(KeyEventArgs e, string keychars) - { - _ProcessingDelete = true; - FindRangeStatus(); - //DebugPrint("RS---------------- Delete > {0}", _RTBRangeStatus); - switch (_RTBRangeStatus) - { - case RangeStatus.NoContainedLinks: - case RangeStatus.Before_After: - case RangeStatus.Before_EndLink: - case RangeStatus.Before_EndBox: - default: - DeleteCurrentSelection(keychars); - e.SuppressKeyPress = true; - break; - case RangeStatus.Before_Between: //myRTB1.SelectedText.EndsWith(@"[END> - /// This inserts a space in between two links. - /// It actually inserts "\v0 {space}\v " between the END tag and the START tag - /// - /// - /// - /// - private void InsertCharBetweenLinks(LinkLocation ll, char charToAdd, bool setSelect) - { - //_InsertingSpaceBetweenLinks = true; - DebugPrint("ICBLvvvvvvvvvvvvvvv>>>"); - Rtf = Rtf.Substring(0, ll.StartRtf) + @"\v0 " + charToAdd.ToString() + @"\v " + Rtf.Substring(ll.StartRtf); - //_InsertingSpaceBetweenLinks = false; - if (setSelect) - SelectionStart = ll.Start - 6; // account for >>"); - } - private void ExpandSelectionToIncludeStart() - { - //_AdjustingSelection = true; - SetSelection(SelectionStart - 7, SelectionLength + 7); // Expand selection to include start - //_AdjustingSelection = false; - } - private void DeleteBetweenBetweenLinks(string keychars) - { - - DebugSelection("DeleteBetweenBetweenLinks"); - int selStart = SelectionStart - 7; - int selLength = SelectionLength + 2; // Include the two added spaces - InsertCharBetweenLinks(_RangeEndLink.NextLink); // Add a space at the end link - InsertCharBetweenLinks(_RangeStartLink); // Add a space a the start link - SetSelection(selStart, selLength);// Select everything including the spaces - DeleteCurrentSelection(keychars);// Delete Selection - } - /// - /// This is added to handle a glitch in richtextbox. Depending on - /// which direction that selection is made (left -> right or right -> left) - /// a replacement or delete may not work, you'll just get a 'beep'. - /// This approach consistently works. - /// - public bool WasXDelete = false; - private void DeleteCurrentSelection(string keys) - { - - DebugPrint("vvvvvvvvvvvvxxxxxxxxxxxx>"); - DebugSelection("Before X"); - DebugPrint(keys == null ? "NULL" : "NOT NULL"); - SelectedText = keys==null?"X":keys; // replace text with X - WasXDelete = (keys == null); - DebugSelection("After X"); - DebugPrint("------------xxxxxxxxxxxx>"); - if (keys == null) - { - _SendBackSpace = true; - RtbSendKeys("{BS}"); // remove X - //this.ClearUndo(); // undo was redisplay 'X' and then deleted text - Application.DoEvents(); - DebugSelection("After BS"); - } - DebugPrint("^^^^^^^^^^^^xxxxxxxxxxxx>"); - } - private void DeleteSelection(int start, int length, string keychars) - { - SetSelection(start, length); - DeleteCurrentSelection(keychars); - } - private void DeleteEndBetweenLinks(string keychars) - { - _ProcessingKeys++; - DebugSelection("DeleteEndBetweenLinks"); - int sstart = SelectionStart; - int slen = SelectionLength + 1 - 7; - // This puts a space at the link that starts at the end of the selection - InsertCharBetweenLinks(_RangeEndLink.NextLink); - //_AdjustingSelection = true; - DeleteSelection(sstart, slen, keychars); - //_AdjustingSelection = false; - _ProcessingKeys--; - } - private void DeleteStartBetweenLinks(string keychars) - { - _ProcessingKeys++; - DebugSelection("DeleteStartBetweenLinks"); - int slen = SelectionLength + 8; - int sstart = SelectionStart - 7; - //LinkLocation ll = FindBetweenLinks(SelectionStart); - InsertCharBetweenLinks(_RangeStartLink); - DeleteSelection(sstart, slen, keychars); - _ProcessingKeys--; - } - private void DeleteFromStartOfBox(string keychars) - { - _ProcessingKeys++; - DebugSelection("DeleteFromStartOfBox"); - int slen = SelectionLength; - SetSelection(0, 0); - //RtbSendKeys(" "); // open for space between links which separates END/START tokens - SelectedText = " "; - DeleteSelection(0, slen + 8, keychars); - _ProcessingKeys--; - } - private void DeleteFromStartOfBoxEndBetweenLinks(string keychars) - { - _ProcessingKeys++; - DebugSelection("DeleteFromStartOfBoxEndBetweenLinks"); - // This puts a space at the link that starts at the end of the selection - int sLen = SelectionStart + SelectionLength - 7 + 2;// -7 for 0) SetSelection(SelectionStart, newend - SelectionStart); - break; - case Keys.Space: - if (e.Control) // Hardspace - Ctrl+Shift+Space - InsertSymbol(@"\u160?"); - break; - case Keys.F3: // shift F3 - e.Handled = true; - ToggleCase(); // toggle through Upper, Lower, and Title case - break; - default: - break; - } - } - - private string GetSelectedDisplayableText() - { - StepRTB srtb = new StepRTB(); - srtb.Rtf = this.SelectedRtf.Replace(@"\u8209?", "-"); - string rtnstr = ""; - string ctxt = srtb.Text;//this.SelectedText; - if (ctxt.EndsWith(""); - if ((strtidx == -1 || strtidx > lnkidx) && lnkidx > -1 && endidx > -1) - { - rtnstr += ctxt.Substring(idx, lnkidx); - idx = endidx + 5; - strtidx = ctxt.IndexOf("", idx); - } - while (strtidx > -1) - { - rtnstr += ctxt.Substring(idx, strtidx - idx); - idx = strtidx + 7; - rtnstr += ctxt.Substring(idx, lnkidx - idx); - idx = endidx + 5; - strtidx = ctxt.IndexOf("", idx); - } - if (idx < ctxt.Length) - rtnstr += ctxt.Substring(idx); - return rtnstr; - } - - private bool IsControlChar = false; - private bool _SendBackSpace = false; - void StepRTB_KeyDown(object sender, KeyEventArgs e) - { - if (e.Control) - { - IsControlChar = true; - switch (e.KeyCode) - { - case Keys.X: //ctrl-X - case Keys.C: //ctrl-C - // handle the clipboard copy and cut when a Transition or RO is selected - // For now, we are coping/cutting just the displayed text to the clipboard (like 16-bit VE-PROMS) - string ts = GetSelectedDisplayableText(); - if (ts!=null&&ts!="") Clipboard.SetText(GetSelectedDisplayableText()); - e.Handled = true; - e.SuppressKeyPress = true; - if (ts!=null&&ts!=""&&e.KeyCode == Keys.X) // cut to clipboard - delete the selected text - HandleDeleteKeyWithSelectedText(e, null); - break; - case Keys.V: - IDataObject iData = Clipboard.GetDataObject(); - if (!iData.GetDataPresent(DataFormats.Text) && !iData.GetDataPresent(DataFormats.Rtf)) - { - MessageBox.Show("Cannot paste, text has special characters or symbols that will not paste correctly."); - } - else - { - Paste(); - if (SelectionLength == 0) SelectionFont = MyStyleFont.WindowsFont; - } - e.Handled = true; - return; - case Keys.Home: - StepRTB_HomeEndPressed(e); - e.Handled = true; - break; - case Keys.End: - StepRTB_HomeEndPressed(e); - e.Handled = true; - break; - case Keys.Enter: - OnInsertPgBrk(this, new EventArgs()); - e.Handled = true; - break; - } - } - switch (e.KeyCode) - { - case Keys.Left: - if (e.Shift) - { - int newstart = FindStart(); // find start of link ending on. - // if not link, don't do special processing - if (newstart == SelectionStart - 1) return; - int len = SelectionLength + SelectionStart - newstart; - SetSelection(newstart, len); - e.Handled = true; - return; - } - if (e.Control || SelectionStart == 0) - { - StepRTB_ArrowPressed(e.Control ? E_ArrowKeys.CtrlLeft : E_ArrowKeys.Left); - e.Handled = true; - } - HandleLocalSelectionChange(); - break; - case Keys.Up: - int ln = GetLineFromCharIndex(SelectionStart); - if (e.Control || ln == 0) - { - StepRTB_ArrowPressed(e.Control ? E_ArrowKeys.CtrlUp : E_ArrowKeys.Up); - e.Handled = true; - } - // if shift-up & at selection had a link, handle this as special case. - if (e.Shift && SelectionLength > 0) - { - RangeStatus rs = FindRangeStatus(); - if (rs != RangeStatus.NoContainedLinks) - { - int curend = SelectionStart + SelectionLength; - SelectionLength = 0; - RtbSendKeys("{Up}"); - Application.DoEvents(); - Select(SelectionStart, curend - SelectionStart); - e.Handled = true; - } - } - else - { - HandleLocalSelectionChange(); - } - break; - case Keys.Right: - // If at beginning of box that starts with a link, don't worry about shift or not, - // because selection is first character or link without any other selection. Don't - // need to write code to handle link at beginning of box in Shift Right code because - // it's handled in HandleSelectionChange. - if (e.Shift && ((SelectionStart > 0) || (SelectionStart == 0 && _LinkLocations.Count > 0 && _LinkLocations[0].Start != 7))) - { - int newlen = FindEnd(); - int len = SelectionLength + newlen; - SetSelection(SelectionStart, len); - e.Handled = true; - return; - } - if (e.Control || SelectionStart == this.Text.Length) - { - StepRTB_ArrowPressed(e.Control ? E_ArrowKeys.CtrlRight : E_ArrowKeys.Right); - e.Handled = true; - } - HandleLocalSelectionChange(); - break; - case Keys.Down: - int l = GetLineFromCharIndex(SelectionStart); - Point pos = new Point(); - pos.X = ClientRectangle.Width; - pos.Y = ClientRectangle.Height; - int lastIndex = this.GetCharIndexFromPosition(pos); - int lastLine = this.GetLineFromCharIndex(lastIndex); - if (e.Control || l >= lastLine) - { - StepRTB_ArrowPressed(e.Control ? E_ArrowKeys.CtrlDown : E_ArrowKeys.Down); - HandleLocalSelectionChange(); - e.Handled = true; - return; - } - if (!e.Shift) HandleLocalSelectionChange(); - // if shift-down & on link at beginning of box - do special processing (regular processing - // didn't handle it correctly. - if (e.Shift && lastLine > 0 && SelectionStart == 0 && _LinkLocations.Count > 0 && _LinkLocations[0].Start == 7) - { - Point cpos = GetPositionFromCharIndex(SelectionStart); - int addon = ClientRectangle.Height / (lastLine + 1); - cpos.Y = cpos.Y + addon; - int selend = GetCharIndexFromPosition(cpos); - Select(7, selend - 7); - e.Handled = true; - } - break; - case Keys.PageUp: - StepRTB_PageKeyPressed(e); - e.Handled = true; - break; - case Keys.PageDown: - StepRTB_PageKeyPressed(e); - e.Handled = true; - break; - case Keys.Delete: - if (SelectionLength == 0) - { - foreach (LinkLocation lls in _LinkLocations) - { - if (SelectionStart >= lls.Start - 7 && SelectionStart < lls.End) - { - SetSelection(lls);// Select the link to the right - HandleDeleteKeyWithSelectedText(e, null); - e.SuppressKeyPress = true; - return; - } - } - if (SelectionStart != TextLength) - { - SelectionStart++;// A Delete can be accomplished with a right arrow followed by a backspace. - RtbSendKeys("{BS}"); // This is done due to a glitch in the RichTextBox that sometimes causes a beep rather than a delete - e.SuppressKeyPress = true; - } - } - else - HandleDeleteKeyWithSelectedText(e, null); - break; - case Keys.Back: - if (_SendBackSpace) - { - _SendBackSpace = false; - return; - } - _CheckSelection = true; - if (SelectionLength == 0) - { - foreach (LinkLocation lls in _LinkLocations) - { - if (SelectionStart > lls.Start - 7 && SelectionStart <= lls.End) - { - SetSelection(lls); - break; - } - } - } - if (SelectionLength > 0) HandleDeleteKeyWithSelectedText(e, null); - break; - case Keys.Insert: - //_OverWrite = !_OverWrite; - //if (_OverWrite) - //{ - // HandleSelectionChange(); - //} - //else - //{ - // SelectionLength = 0; - // HandleSelectionChange(); - //} - // For now, don't allow for toggling between insert/overwrite mode - see - // comment on _OverWrite - e.Handled = true; - break; - case Keys.F5: - if (e.Shift) - { - e.Handled = true; - if (!OnCheckClipboard(this, new EventArgs())) return; // check if 'clipboard' contains a step. - OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste")); - } - else if (!e.Control && !e.Alt) - { - e.Handled = true; - OnCopyStep(this, new EventArgs()); - } - break; - case Keys.F6: - e.Handled = true; - SendKeys.Send("%H{ESC}"); - break; - case Keys.Tab: - VlnFlexGrid myGrid = Parent as VlnFlexGrid; - if (myGrid == null) - { - e.SuppressKeyPress = true; - e.Handled = true; - Form frm = ParentForm(this); - if (frm != null) - frm.SelectNextControl(this, true, true, true, true); - } - else - { - if (e.Shift) - { - e.SuppressKeyPress = true; - e.Handled = true; - if (!myGrid.SelectPrevCell()) - { - // don't do anything if at top (for now) - } - } - else - { - e.SuppressKeyPress = true; - e.Handled = true; - if (!myGrid.SelectNextCell()) - { - myGrid.MyBorders.InsertRow(myGrid.Rows.Count - 1); - myGrid.Rows.Add(1); - myGrid.SelectNextCell(); - } - } - } - break; - case Keys.Enter: - if (!e.Control && !e.Shift && !e.Alt) - { - OnEnterKeyPressed(sender, e); - } - break; - } - } - private static Form ParentForm(Control ctrl) - { - while (!(ctrl.Parent is Form || ctrl.Parent is EditItem)) - ctrl = ctrl.Parent; - return ctrl.Parent as Form; - } - private void StepRTB_HomeEndPressed(KeyEventArgs keyargs) - { - if (MyItemInfo.IsProcedure || MyItemInfo.IsSection) return; - // Cursor moves out of box only if control is pressed too - otherwise key is - // handled in rtb. - //if (keyargs.Control)MyRTBItem.MyStepPanel.StepCursorKeys(this, keyargs); // Replaced with an event - if (keyargs.Control) OnCursorKeyPress(this, keyargs); - } - private void StepRTB_PageKeyPressed(KeyEventArgs keyargs) - { - if (MyItemInfo.IsProcedure || MyItemInfo.IsSection) return; - //MyRTBItem.MyStepPanel.StepCursorKeys(this, keyargs); Replaced with an event - OnCursorKeyPress(this, keyargs); - } - public void StepRTB_ArrowPressed(E_ArrowKeys key) - { - Point cp = PointToClient(Cursor.Position); - //MyRTBItem.MyStepPanel.CursorMovement(this, cp, key); Replaced with an event - OnCursorMovement(this, new StepRTBCursorMovementEventArgs(cp, key)); - } - private void StepRTB_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) - { - if (!ReadOnly) - { - // add the character with its font depending on the char.... - if (!IsControlChar) - { - string strpressed = null; - if (e.KeyChar == '-') - strpressed = GetAddSymbolText(@"\u8209?"); - else - strpressed = e.KeyChar.ToString(); - if (e.KeyChar >= ' ') - { - LinkLocation ll = FindBetweenLinks(); - if (ll != null && SelectionLength == 0) // SelectionLength = 0 means insert - { - if (e.KeyChar == '}') - strpressed = @"\}"; - else if (e.KeyChar == '{') - strpressed = @"\{"; - InsertCharBetweenLinks(ll, strpressed); // e.KeyChar); - e.Handled = true; - } - else if (SelectionLength != 0) - { - HandleDeleteKeyWithSelectedText(new KeyEventArgs(Keys.None), strpressed); - e.Handled = true; - } - } - if (!e.Handled) - { - if (e.KeyChar == '-') - AddSymbol(@"\u8209?"); - else if (e.KeyChar == '{') - AddRtf(@"\{"); - else if (e.KeyChar == '}') - AddRtf(@"\}"); - else - return; - e.Handled = true; // flag that it's been handled, otherwise, will get 2 chars. - } - if (e.Handled && SelectionLength != 0) SelectionFont = MyStyleFont.WindowsFont; - } - IsControlChar = false; - } - } - private void RtbSendKeys(string keys) - { - Focus(); - SendKeys.Send(keys); // With .Net Framework 3.0 this can be replaced with EditingCommands - // http://msdn.microsoft.com/en-us/library/ms771634.aspx - } - - private void DoDeleteEndBetweenLinks() - { - DebugSelection("Beginning"); - int sstart = SelectionStart; - RtbSendKeys("{RIGHT} "); // open for space between links which separates END/START tokens - SetSelection(sstart, SelectionStart - sstart - 1); // 1 is accounting for typed space - DebugSelection("SetSelection"); - RtbSendKeys("{DELETE}"); // deletes text including link - RtbSendKeys("{RIGHT}{BS}"); // deletes space that was added - } - private void DoDeleteStartBetweenLinks() - { - int slen = SelectionLength; - RtbSendKeys("{LEFT} "); - SetSelection(SelectionStart, slen + 7); - RtbSendKeys("{DELETE}"); - RtbSendKeys("{BS}"); - } - #endregion - #region LinkSelectionAndHandling - public bool IsSelectionLinked(int index, int len) - { - if (_LinkLocations == null)return false; - int sel = index; - int selLength = len; - foreach (LinkLocation ll in _LinkLocations) - { - // When the selector moved to the right of a link, the GOTO button was still lit. - // Removing the "+7" seems to have fixed this. - jsj 1/08/2010 - //if (sel >= ll.Start && sel < ll.Start + ll.Length + 7) return true; - if (sel >= ll.Start && sel < ll.Start + ll.Length) return true; - } - return false; - } - /// - /// For use in Find/Replace. - /// If text is found is part of the link information and not the link value, - /// then we want to continue searching. - /// - /// - /// - /// - public bool SkipLinkInfo(int index, int len) - { - if (_LinkLocations == null)return false; - int sel = index; - int selLength = len; - foreach (LinkLocation ll in _LinkLocations) - { - if (sel >= ll.Start - 7 && sel < ll.Start + ll.Length) - { - int pos = ll.Text.IndexOf("#Link:"); - if (sel < ll.Start || sel >= ll.Start-7+pos) - return (true); - } - } - return false; - } - #endregion - #endregion - #region SelectionStack - Stack _SelectionStack = new Stack(); - public void PushSelection() - { - _SelectionStack.Push(new SelectionData(this)); - } - public void PopSelection() - { - SelectionData selection = _SelectionStack.Pop(); - Select(selection.SelectionStart, selection.SelectionLength); - } - public class SelectionData - { - int _SelectionStart; - public int SelectionStart - { - get { return _SelectionStart; } - set { _SelectionStart = value; } - } - int _SelectionLength; - public int SelectionLength - { - get { return _SelectionLength; } - set { _SelectionLength = value; } - } - public SelectionData(RichTextBox richTextBox) - { - _SelectionStart = richTextBox.SelectionStart; - _SelectionLength = richTextBox.SelectionLength; - } - } - #endregion - #region Link Support - int _ProcessingKeys = 0; - - List _LinkLocations; - public List LinkLocations - { - get { return _LinkLocations; } - } - private int _FALLevel = 0; - private bool _IdentifyingLinks = false; - public void FindAllLinks() - { - if (_IdentifyingLinks || _ProcessingDelete) return; - //DebugPrint("FAL{0}vvvvvvvvvvvvvvvvvvvvvvvvv>>", ++_FALLevel); - _AdjustingSelection = true; - PushSelection(); - FindLinks(); - //IdentifyLinks(); - PopSelection(); - LinkLocation llx = FindLinkLocation(); - if (_CheckSelection) - { - if (llx != null) SetSelection(llx.End, 0); - _CheckSelection = false; - } - _AdjustingSelection = false; - if (!_ProcessingDelete) - OnLinkLocationChanged(this, new EventArgs()); - //DebugPrint("FAL{0}^^^^^^^^^^^^^^^^^^^^^^^^^>>", _FALLevel--); - - } - private void FindLinks() - { - string str = Text; - _LinkLocations = new List(); - MatchCollection matches = Regex.Matches(str, @"", RegexOptions.Singleline); - MatchCollection matchesRtf = Regex.Matches(Rtf, "", RegexOptions.Singleline); - LinkLocation thisLink = null; - for (int i = 0; i < matches.Count; i++) //each (Match match in matches) - { - Match match = matches[i]; - Match matchrtf = matchesRtf[i]; - thisLink = new LinkLocation(match.Index + 7, // If the [END> is immediately followed by "); - foreach (LinkLocation ll in _LinkLocations) - if (ll.Start == start && ll.StartsBetween) - return ll; - return null; - } - private LinkLocation FindLinkLocation() - { - return FindLinkLocation(SelectionStart); - } - private LinkLocation FindLinkLocation(int sel) - { - //DebugPrint("FL----------------Location>"); - if (_LinkLocations == null) return null; - foreach (LinkLocation ll in _LinkLocations) - { - // Moving right: - // if less than, allows stopping between two links - if (ll.Start < sel && ll.End > sel) - { - DebugPrint("Greater Than {0} {1} {2}", sel, ll.Start, ll.End); - return ll; - } - // if less than or equal, does not stop between two links - if ((!ll.StartsBetween) && ll.Start <= sel && ll.End > sel) - { - DebugPrint("Greater Than or Equal {0} {1} {2}", sel, ll.Start, ll.End); - return ll; - } - } - return null; - } - public DialogResult ReplaceText(string rpltxt, string fndstr, bool caseSensitive, bool matchWholeWord, bool reverse, bool prompt, IWin32Window fndrpldlg) - { - DialogResult dlgrslt = DialogResult.Yes; - if (SelectionLength > 0) - { - if (IsSelectionLinked(SelectionStart, SelectionLength)) - { - MessageBox.Show(fndrpldlg,"Cannot replace linked text!", "Find/Replace"); - dlgrslt = DialogResult.No; - } - else - { - if (prompt) - dlgrslt = MessageBox.Show(fndrpldlg,"Replace This Occurence?", "Replace Text", MessageBoxButtons.YesNoCancel); - if (dlgrslt == DialogResult.Yes) - SelectedText = rpltxt; - } - } - return dlgrslt; - } - private RichTextBoxFinds _FindOptions = RichTextBoxFinds.None; - public bool FindText(string str, bool caseSensitive, bool matchWholeWord, bool reverse) - { - StepRTB savRTF = new StepRTB(); - int startpos = SelectionStart + SelectionLength; - savRTF.Text = this.Text; - - _FindOptions = RichTextBoxFinds.None; - if (caseSensitive) - _FindOptions |= RichTextBoxFinds.MatchCase; - if (matchWholeWord) - _FindOptions |= RichTextBoxFinds.WholeWord; - if (reverse) - { - _FindOptions |= RichTextBoxFinds.Reverse; - savRTF.Text = this.Text.Substring(0, SelectionStart); - startpos = savRTF.Text.Length; - if (startpos == 0) - return false; // at beginning of rtfbox during a reverse find - } - else - { - if (startpos >= savRTF.Text.Length) - return false; // at end of rtfbox during a forward find - } - // look for the find string in the temporary rtfbox - // then set the cursor selection in the real rtfbox - bool keepgoing = true; - while (keepgoing) - { - int pos = savRTF.Find(str, startpos, _FindOptions); - keepgoing = false; - if (pos >= 0) - { - if (this.SkipLinkInfo(pos, str.Length)) - { - if (reverse) - { - startpos--; - savRTF.Text = savRTF.Text.Substring(0, startpos); - } - else - startpos++; - if (startpos > 0 && startpos < savRTF.Text.Length) - keepgoing = true; - } - else - { - SelectionStart = pos; - SelectionLength = str.Length; - } - } - else - return false; - } - return true; - } - private int FindStart() - { - foreach (LinkLocation ll in _LinkLocations) - { - if (SelectionStart == ll.End) return ll.Start; - if (SelectionStart == ll.Start) - { - if (ll.Start == 7) return 7; - return ll.Start - 8; - } - } - if (SelectionStart > 0) return SelectionStart - 1; - return 0; - } - private int FindEnd() - { - foreach (LinkLocation ll in _LinkLocations) - { - if (SelectionStart + SelectionLength + 7 == ll.Start) return ll.Length + 7; - // this is for in-between links - if (SelectionStart + SelectionLength == ll.Start) return ll.Length; - } - if (SelectionStart + SelectionLength < TextLength) return 1; - return 0; - } - private int FindEndDown() - { - foreach (LinkLocation ll in _LinkLocations) - { - if (SelectionStart + SelectionLength >= ll.Start && SelectionStart + SelectionLength <= ll.End) return ll.End; - } - return 0; - } - private int FindStartUp() - { - foreach (LinkLocation ll in _LinkLocations) - { - if ((SelectionStart >= ll.Start) && (SelectionStart <= ll.End)) return ll.Start; - } - return -1; - } - public void SetSelection(LinkLocation ll) - { - SetSelection(ll.Start, ll.Length); - } - public void SetSelection(int locStart, int locLength) - { - //Application.DoEvents(); // Not needed since SendKeys is always done last. - if (_IdentifyingLinks) - DebugPrint("SS------------------------> {0} {1}", locStart, locLength); - else - DebugPrint("SS========================> {0} {1}", locStart, locLength); - Select(locStart, locLength); - } - #endregion - //#region FontAndStylesSupport - //private void ToggleFontStyle(FontStyle style, bool att_on) - //{ - // int start = SelectionStart; - // int len = SelectionLength; - // System.Drawing.Font currentFont; - // FontStyle fs; - // for (int i = 0; i < len; ++i) - // { - // Select(start + i, 1); - // currentFont = SelectionFont; - // fs = currentFont.Style; - // //add or remove style - // if (!att_on)fs = fs | style; - // else fs = fs & ~style; - - // SelectionFont = new Font( - // currentFont.FontFamily, - // currentFont.Size, - // fs - // ); - // } - //} - /// - /// Returns a Font with: - /// 1) The font applying to the entire selection, if none is the default font. - /// 2) The font size applying to the entire selection, if none is the size of the default font. - /// 3) A style containing the attributes that are common to the entire selection, default regular. - /// - /// - //public Font GetFontDetails() - //{ - // //This method should handle cases that occur when multiple fonts/styles are selected - - // int start = SelectionStart; - // int len = SelectionLength; - // int TempStart = 0; - - // if (len <= 1) - // { - // // Return the selection or default font - // if (SelectionFont != null) - // return SelectionFont; - // else - // return Font; // should be default from format. - // } - - // // Step through the selected text one char at a time - // // after setting defaults from first char - // _rtbTemp.Rtf = SelectedRtf; - - // //Turn everything on so we can turn it off one by one - // FontStyle replystyle = - // FontStyle.Bold | FontStyle.Italic | FontStyle.Underline; - - // // Set reply font, size and style to that of first char in selection. - // _rtbTemp.Select(TempStart, 1); - // string replyfont = _rtbTemp.SelectionFont.Name; - // float replyfontsize = _rtbTemp.SelectionFont.Size; - // replystyle = replystyle & _rtbTemp.SelectionFont.Style; - - // // Search the rest of the selection - // for (int i = 1; i < len; ++i) - // { - // _rtbTemp.Select(TempStart + i, 1); - - // // Check reply for different style - // replystyle = replystyle & _rtbTemp.SelectionFont.Style; - - // // Check font - // if (replyfont != _rtbTemp.SelectionFont.FontFamily.Name) - // replyfont = ""; - - // // Check font size - // if (replyfontsize != _rtbTemp.SelectionFont.Size) - // replyfontsize = (float)0.0; - // } - - // // Now set font and size if more than one font or font size was selected - // if (replyfont == "") - // replyfont = _rtbTemp.Font.FontFamily.Name; - - // if (replyfontsize == 0.0) - // replyfontsize = _rtbTemp.Font.Size; - - // // generate reply font - // Font reply - // = new Font(replyfont, replyfontsize, replystyle); - - // return reply; - //} - //#endregion - #region EnumsSelectionRange - private enum StartStatus : int - { - Before = 100, - Between = 200, - StartLink = 300, - StartBox = 400 - }; - private enum EndStatus : int - { - After = 1, - Between = 2, - EndLink = 3, - EndBox = 4, - StartLink = 5 - }; - public enum RangeStatus : int - { - NoContainedLinks = 0, - Before_After = StartStatus.Before + EndStatus.After, - Before_Between = StartStatus.Before + EndStatus.Between, - Before_EndLink = StartStatus.Before + EndStatus.EndLink, - Before_EndBox = StartStatus.Before + EndStatus.EndBox, - Before_StartLink = StartStatus.Before + EndStatus.StartLink, - Between_After = StartStatus.Between + EndStatus.After, - Between_Between = StartStatus.Between + EndStatus.Between, - Between_EndLink = StartStatus.Between + EndStatus.EndLink, - Between_EndBox = StartStatus.Between + EndStatus.EndBox, - Between_StartLink = StartStatus.Between + EndStatus.StartLink, - StartLink_After = StartStatus.StartLink + EndStatus.After, - StartLink_Between = StartStatus.StartLink + EndStatus.Between, - StartLink_EndLink = StartStatus.StartLink + EndStatus.EndLink, - StartLink_EndBox = StartStatus.StartLink + EndStatus.EndBox, - StartLink_StartLink = StartStatus.StartLink + EndStatus.StartLink, - StartBox_After = StartStatus.StartBox + EndStatus.After, - StartBox_Between = StartStatus.StartBox + EndStatus.Between, - StartBox_EndLink = StartStatus.StartBox + EndStatus.EndLink, - StartBox_EndBox = StartStatus.StartBox + EndStatus.EndBox, - StartBox_StartLink = StartStatus.StartBox + EndStatus.StartLink - }; - private RangeStatus _RTBRangeStatus; - public RangeStatus RTBRangeStatus - { - get { return _RTBRangeStatus; } - set - { - _RTBRangeStatus = value; - if (!_ProcessingDelete) OnRTBRangeStatusChanged(this, new EventArgs()); - } - } - private LinkLocation _RangeStartLink = null; - private LinkLocation _RangeEndLink = null; - public RangeStatus FindRangeStatus() - { - _RangeStartLink = null; - _RangeEndLink = null; - if (_LinkLocations == null || _LinkLocations.Count == 0) - { - return RTBRangeStatus = RangeStatus.NoContainedLinks; - } - LinkLocation foundLink = null; - int start = SelectionStart; - int end = start + SelectionLength; - - foreach (LinkLocation ll in _LinkLocations) - { - if (foundLink == null && ((ll.Start >= start && ll.Start < end) || (ll.End >= start && ll.End < end))) - foundLink = ll; - if (_RangeStartLink == null && start >= ll.Start - 7 && start < ll.End) - _RangeStartLink = ll; - if (_RangeEndLink == null && end >= ll.Start && end <= ll.End) - _RangeEndLink = ll; - } - DebugPrint("SelectionStart {0}, SelectionEnd {1}, TextLength {2}", - SelectionStart, SelectionStart + SelectionLength, - TextLength); - //if (_RangeStartLink != null) - // _RangeStartLink.Show("startLink"); - //if (_RangeEndLink != null) - // _RangeEndLink.Show("endLink"); - //if (foundLink != null) - // foundLink.Show("foundLink"); - - if (foundLink == null) - return RTBRangeStatus = RangeStatus.NoContainedLinks; - - StartStatus myStartStatus = StartStatus.Before; - EndStatus myEndStatus = EndStatus.After; - if (_RangeStartLink != null) - { - if (_RangeStartLink.Start == 7) - myStartStatus = StartStatus.StartBox; - else if (_RangeStartLink.StartsBetween) - myStartStatus = StartStatus.Between; - else - myStartStatus = StartStatus.StartLink; - } - if (_RangeEndLink != null) - { - if (_RangeEndLink.End == TextLength) - myEndStatus = EndStatus.EndBox; - else if (_RangeEndLink.NextStart == _RangeEndLink.End) - myEndStatus = EndStatus.Between; - else if (end == _RangeEndLink.Start) - myEndStatus = EndStatus.StartLink; // Should not happen because of code in HandleSelectionChange - else //if (end == endLink.End) - myEndStatus = EndStatus.EndLink; - } - return RTBRangeStatus = (RangeStatus)((int)myStartStatus + (int)myEndStatus); - } - #endregion - #region OutlineTable - private string _CheckRight = "-\u2500\u2011"; - public string CheckRight - { - get { return _CheckRight; } - set { _CheckRight = value; } - } - private string _CheckAbove = "|\u2502\u2514\u252c\u253c\u251c\u250c\u2534\u2510\u2524"; - public string CheckAbove - { - get { return _CheckAbove; } - set { _CheckAbove = value; } - } - private string _CheckLeft = "-\u2500\u2524\u252c\u251c\u253c\u250c\u2510\u2514\u2011"; - public string CheckLeft - { - get { return _CheckLeft; } - set { _CheckLeft = value; } - } - private string _CheckBelow = "|\u2502"; - public string CheckBelow - { - get { return _CheckBelow; } - set { _CheckBelow = value; } - } - // This is a table of graphics characters - // The index into this table (0-15) is a bitmask with each bit representing - // a different direction from the current character. - // Right is Bit 0 (0 or 1) - // Above is Bit 1 (0 or 2) - // Left is Bit 2 (0 or 4) - // Below is Bit 3 (0 or 8) - // The index is contolled in the following way: - // If there is a graphics character to the right, then you add 1 - // If there is a graphics character above, then you add 2 - // If there is a graphics character left, then you add 4 - // If there is a graphics character below, then you add 8 - // The total results in an index into this array and gives the appropriate character - // combining horizontal and vertical lines. - - static private string [] TableCharsU = { - "\x0", // HEX"\x0", // No character - @"\u9472", // HEX@"\u2500",// - Horizontal line - 16-bit char: '\xC4' - @"\u9474", // HEX@"\u2502",// | Vertical line - 16-bit char: '\xB3' - @"\u9492", // HEX@"\u2514",// L Bottom Left corner - 16-bit char: '\xC0' - @"\u9472", // HEX@"\u2500",// - Horizontal line - 16-bit char: '\xC4' - @"\u9472", // HEX@"\u2500",// - Horizontal line - 16-bit char: '\xC4' - @"\u9496", // HEX@"\u2518",// Bottom Right Corner - 16-bit char: '\xD9' - @"\u9524", // HEX@"\u2534",// Bottom Tee - 16-bit char: '\xC1' - @"\u9474", // HEX@"\u2502",// | Vertical Bar - 16-bit char: '\xB3' - @"\u9484", // HEX@"\u250c",// Upper Left corner - 16-bit char: '\xDA' - @"\u9474", // HEX@"\u2502",// | Vertical Bar - 16-bit char: '\xB3' - @"\u9500", // HEX@"\u251c",// Left Tee - 16-bit char: '\xC3' - @"\u9488", // HEX@"\u2510",// Upper Right corner - 16-bit char: '\xBF' - @"\u9516", // HEX@"\u252c",// T Top Tee - 16-bit char: '\xC2' - @"\u9508", // HEX@"\u2524",// Right Tee - 16-bit char: '\xB4' - @"\u9532", // HEX@"\u253c" // + Plus - 16-bit char: '\xC5' - }; - - private int MaxCharacterWidth() - { - // loop through lines and get the width in characters - int w = 0; - foreach (string line in Lines) - { - string cleanLine = RemoveLinkComments(line); - if (w < cleanLine.Length) - w = cleanLine.Length; - } - return w; - } - internal static string RemoveLinkComments(string line) - { - StringBuilder sb = new StringBuilder(); - int lastIndex = 0; - MatchCollection mc = Regex.Matches(line, @""); - foreach (Match m in mc) - { - sb.Append(line.Substring(lastIndex, m.Index - lastIndex)); // Append text before the link - sb.Append(m.Groups[1].Value); // Append the text portion of the link - lastIndex = m.Index + m.Length; // Calculate the beginning of the remaining text - } - sb.Append(line.Substring(lastIndex)); // Append the text following the last link - string result = sb.ToString(); - result = result.Replace(@""); - if (mcEnd.Count > 0) - { - result = result.Substring(0, mcEnd[0].Index) + result.Substring(mcEnd[0].Index + mcEnd[0].Length); - } - return result; - } - private void ReplaceLinesInTable(bool withBorder) - { - int rowWidth = Lines[0].Length; - for (int row=1;row"); //, RegexOptions.Singleline); - if (matchCollection.Count == 0) matchCollection = Regex.Matches(line, @""); - Match match = matchCollection.Count > 0 ? matchCollection[0] : null; - int matchOffset = 0; - for (int col = 1; col < rowWidth - 1; col++) - { - if (match != null && match.Index == matchOffset + col) - { - matchOffset += match.Length - match.Groups[1].Length; // Increment the offset by the link comment length - col += match.Groups[1].Length; // increment the column by the link value length - if (col >= rowWidth - 1) break;// Don't continue if beyond the contents - match = match.NextMatch(); // Watch for the next match - } - int coll = matchOffset + col; - char chr = line[coll]; - char chrLast = line[coll - 1]; - char chrNext = line[coll + 1]; - char chrAbove = lineAbove[col]; - char chrBelow = lineBelow[col]; - // The following is all using symbol font (either unicode for proportional or - // VeSymbFix for fixed font): - // if this character is a table line draw character, i.e. a dash or vertical bar, or - // graphics characters for those, look around it to see what table character it is - // replaced with - - // Look for -||-- (last three are graphics chars or unicode dash) - if ("-|\u2500\u2502\u2011".IndexOf(chr) > -1) - { - bool horizontalCharacter = "-\u2500\u2011".IndexOf(chr) > -1; - int lineDrawRight = (CheckRight.IndexOf(chrNext) > -1 || (horizontalCharacter && "\u2502".IndexOf(chrNext) > -1)) ? 1 : 0; - int lineDrawAbove = (CheckAbove.IndexOf(chrAbove) > -1 || (!horizontalCharacter && "\u2500\u2011".IndexOf(chrAbove) > -1)) ? 2 : 0; - int lineDrawLeft = (CheckLeft.IndexOf(chrLast) > -1 || (horizontalCharacter && "\u2502".IndexOf(chrLast) > -1)) ? 4 : 0; - int lineDrawBelow = (CheckBelow.IndexOf(chrBelow) > -1 || (!horizontalCharacter && "-\u2500\u2011".IndexOf(chrBelow) > -1)) ? 8 : 0; - int tableCharIndx = lineDrawRight + lineDrawAbove + lineDrawLeft + lineDrawBelow; - if (tableCharIndx > 0) - { - SetTableChar(row, coll, tableCharIndx); - if (withBorder) // Adjust the border as it intersects with lines within the box - { - if (row == 1 && !horizontalCharacter ) SetTableChar(row - 1, col, 13); // Top Row - if (row == Lines.Length - 2 && !horizontalCharacter) SetTableChar(row + 1, col, 7); // Bottom Row - if (col == 1 && horizontalCharacter && ((tableCharIndx & 4)==4)) SetTableChar(row, col - 1, 11); // First Column - if (col == rowWidth - 2 && horizontalCharacter && ((tableCharIndx & 1) == 1)) SetTableChar(row, coll + 1, 14); // Last Column - } - } - } - } - } - } - private void SetTableChar(int row, int col, int tableCharIndx) - { - int rowOffset = GetFirstCharIndexFromLine(row); - Select(rowOffset + col, 1); - string charToBeReplaced = SelectedText; - if (Text.Length > (rowOffset + col + 7) && Text.Substring(rowOffset + col + 1, 6) != "#Link:") - SelectedRtf = RtfPrefixForSymbols + TableCharsU[tableCharIndx] + "?}"; - else - { - SelectionStart++; - int lenComment = 1 + SelectionStart - (rowOffset + col); - //Console.WriteLine("{0},{1},{2}", rowOffset + col, SelectionStart, SelectionLength); - Select(rowOffset + col, 0); - SelectedRtf = RtfPrefixForSymbols + TableCharsU[tableCharIndx] + "?}"; - Select(rowOffset + col, lenComment); - //Console.WriteLine("'{0}',{1},{2},{3}", SelectedText, lenComment, SelectionLength, SelectionStart); - //Console.WriteLine("'{0}'", SelectedRtf); - SelectedRtf = SelectedRtf.Replace(" " + charToBeReplaced, ""); - } - } - #endregion - #region SpellChecker - // We made the Spell Checker method a static so that all of the StepRTB boxes will bare the same instance of the dictionary. - // This allow all the StepRTB's to automatically update when a new word is added. - private static C1.Win.C1SpellChecker.C1SpellChecker _C1SpellChecker2; - - private static C1.Win.C1SpellChecker.C1SpellChecker C1SpellChecker2 - { - get - { - if (_C1SpellChecker2 == null) - { - _C1SpellChecker2 = new C1.Win.C1SpellChecker.C1SpellChecker(); - _C1SpellChecker2.ContextMenuCreated += new C1.Win.C1SpellChecker.ContextMenuEventHandler(_C1SpellChecker2_ContextMenuCreated); - // The veproms.dct file is the main spell checker dictionary. - // We edited the C1 dictionary (C:\Program Files\ComponentOne\Dictionaries\C1Spell_en-US.dct) using ComponentOne's - // dictionary editor (C:\Program Files\ComponentOne\Studio for WinForms\C1SpellChecker\C1DictionaryEditor.exe) - // and added the veproms.words list as another word list in the dictionary. We saved the resulting file as veproms.dct. - string dictpath = string.Format(@"{0}\veproms.dct", Application.StartupPath); - - // Only use the veproms.dct if it is found in the BIN folder. Otherwise, let it default to use the standard dictionary. - if (File.Exists(dictpath)) - _C1SpellChecker2.MainDictionary.FileName = dictpath; // looks in the bin folder by default - - // NOTE: By default, a "Custom.dct" file (UserDictionary) will be created in the BIN folder when a user adds words to the - // spell checker dictionary. The words that the user adds are not placed in the Volian.dct file. - //_C1SpellChecker2.UserDictionary.FileName = @"C:\Development\proms\VEPROMS User Interface\bin\Debug\MYDictionary.dct"; - } - return StepRTB._C1SpellChecker2; - } - } - - // Get or Save our context menu - // This is added to the the spell checker's context menu for a mis-spelled word - private static ContextMenuStrip _ThisContextMenuStrip; - public ContextMenuStrip ThisContextMenuStrip - { - get { return _ThisContextMenuStrip; } - set { _ThisContextMenuStrip = value; } - } - - private static StepRTB _ContextMenuStepRTB; - private static object _ContextMenuStrip; - - static void _C1SpellChecker2_ContextMenuCreated(object sender, C1.Win.C1SpellChecker.ContextMenuEventArgs e) - { - // Adjust their bad word context menu - //Console.WriteLine("==========> spell check context menu {0}",e.Menu.Items[0].Text); - if (e.Menu.Equals(_ContextMenuStrip)) - { - // Add an item for our "Edit Menu" context menu on their spell check context menu - // This gives the user access to our regular context menu when on a mis-spelled word - ToolStripItem tsi = e.Menu.Items.Add("Edit Menu"); - tsi.Click += new EventHandler(tsi_Click); - //Now replace their "Spell" item with ours, so that we can display our custom spell check dialog - for (int i = 0; i < e.Menu.Items.Count; i++) - { - ToolStripItem tsi1 = e.Menu.Items[i]; - if (tsi1 is ToolStripMenuItem && tsi1.Text == "Spell") - { - e.Menu.Items.RemoveAt(i); // remove their spell check dialog item - ToolStripMenuItem tsi2 = new ToolStripMenuItem("Spell"); - tsi2.Click += new EventHandler(tsi2_Click); - e.Menu.Items.Insert(i, tsi2); // add our spell check dialog item - } - } - } - } - - static void tsi2_Click(object sender, EventArgs e) - { - C1SpellChecker2.CheckControl(_ContextMenuStepRTB, true, MySpellCheckDlg); - } - - // Click event to display our "Edit Menu" (StepRTB context menu) - static void tsi_Click(object sender, EventArgs e) - { - ToolStripMenuItem tsmi = sender as ToolStripMenuItem; - //_ContextMenuStepRTB.MyRTBItem.MyStepPanel.MyStepTabPanel.MyStepTabRibbon.OpenContextMenu(tsmi.Owner.Location); - _ContextMenuStepRTB.OnOpenContextMenu(sender, new StepRTBLocationEventArgs(tsmi.Owner.Location)); - } - - // This is our customized Spell Check dialog - // This is display when the use clicks the Spell button from the Ribbon - // or when the "Spell" item is selected from the context menu when on a mis-spelled word - static VlnSpellCheckDlg _MySpellCheckDlg; - public static VlnSpellCheckDlg MySpellCheckDlg - { - get - { - if (_MySpellCheckDlg == null) - _MySpellCheckDlg = new VlnSpellCheckDlg(); - return _MySpellCheckDlg; - } - } - - // This is used when walking through the section doing a spell check - // (from the Spell button on the ribbon) - public bool SpellCheckNext() - { - int nBad = C1SpellChecker2.CheckControl(this, false, MySpellCheckDlg); - return (nBad >= 0); // nBad = -1 means user pressed Cancel button - } - - // This allows us to turn off/on the specll check context menu when we toggle in and out of View Mode. - // see btnToggleEditView_Click() in StepTabRibbon.cs - public void SpellCheckContextMenuOn(bool turnOnMenu) - { - C1SpellChecker2.Options.ShowSuggestionsInContextMenu = turnOnMenu; - } - #endregion - #region - public string DoNewLinkInGridCell() - { - // first find the new link and determine whether it's RO or transition. - int indx = Rtf.IndexOf(@"#Link:ReferencedObject:"); - if (indx > 0) - { - Match mro = Regex.Match(Rtf.Substring(indx, Rtf.Length - indx), @"([A-Za-z]*):(.*)\[END>"); - string linkstr = mro.Groups[2].Value; - string[] roparts = linkstr.Split(" ".ToCharArray()); - ContentRoUsage rousg = null; - int oldid = -1; - using (Item itm = MyItemInfo.Get()) - { - using (RODb rodb = RODb.GetJustRoDb(Convert.ToInt32(roparts[2]))) - { - rousg = itm.MyContent.ContentRoUsages.Add(roparts[1], rodb); - } - oldid = rousg.ROUsageID; - Rtf = Rtf.Replace("", string.Format("", rousg.ROUsageID)); - itm.Save(); - Rtf = Rtf.Replace(string.Format("", oldid), rousg.ROUsageID.ToString()); - itm.Save(); - MyItemInfo.MyContent.RefreshContentRoUsages(); - } - } - // Need to look for any 'New' transitions, don't include existing ones. - Match mt = Regex.Match(Rtf, @"#Link:Transition:([0-9]+) "); - if (mt.Length <= 0) mt = Regex.Match(Rtf, @"#Link:TransitionRange:([0-9]+) "); - if (mt.Length > 0) - { - indx = mt.Index+6; // get past '#Link:" - Match m = Regex.Match(Rtf.Substring(indx, Rtf.Length - indx), @"([A-Za-z]*):(.*)\[END>"); - bool isSingleTran = true; - if (Rtf.Substring(indx, 16).IndexOf("TransitionRange") >= 0) isSingleTran = false; - string linkstr = m.Groups[2].Value; - string[] tparts = linkstr.Split(" ".ToCharArray()); - int type = System.Convert.ToInt32(tparts[0]); - int tr1 = System.Convert.ToInt32(tparts[2]); // tparts[2] is token for tranid - int tr2 = tr1; - if (tparts.Length > 3) - tr2 = System.Convert.ToInt32(tparts[3]); // tparts[3] is token for rangeid - bool dispose1 = false; - Item itm1 = null; - bool dispose2 = false; - Item itm2 = null; - using (Item itm = MyItemInfo.Get()) - { - if (itm.ItemID == tr1) - itm1 = itm; // a transition that points to itself should not dispose - else - { - dispose1 = true; - itm1 = Item.Get(tr1); - } - if (itm.ItemID == tr2) - itm2 = itm; // a transition that points to itself should not dispose - else if (tr1 == tr2) - itm2 = itm1; // if both destinations are the same only dispose the first one - else - { - dispose2 = true; - itm2 = Item.Get(tr2); - } - ContentTransition ct = itm.MyContent.ContentTransitions.Add(itm1, itm2); - //Console.WriteLine("CT {0},{1},{2},{3}", ct.TransitionID, itm.ItemID, itm.MyContent.MyContentUnique, itm.MyContent.ContentTransitions.Count); - ct.TranType = type; - if (isSingleTran) - ct.IsRange = 0; - else if (tr1 != tr2) - ct.IsRange = 1; - else - ct.IsRange = 2; - - int oldidt = ct.TransitionID; - Rtf = Rtf.Replace("", string.Format("", ct.TransitionID)); - itm.Save(); - Rtf = Rtf.Replace(string.Format("", oldidt), ct.TransitionID.ToString()); - itm.Save(); - MyItemInfo.MyContent.RefreshContentTransitions(); - } - - if (dispose2) itm2.Dispose(); - if (dispose1) itm1.Dispose(); - } - return Rtf; - } - #endregion - #region RoInsertInterface - public void UpdateStepRtb(string linktxt, string valtxt) - { - int ss = SelectionStart; // Remember where the link is being added - int sl = SelectionLength; - OnReturnToEditor(this, new EventArgs()); - Select(ss, sl); - InsertRO(valtxt, linktxt); // Insert the LINK - OnDoSaveContents(this, new EventArgs()); // .SaveText(); // Save the text with the LINK - This also moves the cursor to the end of the text - // By selecting a starting position within a link, StepRTB (HandleSelectionChange) will select the link - Select(ss + 7 + valtxt.Length, 0);// Select the link, Try 7 for " 0) - MyLookup = _MyDVI.DocVersionAssociations[0].MyROFst.ROFSTLookup; - else - MyLookup = null; - return _MyDVI; - } - return null; - } - } - private ItemInfo MyItemInfo - { - get - { - if(_MyStepRTB != null && _MyStepRTB.MyItemInfo != null) return _MyStepRTB.MyItemInfo; - if(_MyEditItem != null && _MyEditItem.MyItemInfo != null) return _MyEditItem.MyItemInfo; - return null; - } - } - private DevComponents.DotNetBar.ButtonItem _DefaultContextMenu; - - public void ClearContextMenu() - { - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, null); - } - - #region Save ROs from Word Document jcb 20121221 - private string MyLookupData; - private Dictionary MyAvailableROs; - public void SetContextMenu() - { - AddWROContext(btnCMRtfEdit); - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit); - } - - #region set up save ro menu jcb 20121221 - private void AddWROContext(DevComponents.DotNetBar.ButtonItem myButtonItem) - { - MyAvailableROs = new Dictionary(); - DevComponents.DotNetBar.BaseItem btnSaveRO = null; - if (!myButtonItem.SubItems.Contains("btnSaveRO")) - { - btnSaveRO = new DevComponents.DotNetBar.ButtonItem("btnSaveRO", "Save RO"); - btnSaveRO.Visible = false; - myButtonItem.SubItems.Add(btnSaveRO); - } - else - btnSaveRO = myButtonItem.SubItems["btnSaveRO"]; - if (Clipboard.ContainsData(System.Windows.Forms.DataFormats.Text)) - { - MyLookupData = Clipboard.GetData(System.Windows.Forms.DataFormats.Text).ToString(); - if (MyLookupData.StartsWith(" 0 && MyStepRTB.SelectedText.ToLower() != MyAvailableROs[k].ToLower()) - { - btn = new DevComponents.DotNetBar.ButtonItem("_" + k, MyAvailableROs[k] + " with Annotation"); - btn.Tag = MyAvailableROs[k]; - btn.Click += new EventHandler(SaveROWithAnnotation_Click); - btnSaveRO.SubItems.Add(btn); - } - } - btnSaveRO.Visible = true; - } - else - { - btnSaveRO.SubItems.Clear(); - btnSaveRO.Text = "No RO Found"; - DevComponents.DotNetBar.BaseItem btn = new DevComponents.DotNetBar.ButtonItem("btnRONotFound", "Create Annotation"); - btn.Tag = string.Format("Text '{0}' has no corresponding RO", MyStepRTB.SelectedText); - btn.Click += new EventHandler(NoROFound_Click); - btnSaveRO.SubItems.Add(btn); - btnSaveRO.Visible = true; - } - } - } - } - #endregion - private bool IsValidRO(string data) - { - bool rv = false; - MyAvailableROs = new Dictionary(); - if (MyDVI != null) - { - #region force arp without hi or lo jcb 20121221 - //if (data == "") - //{ - // data = data.Replace("-LO1", ""); - // Console.WriteLine("force null roc"); - //} - #endregion - string accPageID = GetAccPageID(data); - ROFSTLookup.rochild? roc = MyLookup.GetRoChildByAccPagID(accPageID, MyDVI.DocVersionConfig.RODefaults_setpointprefix, MyDVI.DocVersionConfig.RODefaults_graphicsprefix); - if (roc != null) - { - int index = GetROValueIndex(data); - if (index > -1) - { - MyAvailableROs.Add(((ROFSTLookup.rochild)roc).children[index].roid, ((ROFSTLookup.rochild)roc).children[index].value.Replace(@"\u160?", " ")); - if (accPageID.StartsWith("MEL") && index == 0) // If equipment and 1st return value, then add option to add 4th Return Value - { - MyAvailableROs.Add(((ROFSTLookup.rochild)roc).children[3].roid, ((ROFSTLookup.rochild)roc).children[3].value.Replace(@"\u160?", " ")); - MyAvailableROs.Add(((ROFSTLookup.rochild)roc).children[4].roid, ((ROFSTLookup.rochild)roc).children[4].value.Replace(@"\u160?", " ")); - } - rv = true; - } - } - else - { - //see if arp then try HI 1,2,3 and LO 1,2,3 - if (accPageID.StartsWith("ARP")) - { - string tmpAccPageID = string.Empty; - //try HI1,2,3 - string suffix = "-HI"; - for (int i = 1; i < 4; i++) - { - tmpAccPageID = accPageID + suffix + i.ToString(); - roc = MyLookup.GetRoChildByAccPagID(tmpAccPageID, MyDVI.DocVersionConfig.RODefaults_setpointprefix, MyDVI.DocVersionConfig.RODefaults_graphicsprefix); - if (roc != null) - { - int index = GetROValueIndex(data); - if (index > -1) - { - MyAvailableROs.Add(((ROFSTLookup.rochild)roc).children[index].roid, ((ROFSTLookup.rochild)roc).children[index].value.Replace(@"\u160?", " ")); - rv = true; - } - } - } - //try LO1,2,3 - suffix = "-LO"; - for (int i = 1; i < 4; i++) - { - tmpAccPageID = accPageID + suffix + i.ToString(); - roc = MyLookup.GetRoChildByAccPagID(tmpAccPageID, MyDVI.DocVersionConfig.RODefaults_setpointprefix, MyDVI.DocVersionConfig.RODefaults_graphicsprefix); - if (roc != null) - { - int index = GetROValueIndex(data); - if (index > -1) - { - MyAvailableROs.Add(((ROFSTLookup.rochild)roc).children[index].roid, ((ROFSTLookup.rochild)roc).children[index].value.Replace(@"\u160?", " ")); - rv = true; - } - } - } - } - } - } - return rv; - } - private string GetAccPageID(string txt) - { - // - // - // - txt = txt.Replace(" 0) - rv = 0; - else if (data.IndexOf(@"\s") > 0) - rv = 1; - else if (data.IndexOf(@"\t") > 0) - rv = 2; - else if (data.IndexOf(@"\d") > 0) - rv = 3; - else - rv = -1; - } - if (data.StartsWith(" 0) - rv = 0; - else if (data.IndexOf(@"\d") > 0) - rv = 1; - else if (data.IndexOf(@"\r") > 0) - rv = 2; - else - rv = -1; - } - if (data.StartsWith(" 0) - rv = 0; - else if (data.IndexOf(@"\d") > 0) - rv = 1; - else if (data.IndexOf(@"\n") > 0) - rv = 2; - else - rv = -1; - } - return rv; - } - private void SaveRO_Click(object sender, EventArgs e) - { - DevComponents.DotNetBar.BaseItem btn = sender as DevComponents.DotNetBar.BaseItem; - string myroid = btn.Name; - string myvalue = btn.Tag.ToString(); - // the roid may be 12 or 16 chars long, with the last 4 set if there is unit specific - // menuing. Pad to 12 to store in the rousage table. - string padroid = (myroid.Length <= 12) ? myroid + "0000" : myroid; - string linktxt = string.Format(@"#Link:ReferencedObject: {0} {1}", padroid, MyLookup.DocVersionInfo.DocVersionAssociations[0].MyROFst.MyRODb.RODbID); - // Resolve symbols and scientific notation in the RO return value - string valtxt = MyLookup.GetTranslatedRoValue(padroid, MyStepRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta); //ConvertSymbolsAndStuff(selectedChld.value); - MyStepRTB.OnRoInsert(this, new StepRTBRoEventArgs(valtxt, myvalue, linktxt, padroid, MyLookup.DocVersionInfo.DocVersionAssociations[0].MyROFst.MyRODb.RODbID)); - } - private void SaveROWithAnnotation_Click(object sender, EventArgs e) - { - DevComponents.DotNetBar.BaseItem btn = sender as DevComponents.DotNetBar.BaseItem; - string myroid = btn.Name.Replace("_", ""); - string myvalue = btn.Tag.ToString(); - using (Item itm = MyStepRTB.MyItemInfo.Get()) - { - Annotation x = Annotation.MakeAnnotation(itm, AnnotationType.GetByName("RO Value Changed"), null, string.Format("RO Value '{0}' replaces text '{1}'", myvalue, MyStepRTB.SelectedText), null); - } - // the roid may be 12 or 16 chars long, with the last 4 set if there is unit specific - // menuing. Pad to 12 to store in the rousage table. - string padroid = (myroid.Length <= 12) ? myroid + "0000" : myroid; - string linktxt = string.Format(@"#Link:ReferencedObject: {0} {1}", padroid, MyLookup.DocVersionInfo.DocVersionAssociations[0].MyROFst.MyRODb.RODbID); - // Resolve symbols and scientific notation in the RO return value - string valtxt = MyLookup.GetTranslatedRoValue(padroid, MyStepRTB.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.ConvertCaretToDelta); //ConvertSymbolsAndStuff(selectedChld.value); - MyStepRTB.OnRoInsert(this, new StepRTBRoEventArgs(valtxt, myvalue, linktxt, padroid, MyLookup.DocVersionInfo.DocVersionAssociations[0].MyROFst.MyRODb.RODbID)); - } - private void NoROFound_Click(object sender, EventArgs e) - { - DevComponents.DotNetBar.BaseItem btn = sender as DevComponents.DotNetBar.BaseItem; - string myvalue = btn.Tag.ToString(); - using (Item itm = MyStepRTB.MyItemInfo.Get()) - { - Annotation x = Annotation.MakeAnnotation(itm, AnnotationType.GetByName("RO Missing"), null, myvalue, null); - } - } - #endregion - - public void SetGridCellContextMenu() - { - AddWROContext(btnCMRtfCellEdit); - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfCellEdit); - } - public void SetGridContextMenu() - { - if (rtabTableGridTools.Visible) - _ContextMenuBar.SetContextMenuEx(MyFlexGrid, btnCMGrid); - } - public void OpenContextMenu(Point loc) - { - btnCMRtfEdit.Popup(loc); - } - private int _MyLastFormatID = -1; - private StepRTB _MyStepRTB; - public StepRTB MyStepRTB - { - get { return _MyStepRTB; } - set - { - _MyStepRTB = value; - if (value != null) - { - //Console.WriteLine(string.Format("StepTabRibbon: In set of MyStepRTB, Selected Text = {0}", MyStepRTB.SelectedText)); - switch (_MyStepRTB.FieldToEdit) - { - case E_FieldToEdit.PSI: - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMPSI); - _DefaultContextMenu = btnCMPSI; - break; - case E_FieldToEdit.StepText: - if (MyFlexGrid != null) - { - // This happends when the FlexGrid (table) is slected (not when you edit a table cell) - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfCellEdit); - _DefaultContextMenu = btnCMRtfCellEdit; - } - else - { - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit); - _DefaultContextMenu = btnCMRtfEdit; - } - break; - case E_FieldToEdit.Text: - case E_FieldToEdit.Number: - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMRtfEdit3); - _DefaultContextMenu = btnCMRtfEdit3; - break; - default: - break; - } - // The following two lines were replaced by the third line so that the Ribbon KeyTips will work properly. - // ex. Positon on a substep, press , to list the substep types - //_MyStepRTB.MouseUp += new MouseEventHandler(_MyStepRTB_MouseUp); //+= new MouseEventHandler(MyStepRTB_SelectionChanged); - //_MyStepRTB.KeyUp += new KeyEventHandler(_MyStepRTB_KeyUp); //+= new KeyEventHandler(MyStepRTB_SelectionChanged); - _MyStepRTB.SelectionChanged += new EventHandler(_MyStepRTB_SelectionChanged); - //_MyStepRTB.ModeChange += new StepRTBModeChangeEvent(_MyStepRTB_ModeChange); - if (_MyEditItem != null) _MyEditItem.Leave += new EventHandler(_MyEditItem_Leave); - //_MyStepRTB.Leave += new EventHandler(_MyStepRTB_Leave); - _MyStepRTB.LinkChanged += new StepRTBLinkEvent(_MyStepRTB_LinkChanged); - _MyStepRTB.TextChanged += new EventHandler(_MyStepRTB_TextChanged); - if (MyFlexGrid != null) - { - MyFlexGrid.CopyOptionChanged += new VlnFlexGridEvent(MyFlexGrid_CopyOptionChanged); - MyFlexGrid.SelChange+=new EventHandler(MyFlexGrid_SelChange); - } - // Add symbols into the tab ribbon based on format selection. For now, only add symbols once - // because all symbols are same!!! If we start defining different symbols in different formats - // this will have to change, i.e. remove the second part of 'if' statement. - if (MyItemInfo.ActiveFormat.FormatID != _MyLastFormatID && _MyLastFormatID == -1) - { - // Add symbols to the tabribbon & also to the context menu getting info from the format file... - // Note that the ButtonItems must be used in order to place the buttons on a gallery (cannot - // use buttonx or dotnet/windows/button). However, you cannot change the font on ButtonItems so - // the ribbon MUST use the Arial Unicode MS Font for this to work!!!! - FormatInfo fmt = MyItemInfo.ActiveFormat; - SymbolList sl = fmt.PlantFormat.FormatData.SymbolList; - if (sl == null || sl.Count <= 0) - { - MessageBox.Show("No symbols are available, check with administrator"); - return; - } - BuildSymbolGallery(sl, galleryContainerSymbolsCM, galleryContainerSymbolsCM3, galleryContainerSymbolsGrid, galleryContainerSymbolsCM4); - //BuildSymbolGallery(sl, galleryContainerSymbolsCM); - //BuildSymbolGallery(sl, galleryContainerSymbolsCM3); - //BuildSymbolGallery(sl, galleryContainerSymbolsGrid); - } - SetButtonAndMenuEnabling(true); - SetStepButtonAndMenuEnabling(true); - - _MyLastFormatID = MyItemInfo.ActiveFormat.FormatID; - } - } - } - - void _MyStepRTB_TextChanged(object sender, EventArgs e) - { - if (_MyStepRTB == null) return; - // if we are in view mode or the edit window is empty, then don't allow inserting steps/substeps, - // page breaks, copy step, nor creating a pdf - bool allow = (_MyStepRTB.TextLength > 0); - - // turn ribbon items on/off base on whether there is text in the edit window - rbnSiblings.Enabled = rbnBreaks.Enabled = rbnStepParts.Enabled = allow; - // only turn on the Insert Before/After and the CopyStep buttons if on a step part - btnInsAftH.Enabled = btnInsBefH.Enabled = btnInsAfter.Enabled = btnInsBefore.Enabled = btnCpyStp.Enabled = allow && !(MyItemInfo.IsProcedure || MyItemInfo.IsSection); - rbPdf.Enabled = allow; - - // toggle context menus used with the shortcut key - btnCMInsHLS.Enabled = btnCMInsRNO.Enabled = btnCMInsSubStps.Enabled = btnCMInsCaution.Enabled = - btnCMInsNote.Enabled = btnCMInsTable.Enabled = btnCMInsFigure.Enabled = allow; - } - - void MyFlexGrid_SelChange(object sender, EventArgs e) - { - if (MyFlexGrid == null) - return; - if (MyFlexGrid.Selection.c1 < 0 || MyFlexGrid.Selection.r1 < 0) - return; - if (MyFlexGrid.Selection.c1 >= MyFlexGrid.Cols.Count || MyFlexGrid.Selection.r1 >= MyFlexGrid.Rows.Count) - return; - if ((MyEditItem as GridItem).Initializing) return; - //C1.Win.C1FlexGrid.CellRange cr = MyFlexGrid.GetEvenSelection(); - //rbnBorderSelectionPanel.InitializeBorder(MyFlexGrid.MyBorders, cr.r1, cr.c1, cr.r2, cr.c2); - rbnBorderSelectionPanel.InitializeBorder(MyFlexGrid, MyFlexGrid.Selection); - } - void _MyEditItem_Leave(object sender, EventArgs e) - { - // The following two lines were replaced by the third line so that the Ribbon KeyTips will work properly. - // ex. Positon on a substep, press , to list the substep types - //_MyStepRTB.KeyUp -=new KeyEventHandler(_MyStepRTB_KeyUp); - //_MyStepRTB.MouseUp -= new MouseEventHandler(_MyStepRTB_MouseUp); - if (_MyEditItem != null) - { - _MyEditItem.Leave -= new EventHandler(_MyEditItem_Leave); - _MyEditItem.Enter += new EventHandler(_MyEditItem_Enter); - } - //_MyStepRTB.Leave -= new EventHandler(_MyStepRTB_Leave); - if (_MyStepRTB != null) - { - _MyStepRTB.SelectionChanged -= new EventHandler(_MyStepRTB_SelectionChanged); - _MyStepRTB.LinkChanged -= new StepRTBLinkEvent(_MyStepRTB_LinkChanged); - } - if (MyFlexGrid != null) - { - MyFlexGrid.CopyOptionChanged -= new VlnFlexGridEvent(MyFlexGrid_CopyOptionChanged); - MyFlexGrid.SelChange -= new EventHandler(MyFlexGrid_SelChange); - } - } - void _MyEditItem_Enter(object sender, EventArgs e) - { - // The following two lines were replaced by the third line so that the Ribbon KeyTips will work properly. - // ex. Positon on a substep, press , to list the substep types - //_MyStepRTB.KeyUp -=new KeyEventHandler(_MyStepRTB_KeyUp); - //_MyStepRTB.MouseUp -= new MouseEventHandler(_MyStepRTB_MouseUp); - if (_MyEditItem != null) - { - _MyEditItem.Leave += new EventHandler(_MyEditItem_Leave); - _MyEditItem.Enter -= new EventHandler(_MyEditItem_Enter); - } - //_MyStepRTB.Leave -= new EventHandler(_MyStepRTB_Leave); - if (_MyStepRTB != null) - { - _MyStepRTB.LinkChanged += new StepRTBLinkEvent(_MyStepRTB_LinkChanged); - _MyStepRTB.SelectionChanged += new EventHandler(_MyStepRTB_SelectionChanged); - } - if (MyFlexGrid != null) - { - MyFlexGrid.CopyOptionChanged += new VlnFlexGridEvent(MyFlexGrid_CopyOptionChanged); - MyFlexGrid.SelChange += new EventHandler(MyFlexGrid_SelChange); - //Console.WriteLine("Turn on SelChange"); - } - } - void MyFlexGrid_CopyOptionChanged(object sender, EventArgs args) - { - btnTblDgnPaste.Enabled = true; - btnCmGridPaste.Enabled = true; - switch (VlnFlexGrid.MyCopyInfo.MyCopyOption) - { - case GridCopyOption.Row: - btnTblDgnPasteRow.Visible = true; - btnCmGridPasteRow.Visible = true; - btnTblDgnPasteColumn.Visible = false; - btnCmGridPasteCol.Visible = false; - break; - case GridCopyOption.Column: - btnTblDgnPasteRow.Visible = false; - btnCmGridPasteRow.Visible = false; - btnTblDgnPasteColumn.Visible = true; - btnCmGridPasteCol.Visible = true; - break; - case GridCopyOption.Selection: - btnTblDgnPasteRow.Visible = false; - btnCmGridPasteRow.Visible = false; - btnTblDgnPasteColumn.Visible = false; - btnCmGridPasteCol.Visible = false; - break; - default: - break; - } - } - void _MyStepRTB_SelectionChanged(object sender, EventArgs e) - { - SetButtonAndMenuEnabling(false); - } - //void _MyStepRTB_MouseUp(object sender, MouseEventArgs e) - //{ - // //SetButtonAndMenuEnabling(false); - //} - - //void _MyStepRTB_KeyUp(object sender, KeyEventArgs e) - //{ - // //SetButtonAndMenuEnabling(false); - //} - - private void BuildSymbolGallery(SymbolList sl, DevComponents.DotNetBar.GalleryContainer gc1, DevComponents.DotNetBar.GalleryContainer gc2, DevComponents.DotNetBar.GalleryContainer gc3, DevComponents.DotNetBar.GalleryContainer gc4) - { - foreach (Symbol sym in sl) - { - DevComponents.DotNetBar.ButtonItem btn = new DevComponents.DotNetBar.ButtonItem(); - btn.Text = string.Format("{0}", (char)sym.Unicode); - // to name button use unicode rather than desc, desc may have spaces or odd chars - btn.Name = "btn" + sym.Unicode.ToString(); - btn.Tooltip = sym.Desc; - btn.Tag = string.Format(@"{0}", sym.Unicode); - btn.FontBold = true; - btn.Click += new System.EventHandler(btnSym_Click); - galleryContainerSymbols.SubItems.Add(btn); - DevComponents.DotNetBar.ButtonItem btnCM1 = GetCMButton(sym); - btnCM1.Click += new System.EventHandler(btnSym_Click); - gc1.SubItems.Add(btnCM1); - DevComponents.DotNetBar.ButtonItem btnCM2 = GetCMButton(sym); - btnCM2.Click += new System.EventHandler(btnSym_Click); - gc2.SubItems.Add(btnCM2); - DevComponents.DotNetBar.ButtonItem btnCM3 = GetCMButton(sym); - btnCM3.Click += new System.EventHandler(btnSym_Click); - gc3.SubItems.Add(btnCM3); - DevComponents.DotNetBar.ButtonItem btnCM4 = GetCMButton(sym); - btnCM4.Click += new System.EventHandler(btnSym_Click); - gc4.SubItems.Add(btnCM4); - } - } - - private static DevComponents.DotNetBar.ButtonItem GetCMButton(Symbol sym) - { - DevComponents.DotNetBar.ButtonItem btnCM3 = new DevComponents.DotNetBar.ButtonItem(); - btnCM3.Text = string.Format("{0}", (char)sym.Unicode); - // to name button use unicode rather than desc, desc may have spaces or odd chars - btnCM3.Name = "btnCM" + sym.Unicode.ToString(); - btnCM3.Tooltip = sym.Desc; - btnCM3.Tag = string.Format(@"{0}", sym.Unicode); - btnCM3.FontBold = true; - return btnCM3; - } - //void _MyStepRTB_ModeChange(object sender, StepRTBModeChangeEventArgs args) - //{ - // SetButtonAndMenuEnabling(true); - //} - #endregion - #region Constructor - public StepTabRibbon() - { - InitializeComponent(); - _RibbonControl.AutoSize = true; - _RibbonControl.SizeChanged += new EventHandler(_RibbonControl_SizeChanged); - // When AutoExpand is set to true, [CTRL][F1] and double click will hide/expand the ribbon bar - // causing its state to be out of sync with that of the QAT menu option to - // expand/hide the ribbon. - // We now set AutoExpand to false and issue an event to expand/collapse the ribbon - // in a generic event method (ribbonTab_DoubleClick) - // and assigned it to the DoubleClick event of each tab in the ribbon. - // (see ribbonTab_DoubleClick() for more information) -jsj 07-APR-2011 - // Note: the QAT menu is to the right of the V start button in the upper left - _RibbonControl.AutoExpand = false; - _RibbonControl.Items[0].RaiseClick(); // initially default to HOME tab - rbnBorderlistBox.Resize+=new EventHandler(rbnBorderlistBox_Resize); - rbnBorderlistBox.SetupFontAndSize(6); // 6 Point Font - } - - void _RibbonControl_SizeChanged(object sender, EventArgs e) - { - this.Size = _RibbonControl.Size; - } - public bool Expanded - { - get { return _RibbonControl.Expanded; } - set { _RibbonControl.Expanded = value; } - } - #endregion - #region Events - - public event StepTabRibbonEvent PrintRequest; - private void OnPrintRequest(StepTabRibbonEventArgs args) - { - if (PrintRequest != null) - PrintRequest(this, args); - } - void _MyStepRTB_LinkChanged(object sender, StepPanelLinkEventArgs args) - { - // do all Transition and ReferencedObject menu items/buttons based on whether a 'link is selected' and the link type. - SetupGoToButton(); - if (btnCMGoTo.Enabled == true && _MyStepRTB.MyLinkText != null) // must have some link test, use it to set edit of transition or ro... - { - btnCMEditTran.Enabled = _MyStepRTB.MyLinkText.IndexOf("Transition") > -1; // selected link must be a transition - btnCMEditRO.Enabled = _MyStepRTB.MyLinkText.IndexOf("ReferencedObject") > -1; // selected link must be ro - } - else - { - btnCMEditTran.Enabled = false; - btnCMEditRO.Enabled = false; - } - } - private void SetupGoToButton() - { - if (MyEditItem is GridItem && (MyEditItem as GridItem).MyFlexGrid.IsRoTable) - btnCMGoTo.Enabled = btnGoTo.Enabled = true; - else - { - if (_MyStepRTB == null) return; - if (_MyStepRTB.IsSelectionLinked(_MyStepRTB.SelectionStart, _MyStepRTB.SelectionLength)) - { - // if selected text = ?, i.e. a missing/undefined destination, don't allow go to - btnCMGoTo.Enabled = btnGoTo.Enabled = !_MyStepRTB.SelectedText.StartsWith("?"); - } - else - btnCMGoTo.Enabled = btnGoTo.Enabled = false; - } - } - void _MyStepRTB_Leave(object sender, EventArgs e) - { - // The following two lines were replaced by the third line so that the Ribbon KeyTips will work properly. - // ex. Positon on a substep, press , to list the substep types - //_MyStepRTB.KeyUp -=new KeyEventHandler(_MyStepRTB_KeyUp); - //_MyStepRTB.MouseUp -= new MouseEventHandler(_MyStepRTB_MouseUp); - _MyStepRTB.SelectionChanged -= new EventHandler(_MyStepRTB_SelectionChanged); - _MyStepRTB.Leave -= new EventHandler(_MyStepRTB_Leave); - _MyStepRTB.LinkChanged -= new StepRTBLinkEvent(_MyStepRTB_LinkChanged); - } - - void btnInsStep_Click(object sender, EventArgs e) - { - DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender; - if (b.Tag == null) return; - char[] sep = { ' ' }; - string[] insdata = b.Tag.ToString().Split(sep); - if (insdata.Length < 2) return; - int fromtype = Convert.ToInt32(insdata[0]); - int contenttype = Convert.ToInt32(insdata[1]) + 20000; - string tabletype = (insdata.Length == 3)? insdata[2]:null; - // if from type == 0, we've inserted a hls. - // if inserting from section, insert first child - // else do a after from current HLS - if not at HLS, go up parents until find it. - if (fromtype == 0 && !_MyEditItem.MyItemInfo.IsStepSection) - { - EditItem hlsEditItem = _MyEditItem; - while (!hlsEditItem.MyItemInfo.IsHigh) - hlsEditItem = hlsEditItem.ActiveParent; - hlsEditItem.AddSiblingAfter((int?)contenttype, true); - } - else if (InsertingTable(contenttype)) - { - if (tabletype.Contains("RO")) - { - VlnFlexGrid grd = new VlnFlexGrid(); - grd.Rows.Count = 1; - grd.Cols.Count = 1; - grd.IsRoTable = true; - _MyEditItem.AddChild((E_FromType)fromtype, contenttype, grd); - StepTabPanel tmp = Parent as StepTabPanel; - tmp.MyDisplayTabControl.OnLinkModifyRO(this, new StepPanelLinkEventArgs(null)); - } - else - { - VlnFlexGrid grd = CreateNewTable(); - if (grd != null) _MyEditItem.AddChild((E_FromType)fromtype, contenttype, grd); - } - } - else - { - _MyEditItem.AddChild((E_FromType)fromtype, contenttype); - } - } - // Table Grid - private bool InsertingTable(int contenttype) - { - bool rtnval = false; - switch (contenttype) - { - case 20008: // Centered table - case 20010: // AER table - case 20033: // AER table without boarder - case 20034: // Centered table without boarder - rtnval = true; - break; - } - return rtnval; - } - private void btnInsBefore_Click(object sender, EventArgs e) - { - _MyEditItem.AddSiblingBefore(); - } - - private void btnInsAfter_Click(object sender, EventArgs e) - { - _MyEditItem.AddSiblingAfter(); - } - /// - /// Using style for step type, enable/disable formatting buttons - /// - private void SetButtonForStyle() - { - btnBold.Enabled = btnCMBold.Enabled = (!((_MyStepRTB.MyStyleFont.Style & E_Style.Bold) == E_Style.Bold || (_MyStepRTB.MyStyleFont.Style & E_Style.MmBold) == E_Style.MmBold)); - btnUnderline.Enabled = btnCMUnderline.Enabled = (!((_MyStepRTB.MyStyleFont.Style & E_Style.Underline) == E_Style.Underline)); - btnItalics.Enabled = btnCMItalics.Enabled = (!((_MyStepRTB.MyStyleFont.Style & E_Style.Italics) == E_Style.Italics)); - } - public void SetTableButtonsForMergeRangeSelection() - { - if (MyFlexGrid != null) - { - btnTblDgnMergeCells.Enabled = btnCmGridMergeCells.Enabled = !MyFlexGrid.IsInMergeRange(); - } - } - private void SetButtonMenuEnabledDisabledOnSelection(bool setting) - { - btnCMBold.Enabled = btnBold.Enabled = setting; - btnCMItalics.Enabled = btnItalics.Enabled = setting; - btnCMUnderline.Enabled = btnUnderline.Enabled = setting; - btnCMSubscript.Enabled = btnSubscript.Enabled = setting; - btnCMSuperscript.Enabled = btnSuperscript.Enabled = setting; - btnCMCut.Enabled = btnCut.Enabled = setting; - btnCMUndo.Enabled = btnUndo.Enabled = setting; - btnCMRedo.Enabled = btnRedo.Enabled = setting; - //btnEdit3CMPaste.Enabled = btnPasteText.Enabled = btnCMPasteText.Enabled = btnCMPaste.Enabled = btnPaste.Enabled = setting; - btnCMPaste.Enabled = btnCMPasteText.Enabled = btnPasteText.Enabled = btnPasteStepText.Enabled = btnPaste.Enabled = setting; - btnCMCopy.Enabled = btnCopy.Enabled = setting; - btnPasteAfter.Enabled = btnPasteBefore.Enabled = btnStepPaste.Enabled = btnPasteReplace.Enabled = setting; - btnCMGrid.Enabled = setting; - } - private void SetButtonMenuEnabledDisabledOnStepType(bool setting) - { - btnPageBreak.Enabled = btnInsPgBrk.Enabled = setting; - btnCMChgStep.Enabled = btnChgTyp.Enabled = setting; - btnInsHLS.Enabled = btnInsCaut.Enabled = btnInsNote.Enabled = btnInsRNO.Enabled = btnInsFig.Enabled = - btnInsTable.Enabled = btnInsSubstep.Enabled = btnInsBefore.Enabled = btnInsAfter.Enabled = setting; - btnInsTrans.Enabled = btnCMTransition.Enabled = btnInsRO.Enabled = btnCMRO.Enabled = setting; - btnInsAftH.Enabled = btnInsBefH.Enabled = setting; - btnCMChgCase.Enabled = btnChgCase.Enabled = setting; - btnCMHardSpace.Enabled = btnInsHrdSpc.Enabled = setting; - btnCMSymbol.Enabled = btnSymbols.Enabled = setting; - btnIndent.Enabled = setting; - btnDelelete.Enabled = btnDelStep.Enabled = setting; - btnSpell.Enabled = setting; - rtabTableGridTools.Visible = setting; - btnCMGrid.Enabled = setting; - if (MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.AllowNoteCautionAdd) - { - btnInsNote.Enabled = true; - btnInsCaut.Enabled = true; - } - } - private void SetButtonAndMenuEnabling(bool docontextmenus) - { - if (_MyStepRTB == null) return; - if (_MyStepRTB.FieldToEdit != E_FieldToEdit.StepText) - return; // No need to change menu that does not get used - DocVersionInfo dvi = MyEditItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo; - if (dvi == null) return; - if (dvi.VersionType > 127 || MyEditItem.MyStepPanel.VwMode == E_ViewMode.View) - { - SetButtonMenuEnabledDisabledOnSelection(false); - } - else - { - SetButtonMenuEnabledDisabledOnSelection(true); - - if (_MyStepRTB.SelectionFont != null) - { - btnCMBold.Checked = btnBold.Checked = RTBAPI.IsBold(_MyStepRTB); - btnCMItalics.Checked = btnItalics.Checked = RTBAPI.IsItalic(_MyStepRTB); - btnCMUnderline.Checked = btnUnderline.Checked = RTBAPI.IsUnderline(_MyStepRTB); - btnCMSubscript.Checked = btnSubscript.Checked = RTBAPI.IsSubScript(_MyStepRTB); - btnCMSuperscript.Checked = btnSuperscript.Checked = RTBAPI.IsSuperScript(_MyStepRTB); - } - SetButtonForStyle(); - - btnCMCut.Enabled = btnCut.Enabled = _MyStepRTB.SelectionLength > 0; - btnCMUndo.Enabled = btnUndo.Enabled = _MyStepRTB.CanUndo; - btnCMRedo.Enabled = btnRedo.Enabled = _MyStepRTB.CanRedo; - - // for paste, see if there is clipboard data, & if so, of a type we can use. - IDataObject iData = Clipboard.GetDataObject(); - //btnEdit3CMPaste.Enabled = btnPasteText.Enabled = btnCMPasteText.Enabled = btnCMPaste.Enabled = btnPaste.Enabled = (iData.GetDataPresent(DataFormats.Text) || iData.GetDataPresent(DataFormats.Rtf)); - //btnPasteText.Enabled = btnPasteStepText.Enabled = btnPaste.Enabled = (iData.GetDataPresent(DataFormats.Text) || iData.GetDataPresent(DataFormats.Rtf)); - btnPaste.Enabled = (iData.GetDataPresent(DataFormats.Text) || iData.GetDataPresent(DataFormats.Rtf)); - btnCMPasteText.Enabled = btnPasteText.Enabled = iData.GetDataPresent(DataFormats.Text); - btnCMPaste.Enabled = btnPasteStepText.Enabled = iData.GetDataPresent(DataFormats.Rtf); - } - // all selected copy while in either Edit or View mode - btnCMCopy.Enabled = btnCopy.Enabled = _MyStepRTB.SelectionLength > 0; - - // paste step only available if a step was copied. Also, check for valid types: - SetPasteButtonEnabled(); - - // do all Transition and ReferencedObject menu items/buttons based on whether a 'link is selected' and the link type. - //btnCMGoTo.Enabled = btnGoTo.Enabled = _MyStepRTB.IsSelectionLinked(_MyStepRTB.SelectionStart, _MyStepRTB.SelectionLength); //(_MyStepRTB.MyLinkText != null); - SetupGoToButton(); - if (btnCMGoTo.Enabled == true && _MyStepRTB.MyLinkText != null) // must have some link test, use it to set edit of transition or ro... - { - btnCMEditTran.Enabled = _MyStepRTB.MyLinkText.IndexOf("Transition") > -1; // selected link must be a transition - btnCMEditRO.Enabled = _MyStepRTB.MyLinkText.IndexOf("ReferencedObject") > -1; // selected link must be ro - } - else - { - btnCMEditTran.Enabled = false; - btnCMEditRO.Enabled = false; - } - // OLD: SetStepButtonAndMenuEnabling(docontextmenus); - } - - private void SetPasteButtonEnabled() - { - // if there is no 'copied' step, or if a procedure is copied, just turn all buttons off, this can only - // be done from the tree. - StepTabPanel tmp = Parent as StepTabPanel; - if (tmp.MyDisplayTabControl.MyCopyStep == null || tmp.MyDisplayTabControl.MyCopyStep.IsProcedurePart) - { - btnPasteReplace.Enabled = btnPasteBefore.Enabled = btnPasteAfter.Enabled = btnStepPaste.Enabled = false; - return; - } - // If a section is copied, it can be pasted as a section (before/after/replace). If can also - // be pasted as a subsection if the format allows it. - if (tmp.MyDisplayTabControl.MyCopyStep.IsSectionPart) - { - btnPasteBefore.Enabled = btnPasteAfter.Enabled = btnPasteReplace.Enabled = MyItemInfo.IsSectionPart; - // when doing 'substep' part of paste, need to check if format allows subsection. - } - else if (tmp.MyDisplayTabControl.MyCopyStep.IsCautionPart || tmp.MyDisplayTabControl.MyCopyStep.IsNotePart) - // Part type of copied step must be same as Part type of destination, with exceptions of caution/note and step/rno - // can be pasted into each other. - // Part types are procedure - 1, section = 2, step = 6, caution = 3, note = 4, RNO (IsRNO), = 5 table/figure = 7. - btnPasteBefore.Enabled = btnPasteAfter.Enabled = btnPasteReplace.Enabled = (MyItemInfo.IsCautionPart || MyItemInfo.IsNotePart); - else if (tmp.MyDisplayTabControl.MyCopyStep.IsRNOPart || tmp.MyDisplayTabControl.MyCopyStep.IsStepPart) - btnPasteBefore.Enabled = btnPasteAfter.Enabled = btnPasteReplace.Enabled = (MyItemInfo.IsRNOPart || MyItemInfo.IsStepPart); - else if (tmp.MyDisplayTabControl.MyCopyStep.IsTable && MyItemInfo.IsTable) - { - btnPasteBefore.Enabled = btnPasteAfter.Enabled = btnCMPasteBefore.Enabled = btnCMPasteAfter.Enabled = false; - btnPasteReplace.Enabled = btnCMPasteReplace.Enabled = true; - } - else if (tmp.MyDisplayTabControl.MyCopyStep.IsTable && !MyItemInfo.IsTable) - { - btnPasteBefore.Enabled = btnPasteAfter.Enabled = btnCMPasteBefore.Enabled = btnCMPasteAfter.Enabled = false; - btnPasteReplace.Enabled = btnCMPasteReplace.Enabled = false; - } - - - // Can't replace step with same step - if (tmp.MyDisplayTabControl.MyCopyStep.ItemID == MyItemInfo.ItemID) btnPasteReplace.Enabled = false; - } - private void SetStepButtonAndMenuEnabling(bool docontextmenus) - { - if (MyEditItem == null) return; - DocVersionInfo dvi = MyEditItem.MyItemInfo.MyProcedure.ActiveParent as DocVersionInfo; - if (dvi == null) return; - if (dvi.VersionType > 127) - btnCMEditMode1.Enabled = btnEditMode.Enabled = false; // in approved - if (dvi.VersionType > 127 || MyEditItem.MyStepPanel.VwMode == E_ViewMode.View) - { - if (rtabTableGridTools.Checked) - rtabHome.Select(); - rtabTableGridTools.Visible = false; - SetButtonMenuEnabledDisabledOnStepType(false); - this.Refresh(); - return; - } - else - SetButtonMenuEnabledDisabledOnStepType(true); - - btnInsPgBrk.Checked = false; - // see if manual page break - only available on HLS - if (MyItemInfo.IsHigh) - { - StepConfig cfg = MyItemInfo.MyConfig as StepConfig; - btnInsPgBrk.Checked = cfg == null ? false : cfg.Step_NewManualPagebreak; - } - btnInsPgBrk.Enabled = MyItemInfo.IsHigh; - btnPageBreak.Enabled = MyItemInfo.IsHigh; // edit context menu - btnEditMode.Checked = btnCMEditMode1.Checked = MyEditItem.MyStepPanel.VwMode == E_ViewMode.View; - // if on procedure, 'Delete' buttons should be disabled. - btnDelelete.Enabled = btnDelStep.Enabled = !MyItemInfo.IsProcedure; - btnCpyStp.Enabled = !MyItemInfo.IsProcedure; - // Only display the table edit tools if in a grid (table) and that grid (table) is not an RO Table. - GridItem tmpGridItm = MyEditItem as GridItem; - if (btnTblDgnAdjustSize.Checked) - { - btnTblDgnAdjustSize.Checked = false; - ToggleTableDesignButtons(true); - } - rtabTableGridTools.Visible = tmpGridItm != null && !tmpGridItm.MyFlexGrid.IsRoTable; - // If no longer on a table (grid) or the newly selectd table is an RO table - // then select the Home tab (since the Table tab is not visable) - if ((!(MyEditItem is GridItem) && rtabTableGridTools.Checked)) // || ((MyEditItem is GridItem) && !rtabTableGridTools.Visible)) - { - rtabHome.Select(); - } - - // if on procedure or section, 'change type' & 'insert' buttons should be disabled. - if (MyItemInfo.IsProcedure || MyItemInfo.IsSection) - { - btnInsCaut.Enabled = btnInsNote.Enabled = btnInsRNO.Enabled = btnInsFig.Enabled = - btnInsTable.Enabled = btnInsSubstep.Enabled = btnInsBefore.Enabled = btnInsAfter.Enabled = false; - // if on a section, allow note/caution. May want to add condition that this is a subsection? - if (MyItemInfo.IsSection && MyItemInfo.IsStepSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.AllowNoteCautionAdd) - { - btnInsNote.Enabled = true; - btnInsCaut.Enabled = true; - btnInsCaut.SubItems.Clear(); - btnInsNote.SubItems.Clear(); - if (docontextmenus) - { - btnCMInsCaution.SubItems.Clear(); - btnCMInsNote.SubItems.Clear(); - } - GalleryForSubTypes(MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Caution, MyItemInfo.FormatStepData, btnInsCaut, (int)E_FromType.Caution, btnCMInsCaution, docontextmenus); - GalleryForSubTypes(MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Note, MyItemInfo.FormatStepData, btnInsNote, (int)E_FromType.Note, btnCMInsNote, docontextmenus); - } - // if on a procedure or section title, don't allow for insert of ROs or Transitions: - // disable buttons. Info panels for ROs and Transitions are made invisible in frmVEPROMS.cs - btnInsTrans.Enabled = btnCMTransition.Enabled = btnInsRO.Enabled = btnCMRO.Enabled = false; - btnInsAftH.Enabled = btnInsBefH.Enabled = false; - btnInsHLS.Enabled = (!MyItemInfo.IsStepSection) ? false : true; // allow hls from step section - // if active item is a section and format has metasections, check that a hls can be added. - if (MyItemInfo.IsStepSection) - { - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections) - // The 'editable' data config must be set to allow new steps to be created. - { - SectionConfig sc = MyItemInfo.MyConfig as SectionConfig; - if (sc != null && MyItemInfo.Sections != null && MyItemInfo.Sections.Count > 0 && sc.SubSection_Edit != "Y") - btnInsHLS.Enabled = false; - } - } - if (btnInsHLS.Enabled) - { - btnInsHLS.SubItems.Clear(); - GalleryForSubTypes(MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.HLS, MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.HLS, btnInsHLS, (int)E_FromType.Step, btnCMInsHLS, docontextmenus); - } - this.Refresh(); - return; - } - - btnChgTyp.Enabled = true; - - // set up insert buttons based on format - E_AccStep? actable = 0; - StepData sd = MyItemInfo.FormatStepData; - actable = sd.StepEditData.AcTable; - if (actable == null) actable = 0; - btnInsHLS.Enabled = true; - btnInsCaut.Enabled = (actable & E_AccStep.AddingCaution) > 0; - btnInsNote.Enabled = (actable & E_AccStep.AddingNote) > 0; - btnInsRNO.Enabled = (actable & E_AccStep.AddingRNO) > 0; - btnInsFig.Enabled = (actable & E_AccStep.AddingTable) > 0; - btnInsTable.Enabled = (actable & E_AccStep.AddingTable) > 0; - btnInsSubstep.Enabled = (actable & E_AccStep.AddingSub) > 0; - btnInsBefore.Enabled = btnInsBefH.Enabled = !MyItemInfo.IsRNOPart && (actable & E_AccStep.AddingPrev) > 0; - btnInsAfter.Enabled = btnInsAftH.Enabled = !MyItemInfo.IsRNOPart && (actable & E_AccStep.AddingNext) > 0; - - // if this step has a table or figure, disable both of those buttons. - if (MyItemInfo.Tables != null && MyItemInfo.Tables.Count > 0) - btnInsTable.Enabled = btnInsFig.Enabled = btnCMInsFigure.Enabled = btnCMInsTable.Enabled = false; - - btnInsHLS.SubItems.Clear(); - btnInsCaut.SubItems.Clear(); - btnInsNote.SubItems.Clear(); - btnInsRNO.SubItems.Clear(); - btnInsFig.SubItems.Clear(); - btnInsTable.SubItems.Clear(); - btnInsSubstep.SubItems.Clear(); - - if (docontextmenus) - { - btnCMInsHLS.SubItems.Clear(); - btnCMInsCaution.SubItems.Clear(); - btnCMInsNote.SubItems.Clear(); - btnCMInsFigure.SubItems.Clear(); - btnCMInsTable.SubItems.Clear(); - btnCMInsSubStps.SubItems.Clear(); - btnCMInsRNO.SubItems.Clear(); - } - - btnInsRNO.Enabled = btnCMInsRNO.Enabled = btnInsRNO.Enabled && (MyItemInfo.RNOs == null || MyItemInfo.RNOs.Count == 0); // don't insert an RNO if has an RNO - - // if (rno is enabled, set the tag: - if (btnInsRNO.Enabled) - btnInsRNO.Tag = string.Format("{0} {1}", (int)E_FromTypes.RNOs, MyEditItem.MyItemInfo.ActiveFormat.PlantFormat.FormatData.GetIndexFromType("RNOType")); - - // add subitems depending on whether parent type is enabled: - if (btnInsHLS.Enabled) GalleryForSubTypes(MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.HLS, sd, btnInsHLS, 0, btnCMInsHLS, docontextmenus); - if (btnInsCaut.Enabled) GalleryForSubTypes(MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Caution, sd, btnInsCaut, (int)E_FromType.Caution, btnCMInsCaution, docontextmenus); - if (btnInsNote.Enabled) GalleryForSubTypes(MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Note, sd, btnInsNote, (int)E_FromType.Note, btnCMInsNote, docontextmenus); - if (btnInsFig.Enabled) GalleryForSubTypes(MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Fig, sd, btnInsFig, (int)E_FromType.Table, btnCMInsFigure, docontextmenus); - if (btnInsTable.Enabled) GalleryForSubTypes(MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Table, sd, btnInsTable, (int)E_FromType.Table, btnCMInsTable, docontextmenus); - if (btnInsSubstep.Enabled) GalleryForSubTypes(MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Substep, sd, btnInsSubstep, (int)E_FromType.Step, btnCMInsSubStps, docontextmenus); - if (btnInsRNO.Enabled) GalleryForSubTypes(MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.RNO, sd, btnInsRNO, 0, btnCMInsRNO, docontextmenus); - - btnInsTrans.Enabled = btnCMTransition.Enabled = btnInsRO.Enabled = btnCMRO.Enabled = true; - - _RibbonControl.Refresh(); // jsj- added this because Table Design ribbon tab grouping was not going away when not on a table step type - } - /// - /// set up a gallery of step types whose parent are defined by input StepData. Can be below - /// more than one level, for example. Substep, EquipmentList, EquipmentWBlank - both equipment - /// lists would be put in gallery - /// - /// StepData: find subtypes related to this - /// StepData: this should be selected button - /// DevComponents.DotNetBar.ButtonItem: if items in the gallery, add gallery to this button - /// DevComponents.DotNetBar.ButtonItem: if items in the gallery, add btns to context menu - private void GalleryForSubTypes(StepData sdc, StepData selType, DevComponents.DotNetBar.ButtonItem btn, int fromtype, DevComponents.DotNetBar.ButtonItem cmbtn, bool docontextmenus) - { - int cursel = -1; - // The first argument (boolean) in StepGetLevelTypes provides the option to get a complete list of step types - // regardless of whether in the AER or RNO column (set to true). For all types, get both except for figures - // and tables. - bool getall = !(btn.Name == "btnInsFig" || (btn.Name == "btnInsTable")); - List sdl = MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepGetLevelTypes(getall, sdc, ref cursel, selType==null?"Section":selType.Type, MyItemInfo); - if (sdl != null && sdl.Count > 0) - { - Char kt = 'A'; // start with letter A for KeyTips - // if doing the insert substep button, check for substeps already there and if so must match type. - if (btn.Name == "btnInsSubstep") - { - if (MyItemInfo.Steps != null && MyItemInfo.Steps.Count > 0) - { - ItemInfo ichld = MyItemInfo.Steps[0]; - btn.Click -= new System.EventHandler(btnInsStep_Click); - btn.Click += new System.EventHandler(btnInsStep_Click); - btn.Tag = string.Format("{0} {1}", fromtype, ichld.MyContent.Type - 20000); - return; - } - else - { - btn.Tag = null; - btn.Click -= new System.EventHandler(btnInsStep_Click); - } - } - foreach (StepDataRetval sdr in sdl) - { - bool addit = true; - StepData sd = MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[sdr.Index]; - int hlsSubType = -1; // if on hls, use this to set default on substep menu to first child - if (MyItemInfo.IsHigh && MyItemInfo.Steps != null && MyItemInfo.Steps.Count > 0) - { - hlsSubType = (int)MyItemInfo.Steps[0].MyContent.Type - 20000; - } - // unfortunately, there are some special cases to be handled. - // if high level step, don't put the rno button on - // if caution don't add note button (the StepGetLevelTypes method returns cautions/notes together - if (btn.Name == "btnInsHLS" && sd.Type == "RNOType") addit = false; - if (btn.Name == "btnInsCaut" && sd.Type.Length >= 4 && sd.Type.Substring(0, 4) == "Note") addit = false; - if (btn.Name == "btnInsNote" && sd.Type.Length >= 7 && sd.Type.Substring(0, 7) == "Caution") addit = false; - if (btn.Name == "btnInsSubstep" && MyItemInfo.Steps != null && MyItemInfo.Steps.Count > 0) addit = false; - if (addit) - { - DevComponents.DotNetBar.ButtonItem bi = new DevComponents.DotNetBar.ButtonItem("btn" + sd.Type, sd.Type); - bi.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.TextOnlyAlways; - bi.Text = sdr.Name; - bi.Tag = string.Format("{0} {1}", fromtype, sdr.Index); // index of type to insert it when button is clicked - bi.Checked = (selType == null || (sd.Type == selType.Type)); - if (docontextmenus) - { - DevComponents.DotNetBar.ButtonItem cmbi = new DevComponents.DotNetBar.ButtonItem("cmbtn" + sd.Type, sd.Type); - cmbi.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.TextOnlyAlways; - cmbi.Text = sdr.Name; - cmbi.Tag = string.Format("{0} {1}", fromtype, sdr.Index); // index of type to insert it when button is clicked - cmbi.Checked = (selType == null || (sd.Type == selType.Type)); - cmbi.Click += new System.EventHandler(btnInsStep_Click); - cmbtn.SubItems.Add(cmbi); - } - if (MyItemInfo.IsHigh && hlsSubType != -1 && sdr.Index == hlsSubType) bi.Checked = true; - bi.Click += new System.EventHandler(btnInsStep_Click); - // Assign only A-Z to the KeyTips in the list (i.e. assign only the first 24 in the list) - // Note that KeyTips logic support only single characters at this level (can't have 'AA' for example) - if (kt != '0') - { - bi.KeyTips = kt.ToString(); - if (kt == 'Z') - kt = '0'; - else - kt++; - } - btn.SubItems.Add(bi); - } - } - // if this is a table, then need to add RO/Text table options - if (btn.Name == "btnInsTable" && docontextmenus) - { - // If there is only one 'table' type from format under the ribbon's table item, - // eliminate that button and move up the RO & Text Table buttons. - if (btn.SubItems.Count == 1) - { - btn.Tag = btn.SubItems[0].Tag; - btn.SubItems.Clear(); - DoTableSubMenu(btn); - } - else - { - foreach (DevComponents.DotNetBar.ButtonItem tabbtn in btn.SubItems) - DoTableSubMenu(tabbtn); - } - } - // if only 1, be sure event exists on button to insert item & if more than 1 remove event because - // we want the drop down to appear. - if (btn.Name != "btnInsRNO") - btn.Click -= new System.EventHandler(btnInsStep_Click); - if (docontextmenus) - cmbtn.Click -= new System.EventHandler(btnInsStep_Click); - if (btn.SubItems.Count == 1) - { - btn.SubItems.Clear(); - if (btn.Name != "btnInsRNO") - { - btn.Tag = string.Format("{0} {1}", fromtype, sdc.Index); - btn.Click += new System.EventHandler(btnInsStep_Click); - } - if (docontextmenus) - { - cmbtn.SubItems.Clear(); - DevComponents.DotNetBar.ButtonItem cmbi = new DevComponents.DotNetBar.ButtonItem("cmbtn" + sdc.Type, sdc.Type); - cmbi.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.TextOnlyAlways; - cmbi.Text = btn.Text; - if (btn.Name == "btnInsRNO") - cmbi.Tag = btn.Tag; - else - cmbi.Tag = string.Format("{0} {1}", fromtype, sdc.Index); // index of type to insert it when button is clicked - cmbi.Click += new System.EventHandler(btnInsStep_Click); - cmbtn.SubItems.Add(cmbi); - } - } - - } - rbnStepParts.Refresh(); - } - - private void DoTableSubMenu(DevComponents.DotNetBar.ButtonItem tabbtn) - { - char[] sp = { ' ' }; - string[] insdata = tabbtn.Tag.ToString().Split(sp); - int ftype = Convert.ToInt32(insdata[0]); - int sdtype = Convert.ToInt32(insdata[1]); - DevComponents.DotNetBar.ButtonItem cmbt = new DevComponents.DotNetBar.ButtonItem("cmbtnt" + sdtype + "RO", "RO Table"); - cmbt.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.TextOnlyAlways; - cmbt.Text = "RO Table"; - cmbt.Tag = string.Format("{0} {1} {2}", ftype, sdtype, "RO"); - //cmbt.Checked = (sd.Type == selType.Type); - cmbt.Click += new System.EventHandler(btnInsStep_Click); - tabbtn.SubItems.Add(cmbt); - cmbt = new DevComponents.DotNetBar.ButtonItem("cmbtnt" + sdtype + "TX", "Text Table"); - cmbt.ButtonStyle = DevComponents.DotNetBar.eButtonStyle.TextOnlyAlways; - cmbt.Text = "Text Table"; - cmbt.Tag = string.Format("{0} {1} {2}", ftype, sdtype, "TX"); // Text table - //cmbt.Checked = (sd.Type == selType.Type); - cmbt.Click += new System.EventHandler(btnInsStep_Click); - tabbtn.SubItems.Add(cmbt); - tabbtn.Tag = null; - tabbtn.Click -= new System.EventHandler(btnInsStep_Click); - } - #endregion - #region Insert Tab - private void btnSym_Click(object sender, EventArgs e) - { - DevComponents.DotNetBar.ButtonItem b = (DevComponents.DotNetBar.ButtonItem)sender; - StartGridEditing(SelectionOption.Start); // If in a FlexGrid, start the editor for a cell - _MyStepRTB.InsertSymbol(Convert.ToInt32(b.Tag)); - } - private enum SelectionOption - { - Start, - All, - End - } - /// - /// If in a FlexGrid, start the editor for a cell - /// - /// If false cursor will be placed at the begining - private void StartGridEditing(SelectionOption selOpt) - { - // Bug fix: B2012-203, B2012-204 - // Need to check if the selected table cell is in edit mode already. - // if already in edit mode, we don't want to do the StartEditing code below, because it - // will override the current cursor positioning and selection range. - Control ctrl = FindActiveControl(); - if (ctrl == null) return; // null if on property page for procedure & section number/title - if (ctrl is VlnFlexGrid) - { - // Selected table cell is not in edit mode. Go into edit mode and position acording - // to the pass in selOpt. - if (MyFlexGrid != null && MyFlexGrid.Editor == null) - { - MyFlexGrid.StartEditing(); - switch (selOpt) - { - case SelectionOption.Start: - MyStepRTB.Select(0, 0); - break; - case SelectionOption.All: - MyStepRTB.SelectAll(); - break; - case SelectionOption.End: - break; - MyStepRTB.Select(MyStepRTB.TextLength, 0); - default: - MyStepRTB.Select(0, 0); - break; - } - } - } - } - public void btnInsPgBrk_Click(object sender, EventArgs e) - { - rtabInsert.Select(); - if (MyItemInfo.IsProcedure || MyItemInfo.IsSection) return; - - // toggle manual page break - StepConfig cfg = MyItemInfo.MyConfig as StepConfig; - cfg.Step_NewManualPagebreak = !cfg.Step_NewManualPagebreak; - btnPageBreak.Checked = btnInsPgBrk.Checked = cfg.Step_NewManualPagebreak; - } - private void btnIndent_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.Start); - _MyStepRTB.InsertIndent(MyEditItem.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IndentToken); - } - private void btnCMIndent_Click(object sender, EventArgs e) - { - _MyStepRTB.InsertIndent(MyEditItem.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IndentToken); - } - #endregion - #region Home Tab - private bool _PastePlainTextOvrRide = false; - private bool _PasteStepTextOvrRide = false; - private void btnPaste_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.End); - IDataObject myDO = Clipboard.GetDataObject(); - RichTextBox myRtb = _MyStepRTB; - Control ctrl = FindActiveControl(); // null if on property page for procedure & section number/title - - if (ctrl != null && !_MyStepRTB.Focused) - { - if (ctrl is RichTextBox) - { - myRtb = ctrl as RichTextBox; - } - else if (ctrl is ComboBox) - { - ComboBox cmb = ctrl as ComboBox; - if (myDO.GetDataPresent(DataFormats.UnicodeText)) - cmb.SelectedText = myDO.GetData(DataFormats.UnicodeText).ToString(); - else if (myDO.GetDataPresent(DataFormats.Text)) - cmb.SelectedText = myDO.GetData(DataFormats.Text).ToString(); - _PastePlainTextOvrRide = false; - _PasteStepTextOvrRide = false; - return; - } - else - { - SaveErrorInLogProblemWithType(ctrl); - _PastePlainTextOvrRide = false; - _PasteStepTextOvrRide = false; - return; - } - } - // check if rtf is coming from Word, i.e. if it has 'SCHEMAS.MICROSOFT.COM/OFFICE/WORD'. - // If it is coming from Word, it will be pasted as text so as not to get any rtf commands - // that PROMS does not support such as odd Fonts, other symbols, etc. This isn't a complete - // solution, clipboard data may come from other 3rd-party tools and unsupported Rtf may get - // pasted in. But the hope is that this will happen less often than getting it from MS Word. - if (myDO.GetDataPresent(DataFormats.Rtf) && (_PasteStepTextOvrRide || (!_PastePlainTextOvrRide && !PastePlainTextSetting))) - { - string tmpForLink = myDO.GetData(DataFormats.Rtf).ToString().Replace("\r\n", ""); - if (tmpForLink.ToUpper().Contains(@"SCHEMAS.MICROSOFT.COM/OFFICE/WORD")) - myRtb.SelectedText = _MyStepRTB.GetPasteText(PasteNoReturnsSetting, myDO); - else - { - tmpForLink = Regex.Replace(tmpForLink, @"#Link:ReferencedObject:[0-9]+ ", @"#Link:ReferencedObject: "); - tmpForLink = Regex.Replace(tmpForLink, @"#Link:Transition:([0-9]+) [0-9]+ ", @"#Link:Transition:$1 "); - tmpForLink = Regex.Replace(tmpForLink, @"#Link:TransitionRange:([0-9]+) [0-9]+ ", @"#Link:TransitionRange:$1 "); - tmpForLink = tmpForLink.Replace(@"\u8212 \'96", @"-"); // Replace EM Dash with hyphen - tmpForLink = tmpForLink.Replace(@"\u8211 \'96", @"-"); // Replace EN Dash with hyphen - tmpForLink = tmpForLink.Replace(@"\u8212 ", @"-"); // Replace EM Dash with hyphen - tmpForLink = tmpForLink.Replace(@"\u8211 ", @"-"); // Replace EN Dash with hyphen - myRtb.SelectedRtf = tmpForLink; - } - - } - else if (myDO.GetDataPresent(DataFormats.Text)) - myRtb.SelectedText = _MyStepRTB.GetPasteText(PasteNoReturnsSetting, myDO); - if (myRtb.SelectionLength == 0 && myRtb is StepRTB) myRtb.SelectionFont = (myRtb as StepRTB).MyStyleFont.WindowsFont; - _PastePlainTextOvrRide = false; - _PasteStepTextOvrRide = false; - } - private void SaveErrorInLogProblemWithType(Control ctrl) - { - StringBuilder errormsg = new StringBuilder(string.Format("Failed clipboard action with control {0} a {1} ", ctrl.Name, ctrl.GetType().Name)); - Type typ = ctrl.GetType(); - while (typ.Name != "Control") - { - errormsg.Append(string.Format(", dervied from {0}", typ.BaseType.Name)); - typ = typ.BaseType; - } - _MyLog.Error(errormsg); - } - private Control FindActiveControl() - { - // added the flag below because a table (grid) could have a cell selected (a control) - // but it might not have focus (in edit mode) - bool beenThereDoneThat = false; // flag to prevent infinate loop - Control tmp = this; - while (!(tmp.Parent is Form)) - { - tmp = tmp.Parent; - // if coming from property page (properties of procedure & section number/title), - // tmp becomes null rather than from flexgrid or steptext. - if (tmp == null) return null; - } - Form frm = tmp.Parent as Form; - tmp = frm.ActiveControl; - while (!beenThereDoneThat && tmp.Controls.Count > 0) - { - beenThereDoneThat = true; - foreach (Control ctrl in tmp.Controls) - if (ctrl.ContainsFocus) - { - tmp = ctrl; - beenThereDoneThat = false; - break; - } - } - return tmp; - } - private void btnCut_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.All); - MoveSelectedToClipboard(true); - } - private void MoveSelectedToClipboard(bool isCut) - { - Control ctrl = FindActiveControl(); - if (ctrl == null) return; // null if on property page for procedure & section number/title - Clipboard.Clear(); - if (_MyStepRTB.SelectedText == null || _MyStepRTB.SelectedText == "") - return; // nothing to copy onto clipboard, just return - DataObject myDO = new DataObject(); ; - if (ctrl is RichTextBox) - { - //myDO = new DataObject("Rich Text Format", (ctrl as RichTextBox).SelectedRtf); - string tmp2 = _MyStepRTB.SelectedText; - string tmp = _MyStepRTB.GetSelectionForClipBoard(); - tmp2 = Regex.Replace(tmp2, @"#Link:ReferencedObject:[0-9]+ +[0-9a-zA-Z]+ [0-9]+", @""); - tmp2 = Regex.Replace(tmp2, @"#Link:Transition:([0-9]+) [0-9]+ [1-9]+", @""); - tmp2 = Regex.Replace(tmp2, @"#Link:TransitionRange:([0-9]+) [0-9]+ [0-9]+ [0-9]+", ""); - tmp2 = tmp2.Replace("", ""); - myDO.SetText(tmp2, TextDataFormat.Text); - //myDO.SetText(_MyStepRTB.SelectedRtf, TextDataFormat.Rtf); - myDO.SetText(tmp, TextDataFormat.Rtf); - if (isCut) (ctrl as RichTextBox).SelectedText = ""; - } - else if (ctrl is ComboBox) - { - //myDO = new DataObject("Text Format", (ctrl as ComboBox).SelectedText); - myDO.SetText((ctrl as ComboBox).SelectedText, TextDataFormat.Text); - if (isCut) (ctrl as ComboBox).SelectedText = ""; - } - else if (ctrl is TextBox) - { - //myDO = new DataObject("Text Format", (ctrl as TextBox).SelectedText); - myDO.SetText((ctrl as TextBox).SelectedText, TextDataFormat.Text); - if (isCut) (ctrl as TextBox).SelectedText = ""; - } - else - { - SaveErrorInLogProblemWithType(ctrl); - return; - } - //DataObject myDO; - //if (ctrl is RichTextBox) - //{ - // myDO = new DataObject("Rich Text Format", (ctrl as RichTextBox).SelectedRtf); - // myDO.SetText(_MyStepRTB.SelectedText); - // if(isCut) (ctrl as RichTextBox).SelectedText = ""; - //} - //else if (ctrl is ComboBox) - //{ - // myDO = new DataObject("Text Format", (ctrl as ComboBox).SelectedText); - // if (isCut) (ctrl as ComboBox).SelectedText = ""; - //} - //else if (ctrl is TextBox) - //{ - // myDO = new DataObject("Text Format", (ctrl as TextBox).SelectedText); - // if (isCut) (ctrl as TextBox).SelectedText = ""; - //} - //else - //{ - // SaveErrorInLogProblemWithType(ctrl); - // return; - //} - Clipboard.SetDataObject(myDO); - } - private void btnCopy_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.All); - MoveSelectedToClipboard(false); - } - private void btnBold_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.All); - RTBAPI.ToggleBold(!RTBAPI.IsBold(_MyStepRTB), _MyStepRTB, _MyStepRTB.SelectionLength == 0 ? RTBAPI.RTBSelection.SCF_DEFAULT : RTBAPI.RTBSelection.SCF_SELECTION); - btnCMBold.Checked = btnBold.Checked = RTBAPI.IsBold(_MyStepRTB); - } - private void btnItalics_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.All); - RTBAPI.ToggleItalic(!RTBAPI.IsItalic(_MyStepRTB), _MyStepRTB, _MyStepRTB.SelectionLength == 0 ? RTBAPI.RTBSelection.SCF_DEFAULT : RTBAPI.RTBSelection.SCF_SELECTION); - btnCMItalics.Checked = btnItalics.Checked = RTBAPI.IsItalic(_MyStepRTB); - } - private void btnUnderline_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.All); - RTBAPI.ToggleUnderline(!RTBAPI.IsUnderline(_MyStepRTB), _MyStepRTB, _MyStepRTB.SelectionLength == 0 ? RTBAPI.RTBSelection.SCF_DEFAULT : RTBAPI.RTBSelection.SCF_SELECTION); - btnCMUnderline.Checked = btnUnderline.Checked = RTBAPI.IsUnderline(_MyStepRTB); - } - - private void btnSuperscript_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.All); - RTBAPI.ToggleSuperscript(!RTBAPI.IsSuperScript(_MyStepRTB), _MyStepRTB, _MyStepRTB.SelectionLength == 0 ? RTBAPI.RTBSelection.SCF_DEFAULT : RTBAPI.RTBSelection.SCF_SELECTION); - btnCMSuperscript.Checked = btnSuperscript.Checked = RTBAPI.IsSuperScript(_MyStepRTB); - } - - private void btnSubscript_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.All); - RTBAPI.ToggleSubscript(!RTBAPI.IsSubScript(_MyStepRTB), _MyStepRTB, _MyStepRTB.SelectionLength == 0 ? RTBAPI.RTBSelection.SCF_DEFAULT : RTBAPI.RTBSelection.SCF_SELECTION); - btnCMSubscript.Checked = btnSubscript.Checked = RTBAPI.IsSubScript(_MyStepRTB); - } - - private void btnUppercase_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.All); - _MyStepRTB.SetSelectedCase('U'); - } - - private void btnLowercase_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.All); - _MyStepRTB.SetSelectedCase('l'); - } - - private void btnTitleCase_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.All); - _MyStepRTB.SetSelectedCase('T'); - } - private void btnInsTrans_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.Start); - // see if user is positioned 'on' a transition within the rtb, if so do a modify, otherwise, - // insert transition. - StepTabPanel tmp = Parent as StepTabPanel; - tmp.MyDisplayTabControl.OnLinkModifyTran(this, new StepPanelLinkEventArgs(MyStepRTB.MyLinkText)); - } - - private void btnInsHrdSpc_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.Start); - _MyStepRTB.InsertSymbol(@"\u160?"); - } - - private void btnInsRO_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.Start); - // see if user is positioned 'on' an ReferencedObject within the rtb, if so do a modify, otherwise, - // insert transition. - StepTabPanel tmp = Parent as StepTabPanel; - tmp.MyDisplayTabControl.OnLinkModifyRO(this, new StepPanelLinkEventArgs(MyStepRTB.MyLinkText)); - } - - private void btnRedo_Click(object sender, EventArgs e) - { - _MyStepRTB.Redo(); - btnCMUndo.Enabled = btnUndo.Enabled = _MyStepRTB.CanUndo; - btnCMRedo.Enabled = btnRedo.Enabled = _MyStepRTB.CanRedo; - } - - private void btnUndo_Click(object sender, EventArgs e) - { - _MyStepRTB.Undo(); - if (_MyStepRTB.WasXDelete && (_MyStepRTB.Text[_MyStepRTB.SelectionStart - 1] == 'X')) - { - _MyStepRTB.Undo(); - _MyStepRTB.WasXDelete = false; - - // only allow one of these - not best case, but at least can get - // one undo - _MyStepRTB.ClearUndo(); - } - btnCMRedo.Enabled = btnRedo.Enabled = _MyStepRTB.CanRedo; - btnCMUndo.Enabled = btnUndo.Enabled = _MyStepRTB.CanUndo; - } - private void btnGoTo_Click(object sender, EventArgs e) - { - // if on a transition, go to the selected transition 'to'. If on - // a referenced object, bring up ReferencedObject Editor (for now, just put up a message box. - if (_MyStepRTB.MyLinkText != null && _MyStepRTB.MyLinkText.IndexOf("Transition") > -1) - { - _MyEditItem.MyStepPanel.OnLinkClicked(sender, new StepPanelLinkEventArgs(_MyStepRTB.MyLinkText)); - } - else - { - if (VlnSettings.ReleaseMode.Equals("DEMO")) - { - MessageBox.Show("Referenced Object Editor not available in the Demo version.", "PROMS Demo Version"); - return; - } - string myROID; - RODbInfo myRODB; - if (MyFlexGrid != null && MyFlexGrid.IsRoTable) - { - myROID = MyFlexGrid.ROID.ToLower(); - myRODB = RODbInfo.Get(MyFlexGrid.RODbId); - } - else - { - LinkText lt = new LinkText(_MyStepRTB.MyLinkText); - myROID = lt.MyRoUsageInfo.ROID.ToLower(); - myRODB = lt.MyRoUsageInfo.MyRODb; - } - //string roapp = Environment.GetEnvironmentVariable("roapp"); - string roapp = Volian.Base.Library.ExeInfo.GetROEditorPath(); // get the path to the RO Editor Executable - string args = "\"" + myRODB.FolderPath + "\" " + myROID; - if (!Directory.Exists(myRODB.FolderPath)) - { - MessageBox.Show(string.Format("RO Database directory does not exist: {0}", myRODB.FolderPath)); - return; - } - System.Diagnostics.Process.Start(roapp, args); - } - } - private void btnChgTyp_Click(object sender, EventArgs e) - { - StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("Change Step Type"); - MyEditItem.MyStepPanel.OnTabDisplay(sender, args); - } - #endregion - #region RHM debug - //#if DEBUG - // // The following code generates an XML output for the selected item for print testing. - // private void btnPageBreak_Click(object sender, EventArgs e) - // { - // // This is here temporarily to get a node and all of it's children for print testing. - // OutputAllChildren(MyRTBItem); - // } - // private void OutputAllChildren(RTBItem myRTBItem) - // { - // OutputAllChildren(myRTBItem.MyBeforeRTBItems); - // OutputStepInfo(myRTBItem); - // OutputAllChildren(myRTBItem.MyAfterRTBItems); - // OutputAllChildren(myRTBItem.MyRNORTBItems); - // } - // private void OutputStepInfo(RTBItem myRTBItem) - // { - // Label lbl = myRTBItem.MyLabel; - // if (lbl.Text.Trim() != "") - // Console.WriteLine("{4}", - // ToInches(myRTBItem.Left + lbl.Left), ToInches(myRTBItem.Top + lbl.Top), - // lbl.Font.FontFamily.Name,lbl.Font.SizeInPoints,lbl.Text); - // StepRTB rtb = myRTBItem.MyStepRTB; - // Console.WriteLine("{3}", - // ToInches(myRTBItem.Left + rtb.Left), ToInches(myRTBItem.Top + rtb.Top), ToInches(rtb.Width), myRTBItem.MyItemInfo.MyContent.Text); - //// ToInches(myRTBItem.Left + rtb.Left), ToInches(myRTBItem.Top + rtb.Top), ToInches(rtb.Width), rtb.Rtf); - // } - // private float ToInches(int val) - // { - // return Convert.ToSingle(val)/96F; - // } - - // private void OutputAllChildren(List list) - // { - // if(list != null) - // foreach (RTBItem itm in list) - // OutputAllChildren(itm); - // } - - - //#endif - #endregion - - private void btnToggleEditView_Click(object sender, EventArgs e) - { - MyEditItem.MyStepPanel.VwMode = MyEditItem.MyStepPanel.VwMode == E_ViewMode.Edit ? E_ViewMode.View : E_ViewMode.Edit; - MyEditItem.ToggleEditView(MyEditItem.MyStepPanel.VwMode); - SetButtonAndMenuEnabling(true); - SetStepButtonAndMenuEnabling(true); - MyEditItem.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnModeChange(this, new StepRTBModeChangeEventArgs(MyEditItem.MyStepPanel.VwMode)); - btnEditMode.Checked = btnCMEditMode1.Checked = MyEditItem.MyStepPanel.VwMode == E_ViewMode.View; - MyEditItem.MyStepRTB.SpellCheckContextMenuOn(MyEditItem.MyStepPanel.VwMode != E_ViewMode.View); - } - - private void btnROEdit_Click(object sender, EventArgs e) - { - if (VlnSettings.ReleaseMode.Equals("DEMO")) - { - MessageBox.Show("Referenced Object Editor not available in the Demo version.", "PROMS Demo Version"); - return; - } - //string roapp = Environment.GetEnvironmentVariable("roapp"); - string roapp = Volian.Base.Library.ExeInfo.GetROEditorPath(); // get the path to the RO Editor Executable - if (roapp == null || roapp == string.Empty) - { - MessageBox.Show("The 'roapp' environment variable needs to be set to the path of the RO Editor\n\n Ex: C:\\VE-PROMS.NET\\Bin\\roeditor.exe", "Environment Variable Error"); - return; - } - if (!File.Exists(roapp)) - { - string errtxt = string.Format("Could not find path to Referenced Objects Editor:\n\n roapp = {0}\n\n Verify the path assigned to the 'roapp' environment variable", roapp); - MessageBox.Show(errtxt, "Environment Variable Error"); - //MessageBox.Show("Could not find path to Ro Editor, check 'roapp' environment variable","Environment Variable Error"); - return; - } - //if (roapp == null) - //{ - // MessageBox.Show("Could not find path to Ro Editor, check 'roapp' environment variable"); - // return; - //} - if (MyDVI == null || MyDVI.DocVersionAssociationCount < 1) - { - MessageBox.Show("Could not find associated path for ro data.", "No RO Data", MessageBoxButtons.OK, MessageBoxIcon.Information); - return; - } - string roloc = "\"" + MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath + "\""; - if (!Directory.Exists(MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath)) - { - MessageBox.Show(string.Format("RO Database directory does not exist: {0}", MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath)); - return; - } - System.Diagnostics.Process.Start(roapp, roloc); - } - - private void btnUpdROVal_Click(object sender, EventArgs e) - { - // use rodb directory path of the first rofst for the this document version. Later, will need - // to modify code to get which one (when there is more than one) - if (MyDVI.DocVersionAssociations.Count < 1) - { - MessageBox.Show("Error Updating ro.fst. No associated ro.fst"); - return; - } - ROFstInfo roFstInfo = MyDVI.DocVersionAssociations[0].MyROFst; - - string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst"; - if (!File.Exists(rofstPath)) - { - MessageBox.Show("No existing ro.fst in path " + roFstInfo.MyRODb.FolderPath + ". Check for invalid path"); - return; - } - FileInfo fiRofst = new FileInfo(rofstPath); - if (roFstInfo.DTS == fiRofst.LastWriteTimeUtc) - { - MessageBox.Show("ro.fst files are same for path " + roFstInfo.MyRODb.FolderPath + ", import of that ro.fst will not be done"); - return; - } - if (roFstInfo.DTS > fiRofst.LastWriteTimeUtc) - { - MessageBox.Show("Cannot copy older ro.fst from " + roFstInfo.MyRODb.FolderPath + ", import of that ro.fst will not be done"); - return; - } - Cursor = Cursors.WaitCursor; - - using (DocVersion dv = DocVersion.Get(MyDVI.VersionID)) - { - roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); - ROFst newrofst = ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv.DocVersionAssociations[0], dv, roFstInfo); - roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); - StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST"); - MyEditItem.MyStepPanel.OnTabDisplay(sender, args); - btnUpdROVal.Enabled = false; - } - Cursor = Cursors.Default; - } - - public List roFstInfo_ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args) - { - string xml = null; - string srchtxt = null; - Content content = (Content)sender; - using (VlnFlexGrid myGrid = new VlnFlexGrid(content.ContentItems[0])) - { - using (StringReader sr = new StringReader(args.OldGridXml)) - { - myGrid.ReadXml(sr); - sr.Close(); - } - string roid = content.ContentRoUsages[0].ROID; //myGrid.ROID; - int rodbid = content.ContentRoUsages[0].RODbID; //myGrid.RODbId; - ////Font GridFont = myGrid.Font; - //myGrid.MergedRanges.Clear(); - //myGrid.Clear(); - //myGrid.ParseTableFromText(args.ROText); - //myGrid.AutoSizeCols(); - //myGrid.AutoSizeRows(); - //myGrid.MakeRTFcells(); - //myGrid.RODbId = rodbid; - //myGrid.ROID = roid; - //myGrid.IsRoTable = true; - myGrid.Visible = false; - myGrid.ConvertTableROToGrid(args.ROText, rodbid, roid); - myGrid.FixTableCellsHeightWidth(); - myGrid.AdjustGridControlSize(); - myGrid.Visible = true; - using (StringWriter sw = new StringWriter()) - { - myGrid.WriteXml(sw); - xml = sw.GetStringBuilder().ToString(); - sw.Close(); - } - srchtxt = myGrid.GetSearchableText(); - } - List retlist = new List(); - retlist.Add(srchtxt); - retlist.Add(xml); - return retlist; - } - - private void rtabAdmin_Click(object sender, EventArgs e) - { - ribbonTab_SingleClick(sender, e); - btnUpdROVal.Enabled = false; - if (MyDVI.DocVersionAssociations == null || MyDVI.DocVersionAssociations.Count < 1) - { - btnROEdit.Enabled = false; - return; - } - btnROEdit.Enabled = true; - if (!NewerRoFst()) return; - btnUpdROVal.Enabled = true; - } - public bool NewerRoFst() - { - if (_MyDVI == null)return false; - return _MyDVI.NewerRoFst; - } - public void SetUpdRoValBtn(bool en) - { - btnUpdROVal.Enabled = en; - } - private void btnBookmarks_Click(object sender, EventArgs e) - { - StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("Bookmarks"); - MyEditItem.MyStepPanel.OnTabDisplay(sender, args); - } - - private void btnSearch_Click(object sender, EventArgs e) - { - StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("Global Search"); - MyEditItem.MyStepPanel.OnTabDisplay(sender, args); - } - - private void btnLibDocs_Click(object sender, EventArgs e) - { - StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("LibDocs"); - MyEditItem.MyStepPanel.OnTabDisplay(sender, args); - } - - public void btnAnnots_Click(object sender, EventArgs e) - { - StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("Annots"); - MyEditItem.MyStepPanel.OnTabDisplay(sender, args); - } - - public void btnDelStep_Click(object sender, EventArgs e) - { - bool clearCopyStep = false; - StepTabPanel tmp = Parent as StepTabPanel; - if (tmp.MyDisplayTabControl.MyCopyStep != null && - tmp.MyDisplayTabControl.MyCopyStep.ItemID == MyEditItem.MyItemInfo.ItemID) - { - if (MessageBox.Show("Are you sure?\n\nIf you delete this step you will not able to paste it.\nYou should paste it before you delete it.", "Attempting to delete copied step.", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return; - clearCopyStep = true; - } - - bool surpressMessageBox = (e == null); - SectionInfo si = MyEditItem.MyItemInfo as SectionInfo; - if (si != null) - { - string msg = si.HasChildren ? "Are you sure you want to delete this section and its steps?" : "Are you sure you want to delete this section?"; - DialogResult result = MessageBox.Show(msg, "Verify Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (result == DialogResult.Yes) - { - - if (!si.IsStepSection) - { - WordSectionEventArgs args = new WordSectionEventArgs(si); - MyEditItem.MyStepPanel.OnWordSectionClose(sender, args); - } - MyEditItem.RemoveItem(); - if (!si.IsStepSection) - { - WordSectionEventArgs args = new WordSectionEventArgs(si); - MyEditItem.MyStepPanel.OnWordSectionDeleted(sender, args); - } - } - return; - } - StepInfo stpi = MyEditItem.MyItemInfo as StepInfo; - if (stpi == null) // not sure that it will every get here! - { - MessageBox.Show("Unknown type {0}, cannot delete!", MyEditItem.MyItemInfo.GetType().Name); - return; - } - if (!surpressMessageBox) - { - string typeDescription = MyEditItem.MyStepData.StepEditData.TypeMenu.MenuItem; - string msgs = ""; - if (MyFlexGrid != null) MyEditItem.IdentifyMe(true); - MyEditItem.IdentifyChildren(true); - if (stpi.HasChildren) - msgs = string.Format("Are you sure you want to delete this {0} and its substeps?", typeDescription); - else - msgs = string.Format("Are you sure you want to delete this {0}?", typeDescription); - //string msgs = stpi.HasChildren ? "Are you sure you want to delete this step and its substeps?" : "Are you sure you want to delete this step?"; - DialogResult results = MessageBox.Show(msgs, "Verify Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (MyFlexGrid != null) - { - MyFlexGrid.Styles.Fixed.BackColor = MyFlexGrid.DefaultFixedBackgroundColor; - MyFlexGrid.StyleBackColor = MyFlexGrid.DefaultCellBackgroundcolor; - } - MyEditItem.IdentifyChildren(false); - if (results == DialogResult.Yes) - { - MyEditItem.RemoveItem(); - if (clearCopyStep) - { - tmp.MyDisplayTabControl.MyCopyStep = null; - SetPasteButtonEnabled(); - } - } - } - else - { - MyEditItem.RemoveItem(); - if (clearCopyStep) - { - tmp.MyDisplayTabControl.MyCopyStep = null; - SetPasteButtonEnabled(); - } - } - } - - private void btnCMIns_PopupClose(object sender, EventArgs e) - { - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, _DefaultContextMenu); - } - - public void SetShortCutContextMenu(string menuName) - { - bool displayMenu = false; - int moveDown = 0; - int cnt = 0; - E_AccStep? actable = 0; - if (menuName.Contains("PSI")) Console.WriteLine("menu = {0}", menuName); - - StepData sd = MyItemInfo==null?null:MyItemInfo.FormatStepData; - if (sd != null) // will be null if section - { - actable = sd.StepEditData.AcTable; - if (actable == null) actable = 0; - } - //btnInsCaut.Enabled = (actable & E_AccStep.AddingCaution) > 0; - switch (menuName) - { - case "PSI": - displayMenu = true; - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMPSI); - break; - case "InsHLS": - displayMenu = btnCMInsHLS.Enabled; - Cursor.Position = new Point(0, 0); // Enter Key hit, move mouse pointer out of way of context menu - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsHLS); - foreach (DevComponents.DotNetBar.ButtonItem bi in btnCMInsHLS.SubItems) - { - if (bi.Checked) - moveDown = cnt; - cnt++; - } - break; - case "InsRNO": - displayMenu = ((actable & E_AccStep.AddingRNO) > 0) && btnCMInsRNO.Enabled; - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsRNO); - break; - case "InsSubStps": - displayMenu = ((actable & E_AccStep.AddingSub) > 0) && btnCMInsSubStps.Enabled; - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsSubStps); - if (displayMenu) Cursor.Position = new Point(0, 0); // Enter Key hit, move mouse pointer out of way of context menu - foreach (DevComponents.DotNetBar.ButtonItem bi in btnCMInsSubStps.SubItems) - { - if (bi.Checked) - moveDown = cnt; - cnt++; - } - break; - case "InsCaution": - displayMenu = ((actable & E_AccStep.AddingCaution) > 0) && btnCMInsCaution.Enabled; - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsCaution); - break; - case "InsNote": - displayMenu = ((actable & E_AccStep.AddingNote) > 0) && btnCMInsNote.Enabled; - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsNote); - break; - case "InsTable": - displayMenu = ((actable & E_AccStep.AddingTable) > 0) && btnCMInsTable.Enabled; - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsTable); - break; - case "InsFigure": - displayMenu = ((actable & E_AccStep.AddingTable) > 0) && btnCMInsFigure.Enabled; - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMInsFigure); - break; - case "StepPaste": - displayMenu = true; - if (MyFlexGrid != null) - _ContextMenuBar.SetContextMenuEx(MyFlexGrid, btnCMStepPaste); - else - _ContextMenuBar.SetContextMenuEx(_MyStepRTB, btnCMStepPaste); - break; - } - if (displayMenu) - { - SendKeys.Send("+{F10}{DOWN}"); // Display Context menu - while (moveDown > 0) // position to current type - { - SendKeys.Send("{DOWN}"); - moveDown--; - } - } - } - - private void btnSpell_Click(object sender, EventArgs e) - { - //MessageBox.Show("Functionality not available.", "Spell Check"); - StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("SpellChecker"); - MyEditItem.MyStepPanel.OnTabDisplay(sender, args); - } - //private FindReplace dlgFindReplace = null; - private void btnFindRplDlg_Click(object sender, EventArgs e) - { - StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("FndRpl"); - MyEditItem.MyStepPanel.OnTabDisplay(sender, args); - } - - private void InsertSiblingBeforeOrAfter(string b4aftr) - { - E_AccStep? actable = 0; - StepData sd = MyItemInfo.FormatStepData; - actable = sd.StepEditData.AcTable; - if (actable == null) actable = 0; - switch (b4aftr) - { - case "after": - if ((actable & E_AccStep.AddingNext) > 0) - MyEditItem.AddSiblingAfter(); - break; - case "before": - if ((actable & E_AccStep.AddingPrev) > 0) - MyEditItem.AddSiblingBefore(); - break; - } - } - public void ProcessEnterKey() - { - bool deletedEmpty = false; - bool deletedHLS = false; - bool deletedSubStep = false; - bool deletedRNO = false; - bool deletedNote = false; - bool deletedCaution = false; - if (!MyItemInfo.IsTable && MyStepRTB.Text.Length < 1) //empty step text - { - deletedEmpty = true; - deletedHLS = MyItemInfo.IsHigh; - deletedSubStep = MyItemInfo.IsStepPart; - deletedRNO = MyItemInfo.IsRNOPart; - deletedNote = MyItemInfo.IsNote; - deletedCaution = MyItemInfo.IsCaution; - - btnDelStep_Click(MyStepRTB, null); // delete the empty step piece - } - - if (MyItemInfo.IsHigh) - { - if (!deletedHLS) - { - if (deletedSubStep) - SetShortCutContextMenu("InsHLS"); - else if (MyEditItem.MyRNOEditItems != null && MyEditItem.MyRNOEditItems.Count > 0) - MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlRight); // jump to RNO - else if (deletedRNO) - { - AddSubStep(); - } - else if (!deletedHLS) - { - if (MyItemInfo.ColumnMode > 0) - CreateNewRNO(); - else - AddSubStep(); - } - } - } - else if (MyItemInfo.IsRNOPart) - { - MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlLeft); - if (MyItemInfo.IsHigh) - { - //if (MyEditItem != null && MyEditItem.NextDownEditItem != null && MyEditItem.NextDownEditItem.MyItemInfo.MyParent.Equals(MyEditItem.MyItemInfo)) - if (MyEditItem != null && MyEditItem.NextDownEditItem != null && MyEditItem.NextDownEditItem.MyItemInfo.MyParent.ItemID == MyEditItem.MyItemInfo.ItemID) - { - MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlDown); - InsertSiblingBeforeOrAfter("before"); - } - else - SetShortCutContextMenu("InsSubStps"); - } - else - InsertSiblingBeforeOrAfter("after"); - } - else if (MyItemInfo.IsInRNO && MyItemInfo.IsStepPart) - { - if (deletedEmpty) - { - MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlLeft); - CreateNewRNO(); - } - else - InsertSiblingBeforeOrAfter("after"); - } - else if (MyItemInfo.IsStepPart) - { - if (deletedSubStep) - { - //MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlUp); // jump to HLS - SetShortCutContextMenu("InsHLS"); // prompt for new HLS - } - //else if (deletedRNO || MyItemInfo.IsEquipmentList) - // InsertSiblingBeforeOrAfter("after"); - else if (!MyItemInfo.IsSequential) // only add a sibling if substep type does not have sequential tabs - InsertSiblingBeforeOrAfter("after"); - else if (deletedRNO) - { - - if (MyItemInfo.SearchNext != null && MyItemInfo.SearchNext.IsTable) - MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlDown); - else - InsertSiblingBeforeOrAfter("after"); - } - else if (MyEditItem.MyRNOEditItems != null && MyEditItem.MyRNOEditItems.Count > 0) - MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlRight); // jump to RNO - else - if (MyItemInfo.ColumnMode > 0) - CreateNewRNO(); - else - InsertSiblingBeforeOrAfter("after"); - } - else if (MyItemInfo.IsCaution) - { - if (deletedEmpty) - { - MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlDown); - if (deletedCaution) - CreateNewNote(); - } - else - InsertSiblingBeforeOrAfter("after"); - } - else if (MyItemInfo.IsNote) - { - if (!deletedEmpty) - InsertSiblingBeforeOrAfter("after"); - else - MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlDown); - } - else if (MyItemInfo.IsTable || MyItemInfo.IsFigure) - { - ItemInfo next = MyItemInfo.SearchNext; - MyFlexGrid.Select(0, 0); // make sure we are at the first row before doing an up arrow - MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlUp); - if (MyItemInfo.IsHigh) - { - if (deletedSubStep) - SetShortCutContextMenu("InsHLS"); - else if (next != null && next.IsFirstSubStep) - { - MyEditItem.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(next); - InsertSiblingBeforeOrAfter("before"); - } - else - SetShortCutContextMenu("InsSubStps"); - } - else - InsertSiblingBeforeOrAfter("after"); - } - } - - private void AddSubStep() - { - EditItem nextDownEditItem = MyEditItem.NextDownEditItem; - //bool skipTable = false; - // //If the step has a table, move past it before adding a substep - //if (nextDownEditItem != null && nextDownEditItem.MyItemInfo.MyParent.ItemID == MyEditItem.MyID && - // nextDownEditItem.MyItemInfo.IsTablePart) - //{ - // nextDownEditItem = nextDownEditItem.NextDownEditItem; - // skipTable = true; - //} - if (nextDownEditItem != null && nextDownEditItem.MyItemInfo.MyParent.ItemID == MyEditItem.MyID) - { - MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlDown); - //if (skipTable) MyStepRTB.StepRTB_ArrowPressed(E_ArrowKeys.CtrlDown); - InsertSiblingBeforeOrAfter("before"); - } - else - SetShortCutContextMenu("InsSubStps"); - } - - private void CreateNewRNO() - { - if (btnInsRNO.SubItems.Count > 1) - SetShortCutContextMenu("InsRNO"); - else - btnInsRNO.RaiseClick(); - } - - private void CreateNewNote() - { - if (btnInsNote.SubItems.Count > 1) - SetShortCutContextMenu("InsNote"); - else - btnInsNote.RaiseClick(); - } - private void btnPasteAfter_Click(object sender, EventArgs e) - { - StepTabPanel tmp = Parent as StepTabPanel; - if (tmp.MyDisplayTabControl.MyCopyStep == null) return; - MyEditItem.PasteSiblingAfter(tmp.MyDisplayTabControl.MyCopyStep.ItemID); - } - private void btnPasteBefore_Click(object sender, EventArgs e) - { - StepTabPanel tmp = Parent as StepTabPanel; - if (tmp.MyDisplayTabControl.MyCopyStep == null) return; - MyEditItem.PasteSiblingBefore(tmp.MyDisplayTabControl.MyCopyStep.ItemID); - } - private void btnStepPaste_Click(object sender, EventArgs e) - { - // just return - } - - private void btnCpyStp_Click(object sender, EventArgs e) - { - DoCopyStep(); - } - - public void DoCopyStep() - { - // highlight selected step(s) and prompt to see if selection is what user wants: - if (MyFlexGrid != null) MyEditItem.IdentifyMe(true); - MyEditItem.IdentifyChildren(true); - DialogResult dr = MessageBox.Show("Step as Marked?", "Identify Step To Be Copied", MessageBoxButtons.YesNo); - if (dr == DialogResult.Yes) - { - StepTabPanel tmp = Parent as StepTabPanel; - tmp.MyDisplayTabControl.MyCopyStep = MyItemInfo; - btnStepPaste.Enabled = true; - SetPasteButtonEnabled(); - } - if (MyFlexGrid != null) - { - MyFlexGrid.Styles.Fixed.BackColor = MyFlexGrid.DefaultFixedBackgroundColor; - MyFlexGrid.StyleBackColor = MyFlexGrid.DefaultCellBackgroundcolor; - } - MyEditItem.IdentifyChildren(false); - } - - private void btnPasteReplace_Click(object sender, EventArgs e) - { - StepTabPanel tmp = Parent as StepTabPanel; - if (tmp.MyDisplayTabControl.MyCopyStep == null) return; - EditItem oldEditItem = MyEditItem; - MyEditItem = MyEditItem.PasteReplace(tmp.MyDisplayTabControl.MyCopyStep.ItemID); - if (MyEditItem.MyItemInfo.ItemID != oldEditItem.MyItemInfo.ItemID) oldEditItem.Dispose(); - } - - private void btnPdfCreate_Click(object sender, EventArgs e) - { - if (MyItemInfo == null) return; // if creating a pdf before rtb exists, return; - if (MyEditItem != null) MyEditItem.SaveCurrentAndContents(); - OnPrintRequest(new StepTabRibbonEventArgs(MyItemInfo.MyProcedure)); - } - #region Table Grid - #region TablePicker code - // TODO: for tables - //private void btnInsTable_Click(object sender, EventArgs e) - //{ - // Point loc = btnInsTable.DisplayRectangle.Location; - // loc.X += 300; - // int top = this.Top + (btnInsTable.Size.Height * 2); - // TablePickerDlg(sender, e, loc, top); - //} - - private VlnFlexGrid CreateNewTable() - { - Point pt = Cursor.Position; - int left = pt.X; - VlnFlexGrid grd = null; - TablePicker tpdlg = new TablePicker(); - tpdlg.Location = pt; - tpdlg.Left = left; - tpdlg.MaxCols = 20; - tpdlg.MaxRows = 30; - DialogResult dr = tpdlg.ShowDialog(); - while (tpdlg.Visible) - { - Application.DoEvents(); - } - if (dr != DialogResult.Cancel) //!tpdlg.Cancel) - { - // Create a new grid to store the selected size - grd = new VlnFlexGrid(); - grd.Rows.Count = tpdlg.SelectedRows; - grd.Cols.Count = tpdlg.SelectedColumns; - VE_Font vefont = MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList.Table.Font; - Font GridFont = new Font(vefont.Family, (float)vefont.Size); - grd.Font = GridFont; - grd.FitTableToPageWidth((int)(MyItemInfo.MyDocStyle.Layout.PageWidth - MyItemInfo.MyDocStyle.Layout.LeftMargin)); - } - return grd; - } - //private void InitializeNewGrid(C1FlexGrid grd) - //{ - // int numCols = grd.Cols.Count - 1; - // int numRows = grd.Rows.Count - 1; - - // string defText = ""; - // if (textBoxX1.Text.Length > 0) - // defText = textBoxX1.Text; - // else - // defText = textBoxX1.WatermarkText; - // grd.SetData(grd.GetCellRange(0, 0, numRows, numCols), defText); - //} - #endregion - #region Table Grid Copy/Paste - private void btnTblDgnCopyRow_Click(object sender, EventArgs e) - { - MyFlexGrid.CopyRow(); - } - - private void btnTblDgnCopyColumn_Click(object sender, EventArgs e) - { - MyFlexGrid.CopyColumn(); - } - - private void btnTblDgnCopySelection_Click(object sender, EventArgs e) - { - MyFlexGrid.CopyCellSelection(); - } - - private void btnTblDgnPasteRowAbove_Click(object sender, EventArgs e) - { - // create new rows before current position and copy clipboard data - MyFlexGrid.PasteRows(VlnFlexGrid.enmPastePos.Before); - GridItem tmp = MyEditItem as GridItem; - if (tmp!=null) tmp.SavePastedCellRoTran(); - } - - private void btnTblDgnPasteRowBelow_Click(object sender, EventArgs e) - { - // create new rows after current position and copy clipboard data - MyFlexGrid.PasteRows(VlnFlexGrid.enmPastePos.After); - GridItem tmp = MyEditItem as GridItem; - if (tmp != null) tmp.SavePastedCellRoTran(); - } - - private void btnTblDgnPasteReplaceRow_Click(object sender, EventArgs e) - { - // replace rows with current clipboard data starting as current row - MyFlexGrid.PasteRows(VlnFlexGrid.enmPastePos.Replace); - GridItem tmp = MyEditItem as GridItem; - if (tmp != null) tmp.SavePastedCellRoTran(); - } - - private void btnTblDgnPasteColumnLeft_Click(object sender, EventArgs e) - { - MyFlexGrid.PasteColumns(VlnFlexGrid.enmPastePos.Before); - GridItem tmp = MyEditItem as GridItem; - if (tmp != null) tmp.SavePastedCellRoTran(); - } - - private void btnTblDgnPasteColumnRight_Click(object sender, EventArgs e) - { - MyFlexGrid.PasteColumns(VlnFlexGrid.enmPastePos.After); - GridItem tmp = MyEditItem as GridItem; - if (tmp != null) tmp.SavePastedCellRoTran(); - } - - private void btnTblDgnPasteColumnReplace_Click(object sender, EventArgs e) - { - MyFlexGrid.PasteColumns(VlnFlexGrid.enmPastePos.Replace); - GridItem tmp = MyEditItem as GridItem; - if (tmp != null) tmp.SavePastedCellRoTran(); - } - - private void btnTblDgnPasteIntoSelection_Click(object sender, EventArgs e) - { - MyFlexGrid.PasteCopiedCells(); - GridItem tmp = MyEditItem as GridItem; - if (tmp != null) tmp.SavePastedCellRoTran(); - } - - #endregion - #region Table Grid Delete - private void btnTblDgnRemoveRow_Click(object sender, EventArgs e) - { - if (MyFlexGrid.AllRowsSelected()) - btnDelStep_Click(sender, e); - else - MyFlexGrid.RemoveSelectedRow(); - } - - private void btnTblDgnRemoveColumn_Click(object sender, EventArgs e) - { - if (MyFlexGrid.AllColumnsSelected()) - btnDelStep_Click(sender, e); - else - MyFlexGrid.RemoveSelectedColumn(); - } - - #endregion - #region Table Grid Cell Style - - //private void cpHighlight_SelectedColorChanged(object sender, EventArgs e) - //{ - // string strColor = string.Format("{0}, {1}, {2};", cpTblDgnHighlight.SelectedColor.R, cpTblDgnHighlight.SelectedColor.G, cpTblDgnHighlight.SelectedColor.B); - // MyFlexGrid.ChangeBackgroundColor(strColor); - //} - - private void btnTblDgnAlgnTxTopLeft_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.LeftTop); - MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Left); - } - - private void btnTblDgnAlgnTxTopCenter_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.CenterTop); - MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Center); - } - - private void btnTblDgnAlgnTxTopRight_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.RightTop); - MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Right); - } - - private void btnTblDgnAlgnTxCenterLeft_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.LeftCenter); - MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Left); - } - - private void btnTblDgnAlgnTxCenterCenter_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.CenterCenter); - MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Center); - } - - private void btnTblDgnAlgnTxCenterRight_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.RightCenter); - MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Right); - } - - private void btnTblDgnAlgnTxBottomLeft_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.LeftBottom); - MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Left); - } - - private void btnTblDgnAlgnTxBottomCenter_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.CenterBottom); - MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Center); - } - - private void btnTblDgnAlgnTxBottomRight_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellAlign(MyFlexGrid.Selection, C1.Win.C1FlexGrid.TextAlignEnum.RightBottom); - MyFlexGrid.RTFTextAlignment(MyFlexGrid.Selection, HorizontalAlignment.Right); - } - - #endregion - #region Table Grid Merge/Split - private void btnTblDgnSplitCells_ToRows_Click(object sender, EventArgs e) - { - // without the BeginUpdate/EndUpdate, you will see the table jump around while - // it is being adjusted - MyFlexGrid.BeginUpdate(); - MyFlexGrid.SplitSelection(false); - MyFlexGrid.EndUpdate(); - } - #endregion - - private void btnTblDgnSplitCellsToCols_Click(object sender, EventArgs e) - { - // without the BeginUpdate/EndUpdate, you will see the table jump around while - // it is being adjusted - MyFlexGrid.BeginUpdate(); - MyFlexGrid.SplitSelection(true); - MyFlexGrid.EndUpdate(); - } - - private void btnTblDgnMergeCells_Click(object sender, EventArgs e) - { - MyFlexGrid.MergeSelection(); - } - #endregion - #region Table Grid Design - private void btnTblDgnInsertRowAbove_Click(object sender, EventArgs e) - { - MyFlexGrid.InsertRowBefore(); - } - - private void btnTblDgnInsertRowBelow_Click(object sender, EventArgs e) - { - MyFlexGrid.InsertRowAfter(); - } - - private void btnTblDgnInsertColumnAbove_Click(object sender, EventArgs e) - { - MyFlexGrid.InsertColumnBefore(); - } - - private void btnTblDgnInsertColumnBelow_Click(object sender, EventArgs e) - { - MyFlexGrid.InsertColumnAfter(); - } - - public void ToggleTableDesignButtons(bool enable) - { - btnTblDgnAlignText.Enabled = enable; - btnTblDgnCopy.Enabled = enable; - btnTblDgnRemove.Enabled = enable; - //btnTblDgnGridStyle.Enabled = enable; - //rbTblBorder.Enabled = enable; - rbnBorderlistBox.Enabled = enable; - rbnBorderSelectionPanel.Enabled = enable; - btnTblNoBorder.Enabled = enable; - btnTblOutline.Enabled = enable; - btnTblInside.Enabled = enable; - btnTblDgnInsertColumn.Enabled = enable; - btnTblDgnInsertRow.Enabled = enable; - btnTblDgnMergeCells.Enabled = enable; - btnCmGridPaste.Enabled = - btnTblDgnPaste.Enabled = ((VlnFlexGrid.MyCopyInfo.MyCopiedFlexGrid != null) && enable); - btnTblDgnSplitCells.Enabled = enable; - } - public void SetRibbonForGrid() - { - // for paste, see if there is clipboard data, & if so, of a type we can use. - IDataObject iData = Clipboard.GetDataObject(); - // set to true if editing cell, otherwise false for grids - //bool enable = (MyFlexGrid != null && MyFlexGrid.Editor != null); - bool enable = (MyFlexGrid != null); - //btnPasteText.Enabled = btnPasteStepText.Enabled = btnPaste.Enabled = enable; - btnPaste.Enabled = (iData.GetDataPresent(DataFormats.Text) || iData.GetDataPresent(DataFormats.Rtf)) && enable; - btnCMPasteText.Enabled = btnPasteText.Enabled = iData.GetDataPresent(DataFormats.Text) && enable; - btnCMPaste.Enabled = btnPasteStepText.Enabled = iData.GetDataPresent(DataFormats.Rtf ) && enable; - btnCopy.Enabled = enable; - btnCut.Enabled = enable; - btnBold.Enabled = enable && !MyFlexGrid.IsRoTable;// ; - btnItalics.Enabled = enable && !MyFlexGrid.IsRoTable;// ; - btnUnderline.Enabled = enable && !MyFlexGrid.IsRoTable;// ; - btnSubscript.Enabled = enable && !MyFlexGrid.IsRoTable;// ; - btnSuperscript.Enabled = enable && !MyFlexGrid.IsRoTable;// ; - btnChgCase.Enabled = enable && !MyFlexGrid.IsRoTable;// ; - btnInsHrdSpc.Enabled = enable && !MyFlexGrid.IsRoTable;// enable; - btnSymbols.Enabled = enable && !MyFlexGrid.IsRoTable;// enable; - btnIndent.Enabled = enable && !MyFlexGrid.IsRoTable;// ;enable; - btnInsTrans.Enabled = enable && !MyFlexGrid.IsRoTable;// ; - btnInsRO.Enabled = enable; - btnCMRtfCellEdit.Enabled = enable && !MyFlexGrid.IsRoTable; - } - private void btnTblDgnAdjustSize_Click(object sender, EventArgs e) - { - if (MyFlexGrid.Cols.Fixed == 0) // allow change of size. - { - // set all the rows and columns to Fixed so that user can adjust the row/column size - if (MyFlexGrid.Cols[0].Width == -1) MyFlexGrid.Cols[0].Width = MyFlexGrid.Cols.DefaultSize; - MyFlexGrid.Cols.Fixed = MyFlexGrid.Cols.Count; - MyFlexGrid.Rows.Fixed = MyFlexGrid.Rows.Count; - ToggleTableDesignButtons(false); - //MyFlexGrid.ListStyles(); - } - else - { - // set grid back to "normal" mode - MyFlexGrid.Cols.Fixed = 0; - MyFlexGrid.Rows.Fixed = 0; - MyFlexGrid.StyleBackColor = Color.White; - ToggleTableDesignButtons(true); - //MyFlexGrid.ListStyles(); - } - } - #endregion - #region Table Grid Border - private void btnTblDgnTableBorderNone_Click(object sender, EventArgs e) - { - MyFlexGrid.SetTableBorder(C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None); - } - - private void btnTblDgnTableBorderFixedSingle_Click(object sender, EventArgs e) - { - MyFlexGrid.SetTableBorder(C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.FixedSingle); - } - - private void btnTblDgnTableBorderFixed3D_Click(object sender, EventArgs e) - { - MyFlexGrid.SetTableBorder(C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Fixed3D); - } - - private void btnTblDgnTableBorderLight3D_Click(object sender, EventArgs e) - { - MyFlexGrid.SetTableBorder(C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D); - } - - private void btnTblDgnTableBorderXPThemes_Click(object sender, EventArgs e) - { - MyFlexGrid.SetTableBorder(C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes); - } - #endregion - #region Table Grid Grid Style - private void btnTblDgnGridStyleNone_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellBorder(MyFlexGrid.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.None); - } - - private void btnTblDgnGridStyleFlat_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellBorder(MyFlexGrid.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.Flat); - } - - private void btnTblDgnGridStyleDouble_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellBorder(MyFlexGrid.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.Double); - } - - private void btnTblDgnGridStyleRaised_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellBorder(MyFlexGrid.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.Raised); - } - - private void btnTblDgnGridStyleInset_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellBorder(MyFlexGrid.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.Inset); - } - - private void btnTblDgnGridStyleGroove_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellBorder(MyFlexGrid.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.Groove); - } - - private void btnTblDgnGridStyleFillet_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellBorder(MyFlexGrid.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.Fillet); - } - - private void btnTblDgnGridStyleDotted_Click(object sender, EventArgs e) - { - MyFlexGrid.ChangeCellBorder(MyFlexGrid.Selection, C1.Win.C1FlexGrid.BorderStyleEnum.Dotted); - } - #endregion - - private void rbnBorderlistBox_SelectedIndexChanged(object sender, EventArgs e) - { - rbnBorderSelectionPanel.SelectedBorder = rbnBorderlistBox.SelectedLinePattern; - } - - private void rbnBorderSelectionPanel_BordersChanged(object sender, EventArgs args) - { - //C1.Win.C1FlexGrid.CellRange cr = MyFlexGrid.GetEvenSelection(); - MyFlexGrid.SetBorders(MyFlexGrid.Selection, rbnBorderSelectionPanel.TopBorder, rbnBorderSelectionPanel.InsideHorizontalBorder, - rbnBorderSelectionPanel.BottomBorder, rbnBorderSelectionPanel.LeftBorder, rbnBorderSelectionPanel.InsideVerticalBorder, rbnBorderSelectionPanel.RightBorder); - MyEditItem.Invalidate(); - MyFlexGrid.Invalidate(); - } - private void btnTblNoBorder_Click(object sender, EventArgs e) - { - rbnBorderSelectionPanel.AllBorders = GridLinePattern.None; - } - private void btnTblOutline_Click(object sender, EventArgs e) - { - rbnBorderSelectionPanel.OutlineBorder = rbnBorderlistBox.SelectedLinePattern; - } - private void btnTblInside_Click(object sender, EventArgs e) - { - rbnBorderSelectionPanel.InsideBorders = rbnBorderlistBox.SelectedLinePattern; - } - private void rbnBorderlistBox_Resize(object sender, EventArgs e) - { - rbnBorderSelectionPanel.Size = rbnBorderlistBox.Size; - _RibbonControl.Height = rbnBorderlistBox.Height + _RibbonControl.Height - _RibbonControl.ClientSize.Height; - //_RibbonControl.Height = rbnBorderlistBox.Height + _RibbonControl.Height - _RibbonControl.ClientSize.Height; - } - #region Expand/Collaspe Ribbon - // In MS Word, a Double Click of a ribbon tab will toggle (Expand/Collapse) the ribbon. - // Once collapsed, a Single Click of a ribbon tab will temporarily expand the ribbon but does not push the text window - // down to make room. Thus your edit cursor could end up behind the ribbon. - - // In our implementation of the ribbon interface, when we double click to collapse/expand the - // ribbon, the QAT menu on the main form gets out of sync, so we need to handle this manually, turning off AutoExpand - // on the ribbon control. (see StepTabRibbon() constructor) and issue an event to expand/collapse the ribbon. - - // As a result of turning off the AutoExpand, a single click is not recongized internally. - // To get around this, we handle the single click event. - // Our single click event will expand the ribbon tabs if needed but not temporarily. - // Instead, it acts like a double click which is not the same a MS Word, but on the plus side, - // it elimates the risk of the ribbon expanding on top of the current edit window. - - //----------------------------- - - // This is assigned the DoubleClick event on all of the ribbon tabs - // Note that a single mouse click will expand the tabs if collapsed - // Note too that a double click also fires the single click event - // the "didSingleClick" variable handle this case - private void ribbonTab_DoubleClick(object sender, EventArgs e) - { - if (TimeSpan.FromTicks(DateTime.Now.Ticks - _LastClick.Ticks).TotalMilliseconds > 500) - { - //SendKeys.Send("^{F1}"); // toggle expand/collapse ribbon tabs - MyEditItem.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnToggleRibbonExpanded(this, new EventArgs()); - _LastDoubleClick = DateTime.Now; - } - } - - private DateTime _LastClick = DateTime.Now; - private DateTime _LastDoubleClick = DateTime.Now; - - // This is assigned the Click event on all of the ribbon tabs - // If the tabs are collapsed, then expand them on a single click of the tab - private void ribbonTab_SingleClick(object sender, EventArgs e) - { - if ((!_RibbonControl.Expanded) && TimeSpan.FromTicks(DateTime.Now.Ticks - _LastDoubleClick.Ticks).TotalMilliseconds > 500) - { - //SendKeys.Send("^{F1}"); // Expand the ribbon tabs - MyEditItem.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnToggleRibbonExpanded(this, new EventArgs()); - _LastClick = DateTime.Now; - } - } - #endregion // Expand/Collapse Ribbon - - private void btnPasteText_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.End); - _PastePlainTextOvrRide = true; - btnPaste_Click(sender, e); - } - - private void btnPasteStepText_Click(object sender, EventArgs e) - { - StartGridEditing(SelectionOption.End); - _PasteStepTextOvrRide = true; - btnPaste_Click(sender, e); - } - - } - public enum E_FieldToEdit { StepText, Text, Number, PSI }; - public class StepTabRibbonEventArgs : EventArgs - { - public StepTabRibbonEventArgs() { ; } - public StepTabRibbonEventArgs(ItemInfo proc) - { - _Proc = proc; - } - private ItemInfo _Proc; - - public ItemInfo Proc - { - get { return _Proc; } - set { _Proc = value; } - } - } - public delegate void StepTabRibbonEvent(object sender, StepTabRibbonEventArgs args); - -} diff --git a/PROMS/Volian.Controls.Library/TemporaryFormat.cs b/PROMS/Volian.Controls.Library/TemporaryFormat.cs deleted file mode 100644 index 66d53a35..00000000 --- a/PROMS/Volian.Controls.Library/TemporaryFormat.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using VEPROMS.CSLA.Library; - -namespace Volian.Controls.Library -{ - class TemporaryFormat - { - private static string[] _TabFormats = new string[] { - "", // 0 base - "",// 1 //STANDARD - " ",// 2 //HIGH - "[] ",// 3 //IMMEDIATE - "o ",// 4 //AND - "o ",// 5 //OR - "CAUTION ",// 6 //CAUTION - "NOTE ",// 7 //NOTE - "",// 8 //TABLE - " * ",// 9 //CONTINUOUS - "",// 10 //AERTABLE - "o ",// 11 //EQUIPMENTLIST - "",// 12 //TITLE - "",// 13 //PAGENUMBER - "o ",// 14 //EQUIPMENTWBLANK - "",// 15 //PROCNUMBER - "",// 16 //REVNUMBER - "",// 17 //ACCPAGES - "",// 18 //LOSSOFAC - "o ",// 19 //EXPLICITAND - "CAUTION ",// 20 //CAUTION1 - "CAUTION ",// 21 //CAUTION2 - "NOTE ",// 22 //NOTE1 - "NOTE ",// 23 //NOTE2 - "",// 24 //PARAGRAPH - "",// 25 //DEFAULT - "NOTE ",// 26 //NOTE3 - "CAUTION ",// 27 //CAUTION3 - "NOTE ",// 28 //NOTE4 - "CAUTION ",// 29 //CAUTION4 - "o ",// 30 //EQUIPMENTOPT - "o ",// 31 //EQUIPMENTOPTWBLANK - "NOTE ",// 32 //NOTE5 - "",// 33 //BORDERLESSAERTABLE - "",// 34 //BORDERLESSTABLE - "o ",// 35 //IMPLICITOR - "",// 36 //FIGURE - "",// 37 //AERFIGURE - "",// 38 //BORDERLESSFIGURE - "",// 39 //BORDERLESSAERFIGURE - "",// 40 //RNOTYPE - " ! ",// 41 //HIGH5 - "",// 42 //TITLEWITHTEXTRIGHT - "",// 43 //TITLEWITHTEXTBELOW - "",// 44 //CONTACSEQUENTIAL - "o ",// 45 //CONTACAND - "o ",// 46 //CONTACOR - "" // 47 //CONTACPARAGRAPH - }; - private static string[] SeqTabFormat = new string[] { - ". ", - ". ", - ") ", - ") " - }; - public static string TabFormat(StepItem myDisplayItem) - { - string format = string.Empty; - if (myDisplayItem.MyItemInfo != null) - { - int typ = (int)myDisplayItem.MyItemInfo.MyContent.Type; - if (typ >= 20000) - { - if (myDisplayItem.RNOLevel > 0 && myDisplayItem.MyItemInfo.IsRNOPart) return ""; - // Step 1: Get TabFormat from Format - format = _TabFormats[typ % 10000]; - if (format == "") - { - format = SeqTabFormat[myDisplayItem.SeqLevel % SeqTabFormat.Length]; - } - } - } - return format; - } - } -} diff --git a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs.bak b/PROMS/Volian.Controls.Library/VlnFlexGrid.cs.bak deleted file mode 100644 index a1ffec2c..00000000 --- a/PROMS/Volian.Controls.Library/VlnFlexGrid.cs.bak +++ /dev/null @@ -1,4926 +0,0 @@ -using System; -using System.ComponentModel; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using System.Windows.Forms; -using System.Drawing; -using System.Runtime.InteropServices; -using System.Xml; -using System.IO; -using Volian.Controls.Library; -using VEPROMS.CSLA.Library; -using C1.Win.C1FlexGrid; -using C1.Win.C1SpellChecker; -using System.Text.RegularExpressions; -using System.Xml.Serialization; - -namespace Volian.Controls.Library -{ - public delegate void VlnFlexGridEvent(object sender, EventArgs args); - public delegate void VlnFlexGridCursorMovementEvent(object sender, VlnFlexGridCursorMovementEventArgs args); - public delegate string VlnFlexGridPasteEvent(object sender, VlnFlexGridPasteEventArgs args); - public delegate void VlnFlexGridkeyEvent(object sender, KeyEventArgs args); - public partial class vlnPanel : Panel - { - private int _Opacity = 128; - //public int Opacity - //{ - // get { return _Opacity; } - // set { _Opacity = value; } - //} - - public vlnPanel() - { - InitializeComponent(); - } - - public vlnPanel(IContainer container) - { - container.Add(this); - InitializeComponent(); - } - //protected override CreateParams CreateParams - //{ - // get - // { - // CreateParams prams = base.CreateParams; - // prams.ExStyle |= 0x020; // transparent - // return prams; - // } - //} - //protected override void OnPaint(PaintEventArgs pe) - //{ - // pe.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(_Opacity, this.BackColor)), this.ClientRectangle); - //} - } - - public partial class VlnFlexGrid : C1.Win.C1FlexGrid.C1FlexGrid - { - private bool _Disposed = false; - private static int _CountCreated = 0; - private static int _CountDisposed = 0; - private static int _CountFinalized = 0; - private static int IncrementCountCreated - { get { return ++_CountCreated; } } - private int _CountWhenCreated = IncrementCountCreated; - public static int CountCreated - { get { return _CountCreated; } } - public static int CountNotDisposed - { get { return _CountCreated - _CountDisposed; } } - public static int CountNotFinalized - { get { return _CountCreated - _CountFinalized; } } - private bool _Finalized = false; - ~VlnFlexGrid() - { - if(!_Finalized) _CountFinalized++; - _Finalized = true; - } - private C1SpellChecker _SpellChecker; - public C1SpellChecker SpellChecker - { - get { return _SpellChecker; } - set { _SpellChecker = value; } - } - //public string GridStackTrace - //{ - // get - // { - // string st = Volian.Base.Library.vlnStackTrace.GetStack(); - // st = StripFunnyCharacters(st); - // return st; - // Console.WriteLine(st); - // return st.Replace(@"\","|"); - // } - // set - // { - // ; - // } - //} - //private string StripFunnyCharacters(string st) - //{ - // StringBuilder sb = new StringBuilder(); - // foreach (char c in st) - // { - // if ((c < ' ' || c > 255) && !"\r\n\t".Contains(c.ToString())) - // sb.Append(string.Format("x{0:X4}", (int)c)); - // else - // sb.Append(c); - // } - // return sb.ToString(); - //} - public bool IsDirty - { - get - { - return IsGridChanged(this._MyItemInfo.MyContent.MyGrid.Data, this.GetXMLData()); - } - } - private bool IsGridChanged(string oldXml, string newXml) - { - if (this.TableCellEditor.Text.Contains("")) - return false; - XmlDocument XdOld = new XmlDocument(); - XdOld.LoadXml(oldXml); - XmlDocument XdNew = new XmlDocument(); - XdNew.LoadXml(newXml); - //check volian borders 1st - if (XdNew.SelectSingleNode("C1FlexGrid/Control/MyBorderDetailString").InnerText != XdOld.SelectSingleNode("C1FlexGrid/Control/MyBorderDetailString").InnerText) - return true; - //check row/col sizes 2nd - if (GetRowColSizeString(XdNew) != GetRowColSizeString(XdOld)) - return true; - //check for cell data changes 3rd - if (GetCellDataString(XdNew) != GetCellDataString(XdOld)) - return true; - //check for cell format changes 4th - if (GetCellFormatString(XdNew) != GetCellFormatString(XdOld)) - return true; - //check for merged cells 5th - if (GetCellMergeString(XdNew) != GetCellMergeString(XdOld)) - return true; - return false; - } - private string GetRowColSizeString(XmlDocument xd) - { - string defCW = xd.SelectSingleNode("C1FlexGrid/ColumnInfo/DefaultSize").InnerText; - string defRH = xd.SelectSingleNode("C1FlexGrid/RowInfo/DefaultSize").InnerText; - int cols = int.Parse(xd.SelectSingleNode("C1FlexGrid/ColumnInfo/Count").InnerText); - int rows = int.Parse(xd.SelectSingleNode("C1FlexGrid/RowInfo/Count").InnerText); - List rh = new List(); - for (int i = 0; i < rows; i++) - rh.Add(defRH); - List cw = new List(); - for (int i = 0; i < cols; i++) - cw.Add(defCW); - XmlNodeList nlr = xd.SelectNodes("C1FlexGrid/Rows/Row"); - foreach (XmlNode nr in nlr) - { - int idx = int.Parse(nr.Attributes.GetNamedItem("index").InnerText); - rh[idx] = nr.SelectSingleNode("Height").InnerText; - } - XmlNodeList nlc = xd.SelectNodes("C1FlexGrid/Columns/Column"); - foreach (XmlNode nc in nlc) - { - int idx = int.Parse(nc.Attributes.GetNamedItem("index").InnerText); - cw[idx] = nc.SelectSingleNode("Width").InnerText; - } - string rhcw = "RowHeights: "; - string sep = string.Empty; - foreach (string s in rh) - { - rhcw += sep + s; - sep = ","; - } - rhcw += " - ColWidths: "; - sep = string.Empty; - foreach (string s in cw) - { - rhcw += sep + s; - sep = ","; - } - return rhcw; - } - private string GetCellDataString(XmlDocument xd) - { - int cols = int.Parse(xd.SelectSingleNode("C1FlexGrid/ColumnInfo/Count").InnerText); - int rows = int.Parse(xd.SelectSingleNode("C1FlexGrid/RowInfo/Count").InnerText); - List datum = new List(); - for (int i = 0; i < rows * cols; i++) - datum.Add("|"); - XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Cells/Cell/Data"); - string data = string.Empty; - foreach (XmlNode xn in nl) - { - RichTextBox rtb = new RichTextBox(); - rtb.Rtf = xn.InnerText; - XmlAttribute xa = xn.ParentNode.Attributes.GetNamedItem("index") as XmlAttribute; - string[] rc = xa.InnerText.Split(','); - int r = int.Parse(rc[0]); - int c = int.Parse(rc[1]); - int index = r * cols + c; - datum[index] = "|" + (rtb.Text == "" ? "" : rtb.Text); - } - foreach (string s in datum) - data += s; - return data; - } - private string GetCellFormatString(XmlDocument xd) - { - int cols = int.Parse(xd.SelectSingleNode("C1FlexGrid/ColumnInfo/Count").InnerText); - int rows = int.Parse(xd.SelectSingleNode("C1FlexGrid/RowInfo/Count").InnerText); - List datum = new List(); - for (int i = 0; i < rows * cols; i++) - datum.Add("|"); - XmlNodeList nl = xd.SelectNodes("C1FlexGrid/Cells/Cell/Data"); - string data = string.Empty; - foreach (XmlNode xn in nl) - { - RichTextBox rtb = new RichTextBox(); - rtb.Rtf = xn.InnerText; - XmlAttribute xa = xn.ParentNode.Attributes.GetNamedItem("index") as XmlAttribute; - string[] rc = xa.InnerText.Split(','); - int r = int.Parse(rc[0]); - int c = int.Parse(rc[1]); - int index = r * cols + c; - datum[index] = "|" + (rtb.Text == "" ? "" : rtb.Rtf); - } - foreach (string s in datum) - data += s; - return data; - } - private string GetCellMergeString(XmlDocument xd) - { - if(xd.SelectSingleNode("C1FlexGrid/MergedRanges") == null) - return string.Empty; - return xd.SelectSingleNode("C1FlexGrid/MergedRanges").InnerXml; - } - private static GridCopyInfo _MyCopyInfo; - public static GridCopyInfo MyCopyInfo - { - get - { - if (_MyCopyInfo == null) - _MyCopyInfo = new GridCopyInfo(); - return _MyCopyInfo; - } - } - private Color _DefaultCellBackgroundcolor; - - public Color DefaultCellBackgroundcolor - { - get { return _DefaultCellBackgroundcolor; } - } - private Color _DefaultFixedBackgroundColor; - - public Color DefaultFixedBackgroundColor - { - get { return _DefaultFixedBackgroundColor; } - } - public void CopyToCopiedFlexGrid(GridCopyOption myCopyOption) - { - MyCopyInfo.MyCopiedFlexGrid = new VlnFlexGrid(); //make a copy of the grid being copied - using (StringReader sr = new StringReader(this.GetXMLData())) - { - MyCopyInfo.MyCopiedFlexGrid.ReadXml(sr); - this.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None; - sr.Close(); - } - MyCopyInfo.MyCopyOption = myCopyOption; - OnCopyOptionChanged(this, new EventArgs()); - switch (MyCopyInfo.MyCopyOption) - { - case GridCopyOption.Row: - MyCopyInfo.MyCopiedCellRange = MyCopyInfo.MyCopiedFlexGrid.GetCellRange(Selection.r1, 0, Selection.r2, Cols.Count - 1); - break; - case GridCopyOption.Column: - MyCopyInfo.MyCopiedCellRange = MyCopyInfo.MyCopiedFlexGrid.GetCellRange(0, Selection.c1, Rows.Count - 1, Selection.c2); - break; - case GridCopyOption.Selection: - MyCopyInfo.MyCopiedCellRange = MyCopyInfo.MyCopiedFlexGrid.GetCellRange(Selection.r1, Selection.c1, Selection.r2, Selection.c2); - break; - default: - break; - } - } - public event VlnFlexGridEvent CopyOptionChanged; - public void OnCopyOptionChanged(object sender, EventArgs args) - { - if (CopyOptionChanged != null) CopyOptionChanged(sender, args); - } - - [XmlElement("MyBorders")] - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - public string MyBorderDetailString - { - get - { - return MyBorders.ConvertToString(); - } - set - { - if (value != null) - _MyBorders = VlnBorders.Get(value); - else - _MyBorders = null; - } - } - private VlnBorders _MyBorders; - [XmlIgnore] - public VlnBorders MyBorders - { - get - { - if (_MyBorders == null) - _MyBorders = new VlnBorders(GridLinePattern.Single, Rows.Count, Cols.Count); - return _MyBorders; - } - set { _MyBorders = value; } - } - private ItemInfo _MyItemInfo; - public ItemInfo GetMyItemInfo() - { - return _MyItemInfo; - } - //public ItemInfo MyItemInfo - //{ - // get { return _MyItemInfo; } - // set { _MyItemInfo = value; } - //} - public bool TopRowHasBorder() - { - for (int c = 0; c < Cols.Count - 1; c++) - if (MyBorders.HorizontalLines[0, c] != GridLinePattern.None) return true; - return false; - } - public void SetBorders(CellRange myRange, - GridLinePattern top, GridLinePattern middle, GridLinePattern bottom, - GridLinePattern left, GridLinePattern center, GridLinePattern right) - { - for (int r = myRange.r1; r <= myRange.r2; r++) - for (int c = myRange.c1; c <= myRange.c2; c++) - { - CellRange cr = GetMergedRange(r, c); - if (r == myRange.r1) // Top Border - if(top != GridLinePattern.Mixed) MyBorders.HorizontalLines[cr.r1, cr.c1]=top; - if (c == myRange.c1) // Left Border - if(left != GridLinePattern.Mixed) MyBorders.VerticalLines[cr.r1, cr.c1]=left; - if (r == myRange.r2) // Bottom Border - if(bottom != GridLinePattern.Mixed) MyBorders.HorizontalLines[cr.r2 + 1, cr.c2]=bottom; - if (c == myRange.c2) // Right Border - if(right != GridLinePattern.Mixed) MyBorders.VerticalLines[cr.r2, cr.c2 + 1] = right; - if (r == cr.r1 && c == cr.c1) // Look for inside lines - { - if (cr.r1 > myRange.r1 && cr.r1 <= myRange.r2) // Inside Horizontal Top - if (middle != GridLinePattern.Mixed) - { - MyBorders.HorizontalLines[cr.r1, cr.c1] = middle; - MyBorders.HorizontalLines[cr.r1, cr.c2] = middle; - } - if (cr.r2 > myRange.r1 && cr.r2 < myRange.r2) // Inside Horizontal Bottom - if(middle != GridLinePattern.Mixed) MyBorders.HorizontalLines[cr.r2 + 1, cr.c2]=middle; - if (cr.c1 > myRange.c1 && cr.c1 <= myRange.c2) // Inside Vertical Left - if (center != GridLinePattern.Mixed) - { - MyBorders.VerticalLines[cr.r1, cr.c1] = center; - MyBorders.VerticalLines[cr.r2, cr.c1] = center; - } - if (cr.c2 > myRange.c1 && cr.c2 < myRange.c2) // Inside Vertical Right - if(center != GridLinePattern.Mixed) MyBorders.VerticalLines[cr.r2, cr.c2 + 1]=center; - } - c = cr.c2;//Skip to the end of the merged cells - } - - } - public void PasteBorders(int r, int c, int br, int bc) - { - MyBorders.HorizontalLines[r, c] = MyCopyInfo.MyCopiedFlexGrid.MyBorders.HorizontalLines[br,bc]; - MyBorders.VerticalLines[r, c] = MyCopyInfo.MyCopiedFlexGrid.MyBorders.VerticalLines[br, bc]; - MyBorders.HorizontalLines[r+1, c] = MyCopyInfo.MyCopiedFlexGrid.MyBorders.HorizontalLines[br+1, bc]; - MyBorders.VerticalLines[r, c+1] = MyCopyInfo.MyCopiedFlexGrid.MyBorders.VerticalLines[br, bc+1]; - } - - [XmlIgnore] - public bool HasVScroll - { - get - { - return RTBAPI.HasVertScroll(this); - } - } - [XmlIgnore] - public bool HasHScroll - { - get - { - return RTBAPI.HasHorzScroll(this); - } - } - public event VlnFlexGridEvent OpenAnnotations; - public void OnOpenAnnotations(object sender, EventArgs args) - { - if (OpenAnnotations != null) OpenAnnotations(sender, args); - } - public event VlnFlexGridCursorMovementEvent CursorMovement; - internal void OnCursorMovement(object sender, VlnFlexGridCursorMovementEventArgs args) - { - if (CursorMovement != null) CursorMovement(sender, args); - } - public event VlnFlexGridPasteEvent AdjustPastedText; - internal string OnAdjustPastedText(object sender, VlnFlexGridPasteEventArgs args) - { - if (AdjustPastedText != null) return AdjustPastedText(sender, args); - return args.Text; - } - public event VlnFlexGridkeyEvent EnterKeyPressed; - public void OnEnterKeyPressed(object sender, KeyEventArgs args) - { - if (EnterKeyPressed != null) EnterKeyPressed(sender, args); - } - - private TableCellEditor _tableCellEditor; - - public TableCellEditor TableCellEditor - { - get { return _tableCellEditor; } - set { _tableCellEditor = value; } - } - private TableClipBoardFuncts _clpbrdCpyPste; - private int _minColSplitWidth = 10; - //private int _minRowSplitHeight = 23; - - //private int _minSplitColWidth = 10; - //private int _minSplitRowHeight = 20; - private E_ViewMode _vwMode = E_ViewMode.Edit; - [XmlIgnore] - internal E_ViewMode VwMode - { - get { return _vwMode; } - set - { - _vwMode = value; - AllowEditing = _vwMode == E_ViewMode.Edit; - } - } - private bool _IsRoTable = false; - public bool IsRoTable - { - get { return _IsRoTable; } - set { _IsRoTable = value; } - } - private int _RODbId; - public int RODbId - { - get { return _RODbId; } - set { _RODbId = value; } - } - private string _ROID; - - public string ROID - { - get { return _ROID; } - set { _ROID = value; } - } - private float? _DPI = null; - public float? DPI - { - get - { - if (_DPI == null) - _DPI = 120; - return _DPI; - } - set - { - if (DPI != value) - { - _DPI = value; - } - } - } - #region Grid Initialize - - public VlnFlexGrid() - { - InitializeComponent(); - SetupGrid(4, 3); // use a default row and column count - } - - public VlnFlexGrid(int rows, int cols) - { - InitializeComponent(); - SetupGrid(rows, cols); - } - - public VlnFlexGrid(IContainer container) - { - container.Add(this); - InitializeComponent(); - SetupGrid(1, 1); - } - public VlnFlexGrid(ContentItem ci) - { - InitializeComponent(); - SetupGrid(4, 3); // use a default row and column count - _MyItemInfo = ci.MyItem.MyItemInfo; - } - //public VlnFlexGrid(IContainer container) - //{ - // container.Add(this); - - // InitializeComponent(); - // _tableCellEditor = new TableCellEditor(this); - // _tableCellEditor.ContentsResized += new ContentsResizedEventHandler(_tableCellEditor_ContentsResized); - //} - - //void _tableCellEditor_ContentsResized(object sender, ContentsResizedEventArgs e) - //{ - // if (_tableCellEditor._initializingEdit) return; - // CellRange cr = GetMergedRange(Row, Col); - // int oH = cr.UserData == null? 0 : (int)cr.UserData; - // int nH = _tableCellEditor.ContentsRectangle.Height; - // int Hadj = (nH - oH); - // cr.UserData = _tableCellEditor.ContentsRectangle.Height; - // int cellHeight = GetCellHeight(Row,Col); - // int cellheightNLines = cellHeight / (Rows.DefaultSize - 3); - // int nHNLines = nH / (Rows.DefaultSize - 3); - // if (Hadj != 0) - // { - // int curHeight = (Rows[Row].Height == -1) ? Rows.DefaultSize : Rows[Row].Height; - // //if (Hadj > 0 && cellHeight <= oH) - // if (Hadj > 0 && cellheightNLines < nHNLines) - // curHeight += (Rows.DefaultSize - 3); - // if (Hadj < 0 && CanReduceRow()) - // curHeight -= (Rows.DefaultSize-3); - // Rows[Row].Height = curHeight; - // AdjustGridControlSize(); - // } - // //cr.UserData = _tableCellEditor.ContentsRectangle.Height; - // //int mh = GetMaxRowHeight(); - // ////Rows[Row].Height = mh + 2; - // //int h = 0; - // //if (cr.r1 == cr.r2 && cr.c1 == cr.c2) - // // h = Rows[Row].Height - 2; - // //else - // //{ - // // for (int r = cr.r1; r <= cr.r2; r++) - // // h += Rows[r].Height - 2; - // //} - // //Rows[Row].Height += (mh - h); - // ////AdjustGridControlSize(); - //} - private int GetCellHeight(int row, int col) - { - return GetRangeHeight(GetMergedRange(row, col))-3; - } - - public int GetRangeHeight(CellRange cr) - { - int height = 0; - for (int r = cr.r1; r <= cr.r2; r++) - height += (Rows[r].Height == -1) ? Rows.DefaultSize : Rows[r].Height; - return height; - } - - public int GetRangeTop(CellRange cr) - { - int top = 0; - for (int r = 0; r < cr.r1; r++) - top += (Rows[r].Height == -1) ? Rows.DefaultSize : Rows[r].Height; - return top; - } - - public int GetRangeWidth(CellRange cr) - { - int width = 0; - for (int c = cr.c1; c <= cr.c2; c++) - width += (Cols[c].Width == -1) ? Cols.DefaultSize : Cols[c].Width; - return width; - } - - public int GetRangeLeft(CellRange cr) - { - int left = 0; - for (int c = 0; c < cr.c1; c++) - left += (Cols[c].Width == -1) ? Cols.DefaultSize : Cols[c].Width; - return left; - } - - public int GetRangeRowsMin(CellRange cr) - { - int rowsMin = 1 + cr.r2 - cr.r1; - for (int c = cr.c1; c <= cr.c2; c++) - { - int rows = 0; - for (int r = cr.r1; r <= cr.r2; r++) - { - CellRange chk = GetMergedRange(r, c); - if (chk.r1 == r && chk.c1 == c) - rows++; - } - rowsMin = Math.Min(rowsMin, rows); - } - return rowsMin; - } - - public int GetRangeRowsMax(CellRange cr) - { - int rowsMax = 0; - for (int c = cr.c1; c <= cr.c2; c++) - { - int rows = 0; - for (int r = cr.r1; r <= cr.r2; r++) - { - CellRange chk = GetMergedRange(r, c); - if (chk.r1 == r && chk.c1 == c) - rows++; - } - rowsMax = Math.Max(rowsMax, rows); - } - return rowsMax; - } - - public int GetRangeColsMin(CellRange cr) - { - int colsMin = 1 + cr.c2 - cr.c1; - for (int r = cr.r1; r <= cr.r2; r++) - { - int cols = 0; - for (int c = cr.c1; c <= cr.c2; c++) - { - CellRange chk = GetMergedRange(r, c); - if (chk.r1 == r && chk.c1 == c) - cols++; - } - colsMin = Math.Min(colsMin, cols); - } - return colsMin; - } - - public int GetRangeColsMax(CellRange cr) - { - int colsMax = 0; - for (int c = cr.c1; c <= cr.c2; c++) - { - int cols = 0; - for (int r = cr.r1; r <= cr.r2; r++) - { - CellRange chk = GetMergedRange(r, c); - if (chk.r1 == r && chk.c1 == c) - cols++; - } - colsMax = Math.Max(colsMax, cols); - } - return colsMax; - } - - public string GetRangeRowList(CellRange cr) - { - StringBuilder sb = new StringBuilder(); - string sep = ""; - for (int r = cr.r1; r <= cr.r2; r++) - { - CellRange crm = GetMergedRange(r, cr.c1); - if (crm.r1 == r) - { - sb.Append(sep + r.ToString()); - sep = "."; - } - r = crm.r2; - } - return sb.ToString(); - } - - private int BlankRowSpace() - { - int curRowHeight = (Rows[Row].Height == -1) ? Rows.DefaultSize - 3 : Rows[Row].Height - 3; - if (curRowHeight <= (Rows.DefaultSize - 3)) return 0; // never have row less than default height - int blankRowSpace = curRowHeight; - for (int c = 0; c < Cols.Count; c++) - { - CellRange cr = GetMergedRange(Row, c); - if (Row >= cr.r1 && Row <= cr.r2) - { - int cellHeight = GetCellHeight(Row, c); - int dataHeight = (cr.UserData == null) ? cellHeight : (int)cr.UserData; - int ud = dataHeight / (Rows.DefaultSize - 3); - //if (cellHeight < dataHeight) - // Console.WriteLine("r {0}, c {1}, cell{2}, data{3}", Row, c, cellHeight, dataHeight); - blankRowSpace = Math.Min(blankRowSpace, Math.Max(0,cellHeight - dataHeight)); - } - } - //Console.WriteLine("BlankRowSpace {0}", blankRowSpace); - return blankRowSpace; - } - - private int GetCellWidth(int row, int col) - { - int width = 0; - CellRange cr = GetMergedRange(row, col); - for (int c = cr.c1; c <= cr.c2; c++) - { - width += (Cols[c].Width == -1) ? Cols.DefaultSize - 3 : Cols[c].Width -3; - } - return width; - } - - private int BlankColSpace() - { - int curColWidth = (Cols[Col].Width == -1) ? Cols.DefaultSize - 3 : Cols[Col].Width-3; - //int curRowHeightNLines = curRowHeight / (Rows.DefaultSize - 3); - if (curColWidth <= Cols.DefaultSize - 3) return 0; // never have col less than default width - int blankColSpace = curColWidth; - for (int r = 0; r < Rows.Count; r++) - { - using (StepRTB srtb = new StepRTB()) - { - CellRange cr = GetMergedRange(r, Col); - srtb.Rtf = GetCellRTFString(cr.r1, cr.c1); - if (Col >= cr.c1 && Col <= cr.c2) - { - int cellWidth = GetCellWidth(r, Col); - //srtb.Width = cellWidth; - srtb.AdjustWidthForContent(); - //Application.DoEvents(); - //int mergeCellHeightNLines = cellHeight / (Rows.DefaultSize - 3); - //int dataHeight = (cr.UserData == null) ? cellHeight : (int)cr.UserData; - //int ud = dataHeight / (Rows.DefaultSize - 3); - //if (cellHeight < dataHeight) - // Console.WriteLine("r {0}, c {1}, cell{2}, data{3}", Row, c, cellHeight, dataHeight); - //blankColSpace = Math.Min(blankColSpace, Math.Max(0, cellWidth - srtb.MaxTextWidth)); - blankColSpace = Math.Min(blankColSpace, Math.Max(0, cellWidth - srtb.Width)); - } - } - } - //Console.WriteLine("BlankRowSpace {0}", blankRowSpace); - return blankColSpace; - } - //private bool CanReduceRow() - //{ - // int curRowHeight = (Rows[Row].Height == -1) ? Rows.DefaultSize - 3 : Rows[Row].Height - 3; - // int curRowHeightNLines = curRowHeight / (Rows.DefaultSize - 3); - // bool bReduce = (curRowHeight > (Rows.DefaultSize - 3)); - // if (bReduce) - // { - // for (int c = 0; c < Cols.Count; c++) - // { - // CellRange cr = GetMergedRange(Row, c); - // if (Row >= cr.r1 && Row <= cr.r2) - // { - // int mergeCellHeightNLines = GetCellHeight(Row, c) / (Rows.DefaultSize - 3); - // //int ud = (cr.UserData == null) ? 0 : (int)cr.UserData; - // //if ((c != Col) && curRowHeight <= ud && ud >= mergeCellHeight) - // // bReduce = false; - // int ud = ((cr.UserData == null) ? 0 : (int)cr.UserData) / (Rows.DefaultSize - 3); - // if ((c != Col) && curRowHeightNLines <= ud && ud >= mergeCellHeightNLines) - // bReduce = false; - // } - // } - // } - // //Console.WriteLine("canreduce {0}, {1}", Row, bReduce); - // return bReduce; - //} - //private int GetMaxRowHeight() - //{ - // int maxRTFHeight = _minRowSplitHeight; //Rows.DefaultSize;// the smallest a row can be - // Console.WriteLine("================================================================="); - // for (int c = 0; c < Cols.Count; c++) - // { - // CellRange cr = GetMergedRange(Row, c);//GetCellRange(Row, c); - // maxRTFHeight = Math.Max(maxRTFHeight, (int)cr.UserData); - // if (c == 0) - // Console.WriteLine("Height in Row[{0}] = {1}", Row, Rows[Row].Height); - // Console.WriteLine("UserData Cell[{0},{1}] = {2}", Row, c, cr.UserData); - // } - // return maxRTFHeight; - //} - - private bool IsInMergeRange(int row, int col) - { - //foreach (CellRange cr in this.MergedRanges) - //{ - // if (cr.Contains(row, col)) - // return true; // in a merged range - //} - CellRange cr = GetMergedRange(row, col); - return (cr.r1 == row && cr.c1 == col); - } - private bool _ReadingXml = false; - - public bool ReadingXml - { - get { return _ReadingXml; } - } - private static Regex _ReplaceVESymbFix = new Regex(@"({\\f[0-9]+[^ ]* )(VESymbFix)(;})"); - private static Regex _ReplaceArialUnicodeMS = new Regex(@"({\\f[0-9]+[^ ]* )(Arial Unicode MS)(;})"); - private static Regex _ReplaceTextFont = new Regex(@"({\\f[0-9]+[^ ]* )(?((?!VESymbFix)(?!Arial Unicode MS))([^;]*)|(!!!!))(;})"); - public void LoadGrid(ItemInfo itemInfo) - { - _MyItemInfo = itemInfo; - string str = itemInfo.MyContent.MyGrid.Data; - VE_Font vefont = _MyItemInfo.GetItemFont(); - FontFamily ff = StepRTB.MyFontFamily ?? vefont.WindowsFont.FontFamily; // TODO: Does not change fixed font. - if (StepRTB.MySymbolFontName != "VESymbFix") - str = _ReplaceVESymbFix.Replace(str, "$1" + StepRTB.MySymbolFontName + "$3"); - if (StepRTB.MySymbolFontName != "Arial Unicode MS") - str = _ReplaceArialUnicodeMS.Replace(str, "$1" + StepRTB.MySymbolFontName + "$3"); - str = _ReplaceTextFont.Replace(str, "$1" + ff.Name + "$4"); - // To prevent scroll bars from being flashed on/off - // - save an image of the current grid - // - set Visible to false - // - draw the saved grid image - // - do the the load/reload of the grid - // - set Visible back to true. - System.Drawing.Image img = this.CreateImage(); - Visible = false; - if (Parent is GridItem) - { - using (Graphics gr = (Parent as GridItem).CreateGraphics()) - { - gr.DrawImage(img, Left, Top); - } - } - Clear(); - MergedRanges.Clear(); - _ReadingXml = true; - //Console.WriteLine("LoadGrid - Before ReadXML"); - using (StringReader sr = new StringReader(str)) - { - ReadXml(sr); - this.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None; - sr.Close(); - } - //Console.WriteLine("LoadGrid - After ReadXML"); - _ReadingXml = false; - Select(-1, -1); // this keeps the cell from being selected when the grid is first displayed - Visible = true; - } - private void SetupGrid(int numrows, int numcols) //C1FlexGrid NewGrid() - { - // setup the default size of each cell in the table/grid - this.Cols.DefaultSize = (int) DPI; - this.Rows.DefaultSize = 20; - - // setup the number of rows and columns - this.Rows.Count = numrows; - this.Cols.Count = numcols; - - // make all the cell editable - this.Rows.Fixed = 0; - this.Cols.Fixed = 0; - - this.DrawMode = DrawModeEnum.OwnerDraw; - this.ScrollBars = ScrollBars.None; - - // grid styles - this.Styles.EmptyArea.BackColor = Color.Transparent; - this.Styles.EmptyArea.Border.Style = BorderStyleEnum.None; - this.Styles.Normal.Border.Color = Color.Black; - this.Styles.Normal.TextAlign = C1.Win.C1FlexGrid.TextAlignEnum.LeftTop; - - //SetupCellStyles(); - - this.FocusRect = FocusRectEnum.Solid; - this.Styles.Highlight.BackColor = Color.LightCyan; - this.Styles.Highlight.ForeColor = Color.Black; - this.Styles.Focus.BackColor = Color.LightCyan; - this.HighLight = HighLightEnum.WithFocus; - - _DefaultCellBackgroundcolor = this.StyleBackColor; - _DefaultFixedBackgroundColor = this.Styles.Fixed.BackColor; - this.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.Custom; - - this.AllowResizing = C1.Win.C1FlexGrid.AllowResizingEnum.Both; - - - _tableCellEditor = new TableCellEditor(this); - _tableCellEditor.HeightChanged += new StepRTBEvent(_tableCellEditor_HeightChanged); - _clpbrdCpyPste = new TableClipBoardFuncts(); - _SpellChecker = _tableCellEditor.SpellCheckerInstance; - - this.AfterResizeRow += new C1.Win.C1FlexGrid.RowColEventHandler(this.Grid_AfterResize); - this.StartEdit += new C1.Win.C1FlexGrid.RowColEventHandler(this._StartEdit); - this.AfterEdit += new C1.Win.C1FlexGrid.RowColEventHandler(this._AfterEdit); - this.AfterScroll += new C1.Win.C1FlexGrid.RangeEventHandler(this._AfterScroll); - this.AfterResizeColumn += new C1.Win.C1FlexGrid.RowColEventHandler(this.Grid_AfterResize); - this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this._KeyPress); - this.OwnerDrawCell += new OwnerDrawCellEventHandler(this.Grid_OwnerDrawCell); - this.LeaveCell += new EventHandler(VlnFlexGrid_LeaveCell); - - this.KeyDown += new KeyEventHandler(VlnFlexGrid_KeyDown); - this.KeyUp +=new KeyEventHandler(VlnFlexGrid_KeyUp); - TableCellEditor.EditMode = TableCellEditor.Visible; // need to comment out for compile for only jsj - 07FEB2011 - this.MouseDown += new MouseEventHandler(VlnFlexGrid_MouseDown); - } - - private bool _FirstEntry = false; - - public bool FirstEntry - { - get { return _FirstEntry; } - set { _FirstEntry = value; } - } - - void VlnFlexGrid_MouseDown(object sender, MouseEventArgs e) - { - int left = 0; - int top = 0; - int col = 0; - int row = 0; - int strow = Selection.r1; - int stcol = Selection.c1; - int erow = Selection.r2; - int ecol = Selection.c2; - while (e.X > left && col < Cols.Count) - { - left += Cols[col].Width > 0 ? Cols[col].Width : Cols.DefaultSize; - col++; - } - while (e.Y > top && row < Rows.Count) - { - top += Rows[row].Height > 0 ? Rows[row].Height : Rows.DefaultSize; - row++; - } - col--; - row--; - //Console.WriteLine("Mousedown Selection {0}", Selection); - //Console.WriteLine("Mousedown Row, Col [{0},{1}]", row, col); - erow = Math.Max(erow, row); - ecol = Math.Max(ecol, col); - if (_FirstEntry) - Select(row, col); - else - Select(strow, stcol, erow, ecol); - _FirstEntry = false; - } - - - - void _tableCellEditor_HeightChanged(object sender, EventArgs args) - { - if (_tableCellEditor._initializingEdit || !_tableCellEditor.Visible) return; - int curHeight = GetCellHeight(Row, Col);//(Rows[Row].Height == -1) ? Rows.DefaultSize : Rows[Row].Height; - CellRange cr = GetMergedRange(Row, Col); - int oH = cr.UserData == null ? curHeight : (int)cr.UserData; - int nH = _tableCellEditor.Height; //.ContentsRectangle.Height; - int Hadj = (nH - curHeight);//oH); - cr.UserData = _tableCellEditor.Height; //.ContentsRectangle.Height; - //int cellHeight = GetCellHeight(Row, Col); - //int cellheightNLines = cellHeight / (Rows.DefaultSize - 3); - //int nHNLines = nH / (Rows.DefaultSize - 3); - if (Hadj != 0) - { - //if (Hadj > 0 && cellHeight <= oH) - //if (Hadj > 0 && cellheightNLines < nHNLines) - // curHeight += (Rows.DefaultSize - 3); - //if (Hadj < 0 && CanReduceRow()) - // curHeight -= (Rows.DefaultSize - 3); - int blankRowSpace = BlankRowSpace(); - if (Hadj < 0) - Hadj = -Math.Min(-Hadj, blankRowSpace); - //if (Hadj > 0) - // Console.WriteLine("r {0}, nh {1}, curh{2}", Row, nH, curHeight); - if (Hadj != 0) - { - int newHeight = Hadj + ((Rows[Row].Height < 0) ? Rows.DefaultSize : Rows[Row].Height); - //Rows[Row].Height += Hadj;//= curHeight; - Rows[Row].Height = newHeight; - AdjustGridControlSize(); - } - } - } - void VlnFlexGrid_KeyUp(object sender, KeyEventArgs e) - { - if (e.Control) - { - if (e.Alt) - { - switch (e.KeyCode) - { - case Keys.M: - OnOpenAnnotations(this, new EventArgs()); - e.Handled = true; - break; - default: - break; - } - } - } - } - void VlnFlexGrid_KeyDown(object sender, KeyEventArgs e) - { - switch (e.KeyCode) - { - case Keys.Left: - if (e.Shift) return; - _tableCellEditor.StepRTB_ArrowPressed(e.Control ? E_ArrowKeys.CtrlLeft : E_ArrowKeys.Left); - e.Handled = true; - break; - case Keys.Up: - if (e.Shift) return; - _tableCellEditor.StepRTB_ArrowPressed(e.Control ? E_ArrowKeys.CtrlUp : E_ArrowKeys.Up); - e.Handled = true; - break; - case Keys.Right: - if (e.Shift) return; - if (IsRoTable) Select(Rows.Count - 1, Cols.Count - 1); - _tableCellEditor.StepRTB_ArrowPressed(e.Control ? E_ArrowKeys.CtrlRight : E_ArrowKeys.Right); - e.Handled = true; - break; - case Keys.Down: - if (e.Shift) return; - if (IsRoTable) Select(Rows.Count - 1, 0); - _tableCellEditor.StepRTB_ArrowPressed(e.Control ? E_ArrowKeys.CtrlDown : E_ArrowKeys.Down); - e.Handled = true; - break; - case Keys.Enter: - //if (e.Shift) return; - //Select(Rows.Count - 1, 0); - //_tableCellEditor.StepRTB_ArrowPressed(E_ArrowKeys.Down); - //e.Handled = true; - if (!e.Control && !e.Shift && !e.Alt) - { - OnEnterKeyPressed(sender, e); - } - break; - } - } - - void VlnFlexGrid_LeaveCell(object sender, EventArgs e) - { - //CellStyle csd = this.CursorCell.StyleDisplay; - //CellStyle cs = this.GetCellRange(Row, Col).Style; - //if (cs != null) - //{ - // Console.WriteLine("LeaveCell Style = {0}", cs.Name); - // Console.WriteLine("LeaveCell StyleDisplay = {0}", csd.Name); - // cs.ForeColor = Color.Black; - //} - CellStyle cs = this.Styles["Focus"]; - cs.ForeColor = Color.Black; - cs = this.Styles["Highlight"]; - cs.ForeColor = Color.Black; - } - - //void VlnFlexGrid_LeaveEdit(object sender, RowColEventArgs e) - //{ - // //Console.WriteLine("LeaveEdit Style = {0}", this.GetCellRange(e.Row, e.Col).Style.Name); - // this.GetCellRange(e.Row, e.Col).Style.ForeColor = Color.Black; - //} - private void Grid_OwnerDrawCell(object sender, C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e) - { - using (RTF _rtf = new RTF()) - { - // use nearest solid color - // (the RTF control doesn't dither, and doesn't support transparent backgrounds) - Color solid = e.Graphics.GetNearestColor(e.Style.BackColor); - DPI = e.Graphics.DpiX; - if (e.Style.BackColor != solid) - e.Style.BackColor = solid; - - // check whether the cell contains RTF - string rtfText = this.GetDataDisplay(e.Row, e.Col).Replace(@"\~", @"\u160?"); - GridItem gi = Parent as GridItem; - if (gi != null) - { - DisplayText dt = new DisplayText(gi.MyItemInfo, rtfText, true); - rtfText = dt.StartText; - } - // it does, so draw background - e.DrawCell(DrawCellFlags.Background); - if (rtfText.StartsWith(@"{\rtf")) - { - // Please add a comment if this value needs to be changed - _rtf.Rtf = rtfText; - // draw the RTF text - if (e.Bounds.Width > 0 && e.Bounds.Height > 0) - { - _rtf.Width = e.Bounds.Width - 1; // This has also been -3 which matchs the rener command - CellRange cr = GetMergedRange(e.Row, e.Col); - cr.UserData = _rtf.Height; - int hAdjust = 0; - int hDiff = e.Bounds.Height - _rtf.Height; - if (hDiff < 0) - { - Rows[e.Row].Height = _rtf.Height + 4; - AdjustGridControlSize(); - hDiff = 0; - } - if (e.Style != null) - { - switch (e.Style.TextAlign) - { - case TextAlignEnum.CenterBottom: - case TextAlignEnum.GeneralBottom: - case TextAlignEnum.LeftBottom: - case TextAlignEnum.RightBottom: - hAdjust = hDiff; - break; - case TextAlignEnum.CenterCenter: - case TextAlignEnum.GeneralCenter: - case TextAlignEnum.LeftCenter: - case TextAlignEnum.RightCenter: - hAdjust = hDiff / 2; - break; - default: - break; - } - } - if (IsRoTable) - { - _rtf.ForeColor = Color.Red; - } - else - { - _rtf.ForeColor = e.Style.ForeColor; - } - _rtf.BackColor = e.Style.BackColor; - _rtf.Render(e.Graphics, new Rectangle(e.Bounds.X + 1, e.Bounds.Y + hAdjust, e.Bounds.Width - 3, e.Bounds.Height)); - } - } - else - _rtf.Text = rtfText; - - // spell check unless (we're just measuring) - if (!e.Measuring) - { - CharRangeList errors = SpellChecker.CheckText(_rtf.Text);//(text); - // underline errors - if (errors.Count > 0) - { - CharacterRange[] ranges = new CharacterRange[1]; - ranges[0] = new CharacterRange(0, 1); - Pen pn = new Pen(Color.Green, 2); - StringFormat sf = new StringFormat(e.Style.StringFormat); - sf.SetMeasurableCharacterRanges(ranges); - Rectangle rc = e.Style.GetTextRectangle(e.Bounds, null); - Region[] rgns = e.Graphics.MeasureCharacterRanges(_rtf.Text, e.Style.Font, rc, sf);//(text, e.Style.Font, rc, sf); - float btm = rgns[0].GetBounds(e.Graphics).Bottom; - float top = rgns[0].GetBounds(e.Graphics).Top; - int adj = (int)(btm - top); - for (int i = 0; i < errors.Count; i++) - { - // The positioning of the the squigle line does not account for mixed font sizes - // should we support having mixed fonts in the table cells, we will need to add - // logic to support it. - Point ptStart = _rtf.GetPositionFromCharIndex(errors[i].Start); - Point ptEnd = _rtf.GetPositionFromCharIndex(errors[i].Start + errors[i].Length); - SquigleLine(e.Graphics, e.Bounds.Left + ptStart.X, e.Bounds.Top + ptStart.Y + adj, e.Bounds.Left + ptEnd.X); - } - } - } - // and draw border last - //e.DrawCell(DrawCellFlags.Border); - // This can be used to draw more specific borders - DrawCellBorder(e); - // we're done with this cell - e.Handled = true; - } - } - - private void SquigleLine(Graphics graphics, int x1, int y1, int x2) - { - for (Point pt = new Point(x1, y1); pt.X + 2 < x2; pt.X += 4) - { - //Console.WriteLine("squiggle point {0}", pt); - graphics.DrawLines(Pens.Red, new Point[] - { - new Point(pt.X, pt.Y), - new Point(pt.X + 2, pt.Y - 2), - new Point(pt.X + 4, pt.Y) - }); - } - } - private static Color _BorderColor = Color.Black; - public static Color BorderColor - { - get { return VlnFlexGrid._BorderColor; } - set { VlnFlexGrid._BorderColor = value; } - } - private void DrawCellBorder(C1.Win.C1FlexGrid.OwnerDrawCellEventArgs e) - { - Graphics grGrid =e.Graphics; - Rectangle bounds = e.Bounds; - int row = e.Row; - int col = e.Col; - CellRange cr = GetMergedRange(row, col); - GridLinePattern topSide = MyBorders.HorizontalLines[cr.r1,cr.c1]; - GridLinePattern rightOfTopSide = cr.c2 == Cols.Count - 1 ? GridLinePattern.None : MyBorders.HorizontalLines[cr.r1, cr.c2 + 1]; - GridLinePattern leftOfTopSide = cr.c1 == 0? GridLinePattern.None : MyBorders.HorizontalLines[cr.r1, cr.c1 - 1]; - GridLinePattern leftSide = MyBorders.VerticalLines[cr.r1, cr.c1]; - GridLinePattern aboveLeftSide = cr.r1 == 0 ? GridLinePattern.None : MyBorders.VerticalLines[cr.r1 - 1, cr.c1]; - GridLinePattern belowLeftSide = cr.r2 == Rows.Count - 1 ? GridLinePattern.None : MyBorders.VerticalLines[cr.r2 + 1, cr.c1]; - GridLinePattern bottomSide = MyBorders.HorizontalLines[cr.r2+1, cr.c2]; - GridLinePattern rightOfBottomSide = cr.c2 == Cols.Count - 1 ? GridLinePattern.None : MyBorders.HorizontalLines[cr.r2 + 1, cr.c2 + 1]; - GridLinePattern rightSide = MyBorders.VerticalLines[cr.r2, cr.c2+1]; - GridLinePattern belowRightSide = cr.r2 == Rows.Count - 1 ? GridLinePattern.None : MyBorders.VerticalLines[cr.r2 + 1, cr.c2 + 1]; - GridLinePattern none = GridLinePattern.None; - int x1 = bounds.Left; - int y1 = bounds.Top; - int x2 = bounds.Right - 1; - int y2 = bounds.Bottom - 1; - GridItem myGridItem = Parent as GridItem; - Panel myPanel = Parent as Panel; - if (myGridItem == null && myPanel == null) return; - if (row == 0 || col == 0) // Top or Left Edge - Draw on parent - { - using (Graphics grParent = myGridItem != null ? myGridItem.CreateGraphics() : myPanel.CreateGraphics()) - { - if (row == 0) - { - if (col == 0) - { - // Draw the top left intersection - DrawIntersection(grParent, Left - 3, Top-1, none, topSide,leftSide, none); - } - // Draw the top right intersection - DrawIntersection(grParent, Left +x2 - 2, Top-1, none, rightOfTopSide,rightSide,topSide); - // Draw the top side on the parent - DrawLine(grParent, topSide, Left + x1, Top + y1 - 1, Left + x2-3, Top + y1 -1); - } - if (col == 0) - { - // Draw the bottom left intersection - DrawIntersection(grParent, Left -3, Top + y2, leftSide,bottomSide,belowLeftSide,none); - // Draw the left side - DrawLine(grParent, leftSide, Left + x1 - 1, Top + y1, Left + x1 - 1, Top + y2-3); - } - } - } - // Draw the bottom right intersection - DrawIntersection(grGrid, x2 - 2, y2, rightSide, rightOfBottomSide, belowRightSide, bottomSide); - // Draw the bottom side - DrawLine(grGrid, bottomSide, x1, y2, x2-3, y2); - // Draw the right side - DrawLine(grGrid, rightSide, x2, y1, x2, y2-3); - } - private static void DrawLine(Graphics gr, GridLinePattern pattern, int x1, int y1, int x2, int y2) - { - if (pattern == GridLinePattern.None) return; - Pen pn = VlnBorders.LinePen(pattern, BorderColor); - DrawLine(gr, pn, pattern, x1, y1, x2, y2); - } - private static void DrawLine(Graphics gr, Pen pn, int x1, int y1, int x2, int y2) - { - DrawLine(gr, pn, GridLinePattern.Single, x1, y1, x2, y2); - } - private static void DrawLine(Graphics gr, Pen pn, GridLinePattern pattern, int x1, int y1, int x2, int y2) - { - int dx = 0; - int dy = 0; - int dblx = 0; - int dbly = 0; - int xThick = 0; - int yThick = 0; - if (x1 == x2) // Vertical Line - { - dx = (int) (-pn.Width / 2); - dblx = -2; - if (pn.Width > 2) - yThick = 1; - } - else // Horizontal Line - { - dy = (int) (-pn.Width / 2); - dbly = -2; - if (pn.Width > 2) - xThick = 1; - } - gr.DrawLine(pn, x1 + dx, y1 + dy, x2 + dx + xThick, y2 + dy + yThick); - if(pattern == GridLinePattern.Double) - gr.DrawLine(pn, x1 + dx +dblx, y1 + dy + dbly, x2 + dx+dblx, y2 + dy+dbly); - } - private static void DrawIntersection(Graphics gr, int x, int y, GridLinePattern up, GridLinePattern right, GridLinePattern down, GridLinePattern left) - { - if (up == GridLinePattern.Double) - if (right == GridLinePattern.Double) - if (down == GridLinePattern.Double) - if (left == GridLinePattern.Double) DrawIntersectionAllDoubles(gr, x, y); - else DrawDrawIntersection3Doubles_URD(gr, x, y); - else // Down is not double - if (left == GridLinePattern.Double) DrawDrawIntersection3Doubles_URL(gr, x, y); - else DrawDrawIntersection2Doubles_UR(gr, x, y, down, left); - else // right is not double - if (down == GridLinePattern.Double) - if (left == GridLinePattern.Double) DrawDrawIntersection3Doubles_UDL(gr, x, y); - else DrawDrawIntersection2Doubles_UD(gr, x, y, right, left); - else // Down is not double - if (left == GridLinePattern.Double) DrawIntersection2Doubles_UL(gr, x, y, right, down); - else DrawIntersectionOneDoubleOrLess(gr, x, y, up, right, down, left); - else - if (right == GridLinePattern.Double) - if (down == GridLinePattern.Double) - if (left == GridLinePattern.Double) DrawDrawIntersection3Doubles_RDL(gr, x, y); - else DrawDrawIntersection2Doubles_RD(gr, x, y, up, left); - else // Down is not double - if (left == GridLinePattern.Double) DrawDrawIntersection2Doubles_RL(gr, x, y, up, down); - else DrawIntersectionOneDoubleOrLess(gr, x, y, up, right, down, left); - else - if (down == GridLinePattern.Double) - if (left == GridLinePattern.Double) DrawDrawIntersection2Doubles_DL(gr, x, y, up, right); - else DrawIntersectionOneDoubleOrLess(gr, x, y, up, right, down, left); - else // These both use the same function with the same parameters - if (left == GridLinePattern.Double) DrawIntersectionOneDoubleOrLess(gr, x, y, up, right, down, left); - else DrawIntersectionOneDoubleOrLess(gr, x, y, up, right, down, left); - } - private static Pen pnDouble = VlnBorders.LinePen(GridLinePattern.Double, BorderColor); - private static Pen pnThick = VlnBorders.LinePen(GridLinePattern.Thick, BorderColor); - private static void DrawIntersectionAllDoubles(Graphics gr, int x, int y) - { - DrawLine(gr, pnDouble, x-1, y, x, y); - DrawLine(gr, pnDouble, x, y - 2, x, y - 3); - DrawLine(gr, pnDouble, x + 2, y - 2, x + 3, y - 2); - DrawLine(gr, pnDouble, x + 2, y, x + 2, y + 1); - } - private static void DrawDrawIntersection3Doubles_URD(Graphics gr, int x, int y) - { - DrawLine(gr, pnDouble, x , y, x, y - 3); - DrawLine(gr, pnDouble, x + 2, y - 2, x + 3, y - 2); - DrawLine(gr, pnDouble, x + 2, y, x + 2, y + 1); - } - private static void DrawDrawIntersection3Doubles_URL(Graphics gr, int x, int y) - { - DrawLine(gr, pnDouble, x, y, x + 2, y); - DrawLine(gr, pnDouble, x -1, y - 2, x , y - 2); - DrawLine(gr, pnDouble, x + 2, y - 2, x + 3, y - 2); - } - private static void DrawDrawIntersection3Doubles_UDL(Graphics gr, int x, int y) - { - DrawLine(gr, pnDouble, x-1, y, x, y); - DrawLine(gr, pnDouble, x , y - 2, x , y - 3); - DrawLine(gr, pnDouble, x + 2, y-3, x + 2, y); - } - private static void DrawDrawIntersection3Doubles_RDL(Graphics gr, int x, int y) - { - DrawLine(gr, pnDouble, x-1, y, x, y); - DrawLine(gr, pnDouble, x, y - 2, x + 2, y - 2); - DrawLine(gr, pnDouble, x + 2, y, x + 2, y + 1); - } - private static void DrawDrawIntersection2Doubles_UR(Graphics gr, int x, int y, GridLinePattern lp1, GridLinePattern lp2) - { - if (lp1 == GridLinePattern.Thick && lp2 == GridLinePattern.Thick) - DrawLine(gr, pnThick, x, y, x + 3, y); - else - { - DrawLine(gr, pnDouble, x, y, x + 2, y); - DrawLine(gr, pnDouble, x , y, x , y - 2); - DrawLine(gr, pnDouble, x + 2, y - 2, x + 3, y - 2); - } - } - private static void DrawDrawIntersection2Doubles_UD(Graphics gr, int x, int y, GridLinePattern lp1, GridLinePattern lp2) - { - if (lp1 == GridLinePattern.Thick && lp2 == GridLinePattern.Thick) - DrawLine(gr, pnThick, x, y, x + 3, y); - else - { - DrawLine(gr, pnDouble, x, y, x, y - 2); - DrawLine(gr, pnDouble, x + 2, y, x + 2, y - 2); - } - } - private static void DrawIntersection2Doubles_UL(Graphics gr, int x, int y, GridLinePattern lp1, GridLinePattern lp2) - { - if (lp1 == GridLinePattern.Thick && lp2 == GridLinePattern.Thick) - DrawLine(gr, pnThick, x, y, x + 3, y); - else - { - DrawLine(gr, pnDouble, x, y, x + 2, y); - DrawLine(gr, pnDouble, x , y - 2, x, y - 3); - DrawLine(gr, pnDouble, x + 2, y, x + 2, y - 2); - } - } - private static void DrawDrawIntersection2Doubles_RD(Graphics gr, int x, int y, GridLinePattern lp1, GridLinePattern lp2) - { - if (lp1 == GridLinePattern.Thick && lp2 == GridLinePattern.Thick) - DrawLine(gr, pnThick, x, y, x + 3, y); - else - { - DrawLine(gr, pnDouble, x, y, x, y - 2); - DrawLine(gr, pnDouble, x, y - 2, x + 2, y - 2); - DrawLine(gr, pnDouble, x + 2, y, x + 2, y + 1); - } - } - private static void DrawDrawIntersection2Doubles_RL(Graphics gr, int x, int y, GridLinePattern lp1, GridLinePattern lp2) - { - if (lp1 == GridLinePattern.Thick && lp2 == GridLinePattern.Thick) - DrawLine(gr, pnThick, x, y, x + 2, y); - else - { - DrawLine(gr, pnDouble, x, y, x + 2, y); - DrawLine(gr, pnDouble, x, y - 2, x + 2, y - 2); - } - } - private static void DrawDrawIntersection2Doubles_DL(Graphics gr, int x, int y, GridLinePattern lp1, GridLinePattern lp2) - { - if (lp1 == GridLinePattern.Thick && lp2 == GridLinePattern.Thick) - DrawLine(gr, pnThick, x, y, x + 2, y); - else - { - DrawLine(gr, pnDouble, x-1, y, x, y); - DrawLine(gr, pnDouble, x, y - 2, x + 2, y - 2); - DrawLine(gr, pnDouble, x + 2, y, x + 2, y - 2); - } - } - private static void DrawIntersectionOneDoubleOrLess(Graphics gr, int x, int y, - GridLinePattern up, GridLinePattern right, GridLinePattern down, GridLinePattern left) - { - Pen pnUp = VlnBorders.LinePen(up, BorderColor); - Pen pnLeft = VlnBorders.LinePen(left, BorderColor); - int widthUpDown = Math.Max(VlnBorders.LineWidth0(up), VlnBorders.LineWidth0(down)); - int heightLeftRight = Math.Max(VlnBorders.LineWidth0(left), VlnBorders.LineWidth0(right)); - if (heightLeftRight > 0 && widthUpDown > 0) - { - Pen pn = new Pen(BorderColor, widthUpDown); - if(heightLeftRight > 1) - DrawLine(gr, pn, x + 2, y + 1 - heightLeftRight, x + 2, y); - else if(up == GridLinePattern.None) // Work around to set a pixel (actually set two) - DrawLine(gr, pn, x + 2, y, x + 2, y + 1); - } - if (left != GridLinePattern.None) - { - DrawLine(gr, pnLeft, x, y, x + 2 - widthUpDown, y); - if (left == GridLinePattern.Double) - DrawLine(gr, pnLeft, x, y - 2, x + 2 - widthUpDown, y - 2); - } - if (up != GridLinePattern.None) - { - DrawLine(gr, pnUp, x + 2, y - 3 , x + 2, y +1 - heightLeftRight); - if (up == GridLinePattern.Double) - DrawLine(gr, pnUp, x, y - 3, x, y +1 - heightLeftRight); - } - } - #endregion //Grid Initialize - #region Grid and Cell Styles - public void ChangeBackgroundColor(string bckgndColor) - { - CellRange cr = this.Selection; - if (!bckgndColor.EndsWith(";")) - bckgndColor+=";"; - string strBckgndColor = string.Format("BackColor:{0}", bckgndColor); - - for (int rw = cr.r1; rw <= cr.r2; rw++) - for (int cl = cr.c1; cl <= cr.c2; cl++) - { - CellRange tmp = this.GetCellRange(rw, cl, rw, cl); - string StyleName = string.Format("R{0}C{1}Style", rw, cl); - CellStyle cs = this.Styles.Add(StyleName, tmp.Style); - cs.ParseString(strBckgndColor); - tmp.Style = cs; - } - } - - public void ToggleCellTextAlignment() - { - // only used in test program - CellRange cr = this.Selection; - using (StepRTB srtb = new StepRTB()) - { - srtb.Rtf = this.GetCellRTFString(cr.r1, cr.c1); - - srtb.SelectAll(); - int align = (int)srtb.SelectionAlignment; - align = (align + 1) % 3; - - srtb.SelectionAlignment = (HorizontalAlignment)align; - this.PutCellRTFString(cr.r1, cr.c1, srtb.Rtf); - } - } - - public void RTFTextAlignment(CellRange cr, HorizontalAlignment ha) - { - using (StepRTB srtb = new StepRTB()) - { - for (int rw = cr.r1; rw <= cr.r2; rw++) - for (int cl = cr.c1; cl <= cr.c2; cl++) - { - srtb.Rtf = this.GetCellRTFString(rw, cl); - srtb.SelectAll(); - srtb.SelectionAlignment = ha; - this.PutCellRTFString(rw, cl, srtb.Rtf); - } - } - } - - - public void SetTableBorder(C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum border) - { - this.BorderStyle = border; - this.AdjustGridControlSize(); - } - public void ChangeCellAlign(CellRange cr, TextAlignEnum newAlign) - { - for (int rw = cr.r1; rw <= cr.r2; rw++) - for (int col = cr.c1; col <= cr.c2; col++) - { - CellRange tmp = this.GetCellRange(rw, col, rw, col); - string StyleName = string.Format("R{0}C{1}Style", rw, col); - CellStyle cs = null; - if (Styles.Contains(StyleName)) - cs = Styles[StyleName]; - else - cs = this.Styles.Add(StyleName, tmp.Style); - cs.TextAlign = newAlign; - tmp.Style = cs; - } - } - public void ChangeCellBorder(CellRange cr, BorderStyleEnum newBorder) - { - for (int rw = cr.r1; rw <= cr.r2; rw++) - for (int col = cr.c1; col <= cr.c2; col++) - { - CellRange tmp = this.GetCellRange(rw, col, rw, col); - string StyleName = string.Format("R{0}C{1}Style", rw, col); - CellStyle cs = null; - if (Styles.Contains(StyleName)) - cs = Styles[StyleName]; - else - cs = this.Styles.Add(StyleName, tmp.Style); - cs.Border.Style = newBorder; - tmp.Style = cs; - } - } - public void ListStyles() - { - for (int r = 0; r < Rows.Count; r++) - for (int c = 0; c < Cols.Count; c++) - { - CellRange cr = GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - if (cr.Style != null) Console.WriteLine("{0}, {1}, {2}, {3}", r, c, cr.Style.Name, cr.Style.BackColor); - } - } - } - //public void VerticalCenterText() - //{ - // StepRTB myStepRTB = new StepRTB(); - // CellRange selRange = this.Selection; - // for (int r = selRange.r1; r <= selRange.r2; r++) - // for (int c = selRange.c1; c <= selRange.c2; c++) - // { - // CellRange mr = this.GetMergedRange(r, c); - // if (mr.r1 == r) - // { - // int editHeight = (int)mr.UserData; - // int cellHeight = GetCellHeight(mr.r1, mr.c1); - // if (editHeight < cellHeight) - // { - // myStepRTB.Rtf = (string)mr.Data; - // RTBAPI.SetSpaceBefore(myStepRTB, (cellHeight - editHeight) / 2); - // PutCellRTFString(mr.r1, mr.c1, myStepRTB.Rtf); - // } - // } - // } - //} - //public void VerticalTopText() - //{ - // StepRTB myStepRTB = new StepRTB(); - // CellRange selRange = this.Selection; - // for (int r = selRange.r1; r <= selRange.r2; r++) - // for (int c = selRange.c1; c <= selRange.c2; c++) - // { - // CellRange mr = this.GetMergedRange(r, c); - // if (mr.r1 == r) - // { - // myStepRTB.Rtf = (string)mr.Data; - // RTBAPI.SetSpaceBefore(myStepRTB, 0); - // PutCellRTFString(mr.r1, mr.c1, myStepRTB.Rtf); - // } - // } - //} - //public void VerticalBottomText() - //{ - // StepRTB myStepRTB = new StepRTB(); - // CellRange selRange = this.Selection; - // for (int r = selRange.r1; r <= selRange.r2; r++) - // for (int c = selRange.c1; c <= selRange.c2; c++) - // { - // CellRange mr = this.GetMergedRange(r, c); - // if (mr.r1 == r) - // { - // int editHeight = (int)mr.UserData; - // int cellHeight = GetCellHeight(mr.r1, mr.c1); - // if (editHeight < cellHeight) - // { - // myStepRTB.Rtf = (string)mr.Data; - // RTBAPI.SetSpaceBefore(myStepRTB, (cellHeight - editHeight)); - // PutCellRTFString(mr.r1, mr.c1, myStepRTB.Rtf); - // } - // } - // } - //} - - //public void SetupCellStyles() - //{ - // //CellStyle cs; - - // //cs = this.Styles.Add("Dotted"); - // //cs.Border.Style = BorderStyleEnum.Dotted; - // //cs = this.Styles.Add("Double"); - // //cs.Border.Style = BorderStyleEnum.Double; - // //cs = this.Styles.Add("Fillet"); - // //cs.Border.Style = BorderStyleEnum.Fillet; - // //cs = this.Styles.Add("Flat"); - // //cs.Border.Style = BorderStyleEnum.Flat; - // //cs = this.Styles.Add("Groove"); - // //cs.Border.Style = BorderStyleEnum.Groove; - // //cs = this.Styles.Add("Inset"); - // //cs.Border.Style = BorderStyleEnum.Inset; - // //cs = this.Styles.Add("None"); - // //cs.Border.Style = BorderStyleEnum.None; - // //cs = this.Styles.Add("Raised"); - // //cs.Border.Style = BorderStyleEnum.Raised; - // //cs = this.Styles.Add("CenterRight"); - // //cs.TextAlign = TextAlignEnum.RightCenter; //.LeftCenter; // this is being ignored - probably due to RTF conversion - // //cs = this.Styles.Add("Yellow"); - // //cs.BackColor = Color.Yellow; - // //cs = this.Styles.Add("Margins"); - // //cs.Margins.Bottom = 5; - // //cs.Margins.Top = 10; - // //cs.Margins.Left = 15; - // //cs.Margins.Right = 20; - //} - #endregion //Grid and Cell Styles - - #region Grid Size Adjustments - - /// - /// Adjust the grid control size based on the cell sizes. - /// - public void AdjustGridControlSize() - { - if (Parent is GridItem ? (Parent as GridItem).Initializing : false ) return; - int difW = this.Width - this.ClientSize.Width; - int difH = this.Height - this.ClientSize.Height; - int wid = 0; - if (this != null) - { - foreach (C1.Win.C1FlexGrid.Column col in this.Cols) - wid += (col.Width >= 0) ? col.Width : this.Cols.DefaultSize; - - int height = 0; - foreach (C1.Win.C1FlexGrid.Row row in this.Rows) - //height += (row.Height >= 0) ? row.Height : this.Rows.DefaultSize + 2; - height += (row.Height >= 0) ? row.Height : this.Rows.DefaultSize; - - this.Size = new Size(wid + difW, height + difH); - } - } - - public void ConvertTextCellToRTF(int r, int c) - { - using (StepRTB trtb = new StepRTB()) - { - string tstr = null; - bool dummyCharWidth = false; - bool AllowWidthShrink = false; - trtb.SetTableGridCellRTFPrefix(this.Font); - trtb.Clear(); - tstr = (string)this[r, c]; - trtb.Font = this.Font; - if (tstr != null && tstr.Length > 0) - { - string tsave = tstr; - // regular text has special characters to toggle Bold, Underline, and Italics - // we need to subtract the width of these characters (allow column/row to shrink) - //AllowWidthShrink = RemoveBoldUlineItalicChars(trtb.Rtf); - AllowWidthShrink = tstr.Contains("#Link:"); - // this will convert the special characters for Bold, Underline, and Italics - // into RTF commands - //trtb.Rtf = trtb.RtfPrefix + ConvertTableText(trtb.Rtf) + "}"; - //string fromRTF = trtb.Rtf; - //string prefix = trtb.RtfPrefix; - //if (tstr.Contains("#Link:")) prefix += @"{\colortbl ;\red255\green0\blue0;}"; - //if (tstr.Contains("#Link:")) - // Console.WriteLine("here"); - //string jText = trtb.RtfPrefix + ConvertTableText(tstr) + @"\par}"; - //trtb.Rtf = jText; - trtb.Rtf = trtb.RtfPrefix + ConvertTableText(tstr) + @"\par}"; - //string fromStr = trtb.Rtf; - //if (fromRTF.Contains("SimSun")) - // Console.WriteLine("SimSun"); - //else - // Compare(fromRTF, fromStr, tsave); - } - else - { - trtb.Text = "X"; // this is to trick steprtf in giving a char width to fit one character - // note that a space character was too small. - dummyCharWidth = true; - } - // find the needed cell width - trtb.AdjustWidthForContent(); - if (dummyCharWidth) - { - trtb.Text = ""; // clear out the dummy character before saving - dummyCharWidth = false; - } - - this[r, c] = trtb.Rtf; // save the cleaned up and processed cell text as RTF - this.Select(r, c, false); - CellRange sel = this.Selection; - //sel.UserData = trtb.ContentsRectangle.Height; - - // Now adjust the Height and Width in the defined merge ranges - AdjustMergeRangeHeightWidth(r, c, trtb, tstr, AllowWidthShrink); - - - //// Now see the the selected row,col is in the defined merge ranges - //bool mrgrows = false; - //bool mrgcols = false; - //foreach (CellRange cr in this.MergedRanges) - //{ - // if (cr.Contains(r, c)) - // { - // if (cr.c1 != cr.c2) - // mrgcols = true; // in a range of merged columns - // if (cr.r1 != cr.r2) - // mrgrows = true; // in a range of merged rows - // continue; - // } - //} - //if (!mrgcols || !mrgrows) - //{ - // // IF the row of the selected cell is NOT in merged range - // // then go ahead and adjust the row height (if needed) - // if (!mrgrows) - // { - // // add adjustment for grid and cell borders - // int newheight = trtb.Height + 3; - - // //Console.WriteLine("{0} {1} {2} '{3}'", r, c, newheight,trtb.Text); - // if (newheight > this.Rows[r].Height) - // { - // //Console.WriteLine("1 Row {0} Old Height = {1}, New Height = {2}", r, Rows[r].Height, newheight); - // this.Rows[r].Height = newheight; - // } - // } - // // IF the column of the selected cell is NOT in merged range - // // then go ahead and adjust the column width (if needed) - // if (!mrgcols) - // { - // // add adjustment for grid and cell borders - // int newwidth = trtb.Width + 2; - - // if (newwidth > this.Cols[c].Width || AllowWidthShrink || r == 0) - // this.Cols[c].Width = newwidth; - // } - //} - //if (mrgrows && tstr != null) - //{ - // CellRange cr = GetMergedRange(r, c); - // //Console.WriteLine("grid[{0},{1}] merge = {2}", r, c,cr); - // if (cr.r1 == r && cr.c1 == c) - // { - // // if in merged rows, then make sure the cell's height is large enough - // string[] strary = tstr.Split("\n".ToCharArray()); - // // count number of lines of text - // int nlines = strary.Length; - // // count number of rows in merge range - // int nrows = (cr.r2 - cr.r1) + 1; - // //Console.WriteLine("2 Row {0} Height = {1}", cr.r1, Rows[cr.r1].Height); - // while (nlines > nrows) - // { - // // add length to first row in merged range - // int h = this.Rows[cr.r1].Height; - // int defH = Rows.DefaultSize - 3; - // //h = (h == -1) ? _minRowHeight * 2 : h + _minRowHeight; - // h = (h == -1) ? (defH * 2) + 3 : h + defH; - // //h = (h == -1) ? (Rows.DefaultSize + 2) * 2 : h + Rows.DefaultSize + 2; - // //Console.WriteLine("3 Row {0} Old Height = {1}, New Height = {2}", cr.r1, Rows[cr.r1].Height, h); - // this.Rows[cr.r1].Height = h; - // nrows++; - // } - // } - //} - } - } - private void AdjustCellHeightWidth(int r, int c) - { - using (StepRTB trtb = new StepRTB()) - { - string tstr = null; - bool dummyCharWidth = false; - bool AllowWidthShrink = false; - trtb.SetTableGridCellRTFPrefix(this.Font); - trtb.Clear(); - trtb.Font = this.Font; - trtb.Rtf = (string)this[r, c]; - tstr = trtb.Text; - if (tstr != null && tstr.Length > 0) - AllowWidthShrink = tstr.Contains("#Link:"); - else - { - trtb.Text = "X"; // this is to trick steprtf in giving a char width to fit one character - // note that a space character was too small. - dummyCharWidth = true; - } - // find the needed cell width - trtb.AdjustWidthForContent(); - - if (dummyCharWidth) - { - trtb.Text = ""; // clear out the dummy character before saving - dummyCharWidth = false; - } - - this.Select(r, c, false); - CellRange sel = this.Selection; - - // Now adjust the Height and Width in the defined merge ranges - AdjustMergeRangeHeightWidth(r, c, trtb, tstr, AllowWidthShrink); - } - } - - private void AdjustMergeRangeHeightWidth(int r, int c, StepRTB trtb, string tstr, bool AllowWidthShrink) - { - bool mrgrows = false; - bool mrgcols = false; - foreach (CellRange cr in this.MergedRanges) - { - if (cr.Contains(r, c)) - { - if (cr.c1 != cr.c2) - mrgcols = true; // in a range of merged columns - if (cr.r1 != cr.r2) - mrgrows = true; // in a range of merged rows - continue; - } - } - if (!mrgcols || !mrgrows) - { - // IF the row of the selected cell is NOT in merged range - // then go ahead and adjust the row height (if needed) - if (!mrgrows) - { - // add adjustment for grid and cell borders - int newheight = trtb.Height + 3; - - //Console.WriteLine("{0} {1} {2} '{3}'", r, c, newheight,trtb.Text); - if (newheight > this.Rows[r].Height) - { - //Console.WriteLine("1 Row {0} Old Height = {1}, New Height = {2}", r, Rows[r].Height, newheight); - this.Rows[r].Height = newheight; - } - } - // IF the column of the selected cell is NOT in merged range - // then go ahead and adjust the column width (if needed) - if (!mrgcols) - { - // add adjustment for grid and cell borders - int newwidth = trtb.Width + 3; // 2; - if (newwidth > (this.Cols[c].Width == -1 ? this.Cols.DefaultSize : this.Cols[c].Width) || AllowWidthShrink || r == 0) - this.Cols[c].Width = newwidth; - } - } - if (mrgrows && tstr != null) - { - CellRange cr = GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - // if in merged rows, then make sure the cell's height is large enough - string[] strary = tstr.Split("\n".ToCharArray()); - // count number of lines of text - int nlines = strary.Length; - // count number of rows in merge range - int nrows = (cr.r2 - cr.r1) + 1; - //Console.WriteLine("2 Row {0} Height = {1}", cr.r1, Rows[cr.r1].Height); - while (nlines > nrows) - { - // add length to first row in merged range - int h = this.Rows[cr.r1].Height; - int defH = Rows.DefaultSize - 3; - h = (h == -1) ? (defH * 2) + 3 : h + defH; - this.Rows[cr.r1].Height = h; - nrows++; - } - } - } - } - private int TotalColWidths() - { - int cwid = 0; - foreach (Column c in Cols) - { - cwid += ((c.Width > 0) ? c.Width : Cols.DefaultSize); - } - return cwid; - } - /// - /// This will adjust the column widths of the current table based upon the page width - /// Note: This is for use in creating a new table - not to process an existing table. - /// - /// - public void FitTableToPageWidth(int pgWidthPoints) - { - int grdWidth = TotalColWidths(); - int pgwidth = (int)((pgWidthPoints / 72) * this._DPI); - - if (grdWidth > pgwidth) - { - int difWid = grdWidth - pgwidth; - int colAdj = (difWid / Cols.Count) +(((difWid % Cols.Count) > 0) ? 1 : 0); - foreach (Column c in Cols) - { - int cwid = (c.Width > 0) ? c.Width : Cols.DefaultSize; - if ((cwid - colAdj) > 0) - c.Width = cwid - colAdj; - } - } - } - //private void AdjustCellHeightWidth(int r, int c) - //{ - // StepRTB trtb = new StepRTB(); - // string tstr = null; - // bool dummyCharWidth = false; - // bool AllowWidthShrink = false; - // trtb.SetTableGridCellRTFPrefix(this.Font); - // trtb.Clear(); - // trtb.Font = this.Font; - // trtb.Rtf = (string)this[r, c]; - // tstr = trtb.Text; - // if (tstr != null && tstr.Length > 0) - // AllowWidthShrink = tstr.Contains("#Link:"); - // else - // { - // trtb.Text = "X"; // this is to trick steprtf in giving a char width to fit one character - // // note that a space character was too small. - // dummyCharWidth = true; - // } - // // find the needed cell width - // trtb.AdjustWidthForContent(); - - // if (dummyCharWidth) - // { - // trtb.Text = ""; // clear out the dummy character before saving - // dummyCharWidth = false; - // } - - // this.Select(r, c, false); - // CellRange sel = this.Selection; - - // // Now see the the selected row,col is in the defined merge ranges - // bool mrgrows = false; - // bool mrgcols = false; - // foreach (CellRange cr in this.MergedRanges) - // { - // if (cr.Contains(r, c)) - // { - // if (cr.c1 != cr.c2) - // mrgcols = true; // in a range of merged columns - // if (cr.r1 != cr.r2) - // mrgrows = true; // in a range of merged rows - // continue; - // } - // } - // if (!mrgcols || !mrgrows) - // { - // // IF the row of the selected cell is NOT in merged range - // // then go ahead and adjust the row height (if needed) - // if (!mrgrows) - // { - // // add adjustment for grid and cell borders - // int newheight = trtb.Height + 3; - - // //Console.WriteLine("{0} {1} {2} '{3}'", r, c, newheight,trtb.Text); - // if (newheight > this.Rows[r].Height) - // { - // //Console.WriteLine("1 Row {0} Old Height = {1}, New Height = {2}", r, Rows[r].Height, newheight); - // this.Rows[r].Height = newheight; - // } - // } - // // IF the column of the selected cell is NOT in merged range - // // then go ahead and adjust the column width (if needed) - // if (!mrgcols) - // { - // // add adjustment for grid and cell borders - // int newwidth = trtb.Width + 2; - - // if (newwidth > this.Cols[c].Width || AllowWidthShrink || r == 0) - // this.Cols[c].Width = newwidth; - // } - // } - // if (mrgrows && tstr != null) - // { - // CellRange cr = GetMergedRange(r, c); - // if (cr.r1 == r && cr.c1 == c) - // { - // // if in merged rows, then make sure the cell's height is large enough - // string[] strary = tstr.Split("\n".ToCharArray()); - // // count number of lines of text - // int nlines = strary.Length; - // // count number of rows in merge range - // int nrows = (cr.r2 - cr.r1) + 1; - // //Console.WriteLine("2 Row {0} Height = {1}", cr.r1, Rows[cr.r1].Height); - // while (nlines > nrows) - // { - // // add length to first row in merged range - // int h = this.Rows[cr.r1].Height; - // int defH = Rows.DefaultSize - 3; - // h = (h == -1) ? (defH * 2) + 3 : h + defH; - // this.Rows[cr.r1].Height = h; - // nrows++; - // } - // } - // } - //} - - //private void Compare(string fromRTF, string fromStr, string rawstr) - //{ - // int istart = fromRTF.IndexOf(" ",fromRTF.IndexOf("viewkind")); - // int jstart = fromStr.IndexOf(" ",fromStr.IndexOf("viewkind")); - // for (int i = istart; i < fromRTF.Length; i++) - // { - // int j = i - istart + jstart; - // //else if (fromRTF[i] != fromStr[j]) - // if (fromRTF[i] != fromStr[j]) - // { - // if (fromRTF.Substring(i, 1) == @"~" && fromStr.Substring(j, 3) == @"'a0") - // { - // //i++; - // jstart += 2; - // } - // else - // { - // Console.WriteLine("fromStr:\r\n'{0}'\r\nfromRTF:\r\n'{1}'", fromStr, fromRTF); - // ShowRawString(rawstr, "rawstr"); - // Console.WriteLine("Str:'{0}' , RTF:'{1}'", fromStr.Substring(j, Math.Min(10,fromStr.Length-j-1)), fromRTF.Substring(i, Math.Min(10,fromRTF.Length-i-1))); - // return; - // } - // } - // } - //} - - #region DEBUG - //private void ShowRawString(string str, string title) - //{ - // Console.WriteLine("Raw Start --{0}:\n", title); - // foreach (char c in str) - // { - // int ic= (int)c; - // if (c!='\n'&&( ic > 126 || ic < 32)) - // Console.Write("<<{0:x4}>>", ic); - // else - // Console.Write(c); - // } - // Console.WriteLine("\n-- Raw End:{0}", title); - //} - #endregion - - private void Grid_AfterResize(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) - { - this.AdjustGridControlSize(); - } - - #endregion // Grid Size Adjustments - - #region Cell Text - public void MakeRTFcells() - { - // This will spin through all the cells in the grid: - // - convert the text to RTF if needed - // - adjust the grid dimensions based on the cell info. - for (int r = 0; r < this.Rows.Count; r++) - { - this.Rows[r].Height = Rows.DefaultSize;//_minRowHeight;//20;//10; - for (int c = 0; c < this.Cols.Count; c++) - this.ConvertTextCellToRTF(r, c); - } - - TrimColumnWidths(); - RemoveBlankSpaceFromRows(); - SetupCellUserData(); - this.AdjustGridControlSize(); - } - - public void FixTableCellsHeightWidth() - { - RemoveBlankSpaceFromColumns(); - RemoveBlankSpaceFromRows(); - } - - private void RemoveBlankSpaceFromRows() - { - for (int r = 0; r < Rows.Count; r++) - { - Select(r, 0); - int blankRowSpace = BlankRowSpace(); - if (blankRowSpace > 0) - Rows[r].Height -= blankRowSpace; - } - } - - private void RemoveBlankSpaceFromColumns() - { - for (int c = 0; c < Cols.Count; c++) - { - Select(0, c); - int blankColSpace = BlankColSpace(); - if (blankColSpace > 0) - Cols[c].Width -= blankColSpace; - } - } - - private void TrimColumnWidths() - { - for (int c = 0; c < Cols.Count; c++) - { - Select(0, c); - int newColWidth = MinColWidth(); - Cols[c].Width = newColWidth; - } - } - - private int MinColWidth() - { - int curColWidth = 0; - for (int r = 0; r < Rows.Count; r++) - { - CellRange cr = GetMergedRange(r, Col); - // find the needed cell width - if (Col == cr.c1) - { - using (StepRTB srtb = new StepRTB()) - { - srtb.Rtf = GetCellRTFString(cr.r1, cr.c1); - srtb.AdjustWidthForContent(); - curColWidth = Math.Max(curColWidth, srtb.Width + 3); - } - } - } - return curColWidth; - } - - //private bool RemoveBoldUlineItalicChars(string str) - //{ - // int rtn = 0; - - // // Underline next word - // rtn += str.IndexOf(@"\'17"); - - // // Bold next word - // rtn += str.IndexOf(@"\'13"); - - // // Italics On - // rtn += str.IndexOf(@"\'1B4"); - - // // Italics Off - // rtn += str.IndexOf(@"\'1B5"); - - // // underline On - // rtn += str.IndexOf(@"\'ab"); - // // underline Off - // rtn += str.IndexOf(@"\'bb"); - - // return rtn > 0; - - //} - - private string ConvertTableText(string str) - { - string rtn = str; - //ShowRawString(str, "ConvertTableText IN"); - rtn = rtn.Replace(@"START]\v0", @"START]\cf1\v0"); - rtn = rtn.Replace(@"\v #Link:", @"\cf0\v #Link:"); - rtn = rtn.Replace("\n", "\\par\r\n"); - rtn = rtn.Replace("\xB3", @"\f1\u9474?\f0"); // Vert Bar - rtn = rtn.Replace("\xF2", @"\f1\u8805?\f0 "); // greater than or equal - rtn = rtn.Replace("\x7F", @"\f1\u916?\f0 "); // delta - rtn = rtn.Replace("\xF3", @"\f1\u8804?\f0 "); // less than or equal - rtn = rtn.Replace("\xE4", @"\f1\u931?\f0 "); // sigma - rtn = rtn.Replace("\xE7", @"\f1\u947?\f0 "); // gamma - rtn = rtn.Replace("\xFE", @"\f1\u9604?\f0 "); // accum 2584 - rtn = rtn.Replace("\x7", @"\f1\u9679?\f0 "); // bullet 25CF - rtn = rtn.Replace("\xF7", @"\f1\u8776?\f0 "); // approx eq - rtn = rtn.Replace("\xF0", @"\f1\u8773?\f0 "); // similar eq 2245 - rtn = rtn.Replace("\xFB", @"\f1\u8730?\f0 "); // square root - rtn = rtn.Replace("\xE2", @"\f1\u961?\f0 "); // rho 3C1 - rtn = rtn.Replace("\xE3", @"\f1\u960?\f0 "); // pi - rtn = rtn.Replace("\xE6", @"\f1\u956?\f0 "); // micro - rtn = rtn.Replace("\xEB", @"\f1\u948?\f0 "); // lower case delta - rtn = rtn.Replace("\xE5", @"\f1\u963?\f0 "); // lower case sigma - rtn = rtn.Replace("\x90", @"\f1\u274?\f0 "); // energy, 112 - rtn = rtn.Replace("\xEE", @"\f1\u949?\f0 "); // epsilon - rtn = rtn.Replace("\xE9", @"\f1\u952?\f0 "); // theta, 3B8 - rtn = rtn.Replace("\xEC", @"\f1\u8857?\f0 "); // dot in oval, 2299 - rtn = rtn.Replace("\xA8", @"\f1\u964?\f0 "); // tau, 3C4 - rtn = rtn.Replace("\xA9", @"\f1\u9830?\f0 "); // diamond, 2666 - rtn = rtn.Replace("\x18", @"\f1\u8593?\f0 "); // Up Arrow - rtn = rtn.Replace("\x19", @"\f1\u8595?\f0 "); // Down Arrow - rtn = rtn.Replace("\xFF", @"\u160?"); // hardspace - //rtn = rtn.Replace(@"\'a0", @"\u160?"); - //rtn = rtn.Replace("\xff", @"\u160?"); - //rtn = rtn.Replace("\xA0", @"\u160?"); - // underline On - rtn = rtn.Replace("\xab", @"\ul"); - // underline Off - rtn = rtn.Replace("\xbb", @"\ulnone"); - //rtn = rtn.Replace("\xef\xe6", @"\up2 "); - //rtn = rtn.Replace("\xef\xe7", @"\up0 "); - rtn = rtn.Replace("\x9566", @"\up2 "); - rtn = rtn.Replace("\x9567", @"\up0 "); - rtn = rtn.Replace("{", @"\{"); - rtn = rtn.Replace("}", @"\}"); - rtn = rtn.Replace("\xd5", @"\b"); - rtn = rtn.Replace("\xd6", @"\b0"); - - //ShowRawString(rtn, "ConvertTableText OUT"); - return rtn; - } - - private static string SomethingNextWord(string str, string nxtwordcmd, string cmdOn, string cmdOff) - { - string rtn = ""; - int bidx = 0; - int fidx = str.IndexOf(nxtwordcmd, bidx); - char[] term = " \r\n\x02".ToCharArray(); - while (fidx > 0) - { - rtn += str.Substring(bidx, fidx - bidx) + cmdOn; - bidx = fidx + 4; - - if (bidx < str.Length) - { - fidx = str.IndexOfAny(term, bidx); - if (fidx > 0) - { - rtn += str.Substring(bidx, fidx - bidx) + cmdOff + str.Substring(fidx, 1); - bidx = fidx + 1; - } - } - - if (bidx < str.Length) - fidx = str.IndexOf(nxtwordcmd, bidx); - else - fidx = -1; - } - if (bidx < str.Length) - rtn += str.Substring(bidx); - - return rtn; - } - - private void _StartEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) - { - // start editing the cell with the custom editor - _tableCellEditor.StartEditing(e.Row, e.Col); - e.Cancel = true; - } - - // after edit handler (built-in editors) - private void _AfterEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e) - { - this.GetCellRange(e.Row, e.Col).Style.ForeColor = Color.Black; - this.AdjustGridControlSize(); - } - - // if the custom editor is visible, make it follow the cell being edited - private void _AfterScroll(object sender, C1.Win.C1FlexGrid.RangeEventArgs e) - { - this._tableCellEditor.UpdatePosition(); - } - - // save last key pressed for the custom editor - private void _KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) - { - this._tableCellEditor.SetPendingKey(e.KeyChar); - } - - public string GetCellRTFString(int row, int col) - { - string rtnstr = ""; - foreach (CellRange r in this.MergedRanges) - { - if (r.ContainsRow(row) && r.ContainsCol(col)) - { - rtnstr = (string)this[r.r1, r.c1]; - return rtnstr; - } - } - rtnstr = (string)this[row, col]; - return rtnstr; - } - - public void PutCellRTFString(int row, int col, string str) - { - foreach (CellRange r in this.MergedRanges) - { - if (r.ContainsRow(row) && r.ContainsCol(col)) - { - this[r.r1, r.c1] = str; - return; - } - } - this[row, col] = str; - return; - } - public void ClearSelectedCellText() - { - CellRange cr = this.Selection; - cr.Clear(ClearFlags.Content); - } - public void SetupCellUserData() - { - for (int r = 0; r < Rows.Count; r++) - for (int c = 0; c < Cols.Count; c++) - { - string rtfText = GetDataDisplay(r, c); - if (rtfText.StartsWith(@"{\rtf")) - { - using (StepRTB _rtf = new StepRTB()) - { - _rtf.Width = Cols[c].Width; - _rtf.Rtf = rtfText; - CellRange cr = GetCellRange(r, c); - cr.UserData = _rtf.ContentsRectangle.Height; - } - } - } - } - - #endregion //Cell Text - - #region Merged / Split Range - - public void MergeSelection() - { - this.MergedRanges.Add(this.Selection,true); - this.Invalidate(); - this.Select(Selection.r1, Selection.c1); - } - public bool IsInMergeRange() - { - C1.Win.C1FlexGrid.CellRange sel = GetMergedRange(this.Selection.r1, this.Selection.c1); - return MergedRanges.Contains(sel); - } - public void SplitSelection(bool bSplitCols) - { - //Console.WriteLine("SplitSelection this.selection {0}", this.Selection); - //Debug_WritelineMySelection(); - //C1.Win.C1FlexGrid.CellRange sel = this.GetMergedRange(this.Selection.r1, this.Selection.c1); - //Console.WriteLine("SplitSelection myselection {0}", MySelection); - //foreach (CellRange sel in MySelection) - //{ - // //Console.WriteLine("SplitSelection foreach sel {0}", sel); - // if (sel.IsSingleCell) - // this.MergedRanges.Remove(sel); - // if (!(this.MergedRanges.Contains(sel)) && !didit) - // if (bSplitCols) - // SplitSelectionColumns(); - // else - // SplitSelectionRows(); - // didit = true; - //} - if (bSplitCols) - SplitSelectionColumns(); - else - SplitSelectionRows(); - //Debug_WritelineMySelection(); - //foreach (CellRange sel in MySelection) - //{ - // //Console.WriteLine("SplitSelection foreach sel {0}", sel); - // if (this.MergedRanges.Contains(sel)) - // SplitMergedRange(sel, bSplitCols); - //} - //this.Refresh(); - //RefreshMergeRangeCollection(); - this.AdjustGridControlSize(); - } - - private void SplitMergedRange(CellRange sel, bool bSplitCols) - { - int sR = sel.r1; - int eR = sel.r2; - int sC = sel.c1; - int eC = sel.c2; - if (bSplitCols && (IsMergedCols(sel) && !IsMergedRows(sel)) || - (!bSplitCols && (IsMergedRows(sel) && !IsMergedCols(sel)))) - MergedRanges.Remove(sel); - else - { - CellRange saveSelection = Selection; - if (bSplitCols && IsMergedRows(sel)) - { - MergedRanges.Remove(sel); - for (int c = sC; c <= eC; c++) - { - Select(sR, c, eR, c); - MergeSelection(); - } - } - else if (!bSplitCols && IsMergedCols(sel)) - { - MergedRanges.Remove(sel); - for (int r = sR; r <= eR; r++) - { - Select(r, sC, r, eC); - MergeSelection(); - } - } - Select(saveSelection); - } - } - private bool IsMergedRows(CellRange sel) - { - return (sel.r1 != sel.r2); - } - private bool IsMergedCols(CellRange sel) - { - return (sel.c1 != sel.c2); - } - private void SplitSelectionColumns() - { - bool hasNonMergedColumn = false; - //Console.WriteLine("SplitSelectionColumns this.selection {0}", this.Selection); - //Debug_WritelineMySelection(); - CellRange cr = this.Selection; - int numSelCols = (cr.c2 - cr.c1) + 1; - foreach (CellRange sel in MySelection) - { - if (!this.MergedRanges.Contains(sel)) - hasNonMergedColumn = true; - else - { - CellRange mr = GetMergedRange(sel.r1, sel.c1); - if (mr.c1 == mr.c2) - hasNonMergedColumn = true; - } - } - // for each column in the selection, add a new column - if (hasNonMergedColumn) - { - for (int c = cr.c2; c >= cr.c1; c--) - { - Select(cr.r1, c, cr.r2, c); - InsertColumnAfter(); - } - } - // include new columns in selection - this.Select(cr.r1, cr.c1, cr.r2, cr.c2 + ((hasNonMergedColumn) ? numSelCols : 0)); - //if a merged range is part of the selectin, try to split it - foreach (CellRange sel in MySelection) - { - //Console.WriteLine("SplitSelection foreach sel {0}", sel); - if (this.MergedRanges.Contains(sel)) - SplitMergedRange(sel, true); - } - cr = this.Selection; - if (hasNonMergedColumn) - { - for (int r = 0; r < this.Rows.Count; r++) - for (int c = cr.c1; c <= cr.c2; c += 2) - { - if (!this.IsCellSelected(r, c)) - { - CellRange crTmp = GetMergedRange(r, c); - if (crTmp.IsSingleCell) - { - CellRange tcr = this.GetCellRange(r, c, r, c + 1); - this.MergedRanges.Add(tcr); - this.Invalidate(); - } - //CellRange tcr = this.GetCellRange(r, c, r, c + 1); - //this.MergedRanges.Add(tcr); - } - } - // Adjust selected column widths - for (int c = cr.c1; c <= cr.c2; c++) - { - int recWidth = (Cols[c].Width < 0) ? Cols.DefaultSize : Cols[c].Width; // this.GetCellRect(cr.r1, c).Width; - int newWidth = Math.Max(recWidth / 2, _minColSplitWidth); - this.Cols[c].Width = newWidth; - //Console.WriteLine("Cell[{0},{1}].Width = {2}", cr.r1, c, recWidth); - //Console.WriteLine("Cell[{0},{1}].NewWidth = {2}", cr.r1, c, newWidth); - } - } - } - - private void SplitSelectionRows() - { - bool hasNonMergedRow = false; - CellRange cr = this.Selection; - int numSelRows = (cr.r2 - cr.r1) + 1; - //Console.WriteLine("numSelRows = {0}", numSelRows); - //Console.WriteLine("Inital Selection [{0},{1}] - [{2},{3}]", cr.r1, cr.c1, cr.r2, cr.c2); - foreach (CellRange sel in MySelection) - { - if (!this.MergedRanges.Contains(sel)) - hasNonMergedRow = true; - else - { - CellRange mr = GetMergedRange(sel.r1, sel.c1); - if (mr.r1 == mr.r2) - hasNonMergedRow = true; - } - } - // for each row in the selection, add a new row - if (hasNonMergedRow) - { - for (int r = cr.r2; r >= cr.r1; r--) - { - //Console.WriteLine("Inserted new Row at [{0},{1}]", r, cr.c1); - Select(r, cr.c1, r, cr.c2); - InsertRowAfter(); - } - } - // include new rows in selection - this.Select(cr.r1, cr.c1, cr.r2 + numSelRows, cr.c2); - //if a merged range is part of the selectin, try to split it - foreach (CellRange sel in MySelection) - { - //Console.WriteLine("SplitSelection foreach sel {0}", sel); - if (this.MergedRanges.Contains(sel)) - SplitMergedRange(sel, false); - } - cr = this.Selection; - //Console.WriteLine(" After Insert [{0},{1}] - [{2},{3}]", cr.r1, cr.c1, cr.r2, cr.c2); - if (hasNonMergedRow) - { - for (int c = 0; c < this.Cols.Count; c++) - for (int r = cr.r1; r <= cr.r2; r += 2) - { - if (!this.IsCellSelected(r, c)) - { - CellRange crTmp = GetMergedRange(r, c); - if (crTmp.IsSingleCell) - { - CellRange tcr = this.GetCellRange(r, c, r + 1, c); - this.MergedRanges.Add(tcr); - this.Invalidate(); - } - } - } - // Adjust selected Row Heights - for (int r = cr.r1; r <= cr.r2; r++) - { - int recHeight = this.GetCellRect(r, cr.c1).Height; - this.Rows[r].Height = Math.Max(recHeight / 2, Rows.DefaultSize); - //this.Rows[r].Height = Math.Max(recHeight / 2, _minRowSplitHeight); - //Console.WriteLine("Cell[{0},{1}].Height = {2}", r, cr.c1, recHeight); - } - } - //foreach (CellRange crng in this.MergedRanges) - // Console.WriteLine("merge ranges [{0},{1}] - [{2},{3}]", crng.r1, crng.c1, crng.r2, crng.c2); - } - private void AdjustMergedRows(int row, bool above, bool removing) - { - AdjustMergedRows(row, 1, above, removing); - } - - private void AdjustMergedRows(int row, int cnt, bool above, bool removing) - { - CellRangeCollection crc = new CellRangeCollection(this); - if (removing) - { - foreach (CellRange r in this.MergedRanges) - { - CellRange cr = r; - if (r.ContainsRow(row)) - { - if (r.TopRow != r.BottomRow) - { - cr.r2 -= cnt; - crc.Add(cr); - } - } - else - { - if (row <= r.r1) - { - if (row < r.r1) - cr.r1 -= cnt; - cr.r2 -= cnt; - } - crc.Add(cr); - } - } - } - else // adding - foreach (CellRange r in this.MergedRanges) - { - CellRange cr = r; - int inspos = (above) ? row : row - 1; - if (r.ContainsRow(inspos)) - { - bool adjustMergeValues = true; - if (cr.r1 == row && cr.r2 == row + cnt -1) - adjustMergeValues = false; // don't add to existing merge range - we will add a new merge range for this copy - for (int insCnt = 0; insCnt < cnt; insCnt++) - { - if ((above && cr.r1 == inspos) || (!above && cr.r2 == inspos)) - { - string tstr = ""; - int newrow = 0; - if (above) - { - if (this[cr.r1 + cnt, cr.c1] != null) - tstr = this[cr.r1 + cnt, cr.c1].ToString(); - newrow = cr.r1; - } - else - { - if (this[cr.r2, cr.c1] != null) - tstr = this[cr.r2, cr.c1].ToString(); - newrow = cr.r2 + cnt; - } - if (tstr != null && tstr.Length > 0) - for (int x = cr.c1; x <= cr.c2; x++) - this[newrow, x] = tstr; - } - if (adjustMergeValues) cr.r2++; - } - } - else - { - if (inspos < cr.r1) - { - cr.r1 += cnt; - cr.r2 += cnt; - } - } - crc.Add(cr); - } - this.MergedRanges.Clear(); - foreach (CellRange r in crc) - { - if ((r.r1 != r.r2) || (r.c1 != r.c2)) - this.MergedRanges.Add(r); - } - } - - private void AdjustMergedColumns(int col, bool left, bool removing) - { - AdjustMergedColumns(col, 1, left, removing); //adjusting for just one column - } - - private void AdjustMergedColumns(int col, int cnt, bool left, bool removing) - { - CellRangeCollection crc = new CellRangeCollection(this); - if (removing) - { - foreach (CellRange r in this.MergedRanges) - { - CellRange cr = r; - if (r.ContainsCol(col)) - { - if (r.LeftCol != r.RightCol) - { - cr.c2 -= cnt; - crc.Add(cr); - } - } - else - { - if (col < cr.c1) - { - cr.c1-=cnt; - cr.c2-=cnt; } - crc.Add(cr); - } - } - } - else // adding - foreach (CellRange r in this.MergedRanges) - { - CellRange cr = r; - int inspos = (left) ? col : col - 1; - if (r.ContainsCol(inspos)) - { - for (int insCnt = 0; insCnt < cnt; insCnt++) - { - string tstr = ""; - int newcol = 0; - if (left) - { - if (inspos == cr.c1) - tstr = (this[cr.r1, cr.c1 + 1] == null) ? "" : this[cr.r1, cr.c1 + 1].ToString(); - else - tstr = (this[cr.r1, cr.c1] == null) ? "" : this[cr.r1, cr.c1].ToString(); - newcol = cr.c1; - } - else - { - if (this[cr.r1, cr.c2] != null) - tstr = this[cr.r1, cr.c2].ToString(); - newcol = cr.c2 + 1; - } - for (int x = cr.r1; x <= cr.r2; x++) - this[x, newcol] = tstr; - - cr.c2++; - } - } - else if (col <= r.c1) - { - cr.c1+=cnt; - cr.c2+=cnt; - } - crc.Add(cr); - } - this.MergedRanges.Clear(); - foreach (CellRange r in crc) - { - if ((r.r1 != r.r2) || (r.c1 != r.c2)) - this.MergedRanges.Add(r); - } - } - - private bool RowIsInMergeRange(int row) - { - bool rtn = false; - if (row >= 0) - { - CellRange cr = this.Selection; - rtn = true; - int c = cr.c1; - while (rtn && (c <= cr.c2)) - { - int idx = this.MergedRanges.IndexOf(row, c); - rtn = (idx > -1); - c++; - } - } - return rtn; - } - - private bool ColIsInMergeRange(int col) - { - bool rtn = false; - if (col >= 0) - { - CellRange cr = this.Selection; - //rtn = true; - int r = cr.r1; - while (!rtn && (r <= cr.r2)) - { - int idx = this.MergedRanges.IndexOf(col, r); - rtn = (idx > -1); - r++; - } - } - return rtn; - } - - #endregion //Merged / Split Range - - #region Grid Add and Remove Row / Column - - private int GetRowInsertPosition(Boolean before) - { - int rtnrow; - CellRange selcr = this.Selection; - CellRange cr = selcr; - int idx = this.MergedRanges.IndexOf(cr.r1, cr.c2); - if (idx > -1) - cr = this.MergedRanges[idx]; // we want first or last row in merge range - rtnrow = (before) ? cr.r1 : cr.r2; - // The following is an adjustment needed when we are copying an entire row that includes some merged cells - if (selcr.c1 != selcr.c2) - { - while (!before && rtnrow > selcr.r2) rtnrow--; - while (before && rtnrow < selcr.r2) rtnrow++; - } - - return rtnrow; - } - - private int GetColInsertPosition(Boolean before) - { - int rtncol; - CellRange selcr = this.Selection; - CellRange cr = selcr; - int idx = this.MergedRanges.IndexOf(cr.r1, cr.c2); - if (idx > -1) - cr = this.MergedRanges[idx]; // we want the first of last col in merge range - rtncol = (before) ? cr.c1 : cr.c2; - // The following is an adjustment needed when we are copying an entire column that includes some merged cells - if (selcr.r1 != selcr.r2) - { - while (!before && rtncol > selcr.c2) rtncol--; - while (before && rtncol < selcr.c2) rtncol++; - } - return rtncol; - } - - public void InsertColumnBefore() - { - int newcol = this.GetColInsertPosition(true); - this.Cols.Insert(newcol); - // set new column width to same width as column from where it was inserted - this.Cols[newcol].Width = this.Cols[newcol + 1].Width; - MyBorders.InsertColumn(newcol); - this.AdjustMergedColumns(newcol, true, false); - this.AdjustGridControlSize(); - } - - public void InsertColumnAfter() - { - int colidx = this.GetColInsertPosition(false); - if (colidx == this.Cols.Count - 1) // last column - this.Cols.Add(1); - else - this.Cols.Insert(colidx + 1); - MyBorders.InsertColumn(colidx); - // set new column width to same width as column from where it was inserted - this.Cols[colidx + 1].Width = this.Cols[colidx].Width; - this.AdjustMergedColumns(colidx + 1, false, false); - this.AdjustGridControlSize(); - } - - public void InsertRowBefore() - { - int newrow = this.GetRowInsertPosition(true); - this.Rows.Insert(newrow); - // set new row Height to same heidht as row from where it was inserted - this.Rows[newrow].Height = (Rows[newrow + 1].Height == -1) ? Rows.DefaultSize : Rows[newrow + 1].Height; - //this.Rows[newrow].Height = this.Rows[newrow + 1].Height; - MyBorders.InsertRow(newrow); - this.AdjustMergedRows(newrow, true, false); - this.AdjustGridControlSize(); - } - - public void InsertRowAfter() - { - int rowidx = this.GetRowInsertPosition(false); - if (rowidx == this.Rows.Count - 1) // last row - this.Rows.Add(1); - else - this.Rows.Insert(rowidx + 1); - // set new row Height to same heidht as row from where it was inserted - this.Rows[rowidx + 1].Height = (Rows[rowidx].Height == -1) ? Rows.DefaultSize : Rows[rowidx].Height; - //this.Rows[rowidx + 1].Height = this.Rows[rowidx].Height; - MyBorders.InsertRow(rowidx + 1); - this.AdjustMergedRows(rowidx + 1, false, false); - this.AdjustGridControlSize(); - } - - public bool AllRowsSelected() - { - int maxrow = Selection.r2; - foreach (CellRange cr in MySelection) - maxrow = Math.Max(maxrow, cr.r2); - return (Selection.r1 == 0 && maxrow == Rows.Count - 1); - } - - public bool AllColumnsSelected() - { - int maxcol = Selection.c2; - foreach (CellRange cr in MySelection) - maxcol = Math.Max(maxcol, cr.c2); - return (Selection.c1 == 0 && maxcol == Cols.Count - 1); - } - - public void RemoveSelectedColumn() - { - string msg = ""; - string title = ""; - CellRange saveCR = Selection; - this.SelectionMode = SelectionModeEnum.ColumnRange; - //this.Select(this.Selection.r1, this.Selection.c1); - this.Select(0, Selection.c1, Rows.Count - 1, Selection.c2); - this.SelectionMode = SelectionModeEnum.Default; - if (Selection.c1 != Selection.c2) - { - msg = "Remove selected columns?"; - title = "Delete Columns"; - } - else - { - msg = "Remove this column?"; - title = "Delete Column"; - } - DialogResult dr = MessageBox.Show(msg, title, MessageBoxButtons.YesNo); - if (dr == DialogResult.Yes) - RemoveSelectedCells();//RemoveColumns(this.Selection.r1, this.Selection.c1, 1); - else - Select(saveCR); - } - - public void RemoveSelectedRow() - { - string msg = ""; - string title = ""; - CellRange saveCR = Selection; - this.SelectionMode = SelectionModeEnum.RowRange; - //this.Select(this.Selection.r1, this.Selection.c1,); - this.Select(Selection.r1, 0, Selection.r2, Cols.Count - 1); - this.SelectionMode = SelectionModeEnum.Default; - if (Selection.r1 != Selection.r2) - { - msg = "Remove selected rows?"; - title = "Delete Rows"; - } - else - { - msg = "Remove this row?"; - title = "Delete Row"; - } - DialogResult dr = MessageBox.Show(msg, title, MessageBoxButtons.YesNo); - if (dr == DialogResult.Yes) - this.RemoveSelectedCells();//this.RemoveRows(this.Selection.r1, this.Selection.c1, 1); - else - Select(saveCR); - } - - private void RemoveRows(int strow, int stcol, int cnt) - { - bool mergedRow = false; - for (int i = 0; i < cnt; i++) - { - //if (this.RowIsInMergeRange(strow)) - //{ - for (int cl = 0; cl < this.Cols.Count && !mergedRow; cl++) - { - int idx = this.MergedRanges.IndexOf(strow, cl); - if (idx > -1) - { - CellRange cr = this.MergedRanges[idx]; - if (cr.r1 < cr.r2) - mergedRow = true; - //this[cr.r1 + 1, cr.c1] = this[cr.r1, cr.c1]; - } - cl++; - } - //} - this.Rows.Remove(strow); - this.AdjustMergedRows(strow, false, true); - //if (mergedRow) - //{ - //cnt++; - mergedRow = false; - //} - } - MyBorders.DeleteRows(strow, cnt); - this.AdjustGridControlSize(); - } - - private void RemoveColumns(int strow, int stcol, int cnt) - { - bool mergedCol = false; - for (int i = 0; i < cnt; i++) - { - //if (this.ColIsInMergeRange(stcol)) - //{ - for (int rw = 0; rw < this.Rows.Count && !mergedCol; rw++) - { - int idx = this.MergedRanges.IndexOf(rw, stcol); - if (idx > -1) - { - CellRange cr = this.MergedRanges[idx]; - if (cr.c1 < cr.c2) - mergedCol = true; - //this[cr.r1, cr.c1 + 1] = this[cr.r1, cr.c1]; - } - } - //} - this.Cols.Remove(stcol); - this.AdjustMergedColumns(stcol, false, true); - //if (mergedCol) - //{ - // //cnt++; - mergedCol = false; - //} - } - MyBorders.DeleteColumns(stcol, cnt); - this.AdjustGridControlSize(); - } - - public void RemoveSelectedCells() - { - bool didremove = false; - int lastRow = this.Rows.Count - 1; - int lastCol = this.Cols.Count - 1; - CellRange cr = this.Selection; - - // r2 is last row (or in merge range containing last row) - // r1 is first row or r1-m (m is in merge range) is first row - // we can remove columns c1 through c2 - - int idx = this.MergedRanges.IndexOf(cr.r2, cr.c2); - CellRange mr = new CellRange(); - if (idx > -1) mr = this.MergedRanges[idx]; - if (cr.r2 == lastRow || idx > -1 && mr.r2 == lastRow)//RowIsInMergeRange(grd,cr.r2)) - { - if (cr.r1 == 0 || this.RowIsInMergeRange(cr.r1 - 1)) - { - this.RemoveColumns(cr.r1, cr.c1, cr.RightCol - cr.LeftCol + 1);// remove selected columns - didremove = true; - } - } - - - // c2 is last column (or in merge range containing last column) - // c1 is first column or c1-m (m is merge range) is first column - // we can remove rows r1 through r2 - - if (cr.c2 == lastCol || idx > -1 && mr.c2 == lastCol)//ColIsInMergeRange(grd,cr.c1-1)) - { - if (cr.c1 == 0 || this.ColIsInMergeRange(cr.c1 - 1)) - { - // remove selected rows - this.RemoveRows(cr.r1, cr.c1, cr.BottomRow - cr.TopRow + 1); - didremove = true; - } - } - - if (!didremove) - MessageBox.Show("Cannot Removed Part of a Row or Column.\n\nNote: This function allows you to delete one or more rows/columns at time.", "Invalid Selection",MessageBoxButtons.OK,MessageBoxIcon.Hand); - - return; - } - - #endregion //Grid Add and Remove Row / Column - - #region Copy/Paste - - public void CopyRow() - { - DialogResult dr = DialogResult.Yes; - SelectRow(); - if (Selection.r1 != Selection.r2) - { - //dr = MessageBox.Show("You selected a row that includes merged cells.\n\nThese additional rows must be included.\n\nCopy these rows?", "Copy Rows", MessageBoxButtons.YesNo); - dr = MessageBox.Show("Your selection was expanded due to merged cell regions.\n\nContinue with the copy?", "Copy Rows", MessageBoxButtons.YesNo); - } - if (dr == DialogResult.Yes) - CopyToCopiedFlexGrid(GridCopyOption.Row); - } - - public void CopyColumn() - { - SelectCol(); - DialogResult dr = DialogResult.Yes; - if (Selection.c1 != Selection.c2) - { - //dr = MessageBox.Show("You selected a column that includes merged cells.\n\nThese additional columns must be included.\n\nCopy these columns?", "Copy Columns", MessageBoxButtons.YesNo); - dr = MessageBox.Show("Your selection was expanded due to merged cell regions.\n\nContinue with the copy?", "Copy Columns", MessageBoxButtons.YesNo); - } - if (dr == DialogResult.Yes) - CopyToCopiedFlexGrid(GridCopyOption.Column); - } - - public void CopyCellSelection() - { - DialogResult dr = DialogResult.Yes; - CellRange cr = Selection; - MakeSelectionEven(); - if (!cr.Equals(Selection)) - { - dr = MessageBox.Show("Your selection was expanded due to merged cell regions.\n\nContinue with the copy?", "Copy Selection", MessageBoxButtons.YesNo); - } - if (dr == DialogResult.Yes) - CopyToCopiedFlexGrid(GridCopyOption.Selection); - } - - public enum enmPastePos : int - { - Before = 1, Replace = 0, After = -1 - } - - public void PasteRows(enmPastePos pp) - { - if (MyCopyInfo.MyCopiedFlexGrid == null || MyCopyInfo.MyCopyOption != GridCopyOption.Row) return; - int rowsToAdd = MyCopyInfo.MyCopiedCellRange.r2 - MyCopyInfo.MyCopiedCellRange.r1 + 1; - int colsToAdd = Math.Max((MyCopyInfo.MyCopiedCellRange.c2 - MyCopyInfo.MyCopiedCellRange.c1 + 1) - Cols.Count, 0); - int selR1 = Selection.r1; - int selR2 = Selection.r2; - int rowOffset = selR1 + (pp == enmPastePos.After ?(selR2-selR1)+1 : 0) - MyCopyInfo.MyCopiedCellRange.r1; - - // If the rows we are copying has more columns than the current table, then append then needed columns to the grid - if (colsToAdd > 0) - { - Cols.Add(colsToAdd); - AdjustMergedColumns(Cols.Count - 1, colsToAdd, false, false); - MyBorders.InsertColumns(Cols.Count - colsToAdd - 1, colsToAdd); - } - - switch (pp) - { - case enmPastePos.Before: - this.Rows.InsertRange(selR1, rowsToAdd); - AdjustMergedRows(selR1, rowsToAdd, true, false); - MyBorders.InsertRows(Rows.Count - rowsToAdd - 1, rowsToAdd); - break; - case enmPastePos.After: - if (selR2+1 < Rows.Count - 1) - { - this.Rows.InsertRange(selR2 + 1, rowsToAdd); - AdjustMergedRows(selR1+1, rowsToAdd, false, false); - } - else - this.Rows.Add(rowsToAdd); - MyBorders.InsertRows(Rows.Count - rowsToAdd - 1, rowsToAdd); - break; - case enmPastePos.Replace: - if (rowsToAdd > Rows.Count - Selection.r1) - { - int numToAdd = rowsToAdd - (Rows.Count = selR1); - this.Rows.Add(numToAdd); - AdjustMergedRows(selR1, numToAdd, false, false); - } - break; - } - - RemoveMergedRanges(MyCopyInfo.MyCopiedCellRange.r1 + rowOffset, MyCopyInfo.MyCopiedCellRange.c1, MyCopyInfo.MyCopiedCellRange.r2 + rowOffset, MyCopyInfo.MyCopiedCellRange.c2); - for (int r = MyCopyInfo.MyCopiedCellRange.r1; r <= MyCopyInfo.MyCopiedCellRange.r2; r++) - { - Rows[r + rowOffset].Height = MyCopyInfo.MyCopiedFlexGrid.Rows[r].Height; - for (int c = MyCopyInfo.MyCopiedCellRange.c1; c <= Math.Min(MyCopyInfo.MyCopiedCellRange.c2 + colsToAdd, Cols.Count - 1); c++) - { - CellRange crm = MyCopyInfo.MyCopiedFlexGrid.GetMergedRange(r, c); - if (r == crm.r1 && c == crm.c1) - { - Cols[c].Width = Math.Max(Cols[c].Width, MyCopyInfo.MyCopiedFlexGrid.Cols[c].Width); - CellRange cr = GetCellRange(crm.r1 + rowOffset, crm.c1, crm.r2 + rowOffset, crm.c2); - // if the paste is above - copy merge range for the destination - // if the paste is below - put back the range for the source location - if ((crm.r2 > crm.r1) || (crm.c2 > crm.c1)) - MergedRanges.Add(cr); - this[r + rowOffset, c] = MyCopyInfo.MyCopiedFlexGrid[r, c]; - MatchStyle(crm, cr); - PasteBorders(r + rowOffset, c, r, c); - // if the paste is above - put back the range for the source location - // if the paste is below - copy merge range for the destination - int r1 = crm.r1 + rowsToAdd - rowOffset; - int r2 = crm.r2 + rowsToAdd - rowOffset; - CellRange ncr = GetCellRange(r1, crm.c1, r2, crm.c2); - if ((crm.r2 > crm.r1) || (crm.c2 > crm.c1)) - MergedRanges.Add(ncr); - } - } - } - - this.AdjustGridControlSize(); - CopyToCopiedFlexGrid(MyCopyInfo.MyCopyOption); - } - - private void MatchStyle(CellRange crm, CellRange cr) - { - if (crm.Style != null) - { - ChangeCellAlign(cr, crm.Style.TextAlign); - ChangeCellBorder(cr, crm.Style.Border.Style); - } - //else - //{ - // cr.Style = null; // - didn't like the null - //} - } - - private void RemoveMergedRanges(int r1, int c1, int r2, int c2) - { - for (int r = r1; r <= r2; r++) - for (int c = c1; c <= c2; c++) - { - CellRange cr = GetMergedRange(r, c); - if (cr.r1 < cr.r2 || cr.c1 < cr.c2) - MergedRanges.Remove(cr); - } - } - - public void PasteColumns(enmPastePos pp) - { - if (MyCopyInfo.MyCopiedFlexGrid == null || MyCopyInfo.MyCopyOption != GridCopyOption.Column) return; - - int colsToAdd = MyCopyInfo.MyCopiedCellRange.c2 - MyCopyInfo.MyCopiedCellRange.c1 + 1; - int rowsToAdd = Math.Max((MyCopyInfo.MyCopiedCellRange.r2 - MyCopyInfo.MyCopiedCellRange.r1 + 1) - Rows.Count, 0); - int selC1 = Selection.c1; - int selC2 = Selection.c2; - int colOffset = selC1 + (pp == enmPastePos.After ? (selC2-selC1)+1 : 0) - MyCopyInfo.MyCopiedCellRange.c1; - - // If the columns we are copying has more rows than the current table, then append the needed rows to the grid - if (rowsToAdd > 0) - { - Rows.Add(rowsToAdd); - AdjustMergedRows(Rows.Count, false, false); - MyBorders.InsertRows(Rows.Count - rowsToAdd - 1,rowsToAdd); - } - - switch (pp) - { - case enmPastePos.Before: - this.Cols.InsertRange(selC1, colsToAdd); - AdjustMergedColumns(selC1, colsToAdd, true, false); - MyBorders.InsertColumns(Cols.Count - colsToAdd - 1, colsToAdd); - break; - case enmPastePos.After: - if (selC2+1 < Cols.Count - 1) - { - this.Cols.InsertRange(selC2+1, colsToAdd); - AdjustMergedColumns(selC1+1, colsToAdd, false, false); - } - else - this.Cols.Add(colsToAdd); - MyBorders.InsertColumns(Cols.Count - colsToAdd - 1, colsToAdd); - break; - case enmPastePos.Replace: - if (colsToAdd > Cols.Count - selC1) - { - int numToAdd = colsToAdd - (Cols.Count - selC1); - this.Cols.Add(numToAdd); - AdjustMergedColumns(selC1, numToAdd, true, false); - } - break; - } - - RemoveMergedRanges(MyCopyInfo.MyCopiedCellRange.r1, MyCopyInfo.MyCopiedCellRange.c1 + colOffset, MyCopyInfo.MyCopiedCellRange.r2, MyCopyInfo.MyCopiedCellRange.c2 + colOffset); - - // Fix the merge ranges - for (int c = MyCopyInfo.MyCopiedCellRange.c1; c <= MyCopyInfo.MyCopiedCellRange.c2; c++) - { - Cols[c + colOffset].Width = MyCopyInfo.MyCopiedFlexGrid.Cols[c].Width; - for (int r = MyCopyInfo.MyCopiedCellRange.r1; r <= Math.Min(MyCopyInfo.MyCopiedCellRange.r2 + rowsToAdd, Rows.Count - 1); r++) - { - CellRange crm = MyCopyInfo.MyCopiedFlexGrid.GetMergedRange(r, c); - if (r == crm.r1 && c == crm.c1) - { - Rows[r].Height = Math.Max(Rows[r].Height, MyCopyInfo.MyCopiedFlexGrid.Rows[r].Height); - CellRange cr = GetCellRange(crm.r1, crm.c1 + colOffset, crm.r2, crm.c2 + colOffset); - // if the paste is to the left - copy merge range for the destination - // if the paste is to the right - put back the range for the source location - if ((crm.r2 > crm.r1) || (crm.c2 > crm.c1)) - MergedRanges.Add(cr); - // copy cell text to the destination, copy the style, copy the cell borders - this[r, c + colOffset] = MyCopyInfo.MyCopiedFlexGrid[r, c]; - MatchStyle(crm, cr); - PasteBorders(r, c + colOffset, r, c); - // if the paste is to the left - put back the range for the source location - // if the paste is to the right - copy merge range for the destination - int c1 = crm.c1 + colsToAdd - colOffset; - int c2 = crm.c2 + colsToAdd - colOffset; - CellRange ncr = GetCellRange(crm.r1, c1, crm.r2, c2); - if ((crm.r2 > crm.r1) || (crm.c2 > crm.c1)) - MergedRanges.Add(ncr); - } - } - } - - this.AdjustGridControlSize(); - CopyToCopiedFlexGrid(MyCopyInfo.MyCopyOption); - - } - - public void PasteCopiedCells() - { - // Warn the user that this type of paste will replace the currently selected (highlighted) table cells and give the option to abort. - DialogResult dr = MessageBox.Show("This will replace the cells that are currently selected (highlighted). \n\nContinue with the paste?","Paste Table Cells",MessageBoxButtons.YesNo,MessageBoxIcon.Question); - if (dr == DialogResult.No) return; - - int nSelRows = Selection.r2 - Selection.r1 + 1; - int nSelCols = Selection.c2 - Selection.c1 + 1; - int nCpyRows = MyCopyInfo.MyCopiedCellRange.r2 - MyCopyInfo.MyCopiedCellRange.r1 + 1; - int nCpyCols = MyCopyInfo.MyCopiedCellRange.c2 - MyCopyInfo.MyCopiedCellRange.c1 + 1; - int colsToAdd = Math.Max(nCpyCols - nSelCols, 0); - int rowsToAdd = Math.Max(nCpyRows - nSelRows, 0); - int rowOffset = Selection.r1 - MyCopyInfo.MyCopiedCellRange.r1; - int colOffset = Selection.c1 - MyCopyInfo.MyCopiedCellRange.c1; - int selR2 = Selection.r2; - int selC2 = Selection.c2; - // If there are more cells to copy than what is seleceted in the target table - // Add extra rows and columns as needed - if (rowsToAdd > 0) - { - if (selR2 < Rows.Count - 1) - { - this.Rows.InsertRange(selR2 + 1, rowsToAdd); - AdjustMergedRows(selR2 + 1, false, false); - } - else - this.Rows.Add(rowsToAdd); - MyBorders.InsertRows(selR2,rowsToAdd); - } - - if (colsToAdd > 0) - { - if (selC2 < Cols.Count - 1) - { - this.Cols.InsertRange(selC2 + 1, colsToAdd); - AdjustMergedColumns(selC2 + 1, false, false); - } - else - this.Cols.Add(colsToAdd); - MyBorders.InsertColumns(selC2,colsToAdd); - } - - RemoveMergedRanges(MyCopyInfo.MyCopiedCellRange.r1 + rowOffset, MyCopyInfo.MyCopiedCellRange.c1 + colOffset, MyCopyInfo.MyCopiedCellRange.r2 + rowOffset, MyCopyInfo.MyCopiedCellRange.c2 + colOffset); - - for (int c = MyCopyInfo.MyCopiedCellRange.c1; c <= Math.Min(MyCopyInfo.MyCopiedCellRange.c2, Cols.Count - 1 - colOffset); c++) - Cols[c + colOffset].Width = Math.Max(MyCopyInfo.MyCopiedFlexGrid.Cols[c].Width, Cols[c + colOffset].Width); - - for (int r = MyCopyInfo.MyCopiedCellRange.r1; r <= Math.Min(MyCopyInfo.MyCopiedCellRange.r2, Rows.Count - 1 - rowOffset); r++) - { - Rows[r + rowOffset].Height = Math.Max(MyCopyInfo.MyCopiedFlexGrid.Rows[r].Height, Rows[r + rowOffset].Height); - for (int c = MyCopyInfo.MyCopiedCellRange.c1; c <= Math.Min(MyCopyInfo.MyCopiedCellRange.c2, Cols.Count - 1 - colOffset); c++) - { - CellRange crm = MyCopyInfo.MyCopiedFlexGrid.GetMergedRange(r, c); - if (r == crm.r1 && c == crm.c1) - { - CellRange cr = GetCellRange(crm.r1 + rowOffset, crm.c1 + colOffset, crm.r2 + rowOffset, crm.c2 + colOffset); - if ((crm.r2 > crm.r1) || (crm.c2 > crm.c1)) - MergedRanges.Add(cr); - this[r + rowOffset, c + colOffset] = MyCopyInfo.MyCopiedFlexGrid[r, c]; - MatchStyle(crm, cr); - PasteBorders(r + rowOffset, c + colOffset, r, c); - } - } - } - this.AdjustGridControlSize(); - CopyToCopiedFlexGrid(MyCopyInfo.MyCopyOption); - } - - #endregion // Copy/Paste - #region Selection - public bool SelectNextCell() - { - int r = this.Row; - int c = this.Col; - CellRange cr = GetMergedRange(r, c); - do - { - c = cr.c2 + 1; - if (c >= this.Cols.Count) - { - r = r + 1; - c = 0; - if (r >= this.Rows.Count) return false; - } - cr = GetMergedRange(r, c); - } while (r != cr.r1 || c != cr.c1); - Select(r, c); - return true; - } - public bool SelectPrevCell() - { - int r = this.Row; - int c = this.Col; - CellRange cr = GetMergedRange(r, c); - do - { - c = cr.c1 - 1; - if (c < 0) - { - r = r - 1; - c = this.Cols.Count-1; - if (r < 0) return false; - } - cr = GetMergedRange(r, c); - c = cr.c1; - } while (r != cr.r1); - Select(r, c); - return true; - } - #endregion - #region SearchableText - public string GetSearchableText() - { - StringBuilder sb = new StringBuilder(); - int r = 0; - int c = 0; - int w = Cols.Count; - int h = Rows.Count; - - while (r < h) - { - CellRange cr = GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - if (this[r, c] != null) - { - string strp = DisplayText.StaticStripRtfCommands((string)this[r, c]); - sb.Append(strp.Replace("\r\n", " ")); - } - sb.Append("\r\n"); - } - c = c + 1; - if (c == w) - { - c = 0; - r = r + 1; - } - } - return sb.ToString(); - } - #endregion - #region Import / Export Grid - - /// - /// Prompts user with Save File dialog. - /// Grid will be saved to an XML file. - /// - /// - public void ExportToXML(string initDir) - { - SaveFileDialog sfd = new SaveFileDialog(); - sfd.DefaultExt = ".xml"; - sfd.Filter = "XML files (*.xml)|*.xml|All files (*.*)|*.* "; - //sfd.InitialDirectory = @"C:\Development\SampleTableData"; - sfd.InitialDirectory = initDir; - sfd.Title = "Save XML File"; - sfd.ShowDialog(); - this.WriteXml(sfd.FileName); - } - public string GetXMLData() - { - string retstr = null; - using (StringWriter sw = new StringWriter()) - { - this.WriteXml(sw); - retstr = sw.GetStringBuilder().ToString(); - sw.Close(); - } - return retstr; - } - /// - /// Prompts user with Save File dialog. - /// Grid will be saved to an Excel file. - /// - /// - public void ExportToExcel(string initDir) - { - SaveFileDialog sfd = new SaveFileDialog(); - sfd.DefaultExt = ".xls"; - sfd.Filter = "Excel files (*.xls)|*.xls|All files (*.*)|*.* "; - //sfd.InitialDirectory = @"C:\Development\SampleTableData"; - sfd.InitialDirectory = initDir; - sfd.Title = "Save Excel File"; - sfd.ShowDialog(); - this.SaveExcel(sfd.FileName); - } - - /// - /// Prompts user with Open File dialog. - /// XML file will be imported to a table grid. - /// - /// - /// - public string ImportXML(string initDir) - { - string rtn = ""; - OpenFileDialog ofd = new OpenFileDialog(); - ofd.DefaultExt = ".xml"; - ofd.Filter = "XML files (*.xml)|*.xml|All files (*.*)|*.* "; - //ofd.InitialDirectory = @"C:\Development\SampleTableData"; - ofd.InitialDirectory = initDir; - ofd.Multiselect = false; - ofd.Title = "Select XML File"; - ofd.ShowDialog(); - this.Clear(); - this.MergedRanges.Clear(); - this.ReadXml(ofd.FileName); - this.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None; - this.KeyActionTab = KeyActionEnum.MoveAcross; - this.AdjustGridControlSize(); - rtn = ofd.SafeFileName; - return rtn; - } - - /// - /// Prompts user with Open File dialog. - /// Excel file will be imported to a table grid. - /// - /// - /// - public string ImportExcel(string initDir) - { - string rtn = ""; - //VlnFlexGrid grd = rbtDefaultTable.Checked ? vlnFlexGrid2 : vlnFlexGrid3; //GetActiveGrid(); - OpenFileDialog ofd = new OpenFileDialog(); - ofd.DefaultExt = ".xls"; - ofd.Filter = "Excel files (*.xls)|*.xls|All files (*.*)|*.*"; - //ofd.InitialDirectory = @"C:\Development\SampleTableData"; - ofd.InitialDirectory = initDir; - ofd.Multiselect = false; - ofd.Title = "Select Excel File"; - ofd.ShowDialog(); - this.Clear(); - this.MergedRanges.Clear(); - this.LoadExcel(ofd.FileName); - this.AdjustGridControlSize(); - rtn = ofd.SafeFileName; - return rtn; - } - - public void ConvertTableROToGrid(string valtext, int rodbid, string roid) - { - VE_Font vefont = _MyItemInfo.GetItemFont(); - this.Font = vefont.WindowsFont; - this.MergedRanges.Clear(); - this.Clear(); - this.IsRoTable = true; - this.ParseTableFromText(valtext, GridLinePattern.Single); - this.AutoSizeCols(); - this.AutoSizeRows(); - this.MakeRTFcells(); - this.RODbId = rodbid; - this.ROID = roid; - } - - private Regex _ReplaceSpaceNewLine = new Regex(@"(?<=\\[^' \\?\r\n\t]*) (?=\r\n)"); - private Regex _ReplaceTokenSpaceToken = new Regex(@"(?<=\\[^' \\?\r\n\t]*) (?=\\)"); - private Regex _RemoveComments = new Regex(@"\\v .*?\\v0( |$)"); - - private string PrepROTableText(string stepText) - { - // we need to convert some RTF command to DOS so that we can - // figure out the table size - stepText = stepText.Replace("\r", ""); - stepText = stepText.Replace("\xF8", @"\'f8"); - stepText = stepText.Replace(@"\par ", "\r\n"); - stepText = _ReplaceTokenSpaceToken.Replace(stepText, ""); - - //Change Token Order to match RTB output - stepText = stepText.Replace(@"\v0\b0", @"\b0\v0"); - stepText = stepText.Replace(@"\b0\ulnone", @"\ulnone\b0"); - stepText = _ReplaceSpaceNewLine.Replace(stepText, ""); - - // Now change the Unicode symbols to DOS symbols - stepText = stepText.Replace(@"\u8209?", "-"); - stepText = stepText.Replace(@"\u9474?", "\xB3"); // Vert Line graphic character - stepText = stepText.Replace(@"\'b0", "\xB0"); - stepText = stepText.Replace(@"\up2 ", "\x9566"); - stepText = stepText.Replace(@"\up0 ", "\x9567"); - stepText = stepText.Replace(@"\ulnone", "\xBB"); - stepText = stepText.Replace(@"\ul", "\xAB"); - stepText = stepText.Replace(@"\{", "{"); - stepText = stepText.Replace(@"\}", "}"); - stepText = stepText.Replace(@"\b0", "\xD6"); - stepText = stepText.Replace(@"\b", "\xD5"); - stepText = stepText.Replace(@"\u160?", "\xA0"); //hard space - stepText = stepText.Replace(@"\u916?", "\x7F"); // delta - stepText = stepText.Replace(@"\u8805?", "\xF2"); //greater than or equal - stepText = stepText.Replace(@"\u8804?", "\xF3"); // less than or equal - stepText = stepText.Replace(@"\u931?", "\xE4"); // sigma - stepText = stepText.Replace(@"\u947?", "\xE7"); // gamma - stepText = stepText.Replace(@"\u9604?", "\xFE"); // accum 2584 - stepText = stepText.Replace(@"\u9679?", "\x7"); // bullet 25CF - stepText = stepText.Replace(@"\u8776?", "\xF7"); // approx eq - stepText = stepText.Replace(@"\u8773?", "\xF0"); // similar eq 2245 - stepText = stepText.Replace(@"\u8730?", "\xFB"); // square root - stepText = stepText.Replace(@"\u961?", "\xE2"); // rho 3C1 - stepText = stepText.Replace(@"\u960?", "\xE3"); // pi - stepText = stepText.Replace(@"\u956?", "\xE6"); // micro - stepText = stepText.Replace(@"\u948?", "\xEB"); // lower case delta - stepText = stepText.Replace(@"\u963?", "\xE5"); // lower case sigma - stepText = stepText.Replace(@"\u274?", "\x90"); // energy, 112 - stepText = stepText.Replace(@"\u949?", "\xEE"); // epsilon - stepText = stepText.Replace(@"\u952?", "\xE9"); // theta, 3B8 - stepText = stepText.Replace(@"\u8857?", "\xEC"); // dot in oval, 2299 - stepText = stepText.Replace(@"\u964?", "\xA8"); // tau, 3C4 - stepText = stepText.Replace(@"\u9830?", "\xA9"); // diamond, 2666 - stepText = stepText.Replace(@"\u8593?", "\x18"); // Up Arrow - changes to \xff - stepText = stepText.Replace(@"\u8595?", "\x19"); // Down Arrow - changes to \xd6 - // Fix "|" followed by a newline - this confuses the table converter - stepText = stepText.Replace(@"|\r\n", @"| \r\n"); - stepText = stepText.Replace(@"|\n\r", @"| \n\r"); - stepText = stepText.Replace(@"|\n", @"| \n"); - - // if the entire row is underlined, then remove the underline and insert a row of dashes - stepText = ConvertUnderlineToRow(stepText); - - return stepText; - } - private bool IsPrintableTableChar(char c) - { - string printablSymbols = "\xB3\xA0\x7F\xF2\xF3\xE4\xE7\xFE\x07\xF7\xF0\xFB\xE2\xE3\xE6\xEB\xE5\x90\xEE\xE9\xEC\xA8\xA9\x18\x19"; - return (((c > '\x1F') && (c < '\x80')) || (printablSymbols.IndexOf(c) >= 0)); - } - private string ConvertUnderlineToRow(string stepText) - { - string rtnStr = ""; - char[] sep = { '\n' }; - string[] lines = stepText.Split(sep); - foreach (string line in lines) - { - int idx = 0; - int chrCnt = 0; - int uOnPos = -1; - int uOffPos = -1; - bool ulineOn = false; - char curChar = line[idx]; - string dashRow = ""; - while (idx < line.Length && !IsPrintableTableChar(line[idx])) - { - if (line[idx] == '\xAB') //underline ON - { - ulineOn = true; - uOnPos = idx; - } - idx++; - } - while (ulineOn && idx < line.Length) - { - if (IsPrintableTableChar(line[idx])) - { - if (line[idx] == '|' || line[idx] == '\xB3') - { - dashRow += new string('-', chrCnt); - dashRow += "|"; - chrCnt = 0; - } - else - chrCnt++; - idx++; - } - else - { - if (line[idx] == '\xBB') //underline OFF - { - uOffPos = idx; - ulineOn = false; - while ((idx < line.Length) && !IsPrintableTableChar(line[idx])) - { - if (line[idx] == '\xAB') - ulineOn = true; - idx++; - } - if (idx == line.Length) - ulineOn = true; - if (!ulineOn) - dashRow = ""; - } - else - idx++; - } - } - string curLine = line; - curLine = curLine.Replace('\xB3', '|'); // replace graphic vert bar with DOS vert bar - if (ulineOn && idx == line.Length) // entire line is underlined, remove underline, insert row of dashes - { - curLine = curLine.Replace("\xAB", ""); // remove Underline ON - curLine = curLine.Replace("\xBB", ""); // remove Underline OFF - dashRow += new string('-', chrCnt); - dashRow = "\n" + dashRow; - } - if (rtnStr.Length > 0) rtnStr += "\n"; - rtnStr += curLine; - rtnStr += dashRow; - } - return rtnStr; - } - - /// - /// This will parse a string containing the ascii text of the old style VE-PROMS (16-bit) tables. - /// It will find the number of rows and columns base on newlines, vertical bars, and dashes. - /// Then it will parse the the text, place them in cells, and attempt to merge cells were needed. - /// - /// - public void ParseTableFromText(string buff,GridLinePattern border) - { - string txtbuff = PrepROTableText(buff); - if (IsRoTable) txtbuff = _RemoveComments.Replace(txtbuff, ""); - int curRow = 0; - int curCol = 0; - int maxRow = 0; - int maxCol = 0; - // Get Max Rows and Max Cols - char[] test = "|\n\x02".ToCharArray(); - int idx = 0; - int idxst = 0; - int colPos = 0; - int strow = 0; - Dictionary dicCols = new Dictionary(); - do - { - idx = txtbuff.IndexOfAny(test, idxst); - if (idx > -1) - { - switch (txtbuff[idx]) - { - case '|': // end of a column - colPos = idxst - strow; - if (!dicCols.ContainsKey(colPos)) - dicCols.Add(colPos, curCol); - else if (curCol > dicCols[colPos]) - { - dicCols.Remove(colPos); - dicCols.Add(colPos, curCol); - } - curCol++; - break; - case '\x02': - case '\n': // end of a row - colPos = idxst - strow; - if (!dicCols.ContainsKey(colPos)) - dicCols.Add(colPos, curCol); - else if (curCol > dicCols[colPos]) - { - dicCols.Remove(colPos); - dicCols.Add(colPos, curCol); - } - curRow++; - strow = idx + 1; - if (curCol > maxCol) - maxCol = curCol; - curCol = 0; - break; - } - idxst = idx + 1; - if (idxst >= txtbuff.Length) - idx = -1; - } - } while (idx != -1); - if (idxst < txtbuff.Length) - { - colPos = idxst - strow; - if (!dicCols.ContainsKey(colPos)) - dicCols.Add(colPos, curCol); - else if (curCol > dicCols[colPos]) - { - dicCols.Remove(colPos); - dicCols.Add(colPos, curCol); - } - } - maxRow = curRow; // +1; - curRow = 0; - curCol = 0; - // The resulting Table Grid size in rows and columns - this.Cols.Count = maxCol + 1; - this.Rows.Count = maxRow + 1; - - // make all rows and columns editable - this.Rows.Fixed = 0; - this.Cols.Fixed = 0; - - // TableCellInfo is used to assign merge ranges - // Make a two dimensional array of TableCellinfo the same size as the table grid - TableCellInfo[,] tci = new TableCellInfo[maxRow + 1, maxCol + 1]; - for (int r = 0; r <= maxRow; r++) - for (int c = 0; c <= maxCol; c++) - tci[r, c] = new TableCellInfo(); - // Read in each cell of the grid - idx = 0; - idxst = 0; - colPos = 0; - strow = 0; - int prevCol = 0; - int tstidx = 0; - string tstr = ""; - bool incRow = false; - do - { - idx = txtbuff.IndexOfAny(test, idxst); - if (idx > -1) - { - switch (txtbuff[idx]) - { - case '|': // end of column - colPos = idxst - strow; - // based on the position of the | char, find what column we are in. - // note that this will tell us if any columns to the left were merged - // the while loop will flag cell that need to be merged - curCol = dicCols[colPos]; - while (curCol > prevCol + 1) - { - tci[curRow, prevCol].MergeColRight = true; - prevCol++; - } - prevCol = curCol; - - // parse out the text to be placed in the table cell - tstr = txtbuff.Substring(idxst, idx - idxst); - if (tstr.Length == 0) - tstr += " "; - // test for a string of '-' characters - for (tstidx = 0; (tstidx < tstr.Length) && (tstr[tstidx] == '-'); tstidx++) ; - if (tstidx < tstr.Length) // not a full line (row) of '-' chars - { - // take a peek at the start of the next piece of table text to parse - // if it starts with a '-' char, then flag to merge the columns up to - // this point with the same columns in the next row - if (idx < txtbuff.Length - 1 && txtbuff[idx + 1] == '-') - { - for (int c = curCol; c >= 0; c--) - if (!tci[curRow, c].ColEnd) - tci[curRow, c].MergeRowBellow = true; - } - // if this column is in a merged grouping of rows, - // get the cell text in the first cell of the merged grouping of cells - // we will append the newly parsed text to this cell's text. - int rw = curRow; - while (rw - 1 >= 0 && tci[rw - 1, curCol].MergeRowBellow) rw--; - int cl = curCol; - while (cl - 1 >= 0 && tci[rw, cl-1].MergeColRight) cl--; - //string jstr = (string)this[rw, curCol]; - string jstr = (string)this[rw, cl]; - if (jstr == null) - jstr = tstr; - else - jstr += ((cl==curCol)? "\n" : "") + tstr; // multi line cell - //jstr += "\n" + tstr; // multi line cell - //this[rw, curCol] = jstr; - this[rw, cl] = jstr; - //// take a peek at the start of the next piece of table text to parse - //// if it starts with a '-' char, then flag to merge the columns up to - //// this point with the same columns in the next row - //if (idx < txtbuff.Length - 1 && txtbuff[idx + 1] == '-') - //{ - // for (int c = curCol; c >= 0; c--) - // if (!tci[curRow, c].ColEnd) - // tci[curRow, c].MergeRowBellow = true; - //} - //int tcol = dicCols[idx]; - //// if were are that the end of the 16-bit text line, but not in the last column, - //// merge the remaining columns to the right - //if (curCol < tcol) - //{ - // for (int i = curCol; i <= tcol; i++) - // tci[curRow, i].MergeColRight = true; - //} - } - else // parsed text contains all dashes - { - // take a peek at the start of the next piece of table text to parse - // if it starts with a space, return, newline, or EndOfFile char, - // then flag to merge the columns up to - // this point with the same columns in the next row - if (idx < txtbuff.Length - 1 && " \r\n\x02".IndexOf(txtbuff[idx + 1]) > 0) - { - int nextCol = (curCol + 1 > this.Cols.Count) ? curCol : curCol + 1; - if (!tci[curRow, nextCol].ColEnd) - tci[curRow, nextCol].MergeRowBellow = true; - //for (int c = nextCol; c >= 0; c--) - // if (!tci[curRow, c].ColEnd) - // tci[curRow, c].MergeRowBellow = true; - } - tci[curRow, curCol].ColEnd = true; - incRow = true; - } - break; - case '\x02': // end of file - case '\n': // new line of 16-bit table text - colPos = idxst - strow; - curCol = dicCols[colPos]; - // see what column we are in - new line might occure before last grid column - strow = idx + 1; - // parse out the cell text - tstr = txtbuff.Substring(idxst, idx - idxst); - if (tstr.EndsWith("\r")) // strip off carrage return - tstr = tstr.Substring(0, tstr.Length - 1); - //tstr = tstr.TrimEnd(" ".ToCharArray()); - if (tstr.Length == 0) - tstr += " "; - // test for a string of '-' characters - for (tstidx = 0; (tstidx < tstr.Length) && (tstr[tstidx] == '-'); tstidx++) ; - if (tstidx < tstr.Length) // not a full line (row) of '-' chars - { - //curCol = dicCols[colPos]; - while (curCol > prevCol + 1) - { - tci[curRow, prevCol].MergeColRight = true; - prevCol++; - } - // if this column is in a merged grouping of rows, - // get the cell text in the first cell of the merged grouping of cells - // we will append the newly parsed text to this cell's text. - int rw = curRow; - while (rw - 1 >= 0 && tci[rw - 1, curCol].MergeRowBellow) rw--; - int cl = curCol; - while (cl - 1 >= 0 && tci[rw, cl-1].MergeColRight) cl--; - //string jstr = (string)this[rw, curCol]; - string jstr = (string)this[rw, cl]; - if (jstr == null) - jstr = tstr; - else - jstr += ((cl == curCol) ? "\n" : "") + tstr; // multi line cell - //jstr += "\n" + tstr; // multi line cell - - //this[rw, curCol] = jstr; - this[rw, cl] = jstr; - } - else if (tstr.Length > 0) // parsed text is all dash characters - { - incRow = true; - if (curRow > 0 && curCol > 0) // merge the column in the previous row with this one - tci[curRow - 1, curCol].MergeRowBellow = false; - } - // if were are that the end of the 16-bit text line, but not in the last column, - // merge the remaining columns to the right - if ((curCol < maxCol) && (tstidx < tstr.Length)) - { - for (int i = curCol; i < maxCol; i++) - tci[curRow, i].MergeColRight = true; - } - if (incRow) - curRow++; - curCol = 0; - incRow = false; - break; - } - idxst = idx + 1; - if (idxst >= txtbuff.Length) - idx = -1; - } - else if (idxst < txtbuff.Length - 1) // handle any remaining text not yet parsed - { - // find the curent column and merge remaining columns to the right - colPos = idxst - strow; - curCol = dicCols.Count==0?0:dicCols[colPos]; - while (curCol > prevCol + 1) - { - tci[curRow, prevCol].MergeColRight = true; - prevCol++; - } - // parse out the remaining text - tstr = txtbuff.Substring(idxst); - //tstr = tstr.TrimEnd(" ".ToCharArray()); - if (tstr.Length == 0) - tstr += " "; - // test for a string of '-' characters - for (tstidx = 0; (tstidx < tstr.Length) && (tstr[tstidx] == '-'); tstidx++) ; - if (tstidx < tstr.Length) - { - // if this column is in a merged grouping of rows, - // get the cell text in the first cell of the merged grouping of cells - // we will append the newly parsed text to this cell's text. - int rw = curRow; - while (rw - 1 >= 0 && tci[rw - 1, curCol].MergeRowBellow) rw--; - int cl = curCol; - while (cl - 1 >= 0 && tci[rw, cl-1].MergeColRight) cl--; - //string jstr = (string)this[rw, curCol]; - string jstr = (string)this[rw, cl]; - if (jstr == null) - jstr = tstr; - else - jstr += ((cl == curCol) ? "\n" : "") + tstr; // multi line cell - //jstr += "\n" + tstr; // multi line cell - //this[rw, curCol] = jstr; - this[rw, cl] = jstr; - } - } - } while (idx != -1); - - // we are done parsing the 16-bit text. - // now set the merge ranges in the table grid, based on the - // information saved in that two dimensional array of TableCellinfo - this.Rows.Count = curRow + 1; - this.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.Custom; - maxRow = curRow; - int rR = 0; - int rC = 0; - for (int r = 0; r <= maxRow; r++) - for (int c = 0; c <= maxCol; c++) - { - if (tci[r, c].MergeColRight) - { - rC = c; - while ((rC < maxCol) && (tci[r, rC].MergeColRight)) rC++; - if (rC > c) - { - this.MergedRanges.Add(this.GetCellRange(r, c, r, rC)); - string cellstr = this[r, c].ToString(); - for (int x = c + 1; x <= rC; x++) - this[r, x] = cellstr; - c = rC; - } - } - } - for (int c = 0; c <= maxCol; c++) - for (int r = 0; r <= maxRow; r++) - { - if (tci[r, c].MergeRowBellow) - { - rR = r; - while ((rR < maxRow) && (tci[rR, c].MergeRowBellow)) rR++; - if (rR > r) - { - this.MergedRanges.Add(this.GetCellRange(r, c, rR, c)); - string cellstr = this[r, c].ToString(); - for (int x = r + 1; x <= rR; x++) - this[x, c] = cellstr; - r = rR; - } - } - } - for (int c = 0; c <= maxCol; c++) - for (int r = 0; r <= maxRow; r++) - { - if (this[r, c] != null) - { - string cellstr = this[r, c].ToString(); - this[r, c] = cellstr.TrimEnd("\r\n\t".ToCharArray()); - //this[r, c] = cellstr.TrimEnd(" \r\n\t".ToCharArray()); - CellRange cr = this.GetMergedRange(r, c); - if (cr.r1 != cr.r2) - TrimMergedRangeCellText(cr); - } - } - MyBorders = new VlnBorders(border, Rows.Count, Cols.Count); - } - - private void TrimMergedRangeCellText(CellRange cr) - { - // count number of newlines - string cellstr = this[cr.r1, cr.c1].ToString(); - string[] strary = cellstr.Split("\n".ToCharArray()); - int nlines = strary.Length; - // count number of rows in merge range - int nrows = (cr.r2 - cr.r1) + 1; - int neededLines = (nlines - (nrows - 1)); - bool bNeedToTrim = (nlines > neededLines); - string jstr = ""; - int LinesToGo = neededLines; - if (bNeedToTrim) - { - int numBlanksEnd = 0; - // find the number of blank lines at the end of this table cell - for (int i = nlines-1; i >= 0; i--) - { - if (strary[i].Trim().Length == 0) - numBlanksEnd++; - else - break; - } - int preBlanksLines = 0; - //foreach (string tmpstr in strary) - // we ignore the ending blank lines - // this allows us to include any blank lines that are between text lines - for (int i = 0; i < nlines - numBlanksEnd; i++) - { - string tmpstr = strary[i]; - int tlen = tmpstr.Trim().Length; - if (tlen > 0 || (LinesToGo < neededLines)) - { - if (jstr.Length > 0) jstr += "\n"; - jstr += tmpstr; - LinesToGo--; - } - else if (LinesToGo == (nlines - (nrows - 1))) - preBlanksLines++; - } - while (LinesToGo > 0) - { - // need to put this type of hard space (not \xA0) to hold the newline position - if (preBlanksLines > 0) - { - jstr = "\\~\n" + jstr; - LinesToGo--; - } - if (numBlanksEnd > 0) - { - jstr += "\n\\~"; - LinesToGo--; - } - } - this[cr.r1, cr.c1] = jstr; - } - } - - #endregion //Import / Export Grid - - #region Bug Work Around - protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e) - { - - // Note: this fixes a bug that happens when the grid has more rows than columns - // notified ComponentOne of the problem 6/25/09 via Email - try - { - base.OnMouseDown(e); - } - catch (Exception ex) - { - while (ex != null) - { - Console.WriteLine("{0} {1} {2}", ex.GetType().Name, ex.Message, ex.StackTrace); - ex = ex.InnerException; - } - } - - } - #endregion //Bug Work Around - - //public void CenterTheCellText() - //{ - // // Cannot use this type of text allignment with RTF text cells - // CellRange cr = this.Selection; - // for (int rw = cr.r1; rw <= cr.r2; rw++) - // for (int col = cr.c1; col <= cr.c2; col++) - // { - // CellRange tmp = this.GetCellRange(rw, col, rw, col); - // string StyleName = string.Format("R{0}C{1}Style", rw, col); - // CellStyle cs = this.Styles.Add(StyleName, tmp.Style); - // cs.TextAlign = TextAlignEnum.CenterCenter; - // tmp.Style = cs; - // } - - //} - #region Uneven Selections - /// - /// True if the top and bottom row of the selection is the same for every column - /// - public bool EvenSelection - { - get - { - if (Selection.c1 < 0 || Selection.c2 < 0 || Selection.r1 < 0 || Selection.r2 < 0) return true; // Even if there is no selection - if (Selection.IsSingleCell) return true; // One cell by definition is Even - int cMin = MinimumColumn(Selection.r1, Selection.c1); // Get the left column of the top row - int cMax = MaximumColumn(Selection.r1, Selection.c2); // Get the right column of the top row - for (int r = Selection.r1 + 1; r <= Selection.r2; r++) - { - // Uneven if the top row in this column doesn't match the first column - if (MinimumColumn(r, Selection.c1) != cMin) - return false; - // Uneven if the bottom row in this column doesn't match the first column - if (MaximumColumn(r, Selection.c2) != cMax) - return false; - } - int rMin = MinimumRow(Selection.r1, Selection.c1); // Get the top row of the left column - int rMax = MaximumRow(Selection.r2, Selection.c1); // Get the bottom row of the left column - for (int c = Selection.c1 + 1; c <= Selection.c2; c++) - { - // Uneven if the top row in this column doesn't match the first column - if (MinimumRow(Selection.r1, c) != rMin) - return false; - // Uneven if the bottom row in this column doesn't match the first column - if (MaximumRow(Selection.r2, c) != rMax) - return false; - } - return true; - } - } - public void MakeSelectionEven() - { - if (Selection.IsSingleCell) return; // One cell by definition is Even - MakeSelectionEven(Selection.r1, Selection.c1, Selection.r2, Selection.c2); - } - public void SelectRow() - { - MakeSelectionEven(Selection.r1, 0, Selection.r2, Cols.Count - 1); - } - public void SelectCol() - { - MakeSelectionEven(0, Selection.c1, Rows.Count - 1, Selection.c2); - } - public void MakeSelectionEven(int r1,int c1, int r2, int c2) - { - if (c1 < 0 || c2 < 0 || r1 < 0 || r2 < 0) return; // if there is no selection don't bother - CellRange cr = GetEvenSelection(r1, c1, r2, c2); - Select(cr); - } - - public CellRange GetEvenSelection() - { - return GetEvenSelection(Selection.r1, Selection.c1, Selection.r2, Selection.c2); - } - - public CellRange GetEvenSelection(int r1, int c1, int r2, int c2) - { - int cMinNew = MinimumColumn(r1, c1); // Get the left column of the top row - int cMaxNew = MaximumColumn(r1, c2); // Get the right column of the top row - int rMinNew = MinimumRow(r1, c1); // Get the top row of the left column - int rMaxNew = MaximumRow(r2, c1); // Get the bottom row of the left column - int cMin = cMinNew; - int cMax = cMaxNew; - int rMin = rMinNew; - int rMax = rMaxNew; - do - { - cMin = cMinNew; - cMax = cMaxNew; - rMin = rMinNew; - rMax = rMaxNew; - for (int r = rMin; r <= rMax; r++) - { - // Uneven if the top row in this column doesn't match the first column - int myMin = MinimumColumn(r, cMin); - if (myMin < cMinNew) - cMinNew = myMin; - // Uneven if the bottom row in this column doesn't match the first column - int myMax = MaximumColumn(r, cMax); - if (myMax > cMaxNew) - cMaxNew = myMax; - } - for (int c = cMinNew; c <= cMaxNew; c++) - { - // if the top row in this column is less than the minimum save it - int myMin = MinimumRow(rMin, c); - if (myMin < rMinNew) - rMinNew = myMin; - // Uneven if the bottom row in this column doesn't match the first column - int myMax = MaximumRow(rMax, c); - if (myMax > rMax) - rMaxNew = myMax; - } - } - while (cMinNew < cMin || cMaxNew > cMax || rMinNew < rMin || rMaxNew > rMax); - CellRange cr = GetCellRange(rMinNew, cMinNew, rMaxNew, cMaxNew); - return cr; - } - private int MinimumColumn(int r, int c) - { - return GetMergedRange(r, c).c1; - } - private int MaximumColumn(int r, int c) - { - return GetMergedRange(r, c).c2; - } - private int MinimumRow(int r, int c) - { - return GetMergedRange(r, c).r1; - } - private int MaximumRow(int r, int c) - { - return GetMergedRange(r, c).r2; - } - public Color StyleBackColor - { - get {return Styles.Normal.BackColor;} - set - { - Styles.Normal.BackColor = value; - Styles.Alternate.BackColor = value; - for (int c = 0; c < Cols.Count; c++) - for (int r = 0; r < Rows.Count; r++) - { - CellRange cr = GetMergedRange(r, c); - if (cr.Style != null && cr.Style.BackColor != value && cr.Style.Name != "Fixed") - { - cr.Style.BackColor = value; - //Console.WriteLine("{0}, {1}, {2}, {3}", r, c, cr.Style.Name, cr.Style.BackColor); - } - } - } - } - /// - /// Returns a list of cells or merged cells within the selection - /// - public List MySelection - { - get - { - List ranges = new List(); - for (int c = Selection.c1; c <= Selection.c2; c++) - for (int r = Selection.r1; r <= Selection.r2; r++) - { - CellRange cr = GetMergedRange(r, c); - if (!ranges.Contains(cr)) - ranges.Add(cr); - } - //} - return ranges; - } - } - /// - /// This is a test to see if MySelection works. - /// - public void BoldMySelection() - { - foreach (CellRange cr in MySelection) - { - using (StepRTB rtb = new StepRTB()) - { - rtb.Rtf = GetCellRTFString(cr.r1, cr.c1); - rtb.SelectAll(); - rtb.SelectionFont = new Font(rtb.SelectionFont, FontStyle.Bold); - this[cr.r1, cr.c1] = rtb.Rtf; - } - } - } - - public void ShowMySelection() - { - int r1 = MySelection[0].r1; - int r2 = MySelection[0].r2; - int c1 = MySelection[0].c1; - int c2 = MySelection[0].c2; - foreach (CellRange cr in MySelection) - { - r1 = Math.Min(r1, cr.r1); - c1 = Math.Min(c1, cr.c1); - r2 = Math.Max(r2, cr.r2); - c2 = Math.Max(c2, cr.c2); - } - Select(r1,c1,r2,c2); - } - - public void Debug_WritelineMySelection() - { - int r1 = MySelection[0].r1; - int r2 = MySelection[0].r2; - int c1 = MySelection[0].c1; - int c2 = MySelection[0].c2; - Console.WriteLine("Initial MySelection[0] {0}", MySelection[0]); - foreach (CellRange cr in MySelection) - { - r1 = Math.Min(r1, cr.r1); - c1 = Math.Min(c1, cr.c1); - r2 = Math.Max(r2, cr.r2); - c2 = Math.Max(c2, cr.c2); - Console.WriteLine("Foreach range ({0},{1}) - ({2},{3})", r1, c1, r2, c2); - } - } - - #endregion - } - /// - /// This is used for storing the grid selection for copy/past Row/Column - /// - public enum GridCopyOption { Row, Column, Selection }; - - #region RTF Class for Cell rendering - /// - /// RTF Should only be used if the contents of the richtextbox are to be converted to an image. - /// - class RTF : StepRTB - { - // messages used by RichEd20.dll - internal const int - WM_USER = 0x0400, - EM_FORMATRANGE = WM_USER + 57; - - // FORMATRANGE is used by RichEd20.dll to render RTF - internal struct FORMATRANGE - { - internal IntPtr hdc, hdcTarget; - internal Rectangle rc, rcPage; - internal int cpMin, cpMax; - } - - // render the control directly into a given Graphics object - // (this does not honor clipping set in the target Graphics object; it that is - // a problem, use the RenderClipped method instead). - public void Render(Graphics g, Rectangle rc) - { - // convert rect from pixels to twips - rc.X = (int)(rc.X * 1440 / g.DpiX); - rc.Y = (int)(rc.Y * 1440 / g.DpiY); - rc.Width = rc.X + (int)((rc.Width) * 1440 / g.DpiX); - rc.Height = rc.Y + (int)((rc.Height) * 1440 / g.DpiY); - - // get dc - IntPtr hdc = g.GetHdc(); - - // set up FORMATRANGE struct - FORMATRANGE fmt = new FORMATRANGE(); - fmt.hdc = fmt.hdcTarget = hdc; - fmt.rc = fmt.rcPage = rc; - fmt.cpMin = 0; - fmt.cpMax = -1; - - // render RTF - int render = 1; - SendMessageFormatRange(Handle, EM_FORMATRANGE, render, ref fmt); - - // clean up - SendMessage(Handle, EM_FORMATRANGE, render, 0); - - // done with dc - g.ReleaseHdc(hdc); - } - - // render RTF into a Graphics object using a temporary bitmap to ensure - // clipping works correctly. - public void RenderClipped(Graphics g, Rectangle rc) - { - // create temp bitmap - Rectangle rcSrc = new Rectangle(0, 0, rc.Width, rc.Height); - using (Bitmap bmp = new Bitmap(rc.Width, rc.Height)) - { - // render RTF into bitmap - using (Graphics gBmp = Graphics.FromImage(bmp)) - { - Render(gBmp, rcSrc); - // transfer bitmap to original Graphics object - // (this honors clipping set in the target Graphics object) - g.DrawImage(bmp, rc, rcSrc, GraphicsUnit.Pixel); - } - } - } - - // SendMessage - [DllImport("USER32.DLL", CharSet = CharSet.Auto)] - static private extern int SendMessage( - IntPtr hWnd, - uint wMsg, - int wParam, - int lParam); - [DllImport("USER32.DLL", CharSet = CharSet.Auto, EntryPoint = "SendMessage")] - static private extern int SendMessageFormatRange( - IntPtr hWnd, - uint wMsg, - int wParam, - ref FORMATRANGE lParam); - } - - #endregion //RTF Class for Cell rendering - # region TableCellInfo for text parse - class TableCellInfo - { - private bool _MergeRowBellow; - - public bool MergeRowBellow - { - get { return _MergeRowBellow; } - set { _MergeRowBellow = value; } - } - private bool _MergeColRight; - - public bool MergeColRight - { - get { return _MergeColRight; } - set { _MergeColRight = value; } - } - private bool _ColEnd; - - public bool ColEnd - { - get { return _ColEnd; } - set { _ColEnd = value; } - } - private string _Text; - - public string Text - { - get { return _Text; } - set { _Text = value; } - } - } - #endregion //TableCellInfo for text parse - #region TableCellEditor - /// - /// TableCellEditor inherits from a StepRTB and is used as a custom cell editor - /// for the C1FlexGrid control. - /// - public class TableCellEditor : StepRTB //System.Windows.Forms.RichTextBox //System.Windows.Forms.TextBox // System.Windows.Forms.ComboBox - { - private VlnFlexGrid _owner; - private int _row, _col; - private char _pendingKey; - private bool _cancel; - public bool _initializingEdit; - - // constructor: attach to owner grid - public TableCellEditor(VlnFlexGrid owner) - { - Visible = false; - AutoSize = false; - BackColor = Color.SkyBlue; - BorderStyle = BorderStyle.None; - ScrollBars = RichTextBoxScrollBars.None; - _initializingEdit = false; - _pendingKey = (char)0; - _cancel = false; - _owner = owner; - _owner.Controls.Add(this); - this.CursorMovement += new StepRTBCursorMovementEvent(TableCellEditor_CursorMovement); - this.CursorKeyPress += new StepRTBCursorKeysEvent(TableCellEditor_CursorKeyPress); - this.Leave += new EventHandler(_editor_Leave); - //this.HeightChanged += new StepRTBEvent(_HeightChanged); - } - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - } - // start editing: move to cell and activate - public void StartEditing(int row, int col) - { - _initializingEdit = true; - ReadOnly = IsRoTable; - // save coordinates of cell being edited - _row = row; - _col = col; - //this.Clear(); //jsj - // assume we'll save the edits - _cancel = false; - // move editor over the current cell - Rectangle rc = _owner.GetCellRect(row, col, true); - rc.Width--; - rc.Height--; - Bounds = rc; - // initialize control content - Text = ""; - FindAllLinks(); // jsj 1-5-2011 - if (_pendingKey > ' ' && !ReadOnly) - Text = _pendingKey.ToString(); - else if (_owner[row, col] != null) - { - string tmp = _owner[row, col].ToString(); - if (tmp.StartsWith(@"{\rtf")) - Rtf = tmp.Replace(@"\~",@"\u160?"); - else - Text = tmp; - } - Select(Text.Length, 0); - - Size sz = new Size(rc.Width, rc.Height); - - //this.Size = sz; - this.Width = rc.Width; - - // make editor visible - Visible = true; - - // and get the focus - //Select(); - Focus(); - _initializingEdit = false; - } - - void TableCellEditor_CursorKeyPress(object sender, KeyEventArgs args) - { - //throw new Exception("The method or operation is not implemented."); - } - - void TableCellEditor_CursorMovement(object sender, StepRTBCursorMovementEventArgs args) - { - int row = _owner.Selection.r1; - int col = _owner.Selection.c1; - CellRange cr = _owner.GetMergedRange(row, col); - //Console.WriteLine("keystroke {0} selection {1},{2}", args.Key, row, col); - //vlnStackTrace.ShowStack("keystroke {0} selection {1},{2}", args.Key, row, col); - _owner.Select(); - // See if we are in a merged range of cells. - // if so, use the merged range instead of the selected range - // so that we can jump to the top/bottom/left/right of the range - // before attempting the move to the next grid cell. - //int idx = _owner.MergedRanges.IndexOf(row, col); - //if (idx > -1) cr = _owner.MergedRanges[idx]; - - switch (args.Key) - { - case VEPROMS.CSLA.Library.E_ArrowKeys.CtrlDown: - case VEPROMS.CSLA.Library.E_ArrowKeys.Down: - row = cr.r2; - if (row < _owner.Rows.Count - 1) - _owner.Select(_owner.GetMergedRange(row + 1, col)); - else - _owner.OnCursorMovement(this, new VlnFlexGridCursorMovementEventArgs(args.Key)); - break; - case VEPROMS.CSLA.Library.E_ArrowKeys.CtrlLeft: - case VEPROMS.CSLA.Library.E_ArrowKeys.Left: - col = cr.c1; - if (col > 0) - _owner.Select(_owner.GetMergedRange(row, col - 1)); - else if(row > 0) - _owner.Select(_owner.GetMergedRange(row - 1, _owner.Cols.Count - 1)); - else - _owner.OnCursorMovement(this, new VlnFlexGridCursorMovementEventArgs(args.Key)); - break; - case VEPROMS.CSLA.Library.E_ArrowKeys.CtrlRight: - case VEPROMS.CSLA.Library.E_ArrowKeys.Right: - col = cr.c2; - if (col < _owner.Cols.Count - 1) - _owner.Select(_owner.GetMergedRange(row, col + 1)); - else if (cr.r2 < _owner.Rows.Count - 1) - { - CellRange crDest = _owner.GetMergedRange(cr.r2 + 1, 0); - if (cr.r2 < crDest.r1) // It will move to the correct place - _owner.Select(crDest); - else if (crDest.r2 < _owner.Rows.Count) - _owner.Select(_owner.GetMergedRange(crDest.r2 + 1, 0)); - else - _owner.OnCursorMovement(this, new VlnFlexGridCursorMovementEventArgs(args.Key)); - } - else - _owner.OnCursorMovement(this, new VlnFlexGridCursorMovementEventArgs(args.Key)); - break; - case VEPROMS.CSLA.Library.E_ArrowKeys.CtrlUp: - case VEPROMS.CSLA.Library.E_ArrowKeys.Up: - row = cr.r1; - if (row > 0) - _owner.Select(_owner.GetMergedRange(row - 1, col)); - else - _owner.OnCursorMovement(this, new VlnFlexGridCursorMovementEventArgs(args.Key)); - break; - default: - break; - } - //Console.WriteLine("selection {0}", _owner.Selection); - //_owner.Focus(); // focus was jumping out of the grid this keeps it in. - } - - // after edit handler (custom editor) - void _editor_Leave(object sender, EventArgs e) - { - _owner.Invalidate(); - _owner.AdjustGridControlSize(); - } - //void _HeightChanged(object sender, EventArgs args) - //{ - // _owner.Invalidate(); - //} - - // save key that started the editing mode - public void SetPendingKey(char chr) - { - _pendingKey = chr; - } - - // expose internal variables - public bool Cancel { get { return _cancel; } } - public int Row { get { return _row; } } - public int Col { get { return _col; } } - - // move editor after the grid has scrolled - public void UpdatePosition() - { - // get cell rect now - Rectangle rcCell = _owner.GetCellRect(_row, _col, false); - - // intersect with scrollable part of the grid - Rectangle rcScroll = _owner.ClientRectangle; - rcScroll.X = _owner.Cols[_owner.Cols.Fixed].Left; - rcScroll.Y = _owner.Rows[_owner.Rows.Fixed].Top; - rcScroll.Width -= rcScroll.X; - rcScroll.Height -= rcScroll.Y; - rcCell = Rectangle.Intersect(rcCell, rcScroll); - - // and move the control - if (rcCell.Width > 0) rcCell.Width--; - if (rcCell.Height > 0) rcCell.Height--; - Bounds = rcCell; - - Size sz = new Size(_owner.GetCellRect(_row, _col).Width, _owner.GetCellRect(_row, _col).Height); - this.Size = sz; - } - - // lost focus: hide the editor - override protected void OnLeave(System.EventArgs e) - { - // base processing - base.OnLeave(e); - - // copy text to owner grid - if (!_cancel) - { - _owner[_row, _col] = Rtf; //Text; - } - // no more pending keys - _pendingKey = (char)0; - - // done for now, hide editor - Visible = false; - } - - // we will handle the Tab key ourselves - override protected bool IsInputKey(Keys keyData) - { - if (keyData == Keys.Tab) return true; - return base.IsInputKey(keyData); - } - - //// some keys end the editing - //override protected void OnKeyDown(System.Windows.Forms.KeyEventArgs e) - //{ - // switch (e.KeyCode) - // { - // case Keys.Escape: // cancel edits - // _cancel = true; - // _owner.Select(); - // e.Handled = true; - // return; - - // case Keys.Enter: // finish editing - // case Keys.Tab: - // case Keys.Up: - // case Keys.Down: - // case Keys.PageUp: - // case Keys.PageDown: - // _owner.Select(); - // e.Handled = true; - // MoveCursor(e.KeyCode); - // return; - - // default: // default processing - // base.OnKeyDown(e); - // return; - // } - //} - - //// move cursor after done editing - //protected void MoveCursor(Keys key) - //{ - // int row = _owner.Row; - // int col = _owner.Col; - // switch (key) - // { - // case Keys.Tab: col++; break; - // case Keys.Up: row--; break; - // //case Keys.Return: row++; break; - // case Keys.Down: row++; break; - // //case Keys.PageUp: row -= 10; break; - // //case Keys.PageDown: row += 10; break; - // } - - // // validate new selection - // if (row < _owner.Rows.Fixed) row = _owner.Rows.Fixed; - // if (col < _owner.Cols.Fixed) col = _owner.Cols.Fixed; - // if (row > _owner.Rows.Count - 1) row = _owner.Rows.Count - 1; - // if (col > _owner.Cols.Count - 1) col = _owner.Cols.Count - 1; - - // // apply new selection - // _owner.Select(row, col); - //} - - //// suppress some keys to avoid annoying beep - //override protected void OnKeyPress(System.Windows.Forms.KeyPressEventArgs e) - //{ - // switch (e.KeyChar) - // { - // case (char)27: // Keys.Escape: - // case (char)13: // Keys.Enter: - // case (char)9: // Keys.Tab: - // e.Handled = true; - // return; - // } - // base.OnKeyPress(e); - //} - } - #endregion // TableCellEditor - #region TableClipBoardFuncts Class - class TableClipBoardFuncts - { - DataFormats.Format dfmtTableCellRange = DataFormats.GetFormat("TableCellRange"); - private SelectedTableCells mySeldTableCellsObject; - private DataObject myDataObject; - public TableClipBoardFuncts() - { - //mySeldTableCellsObject = new DataObject(dfmtTableCellRange.Name, seldTableCells); - } - - public void Put(CellRange cr) - { - // Copies myObject into the clipboard. - // Clip get the value (text) of all the cells in the selected range - // This is saved as one RTF string. - Clipboard.SetDataObject(cr.Clip, true); // the "true" make the copy persistent - //Console.WriteLine("\nClip: '{0}' \n'{1}'", cr.Clip,cr.DataDisplay); - //mySeldTableCellsObject = new SelectedTableCells(); - //mySeldTableCellsObject.CpbrdCellRange = cr; - // myDataObject = new DataObject(dfmtTableCellRange.Name, mySeldTableCellsObject); - // try - // { - // Clipboard.SetDataObject(myDataObject); //,true); - // } - // catch (Exception ex) - // { - // Console.WriteLine(ex.Message); - // } - - } - - public ArrayList Get() - { - // Retrieves the data from the clipboard. - IDataObject myRetrievedObject = Clipboard.GetDataObject(); - string jj = (string)myRetrievedObject.GetData(DataFormats.Text); - return GetCellStrings(jj); - } - - //public CellRange get_cr_Paste() - //{ - // mySeldTableCellsObject = new SelectedTableCells(); - // CellRange cr = new CellRange(); - // SelectedTableCells sc; - // IDataObject myRetrievedObject = Clipboard.GetDataObject(); - // try - // { - // //object obj = myRetrievedObject.GetData(dfmtTableCellRange.Name); - // object obj = myRetrievedObject.GetData("TableCellRange"); - // //sc = (SelectedTableCells)myRetrievedObject.GetData(dfmtTableCellRange.Name); - // sc = (SelectedTableCells)obj; - // cr = sc.CpbrdCellRange; - // } - // catch (Exception ex) - // { - // Console.WriteLine(ex.Message); - // } - // return cr; - //} - - private ArrayList GetCellStrings(string instr) - { - // The table cells placed on the clipboard is saved as one long RTF string. - // "\r\n\t" defines a cell border - // "\r\n\r" defines beginning of next line (row) - // This function will separate each cell text and place them in an array. - // This allow the clipboard information to be pasted independently from - // how it was selected. - - // Bug fix: the CellRange.Clip (see cr.clip in the Put() function above) is replacing - // new lines with spaces. We need to put them back. - instr = instr.Replace(@"}} \", "}}\r\n\\"); - string tstr = ""; // this will contain the parsed out cell text - ArrayList arylstCellStrings = new ArrayList(); - int sidx = 0; // start index - int tidx = 0; - if (instr != null) - { - int idx = instr.IndexOf(@"{\rtf",sidx+1); // cell boarder - while (idx > 0) - { - tstr = instr.Substring(sidx, idx - sidx); - tstr = tstr.Substring(0, tstr.LastIndexOf('}') + 1); - //Console.WriteLine("\ntstr: '{0}'", tstr); - arylstCellStrings.Add(tstr); - sidx = idx; - idx = instr.IndexOf(@"{\rtf",sidx+1); - } - if (sidx < instr.Length) - { - tstr = instr.Substring(sidx); - arylstCellStrings.Add(tstr); - } - } - return arylstCellStrings; - } - - //private ArrayList GetCellStrings(string instr) - //{ - // // The table cells placed on the clipboard is saved as one long RTF string. - // // "\r\n\t" defines a cell border - // // "\r\n\r" defines beginning of next line (row) - // // This function will separate each cell text and place them in an array. - // // This allow the clipboard information to be pasted independently from - // // how it was selected. - - // string tstr = ""; // this will contain the parsed out cell text - // ArrayList arylstCellStrings = new ArrayList(); - // int sidx = 0; // start index - // int tidx = 0; - // if (instr != null) - // { - // int idx = instr.IndexOf("\r\n\t"); // cell boarder - // if (idx < 0) idx = instr.IndexOf("\r\n\r"); // new line (needed for multiple lines in one cell) - // while (idx > 0) - // { - // tstr = instr.Substring(sidx, idx - sidx); - // tidx = tstr.IndexOf("\r\n\r"); - // if (tidx > 0) - // { - // idx = instr.IndexOf("\r\n\r", sidx); - // tstr = instr.Substring(sidx, idx - sidx); - // } - // arylstCellStrings.Add(tstr.Substring(tstr.IndexOf("{\\rtf"))); - // sidx = idx + 3; - // if (sidx < instr.Length) - // { - // idx = instr.IndexOf("\r\n\t", sidx); - // if (idx < 0) idx = instr.IndexOf("\r\n\r", sidx); - // } - // } - // if (sidx < instr.Length) - // { - // tstr = instr.Substring(sidx); - // arylstCellStrings.Add(tstr.Substring(tstr.IndexOf("{\\rtf"))); - // } - // } - // return arylstCellStrings; - //} - } - - [Serializable] - public class SelectedTableCells : Object - { - private CellRange _cpbrdCellRange; - - public CellRange CpbrdCellRange - { - get { return _cpbrdCellRange; } - set { _cpbrdCellRange = value; } - } - public SelectedTableCells() - { - } - } - #endregion // TableClipBoardFuncts Class - public class VlnFlexGridCursorMovementEventArgs - { - private E_ArrowKeys _Key; - public E_ArrowKeys Key - { - get { return _Key; } - set { _Key = value; } - } - public VlnFlexGridCursorMovementEventArgs(E_ArrowKeys key) - { - _Key = key; - } - } - public class VlnFlexGridPasteEventArgs - { - private string _Text; - public string Text - { - get { return _Text; } - set { _Text = value; } - } - public VlnFlexGridPasteEventArgs(string text) - { - _Text = text; - } - } - public class GridCopyInfo - { - private GridCopyOption _MyCopyOption = GridCopyOption.Selection; - - public GridCopyOption MyCopyOption - { - get { return _MyCopyOption; } - set - { - //Console.WriteLine("MyCopyOption = {0}", _MyCopyOption); - //if (_MyCopyOption != value) - // Console.WriteLine("Changed Option to {0}", value); - _MyCopyOption = value; - } - } - private VlnFlexGrid _MyCopiedFlexGrid = null; - - public VlnFlexGrid MyCopiedFlexGrid - { - get { return _MyCopiedFlexGrid; } - set { _MyCopiedFlexGrid = value; } - } - private CellRange _MyCopiedCellRange; - - public CellRange MyCopiedCellRange - { - get { return _MyCopiedCellRange; } - set { _MyCopiedCellRange = value; } - } - - } -} diff --git a/PROMS/Volian.Controls.Library/VlnSpellCheckDlg - ForDebugAutoIgnor.cs b/PROMS/Volian.Controls.Library/VlnSpellCheckDlg - ForDebugAutoIgnor.cs deleted file mode 100644 index 9f5badd2..00000000 --- a/PROMS/Volian.Controls.Library/VlnSpellCheckDlg - ForDebugAutoIgnor.cs +++ /dev/null @@ -1,316 +0,0 @@ -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 -{ - // Our custom Spell Checker dialog - public partial class VlnSpellCheckDlg : DevComponents.DotNetBar.Office2007Form, ISpellDialog - { - private C1SpellChecker _Spell; - private ISpellCheckableEditor _Editor; - private CharRangeList _Errors; - private int _ErrorCount; - private int _ErrorIndex = -1; // current error index - private bool _AutoSuggest = true; - private string _NoSuggestionsText = "(no suggestions)"; - - Dictionary _changeAll = new Dictionary(); - - /// - /// Gets the object that represents the error currently - /// displayed in the dialog. - /// - 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) - - public VlnSpellCheckDlg() - { - InitializeComponent(); - } - /// - /// Initializes the dialog to use the given parameters. - /// - /// to use for spelling. - /// that contains the text to spell-check. - /// that contains the initial error list. - public void Initialize(C1SpellChecker spell, ISpellCheckableEditor editor, CharRangeList errors) - { - _Spell = spell; - _Editor = editor; - _Errors = errors; - if (_Errors == null) - { - _Errors = _Spell.CheckText(_Editor.Text); - } - _ErrorCount += _Errors.Count; - btnAddToDictionary.Visible = _Spell.UserDictionary.Enabled; - } - /// - /// Gets the total number of errors detected in the control. - /// - public int ErrorCount - { - get { return _ErrorCount; } - } - - /// - /// Gets or sets the index of the current error into the list. - /// - public int ErrorIndex - { - get { return _ErrorIndex; } - set - { - _ErrorIndex = value; - UpdateCurrentError(); - } - } - - private void UpdateEditor(string replacement) - { - DidCorrectSpelling = true; - // save starting point to continue checking from here - int start = CurrentError.Start; - - if (replacement.Length == 0) - { - // if replacement is empty, expand over spaces and commas - CharRange delete = CharRange.ExpandOverWhitespace(_Editor.Text, CurrentError); - _Editor.Select(delete.Start, delete.Text.Length); - } - - // replace word in text and re-check - _Editor.SelectedText = replacement; - _Errors = _Spell.CheckText(_Editor.Text, start); - - // update index - ErrorIndex = ErrorIndex; // originally 0; - } - public void Ignore() - { - btnIgnore.PerformClick(); - } - /// - /// Raises the event. - /// - /// that contains the event data. - protected override void OnLoad(EventArgs e) - { - // fire load event - base.OnLoad(e); - Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle); - - //AddHandle(); - // show first error (after firing load event) - ErrorIndex = 0; - } - // added for debugging - comment out when not using - //public void AddHandle() - //{ - // if (!Handles.Contains(this.Handle)) - // { - // GC.Collect(); - // Handles.Add(this.Handle); - // Console.WriteLine("Handles {0}, RTB Count Created {1}, RTB Count Not Disposed = {2} ", Handles.Count,StepRTB.CountCreated,StepRTB.CountNotDisposed); - - // } - //} - //private static List Handles = new List(); - - private bool _Initializing = false; - private string _OrgWord; - - // update dialog to show current error - private void UpdateCurrentError() - { - // design time - if (DesignMode || _Errors == null) - { - return; - } - // finished with this batch of errors - if (ErrorIndex >= _Errors.Count) - { - // check whether the editor has more text to check - while (_Editor.HasMoreText()) - { - _Errors = _Spell.CheckText(_Editor.Text); - if (_Errors.Count > 0) - { - _ErrorCount += _Errors.Count; - ErrorIndex = 0; - return; - } - } - - // editor has no more text... - DialogResult = DialogResult.OK; - return; - } - - // update current error - CharRange err = CurrentError; - - // select word in editor - _Editor.Select(err.Start, err.Text.Length); - - // honor 'change all' list - if (_changeAll.ContainsKey(err.Text)) - { - txbBadWord.Text = _changeAll[err.Text]; - btnChange_Click(this, EventArgs.Empty); - return; - } - - _Initializing = true; - // show bad word, new text - txbBadWord.Text = _OrgWord = err.Text; - - // repeated word? - if (err.Duplicate) - { - // adjust dialog - lblNotInDictionary.Text = "Duplicate Word"; - btnIgnoreAll.Enabled = false; - btnAddToDictionary.Enabled = false; - btnRemove.Enabled = true; - - // no suggestions - lbSuggestList.Items.Clear(); - } - else - { - // adjust dialog - lblNotInDictionary.Text = "Not In Dictionary"; - btnIgnoreAll.Enabled = true; - btnAddToDictionary.Enabled = true; - btnRemove.Enabled = false; - - SetupSuggestions(err.Text); - } - - // focus to new word - _AutoSuggest = false; - txbBadWord.SelectAll(); - txbBadWord.Focus(); - _AutoSuggest = true; - AcceptButton = btnIgnore; - - // 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) - { - // show suggestions - _Initializing = true; - string[] suggestions = _Spell.GetSuggestions(badWord); - lbSuggestList.Items.Clear(); - if (suggestions.Length > 0) - { - lbSuggestList.Items.AddRange(suggestions); - lbSuggestList.SelectedIndex = -1; - lbSuggestList.Enabled = true; - } - else - { - lbSuggestList.Items.Add(_NoSuggestionsText); - lbSuggestList.SelectedIndex = -1; - lbSuggestList.Enabled = false; - } - _Initializing = false; - if (_Editor.Control is StepRTB && !(_Editor.Control as StepRTB).MyItemInfo.IsHigh) - { - Ignore(); - } - } - - private void txbBadWord_TextChanged(object sender, EventArgs e) - { - btnChange.Enabled = (_OrgWord != txbBadWord.Text); - btnChangeAll.Enabled = btnChange.Enabled && lblNotInDictionary.Text == "Not In Dictionary"; - btnAddToDictionary.Enabled = _Spell.UserDictionary.Enabled && !InDictionary(txbBadWord.Text); - if (_AutoSuggest && !_Initializing) - { - SetupSuggestions(txbBadWord.Text); - } - } - - private bool InDictionary(string word) - { - if (_Spell.MainDictionary.Contains(word)) - return true; - if (_Spell.CustomDictionary != null && _Spell.CustomDictionary.Contains(word)) - return true; - if (_Spell.UserDictionary != null && _Spell.UserDictionary.Contains(word)) - return true; - return false; - } - - private void btnChange_Click(object sender, EventArgs e) - { - UpdateEditor(txbBadWord.Text); - } - - 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 btnIgnoreAll_Click(object sender, EventArgs e) - { - //Console.WriteLine("handle: {0}", this.Handle); - _Spell.IgnoreList.Add(CurrentError.Text); - _Errors = _Spell.CheckText(_Editor.Text, CurrentError.Start); - UpdateCurrentError(); - } - - private void btnAddToDictionary_Click(object sender, EventArgs e) - { - _Spell.UserDictionary.AddWord(CurrentError.Text); - _Errors = _Spell.CheckText(_Editor.Text, CurrentError.Start); - ErrorIndex = 0; - } - - private void lbSuggestList_SelectedIndexChanged(object sender, EventArgs e) - { - _AutoSuggest = false; - if (!_Initializing && lbSuggestList.Text != _NoSuggestionsText) - txbBadWord.Text = lbSuggestList.Text; - _AutoSuggest = true; - } - - // double-click selects word for suggestion list and changes mis-spelled word - private void lbSuggestList_DoubleClick(object sender, EventArgs e) - { - if (txbBadWord.Text == lbSuggestList.Text) - { - UpdateEditor(txbBadWord.Text); - } - } - - private void btnRemove_Click(object sender, EventArgs e) - { - UpdateEditor(""); - } - } -} \ No newline at end of file diff --git a/PROMS/Volian.Controls.Library/Volian.Controls.Library.csproj.bak b/PROMS/Volian.Controls.Library/Volian.Controls.Library.csproj.bak deleted file mode 100644 index 83c4f0fd..00000000 --- a/PROMS/Volian.Controls.Library/Volian.Controls.Library.csproj.bak +++ /dev/null @@ -1,623 +0,0 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {8556527C-6615-487F-8AF7-22EBC3EF0268} - Library - Properties - Volian.Controls.Library - Volian.Controls.Library - SAK - SAK - SAK - SAK - v4.6.1 - - - - - 2.0 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - x86 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - true - bin\Demo\ - DEBUG;TRACE - full - x86 - prompt - false - - - true - bin\Debug\ - DEBUG;TRACE - full - x86 - prompt - false - - - bin\Debug\ - TRACE - true - pdbonly - x86 - prompt - false - - - true - bin\Demo\ - TRACE;DEMO - full - x86 - prompt - false - - - - - - False - ..\csla20cs-2.1.4-070223\csla20cs\csla20cs\Csla\bin\Debug\Csla.dll - - - True - - - False - ..\..\..\Program Files\Microsoft Visual Studio 8\Common7\IDE\PublicAssemblies\EnvDTE.dll - - - - False - ..\DataLoader\bin\Debug\log4net.dll - - - - - ..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Core.dll - - - - - - - - - - - - UserControl - - - AnnotationDetails.cs - - - UserControl - - - AnnotationSearch.cs - - - Component - - - BorderListBox.cs - - - Component - - - BorderSelectionPanel.cs - - - - UserControl - - - DisplayApplicability.cs - - - UserControl - - - DisplayBookMarks.cs - - - UserControl - - - DisplayFoldoutMaint.cs - - - UserControl - - - DisplayHistory.cs - - - UserControl - - - DisplayLibDocs.cs - - - UserControl - - - DisplayReports.cs - - - UserControl - - - DisplaySearch.cs - - - UserControl - - - DisplayTags.cs - - - Form - - - dlgChgId.cs - - - Form - - - dlgEnhMissingItem.cs - - - Form - - - dlgUCFImportOptions.cs - - - UserControl - - - EditItem.cs - - - Form - - - FindReplace.cs - - - Form - - - frmEnhanced.cs - - - Form - - - frmImportWordContents.cs - - - Form - - - frmSendErrorLog.cs - - - Form - - - frmViewTextFile.cs - - - UserControl - - - GridItem.cs - - - UserControl - - - ImageItem.cs - - - - Form - - - PreviewMultiLineRO.cs - - - Form - - - PreviewROImage.cs - - - True - True - Settings.settings - - - UserControl - - - RTBItem.cs - - - UserControl - - - RtfRawItem.cs - - - - Component - - - StepPanel.cs - - - UserControl - - - DisplayRO.cs - - - UserControl - - - DisplayTabControl.cs - - - Component - - - DisplayTabItem.cs - - - Component - - - StepTabPanel.cs - - - UserControl - - - StepTabRibbon.cs - - - UserControl - - - DisplayTransition.cs - - - - Component - - - Component - - - DSOTabPanel.cs - - - Component - - - - - True - True - Resources.resx - - - Component - - - RichTextBox41.cs - - - - - Component - - - TransPanel.cs - - - - UserControl - - - vlnExpander.cs - - - Component - - - StepRTB.cs - - - Component - - - VlnFlexGrid.cs - - - - Form - - - VlnSpellCheckDlg.cs - - - UserControl - - - Component - - - vlnTreeView.cs - - - Component - - - vlnTreeView3.cs - - - Form - - - WebBrowser.cs - - - - - - AnnotationDetails.cs - Designer - - - AnnotationSearch.cs - Designer - - - DisplayBookMarks.cs - Designer - - - DisplayLibDocs.cs - Designer - - - DisplaySearch.cs - Designer - - - DisplayTags.cs - Designer - - - dlgEnhMissingItem.cs - - - dlgUCFImportOptions.cs - - - FindReplace.cs - Designer - - - frmEnhanced.cs - - - frmImportWordContents.cs - - - PreviewMultiLineRO.cs - Designer - - - PreviewROImage.cs - Designer - - - RTBItem.cs - Designer - - - Designer - StepPanel.cs - - - Designer - DisplayRO.cs - - - DisplayTabControl.cs - Designer - - - StepTabRibbon.cs - Designer - - - Designer - DisplayTransition.cs - - - Designer - ResXFileCodeGenerator - Resources.Designer.cs - - - vlnExpander.cs - Designer - - - StepRTB.cs - Designer - - - VlnSpellCheckDlg.cs - Designer - - - WebBrowser.cs - Designer - - - - - {34ADDF19-CBBA-4A11-BC99-D141BA2D29EC} - DropDownPanel - - - {b22ce5ad-288c-44cd-8a22-b3bcf77b7161} - FlexableMessageBox - - - {70F23722-19A3-4AC1-A900-55831C945786} - LBWordLibrary - - - {23DECB23-7CEA-433E-88BD-67DA7689B89E} - TablePicker - - - {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5} - VEPROMS.CSLA.Library - - - {52D74078-3822-410E-889B-464BD21AAB9E} - VG - - - {AEEE9FD1-6892-45E2-A67E-418C06D46FF9} - Volian.Base.Library - - - {2bd7d42a-a8f6-4dea-bdca-5f4d58c6140f} - Volian.Pipe.Library - - - {04E168D0-9CC7-43D9-A9F1-93E481EA86A3} - XYPlots - - - - - {C2034871-761F-4DA0-80F2-6644E616C0F5} - 8 - 0 - 0 - aximp - False - - - {C2034871-761F-4DA0-80F2-6644E616C0F5} - 8 - 0 - 0 - tlbimp - False - True - - - {00020430-0000-0000-C000-000000000046} - 2 - 0 - 0 - primary - False - - - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - DisplayApplicability.cs - Designer - - - Designer - DisplayFoldoutMaint.cs - - - DisplayReports.cs - Designer - - - dlgChgId.cs - Designer - - - frmSendErrorLog.cs - Designer - - - frmViewTextFile.cs - Designer - - - Designer - GridItem.cs - - - VlnFlexGrid.cs - Designer - - - - - - - - - \ No newline at end of file diff --git a/PROMS/Volian.Controls.Library/mytransitionquery b/PROMS/Volian.Controls.Library/mytransitionquery deleted file mode 100644 index d66f1c78..00000000 --- a/PROMS/Volian.Controls.Library/mytransitionquery +++ /dev/null @@ -1,9 +0,0 @@ -select dbo.ve_getitemapplicability(iii.itemid) fromappl,dbo.ve_getitemapplicability(ii.itemid) toappl, -dbo.ve_GetShortPath(iii.itemid) frompath,dbo.ve_GetShortPath(ii.itemid) topath, -ccc.type fromtype,cc.type totype -from transitions tt -inner join contents ccc on tt.fromid = ccc.contentid -inner join items iii on ccc.contentid = iii.contentid -inner join items ii on tt.toid = ii.itemid -inner join contents cc on ii.contentid = cc.contentid -where dbo.ve_getitemapplicability(iii.itemid) != dbo.ve_getitemapplicability(ii.itemid) diff --git a/PROMS/Volian.Controls.Library/vlnStackTrace.cs b/PROMS/Volian.Controls.Library/vlnStackTrace.cs deleted file mode 100644 index fd31ef6e..00000000 --- a/PROMS/Volian.Controls.Library/vlnStackTrace.cs +++ /dev/null @@ -1,195 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Diagnostics; - -namespace Volian.Controls.Library -{ - public static class vlnStackTrace - { - public static string GetStack(string str, params object[] objects) - { - return string.Format(str, objects) + StackToString(); - } - public static void ShowStack(string str, params object[] objects) - { - Console.WriteLine(string.Format(str, objects) + StackToString()); - } - public static string GetStack() - { - return StackToString(); - } - public static void ShowStack() - { - Console.WriteLine(StackToString()); - } - private static string StackToString() - { - StringBuilder sb = new StringBuilder(); - StackTrace st = new StackTrace(true); - StackFrame[] sfs = st.GetFrames(); - int ii = 0; - string sLast = ""; - string sThis = ""; - int imax = MatchingStackFrame(sfs); - foreach (StackFrame sf in sfs) - { - if (imax == 0) - sb.Append(string.Format("\r\n{0}---------", "".PadLeft(ii++ * 2))); - imax--; - if (ii < 2) ii++; - else - { - string sMethod = sf.GetMethod().Name; - string sNamespace = sf.GetMethod().ReflectedType.Namespace; - string sType = sf.GetMethod().ReflectedType.Name; - if (sf.GetFileLineNumber() != 0) - { - sMethod += string.Format(" {0}[{1}]", sf.GetFileName(), sf.GetFileLineNumber()); - sThis = ""; - } - else - { - sThis = sNamespace; - } - if (sLast == sThis && sThis != "") - sb.Append(string.Format("\t*.{0}.{1}", sType, sMethod)); - else - sb.Append(string.Format("\r\n{0}{1}.{2}.{3}", "".PadLeft(ii++ * 2), sNamespace, sType, sMethod)); - } - sLast = sThis; - } - return sb.ToString(); - } - public static void ShowStackFirstLocal(string str) - { - Console.WriteLine(str + " " + StackToStringLocal(3,0)); - } - public static void ShowStackLocal(string str,int start) - { - Console.WriteLine(str + " " + StackToStringLocal(start,1)); - } - public static void ShowStackLocal(string str,int start, int limit) - { - Console.WriteLine(str + " " + StackToStringLocal(start, limit)); - } - private static string StackToStringLocal(int start, int limit) - { - StringBuilder sb = new StringBuilder(); - string sep = "Local Method - "; - StackTrace st = new StackTrace(true); - StackFrame[] sfs = st.GetFrames(); - int count = 0; - int localCount = 0; - foreach (StackFrame sf in sfs) - { - count++; - if (count > start) - { - if (sf.GetFileLineNumber() != 0) - { - string sMethod = sf.GetMethod().Name; - string sNamespace = sf.GetMethod().ReflectedType.Namespace; - string sType = sf.GetMethod().ReflectedType.Name; - sMethod += string.Format(" {0}[{1}]", sf.GetFileName(), sf.GetFileLineNumber()); - sb.Append(sep + string.Format("{0}.{1}.{2}", sNamespace, sType, sMethod)); - localCount ++; - if (localCount >= limit) - return sb.ToString(); - sep = "\r\n" + "".PadRight(localCount *2); - } - } - } - if (localCount > 0) - return sb.ToString(); - return "No Local Method"; - } - public static string CalledFrom - { - get - { - StackTrace st = new StackTrace(true); - StackFrame[] sfs = st.GetFrames(); - int count = 0; - foreach (StackFrame sf in sfs) - { - if (sf.GetFileLineNumber() != 0) - { - count++; - { - string sMethod = sf.GetMethod().Name; - string sNamespace = sf.GetMethod().ReflectedType.Namespace; - string sType = sf.GetMethod().ReflectedType.Name; - sMethod += string.Format(" {0}[{1}]", sf.GetFileName(), sf.GetFileLineNumber()); - if (count > 3) - return string.Format("{0}.{1}.{2}", sNamespace, sType, sMethod); - } - } - } - return "No Local Method"; - } - } - private static StackFrame[] _LastSFS; - private static int MatchingStackFrame(StackFrame[] sfs) - { - int iFound = -1; - if (_LastSFS != null) - { - // start at the far end and work backward - for (int i = 1; iFound < 0 && i <= sfs.Length && i <= _LastSFS.Length; i++) - { - if (!Match(sfs[sfs.Length - i],_LastSFS[_LastSFS.Length - i])) - iFound = 1+ sfs.Length - i; - } - } - if (iFound < 0) iFound = sfs.Length; - _LastSFS = (StackFrame[])sfs.Clone(); - return iFound; - } - - private static bool Match(StackFrame stackFrame1, StackFrame stackFrame2) - { - if (stackFrame1.GetMethod().Name != stackFrame2.GetMethod().Name) return false; - if (stackFrame1.GetMethod().DeclaringType.FullName != stackFrame2.GetMethod().DeclaringType.FullName) return false; - if (stackFrame1.GetILOffset() != stackFrame2.GetILOffset()) return false; - return true; - } - public static bool ScrollInStack() - { - StackTrace st = new StackTrace(true); - StackFrame[] sfs = st.GetFrames(); - bool retval = false; - foreach (StackFrame sf in sfs) - { - string sMethod = sf.GetMethod().Name; - string sNamespace = sf.GetMethod().ReflectedType.Namespace; - string sType = sf.GetMethod().ReflectedType.Name; - if (sMethod.ToUpper().Contains("SCROLL") || sType.ToUpper().Contains("SCROLL")) - { - retval = true; - Console.WriteLine("{0}.{1}.{2}", sNamespace, sType, sMethod); - } - } - return retval; - } - /// - /// This will clear the Output window when run in the Development Environment - /// Add EnvDTE and EnvDTE80 to references from .NET - /// - public static void ClearOutputWindow() - { -#if (DEBUG) - try - { - EnvDTE80.DTE2 dte2 = (EnvDTE80.DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.8.0"); - dte2.ToolWindows.OutputWindow.ActivePane.Clear(); - } - catch (Exception ex) - { - Console.WriteLine("ClearOutputWindow {0} - {1}\r\n{2}", ex.GetType().Name, ex.Message, ex.StackTrace); - } -#endif - } - - } -} diff --git a/PROMS/Volian.Controls.Library/vlnTreeView - Copy.cs b/PROMS/Volian.Controls.Library/vlnTreeView - Copy.cs deleted file mode 100644 index 15d8616e..00000000 --- a/PROMS/Volian.Controls.Library/vlnTreeView - Copy.cs +++ /dev/null @@ -1,1771 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Text.RegularExpressions; -using System.Windows.Forms; -using System.Runtime.InteropServices; // For DragHelper -using System.Reflection; -using Csla; -using Csla.Validation; -using VEPROMS.CSLA.Library; - -namespace Volian.Controls.Library -{ - #region DelegatesAndEventArgs - public delegate void vlnTreeViewEvent(object sender, vlnTreeEventArgs args); - public delegate void vlnTreeViewItemInfoEvent(object sender, vlnTreeItemInfoEventArgs args); - public delegate bool vlnTreeViewBoolEvent(object sender, vlnTreeEventArgs args); - public delegate bool vlnTreeViewItemInfoDeleteEvent(object sender, vlnTreeItemInfoEventArgs args); - public delegate bool vlnTreeViewItemInfoInsertEvent(object sender, vlnTreeItemInfoInsertEventArgs args); - public delegate bool vlnTreeViewItemInfoPasteEvent(object sender, vlnTreeItemInfoPasteEventArgs args); - public delegate TreeNode vlnTreeViewTreeNodeEvent(object sender, vlnTreeEventArgs args); - public delegate DialogResult vlnTreeViewPropertyEvent(object sender, vlnTreePropertyEventArgs args); - public delegate void vlnTreeViewSectionInfoEvent(object sender, vlnTreeSectionInfoEventArgs args); - public delegate void WordSectionDeletedEvent(object sender, WordSectionEventArgs args); - public partial class vlnTreeSectionInfoEventArgs - { - private SectionInfo _MySectionInfo; - public SectionInfo MySectionInfo - { - get { return _MySectionInfo; } - set { _MySectionInfo = value; } - } - public vlnTreeSectionInfoEventArgs(SectionInfo mySectionInfo) - { - _MySectionInfo = mySectionInfo; - } - } - public partial class vlnTreeEventArgs - { - #region Business Methods - private TreeNode _Node; - public TreeNode Node - { - get { return _Node; } - set { _Node = value; } - } - private TreeNode _Destination=null; - public TreeNode Destination - { - get { return _Destination; } - set { _Destination = value; } - } - private int _Index; - public int Index - { - get { return _Index; } - set { _Index = value; } - } - #endregion - #region Factory Methods - private vlnTreeEventArgs() { ;} - public vlnTreeEventArgs(TreeNode node) - { - _Node = node; - } - public vlnTreeEventArgs(TreeNode node, TreeNode destination, int index) - { - _Node = node; - _Destination = destination; - _Index = index; - } - #endregion - } - public partial class vlnTreeItemInfoEventArgs - { - #region Business Methods - private ItemInfo _MyItemInfo; - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - set { _MyItemInfo = value; } - } - #endregion - #region Factory Methods - private vlnTreeItemInfoEventArgs() { ;} - public vlnTreeItemInfoEventArgs(ItemInfo myItemInfo) - { - _MyItemInfo = myItemInfo; - } - #endregion - } - public enum E_InsertType {Before, After, Child}; - public partial class vlnTreeItemInfoInsertEventArgs - { - #region Business Methods - private ItemInfo _MyItemInfo; - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - set { _MyItemInfo = value; } - } - private E_InsertType _InsertType; - public E_InsertType InsertType - { - get { return _InsertType; } - set { _InsertType = value; } - } - private int _Type; - public int Type - { - get { return _Type; } - set { _Type = value; } - } - private E_FromType _FromType; - public E_FromType FromType - { - get { return _FromType; } - set { _FromType = value; } - } - private string _StepText; - public string StepText - { - get { return _StepText; } - set { _StepText = value; } - } - #endregion - #region Factory Methods - private vlnTreeItemInfoInsertEventArgs() { ;} - public vlnTreeItemInfoInsertEventArgs(ItemInfo myItemInfo, E_InsertType insertType, string stepText) - { - _MyItemInfo = myItemInfo; - _InsertType = insertType; - _StepText = stepText; - } - public vlnTreeItemInfoInsertEventArgs(ItemInfo myItemInfo, E_InsertType insertType, string stepText, int type, E_FromType fromType) - { - _MyItemInfo = myItemInfo; - _InsertType = insertType; - _StepText = stepText; - _Type = type; - _FromType = fromType; - } - #endregion - } - #region PasteEventArgs - public partial class vlnTreeItemInfoPasteEventArgs - { - #region Business Methods - private ItemInfo _MyItemInfo; - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - set { _MyItemInfo = value; } - } - private int _CopyStartID; - public int CopyStartID - { - get { return _CopyStartID; } - set { _CopyStartID = value; } - } - private ItemInfo.EAddpingPart _PasteType; - public ItemInfo.EAddpingPart PasteType - { - get { return _PasteType; } - set { _PasteType = value; } - } - private int? _Type; - public int? Type - { - get { return _Type; } - set { _Type = value; } - } - #endregion - #region Factory Methods - private vlnTreeItemInfoPasteEventArgs() { ;} - public vlnTreeItemInfoPasteEventArgs(ItemInfo myItemInfo, int copyStartId, ItemInfo.EAddpingPart pasteType, int? type) - { - _MyItemInfo = myItemInfo; - _CopyStartID = copyStartId; - _PasteType = pasteType; - _Type = type; - } - - #endregion - } - #endregion - public partial class vlnTreePropertyEventArgs : EventArgs - { - private string _Title; - public string Title - { - get { return _Title; } - set { _Title = value; } - } - private object _ConfigObject; - public object ConfigObject - { - get { return _ConfigObject; } - set { _ConfigObject = value; } - } - private FolderConfig _FolderConfig; - public FolderConfig FolderConfig - { - get { return _FolderConfig; } - set { _ConfigObject = _FolderConfig = value; } - } - private DocVersionConfig _DocVersionConfig; - public DocVersionConfig DocVersionConfig - { - get { return _DocVersionConfig; } - set { _ConfigObject = _DocVersionConfig = value; } - } - private ProcedureConfig _ProcedureConfig; - public ProcedureConfig ProcedureConfig - { - get { return _ProcedureConfig; } - set { _ConfigObject = _ProcedureConfig = value; } - } - private SectionConfig _SectionConfig; - public SectionConfig SectionConfig - { - get { return _SectionConfig; } - set { _ConfigObject = _SectionConfig = value; } - } - private vlnTreePropertyEventArgs() { ;} - public vlnTreePropertyEventArgs(string title, FolderConfig folderConfig) - { - _Title = title; - FolderConfig = folderConfig; - } - public vlnTreePropertyEventArgs(string title, DocVersionConfig docVersionConfig) - { - _Title = title; - DocVersionConfig = docVersionConfig; - } - public vlnTreePropertyEventArgs(string title, ProcedureConfig procedureConfig) - { - _Title = title; - ProcedureConfig = procedureConfig; - } - public vlnTreePropertyEventArgs(string title, SectionConfig sectionConfig) - { - _Title = title; - DocStyleListConverter.MySection = sectionConfig.MySection; - SectionConfig = sectionConfig; - } - } - #endregion - public partial class vlnTreeView : TreeView - { - #region Local Vars - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - - FolderInfo _LastFolderInfo = null; - ProcedureInfo _LastProcedureInfo = null; - DocVersionInfo _LastDocVersionInfo = null; - SectionInfo _LastSectionInfo = null; - VETreeNode _LastTreeNode = null; - StepInfo _LastStepInfo = null; - ItemInfo _LastItemInfo = null; - #endregion - #region Events - public event vlnTreeViewItemInfoDeleteEvent DeleteItemInfo; - private bool OnDeleteItemInfo(object sender, vlnTreeItemInfoEventArgs args) - { - if (DeleteItemInfo != null) return DeleteItemInfo(sender, args); - return false; - } - public event vlnTreeViewItemInfoInsertEvent InsertItemInfo; - private bool OnInsertItemInfo(object sender, vlnTreeItemInfoInsertEventArgs args) - { - if (InsertItemInfo != null) return InsertItemInfo(sender, args); - return false; - } - public event vlnTreeViewItemInfoPasteEvent PasteItemInfo; - private bool OnPasteItemInfo(object sender, vlnTreeItemInfoPasteEventArgs args) - { - if (PasteItemInfo != null) return PasteItemInfo(sender, args); - return false; - } - public event vlnTreeViewEvent NodeMove; - private void OnNodeMove(object sender, vlnTreeEventArgs args) - { - if (NodeMove != null) NodeMove(sender, args); - } - public event vlnTreeViewEvent NodeCopy; - private void OnNodeCopy(object sender, vlnTreeEventArgs args) - { - if (NodeCopy != null) NodeCopy(sender, args); - } - public event vlnTreeViewPropertyEvent NodeOpenProperty; - private DialogResult OnNodeOpenProperty(object sender, vlnTreePropertyEventArgs args) - { - if (NodeOpenProperty != null) return NodeOpenProperty(sender, args); - return DialogResult.Cancel; - } - public event vlnTreeViewEvent NodeSelect; - private void OnNodeSelect(object sender, vlnTreeEventArgs args) - { - if (NodeSelect != null) NodeSelect(sender, args); - } - public event vlnTreeViewEvent NodeNew; - private void OnNodeNew(object sender, vlnTreeEventArgs args) - { - if (NodeNew != null) NodeNew(sender, args); - } - public event vlnTreeViewEvent NodeSelectionChange; - private void OnNodeSelectionChange(object sender, vlnTreeEventArgs args) - { - if (NodeSelectionChange != null) NodeSelectionChange(sender, args); - } - public event vlnTreeViewSectionInfoEvent SectionShouldClose; - private void OnSectionShouldClose(object sender, vlnTreeSectionInfoEventArgs args) - { - if (SectionShouldClose != null) SectionShouldClose(sender, args); - } - public event WordSectionDeletedEvent WordSectionDeleted; - internal void OnWordSectionDeleted(object sender, WordSectionEventArgs args) - { - WordSectionDeleted(sender, args); - } - public event vlnTreeViewItemInfoEvent OpenItem; - private void OnOpenItem(object sender, vlnTreeItemInfoEventArgs args) - { - if (OpenItem != null) OpenItem(sender, args); - } - #endregion - #region Constructors - public vlnTreeView() - { - InitializeComponent(); - this.AllowDrop = true; - DragHelper.InitCommonControls(); - this.ItemDrag += new ItemDragEventHandler(tv_ItemDrag); - this.DragDrop += new DragEventHandler(tv_DragDrop); - this.DragEnter += new DragEventHandler(tv_DragEnter); - this.DragLeave += new EventHandler(tv_DragLeave); - this.DragOver += new DragEventHandler(tv_DragOver); - this.MouseDown += new MouseEventHandler(tv_MouseDown); - this.KeyPress += new KeyPressEventHandler(tv_KeyPress); - base.AfterSelect += new TreeViewEventHandler(tv_AfterSelect); - } - #endregion - #region MenuSupport - private void tv_AfterSelect(object sender, TreeViewEventArgs e) - { - if(!_AdjustingTree) - OnNodeSelectionChange(sender, new vlnTreeEventArgs(e.Node)); - } - // use to determine which menu items have been selected for those tree nodes - // that allow more than one type of operation associated with their selection. - public enum MenuSelections : int - { - Folder = 1, FolderBefore = 2, FolderAfter = 3, DocVersion = 4, Procedure = 5, ProcedureBefore = 6, ProcedureAfter = 7, Section = 8, SectionBefore = 9, SectionAfter = 10, Step = 11, StepBefore = 12, StepAfter = 13, StepReplace = 14 - } - void tv_MouseDown(object sender, MouseEventArgs e) - { - if (e.Button == MouseButtons.Right) - { - VETreeNode tn = this.GetNodeAt(new Point(e.X, e.Y)) as VETreeNode; - if (tn != null) - { - this.SelectedNode = tn as TreeNode; - Application.DoEvents(); - // Display Menu - ToolStripMenuItem mi = new ToolStripMenuItem(); - ContextMenu cm = new ContextMenu(); - - #region Menu_New - if (tn.VEObject as FolderInfo != null) - { - // For Folders, if no children, can add either docversion or folder. If children are - // folders then can only add another folder, and if children are docversions can only - // add docversion. - FolderInfo fi = tn.VEObject as FolderInfo; - if (fi.MyParent != null) // don't allow insert before/after if at top node - { - cm.MenuItems.Add("Insert Folder Before", new EventHandler(mi_Click)); - cm.MenuItems.Add("Insert Folder After", new EventHandler(mi_Click)); - } - if (fi.FolderDocVersionCount == 0) cm.MenuItems.Add("New Folder", new EventHandler(mi_Click)); - if (fi.ChildFolderCount == 0) cm.MenuItems.Add("Create Working Draft", new EventHandler(mi_Click)); - } - else if (tn.VEObject as DocVersionInfo != null) // DocVersions can only contain procs - cm.MenuItems.Add("New Procedure", new EventHandler(mi_Click)); - else if (tn.VEObject as ProcedureInfo != null) // Procs can only contain sections - { - cm.MenuItems.Add("Insert Procedure Before", new EventHandler(mi_Click)); - cm.MenuItems.Add("Insert Procedure After", new EventHandler(mi_Click)); - cm.MenuItems.Add("New Section", new EventHandler(mi_Click)); - } - else if (tn.VEObject as SectionInfo != null) - { - // A step Section can contain other steps or can contain subsections (either step section - // or word doc section). Also note that there can be a mix. - // A word doc section can contain another subsection (either step section or word doc section), - // but cannot contain steps. - SectionInfo si = tn.VEObject as SectionInfo; - // Do not need step versus Word doc options, user enters this in property page during - // insert process. - cm.MenuItems.Add("Insert Section Before", new EventHandler(mi_Click)); - cm.MenuItems.Add("Insert Section After", new EventHandler(mi_Click)); - cm.MenuItems.Add("New Subsection", new EventHandler(mi_Click)); - if (si.IsStepSection) cm.MenuItems.Add("New Step", new EventHandler(mi_Click)); - } - else if (tn.VEObject as StepInfo != null) - { - // check the format for allowable inserts, and also, - ItemInfo i = tn.VEObject as ItemInfo; - if (AddToInsertMenu(i,0)) cm.MenuItems.Add("Insert Step Before", new EventHandler(mi_Click)); - if (AddToInsertMenu(i,1)) cm.MenuItems.Add("Insert Step After", new EventHandler(mi_Click)); - } - #endregion - #region Menu_Open - if (!tn.IsExpanded && tn.VEObject as SectionInfo != null) - { - SectionInfo si = tn.VEObject as SectionInfo; - if (si.IsStepSection) cm.MenuItems.Add("Open", new EventHandler(mi_Click)); - } - else if (!tn.IsExpanded && tn.VEObject as StepInfo != null) - { - StepInfo stpi = tn.VEObject as StepInfo; - if (stpi.HasChildren) cm.MenuItems.Add("Open", new EventHandler(mi_Click)); - } - else if (!tn.IsExpanded) - cm.MenuItems.Add("Open", new EventHandler(mi_Click)); - #endregion - #region Menu_CutCopy - // For initial release, copy is not available for folders or docversions - if (tn.VEObject as ItemInfo != null) - { - cm.MenuItems.Add("Copy", new EventHandler(mi_Click)); - } - #endregion - Menu_Paste(tn, cm); - #region Menu_Delete - // Add delete to the menu unless at the very 'top' node or on a grouping (partinfo) - // node (RNOs, Steps, Cautions, Notes) - PartInfo pi = tn.VEObject as PartInfo; - if (pi == null && tn.Parent!=null) cm.MenuItems.Add("Delete", new EventHandler(mi_Click)); - #endregion - #region Menu_Properties - // Add Properties to the menu unless at the very 'top' node or on a grouping (partinfo) - // node (RNOs, Steps, Cautions, Notes) or at the step level. - PartInfo pia = tn.VEObject as PartInfo; - ItemInfo ii = tn.VEObject as ItemInfo; - if (pia == null && tn.VEObject as StepInfo == null) cm.MenuItems.Add("Properties...", new EventHandler(mi_Click)); - #endregion - cm.Show(this, new Point(e.X, e.Y)); - } - } - } - - private bool AddToInsertMenu(ItemInfo ii, int ba) // 0 = before, 1 = after - { - // set up insert buttons based on format - bool retB = true; - E_AccStep? actable = 0; - StepData sd = ii.FormatStepData; - actable = sd.StepEditData.AcTable; - if (actable == null) actable = 0; - - return (ba == 0) ? !ii.IsRNOPart && (actable & E_AccStep.AddingPrev) > 0 : - !ii.IsRNOPart && (actable & E_AccStep.AddingNext) > 0; - } - private void Menu_Paste(VETreeNode tn, ContextMenu cm) - { - #region MenuPaste - // Find what's in paste buffer & determine whether the paste can occur for the selected node. - object tmpClip = Clipboard.GetData("PromsClipboard"); - if (tmpClip != null) - { - PromsClipboard tstClip = (PromsClipboard)tmpClip; - ItemInfo iiClipboard = ItemInfo.Get(tstClip.itemId); - // if the item doesn't exist anymore, don't allow the paste, by not adding - // paste menu items to context menu. - if (iiClipboard == null) - { - Clipboard.Clear(); - return; - } - // can it be pasted at current node. - if (tn.VEObject as DocVersionInfo != null) // paste item must be a proc - { - if (iiClipboard.IsProcedure) cm.MenuItems.Add("Paste Procedure", new EventHandler(mi_Click)); - } - else - { - ItemInfo iiPasteHere = tn.VEObject as ItemInfo; - if (iiPasteHere != null) - { - if (iiPasteHere.IsProcedure && iiClipboard.IsProcedure) // procedure can be pasted before/replace/after - { - cm.MenuItems.Add("Paste Procedure Before", new EventHandler(mi_Click)); - cm.MenuItems.Add("Replace Existing Procedure", new EventHandler(mi_Click)); - cm.MenuItems.Add("Paste Procedure After", new EventHandler(mi_Click)); - } - else if (iiPasteHere.IsProcedure && iiClipboard.IsSection) // procedure must have sections only - cm.MenuItems.Add("Paste Section", new EventHandler(mi_Click)); - else if (iiPasteHere.IsSection && iiClipboard.IsSection) - { - cm.MenuItems.Add("Paste Section Before", new EventHandler(mi_Click)); - cm.MenuItems.Add("Replace Existing Section", new EventHandler(mi_Click)); - cm.MenuItems.Add("Paste Section After", new EventHandler(mi_Click)); - } - else if (iiPasteHere.IsStepSection && iiClipboard.IsStep) - cm.MenuItems.Add("Paste Step", new EventHandler(mi_Click)); - else if (iiPasteHere.IsStep && iiClipboard.IsStep) - { - if (AddToInsertMenu(iiPasteHere, 0)) cm.MenuItems.Add("Paste Step Before", new EventHandler(mi_Click)); - cm.MenuItems.Add("Replace Existing Step", new EventHandler(mi_Click)); - if (AddToInsertMenu(iiPasteHere, 1)) cm.MenuItems.Add("Paste Step After", new EventHandler(mi_Click)); - } - } - } - } - #endregion - } - - void mi_Click(object sender, EventArgs e) - { - MenuItem mi = (MenuItem)sender; - switch (mi.Text) - { - case "Open": - OpenNode(); - break; - case "Insert Folder Before": - tv_NodeNew(MenuSelections.FolderBefore); - break; - case "Insert Folder After": - tv_NodeNew(MenuSelections.FolderAfter); - break; - case "New Folder": - SelectedNode.Expand(); - tv_NodeNew(MenuSelections.Folder); - break; - case "Create Working Draft": - SelectedNode.Expand(); - tv_NodeNew(MenuSelections.DocVersion); - break; - case "New Procedure": - SelectedNode.Expand(); - tv_NodeNew(MenuSelections.Procedure); - break; - case "Insert Procedure Before": - tv_NodeNew(MenuSelections.ProcedureBefore); - break; - case "Insert Procedure After": - tv_NodeNew(MenuSelections.ProcedureAfter); - break; - case "New Section": - case "New Subsection": - SelectedNode.Expand(); - tv_NodeNew(MenuSelections.Section); - break; - case "Insert Section Before": - tv_NodeNew(MenuSelections.SectionBefore); - break; - case "Insert Section After": - tv_NodeNew(MenuSelections.SectionAfter); - break; - case "Insert Step Before": - tv_NodeNew(MenuSelections.StepBefore); - break; - case "Insert Step After": - tv_NodeNew(MenuSelections.StepAfter); - break; - case "New Step": - SelectedNode.Expand(); - tv_NodeNew(MenuSelections.Step); - break; - case "Copy"://Copy the selected node - tv_NodeCopy(); - break; - // lots of paste options: - case "Paste Procedure": - case "Paste Procedure Before": - case "Replace Existing Procedure": - case "Paste Procedure After": - case "Paste Section": - case "Paste Section Before": - case "Replace Existing Section": - case "Paste Section After": - case "Paste Step": - case "Paste Step Before": - case "Replace Existing Step": - case "Paste Step After": - tv_NodePaste(mi.Text); - break; - case "Delete": - if (tv_NodeDelete()) - { - TreeNode myParent = SelectedNode.Parent; - SelectedNode.Remove(); - SelectedNode = myParent; - OnNodeSelect(this, new vlnTreeEventArgs(SelectedNode)); - } - break; - case "Properties..."://Show the properties for the selected node - SetLastValues((VETreeNode)SelectedNode); - SetupNodeProperties(); - break; - default: - MessageBox.Show(string.Format("Unrecognized Menu Item '{0}'", mi.Text)); - break; - } - } - - [Serializable] - public struct PromsClipboard - { - public int cType; - public int itemId; - } - public enum PromsClipboardType : int - { - Copy = 1, Cut = 2 - } - private void tv_NodePaste(string p) - { - object oClip = Clipboard.GetData("PromsClipboard"); - if (oClip == null) return; - - PromsClipboard iClip = (PromsClipboard) oClip; - ItemInfo iiClipboard = ItemInfo.Get(iClip.itemId); - VETreeNode tn = SelectedNode as VETreeNode; - DocVersionInfo dvi = tn.VEObject as DocVersionInfo; - if (dvi != null) - { - return; - } - - ItemInfo iiPaste = tn.VEObject as ItemInfo; - if (iiPaste == null) return; - if (p.IndexOf("Before") > -1) - PasteBeforeOrAfter(MenuSelections.StepBefore, tn, iiClipboard.ItemID); - else if (p.IndexOf("After") > -1) - PasteBeforeOrAfter(MenuSelections.StepAfter, tn, iiClipboard.ItemID); - else if (p.IndexOf("Replace") > -1) - PasteReplace(tn, iiClipboard.ItemID); - } - private void PasteBeforeOrAfter(MenuSelections newtype, VETreeNode tn, int copyStartID) - { - // If paste-from step is open in the editor, use the OnPasteItemInfo to paste the step and add stepitems - // to the step editor panel. - ItemInfo ii = tn.VEObject as ItemInfo; - ItemInfo.EAddpingPart pasteOpt = newtype == MenuSelections.StepBefore ? ItemInfo.EAddpingPart.Before : ItemInfo.EAddpingPart.After; - // If parent step is open in step editor, the 'OnPasteItemInfo' event will cause - // the item to be pasted in the step editor and the tree. - if (!OnPasteItemInfo(this, new vlnTreeItemInfoPasteEventArgs(ii, copyStartID, pasteOpt, ii.MyContent.Type))) - { - // The parent step was not open in the step editor, just paste step (in data) and add treenode. - ItemInfo newItemInfo = null; - if (newtype == MenuSelections.StepBefore) - newItemInfo = ii.PasteSiblingBefore(copyStartID); - else - newItemInfo = ii.PasteSiblingAfter(copyStartID); - } - SelectedNode = (VETreeNode)((newtype == MenuSelections.StepAfter) ? tn.NextNode : tn.PrevNode); - } - private void PasteReplace(VETreeNode tn, int copyStartID) - { - VETreeNode prevtn = (VETreeNode) tn.PrevNode; - VETreeNode partn = (VETreeNode) tn.Parent; - ItemInfo ii = tn.VEObject as ItemInfo; - if (!OnPasteItemInfo(this, new vlnTreeItemInfoPasteEventArgs(ii, copyStartID, ItemInfo.EAddpingPart.Replace, ii.MyContent.Type))) - { - //return; - ItemInfo replItemInfo = Item.PasteReplace(ii, copyStartID); - } - SelectedNode = (VETreeNode)((prevtn != null) ? prevtn.NextNode : partn.FirstNode); - } - private void tv_NodeCopy() - { - if (SelectedNode==null)return; - VETreeNode tn = SelectedNode as VETreeNode; - ItemInfo ii = tn.VEObject as ItemInfo; - if (ii != null) - { - Clipboard.Clear(); - PromsClipboard iClip; - iClip.itemId = ii.ItemID; - iClip.cType = (int)PromsClipboardType.Copy; - DataObject myDO = new DataObject(); - myDO.SetText(ii.DisplayNumber==null||ii.DisplayNumber==""?" ":ii.DisplayNumber); - myDO.SetData("PromsClipboard", iClip); - Clipboard.SetDataObject(myDO); - //Clipboard.SetData("PromsClipboard", iClip); - //Clipboard.SetData(DataFormats.Text, ii.DisplayNumber); - } - } - #endregion - #region PropertyPagesInterface - private void SetupNodeProperties() - { - VETreeNode tn = SelectedNode as VETreeNode; - if (tn==null)return; - - if ((tn.VEObject as FolderInfo) != null) - OpenProperties(tn.VEObject as FolderInfo); - else if ((tn.VEObject as DocVersionInfo) != null) - OpenProperties(tn.VEObject as DocVersionInfo); - else if ((tn.VEObject as ProcedureInfo) != null) - OpenProperties(tn.VEObject as ProcedureInfo); - else if ((tn.VEObject as SectionInfo) != null) - OpenProperties(tn.VEObject as SectionInfo); - else if ((tn.VEObject as StepInfo) != null) - MessageBox.Show("Open up info tab or whatever is associated with step"); - tn.RefreshNode(); - } - private void OpenProperties(FolderInfo folderInfo) - { - using (Folder folder = folderInfo.Get()) - { - OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} Properties", folder.FolderConfig.Name), folder.FolderConfig)); - } - } - private void OpenProperties(DocVersionInfo dvInfo) - { - using (DocVersion dv = dvInfo.Get()) - { - OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} Properties", dv.DocVersionConfig.Name), dv.DocVersionConfig)); - } - } - private void OpenProperties(ProcedureInfo procInfo) - { - using (Procedure proc = procInfo.Get()) - { - OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} {1} Properties", proc.ProcedureConfig.Number, proc.ProcedureConfig.Title), proc.ProcedureConfig)); - } - } - private void OpenProperties(SectionInfo sectInfo) - { - OnSectionShouldClose(this, new vlnTreeSectionInfoEventArgs(sectInfo)); - using (Section sect = sectInfo.Get()) - { - string title = null; - if (sectInfo.SectionConfig.Number.Length > 0) - title = string.Format("{0} {1} Properties", sectInfo.SectionConfig.Number, sectInfo.SectionConfig.Title); - else - title = string.Format("{0} Properties", sectInfo.SectionConfig.Title); - OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(title, sect.SectionConfig)); - } - } - private void OpenProperties(StepInfo stpinfo) - { - using (Step stp = stpinfo.Get()) - { - } - } - - #endregion - #region OpenNode - private void tv_KeyPress(object sender, KeyPressEventArgs e) - { - if (e.KeyChar == '\r') - { - OpenNode(); - e.Handled = true; - } - } - public void OpenNode() - { - VETreeNode tn = SelectedNode as VETreeNode; - if (tn != null) - { - if (tn.VEObject.GetType() == typeof(FolderInfo) || tn.VEObject.GetType() == typeof(DocVersionInfo) || tn.VEObject.GetType() == typeof(PartInfo)) - { - if (tn.Nodes.Count > 0) - { - tn.Expand(); - SelectedNode = tn.Nodes[0]; - Focus(); - } - } - else - OnNodeSelect(this, new vlnTreeEventArgs(SelectedNode)); - } - } - #endregion - #region InsertAllLevels - public void tv_NodeNew(MenuSelections newtype) - { - VETreeNode tn = null; - if (SelectedNode == null) return; - SetLastValues((VETreeNode)SelectedNode); - - #region InsertFolderOrDocVersion - if (_LastFolderInfo != null) - { - using (Folder parentfolder = _LastFolderInfo.Get()) - { - if (newtype == MenuSelections.DocVersion) - { - int dvid = -1; // flag to allow user to cancel from dialog & then we remove it. - using (DocVersion docversion = DocVersion.MakeDocVersion(parentfolder, "Working Draft", "Title", null, null, null)) - { - ShowBrokenRules(docversion.BrokenRulesCollection); - SetLastValues(DocVersionInfo.Get(docversion.VersionID)); - if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("Working Draft", docversion.DocVersionConfig)) == DialogResult.OK) - { - docversion.Save().Dispose(); - tn = new VETreeNode(_LastDocVersionInfo); - SelectedNode.Nodes.Add(tn); // add tree node to end of list. - } - else - dvid = docversion.VersionID; - } - if (dvid != -1) DocVersion.Delete(dvid); - } - else if (newtype == MenuSelections.Folder) - { - int f1 = -1; // flag to allow user to cancel from dialog & then we remove it. - string uniquename = _LastFolderInfo.UniqueChildName("New Folder"); - using (Folder folder = Folder.MakeFolder(parentfolder, parentfolder.MyConnection, uniquename, string.Empty, "Short Name", null, string.Empty, DateTime.Now, "Test")) - { - ShowBrokenRules(folder.BrokenRulesCollection); - SetLastValues(FolderInfo.Get(folder.FolderID)); - if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(uniquename, folder.FolderConfig)) == DialogResult.OK) - { - folder.Save().Dispose(); - tn = new VETreeNode((IVEDrillDownReadOnly)_LastFolderInfo); - SelectedNode.Nodes.Add(tn); // add new tree node to end of childlist. - } - else - f1 = folder.FolderID; - } - if (f1 != -1) Folder.Delete(f1); - } - else if (newtype == MenuSelections.FolderAfter||newtype == MenuSelections.FolderBefore) - { - int f2 = -1; - string uniquename = _LastFolderInfo.MyParent.UniqueChildName("New Folder"); - int myindex = SelectedNode.Index + ((newtype == MenuSelections.FolderAfter) ? 1 : 0); - FolderInfo parfolderinfo = FolderInfo.Get(parentfolder.FolderID); - double? myorder = parfolderinfo.NewManualOrder(myindex); - using (Folder folder = Folder.MakeFolder(parentfolder.MyParent, parentfolder.MyConnection, uniquename, string.Empty, "Short Name", null, myorder, string.Empty, DateTime.Now, "Test")) - { - ShowBrokenRules(folder.BrokenRulesCollection); - SetLastValues(FolderInfo.Get(folder.FolderID)); - if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(uniquename, folder.FolderConfig)) == DialogResult.OK) - { - folder.Save().Dispose(); - tn = new VETreeNode((IVEDrillDownReadOnly)_LastFolderInfo); - if (newtype == MenuSelections.FolderBefore) SelectedNode.Parent.Nodes.Insert(SelectedNode.Index, tn); - if (newtype == MenuSelections.FolderAfter) SelectedNode.Parent.Nodes.Insert(SelectedNode.Index + 1, tn); - } - else - f2 = folder.FolderID; - } - if (f2 != -1) Folder.Delete(f2); - } - } - } - #endregion - #region InsertProcedure - else if (newtype == MenuSelections.Procedure) - { - int p1 = -1; - using (Procedure procedure = Procedure.MakeProcedure(_LastDocVersionInfo, _LastDocVersionInfo.Procedures.Count!=0?_LastDocVersionInfo.Procedures[_LastDocVersionInfo.Procedures.Count-1]:null, null, "New Procedure", 0)) - { - ShowBrokenRules(procedure.BrokenRulesCollection); - SetLastValues(ProcedureInfo.Get(procedure.ItemID)); - if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("New Procedure", procedure.ProcedureConfig)) == DialogResult.OK) - { - procedure.Save().Dispose(); - tn = new VETreeNode(_LastProcedureInfo); - SelectedNode.Nodes.Add(tn); // add tree node to end of list. - } - else - p1 = procedure.ItemID; - } - if (p1 != -1) Item.Delete(p1); - } - else if (newtype == MenuSelections.ProcedureAfter || newtype == MenuSelections.ProcedureBefore) - { - int p2 = -1; - int tvindex = SelectedNode.Index; - // if inserting before, the parent is set in case previous is null, i.e. beginning of the list. - using (Procedure procedure = Procedure.MakeProcedure((newtype == MenuSelections.ProcedureAfter) ? null : _LastProcedureInfo.ActiveParent, (newtype == MenuSelections.ProcedureAfter) ? _LastProcedureInfo : _LastProcedureInfo.MyPrevious, null, "New Procedure", 0)) - { - ShowBrokenRules(procedure.BrokenRulesCollection); - SetLastValues(ProcedureInfo.Get(procedure.ItemID)); - if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("New Procedure", procedure.ProcedureConfig)) == DialogResult.OK) - { - procedure.Save().Dispose(); - tn = new VETreeNode(_LastProcedureInfo); - TreeNode par = SelectedNode.Parent; - par.Nodes.Insert(tvindex + ((newtype == MenuSelections.ProcedureBefore) ? 0 : 1), tn); - } - else - p2 = procedure.ItemID; - } - if (p2 != -1) Item.Delete(p2); - } - #endregion - #region InsertSection - else if (newtype == MenuSelections.Section) // Insert subsection at end of parents section list - { - int s1 = -1; - if (!(_LastProcedureInfo == null) || !(_LastSectionInfo == null)) - { - using (Section section = Section.MakeSection(_LastItemInfo, _LastItemInfo.LastChild(E_FromType.Section), null, "New Section", 10000)) - { - ShowBrokenRules(section.BrokenRulesCollection); - SetLastValues(SectionInfo.Get(section.ItemID)); - if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("New Section", section.SectionConfig)) == DialogResult.OK) - { - tn = new VETreeNode(_LastSectionInfo); - SelectedNode.Nodes.Add(tn); // add tree node to end of list. - } - else - s1 = section.ItemID; - } - if (s1 != -1) Item.Delete(s1); - } - } - else if (newtype == MenuSelections.SectionAfter || newtype == MenuSelections.SectionBefore) - { - int tvindex = SelectedNode.Index; - // if inserting before, the parent is set in case previous is null, i.e. beginning of the list. - int s2 = -1; - using (Section section = Section.MakeSection((newtype == MenuSelections.SectionAfter) ? null : _LastSectionInfo.MyParent, (newtype == MenuSelections.SectionAfter) ? _LastSectionInfo : _LastSectionInfo.MyPrevious, null, "New Section", 10000)) - { - ShowBrokenRules(section.BrokenRulesCollection); - SetLastValues(SectionInfo.Get(section.ItemID)); - if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("New Section", section.SectionConfig)) == DialogResult.OK) - { - tn = new VETreeNode(_LastSectionInfo); - TreeNode par = SelectedNode.Parent; - par.Nodes.Insert(tvindex + ((newtype == MenuSelections.SectionBefore) ? 0 : 1), tn); - } - else - s2 = section.ItemID; - } - if (s2 != -1) Item.Delete(s2); - } - #endregion - #region InsertStep - else if (newtype == MenuSelections.Step) // insert step from section - no substeps from tree. - { - tn = InsertChildStep((VETreeNode)SelectedNode); - } - else if (newtype == MenuSelections.StepAfter || newtype == MenuSelections.StepBefore && _LastStepInfo != null) - { - tn = InsertBeforeOrAfter(newtype, (VETreeNode)SelectedNode); - } - #endregion - - if (tn != null) - { - SelectedNode = tn; - OnNodeNew(this, new vlnTreeEventArgs(SelectedNode)); - Refresh(); - } - } - - private VETreeNode InsertChildStep(VETreeNode tn) - { - // If parent step is open in editor, use the OnInsertItemInfo to insert step & add stepitems to step editor panel - ItemInfo ii = tn.VEObject as ItemInfo; - if (OnInsertItemInfo(this, new vlnTreeItemInfoInsertEventArgs(ii, E_InsertType.Child, "New Step", 20002, E_FromType.Step))) - { - return null; // should we try to get to the child? - } - // The parent step was not open in the step editor, just create new step and add treenode. - using (Step step = Step.MakeStep(_LastItemInfo, _LastItemInfo.LastChild(E_FromType.Step), null, "New Step", 20002, E_FromType.Step)) - { - ShowBrokenRules(step.BrokenRulesCollection); - SetLastValues(StepInfo.Get(step.ItemID)); - tn = new VETreeNode(_LastStepInfo); - SelectedNode.Nodes.Add(tn); // add tree node to end of list. - } - return tn; - } - - private VETreeNode InsertBeforeOrAfter(MenuSelections newtype, VETreeNode tn) - { - // If parent step is open in editor, use the OnInsertItemInfo to insert step & add stepitems to step editor panel - ItemInfo ii = tn.VEObject as ItemInfo; - if (OnInsertItemInfo(this, new vlnTreeItemInfoInsertEventArgs(ii,(newtype == MenuSelections.StepAfter) ? E_InsertType.After:E_InsertType.Before, "New Step"))) - { - return (VETreeNode)((newtype == MenuSelections.StepAfter) ? tn.NextNode : tn.PrevNode); - } - // The parent step was not open in the step editor, just create new step and add treenode. - int tvindex = SelectedNode.Index; - // if inserting before, the parent is set in case previous is null, i.e. beginning of the list. - ItemInfo parent = (newtype == MenuSelections.StepAfter) ? null : _LastStepInfo.MyParent; - using (Step step = Step.MakeStep(parent, (newtype == MenuSelections.StepAfter) ? _LastStepInfo : _LastStepInfo.MyPrevious, null, "New Step", (int)_LastStepInfo.MyContent.Type, (E_FromType)_LastStepInfo.FirstSibling.ItemParts[0].FromType)) - { - ShowBrokenRules(step.BrokenRulesCollection); - SetLastValues(StepInfo.Get(step.ItemID)); - tn = new VETreeNode(_LastStepInfo); - TreeNode par = SelectedNode.Parent; - par.Nodes.Insert(tvindex + ((newtype == MenuSelections.StepBefore) ? 0 : 1), tn); - } - return tn; - } - private void ShowBrokenRules(BrokenRulesCollection brs) - { - if (brs != null) - { - foreach (BrokenRule br in brs) - { - Console.WriteLine("broken rule {0}", br.Description); - } - } - } - #endregion - #region DeleteAllLevels - private bool tv_NodeDelete() - { - SetLastValues((VETreeNode)SelectedNode); - - DialogResult result = MessageBox.Show("Are you sure you want to delete " + SelectedNode.Text, "Verify Delete", - MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (result == DialogResult.Yes) - { - if (_LastFolderInfo != null) - { - Folder.Delete(_LastFolderInfo.FolderID); - _LastFolderInfo = null; - return true; - } - else if (_LastDocVersionInfo != null) - { - DocVersion.Delete(_LastDocVersionInfo.VersionID); - _LastDocVersionInfo = null; - return true; - } - else if (_LastProcedureInfo != null) - { - // always return false because an event gets fired to delete tree nodes. - if (!DeleteItemInfoAndChildren(_LastProcedureInfo)) return false; - _LastProcedureInfo = null; - return false; - } - else if (_LastSectionInfo != null) - { - OnSectionShouldClose(this, new vlnTreeSectionInfoEventArgs(_LastSectionInfo)); - // always return false because an event gets fired to delete tree nodes. - if (!DeleteItemInfoAndChildren(_LastSectionInfo)) - { - return false; - } - WordSectionEventArgs args = new WordSectionEventArgs(_LastSectionInfo); - OnWordSectionDeleted(this, args); - _LastSectionInfo = null; - return false; - } - else if (_LastStepInfo != null) - { - // always return false because an event gets fired to delete tree nodes. - if (!DeleteItemInfoAndChildren(_LastStepInfo)) return false; - _LastStepInfo = null; - return false; - } - } - return false; - } - private bool DeleteItemInfoAndChildren(ItemInfo ii) - { - try - { - // send an event to frmVeproms that sends an event to the stepeditor to - // do delete using stepitem - this manages windowing from the step editor. - // If the procedure is open & you're deleting procedure, you want to close open - // window - this is done in DisplayTabControl-DeleteStepTabItem. - if (!OnDeleteItemInfo(this, new vlnTreeItemInfoEventArgs(ii))) - Item.DeleteItemAndChildren(ii); - return true; - } - catch (System.Data.SqlClient.SqlException ex) - { - HandleSqlExceptionOnDelete(ex, ii); - return false; - } - } - private void HandleSqlExceptionOnDelete(System.Data.SqlClient.SqlException ex, ItemInfo ii) - { - if (ex.Message.Contains("has External Transitions and has no next step")) - { - using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitions(ii.ItemID)) - { - DialogResult ans = MessageBox.Show("Transitions exist to this step and cannot be adjusted automatically." + - "\r\n\r\nDo you want to be placed on the " + (exTrans.Count > 1 ? "first " : "") + "substep with the problem Transition?" + - "\r\n\r\nSubsteps with Problem Transitions" + - exTrans.Summarize(), - "Cannot Delete This Step", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (ans == DialogResult.Yes) - { - OnOpenItem(this, new vlnTreeItemInfoEventArgs(exTrans[0].MyContent.ContentItems[0])); - } - } - } - else if (ex.Message.Contains("has External Transitions to it's children")) - { - using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(ii.ItemID)) - { - DialogResult ans = MessageBox.Show("Transitions exist to substeps of this step and cannot be adjusted automatically." + - "\r\n\r\nDo you want to be placed on the " + (exTrans.Count > 1 ? "first " : "") + "substep with the problem Transition?" + - "\r\n\r\nSubsteps with Problem Transitions:" + - exTrans.Summarize(), - "Cannot Delete This Step", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (ans == DialogResult.Yes) - { - OnOpenItem(this, new vlnTreeItemInfoEventArgs(exTrans[0].MyContent.ContentItems[0])); - } - } - } - else - MessageBox.Show(ex.Message, "SQL Exception", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - } - #endregion - #region SetLastValuesAndSaveIfChangedStuff - private void SetLastValues(VETreeNode node) - { - _LastTreeNode = node; - SetLastValues(node.VEObject); - } - private void SetLastValues(IVEDrillDownReadOnly veobject) - { - _LastFolderInfo = veobject as FolderInfo; - _LastDocVersionInfo = veobject as DocVersionInfo; - _LastProcedureInfo = veobject as ProcedureInfo; - _LastSectionInfo = veobject as SectionInfo; - _LastStepInfo = veobject as StepInfo; - _LastItemInfo = veobject as ItemInfo; - } - #endregion - #region Cursor - private bool SetupDragCursor(ImageList il, TreeNode tn) - { - // Reset image list used for drag image - il.Images.Clear(); - int howBig = tn.Bounds.Size.Width + this.Indent; - if (howBig > 256) howBig = 256; - il.ImageSize = new Size(howBig, tn.Bounds.Height); - - // Create new bitmap - // This bitmap will contain the tree node image to be dragged - Bitmap bmp = new Bitmap(tn.Bounds.Width + this.Indent, tn.Bounds.Height); - - // Get graphics from bitmap - Graphics gfx = Graphics.FromImage(bmp); - - // Draw node icon into the bitmap - if (this.ImageList != null) gfx.DrawImage(this.ImageList.Images[0], 0, 0); - - // Draw node label into bitmap - gfx.DrawString(tn.Text, this.Font, new SolidBrush(this.ForeColor), - // new SolidBrush(Color.Blue), - (float)this.Indent, 1.0f); - - // Add bitmap to imagelist - _dragImageList.Images.Add(bmp); - - // Get mouse position in client coordinates - Point p = this.PointToClient(Control.MousePosition); - - // Compute delta between mouse position and node bounds - int dx = p.X + this.Indent - tn.Bounds.Left; - int dy = p.Y - tn.Bounds.Top; - - // Begin dragging image - return DragHelper.ImageList_BeginDrag(_dragImageList.Handle, 0, dx, dy); - } - private void tv_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e) - { - // Get drag node and select it - try - { - TreeNode dragNode = (TreeNode)e.Item; - Type t = dragNode.GetType(); - //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("Item Drag {0} - {1}", t.FullName, t.BaseType.FullName); - Type t2 = Type.GetType(t.FullName); - //if(t2 != null) - // if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("Item Drag {0} - {1}", t2.FullName, t2.BaseType.FullName); - this.SelectedNode = dragNode; - ItemInfo iidrag = ((VETreeNode)dragNode).VEObject as ItemInfo; - FolderInfo fdrag = ((VETreeNode)dragNode).VEObject as FolderInfo; - DocVersionInfo ddrag = ((VETreeNode)dragNode).VEObject as DocVersionInfo; - if ((iidrag == null && fdrag == null && ddrag == null) || (iidrag != null && iidrag.IsStep)) - { - MessageBox.Show(iidrag==null?"Cannot drag/drop a grouping node.":"Cannot drag/drop a Step"); - return; - } - if (SetupDragCursor(_dragImageList, dragNode)) - { - this.DoDragDrop(dragNode, DragDropEffects.Move | DragDropEffects.Copy);// Begin dragging - DragHelper.ImageList_EndDrag();// End dragging image - } - } - catch (Exception ex) - { - if(_MyLog.IsErrorEnabled)_MyLog.Error("tv_ItemDrag", ex); - } - } - #endregion - #region DragDrop - ImageList _dragImageList = new ImageList(); - public enum DropPosition : int - { - Child = 0, Before = 1, After = 2 - } - private class DropLocation - { - #region Business Methods - private TreeNode _dropNode; - public TreeNode DropNode - { - get { return _dropNode; } - set { _dropNode = value; } - } - private int _index; - public int Index - { - get { return _index; } - set { _index = value; } - } - private DropPosition _position; - public DropPosition Position - { - get { return _position; } - set { _position = value; } - } - DateTime _lastScroll; - public DateTime LastScroll - { - get { return _lastScroll; } - } - private string _location = string.Empty; - #endregion - #region Constructors - public DropLocation(TreeView tv, System.Windows.Forms.DragEventArgs e, DateTime lastScroll) - { - _lastScroll = lastScroll; - _dropNode = tv.GetNodeAt(tv.PointToClient(new Point(e.X, e.Y))); - if (_dropNode == null) return; - int OffsetY = tv.PointToClient(Cursor.Position).Y - _dropNode.Bounds.Top; - if (OffsetY < _dropNode.Bounds.Height / 3) // First Third - Before - { - _index = _dropNode.Index; - _dropNode = _dropNode.Parent; - _position = DropPosition.Before; - _location = string.Format("Before1 {0}[{1}] y={2}", _dropNode.Text, _index, OffsetY); - } - else if ((OffsetY / 2) < _dropNode.Bounds.Height / 3) // Second Third - Child - { - _location = string.Format("Child {0} y={1}", _dropNode.Text, OffsetY); - _position = DropPosition.Child; - _index = 0; - //if (_dropNode.Parent == null) - //{ - // if(_MyLog.IsInfoEnabled)_MyLog.Info("Root Node"); - //} - } - else // Last Third - After Now I need to check the X value - { - if (_dropNode.NextVisibleNode != null && _dropNode.Nodes.Count > 0 && _dropNode.IsExpanded)// Has Children & Expanded - Insert first child - { - // _dropNode = _dropNode.Nodes[0]; - _index = 0; - _position = DropPosition.Before; - _location = string.Format("Before2 {0}[{1}] y={2}", _dropNode.Text, _index, OffsetY); - } - else // No Children or Children Collapsed - Insert Next at various levels depending upon horizontal location. - { - Point pt = tv.PointToClient(new Point(e.X, e.Y)); - TreeNode nextParent = _dropNode.NextNode; - if (nextParent != null) nextParent = nextParent.Parent; - do - { - _index = _dropNode.Index; - _dropNode = _dropNode.Parent; - } while (pt.X < _dropNode.Bounds.X && _dropNode != nextParent); - _location = string.Format("After {0}[{1}] y={2}", _dropNode.Text, _index, OffsetY); - _position = DropPosition.After; - } - } - LimitMoves(e); - } - public void LimitMoves(DragEventArgs e) - { - if ((e.KeyState & 8) == 0) - { - //TreeNode dragNode = (TreeNode)e.Data.GetData("System.Windows.Forms.TreeNode"); - //TreeNode dragNode = (TreeNode)e.Data.GetData("TreeTest.FolderTreeNode"); - TreeNode dragNode = vlnTreeView.GetTreeNodeFromData(e.Data); - switch (_position) - { - case DropPosition.Before: - if (dragNode == _dropNode.Nodes[_index] || dragNode == _dropNode.Nodes[_index].PrevNode) - { - // if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("Before {0} {1} {2} {3} {4}", dragNode.Text ,_position.ToString() , _dropNode.Nodes[_index].Text - // ,_dropNode.Nodes[_index].PrevNode,_dropNode.Nodes[_index].NextNode); - _dropNode = null; - } - break; - case DropPosition.Child: - if (dragNode.Parent == _dropNode) - { - // if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("Child {0} {1} {2} {3} {4} {5}", dragNode.Text ,_position.ToString() , _dropNode.Nodes[_index].Text - // ,_dropNode.Nodes[_index].PrevNode,_dropNode.Nodes[_index].NextNode,DateTime.Now); - _dropNode = null; - } - break; - case DropPosition.After: - if (dragNode == _dropNode.Nodes[_index] || dragNode == _dropNode.Nodes[_index].NextNode) - { - // if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("After {0} {1} {2} {3} {4}", dragNode.Text ,_position.ToString() , _dropNode.Nodes[_index].Text - // ,_dropNode.Nodes[_index].PrevNode,_dropNode.Nodes[_index].NextNode); - _dropNode = null; - } - break; - } - } - } - #endregion - public override string ToString() - { - return string.Format("{0}[{1}].{2}", _dropNode.Text, _index, _position.ToString()); - } - #region Drawing - private void TreeNodeTriangle(Graphics g) - { - Rectangle r = _dropNode.Bounds; - int RightPos = r.Right + 6; - Point[] RightTriangle = new Point[]{ - new Point(RightPos, r.Y ), - new Point(RightPos - (r.Height / 2), r.Y + (r.Height / 2)), - new Point(RightPos, r.Y + r.Height), - new Point(RightPos - (r.Height / 3), r.Y + (r.Height / 2)) - }; - g.FillPolygon(System.Drawing.Brushes.Black, RightTriangle); - } - private void InsertPointer(TreeNode tn, Graphics g) - { - TreeView tv = _dropNode.TreeView; - Rectangle r2 = _dropNode.Nodes[_index].Bounds; - Rectangle r3 = tn.Bounds; - int y = (_position == DropPosition.Before ? r2.Y : r3.Bottom); - int x = r2.Left; - - if (y == 0) - { - return; - } - //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("Line at {0} Node {1}[{2}] {3}", _location, _dropNode.Text, _index, _position.ToString()); - Color lc = (_position == DropPosition.After ? Color.Red : Color.Blue); - Brush lb = (_position == DropPosition.After ? Brushes.Red : Brushes.Blue); - Point[] RightTriangle; - if (_position == DropPosition.After) - { - RightTriangle = new Point[]{ - new Point(x, y ), - new Point(x+4, y+4), - new Point(x+8, y)}; - } - else - { - RightTriangle = new Point[]{ - new Point(x, y), - new Point(x+4, y-4), - new Point(x+8, y)}; - } - g.DrawLine(new System.Drawing.Pen(lc, 2), new Point(r2.Left, y), new Point(tv.Width - 8, y)); - g.FillPolygon(lb, RightTriangle); - } - public void ShowLocation(System.Windows.Forms.DragEventArgs e, bool ScrollOnly) - { - //if (e.Effect == DragDropEffects.None) return; - if (_dropNode != null) - { -// if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("ShowLocation1 {0} {1}", e.Effect.ToString(), DateTime.Now.Millisecond); - DragHelper.ImageList_DragShowNolock(false); - TreeView tv = _dropNode.TreeView; - TreeNode tmp = tv.GetNodeAt(tv.PointToClient(new Point(e.X, e.Y))); -// if (!ScrollOnly) -// { - if (ScrollTreeView(tmp) || !ScrollOnly) - { - //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("ShowLocation2 {0} {1}", e.Effect.ToString(), DateTime.Now.Millisecond); - tv.Refresh(); - if (e.Effect != DragDropEffects.None) - { - //tv.SelectedNode = dropNode; - Graphics g = tv.CreateGraphics(); - TreeNodeTriangle(g); - if (_position != DropPosition.Child)InsertPointer(tmp, g); - } - } -// } -// else ScrollTreeView(tmp); - DragHelper.ImageList_DragShowNolock(true); - } - } - #endregion - public void ShowLocation() - { - //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0}[{1}] {2}", _dropNode.Text, _index, _position.ToString()); - } - #region AutoScroll - private bool ScrollTreeView(TreeNode tn) - { - bool retval = false; - TimeSpan ts = new TimeSpan(DateTime.Now.Ticks - _lastScroll.Ticks); - if (ts.Milliseconds > 100)// This controls the scroll speed - { - int top = tn.Bounds.Top; - _lastScroll = DateTime.Now; - if (tn.TreeView.ClientSize.Height < tn.Bounds.Bottom) tn.EnsureVisible();// Make sure that the current node is visible - if (tn.NextVisibleNode != null && tn.TreeView.ClientSize.Height < tn.NextVisibleNode.Bounds.Bottom) - tn.NextVisibleNode.EnsureVisible();// Make sure that the next node is visible - else - if (tn.PrevVisibleNode != null && tn.PrevVisibleNode.PrevVisibleNode != null && tn.PrevVisibleNode.PrevVisibleNode.IsVisible == false) - tn.PrevVisibleNode.PrevVisibleNode.EnsureVisible();// Make sure that the previous node is visible } - else - if (tn.PrevVisibleNode != null && tn.PrevVisibleNode.IsVisible == false) - tn.PrevVisibleNode.EnsureVisible();// Make sure that the previous node is visible - retval = (top != tn.Bounds.Top); - // if (retval) if(_MyLog.IsInfoEnabled)_MyLog.Info("Scroll"); - } - return retval; - } - #endregion - public bool Equals(DropLocation dl) - { - return (dl != null && _lastScroll.Equals(dl.LastScroll) && _dropNode.Equals(dl.DropNode) && - _position.Equals(dl.Position)); - } - } - private DropLocation _LastDropLocation = null; - private void tv_DragOver(object sender, System.Windows.Forms.DragEventArgs e) - { - try - { - TreeNode dragNode = GetTreeNodeFromData(e.Data); - // Compute drag position and move image - Point formP = this.FindForm().PointToClient(new Point(e.X, e.Y)); - DragHelper.ImageList_DragMove(formP.X - this.Left, formP.Y - this.Top); - DropLocation dl = new DropLocation(this, e, _LastDropLocation == null ? DateTime.Now : _LastDropLocation.LastScroll); - string s = string.Empty; - if (dl.DropNode == null) - { - e.Effect = DragDropEffects.None; - } - else - { - DragDropEffects ee = e.Effect; - if ((e.KeyState & 8) == 8) - ee = DragDropEffects.Copy; // Copy it - else - ee = DragDropEffects.Move; // Move it - if (IsChild(dragNode, dl.DropNode)) // Don't copy or move to a child node - ee = DragDropEffects.None; - else if (IsDocVersion((VETreeNode)dragNode)) // Don't move docversions - ee = DragDropEffects.None; - else if (IsFolder((VETreeNode)dragNode)) // Folder move is only valid if moving to folder with NO docversions - { - FolderInfo fdropi = ((VETreeNode)dl.DropNode).VEObject as FolderInfo; - if (fdropi == null || fdropi.FolderDocVersionCount > 0) ee = DragDropEffects.None; - } - else if (IsSection((VETreeNode)dragNode)) - { - // A section can be moved within a procedure or to a section within the same procedure... - // For HLP, just move within the same procedure - // TODO: allow for section move within subsections. - ProcedureInfo pdropi = ((VETreeNode)dl.DropNode).VEObject as ProcedureInfo; - if (pdropi == null || (dragNode.Parent != dl.DropNode)) ee = DragDropEffects.None; - } - else if (!IsFolder((VETreeNode)dragNode) && (dragNode.Parent != dl.DropNode)) - ee = DragDropEffects.None; - if (e.Effect != ee) e.Effect = ee; - dl.ShowLocation(e, dl.Equals(_LastDropLocation)); - _LastDropLocation = dl; - } - } - catch (Exception ex) - { - if(_MyLog.IsErrorEnabled)_MyLog.Error("tv_DragOver", ex); - } - } - - private bool IsSection(VETreeNode vETreeNode) - { - SectionInfo sectInfo = vETreeNode.VEObject as SectionInfo; - if (sectInfo != null) return true; - return false; - } - private bool IsProcedure(VETreeNode vETreeNode) - { - ProcedureInfo procInfo = vETreeNode.VEObject as ProcedureInfo; - if (procInfo != null) return true; - return false; - } - private bool IsDocVersion(VETreeNode dragNode) - { - DocVersionInfo dvInfo = dragNode.VEObject as DocVersionInfo; - if (dvInfo != null) return true; - return false; - } - private static TreeNode GetTreeNodeFromData(IDataObject datobj) - { - foreach (string s in datobj.GetFormats()) - { - try - { - return (TreeNode)datobj.GetData(s); - } - catch (Exception ex) - { - if(_MyLog.IsErrorEnabled)_MyLog.Error("GetTreeNodeFromData", ex); - } - } - return null; - } - private bool IsFolder(VETreeNode veTreeNode) - { - return (veTreeNode.VEObject.GetType() == typeof(FolderInfo)); - } - private void tv_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) - { - try - { - TreeNode dragNode = GetTreeNodeFromData(e.Data); - DragHelper.ImageList_DragLeave(this.Handle); - int index = _LastDropLocation.Index + (_LastDropLocation.Position == DropPosition.After ? 1 : 0); - int myIndex = index; - if (dragNode.Parent == _LastDropLocation.DropNode && dragNode.Index <= _LastDropLocation.Index) index--; - if (e.Effect == DragDropEffects.Move)// If Move Remove drag node from parent - dragNode.Remove(); - else - dragNode = Clone(dragNode); - _LastDropLocation.DropNode.Nodes.Insert(index, dragNode); - this.SelectedNode = dragNode; - FolderInfo fdragi = ((VETreeNode)dragNode).VEObject as FolderInfo; - FolderInfo fdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as FolderInfo; - if (fdragi != null && fdropi != null && fdropi.FolderDocVersionCount==0) - { - using (Folder fdrag = fdragi.Get()) - { - using (Folder fdrop = fdropi.Get()) - { - fdrag.ManualOrder = fdropi.NewManualOrder(myIndex); - fdrag.MyParent = fdrop; - fdrag.Save(); - } - } - return; - } - // No drag/drop supported for document versions. - - // Allow drag/drop of procedures within a Document Version (must have same parent). Note that drop location - // may either be a document version or a procedure depending on where the user wants to position the procedure. - ProcedureInfo pdragi = ((VETreeNode)dragNode).VEObject as ProcedureInfo; - ProcedureInfo pdropi = null; - if (pdragi != null) // moving a procedure - { - pdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as ProcedureInfo; - if (pdropi != null && pdragi.ActiveParent == pdropi.ActiveParent) - { - pdragi.MoveProcedure(pdragi.ActiveParent, myIndex); - return; - } - DocVersionInfo dvdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as DocVersionInfo; - DocVersionInfo dvdragpar = pdragi.ActiveParent as DocVersionInfo; - if (dvdropi != null && dvdragpar.VersionID == dvdropi.VersionID) - { - pdragi.MoveProcedure(dvdropi, myIndex); - return; - } - } - - // Allow drag/drop of sections within the same procedure or same section (if subsection) (must have same parent) - SectionInfo sdragi = ((VETreeNode)dragNode).VEObject as SectionInfo; - SectionInfo sdropi = null; - if (sdragi != null) // moving a section - { - sdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as SectionInfo; - if (sdropi != null && sdragi.ActiveParent == sdropi.ActiveParent) - { - sdragi.MoveSection(sdragi, myIndex); - return; - } - pdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as ProcedureInfo; - if (pdropi != null && sdragi.MyParent.ItemID == pdropi.ItemID) - { - sdragi.MoveSection(pdropi, myIndex); - return; - } - } - - // Allow drag/drop of steps within the same parent only - StepInfo stdragi = ((VETreeNode)dragNode).VEObject as StepInfo; - StepInfo stdropi = null; - if (stdragi != null) // moving a step - { - stdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as StepInfo; - if (stdropi != null && stdragi.ActiveParent == stdropi.ActiveParent) - { - stdragi.MoveStep(stdragi.ActiveParent, myIndex); - return; - } - sdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as SectionInfo; - if (sdropi != null && stdragi.MyParent.ItemID == sdropi.ItemID) - { - stdragi.MoveStep(stdragi.ActiveParent, myIndex); - return; - } - // the following handles items under the app nodes of 'steps', 'notes', 'cautions', etc. - if (sdropi == null && dragNode.Parent == _LastDropLocation.DropNode) - { - stdragi.MoveStep(stdragi.ActiveParent, myIndex); - return; - } - } - } - catch (Exception ex) - { - if(_MyLog.IsErrorEnabled)_MyLog.Error("tv_DragDrop", ex); - } - } -// private void DumpMembers(object o) -// { -// Type t = o.GetType(); -// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("\r\n\r\nMembers for type {0}", t.ToString()); -// MemberInfo[] mis = t.GetMembers(); -// int i = 0; -// foreach (MemberInfo mi in mis) -// { -// i++; -// try -// { -// //if(mi.MemberType != MemberTypes.Method) -// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0} {1} {2}", i, mi.Name, mi.MemberType); -//// if (fi.Name == "TreeView") -//// fi.SetValue(o, null); -// } -// catch (Exception ex) -// { -// if(_MyLog.IsErrorEnabled)_MyLog.Error("DumpMembers", ex); -// } -// } -// } - private TreeNode Clone(TreeNode tn) - { - - TreeNode tmp = (TreeNode)tn.Clone(); - ExpandMatch(tmp,tn); - return tmp; - } - private void tv_DragDropOld(object sender, System.Windows.Forms.DragEventArgs e) - { - TreeNode dragNode = (TreeNode)e.Data.GetData("System.Windows.Forms.TreeNode");// Get the drag node - DragHelper.ImageList_DragLeave(this.Handle); - TreeNode cloneNode = (TreeNode)dragNode.Clone();// copy the source node - ExpandMatch(cloneNode, dragNode); - _LastDropLocation.DropNode.Nodes.Insert(_LastDropLocation.Index + (_LastDropLocation.Position == DropPosition.After ? 1 : 0), cloneNode); - if (e.Effect == DragDropEffects.Move)// If Move Remove drag node from parent - dragNode.Remove(); - this.SelectedNode = cloneNode; - } - private void tv_DragEnter(object sender, System.Windows.Forms.DragEventArgs e) - { - DragHelper.ImageList_DragEnter(this.Handle, e.X - this.Left, e.Y - this.Top); - } - private void tv_DragLeave(object sender, System.EventArgs e) - { - DragHelper.ImageList_DragLeave(this.Handle); - this.Refresh(); - } - private void ExpandMatch(TreeNode tn1, TreeNode tn2) - { - if (tn2.IsExpanded) tn1.Expand(); - foreach (TreeNode tc in tn2.Nodes) ExpandMatch(tn1.Nodes[tc.Index], tc); - } - private bool IsChild(TreeNode parent, TreeNode child) - { - if (parent.Equals(child)) return true;// Check against self - foreach (TreeNode tc in parent.Nodes) if (IsChild(tc, child)) return true;//Check all children - return false;// Must not be a child at this level - } - #endregion - private bool _AdjustingTree = false; - public void AdjustTree(ItemInfo selectedItem) - { - // start at the top parent and walk down the nodes to find child - VETreeNode node = FindNodeAndExpand(selectedItem); - if (node != null) - { - _AdjustingTree = true; - this.SelectedNode = node; - _AdjustingTree = false; - } - } - public VETreeNode FindNodeAndExpand(IVEDrillDownReadOnly selectedItem) - { - if (selectedItem.ActiveParent == null) - { - return (VETreeNode)this.Nodes[0]; // Return the top node - } - VETreeNode parent = FindNodeAndExpand(selectedItem.ActiveParent); - if (parent == null) return null; - if (!parent.IsExpanded) - parent.Expand(); - foreach (TreeNode childNode in parent.Nodes) - { - VETreeNode child = childNode as VETreeNode; - if (child != null && CompareVEObject(child.VEObject, selectedItem)) - return child; - } - foreach (TreeNode childNode in parent.Nodes) - { - VETreeNode child = childNode as VETreeNode; - if (child.VEObject is PartInfo) - foreach (VETreeNode grandchild in child.Nodes) - if (CompareVEObject(grandchild.VEObject, selectedItem)) - return grandchild; - } - return null; - } - public bool CompareVEObject(IVEDrillDownReadOnly obj1, IVEDrillDownReadOnly obj2) - { - ItemInfo myItem = obj1 as ItemInfo; - if (myItem != null) - if (myItem.ItemID == ((ItemInfo)obj2).ItemID) return true; - DocVersionInfo myDV = obj1 as DocVersionInfo; - if (myDV != null) - if (myDV.VersionID == ((DocVersionInfo)obj2).VersionID) return true; - FolderInfo myFolder = obj1 as FolderInfo; - if (myFolder != null) - if (myFolder.FolderID == ((FolderInfo)obj2).FolderID) return true; - return false; - } - } - #region DragHelper - public class DragHelper - { - [DllImport("comctl32.dll")] - public static extern bool InitCommonControls(); - - [DllImport("comctl32.dll", CharSet = CharSet.Auto)] - public static extern bool ImageList_BeginDrag(IntPtr himlTrack, int - iTrack, int dxHotspot, int dyHotspot); - - [DllImport("comctl32.dll", CharSet = CharSet.Auto)] - public static extern bool ImageList_DragMove(int x, int y); - - [DllImport("comctl32.dll", CharSet = CharSet.Auto)] - public static extern void ImageList_EndDrag(); - - [DllImport("comctl32.dll", CharSet = CharSet.Auto)] - public static extern bool ImageList_DragEnter(IntPtr hwndLock, int x, int y); - - [DllImport("comctl32.dll", CharSet = CharSet.Auto)] - public static extern bool ImageList_DragLeave(IntPtr hwndLock); - - [DllImport("comctl32.dll", CharSet = CharSet.Auto)] - public static extern bool ImageList_DragShowNolock(bool fShow); - static DragHelper() - { - InitCommonControls(); - } - } - #endregion -} diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs.bak b/PROMS/Volian.Controls.Library/vlnTreeView.cs.bak deleted file mode 100644 index 7c63f38a..00000000 --- a/PROMS/Volian.Controls.Library/vlnTreeView.cs.bak +++ /dev/null @@ -1,2735 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Text.RegularExpressions; -using System.Windows.Forms; -using System.Runtime.InteropServices; // For DragHelper -using System.Reflection; -using Csla; -using Csla.Validation; -using VEPROMS.CSLA.Library; -using System.IO; -using Volian.Base.Library; - -namespace Volian.Controls.Library -{ - #region DelegatesAndEventArgs - public delegate void vlnTreeViewEvent(object sender, vlnTreeEventArgs args); - public delegate void vlnTreeViewItemInfoEvent(object sender, vlnTreeItemInfoEventArgs args); - public delegate bool vlnTreeViewBoolEvent(object sender, vlnTreeEventArgs args); - public delegate bool vlnTreeViewItemInfoDeleteEvent(object sender, vlnTreeItemInfoEventArgs args); - public delegate bool vlnTreeViewItemInfoInsertEvent(object sender, vlnTreeItemInfoInsertEventArgs args); - public delegate bool vlnTreeViewItemInfoPasteEvent(object sender, vlnTreeItemInfoPasteEventArgs args); - public delegate TreeNode vlnTreeViewTreeNodeEvent(object sender, vlnTreeEventArgs args); - public delegate DialogResult vlnTreeViewPropertyEvent(object sender, vlnTreePropertyEventArgs args); - public delegate DialogResult vlnTreeViewPSIEvent(object sender, vlnTreeEventArgs args); - public delegate void vlnTreeViewSectionInfoEvent(object sender, vlnTreeSectionInfoEventArgs args); - public delegate void WordSectionDeletedEvent(object sender, WordSectionEventArgs args); - public delegate void vlnTreeViewPdfEvent(object sender, vlnTreeViewPdfArgs args); - public partial class vlnTreeSectionInfoEventArgs - { - private bool _IsDeleting = false; - public bool IsDeleting - { - get { return _IsDeleting; } - set { _IsDeleting = value; } - } - private SectionInfo _MySectionInfo; - public SectionInfo MySectionInfo - { - get { return _MySectionInfo; } - set { _MySectionInfo = value; } - } - public vlnTreeSectionInfoEventArgs(SectionInfo mySectionInfo) - { - _MySectionInfo = mySectionInfo; - } - public vlnTreeSectionInfoEventArgs(SectionInfo mySectionInfo,bool isDeleting) - { - _MySectionInfo = mySectionInfo; - _IsDeleting = isDeleting; - } - } - public partial class vlnTreeViewPdfArgs - { - private string _MyFilename; - public string MyFilename - { - get { return _MyFilename; } - set { _MyFilename = value; } - } - private byte[] _MyBuffer; - public byte[] MyBuffer - { - get { return _MyBuffer; } - set { _MyBuffer = value; } - } - private string _MyWatermark; - public string MyWatermark - { - get { return _MyWatermark; } - set { _MyWatermark = value; } - } - public vlnTreeViewPdfArgs(string filename, byte[] buffer, string watermark) - { - _MyFilename = filename; - _MyBuffer = buffer; - _MyWatermark = watermark; - } - } - public partial class vlnTreeEventArgs - { - #region Business Methods - private TreeNode _Node; - public TreeNode Node - { - get { return _Node; } - set { _Node = value; } - } - private TreeNode _Destination=null; - public TreeNode Destination - { - get { return _Destination; } - set { _Destination = value; } - } - private int _Index; - public int Index - { - get { return _Index; } - set { _Index = value; } - } - //jcb multiunit - private string _Unit; - public string Unit - { - get { return _Unit; } - set { _Unit = value; } - } - private int _UnitIndex = -1; - public int UnitIndex - { - get { return _UnitIndex; } - set { _UnitIndex = value; } - } - //end jcb multiunit - #endregion - #region Factory Methods - private vlnTreeEventArgs() { ;} - public vlnTreeEventArgs(TreeNode node) - { - _Node = node; - } - public vlnTreeEventArgs(TreeNode node, TreeNode destination, int index) - { - _Node = node; - _Destination = destination; - _Index = index; - } - //jcb multiunit - public vlnTreeEventArgs(TreeNode node, TreeNode destination, int index, string unit, int unitIndex) - { - _Node = node; - _Destination = destination; - _Index = index; - _Unit = unit; - _UnitIndex = unitIndex; - } - //end jcb multiunit - #endregion - } - public partial class vlnTreeItemInfoEventArgs - { - #region Business Methods - private ItemInfo _MyItemInfo; - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - set { _MyItemInfo = value; } - } - #endregion - #region Factory Methods - private vlnTreeItemInfoEventArgs() { ;} - public vlnTreeItemInfoEventArgs(ItemInfo myItemInfo) - { - _MyItemInfo = myItemInfo; - } - #endregion - } - public enum E_InsertType {Before, After, Child}; - public partial class vlnTreeItemInfoInsertEventArgs - { - #region Business Methods - private ItemInfo _MyItemInfo; - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - set { _MyItemInfo = value; } - } - private E_InsertType _InsertType; - public E_InsertType InsertType - { - get { return _InsertType; } - set { _InsertType = value; } - } - private int _Type; - public int Type - { - get { return _Type; } - set { _Type = value; } - } - private E_FromType _FromType; - public E_FromType FromType - { - get { return _FromType; } - set { _FromType = value; } - } - private string _StepText; - public string StepText - { - get { return _StepText; } - set { _StepText = value; } - } - #endregion - #region Factory Methods - private vlnTreeItemInfoInsertEventArgs() { ;} - public vlnTreeItemInfoInsertEventArgs(ItemInfo myItemInfo, E_InsertType insertType, string stepText) - { - _MyItemInfo = myItemInfo; - _InsertType = insertType; - _StepText = stepText; - } - public vlnTreeItemInfoInsertEventArgs(ItemInfo myItemInfo, E_InsertType insertType, string stepText, int type, E_FromType fromType) - { - _MyItemInfo = myItemInfo; - _InsertType = insertType; - _StepText = stepText; - _Type = type; - _FromType = fromType; - } - #endregion - } - #region PasteEventArgs - public partial class vlnTreeItemInfoPasteEventArgs - { - #region Business Methods - private ItemInfo _MyItemInfo; - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - set { _MyItemInfo = value; } - } - private int _CopyStartID; - public int CopyStartID - { - get { return _CopyStartID; } - set { _CopyStartID = value; } - } - private ItemInfo.EAddpingPart _PasteType; - public ItemInfo.EAddpingPart PasteType - { - get { return _PasteType; } - set { _PasteType = value; } - } - private int? _Type; - public int? Type - { - get { return _Type; } - set { _Type = value; } - } - #endregion - #region Factory Methods - private vlnTreeItemInfoPasteEventArgs() { ;} - public vlnTreeItemInfoPasteEventArgs(ItemInfo myItemInfo, int copyStartId, ItemInfo.EAddpingPart pasteType, int? type) - { - _MyItemInfo = myItemInfo; - _CopyStartID = copyStartId; - _PasteType = pasteType; - _Type = type; - } - - #endregion - } - #endregion - public partial class vlnTreePropertyEventArgs : EventArgs - { - private string _Title; - public string Title - { - get { return _Title; } - set { _Title = value; } - } - private object _ConfigObject; - public object ConfigObject - { - get { return _ConfigObject; } - set { _ConfigObject = value; } - } - private FolderConfig _FolderConfig; - public FolderConfig FolderConfig - { - get { return _FolderConfig; } - set { _ConfigObject = _FolderConfig = value; } - } - private DocVersionConfig _DocVersionConfig; - public DocVersionConfig DocVersionConfig - { - get { return _DocVersionConfig; } - set { _ConfigObject = _DocVersionConfig = value; } - } - private ProcedureConfig _ProcedureConfig; - public ProcedureConfig ProcedureConfig - { - get { return _ProcedureConfig; } - set { _ConfigObject = _ProcedureConfig = value; } - } - private SectionConfig _SectionConfig; - public SectionConfig SectionConfig - { - get { return _SectionConfig; } - set { _ConfigObject = _SectionConfig = value; } - } - private vlnTreePropertyEventArgs() { ;} - public vlnTreePropertyEventArgs(string title, FolderConfig folderConfig) - { - _Title = title; - FolderConfig = folderConfig; - } - public vlnTreePropertyEventArgs(string title, DocVersionConfig docVersionConfig) - { - _Title = title; - DocVersionConfig = docVersionConfig; - } - public vlnTreePropertyEventArgs(string title, ProcedureConfig procedureConfig) - { - _Title = title; - ProcedureConfig = procedureConfig; - } - public vlnTreePropertyEventArgs(string title, SectionConfig sectionConfig) - { - _Title = title; - DocStyleListConverter.MySection = sectionConfig.MySection; - SectionConfig = sectionConfig; - } - } - #endregion - public partial class vlnTreeView : TreeView - { - private SessionInfo _MySessionInfo; - public SessionInfo MySessionInfo - { - get { return _MySessionInfo; } - set { _MySessionInfo = value; } - } - #region Local Vars - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - - FolderInfo _LastFolderInfo = null; - ProcedureInfo _LastProcedureInfo = null; - DocVersionInfo _LastDocVersionInfo = null; - SectionInfo _LastSectionInfo = null; - VETreeNode _LastTreeNode = null; - StepInfo _LastStepInfo = null; - ItemInfo _LastItemInfo = null; - #endregion - #region Events - public event vlnTreeViewPdfEvent ViewPDF; - private void OnViewPDF(object sender, vlnTreeViewPdfArgs args) - { - if (ViewPDF != null) ViewPDF(sender, args); - } - public event vlnTreeViewItemInfoDeleteEvent DeleteItemInfo; - private bool OnDeleteItemInfo(object sender, vlnTreeItemInfoEventArgs args) - { - if (DeleteItemInfo != null) return DeleteItemInfo(sender, args); - return false; - } - public event vlnTreeViewItemInfoInsertEvent InsertItemInfo; - private bool OnInsertItemInfo(object sender, vlnTreeItemInfoInsertEventArgs args) - { - if (InsertItemInfo != null) return InsertItemInfo(sender, args); - return false; - } - public event vlnTreeViewItemInfoPasteEvent PasteItemInfo; - private bool OnPasteItemInfo(object sender, vlnTreeItemInfoPasteEventArgs args) - { - if (PasteItemInfo != null) return PasteItemInfo(sender, args); - return false; - } - public event vlnTreeViewEvent NodeMove; - private void OnNodeMove(object sender, vlnTreeEventArgs args) - { - if (NodeMove != null) NodeMove(sender, args); - } - public event vlnTreeViewEvent NodeCopy; - private void OnNodeCopy(object sender, vlnTreeEventArgs args) - { - if (NodeCopy != null) NodeCopy(sender, args); - } - public event vlnTreeViewPropertyEvent NodeOpenProperty; - private DialogResult OnNodeOpenProperty(object sender, vlnTreePropertyEventArgs args) - { - if (NodeOpenProperty != null) return NodeOpenProperty(sender, args); - return DialogResult.Cancel; - } - public event vlnTreeViewPSIEvent NodePSI; - private DialogResult OnNodePSI(object sender, vlnTreeEventArgs args) - { - if (NodePSI != null) return NodePSI(sender, args); - return DialogResult.Cancel; - } - public event vlnTreeViewEvent NodeSelect; - private void OnNodeSelect(object sender, vlnTreeEventArgs args) - { - if (NodeSelect != null) NodeSelect(sender, args); - } - public event vlnTreeViewEvent PrintProcedure; - private void OnPrintProcedure(object sender, vlnTreeEventArgs args) - { - if (PrintProcedure != null) PrintProcedure(sender, args); - } - public event vlnTreeViewEvent PrintAllProcedures; - private void OnPrintAllProcedures(object sender, vlnTreeEventArgs args) - { - if (PrintAllProcedures != null) PrintAllProcedures(sender, args); - } - public event vlnTreeViewEvent ApproveProcedure; - private void OnApproveProcedure(object sender, vlnTreeEventArgs args) - { - if (ApproveProcedure != null) ApproveProcedure(sender, args); - } - public event vlnTreeViewEvent ApproveAllProcedures; - private void OnApproveAllProcedures(object sender, vlnTreeEventArgs args) - { - if (ApproveAllProcedures != null) ApproveAllProcedures(sender, args); - } - public event vlnTreeViewEvent ApproveSomeProcedures; - private void OnApproveSomeProcedures(object sender, vlnTreeEventArgs args) - { - if (ApproveSomeProcedures != null) ApproveSomeProcedures(sender, args); - } - public event vlnTreeViewEvent ReportAllProceduresInconsistencies; - private void OnReportAllProceduresInconsistencies(object sender, vlnTreeEventArgs args) - { - if (ReportAllProceduresInconsistencies != null) ReportAllProceduresInconsistencies(sender, args); - } - public event vlnTreeViewEvent RefreshCheckedOutProcedures; - private void OnRefreshCheckedOutProcedures(object sender, vlnTreeEventArgs args) - { - if (RefreshCheckedOutProcedures != null) RefreshCheckedOutProcedures(sender, args); - } - public event vlnTreeViewEvent ProcedureCheckedOutTo; - private void OnProcedureCheckedOutTo(object sender, vlnTreeEventArgs args) - { - if (ProcedureCheckedOutTo != null) ProcedureCheckedOutTo(sender, args); - } - public event vlnTreeViewEvent NodeNew; - private void OnNodeNew(object sender, vlnTreeEventArgs args) - { - if (NodeNew != null) NodeNew(sender, args); - } - /// - /// Raised after a new step is added. - /// - public event vlnTreeViewEvent NodeInsert; - private void OnNodeInsert(object sender, vlnTreeEventArgs args) - { - if (NodeInsert != null) NodeInsert(sender, args); - } - public event vlnTreeViewEvent NodeSelectionChange; - private void OnNodeSelectionChange(object sender, vlnTreeEventArgs args) - { - if (NodeSelectionChange != null) NodeSelectionChange(sender, args); - } - public event vlnTreeViewSectionInfoEvent SectionShouldClose; - private void OnSectionShouldClose(object sender, vlnTreeSectionInfoEventArgs args) - { - if (SectionShouldClose != null) SectionShouldClose(sender, args); - } - public event WordSectionDeletedEvent WordSectionDeleted; - internal void OnWordSectionDeleted(object sender, WordSectionEventArgs args) - { - WordSectionDeleted(sender, args); - } - public event vlnTreeViewItemInfoEvent OpenItem; - private void OnOpenItem(object sender, vlnTreeItemInfoEventArgs args) - { - if (OpenItem != null) OpenItem(sender, args); - } - #endregion - #region Constructors - public vlnTreeView() - { - InitializeComponent(); - this.AllowDrop = true; - DragHelper.InitCommonControls(); - this.ItemDrag += new ItemDragEventHandler(tv_ItemDrag); - this.DragDrop += new DragEventHandler(tv_DragDrop); - this.DragEnter += new DragEventHandler(tv_DragEnter); - this.DragLeave += new EventHandler(tv_DragLeave); - this.DragOver += new DragEventHandler(tv_DragOver); - this.MouseDown += new MouseEventHandler(tv_MouseDown); - this.KeyPress += new KeyPressEventHandler(tv_KeyPress); - base.AfterSelect += new TreeViewEventHandler(tv_AfterSelect); - } - #endregion - #region MenuSupport - private void tv_AfterSelect(object sender, TreeViewEventArgs e) - { - if (!_AdjustingTree) - OnNodeSelectionChange(sender, new vlnTreeEventArgs(e.Node)); - } - // use to determine which menu items have been selected for those tree nodes - - // that allow more than one type of operation associated with their selection. - public enum MenuSelections : int - { - Folder = 1, FolderBefore = 2, FolderAfter = 3, DocVersion = 4, Procedure = 5, ProcedureBefore = 6, ProcedureAfter = 7, Section = 8, SectionBefore = 9, SectionAfter = 10, Step = 11, StepBefore = 12, StepAfter = 13, StepReplace = 14 - } - void tv_MouseDown(object sender, MouseEventArgs e) - { - if (e.Button == MouseButtons.Right) - { - OwnerInfoList oil = null; - OwnerInfo oi = null; - VETreeNode tn = this.GetNodeAt(new Point(e.X, e.Y)) as VETreeNode; - if (tn != null) - { - this.SelectedNode = tn as TreeNode; - Application.DoEvents(); - // Display Menu - ToolStripMenuItem mi = new ToolStripMenuItem(); - ContextMenu cm = new ContextMenu(); - UserInfo ui = UserInfo.GetByUserID(VlnSettings.UserID); - if (ui == null) - { - MessageBox.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", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; - } - #region Menu_New - if (tn.VEObject as FolderInfo != null) - { - // For Folders, if no children, can add either docversion or folder. If children are - // folders then can only add another folder, and if children are docversions can only - // add docversion. - FolderInfo fi = tn.VEObject as FolderInfo; - if (ui.IsAdministrator() || ui.IsSetAdministrator(fi)) - { - if (fi.MyParent != null) // don't allow insert before/after if at top node - { - cm.MenuItems.Add("Insert Folder Before", new EventHandler(mi_Click)); - cm.MenuItems.Add("Insert Folder After", new EventHandler(mi_Click)); - } - if (fi.FolderDocVersionCount == 0) cm.MenuItems.Add("New Folder", new EventHandler(mi_Click)); - if (fi.ChildFolderCount == 0 && !fi.HasWorkingDraft) cm.MenuItems.Add("Create Working Draft", new EventHandler(mi_Click)); - } - } - else if (tn.VEObject as DocVersionInfo != null) // DocVersions can only contain procs - { - DocVersionInfo dvi = tn.VEObject as DocVersionInfo; - if (ui.IsAdministrator() || ui.IsSetAdministrator(dvi) || ui.IsWriter(dvi)) - { - OwnerInfoList.Reset(); - oil = OwnerInfoList.GetByVersionID(dvi.VersionID); - cm.MenuItems.Add("Refresh Checked Out Procedures", new EventHandler(mi_Click)); - cm.MenuItems.Add("New Procedure", new EventHandler(mi_Click)); - if (dvi.MultiUnitCount > 1) - { - MenuItem mip = new MenuItem("Print All Procedures for"); - MenuItem mia = new MenuItem("Approve All Procedures for"); - MenuItem mis = new MenuItem("Approve Some Procedures for"); - int k = 0; - foreach (string s in dvi.UnitNames) - { - k++; - MenuItem mp = mip.MenuItems.Add(s, new EventHandler(miMultiUnit_Click)); - mp.Tag = k; - MenuItem ma = mia.MenuItems.Add(s, new EventHandler(miMultiUnit_Click)); - ma.Tag = k; - MenuItem ms = mis.MenuItems.Add(s, new EventHandler(miMultiUnit_Click)); - ms.Tag = k; - } - //MenuItem mmp = mip.MenuItems.Add("All Units", new EventHandler(miMultiUnit_Click)); - //mmp.Tag = 0; - //MenuItem mma = mia.MenuItems.Add("All Units", new EventHandler(miMultiUnit_Click)); - //mma.Tag = 0; - //MenuItem mms = mis.MenuItems.Add("All Units", new EventHandler(miMultiUnit_Click)); - //mms.Tag = 0; - cm.MenuItems.Add(mip); - cm.MenuItems.Add(mia); - cm.MenuItems.Add(mis); - } - else - { - cm.MenuItems.Add("Print All Procedures", new EventHandler(mi_Click)); - cm.MenuItems.Add("Approve All Procedures", new EventHandler(mi_Click)); - cm.MenuItems.Add("Approve Some Procedures", new EventHandler(mi_Click)); - } - cm.MenuItems.Add("Report All Procedures Inconsistencies", new EventHandler(mi_Click)); - } - else - { - OwnerInfoList.Reset(); - oil = OwnerInfoList.GetByVersionID(dvi.VersionID); - cm.MenuItems.Add("Refresh Checked Out Procedures", new EventHandler(mi_Click)); - if (dvi.MultiUnitCount > 1) - { - MenuItem mip = new MenuItem("Print All Procedures for"); - int k = 0; - foreach (string s in dvi.UnitNames) - { - k++; - MenuItem mp = mip.MenuItems.Add(s, new EventHandler(miMultiUnit_Click)); - mp.Tag = k; - } - //MenuItem mmp = mip.MenuItems.Add("All Units", new EventHandler(miMultiUnit_Click)); - //mmp.Tag = 0; - //MenuItem mma = mia.MenuItems.Add("All Units", new EventHandler(miMultiUnit_Click)); - //mma.Tag = 0; - //MenuItem mms = mis.MenuItems.Add("All Units", new EventHandler(miMultiUnit_Click)); - //mms.Tag = 0; - cm.MenuItems.Add(mip); - } - else - { - cm.MenuItems.Add("Print All Procedures", new EventHandler(mi_Click)); - } - } - //if (ui.IsAdministrator() || ui.IsSetAdministrator(dvi)) - //{ - // cm.MenuItems.Add("Check Out Procedure Set", new EventHandler(mi_Click)); - // cm.MenuItems.Add("Check In Procedure Set", new EventHandler(mi_Click)); - //} - if (ui.IsAdministrator() || ui.IsSetAdministrator(dvi) || ui.IsROEditor(dvi)) - { - cm.MenuItems.Add("Run RO Editor", new EventHandler(mi_Click)); - } - if (ui.IsAdministrator() || ui.IsSetAdministrator(dvi)) - { - MenuItem urv = cm.MenuItems.Add("Update RO Values", new EventHandler(mi_Click)); - urv.Enabled = dvi.NewerRoFst; - } - } - else if (tn.VEObject as ProcedureInfo != null) // Procs can only contain sections - { - ProcedureInfo pri = tn.VEObject as ProcedureInfo; - oi = OwnerInfo.GetByItemID(pri.ItemID, CheckOutType.Procedure); - if (ui.IsAdministrator() || ui.IsSetAdministrator(pri.MyDocVersion) || ui.IsWriter(pri.MyDocVersion)) - { - if (oi != null && oi.SessionID != MySessionInfo.SessionID) - cm.MenuItems.Add(string.Format("Procedure Checked Out to {0}", oi.SessionUserID), new EventHandler(mi_Click)); - if (pri.ActiveFormat.PlantFormat.FormatData.ProcData.PSI.Caption != null) cm.MenuItems.Add("Procedure Specific Information", new EventHandler(mi_Click)); - cm.MenuItems.Add("Insert Procedure Before", new EventHandler(mi_Click)); - cm.MenuItems.Add("Insert Procedure After", new EventHandler(mi_Click)); - - // if this format has change ids that were added from edit, allow removal of - // change ids for this procedure: - FolderInfo fi = FolderInfo.Get(1); - FormatInfo frmI = FormatInfo.Get(fi.FormatID ?? 1); - if (frmI.PlantFormat.FormatData.ProcData.ChangeBarData.ChgBarMessageFromEdit) - cm.MenuItems.Add("Remove Change Ids", new EventHandler(mi_Click)); - cm.MenuItems.Add("New Section", new EventHandler(mi_Click)); - if (pri.MyDocVersion.MultiUnitCount > 1) - { - MenuItem mip = new MenuItem("Print"); - MenuItem mia = new MenuItem("Approve"); - int k = 0; - foreach (string s in pri.MyDocVersion.UnitNames) - { - k++; - MenuItem mp = mip.MenuItems.Add(s, new EventHandler(miMultiUnit_Click)); - mp.Tag = k; - MenuItem ma = mia.MenuItems.Add(s, new EventHandler(miMultiUnit_Click)); - ma.Tag = k; - } - cm.MenuItems.Add(mip); - cm.MenuItems.Add(mia); - AddApprovedRevisionsMultiUnit(cm.MenuItems, pri); - } - else - { - cm.MenuItems.Add("Print", new EventHandler(mi_Click)); - cm.MenuItems.Add("Approve", new EventHandler(mi_Click)); - AddApprovedRevisions(cm.MenuItems, pri); - } - } - else - { - if (oi != null && oi.SessionID != MySessionInfo.SessionID) - cm.MenuItems.Add(string.Format("Procedure Checked Out to {0}", oi.SessionUserID), new EventHandler(mi_Click)); - if (pri.MyDocVersion.MultiUnitCount > 1) - { - MenuItem mip = new MenuItem("Print"); - int k = 0; - foreach (string s in pri.MyDocVersion.UnitNames) - { - k++; - MenuItem mp = mip.MenuItems.Add(s, new EventHandler(miMultiUnit_Click)); - mp.Tag = k; - } - cm.MenuItems.Add(mip); - AddApprovedRevisionsMultiUnit(cm.MenuItems, pri); - } - else - { - cm.MenuItems.Add("Print", new EventHandler(mi_Click)); - AddApprovedRevisions(cm.MenuItems, pri); - } - } - } - else if (tn.VEObject as SectionInfo != null) - { - // A step Section can contain other steps or can contain subsections (either step section - // or word doc section). Also note that there can be a mix. - // A word doc section can contain another subsection (either step section or word doc section), - // but cannot contain steps. - SectionInfo si = tn.VEObject as SectionInfo; - if (ui.IsAdministrator() || ui.IsSetAdministrator(si.MyProcedure.MyDocVersion) || ui.IsWriter(si.MyProcedure.MyDocVersion)) - { - if (si.HasWordContent) - { - oi = OwnerInfo.GetByItemID(si.MyContent.MyEntry.DocID, CheckOutType.Document); - } - si.MyConfig = null; - // Do not need step versus Word doc options, user enters this in property page during - // insert process. - if (oi != null && oi.SessionID != MySessionInfo.SessionID) - cm.MenuItems.Add(string.Format("Document Checked Out to {0}", oi.SessionUserID), new EventHandler(mi_Click)); - cm.MenuItems.Add("Insert Section Before", new EventHandler(mi_Click)); - cm.MenuItems.Add("Insert Section After", new EventHandler(mi_Click)); - if (!si.IsAutoTOCSection) - { - bool meta = si.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections; - if (meta) cm.MenuItems.Add("New Subsection", new EventHandler(mi_Click)); - // if this section has subsections, then be sure that the 'editable' data config - // is set to allow new step creation. - if (si.IsStepSection) - { - SectionConfig sc = si.MyConfig as SectionConfig; - if (si.Sections == null || si.Sections.Count == 0 || (meta && sc != null && si.Sections != null && si.Sections.Count > 0 && sc.SubSection_Edit == "Y")) - cm.MenuItems.Add("New Step", new EventHandler(mi_Click)); - } - } - } - } - else if (tn.VEObject as StepInfo != null) - { - // check the format for allowable inserts, and also, - ItemInfo i = tn.VEObject as ItemInfo; - if (ui.IsAdministrator() || ui.IsSetAdministrator(i.MyProcedure.MyDocVersion) || ui.IsWriter(i.MyProcedure.MyDocVersion)) - { - //oi = OwnerInfo.GetByItemID(i.MyProcedure.ItemID); - if (AddToInsertMenu(i, 0)) cm.MenuItems.Add("Insert Step Before", new EventHandler(mi_Click)); - if (AddToInsertMenu(i, 1)) cm.MenuItems.Add("Insert Step After", new EventHandler(mi_Click)); - } - } - #endregion - #region Menu_Open - if (!tn.IsExpanded && tn.VEObject as SectionInfo != null) - { - SectionInfo si = tn.VEObject as SectionInfo; - if (si.IsStepSection) cm.MenuItems.Add("Open", new EventHandler(mi_Click)); - } - else if (!tn.IsExpanded && tn.VEObject as StepInfo != null) - { - StepInfo stpi = tn.VEObject as StepInfo; - if (stpi.HasChildren) cm.MenuItems.Add("Open", new EventHandler(mi_Click)); - } - else if (!tn.IsExpanded) - cm.MenuItems.Add("Open", new EventHandler(mi_Click)); - #endregion - #region Menu_CutCopy - // For initial release, copy is not available for folders or docversions - if (tn.VEObject as ItemInfo != null) - { - ItemInfo i = tn.VEObject as ItemInfo; - if (ui.IsAdministrator() || ui.IsSetAdministrator(i.MyProcedure.MyDocVersion) || ui.IsWriter(i.MyProcedure.MyDocVersion)) - cm.MenuItems.Add("Copy", new EventHandler(mi_Click)); - } - #endregion - bool ok = false; - if (tn.VEObject is FolderInfo && (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as FolderInfo))) - ok = true; - else if (tn.VEObject is DocVersionInfo && (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as DocVersionInfo))) - ok = true; - else if (tn.VEObject is ItemInfo && (ui.IsAdministrator() || ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion) || ui.IsWriter((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion))) - ok = true; - if(ok) - Menu_Paste(tn, cm); - #region Menu_Delete - if (ok) - { - // Add delete to the menu unless at the very 'top' node, on a grouping (partinfo) - // node (RNOs, Steps, Cautions, Notes) or Folder/DocVersion that contains any items. - PartInfo pi = tn.VEObject as PartInfo; - if (pi == null && tn.Parent != null) // it's not a part and it's not the top.... - { - FolderInfo fi = tn.VEObject as FolderInfo; - if (fi == null || tn.Nodes.Count == 0) // it's not a folder or it has no children - { - DocVersionInfo di = tn.VEObject as DocVersionInfo; - if (di == null || tn.Nodes.Count == 0) // it's not a docversion or it has no children - cm.MenuItems.Add("Delete", new EventHandler(mi_Click)); - } - } - } - #endregion - #region Menu_Properties - // Add Properties to the menu unless at the very 'top' node or on a grouping (partinfo) - // node (RNOs, Steps, Cautions, Notes) or at the step level. - ok = tn.VEObject as FolderInfo != null ? ui.IsAdministrator() : tn.VEObject as DocVersionInfo != null ? (ui.IsAdministrator() || ui.IsSetAdministrator(tn.VEObject as DocVersionInfo)) : (ui.IsAdministrator() || ui.IsSetAdministrator((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion) || ui.IsWriter((tn.VEObject as ItemInfo).MyProcedure.MyDocVersion)); - PartInfo pia = tn.VEObject as PartInfo; - ItemInfo ii = tn.VEObject as ItemInfo; - if (ok) - if (pia == null && tn.VEObject as StepInfo == null) cm.MenuItems.Add("Properties...", new EventHandler(mi_Click)); - #endregion - if (oil != null && oil.Count > 0 && tn.VEObject as DocVersionInfo != null) - { - /* - --docversion level - Approve All Procedures - Report All Procedures Inconsistencies - */ - bool greyOut = false; - foreach (OwnerInfo own in oil) - { - if (own.SessionID != MySessionInfo.SessionID) - { - greyOut = true; - break; - } - } - if (greyOut) - { - foreach (MenuItem itm in cm.MenuItems) - { - if (itm.Text == "Approve All Procedures" || itm.Text == "Report All Procedures Inconsistencies") - itm.Enabled = false; - } - } - } - if (oi != null && oi.SessionID != MySessionInfo.SessionID) - { - /* - --procedure level - Procedure Specific Information - New Section - Approve - Open - Copy - Delete - Properties... - - --section level - all of them - - --step level - all of them - */ - if (tn.VEObject as ProcedureInfo != null) - { - foreach (MenuItem itm in cm.MenuItems) - { - if(itm.Text == "Procedure Specific Information" || itm.Text == "New Section" || itm.Text == "Approve" || itm.Text == "Open" || - itm.Text == "Copy" || itm.Text == "Delete" || itm.Text == "Properties..." || itm.Text == "Replace Existing Procedure") - itm.Enabled = false; - } - } - if (tn.VEObject as SectionInfo != null || tn.VEObject as StepInfo != null) - { - foreach (MenuItem itm in cm.MenuItems) - { - if(!itm.Text.StartsWith("Document Checked Out")) - itm.Enabled = false; - } - } - } - cm.Show(this, new Point(e.X, e.Y)); - } - } - } - - private void AddApprovedRevisionsMultiUnit(Menu.MenuItemCollection menuItemCollection, ProcedureInfo pri) - { - RevisionInfoList ril = RevisionInfoList.GetByItemID(pri.ItemID); - if (ril.Count == 0) return; - MenuItem mi = menuItemCollection.Add("Versions"); - int k = 0; - int lastApprovedRevisionID = 0; - foreach (string s in pri.MyDocVersion.UnitNames) - { - k++; - MenuItem mv = mi.MenuItems.Add(s); - mv.Tag = k; - ril = RevisionInfoList.GetByItemIDandUnitID(pri.ItemID, k); - foreach (RevisionInfo ri in ril) - { - MenuItem mir = mv.MenuItems.Add(ri.ToString()); - mir.Tag = ri; - if (ri.LatestVersion.MyStage.IsApproved > 0 && (ri.RevisionID > lastApprovedRevisionID)) - lastApprovedRevisionID = ri.RevisionID; - if (ri.LatestVersion.PDF != null) - { - MenuItem mirp = mir.MenuItems.Add("View Procedure"); - mirp.Tag = ri; - mirp.Click += new EventHandler(MultiUnitApprovedRevision_Click); - } - if (ri.LatestVersion.SummaryPDF != null) - { - MenuItem mirs = mir.MenuItems.Add("View Summary of Changes"); - mirs.Tag = ri; - mirs.Click += new EventHandler(MultiUnitSummaryOfChanges_Click); - } - //end added jcb 20111031 - mv.Tag = lastApprovedRevisionID; - } - } - } - - private void AddApprovedRevisions(Menu.MenuItemCollection menuItemCollection, ProcedureInfo pri) - { - RevisionInfoList ril = null; - try - { - ril = RevisionInfoList.GetByItemID(pri.ItemID); - } - catch - { - return; - } - if (ril.Count == 0) return; - MenuItem mi = menuItemCollection.Add("Versions"); - int lastApprovedRevisionID = 0; - foreach (RevisionInfo ri in ril) - { - MenuItem mir = mi.MenuItems.Add(ri.ToString()); - mir.Tag = ri; - if (ri.LatestVersion.MyStage.IsApproved > 0 && (ri.RevisionID > lastApprovedRevisionID)) - lastApprovedRevisionID = ri.RevisionID; - //mir.Click += new EventHandler(ApprovedRevision_Click); - //added jcb 20111031 - if (ri.LatestVersion.PDF != null) - { - MenuItem mirp = mir.MenuItems.Add("View Procedure"); - mirp.Tag = ri; - mirp.Click += new EventHandler(ApprovedRevision_Click); - } - if (ri.LatestVersion.SummaryPDF != null) - { - MenuItem mirs = mir.MenuItems.Add("View Summary of Changes"); - mirs.Tag = ri; - mirs.Click += new EventHandler(SummaryOfChanges_Click); - } - //end added jcb 20111031 - mi.Tag = lastApprovedRevisionID; - } - } - - void ApprovedRevision_Click(object sender, EventArgs e) - { - bool superceded = false; - MenuItem mi = sender as MenuItem; - if (mi == null) return; - RevisionInfo ri = mi.Tag as RevisionInfo; - { - MenuItem mip = mi.Parent as MenuItem; - if (ri.RevisionID < int.Parse(mip.Parent.Tag.ToString())) - superceded = true; - } - vlnTreeViewPdfArgs args = new vlnTreeViewPdfArgs(Volian.Base.Library.TmpFile.CreateFileName(ProcedureInfo.Get(ri.ItemID).PDFNumber), ri.LatestVersion.PDF, superceded ? "Superceded" : ""); - OnViewPDF(sender, args); -// System.Diagnostics.Process pp = System.Diagnostics.Process.Start(GetDocPdf(ri, superceded)); - } - void MultiUnitApprovedRevision_Click(object sender, EventArgs e) - { - bool superceded = false; - MenuItem mi = sender as MenuItem; - if (mi == null) return; - RevisionInfo ri = mi.Tag as RevisionInfo; - { - MenuItem mip = mi.Parent as MenuItem; - if (ri.RevisionID < int.Parse(mip.Parent.Tag.ToString())) - superceded = true; - } - ItemInfo ii = ItemInfo.Get(ri.ItemID); - ii.MyDocVersion.DocVersionConfig.SelectedSlave = ri.MyConfig.Applicability_Index; - vlnTreeViewPdfArgs args = new vlnTreeViewPdfArgs(Volian.Base.Library.TmpFile.CreateFileName(ProcedureInfo.Get(ri.ItemID).PDFNumber), ri.LatestVersion.PDF, superceded ? "Superceded" : ""); - OnViewPDF(sender, args); - // System.Diagnostics.Process pp = System.Diagnostics.Process.Start(GetDocPdf(ri, superceded)); - } - void SummaryOfChanges_Click(object sender, EventArgs e) - { - MenuItem mi = sender as MenuItem; - if (mi == null) return; - RevisionInfo ri = mi.Tag as RevisionInfo; - vlnTreeViewPdfArgs args = new vlnTreeViewPdfArgs(Volian.Base.Library.TmpFile.CreateFileName(ProcedureInfo.Get(ri.ItemID).PDFNumber + " Summary of Changes"), ri.LatestVersion.SummaryPDF, ""); - OnViewPDF(sender, args); - // System.Diagnostics.Process pps = System.Diagnostics.Process.Start(GetDocSummaryPdf(ri)); - } - void MultiUnitSummaryOfChanges_Click(object sender, EventArgs e) - { - MenuItem mi = sender as MenuItem; - if (mi == null) return; - RevisionInfo ri = mi.Tag as RevisionInfo; - ItemInfo ii = ItemInfo.Get(ri.ItemID); - ii.MyDocVersion.DocVersionConfig.SelectedSlave = ri.MyConfig.Applicability_Index; - vlnTreeViewPdfArgs args = new vlnTreeViewPdfArgs(Volian.Base.Library.TmpFile.CreateFileName(ProcedureInfo.Get(ri.ItemID).PDFNumber + " Summary of Changes"), ri.LatestVersion.SummaryPDF, ""); - OnViewPDF(sender, args); - // System.Diagnostics.Process pps = System.Diagnostics.Process.Start(GetDocSummaryPdf(ri)); - } - //private string GetDocPdf(RevisionInfo ri, bool superceded) - //{ - // string fileName = Volian.Base.Library.TmpFile.CreateFileName(ItemInfo.Get(ri.ItemID).DisplayNumber); - // FileInfo fi = new FileInfo(VlnSettings.TemporaryFolder + @"\" + fileName); - // FileStream fs = fi.Create(); - // byte[] myPdf = ri.LatestVersion.PDF; - // if (myPdf != null) fs.Write(myPdf, 0, myPdf.Length); - // fs.Close(); - // if (superceded) - // AddSupercededWatermark(VlnSettings.TemporaryFolder + @"\" + fileName); - // return VlnSettings.TemporaryFolder + @"\" + fileName; - //} - - //private void AddSupercededWatermark(string p) - //{ - // MessageBox.Show("superceded"); - //} - //private string GetDocSummaryPdf(RevisionInfo ri) - //{ - // string fileName = Volian.Base.Library.TmpFile.CreateFileName(ItemInfo.Get(ri.ItemID).DisplayNumber + " Summary of Changes"); - // FileInfo fi = new FileInfo(VlnSettings.TemporaryFolder + @"\" + fileName); - // FileStream fs = fi.Create(); - // byte[] myPdf = ri.LatestVersion.SummaryPDF; - // if (myPdf != null) fs.Write(myPdf, 0, myPdf.Length); - // fs.Close(); - // return VlnSettings.TemporaryFolder + @"\" + fileName; - //} - - - private bool AddToInsertMenu(ItemInfo ii, int ba) // 0 = before, 1 = after - { - // set up insert buttons based on format - bool retB = true; - E_AccStep? actable = 0; - StepData sd = ii.FormatStepData; - actable = sd.StepEditData.AcTable; - if (actable == null) actable = 0; - - return (ba == 0) ? !ii.IsRNOPart && (actable & E_AccStep.AddingPrev) > 0 : - !ii.IsRNOPart && (actable & E_AccStep.AddingNext) > 0; - } - private void Menu_Paste(VETreeNode tn, ContextMenu cm) - { - #region MenuPaste - // Find what's in paste buffer & determine whether the paste can occur for the selected node. - object tmpClip = Clipboard.GetData("PromsClipboard"); - if (tmpClip != null) - { - PromsClipboard tstClip = (PromsClipboard)tmpClip; - ItemInfo iiClipboard = ItemInfo.Get(tstClip.itemId); - // if the item doesn't exist anymore, don't allow the paste, by not adding - // paste menu items to context menu. - if (iiClipboard == null) - { - Clipboard.Clear(); - return; - } - // can it be pasted at current node. - if (tn.VEObject as DocVersionInfo != null) // paste item must be a proc - { - if (iiClipboard.IsProcedure) cm.MenuItems.Add("Paste Procedure", new EventHandler(mi_Click)); - } - else - { - ItemInfo iiPasteHere = tn.VEObject as ItemInfo; - if (iiPasteHere != null) - { - if (iiPasteHere.IsProcedure && iiClipboard.IsProcedure) // procedure can be pasted before/replace/after - { - cm.MenuItems.Add("Paste Procedure Before", new EventHandler(mi_Click)); - cm.MenuItems.Add("Replace Existing Procedure", new EventHandler(mi_Click)); - cm.MenuItems.Add("Paste Procedure After", new EventHandler(mi_Click)); - } - else if (iiPasteHere.IsProcedure && iiClipboard.IsSection) // procedure must have sections only - cm.MenuItems.Add("Paste Section", new EventHandler(mi_Click)); - else if (iiPasteHere.IsSection && iiClipboard.IsSection) - { - cm.MenuItems.Add("Paste Section Before", new EventHandler(mi_Click)); - cm.MenuItems.Add("Replace Existing Section", new EventHandler(mi_Click)); - cm.MenuItems.Add("Paste Section After", new EventHandler(mi_Click)); - } - else if (iiPasteHere.IsStepSection && iiClipboard.IsStep) - cm.MenuItems.Add("Paste Step", new EventHandler(mi_Click)); - else if (iiPasteHere.IsStep && iiClipboard.IsStep) - { - if (AddToInsertMenu(iiPasteHere, 0)) cm.MenuItems.Add("Paste Step Before", new EventHandler(mi_Click)); - cm.MenuItems.Add("Replace Existing Step", new EventHandler(mi_Click)); - if (AddToInsertMenu(iiPasteHere, 1)) cm.MenuItems.Add("Paste Step After", new EventHandler(mi_Click)); - } - } - } - } - #endregion - } - //jcb multiunit - void miMultiUnit_Click(object sender, EventArgs e) - { - MenuItem mi = sender as MenuItem; - MenuItem mip = mi.Parent as MenuItem; - switch (mip.Text) - { - case "Print": - OnPrintProcedure(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag)); - break; - case "Print All Procedures for": - OnPrintAllProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0,mi.Text,(int)mi.Tag)); - break; - case "Approve": - OnApproveProcedure(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag)); - break; - case "Approve All Procedures for": - OnApproveAllProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag)); - break; - case "Approve Some Procedures for": - OnApproveSomeProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0, mi.Text, (int)mi.Tag)); - break; - default: - MessageBox.Show(string.Format("Unrecognized Menu Item '{0}'", mip.Text)); - break; - } - } - //end jcb multiunit - void mi_Click(object sender, EventArgs e) - { - MenuItem mi = sender as MenuItem; - if (mi == null) - return; - if (mi.Text.StartsWith("Procedure Checked Out to") || mi.Text.StartsWith("Document Checked Out to")) - { - OnProcedureCheckedOutTo(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); - return; - } - switch (mi.Text) - { - case "Open": - OpenNode(); - break; - case "Insert Folder Before": - tv_NodeNew(MenuSelections.FolderBefore); - break; - case "Insert Folder After": - tv_NodeNew(MenuSelections.FolderAfter); - break; - case "New Folder": - SelectedNode.Expand(); - tv_NodeNew(MenuSelections.Folder); - break; - case "Create Working Draft": - SelectedNode.Expand(); - tv_NodeNew(MenuSelections.DocVersion); - break; - case "New Procedure": - SelectedNode.Expand(); - tv_NodeNew(MenuSelections.Procedure); - break; - case "Insert Procedure Before": - tv_NodeNew(MenuSelections.ProcedureBefore); - break; - case "Insert Procedure After": - tv_NodeNew(MenuSelections.ProcedureAfter); - break; - case "Remove Change Ids": - tv_RemoveChgIds(); - break; - case "New Section": - case "New Subsection": - SelectedNode.Expand(); - tv_NodeNew(MenuSelections.Section); - break; - case "Insert Section Before": - tv_NodeNew(MenuSelections.SectionBefore); - break; - case "Insert Section After": - tv_NodeNew(MenuSelections.SectionAfter); - break; - case "Insert Step Before": - tv_NodeNew(MenuSelections.StepBefore); - break; - case "Insert Step After": - tv_NodeNew(MenuSelections.StepAfter); - break; - case "New Step": - SelectedNode.Expand(); - tv_NodeNew(MenuSelections.Step); - break; - case "Copy"://Copy the selected node - tv_NodeCopy(); - break; - // lots of paste options: - case "Paste Procedure": - case "Paste Procedure Before": - case "Replace Existing Procedure": - case "Paste Procedure After": - case "Paste Section": - case "Paste Section Before": - case "Replace Existing Section": - case "Paste Section After": - case "Paste Step": - case "Paste Step Before": - case "Replace Existing Step": - case "Paste Step After": - tv_NodePaste(mi.Text); - break; - case "Delete": - if (tv_NodeDelete()) - { - TreeNode myParent = SelectedNode.Parent; - SelectedNode.Remove(); - SelectedNode = myParent; - OnNodeSelect(this, new vlnTreeEventArgs(SelectedNode)); - } - break; - case "Properties..."://Show the properties for the selected node - SetLastValues((VETreeNode)SelectedNode); - SetupNodeProperties(); - break; - case "Procedure Specific Information": - VETreeNode tn = SelectedNode as VETreeNode; - ProcedureInfo pi = tn.VEObject as ProcedureInfo; - if (pi != null) - { - using (Procedure proc = pi.Get()) - { - OnNodePSI(this, new vlnTreeEventArgs(tn, null, 0)); - } - } - break; - case "Print": - OnPrintProcedure(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); - break; - case "Print All Procedures": - OnPrintAllProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); - break; - case "Approve": - OnApproveProcedure(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); - break; - case "Approve All Procedures": - OnApproveAllProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); - break; - case "Approve Some Procedures": - OnApproveSomeProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); - break; - case "Report All Procedures Inconsistencies": - OnReportAllProceduresInconsistencies(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); - break; - case "Refresh Checked Out Procedures": - OnRefreshCheckedOutProcedures(this, new vlnTreeEventArgs(SelectedNode as VETreeNode, null, 0)); - break; - case "Run RO Editor": - RunROEditor(SelectedNode as VETreeNode); - break; - case "Update RO Values": - UpdateROValues(SelectedNode as VETreeNode); - break; - //case "Check Out Procedure Set": - // CheckOutDocVersion(SelectedNode as VETreeNode); - // break; - //case "Check In Procedure Set": - // CheckInDocVersion(SelectedNode as VETreeNode); - // break; - default: - MessageBox.Show(string.Format("Unrecognized Menu Item '{0}'", mi.Text)); - break; - } - } - private void tv_RemoveChgIds() - { - Console.WriteLine("HERE"); // add code/query to clear change ids in config. - } - private Dictionary MyCheckedOutDocVersions; - private void CheckOutDocVersion(VETreeNode tn) - { - if (MyCheckedOutDocVersions == null) - MyCheckedOutDocVersions = new Dictionary(); - DocVersionInfo MyDVI = tn.VEObject as DocVersionInfo; - string message = string.Empty; - if (MySessionInfo.CanCheckOutItem(MyDVI.VersionID, CheckOutType.DocVersion, ref message)) - MyCheckedOutDocVersions.Add(MyDVI.VersionID,MySessionInfo.CheckOutItem(MyDVI.VersionID, CheckOutType.DocVersion)); - else - MessageBox.Show(this, message, "Working Draft Has Items Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - private void CheckInDocVersion(VETreeNode tn) - { - DocVersionInfo MyDVI = tn.VEObject as DocVersionInfo; - MySessionInfo.CheckInItem(MyCheckedOutDocVersions[MyDVI.VersionID]); - MyCheckedOutDocVersions.Remove(MyDVI.VersionID); - } - - private void UpdateROValues(VETreeNode tn) - { - DocVersionInfo MyDVI = tn.VEObject as DocVersionInfo; - // use rodb directory path of the first rofst for the this document version. Later, will need - // to modify code to get which one (when there is more than one) - if (MyDVI.DocVersionAssociations.Count < 1) - { - MessageBox.Show("Error Updating ro.fst. No associated ro.fst"); - return; - } - ROFstInfo roFstInfo = MyDVI.DocVersionAssociations[0].MyROFst; - - string rofstPath = roFstInfo.MyRODb.FolderPath + @"\ro.fst"; - if (!File.Exists(rofstPath)) - { - MessageBox.Show("No existing ro.fst in path " + roFstInfo.MyRODb.FolderPath + ". Check for invalid path"); - return; - } - FileInfo fiRofst = new FileInfo(rofstPath); - if (roFstInfo.DTS == fiRofst.LastWriteTimeUtc) - { - MessageBox.Show("ro.fst files are same for path " + roFstInfo.MyRODb.FolderPath + ", import of that ro.fst will not be done"); - return; - } - if (roFstInfo.DTS > fiRofst.LastWriteTimeUtc) - { - MessageBox.Show("Cannot copy older ro.fst from " + roFstInfo.MyRODb.FolderPath + ", import of that ro.fst will not be done"); - return; - } - Cursor = Cursors.WaitCursor; - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(MyDVI.VersionID, CheckOutType.DocVersion, ref message)) - { - MessageBox.Show(this, message, "Working Draft Has Items Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; - } - int ownerid = MySessionInfo.CheckOutItem(MyDVI.VersionID, CheckOutType.DocVersion); - using (DocVersion dv = DocVersion.Get(MyDVI.VersionID)) - { - roFstInfo.ROTableUpdate += new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); - ROFst newrofst = ROFstInfo.UpdateRoFst(roFstInfo.MyRODb, dv.DocVersionAssociations[0], dv, roFstInfo); - roFstInfo.ROTableUpdate -= new ROFstInfoROTableUpdateEvent(roFstInfo_ROTableUpdate); - StepPanelTabDisplayEventArgs args = new StepPanelTabDisplayEventArgs("DisplayROUpdateROFST"); - } - MySessionInfo.CheckInItem(ownerid); - Cursor = Cursors.Default; - } - public List roFstInfo_ROTableUpdate(object sender, ROFstInfoROTableUpdateEventArgs args) - { - return VlnFlexGrid.ROTableUpdate(sender, args); - //string xml = null; - //string srchtxt = null; - //using (VlnFlexGrid myGrid = new VlnFlexGrid()) - //{ - // using (StringReader sr = new StringReader(args.OldGridXml)) - // { - // myGrid.ReadXml(sr); - // myGrid.KeyActionTab = C1.Win.C1FlexGrid.KeyActionEnum.MoveAcross; - // sr.Close(); - // } - // string roid = myGrid.ROID; - // int rodbid = myGrid.RODbId; - // Font GridFont = myGrid.Font; - // myGrid.Clear(); - // myGrid.ParseTableFromText(args.ROText, GridLinePattern.Single); - // myGrid.AutoSizeCols(); - // myGrid.AutoSizeRows(); - // myGrid.MakeRTFcells(); - // myGrid.RODbId = rodbid; - // myGrid.ROID = roid; - // myGrid.IsRoTable = true; - // using (StringWriter sw = new StringWriter()) - // { - // myGrid.WriteXml(sw); - // xml = sw.GetStringBuilder().ToString(); - // sw.Close(); - // } - // srchtxt = myGrid.GetSearchableText(); - //} - //List retlist = new List(); - //retlist.Add(srchtxt); - //retlist.Add(xml); - //return retlist; - } - - private void RunROEditor(VETreeNode tn) - { - DocVersionInfo MyDVI = tn.VEObject as DocVersionInfo; - if (VlnSettings.ReleaseMode.Equals("DEMO")) - { - MessageBox.Show("Referenced Object Editor not available in the Demo version.", "PROMS Demo Version"); - return; - } - //string roapp = Environment.GetEnvironmentVariable("roapp"); - string roapp = Volian.Base.Library.ExeInfo.GetROEditorPath(); // get the path to the RO Editor Executable - if (roapp == null || roapp == string.Empty) - { - MessageBox.Show("The 'roapp' environment variable needs to be set to the path of the RO Editor\n\n Ex: C:\\VE-PROMS.NET\\Bin\\roeditor.exe", "Environment Variable Error"); - return; - } - if (!File.Exists(roapp)) - { - string errtxt = string.Format("Could not find path to Referenced Objects Editor:\n\n roapp = {0}\n\n Verify the path assigned to the 'roapp' environment variable", roapp); - MessageBox.Show(errtxt, "Environment Variable Error"); - //MessageBox.Show("Could not find path to Ro Editor, check 'roapp' environment variable","Environment Variable Error"); - return; - } - //if (roapp == null) - //{ - // MessageBox.Show("Could not find path to Ro Editor, check 'roapp' environment variable"); - // return; - //} - if (MyDVI == null || MyDVI.DocVersionAssociationCount < 1) - { - MessageBox.Show("Could not find associated path for ro data.", "No RO Data", MessageBoxButtons.OK, MessageBoxIcon.Information); - return; - } - string roloc = "\"" + MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath + "\""; - if (!Directory.Exists(MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath)) - { - MessageBox.Show(string.Format("RO Database directory does not exist: {0}", MyDVI.DocVersionAssociations[0].MyROFst.MyRODb.FolderPath)); - return; - } - System.Diagnostics.Process.Start(roapp, roloc); - } - - [Serializable] - public struct PromsClipboard - { - public int cType; - public int itemId; - } - public enum PromsClipboardType : int - { - Copy = 1, Cut = 2 - } - private void tv_NodePaste(string p) - { - object oClip = Clipboard.GetData("PromsClipboard"); - if (oClip == null) return; - - PromsClipboard iClip = (PromsClipboard) oClip; - ItemInfo iiClipboard = ItemInfo.Get(iClip.itemId); - string message = string.Empty; - if (iiClipboard.MyContent.MyEntry == null) - { - if (!MySessionInfo.CanCheckOutItem(iiClipboard.MyProcedure.ItemID, CheckOutType.Procedure, ref message)) - { - MessageBox.Show(this, message, "Copied Procedure Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; - } - } - else - { - if (!MySessionInfo.CanCheckOutItem(iiClipboard.MyContent.MyEntry.DocID, CheckOutType.Document, ref message)) - { - MessageBox.Show(this, message, "Copied Document Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; - } - } - VETreeNode tn = SelectedNode as VETreeNode; - DocVersionInfo dvi = tn.VEObject as DocVersionInfo; - if (dvi != null) - { - return; - } - - ItemInfo iiPaste = tn.VEObject as ItemInfo; - if (iiPaste == null) return; - if (p.IndexOf("Before") > -1) - PasteBeforeOrAfter(MenuSelections.StepBefore, tn, iiClipboard.ItemID); - else if (p.IndexOf("After") > -1) - PasteBeforeOrAfter(MenuSelections.StepAfter, tn, iiClipboard.ItemID); - else if (p.IndexOf("Replace") > -1) - PasteReplace(tn, iiClipboard.ItemID); - } - private void PasteBeforeOrAfter(MenuSelections newtype, VETreeNode tn, int copyStartID) - { - // If paste-from step is open in the editor, use the OnPasteItemInfo to paste the step and add RTBItems - // to the step editor panel. - ItemInfo ii = tn.VEObject as ItemInfo; - ItemInfo.EAddpingPart pasteOpt = newtype == MenuSelections.StepBefore ? ItemInfo.EAddpingPart.Before : ItemInfo.EAddpingPart.After; - // If parent step is open in step editor, the 'OnPasteItemInfo' event will cause - // the item to be pasted in the step editor and the tree. - if (ii.IsProcedure || !OnPasteItemInfo(this, new vlnTreeItemInfoPasteEventArgs(ii, copyStartID, pasteOpt, ii.MyContent.Type))) - { - // The parent step was not open in the step editor, just paste step (in data) and add treenode. - ItemInfo newItemInfo = null; - if (newtype == MenuSelections.StepBefore) - newItemInfo = ii.PasteSiblingBefore(copyStartID); - else - newItemInfo = ii.PasteSiblingAfter(copyStartID); - } - SelectedNode = (VETreeNode)((newtype == MenuSelections.StepAfter) ? tn.NextNode : tn.PrevNode); - } - private void PasteReplace(VETreeNode tn, int copyStartID) - { - VETreeNode prevtn = (VETreeNode) tn.PrevNode; - VETreeNode partn = (VETreeNode) tn.Parent; - ItemInfo ii = tn.VEObject as ItemInfo; - if (!OnPasteItemInfo(this, new vlnTreeItemInfoPasteEventArgs(ii, copyStartID, ItemInfo.EAddpingPart.Replace, ii.MyContent.Type))) - { - //return; - ItemInfo replItemInfo = Item.PasteReplace(ii, copyStartID); - } - SelectedNode = (VETreeNode)((prevtn != null) ? prevtn.NextNode : partn.FirstNode); - } - private void tv_NodeCopy() - { - if (SelectedNode==null)return; - VETreeNode tn = SelectedNode as VETreeNode; - ItemInfo ii = tn.VEObject as ItemInfo; - if (ii != null) - { - Clipboard.Clear(); - PromsClipboard iClip; - iClip.itemId = ii.ItemID; - iClip.cType = (int)PromsClipboardType.Copy; - DataObject myDO = new DataObject(); - myDO.SetText(ii.DisplayNumber==null||ii.DisplayNumber==""?" ":ii.DisplayNumber); - myDO.SetData("PromsClipboard", iClip); - Clipboard.SetDataObject(myDO); - //Clipboard.SetData("PromsClipboard", iClip); - //Clipboard.SetData(DataFormats.Text, ii.DisplayNumber); - } - } - #endregion - #region PropertyPagesInterface - private void SetupNodeProperties() - { - VETreeNode tn = SelectedNode as VETreeNode; - if (tn==null)return; - - if ((tn.VEObject as FolderInfo) != null) - OpenProperties(tn.VEObject as FolderInfo); - else if ((tn.VEObject as DocVersionInfo) != null) - OpenProperties(tn.VEObject as DocVersionInfo); - else if ((tn.VEObject as ProcedureInfo) != null) - OpenProperties(tn.VEObject as ProcedureInfo); - else if ((tn.VEObject as SectionInfo) != null) - OpenProperties(tn.VEObject as SectionInfo); - else if ((tn.VEObject as StepInfo) != null) - MessageBox.Show("Open up info tab or whatever is associated with step"); - tn.RefreshNode(); - } - private void OpenProperties(FolderInfo folderInfo) - { - using (Folder folder = folderInfo.Get()) - { - OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} Properties", folder.FolderConfig.Name), folder.FolderConfig)); - } - } - private void OpenProperties(DocVersionInfo dvInfo) - { - using (DocVersion dv = dvInfo.Get()) - { - OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} Properties", dv.DocVersionConfig.Name), dv.DocVersionConfig)); - } - } - private void OpenProperties(ProcedureInfo procInfo) - { - using (Procedure proc = procInfo.Get()) - { - OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(string.Format("{0} {1} Properties", proc.ProcedureConfig.Number, proc.ProcedureConfig.Title), proc.ProcedureConfig)); - } - } - private void OpenProperties(SectionInfo sectInfo) - { - OnSectionShouldClose(this, new vlnTreeSectionInfoEventArgs(sectInfo)); - using (Section sect = sectInfo.Get()) - { - string title = null; - if (sectInfo.SectionConfig.Number.Length > 0) - title = string.Format("{0} {1} Properties", sectInfo.SectionConfig.Number, sectInfo.SectionConfig.Title); - else - title = string.Format("{0} Properties", sectInfo.SectionConfig.Title); - OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(title, sect.SectionConfig)); - } - } - private void OpenProperties(StepInfo stpinfo) - { - using (Step stp = stpinfo.Get()) - { - } - } - - #endregion - #region OpenNode - private void tv_KeyPress(object sender, KeyPressEventArgs e) - { - if (e.KeyChar == '\r') - { - OpenNode(); - e.Handled = true; - } - } - public void OpenNode() - { - VETreeNode tn = SelectedNode as VETreeNode; - if (tn != null) - { - if (tn.VEObject.GetType() == typeof(FolderInfo) || tn.VEObject.GetType() == typeof(DocVersionInfo) || tn.VEObject.GetType() == typeof(PartInfo)) - { - if (tn.Nodes.Count > 0) - { - tn.Expand(); - SelectedNode = tn.Nodes[0]; - Focus(); - } - } - else - OnNodeSelect(this, new vlnTreeEventArgs(SelectedNode)); - } - } - #endregion - #region InsertAllLevels - public void tv_NodeNew(MenuSelections newtype) - { - VETreeNode tn = null; - if (SelectedNode == null) return; - SetLastValues((VETreeNode)SelectedNode); - - #region InsertFolderOrDocVersion - if (_LastFolderInfo != null) - { - using (Folder parentfolder = _LastFolderInfo.Get()) - { - if (newtype == MenuSelections.DocVersion) - { - int dvid = -1; // flag to allow user to cancel from dialog & then we remove it. - using (DocVersion docversion = DocVersion.MakeDocVersion(parentfolder, "Working Draft", "Title", null, null, null)) - { - ShowBrokenRules(docversion.BrokenRulesCollection); - SetLastValues(DocVersionInfo.Get(docversion.VersionID)); - if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("Working Draft", docversion.DocVersionConfig)) == DialogResult.OK) - { - docversion.Save(); - tn = new VETreeNode(_LastDocVersionInfo); - SelectedNode.Nodes.Add(tn); // add tree node to end of list. - } - else - dvid = docversion.VersionID; - } - if (dvid != -1) DocVersion.Delete(dvid); - } - else if (newtype == MenuSelections.Folder) - { - int f1 = -1; // flag to allow user to cancel from dialog & then we remove it. - string uniquename = _LastFolderInfo.UniqueChildName("New Folder"); - using (Folder folder = Folder.MakeFolder(parentfolder, parentfolder.MyConnection, uniquename, string.Empty, "Short Name", null, string.Empty, DateTime.Now, VlnSettings.UserID)) - { - ShowBrokenRules(folder.BrokenRulesCollection); - FolderInfo fi = FolderInfo.Get(folder.FolderID); - folder.ManualOrder = fi.ManualOrder; - SetLastValues(fi); - if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(uniquename, folder.FolderConfig)) == DialogResult.OK) - { - folder.Save(); - tn = new VETreeNode((IVEDrillDownReadOnly)_LastFolderInfo); - SelectedNode.Nodes.Add(tn); // add new tree node to end of childlist. - } - else - f1 = folder.FolderID; - } - if (f1 != -1) Folder.Delete(f1); - } - else if (newtype == MenuSelections.FolderAfter||newtype == MenuSelections.FolderBefore) - { - int f2 = -1; - string uniquename = _LastFolderInfo.MyParent.UniqueChildName("New Folder"); - int myindex = SelectedNode.Index + ((newtype == MenuSelections.FolderAfter) ? 1 : 0); - FolderInfo parfolderinfo = FolderInfo.Get(parentfolder.FolderID); - double? myorder = parfolderinfo.NewManualOrder(myindex); - using (Folder folder = Folder.MakeFolder(parentfolder.MyParent, parentfolder.MyConnection, uniquename, string.Empty, "Short Name", null, myorder, string.Empty, DateTime.Now, VlnSettings.UserID)) - { - ShowBrokenRules(folder.BrokenRulesCollection); - SetLastValues(FolderInfo.Get(folder.FolderID)); - if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs(uniquename, folder.FolderConfig)) == DialogResult.OK) - { - folder.Save(); - tn = new VETreeNode((IVEDrillDownReadOnly)_LastFolderInfo); - if (newtype == MenuSelections.FolderBefore) SelectedNode.Parent.Nodes.Insert(SelectedNode.Index, tn); - if (newtype == MenuSelections.FolderAfter) SelectedNode.Parent.Nodes.Insert(SelectedNode.Index + 1, tn); - } - else - f2 = folder.FolderID; - } - if (f2 != -1) Folder.Delete(f2); - } - } - } - #endregion - #region InsertProcedure - else if (newtype == MenuSelections.Procedure) - { - int p1 = -1; - using (Procedure procedure = Procedure.MakeProcedure(_LastDocVersionInfo, _LastDocVersionInfo.Procedures.Count!=0?_LastDocVersionInfo.Procedures[_LastDocVersionInfo.Procedures.Count-1]:null, null, "New Procedure", 0)) - { - ShowBrokenRules(procedure.BrokenRulesCollection); - SetLastValues(ProcedureInfo.Get(procedure.ItemID)); - if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("New Procedure", procedure.ProcedureConfig)) == DialogResult.OK) - { - procedure.Save(); - tn = new VETreeNode(_LastProcedureInfo); - SelectedNode.Nodes.Add(tn); // add tree node to end of list. - } - else - p1 = procedure.ItemID; - } - if (p1 != -1) - DeleteItemInfoAndChildren(_LastProcedureInfo);// Delete Item and reset Previous and Next - } - else if (newtype == MenuSelections.ProcedureAfter || newtype == MenuSelections.ProcedureBefore) - { - int p2 = -1; - int tvindex = SelectedNode.Index; - // if inserting before, the parent is set in case previous is null, i.e. beginning of the list. - using (Procedure procedure = Procedure.MakeProcedure((newtype == MenuSelections.ProcedureAfter) ? null : _LastProcedureInfo.ActiveParent, (newtype == MenuSelections.ProcedureAfter) ? _LastProcedureInfo : _LastProcedureInfo.MyPrevious, null, "New Procedure", 0)) - { - ShowBrokenRules(procedure.BrokenRulesCollection); - SetLastValues(ProcedureInfo.Get(procedure.ItemID)); - if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("New Procedure", procedure.ProcedureConfig)) == DialogResult.OK) - { - procedure.Save(); - tn = new VETreeNode(_LastProcedureInfo); - TreeNode par = SelectedNode.Parent; - par.Nodes.Insert(tvindex + ((newtype == MenuSelections.ProcedureBefore) ? 0 : 1), tn); - } - else - p2 = procedure.ItemID; - } - if (p2 != -1) - DeleteItemInfoAndChildren(_LastProcedureInfo); // Delete Item and reset Previous and Next - } - #endregion - #region InsertSection - else if (newtype == MenuSelections.Section) // Insert subsection at end of parents section list - { - string message = string.Empty; - if (_LastProcedureInfo != null) - if (!MySessionInfo.CanCheckOutItem(_LastProcedureInfo.ItemID, CheckOutType.Procedure, ref message)) - { - MessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; - } - int s1 = -1; - if (!(_LastProcedureInfo == null) || !(_LastSectionInfo == null)) - { - // May need to create 'pseudo' nodes, for the 'Steps' and 'Sections' grouping tree nodes. - // If no grouping nodes exist off a section (we are adding a subsection), then - // add a 'pseudo' node. - // If step(s) exists, but not a section, then need 'pseudo' nodes, i.e. 'Steps' and 'Sections' - // tree nodes. - // Otherwise, the 'Sections' pseudo node will exist. - // Note that this check has to be done before the section is made, otherwise the item will - // have sections, i.e. the one getting added. - bool doPseudo = false; - if (_LastItemInfo.IsSection) // if adding off of a procedure, don't add pseuo. - { - if (SelectedNode.Nodes.Count == 0) - doPseudo = true; - else if (SelectedNode.Nodes.Count > 0) - { - // Check to see if sections already exist, if so, the pseudo node will too. - bool hasMetaSubs = _LastItemInfo.Sections != null && _LastItemInfo.Sections.Count > 0; - if (!hasMetaSubs) doPseudo = true; - } - } - using(Section section = CreateNewSection()) - { - ShowBrokenRules(section.BrokenRulesCollection); - SetLastValues(SectionInfo.Get(section.ItemID)); - if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("New Section", section.SectionConfig)) == DialogResult.OK) - { - if (!doPseudo) - { - tn = new VETreeNode(_LastSectionInfo); - SelectedNode.Nodes.Add(tn); // add tree node to end of list. - OnNodeSelect(this, new vlnTreeEventArgs(tn)); - } - else - { - // may have to add a 'steps' node if a step(s) already exist... - ItemInfo ii = (SelectedNode as VETreeNode).VEObject as ItemInfo; - int cpindx = 0; - if (SelectedNode.Nodes.Count>0) - { - VETreeNode vtn = SelectedNode.Nodes[0] as VETreeNode; - ItemInfo ichld1 = null; - if (vtn != null) ichld1 = vtn.VEObject as ItemInfo; - //ItemInfo ichld1 = (SelectedNode.Nodes[0] as VETreeNode).VEObject as ItemInfo; - if (ichld1 != null && ichld1.IsStep) - { - // find associated part node: - foreach (PartInfo pi in ii.MyContent.ContentParts) - { - if (pi.FromType == (int)E_FromType.Step) - { - // A 'Steps' pseudo node must be added and any existing steps - // must be moved below it: - VETreeNode tnStepPart = new VETreeNode(ii.MyContent.ContentParts[cpindx]); - foreach (TreeNode tnc in SelectedNode.Nodes) - { - TreeNode cloned = (TreeNode)tnc.Clone(); - tnStepPart.Nodes.Add(cloned); - } - SelectedNode.Nodes.Clear(); - SelectedNode.Nodes.Add(tnStepPart); - break; - } - cpindx++; - } - } - } - // At this level, there will only be 'Steps' or 'Sections' nodes. So, use - // the ContentParts[indx] that was not used to create the pseudo node. - if (cpindx == 1) cpindx = 0; - VETreeNode tnPart = new VETreeNode(ii.MyContent.ContentParts[cpindx]); - SelectedNode.Nodes.Add(tnPart); - tn = new VETreeNode(_LastSectionInfo); - tnPart.Nodes.Add(tn); // add tree node to end of list. - } - } - else - s1 = section.ItemID; - } - if (s1 != -1) - DeleteItemInfoAndChildren(_LastSectionInfo);// Delete Item and reset Previous and Next - } - } - else if (newtype == MenuSelections.SectionAfter || newtype == MenuSelections.SectionBefore) - { - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(_LastSectionInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message)) - { - MessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; - } - int tvindex = SelectedNode.Index; - // if inserting before, the parent is set in case previous is null, i.e. beginning of the list. - int s2 = -1; - using (Section section = Section.MakeSection((newtype == MenuSelections.SectionAfter) ? null : _LastSectionInfo.MyParent, (newtype == MenuSelections.SectionAfter) ? _LastSectionInfo : _LastSectionInfo.MyPrevious, null, "New Section", 10000)) - { - ShowBrokenRules(section.BrokenRulesCollection); - SetLastValues(SectionInfo.Get(section.ItemID)); - if (OnNodeOpenProperty(this, new vlnTreePropertyEventArgs("New Section", section.SectionConfig)) == DialogResult.OK) - { - tn = new VETreeNode(_LastSectionInfo); - TreeNode par = SelectedNode.Parent; - par.Nodes.Insert(tvindex + ((newtype == MenuSelections.SectionBefore) ? 0 : 1), tn); - } - else - s2 = section.ItemID; - } - if (s2 != -1) - DeleteItemInfoAndChildren(_LastSectionInfo);// Delete Item and reset Previous and Next - } - #endregion - #region InsertStep - else if (newtype == MenuSelections.Step) // insert step from section - no substeps from tree. - { - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(_LastSectionInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message)) - { - MessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; - } - tn = InsertChildStep((VETreeNode)SelectedNode); - } - else if (newtype == MenuSelections.StepAfter || newtype == MenuSelections.StepBefore && _LastStepInfo != null) - { - string message = string.Empty; - if (!MySessionInfo.CanCheckOutItem(_LastStepInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message)) - { - MessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return; - } - tn = InsertBeforeOrAfter(newtype, (VETreeNode)SelectedNode); - } - #endregion - - if (tn != null) - { - SelectedNode = tn; - OnNodeNew(this, new vlnTreeEventArgs(SelectedNode)); - Refresh(); - OnNodeInsert(this, new vlnTreeEventArgs(SelectedNode)); - } - } - private Section CreateNewSection() - { - if(_LastItemInfo.LastChild(E_FromType.Section) != null) - return Section.MakeSection(_LastItemInfo, _LastItemInfo.LastChild(E_FromType.Section), null, "New Section", 10000); - ItemInfo iii = _LastItemInfo.InsertChild(E_FromType.Section, 10000, "New Section", null); - return Section.Get(iii.ItemID); - } - private VETreeNode InsertChildStep(VETreeNode tn) - { - // If parent step is open in editor, use the OnInsertItemInfo to insert step & add RTBItems to step editor panel - ItemInfo ii = tn.VEObject as ItemInfo; - if (OnInsertItemInfo(this, new vlnTreeItemInfoInsertEventArgs(ii, E_InsertType.Child, "New Step", 20002, E_FromType.Step))) - { - return null; // should we try to get to the child? - } - // The parent step was not open in the step editor, just create new step and add treenode. - using (Step step = Step.MakeStep(_LastItemInfo, _LastItemInfo.LastChild(E_FromType.Step), null, "New Step", 20002, E_FromType.Step)) - { - ShowBrokenRules(step.BrokenRulesCollection); - SetLastValues(StepInfo.Get(step.ItemID)); - tn = new VETreeNode(_LastStepInfo); - SelectedNode.Nodes.Add(tn); // add tree node to end of list. - } - return tn; - } - - private VETreeNode InsertBeforeOrAfter(MenuSelections newtype, VETreeNode tn) - { - // If parent step is open in editor, use the OnInsertItemInfo to insert step & add RTBItems to step editor panel - ItemInfo ii = tn.VEObject as ItemInfo; - if (OnInsertItemInfo(this, new vlnTreeItemInfoInsertEventArgs(ii,(newtype == MenuSelections.StepAfter) ? E_InsertType.After:E_InsertType.Before, "New Step"))) - { - return (VETreeNode)((newtype == MenuSelections.StepAfter) ? tn.NextNode : tn.PrevNode); - } - // The parent step was not open in the step editor, just create new step and add treenode. - int tvindex = SelectedNode.Index; - // if inserting before, the parent is set in case previous is null, i.e. beginning of the list. - ItemInfo parent = (newtype == MenuSelections.StepAfter) ? null : _LastStepInfo.MyParent; - using (Step step = Step.MakeStep(parent, (newtype == MenuSelections.StepAfter) ? _LastStepInfo : _LastStepInfo.MyPrevious, null, "New Step", (int)_LastStepInfo.MyContent.Type, (E_FromType)_LastStepInfo.FirstSibling.ItemParts[0].FromType)) - { - ShowBrokenRules(step.BrokenRulesCollection); - SetLastValues(StepInfo.Get(step.ItemID)); - tn = new VETreeNode(_LastStepInfo); - _LastStepInfo.UpdateTransitionText(); - TreeNode par = SelectedNode.Parent; - par.Nodes.Insert(tvindex + ((newtype == MenuSelections.StepBefore) ? 0 : 1), tn); - } - return tn; - } - private void ShowBrokenRules(BrokenRulesCollection brs) - { - if (brs != null) - { - foreach (BrokenRule br in brs) - { - Console.WriteLine("broken rule {0}", br.Description); - } - } - } - #endregion - #region DeleteAllLevels - private bool tv_NodeDelete() - { - SetLastValues((VETreeNode)SelectedNode); - string message = string.Empty; - if(_LastStepInfo != null) - if (!MySessionInfo.CanCheckOutItem(_LastStepInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message)) - { - MessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return false; - } - if (_LastSectionInfo != null) - if (!MySessionInfo.CanCheckOutItem(_LastSectionInfo.MyProcedure.ItemID, CheckOutType.Procedure, ref message)) - { - MessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return false; - } - if (_LastProcedureInfo != null) - if (!MySessionInfo.CanCheckOutItem(_LastProcedureInfo.ItemID, CheckOutType.Procedure, ref message)) - { - MessageBox.Show(this, message, "Item Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return false; - } - if (_LastDocVersionInfo != null) - { - StringBuilder sb = new StringBuilder(); - foreach (ProcedureInfo pi in _LastDocVersionInfo.Procedures) - { - if (!MySessionInfo.CanCheckOutItem(pi.ItemID, CheckOutType.Procedure, ref message)) - sb.AppendLine(message); - message = string.Empty; - } - if (sb.Length > 0) - { - MessageBox.Show(this, sb.ToString(), "Items Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return false; - } - } - if (_LastFolderInfo != null) - { - StringBuilder sb = new StringBuilder(); - if (_LastFolderInfo.FolderDocVersionCount > 0) - { - foreach (DocVersionInfo dvi in _LastFolderInfo.FolderDocVersions) - { - foreach (ProcedureInfo pi in dvi.Procedures) - { - if (!MySessionInfo.CanCheckOutItem(pi.ItemID, CheckOutType.Procedure, ref message)) - sb.AppendLine(message); - message = string.Empty; - } - } - } - if (sb.Length > 0) - { - MessageBox.Show(this, sb.ToString(), "Items Already Checked Out", MessageBoxButtons.OK, MessageBoxIcon.Warning); - return false; - } - } - - DialogResult result = MessageBox.Show("Are you sure you want to delete " + SelectedNode.Text, "Verify Delete", - MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (result == DialogResult.Yes) - { - if (_LastFolderInfo != null) - { - Folder.Delete(_LastFolderInfo.FolderID); - _LastFolderInfo = null; - return true; - } - else if (_LastDocVersionInfo != null) - { - DocVersion.Delete(_LastDocVersionInfo.VersionID); - _LastDocVersionInfo = null; - return true; - } - else if (_LastProcedureInfo != null) - { - // always return false because an event gets fired to delete tree nodes. - if (!DeleteItemInfoAndChildren(_LastProcedureInfo)) return false; - _LastProcedureInfo = null; - return false; - } - else if (_LastSectionInfo != null) - { - OnSectionShouldClose(this, new vlnTreeSectionInfoEventArgs(_LastSectionInfo,true)); - // always return false because an event gets fired to delete tree nodes. - if (!DeleteItemInfoAndChildren(_LastSectionInfo)) - { - return false; - } - WordSectionEventArgs args = new WordSectionEventArgs(_LastSectionInfo); - OnWordSectionDeleted(this, args); - _LastSectionInfo = null; - return false; - } - else if (_LastStepInfo != null) - { - // always return false because an event gets fired to delete tree nodes. - if (!DeleteItemInfoAndChildren(_LastStepInfo)) return false; - _LastStepInfo = null; - return false; - } - } - return false; - } - private bool DeleteItemInfoAndChildren(ItemInfo ii) - { - try - { - // send an event to frmVeproms that sends an event to the stepeditor to - // do delete using RTBItem - this manages windowing from the step editor. - // If the procedure is open & you're deleting procedure, you want to close open - // window - this is done in DisplayTabControl-DeleteStepTabItem. - if (!OnDeleteItemInfo(this, new vlnTreeItemInfoEventArgs(ii))) - Item.DeleteItemAndChildren(ii); - return true; - } - catch (System.Data.SqlClient.SqlException ex) - { - HandleSqlExceptionOnDelete(ex, ii); - return false; - } - } - private void HandleSqlExceptionOnDelete(System.Data.SqlClient.SqlException ex, ItemInfo ii) - { - if (ex.Message.Contains("has External Transitions and has no next step")) - { - using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitions(ii.ItemID)) - { - DialogResult ans = MessageBox.Show("Transitions exist to this step and cannot be adjusted automatically." + - "\r\n\r\nDo you want to be placed on the " + (exTrans.Count > 1 ? "first " : "") + "substep with the problem Transition?" + - "\r\n\r\nSubsteps with Problem Transitions" + - exTrans.Summarize(), - "Cannot Delete This Step", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (ans == DialogResult.Yes) - { - OnOpenItem(this, new vlnTreeItemInfoEventArgs(exTrans[0].MyContent.ContentItems[0])); - } - } - } - else if (ex.Message.Contains("has External Transitions to it's children")) - { - using (TransitionInfoList exTrans = TransitionInfoList.GetExternalTransitionsToChildren(ii.ItemID)) - { - DialogResult ans = MessageBox.Show("Transitions exist to substeps of this step and cannot be adjusted automatically." + - "\r\n\r\nDo you want to be placed on the " + (exTrans.Count > 1 ? "first " : "") + "substep with the problem Transition?" + - "\r\n\r\nSubsteps with Problem Transitions:" + - exTrans.Summarize(), - "Cannot Delete This Step", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - if (ans == DialogResult.Yes) - { - OnOpenItem(this, new vlnTreeItemInfoEventArgs(exTrans[0].MyContent.ContentItems[0])); - } - } - } - else - MessageBox.Show(ex.Message, "SQL Exception", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); - } - #endregion - #region SetLastValuesAndSaveIfChangedStuff - private void SetLastValues(VETreeNode node) - { - _LastTreeNode = node; - SetLastValues(node.VEObject); - } - private void SetLastValues(IVEDrillDownReadOnly veobject) - { - _LastFolderInfo = veobject as FolderInfo; - _LastDocVersionInfo = veobject as DocVersionInfo; - _LastProcedureInfo = veobject as ProcedureInfo; - _LastSectionInfo = veobject as SectionInfo; - _LastStepInfo = veobject as StepInfo; - _LastItemInfo = veobject as ItemInfo; - } - #endregion - #region Cursor - private bool SetupDragCursor(ImageList il, TreeNode tn) - { - // Reset image list used for drag image - il.Images.Clear(); - int howBig = tn.Bounds.Size.Width + this.Indent; - if (howBig > 256) howBig = 256; - il.ImageSize = new Size(howBig, tn.Bounds.Height); - - // Create new bitmap - // This bitmap will contain the tree node image to be dragged - Bitmap bmp = new Bitmap(tn.Bounds.Width + this.Indent, tn.Bounds.Height); - - // Get graphics from bitmap - Graphics gfx = Graphics.FromImage(bmp); - - // Draw node icon into the bitmap - if (this.ImageList != null) gfx.DrawImage(this.ImageList.Images[0], 0, 0); - - // Draw node label into bitmap - gfx.DrawString(tn.Text, this.Font, new SolidBrush(this.ForeColor), - // new SolidBrush(Color.Blue), - (float)this.Indent, 1.0f); - - // Add bitmap to imagelist - _dragImageList.Images.Add(bmp); - - // Get mouse position in client coordinates - Point p = this.PointToClient(Control.MousePosition); - - // Compute delta between mouse position and node bounds - int dx = p.X + this.Indent - tn.Bounds.Left; - int dy = p.Y - tn.Bounds.Top; - - // Begin dragging image - return DragHelper.ImageList_BeginDrag(_dragImageList.Handle, 0, dx, dy); - } - private void tv_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e) - { - // Get drag node and select it - try - { - TreeNode dragNode = (TreeNode)e.Item; - Type t = dragNode.GetType(); - //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("Item Drag {0} - {1}", t.FullName, t.BaseType.FullName); - Type t2 = Type.GetType(t.FullName); - //if(t2 != null) - // if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("Item Drag {0} - {1}", t2.FullName, t2.BaseType.FullName); - this.SelectedNode = dragNode; - ItemInfo iidrag = ((VETreeNode)dragNode).VEObject as ItemInfo; - FolderInfo fdrag = ((VETreeNode)dragNode).VEObject as FolderInfo; - DocVersionInfo ddrag = ((VETreeNode)dragNode).VEObject as DocVersionInfo; - if ((iidrag == null && fdrag == null && ddrag == null)) - { - MessageBox.Show("Cannot drag/drop a grouping node."); - return; - } - // don't put up message, message kept coming up on any selection of node (to copy, properties, etc) - //if (iidrag != null && iidrag.IsStep) return; - if (SetupDragCursor(_dragImageList, dragNode)) - { - this.DoDragDrop(dragNode, DragDropEffects.Move | DragDropEffects.Copy);// Begin dragging - DragHelper.ImageList_EndDrag();// End dragging image - } - } - catch (Exception ex) - { - if(_MyLog.IsErrorEnabled)_MyLog.Error("tv_ItemDrag", ex); - } - } - #endregion - #region DragDrop - ImageList _dragImageList = new ImageList(); - public enum DropPosition : int - { - Child = 0, Before = 1, After = 2 - } - private class DropLocation - { - #region Business Methods - private TreeNode _dropNode; - public TreeNode DropNode - { - get { return _dropNode; } - set { _dropNode = value; } - } - private int _index; - public int Index - { - get { return _index; } - set { _index = value; } - } - private DropPosition _position; - public DropPosition Position - { - get { return _position; } - set { _position = value; } - } - DateTime _lastScroll; - public DateTime LastScroll - { - get { return _lastScroll; } - } - private string _location = string.Empty; - #endregion - #region Constructors - public DropLocation(TreeView tv, System.Windows.Forms.DragEventArgs e, DateTime lastScroll) - { - _lastScroll = lastScroll; - _dropNode = tv.GetNodeAt(tv.PointToClient(new Point(e.X, e.Y))); - if (_dropNode == null) return; - int OffsetY = tv.PointToClient(Cursor.Position).Y - _dropNode.Bounds.Top; - if (OffsetY < _dropNode.Bounds.Height / 3) // First Third - Before - { - _index = _dropNode.Index; - _dropNode = _dropNode.Parent; - _position = DropPosition.Before; - _location = string.Format("Before1 {0}[{1}] y={2}", _dropNode.Text, _index, OffsetY); - } - else if ((OffsetY / 2) < _dropNode.Bounds.Height / 3) // Second Third - Child - { - _location = string.Format("Child {0} y={1}", _dropNode.Text, OffsetY); - _position = DropPosition.Child; - _index = 0; - //if (_dropNode.Parent == null) - //{ - // if(_MyLog.IsInfoEnabled)_MyLog.Info("Root Node"); - //} - } - else // Last Third - After Now I need to check the X value - { - if (_dropNode.NextVisibleNode != null && _dropNode.Nodes.Count > 0 && _dropNode.IsExpanded)// Has Children & Expanded - Insert first child - { - // _dropNode = _dropNode.Nodes[0]; - _index = 0; - _position = DropPosition.Before; - _location = string.Format("Before2 {0}[{1}] y={2}", _dropNode.Text, _index, OffsetY); - } - else // No Children or Children Collapsed - Insert Next at various levels depending upon horizontal location. - { - Point pt = tv.PointToClient(new Point(e.X, e.Y)); - TreeNode nextParent = _dropNode.NextNode; - if (nextParent != null) nextParent = nextParent.Parent; - do - { - _index = _dropNode.Index; - _dropNode = _dropNode.Parent; - } while (pt.X < _dropNode.Bounds.X && _dropNode != nextParent); - _location = string.Format("After {0}[{1}] y={2}", _dropNode.Text, _index, OffsetY); - _position = DropPosition.After; - } - } - LimitMoves(e); - } - public void LimitMoves(DragEventArgs e) - { - if ((e.KeyState & 8) == 0) - { - //TreeNode dragNode = (TreeNode)e.Data.GetData("System.Windows.Forms.TreeNode"); - //TreeNode dragNode = (TreeNode)e.Data.GetData("TreeTest.FolderTreeNode"); - TreeNode dragNode = vlnTreeView.GetTreeNodeFromData(e.Data); - switch (_position) - { - case DropPosition.Before: - if (dragNode == _dropNode.Nodes[_index] || dragNode == _dropNode.Nodes[_index].PrevNode) - { - // if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("Before {0} {1} {2} {3} {4}", dragNode.Text ,_position.ToString() , _dropNode.Nodes[_index].Text - // ,_dropNode.Nodes[_index].PrevNode,_dropNode.Nodes[_index].NextNode); - _dropNode = null; - } - break; - case DropPosition.Child: - if (dragNode.Parent == _dropNode) - { - // if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("Child {0} {1} {2} {3} {4} {5}", dragNode.Text ,_position.ToString() , _dropNode.Nodes[_index].Text - // ,_dropNode.Nodes[_index].PrevNode,_dropNode.Nodes[_index].NextNode,DateTime.Now); - _dropNode = null; - } - break; - case DropPosition.After: - if (dragNode == _dropNode.Nodes[_index] || dragNode == _dropNode.Nodes[_index].NextNode) - { - // if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("After {0} {1} {2} {3} {4}", dragNode.Text ,_position.ToString() , _dropNode.Nodes[_index].Text - // ,_dropNode.Nodes[_index].PrevNode,_dropNode.Nodes[_index].NextNode); - _dropNode = null; - } - break; - } - } - } - #endregion - public override string ToString() - { - return string.Format("{0}[{1}].{2}", _dropNode.Text, _index, _position.ToString()); - } - #region Drawing - private void TreeNodeTriangle(Graphics g) - { - Rectangle r = _dropNode.Bounds; - int RightPos = r.Right + 6; - Point[] RightTriangle = new Point[]{ - new Point(RightPos, r.Y ), - new Point(RightPos - (r.Height / 2), r.Y + (r.Height / 2)), - new Point(RightPos, r.Y + r.Height), - new Point(RightPos - (r.Height / 3), r.Y + (r.Height / 2)) - }; - g.FillPolygon(System.Drawing.Brushes.Black, RightTriangle); - } - private void InsertPointer(TreeNode tn, Graphics g) - { - TreeView tv = _dropNode.TreeView; - Rectangle r2 = _dropNode.Nodes[_index].Bounds; - Rectangle r3 = tn.Bounds; - int y = (_position == DropPosition.Before ? r2.Y : r3.Bottom); - int x = r2.Left; - - if (y == 0) - { - return; - } - //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("Line at {0} Node {1}[{2}] {3}", _location, _dropNode.Text, _index, _position.ToString()); - Color lc = (_position == DropPosition.After ? Color.Red : Color.Blue); - Brush lb = (_position == DropPosition.After ? Brushes.Red : Brushes.Blue); - Point[] RightTriangle; - if (_position == DropPosition.After) - { - RightTriangle = new Point[]{ - new Point(x, y ), - new Point(x+4, y+4), - new Point(x+8, y)}; - } - else - { - RightTriangle = new Point[]{ - new Point(x, y), - new Point(x+4, y-4), - new Point(x+8, y)}; - } - g.DrawLine(new System.Drawing.Pen(lc, 2), new Point(r2.Left, y), new Point(tv.Width - 8, y)); - g.FillPolygon(lb, RightTriangle); - } - public void ShowLocation(System.Windows.Forms.DragEventArgs e, bool ScrollOnly) - { - //if (e.Effect == DragDropEffects.None) return; - if (_dropNode != null) - { -// if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("ShowLocation1 {0} {1}", e.Effect.ToString(), DateTime.Now.Millisecond); - DragHelper.ImageList_DragShowNolock(false); - TreeView tv = _dropNode.TreeView; - TreeNode tmp = tv.GetNodeAt(tv.PointToClient(new Point(e.X, e.Y))); -// if (!ScrollOnly) -// { - if (ScrollTreeView(tmp) || !ScrollOnly) - { - //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("ShowLocation2 {0} {1}", e.Effect.ToString(), DateTime.Now.Millisecond); - tv.Refresh(); - if (e.Effect != DragDropEffects.None) - { - //tv.SelectedNode = dropNode; - Graphics g = tv.CreateGraphics(); - TreeNodeTriangle(g); - if (_position != DropPosition.Child)InsertPointer(tmp, g); - } - } -// } -// else ScrollTreeView(tmp); - DragHelper.ImageList_DragShowNolock(true); - } - } - #endregion - public void ShowLocation() - { - //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0}[{1}] {2}", _dropNode.Text, _index, _position.ToString()); - } - #region AutoScroll - private bool ScrollTreeView(TreeNode tn) - { - bool retval = false; - TimeSpan ts = new TimeSpan(DateTime.Now.Ticks - _lastScroll.Ticks); - if (ts.Milliseconds > 100)// This controls the scroll speed - { - int top = tn.Bounds.Top; - _lastScroll = DateTime.Now; - if (tn.TreeView.ClientSize.Height < tn.Bounds.Bottom) tn.EnsureVisible();// Make sure that the current node is visible - if (tn.NextVisibleNode != null && tn.TreeView.ClientSize.Height < tn.NextVisibleNode.Bounds.Bottom) - tn.NextVisibleNode.EnsureVisible();// Make sure that the next node is visible - else - if (tn.PrevVisibleNode != null && tn.PrevVisibleNode.PrevVisibleNode != null && tn.PrevVisibleNode.PrevVisibleNode.IsVisible == false) - tn.PrevVisibleNode.PrevVisibleNode.EnsureVisible();// Make sure that the previous node is visible } - else - if (tn.PrevVisibleNode != null && tn.PrevVisibleNode.IsVisible == false) - tn.PrevVisibleNode.EnsureVisible();// Make sure that the previous node is visible - retval = (top != tn.Bounds.Top); - // if (retval) if(_MyLog.IsInfoEnabled)_MyLog.Info("Scroll"); - } - return retval; - } - #endregion - public bool Equals(DropLocation dl) - { - return (dl != null && _lastScroll.Equals(dl.LastScroll) && _dropNode.Equals(dl.DropNode) && - _position.Equals(dl.Position)); - } - } - private DropLocation _LastDropLocation = null; - private void tv_DragOver(object sender, System.Windows.Forms.DragEventArgs e) - { - try - { - TreeNode dragNode = GetTreeNodeFromData(e.Data); - // Compute drag position and move image - Point formP = this.FindForm().PointToClient(new Point(e.X, e.Y)); - DragHelper.ImageList_DragMove(formP.X - this.Left, formP.Y - this.Top); - DropLocation dl = new DropLocation(this, e, _LastDropLocation == null ? DateTime.Now : _LastDropLocation.LastScroll); - string s = string.Empty; - if (dl.DropNode == null) - { - e.Effect = DragDropEffects.None; - } - else - { - DragDropEffects ee = e.Effect; - if (e.KeyState == 13) // Shift and Control Keys to do a move. - ee = DragDropEffects.Move; - else - ee = DragDropEffects.None; // Default - Do nothing - if (IsChild(dragNode, dl.DropNode)) // Don't copy or move to a child node - ee = DragDropEffects.None; - else if (IsDocVersion((VETreeNode)dragNode)) // Don't move docversions - ee = DragDropEffects.None; - else if (IsFolder((VETreeNode)dragNode)) // Folder move is only valid if moving to folder with NO docversions - { - FolderInfo fdropi = ((VETreeNode)dl.DropNode).VEObject as FolderInfo; - if (fdropi == null || fdropi.FolderDocVersionCount > 0) ee = DragDropEffects.None; - } - else if (IsSection((VETreeNode)dragNode)) - { - // A section can be moved within a procedure or to a section within the same procedure... - // For HLP, just move within the same procedure - // TODO: allow for section move within subsections. - ProcedureInfo pdropi = ((VETreeNode)dl.DropNode).VEObject as ProcedureInfo; - if (pdropi == null || (dragNode.Parent != dl.DropNode)) ee = DragDropEffects.None; - } - else if (!IsFolder((VETreeNode)dragNode) && (dragNode.Parent != dl.DropNode)) - ee = DragDropEffects.None; - if (e.Effect != ee) e.Effect = ee; - dl.ShowLocation(e, dl.Equals(_LastDropLocation)); - _LastDropLocation = dl; - } - } - catch (Exception ex) - { - if(_MyLog.IsErrorEnabled)_MyLog.Error("tv_DragOver", ex); - } - } - - private bool IsSection(VETreeNode vETreeNode) - { - SectionInfo sectInfo = vETreeNode.VEObject as SectionInfo; - if (sectInfo != null) return true; - return false; - } - private bool IsProcedure(VETreeNode vETreeNode) - { - ProcedureInfo procInfo = vETreeNode.VEObject as ProcedureInfo; - if (procInfo != null) return true; - return false; - } - private bool IsDocVersion(VETreeNode dragNode) - { - DocVersionInfo dvInfo = dragNode.VEObject as DocVersionInfo; - if (dvInfo != null) return true; - return false; - } - private static TreeNode GetTreeNodeFromData(IDataObject datobj) - { - foreach (string s in datobj.GetFormats()) - { - try - { - return (TreeNode)datobj.GetData(s); - } - catch (Exception ex) - { - if(_MyLog.IsErrorEnabled)_MyLog.Error("GetTreeNodeFromData", ex); - } - } - return null; - } - private bool IsFolder(VETreeNode veTreeNode) - { - return (veTreeNode.VEObject.GetType() == typeof(FolderInfo)); - } - private void tv_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) - { - try - { - TreeNode dragNode = GetTreeNodeFromData(e.Data); - DragHelper.ImageList_DragLeave(this.Handle); - int index = _LastDropLocation.Index + (_LastDropLocation.Position == DropPosition.After ? 1 : 0); - int myIndex = index; - if (dragNode.Parent == _LastDropLocation.DropNode && dragNode.Index <= _LastDropLocation.Index) index--; - if (e.Effect == DragDropEffects.Move)// If Move Remove drag node from parent - dragNode.Remove(); - else - dragNode = Clone(dragNode); - _LastDropLocation.DropNode.Nodes.Insert(index, dragNode); - this.SelectedNode = dragNode; - FolderInfo fdragi = ((VETreeNode)dragNode).VEObject as FolderInfo; - FolderInfo fdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as FolderInfo; - if (fdragi != null && fdropi != null && fdropi.FolderDocVersionCount==0) - { - using (Folder fdrag = fdragi.Get()) - { - using (Folder fdrop = fdropi.Get()) - { - fdrag.ManualOrder = fdropi.NewManualOrder(myIndex); - fdrag.MyParent = fdrop; - fdrag.Save(); - } - } - return; - } - // No drag/drop supported for document versions. - - // Allow drag/drop of procedures within a Document Version (must have same parent). Note that drop location - // may either be a document version or a procedure depending on where the user wants to position the procedure. - ProcedureInfo pdragi = ((VETreeNode)dragNode).VEObject as ProcedureInfo; - ProcedureInfo pdropi = null; - if (pdragi != null) // moving a procedure - { - pdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as ProcedureInfo; - if (pdropi != null && pdragi.ActiveParent == pdropi.ActiveParent) - { - pdragi.MoveProcedure(pdragi.ActiveParent, myIndex); - return; - } - DocVersionInfo dvdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as DocVersionInfo; - DocVersionInfo dvdragpar = pdragi.ActiveParent as DocVersionInfo; - if (dvdropi != null && dvdragpar.VersionID == dvdropi.VersionID) - { - pdragi.MoveProcedure(dvdropi, myIndex); - return; - } - } - - // Allow drag/drop of sections within the same procedure or same section (if subsection) (must have same parent) - SectionInfo sdragi = ((VETreeNode)dragNode).VEObject as SectionInfo; - SectionInfo sdropi = null; - if (sdragi != null) // moving a section - { - sdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as SectionInfo; - if (sdropi != null && sdragi.ActiveParent == sdropi.ActiveParent) - { - sdragi.MoveSection(sdragi, myIndex); - return; - } - pdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as ProcedureInfo; - if (pdropi != null && ((ItemInfo)(sdragi.ActiveParent)).ItemID == pdropi.ItemID) - { - sdragi.MoveSection(pdropi, myIndex); - sdragi.Moving = true; - OnNodeSelect(dragNode, new vlnTreeEventArgs(dragNode)); - return; - } - } - - // Allow drag/drop of steps within the same parent only - StepInfo stdragi = ((VETreeNode)dragNode).VEObject as StepInfo; - StepInfo stdropi = null; - if (stdragi != null) // moving a step - { - stdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as StepInfo; - if (stdropi != null && stdragi.ActiveParent == stdropi.ActiveParent) - { - stdragi.MoveStep(stdragi.ActiveParent, myIndex); - return; - } - sdropi = ((VETreeNode)_LastDropLocation.DropNode).VEObject as SectionInfo; - if (sdropi != null && stdragi.MyParent.ItemID == sdropi.ItemID) - { - stdragi.MoveStep(stdragi.ActiveParent, myIndex); - return; - } - // the following handles items under the app nodes of 'steps', 'notes', 'cautions', etc. - if (sdropi == null && dragNode.Parent == _LastDropLocation.DropNode) - { - stdragi.MoveStep(stdragi.ActiveParent, myIndex); - return; - } - } - } - catch (Exception ex) - { - if(_MyLog.IsErrorEnabled)_MyLog.Error("tv_DragDrop", ex); - } - } -// private void DumpMembers(object o) -// { -// Type t = o.GetType(); -// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("\r\n\r\nMembers for type {0}", t.ToString()); -// MemberInfo[] mis = t.GetMembers(); -// int i = 0; -// foreach (MemberInfo mi in mis) -// { -// i++; -// try -// { -// //if(mi.MemberType != MemberTypes.Method) -// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0} {1} {2}", i, mi.Name, mi.MemberType); -//// if (fi.Name == "TreeView") -//// fi.SetValue(o, null); -// } -// catch (Exception ex) -// { -// if(_MyLog.IsErrorEnabled)_MyLog.Error("DumpMembers", ex); -// } -// } -// } - private TreeNode Clone(TreeNode tn) - { - - TreeNode tmp = (TreeNode)tn.Clone(); - ExpandMatch(tmp,tn); - return tmp; - } - private void tv_DragDropOld(object sender, System.Windows.Forms.DragEventArgs e) - { - TreeNode dragNode = (TreeNode)e.Data.GetData("System.Windows.Forms.TreeNode");// Get the drag node - DragHelper.ImageList_DragLeave(this.Handle); - TreeNode cloneNode = (TreeNode)dragNode.Clone();// copy the source node - ExpandMatch(cloneNode, dragNode); - _LastDropLocation.DropNode.Nodes.Insert(_LastDropLocation.Index + (_LastDropLocation.Position == DropPosition.After ? 1 : 0), cloneNode); - if (e.Effect == DragDropEffects.Move)// If Move Remove drag node from parent - dragNode.Remove(); - this.SelectedNode = cloneNode; - } - private void tv_DragEnter(object sender, System.Windows.Forms.DragEventArgs e) - { - DragHelper.ImageList_DragEnter(this.Handle, e.X - this.Left, e.Y - this.Top); - } - private void tv_DragLeave(object sender, System.EventArgs e) - { - DragHelper.ImageList_DragLeave(this.Handle); - this.Refresh(); - } - private void ExpandMatch(TreeNode tn1, TreeNode tn2) - { - if (tn2.IsExpanded) tn1.Expand(); - foreach (TreeNode tc in tn2.Nodes) ExpandMatch(tn1.Nodes[tc.Index], tc); - } - private bool IsChild(TreeNode parent, TreeNode child) - { - if (parent.Equals(child)) return true;// Check against self - foreach (TreeNode tc in parent.Nodes) if (IsChild(tc, child)) return true;//Check all children - return false;// Must not be a child at this level - } - #endregion - private bool _AdjustingTree = false; - public void AdjustTree(ItemInfo selectedItem) - { - // start at the top parent and walk down the nodes to find child - VETreeNode node = FindNodeAndExpand(selectedItem); - if (node != null) - { - _AdjustingTree = true; - this.SelectedNode = node; - _AdjustingTree = false; - } - } - public VETreeNode FindNodeAndExpand(IVEDrillDownReadOnly selectedItem) - { - if (selectedItem.ActiveParent == null) - { - return (VETreeNode)this.Nodes[0]; // Return the top node - } - VETreeNode parent = FindNodeAndExpand(selectedItem.ActiveParent); - if (parent == null) return null; - if (!parent.IsExpanded) - parent.Expand(); - foreach (TreeNode childNode in parent.Nodes) - { - VETreeNode child = childNode as VETreeNode; - if (child != null && CompareVEObject(child.VEObject, selectedItem)) - return child; - } - foreach (TreeNode childNode in parent.Nodes) - { - VETreeNode child = childNode as VETreeNode; - if (child.VEObject is PartInfo) - foreach (VETreeNode grandchild in child.Nodes) - if (CompareVEObject(grandchild.VEObject, selectedItem)) - return grandchild; - } - return null; - } - public bool CompareVEObject(IVEDrillDownReadOnly obj1, IVEDrillDownReadOnly obj2) - { - ItemInfo myItem = obj1 as ItemInfo; - if (myItem != null) - if (myItem.ItemID == ((ItemInfo)obj2).ItemID) return true; - DocVersionInfo myDV = obj1 as DocVersionInfo; - if (myDV != null) - if (myDV.VersionID == ((DocVersionInfo)obj2).VersionID) return true; - FolderInfo myFolder = obj1 as FolderInfo; - if (myFolder != null) - if (myFolder.FolderID == ((FolderInfo)obj2).FolderID) return true; - return false; - } - } - #region DragHelper - public class DragHelper - { - [DllImport("comctl32.dll")] - public static extern bool InitCommonControls(); - - [DllImport("comctl32.dll", CharSet = CharSet.Auto)] - public static extern bool ImageList_BeginDrag(IntPtr himlTrack, int - iTrack, int dxHotspot, int dyHotspot); - - [DllImport("comctl32.dll", CharSet = CharSet.Auto)] - public static extern bool ImageList_DragMove(int x, int y); - - [DllImport("comctl32.dll", CharSet = CharSet.Auto)] - public static extern void ImageList_EndDrag(); - - [DllImport("comctl32.dll", CharSet = CharSet.Auto)] - public static extern bool ImageList_DragEnter(IntPtr hwndLock, int x, int y); - - [DllImport("comctl32.dll", CharSet = CharSet.Auto)] - public static extern bool ImageList_DragLeave(IntPtr hwndLock); - - [DllImport("comctl32.dll", CharSet = CharSet.Auto)] - public static extern bool ImageList_DragShowNolock(bool fShow); - static DragHelper() - { - InitCommonControls(); - } - } - #endregion -} diff --git a/PROMS/Volian.Pipe.Library/Volian.Pipe.Library.sln b/PROMS/Volian.Pipe.Library/Volian.Pipe.Library.sln deleted file mode 100644 index 33d4dfd4..00000000 --- a/PROMS/Volian.Pipe.Library/Volian.Pipe.Library.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30723.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volian.Pipe.Library", "Volian.Pipe.Library.csproj", "{2BD7D42A-A8F6-4DEA-BDCA-5F4D58C6140F}" -EndProject -Global - GlobalSection(SourceCodeControl) = preSolution - SccNumberOfProjects = 2 - SccProjectUniqueName0 = Volian.Pipe.Library.csproj - SccLocalPath0 = . - SccLocalPath1 = . - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2BD7D42A-A8F6-4DEA-BDCA-5F4D58C6140F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2BD7D42A-A8F6-4DEA-BDCA-5F4D58C6140F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2BD7D42A-A8F6-4DEA-BDCA-5F4D58C6140F}.Debug|x86.ActiveCfg = Debug|x86 - {2BD7D42A-A8F6-4DEA-BDCA-5F4D58C6140F}.Debug|x86.Build.0 = Debug|x86 - {2BD7D42A-A8F6-4DEA-BDCA-5F4D58C6140F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2BD7D42A-A8F6-4DEA-BDCA-5F4D58C6140F}.Release|Any CPU.Build.0 = Release|Any CPU - {2BD7D42A-A8F6-4DEA-BDCA-5F4D58C6140F}.Release|x86.ActiveCfg = Release|x86 - {2BD7D42A-A8F6-4DEA-BDCA-5F4D58C6140F}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/PROMS/Volian.Print.Library/ContActionSum - Copy.cs b/PROMS/Volian.Print.Library/ContActionSum - Copy.cs deleted file mode 100644 index 9b80d70d..00000000 --- a/PROMS/Volian.Print.Library/ContActionSum - Copy.cs +++ /dev/null @@ -1,452 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using LBWordLibrary; -using VEPROMS.CSLA.Library; -using System.Text.RegularExpressions; - -namespace Volian.Print.Library -{ - public class ContinuousActionSummary : IDisposable - { - private LBApplicationClass _WordApp; - private LBDocumentClass _WordDoc; - private LBSelection _WordSel; - private LBTable _WordTbl; - private const string TheQuickBrownFox = "The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog."; - private VE_Font _pkFont; - public ContinuousActionSummary() - { - _WordApp = new LBApplicationClass(); - _WordDoc = _WordApp.Documents.Add(); - _WordSel = _WordApp.Selection; - _pkFont = new VE_Font("Arial", 11, E_Style.None, 12); // copied from Calvert Placekeepers. - } - public void Visible() - { - _WordApp.Visible = true; - _WordApp.Activate(); - } - public ContinuousActionSummary(pkParagraphs myContActSteps, VE_Font pkFont) - { - _WordApp = new LBApplicationClass(); - _WordDoc = _WordApp.Documents.Add(); - _WordSel = _WordApp.Selection; - //_WordApp.Visible = true; - _pkFont = pkFont; - AddTable(); - AddHeader(); - foreach (pkParagraph myContAct in myContActSteps) - { - if (myContAct.MyChildren.Count > 0) // only print the section title if it has Continuous Action Steps - AddSectionHeader(myContAct.MyParagraph.MyItemInfo.DisplayNumber, myContAct.MyParagraph.MyItemInfo.FormattedDisplayText); - foreach (pkParagraph pgh in myContAct.MyChildren) // within each section... - { - // start Continuous Action text table cell - //StartSubStep(); - foreach (pkParagraph pghC in pgh.MyCautionsAndNotes) // this is a high level step with cautions and/or notes - { - StepConfig sc = pghC.MyParagraph.MyItemInfo.MyConfig as StepConfig; - string doneStr = ""; - //string NoteCautionTab = string.Format("{0} NOTE: ",pghC.MyParagraph.MyParent.MyTab.Text.Trim()); - //if (pghC.MyParagraph.MyItemInfo.IsCaution) NoteCautionTab = string.Format("{0} CAUTION: ", pghC.MyParagraph.MyParent.MyTab.Text.Trim()); - string NoteCautionTab = string.Format((pghC.MyParagraph.MyItemInfo.IsCaution)?"{0} CAUTION: ":"{0} NOTE: ",pghC.MyParagraph.MyParent.MyTab.Text.Trim()); - NoteCautionTab += " "; - AddContinuousAction(NoteCautionTab, GetContActStepText(pghC.MyParagraph.MyItemInfo), doneStr, (pghC.MyParagraph.MyItemInfo.PageNumber+1).ToString()); - //AddCautionOrNote(NoteCautionTab, pghC.MyParagraph.MyItemInfo.FormattedDisplayText, doneStr, (pghC.MyParagraph.MyItemInfo.PageNumber+1).ToString()); - } - string stpTab = pgh.MyParagraph.MyItemInfo.MyTab.CleanText.Trim() + " "; // this is either the High Level step tab or the sub-step tab - if (pgh.MyParagraph.MyItemInfo.IsNote || pgh.MyParagraph.MyItemInfo.IsCaution) // only the caution and/or note is on the CAS - high level step not selected - { - stpTab = string.Format("{0} ", pgh.MyParagraph.MyParent.MyTab.Text.Trim()) + " " + stpTab; - } - else if (!pgh.MyParagraph.MyItemInfo.IsHigh) // if the high level step was not included, adjust the tab for a sub-step/RNO - { - string tabPre = ""; - ItemInfo ii = pgh.MyParagraph.MyItemInfo.MyParent; - if (pgh.MyParagraph.MyItemInfo.IsRNOPart) - { - stpTab = stpTab.TrimEnd() + "[R] "; - ii = ii.MyParent; - } - while (ii != null && !ii.IsSection) - { - tabPre = ii.MyTab.Text.Trim() + " " + tabPre; - ii = ii.MyParent; - } - stpTab = tabPre + stpTab; - } - AddContinuousAction(stpTab, GetContActStepText(pgh.MyParagraph.MyItemInfo), "", (pgh.MyParagraph.MyItemInfo.PageNumber + 1).ToString()); - //AddHighLevelStep(stpTab, pgh.MyParagraph.MyItemInfo.FormattedDisplayText, "", (pgh.MyParagraph.MyItemInfo.PageNumber + 1).ToString()); - //AddHighLevelStep(pgh.MyParagraph.MyItemInfo.MyTab.CleanText, pgh.MyParagraph.MyItemInfo.FormattedDisplayText, "", (pgh.MyParagraph.MyItemInfo.PageNumber + 1).ToString()); - if (pgh.MyChildren.Count > 0) // process the sub-steps under this parent - { - //StartSubStep(); - AddChildren(pgh, 1); - //FinishSubstep("", ""); - } - } - } - RepeatHeader(); - } - - private void AddChildren(pkParagraph pgh, int level) - //private void AddChildren(pkParagraph pgh, int level, ref bool conAct) - { - foreach (pkParagraph cpgh in pgh.MyChildren) - { - - if (cpgh.MyCautionsAndNotes.Count > 0) - AddNotesOrCautions(cpgh,level); - //AddNotesOrCautions(cpgh,level, ref conAct); - //if (!conAct) - // conAct = IsContinuousActionPlacekeeper(conAct, cpgh); - //ContinueSubStep(cpgh.MyParagraph.MyItemInfo.FormattedDisplayText, level); - string stpTab = cpgh.MyParagraph.MyItemInfo.MyTab.CleanText.Trim() + " "; - if (cpgh.MyParagraph.MyItemInfo.IsNote || cpgh.MyParagraph.MyItemInfo.IsCaution) - { - stpTab = string.Format("{0} ", cpgh.MyParagraph.MyParent.MyTab.Text.Trim()) + " " + stpTab; - } - //else if (!cpgh.MyParagraph.MyItemInfo.IsHigh) - //{ - // string tabPre = ""; - // ItemInfo ii = cpgh.MyParagraph.MyItemInfo.MyParent; - // while (ii != null && !ii.IsSection && !ii.IsHigh) - // { - // tabPre = ii.MyTab.Text.Trim() + " " + tabPre; - // ii = ii.MyParent; - // } - // stpTab = tabPre + stpTab; - //} - AddContinuousAction(stpTab, GetContActStepText(cpgh.MyParagraph.MyItemInfo), "", (cpgh.MyParagraph.MyItemInfo.PageNumber + 1).ToString()); - AddChildren(cpgh, level + 1); - //AddChildren(cpgh, level+1, ref conAct); - } - } - - private string GetContActStepText(ItemInfo myItemInfo) - { - string conActSumText = ""; - StepConfig sc = myItemInfo.MyConfig as StepConfig; - if (sc != null && sc.Step_AlternateContActSumText != null) - conActSumText = sc.Step_AlternateContActSumText; - if (conActSumText == "") - conActSumText = myItemInfo.FormattedDisplayText; - return conActSumText; - } - - private void AddNotesOrCautions(pkParagraph pgh, int level) - //private void AddNotesOrCautions(pkParagraph pgh, int level, ref bool conAct) - { - foreach (pkParagraph cpgh in pgh.MyCautionsAndNotes) - { - //if (!conAct) - // conAct = IsContinuousActionPlacekeeper(conAct, cpgh); - //ContinueNoteOrCaution(cpgh.MyParagraph.MyItemInfo, level); - string doneStr = ""; - string NoteCautionTab = string.Format("{0} NOTE: ", cpgh.MyParagraph.MyParent.MyTab.Text); - if (cpgh.MyParagraph.MyItemInfo.IsCaution) NoteCautionTab = string.Format("{0} CAUTION: ", cpgh.MyParagraph.MyParent.MyTab.Text); - AddContinuousAction(NoteCautionTab, GetContActStepText(cpgh.MyParagraph.MyItemInfo), doneStr, (cpgh.MyParagraph.MyItemInfo.PageNumber + 1).ToString()); - } - } - - //private static bool IsContinuousActionPlacekeeper(bool conAct, pkParagraph pkPar) - //{ - // StepConfig sc = pkPar.MyParagraph.MyItemInfo.MyConfig as StepConfig; - // conAct = (sc.Step_Placekeeper.ToUpper() == "C"); - // return conAct; - //} - - private void ContinueNoteOrCaution(ItemInfo ii, int level) - { - string NoteCautionTab = "NOTE: "; - if (ii.IsCaution) NoteCautionTab = "CAUTION: "; - if (!_FirstLine) _WordSel.TypeParagraph(); - _FirstLine = false; - SetIndent(.33F + (.31F * level), -.31F); - WriteCell(NoteCautionTab + ii.FormattedDisplayText, false, false); - } - //public void BuildSample() - //{ - // _WordSel.TypeText("Placekeeper"); - // _WordSel.TypeParagraph(); - // _WordApp.Visible = true; - // AddTable(); - // AddHeader(); - // AddSectionHeader("Section VI", "Title for section VI"); - // AddHighLevelStep("A.", TheQuickBrownFox, "C", "5"); - // AddSubStep(TheQuickBrownFox, "C", ""); - // AddCautionOrNote("NOTE:", "The Note text has a hanging indent on all but the first line of text", "", ""); - // AddHighLevelStep("B.", TheQuickBrownFox, "C", "7"); - // StartSubStep(); - // ContinueSubStep(TheQuickBrownFox, 1); - // ContinueSubStep(TheQuickBrownFox, 2); - // ContinueSubStep(TheQuickBrownFox, 2); - // ContinueSubStep(TheQuickBrownFox, 3); - // ContinueSubStep(TheQuickBrownFox, 3); - // ContinueSubStep(TheQuickBrownFox, 2); - // ContinueSubStep(TheQuickBrownFox, 1); - // FinishSubstep("", ""); - // AddHighLevelStep("C.", TheQuickBrownFox, "C", "8"); - // StartSubStep(); - // ContinueSubStep(TheQuickBrownFox, 1); - // ContinueSubStep(TheQuickBrownFox, 2); - // ContinueSubStep(TheQuickBrownFox, 2); - // ContinueSubStep(TheQuickBrownFox, 3); - // ContinueSubStep(TheQuickBrownFox, 3); - // ContinueSubStep(TheQuickBrownFox, 2); - // ContinueSubStep(TheQuickBrownFox, 1); - // FinishSubstep("", ""); - // RepeatHeader(); - //} - - private void RepeatHeader() - { - _WordTbl.Rows.First.Select(); - _WordSel.Rows.HeadingFormat = -1; - } - private bool _FirstSection = true; - private void AddTable() - { - _FirstSection = true; - _WordTbl = _WordDoc.Tables.Add(_WordSel.Range, 1, 4, 1, 0); - _WordTbl.TopPadding = 6F; - _WordTbl.BottomPadding = 6F; - LBColumn col = _WordTbl.Columns.First; - //col.SetWidth(12F, LBWdRulerStyle.wdAdjustNone); - //col = col.Next; - col.SetWidth(72 * .91F, LBWdRulerStyle.wdAdjustNone); - col = col.Next; - col.SetWidth(72 * 4.1F, LBWdRulerStyle.wdAdjustNone); - col = col.Next; - //col.SetWidth(72 * .81F, LBWdRulerStyle.wdAdjustNone); - col.SetWidth(72 * .76F, LBWdRulerStyle.wdAdjustNone); - col = col.Next; - //col.SetWidth(72 * .81F, LBWdRulerStyle.wdAdjustNone); - col.SetWidth(72 * .76F, LBWdRulerStyle.wdAdjustNone); - _WordTbl.Rows.AllowBreakAcrossPages = 0; - } - private void AddHeader() - { - //Advance(); - WriteCell("START", true, true); - //SetIndent(0.32F, -0F); - WriteCell("STEP CONTINUOUS ACTION", true, true); - WriteCell("DONE", true, true); - WriteCell("PAGE", true, false); - } - private void AddSectionHeader(string number, string title) - { - if (!_FirstSection) - { - Advance(5); - _WordSel.MoveLeft(LBWdUnits.wdCell, 1, false); - _WordSel.SelectRow(); - _WordSel.Cells.Merge(); - } - _FirstSection = false; - Advance(2); - SetIndent(0, 0); - WriteCell("SECTION " + number, true, false); - WriteCell(" " + title, false, true); - Advance(); - } - private float GetTextWidth(string txt) - { - System.Drawing.Font font = new System.Drawing.Font(_pkFont.Family, (float)_pkFont.Size); - iTextSharp.text.Font iFont = Volian.Svg.Library.VolianPdf.GetFont(font); - float w = 0; - foreach (char c in txt) - { - w += iFont.BaseFont.GetWidthPointKerned(c.ToString(), (float)_pkFont.Size); - } - // indented text didn't always line up doing it this way - //float w = iFont.BaseFont.GetWidthPointKerned(txt, (float)_pkFont.Size); - return w; - } - private void AddHighLevelStep(string number, string text, string done, string page) - { - //// if the text contains prerequisite steps, - //// parse out the step numbers and place them in the first column - //if (text.Contains(@"\{Prerequisite Step: ")) - //{ - // string prereqToken = @"\{Prerequisite Step: "; - // string preqStp = ""; - // int idx = text.IndexOf(prereqToken); - // while (idx >= 0) - // { - // int parseStart = idx+prereqToken.Length; - // int endx = text.IndexOf(@"\}",parseStart); - // int parseLen = endx - parseStart; - // preqStp += "("+text.Substring(parseStart, parseLen) + "), "; - // text = text.Remove(idx, endx+2 - idx); - // idx = text.IndexOf(prereqToken); - // } - // Advance(1); - // preqStp = preqStp.Substring(0, preqStp.Length - 2); // remove ending ", " - // WriteCell(preqStp, false, true); - //} - //else - Advance(2); - if (text.Contains("\x05")) // hanging indent character - { - string[] parts = text.Split("\x05".ToCharArray()); - float ind = (GetTextWidth(number) + GetTextWidth(parts[0])) / 72f; - SetIndent(ind, -ind); - WriteCell(number + parts[0] + parts[1], false, true); - } - else - { - SetIndent(.33F, -.33F); - WriteCell(number + text, false, true); - } - SetAlignment(LBWdParagraphAlignment.wdAlignParagraphCenter, LBWdCellVerticalAlignment.wdCellAlignVerticalBottom); - WriteCell(done, false, true); - SetAlignment(LBWdParagraphAlignment.wdAlignParagraphCenter, LBWdCellVerticalAlignment.wdCellAlignVerticalBottom); - WriteCell(page, false, false); - } - private void AddSubStep(string text, string done, string page) - { - Advance(2); - //SetIndent(.64F, -.31F); - //_WordSel.InsertSymbol(8226, _WordSel.Font, System.Reflection.Missing.Value, System.Reflection.Missing.Value); - //WriteCell("\u2022" + "\t" + text, false, true); // this will print out a bullet and a tab - WriteCell(text, false, true); - SetAlignment(LBWdParagraphAlignment.wdAlignParagraphCenter, LBWdCellVerticalAlignment.wdCellAlignVerticalBottom); - WriteCell(done, false, true); - SetAlignment(LBWdParagraphAlignment.wdAlignParagraphCenter, LBWdCellVerticalAlignment.wdCellAlignVerticalBottom); - WriteCell(page, false, false); - } - private bool _FirstLine = false; - private void StartSubStep() - { - _FirstLine = true; - Advance(2); - SetIndent(.64F, -.31F); - } - private void ContinueSubStep(string text, int level) - { - if(!_FirstLine) _WordSel.TypeParagraph(); - _FirstLine = false; - SetIndent(.33F + (.31F * level), -.31F); - //WriteCell("\u2022" + "\t" + text, false, false); // this will print out a bullet and a tab - WriteCell(text, false, false); - } - private void FinishSubstep(string done, string page) - { - Advance(); - SetAlignment(LBWdParagraphAlignment.wdAlignParagraphCenter, LBWdCellVerticalAlignment.wdCellAlignVerticalBottom); - WriteCell(done, false, true); - SetAlignment(LBWdParagraphAlignment.wdAlignParagraphCenter, LBWdCellVerticalAlignment.wdCellAlignVerticalBottom); - WriteCell(page, false, false); - } - private void AddCautionOrNote(string type, string text, string done, string page) - { - Advance(2); - SetIndent(.33F, -.33F); - WriteCell(type, true, false); - WriteCell(" " + text, false, true); - SetAlignment(LBWdParagraphAlignment.wdAlignParagraphCenter, LBWdCellVerticalAlignment.wdCellAlignVerticalBottom); - WriteCell(done, false, true); - SetAlignment(LBWdParagraphAlignment.wdAlignParagraphCenter, LBWdCellVerticalAlignment.wdCellAlignVerticalBottom); - WriteCell(page, false, false); - } - private void AddContinuousAction(string number, string text, string done, string page) - { - Advance(2); - //SetIndent(.33F, -.33F); - //WriteCell(type, true, false); - //WriteCell(" " + text, false, true); - if (text.Contains("\x05")) // hanging indent character - { - string[] parts = text.Split("\x05".ToCharArray()); - float ind = (GetTextWidth(number) + GetTextWidth(parts[0])) / 72f; - SetIndent(ind, -ind); - WriteCell(number + parts[0] + parts[1], false, true); - } - else - { - SetIndent(.33F, -.33F); - WriteCell(number + text, false, true); - } - SetAlignment(LBWdParagraphAlignment.wdAlignParagraphCenter, LBWdCellVerticalAlignment.wdCellAlignVerticalBottom); - WriteCell(done, false, true); - SetAlignment(LBWdParagraphAlignment.wdAlignParagraphCenter, LBWdCellVerticalAlignment.wdCellAlignVerticalBottom); - WriteCell(page, false, false); - } - static Regex rgx = new Regex(@"\\(b|ul|up[1-9]|dn0|up0|dn[1-9]|b0|ulnone)( |$|(?=\\))"); - private void WriteRTF(string text) - { - //if (text.Contains("\\")) - // Console.WriteLine("here"); - Match m = rgx.Match(text); - while (m.Success) - { - if (m.Index > 0) - _WordSel.TypeText(text.Substring(0,m.Index)); - switch (m.Groups[1].Value) - { - case "b": // bold on - _WordSel.Font.Bold = 1; - break; - case "b0": // bold off - _WordSel.Font.Bold = 0; - break; - case "ul": // underline on - _WordSel.Font.Underline = LBWdUnderline.wdUnderlineSingle; - break; - case "ulnone": // underline off - _WordSel.Font.Underline = LBWdUnderline.wdUnderlineNone; - break; - case "dn0": // superscript off - _WordSel.Font.Superscript = 0; - break; - case "up0": // subscript off - _WordSel.Font.Subscript = 0; - break; - default: - if (m.Groups[1].Value.StartsWith("dn"))// subscript on - _WordSel.Font.Subscript = 1; - else // superscript on - _WordSel.Font.Superscript = 1; - break; - - } - text = text.Substring(m.Index+m.Length); - m = rgx.Match(text); - } - _WordSel.TypeText(text); - } - private void WriteCell(string text, bool bold, bool advance) - { - _WordSel.Font.Name = _pkFont.Family;//"Arial"; - _WordSel.Font.Bold = bold ? 1 : 0; - //_WordSel.TypeText(text); - WriteRTF(text); - if (advance) Advance(); - } - private void SetIndent(float left, float first) - { - _WordSel.ParagraphFormat.LeftIndent = left * 72; - _WordSel.ParagraphFormat.FirstLineIndent = first * 72; - } - private void SetAlignment(LBWdParagraphAlignment hAlign, LBWdCellVerticalAlignment vAlign) - { - _WordSel.ParagraphFormat.Alignment = hAlign; - _WordSel.Cells.VerticalAlignment = vAlign; - } - private void Advance(int count) - { - _WordSel.MoveRight(LBWdUnits.wdCell, count, false); - } - private void Advance() - { - Advance(1); - } - public void Dispose() - { - _WordApp.Quit(false); - } - } -} diff --git a/PROMS/Volian.Print.Library/Grid2Pdf.cs.bak b/PROMS/Volian.Print.Library/Grid2Pdf.cs.bak deleted file mode 100644 index a8125038..00000000 --- a/PROMS/Volian.Print.Library/Grid2Pdf.cs.bak +++ /dev/null @@ -1,1536 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using C1.Win.C1FlexGrid; -using System.IO; -using Itenso.Rtf; -using Itenso.Rtf.Parser; -using Itenso.Rtf.Interpreter; -using Itenso.Rtf.Support; -using Volian.Print.Library; -using Volian.Controls.Library; -using iTextSharp.text; -using iTextSharp.text.pdf; -using VEPROMS.CSLA.Library; -using System.Text.RegularExpressions; - -namespace Volian.Print.Library -{ - #region Settings // RHM20150429 - Table Scrunch - public partial class vlnTable - { - private string _DebugInfo = null; // RHM20150429 - Table Scrunch - public string DebugInfo - { - get { return _DebugInfo; } - set { _DebugInfo = value; } - } - private int _ItemID = 0; - public int ItemID - { - get { return _ItemID; } - set { _ItemID = value; } - } - private bool _ShowDetails = false; - public bool ShowDetails - { - get { return _ShowDetails; } - set { _ShowDetails = value; } - } - private bool _IsTooBig = false; - public bool IsTooBig - { - get { return _IsTooBig; } - set { _IsTooBig = value; } - } - } - public partial class vlnCells - { - private static float YAdjust_HContent = 4; // 4 - private float YAdjust_SpacingAfter - { - get - { - return 8-8*MyTable.Adjustment;//0; // 8 - } - } - } - public partial class vlnCell - { - public bool ShowDetails - { get { return MyTable.ShowDetails; } } - private static float YAdjust_h = 0; // 0 - private float YAdjust_TextLocation - { - get - { - return 4 - 4 * MyTable.Adjustment; ;//0; // 4 - } - } - } - //public partial class vlnTable - //{ - // private static float YAdjust_RowTop = 0;//8; // 0 - //} - //public partial class vlnCells - //{ - // private static float YAdjust_HContent = 4; // 4 - // private static float YAdjust_SpacingAfter = 8;//0; // 8 - //} - //public partial class vlnCell - //{ - // private static float YAdjust_h = 0; // 0 - // private static float YAdjust_TextLocation = 4;//0; // 4 - //} - #endregion - public partial class vlnTable - { - #region Properties - private float[] _HContents;// RHM20150525 - Table Scrunch - public float[] HContents - { - get { return _HContents; } - set { _HContents = value; } - } - private float[] _RowTop; - public float[] RowTop - { - get { return _RowTop; } - set { _RowTop = value; } - } - private float[] _ColLeft; - public float[] ColLeft - { - get { return _ColLeft; } - set { _ColLeft = value; } - } - private VlnFlexGrid _MyFlexGrid; - public VlnFlexGrid MyFlexGrid - { - get { return _MyFlexGrid; } - set { _MyFlexGrid = value; } - } - private VlnBorders _MyBorders; - public VlnBorders MyBorders - { - get { return _MyBorders; } - set { _MyBorders = value; } - } - private iTextSharp.text.pdf.PdfContentByte _MyContentByte; - public iTextSharp.text.pdf.PdfContentByte MyContentByte - { - get { return _MyContentByte; } - set { _MyContentByte = value; } - } - private vlnCells _MyCells; - public vlnCells MyCells - { - get { return _MyCells; } - set { _MyCells = value; } - } - public float Height - { get - { - return RowTop[RowTop.Length - 1]; - } } - public float Width - { get - { - return ColLeft[ColLeft.Length - 1]; - } } - - private static float _XOffset = -1; // This moves the borders with respect to the text - public static float XOffset - { - get { return vlnTable._XOffset; } - set { vlnTable._XOffset = value; } - } - private static float _YOffset = 0; // This moves the borders with respect to the text - public static float YOffset - { - get { return vlnTable._YOffset; } - set { vlnTable._YOffset = value; } - } - private static float _LineThicknessForThin = .9F; - public static float LineThicknessForThin - { - get { return vlnTable._LineThicknessForThin; } - set { vlnTable._LineThicknessForThin = value; } - } - private static float _LineThicknessForThick = 1.8F; - public static float LineThicknessForThick - { - get { return vlnTable._LineThicknessForThick; } - set { vlnTable._LineThicknessForThick = value; } - } - private static float _LineThicknessForDouble = .6F; - public static float LineThicknessForDouble - { - get { return vlnTable._LineThicknessForDouble; } - set { vlnTable._LineThicknessForDouble = value; } - } - public static float DoubleLineOffset - { - get { return (LineThicknessForThick - LineThicknessForDouble) / 2; }//LineThicknessForThick - 2 * LineThicknessForDouble; } - } - private float _TotalContentHeight = 0;// RHM20150525 - Table Scrunc - public float TotalContentHeight - { - get - { - if (_TotalContentHeight == 0) - { - foreach (float h in HContents) - _TotalContentHeight += h; - } - return _TotalContentHeight; - } - } - public float SpaceAvailable// RHM20150525 - Table Scrunc - { - get { return TotalContentHeight ==0 ? 0 : RowTop[RowTop.Length - 1] - TotalContentHeight; } - } - private float _TooBig;// RHM20150525 - Table Scrunc - public float TooBig - { - get { return _TooBig; } - set - { - _TooBig = value; - //_Adjustment = Math.Min(1F, (_TooBig / (RowTop.Length - 1)) / 12); - //if (ShowDetails) Console.WriteLine("TooBig\t{0}\t{1}", value, _Adjustment); - //if(ShowDetails) Console.WriteLine("Before RowTop={0}", RowTop[RowTop.Length-1] ); - float extra=(TooBig < SpaceAvailable)?(SpaceAvailable - TooBig) / HContents.Length:0; - for (int r = 0; r < RowTop.Length - 1; r++) - RowTop[r + 1] = RowTop[r] + HContents[r] + extra; - //if(ShowDetails) Console.WriteLine("After RowTop={0}", RowTop[RowTop.Length-1] ); - } - } - private float _Adjustment = 0;// RHM20150525 - Table Scrunc - public float Adjustment - { - get { return _Adjustment; } - set { _Adjustment = value; } - } - //private float _YAdjust_RowTop = 0;//8; // 0 - public float YAdjust_RowTop - { - get - { - return _Adjustment * 12; - } - } - private void DrawRuler(PdfContentByte cb, float x, float yTop, float height)// RHM20150525 - Table Scrunc - { - VlnSvgPageHelper myPageHelper = cb.PdfWriter.PageEvent as VlnSvgPageHelper; - if (myPageHelper.DebugLayer != null) - { - cb.BeginLayer(myPageHelper.DebugLayer); - cb.SaveState(); - cb.SetLineWidth(.1F); - cb.SetColorStroke(new Color(System.Drawing.Color.Orange)); - float yBottom = yTop - height; - cb.MoveTo(x, yTop); - cb.LineTo(x, yBottom); - int i = 0; - for (float y = yTop; y >= yBottom; y -= 10) - { - float w = 10; - if (i % 10 == 0) w = 30; - else if (i % 5 == 0) w = 20; - cb.SetLineWidth(w / 30); - i++; - cb.MoveTo(x + w, y); - cb.LineTo(x, y); - cb.Stroke(); - } - i = 0; - cb.Stroke(); - cb.RestoreState(); - cb.EndLayer(); - } - } - private void ShowRowTops(string location)// RHM20150525 - Table Scrunc - { - if (!ShowDetails) return; - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < RowTop.Length; i++) - sb.Append("\t" + RowTop[i].ToString()); - Console.WriteLine(location + "\t" + sb.ToString()); - } - private void EndSetup()// RHM20150525 - Table Scrunc - { - if (ShowDetails) ShowRowTops("vlnTable.ctor.2"); - if (ShowDetails) Console.WriteLine("^^^^^^vlnTable============{0}===============", ItemID); - } - private void SetupDebug(VlnFlexGrid myFlexGrid)// RHM20150525 - Table Scrunc - { - //ShowDetails = myFlexGrid.GetMyItemInfo().InList(38329); - //if(ShowDetails) Console.WriteLine("vvvvvvlnTable============{0}===============", ItemID); - ItemInfo myItemInfo = myFlexGrid.GetMyItemInfo(); - ItemID = myItemInfo.ItemID; - DebugInfo = string.Format("DebugID = {0}, ID={1} Type={2} TypeName='{3}' StepLevel={4} ShortPath={5} Width={6} Left={7} YOffset={8}", - 0, myItemInfo.ItemID, myItemInfo.FormatStepType, myItemInfo.FormatStepData == null ? "NoStepData" : myItemInfo.FormatStepData.Type, - myItemInfo.StepLevel, myItemInfo.ShortPath, Width, XOffset, YOffset); - } - #endregion - #region Constructors - public vlnTable(VlnFlexGrid myFlexGrid, iTextSharp.text.pdf.PdfContentByte myContentByte) - { - MyFlexGrid = myFlexGrid; - MyContentByte = myContentByte; - InitializeSizes(); - SetupDebug(myFlexGrid);// RHM20150525 - Table Scrunc - MyCells = new vlnCells(this, MyFlexGrid, MyContentByte); - EndSetup();// RHM20150525 - Table Scrunc - } - #endregion - #region Private Methods - private void InitializeSizes() - { - RowTop = new float[MyFlexGrid.Rows.Count + 1]; - HContents = new float[MyFlexGrid.Rows.Count];// RHM20150525 - Table Scrunc - RowTop[0] = 0; - for (int r = 0; r < MyFlexGrid.Rows.Count; r++) - RowTop[r + 1] = RowTop[r] + 72 * (MyFlexGrid.Rows[r].Height == -1 - ? MyFlexGrid.Rows.DefaultSize : MyFlexGrid.Rows[r].Height) / (float)MyFlexGrid.DPI; - ColLeft = new float[MyFlexGrid.Cols.Count + 1]; - ColLeft[0] = 0; - for (int c = 0; c < MyFlexGrid.Cols.Count; c++) - ColLeft[c + 1] = 2 + ColLeft[c] + 72 * (MyFlexGrid.Cols[c].Width == -1 // RHM20150429 - Table Scrunch - ? MyFlexGrid.Cols.DefaultSize : MyFlexGrid.Cols[c].Width) / (float)MyFlexGrid.DPI; - } - #endregion - #region Public Methods - public void AdjustRowTop(int row1, int row2, float hNew) - { - float hAdjust = hNew - (RowTop[row2 + 1] - RowTop[row1]); - for (int r = row2; r < MyFlexGrid.Rows.Count; r++) - RowTop[r + 1] += hAdjust; - } - public void ToPdf(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top) - { - //ZoomGrid(myColumnText, left, top); - if(ShowDetails) Console.WriteLine("vvvvvvToPdf============{0}===============", ItemID);// RHM20150525 - Table Scrunc - ShowRowTops("ToPDF1"); - PdfContentByte cb = myColumnText.Canvas; // RHM20150429 - Table Scrunch - VlnSvgPageHelper myPageHelper = cb.PdfWriter.PageEvent as VlnSvgPageHelper; - string myLPI = myPageHelper.YMultiplier == 1.0F ? ",6LPI" : ",7LPI"; - Rtf2Pdf.DrawPdfDebug(myColumnText.Canvas, left-2, top+1, left + Width, top-myPageHelper.YMultiplier *(Height+1), - DebugInfo+", Height= " + (myPageHelper.YMultiplier * Height).ToString() + myLPI, 0); - PdfLayer textLayer = myPageHelper == null ? null : myPageHelper.TextLayer; // RHM20150429 - Table Scrunch - if (textLayer != null) cb.BeginLayer(textLayer); - myPageHelper.AddGap(top, top - Height, left, left + Width); - MyCells.ToPdf(myColumnText, left, top); - DrawRuler(myColumnText.Canvas, left + Width, top, myPageHelper.YMultiplier * (Height + 1)); // RHM20150429 - Table Scrunch - if (textLayer != null) cb.EndLayer(); - ShowRowTops("ToPDF2"); - if (ShowDetails) Console.WriteLine("^^^^^^ToPdf============{0}===============", ItemID); - } - private void ZoomGrid(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top) - { - PdfDestination dest = new PdfDestination(PdfDestination.FITR, left - 4, top - Height - 4, left + Width, top + 4); - myColumnText.Canvas.SetAction(PdfAction.GotoLocalPage(myColumnText.Canvas.PdfWriter.CurrentPageNumber, dest, myColumnText.Canvas.PdfWriter), left, top - Height, left + Width, top); - } - #endregion - } - public partial class vlnCells : List // RHM20150429 - Table Scrunch - { - #region Properties - private VlnFlexGrid _MyFlexGrid; - public VlnFlexGrid MyFlexGrid - { - get { return _MyFlexGrid; } - set { _MyFlexGrid = value; } - } - private vlnTable _MyTable; - public vlnTable MyTable - { - get { return _MyTable; } - set { _MyTable = value; } - } - public bool ShowDetails// RHM20150525 - Table Scrunc - { get { return MyTable.ShowDetails; }} - private iTextSharp.text.pdf.PdfContentByte _MyContentByte; - public iTextSharp.text.pdf.PdfContentByte MyContentByte - { - get { return _MyContentByte; } - set { _MyContentByte = value; } - } - #endregion - #region Constructors - public vlnCells(vlnTable myTable, VlnFlexGrid myFlexGrid, iTextSharp.text.pdf.PdfContentByte myContentByte) - { - MyTable = myTable; - MyFlexGrid = myFlexGrid; - MyContentByte = myContentByte; - SetupCells(); - foreach(vlnCell cell in this) - { - myTable.MyBorders = VlnBorders.Get(myFlexGrid.MyBorders.ConvertToString()); - GridLinePattern glp = cell.AboveLeftSide; - glp = cell.AboveRightSide; - glp = cell.BelowLeftSide; - glp = cell.BelowRightSide; - glp = cell.RightOfBottomSide; - glp = cell.RightOfTopSide; - object ta = cell.TextAlign; - } - } - #endregion - #region Private Methods - private void SetupCells() - { - // Create a ColumnText to determine the cell heights - iTextSharp.text.pdf.ColumnText myColumnText1 = new iTextSharp.text.pdf.ColumnText(MyContentByte); - // Walk through - for (int r = 0; r < MyFlexGrid.Rows.Count; r++) - { - float hMax = 12; // RHM20150429 - Table Scrunch - for (int c = 0; c < MyFlexGrid.Cols.Count; c++) - { - CellRange cr = MyFlexGrid.GetMergedRange(r, c); - if (cr.r1 == r && cr.c1 == c) - { - float w = MyTable.ColLeft[cr.c2 + 1] - MyTable.ColLeft[cr.c1]; - float h = MyTable.RowTop[cr.r2 + 1] - MyTable.RowTop[cr.r1]; - string str = MyFlexGrid.GetCellRTFString(r, c) ?? string.Empty; - if (str.Contains(@"\cf")) - { - str = System.Text.RegularExpressions.Regex.Replace(str, @"\\cf[0-9]\\", @"\"); - str = System.Text.RegularExpressions.Regex.Replace(str, @"\\cf[0-9] ", @""); - } - // the FreeMono font is used for the editor, but VESymbFix is used for printing - // The font spefication is embeded in the table text so we need to change the font reference from - // FreeMono to VESymbFix before we print the table - if (str.ToUpper().Contains("FREEMONO")) - str = str.Replace("FreeMono", "VESymbFix"); - DisplayText dt = new DisplayText(MyFlexGrid.GetMyItemInfo(), str, false); - str = dt.StartText; - str = PreProcessRTF(w, str); - - // If the font is not proportional, pass the symbol font through to RtfToParagraph. It is needed - // in underlying code to set the chunk's font if the first character of a cell is a hardspace. Without - // this, pdfs were using the Helvetica font, which is a default itextsharp font. - ItemInfo ii = MyFlexGrid.GetMyItemInfo(); - iTextSharp.text.Font ff = null; - if (!ii.FormatStepData.Font.FontIsProportional()) - ff = Volian.Svg.Library.VolianPdf.GetFont("VESymbFix", (int)ii.FormatStepData.Font.Size, (int)ii.FormatStepData.Font.WindowsFont.Style); - iTextSharp.text.Paragraph myPara = RtfToParagraph(str, ff); - - myColumnText1.SetSimpleColumn(0, 0, w-2, MyContentByte.PdfDocument.PageSize.Top); // Padding = 4 - if (str.Contains(@"\'05")) - { - // if there is a hanging indent, the iTextSharp paragraph properties must be set - // to print the indent. Replace the indent 'token' with a non-used symbol, this will - // create a chunk with that symbol. Then loop through all of the chunks until we find - // this symbol, adding up the widths to that point. This width is the value that - // needs to be used to set the indent. - // Notes: - // A hard return will reset the chkW (indent width) back to zero. - // We jump out of the processing loop after the first indent token is found and ignor any other ones - float chkW = CalculateHangingIndent(str); - myPara.IndentationLeft = chkW; - myPara.FirstLineIndent = -chkW; - } - Match match = Regex.Match(str, @"\\fi([-0-9]*) ?\\li([0-9]*)"); - if (match.Success) - { - float fi = float.Parse(match.Groups[1].Value) / 20; // 72 is dots per inch & 96 is standard DPI (120 is KBR's machine) - float li = float.Parse(match.Groups[2].Value) / 20; - // if there is a hanging indent, the iTextSharp paragraph properties must be set - // to print the indent. - myPara.IndentationLeft = li; - myPara.FirstLineIndent = fi; - } - // RHM 20120925 - Line spacing should be 6 lines per inch. In order to get a valid value - // for TotalLeading you have to set MultipliedLeading first: - myPara.MultipliedLeading = 1.0f; - // once there is valid value for TotalLeading (from previous line), you can use it to - // calculate a MultipliedLeading to give 6 LPI (12 points) - myPara.MultipliedLeading = 12.0f / myPara.TotalLeading; - myPara.SpacingAfter = 8; // RHM 20120925 - Add a line to properly space text from lines. - if(Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase2)) // RHM20150429 - Table Scrunch - myPara.SpacingAfter = 0;// YAdjust_SpacingAfter; // RHM 20120925 - Add a line to properly space text from lines. - FixHyphens(myPara, MyTable); - if (Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase3)) - TrimNewlines(myPara); // RHM20150429 - Table Scrunch - myColumnText1.AddElement(myPara); - //myColumnText1.Canvas.SetColorFill(PrintOverride.OverrideTextColor(System.Drawing.Color.Black)); - float posBefore = myColumnText1.YLine; - int status = myColumnText1.Go(true); - float posAfter = myColumnText1.YLine; - float hContent = 4 + posBefore - posAfter; - if (Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase4))// RHM20150525 - Table Scrunc - { - hContent = 0 + posBefore - posAfter;//YAdjust_HContent + posBefore - posAfter; - // if (myPara.Chunks.Count > 0 && myPara.Chunks[myPara.Chunks.Count - 1] == "\n") - // hContent -= 12; - } - //if(ShowDetails) Console.WriteLine("{0}\t{1}\t{2}",r,c, hContent/12); - if (cr.r1 == cr.r2) - hMax = Math.Max(hMax, hContent); - else - hMax = Math.Max(hMax, hContent - (cr.r2 - cr.r1) * _SixLinesPerInch); - if (hContent > h) - { // RHM20150429 - Table Scrunch - //if (ShowDetails) Console.WriteLine("Less {0},{1},{2},{3},{4},{5}", r, c, posBefore, posAfter, hContent, hMax); - MyTable.AdjustRowTop(cr.r1, cr.r2, hContent); - } // RHM20150429 - Table Scrunch - if (Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase5)) - { - //if (ShowDetails) Console.WriteLine("Greater{0},{1},{2},{3},{4},{5}", r, c, posBefore, posAfter, hContent, hMax); - //if (c == MyFlexGrid.Cols.Count - 1) - //MyTable.AdjustRowTop(cr.r1, cr.r2, hMax + 6); - MyTable.HContents[cr.r2] = hMax+2; - } - Add(new vlnCell(cr.r1, cr.c1, cr.r2, cr.c2, MyTable, myPara,hContent)); - } - } - } - } - private void ShowChunks(System.Collections.ArrayList chunks) // RHM20150429 - Table Scrunch - { - StringBuilder sb = new StringBuilder(); - foreach (Chunk chk in chunks) - { - sb.Append(BuildChunks(chk.Content)); - } - //if (ShowDetails) Console.WriteLine("Chunks = '{0}'", sb.ToString()); - } - private string BuildChunks(string str) - { - StringBuilder sb = new StringBuilder(); - foreach(char c in str) - { - if (((int)c) < 0x20 || ((int)c) > 0x7F) - sb.Append(string.Format("<{0:X4}>",(int)c)); - else - sb.Append(c); - } - return "{" + sb.ToString() + "}"; - } - private void TrimNewlines(Paragraph myPara) - { - while (myPara.Count > 0 && ParaEndsWithNewLine(myPara)) - myPara.RemoveAt(myPara.Count - 1); - } - private bool ParaEndsWithNewLine(Paragraph myPara) - { - Chunk chk = myPara[myPara.Count - 1] as Chunk; - if (chk == null) return false; - if (chk.Content == "\n") return true; - return false; - } - public class VlnSplitCharacter : ISplitCharacter - { - public bool IsSplitCharacter(int start, int current, int end, char[] cc, PdfChunk[] ck) - { - return (cc[current] == ' '); - } - public bool IsSplitCharacter(char c) - { - return (c == ' '); - } - } - public static VlnSplitCharacter mySplitter = new VlnSplitCharacter(); - internal static void FixHyphens(Paragraph myPara, vlnTable myTable) - { - // Find chunk with hardhyphen - - // If a hard hyphen is found, the remove it and add a dash (keyboard minus sign) to the beginning - // of the text that follows it. - int hype=-1; - Font fnt = null; - while ((hype = GetHyphen(myPara)) > -1) - { - fnt = null; - if (hype > 0) - { - Chunk chk1 = (Chunk)myPara[hype - 1]; - if (hype > 1 && chk1.Content.Equals("\n")) - chk1 = (Chunk)myPara[hype - 2]; - fnt = chk1.Font; // use the font of the text that follows the hyphen (dash) - } - else if (hype < myPara.Count - 1) - { - Chunk chk2 = (Chunk)myPara[hype + 1]; - if (hype != 0 && !chk2.Content.Equals("\n")) - fnt = chk2.Font; // use the font of the text that follows the hyphen (dash) - } - if (fnt == null) - { - // if there was no text following the hypen, then use the font defined for tables in the plant's format - VEPROMS.CSLA.Library.VE_Font vfnt = myTable.MyFlexGrid.GetMyItemInfo().FormatStepData.Font; - System.Drawing.Font ffont = new System.Drawing.Font(vfnt.Family, (float)vfnt.Size); - fnt = Volian.Svg.Library.VolianPdf.GetFont(ffont); - fnt.SetStyle(myPara.Font.Style); - fnt.SetColor(myPara.Font.Color.R,myPara.Font.Color.G,myPara.Font.Color.B); - } - Chunk chk = (Chunk)myPara[hype]; - // THIS CODE IS USED FOR DEBUGGING - //if (!fnt.Familyname.StartsWith("L")) - //{ - // Console.WriteLine("font = {0}", makeitpretty(fnt)); - // Console.WriteLine("Hype = {0}\r\n{1}",hype, myPara.Content); - // if (hype > 0) - // { - // Chunk chk3 = (Chunk)myPara[hype - 1]; - // Console.WriteLine("before '{0}'", chk3.Content); - // } - // Chunk chk4 = (Chunk)myPara[hype]; - // Console.WriteLine("during '{0}'", chk4.Content); - // if (hype < myPara.Count -1) - // { - // Chunk chk5 = (Chunk)myPara[hype + 1]; - // Console.WriteLine("after '{0}'", chk5.Content); - // } - //} - string prefix = ""; - if (chk.Content == "\u2011" && hype < (myPara.Count - 1)) - { - myPara.RemoveAt(hype);// Remove standalone hyphen - chk = (Chunk)myPara[hype]; - prefix = "-"; - } - myPara.RemoveAt(hype); - myPara.Insert(hype, new Chunk(prefix + chk.Content.Replace("\u2011", "-"), fnt)); - } - } - - // THIS FUNCTION IS USED FOR DEBUGGING - private static string makeitpretty(Font fnt) - { - return string.Format("font {0}, size {1}, style {2}", fnt.Familyname, fnt.Size, fnt.Style); - } - - private static int GetHyphen(Paragraph myPara) - { - int index=0; - foreach (Chunk chk in myPara.Chunks) - if (chk.Content.Contains("\u2011")) - return index; - else - index++; - return -1; - } - public static float CalculateHangingIndent(string rtf) - { - float chkW = 0; - // **** This is intened to be a temporary fix for V.C.Summer **** - // Two procedures would not print: A-2 SAG in Summer's SAMG set, and SAG-3 in Summer's PWOG DAMG set. - // These procedures have tables with hanging indents and use the Letter Gothic Tall font. - // It appears that the font information for the hanging indent character is not included in the RTF - // for those table cells. - // This piece of code checks for the existance of a font definition of \f1 which is need for the \u9999? indent character - // If the a font definition of \f1 is not found then the indent character is removed. This will allow the procedure to print - // but the text in that table cell will not be indented. - jsj 10/10/2014 - //IRtfDocument rtfDoc2 = RtfInterpreterTool.BuildDoc(rtf.Replace(@"\'05", @"\f1 \u9999? \f0 ")); - IRtfDocument rtfDoc2 = null; - //if (rtf.Contains(@"\f1\fnil\fcharset0 ")) - // rtfDoc2 = RtfInterpreterTool.BuildDoc(rtf.Replace(@"\'05", @"\f1 \u9999? \f0 ")); - //else - //{ - // first add the symbol font and then surround the indent as above. - rtfDoc2 = RtfInterpreterTool.BuildDoc(rtf.Replace(@"\'05", @"\par\u9999?\par")); - //} - - Rtf2iTextSharp rtf2IText2 = new Rtf2iTextSharp(rtfDoc2); - iTextSharp.text.Paragraph para2 = rtf2IText2.Convert(); - for (int ic = 0; ic < para2.Chunks.Count; ic++) - { - Chunk chk = para2.Chunks[ic] as Chunk; - if (chk.Content[0] == 9999) break; - if (chk.Content.Contains("\u270f")) - { - int i = chk.Content.IndexOf('\u270F'); - int n = chk.Content.Length; - chkW += chk.GetWidthPoint() * i / (n - i); - break; - } - if (chk.Content.Contains("\n")) - { - if (ic < para2.Chunks.Count - 2 && (para2.Chunks[ic + 1] as Chunk).Content.StartsWith("\u270f")) return chkW; - chkW = 0; //hard return - reset chkW (indent start) - } - chkW += chk.GetWidthPoint(); - } - return chkW; - } - - private static StepRTB _StatRTB = new StepRTB(); - private string PreProcessRTF(float w, string str) - { - _StatRTB.Text = string.Empty; - _StatRTB.Width = (int)w; - _StatRTB.Font = MyFlexGrid.Font; - if (str.StartsWith(@"{\rtf")) - // The 'Replace(@" \ulnone", @"\u160?\ulnone")' was added so that data in VEWCN SUR_WTC - // tables would print. There were a number of tables, for example in STN NB-106/8.1.6, - // that had a series of spaces underlined and these spaces were not underlined in the - // generated pdf. It seems that there is a problem somewhere in the rtb -> itextsharp - // level. This fixed the immediate problem. If there is 'b0' (bold off) after the - // space before the 'ulnone' the following won't work. Also, this change was not - // made in the non-table code. If the problem occurs there, it should be added. - _StatRTB.Rtf = str.Replace(@"\~", @"\u160?").Replace(@" \ulnone", @"\u160?\ulnone"); - else - _StatRTB.Text = str; - _StatRTB.SelectAll(); - _StatRTB.SelectionColor = PrintOverride.OverrideTextColor(System.Drawing.Color.Black); - str = _StatRTB.Rtf; - return str; - } - public static iTextSharp.text.Paragraph RtfToParagraph(string rtf, iTextSharp.text.Font mySymFont) - { - IRtfDocument rtfDoc = RtfInterpreterTool.BuildDoc(rtf); - Rtf2iTextSharp rtf2IText = new Rtf2iTextSharp(rtfDoc); - rtf2IText.DefaultFont = mySymFont; - iTextSharp.text.Paragraph para = rtf2IText.Convert(); - para.SetLeading(_SixLinesPerInch, 0); - return para; - } - private static float _SixLinesPerInch = 12; // twips - #endregion - #region Public Methods - public void ToPdf(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top) - { - foreach (vlnCell myCell in this) - myCell.ToPdf(myColumnText, left, top); - } - #endregion - } - public partial class vlnCell // RHM20150429 - Table Scrunch - { - #region Properties - private vlnTable _MyTable; - public vlnTable MyTable - { - get { return _MyTable; } - set { _MyTable = value; } - } - public VlnBorders MyBorders - { - get { return _MyTable.MyBorders; } - } - private int _r1; - public int r1 - { - get { return _r1; } - set { _r1 = value; } - } - private int _c1; - public int c1 - { - get { return _c1; } - set { _c1 = value; } - } - private int _r2; - public int r2 - { - get { return _r2; } - set { _r2 = value; } - } - private int _c2; - public int c2 - { - get { return _c2; } - set { _c2 = value; } - } - private iTextSharp.text.Paragraph _MyPara; - public iTextSharp.text.Paragraph MyPara - { - get { return _MyPara; } - set { _MyPara = value; } - } - private float _HContent; - public float HContent - { - get { return _HContent; } - set { _HContent = value; } - } - #endregion - #region Line Pattern Diagram - /* - The diagram below identifies the various border names for the cell in the center - - |-AboveLeftSide |-AboveRightSide - | | - | | - | | - LeftOfTopSide | TopSide | RightOfTopSide - ------------------|-------------------|------------------ - | | - | | - |-LeftSide |-RightSide - | | - | | - LeftOfBottomSide | BottomSide | RightOfBottomSide - --------------------------------------|------------------ - | | - | | - | | - | | - |-BelowLeftSide |-BelowRightSide - */ - - #endregion - #region Horizontal Line Patterns - private GridLinePattern _TopSide = GridLinePattern.Unknown; - public GridLinePattern TopSide - { - get - { - if (_TopSide == GridLinePattern.Unknown) - _TopSide = MyBorders.HorizontalLines[r1, c1]; - return _TopSide; - } - } - private GridLinePattern _BottomSide = GridLinePattern.Unknown; - public GridLinePattern BottomSide - { - get - { - if (_BottomSide == GridLinePattern.Unknown) - _BottomSide = MyBorders.HorizontalLines[r2 + 1, c2]; - return _BottomSide; - } - } - private GridLinePattern _RightOfTopSide = GridLinePattern.Unknown; - public GridLinePattern RightOfTopSide - { - get - { - if (_RightOfTopSide == GridLinePattern.Unknown) - { - if (c2 == MyTable.MyFlexGrid.Cols.Count - 1) - _RightOfTopSide = GridLinePattern.None; - else - { - CellRange cr = MyTable.MyFlexGrid.GetMergedRange(r1, c2 + 1); - if (cr.r1 == r1) - _RightOfTopSide = MyBorders.HorizontalLines[r1, c2 + 1]; - else - _RightOfTopSide = GridLinePattern.None; - } - } - return _RightOfTopSide; - } - } - private GridLinePattern _LeftOfTopSide = GridLinePattern.Unknown; - public GridLinePattern LeftOfTopSide - { - get - { - if (_LeftOfTopSide == GridLinePattern.Unknown) - { - if (c1 == 0) - _LeftOfTopSide = GridLinePattern.None; - else - { - // This property is only used if c1==0 or r1==0: - // A merged range for row = 0 will always return an r1=0. - CellRange cr = MyTable.MyFlexGrid.GetMergedRange(r1, c1 - 1); - if (cr.r1 == r1) - _LeftOfTopSide = MyBorders.HorizontalLines[r1, c1 - 1]; - else // Since this section of code is only entered when r1==0, this else condition should never happen - _LeftOfTopSide = GridLinePattern.None; - } - } - return _LeftOfTopSide; - } - } - private GridLinePattern _RightOfBottomSide = GridLinePattern.Unknown; - public GridLinePattern RightOfBottomSide - { - get - { - if (_RightOfBottomSide == GridLinePattern.Unknown) // Need to consider Merged Cells - { - if (c2 == MyTable.MyFlexGrid.Cols.Count - 1) - _RightOfBottomSide = GridLinePattern.None; - else - { - CellRange cr = MyTable.MyFlexGrid.GetMergedRange(r2, c2 + 1); - if (cr.r2 == r2) - _RightOfBottomSide = MyBorders.HorizontalLines[r2 + 1, c2 + 1]; - else - _RightOfBottomSide = GridLinePattern.None; - } - } - return _RightOfBottomSide; - } - } - private GridLinePattern _LeftOfBottomSide = GridLinePattern.Unknown; - public GridLinePattern LeftOfBottomSide - { - get - { - if (_LeftOfBottomSide == GridLinePattern.Unknown) // Need to consider Merged Cells - { - if (c1 == 0) - _LeftOfBottomSide = GridLinePattern.None; - else - { - CellRange cr = MyTable.MyFlexGrid.GetMergedRange(r2, c1 - 1); - if (cr.r2 == r2) - _LeftOfBottomSide = MyBorders.HorizontalLines[r2 + 1, c1 - 1]; - else - _LeftOfBottomSide = GridLinePattern.None; - } - } - return _LeftOfBottomSide; - } - } - #endregion - #region Vertical Line Patterns - private GridLinePattern _LeftSide = GridLinePattern.Unknown; - public GridLinePattern LeftSide - { - get - { - if (_LeftSide == GridLinePattern.Unknown) - _LeftSide = MyBorders.VerticalLines[r1, c1]; - return _LeftSide; - } - } - private GridLinePattern _RightSide = GridLinePattern.Unknown; - public GridLinePattern RightSide - { - get - { - if (_RightSide == GridLinePattern.Unknown) - _RightSide = MyBorders.VerticalLines[r2, c2 + 1]; - return _RightSide; - } - } - private GridLinePattern _BelowRightSide = GridLinePattern.Unknown; - public GridLinePattern BelowRightSide - { - get - { - if (_BelowRightSide == GridLinePattern.Unknown) - { - if (r2 == MyTable.MyFlexGrid.Rows.Count - 1) - _BelowRightSide = GridLinePattern.None; - else - { - CellRange cr = MyTable.MyFlexGrid.GetMergedRange(r2 + 1, c2); - if (cr.c2 == c2) - _BelowRightSide = MyBorders.VerticalLines[r2 + 1, c2 + 1]; - else - _BelowRightSide = GridLinePattern.None; - } - } - return _BelowRightSide; - } - } - private GridLinePattern _AboveRightSide = GridLinePattern.Unknown; - public GridLinePattern AboveRightSide - { - get - { - if (_AboveRightSide == GridLinePattern.Unknown) - { - if (r1 == 0) - _AboveRightSide = GridLinePattern.None; - else - { - CellRange cr = MyTable.MyFlexGrid.GetMergedRange(r1 - 1, c2); - if (cr.c2 == c2) - _AboveRightSide = MyBorders.VerticalLines[r1 - 1, c2 + 1]; - else - _AboveRightSide = GridLinePattern.None; - } - } - return _AboveRightSide; - } - } - private GridLinePattern _BelowLeftSide = GridLinePattern.Unknown; - public GridLinePattern BelowLeftSide - { - get - { - if (_BelowLeftSide == GridLinePattern.Unknown) - { - if (r2 == MyTable.MyFlexGrid.Rows.Count - 1) - _BelowLeftSide = GridLinePattern.None; - else - { - CellRange cr = MyTable.MyFlexGrid.GetMergedRange(r2 + 1, c1); - if (cr.c1 == c1) - _BelowLeftSide = MyBorders.VerticalLines[r2 + 1, c1]; - else - _BelowLeftSide = GridLinePattern.None; - } - } - return _BelowLeftSide; - } - } - private GridLinePattern _AboveLeftSide = GridLinePattern.Unknown; - public GridLinePattern AboveLeftSide - { - get - { - if (_AboveLeftSide == GridLinePattern.Unknown) - { - if (r1 == 0) - _AboveLeftSide = GridLinePattern.None; - else - { - // This property is only used if c1==0 or r1==0: - // A merged range for col = 0 will always return an c1=0. - CellRange cr = MyTable.MyFlexGrid.GetMergedRange(r1 - 1, c1); - if (cr.c1 == c1) - _AboveLeftSide = MyBorders.VerticalLines[r1 - 1, c1]; - else // Since this section of code is only entered when c1==0, this else condition should never happen - _AboveLeftSide = GridLinePattern.None; - } - } - return _AboveLeftSide; - } - } - #endregion - #region Static Properties - private static float XOffset { get { return vlnTable.XOffset; } } - private static float YOffset { get { return vlnTable.YOffset; } } - private static float LineThicknessForThin { get { return vlnTable.LineThicknessForThin; } } - private static float LineThicknessForThick { get { return vlnTable.LineThicknessForThick; } } - private static float LineThicknessForDouble { get { return vlnTable.LineThicknessForDouble; } } - private static float DoubleLineOffset { get { return vlnTable.DoubleLineOffset; } } - - // adjustments for line intersections: - private static float ThickOverDouble { get { return ((2 * DoubleLineOffset) + LineThicknessForDouble - LineThicknessForThick) / 2; } } - private static float ThickUnderDouble { get { return DoubleLineOffset + (LineThicknessForThick - LineThicknessForDouble) / 2; } } - private static float ThickOverThin { get { return (LineThicknessForThin - LineThicknessForThick) / 2; } } - private static float ThinOverThick { get { return (LineThicknessForThick - LineThicknessForThin) / 2; } } - private static float ThinUnderDouble { get { return DoubleLineOffset + (LineThicknessForThin - LineThicknessForDouble) / 2; } } - private static float ThinOverDouble { get { return (DoubleLineOffset + LineThicknessForThin - LineThicknessForDouble) / 2; } } - private static float DoubleUnderThin { get { return (LineThicknessForThin - LineThicknessForDouble) / 2; } } - private static float DoubleUnderThick { get { return (LineThicknessForThick - LineThicknessForDouble) / 2; } } - #endregion - #region Constructors - public vlnCell(int r1, int c1, int r2, int c2, vlnTable myTable, iTextSharp.text.Paragraph myPara, float hContent) - { - this.r1 = r1; - this.c1 = c1; - this.r2 = r2; - this.c2 = c2; - MyTable = myTable; - MyPara = myPara; - HContent = hContent; - } - #endregion - #region Public Methods - public override string ToString() - { - return string.Format("{0}:{1}", r1, c1); - } - public void ToPdf(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top) - { - myColumnText.Canvas.SaveState(); - VlnSvgPageHelper _MyPageHelper = myColumnText.Canvas.PdfWriter.PageEvent as VlnSvgPageHelper; - float mult = _MyPageHelper.YMultiplier; - float x = MyTable.ColLeft[c1]; - float w = MyTable.ColLeft[c2 + 1] - x; - float y = mult * MyTable.RowTop[r1]; - float h = mult * MyTable.RowTop[r2 + 1] - y; - if (Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase6))// RHM20150525 - Table Scrunc - { - h = YAdjust_h + mult * MyTable.RowTop[r2 + 1] - y; - - } - BordersToPdf(myColumnText, left, top, x, w, y, h ); - float hAdjust = VeritcalTextAlignment(h,_MyPageHelper.YMultiplier); - iTextSharp.text.pdf.ColumnText myColumnText1 = new iTextSharp.text.pdf.ColumnText(myColumnText.Canvas); - float adjustTextLocation = mult * 4; // RHM 20120925 Move text down about 1 half line from the border - if (Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase7))// RHM20150525 - Table Scrunc - { - adjustTextLocation = mult * 0; - if (mult != 1F) adjustTextLocation=1; - } - myColumnText1.SetSimpleColumn(1 + left + x, top - y - h , left + x + w - 2, 1 + top - y - hAdjust - adjustTextLocation); // 2 == Default Padding - if (ShowDetails) Console.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t\"{9}\"" - , r1, c1, hAdjust, adjustTextLocation, y, h, top, 1 + top - y - hAdjust - adjustTextLocation, - _MyPageHelper.YMultiplier, MyPara.Content.Substring(0, Math.Min(20, MyPara.Content.Length))); - MyPara.MultipliedLeading *= _MyPageHelper.YMultiplier; - vlnCells.FixHyphens(MyPara, MyTable); - myColumnText1.AddElement(MyPara); - foreach(object obj in MyPara) - { - if(obj is iTextSharp.text.Image) - { - iTextSharp.text.Image img = obj as iTextSharp.text.Image; - img.SetAbsolutePosition(left,top-h); - img.ScaleAbsoluteWidth(w); - img.ScaleAbsoluteHeight(h); - myColumnText.Canvas.AddImage(img); - } - } - float posBefore = myColumnText1.YLine; // RHM20150429 - Table Scrunch - myColumnText1.Go(); - float posAfter = myColumnText1.YLine; // RHM20150429 - Table Scrunch - if(ShowDetails)Console.WriteLine("ToPDF posBefore,posAfter,difference={0},{1},{2},{3}", - posBefore, posAfter, posBefore - posAfter,w); - myColumnText.Canvas.RestoreState(); - } - private static float _SixLinesPerInch = 12; // twips - public bool IsRangeStyleNull = false; - private TextAlignEnum? _TextAlign = null; - public TextAlignEnum? TextAlign - { - get - { - if (_TextAlign == null) - { - CellRange cr = MyTable.MyFlexGrid.GetCellRange(r1, c1, r2, c2); - if (cr.Style == null) - { - IsRangeStyleNull = true; - return _TextAlign; - } - else - { - IsRangeStyleNull = false; - _TextAlign = cr.Style.TextAlign; - } - } - return (TextAlignEnum)_TextAlign; - } - } - #endregion - #region Private Text Methods - private float VeritcalTextAlignment(float h, float mult) - { - float hAdjust = 0; - //CellRange cr = MyTable.MyFlexGrid.GetCellRange(r1, c1, r2, c2); - if (!IsRangeStyleNull) - { - switch (TextAlign) - { - case TextAlignEnum.CenterBottom: - case TextAlignEnum.GeneralBottom: - case TextAlignEnum.LeftBottom: - case TextAlignEnum.RightBottom: - hAdjust = Math.Max(0,h - (mult * HContent) )-1; - //Console.WriteLine("\"Bottom\",{0},{1},{2}", h, HContent, hAdjust); - break; - case TextAlignEnum.CenterCenter: - case TextAlignEnum.GeneralCenter: - case TextAlignEnum.LeftCenter: - case TextAlignEnum.RightCenter: - hAdjust = Math.Max(0,(h - (mult * HContent)) / 2)-1; - //Console.WriteLine("\"Middle\",{0},{1},{2}", h, HContent, hAdjust); - break; - default: - break; - } - } - return hAdjust; - } - #endregion - #region Private Border Methods - // coordinate system is upside down of screen. 0,0 on screen is top/left. 0,0 on pdf is bottom/left. - // i.e. x is same, y is flipped. - private void BordersToPdf(iTextSharp.text.pdf.ColumnText myColumnText, float left, float top, float x, float w, float y, float h) - { - PdfContentByte cb = myColumnText.Canvas; - cb.SaveState();// Save state before drawing borders - //SetOpacity(cb, .7F); // This line makes the borders transparent for testing - float xLeft = left + x + XOffset; - float yTop = top - y + YOffset; - float xRight = left + x + w + XOffset; - float yBottom = top - y - h + YOffset; - // ZoomToCell(myColumnText, xLeft, yTop, xRight, yBottom); - // Draw Top Side for the first row - if (r1 == 0) - DrawHorizontalLine(cb, "Top", xLeft, xRight, yTop, TopSide, LeftSide, AboveLeftSide, LeftOfTopSide, AboveRightSide, RightSide, RightOfTopSide); - // Draw Left Side for the first column - if (c1 == 0) - DrawLineVertical(cb, "Left", xLeft, yBottom, yTop, LeftSide, BottomSide, LeftOfBottomSide, BelowLeftSide, LeftOfTopSide, TopSide, AboveLeftSide); - // Draw Bottom Side - DrawHorizontalLine(cb, "Bottom", xLeft, xRight, yBottom, BottomSide, BelowLeftSide, LeftSide, LeftOfBottomSide, RightSide, BelowRightSide, RightOfBottomSide); - // Draw Right Side - DrawLineVertical(cb, "Right", xRight, yBottom, yTop, RightSide, RightOfBottomSide, BottomSide, BelowRightSide, TopSide, RightOfTopSide, AboveRightSide); - cb.RestoreState(); - } - private void DrawHorizontalLine(PdfContentByte cb, string side, float xStart, float xEnd, float y, GridLinePattern LinePattern, - GridLinePattern startToLeft, GridLinePattern startToRight, GridLinePattern startAhead, - GridLinePattern endToLeft, GridLinePattern endToRight, GridLinePattern endAhead) - { - if (LinePattern != GridLinePattern.None) - { - float direction = (xStart < xEnd) ? 1 : -1; - InitializeLineStyle(cb); - SetLineColor(cb, r1, c1, side); - if (LinePattern == GridLinePattern.Double) - { - // Top Line - float dStart = -direction * DoubleIntersectionRight(startToLeft, startToRight, startAhead); - float dEnd = direction * DoubleIntersectionLeft(endToLeft, endToRight, endAhead); - DrawLine(cb, LineThicknessForDouble, xStart + dStart, y + DoubleLineOffset, xEnd + dEnd, y + DoubleLineOffset); - // Bottom Line - dStart = -direction * DoubleIntersectionLeft(startToLeft, startToRight, startAhead); - dEnd = direction * DoubleIntersectionRight(endToLeft, endToRight, endAhead); - DrawLine(cb, LineThicknessForDouble, xStart + dStart, y - DoubleLineOffset, xEnd + dEnd, y - DoubleLineOffset); - } - else if (LinePattern != GridLinePattern.Thick) - { - SetLinePattern(cb, LinePattern); - float dStart = -direction * ThinIntersection(startToLeft, startToRight, startAhead); - float dEnd = direction * ThinIntersection(endToLeft, endToRight, endAhead); - DrawLine(cb, LineThicknessForThin, xStart + dStart, y, xEnd + dEnd, y); - } - else - { - float dStart = -direction * ThickIntersection(startToLeft, startToRight, startAhead); - float dEnd = direction * ThickIntersection(endToLeft, endToRight, endAhead); - DrawLine(cb, LineThicknessForThick, xStart + dStart, y, xEnd + dEnd, y); - } - cb.Stroke(); - } - } - private void DrawLineVertical(PdfContentByte cb, string side, float x, float yStart, float yEnd, GridLinePattern LinePattern, - GridLinePattern startToLeft, GridLinePattern startToRight, GridLinePattern startAhead, - GridLinePattern endToLeft, GridLinePattern endToRight, GridLinePattern endAhead) - { - if (LinePattern != GridLinePattern.None) - { - float direction = (yStart < yEnd) ? 1 : -1; - InitializeLineStyle(cb); - SetLineColor(cb, r1, c1, side); - if (LinePattern == GridLinePattern.Double) - { - //Left Line - float dStart = -direction * DoubleIntersectionRight(startToLeft, startToRight, startAhead); - float dEnd = direction * DoubleIntersectionLeft(endToLeft, endToRight, endAhead); - DrawLine(cb, LineThicknessForDouble, x - DoubleLineOffset, yStart + dStart, x - DoubleLineOffset, yEnd + dEnd); - //Right Line - dStart = -direction * DoubleIntersectionLeft(startToLeft, startToRight, startAhead); - dEnd = direction * DoubleIntersectionRight(endToLeft, endToRight, endAhead); - DrawLine(cb, LineThicknessForDouble, x + DoubleLineOffset, yStart + dStart, x + DoubleLineOffset, yEnd + dEnd); - } - else if (LinePattern != GridLinePattern.Thick) - { - SetLinePattern(cb, LinePattern); - float dStart = -direction * ThinIntersection(startToLeft, startToRight, startAhead); - float dEnd = direction * ThinIntersection(endToLeft, endToRight, endAhead); - DrawLine(cb, LineThicknessForThin, x, yStart + dStart, x, yEnd + dEnd); - } - else - { - float dStart = -direction * ThickIntersection(startToLeft, startToRight, startAhead); - float dEnd = direction * ThickIntersection(endToLeft, endToRight, endAhead); - DrawLine(cb, LineThicknessForThick, x, yStart + dStart, x, yEnd + dEnd); - } - cb.Stroke(); - } - } - #endregion - #region Intersection Diagram - /* driving into an intersection on line being drawn, facing the intersection. Each intersection requires - * drawing of each of the four cases: - - Case 1: Line being drawn right: - - lineToLeft - ^ - | - Line Being Drawn ----->|---> LineAhead - | - v - lineToRight - - - Case 2: Line being drawn left: - - lineToRight - ^ - | - LineAhead <-----|<--- Line Being Drawn - | - v - lineToLeft - - Case 3: Line being drawn up: - - lineAhead - ^ - | - lineToLeft <-----|----> lineToRight - ^ - | - | - Line Being Drawn - - Case 4: Line being drawn down: - - Line Begin Drawn - | - | - v - lineToRight <-----|----> lineToLeft - | - | - v - lineAhead - * - */ - #endregion - #region Border Intersection Methods - private static float DoubleIntersectionLeft(GridLinePattern lineToLeft, GridLinePattern lineToRight, GridLinePattern lineAhead) - { - if (lineToLeft == GridLinePattern.Double) - return -DoubleLineOffset; - if (lineToRight == GridLinePattern.Double || lineAhead == GridLinePattern.Double) - return DoubleLineOffset; - if (lineToLeft == GridLinePattern.Thick || lineToRight == GridLinePattern.Thick) - return DoubleUnderThick; - if (VlnBorders.LineWidth(lineToLeft) == 1 || VlnBorders.LineWidth(lineToRight) == 1) - return DoubleUnderThin; - return 0; - } - private static float DoubleIntersectionRight(GridLinePattern lineToLeft, GridLinePattern lineToRight, GridLinePattern lineAhead) - { - if (lineToRight == GridLinePattern.Double) - return -DoubleLineOffset; - if (lineToLeft == GridLinePattern.Double || lineAhead == GridLinePattern.Double) - return DoubleLineOffset; - if (lineToLeft == GridLinePattern.Thick || lineToRight == GridLinePattern.Thick) - return DoubleUnderThick; - if (VlnBorders.LineWidth(lineToLeft) == 1 || VlnBorders.LineWidth(lineToRight) == 1) - return DoubleUnderThin; - return 0; - } - private static float ThinIntersection(GridLinePattern lineToLeft, GridLinePattern lineToRight, GridLinePattern lineAhead) - { - if (lineToLeft == GridLinePattern.Double && lineToRight == GridLinePattern.Double) - return -ThinUnderDouble; - if (lineToLeft == GridLinePattern.Double || lineToRight == GridLinePattern.Double) - { - if (lineAhead == GridLinePattern.Double) return -ThinUnderDouble; - return ThinOverDouble; - } - if (lineToLeft == GridLinePattern.Thick || lineToRight == GridLinePattern.Thick) - return ThinOverThick; - return 0; - } - private static float ThickIntersection(GridLinePattern lineToLeft, GridLinePattern lineToRight, GridLinePattern lineAhead) - { - if (lineToLeft == GridLinePattern.Double && lineToRight == GridLinePattern.Double) - { - if (lineAhead == GridLinePattern.Thick) return ThickOverDouble; - return -ThickUnderDouble; - } - if ( lineToLeft == GridLinePattern.Double || lineToRight == GridLinePattern.Double) - { - if (lineAhead == GridLinePattern.Double) - { - if (lineToLeft == GridLinePattern.Thick || lineToRight == GridLinePattern.Thick) - return ThickOverDouble; - return -ThickUnderDouble; - } - return ThickOverDouble; - } - if (VlnBorders.LineWidth(lineToLeft) == 1 && VlnBorders.LineWidth(lineToRight) == 1) - return ThickOverThin; - return 0; - } - #endregion - #region Basic Border Methods - private static void DrawLine(PdfContentByte cb, float lineThickness, float xStart, float yStart, float xEnd, float yEnd) - { - cb.SetLineWidth(lineThickness); - cb.MoveTo(xStart, yStart); - cb.LineTo(xEnd, yEnd); - } - private static void SetLinePattern(PdfContentByte cb, GridLinePattern linePattern) - { - if (linePattern == GridLinePattern.Dotted) - { - cb.SetLineDash(0, 2, 0); - cb.SetLineCap(PdfContentByte.LINE_CAP_ROUND); - } - else if (linePattern == GridLinePattern.Dashed) - cb.SetLineDash(4, 4, 0); - } - private static void SetLineColor(PdfContentByte cb, int row, int col, string side) - { - iTextSharp.text.Color lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Black)); - //switch (side) - //{ - // case "Top": - // if (col == 0) lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Blue)); - // else lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Cyan)); - // break; - // case "Left": - // if (row == 0) lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Red)); - // else lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Magenta)); - // break; - // case "Bottom": - // if (col == 0) lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Green)); - // else lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Cyan)); - // break; - // case "Right": - // if (row == 0) lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Orange)); - // else lineColor = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Magenta)); - // break; - //} - cb.SetColorStroke(lineColor); - } - private static void InitializeLineStyle(PdfContentByte cb) - { - cb.SetLineCap(PdfContentByte.LINE_CAP_PROJECTING_SQUARE); // Extend the line by half of it's thickness - cb.SetLineDash(0);// Solid Line - } - #endregion - #region Debug Methods - private static void SetOpacity(PdfContentByte cb, float opacity) - { - PdfGState gs = new PdfGState(); - gs.StrokeOpacity = opacity; - cb.SetGState(gs); - } - private static void ZoomToCell(iTextSharp.text.pdf.ColumnText myColumnText, float xLeft, float yTop, float xRight, float yBottom) - { - PdfDestination dest = new PdfDestination(PdfDestination.FITR, xLeft - 4, yBottom , xRight, yTop + 4); - myColumnText.Canvas.SetAction(PdfAction.GotoLocalPage(myColumnText.Canvas.PdfWriter.CurrentPageNumber, dest, myColumnText.Canvas.PdfWriter), xLeft, yBottom, xRight, yTop); - } - #endregion - #region Old Border Methods - //private void DrawLeftLine(PdfContentByte cb, float xLeft, float yTop, float yBottom) - //{ - // if (c1 == 0 && LineLeft != GridLinePattern.None) - // { - // InitializeLineStyle(cb); - // SetLineColor(cb, r1, c1, "Left"); - // if (LineLeft == GridLinePattern.Double) - // { - // //Left Line - // float dyTop = DoubleIntersectionLeft(LineTopLeft, LineTop, LineLeftAbove); - // float dyBottom = -DoubleIntersectionRight(LineBottom, LineBottomLeft, LineLeftBelow); - // DrawLine(cb, LineThicknessForDouble, xLeft - DoubleLineOffset, yTop + dyTop, xLeft - DoubleLineOffset, yBottom + dyBottom); - // //Right Line - // dyTop = DoubleIntersectionRight(LineTopLeft, LineTop, LineLeftAbove); - // dyBottom = -DoubleIntersectionLeft(LineBottom, LineBottomLeft, LineLeftBelow); - // DrawLine(cb, LineThicknessForDouble, xLeft + DoubleLineOffset, yTop + dyTop, xLeft + DoubleLineOffset, yBottom + dyBottom); - // } - // else if (LineLeft != GridLinePattern.Thick) - // { - // SetLinePattern(cb, LineLeft); - // float dyTop = ThinIntersection(LineTopLeft, LineTop, LineLeftAbove); - // float dyBottom = -ThinIntersection(LineBottom, LineBottomLeft, LineLeftBelow); - // DrawLine(cb, LineThicknessForThin, xLeft, yTop + dyTop, xLeft, yBottom + dyBottom); - // } - // else - // { - // float dyTop = ThickIntersection(LineTopLeft, LineTop, LineLeftAbove); - // float dyBottom = -ThickIntersection(LineBottom, LineBottomLeft, LineLeftBelow); - // DrawLine(cb, LineThicknessForThick, xLeft, yTop + dyTop, xLeft, yBottom + dyBottom); - // } - // cb.Stroke(); - // } - //} - //private void DrawRightLine(PdfContentByte cb, float xRight, float yTop, float yBottom) - //{ - // if (LineRight != GridLinePattern.None) - // { - // InitializeLineStyle(cb); - // SetLineColor(cb, r1, c1, "Right"); - // if (LineRight == GridLinePattern.Double) - // { - // //Left Line - // float dyTop = DoubleIntersectionLeft(LineTop, LineTopRight, LineRightAbove); - // float dyBottom = -DoubleIntersectionRight(LineBottomRight, LineBottom, LineRightBelow); - // DrawLine(cb, LineThicknessForDouble, xRight - DoubleLineOffset, yTop + dyTop, xRight - DoubleLineOffset, yBottom + dyBottom); - // //Right Line - // dyTop = DoubleIntersectionRight(LineTop, LineTopRight, LineRightAbove); - // dyBottom = -DoubleIntersectionLeft(LineBottomRight, LineBottom, LineRightBelow); - // DrawLine(cb, LineThicknessForDouble, xRight + DoubleLineOffset, yTop + dyTop, xRight + DoubleLineOffset, yBottom + dyBottom); - // } - // else if (LineRight != GridLinePattern.Thick) - // { - // float dyTop = ThinIntersection(LineTop, LineTopRight, LineRightAbove); - // float dyBottom = -ThinIntersection(LineBottomRight, LineBottom, LineRightBelow); - // SetLinePattern(cb, LineRight); - // DrawLine(cb, LineThicknessForThin, xRight, yTop + dyTop, xRight, yBottom + dyBottom); - // } - // else - // { - // float dyTop = ThickIntersection(LineTop, LineTopRight, LineRightAbove); - // float dyBottom = -ThickIntersection(LineBottomRight, LineBottom, LineRightBelow); - // DrawLine(cb, LineThicknessForThick, xRight, yTop + dyTop, xRight, yBottom + dyBottom); - // } - // cb.Stroke(); - // } - //} - //private void DrawTopLine(PdfContentByte cb, float xLeft, float xRight, float yTop) - //{ - // if (r1 == 0 && TopSide != GridLinePattern.None) - // { - // InitializeLineStyle(cb); - // SetLineColor(cb, r1, c1, "Top"); - // if (TopSide == GridLinePattern.Double) - // { - // // Top Line - // float dxLeft = -DoubleIntersectionRight(LeftSide, AboveLeftSide, LeftOfTopSide); - // float dxRight = DoubleIntersectionLeft(AboveRightSide, RightSide, RightOfTopSide); - // DrawLine(cb, LineThicknessForDouble, xLeft + dxLeft, yTop + DoubleLineOffset, xRight + dxRight, yTop + DoubleLineOffset); - // // Bottom Line - // dxLeft = -DoubleIntersectionLeft(LeftSide, AboveLeftSide, LeftOfTopSide); - // dxRight = DoubleIntersectionRight(AboveRightSide, RightSide, RightOfTopSide); - // DrawLine(cb, LineThicknessForDouble, xLeft + dxLeft, yTop - DoubleLineOffset, xRight + dxRight, yTop - DoubleLineOffset); - // } - // else if (TopSide != GridLinePattern.Thick) - // { - // SetLinePattern(cb, TopSide); - // float dxLeft = -ThinIntersection(LeftSide, AboveLeftSide, LeftOfTopSide); - // float dxRight = ThinIntersection(AboveRightSide, RightSide, RightOfTopSide); - // DrawLine(cb, LineThicknessForThin, xLeft + dxLeft, yTop, xRight + dxRight, yTop); - // } - // else - // { - // float dxLeft = -ThickIntersection(LeftSide, AboveLeftSide, LeftOfTopSide); - // float dxRight = ThickIntersection(AboveRightSide, RightSide, RightOfTopSide); - // if (c1 == 0) - // Console.WriteLine("'{0}','{1}','{2}',{3},{4}", LeftSide, AboveLeftSide, LeftOfTopSide, dxLeft, ThickOverThin); - // DrawLine(cb, LineThicknessForThick, xLeft + dxLeft, yTop, xRight + dxRight, yTop); - // } - // cb.Stroke(); - // } - //} - //private void DrawBottomLine(PdfContentByte cb, float xLeft, float xRight, float yBottom) - //{ - // if (BottomSide != GridLinePattern.None) - // { - // InitializeLineStyle(cb); - // SetLineColor(cb, r1, c1, "Bottom"); - // if (BottomSide == GridLinePattern.Double) - // { - // // Top Line - // float dxLeft = -DoubleIntersectionRight(BelowLeftSide, LeftSide, LeftOfBottomSide); - // float dxRight = DoubleIntersectionLeft(RightSide, BelowRightSide, RightOfBottomSide); - // DrawLine(cb, LineThicknessForDouble, xLeft + dxLeft, yBottom + DoubleLineOffset, xRight + dxRight, yBottom + DoubleLineOffset);// Top Line - // // Bottom Line - // dxLeft = -DoubleIntersectionLeft(BelowLeftSide, LeftSide, LeftOfBottomSide); - // dxRight = DoubleIntersectionRight(RightSide, BelowRightSide, RightOfBottomSide); - // DrawLine(cb, LineThicknessForDouble, xLeft + dxLeft, yBottom - DoubleLineOffset, xRight + dxRight, yBottom - DoubleLineOffset);//Bottom Line - // } - // else if (BottomSide != GridLinePattern.Thick) // Bottom line is thin. Determine if intersecting with double: - // { - // SetLinePattern(cb, BottomSide); - // float dxLeft = -ThinIntersection(BelowLeftSide, LeftSide, LeftOfBottomSide); - // float dxRight = ThinIntersection(RightSide, BelowRightSide, RightOfBottomSide); - // DrawLine(cb, LineThicknessForThin, xLeft + dxLeft, yBottom, xRight + dxRight, yBottom); - // } - // else - // { - // float dxLeft = -ThickIntersection(BelowLeftSide, LeftSide, LeftOfBottomSide); - // float dxRight = ThickIntersection(RightSide, BelowRightSide, RightOfBottomSide); - // DrawLine(cb, LineThicknessForThick, xLeft + dxLeft, yBottom, xRight + dxRight, yBottom); - // } - // cb.Stroke(); - // } - //} - #endregion - } -} diff --git a/PROMS/Volian.Print.Library/Pagination.cs.bak b/PROMS/Volian.Print.Library/Pagination.cs.bak deleted file mode 100644 index e8b16a3b..00000000 --- a/PROMS/Volian.Print.Library/Pagination.cs.bak +++ /dev/null @@ -1,443 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using VEPROMS.CSLA.Library; -using Volian.Base.Library; -using iTextSharp.text.pdf; -using Volian.Svg.Library; - -namespace Volian.Print.Library -{ - public partial class vlnParagraph - { - /// - /// This variable is used to match 16 bit pagination - /// - private bool _Match16BitPagination = false; - /// - /// Dtermines if the current step is preceded by a Page Break - /// - /// - /// - /// - /// - /// 0 - No page break - /// 1 - Break on High Level Step - /// 2 - Break within a Step - /// 3 - Break on High Level Step (SevenLinesPerInch) - /// - private int Paginate(float yLocation, float yTopMargin, float yBottomMargin) - { - float yPageSize = yTopMargin - yBottomMargin; - - // TODO: This does not account for a long step as the last step that would exceed more than one page and - // that has an end message that needs to be accounted for in determining pagination. To do that the last - // child should be the only paragraph that accounts for the End message. - // - // If last step & there should be an end message, pagination tests need to account for the 3 lines the end - // message uses. The 3 is for a line above, the end message line & the line below (in case there is a border/box line). - - // The 3 was changed to 2 for the end line & the line below. The blank line below the step gives the blank - // line above the end message, thus 2 not 3. This change was made on July 20, 2011 by RHM & KBR. The - // procedure in questions was VEWCNEMG\EMGAPP.PRC, ES-01, Step 8. - bool ManualPageBreak = false; - float yEndMsg = !MyItemInfo.IsSection && MyItemInfo.MyHLS.NextItem == null && (MyItemInfo.MyDocStyle.End.Message ?? "") != "" ? 2 * SixLinesPerInch : 0; - float yWithinMargins = CalculateYLocation(yLocation, yTopMargin) - yBottomMargin; // -SixLinesPerInch; - bool isFirstChild = MyItemInfo.MyPrevious == null; - bool nearTheTop = (yWithinMargins < yPageSize) && (yWithinMargins > (yPageSize - 5 * SixLinesPerInch)); - // if step is breaking over a number of pages, determine if the current step is the - // location of a pagebreak. - if (MyPageHelper.ParaBreaks.Count > 0) - { - if (this == MyPageHelper.ParaBreaks[0] || this.YTopMost > MyPageHelper.ParaBreaks[0].YTopMost) - { - MyPageHelper.ParaBreaks.RemoveAt(0); - //Console.WriteLine("'PageBreak',6,'Yes','Page Break within Step',{0},{1},{2},{3}, {4},'{5}'", MyItemInfo.ItemID, YSize, 0, 0, 0, MyItemInfo.ShortPath); - //Console.WriteLine("Prev = {0}", MyItemInfo.MyPrevious==null ? "''" : MyItemInfo.DBSequence); - ShowPageBreak(1, "Page Break within Step", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); - return 2; // break on this item within a step - } - return 0; // this is not an item with a break - } - float mySize = YSize * MyPageHelper.YMultiplier; - vlnParagraph firstChild = ChildrenBelow.Count > 0 ? ChildrenBelow[0] : null; - // Steps that have the smart template (the WCNCKL format for example), always include two children. - if (MyItemInfo.IsHigh && MyItemInfo.FormatStepData.UseSmartTemplate && ChildrenBelow.Count > 1) - firstChild = ChildrenBelow[1]; - if (firstChild != null && !firstChild.MyItemInfo.IsNumbered) // If not numbered get the last child - firstChild = firstChild.MyParent.ChildrenBelow[firstChild.MyParent.ChildrenBelow.Count - 1]; - float ySizeIncludingFirst = firstChild == null ? YSize : firstChild.YSize + (firstChild.YTopMost - YTopMost); - bool KeepStepsOnPage = MyItemInfo.ActiveFormat.MyStepSectionLayoutData.KeepStepsOnPage; - if (MyItemInfo.IsStepSection) - { - if (yLocation < yTopMargin) // continuous section - { - if (ChildrenBelow == null || ChildrenBelow.Count == 0) - { - // see if there is an end message. This is stored in the helper - if there is, - // we need to be sure that there is room for it. - if (MyPageHelper.BottomMessage != null) - { - if (mySize + yEndMsg <= yWithinMargins) return 1; - } - return 0; - } - - // This is a continuous section. There may be cases where the user put a manual page - // break on the first step (child) in the section. if so, break on the section. The - // flag SectionPageBreak is set to true to flag that a pagebreak should not be done - // on that first step. - StepConfig sc = firstChild.MyItemInfo.MyConfig as StepConfig; - ManualPageBreak = MyPageHelper.OriginalPageBreak ? (sc == null ? false : sc.Step_ManualPagebreak) : - sc == null ? false : sc.Step_NewManualPagebreak; - if (ManualPageBreak) - { - SectionPageBreak = true; - ShowPageBreak(2, "Section Page Break", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); - return 1; - } - // can the title and the first step fit? - // add the first child's size + (the section title's size) - //if (ySizeIncludingFirst > (yLocation - yBottomMargin - SixLinesPerInch)) return 1; - //if (ySizeIncludingFirst > (yLocation - yBottomMargin) && ySizeIncludingFirst < yPageSize) - vlnParagraph firstStepChild = firstChild; - //while (firstStepChild.MyItemInfo.IsSection && firstStepChild.ChildrenBelow.Count > 0) firstStepChild = firstStepChild.ChildrenBelow[0]; - if(firstStepChild.MyItemInfo.IsNumbered) - while (firstStepChild.ChildrenBelow.Count > 0 && (firstStepChild.MyItemInfo.IsSection || firstStepChild.MyItemInfo.IsHigh)) - { - firstStepChild = firstStepChild.ChildrenBelow[0]; - if (!firstStepChild.MyItemInfo.IsNumbered) - { - firstStepChild = firstStepChild.MyParent.ChildrenBelow[firstStepChild.MyParent.ChildrenBelow.Count-1]; - break; - } - } - else - firstStepChild = firstStepChild.MyParent.ChildrenBelow[firstStepChild.MyParent.ChildrenBelow.Count-1]; - float ySizeIncludingFirstStep = firstStepChild.YSize + (firstStepChild.YTopMost - YTopMost); - bool firstSubstepExceedsSpaceAvailable = ySizeIncludingFirstStep > yWithinMargins; - if (KeepStepsOnPage && firstSubstepExceedsSpaceAvailable && !isFirstChild) - KeepStepsOnPage = false; - if (!KeepStepsOnPage && ySizeIncludingFirst > (yLocation - yBottomMargin)) - { - ShowPageBreak(4, "Page Break Before Continuous Step Section", "Yes", YSize, yPageSize, yWithinMargins, ManualPageBreak); - return 1; - } - } - return 0; // Don't Paginate (page break) on a Step Section if it's first thing on page - } - if (!MyItemInfo.IsHigh) return 0; // Don't Paginate on a Substep level - StepConfig sc1 = MyItemInfo.MyConfig as StepConfig; - ManualPageBreak = MyPageHelper.OriginalPageBreak ? (sc1 == null ? false : sc1.Step_ManualPagebreak) : - sc1 == null ? false : sc1.Step_NewManualPagebreak; - if (MyItemInfo.FirstSibling == MyItemInfo && ManualPageBreak) - { - // if parent/section used this pagebreak, skip it. - if (MyParent.SectionPageBreak) - { - ManualPageBreak = false; - MyParent.SectionPageBreak = false; - } - } - if (_Match16BitPagination) mySize = YSize; - float ySize7LPI = YSize; // +SixLinesPerInch; - if (_Match16BitPagination) ySize7LPI += SixLinesPerInch; - string firstStep = "No"; - if (MyItemInfo.IsHigh && MyItemInfo.MyPrevious == null) - firstStep = "Yes"; - //if (!ManualPageBreak && mySize + yEndMsg <= yWithinMargins) // Don't Paginate if there is enough room, will fit on page - // Pagination Fix - Break1LineShort1 - float yExtra = (yWithinMargins == yPageSize ? 0 : SixLinesPerInch - MyItemInfo.MyDocStyle.Layout.FooterLength) ?? 0; - float yExtra2 = (SixLinesPerInch - MyItemInfo.MyDocStyle.Layout.FooterLength) ?? 0; - if (KeepStepsOnPage && ySizeIncludingFirst > yWithinMargins) - KeepStepsOnPage = false; - bool KeepWithHeader = isFirstChild && nearTheTop; - if (!ManualPageBreak && mySize + yEndMsg <= yWithinMargins + yExtra) // Don't Paginate if there is enough room, will fit on page - //if (!ManualPageBreak && mySize + yEndMsg <= yWithinMargins + SixLinesPerInch) // Don't Paginate if there is enough room, will fit on page - { - //Console.WriteLine("'PageBreak',1,'No','HLS will fit on page',{0},{1},{2}, {3}, {4},'{5}'", MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize), MyItemInfo.ShortPath); - ShowPageBreak(-1, "HLS will fit on page", firstStep, YSize, yPageSize, yWithinMargins,ManualPageBreak); - return 0; - } - // !MyItemInfo.IsHigh - if (MyItemInfo.IsRNOPart && MyParent.XOffset < XOffset) return 0; // Don't paginate on an RNO to the right - - // YSize includes a blank line after the step which we don't want to include in the page break test, thus the - // YSize - SixLinesPerInch: - // yPageSizeNextPage is the page size of the 'next' page. A format variable exists off of the docstyle - // For UseOnFirstPage vs UseOnAllButFirstPage. If this is set for this format, and processing the FIRST - // page, the size of next page, which may be different, is used in pagination calculationstop. - // If this format flag is not set, or not printing the first page of the section with this flag, - // this next page size is the same as current page size. - float yPageSizeNextPage = yPageSize; - //if (firstStep == "No") - // ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin); - if (MyPageHelper.DidFirstPageDocStyle && (MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnAllButFirstPage) > 0) - yPageSizeNextPage = GetYPageSizeUseOnAllButFirstPage(); - if (!KeepWithHeader && !KeepStepsOnPage && YSize - SixLinesPerInch + yEndMsg <= yPageSizeNextPage) // if the entire step can fit on one page, do a page break - { - // Don't want extra line before step - //Console.WriteLine("'PageBreak',2,'Yes','HLS will fit on 1 Page',{0},{1},{2}, {3}, {4},'{5}'", MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize), MyItemInfo.ShortPath); - // A page break will occur before the step is put out. ShowPageBreak with first argument of -1 is NOT a page break. - ShowPageBreak(5, "HLS will fit on 1 Page at 6 LPI", "Yes", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); - return 1; - } - // TODO - yEndMsg - compressed size? - - // ySize7LPI includes a blank line after the step which we don't want to include in the page break test. - else if (!KeepStepsOnPage && MyItemInfo.ActiveFormat.MyStepSectionLayoutData.CompressSteps && (ySize7LPI - SixLinesPerInch) < (yPageSizeNextPage * SixLinesPerInch / _SevenLinesPerInch)) - { - //Console.WriteLine("'PageBreak',3,'Yes','HLS will fit on 1 Page at 7 LPI',{0},{1},{2}, {3}, {4},'{5}'", MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize), MyItemInfo.ShortPath); - ShowPageBreak(7, "HLS will fit on 1 Page at 7 LPI", "Yes", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); - //Console.WriteLine("'7LPI',{0},{1}", MyItemInfo.DBSequence, YSize); - return 3; // High Level Step can fit at SevenLinesPerInch - } - else // The entire step cannot fit on a blank page or KeepStepsOnPage is true. - { - // if there is more than half a page left, then start to print on the current page - float myFirstPieceSize = GetFirstPieceSize(); //Case 0 - if (_Match16BitPagination) myFirstPieceSize += 2 * SixLinesPerInch; - // TODO: Put this line back to case 0, i.e. previous line. This fixes a 16-bit vs 32-bit pagination diff in EO30 Step 20. - //float myFirstPieceSize = GetFirstPieceSize() + 2 * SixLinesPerInch; //Case 10 - this is to match 16bit - //is the amount of space left (yWithinMargins) is greater than 1/2 of the current page (yPageSize / 2): - if (KeepWithHeader ||( !ManualPageBreak && ((MyItemInfo.ActiveFormat.MyStepSectionLayoutData.SpecialPageBreakFlag && yWithinMargins > yPageSize / 2 && - myFirstPieceSize < yWithinMargins) || KeepStepsOnPage))) - { - //Console.WriteLine("'PageBreak',4,'No','HLS will have to split anyway',{0},{1},{2}, {3}, {4},'{5}'", MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize), MyItemInfo.ShortPath); - // yPageSize is space on next page. This may be different if the format flag 'UseOnAllButFirst' is - // set. - // yWithinMargins is space available on current page. - // if the HLS is part of a Smart Template (i.e. WCNCKL table), don't add in an extra line because - // that makes pagination work incorrectly because the Smart Template has a 'table' line after the - // text. - float ySpaceOnFirstPage = yWithinMargins + (MyItemInfo.FormatStepData.UseSmartTemplate ? 0 : SixLinesPerInch); - if (firstStep == "Yes") - { - ySpaceOnFirstPage = yWithinMargins; // Accounts for Section Title Line - ShowPageBreak(8, "First HLS has to split on current page", firstStep, YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); - } - else - ShowPageBreak(6, "HLS will have to split on current page", "Special", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); - //BuildPageBreakList(yWithinMargins + SixLinesPerInch, yPageSizeNextPage + yExtra2, KeepStepsOnPage); // Case 5 - Determine items where page break(s) occur - BuildPageBreakList(ySpaceOnFirstPage, yPageSize + yExtra2, KeepStepsOnPage); // Case 5 - Determine items where page break(s) occur - return 0; // Stay on this page - } - - // Less than half a page left, start printing on a new page. - //Console.WriteLine("'PageBreak',5,'Yes','HLS will have to split',{0},{1},{2}, {3}, {4},'{5}'", MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize), MyItemInfo.ShortPath); - if (firstStep == "Yes") - ShowPageBreak(9, "First HLS will have to split on new page", "Yes", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); - else - ShowPageBreak(3, "HLS will have to split on new page", "Yes", YSize, yPageSizeNextPage, yWithinMargins, ManualPageBreak); - // Determine items where page break(s) occur - //BuildPageBreakList(yPageSize, yPageSize - 2 * SixLinesPerInch); // Case Base - //BuildPageBreakList(yPageSize, yPageSize); // Case 1 :Works for ES05 Step 15 SubStep 7 - // Pagination Fix Break1LineShort2 - //BuildPageBreakList(yPageSize + yExtra, yPageSize); // Case 1 :Works for ES05 Step 15 SubStep 7 - // Pagination Fix Break1LineShort4 - BuildPageBreakList(yPageSize + yExtra, yPageSizeNextPage + yExtra2, KeepStepsOnPage); // Case 1 :Works for ES05 Step 15 SubStep 7 - return 1; // Paginate on High Level Steps - } - //if (yWithinMargins > yPageSize / 2) - //{ - // Console.WriteLine("'PageBreak',4,'No','Not Half way down the page',{0},{1},{2}, {3}, {4},'{5}'", MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize), MyItemInfo.ShortPath); - // return 0; // More than half way down the page - //} - //if (ChildrenBelow.Count > 0 && ChildrenBelow[0].YSize < yWithinMargins) - // return 0; - //Console.WriteLine("'PageBreak',5,'Yes','At least half the page is filled',{0},{1},{2},{3}, {4},'{5}'", MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize), MyItemInfo.ShortPath); - //return 2; - throw new Exception("PageBreak Logic Missing, vlnParagraph.cs"); - } - - private float GetYPageSizeUseOnAllButFirstPage() - { - float _PointsPerPage = 792; - int indx = (int)MyItemInfo.MyDocStyle.IndexOtherThanFirstPage; - foreach (DocStyle ds in MyItemInfo.ActiveFormat.PlantFormat.DocStyles.DocStyleList) - { - if (ds.Index == indx) - { - float yTopMargin = _PointsPerPage - (float)ds.Layout.TopMargin; - float yBottomMargin = Math.Max(0, yTopMargin - (float)ds.Layout.PageLength); - return yTopMargin - yBottomMargin; - } - } - return 0; - } - private void ForcePagination(PdfContentByte cb, ref float yPageStart, float yTopMargin, float yBottomMargin, ref float yLocation, ref float retval) - { - cb.PdfDocument.NewPage(); // pagination issue - DebugText.WriteLine("*****PaginateError"); - yPageStart = yTopMargin + YVeryTop; - yLocation = yPageStart - YOffset; - //MyItemInfo.ItemID, YSize, yPageSize, yLocation - //_MyLog.ErrorFormat("<<< ERROR >>> Forced Pagination - ItemID = {0}\r\nLocation = '{1}'", MyItemInfo.ItemID, MyItemInfo.ShortPath); - _MyLog.ErrorFormat("<<< ERROR >>> Forced Pagination\r\n==>'Forced Pagination',{0},'{1}','{2}'" - , MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath); - DebugPagination.WriteLine("------,'Yes','Forced Pagination',{0},{1},,{3},{4}", MyItemInfo.ItemID, YSize, 0, yLocation, MyItemInfo.DBSequence); - retval = Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, DebugInfo, yBottomMargin); - } - private void ShowPageBreak(int instance, string message, string breakOrNot, float YSize, float yPageSize, float yWithinMargins, bool manualPageBreak) - { - if (breakOrNot != "No") - { - // DebugPagination.WriteLine("{0}", MyItemInfo.DBSequence); //,instance); - DebugPagination.WriteLine("{0:D6},'{1}',{2},'{3}','{4}',{5},{6},{7},{8},{9}", - MyPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber - (breakOrNot == "Yes" ? 0 : 1), - MyItemInfo.ShortPath, instance, - (manualPageBreak ? "Manual " : "") + message, breakOrNot, - MyItemInfo.ItemID, YSize, yPageSize, yWithinMargins, (int)(100 * yWithinMargins / yPageSize)); - } - // Console.WriteLine("{0},{1}", MyItemInfo.DBSequence, IsFirstSubStep(MyItemInfo)); //,instance); - } - private void BuildPageBreakList(float ySpaceOnCurPage, float yPageSize, bool KeepStepsOnPage) - { - ParagraphLocations myLocations = new ParagraphLocations(); - BuildLocationList(YTopMost, myLocations); - StepLevelList myList = myLocations.BuildStepLevelList(KeepStepsOnPage); - // Find Break Locations in the list based upon StepLevel and yLocation - float yTop = 0; - float yLowerLimit = (yPageSize - 2 * SixLinesPerInch) / 2; - float yStart = Math.Max(0, (yPageSize - 2 * SixLinesPerInch) - ySpaceOnCurPage); - //Console.WriteLine("'yStart',{0},{1}", MyItemInfo.DBSequence, yStart); - - // The following three lines make page breaking match 16-bit: - if (_Match16BitPagination) - { - yLowerLimit = yStart - SixLinesPerInch + ySpaceOnCurPage / 2; - if ((yStart + MyItemInfo.MyDocStyle.Layout.TopMargin + 2 * SixLinesPerInch) > ((MyItemInfo.MyDocStyle.Layout.TopMargin + yPageSize - 2 * SixLinesPerInch) / 2)) - yLowerLimit = yStart + 2 * SixLinesPerInch; - } - // Make sure that the FirstPiece (Caution Note HLS and First Substeps) fit - float myFirstPieceSize = GetFirstPieceSize(); //Case 0 - if (myFirstPieceSize < ySpaceOnCurPage) yLowerLimit = Math.Max(myFirstPieceSize + yStart, yLowerLimit); - //while ((YSize - yTop) >= ySpaceOnCurPage) - // Pagination Fix Break1LineShort3b - DocStyle docstyle = MyItemInfo.MyDocStyle; - string myBottomMsg = docstyle.Continue.Bottom.Message; - float myBottomMsgSpace = ((myBottomMsg ?? "") != "") ? 2 * SixLinesPerInch : 0; - switch (docstyle.Continue.Bottom.Location) - { - case E_ContBottomLoc.BottomOfPage: // place continue message at bottom of page - myBottomMsgSpace = 0; - break; - } - string myTopMsg = docstyle.Continue.Top.Message; - float myTopMsgSpace = ((myTopMsg ?? "") != "") ? 2 * SixLinesPerInch : 0; - while ((YSize - yTop) > ySpaceOnCurPage) - { - ySpaceOnCurPage -= myBottomMsgSpace; - vlnParagraph paraBreak = FindPageBreak(yStart, ySpaceOnCurPage, yLowerLimit, myList); - if (paraBreak == null) - { - _MyLog.ErrorFormat("<<< ERROR >>> Cannot find a place to break\r\n==>'Cannot Find Place to Break',{0},'{1}','{2}'" - , MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath); - break; - } - // yTopNew is y Location of this page break. YTopMost is top of HLS, including any Cautions/Notes/Boxes/etc - //float yTopNew = paraBreak.YVeryTop - YTopMost; - //float yTopNew = paraBreak.YTopMost - YTopMost; - float yTopNew = Math.Min(paraBreak.YTopMost, paraBreak.YVeryTop) - YTopMost; - RemoveProcessedParagraphs(myList, yTopNew - yTop); - yTop = yTopNew; - MyPageHelper.ParaBreaks.Add(paraBreak); - ySpaceOnCurPage = yPageSize - (myTopMsgSpace + SixLinesPerInch); // Allow for continue message and blank line. - //ySpaceOnCurPage = yPageSize - (myTopMsgSpace + SixLinesPerInch); // Allow for continue message and blank line. - //if (paraBreak.YTopMost != paraBreak.YVeryTop && MyPageHelper.TopMessage == null && MyPageHelper.BottomMessage == null) - // ySpaceOnCurPage = yPageSize; - //ySpaceOnCurPage = yPageSize; // Allow for continue message and blank line. - //DocStyle docstyle = MyItemInfo.MyDocStyle; - //string myMsg = docstyle.Continue.Bottom.Message; - //if ((myMsg ?? "") != "") ySpaceOnCurPage -= 2 * SixLinesPerInch; // Allow for continue message and blank line. - yLowerLimit = ySpaceOnCurPage / 2; - if (_Match16BitPagination) yLowerLimit -= 1.5F * SixLinesPerInch; // 276 for HLP - yStart = 0; - } - } - /// - /// Finds the highest StepLevel (lowest StepLevel number, 0 = HLS, 1 = first substep) that - /// fills the page sufficiently (more than half-full) - /// - /// - /// - /// - /// - private static vlnParagraph FindPageBreak(float yStart, float yUpperLimit, float yLowerLimit, StepLevelList myList) - { - vlnParagraph minPara = null; - foreach (int stepLevel in myList.Keys) // loop thru StepLevels, starting with lowest. - { - foreach (float yLocation in myList[stepLevel].Keys) // loop thru yLocation - { - vlnParagraph myPara = myList[stepLevel][yLocation]; - // The top of this step will fit onto page (-yLocation < yWithinMargins) - float wcnChkLstBorder = myPara.MyItemInfo.MyHLS.FormatStepData.UseSmartTemplate && - (myPara.MyItemInfo.MyHLS.FormatStepData.Suffix ?? "") != "" ? 2*SixLinesPerInch : 0; - if (minPara == null || minPara.YTop > myPara.YTop) - minPara = myPara; - if (wcnChkLstBorder -yLocation <= yUpperLimit) // Fix for OFN-RJ-23 - //if (-yLocation < yUpperLimit) // Before - //if (-yLocation < yWithinMargins && myList[stepLevel][yLocation].MyItemInfo.MyPrevious != null) - { - //ItemInfo prev = myList[stepLevel][yLocation].MyItemInfo.MyPrevious; - //if (myList[stepLevel][yLocation].MyItemInfo.ItemID == 5609) Console.WriteLine("aer"); - //if (myList[stepLevel][yLocation].MyItemInfo.ItemID == 4312) Console.WriteLine("rno"); - // The top of this step is more than 1/2 way down the page - if ((-yLocation + yStart) >= yLowerLimit) - return myPara; - - // If this item will not fit on the current page, put a page break - if (myPara.YBottom - myPara.YTop > (yUpperLimit - (-yLocation + yStart))) - return myPara; - // if is a caution or note & parent is a substep and entire substep doesn't fit, break. - if ((myPara.MyItemInfo.IsNote || myPara.MyItemInfo.IsCaution) && - !myPara.MyParent.MyItemInfo.IsHigh && - myPara.MyParent.YSize > (yUpperLimit + yLocation)) - { - return myList[stepLevel][yLocation]; - } - } - } - } - return minPara; - } - - //private void WalkStepLevel(float yTopMost) - //{ - // foreach (vlnParagraph child in ChildrenAbove) - // child.WalkStepLevel(yTopMost); - // foreach (vlnParagraph child in ChildrenLeft) - // child.WalkStepLevel(yTopMost); - // ShowStepLevel(yTopMost); - // foreach (vlnParagraph child in ChildrenRight) - // child.WalkStepLevel(yTopMost); - // foreach (vlnParagraph child in ChildrenBelow) - // child.WalkStepLevel(yTopMost); - //} - //private void ShowStepLevel(float yTopMost) - //{ - // ItemInfo item = MyItemInfo; - // ItemInfo parent = item.ActiveParent as ItemInfo; - // //if (para.MyItemInfo.ItemID == 205) - // // Console.Write(""); - // DebugPagination.WriteLine("'StepLevel',{0},{1},{2},{3},{4},{5},{6},{7},{8},{9}", YVeryTop - yTopMost, YSize, YBottomMost - yTopMost, item.ItemID, item.DBSequence, item.StepLevel, item.MyContent.Type % 10000, - // parent.MyContent.Type % 10000, item.HasCautionOrNote ? 1 : 0, parent.Cautions == null ? 0 : 1); - //} - } - public partial class VlnSvgPageHelper : SvgPageHelper - { - private bool _OriginalPageBreak; // use 16bit page breaks. - public bool OriginalPageBreak - { - get { return _OriginalPageBreak; } - set { _OriginalPageBreak = value; } - } - // This handles Page Breaks within a Step - private List _ParaBreaks = new List(); - public List ParaBreaks - { - get { return _ParaBreaks; } - set { _ParaBreaks = value; } - } - } -} diff --git a/PROMS/Volian.Print.Library/PromsPrinter.cs.bak b/PROMS/Volian.Print.Library/PromsPrinter.cs.bak deleted file mode 100644 index 6505e8a5..00000000 --- a/PROMS/Volian.Print.Library/PromsPrinter.cs.bak +++ /dev/null @@ -1,2024 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using VEPROMS.CSLA.Library; -using Volian.Svg.Library; -using iTextSharp.text.factories; -using iTextSharp.text; -using iTextSharp.text.pdf; -using System.Text.RegularExpressions; -using System.IO; -using System.Xml; -using System.Windows.Forms; -using LBWordLibrary; -using System.Drawing; -using System.Drawing.Imaging; -using Volian.Controls.Library; -using Volian.Base.Library; -using JR.Utils.GUI.Forms; - -namespace Volian.Print.Library -{ - public delegate void PromsPrinterStatusEvent(object sender,PromsPrintStatusArgs args); - public class PromsPrintStatusArgs - { - private string _MyStatus; - public string MyStatus - { - get { return _MyStatus; } - } - private DateTime _When = DateTime.Now; - public DateTime When - { - get { return _When; } - } - private PromsPrinterStatusType _Type; - public PromsPrinterStatusType Type - { - get { return _Type; } - set { _Type = value; } - } - private int _Progress = 0; - - public int Progress - { - get { return _Progress; } - set { _Progress = value; } - } - public PromsPrintStatusArgs(string myStatus, PromsPrinterStatusType type) - { - _MyStatus = myStatus; - _Type = type; - } - public PromsPrintStatusArgs(string myStatus, PromsPrinterStatusType type, int progress) - { - _MyStatus = myStatus; - _Type = type; - _Progress = progress; - } - } - public enum PromsPrinterStatusType - { - Start, - General, - MSWordToPDF, - PageList, - Watermark, - Read16, - Merge16, - Open16, - ReadMSWord, - MergeMSWord, - OpenMSWord, - OpenPDF, - Merge, - Total, - CloseDocument, - NewPage, - BuildSVG, - SetSVG, - SetPageEvent, - GetSection, - Before, - BuildStep, - Progress, - ProgressSetup, - LoadVlnParagraph - } - public class PromsPrinter - { - public bool NeedSupInfoBreak = false; - public E_SupInfoPrintType SupInfoPrintType = E_SupInfoPrintType.None; - // used to link supinfo steps in pdf - public int SupInfoPdfPageCount = -1; - private Dictionary _SupInfoPdfPage; - public Dictionary SupInfoPdfPage - { - get { return _SupInfoPdfPage; } - set { _SupInfoPdfPage = value; } - } - private bool _DoingFacingPage = false; // used to flag actual pdf generation of facing page within final print (so no section titles get printed) - public bool DoingFacingPage - { - get { return _DoingFacingPage; } - set { _DoingFacingPage = value; } - } - // used to save word sections with resolved ROs (for export file generated from approve) - private Dictionary _DocReplace; - public Dictionary DocReplace - { - get { return _DocReplace; } - set { _DocReplace = value; } - } - private bool _SaveLinks = false; - public bool SaveLinks - { - get { return _SaveLinks; } - set { _SaveLinks = value; } - } - private bool _RemoveTrailingHardReturnsAndManualPageBreaks = false; - public bool RemoveTrailingHardReturnsAndManualPageBreaks - { - get { return _RemoveTrailingHardReturnsAndManualPageBreaks; } - set { _RemoveTrailingHardReturnsAndManualPageBreaks = value; } - } - - private string _Prefix = ""; // RHM20150506 Multiline ItemID TextBox - public string Prefix - { - get { return _Prefix; } - set { _Prefix = value; } - } - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - public event PromsPrinterStatusEvent StatusChanged; - internal void OnStatusChanged(object sender, PromsPrintStatusArgs args) - { - if (StatusChanged != null) - StatusChanged(sender, args); - } - internal void OnStatusChanged(string myStatus, PromsPrinterStatusType type) - { - OnStatusChanged(this, new PromsPrintStatusArgs(myStatus, type)); - } - public void OnStatusChanged(string msg) - { - OnStatusChanged(this, new PromsPrintStatusArgs(msg, PromsPrinterStatusType.General)); - } - internal void OnStatusChanged(string myStatus, PromsPrinterStatusType type, int progress) - { - OnStatusChanged(this, new PromsPrintStatusArgs(myStatus, type, progress)); - } - private string _Rev; - private ItemInfo _MyItem; - public ItemInfo MyItem - { - get { return _MyItem; } - set { _MyItem = value; } - } - private string _Watermark; - private string _PDFFile; - public string PDFFile - { - get { return _PDFFile; } - set { _PDFFile = value; } - } - private bool _DebugOutput; - public bool DebugOutput - { - get { return _DebugOutput; } - set { _DebugOutput = value; } - } - private string _BackgroundFolder; - public string BackgroundFolder - { - get { return _BackgroundFolder; } - set { _BackgroundFolder = value; } - } - private bool _OpenPDF; - - public bool OpenPDF - { - get { return _OpenPDF; } - set { _OpenPDF = value; } - } - private bool _OverWrite; - - public bool OverWrite - { - get { return _OverWrite; } - set { _OverWrite = value; } - } - private ChangeBarDefinition _MyChangeBarDefinition; - public ChangeBarDefinition MyChangeBarDefinition - { - get { return _MyChangeBarDefinition; } - set { _MyChangeBarDefinition = value; } - } - private bool _OriginalPageBreak; // use 16bit page breaks. - public bool OriginalPageBreak - { - get { return _OriginalPageBreak; } - set { _OriginalPageBreak = value; } - } - private bool _InsertBlankPages; - public bool InsertBlankPages - { - get { return _InsertBlankPages; } - set { _InsertBlankPages = value; } - } - private bool _BatchPrint = true; // flags that a batch-type print is occurring, i.e. AllProcedures or Automatic testing - public bool BatchPrint - { - get { return _BatchPrint; } - set { _BatchPrint = value; } - } - private static List _TransPageNumProblems = null; - public static List TransPageNumProblems - { - get { return PromsPrinter._TransPageNumProblems; } - set { PromsPrinter._TransPageNumProblems = value; } - } - public static void ClearTransPageNumProblems() - { - _TransPageNumProblems = null; - } - public static DialogResult ReportTransPageNumProblems() - { - if (TransPageNumProblems != null && TransPageNumProblems.Count > 0) - { - string pnProbl = null; - foreach (string pstr in TransPageNumProblems) - pnProbl = pnProbl + "\r\n" + pstr; - Clipboard.SetText(pnProbl); - return FlexibleMessageBox.Show("The following list was placed on the Windows Clipboard." - + "\r\nIt shows the page numbers of the locations that are referenced by transitions." - + "\r\nThis list, along with the PDF, can help you to determine the cause of the inconsistent page numbers." - + "\r\n\r\nDo you want to also review the PDF output prior to the second pass printing?" - + "\r\n\r\n------------------------------\r\n" + pnProbl, - "Inconsistent Transition Page Numbers", MessageBoxButtons.YesNo, MessageBoxIcon.Question); - } - return DialogResult.No; - } - private ReaderHelper _MyReaderHelper; - public ReaderHelper MyReaderHelper - { - get { return _MyReaderHelper; } - set { _MyReaderHelper = value; } - } - public PromsPrinter(ItemInfo myItem, string rev, string watermark, bool debugOutput, bool origPgBrk, string backgroundFolder, bool openPDF, bool overWrite, - ChangeBarDefinition cbd, String pdfFile, bool insertBlankPages, bool batchPrint, string prefix, bool saveLinks, bool removeTrailngHardReturnsAndManualPageBreaks) - { - Prefix = prefix; // RHM20150506 Multiline ItemID TextBox - _MyItem = myItem; - _Rev = rev; - _Watermark = watermark; - _DebugOutput = debugOutput; - _BackgroundFolder = backgroundFolder; - _OpenPDF = openPDF; - _OverWrite = overWrite; - _MyChangeBarDefinition = cbd; - _PDFFile = pdfFile; - _OriginalPageBreak = origPgBrk; - _InsertBlankPages = insertBlankPages; - _BatchPrint = batchPrint; - _MyReaderHelper = new ReaderHelper(this); - _SaveLinks = saveLinks; - _RemoveTrailingHardReturnsAndManualPageBreaks = removeTrailngHardReturnsAndManualPageBreaks; - //_MyReaderHelper.LoadTree(myItem); - } - private string _BeforePageNumberPdf = null; - public string BeforePageNumberPdf - { - get { return _BeforePageNumberPdf; } - set { _BeforePageNumberPdf = value; } - } - public string Print(string pdfFolder, bool makePlacekeeper, bool makeContinuousActionSummary) - { - if (_MyItem is ProcedureInfo) - { - if ((_MyItem as ProcedureInfo).ProcHasSupInfoData) - { - // Use two passes to print facing page supplemental information for SAMGs - // First pass gets pagination for the step sections and stores the associated supplemental information ids in - // the list StepSectPageBreaksForSupInfo off of the section object - // Second pass prints the supplemental information pdfs using the list generated in the first pass to know where to do the - // supplemental information page breaks & then merges in those pages when printing the step sections. - SupInfoPrintType = E_SupInfoPrintType.DoPageBreaks; - string retstr = Print(_MyItem as ProcedureInfo, pdfFolder, false, false); - if (retstr == null) return null; - SupInfoPrintType = E_SupInfoPrintType.Merge; - return Print(_MyItem as ProcedureInfo, pdfFolder, false, false); - } - else if (!(_MyItem.ActiveFormat.PlantFormat.FormatData.TransData.UseTransitionModifier || - _MyItem.ActiveFormat.PlantFormat.FormatData.TransData.UseSpecificTransitionModifier)) - return Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper, makeContinuousActionSummary); - else - { - // if the plant uses transition modifiers and/or page num in transition format, - // need to do two passes. First pass, sets the pagenumbers for each item, - // 2nd pass fills in the page numbers in transitions. - DirectoryInfo di = new DirectoryInfo(pdfFolder + @"\PageNumberPass1"); - if (!di.Exists) di.Create(); - string retstr = Print(_MyItem as ProcedureInfo, pdfFolder + @"\PageNumberPass1", false, false); - if (retstr == null) return null; - BeforePageNumberPdf = retstr; - ProcedureInfo.RefreshPageNumTransitions(_MyItem as ProcedureInfo); - _MyReaderHelper = new ReaderHelper(this); - retstr = Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper, makeContinuousActionSummary); - if (TransPageNumProblems.Count > 0) - { - if (BatchPrint || (MessageBox.Show("Page Number Transitions may be fixed if a second pass is performed. Do you want to perform a second pass?", "Page Number Transition Errors", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)) - { - DirectoryInfo di1 = new DirectoryInfo(pdfFolder + @"\PageNumberPass2"); - if (!di1.Exists) di1.Create(); - FileInfo fi = new FileInfo(retstr); - FileInfo fidest = new FileInfo(di1.FullName + @"\" + fi.Name); - if (fidest.Exists) fidest.Delete(); - try - { - fi.MoveTo(di1.FullName + @"\" + fi.Name); - } - catch (Exception ex) - { - _MyLog.ErrorFormat("{0} During Save {1}", ex.GetType().FullName, ex.Message); - } - ClearTransPageNumProblems(); - RefreshPageNumber(_MyItem); - ProcedureInfo.RefreshPageNumTransitions(_MyItem as ProcedureInfo); - _MyReaderHelper = new ReaderHelper(this); - retstr = Print(_MyItem as ProcedureInfo, pdfFolder, makePlacekeeper, makeContinuousActionSummary); - } - } - return retstr; - } - } - return ""; - } - - private void RefreshPageNumber(ItemInfo _MyItem) - { - // set all page numbers for all items under the passed in procedure item - _MyItem.PageNumber = _MyItem.PageNumberNextPass; - if (_MyItem.MyContent.ContentPartCount > 0) - { - foreach (PartInfo pi in _MyItem.MyContent.ContentParts) - { - foreach (ItemInfo ii in pi.MyItems) - RefreshPageNumber(ii); - } - } - } - internal string BuildMSWordPDF(SectionInfo section) - { - DateTime tStart = DateTime.Now; - string MSWordFile = null; - if (section.MyContent.ContentEntryCount == 1) - { - MSWordToPDF.DocReplace = DocReplace; - MSWordFile = MSWordToPDF.GetDocPdf(section, PrintOverride.TextColor); - MSWordToPDF.DocReplace = null; - GC.Collect(); // memory garbage collection - OnStatusChanged("MSWord converted to PDF " + MSWordFile, PromsPrinterStatusType.MSWordToPDF); - } - return MSWordFile; - } - private static void AddImportedPageToLayer(PdfContentByte cb, PdfLayer layer, PdfImportedPage page, float xOff, float yOff) - { - cb.BeginLayer(layer); - iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(page); - - // the following checks if the content of page is landscape and rotates because we're printing on - // a portrait page. If, at some point, we print a total landscape page, not a mix, this will need - // re-evaluated. - if (page.Height < page.Width) - { - if (cb.PdfDocument.PageSize.Height > cb.PdfDocument.PageSize.Width) - image.RotationDegrees = 90F; - } - image.SetAbsolutePosition(xOff, yOff); - cb.AddImage(image); - cb.EndLayer(); - } - private PdfLayer _TextLayer; - private PdfLayer _BackgroundLayer; - private PdfLayer _MSWordLayer; - private PdfLayer _PagelistLayer; - private PdfLayer _DebugLayer; - private PdfLayer _WatermarkLayer; - private void CreateLayers(PdfContentByte cb) - { - if (DebugOutput) - { - _BackgroundLayer = new PdfLayer("16-Bit", cb.PdfWriter); - _MSWordLayer = new PdfLayer("32-Bit MSWord", cb.PdfWriter); - _PagelistLayer = new PdfLayer("32-Bit Pagelist", cb.PdfWriter); - _TextLayer = new PdfLayer("32-Bit Text", cb.PdfWriter); - _DebugLayer = new PdfLayer("Debug", cb.PdfWriter); - _WatermarkLayer = new PdfLayer("Watermark", cb.PdfWriter); - _WatermarkLayer.SetPrint("Watermark", true); - } - } - private void CloseDocument(string fileName) - { - int profileDepth = ProfileTimer.Push(">>>> CloseDocument"); - try - { - MyContentByte.PdfDocument.Close(); - MyContentByte = null; - } - catch (Exception ex) - { - Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message); - } - OnStatusChanged("CloseDocument", PromsPrinterStatusType.CloseDocument); - if (OpenPDF) - System.Diagnostics.Process.Start(fileName); - OnStatusChanged("OpenPDF", PromsPrinterStatusType.OpenPDF); - ProfileTimer.Pop(profileDepth); - } - private PdfContentByte _MyContentByte = null; - public PdfContentByte MyContentByte - { - get { return _MyContentByte; } - set - { - _MyContentByte = value; - if(value != null)MyReaderHelper.LoadTree(MyItem); - } - } - public void NewPage() - { - string path = Volian.Base.Library.vlnStackTrace.StackToStringLocal(2, 1); - NewPage(false); - } - public void NewPage(bool sectionChange) - { - // the first time we come in here we already printed the first page. - // we are now setting up the page size for the next page - iTextSharp.text.Rectangle rct = MyReaderHelper.MyPromsPrinter.MyContentByte.PdfDocument.PageSize; - if (_MyHelper != null) - { - SectionInfo currentSection = _MyHelper.MySection; - SectionInfo nextSection = GetNextSection(currentSection); // _MyHelper.MySection.NextItem as SectionInfo; - //SectionConfig sc = (nextSection ?? currentSection).MyConfig as SectionConfig; - // If we are changing to a different section, then get the config from the nextSection - // else we are still printing in the same section so get the config from the current section - SectionConfig sc = ((!sectionChange || nextSection == null)? currentSection.MyConfig : nextSection.MyConfig) as SectionConfig; - bool wordMargins = (sc != null && sc.Section_WordMargin == "Y"); - if (wordMargins) - { - if (nextSection != null && (sectionChange) && !nextSection.IsStepSection) //change to a word section - { - LastWordSection = nextSection; - _PageCountOfWordSection = 1; - MyReaderHelper.MySectionInfo = LastWordSection; - //ShowNeedForPageSize(); - rct = MyReaderHelper.GetSize(LastWordSection, 1); - } - else if (!currentSection.IsStepSection) //current section is a word section - { - if (currentSection != LastWordSection) - { - LastWordSection = currentSection; - _PageCountOfWordSection = 1; - } - else - _PageCountOfWordSection++; - MyReaderHelper.MySectionInfo = LastWordSection; - //ShowNeedForPageSize(); - rct = MyReaderHelper.GetSize(LastWordSection, _PageCountOfWordSection); - } - } - else // don't use Word margins - { - rct = PageSize.LETTER; - } - //Console.WriteLine("\"{0}\"\t\"{1}\"\t\"{2}\"\t\"{3}\"\t{4}" - // , currentSection == null ? "" : currentSection.DisplayNumber + " " + currentSection.DisplayText - // , nextSection == null ? "" : nextSection.DisplayNumber + " " + nextSection.DisplayText - // , sectionChange, wordMargins,_PageCountOfWordSection); - } - // Bug Fix: B2016-135 when using a large page size word section, that large page size was being used for the foldout page - // save this for the next section which will be the large page size word section. - if (_MyFoldoutReader.Count > 0) - MyContentByte.PdfDocument.SetPageSize(NxtRCT); - else - MyContentByte.PdfDocument.SetPageSize(rct); - NxtRCT = rct; - MyContentByte.PdfDocument.NewPage(); - } - private iTextSharp.text.Rectangle NxtRCT = PageSize.LETTER; - private SectionInfo GetNextSection(SectionInfo currentSection) - { - if (currentSection.Sections != null) - return currentSection.Sections[0] as SectionInfo; - if (currentSection.NextItem != null) - return currentSection.NextItem as SectionInfo; - SectionInfo parent = currentSection.ActiveParent as SectionInfo; - while (parent != null && parent.NextItem == null) - parent = parent.ActiveParent as SectionInfo; - if (parent == null) return null; - return parent.NextItem as SectionInfo; - } - private SectionInfo _PreviousWordSection = null; - public SectionInfo PreviousWordSection - { - get { return _PreviousWordSection; } - set { _PreviousWordSection = value; } - } - private SectionInfo _LastWordSection = null; - public SectionInfo LastWordSection - { - get { return _LastWordSection; } - set - { - PreviousWordSection = _LastWordSection; - _LastWordSection = value; - } - } - private int _PageCountOfWordSection = 0; - //private void ShowNeedForPageSize() - //{ - // if(PreviousWordSection != null && PreviousWordSection != LastWordSection) - // Console.WriteLine("Switch From {0}.{1} ",PreviousWordSection.DisplayNumber,PreviousWordSection.DisplayText); - // Console.WriteLine("To {0}.{1} Page: {2}",LastWordSection.DisplayNumber,LastWordSection.DisplayText,_PageCountOfWordSection); - // PreviousWordSection = LastWordSection; - //} - private PdfContentByte OpenDoc(string outputFileName, iTextSharp.text.Rectangle rect) - { - PdfWriter writer=null; - iTextSharp.text.Document document = new iTextSharp.text.Document(rect); - try - { - writer = PdfWriter.GetInstance(document, new FileStream(outputFileName, FileMode.Create)); - // PDFA1B does not allow layers, so this is disabled for now - // If enabled, CreateLayers will need to be skipped. - //writer.PDFXConformance = PdfWriter.PDFA1B; - } - catch (Exception ex) - { - StringBuilder sb = new StringBuilder(); - sb.AppendLine("Could not create"); - sb.AppendLine(); - sb.AppendLine(outputFileName + "."); - sb.AppendLine(); - sb.AppendLine("If it is open, close and retry."); - MessageBox.Show(sb.ToString(), "Error on CreatePdf", MessageBoxButtons.OK, MessageBoxIcon.Warning); - //MessageBox.Show("Could not create " + outputFileName + ". If it is open, close and retry.", "Error on CreatePdf"); - return MyContentByte = null; - } - document.Open(); - // Create Layers - CreateLayers(writer.DirectContent); - MSWordToPDF.DebugStatus = DebugOutput ? 1 : 0; - PrintOverride.Reset(); - if (DebugOutput) - { - PrintOverride.TextColor = System.Drawing.Color.Red; - PrintOverride.SvgColor = System.Drawing.Color.LawnGreen; - PrintOverride.BoxColor = System.Drawing.Color.Red; - PrintOverride.ChangeBarColor = System.Drawing.Color.Red; - PrintOverride.DebugColor = System.Drawing.Color.CadetBlue; - } - MyContentByte = writer.DirectContent; - return MyContentByte; - } - //private string CreateFileName(string procNumber, string sectNumber, string sectTitle) - //{ - // return FixFileName(procNumber + "_" + ((sectNumber ?? "") != "" ? sectNumber : sectTitle)); - //} - //private string CreateFileName(string procNumber) - //{ - // return FixFileName(procNumber); - //} - //private string FixFileName(string name) - //{ - // return Regex.Replace(name, "[ .,/]", "_") + ".pdf"; - //} - int _StepPageNumber = 0; - private VlnSvgPageHelper _MyHelper = null; - //private static PdfReader _MyFoldoutReader = null; - //private static SectionInfo _MyFoldoutSection = null; - private static List _MyFoldoutReader = null; - public static List MyFoldoutReader - { - get { return PromsPrinter._MyFoldoutReader; } - set { PromsPrinter._MyFoldoutReader = value; } - } - private static List _MyFoldoutSection = null; - private string Print(ProcedureInfo myProcedure, string pdfFolder, bool makePlacekeeper, bool makeContinuousActionSummary) - { - int profileDepth = ProfileTimer.Push(">>>> PromsPrinter.Print"); - if (_TransPageNumProblems == null) _TransPageNumProblems = new List(); - - if (_MyFoldoutReader != null) _MyFoldoutReader.Clear(); - else _MyFoldoutReader = new List(); - - if (_MyFoldoutSection != null) _MyFoldoutSection.Clear(); - else _MyFoldoutSection = new List(); - - if (myProcedure.Sections != null) - { - int cnt = 0; - foreach (SectionInfo mySection in myProcedure.Sections) - { - if ((myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts && mySection.MyContent.Number.ToUpper() == "FOLDOUT") - || (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && mySection.MyContent.Text.ToUpper().Contains("FOLDOUT"))) - { - // if floating foldouts, need a list of sections & foldoutreaders. Just do first for now. - - _MyFoldoutSection.Add(mySection); - string foldoutPdf = PrintProcedureOrFoldout(myProcedure, mySection, Volian.Base.Library.VlnSettings.TemporaryFolder + @"\Foldout" + cnt.ToString() + @".pdf", false, false); - _MyFoldoutReader.Add(foldoutPdf != null ? new PdfReader(foldoutPdf) : null); - cnt++; - } - } - } - OnStatusChanged("Print " + myProcedure.DisplayNumber, PromsPrinterStatusType.Start); - string outputFileName = pdfFolder + "\\" + Prefix + PDFFile; // RHM20150506 Multiline ItemID TextBox - - if (!OverWrite && File.Exists(outputFileName)) - { - if (MessageBox.Show(outputFileName + " exists. Overwrite file?", "File Exists", MessageBoxButtons.YesNo) == DialogResult.No) - { - ProfileTimer.Pop(profileDepth); - return null; - } - } - string retval = PrintProcedureOrFoldout(myProcedure, null, outputFileName, makePlacekeeper, makeContinuousActionSummary); - ProfileTimer.Pop(profileDepth); - return retval; - } - - // See if the last non Foldout Section has a Final Message. - private int GetFinalMessageSectionID(ProcedureInfo myProcedure, bool doingFoldout) - { - if (!doingFoldout) - { - // Work backwards because we don't want to include any foldouts. Find the last section that is not - // a foldout. If it has a final message, this is the 'last section' and should have a final message. - // If it doesn't have a final message, then none should be printed. - int cntSect = myProcedure.Sections.Count; - for (int i = cntSect - 1; i >= 0; i--) - { - SectionInfo mySection = myProcedure.Sections[i] as SectionInfo; - if (!mySection.DisplayText.ToUpper().Contains("FOLDOUT")) - { - if (mySection.MyDocStyle.Final != null && mySection.MyDocStyle.Final.Message != null && mySection.MyDocStyle.Final.Message.Length > 0) - return mySection.ItemID; - else - return -1; - } - } - } - return -1; - } - private bool _AllowAllWatermarks = false; - public bool AllowAllWatermarks - { - get { return _AllowAllWatermarks; } - set { _AllowAllWatermarks = value; } - } - private PdfReader readerWord; - private string PrintProcedureOrFoldout(ProcedureInfo myProcedure, SectionInfo myFoldoutSection, string outputFileName, bool makePlacekeeper, bool makeContinuousActionSummary) - { - int profileDepth = ProfileTimer.Push(">>>> PrintProcedureOrFoldout"); - Rtf2Pdf.TextAtCounter = 0; - bool doingFoldout = myFoldoutSection != null; - // The following line accounts for 16bit OverrideLeftMargin when the 'Absolute' attribute is used in the genmac. - // We don't want to use the OverrideLeftMargin when 'Absolute' is used in the genmac. - // It's set here because the Volian.Svg.Library cannot call back to Volian.Print.Library to get this value. - Svg.Library.Svg.AbsoluteOffset = new PointF(2 * 72F / (float)myProcedure.ActiveFormat.PlantFormat.FormatData.Font.CPI, -9.5F); - // Create an MSWord Pdf - // Setup a pdf Document for printing - OnStatusChanged("Before OpenDoc", PromsPrinterStatusType.Before); - iTextSharp.text.Rectangle rct = PageSize.LETTER; - if (myProcedure.Sections != null && !myProcedure.Sections[0].IsStepSection) - { - SectionInfo si = myProcedure.Sections[0] as SectionInfo; - SectionConfig sc = si.MyConfig as SectionConfig; - bool wordMargins = (sc != null && sc.Section_WordMargin == "Y"); - if (wordMargins) - { - string pdfFile =BuildMSWordPDF(si); - try - { - PdfReader reader = new PdfReader(pdfFile); - rct = reader.GetPageSizeWithRotation(1); - } - catch (Exception ex) - { - MessageBox.Show(ex.Message, ex.GetType().FullName, MessageBoxButtons.OK, MessageBoxIcon.Warning); - _MyLog.Warn(string.Format("Error of ReadPDf [{0}],{1}.{2}",si.ItemID,si.DisplayNumber,si.DisplayText),ex); - throw new Exception("Error in readPDF", ex); - } - } - } - PdfContentByte cb = OpenDoc(outputFileName, rct); - if (cb == null) - { - ProfileTimer.Pop(profileDepth); - return null; - } - SetupProperties(cb.PdfDocument, myProcedure); - OnStatusChanged("Before NewPage", PromsPrinterStatusType.Before); - NewPage(); // Start of print - //_MyLog.InfoFormat("NewPage 1 {0}", cb.PdfWriter.CurrentPageNumber); - OnStatusChanged("After NewPage", PromsPrinterStatusType.NewPage); - if (myProcedure.Sections == null) - { - MessageBox.Show("This procedure has no content and will not be printed.", "Empty Procedure", MessageBoxButtons.OK, MessageBoxIcon.Information); - ProfileTimer.Pop(profileDepth); - return null; - } - OnStatusChanged(myProcedure.DisplayNumber, PromsPrinterStatusType.ProgressSetup, myProcedure.Sections.Count); - int progress = 0; - int finalMessageSectionID = GetFinalMessageSectionID(myProcedure, doingFoldout); - string LastFmtName = null; - int lastDocStyle = -1; - bool firstStepSec = true; - foreach (SectionInfo mySection in myProcedure.Sections) - { - NeedSupInfoBreak = true; - if (((mySection.MyContent.Number.ToUpper() == "FOLDOUT" && myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.SectionLevelFoldouts) - || (myProcedure.ActiveFormat.PlantFormat.FormatData.PrintData.AlternateFloatingFoldout && mySection.MyContent.Text.ToUpper().Contains("FOLDOUT"))) - != doingFoldout) continue; - if (myFoldoutSection != null && myFoldoutSection.ItemID != mySection.ItemID) continue; - PrintOverride.CompressSuper = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSuper; - PrintOverride.CompressSub = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressHPSub; - PrintOverride.CompressPropSubSup = mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.CompressPropSubSup; - - OnStatusChanged((mySection.DisplayNumber ?? "") == "" ? mySection.DisplayText : mySection.DisplayNumber, PromsPrinterStatusType.Progress, progress++); - // Set up Helper for the particular Section - if (_MyHelper == null) - { - LastFmtName = mySection.ActiveFormat.Name; - lastDocStyle = (int)mySection.MyDocStyle.Index; - string hlsText = ""; - int hlsItemId = 0; - if (mySection.IsStepSection && mySection.Steps != null && mySection.Steps.Count > 0) - { - hlsItemId = mySection.Steps[0].ItemID; - hlsText = mySection.Steps[0].DisplayText; // save the High level step text for use in the page list - } - cb.PdfWriter.PageEvent = _MyHelper = new VlnSvgPageHelper(mySection, this, hlsText, hlsItemId); - _MyHelper.AllowAllWatermarks = AllowAllWatermarks; - _MyHelper.MyPdfWriter = cb.PdfWriter; - _MyHelper.CreatingFoldoutPage = doingFoldout; - _MyHelper.CreatingSupInfoPage = false; - _MyHelper.MyPdfContentByte = cb; - - if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null); - if (DebugOutput) - { - // 16-bit background - string procedureFileName = BackgroundFolder + "\\" + PDFFile.Trim();//CreateFileName(myProcedure.DisplayNumber); - FileInfo VEPromsFile = new FileInfo(procedureFileName); - if (VEPromsFile.Exists && !doingFoldout) - { - _MyHelper.BackgroundFile = procedureFileName; - float x = 0; - float y = 0; - if (!(mySection.ActiveFormat.Name.ToUpper().StartsWith("WST") || _MyHelper.Back32BitPROMS)) // compare folder contains PROMS generated PDF - { - // X value below = 16-bit pdf OverrideLeftMargin = -2 characters at the plant format's default Font's - // characters per inch. - // 16bit OverrideLeftMargin, defined as -2 in driver\drvin.rtf, - override took 2 characters out, so we're adding it back in: - // These values adjust if overlay is 16bit versus 32bit. This is - // used so that the comparison is an exact match. Use 0,0 if comparing to another 32bit - // pdf, i.e. won't process the following 2 lines of code. - x = 2 * 72F / (float)myProcedure.ActiveFormat.PlantFormat.FormatData.Font.CPI; - y = -9.5F; - } - x += 72F * VlnSettings.GetCommandFloat("X", 0); - y -= 72F * VlnSettings.GetCommandFloat("Y", 0); - _MyHelper.BackgroundOffset = new PointF(x,y); - _MyHelper.BackgroundPageOffset = 0; - } - _MyHelper.WatermarkLayer = _WatermarkLayer; - _MyHelper.PageListLayer = _PagelistLayer; - _MyHelper.TextLayer = _TextLayer; - _MyHelper.BackgroundLayer = _BackgroundLayer; - _MyHelper.DebugLayer = _DebugLayer; - } - _MyHelper.Rev = _Rev; - _MyHelper.Watermark = _Watermark; - _MyHelper.DoZoomOMatic = DebugOutput; - _MyHelper.OriginalPageBreak = OriginalPageBreak; - OnStatusChanged("After Set PageEvent", PromsPrinterStatusType.SetPageEvent); - } - else - { - //added by jcb to reset mygaps when changing a section. found old section gaps were carrying over to new section - _MyHelper.MyGaps.Clear(); - //Console.WriteLine("'{0}' PromsPrinter", mySection.DisplayText); - // if pagination is separate or we've changed the format, we have not done the first page - // (if this format has the useonfirst page docstyle flag) - if (LastFmtName != mySection.ActiveFormat.Name || lastDocStyle != (int)mySection.MyDocStyle.Index || mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate) - { - _MyHelper.DidFirstPageDocStyle = false; - lastDocStyle = (int)mySection.MyDocStyle.Index; - LastFmtName = mySection.ActiveFormat.Name; - } - if (!mySection.IsStepSection) _MyHelper.PageBookmarks.Add((ItemInfo)mySection, ((mySection.DisplayNumber ?? "") == "" ? "" : mySection.DisplayNumber + " - ") + mySection.DisplayText, null); - _MyHelper.MySection = mySection; - //OnStatusChanged("After Set Svg", PromsPrinterStatusType.SetSVG); - } - // if this format uses phonelists, see if this section has one. We need to know the number - //of lines to adjust the pagelength for pagination and printing. - _MyHelper.PhoneListHeight = 0; - if (mySection.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList) - { - // get config for section - SectionConfig sc = mySection.MyConfig as SectionConfig; - if (sc.Section_PhoneList != null && sc.Section_PhoneList == "Y") - { - DocVersionConfig dvc = mySection.MyDocVersion.MyConfig as DocVersionConfig; - if (dvc != null) - { - string phlist = dvc.Print_PhoneList; - if (phlist != null && phlist != "") - { - // count lines: - int cl = 0; - int indx = phlist.IndexOf("\n"); - while (indx > 0) - { - cl++; - if (indx + 1 > phlist.Length) - indx = -1; - else - indx = phlist.IndexOf("\n", indx + 1); - } - if (cl == 0) cl = 1; // phone list is a single line without an ending newline - _MyHelper.PhoneListHeight = cl * vlnPrintObject.SixLinesPerInch; - } - } - } - } - _MyHelper.FinalMessageSectionID = finalMessageSectionID; // set VlnSvgPageHelper with the finalMessageSectionID - - if (mySection.IsAutoTOCSection) - { - if (((cb.PdfWriter.CurrentPageNumber % 2 == 0 && !_MyHelper.CreatingFoldoutPage) || myProcedure.ProcHasSupInfoData) && InsertBlankPages) // Bug Fix: B2016-181 - add blank page if page count is even - { - _MyHelper.OnBlankPage = true; - cb.PdfDocument.Add(new iTextSharp.text.Table(1)); - NewPage(); - } - GenerateTOC(mySection, myProcedure, cb, _TextLayer); - } - else - { - if (mySection.IsStepSection) - { - if (mySection.Steps != null && mySection.Steps.Count > 0) - { - // get first step to send to floating foldout indx.&& MyItemInfo.FoldoutIndex>-1) - ItemInfo firstStep = mySection.Steps[0]; - if (firstStep.FoldoutIndex() > -1) - DoFoldoutPage(cb, "Beginning of Step Section", _TextLayer, _MyHelper, firstStep.FoldoutIndex(), InsertBlankPages); - else if (!_MyHelper.CreatingFoldoutPage && _MyFoldoutReader.Count > 0 && InsertBlankPages) - { - // if it is continuous pagination, don't do blank page - not sure if this is correct place for this: - if (mySection.SectionConfig.Section_Pagination == SectionConfig.SectionPagination.Separate) - { - // only insert a blank page if this section does not have a foldout (but the procedure as a whole does) - // and the checkbox on the print dialog to add blank pages is checked - _MyHelper.OnBlankPage = true; - cb.PdfDocument.Add(new iTextSharp.text.Table(1)); - NewPage(); - //_MyLog.InfoFormat("NewPage Begin Step Sect blank {0}", cb.PdfWriter.CurrentPageNumber); - } - } - else - { - // If the procedure has supplemental facing pages, but this section does not & it's the first section, - // need a blank 'facing page'. Sections after the first will get blank 'facing page' in print's pagination logic - if (SupInfoPrintType==E_SupInfoPrintType.Merge && !mySection.HasSupInfoSteps && firstStepSec && InsertBlankPages) - { - _MyHelper.OnBlankPage = true; - cb.PdfDocument.Add(new iTextSharp.text.Table(1)); - NewPage(); - firstStepSec = false; - } - } - } - CreateStepPdf(mySection, cb); - } - else - { - CreateWordDocPdf(cb, mySection); - } - } - _MyHelper.PrintedSectionPage = 0; - } - if (_MyHelper != null && _MyHelper.BackgroundFile != null) - { - _MyHelper.MySvg = null; - while (cb.PdfWriter.CurrentPageNumber <= _MyHelper.BackgroundPageCount) - { - PrintTextMessage(cb, "No Proms Output", _TextLayer); - NewPage(); - //_MyLog.InfoFormat("NewPage 2 {0}", cb.PdfWriter.CurrentPageNumber); - if (DebugPagination.IsOpen) DebugPagination.WriteLine("{0:D6},'{1}'", - _MyHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber, "No PROMS Output"); - } - } - OnStatusChanged(myProcedure.DisplayNumber + " PDF Creation Completed", PromsPrinterStatusType.Progress, progress); - if (DebugPagination.IsOpen) DebugPagination.TotalPages += cb.PdfWriter.CurrentPageNumber; - CloseDocument(outputFileName); - if (_MyHelper != null && makePlacekeeper) - { - // Setting the default font to Arial since that is what Calvert is currently using for their Placekeeper pages - VE_Font pkFont = new VE_Font("Arial", 11, E_Style.None, 12); // default font info. - // Ideally, we should grab the font from the DocStyle used for the Placekeeper. - // Note that Calvert has two Placekeeper docSyles (EOPs and AOPs) in the same format. - // Both Placekeeper DocStyles use Arial 11 pt font, so there is no need to grab it from the format file. - //foreach (DocStyle ds in _MyHelper.MySection.ActiveFormat.PlantFormat.DocStyles.DocStyleList) - //{ // note that this will get the last Placekeeper font setting - // if (ds.StructureStyle.Style == E_DocStructStyle.Placekeeper) - // pkFont = ds.Font; - //} - if (_MyHelper.MyPlacekeepers.Count > 0) - MyPlacekeeper = new Placekeeper(_MyHelper.MyPlacekeepers, pkFont); - } - // Generate the Continuous Action Summary - if (_MyHelper != null && makeContinuousActionSummary) - { - // Set the font for the Continue Action Summary - VE_Font pkFont = myProcedure.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.ContinuousActionSummaryData.Font; // uses font defined in the format or uses what is definced in BaseAll format - if (_MyHelper.MyContActSteps.Count > 0) - MyContActSummary = new ContinuousActionSummary(_MyHelper.MyContActSteps, pkFont); - } - _MyHelper = null; - ProfileTimer.Pop(profileDepth); - return outputFileName; - } - - private void SetupProperties(PdfDocument document, ProcedureInfo myProcedure) - { - document.AddTitle(string.Format("{0} {1}",myProcedure.DisplayNumber,myProcedure.DisplayText)); - document.AddSubject(myProcedure.SearchDVPath); - document.AddCreator(string.Format("{0} {1}",Application.ProductName, Application.ProductVersion)); - document.AddAuthor(Volian.Base.Library.VlnSettings.UserID); - } - private Placekeeper _MyPlacekeeper = null; - - public Placekeeper MyPlacekeeper - { - get { return _MyPlacekeeper; } - set { _MyPlacekeeper = value; } - } - - private ContinuousActionSummary _MyContActSummary = null; - - public ContinuousActionSummary MyContActSummary - { - get { return _MyContActSummary; } - set { _MyContActSummary = value; } - } - - public void CreateWordDocPdf(PdfContentByte cb, SectionInfo mySection) - { - if (mySection.PageNumber == -1) // If page num transition goes to a section, need the pagenumber of section. - { - if ((mySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontCountFoldoutPgs) == E_DocStructStyle.DontCountFoldoutPgs) - mySection.PageNumber = _MyHelper.CurrentPageNumberNoFoldouts; - else - mySection.PageNumber = _MyHelper.CurrentPageNumber; - } - else - { - if ((mySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontCountFoldoutPgs) == E_DocStructStyle.DontCountFoldoutPgs) - mySection.PageNumberNextPass = _MyHelper.CurrentPageNumberNoFoldouts; - else - mySection.PageNumberNextPass = _MyHelper.CurrentPageNumber; - } - int profileDepth = ProfileTimer.Push(">>>> CreateWordDocPdf"); - _MyHelper.MySection = mySection; - try - { - OnStatusChanged("Get Section", PromsPrinterStatusType.GetSection); - int sectPageCount = 0; - float locEndOfWordDoc = 0; - float pdfSize = 0; - using (PdfInfo myPdf = PdfInfo.Get(mySection,false)) - { - sectPageCount = (int)(Math.Ceiling(myPdf.PageCount)); - locEndOfWordDoc = (float)(myPdf.PageCount - (sectPageCount - 1)) * 100; - pdfSize = (float)myPdf.PageCount; - } - string tocKey = string.Format("TOC{0}", mySection.ItemID); - if (_MyHelper.MyTOCPageCounts.ContainsKey(tocKey)) - { - PageCount pc = _MyHelper.MyTOCPageCounts[tocKey]; - // add 1 because have not hit end page yet. - pc.Total = _MyHelper.CurrentTOCPageNumber + 1; - pc.DrawTemplates(); - } - else - { - // see if this section will be added to the table of content. This is for sections that - // precede tha actual Automated TOC section. - SectionConfig sc = mySection.MyConfig as SectionConfig; - if (sc != null && sc.Section_TOC == "Y") - { - string tockey = "TOC" + mySection.ItemID.ToString(); - if (!_MyHelper.MyTOCPageNums.ContainsKey(tockey)) - // increment the CurrentTOCPageNumber by 1 since we haven't hit an - // endpage yet, and that's what increments it to the current page number. - _MyHelper.MyTOCPageNums.Add(tockey, _MyHelper.CurrentTOCPageNumber + 1); - } - } - float origYoff = (float)mySection.MyDocStyle.Layout.TopMargin; - bool resetSvgForCont = true; - for (int ii = 0; ii < sectPageCount; ii++) - { - int pageNumber = 1 + ii; - bool didFoldout = false; - if (((mySection.MyDocStyle.StructureStyle.Style ?? 0) & E_DocStructStyle.UseSectionFoldout) != 0) - { - didFoldout = true; - DoFoldoutPage(cb, "Word Document", _TextLayer, _MyHelper, 0, false); - } - if (this.MyReaderHelper != null) - { - bool doimport2 = true; - PdfImportedPage fgPage = null; - try - { - fgPage = this.MyReaderHelper.GetPage(mySection, ii + 1); - } - catch (Exception ex) - { - Console.WriteLine(ex); - doimport2 = false; - } - OnStatusChanged("Read MSWord", PromsPrinterStatusType.ReadMSWord); - if (doimport2) - { - if (((!didFoldout && _MyFoldoutReader.Count > 0) || mySection.MyProcedure.ProcHasSupInfoData) && cb.PdfWriter.CurrentPageNumber > 1 && InsertBlankPages) - { - // only insert a blank page if this section does not have a foldout (but the procedure as a whole does) - // and the checkbox on the print dialog to add blank pages is checked - _MyHelper.OnBlankPage = true; - cb.PdfDocument.Add(new iTextSharp.text.Table(1)); - NewPage(); - //_MyLog.InfoFormat("NewPage 3 blank {0}", cb.PdfWriter.CurrentPageNumber); - } - float yoff = 0; - if (_MyHelper.DidFirstPageDocStyle) yoff = origYoff - (float)mySection.MyDocStyle.Layout.TopMargin; - AddImportedPageToLayer(cb.PdfWriter.DirectContent, _MSWordLayer, fgPage, (float)(mySection.MyDocStyle.Layout.MSWordXAdj ?? 0), (float)(mySection.MyDocStyle.Layout.MSWordYAdj ?? 0) + yoff); - if(DebugPagination.IsOpen) DebugPagination.WriteLine("{0:D6},'{1}',{2}", - _MyHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber, mySection.ShortPath,pageNumber); - - } - if (ii == sectPageCount - 1) - { - // if there's and end message, add it to the appropriate location on the last page of - // the word document: - if ((mySection.MyDocStyle.End.Message ?? "") != "") - { - float ylocation = cb.PdfDocument.PageSize.Height - ((float)mySection.MyDocStyle.Layout.TopMargin + locEndOfWordDoc * 72); // 72 - pts per inch. - iTextSharp.text.Font fnt = VolianPdf.GetFont(mySection.MyDocStyle.End.Font.WindowsFont); - fnt.Color = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Black)); - iTextSharp.text.Paragraph para = new Paragraph(mySection.MyDocStyle.End.FixedMessage, fnt); - float wtpm = (float)mySection.MyDocStyle.Layout.PageWidth - (float)mySection.MyDocStyle.Layout.LeftMargin; - float centerpos = (float)mySection.MyDocStyle.Layout.LeftMargin + (wtpm - (mySection.MyDocStyle.End.Message.Length * mySection.MyDocStyle.End.Font.CharsToTwips)) / 2; - float yBottomMargin = Math.Max(0, (float)mySection.MyDocStyle.Layout.TopMargin - (float)mySection.MyDocStyle.Layout.PageLength - 2 * vlnPrintObject.SixLinesPerInch); - float adjMsgY = 0; - if ((float)mySection.MyDocStyle.End.Flag < 0) // Adjust this many lines down the page. - { - adjMsgY = (float)(-(float)mySection.MyDocStyle.End.Flag * vlnPrintObject.SixLinesPerInch); - if (ylocation - adjMsgY > mySection.MyDocStyle.Layout.FooterLength) ylocation = ylocation - adjMsgY; - } - bool landscape = (mySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_WordContentLandscaped) == E_DocStructStyle.DSS_WordContentLandscaped; - if (landscape) - { - cb.SaveState(); - System.Drawing.Drawing2D.Matrix myMatrix = new System.Drawing.Drawing2D.Matrix(0, 1, -1, 0, cb.PdfDocument.PageSize.Height, 0); - cb.Transform(myMatrix); - } - Rtf2Pdf.TextAt(cb, para, centerpos, ylocation + 6, 200, 12, "", yBottomMargin); - if (landscape) cb.RestoreState(); - } - } - OnStatusChanged("Merge MSWord", PromsPrinterStatusType.MergeMSWord); - } - OnStatusChanged("Before NewPage", PromsPrinterStatusType.Before); - if (mySection.MyDocStyle.LandscapePageList)// && mySection.MyDocStyle.Layout.PageWidth > mySection.MyDocStyle.Layout.PageLength) - _MyHelper.IsLandscape = true; - else - _MyHelper.IsLandscape = false; - NewPage(ii == sectPageCount-1); // Word Document - //_MyLog.InfoFormat("NewPage 3 {0}", cb.PdfWriter.CurrentPageNumber); - - // if this document style has another style that is for pages other than first, we need to - // reset the document style off of this section AND reset docstyle values used. - _MyHelper.DidFirstPageDocStyle = true; - - // Calvert has a case in their stp landscape word docs where a ' (Continued)' message - // appears in their pagelist item for printing the section title, {ATTACHTITLECONT} pagelist - // However, other sections use this token, but do NOT have the continue message - so - // the docstyle was added to flag the difference between them (STP-Landscape Attachments has it, - // STP-Attachments do not) - if (resetSvgForCont && (mySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListAddSectCont) == E_DocStructStyle.DSS_PageListAddSectCont) - { - _MyHelper.ResetSvg(); - resetSvgForCont = false; // only need to reset it once (for all pages after 1st page) - } - - //DebugPagination.WriteLine("CreateWordDocPdf"); - if ((mySection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnFirstPage) > 0) - _MyHelper.MySection = mySection; // this resets the docstyle/pagestyle in pagehelper - OnStatusChanged("After NewPage", PromsPrinterStatusType.NewPage); - } - } - catch (Exception ex) - { - NewPage(); // can we put out 'error on page'? - _MyLog.InfoFormat("NewPage error on page {0}", cb.PdfWriter.CurrentPageNumber); - } - finally - { - _MyHelper.IsLandscape = false; // reset landscape mode to false - } - ProfileTimer.Pop(profileDepth); - } - private void GenerateTOC(SectionInfo tocSection, ProcedureInfo myProcedure, PdfContentByte cb, PdfLayer textLayer) - { - iTextSharp.text.pdf.PdfWriter writer = cb.PdfWriter; - float _PointsPerPage = 792; - float yTopMargin = _PointsPerPage - (float)tocSection.MyDocStyle.Layout.TopMargin; - float yBottomMargin = Math.Max(0, yTopMargin - (float)tocSection.MyDocStyle.Layout.PageLength); // - 2 * vlnPrintObject.SixLinesPerInch); - if (textLayer != null) cb.BeginLayer(textLayer); - TableOfContentsData tOfC = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData; - //ItemInfo procItem = ItemInfo.Get(myProcedure.ItemID); - ItemInfo procItem = myProcedure; - lastyLocation = 0; - AddSectionToTOC(tocSection, procItem, tOfC, cb, yTopMargin, 0, false); // add all of the marked sections and sub-sections to the table of contents - if (textLayer != null) cb.EndLayer(); - NewPage(); - //_MyLog.InfoFormat("NewPage 4 {0}", cb.PdfWriter.CurrentPageNumber); - _NoBreakYOffset = 0; - } - float lastyLocation = 0; - private string GetRtfToC(string txt, TableOfContentsData tOfCData) - { - return GetRtfToC(txt, tOfCData, null); - } - private string GetRtfToC(string txt, TableOfContentsData tOfCData, VE_Font overrideFont) - { - StringBuilder _RtfSB = new StringBuilder(); - VEPROMS.CSLA.Library.DisplayText toctxt = new VEPROMS.CSLA.Library.DisplayText(txt, tOfCData.Font, false); - System.Drawing.Font myFont = toctxt.TextFont.WindowsFont; - if (overrideFont != null) - { - toctxt = new VEPROMS.CSLA.Library.DisplayText(txt, overrideFont, false); - myFont = overrideFont.WindowsFont;//toctxt.TextFont.WindowsFont; - } - _RtfSB.Append(vlnPrintObject.AddFontTable(myFont)); - _RtfSB.Append(toctxt.StartText); - _RtfSB.Append("}"); - return _RtfSB.ToString(); - } - private float AddSectionToTOC(SectionInfo tocSection, ItemInfo ii, TableOfContentsData tOfC, PdfContentByte cb, float yPageStart, float yLocation, bool didSubSecLineSpacing) - { - // The following adjustments are for WCN1: - // for xAdjNumber: 6 is for 1 char less in 16bit (\promsnt\exe\print\tabocont.c, method 'howMany'. - // 1.2 is a tweak to get output to match between 16 & 32 bit. - // for xAdjTitle: .8 & 1.2 are both tweaks to get output to match. - // for xAdjTitleIndent: 6 is for 1 char less. 2.4 is a tweak - float xAdjNumber = -6 + 1.2F; - float xAdjTitle = .8F + 1.2F; - float xAdjTitleIndent = -6 + 2.4F; - float yadj = 0.5F; // tweak to get 16 & 32 bit output to match. - - float yPageStartAdj = yPageStart - yadj; - float leftMargin = (float)tocSection.MyDocStyle.Layout.LeftMargin; - float secNumPos = (float)tOfC.TofCSecNumPos + xAdjNumber; - float secTitlePos = (float)tOfC.TofCSecTitlePos + xAdjTitle; - float secPagePos = (float)tOfC.TofCPageNumPos + xAdjNumber; - float height = tOfC.Font.WindowsFont.Size * 1.5F; - string lastTOCGroupHeading = ""; - if (ii.Sections != null) - { - int sectCnt = 0; // keep count of which section/sub-section we are processing - bool doSubY = false; - foreach (SectionInfo mySection in ii.Sections) - { - sectCnt++; - SectionConfig sc = mySection.MyConfig as SectionConfig; - if ((mySection.MyDocStyle != null && mySection.MyDocStyle.IncludeInTOC && (sc == null || sc.Section_TOC != "Y")) - || ((mySection.MyDocStyle == null || !mySection.MyDocStyle.IncludeInTOC) && (sc != null && sc.Section_TOC == "Y"))) - { - // for indenting of subsections, count up tree. Only start indenting - // at third level, i.e. not indent on 1.0 and 1.1, but indent on 1.1.1: - int level = 0; - ItemInfo iilvl = mySection as ItemInfo; - while (!iilvl.IsProcedure) - { - level++; - iilvl = iilvl.MyParent; - } - // check what level the plant wants the auto ToC indented: - int tofCNumLevels = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCNumLevels ?? 0; - if (tofCNumLevels > 0 && level > tofCNumLevels) return yLocation; - - int startIndentAfterLevel = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCStartIndentAfterLevel ?? 2; // - //level = level <= 2 ? 0 : level - 2; // no indenting until third level - level = level <= startIndentAfterLevel ? 0 : level - startIndentAfterLevel; - float indentOffset = (level * (secTitlePos - secNumPos)); - - if (didSubSecLineSpacing && sectCnt == 1 && indentOffset > 0) // processing first sub-section and we are indenting B2016-205 - { - // processed last sub-section so use the main section line spacing (most times is double spaced) - yLocation -= (float)(tOfC.TofCLineSpacingSub ?? 1) * vlnPrintObject.SixLinesPerInch; - yLocation += (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch; - } - // The Group Title logic was added for V.C. Summer and Farley(new writer guide format) - // It allows the user to enter a Table of Contents Grouping Title on the Section Property (under automation) - // The grouping title will print if the same title wasn't last printed - string tocGrpHeading = sc.Section_TOC_Group_Title; // returns a "" if no title was entered - float yBottomMargin = yPageStart - (float)tocSection.MyDocStyle.Layout.PageLength + (2 * vlnPrintObject.SixLinesPerInch); - bool doGroupHeading = false; - if (tocGrpHeading != lastTOCGroupHeading && tocGrpHeading.Length > 0) - { - doGroupHeading = true; - if (lastTOCGroupHeading != "") - yLocation += vlnPrintObject.SixLinesPerInch; - lastTOCGroupHeading = tocGrpHeading; - } - // need to do the section number, section title & page number. Page number - // has to be put on at end after number of page is known, so use a Template. - bool didGrp = false; - string tmptxt = mySection.MyContent.Number == null || mySection.MyContent.Number == "" ? " " : mySection.DisplayNumber;// B2017-019 - process "" in section number - if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCRemoveGrpNameInSects - && tocGrpHeading.Length > 0 && tmptxt.ToUpper().Contains(tocGrpHeading)) - { - tmptxt = tmptxt.Replace(tocGrpHeading, ""); - didGrp = true; - } - if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCRemoveGrpNameInSects - && lastTOCGroupHeading.Length > 0 && tmptxt.ToUpper().Contains(lastTOCGroupHeading)) - { - tmptxt = tmptxt.Replace(lastTOCGroupHeading, ""); - didGrp = true; - } - string rtfText = GetRtfToC(tmptxt, tOfC); - Paragraph myparagraphSecNum = vlnPrintObject.RtfToParagraph(rtfText); - float width = 0; - foreach (Chunk chkt in myparagraphSecNum.Chunks) - width += chkt.GetWidthPoint(); - float numwidth = width; - Rtf2Pdf.Offset = new PointF(0, 2.5F); - - // if the starting column of text would be in 'middle of' the number, just put it - // a few spaces after the number. The '18' below represents 3 chars. - float adjSecTitlePos = secTitlePos + indentOffset + (level * 6); - if (secNumPos + numwidth + indentOffset > secTitlePos + indentOffset) - adjSecTitlePos = secNumPos + numwidth + 18 - xAdjTitleIndent + indentOffset; - - // logic put in for V.C. Summer who wants to their auto table of contents to print "OPERATOR ACTIONS" (set in the format) instead of "Procedure Steps" - // - note that Summer didn't want to change the section title because they want transition to say "procedure step" for the section title. 03/08/2016 - string tocSecTitle = mySection.FormattedDisplayText;// B2017-019 - process "" in section title - if (tocSecTitle.ToUpper() == "PROCEDURE STEPS" && tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCProcedureStepsTitle != "") - tocSecTitle = tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCProcedureStepsTitle; - - // Do the title first since it may wrap to 2nd line and this is an issue for - // doing a pagebreak, i.e. may cause a page break when the number on a single line - // would not. - //if (tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData - if (level == 0 && tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCUnderlineFirstLevelTitle) - { - VE_Font ovrFont = new VE_Font(tOfC.Font.Family, (int)tOfC.Font.Size,(E_Style)tOfC.Font.Style | E_Style.Underline, (float)tOfC.Font.CPI); - rtfText = GetRtfToC(tocSecTitle, tOfC, ovrFont); - } - else - rtfText = GetRtfToC(tocSecTitle, tOfC); - Paragraph myparagraphSecTitle = vlnPrintObject.RtfToParagraph(rtfText); // section title - width = secPagePos - adjSecTitlePos - 6; - float savTitleWid = width; - // for South Texas Table of Contents - // if there is no section number (we put a blank in tmptxt) then move the section title over to the section number position - if (doGroupHeading) // see if the group title and the first item under it will fit on the page B2016-216 - { - VE_Font grpingFont = new VE_Font(tOfC.Font.Family, (int)tOfC.Font.Size, (E_Style)tOfC.Font.Style | E_Style.Underline, (float)tOfC.Font.CPI); - string rtfGrpingText = GetRtfToC(tocGrpHeading, tOfC, grpingFont); - Paragraph myparagraphGrpTitle = vlnPrintObject.RtfToParagraph(rtfGrpingText); - float w = secPagePos - 6; - int lnaftergroup = ((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 0) > 0) ? 1 : 2; - float yLocAfterGrpTitleAndFirstItem = yLocation + (lnaftergroup * vlnPrintObject.SixLinesPerInch) + vlnPrintObject.GetHeight(cb, myparagraphGrpTitle, string.Empty, w, false) + vlnPrintObject.GetHeight(cb, myparagraphSecTitle, string.Empty, savTitleWid, false); - // if group heading and first item under it does not fit on the page, do a page break - if ((yPageStart - yLocAfterGrpTitleAndFirstItem) < yBottomMargin) - { - NewPage(); - _MyHelper.ResetSvg(); // needed to reset so that PSNotFirst pagelist justify flag gets used for BGE - yLocation = lastyLocation = 0; - } - //if (yLocation > 0) yLocation += vlnPrintObject.SixLinesPerInch;// commented out for B2016-200 // for two blank line between last TOC title and the new grouping title - float rtnval = Rtf2Pdf.TextAt(cb, myparagraphGrpTitle, leftMargin + secNumPos, yPageStart - yLocation, w, height, "", yBottomMargin); // print the Group Title - yLocation += vlnPrintObject.SixLinesPerInch; // for two blank line between last TOC title and the new grouping title - added for B2016-200 - yLocation += (lnaftergroup * vlnPrintObject.SixLinesPerInch); // new line - } - // Print the section title - float retval = Rtf2Pdf.TextAt(cb, myparagraphSecTitle, leftMargin + ((tOfC.TofCSecNumPos == tOfC.TofCSecTitlePos && tmptxt.Equals(" "))? secNumPos : adjSecTitlePos), yPageStart - yLocation, width, height, "", yBottomMargin); - if (retval == 0) // couldn't fit, flags need for a page break. - { - NewPage(); - _MyHelper.ResetSvg(); // needed to reset so that PSNotFirst pagelist justify flag gets used for BGE - yLocation = lastyLocation = 0; - retval = Rtf2Pdf.TextAt(cb, myparagraphSecTitle, leftMargin + adjSecTitlePos, yPageStart - yLocation, width, height, "", yBottomMargin); - } - float ttlRetval = retval; - float savTitleFillWidth = Rtf2Pdf.FillWidth; - - // Now do the section number. Retval is the ylocation on page after the text - // is put out. - retval = Rtf2Pdf.TextAt(cb, myparagraphSecNum, leftMargin + secNumPos + indentOffset, yPageStart - yLocation, numwidth * 1.3F, height, "", yBottomMargin); - - //float lSpace = (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch; - - // adjust ylocation for pagenumber - the ylocation will get reset if the - // section title split on 2 lines and the page number needs to be on the 2nd line. - // Only do this if the title is not empty (the code was meant for if title spans more than a line) - if (retval != ttlRetval && mySection.MyContent.Text != null && mySection.MyContent.Text != "") yLocation += (retval - ttlRetval); - - // retval = the minimum (further down the page) between section number and - // title - this accounts for multi line title. - retval = Math.Min(retval, ttlRetval); - lastyLocation = retval; - - // check that the page number should be in the TOC (some BGE sections do not have the page number) - if (!((mySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontNumberInTOC) == E_DocStructStyle.DontNumberInTOC)) - { - // add a template for the page number: - // if the space character is not null & is not a space, the we've got to put out - // these between the section title & the page number - if (tOfC.TofCSpaceChar != null && tOfC.TofCSpaceChar != "" && tOfC.TofCSpaceChar != " ") - { - width = 0; - foreach (Chunk chkt in myparagraphSecTitle.Chunks) - width += chkt.GetWidthPoint(); - - // get height - if two lines high, need width of 2nd line for adding - // space characters - float heightTtl = vlnPrintObject.GetHeight(cb, myparagraphSecTitle, string.Empty, savTitleWid, false); - string spaceStr = ""; - float startSpace = 0; - // the '6's in the next few code lines & in the 'while' loop below allows the placement of the dots (or other space character) - // to be not too close to section title & page number. - if (heightTtl > vlnPrintObject.SixLinesPerInch) - { - // this title is 2 or more lines, find start of leader dots by determining length of text - // on 2nd line (the savTitleFillWidth is the widest line of the split title) - float secondLineWidth = width - savTitleFillWidth; - startSpace = leftMargin + adjSecTitlePos + secondLineWidth + 6; - } - else - startSpace = leftMargin + adjSecTitlePos + width + 6; - // If the page number is Right justified, need less space characters ('.') so that page number - // doesn't have the last space character overwriting the 1st digit: - int endJust = (tOfC.TofCPageNumAlign.ToUpper() == "RIGHT") ? 18 : 6; - - float endSpace = leftMargin + secPagePos - endJust; - float numSpace = endSpace - startSpace; - rtfText = GetRtfToC(tOfC.TofCSpaceChar, tOfC); - Paragraph tmpmyparagraph = vlnPrintObject.RtfToParagraph(rtfText); - float spacchrwid = 0; - foreach (Chunk chkt in tmpmyparagraph.Chunks) - spacchrwid += chkt.GetWidthPoint(); - while (numSpace > 6) - { - spaceStr = spaceStr + tOfC.TofCSpaceChar; - numSpace -= spacchrwid; - } - - rtfText = GetRtfToC(spaceStr, tOfC); // out the leader dots - Paragraph myparagraphs = vlnPrintObject.RtfToParagraph(rtfText); - retval = Rtf2Pdf.TextAt(cb, myparagraphs, startSpace, yPageStart - yLocation, endSpace - startSpace, height, "", yBottomMargin); - - } - // if in the pre-table of content list, just put the page number out as text. - // otherwise, add a template _MyHelper.MyTOCPageCounts - string key = "TOC" + mySection.ItemID.ToString(); - if (mySection.IsAutoTOCSection || _MyHelper.MyTOCPageNums.ContainsKey(key)) - { - string pnum = _MyHelper.MyTOCPageNums.ContainsKey(key) ? _MyHelper.MyTOCPageNums[key].ToString() : (_MyHelper.CurrentTOCPageNumber + 1).ToString(); - rtfText = GetRtfToC(pnum, tOfC); - Paragraph myparagraphp = vlnPrintObject.RtfToParagraph(rtfText); - width = pnum.Length * 6; - retval = Rtf2Pdf.TextAt(cb, myparagraphp, leftMargin + secPagePos, yPageStart - yLocation, width, height, "", yBottomMargin); - } - else - AddTemplateTOCPageCounts(tOfC, yLocation, yPageStartAdj, leftMargin, secPagePos, height, mySection); - } - //If the format wants single spacing within subsections (2nd level and lower), then need to figure out - // spacing (vcb1 table of contents) - //bool dosuby = (((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 1) > 0) - // && (mySection.MyParent.IsSection && ((mySection.Sections != null && mySection.Sections.Count > 0) || (level > 0 && mySection.NextItem != null)))) - // || didGrp; - doSubY = (((tocSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCLineSpacingSub ?? 1) > 0) - && (mySection.MyParent.IsSection && (/* mySection.Sections == null && */ sectCnt < ii.Sections.Count))) // B2016-205 - || didGrp; - if (doSubY) - yLocation += (float)(tOfC.TofCLineSpacingSub ?? 1) * vlnPrintObject.SixLinesPerInch; - else - yLocation += (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch; - } - float savYLoc = yLocation; - yLocation = AddSectionToTOC(tocSection, mySection, tOfC, cb, yPageStart, yLocation, doSubY); - if (savYLoc == yLocation) // nothing was outputted i.e. the subsections are not included on the TOC // B2016-205 - { - if (doSubY && sectCnt == ii.Sections.Count) - { - // processed last sub-section so use the main section line spacing (most times is double spaced) - yLocation -= (float)(tOfC.TofCLineSpacingSub ?? 1) * vlnPrintObject.SixLinesPerInch; - yLocation += (float)(tOfC.TofCLineSpacing ?? 1) * vlnPrintObject.SixLinesPerInch; - } - } - } - } - return yLocation; - } - - private void AddTemplateTOCPageCounts(TableOfContentsData tOfC, float yLocation, float yPageStartAdj, float leftMargin, float secPagePos, float height, SectionInfo mySection) - { - string key = "TOC" + mySection.ItemID.ToString(); - PdfTemplate tmp = _MyHelper.MyTOCPageCounts.AddToTemplateList(key, _MyHelper.MyPdfWriter, "{TOCPAGE}", tOfC.Font.WindowsFont, (tOfC.TofCPageNumAlign.ToUpper() == "RIGHT") ? Element.ALIGN_RIGHT : Element.ALIGN_LEFT, PrintOverride.TextColor); - _MyHelper.MyPdfContentByte.AddTemplate(tmp, leftMargin + secPagePos, (yPageStartAdj - yLocation) - height / 2); - } - - //private string GetRtfPlacekeeper(string txt, PlacekeeperData pkCData) - //{ - // StringBuilder _RtfSB = new StringBuilder(); - // Volian.Controls.Library.DisplayText pktxt = new Volian.Controls.Library.DisplayText(txt, pkCData.Font, false); - // System.Drawing.Font myFont = pktxt.TextFont.WindowsFont; - // _RtfSB.Append(vlnPrintObject.AddFontTable(myFont)); - // _RtfSB.Append(pktxt.StartText); - // _RtfSB.Append("}"); - // return _RtfSB.ToString(); - //} - //private float AddSectionToPK(SectionInfo pkSection, ItemInfo ii, PlacekeeperData pkData, PdfContentByte cb, float yPageStart, float yLocation) - //{ - // SectionConfig pkSC = pkSection.MyConfig as SectionConfig; - // if (pkSC.Section_Placekeeper != "Y") return yLocation; // automatic generation of Placekeeper turned off - // float xAdjNumber = -6 + 1.2F; - // float xAdjTitle = .8F + 1.2F; - // float xAdjTitleIndent = -6 + 2.4F; - // float yadj = 0.5F; // tweak to get 16 & 32 bit output to match. - - // float yPageStartAdj = yPageStart - yadj; - // float leftMargin = (float)pkSection.MyDocStyle.Layout.LeftMargin; - // //float secNumPos = (float)tOfC.TofCSecNumPos + xAdjNumber; - // //float secTitlePos = (float)tOfC.TofCSecTitlePos + xAdjTitle; - // //float secPagePos = (float)tOfC.TofCPageNumPos + xAdjNumber; - // //float height = tOfC.Font.WindowsFont.Size * 1.5F; - // if (ii.Sections != null) - // { - // foreach (SectionInfo mySection in ii.Sections) - // { - // SectionConfig sc = mySection.MyConfig as SectionConfig; - // if (mySection.ItemID != pkSection.ItemID && sc != null && sc.Section_Placekeeper == "Y") - // { - // // Look at each step in the section and build a Placekeeper for those steps that are marked - - // // need to do the section number, section title & page number. Page number - // // has to be put on at end after number of page is known, so use a Template. - // //string tmptxt = mySection.MyContent.Number == null || mySection.MyContent.Number == "" ? " " : mySection.MyContent.Number; - // //string rtfText = GetRtfPlacekeeper(tmptxt, pkData);//GetRtfToC(tmptxt, tOfC); - // //Paragraph myparagraphn = vlnPrintObject.RtfToParagraph(rtfText); - // float width = 0; - // //foreach (Chunk chkt in myparagraphn.Chunks) - // // width += chkt.GetWidthPoint(); - // float numwidth = width; - // float yBottomMargin = yPageStart - (float)pkSection.MyDocStyle.Layout.PageLength + (2 * vlnPrintObject.SixLinesPerInch); - // Rtf2Pdf.Offset = new PointF(0, 2.5F); - - // //// for indenting of subsections, count up tree. Only start indenting - // //// at third level, i.e. not indent on 1.0 and 1.1, but indent on 1.1.1: - // //int level = 0; - // //ItemInfo iilvl = mySection as ItemInfo; - // //while (!iilvl.IsProcedure) - // //{ - // // level++; - // // iilvl = iilvl.MyParent; - // //} - // //// check what level the plant wants the auto ToC indented: - // //int tofCNumLevels = pkSection.ActiveFormat.PlantFormat.FormatData.SectData.AccSectionData.TableOfContentsData.TofCNumLevels ?? 0; - // //if (tofCNumLevels > 0 && level > tofCNumLevels) return yLocation; - - // //level = level <= 2 ? 0 : level - 2; // no indenting until third level - // //float indentOffset = (level * (secTitlePos - secNumPos)); - - // // if the starting column of text would be in 'middle of' the number, just put it - // // a few spaces after the number. The '18' below represents 3 chars. - // //float adjSecTitlePos = secTitlePos + indentOffset + (level * 6); - // //if (secNumPos + numwidth + indentOffset > secTitlePos + indentOffset) - // // adjSecTitlePos = secNumPos + numwidth + 18 - xAdjTitleIndent + indentOffset; - // //rtfText = GetRtfToC(mySection.MyContent.Text, tOfC); - // //Paragraph myparagrapht = vlnPrintObject.RtfToParagraph(rtfText); - // //width = secPagePos - adjSecTitlePos - 6; - // //float retval = Rtf2Pdf.TextAt(cb, myparagrapht, leftMargin + adjSecTitlePos, yPageStart - yLocation, width, height, "", yBottomMargin); - // //float ttlRetval = retval; - // //if (retval == 0) - // //{ - // // cb.PdfDocument.NewPage(); - // // //_MyLog.InfoFormat("NewPage 5 {0}", cb.PdfWriter.CurrentPageNumber); - // // yLocation = lastyLocation = 0; - // // retval = Rtf2Pdf.TextAt(cb, myparagrapht, leftMargin + adjSecTitlePos, yPageStart - yLocation, width, height, "", yBottomMargin); - // // ttlRetval = retval; - // //} - // //retval = Rtf2Pdf.TextAt(cb, myparagraphn, leftMargin + secNumPos + indentOffset, yPageStart - yLocation, width * 1.3F, height, "", yBottomMargin); - // //if (retval == 0) // do a newpage, it couldn't fit on current page. - // //{ - // // cb.PdfDocument.NewPage(); - // // //_MyLog.InfoFormat("NewPage 5 {0}", cb.PdfWriter.CurrentPageNumber); - // // yLocation = lastyLocation = 0; - // // retval = Rtf2Pdf.TextAt(cb, myparagraphn, leftMargin + secNumPos + indentOffset, yPageStart - yLocation, width * 1.3F, height, "", yBottomMargin); - // //} - // //retval = Math.Min(retval, ttlRetval); - // //float lSpace = (tOfC.TofCLineSpacing == 2) ? 2 * vlnPrintObject.SixLinesPerInch : vlnPrintObject.SixLinesPerInch; - // //if (lastyLocation != 0 && ((lastyLocation - retval) > lSpace)) - // // yLocation += (lastyLocation - retval - lSpace); - // //lastyLocation = retval; - - // //// check that the page number should be in the TOC (some BGE sections do not have the page number) - // //if (!((mySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontNumberInTOC) == E_DocStructStyle.DontNumberInTOC)) - // //{ - // // // add a template for the page number: - // // // if the space character is not null & is not a space, the we've got to put out - // // // these between the section title & the page number - // // if (tOfC.TofCSpaceChar != null && tOfC.TofCSpaceChar != "" && tOfC.TofCSpaceChar != " ") - // // { - // // width = 0; - // // foreach (Chunk chkt in myparagrapht.Chunks) - // // width += chkt.GetWidthPoint(); - // // float startSpace = leftMargin + adjSecTitlePos + width; - // // float endSpace = leftMargin + secPagePos; - // // float numSpace = endSpace - startSpace; - // // string spaceStr = ""; - // // rtfText = GetRtfToC(tOfC.TofCSpaceChar, tOfC); - // // Paragraph tmpmyparagraph = vlnPrintObject.RtfToParagraph(rtfText); - // // float spacchrwid = 0; - // // foreach (Chunk chkt in tmpmyparagraph.Chunks) - // // spacchrwid += chkt.GetWidthPoint(); - // // while (numSpace > 0) - // // { - // // spaceStr = spaceStr + tOfC.TofCSpaceChar; - // // numSpace -= spacchrwid; - // // } - // // rtfText = GetRtfToC(spaceStr, tOfC); - // // Paragraph myparagraphs = vlnPrintObject.RtfToParagraph(rtfText); - // // retval = Rtf2Pdf.TextAt(cb, myparagraphs, startSpace, yPageStart - yLocation, endSpace - startSpace, height, "", yBottomMargin); - // // } - // // // if in the pre-table of content list, just put the page number out as text. - // // // otherwise, add a template _MyHelper.MyTOCPageCounts - // // string key = "TOC" + mySection.ItemID.ToString(); - // // if (mySection.IsAutoTOCSection || _MyHelper.MyTOCPageNums.ContainsKey(key)) - // // { - // // string pnum = _MyHelper.MyTOCPageNums.ContainsKey(key) ? _MyHelper.MyTOCPageNums[key].ToString() : (_MyHelper.CurrentTOCPageNumber + 1).ToString(); - // // rtfText = GetRtfToC(pnum, tOfC); - // // Paragraph myparagraphp = vlnPrintObject.RtfToParagraph(rtfText); - // // width = pnum.Length * 6; - // // retval = Rtf2Pdf.TextAt(cb, myparagraphp, leftMargin + secPagePos, yPageStart - yLocation, width, height, "", yBottomMargin); - // // } - // // else - // // AddTemplateTOCPageCounts(tOfC, yLocation, yPageStartAdj, leftMargin, secPagePos, height, mySection); - // //} - - // yLocation += vlnPrintObject.SixLinesPerInch; - // } - // //yLocation = AddSectionToTOC(tocSection, mySection, tOfC, cb, yPageStart, yLocation); - // } - // } - // return yLocation; - //} - - //private void AddTemplatePKPageCounts(TableOfContentsData tOfC, float yLocation, float yPageStartAdj, float leftMargin, float secPagePos, float height, SectionInfo mySection) - //{ - // string key = "PK" + mySection.ItemID.ToString(); - // PdfTemplate tmp = _MyHelper.MyTOCPageCounts.AddToTemplateList(key, _MyHelper.MyPdfWriter, "{TOCPAGE}", tOfC.Font.WindowsFont, Element.ALIGN_LEFT, PrintOverride.TextColor); - // _MyHelper.MyPdfContentByte.AddTemplate(tmp, leftMargin + secPagePos, (yPageStartAdj - yLocation) - height / 2); - //} - private static void PrintTextMessage(PdfContentByte cb, string message, PdfLayer textLayer) - { - if (textLayer != null) cb.BeginLayer(textLayer); - float fontSize = 30; - ColumnText ct = new ColumnText(cb); - iTextSharp.text.Font font = FontFactory.GetFont("Arial", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, fontSize,iTextSharp.text.Font.NORMAL, new iTextSharp.text.Color(PrintOverride.TextColor)); - Chunk chk = new Chunk(message, font); - float xCenter = cb.PdfDocument.PageSize.Width / 2; - float yCenter = cb.PdfDocument.PageSize.Height / 2; - float width = chk.GetWidthPoint() * 1.01F; - float height = fontSize * 1.5F; - ct.SetSimpleColumn(xCenter - width / 2, yCenter - height / 2, xCenter + width / 2, yCenter + height / 2); - Phrase ph = new Phrase(chk); - ct.AddElement(ph); - cb.SetColorFill(new iTextSharp.text.Color(PrintOverride.TextColor)); - ct.Go(); - if (textLayer != null) cb.EndLayer(); - } - private float _NoBreakYOffset = 0; - private float _NoBreakYPageStart = 0; - private void CreateStepPdf(SectionInfo section, PdfContentByte cb) - { - int profileDepth = ProfileTimer.Push(">>>> CreateStepPdf"); - //PrintTimer pt = new PrintTimer(); - iTextSharp.text.pdf.PdfWriter writer = cb.PdfWriter; - ItemInfo myItemInfo = section as ItemInfo; - if (SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks) - { - if (section.StepSectPageBreaksForSupInfo == null) section.StepSectPageBreaksForSupInfo = new List(); - else section.StepSectPageBreaksForSupInfo.Clear(); - } - // 792: 72 * 11 inches - TopRow - Top is high value - float _PointsPerPage = 792; - float yTopMargin = _PointsPerPage - (float)myItemInfo.MyDocStyle.Layout.TopMargin; - yTopMargin -= _MyHelper.AdjustTopMarginForMultiLinePageListItems; - // the following line was modified to comment out the - 2 * SixLinesPerInch. this fixed a pagination problem with WCN EMG E-3. - float yBottomMargin = Math.Max(0, yTopMargin - (float)myItemInfo.MyDocStyle.Layout.PageLength); // - 2 * vlnPrintObject.SixLinesPerInch); - vlnParagraph.PathPrefix = myItemInfo.Path; - //Rtf2Pdf.PdfDebug = true; - Rtf2Pdf.Offset = new PointF(0, 2.5F); - if (section.MyDocStyle.LandscapePageList) - { - if ((section.MyConfig as SectionConfig).Section_Pagination == SectionConfig.SectionPagination.Separate) - { - System.Drawing.Drawing2D.Matrix myMatrix = new System.Drawing.Drawing2D.Matrix(0, 1, -1, 0, cb.PdfDocument.PageSize.Height, 0); - cb.Transform(myMatrix); - } - } - else - _MyHelper.IsLandscape = false; - _MyHelper.ChangeBarDefinition = MyChangeBarDefinition; - //pt.Description = "vlnParagrph"; - vlnParagraph myParagraph = new vlnParagraph(null, cb, myItemInfo, (float)myItemInfo.MyDocStyle.Layout.LeftMargin, _NoBreakYOffset, 0, myItemInfo.ColumnMode, myItemInfo.ActiveFormat, null, null, 0, true, this); - //pt.Description = "After vlnParagrph"; - //if (myParagraph.MyItemInfo.InList(15906)) - //{ - // CPSGen myGen = new CPSGen(myParagraph); - // myGen.Generate("TestCPSGEN.xml"); - //} - float localYPageStart = 0; - float yPageStart = yTopMargin; - if (myItemInfo.HasChildren || myItemInfo.MyDocVersion.DocVersionConfig.SelectedSlave > 0 || (myItemInfo.ActiveFormat.PlantFormat.FormatData.Express && myItemInfo.MyDocStyle.OptionalSectionContent)) - { - // if there is supplemental information associated with this section... generate the pdf. This pdf will be used to place - // supplemental information on facing pages - if (SupInfoPrintType == E_SupInfoPrintType.Merge && myParagraph.SupInfoSection != null && myParagraph.SupInfoSection.ChildrenBelow != null && myParagraph.SupInfoSection.ChildrenBelow.Count > 0) - GenerateSuppInfoPdf(myParagraph.SupInfoSection, yTopMargin, yBottomMargin); - localYPageStart = myParagraph.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); - if (myParagraph.MyPlaceKeeper != null) - _MyHelper.MyPlacekeepers.Add(myParagraph.MyPlaceKeeper); // add this step text to the PlaceKeeper (Calvert Cliffs) - if (myParagraph.MyContAct != null) - _MyHelper.MyContActSteps.Add(myParagraph.MyContAct); // add this step to the Continuous Action Summary - } - else if (!myItemInfo.MyDocStyle.OptionalSectionContent) - { - SectionInfo si = myItemInfo.ActiveSection as SectionInfo; - if(si.IsSeparatePagination()) // Don't output this message for continuous sections - // This was causing overlap of this message with previous sections - PrintTextMessage(cb, "No Section Content", _TextLayer); - } - SectionConfig.SectionPagination sp = SectionConfig.SectionPagination.Separate; // always the default - ItemInfo nxtItem = section.NextItem; - if (nxtItem != null) - { - // if this section & the next section are not accessory pages, see if there is continuous pagination, - // i.e. no page break between them. - if (section.IsStepSection && nxtItem.IsStepSection) - { - SectionInfo si = nxtItem as SectionInfo; - SectionConfig sc = si.SectionConfig; - try - { - if (sc != null) sp = sc.Section_Pagination; - } - catch (Exception ex) - { - sp = SectionConfig.SectionPagination.Separate; - } - } - } - if (sp == SectionConfig.SectionPagination.Separate) - { - if (section.MyDocStyle.LandscapePageList) - { - _MyHelper.IsLandscape = false; - } - NewPage(true); // end of step section - //_MyLog.InfoFormat("NewPage 6 {0}", cb.PdfWriter.CurrentPageNumber); - _NoBreakYOffset = 0; - yPageStart = yTopMargin; - } - else - { - if (nxtItem != null && nxtItem.MyPrevious != null && nxtItem.ActiveFormat.PlantFormat.FormatData.SectData.SectionHeader.Level0Big) - localYPageStart -= 12; - if (_MyHelper.BottomMessage != null) - { - _MyHelper.DrawBottomMessage(cb); - localYPageStart += 12; - myParagraph.YBottomMost += 24; // two lines. - } - float tmplocal = localYPageStart; - _NoBreakYOffset = myParagraph.YBottomMost; - float yOffset = localYPageStart - yTopMargin; - _NoBreakYOffset -= yOffset; - yPageStart = localYPageStart; - Volian.Base.Library.DebugText.WriteLine("NOBREAK:{0},'{1}','{2}','{3}','{4}','{5}'", section.ItemID, tmplocal, yTopMargin, localYPageStart, _NoBreakYOffset, myParagraph.YBottomMost); - } - OnStatusChanged("StepSection converted to PDF " + section.ShortPath, PromsPrinterStatusType.BuildStep); - //pt.Description = "End"; - ProfileTimer.Pop(profileDepth); - } - - private void GenerateSuppInfoPdf(vlnParagraph vlnParagraph, float yTopMargin, float yBottomMargin) - { - ReaderHelper savMyReaderHelper = MyReaderHelper; - PdfContentByte savMyContentByte = MyContentByte; - VlnSvgPageHelper savMyHelper = _MyHelper; - if (SupInfoPdfPage == null) SupInfoPdfPage = new Dictionary(); - else SupInfoPdfPage.Clear(); - string SupInfoPdfName = Volian.Base.Library.VlnSettings.TemporaryFolder + @"\SupInfo" + vlnParagraph.MyItemInfo.ItemID.ToString() + @".pdf"; - PdfContentByte cb = OpenDoc(SupInfoPdfName, PageSize.LETTER); - if (cb == null) return; - VlnSvgPageHelper myPageHealper = new VlnSvgPageHelper(vlnParagraph.MyItemInfo as SectionInfo, this, null, 0); - cb.PdfWriter.PageEvent = myPageHealper; - myPageHealper.AllowAllWatermarks = AllowAllWatermarks; - myPageHealper.MyPdfWriter = cb.PdfWriter; - myPageHealper.CreatingFoldoutPage = false; - myPageHealper.CreatingSupInfoPage = true; - myPageHealper.MyPdfContentByte = cb; - myPageHealper.ChangeBarDefinition = MyChangeBarDefinition; - float yPageStart = yTopMargin; - vlnParagraph._yPageStartForSupInfo = yTopMargin; - vlnParagraph.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); - try - { - cb.PdfDocument.Close(); - cb = null; - } - catch (Exception ex) - { - Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message); - } - _MyHelper = savMyHelper; - MyContentByte = savMyContentByte; - MyReaderHelper = savMyReaderHelper; - } - public void DoSupInfoPage(PdfContentByte cb, string str, PdfLayer textLayer, VlnSvgPageHelper myPageHelper, int itemid, bool insertBlankPages) - { - // see if the ID is in the facing page pdf - if so, get the page: - if (SupInfoPdfPage == null || SupInfoPdfPage.Count < 1) return; - int getpage = 0; - if (SupInfoPdfPage.ContainsKey(itemid)) getpage = SupInfoPdfPage[itemid]; - if (getpage < 0) - { - myPageHelper.OnBlankPage = true; - cb.PdfDocument.Add(new iTextSharp.text.Table(1)); - NewPage(); - return; - } - PdfImportedPage sipage = null; - try - { - string SupInfoPdfName = Volian.Base.Library.VlnSettings.TemporaryFolder + @"\SupInfo" + myPageHelper.MySection.ItemID.ToString() + @".pdf"; - PdfReader pdfreader = new PdfReader(SupInfoPdfName); - sipage = cb.PdfWriter.GetImportedPage(pdfreader, getpage+1); - AddImportedPageToLayer(cb.PdfWriter.DirectContent, textLayer, sipage, 0, 0); - DoingFacingPage = true; - myPageHelper.ResetSvg(); - NewPage(); - DoingFacingPage = false; - myPageHelper.ResetSvg(); - pdfreader.Close(); - } - catch (Exception ex) - { - Console.WriteLine(ex); - } - } - public void DoFoldoutPage(PdfContentByte cb, string str, PdfLayer textLayer, VlnSvgPageHelper myPageHelper, int foldoutindx, bool insertBlankPages) - { - if (_MyFoldoutSection == null || _MyFoldoutSection.Count==0) return; - - // if the very first page to be output is a 'foldout', treat this as a special case, since - // if duplex printing is on, the foldout should always be on the left side, i.e. or behind - // the document text. The option PROMS provides is to either: - // 1) Skip doing the foldout before the first page, if the 'InsertBlankPages' isn't set, by not checking - // the checkbox on the print dialog. - // 2) Insert a blank page as the first page, if the 'InsertBlankPages' is set. - if (!myPageHelper.PrintedAPage && !insertBlankPages) return; - if (!myPageHelper.PrintedAPage) - { - // only insert a blank page if this is the very first page printed & section has a foldout - // and the checkbox on the print dialog to add blank pages is checked. This will put out a blank page as - // as the first page so that duplex printing is correct for this condition. - myPageHelper.OnBlankPage = true; - cb.PdfDocument.Add(new iTextSharp.text.Table(1)); - NewPage(); - } - - SectionInfo saveSect = myPageHelper.MySection; - myPageHelper.MySection = _MyFoldoutSection[foldoutindx]; - myPageHelper.OnFoldoutPage = true; - if (_MyFoldoutReader != null) - { - bool doimport2 = true; - PdfImportedPage fgPage = null; - try - { // read saved foldout page - fgPage = cb.PdfWriter.GetImportedPage(_MyFoldoutReader[foldoutindx],1); - } - catch (Exception ex) - { - Console.WriteLine(ex); - doimport2 = false; - } - if (doimport2) - {// put the saved foldout page into the PDF - AddImportedPageToLayer(cb.PdfWriter.DirectContent, textLayer, fgPage, 0, 0); - foreach (iTextSharp.text.pdf.PdfAnnotation.PdfImportedLink il in _MyFoldoutReader[foldoutindx].GetLinks(1)) - { - if(!il.IsInternal() ) - cb.PdfWriter.AddAnnotation(il.CreateAnnotation(cb.PdfWriter)); - } - - if (DebugPagination.IsOpen) DebugPagination.WriteLine("{0:D6},'{1}',{2}", - myPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber, "Foldout", 1); - } - } - //_MyLog.InfoFormat("DoFoldoutPage {0}", cb.PdfWriter.CurrentPageNumber); - //PrintTextMessage(cb, "Foldout for: " + str, textLayer); - NewPage();// Temporary for foldout/16bit-32bit page alignment - //_MyLog.InfoFormat("NewPage 8 {0}", cb.PdfWriter.CurrentPageNumber); - myPageHelper.MySection = saveSect; - myPageHelper.OnFoldoutPage = false; - } - public static byte[] WatermarkPDF(byte[] buffer, string watermark) - { - PdfReader reader = new PdfReader(buffer); - MemoryStream ms = new MemoryStream(); - PdfStamper stamper = new PdfStamper(reader, ms); - PdfLayer layer = new PdfLayer("Watermark", stamper.Writer); - layer.SetPrint("Print", true); - for (int i = 1; i <= reader.NumberOfPages; i++) - { - PdfContentByte cb = stamper.GetUnderContent(i); - cb.SaveState(); - cb.BeginLayer(layer); - SvgWatermark wm = new SvgWatermark(cb, watermark, System.Drawing.Color.Blue, .15F); - //wm.SetSquareDotPattern(.7F); - //wm.SetTextPattern(8, 3); - //wm.SetTextPattern2(8); - //wm.SetHashPattern(1, 6); - //wm.SetDotPattern(5, 2); - wm.Draw(); - cb.EndLayer(); - cb.RestoreState(); - } - stamper.Close(); - /* - cb.SaveState(); - if (_WatermarkLayer != null) cb.BeginLayer(_WatermarkLayer); - SvgWatermark myWatermark = new SvgWatermark(cb, Watermark, System.Drawing.Color.Blue, .15F); - myWatermark.SetSquareDotPattern(.7F); - myWatermark.Draw(); - if (_WatermarkLayer != null) cb.EndLayer(); - cb.RestoreState(); - */ - return ms.ToArray(); - } - } - public class ReaderHelper - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private Dictionary dicPage = new Dictionary(); - private Dictionary dicSize = new Dictionary(); - private PromsPrinter _MyPromsPrinter; - public PromsPrinter MyPromsPrinter - { - get { return _MyPromsPrinter; } - set { _MyPromsPrinter = value; } - } - private SectionInfo _MySectionInfo; - public SectionInfo MySectionInfo - { - get { return _MySectionInfo; } - set - { - if (_MySectionInfo == null || value.ItemID != _MySectionInfo.ItemID) - { - _MySectionInfo = value; - //MyPdfFile = _MyPromsPrinter.BuildMSWordPDF(MySectionInfo); - //try - //{ - // MyReader = MyPdfFile != null ? new PdfReader(MyPdfFile) : null; - // string key = string.Empty; - // for (int i = 1; i <= MyReader.NumberOfPages; i++) - // { - // key = string.Format("{0}.{1}", MySectionInfo.ItemID, i); - // dicPage.Add(key, MyPromsPrinter.MyContentByte.PdfWriter.GetImportedPage(MyReader, i)); - // dicSize.Add(key, MyReader.GetPageSizeWithRotation(i)); - // } - //} - //catch (Exception ex) - //{ - // MyReader = null; - //} - } - } - } - private string _MyPdfFile; - public string MyPdfFile - { - get { return _MyPdfFile; } - set { _MyPdfFile = value; } - } - private int _DocID; - public int DocID - { - get { return _DocID; } - set { _DocID = value; } - } - private PdfReader _MyReader; - public PdfReader MyReader - { - get { return _MyReader; } - set { _MyReader = value; } - } - public ReaderHelper(PromsPrinter pp) - { - MyPromsPrinter = pp; - //this.LoadTree(pp.MyItem); - } - public PdfImportedPage GetPage(SectionInfo sectInfo, int pageNumber) - { - string key = string.Format("{0}.{1}", sectInfo.ItemID, pageNumber); - return dicPage[key]; - } - public iTextSharp.text.Rectangle GetSize(SectionInfo sectInfo, int pageNumber) - { - string key = string.Format("{0}.{1}", sectInfo.ItemID, pageNumber); - if(dicSize.ContainsKey(key)) - return dicSize[key]; - return PageSize.LETTER; - } - public void LoadTree(ItemInfo ii) - { - dicPage = new Dictionary(); - dicSize = new Dictionary(); - LoadSectionTree(ii); - } - private void LoadSectionTree(ItemInfo ii) - { - foreach (SectionInfo si in ii.Sections) - { - if (si.IsStepSection) - { - if(si.Sections != null)LoadSectionTree(si); - } - else - { - MyPdfFile = _MyPromsPrinter.BuildMSWordPDF(si); - if (MyPdfFile != null) - { - try - { - MyReader = MyPdfFile != null ? new PdfReader(MyPdfFile) : null; - string key = string.Empty; - for (int i = 1; i <= MyReader.NumberOfPages; i++) - { - key = string.Format("{0}.{1}", si.ItemID, i); - dicPage.Add(key, MyPromsPrinter.MyContentByte.PdfWriter.GetImportedPage(MyReader, i)); - iTextSharp.text.Rectangle rectgl = MyReader.GetPageSizeWithRotation(i); - // If the word page is set to landscape, but the the document sytle is not landscape, then flip the height and width (put back to portrait) - if (!((si.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_WordContentLandscaped) == E_DocStructStyle.DSS_WordContentLandscaped) && rectgl.Height < rectgl.Width) - rectgl = new iTextSharp.text.Rectangle(rectgl.Height, rectgl.Width); - dicSize.Add(key, rectgl); - //dicSize.Add(key, MyReader.GetPageSizeWithRotation(i)); - } - } - catch (Exception ex) - { - if (_MyPromsPrinter.DocReplace == null) - MessageBox.Show(ex.Message, ex.GetType().FullName, MessageBoxButtons.OK, MessageBoxIcon.Error); - _MyLog.Warn(string.Format("Error in LoadSectionTree [{0}],{1}.{2}", si.ItemID, si.DisplayNumber, si.DisplayText), ex); - } - } - } - } - } - } - //public class PrintTimer - //{ - // private DateTime _StartTime = DateTime.Now; - - // public DateTime StartTime - // { - // get { return _StartTime; } - // set { _StartTime = value; } - // } - // private string _Description = "Start"; - // public string Description - // { - // get { return _Description; } - // set - // { - // DateTime dtNext = DateTime.Now; - // //Console.WriteLine("{0},'{1}'", TimeSpan.FromTicks(dtNext.Ticks - LastTime.Ticks).TotalSeconds, Description); - // _Description = value; - // _LastTime = dtNext; - // } - // } - // private DateTime _LastTime = DateTime.Now; - // public DateTime LastTime - // { - // get { return _LastTime; } - // set { _LastTime = value; } - // } - //} -} diff --git a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs.bak b/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs.bak deleted file mode 100644 index a7daaf2c..00000000 --- a/PROMS/Volian.Print.Library/VlnSvgPageHelper.cs.bak +++ /dev/null @@ -1,1899 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using iTextSharp.text; -using iTextSharp.text.pdf; -using iTextSharp.text.factories; -using Volian.Svg.Library; -using System.Text.RegularExpressions; -using System.Xml; -using VEPROMS.CSLA.Library; - -namespace Volian.Print.Library -{ - public partial class VlnSvgPageHelper:SvgPageHelper - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private PageBookmarks _PageBookmarks = new PageBookmarks(); - public PageBookmarks PageBookmarks - { - get { return _PageBookmarks; } - set { _PageBookmarks = value; } - } - private PdfOutline _MyPdfOutline = null; - public PdfOutline MyPdfOutline - { - get { return _MyPdfOutline; } - set { _MyPdfOutline = value; } - } - private ChkListBoxesHelper _CheckListBoxes = null; - private ChkListBoxesHelper CheckListBoxes - { - get { return _CheckListBoxes; } - set { _CheckListBoxes = value; } - } - - private vlnText _TopMessage; - public vlnText TopMessage - { - get { return _TopMessage; } - set { _TopMessage = value; } - } - private vlnText _BottomMessage; - public vlnText BottomMessage - { - get { return _BottomMessage; } - set { _BottomMessage = value; } - } - Dictionary _MyParagraphs = new Dictionary(); - public Dictionary MyParagraphs - { - get { return _MyParagraphs; } - set { _MyParagraphs = value; } - } - float _YMultiplier = 1; - public float YMultiplier - { - get { return _YMultiplier; } - set { _YMultiplier = value; } - } - private PdfWriter _MyPdfWriter; - public PdfWriter MyPdfWriter - { - get { return _MyPdfWriter; } - set - { - MyPageCounts = new PageCounts(); - MyTOCPageCounts = new PageCounts(); - MyTOCPageNums = new Dictionary(); - _MyPdfWriter = value; - } - } - private PdfContentByte _MyPdfContentByte; - public PdfContentByte MyPdfContentByte - { - get { return _MyPdfContentByte; } - set { _MyPdfContentByte = value; } - } - private int _FinalMessageSectionID; - public int FinalMessageSectionID - { - get { return _FinalMessageSectionID; } - set { _FinalMessageSectionID = value; } - } - private bool _DidFirstPageDocStyle = false; - public bool DidFirstPageDocStyle - { - get { return _DidFirstPageDocStyle; } - set { _DidFirstPageDocStyle = value; } - } - public override void OnCloseDocument(PdfWriter writer, iTextSharp.text.Document document) - { - AddBookmarks(writer); - MyPageCounts.DrawTemplates(); - } - private bool _OnBlankPage = false; - public bool OnBlankPage // used while inserting a blank page when printing a procedure with duplex foldouts - { - get { return _OnBlankPage; } - set { _OnBlankPage = value; } - } - // when false, no page has been printed yet (for determining whether a blank page before print - // needs done if first section has foldouts) - private bool _PrintedAPage = false; - public bool PrintedAPage - { - get { return _PrintedAPage; } - set { _PrintedAPage = value; } - } - - // the following two variables are used to handle the 'PSOnlyFirst' page list Justify flag. - // PSOnlyFirst signals that the pagelist token should only be processed for the first page of - // the section. It gets set when this token is processed, so that any remaining pages will - // not get the token. It's value is derived by taking the different the location of this token - // & the location of the previous token, so that this amount can be used to move the text up - // on the 'not first' pages of the section. It's used as an adjustment on the topmargin. - // This is used in FNP formats. - private int _sectLevelNumTtlDiff = 0; - private int _PrintedSectionPage = 0; - public int PrintedSectionPage - { - get { return _PrintedSectionPage; } - set { _PrintedSectionPage = value; } - } - - private bool _AddBlankPagesForDuplexPrinting = false; - public bool AddBlankPagesForDuplexPrinting // Tells us if a the option to add a blank page is turn on (for procedures with duplex foldouts) - { - get { return _AddBlankPagesForDuplexPrinting; } - set { _AddBlankPagesForDuplexPrinting = value; } - } - public override void OnEndPage(PdfWriter writer, iTextSharp.text.Document document) - { - if (OnBlankPage) - { - OnBlankPage = false; - } - else if (!OnFoldoutPage) - { - if (DidFirstPageDocStyle) ResetDocStyleAndValues(); - AddBookmarks(writer); - MyPageCounts.CanIncrement = true; - base.OnEndPage(writer, document); - DrawChangeBars(writer.DirectContent); - DrawMessages(writer.DirectContent); - if (!CreatingFoldoutPage) - DrawRuler(writer.DirectContent); - } - else - { - E_NumberingSequence numseq = MySection.MyDocStyle.NumberingSequence??0; - // if a foldout is only printing within its section, don't do increments on pagecounts: - if (numseq==E_NumberingSequence.WithinEachSection) - MyPageCounts.CanIncrement = false; - else - MyPageCounts.CanIncrement = true; - base.OnEndPage(writer, document); - if (!CreatingFoldoutPage) - DrawRuler(writer.DirectContent); - } - if (MySection.MyDocStyle.StructureStyle.Style==null || (MySection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontCountInTabOfCont) == 0) - CurrentTOCPageNumber++; - if (MySection.MyDocStyle.CenterLineX != null && MySection.ColumnMode > 0) - DrawCenterLine(writer.DirectContent, MySection.MyDocStyle.Layout.LeftMargin + MySection.MyDocStyle.CenterLineX ?? 0, MySection.MyDocStyle.CenterLineYTop ?? 0, MySection.MyDocStyle.CenterLineYBottom ?? 0); - PageListTopCheckOffHeader = null; - PageListLastCheckOffHeader = null; - YMultiplier = 1; - PrintedAPage = true; - } - private Gaps _MyGaps; - public Gaps MyGaps - { - get - { - if (_MyGaps == null) - _MyGaps = new Gaps(); - return _MyGaps; - } - } - public void AddGap(float top, float bottom, float left, float right) - { - float center = MySection.MyDocStyle.Layout.LeftMargin + MySection.MyDocStyle.CenterLineX ?? 0; - if(center == 0) return; - if (center > right || center < left) return; - MyGaps.Add(top, bottom); - } - private void DrawCenterLine(PdfContentByte cb, float xLoc, float yTop, float yBottom) - { - cb.SaveState(); - if (PageListLayer != null) cb.BeginLayer(PageListLayer); - cb.SetLineWidth(.95f); - cb.SetColorStroke(new Color(PrintOverride.SvgColor)); - cb.MoveTo(xLoc, yTop); - if (_MyGaps != null) - { - foreach (Gap gap in MyGaps) - { - cb.LineTo(xLoc, gap.YTop); - cb.MoveTo(xLoc, gap.YTop - (gap.YTop - gap.YBottom) * YMultiplier); - } - _MyGaps = null; - } - cb.LineTo(xLoc, yBottom); - cb.Stroke(); - if (PageListLayer != null) cb.EndLayer(); - cb.RestoreState(); - } - - private bool ResetDocStyleAndValues() - { - // if this document style has another style that is for pages other than first, we need to - // reset the document style off of this section AND reset docstyle values used - // AND reset the 'svg' data. - bool forceLoadSvg = false; - if ((MySection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnFirstPage) > 0) - { - //Console.WriteLine("{0} ResetDocStyleAndValues", MySection.MyDocStyle.Name); - ItemInfo ii = (ItemInfo) MySection; - int indx = (int)MySection.MyDocStyle.IndexOtherThanFirstPage; - foreach (DocStyle ds in ii.ActiveFormat.PlantFormat.DocStyles.DocStyleList) - { - if (ds.Index == indx) - { - MySection.MyDocStyle = ds; - forceLoadSvg = true; - break; - } - } - } - return forceLoadSvg; - } - public void ResetSvg() - { - Volian.Svg.Library.Svg sectSvg = BuildSvg(_MySection, true); - if (sectSvg != null) MySvg = sectSvg; - } - private float? _YTopMargin = null; - public float? YTopMargin - { - get { return _YTopMargin; } - set { _YTopMargin = value; } - } - private void DrawRuler(PdfContentByte cb) - { - if (DebugLayer == null) return; - Layout layout = MySection.MyDocStyle.Layout; - cb.SaveState(); - cb.BeginLayer(DebugLayer); - float x = (cb.PdfWriter.PageSize.Left + cb.PdfWriter.PageSize.Right) / 2; - cb.SetLineWidth(.1F); - cb.SetColorStroke(new Color(System.Drawing.Color.CornflowerBlue)); - float yTop = (float)(cb.PdfWriter.PageSize.Height - layout.TopMargin); - if(YTopMargin != null) yTop = (float)YTopMargin; - float yBottom = (float)(cb.PdfWriter.PageSize.Height - (layout.TopMargin + layout.PageLength)); - //Console.WriteLine("'{0}',{1},{2}", MySection.MyDocStyle.Name, yTop, yBottom); - cb.MoveTo(x, yTop); - cb.LineTo(x, yBottom); - int i = 0; - for (float y = yTop; y >= yBottom; y -= 12) - { - float w = 10; - if (i % 10 == 0) w = 30; - else if (i % 5 == 0) w = 20; - cb.SetLineWidth(w / 30); - i++; - cb.MoveTo(x - w, y); - cb.LineTo(x, y); - cb.Stroke(); - } - i = 0; - for (float y = yTop; y >= yBottom; y -= 10.1F) - { - float w = 10; - if (i % 10 == 0) w = 30; - else if (i % 5 == 0) w = 20; - cb.SetLineWidth(w / 30); - i++; - cb.MoveTo(x + w, y-1); - cb.LineTo(x, y-1); - cb.Stroke(); - } - cb.SetLineWidth(.1F); - cb.Rectangle((float)layout.LeftMargin, yTop, (float)layout.PageWidth - (float)layout.LeftMargin, yBottom - yTop); - float yRuler = 612; - cb.MoveTo(0, yRuler); - cb.LineTo(612, yRuler); - for (float x1 = 0; x1 < 612; x1 += 6) // tic marks every 1/12 inch - { - if (x1 % 72 == 0) - { - cb.MoveTo(x1, yRuler-20); - cb.LineTo(x1, yRuler+20); - } - else if (x1 % 36 == 0) - { - cb.MoveTo(x1, yRuler-10); - cb.LineTo(x1, yRuler+10); - } - else - { - cb.MoveTo(x1, yRuler-5); - cb.LineTo(x1, yRuler); - } - } - for (float x1 = 0; x1 < 612; x1 += 7.2f) // tic marks every 1/10 inch - { - if (x1 % 72 == 0) - { - cb.MoveTo(x1, yRuler); - cb.LineTo(x1, yRuler + 20); - } - else if (x1 % 36 == 0) - { - cb.MoveTo(x1, yRuler); - cb.LineTo(x1, yRuler + 10); - } - else - { - cb.MoveTo(x1, yRuler); - cb.LineTo(x1, yRuler + 5); - } - } - //cb.MoveTo(122.4F, 0); //WCN2 HLS - //cb.LineTo(122.4F, cb.PdfWriter.PageSize.Height); - //cb.MoveTo(78, 0); // HLP HLS - //cb.LineTo(78, cb.PdfWriter.PageSize.Height); - //cb.MoveTo(441, 0); // HLP cover page date - //cb.LineTo(441, cb.PdfWriter.PageSize.Height); - //cb.MoveTo(71.4F, 0); // WCN Purpose page, Revision: {REV} - //cb.LineTo(71.4F, cb.PdfWriter.PageSize.Height); - cb.Stroke(); - cb.EndLayer(); - cb.RestoreState(); - } - private void AddBookmarks(PdfWriter writer) - { - foreach (PageBookmark pb in PageBookmarks) - { - if (!pb.MyItemInfo.IsSection && MyPdfOutline != null) - new PdfOutline(MyPdfOutline, pb.PdfDestination, pb.Title, false); - else - { - PdfDestination dest = new PdfDestination(PdfDestination.FIT); - MyPdfOutline = new PdfOutline(writer.DirectContent.RootOutline, dest, pb.Title, false); - } - } - PageBookmarks.Clear(); - } - private void DrawMessages(PdfContentByte cb) - { - float tmp = 0; - if (TopMessage != null) - { - TopMessage.ToPdf(cb, 0, ref tmp, ref tmp); - TopMessage = null; // Only output it once. - } - if (BottomMessage != null) - { - BottomMessage.ToPdf(cb, 0, ref tmp, ref tmp); - BottomMessage = null; // Only output it once. - } - } - public void DrawBottomMessage(PdfContentByte cb) - { - float tmp = 0; - if (BottomMessage != null) - { - BottomMessage.ToPdf(cb, 0, ref tmp, ref tmp); - BottomMessage = null; // Only output it once. - } - } - private void DrawChangeBars(PdfContentByte cb) - { - float tmp = 0; - foreach (vlnChangeBar vcb in MyChangeBars) - { - // TODO: Pass in zeroes because topdf is inherited. - vcb.ToPdf(cb, 0, ref tmp, ref tmp); - } - _MyChangeBars = new List(); - } - #region SectionLevelData - private ChangeBarDefinition _ChangeBarDefinition; - public ChangeBarDefinition ChangeBarDefinition - { - get { return _ChangeBarDefinition; } - set { _ChangeBarDefinition = value; } - } - #endregion - private PdfLayer _TextLayer; - public PdfLayer TextLayer - { - get { return _TextLayer; } - set { _TextLayer = value; } - } - private PdfLayer _DebugLayer; - public PdfLayer DebugLayer - { - get { return _DebugLayer; } - set { _DebugLayer = value; } - } - private VEPROMS.CSLA.Library.SectionInfo _MySection; - public VEPROMS.CSLA.Library.SectionInfo MySection - { - get { return _MySection; } - set - { - _MySection = value; - MySectionTitle = ((_MySection.DisplayNumber ?? "")=="" ? "" : _MySection.DisplayNumber + " - ") + _MySection.DisplayText; - bool forceLoadSvg = false; - if (DidFirstPageDocStyle) - forceLoadSvg = ResetDocStyleAndValues(); // this method also gets the SVG (the 'else' part of this) - Volian.Svg.Library.Svg sectSvg = BuildSvg(_MySection, forceLoadSvg); - if (sectSvg != null) MySvg = sectSvg; - _YTopMargin = null; - } - } - private string _MySectionTitle; - public string MySectionTitle - { - get { return _MySectionTitle; } - set { _MySectionTitle = value; } - } - private int _MaxRNO; - public int MaxRNO - { - get - { - return _MySection.ColumnMode; - } - } - private int _CurrentPageOf = 0; - public int CurrentPageOf - { - get { return _CurrentPageOf; } - set { _CurrentPageOf = value; } - } - private string _Rev = string.Empty; - public string Rev - { - get { return _Rev; } - set { _Rev = value; } - } - private string _RevDate = string.Empty; - public string RevDate - { - get { return _RevDate; } - set { _RevDate = value; } - } - private bool _DoFloatingFoldout = true; - public bool DoFloatingFoldout - { - get { return _DoFloatingFoldout; } - set { _DoFloatingFoldout = value; } - } - - private List _MyChangeBars = new List(); - public List MyChangeBars - { - get { return _MyChangeBars; } - set { _MyChangeBars = value; } - } - public void AddChangeBar(vlnChangeBar vcb, string cbmess) - { - if (vcb == null) return; - vlnChangeBar prevCB = null; - foreach (vlnChangeBar cb in MyChangeBars) - { - // only look at changebars in same column - if (cb.XOffset == vcb.XOffset) - { - // if the two change bars end at same location, set prevCB which will - // adjust the length (top position) of the change bar. This condition - // also flags that the change bar texts overlap. - if (cb.YChangeBarBottom == vcb.YChangeBarBottom) prevCB = cb; - - // continuous case, if changes bars overlap, adjust size and don't add new one to - // the MyChangeBars list. - if (MySection.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ContinuousChangeBars) - { - if (OverlapOrSpan(cb, vcb)) - { - if (prevCB == null) prevCB = cb; - else if (prevCB.YChangeBarBottom > cb.YChangeBarBottom) prevCB = cb; - } - } - } - } - // if this and the prevCB overlap, adjust yoffset/height/ybottom in the prevCB so that both change bars are - // included in this Dictionary item. A new vlnChangeBar is not added to the MyChangeBars list, the current - // one that overlaps with the new is adjusted. - if (prevCB != null) - { - // Bottom for both change bars is same, adjust top (YOffset) and height. - if (prevCB.YChangeBarBottom == vcb.YChangeBarBottom) - { - prevCB.YOffset = Math.Max(prevCB.YOffset, vcb.YOffset); - float yChangeBarBottomExtend = prevCB.YChangeBarBottomExtend; - prevCB.Height = Math.Max(prevCB.Height, vcb.Height); - prevCB.YExtendLine = prevCB.YChangeBarBottom - Math.Min(yChangeBarBottomExtend, vcb.YChangeBarBottomExtend); //Math.Max(prevCB.YExtendLine, vcb.YExtendLine); - // if a change bar message at this ychangebarbottom exists, see which message is used - if (cbmess != null && prevCB.Messages.ContainsKey(prevCB.YChangeBarBottom)) UpdateCbMessage(cbmess, prevCB, vcb.XOffset); - return; - } - // Bottom locations are not the same, but another change bar is not added, i.e. the - // length of the line is adjusted. - prevCB.YOffset = Math.Max(prevCB.YOffset, vcb.YOffset); - float yChangeBarBottomExtend1 = prevCB.YChangeBarBottomExtend; - prevCB.YChangeBarBottom = Math.Min(prevCB.YChangeBarBottom, vcb.YChangeBarBottom); - prevCB.YExtendLine = prevCB.YChangeBarBottom - Math.Min(yChangeBarBottomExtend1, vcb.YChangeBarBottomExtend); //Math.Max(prevCB.YExtendLine, vcb.YExtendLine); - // Two messages at this location, determine which one to use - if (cbmess != null && prevCB.Messages.ContainsKey(prevCB.YChangeBarBottom)) UpdateCbMessage(cbmess, prevCB, vcb.XOffset); - - // no message at this location, just add it. - else if (cbmess != null) - prevCB.Messages.Add(vcb.YChangeBarBottom, new vlnChangeBarMessage(vcb.MyParent.XOffset, cbmess)); - return; - } - - // There was no overlap, add a message if it exists, and then add the change bar to the MyChangeBars list. - if (cbmess != null) vcb.Messages.Add(vcb.YChangeBarBottom, new vlnChangeBarMessage(vcb.MyParent.XOffset, cbmess)); - MyChangeBars.Add(vcb); - } - - private static void UpdateCbMessage(string cbmess, vlnChangeBar prevCB, float xoff) - { - // If there are two messages at the same location, for example an AER change bar & and RNO - // change bar, and the messages have different text, see which change bar message should be - // added, i.e. use the one in 'rno', the greatest x value. - vlnChangeBarMessage tmp = prevCB.Messages[prevCB.YChangeBarBottom]; - if (cbmess != tmp.Message) - { - if (xoff > tmp.ParentX) - { - prevCB.Messages.Remove(prevCB.YChangeBarBottom); - prevCB.Messages.Add(prevCB.YChangeBarBottom, new vlnChangeBarMessage(xoff, cbmess)); - } - } - } - private bool OverlapOrSpan(vlnChangeBar cb, vlnChangeBar vcb) - { - if (cb.MyParent.MyItemInfo.MyHLS.ItemID != vcb.MyParent.MyItemInfo.MyHLS.ItemID) return false; - // cb.Yoffset is within range of vcb: - if (cb.YOffset <= vcb.YOffset && - cb.YOffset >= (vcb.YChangeBarBottomExtend - vlnPrintObject.SixLinesPerInch)) return true; - // cb.YChangeBarBottom is within range of vcb: - if ((cb.YChangeBarBottomExtend-vlnPrintObject.SixLinesPerInch) <= vcb.YOffset && - cb.YChangeBarBottomExtend >= (vcb.YChangeBarBottomExtend - vlnPrintObject.SixLinesPerInch)) return true; - // vcb.Yoffset is within range of cb: - if (vcb.YOffset <= cb.YOffset && - vcb.YOffset >= (cb.YChangeBarBottomExtend - vlnPrintObject.SixLinesPerInch)) return true; - // vcb.YChangeBarBottom is within range of cb: - if ((vcb.YChangeBarBottomExtend - vlnPrintObject.SixLinesPerInch) <= cb.YOffset && - vcb.YChangeBarBottomExtend >= (cb.YChangeBarBottomExtend - vlnPrintObject.SixLinesPerInch)) return true; - return false; - } - private PromsPrinter _MyPromsPrinter; - public PromsPrinter MyPromsPrinter - { - get { return _MyPromsPrinter; } - set { _MyPromsPrinter = value; } - } - private int _MyRomanPage = 1; - public VlnSvgPageHelper(VEPROMS.CSLA.Library.SectionInfo mySection, PromsPrinter myPromsPrinter, string hlsText, int hlsItemId) - : base() - { - HLSText = hlsText; - HasHLSTextId = hlsItemId; - MySection = mySection; - MyPromsPrinter = myPromsPrinter; - } - private Volian.Svg.Library.Svg BuildSvg(VEPROMS.CSLA.Library.SectionInfo mySection, bool forceLoad) - { - // if mysection uses continuous pagination, and the previous section uses the same format, - // and the docstyle is set to use on first page only, - // then set section to use the Use On Rest of Pages - //SectionConfig.SectionPagination sPag = SectionConfig.SectionPagination.Separate; - //if (mySection.IsStepSection && mySection.MyPrevious != null && mySection.MyPrevious.IsStepSection) - //{ - // SectionConfig sc = mySection.MyConfig as SectionConfig; - // sPag = sc.Section_Pagination; - // if (sPag == SectionConfig.SectionPagination.Continuous) - // { - // if (MySection.MyDocStyle.StructureStyle.Where == E_DocStyleUse.UseOnFirstPage) - // MySection.DidFirstPageDocStyle = true; - // } - //} - VEPROMS.CSLA.Library.FormatInfo activeFormat = mySection.ActiveFormat; - VEPROMS.CSLA.Library.DocStyle docStyle = mySection.MyDocStyle; - Volian.Svg.Library.Svg mySvg = null; - mySvg = SvgSerializer.StringDeserialize(BuildMyText(activeFormat)); - mySvg.ViewBox.Height = 1100; - mySvg.ViewBox.Width = 850; - mySvg.Height = new SvgMeasurement(11, E_MeasurementUnits.IN); - mySvg.Width = new SvgMeasurement(8.5F, E_MeasurementUnits.IN); - mySvg.LeftMargin = (float)docStyle.Layout.LeftMargin; - mySvg.TopMargin = 9.6F; - VEPROMS.CSLA.Library.PageStyle pageStyle = docStyle.pagestyle; - AddPageListItems(mySvg, pageStyle, mySection, forceLoad); - mySvg.ProcessText += new SvgProcessTextEvent(mySvg_ProcessText); - // if this section had a previous section and this is continuous, don't generate the svg for - // it, we'll use the previous section. The only thing we need to do is to process through the - // pagelist items in case there are some section items, for example the checkoff header needs - // to be processed for each section whether or not it is continuous. - SectionConfig.SectionPagination sPag = SectionConfig.SectionPagination.Separate; - if (mySection.MyContent.Number.ToUpper() != "FOLDOUT" && mySection.IsStepSection && mySection.MyPrevious != null && mySection.MyPrevious.IsStepSection) - { - SectionConfig sc = mySection.MyConfig as SectionConfig; - sPag = sc.Section_Pagination; - } - //if (sPag == SectionConfig.SectionPagination.Continuous && !mySection.DidFirstPageDocStyle) return null; - if (forceLoad) return mySvg; - if (sPag == SectionConfig.SectionPagination.Continuous) return null; - return mySvg; - } - public PageCounts MyPageCounts = null; - public PageCounts MyTOCPageCounts = null; - public Dictionary MyTOCPageNums = null; - private static Regex regexFindToken = new Regex("{[^{}]*}"); - private static Regex regexFindSubToken = new Regex(@"\[[^{}]*\]"); - private string mySvg_ProcessText(object sender, SvgProcessTextArgs args) - { - if (args.MyText == null) return string.Empty; // Needed for empty genmac text (was space in 16bit files) - if (!args.MyText.Contains("{")) - return args.MyText; - /* - * Check if tokens for handling page counts ({PAGE} {OF} etc). if so, do templates. - */ - if (args.MyText.Contains("{DOCCURPAGE}") || args.MyText.Contains("{DOCTOTPAGE}")) - { - string key = "DocCurPage." + MySection.ItemID; - string txt = args.MyText.Replace("{DOCCURPAGE}", "{PAGE}").Replace("{DOCTOTPAGE}", "{OF}"); - MyPdfContentByte.AddTemplate(MyPageCounts.AddToTemplateList(key, MyPdfWriter, txt, args.MySvgText.Font, args.MySvgText.Align, args.MySvgText.FillColor), args.MySvgScale.X(args.MySvgText.X), args.MySvgScale.Y(MyPdfContentByte, args.MySvgText.Y)); - return string.Empty; - } - //if (args.MyText.Contains("{ROMANPAGE}")) - //{ - // //return args.MyText.Replace("{ROMANPAGE}", ItemInfo.RomanNumbering(_MyRomanPage++).ToLower()); - // string key = "RomanPage." + MySection.ItemID; - // string txt = args.MyText; - // MyPdfContentByte.AddTemplate(MyPageCounts.AddToTemplateList(key, MyPdfWriter, txt, args.MySvgText.Font, args.MySvgText.Align, args.MySvgText.FillColor), args.MySvgScale.X(args.MySvgText.X), args.MySvgScale.Y(MyPdfContentByte, args.MySvgText.Y)); - // return string.Empty; - //} - if (args.MyText.Contains("{SECONDARYPAGE}") || args.MyText.Contains("{SECONDARYOF}")) - { - string key = "SecondaryPage." + MySection.ItemID; - string txt = args.MyText.Replace("{SECONDARYPAGE}", "{PAGE}").Replace("{SECONDARYOF}", "{OF}"); - MyPdfContentByte.AddTemplate(MyPageCounts.AddToTemplateList(key, MyPdfWriter, txt, args.MySvgText.Font, args.MySvgText.Align, args.MySvgText.FillColor), args.MySvgScale.X(args.MySvgText.X), args.MySvgScale.Y(MyPdfContentByte, args.MySvgText.Y)); - return string.Empty; - } - string tocKey = "TOC" + MySection.ItemID.ToString(); - if (args.MyText.Contains("{PAGE}") || args.MyText.Contains("{OF}")) - { - - #region numberingseq - /* - public enum E_NumberingSequence : uint - { - NoPageNum = 0, - WithSteps = 1, Add to original steps section page count. - WithinEachDocStyle = 2, - WithinEachSection = 3, - WithinEachDocStyle1 = 4, - GroupedByPagination = 5, - GroupedByLevel = 6, - WithStepsAndSecondaryPageNumber = 7, - WithStepsAndSecondaryPageNumberGroupedByLevel = 8, - Like6_ButDoesntNeedSubsection = 9, - Like6_ButDoesntNeedSubsection1 = 10 - }; - */ - #endregion - // default for the key is to make it NumberingSequence. Then handle - // specific cases. - string key = ((int)MySection.MyDocStyle.NumberingSequence).ToString(); - - E_NumberingSequence numseq = MySection.MyDocStyle.NumberingSequence??0; - switch (numseq) - { - case E_NumberingSequence.WithSteps: // Number with 'originalstepsection' - ProcedureInfo pc = MySection.MyProcedure; - int sectid = 0; - foreach (SectionInfo si in pc.Sections) - { - SectionConfig sc = si.MyConfig as SectionConfig; - if (sc.Section_OriginalSteps == "Y") - { - sectid = si.ItemID; - break; - } - } - if (sectid != 0) key = (int)E_NumberingSequence.WithinEachSection + "." + sectid; - break; - case E_NumberingSequence.WithinEachDocStyle: - key = key + "." + MySection.ActiveFormat.FormatID + "." + MySection.MyDocStyle.Index; - break; - case E_NumberingSequence.WithinEachSection: - key = key + "." + MySection.ItemID; - break; - case E_NumberingSequence.Like6_ButDoesntNeedSubsection: - if (MySection.MyParent.IsSection) - key = key + "." + MySection.MyParent.ItemID; - else - key = key + "." + MySection.ItemID; - break; - case E_NumberingSequence.WithStepsAndSecondaryPageNumber: - // For this one, we'll do two keys and templates. One will go with the main steps - // section and one will be for this secondary section. - ProcedureInfo pc1 = MySection.MyProcedure; - int psectid = 0; - foreach (SectionInfo si in pc1.Sections) - { - SectionConfig sc = si.MyConfig as SectionConfig; - if (sc.Section_OriginalSteps == "Y") - { - psectid = si.ItemID; - break; - } - } - if (psectid != 0) - { - key = (int)E_NumberingSequence.WithinEachSection + "." + psectid; - PdfTemplate tmp1 = MyPageCounts.AddToTemplateList(key, MyPdfWriter, args.MyText, args.MySvgText.Font, args.MySvgText.Align, args.MySvgText.FillColor); - } - break; - } - PdfTemplate tmp = MyPageCounts.AddToTemplateList(key, MyPdfWriter, args.MyText, args.MySvgText.Font, args.MySvgText.Align, args.MySvgText.FillColor); - // Proms page numbering designed requires a "{PAGE}" token to increment the page counter. So the easiest way - // to do that was to add a "{PAGE}" token to every page that is flagged as not to be printed. - if (!args.MyText.StartsWith("Non-printing ")) MyPdfContentByte.AddTemplate(tmp, args.MySvgScale.X(args.MySvgText.X), args.MySvgScale.Y(MyPdfContentByte, args.MySvgText.Y)); - return string.Empty; - } - if (args.MyText.Contains("{FINALPAGE}")) - { - if (MySection.ItemID == FinalMessageSectionID) - { - string key = "FinalPage"; - MyPdfContentByte.AddTemplate(MyPageCounts.AddToTemplateList(key, MyPdfWriter, args.MyText, MySection.MyDocStyle.Final.Message, args.MySvgText.Font, args.MySvgText.Align, args.MySvgText.FillColor), args.MySvgScale.X(args.MySvgText.X), args.MySvgScale.Y(MyPdfContentByte, args.MySvgText.Y)); - } - return string.Empty; - } - return regexFindToken.Replace(args.MyText, new MatchEvaluator(ReplacePageListToken)); - } - private string BuildMyText(VEPROMS.CSLA.Library.FormatInfo activeFormat) - { - string sGenMac = activeFormat.GenMac; - if (sGenMac == null || sGenMac == "") - { - // If subformat and does not have its own genmac, find an inherited genmac. - FormatInfo tmpf = FormatInfo.Get(activeFormat.ParentID); - while (tmpf.FormatID!=1 && (sGenMac==null||sGenMac=="")) - { - sGenMac = tmpf.GenMac; - tmpf = FormatInfo.Get(tmpf.ParentID); - } - if (sGenMac == null || sGenMac == "") - sGenMac = "";// return ""; - } - if (!sGenMac.Contains("xmlns")) - sGenMac = sGenMac.Replace(".StringSerialize(mySvg); - XmlDocument xDocPrintout = new XmlDocument(); - xDocPrintout.LoadXml(str); - XmlNode xn = xDocPrintout.DocumentElement.ChildNodes[0]; - xn.AppendChild(xDocPrintout.ImportNode(xDocGenMac.DocumentElement, true)); - return xDocPrintout.OuterXml; - } - private string FirstAndLast(string token) - { - // strip the curly braces and return the first and last character - // For example Header1 becomes H1 and Box2 becomes B2 - return token.Substring(1, 1) + token.Substring(token.Length - 2, 1); - } - private static Regex regexJustTokens = new Regex(@"^{([^{}]*}{)*[^{}]*}$"); - - // The following variables are used to keep track of whether a check off header should be printed - // if the {CHKOFFHEADING} pagelist item is found. PageListTopCheckOffHeader is the text that - // should be printed at the top of the page. PageListLastCheckOffHeader is the last header that was - // printed (if a header is on the page, and another is to be printed, it doesn't get printed if it - // is the same as the previous) and PageListCheckOffHeader is the page list item converted to a - // SvgText - this stores X/Y location, etc. - public string PageListTopCheckOffHeader = null; - public string PageListLastCheckOffHeader = null; - public SvgText PageListCheckOffHeader = null; - - public Dictionary PgLogicals; - private void AddPageListItems(Volian.Svg.Library.Svg mySvg, VEPROMS.CSLA.Library.PageStyle pageStyle, VEPROMS.CSLA.Library.SectionInfo section, bool forceLoad) - { - //Console.WriteLine("{0}", section.ActiveFormat.Name); - //Console.WriteLine("{0} pgstyle {1} section", pageStyle.Name,section.DisplayText); - if (PgLogicals == null) PgLogicals = new Dictionary(); - else PgLogicals.Clear(); - - PageListCheckOffHeader = null; - // If this is a continuous section, then the only pagelist items we want are section type since - // we are still on the same page. - CHECK IF ON SAME PAGE!!!! - SectionConfig.SectionPagination sPag = SectionConfig.SectionPagination.Separate; - if (section.IsStepSection && section.MyPrevious != null && section.MyPrevious.IsStepSection && section.MyContent.Number.ToUpper() != "FOLDOUT") - { - SectionConfig sc = section.MyConfig as SectionConfig; - sPag = sc.Section_Pagination; - } - SvgGroup svgGroup = new SvgGroup(); - - //int defPtPerRow = 72 / 6; - //int curLPI = 6; // default - //int prevLPI = 6; - //float PrevRow = 0; - //float rowAdj = 0; // = 18; - foreach (VEPROMS.CSLA.Library.PageItem pageItem in pageStyle.PageItems) - { - if (pageItem.Token == null) continue; // can be null if token is dependent on PSI lookup! - DidHLSText = false; // reset to false for this group of tokens. - //if (pageItem.Token.Contains("HLSTEXT")) - // Console.WriteLine("{0} - PageList Token", pageItem.Token); - - VE_Font useFontForCheckOffHeader = null; - if (forceLoad || (sPag == SectionConfig.SectionPagination.Separate || ((sPag == SectionConfig.SectionPagination.Continuous || sPag ==0 )&& (pageItem.Row < 0)))) - { - //if (PrevRow > 0) - //{ - // //float pgRow = (float)(pageItem.Row + rowAdj); - // if (curLPI != prevLPI) - // { - // int prow = (int)(PrevRow / defPtPerRow); - // int nrows = ((int)(pageItem.Row / defPtPerRow)) - prow; - // rowAdj += (float)Math.Abs(((nrows * (72 / curLPI)) - ((nrows * defPtPerRow) + rowAdj))); - // //rowAdj += (float)(((pgRow - PrevRow) / (72 * prevLPI)) * (72 / curLPI)); - // prevLPI = curLPI; - // } - //} - MatchCollection matches = regexFindToken.Matches(pageItem.Token); - if (matches.Count > 0) - { - string plstr = ""; - // When a pagelist line (row) has more than one token that is resolved to text, each resolved token text was place on top - // of each other. Use a temporary string (plstr) to process the pagelist tokens for each pagelist line (row) before adding - // it to the svgGroup. - plstr = pageItem.Token; - foreach (Match match in matches) - { - string token = match.Value; - //token = Regex.Replace(token, @"[\xB3-\xDF]", " "); - - // handle any conditional PS tokens - if (plstr.Contains(@"PS=")) - { - ProcedureConfig procConfig = new ProcedureConfig(section.MyProcedure.MyContent.Config); - if (procConfig != null) - { - int indx = token.IndexOf("="); - int qindx = token.IndexOf("?", indx); - string pstok = token.Substring(indx + 1, qindx - indx - 1); - string val = procConfig.GetValue("PSI", pstok); - int bindx = token.IndexOf("|", indx); - if (val == "Y") - val = token.Substring(qindx + 1, bindx - qindx - 1); - else - { - int eindx = token.IndexOf("}", bindx); - val = token.Substring(bindx + 1, eindx - bindx - 1); - } - if (val != null && val != "" && !PgLogicals.ContainsKey(pstok)) PgLogicals.Add(pstok, val != null); - //if (val == null || val == "") - //val = " "; - if (val == null) - val = ""; - plstr = plstr.Replace(token, val); - // Get a list of Pagelist token that are inside the PS= conditional result - // Paglist tokens inside a PS= conditional are surrounded by square brackets instead of curley - // ex. [BOX3] instead of {BOX3} - MatchCollection subMatches = regexFindSubToken.Matches(plstr); - if (subMatches.Count > 0) - { - foreach (Match subMatch in subMatches) - { - string subToken = subMatch.Value; - ProcessPaglistToken(section, svgGroup, pageItem, ref useFontForCheckOffHeader, ref plstr, subToken); - } - } - } - } - else - ProcessPaglistToken(section, svgGroup, pageItem, ref useFontForCheckOffHeader, ref plstr, token); - } // end foreach matches - if (plstr.StartsWith("RO_Lookup(")) - { - string parms = plstr.Substring(10,plstr.Length-11); - string[] parts = parms.Split(",".ToCharArray()); - plstr = ROLookup(parts[0], parts[1], parts[2]); - } - if (plstr != "") - { - if (useFontForCheckOffHeader != null) - svgGroup.Add(PageItemToSvgText(pageItem, plstr, useFontForCheckOffHeader, MySection)); - else - svgGroup.Add(PageItemToSvgText(pageItem, plstr, MySection)); - } - } - else - svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token, MySection)); - } - } - // Proms page numbering designed requires a "{PAGE}" token to increment the page counter. So the easiest way - // to do that was to add a "{PAGE}" token to every page that is flagged as not to be printed. - if (sPag == SectionConfig.SectionPagination.Separate) - { - SvgText st = new SvgText(new System.Drawing.PointF(300, 300), "Non-printing {PAGE}", new System.Drawing.Font("Arial", 10), System.Drawing.Color.Black); - svgGroup.Add(st); - } - if (svgGroup.Count>0) mySvg.Add(svgGroup); - } - private string ROLookup(string accpageid, string multiid, string deflt) - { - ROFSTLookup myLookup = MySection.MyDocVersion.DocVersionAssociations[0].MyROFst.ROFSTLookup; - string accpgid = accpageid; - accpgid = accpgid.Replace("-HIGH", "-HI").Replace("-LOW", "-LO").Replace("_HIGH", "-HI").Replace("_LOW", "-LO").Replace(@"\u8209?", "-"); - string val = myLookup.GetROValueByAccPagID("<" + accpgid + "." + multiid + ">", MySection.MyDocVersion.DocVersionConfig.RODefaults_setpointprefix, MySection.MyDocVersion.DocVersionConfig.RODefaults_graphicsprefix); - if (!deflt.StartsWith("[") && val != null) - { - val = val.Replace("[xB3]", "\xB3"); - val = val.Replace("[xB2]", "\xB2"); - return val; - } - return deflt; - } - private bool _DidHLSText = false; - public bool DidHLSText - { - get { return _DidHLSText; } - set { _DidHLSText = value; } - } - private int _HasHLSTextId = 0; - public int HasHLSTextId - { - get { return _HasHLSTextId; } - set { _HasHLSTextId = value; } - } - private string _HLSText = ""; - public string HLSText - { - get { return _HLSText; } - set - { - if (_HLSText == "") - _HLSText = value; - } - } - private string _HLSTAB = ""; - public string HLSTAB - { - get { return _HLSTAB; } - set { _HLSTAB = value; } - } - private string _HLRNO = ""; - public string HLRNO - { - get { return _HLRNO; } - set { _HLRNO = value; } - } - private void ProcessPaglistToken(VEPROMS.CSLA.Library.SectionInfo section, SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, ref VE_Font useFontForCheckOffHeader, ref string plstr, string token) - { - //Console.WriteLine("{0} ProcessPagelistToken", token); - // Paglist token inside a PS= conditional are surrounded by square brackets instead of curley - // ex. [BOX3] instead of {BOX3}, thus the redunant looking cases - switch (token) - { - case "{!atom}": - // Add an Atom Figure to the SVG - plstr = plstr.Replace(token, ""); - AddImage(svgGroup, 160.5f, 170.5f, 288f, 323f, "atom.bmp"); - break; - case "{!cpllogo}": - plstr = plstr.Replace(token, ""); - AddImage(svgGroup, 10f, 10f, 78.7f, 29.8f, "cpllogo.bmp"); - break; - //case "{!domlogo}": - // AddImage(svgGroup, 10f, 70f, 123f, 40.1f, "domlogo.bmp"); - // break; - //case "{!gpclogo}": - // AddImage(svgGroup, 10f, 150f, 35.2f, 35.8f, "gpclogo.bmp"); - // break; - case "{HEADER1}": - case "[HEADER1]": - case "{HEADER2}": - case "[HEADER2]": - case "{HEADER3}": - case "[HEADER3]": - case "{HEADER4}": - case "[HEADER4]": - case "{HEADER5}": - case "[HEADER5]": - case "{BOX1}": - case "[BOX1]": - case "{BOX2}": - case "[BOX2]": - case "{BOX3}": - case "[BOX3]": - case "{BOX4}": - case "[BOX4]": - case "{BOX5}": - case "[BOX5]": - case "{BOX6}": - case "[BOX6]": - case "{BOX7}": - case "[BOX7]": - case "{BOX8}": - case "[BOX8]": - case "{BOX9}": - case "[BOX9]": - plstr = plstr.Replace(token, ""); - svgGroup.Add(PageItemToSvgUse(pageItem, FirstAndLast(token))); - break; - case "{PMODEBOX}": // need to set either 1 or 2 depending on number of columns - case "[PMODEBOX]": - string box = "1"; - if (_MySection.SectionConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.Four) - box = "4"; - else if (_MySection.SectionConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.Three) - box = "3"; - else if (_MySection.SectionConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.Two) - box = "2"; - box = "{BOX" + box + "}"; - plstr = plstr.Replace(token, ""); - svgGroup.Add(PageItemToSvgUse(pageItem, FirstAndLast(box))); - break; - case "{DRAFTPAGE}": - if (!AllowedWatermarks.Contains("Draft")) AllowedWatermarks.Add("Draft"); - plstr = plstr.Replace(token, "");// Remove token since it is handled now - break; - case "{REFERENCEPAGE}": - if (!AllowedWatermarks.Contains("Reference")) AllowedWatermarks.Add("Reference"); - plstr = plstr.Replace(token, "");// Remove token since it is handled now - break; - case "{MASTERPAGE}": - if (!AllowedWatermarks.Contains("Master")) AllowedWatermarks.Add("Master"); - plstr = plstr.Replace(token, "");// Remove token since it is handled now - break; - case "{SAMPLEPAGE}": - if (!AllowedWatermarks.Contains("Sample")) AllowedWatermarks.Add("Sample"); - plstr = plstr.Replace(token, "");// Remove token since it is handled now - break; - case "{INFORMATIONPAGE}": - if (!AllowedWatermarks.Contains("Information Only")) AllowedWatermarks.Add("Information Only"); - break; - case "{PROCTITLE}": - case "[PROCTITLE]": - case "{PROCTITLE1}": - case "[PROCTITLE1]": - case "{PROCTITLE2}": - case "[PROCTITLE2]": - case "{COVERPROCTITLE}": - case "[COVERPROCTITLE]": - int tlen = (token.Contains("COVERPROCTITLE"))?(int)section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength : (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength; - //float linelen = (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength * (float)pageItem.Font.CPI / 12; - float linelen = tlen * (float)pageItem.Font.CPI / 12; - string title = section.MyProcedure.MyContent.Text; - if (section.ActiveFormat.PlantFormat.FormatData.ProcData.CapitalizeTitle) title = title.ToUpper(); - plstr = SplitTitle(svgGroup, pageItem, title, (int)linelen, token, plstr); //,rowAdj); - break; - case "{COVERTITLE1}": - case "[COVERTITLE1]": - case "{COVERTITLE2}": - case "[COVERTITLE2]": - int ctlen = section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength ?? 0; - float coverlinelen = ((ctlen == 0) ? (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength : ctlen) * (float)pageItem.Font.CPI / 12; - string title1 = section.MyProcedure.MyContent.Text; - if (section.ActiveFormat.PlantFormat.FormatData.ProcData.CapitalizeTitle) title1 = title1.ToUpper(); - plstr = SplitCoverTitle(svgGroup, pageItem, title1, (int)coverlinelen, token, plstr);//, rowAdj); - break; - case "{TITLE&UNIT}": - case "[TITLE&UNIT]": - tlen = (token.Contains("COVERPROCTITLE"))?(int)section.ActiveFormat.PlantFormat.FormatData.ProcData.CoverTitleLength : (int)section.ActiveFormat.PlantFormat.FormatData.ProcData.TitleLength; - linelen = tlen * (float)pageItem.Font.CPI / 12; - plstr = SplitTitleAndUnit(svgGroup, pageItem, section.MyProcedure.MyContent.Text.ToUpper(), (int)linelen, token, plstr); //,rowAdj); - break; - case "{SPLITEOPNUM}": - case "[SPLITEOPNUM]": - string eopnum1 = section.MyProcedure.MyContent.Number; - string unitnum1 = MySection.MyDocVersion.DocVersionConfig.Unit_ProcedureNumber; - string unitname1 = MySection.MyDocVersion.DocVersionConfig.Unit_Name; - if (unitnum1.Length > 0) - { - if (unitnum1.Contains("#")) - eopnum1 = unitnum1.Replace("#", eopnum1); - if (unitnum1.Contains("!")) - eopnum1 = unitnum1.Replace("!", unitname1); - if (eopnum1 == string.Empty) - eopnum1 = section.MyProcedure.MyContent.Number; - } - plstr = SplitEOPNumber(svgGroup, pageItem, eopnum1, token, plstr); - break; - case "{EOPNUM}": - case "[EOPNUM]": - case "{PREDELIMEOPNUM}": - case "[PREDELIMEOPNUM]": - string eopnum = section.MyProcedure.MyContent.Number; - string unitnum = MySection.MyDocVersion.DocVersionConfig.Unit_ProcedureNumber; - string unitname = MySection.MyDocVersion.DocVersionConfig.Unit_Name; - if (unitnum.Length > 0) - { - if (unitnum.Contains("#")) - eopnum = unitnum.Replace("#", eopnum); - if (unitnum.Contains("!")) - eopnum = unitnum.Replace("!", unitname); - if (eopnum == string.Empty) - eopnum = section.MyProcedure.MyContent.Number; - } - if (token.Equals("{PREDELIMEOPNUM}")) - { - // only use up to the first non-alphanumeric character of the procedur number - // Prairie Island (NSP) Alarms use this token - int idx = 0; - while (idx < eopnum.Length && char.IsLetterOrDigit(eopnum[idx])) idx++; - if (idx < eopnum.Length) - eopnum = eopnum.Substring(0, idx); - } - plstr = plstr.Replace(token, eopnum); - //svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, eopnum))); - //svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, section.MyProcedure.MyContent.Number))); - break; - case "{SECTIONLEVELTITLE}": - case "[SECTIONLEVELTITLE]": - bool printsectlevel = ((pageItem.Justify & VEPROMS.CSLA.Library.E_Justify.PSOnlyFirst) != VEPROMS.CSLA.Library.E_Justify.PSOnlyFirst) || - (((pageItem.Justify & VEPROMS.CSLA.Library.E_Justify.PSOnlyFirst) == VEPROMS.CSLA.Library.E_Justify.PSOnlyFirst) && PrintedSectionPage==0); - // if there is 'no title' for the section, only print it if a format flag says to print it. - if (printsectlevel) - { - if (section.DisplayText.ToUpper().Contains("") && !section.ActiveFormat.PlantFormat.FormatData.ProcData.PrintNoTitle) printsectlevel = false; - } - if (printsectlevel) - { - plstr = SplitTitle(svgGroup, pageItem, section.DisplayText, section.ActiveFormat.PlantFormat.FormatData.SectData.SectionTitleLength, token, plstr); - PrintedSectionPage = (int)pageItem.Row - _sectLevelNumTtlDiff; - } - else - plstr = plstr.Replace(token, ""); - //svgGroup.Add(PageItemToSvgText(pageItem, section.DisplayText)); - break; - case "{SECTIONLEVELNUMBER}": - case "[SECTIONLEVELNUMBER]": - plstr = plstr.Replace(token, section.DisplayNumber); - _sectLevelNumTtlDiff = (int)pageItem.Row; - //svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, section.DisplayNumber))); - break; - case "{UNITTEXT}": - case "[UNITTEXT]": - plstr = plstr.Replace(token, MySection.MyDocVersion.DocVersionConfig.Unit_Text); - //svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token.Replace(token, MySection.MyDocVersion.DocVersionConfig.Unit_Text))); - break; - case "{UNITNUMBER}": - case "[UNITNUMBER]": - plstr = plstr.Replace(token, MySection.MyDocVersion.DocVersionConfig.Unit_Number); - break; - case "{ATTACHNUM}": - case "[ATTACHNUM]": - plstr = plstr.Replace(token, "1"); // used by SHESDD - but 16bit returns '1' unless has format flag 'MoveParensToToken' that was only in SCE (San Onofre) - break; - - case "{CHKOFFHEADING}": - case "[CHKOFFHEADING]": - // unfortunately, the font is not stored on the page list item if there is an active - // check off header. It is stored with the checkoff data as defined by user selection - // of the selected header (selection stored in section config). - int sindx = section.CheckOffHeadingIndex(); - VE_Font vf = sindx <= 0 ? pageItem.Font : - section.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList[sindx].Font; - useFontForCheckOffHeader = vf; - PageListCheckOffHeader = PageItemToSvgText(pageItem, pageItem.Token, vf, section); - break; - case "{HLSTEXT}": - DidHLSText = true; - plstr = plstr.Replace(token, HLSText); - break; - case "{PROCDES}": - ProcDescrList pdl = section.ActiveFormat.PlantFormat.FormatData.PrintData.ProcDescrList; - if (pdl != null && pdl.Count > 0) - { - // the following line is needed for FNP: a checkin needed to be done for Robinson and - // did not want to include the commented out lines in this 'case' statement group: - //string procnum = section.MyProcedure.MyContent.Number.Replace(@"\u8209?", "-"); // uncomment for FNP - string procnum = section.MyProcedure.MyContent.Number; - foreach (ProcDescr pd in pdl) - { - if (pd.MatchProcNumber != null) - { - string matchStr = (pd.MatchProcNumber.StartsWith("*}")) ? pd.MatchProcNumber.Substring(2) : pd.MatchProcNumber; - if (procnum.Contains(matchStr)) - { - plstr = pd.ProcDescr1; - break; - } - if (pd.MatchProcNumber == "@") - { - if (Regex.IsMatch(procnum, "^[A-Za-z]+$")) - plstr = pd.ProcDescr1; - else - plstr = ""; - break; - } - } - else - plstr = "UNKNOWN"; - } - } - break; - case "{CURDATE}": - DateTime thisDate1 = DateTime.Today; - plstr = plstr.Replace(token, thisDate1.ToString("MMMM dd, yyyy")); - break; - case "{CURTIME}": - DateTime thisDate2 = DateTime.Now; - plstr = plstr.Replace(token, thisDate2.ToString("H:mm")); - break; - case "{HLRNO}": - plstr = HLRNO==null?"":plstr.Replace(token, HLRNO); - break; - case "{HLSTAB}": - plstr = plstr.Replace(token, HLSTAB); - break; - default: - if (token.Contains(@"RO-")) - { - plstr = token.Replace("{","").Replace("}",""); - svgGroup.Add(PageItemToSvgText(pageItem, plstr, MySection)); - } - if (token.Contains(@"PS-")) - { - //Console.WriteLine("RefreshConfig {0} {1}", section.MyProcedure.ItemID, section.MyProcedure.MyItemInfoUnique); - //section.MyProcedure.RefreshConfig(); - //ProcedureConfig procConfig = section.MyProcedure.MyConfig as ProcedureConfig; - //Console.WriteLine("> ProcConfig {0} {1}",procConfig,section.MyProcedure.MyItemInfoUnique); - //Console.WriteLine("> MyContent {0}", section.MyProcedure.MyContent.Config); - //section.MyProcedure.RefreshConfig(); - ProcedureConfig procConfig = new ProcedureConfig(section.MyProcedure.MyContent.Config); - //Console.WriteLine("< ProcConfig {0}", procConfig); - if (procConfig != null) - { - int indx = token.IndexOf("-"); - int qindx = token.IndexOf("?", indx); - string val = null; - if (qindx == -1) - { - val = procConfig.GetValue("PSI", token.Substring(4, token.Length - 5)); - plstr = plstr.Replace(token, val); - //svgGroup.Add(PageItemToSvgText(pageItem, plstr, MySection)); - } - else - { - string pstok = token.Substring(indx + 1, qindx - indx - 1); - plstr = procConfig.GetValue("PSI", pstok); - // the first part of the string between the ? and ' ' is the other logical - // to see if it's on. If on, just use col and/or row as defined. Otherwise use - // value between = and |. - int sindx2 = token.IndexOf(" ", qindx); - string logcheck = token.Substring(qindx + 1, sindx2 - qindx - 1); - if (PgLogicals.ContainsKey(logcheck)) - { - int bindx = token.IndexOf("|", indx); - string newval = token.Substring(sindx2 + 1, bindx - sindx2 - 1); - float col = pageItem.Col ?? 0; - if (newval.ToUpper().Contains("COL")) - { - col = System.Convert.ToInt32(newval.Substring(4)); - } - svgGroup.Add(PageItemToSvgText(pageItem.Token, pageItem.Row ?? 0, col, pageItem.Justify ?? VEPROMS.CSLA.Library.E_Justify.PSLeft, pageItem.Font, plstr, MySection)); - plstr = ""; // clear so it doesn't get added twice, i.e. in the method that calls this. - } - } - } - } - else - { - if (plstr != "") - svgGroup.Add(PageItemToSvgText(pageItem, plstr, MySection)); - //svgGroup.Add(PageItemToSvgText(pageItem, pageItem.Token)); - } - //_MyLog.InfoFormat("Token not processed {0}", token); - break; - } - } - private static void AddImage(SvgGroup svgGroup, float x, float y, float w, float h, string figure) - { - svgGroup.Add(new SvgImage(new System.Drawing.PointF(x, y), new System.Drawing.SizeF(w, h), - System.Windows.Forms.Application.StartupPath + @"\Resources\" + figure)); - } - - private string SplitTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr) - { - if (match == "{PROCTITLE2}" || match == "[PROCTITLE2]") return plstr.Replace(match, ""); - if (len == null || len == 0 || ItemInfo.StripRtfFormatting(title).Length < len) - { - if (match == "{PROCTITLE2}" || match == "[PROCTITLE2]") return plstr.Replace(match, ""); // this would have been done in proctitle1 - plstr = plstr.Replace(match, title); - //svgGroup.Add(PageItemToSvgText(pageItem, title)); - return plstr; - } - // Otherwise determine how many line to split the text into - List titleLines = SplitText(title, (int)len); - - // Adjust y location based on which pagelist token & how many lines. Proctitle1 is adjusted if - // there are more than 2 lines (proctitle1 should have it's own y location that is used if there are 1 or 2 lines.) - float yOffset = (pageItem.Token.Contains("1") && titleLines.Count <= 2) ? 0 : (-6 * (titleLines.Count - 1)); - int cnt = 0; - - // if the title broke into two lines & proctitle1 & proctitle2 are on the same line, handle that - // and return the string: - if (titleLines.Count == 2 && pageItem.Token.Contains("1") && pageItem.Token.Contains("2")) - { - plstr = plstr.Replace("{PROCTITLE1}", titleLines[0]); - plstr = plstr.Replace("[PROCTITLE1]", titleLines[0]); - plstr = plstr.Replace("{PROCTITLE2}", titleLines[1]); - plstr = plstr.Replace("[PROCTITLE2]", titleLines[1]); - return plstr; - } - foreach (string line in titleLines) - { - cnt++; - if (cnt == 1 && yOffset == 0) // adj == 0 means we use PROCTITLE1/PROCTITLE2 pagelist tokens with 2 or less lines - plstr = plstr.Replace(match, line); - else - { - svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset)); - plstr = plstr.Replace(match, ""); - } - yOffset += (float)((pageItem.Font.Size > 14) ? pageItem.Font.Size : 12); - } - return plstr; - } - private string SplitTitleAndUnit(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string token, string plstr) - { - List titleLines = SplitText(title, (int)len); - // Add a separate line with the Unit Number - titleLines.Add("UNIT " + MySection.MyDocVersion.DocVersionConfig.Unit_Number); - // Adjust y location based on which pagelist token & how many lines. - float yOffset = (-6 * (titleLines.Count - 1)); - foreach (string line in titleLines) - { - svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset)); - yOffset += (float)((pageItem.Font.Size > 14) ? pageItem.Font.Size : 12); - } - return plstr.Replace(token, ""); - } - private string SplitEOPNumber(SvgGroup svgGroup, PageItem pageItem, string eopnum, string token, string plstr) - { - string[] eopnums = eopnum.Split(" ".ToCharArray()); - float yOffset = (-6 * (eopnums.Length - 1)); - foreach (string line in eopnums) - { - svgGroup.Add(PageItemToSvgText(pageItem, line, yOffset)); - yOffset += (float)((pageItem.Font.Size > 14) ? pageItem.Font.Size : 12); - } - return plstr.Replace(token, ""); - } - //private string symblsStr = "\u25CF\u0394"; // string of possible symbol character in a tab - //// add symbol characters as needed - //// "\u25CF" - solid bullet - //// \x0394 - delta - //private float GetTextWidth(VE_Font vefont, string txt, string symblFontName) - //{ - // System.Drawing.Font font = new System.Drawing.Font(vefont.Family, (float)vefont.Size, GetSysFontStyle(vefont)); - // System.Drawing.Font symbFont = new System.Drawing.Font(symblFontName, (float)vefont.Size); - // iTextSharp.text.Font iFont = Volian.Svg.Library.VolianPdf.GetFont(font); - // iTextSharp.text.Font iSymblFont = Volian.Svg.Library.VolianPdf.GetFont(symbFont); - // float w = 0; - // foreach (char c in txt) - // { - // int idx = symblsStr.IndexOf(c); - // if (idx >= 0) // symbol character - use symbol font to find its width - // w += iSymblFont.BaseFont.GetWidthPointKerned(symblsStr[idx].ToString(), (float)vefont.Size); - // else - // w += iFont.BaseFont.GetWidthPointKerned(c.ToString(), (float)vefont.Size); - // } - // //float w = iFont.BaseFont.GetWidthPointKerned(Text.Replace("\u25CF","@"), (float)vefont.Size); - // return w; - //} - - private string SplitCoverTitle(SvgGroup svgGroup, VEPROMS.CSLA.Library.PageItem pageItem, string title, int? len, string match, string plstr) - { - if (len == null || ItemInfo.StripRtfFormatting(title).Length < len) - { - if (match == "{COVERTITLE2}" || match == "[COVERTITLE2]") return plstr; // this would have been done in COVERTITLE1 - plstr = plstr.Replace(match, title); - //svgGroup.Add(PageItemToSvgText(pageItem, title)); - return plstr; - } - // Otherwise determine how many line to split the text into - List titleLines = SplitText(title, (int)len); - if (match == "{COVERTITLE1}" || match == "[COVERTITLE1]") - { - plstr = plstr.Replace(match, titleLines[0]); - //svgGroup.Add(PageItemToSvgText(pageItem, titleLines[0])); - return plstr; - } - // if the token was proctitle, dont' adjust. If the token was PROCTITLE1/2 then - // move down 6. -// int adj = pageItem.Token.Contains("1") || pageItem.Token.Contains("2") ? 0 : -6; - int adj = (titleLines.Count > 2) ? -6 : 0; - float yOffset = adj * (titleLines.Count - 2); - int lnCnt = 0; - foreach (string line in titleLines) - { - lnCnt++; - if (lnCnt == 1) continue; - plstr = plstr.Replace(match, line); - svgGroup.Add(PageItemToSvgText(pageItem, plstr, yOffset)); - plstr = ""; // clear it because it was added into the list in the line above this, i.e. don't duplicate - yOffset += 12; - } - return plstr; - } - private List SplitText(string text, int len) - { - List results = new List(); - if (text.Contains("\\LINE ") || text.Contains("\r\n")) - { - string[] mySplit = {"\\LINE ","\r\n"}; - return new List(text.Split(mySplit, StringSplitOptions.None)); - - } - int width = 0; // width of text, non-rtf - int start = 0; // start of line (index into string 'text'), includes rtf - int lastspace = 0; // location of lastspace (index into string 'text'), includes rtf - int startNonRtf = 0; // start of line, non-rtf (used for determining starting position to determine width if there was a break) - string rtfprefix = ""; - string nextprefix = ""; - for (int indx = 0; indx < text.Length; indx++) - { - if (text[indx] == '\\') //rtf command - { - // look for three things at beginning of string: hex, unicode, rtfcommand. - Match m = Regex.Match(text.Substring(indx), @"^\\'[a-fA-F0-9][a-fA-F0-9]"); //hex - if (m.Success) - { - indx += m.Length - 1; - width++; - } - else - { - m = Regex.Match(text.Substring(indx), @"^\\[uU][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][a-fA-F0-9][?]"); - if (m.Success) - { - indx += m.Length - 1; - width++; - } - else - { - m = Regex.Match(text.Substring(indx), @"^\\[^ ]*? "); - if (m.Success) - { - indx += m.Length - 1; - rtfprefix = AdjustRtfPrefix(rtfprefix, m.Value); - } - } - } - - } - else - { - if (text[indx] == ' ') - { - lastspace = indx; - startNonRtf = width; - } - width++; - if (width > len) - { - // what should be done if lastspace == 0 - results.Add(nextprefix+text.Substring(start, lastspace-start).Trim(" ".ToCharArray())); - nextprefix = rtfprefix; - if (nextprefix != "") nextprefix += " "; - start = lastspace + 1; - width = (width - startNonRtf - 1) > 0 ? width - startNonRtf - 1 : 0; - lastspace = 0; - } - } - - } - if (width > 0 || start < text.Length) results.Add(nextprefix + text.Substring(start).Trim(" ".ToCharArray())); - return results; - } - - private string AdjustRtfPrefix(string rtfprefix, string rtfcommand) - { - if (rtfcommand.Contains(@"\ulnone") || rtfcommand.Contains(@"\ul0")) // off - rtfprefix = rtfprefix.Replace(@"\ul",""); - else if (rtfcommand.Contains(@"\ul")) - rtfprefix += @"\ul"; - if (rtfcommand.Contains(@"\up0") || rtfcommand.Contains(@"\dn0")) rtfprefix = rtfprefix.Replace(@"\up2", "").Replace(@"\dn2", ""); - else if (rtfcommand.Contains(@"\up")) rtfprefix += @"\up2"; - else if (rtfcommand.Contains(@"\dn")) rtfprefix += @"\dn2"; - if (rtfcommand.Contains(@"\b0")) - rtfprefix = rtfprefix.Replace(@"\b", ""); - else if (rtfcommand.Contains(@"\b")) - rtfprefix += @"\b"; - if (rtfcommand.Contains(@"\i0")) - rtfprefix = rtfprefix.Replace(@"\i", ""); - else if (rtfcommand.Contains(@"\i")) - rtfprefix += @"\i"; - return rtfprefix; - } - private int FindWidth(string title, int start, int len) - { - for (int ii = start + len; ii > start; ii--) - { - if (title[ii] == ' ') - { - while (title[ii] == ' ') ii--; - if (ii > start) - return 2 + ii - start; - return len; - } - } - return len; - } - private SvgPart PageItemToSvgUse(VEPROMS.CSLA.Library.PageItem pageItem, string templateName) - { - SvgUse svgUse = new SvgUse(); - svgUse.UseID = templateName; - svgUse.X = new SvgMeasurement((float)(pageItem.Col ?? 0), E_MeasurementUnits.PT); - svgUse.Y = new SvgMeasurement((float)(pageItem.Row ?? 0), E_MeasurementUnits.PT); - return svgUse; - } - private static SvgText PageItemToSvgText(VEPROMS.CSLA.Library.PageItem pageItem, string text, VE_Font font, SectionInfo mySection) - { - SvgText svgText = PageItemToSvgText(pageItem, text, mySection); - svgText.Font = font.WindowsFont; - return svgText; - } - private static SvgText PageItemToSvgText(VEPROMS.CSLA.Library.PageItem pageItem, string text, SectionInfo mySection) - { - SvgText svgText = new SvgText(); - svgText.Text = text; - VEPROMS.CSLA.Library.E_Justify justify = pageItem.Justify ?? VEPROMS.CSLA.Library.E_Justify.PSLeft; - float colAdj16bit = 0; - if ((justify & VEPROMS.CSLA.Library.E_Justify.PSLeft) == VEPROMS.CSLA.Library.E_Justify.PSLeft) - svgText.Justify = SvgJustify.Left; - else if ((justify & VEPROMS.CSLA.Library.E_Justify.PSRight) == VEPROMS.CSLA.Library.E_Justify.PSRight) - svgText.Justify = SvgJustify.Right; - else - { - svgText.Justify = SvgJustify.Center; - if (((justify & VEPROMS.CSLA.Library.E_Justify.PSTrue) != VEPROMS.CSLA.Library.E_Justify.PSTrue) && - !mySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PicaIgnoreFiveSixths) - { - // the default CPI for Proms is 12, in 16bit 12 is the default - if a font wasn't defined - // or when doing a positioning calculation 12 was used. So we need to make an adjustment - // to handle non-12 CPI (12CPI will just cancel out in the following calculation). - - // Take the difference between the width in Points of a character at 12CPI and a character - // at the defined font's CPI. Multiply that times the length of title and divide by two - // to find the half-way point. - - // if the PageItem's font CPI is null, then default to 12 CPI - colAdj16bit = (1 + text.Length) * ((72 / (float)(pageItem.Font.CPI ?? 12)) - (72 / 12)) / 2; - } - } - svgText.Font = pageItem.Font.WindowsFont; - float row = (float)pageItem.Row < 0 ? -(float)pageItem.Row : (float)pageItem.Row; - if ((justify & VEPROMS.CSLA.Library.E_Justify.PSTop) == VEPROMS.CSLA.Library.E_Justify.PSTop) row -= ((72 / 6) / 2); - float lcol = pageItem.Col ?? 0; - - // the column may need adjusted based on the document styles PageWidth. This was done in - // the 16bit code and was needed here to get the printed output to match. - if (pageItem.Font.FontIsProportional() && svgText.Justify == SvgJustify.Center) - { - int dotsPerChar = (int)(2400 / (mySection.MyDocStyle.Layout.PageWidth / 6)); - lcol = (lcol * 25) / dotsPerChar; - } - - svgText.X = new SvgMeasurement((float)lcol - colAdj16bit, E_MeasurementUnits.PT); - svgText.Y = new SvgMeasurement(row, E_MeasurementUnits.PT); - if (svgText.Font.Underline && svgText.Text.EndsWith(" ")) svgText.Text = svgText.Text.Substring(0, svgText.Text.Length - 1) + "\xA0";// replace last space with a hardspace - return svgText; - } - private SvgPart PageItemToSvgText(VEPROMS.CSLA.Library.PageItem pageItem, string text, float yOffset) - { - SvgText svgText = new SvgText(); - svgText.Text = text; - VEPROMS.CSLA.Library.E_Justify justify = pageItem.Justify ?? VEPROMS.CSLA.Library.E_Justify.PSLeft; - float colAdj16bit = 0; - if ((justify & VEPROMS.CSLA.Library.E_Justify.PSLeft) == VEPROMS.CSLA.Library.E_Justify.PSLeft) - svgText.Justify = SvgJustify.Left; - else if ((justify & VEPROMS.CSLA.Library.E_Justify.PSRight) == VEPROMS.CSLA.Library.E_Justify.PSRight) - svgText.Justify = SvgJustify.Right; - else - { - svgText.Justify = SvgJustify.Center; - if (((justify & VEPROMS.CSLA.Library.E_Justify.PSTrue) != VEPROMS.CSLA.Library.E_Justify.PSTrue) && - !MySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PicaIgnoreFiveSixths) - { - // the default CPI for Proms is 12, in 16bit 12 is the default - if a font wasn't defined - // or when doing a positioning calculation 12 was used. So we need to make an adjustment - // to handle non-12 CPI (12CPI will just cancel out in the following calculation). - - // Take the difference between the width in Points of a character at 12CPI and a character - // at the defined font's CPI. Multiply that times the length of title and divide by two - // to find the half-way point. - colAdj16bit = (1 + text.Length) * ((72 / (float)pageItem.Font.CPI) - (72 / 12)) / 2; - } - } - float lcol = pageItem.Col ?? 0; - - // the column may need adjusted based on the document styles PageWidth. This was done in - // the 16bit code and was needed here to get the printed output to match. - if (pageItem.Font.FontIsProportional() && svgText.Justify == SvgJustify.Center) - { - int dotsPerChar = (int)(2400 / (MySection.MyDocStyle.Layout.PageWidth / 6)); - lcol = (lcol * 25) / dotsPerChar; - } - svgText.Font = pageItem.Font.WindowsFont; - svgText.X = new SvgMeasurement((float)lcol - colAdj16bit, E_MeasurementUnits.PT); // new SvgMeasurement((float)(pageItem.Col ?? 0), E_MeasurementUnits.PT); - svgText.Y = new SvgMeasurement((float)(yOffset + pageItem.Row ?? 0), E_MeasurementUnits.PT); - if (svgText.Font.Underline && svgText.Text.EndsWith(" ")) svgText.Text = svgText.Text.Substring(0, svgText.Text.Length - 1) + "\xA0";// replace last space with a hardspace - return svgText; - } - private SvgPart PageItemToSvgText(string token, float row, float col, E_Justify just, VE_Font font, string text, SectionInfo MySection) - { - SvgText svgText = new SvgText(); - svgText.Text = text; - VEPROMS.CSLA.Library.E_Justify justify = just; - float colAdj16bit = 0; - if ((justify & VEPROMS.CSLA.Library.E_Justify.PSLeft) == VEPROMS.CSLA.Library.E_Justify.PSLeft) - svgText.Justify = SvgJustify.Left; - else if ((justify & VEPROMS.CSLA.Library.E_Justify.PSRight) == VEPROMS.CSLA.Library.E_Justify.PSRight) - svgText.Justify = SvgJustify.Right; - else - { - svgText.Justify = SvgJustify.Center; - if (((justify & VEPROMS.CSLA.Library.E_Justify.PSTrue) != VEPROMS.CSLA.Library.E_Justify.PSTrue) && - !MySection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.PicaIgnoreFiveSixths) - { - // the default CPI for Proms is 12, in 16bit 12 is the default - if a font wasn't defined - // or when doing a positioning calculation 12 was used. So we need to make an adjustment - // to handle non-12 CPI (12CPI will just cancel out in the following calculation). - - // Take the difference between the width in Points of a character at 12CPI and a character - // at the defined font's CPI. Multiply that times the length of title and divide by two - // to find the half-way point. - colAdj16bit = (1 + text.Length) * ((72 / (float)font.CPI) - (72 / 12)) / 2; - } - } - float lcol = col; - - // the column may need adjusted based on the document styles PageWidth. This was done in - // the 16bit code and was needed here to get the printed output to match. - if (font.FontIsProportional() && svgText.Justify == SvgJustify.Center) - { - int dotsPerChar = (int)(2400 / (MySection.MyDocStyle.Layout.PageWidth / 6)); - lcol = (lcol * 25) / dotsPerChar; - } - svgText.Font = font.WindowsFont; - svgText.X = new SvgMeasurement((float)lcol - colAdj16bit, E_MeasurementUnits.PT); // new SvgMeasurement((float)(pageItem.Col ?? 0), E_MeasurementUnits.PT); - svgText.Y = new SvgMeasurement(row, E_MeasurementUnits.PT); - if (svgText.Font.Underline && svgText.Text.EndsWith(" ")) svgText.Text = svgText.Text.Substring(0, svgText.Text.Length - 1) + "\xA0";// replace last space with a hardspace - return svgText; - } - private static List _MissingTokens = new List(); - protected override string ReplacePageListToken(Match match) - { - switch (match.Value) - { - case "{PAGE}": // Current Page Number - return CurrentPageNumber.ToString(); - case "{OF}": // Total Page Count for this section - return CurrentPageOf.ToString(); - case "{REV}": // Revision Number and/or Revision string. - case "{REV2}": - // The 16bit code has a revision number & then a revision date. This revision date - // was actually either a date OR a string. The 32bit code no longer will call this - // token or string RevDate. HLP procs & stpdif show the different types of data - // that are used. - - // 16-bit had code to string preceeding blanks. - if (Rev != null && Rev != "") Rev = Rev.TrimStart(" ".ToCharArray()); - - // Now check the format flags to determine if/how the Rev string should be parsed. - if ((MySection.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate && Rev.Contains("/")) - || (MySection.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash && Rev.Contains("\\"))) - { - int indx = Rev.IndexOf(MySection.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash ? '\\' : '/'); - if (match.Value == "{REV}") return Rev.Substring(0,indx); - return Rev.Substring(indx+1); - } - if (match.Value == "{REV}")return Rev; - return System.DateTime.Today.ToShortDateString(); - case "{CHKOFFHEADING}": - return PageListTopCheckOffHeader; - case "{ROMANPAGE}": - return ItemInfo.RomanNumbering(CurrentPageNumber).ToLower(); - case "{SETREV}": - return MySection.MyDocVersion.DocVersionConfig.ProcedureSetRev; - } - if (!_MissingTokens.Contains(match.Value)) - { - _MissingTokens.Add(match.Value); - _MyLog.InfoFormat("Unhandled token {0}", match.Value); - } - return ""; - } - } - public class ChkListBoxesHelper : List - { - private float _yOffsetStart; - private float _yOffsetEnd; - public ChkListBoxesHelper() - : base() - { - } - public void Add(ItemInfo myHls, float yoffStart, float yoffend) - { - Add(new ChkListBoxHelper()); - } - public void Draw() - { - foreach (ChkListBoxHelper cb in this) - { - - } - } - } - public class ChkListBoxHelper - { - public ChkListBoxHelper() - { - } - } - public class PageBookmarks : List - { - public PageBookmarks() - : base() - { - } - public void Add(ItemInfo itemInfo, string title, PdfDestination pdfDestination) - { - Add(new PageBookmark(itemInfo, title, pdfDestination)); - } - } - public class PageBookmark - { - private ItemInfo _MyItemInfo; - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - set { _MyItemInfo = value; } - } - private string _Title; - public string Title - { - get { return _Title; } - set { _Title = value; } - } - private PdfDestination _PdfDestination; - public PdfDestination PdfDestination - { - get { return _PdfDestination; } - set { _PdfDestination = value; } - } - public PageBookmark(ItemInfo itemInfo, string title, PdfDestination pdfDestination) - { - _MyItemInfo = itemInfo; - _Title = title; - _PdfDestination = pdfDestination; - } - } - public class ChangeBarDefinition // anything that is section level should go in here. - { - private PrintChangeBar _MyChangeBarType; - public PrintChangeBar MyChangeBarType - { - get { return _MyChangeBarType; } - set { _MyChangeBarType = value; } - } - private PrintChangeBarLoc _MyChangeBarLoc; - public PrintChangeBarLoc MyChangeBarLoc - { - get { return _MyChangeBarLoc; } - set { _MyChangeBarLoc = value; } - } - private PrintChangeBarText _MyChangeBarText; - public PrintChangeBarText MyChangeBarText - { - get { return _MyChangeBarText; } - set { _MyChangeBarText = value; } - } - private string _MyChangeBarMessage; // user defined change bar message from docconfig - public string MyChangeBarMessage - { - get { return _MyChangeBarMessage; } - set { _MyChangeBarMessage = value; } - } - private int _MyChangeBarColumn; // two dimensional array, if both on same side, values are = - public int MyChangeBarColumn - { - get { return _MyChangeBarColumn; } - set { _MyChangeBarColumn = value; } - } - /* - * could have line thickness (set default from 16-bit), line color (set default as black), line style - */ - public ChangeBarDefinition() - { - } - public ChangeBarDefinition(PrintChangeBar myCBT, PrintChangeBarLoc myCBL, PrintChangeBarText myCBTxt, string myCBMsg) - { - _MyChangeBarType = myCBT; - _MyChangeBarLoc = myCBL; - _MyChangeBarText = myCBTxt; - } - public ChangeBarDefinition(DocVersionConfig docverConfig, FormatInfo formatInfo) - { - // if there is not overridden data on the docversion, prompt user... - ChangeBarData changeBarData = formatInfo.PlantFormat.FormatData.ProcData.ChangeBarData; - if (docverConfig == null || docverConfig.Print_ChangeBar == PrintChangeBar.SelectBeforePrinting) - { - // use these for now, i.e. this is what user would have selected from dialog. - _MyChangeBarType = PrintChangeBar.WithDefault; - _MyChangeBarLoc = PrintChangeBarLoc.OutsideBox; - _MyChangeBarText = PrintChangeBarText.None; - } - else - { - _MyChangeBarType = docverConfig.Print_ChangeBar; - _MyChangeBarLoc = docverConfig.Print_ChangeBarLoc; - _MyChangeBarText = docverConfig.Print_ChangeBarText; - } - if (_MyChangeBarType == PrintChangeBar.WithDefault) // get data from format - { - _MyChangeBarText = changeBarData.ChangeBarMessage == "ChgID" ? PrintChangeBarText.ChgID : - changeBarData.ChangeBarMessage == "DateAndChgID" ? PrintChangeBarText.DateChgID : - changeBarData.ChangeBarMessage == "None" ? PrintChangeBarText.None : - changeBarData.ChangeBarMessage == "RevNum" ? PrintChangeBarText.RevNum : PrintChangeBarText.UserDef; - } - if (_MyChangeBarType != PrintChangeBar.Without) - { - // if the format has the absolutefixedchangecolumn format flag, then always use the fixedchangecolumn from the - // format, otherwise, use the default column based on the selected location, stored in the base format. - _MyChangeBarColumn = (changeBarData.AbsoluteFixedChangeColumn) ? - (int)changeBarData.FixedChangeColumn : - System.Convert.ToInt32(changeBarData.DefaultCBLoc.Split(",".ToCharArray())[(int)(_MyChangeBarLoc)]); - if (_MyChangeBarText == PrintChangeBarText.UserDef) - _MyChangeBarMessage = docverConfig.Print_UserCBMess1 + @"\n" + docverConfig.Print_UserCBMess2; - - } - } - } - public class CheckOffHeaderHelper - { - private SvgText _SvgText; - public SvgText SvgText - { - get { return _SvgText; } - set { _SvgText = value; } - } - private VEPROMS.CSLA.Library.VE_Font _CheckOffHeaderFont; - public VEPROMS.CSLA.Library.VE_Font CheckOffHeaderFont - { - get { return _CheckOffHeaderFont; } - set { _CheckOffHeaderFont = value; } - } - public CheckOffHeaderHelper(SvgText stext, VEPROMS.CSLA.Library.VE_Font vf) - { - _SvgText = stext; - _CheckOffHeaderFont = vf; - } - } - public class Gap - { - private float _YTop; - public float YTop - { - get { return _YTop; } - set { _YTop = value; } - } - private float _YBottom; - public float YBottom - { - get { return _YBottom; } - set { _YBottom = value; } - } - public Gap(float yTop, float yBottom) - { - _YTop = yTop; - _YBottom = yBottom; - } - } - public class Gaps : List - { - public void Add(float yTop, float yBotttom) - { - this.Add(new Gap(yTop, yBotttom)); - } - } -} diff --git a/PROMS/Volian.Print.Library/Volian.Print.Library.csproj.bak b/PROMS/Volian.Print.Library/Volian.Print.Library.csproj.bak deleted file mode 100644 index a0340f01..00000000 --- a/PROMS/Volian.Print.Library/Volian.Print.Library.csproj.bak +++ /dev/null @@ -1,165 +0,0 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {94830C07-6A3A-450E-9674-C9B4293A7726} - Library - Properties - Volian.Print.Library - Volian.Print.Library - "%24/PROMS/Volian.Print.Library", NGEAAAAA - . - - - MSSCCI:Microsoft Visual SourceSafe - v4.6.1 - - - - - 2.0 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - x86 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - true - bin\Debug\ - DEBUG;TRACE - full - x86 - prompt - false - - - bin\x86\Release\ - TRACE - true - pdbonly - x86 - prompt - false - - - - - False - ..\Volian.Controls.Library\bin\Debug\Csla.dll - - - ..\FlexableMessageBox\bin\Debug\FlexableMessageBox.dll - - - False - ..\..\Proms3rdPartyLibraries\RtfConverter\bin\Debug\Itenso.Rtf.Interpreter.dll - - - False - ..\..\Proms3rdPartyLibraries\RtfConverter\bin\Debug\Itenso.Rtf.Parser.dll - - - False - ..\..\Proms3rdPartyLibraries\iTechSharp\itextsharp.dll - - - False - ..\LBWordLibrary\bin\Debug\LBWordLibrary.dll - - - False - ..\DataLoader\bin\Debug\log4net.dll - - - - True - - - - - - - ..\ReferencedObjects\LibSource\VlnStatus\bin\Debug\VlnStatus.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {41B2D786-1C03-4C1A-9247-DA9F0D6B06D5} - VEPROMS.CSLA.Library - - - {AEEE9FD1-6892-45E2-A67E-418C06D46FF9} - Volian.Base.Library - - - {8556527C-6615-487F-8AF7-22EBC3EF0268} - Volian.Controls.Library - - - {293911B5-C602-483F-A97F-F962EEFB3CAE} - Volian.Svg.Library - - - - - - - - \ No newline at end of file diff --git a/PROMS/Volian.Print.Library/app.config b/PROMS/Volian.Print.Library/app.config deleted file mode 100644 index 7be68eba..00000000 --- a/PROMS/Volian.Print.Library/app.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/Volian.Print.Library/vlnBox - Copy.cs b/PROMS/Volian.Print.Library/vlnBox - Copy.cs deleted file mode 100644 index 5ca5abd3..00000000 --- a/PROMS/Volian.Print.Library/vlnBox - Copy.cs +++ /dev/null @@ -1,221 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using iTextSharp.text.pdf; -using iTextSharp.text; -using VEPROMS.CSLA.Library; - - -namespace Volian.Print.Library -{ - public partial class vlnBox : vlnPrintObject - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private int _LineType; /* how to represent?? */ - private System.Drawing.Color _Color; - public System.Drawing.Color Color - { - get { return _Color; } - set { _Color = value; } - } - private Box _MyBox; - - public Box MyBox - { - get { return _MyBox; } - set { _MyBox = value; } - } - // the following two fields are used if 'boxed' step, thus - // no 'Box' was defined in format file. - public string DefBox = null; - public float DefEnd = 0; - public vlnBox() - { - } - public vlnBox(vlnParagraph paragraph) - { - } - public const string BoxThin = "\x2510.\x2500.\x250c.\x2502. . .\x2518.\x2514. .\x2500. . "; - const string BoxThick = "\x2584.\x2584.\x2584.\x2588. . .\x2580.\x2580. .\x2580. . "; - const string BoxDouble = "\x2557.\x2550.\x2554.\x2551. . .\x255D.\x255A. .\x2550. . "; - const string BoxFPLNote = "\x2557.\x2550\xad.\x2554\xad.\x2551. . .\x255d.\x255a\xad. .\x2550\xad. . "; - const string BoxFPLCaution = "\x2588.\x2580.\x2588.\x2588. . .\x2588.\x2588. .\x2584. . "; - const string BoxAsterisk = " *.* .* . . . . *.* . .* . . "; - const string BoxAsteriskWithSides = " *.* .* .* . . . *.* . .* . . "; - - public override float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin) - { - if (MyBox == null) return yPageStart; - cb.SaveState(); - VlnSvgPageHelper _MyPageHelper = cb.PdfWriter.PageEvent as VlnSvgPageHelper; - PdfLayer textLayer = _MyPageHelper == null ? null : _MyPageHelper.TextLayer; - if (textLayer != null) cb.BeginLayer(textLayer); - MyContentByte = cb; - //Console.WriteLine("'{0}','{1}'", CharToAsc(MyBox.BoxStyle), MyParent.MyItemInfo.ShortPath); - float top = CalculateYOffset(yPageStart, yTopMargin) - (7*MyPageHelper.YMultiplier); - float bottom = top - (Height * MyPageHelper.YMultiplier); - float left = (float)((MyBox.Start ?? 0) + MyParent.MyItemInfo.MyDocStyle.Layout.LeftMargin); - float right = (float)MyParent.MyItemInfo.MyDocStyle.Layout.LeftMargin + (float)(MyBox.End ?? DefEnd); - iTextSharp.text.Color boxColor = new iTextSharp.text.Color(PrintOverride.OverrideBoxColor(System.Drawing.Color.Black)); - cb.SetColorStroke(boxColor); - if (DefBox != null) - { - cb.SetLineWidth(.6F); - cb.Rectangle(left, bottom, right - left, Height * MyPageHelper.YMultiplier); - } - else - { - const float llxOffset = 3; - float lineThickness = 0; - switch (MyBox.BoxStyle) - { - case BoxThin: - lineThickness = .6F; - cb.SetLineWidth(lineThickness); - cb.Rectangle(left + llxOffset, bottom + (lineThickness / 2), right - left, (Height - lineThickness) * MyPageHelper.YMultiplier); - break; - case BoxThick: - lineThickness = 6; - cb.SetLineWidth(lineThickness); - cb.Rectangle(left + llxOffset, bottom + (lineThickness / 2), right - left, (Height - lineThickness) * MyPageHelper.YMultiplier); - break; - case BoxDouble: - lineThickness = .6F; - cb.SetLineWidth(lineThickness); - // outer rectangle (rectangle's are defined as x,y,w,h) - cb.Rectangle(left + llxOffset - lineThickness * 1.5F, bottom - lineThickness, right - left + lineThickness * 3, (Height + lineThickness * 2) * MyPageHelper.YMultiplier); - // inner rectangle - cb.Rectangle(left + llxOffset + lineThickness, bottom + lineThickness * 1.5F, right - left - lineThickness * 2, (Height - lineThickness * 3) * MyPageHelper.YMultiplier); - break; - case BoxFPLNote: - lineThickness = 2; - cb.SetLineWidth(lineThickness); - float[] linePattern = { 6, 1.75F, 2.5F, 1.75F }; - cb.SetLineDash(linePattern,3); - cb.Rectangle(left + llxOffset, bottom + (lineThickness / 2) -1, right - left, (2 + Height - lineThickness) * MyPageHelper.YMultiplier); - break; - case BoxFPLCaution: - lineThickness = 3; - cb.SetLineWidth(lineThickness); - // use a Y adjustment (top & bottom) to make the caution box match the 16bit output. - float YbxAdjust = 6.5F; - cb.Rectangle(left + llxOffset, bottom - YbxAdjust + (lineThickness / 2), right - left, (Height - lineThickness + 2*YbxAdjust) * MyPageHelper.YMultiplier); - break; - case BoxAsterisk: - // this box is not drawn, it is a series of asterisks drawn above and below text. - // For this box, there are no vertical edges (RGE uses this box type) - DrawTopBottomAsterisk(cb, yPageStart, yTopMargin, yBottomMargin, ref top, ref bottom, left); - break; - case BoxAsteriskWithSides: - DrawTopBottomAsterisk(cb, yPageStart, yTopMargin, yBottomMargin, ref top, ref bottom, left); - DrawSideAsterisk(cb, yPageStart, yTopMargin, yBottomMargin, top, bottom, left, right); - break; - default: - // For other than thick, thin and double. - if (!_UnimplementedBoxStyles.Contains(MyBox.BoxStyle)) - { - _UnimplementedBoxStyles.Add(MyBox.BoxStyle); - _MyLog.InfoFormat("Unimplemented Box Style {0} {1}", ShowBoxStyle(MyBox.BoxStyle), MyParent.MyItemInfo.ShortPath); - //Console.WriteLine("Unimplemented Box Style {0} {1}", ShowBoxStyle(MyBox.BoxStyle), MyParent.MyItemInfo.ShortPath); - } - break; - //throw new Exception("Missing vlnBox handler"); - } - } - cb.Stroke(); - if (textLayer != null) cb.EndLayer(); - cb.RestoreState(); - return yPageStart; - } - - private void DrawSideAsterisk(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin, float top, float bottom, float left, float right) - { - top = CalculateYOffset(yPageStart, yTopMargin); - bottom = top - (Height * MyPageHelper.YMultiplier); - VE_Font vf = MyParent.MyItemInfo.FormatStepData.Font; - - // Left side first: - string Rtf = GetRtf(MyBox.BXVert, vf); - float vertDiff = top; - float size = (float)(MyBox.BXVert.Length * (72 / vf.CPI)); - while (vertDiff > bottom) - { - Rtf2Pdf.TextAt(cb, IParagraph, left, vertDiff, size, 100, "", yBottomMargin); - vertDiff -= (SixLinesPerInch * MyPageHelper.YMultiplier); - } - - // right side: - vertDiff = top; - Rtf = GetRtf(MyBox.BXVert.TrimEnd(), vf); - while (vertDiff > bottom) - { - if (MyBox.End != null)Rtf2Pdf.TextAt(cb, IParagraph, (float) MyBox.End, vertDiff, size, 100, "", yBottomMargin); - vertDiff = (SixLinesPerInch * MyPageHelper.YMultiplier); - } - } - - private void DrawTopBottomAsterisk(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin, ref float top, ref float bottom, float left) - { - top = CalculateYOffset(yPageStart, yTopMargin); - bottom = top - (Height * MyPageHelper.YMultiplier); - VE_Font vf = MyParent.MyItemInfo.FormatStepData.Font; - - // Top line first: - StringBuilder sb = new StringBuilder(); - sb.Append(MyBox.BXVert); - float size = (float)(MyBox.BXULC.Length * (72 / vf.CPI)); - while (size < MyBox.End) - { - sb.Append(MyBox.BXHorz); - size = size + (float)(MyBox.BXHorz.Length * (72 / vf.CPI)); - } - // Tack on the right upper corner. For some reason, the upper right corner in the - // formats had the first character as a space, this would put two spaces in a row - // at the end of the string, so remove the space before tacking on the upper right - // corner: - string bxstr = sb.ToString().TrimEnd() + MyBox.BXURC; - size = size + (float)((MyBox.BXURC.Length) * (72 / vf.CPI)); - Rtf = GetRtf(bxstr, vf); - Rtf2Pdf.TextAt(cb, IParagraph, left, top, size, 100, "", yBottomMargin); - - // Bottom line now - sb.Remove(0, sb.Length); - sb.Append(MyBox.BXLLC); - size = (float)(MyBox.BXLLC.Length * (72 / vf.CPI)); - while (size < MyBox.End) - { - sb.Append(MyBox.BXHorz); - size = size + (float)(MyBox.BXHorz.Length * (72 / vf.CPI)); - } - bxstr = sb.ToString().TrimEnd() + MyBox.BXLRC; - size = size + (float)((MyBox.BXLRC.Length) * (72 / vf.CPI)); - Rtf = GetRtf(bxstr, vf); - Rtf2Pdf.TextAt(cb, IParagraph, left, bottom, size, 100, "", yBottomMargin); - } - - private string ShowBoxStyle(string str) - { - StringBuilder sb = new StringBuilder(); - foreach (Char c in str) - { - if (c >= ' ' && c < 128) - sb.Append(c); - else - sb.Append(string.Format("x{0:X0000}", (int)c)); - } - return sb.ToString(); - } - private static List _UnimplementedBoxStyles = new List(); - private string CharToAsc(string p) - { - StringBuilder sb = new StringBuilder(); - foreach (char c in p) - { - if (c >= ' ' && c < 127) sb.Append(c); - else sb.Append(string.Format("\\x{0:x}", (int)c)); - } - return sb.ToString(); - } - } -} diff --git a/PROMS/Volian.Print.Library/vlnBox.cs.bak b/PROMS/Volian.Print.Library/vlnBox.cs.bak deleted file mode 100644 index d48430c4..00000000 --- a/PROMS/Volian.Print.Library/vlnBox.cs.bak +++ /dev/null @@ -1,233 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using iTextSharp.text.pdf; -using iTextSharp.text; -using VEPROMS.CSLA.Library; - - -namespace Volian.Print.Library -{ - public partial class vlnBox : vlnPrintObject - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - private int _LineType; /* how to represent?? */ - private System.Drawing.Color _Color; - public System.Drawing.Color Color - { - get { return _Color; } - set { _Color = value; } - } - private Box _MyBox; - - public Box MyBox - { - get { return _MyBox; } - set { _MyBox = value; } - } - // the following two fields are used if 'boxed' step, thus - // no 'Box' was defined in format file. - public string DefBox = null; - public float DefEnd = 0; - public vlnBox() - { - } - public vlnBox(vlnParagraph paragraph) - { - } - public const string BoxThin = "\x2510.\x2500.\x250c.\x2502. . .\x2518.\x2514. .\x2500. . "; - const string BoxThick = "\x2584.\x2584.\x2584.\x2588. . .\x2580.\x2580. .\x2580. . "; - const string BoxDouble = "\x2557.\x2550.\x2554.\x2551. . .\x255D.\x255A. .\x2550. . "; - const string BoxFPLNote = "\x2557.\x2550\xad.\x2554\xad.\x2551. . .\x255d.\x255a\xad. .\x2550\xad. . "; - const string BoxFPLCaution = "\x2588.\x2580.\x2588.\x2588. . .\x2588.\x2588. .\x2584. . "; - const string BoxAsterisk = " *.* .* . . . . *.* . .* . . "; - const string BoxAsteriskWithSides1 = " *.* .* .* . . . *.* . .* . . "; // ip2 - const string BoxAsteriskWithSides2 = "*. *.*.*. . .*.*. . *. . "; // ip3 (sub 15) - - public override float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin) - { - if (MyBox == null) return yPageStart; - cb.SaveState(); - VlnSvgPageHelper _MyPageHelper = cb.PdfWriter.PageEvent as VlnSvgPageHelper; - PdfLayer textLayer = _MyPageHelper == null ? null : _MyPageHelper.TextLayer; - if (textLayer != null) cb.BeginLayer(textLayer); - MyContentByte = cb; - //Console.WriteLine("'{0}','{1}'", CharToAsc(MyBox.BoxStyle), MyParent.MyItemInfo.ShortPath); - float top = CalculateYOffset(yPageStart, yTopMargin) - (7*MyPageHelper.YMultiplier); - float bottom = top - (Height * MyPageHelper.YMultiplier); - float left = (float)((MyBox.Start ?? 0) + MyParent.MyItemInfo.MyDocStyle.Layout.LeftMargin); - float right = (float)MyParent.MyItemInfo.MyDocStyle.Layout.LeftMargin + (float)(MyBox.End ?? DefEnd); - iTextSharp.text.Color boxColor = new iTextSharp.text.Color(PrintOverride.OverrideBoxColor(System.Drawing.Color.Black)); - cb.SetColorStroke(boxColor); - _MyPageHelper.MyGaps.Add(top, bottom); - if (DefBox != null) - { - cb.SetLineWidth(.6F); - cb.Rectangle(left, bottom, right - left, Height * MyPageHelper.YMultiplier); - } - else - { - const float llxOffset = 3; - float lineThickness = 0; - switch (MyBox.BoxStyle) - { - case BoxThin: - lineThickness = .6F; - cb.SetLineWidth(lineThickness); - cb.Rectangle(left + llxOffset, bottom + (lineThickness / 2), right - left, (Height - lineThickness) * MyPageHelper.YMultiplier); - break; - case BoxThick: - lineThickness = 6; - cb.SetLineWidth(lineThickness); - cb.Rectangle(left + llxOffset, bottom + (lineThickness / 2), right - left, (Height - lineThickness) * MyPageHelper.YMultiplier); - break; - case BoxDouble: - lineThickness = .6F; - cb.SetLineWidth(lineThickness); - // outer rectangle (rectangle's are defined as x,y,w,h) - cb.Rectangle(left + llxOffset - lineThickness * 1.5F, bottom - lineThickness, right - left + lineThickness * 3, (Height + lineThickness * 2) * MyPageHelper.YMultiplier); - // inner rectangle - cb.Rectangle(left + llxOffset + lineThickness, bottom + lineThickness * 1.5F, right - left - lineThickness * 2, (Height - lineThickness * 3) * MyPageHelper.YMultiplier); - break; - case BoxFPLNote: - lineThickness = 2; - cb.SetLineWidth(lineThickness); - float[] linePattern = { 6, 1.75F, 2.5F, 1.75F }; - cb.SetLineDash(linePattern,3); - cb.Rectangle(left + llxOffset, bottom + (lineThickness / 2) -1, right - left, (2 + Height - lineThickness) * MyPageHelper.YMultiplier); - break; - case BoxFPLCaution: - lineThickness = 3; - cb.SetLineWidth(lineThickness); - // use a Y adjustment (top & bottom) to make the caution box match the 16bit output. - float YbxAdjust = 6.5F; - cb.Rectangle(left + llxOffset, bottom - YbxAdjust + (lineThickness / 2), right - left, (Height - lineThickness + 2*YbxAdjust) * MyPageHelper.YMultiplier); - break; - case BoxAsterisk: - DrawAsteriskTopBottom(cb, yPageStart, yTopMargin, yBottomMargin, ref top, ref bottom, left); - break; - case BoxAsteriskWithSides1: - case BoxAsteriskWithSides2: - DrawAsteriskTopBottom(cb, yPageStart, yTopMargin, yBottomMargin, ref top, ref bottom, left); - DrawAsteriskSide(cb, yPageStart, yTopMargin, yBottomMargin, top, bottom, left, right); - break; - default: - // For other than thick, thin and double. - if (!_UnimplementedBoxStyles.Contains(MyBox.BoxStyle)) - { - _UnimplementedBoxStyles.Add(MyBox.BoxStyle); - _MyLog.InfoFormat("Unimplemented Box Style {0} {1}", ShowBoxStyle(MyBox.BoxStyle), MyParent.MyItemInfo.ShortPath); - //Console.WriteLine("Unimplemented Box Style {0} {1}", ShowBoxStyle(MyBox.BoxStyle), MyParent.MyItemInfo.ShortPath); - } - break; - //throw new Exception("Missing vlnBox handler"); - } - } - cb.Stroke(); - if (textLayer != null) cb.EndLayer(); - cb.RestoreState(); - return yPageStart; - } - - private void DrawAsteriskTopBottom(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin, ref float top, ref float bottom, float left) - { - // this box is not drawn, it is a series of asterisks drawn above and below text. - // For this box, there are no vertical edges (RGE uses this box type) - top = CalculateYOffset(yPageStart, yTopMargin); - // Bug fix B2013-091 - // added YMultiplier to handle compress pages - // bottom row of asterisks was in non-compressed line location - bottom = top - (Height * MyPageHelper.YMultiplier);//Height; - - // create a new font without any styles such as underline. - VE_Font vf = new VE_Font(MyParent.MyItemInfo.FormatStepData.Font.Family, (int)MyParent.MyItemInfo.FormatStepData.Font.Size, E_Style.None, (float)MyParent.MyItemInfo.FormatStepData.Font.CPI); - - // Top line first: - StringBuilder sb = new StringBuilder(); - sb.Append(MyBox.BXULC); - float size = (float)(MyBox.BXULC.Length * (72/vf.CPI)); - while (size < (MyBox.End - MyBox.Start)) - { - sb.Append(MyBox.BXHorz); - size = size + (float)(MyBox.BXHorz.Length * (72/vf.CPI)); - } - // Tack on the right upper corner. For some reason, the upper right corner in the - // formats had the first character as a space, this would put two spaces in a row - // at the end of the string, so remove the space before tacking on the upper right - // corner: - string bxstr = sb.ToString().TrimEnd() + MyBox.BXURC; - size = size + (float)((MyBox.BXURC.Length) * (72/vf.CPI)); - Rtf = GetRtf(bxstr, vf); - IParagraph = null; // set to null so that next access of IParagraph sets the Rtf. - Rtf2Pdf.TextAt(cb, IParagraph, left, top, size, 100, "", yBottomMargin); - - // Bottom line now - sb.Remove(0, sb.Length); - sb.Append(MyBox.BXLLC); - size = (float)(MyBox.BXLLC.Length * (72 / vf.CPI)); - while (size < (MyBox.End-MyBox.Start)) - { - sb.Append(MyBox.BXHorz); - size = size + (float)(MyBox.BXHorz.Length * (72 / vf.CPI)); - } - bxstr = sb.ToString().TrimEnd() + MyBox.BXLRC; - size = size + (float)((MyBox.BXLRC.Length) * (72/vf.CPI)); - Rtf = GetRtf(bxstr, vf); - IParagraph = null; // set to null so that next access of IParagraph sets the Rtf. - Rtf2Pdf.TextAt(cb, IParagraph, left, bottom, size, 100, "", yBottomMargin); - } - private void DrawAsteriskSide(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin, float top, float bottom, float left, float right) - { - top = CalculateYOffset(yPageStart, yTopMargin); - bottom = top - (Height * MyPageHelper.YMultiplier); - float height = (SixLinesPerInch * MyPageHelper.YMultiplier) + 4; // just add a little on so that height is a little bigger than character - VE_Font vf = MyParent.MyItemInfo.FormatStepData.Font; - - // Left side first: - Rtf = GetRtf(MyBox.BXVert, vf); - IParagraph = null; // set to null so that next access of IParagraph sets the Rtf. - // start down one line because the top/bottom code draws the corner - float vertDiff = top - (SixLinesPerInch * MyPageHelper.YMultiplier); - float width = (float)(MyBox.BXVert.Length * (72 / vf.CPI)); - while (vertDiff > bottom) - { - Rtf2Pdf.TextAt(cb, IParagraph, left, vertDiff, width, height, "", yBottomMargin); - vertDiff -= (SixLinesPerInch * MyPageHelper.YMultiplier); - } - - // right side: - vertDiff = top - (SixLinesPerInch * MyPageHelper.YMultiplier); - Rtf = GetRtf(MyBox.BXVert.TrimEnd(), vf); - IParagraph = null; // set to null so that next access of IParagraph sets the Rtf. - while (vertDiff > bottom) - { - Rtf2Pdf.TextAt(cb, IParagraph, right, vertDiff, width, height, "", yBottomMargin); - vertDiff -= (SixLinesPerInch * MyPageHelper.YMultiplier); - } - } - private string ShowBoxStyle(string str) - { - StringBuilder sb = new StringBuilder(); - foreach (Char c in str) - { - if (c >= ' ' && c < 128) - sb.Append(c); - else - sb.Append(string.Format("x{0:X0000}", (int)c)); - } - return sb.ToString(); - } - private static List _UnimplementedBoxStyles = new List(); - private string CharToAsc(string p) - { - StringBuilder sb = new StringBuilder(); - foreach (char c in p) - { - if (c >= ' ' && c < 127) sb.Append(c); - else sb.Append(string.Format("\\x{0:x}", (int)c)); - } - return sb.ToString(); - } - } -} diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs.bak b/PROMS/Volian.Print.Library/vlnParagraph.cs.bak deleted file mode 100644 index 4ed3b2db..00000000 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs.bak +++ /dev/null @@ -1,6266 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -//using System.Drawing; -using System.Text.RegularExpressions; -using System.IO; -using iTextSharp.text.pdf; -using iTextSharp.text; -using Itenso.Rtf; -using Itenso.Rtf.Parser; -using Itenso.Rtf.Interpreter; -using Itenso.Rtf.Support; -using Volian.Controls.Library; -using VEPROMS.CSLA.Library; -using Volian.Base.Library; - -namespace Volian.Print.Library -{ - public partial class vlnParagraphs : List - { - private vlnParagraph _Parent; - public vlnParagraph Parent - { - get { return _Parent; } - set { _Parent = value; } - } - public vlnParagraphs(vlnParagraph parent) - { - _Parent = parent; - } - // Step Designators are used by Comanche Peak and stored in their CAUTION2 type - // We need to save this information and not process it like a normal Caution. - private string _StepDesignator; - public string StepDesignator - { - get { return _StepDesignator; } - set { _StepDesignator = value; } - } - private float? _StepDesignatorColumn; - - public float? StepDesignatorColumn - { - get { return _StepDesignatorColumn; } - set { _StepDesignatorColumn = value; } - } - private VE_Font _StepDesignatorFont; - - public VE_Font StepDesignatorFont - { - get { return _StepDesignatorFont; } - set { _StepDesignatorFont = value; } - } - - public bool IsEnhancedBackgroundFormat(ItemInfo itminfo) - { - return ((itminfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds); - } - public bool IsEnhancedDeviationFormat(ItemInfo itminfo) - { - return ((itminfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations); - } - public float Add(PdfContentByte cb, ItemInfoList itemInfoList, float xoff, float yoff, float yoffRight, int rnoLevel, int maxRNO, FormatInfo formatInfo) - { - return Add(cb, itemInfoList, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo, null); - } - public float Add(PdfContentByte cb, ItemInfoList itemInfoList, float xoff, float yoff, float yoffRight, int rnoLevel, int maxRNO, FormatInfo formatInfo, PromsPrinter pp) - { - int profileDepth = ProfileTimer.Push(">>>> vlnParagraphs.Add"); - bool bxHlsDraw = false; - int? bxIndex = null; - vlnBox box = null; - float yTop = yoff; - ItemInfo lastChild = null; - string lastHeader = null; - bool didComponentTableRow = false; - float tableBottomMost = 0; - float xoffBase = xoff; - int prevTplRow = 0; - int maxRnoSav = maxRNO; - foreach (ItemInfo iChildItemInfo in itemInfoList) - { - if(pp != null) pp.OnStatusChanged((iChildItemInfo.DisplayNumber ?? "") == "" ? iChildItemInfo.DisplayText : iChildItemInfo.DisplayNumber, PromsPrinterStatusType.LoadVlnParagraph); - if (iChildItemInfo.IsFootnote) - { - vlnParagraph para = new vlnParagraph(Parent, cb, iChildItemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null, yoffRight, true, iChildItemInfo.IsSection ? pp :null); - continue; // don't add it, vlnParagraph adds this item to the footnote list in ToPdf. - } - maxRNO = maxRnoSav; - if (iChildItemInfo.IsHigh) bxIndex = null; - if (iChildItemInfo.IsSection && (iChildItemInfo as SectionInfo).ColumnMode != maxRNO) - maxRNO = (iChildItemInfo as SectionInfo).ColumnMode; - int maxRnoTemplate = iChildItemInfo.TemplateChildColumnMode; - if (maxRnoTemplate >= 0) maxRNO = maxRnoTemplate-1; - ItemInfo childItemInfo = iChildItemInfo; - int? bxIndx = childItemInfo.FormatStepData == null ? -1 : childItemInfo.FormatStepData.StepLayoutData.STBoxindex; - // if the Caution or Note is not boxed, then use ColT to set the starting column of the Note or Caution - if (((bxIndx ?? -1) == -1) && (childItemInfo.IsCaution || childItemInfo.IsNote) && !childItemInfo.IsInRNO && - !childItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.Dev_Format && - !IsEnhancedBackgroundFormat(childItemInfo) && !IsEnhancedDeviationFormat(childItemInfo)) - //xoff += (float)childItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColT; - xoff = xoffBase + (float)childItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColT; - - // if in a ComponentTableFormat (FNP sub format 1, component list), column headers are defined - // by the first level of children. The data for the column is the child of the column header. - // Sometimes the column will not have data, the following handles that case. Also, use - // the boolean didComponentTableRow to keep track of the bottom most yoff of the table row. - if ((childItemInfo.MyDocStyle.ComponentList) && childItemInfo.MyParent.IsInTemplate()|| - (childItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && childItemInfo.IsInTemplate())) - { - if (childItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) - { - // if this template element has a -1 for row, print it (if = 0 this is a heading for edit - // and not printed). if this template element has a width of > 0, then also print it, - // these are headings and should be printed). This was added for Calvert Alarm (BGEALN) format for - // DEVICE/SETPOINT (row=-1), and for POSSIBLE CAUSES, AUTOMATIC ACTIONS, etc (width>0) - // find the indexes into the template for this item. The index must be for the HLS this is - // or this is under. - int tindx = childItemInfo.TemplateIndex; - if (tindx == -1) - xoff = (float)childItemInfo.MyDocStyle.Layout.LeftMargin; - else if (childItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].row < 0 || - childItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].width > 0) - { - // move down for the 'POSSIBLE CAUSES'. To know it's that step type, check - // the column field in template. -1 represents staying on same row but using - // the start template field to get the xoffset. - if (prevTplRow == -1 && prevTplRow != childItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].row) - { - // position to the furthest down the page of the Device/setpoint/annunciator window: - yoff = Math.Max(yoff, Parent.YBottomMost + vlnPrintObject.SixLinesPerInch); - yoff = Math.Max(yoff, tableBottomMost + vlnPrintObject.SixLinesPerInch); - } - xoff = (float)childItemInfo.MyDocStyle.Layout.LeftMargin + (childItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].start * 7.2f); - prevTplRow = childItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].row; - } - } - else - { - // childItemInfo = 'child' and set to use a template for defining size. - // Note that the 'IsCaution1' was added for Calvert Valve lists, i.e. - // the Caution1 is a subheader & must be printed within the valve list table. - if (childItemInfo.Steps == null && !childItemInfo.IsCaution1) - continue; - if (!childItemInfo.IsCaution1) childItemInfo = childItemInfo.Steps[0]; - didComponentTableRow = true; - } - } - if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.TabData != null && childItemInfo.FormatStepData.TabData.IsTransition) - { - lastHeader = childItemInfo.DisplayText; - } - else - { - if ((childItemInfo.IsCaution || childItemInfo.IsNote) && - childItemInfo.MyPrevious != null && childItemInfo.MyPrevious.MyContent.Type != childItemInfo.MyContent.Type && - childItemInfo.NextItemCount > 0 && childItemInfo.NextItem!= null && childItemInfo.MyContent.Type == childItemInfo.NextItem.MyContent.Type) - childItemInfo.SetupTags(); // added for V.C. Summer Transition caution in EOP-15.0 step 5.4 - if (lastHeader != null) - { - childItemInfo.SetHeader(childItemInfo.FormatStepData.TabData.Font, lastHeader); - lastHeader = null; - } - // if the format has MatchUpRNOCautNote, then add a line to yoff, if not at top of rno column. - if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.MatchUpRNO) - { - if (childItemInfo.MyParent != null && childItemInfo.MyParent.MyParent != null && !childItemInfo.MyParent.MyParent.IsHigh) - yoff += vlnPrintObject.SixLinesPerInch; - } - // if this is a caution/note and it has a caution/note substep, do it before this caution/note, so that - // it comes above it. - if (childItemInfo.Cautions != null && (childItemInfo.IsCaution || childItemInfo.IsNote)) - yoff = Add(cb, childItemInfo.Cautions, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo); - if (childItemInfo.Notes != null && (childItemInfo.IsCaution || childItemInfo.IsNote)) - yoff = Add(cb, childItemInfo.Notes, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo); - //int? bxIndx = childItemInfo.FormatStepData == null ? -1 : childItemInfo.FormatStepData.StepLayoutData.STBoxindex; - bool boxHLS = false; - - // If this step has a previous, and its header is different than the previous's header. Allow it to go - // into the box code. Without this check, none of the box code is run. This caused a problem - // for VCS where two different type notes where not getting separate boxes. - bool doSeparateBoxHdrChg = false; - if (childItemInfo.MyPrevious != null && ((childItemInfo.MyHeader != null && childItemInfo.MyPrevious.MyHeader != null - && childItemInfo.MyHeader.CleanText != childItemInfo.MyPrevious.MyHeader.CleanText) || - (childItemInfo.MyHeader == null && childItemInfo.MyPrevious.MyHeader != null || childItemInfo.MyHeader != null && childItemInfo.MyPrevious.MyHeader == null))) - doSeparateBoxHdrChg = childItemInfo.MyPrevious.MyContent.Type != childItemInfo.MyContent.Type;//true; - - bool alwaysBox = (childItemInfo.IsHigh && childItemInfo.FormatStepData.BoxIt); - if ((alwaysBox || (bxIndx ?? -1) != -1) && (bxIndex != bxIndx || childItemInfo.FormatStepData.BoxIt || childItemInfo.MyHeader != null || doSeparateBoxHdrChg || childItemInfo.FormatStepData.SeparateBox)) - { - if (childItemInfo.FormatStepData.BoxIt) // this is a boxed HLS - { - box = new vlnBox(); - box.MyBox = new Box(); - box.DefBox = vlnBox.BoxThin; - StepSectionLayoutData ssld = formatInfo.MyStepSectionLayoutData; - float colR = float.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[childItemInfo.ColumnMode]); - int widS = vlnPrintObject.ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); - box.DefEnd = (float)(ssld.ColS + colR + widS + (60 / 4.8)); - box.YOffset = yoff - .75F * vlnPrintObject.SixLinesPerInch; - } - else if (bxIndex == null) // First boxed step - { - if (childItemInfo.IsHigh) boxHLS = true; - box = new vlnBox(); - box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - if (box.MyBox != null) - { - box.YOffset = yoff; - int ln = 1; // a format flag determines whether there is a space before the note/caution. - if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; - if (!boxHLS || (boxHLS && !childItemInfo.HasCautionOrNote)) - { - // note that in the following line of code, the Calvert Alarms' caution1 is their annunciator window - // so it needs the extra lines as defined by 'ln' or the text will be too close to the top of the box. - if (!formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || iChildItemInfo.IsCaution1) - yoff += ln * vlnPrintObject.SixLinesPerInch; - else - yoff += vlnPrintObject.SixLinesPerInch; - } - } - bxIndex = bxIndx; - } - else // Change Box Style - { - bool handleSeparateBox = true; - if (childItemInfo.IsCaution && !childItemInfo.FormatStepData.SeparateBox && !childItemInfo.FormatStepData.SeparateBoxCautions) handleSeparateBox = false; - if (childItemInfo.IsNote && !childItemInfo.FormatStepData.SeparateBox) handleSeparateBox = false; - - if (bxIndx != null && (handleSeparateBox || bxIndex != bxIndx || doSeparateBoxHdrChg)) - { - if (box != null) - { - box.Height = yoff - box.YOffset; // new height, with children - if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || - formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) - { - if (childItemInfo.MyHeader != null && childItemInfo.MyPrevious != null - && ((childItemInfo.MyPrevious.IsCautionOrNotePart && childItemInfo.IsCautionOrNotePart) - || childItemInfo.FormatStepData.SeparateBox)) - yoff += vlnPrintObject.SixLinesPerInch * 2; - } - else if (childItemInfo.MyHeader != null && childItemInfo.MyPrevious != null - && ((childItemInfo.MyPrevious.IsCaution && childItemInfo.IsCaution) || - (childItemInfo.MyPrevious.IsNote && childItemInfo.IsNote) || childItemInfo.FormatStepData.SeparateBox)) - yoff += vlnPrintObject.SixLinesPerInch * 2; - else if (doSeparateBoxHdrChg) - yoff += vlnPrintObject.SixLinesPerInch * 2; - } - box = new vlnBox(); - box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - int ln = 1; // a format flag determines whether there is a space before the note/caution. - //if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; - if (childItemInfo.MixCautionNotesDiffType()) ln += 2; - box.YOffset = yoff + ((ln - 1) * vlnPrintObject.SixLinesPerInch); - if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; - yoff += ln * vlnPrintObject.SixLinesPerInch; - } - } - bxIndex = bxIndx; - } - else if (((bxIndx ?? -1) == -1) && box != null) - { - // BGE STP has a null box for its 'Date Time Stamp', i.e. Note4, - // without this code if there is a previous sibling the 'Date Time Note' was - // included in its previous sibling's box: - // (STBoxindex="" is how Note4's box in BGE STP is defined - it is the only place - // in the format files that this is done) - box.Height = yoff - box.YOffset; // new height, with children - yoff += 2 * vlnPrintObject.SixLinesPerInch; - box = null; - } - // DoubleBoxHls is a format flag used by BGE to draw double lined boxes around their HLS - if (childItemInfo.IsHigh && ((childItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS)) - { - boxHLS = true; - box = new vlnBox(); - box.MyBox = new Box(); - box.DefBox = vlnBox.DOUBLEboxHLS; - bxHlsDraw = true; - } - // Comanche peak or WCN bck Step designator - if (childItemInfo.IsCaution2 && childItemInfo.SameRowAsParent || - childItemInfo.IsCaution1 && childItemInfo.SameRowAsParent) - { - // Save the Step Designator information - // SameRowAsParentMultiLine currently used in Comanche Peak EOP and Flex formats - handles a hard return in the caution type - _StepDesignator = ((childItemInfo.SameRowAsParentMultiLines) ? childItemInfo.MulitLineStepDesignatorDisplayText : childItemInfo.DisplayText); - int typ = ((int)childItemInfo.MyContent.Type) % 10000; - _StepDesignatorColumn = formatInfo.PlantFormat.FormatData.StepDataList[typ].ColOverride; - E_Style es = (E_Style)childItemInfo.FormatStepData.Font.Style; - _StepDesignatorFont = new VE_Font(childItemInfo.FormatStepData.Font.Family, (int)childItemInfo.FormatStepData.Font.Size, es, (float)childItemInfo.FormatStepData.Font.CPI); - } - else - { - if (childItemInfo is SectionInfo) formatInfo = (childItemInfo as SectionInfo).LocalFormat ?? formatInfo; - if (rnoLevel < maxRNO && childItemInfo.RNOs != null) yoff = Math.Max(yoff, yoffRight); - if (childItemInfo.ActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.ContActBoxOnSubSteps && - box != null && box.MyBox != null && bxIndx == null) // point beach boxed substeps - { - box.Height = yoff - box.YOffset - (1F * vlnPrintObject.SixLinesPerInch); - box = null; - yoff += 1 * vlnPrintObject.SixLinesPerInch; - } - vlnParagraph para = new vlnParagraph(Parent, cb, childItemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null, yoffRight, true, pp); - - // if doing the component list (FNP), keep track of the bottom most columns' data - // so this can be returned after the row is done. - tableBottomMost = Math.Max(tableBottomMost, para.YBottomMost); - if (box != null && box.MyParent == null) - { - box.MyParent = para; - para.PartsContainer.Add(box); - } - Add(para); - if (didComponentTableRow && iChildItemInfo.Steps != null && iChildItemInfo.Steps.Count > 1) - tableBottomMost = Math.Max(tableBottomMost, AddComponentTableSiblings(cb, iChildItemInfo.Steps[1], xoff, para.YBottomMost, rnoLevel, maxRNO, formatInfo, yoffRight, pp)); - - // Calvert Alarm's caution1 is the Annunciator window, i.e. in top right of page. Adjust - // y offset for this caution that is printed BELOW the hls. - if (childItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && iChildItemInfo.IsCaution1) para.MyHighLevelParagraph.YBottomMost = para.YBottomMost; - - // para.YBottomMost will have y for bottom of any substeps that are also enclosed in the box. - if (childItemInfo.IsStep && childItemInfo.MyHLS != null && childItemInfo.MyHLS.FormatStepData.UseSmartTemplate && para.ChildrenBelow.Count > 0 && para.ChildrenBelow[0].YBottomMost > para.YBottomMost) - yoff = para.ChildrenBelow[0].YBottomMost; - // if doing the component list (FNP), yoff for the HLS (if it's the component in the list, - // i.e. the leftmost item in the table), the yoff is either the HLS bottom, or the bottom most - // of all of the other columns' data. - else if (childItemInfo.IsHigh && childItemInfo.FormatStepData.UseOldTemplate && childItemInfo.MyDocStyle.ComponentList) - yoff = Math.Max(para.YBottom, para.YBottomMost) + vlnPrintObject.SixLinesPerInch; - // increment the y offset if not doing the ComponentTableFormat - else if (!para.UseTemplateKeepOnCurLine(childItemInfo)) - yoff = para.YBottomMost; - // don't adjust YBottomost until after yoff is set for the RNO Separator - para.YBottomMost += para.YBottomMostAdjust; - if (box != null && childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.BoxIt) - { - box.Height = yoff - box.YOffset - (1.1F * vlnPrintObject.SixLinesPerInch); - box = null; // if doing boxed steps, only do single sibling at a time. - } - if (bxHlsDraw) - { - box.YOffset = para.YTop; - box.Height = para.Height; - box = null; - } - else if (boxHLS) - { - // the following line controls whether there is 1 line or 2 lines between - // the box line & the starting/ending yoffset of the HLS. WEP2 had no extra line between - // box & top/bottom of step. The DiffContActBox was added for WEP2. - int boxLnAdjust = iChildItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.DiffContActBox ? 1 : 2; - box.YOffset = para.YTop - (boxLnAdjust * vlnPrintObject.SixLinesPerInch); - boxLnAdjust = iChildItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.DiffContActBox ? 1 : 0; - - // if the YBottomForBox is set, use it to define height. Note that this property was - // introduced for IP3 continuous hls (surrounded by the asterisk box), no other format/step type uses it. - if (para.YBottomForBox > 0) - box.Height = para.YBottomForBox - box.YOffset - (boxLnAdjust * vlnPrintObject.SixLinesPerInch); // para.YTop - (1.1F * vlnPrintObject.SixLinesPerInch); - else - box.Height = para.YBottomMost - box.YOffset - (boxLnAdjust * vlnPrintObject.SixLinesPerInch); // para.YTop - (1.1F * vlnPrintObject.SixLinesPerInch); - box = null; - } - } - if (boxHLS) - { - // if the next HLS is boxed also, only need 1 line separating, otherwise - // need 2. - ItemInfo nxt = childItemInfo.GetNextItem(); - int nxtIsBoxed = 2; - if (nxt != null && - nxt.FormatStepData.StepLayoutData.STBoxindex != null && nxt.FormatStepData.StepLayoutData.STBoxindex >= 0) nxtIsBoxed--; - if (nxt != null && (nxt.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS) nxtIsBoxed = 0; - yoff += (nxtIsBoxed * vlnPrintObject.SixLinesPerInch); - } - if (childItemInfo.IsSequential && childItemInfo.NextItemCount > 0 && childItemInfo.MyParent.IsHigh && ((childItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.XBlankW1stLevSub) == E_DocStructStyle.XBlankW1stLevSub)) - yoff += vlnPrintObject.SixLinesPerInch; - boxHLS = false; - lastChild = childItemInfo; - } - } - if (box != null && box.MyBox != null) - { - box.Height = yoff - box.YOffset; // new height, with children - yoff += 2 * vlnPrintObject.SixLinesPerInch; - if (lastChild != null && lastChild.FormatStepData.AlwaysUseExtraLines && (lastChild.IsCaution || lastChild.IsNote)) - { - if (!lastChild.MyParent.IsHigh) - yoff += lastChild.ActiveFormat.PlantFormat.FormatData.StepDataList[2].StepLayoutData.STExtraSpace ?? 0; - } - } - // after the last child substep when doing a Component table row (FNP Component Lists), set the value - // of the yoff to be the bottom most line in the table. - if (didComponentTableRow) yoff = tableBottomMost; - ProfileTimer.Pop(profileDepth); - return yoff; - } - private float AddComponentTableSiblings(PdfContentByte cb, ItemInfo ii, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo, float yoffRight, PromsPrinter pp) - { - // Some of the data for the valve lists (BGE) and component lists (FARLEY) have - // sibling data within a column, rather than hard returns within the same paragraph. - float tableBottomMost = 0; - while (ii != null) - { - vlnParagraph para = new vlnParagraph(Parent, cb, ii, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null, yoffRight, true, pp); - tableBottomMost = Math.Max(tableBottomMost, para.YBottomMost); - yoff = para.YBottomMost; - Add(para); - ii = ii.GetNextItem(); - } - return tableBottomMost; - } - public float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin) - { - foreach (vlnParagraph child in this) - { - yPageStart = child.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); - } - return yPageStart; - } - } - public partial class vlnParagraph : vlnPrintObject - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - public override string ToString() - { - return string.Format("{0} - {1} - {2} - '{3}'", this.MyItemInfo.ItemID, this.YTop, this.YSize, this.MyItemInfo.ShortPath); - } - private bool _PageBreakOnStep = false; - public bool PageBreakOnStep - { - get { return _PageBreakOnStep; } - set { _PageBreakOnStep = value; } - } - private bool HasCalvertMacro = false; // this step has the Calvert (BGE) Alarm CONDITION/RESPONSE macro associated with it - private float WidthNoLimit = 0; - private vlnTable _MyGrid; - public vlnTable MyGrid - { - get { return _MyGrid; } - set { _MyGrid = value; } - } - public float SectYPageStart = 0; - private bool _IsWordDocPara = false; - public bool IsWordDocPara - { - get { return _IsWordDocPara; } - set { _IsWordDocPara = value; } - } - public static bool HasPrefPageBreak = false; // use to track page breaks for supp info - public bool PrefPageBreak = false; - private bool _ShowSectionTitles; - public bool ShowSectionTitles - { - get { return _ShowSectionTitles; } - set { _ShowSectionTitles = value; } - } - - public float ParagraphToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin) - { - //if(PartsAbove.Count > 0 && PartsAbove[0] is vlnHeader) - // if (PartsLeft.Count > 0 && PartsLeft[0] is vlnTab) - // //if((PartsLeft[0] as vlnTab).Text[0] != '\u25CF') - // _MyLog.WarnFormat("NoteTab '{0}','{1}','{2}','{3}','{4}','{5}','{6}'", (PartsAbove[0] as vlnHeader).Text, (PartsLeft[0] as vlnTab).Text, MyItemInfo.MyProcedure.DisplayNumber, MyItemInfo.MyHLS.DisplayText, - // MyItemInfo.ShortPath, MyItemInfo.FormatStepData.TabData.IdentPrint, MyItemInfo.FormatStepData.TabData.IdentEdit); -// - if (MyItemInfo.IsFootnote && Processed) return yPageStart; - int pagenumTran = 0; - if ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DontCountFoldoutPgs) == E_DocStructStyle.DontCountFoldoutPgs) - pagenumTran = MyPageHelper.CurrentPageNumberNoFoldouts; - else - pagenumTran = MyPageHelper.CurrentPageNumber; - if (MyItemInfo.PageNumber == -1) MyItemInfo.PageNumber = pagenumTran; - else if (MyItemInfo.PageNumberUsed != 0 && MyItemInfo.PageNumberUsed != pagenumTran) - { - if (PromsPrinter.TransPageNumProblems == null) PromsPrinter.TransPageNumProblems = new List(); - string pnErr = string.Format("{0} {1} {2} {3}", MyItemInfo.ItemID, MyItemInfo.ShortPath, MyItemInfo.PageNumberUsed, pagenumTran); - PromsPrinter.TransPageNumProblems.Add(pnErr); - } - MyItemInfo.PageNumberNextPass = pagenumTran; - if (Processed) return yPageStart; - //float localYPageStart = yPageStart; - Processed = true; - if (_PartsAbove != null && _PartsAbove.Count > 0) - { - // For McGuire and Catawba, they use CustomSpacing which inserts a blank line before high level steps - // if we paginate on one of these blank lines, we want to skip that blank line so that there isn't an - // extra blank line at the top of the page. - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.CustomSpacing && - PartsAbove[0].YOffset + yTopMargin == yPageStart && PartsAbove[0].IParagraph.Content == " ") - { - if (MyItemInfo.IsHigh && ((YOffset - YTopMost) > SixLinesPerInch)) - { - //Console.WriteLine("==> {0} {1} MOST {2} DIF {3}", MyItemInfo.ShortPath, YOffset, YTopMost, YOffset - YTopMost); - yPageStart = yTopMargin + YTopMost; - } - else - yPageStart = yTopMargin + YOffset; - } - else - yPageStart = PartsAbove.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); - } - - if (MyItemInfo.IsHigh && ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS)) yPageStart -= SixLinesPerInch; - if (MyItemInfo.IsHigh && MyItemInfo.MyDocStyle.SpecialStepsFoldout) yPageStart -= SixLinesPerInch; - if (MyItemInfo.IsHigh && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.DoSTExtraAtTop && (yPageStart - YTopMost == yTopMargin)) - { - yPageStart += ((MyItemInfo.FormatStepData == null) ? 0 : MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace ?? 0); - if ((MyItemInfo.Cautions != null && MyItemInfo.Cautions[0].FormatStepData.AlwaysUseExtraLines) || (MyItemInfo.Notes != null && MyItemInfo.Notes[0].FormatStepData.AlwaysUseExtraLines)) - yPageStart -= ((MyItemInfo.FormatStepData == null) ? 0 : MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace ?? 0); - } - // Save the HLS & RNO string in case the pagelist item uses it (some of the backgrounds): - if (MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.PageBreakOnStep) - { - MyPageHelper.HLSTAB = MyItemInfo.HighLevelStepTabPageList; - // find the rno and use it's tab for the HLRNO part. - ItemInfo rno = MyItemInfo.RNOs != null && MyItemInfo.RNOs.Count > 0 ? MyItemInfo.RNOs[0] : null; - string rnotab = (rno == null) ? null : rno.DisplayText; - MyPageHelper.HLRNO = rno == null ? null : MyItemInfo.FormatStepData.TabData.RNOIdent + rnotab; - MyPageHelper.ResetSvg(); - } - - float yLocation = CalculateYOffset(yPageStart, yTopMargin); - if (MyItemInfo.HasChangeBar && MyPageHelper.ChangeBarDefinition.MyChangeBarType != PrintChangeBar.Without) MyPageHelper.AddChangeBar(DoChangeBar(cb, MyItemInfo, MyPageHelper, XOffset, yLocation, MyPageHelper.MaxRNO, MyItemInfo.ActiveFormat), cbMess); - float retval = yLocation; - // 'doprint' will always be true if not doing NSP's {HLSTEXT} token in page list. The following code is used to prevent - // printing the High level step, if the high level step is printed from the pagelist using {HLSTEXT} token. - bool doprint = !(MyPageHelper.DidHLSText && MyItemInfo.ItemID == MyPageHelper.HasHLSTextId); - if (MyItemInfo.IsFigure) - { - yLocation -= (SixLinesPerInch * MyPageHelper.YMultiplier); - if (ImageText != null) - retval = DrawFigure(cb, yBottomMargin, yLocation, yPageStart, yTopMargin); - else - retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation); - } - else if (MyItemInfo.IsRtfRaw) - { - retval = DrawRaw(cb, yBottomMargin, yLocation, yPageStart, yTopMargin); - } - else if (!MyItemInfo.IsStepSection - || (ShowSectionTitles - && !MyItemInfo.MyDocStyle.CancelSectTitle - && !MyItemInfo.MyDocStyle.SpecialStepsFoldout)) // Don't ouput the Step Section title - { - // if this is a section, then check the section config for printable header too. - if (MyItemInfo.IsSection) - { - SectionConfig sch = MyItemInfo.MyConfig as SectionConfig; - //if (!(ShowSectionTitles - // && !MyItemInfo.MyDocStyle.CancelSectTitle - // && !MyItemInfo.MyDocStyle.SpecialStepsFoldout - // && !MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections) - // && - if (sch != null && sch.Section_PrintHdr != "Y") doprint = false; - } - if (MyItemInfo.MyContent.MyGrid != null) - { - int profileDepth = ProfileTimer.Push(">>>> vlnParagraph.DrawDrid"); - // RHM20150507 Include Footer - retval = DrawGrid(cb, ref yPageStart, yTopMargin, yBottomMargin + (float)MyItemInfo.MyDocStyle.Layout.FooterLength, ref yLocation); // RHM20150429 - Table Scrunch - ProfileTimer.Pop(profileDepth); - } - else - { - if (doprint) - { - int profileDepth = ProfileTimer.Push(">>>> vlnParagraph.DrawText"); - IsCompressed = (MyPageHelper.YMultiplier != 1 && MyItemInfo != null && MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.Font.Size >= 12 && (MyItemInfo.FormatStepData.Font.Style & E_Style.Underline) != 0); - retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation); - // _yPageStartForSupInfo is used to move steps down the page for the supinfo pdf. Each supinfo step may not be related to previous in structure, so need this to set y location. - if (MyItemInfo.IsInSupInfo) _yPageStartForSupInfo = retval; - // Wolf Creek Training format puts a separator line after printing the section number/title - if (MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining) - MyPageHelper.SectionSepLineYoffStart = retval - (SixLinesPerInch / 2); - SectionContinuePrinted = true; - ProfileTimer.Pop(profileDepth); - } - } - if (MyItemInfo.IsHigh) - { - MyPageHelper.PageBookmarks.Add(MyItemInfo, (MyItemInfo.MyTab == null) ? "" : MyItemInfo.MyTab.CleanText + " " + MyItemInfo.DisplayText, - new PdfDestination(PdfDestination.FITBH, yLocation + YVeryTop - YTopMost + SixLinesPerInch)); - } - } - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.WolfcreekCKLFormat) - { - DrawChkOrValveTableLines(cb, MyItemInfo, yPageStart, yTopMargin, yBottomMargin, yLocation); - } - if (MyItemInfo.IsSection) - { - SectionConfig sc = MyItemInfo.MyConfig as SectionConfig; - if ((MyItemInfo.MyDocStyle != null && MyItemInfo.MyDocStyle.IncludeInTOC && (sc == null || sc.Section_TOC != "Y")) - || ((MyItemInfo.MyDocStyle == null || !MyItemInfo.MyDocStyle.IncludeInTOC) && (sc != null && sc.Section_TOC == "Y"))) - { - string tocKey = string.Format("TOC{0}", MyItemInfo.ItemID); - if (MyPageHelper.MyTOCPageCounts.ContainsKey(tocKey)) - { - PageCount pc = MyPageHelper.MyTOCPageCounts[tocKey]; - if (pc.Total == 0) - { - pc.Total = MyPageHelper.CurrentTOCPageNumber + 1; - pc.DrawTemplates(); - - } - } - } - } - if (!doprint) return yPageStart; - if (_PartsLeft != null && _PartsLeft.Count > 0) yPageStart = PartsLeft.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); - if (_PartsRight != null && _PartsRight.Count > 0) yPageStart = PartsRight.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); - if (_PartsBelow != null && _PartsBelow.Count > 0) yPageStart = PartsBelow.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); - if (_PartsContainer != null && _PartsContainer.Count > 0) yPageStart = PartsContainer.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); - - //if (localYPageStart != yPageStart) DebugText.WriteLine("ParToPdf-yPagestartDiff:{0},{1},{2}", MyItemInfo.ItemID, localYPageStart, yPageStart); - return yPageStart; - } - - private float DrawRaw(PdfContentByte cb, float yBottomMargin, float yLocation, float yPageStart, float yTopMargin) - { - if (DebugText.IsOpen) DebugText.WriteLine("{0},'{1}','{2}','<>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, FormattedText); - float retval = yLocation; - System.Drawing.Size sz = RtfRawItem.GetRtfRawSize(MyItemInfo.MyContent.Text); - Height = sz.Height; - Width = sz.Width; - Volian.Controls.Library.RTF myRtb = new RTF(); - myRtb.Size = sz; - myRtb.Rtf = MyItemInfo.MyContent.Text; - try - { - System.Drawing.Image image = new System.Drawing.Bitmap((int)Width, (int)Height); - System.Drawing.Graphics gr = System.Drawing.Graphics.FromImage(image); - myRtb.RenderClipped(gr, new System.Drawing.Rectangle(0, 0, (int)Width, (int)Height)); - retval = Rtf2Pdf.RtfRawAt(cb, image, XOffset + MyItemInfo.FormatStepData.Font.CharsToTwips, yLocation, Width * MyPageHelper.YMultiplier, Height * MyPageHelper.YMultiplier, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.ToUpper().Contains("BORDERLESS")); - } - catch (Exception ex) - { - return retval + 2 * SixLinesPerInch; // couldn't print equation, just print 2 blank lines. - } - return retval; - } - private bool _SectionContinuePrinted = false; - - public bool SectionContinuePrinted - { - get { return _SectionContinuePrinted; } - set { _SectionContinuePrinted = value; } - } - private void DrawChkOrValveTableLines(PdfContentByte cb, ItemInfo ii, float yPageStart, float yTopMargin, float yBottomMargin, float yLocation) - { - if (!ii.IsStep || ii.IsCaution || ii.IsNote) return; - - Box bx = ii.ActiveFormat.PlantFormat.FormatData.BoxList[0]; - float lpi = MyPageHelper.YMultiplier == 1.0 ? SixLinesPerInch : _SevenLinesPerInch; - bool savedebug = Rtf2Pdf.PdfDebug; - Rtf2Pdf.PdfDebug = false; - System.Drawing.Font symbFont = new System.Drawing.Font("VESymbFix", (float)ii.FormatStepData.Font.Size); - iTextSharp.text.Font iSymblFont = Volian.Svg.Library.VolianPdf.GetFont(symbFont); - iSymblFont.Color = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Black)); - // The vertPos array from the format defines the column locations: - string[] vertPos = ii.MyHLS.FormatStepData.VertPos.Split(",".ToCharArray()); - // Count how many vertical lines are in the checklist table: - int cntVertPos = vertPos.Length - 1; - while (vertPos[cntVertPos] == "0" && cntVertPos > 0) cntVertPos--; - cntVertPos++; - Paragraph paraVertLine = new Paragraph(ii.ActiveFormat.PlantFormat.FormatData.BoxList[0].BXVert, iSymblFont); - float lWidth = 100; - float csize = 6 - .3f; // added the .3 to make line up with 16bit. - - // if High Level Step, just need to do edges for number of lines: - if (ii.IsHigh) - { - // count # of '{\par} commands in prefix and suffix. - int countLine = 0; - string preSuf_Fix = (ii.FormatStepData.Prefix != null && ii.FormatStepData.Prefix != "") ? ii.FormatStepData.Prefix : null; - if (preSuf_Fix != null) countLine++; // account for a line of prefix (if no \par) - // if this is a proportional font, need to 'draw' the prefix/suffix. NOTE that the suffix should - // just list the headers and the prefix can be 'empty'. - if (ii.FormatStepData.Font.FontIsProportional()) - { - float yLocVertLine = yLocation + (lpi / 2); - // Prefix, i.e. Top line: - Paragraph topLeftLine = new Paragraph(bx.BXULC, iSymblFont); - Rtf2Pdf.TextAt(cb, topLeftLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); - Paragraph topRightLine = new Paragraph(bx.BXURC, iSymblFont); - Rtf2Pdf.TextAt(cb, topRightLine, float.Parse(vertPos[cntVertPos - 1]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); - Paragraph horzLine = new Paragraph(bx.BXHorz, iSymblFont); - float thPos = float.Parse(vertPos[0]) + csize; - while (thPos < float.Parse(vertPos[cntVertPos - 1])) - { - Rtf2Pdf.TextAt(cb, horzLine, thPos + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); - thPos += csize; - } - - // Vertical Lines around HLS - //int countLine = (int)(this.Height / lpi); - yLocVertLine = yLocation - (lpi / 2); - for (int i = 0; i < 1; i++) - { - Rtf2Pdf.TextAt(cb, paraVertLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); - Rtf2Pdf.TextAt(cb, paraVertLine, float.Parse(vertPos[cntVertPos - 1]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); - yLocVertLine -= lpi; - } - - // Suffix, i.e. Column headers. - // first do left/right side chars above and below column headers - //countLine = (int)(this.Height / lpi); - Paragraph sideLeftLine = new Paragraph(bx.BXMLS, iSymblFont); - Rtf2Pdf.TextAt(cb, sideLeftLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); - Rtf2Pdf.TextAt(cb, sideLeftLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine - (2 * lpi), lWidth, 100, null, yBottomMargin); - Paragraph sideRightLine = new Paragraph(bx.BXMRS, iSymblFont); - Rtf2Pdf.TextAt(cb, sideRightLine, float.Parse(vertPos[6]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); - Rtf2Pdf.TextAt(cb, sideRightLine, float.Parse(vertPos[6]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine - (2 * lpi), lWidth, 100, null, yBottomMargin); - - // now do the lines with the 'T' type lines for top/bottom of vertical lines. - thPos = float.Parse(vertPos[0]) + csize; - while (thPos < float.Parse(vertPos[cntVertPos - 1])) - { - Rtf2Pdf.TextAt(cb, horzLine, thPos + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); - Rtf2Pdf.TextAt(cb, horzLine, thPos + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine - (2 * lpi), lWidth, 100, null, yBottomMargin); - thPos += csize; - } - - // now do the vertical bar between header words and the column header words. - yLocVertLine -= lpi; - string[] colHdrs = _MyItemInfo.FormatStepData.Suffix.Substring(_MyItemInfo.FormatStepData.Suffix.IndexOf(";") + 1).Split(",".ToCharArray()); - iTextSharp.text.Font iHdrFont = Volian.Svg.Library.VolianPdf.GetFont(_MyItemInfo.FormatStepData.Font.WindowsFont); - iHdrFont.Color = new iTextSharp.text.Color(PrintOverride.OverrideTextColor(System.Drawing.Color.Black)); - - Paragraph topT = new Paragraph(bx.BXUMID, iSymblFont); - Paragraph crossT = new Paragraph(bx.BXMID, iSymblFont); - - for (int i = 0; i < cntVertPos; i++) - { - // do vertical line: - Rtf2Pdf.TextAt(cb, paraVertLine, float.Parse(vertPos[i]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); - // do the column header text - center it: - if (i < colHdrs.Length) - { - Paragraph parColHdr = new Paragraph(colHdrs[i], iHdrFont); - // find the center point of column header and subtract 1/2 width of the text to locate the text. - float hloc = (float.Parse(vertPos[i]) + ((float.Parse(vertPos[i + 1]) - float.Parse(vertPos[i])) / 2)); - Chunk chk = (Chunk)parColHdr.Chunks[0]; - hloc = hloc - (chk.GetWidthPoint() / 2); - Rtf2Pdf.TextAt(cb, parColHdr, hloc + (float)ii.MyDocStyle.Layout.LeftMargin, yLocVertLine, lWidth, 100, null, yBottomMargin); - } - // Do the crosswise table characters, i.e. T and + - if (i > 0 && i < colHdrs.Length) - { - Rtf2Pdf.TextAt(cb, topT, float.Parse(vertPos[i]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine + lpi, lWidth, 100, null, yBottomMargin); - Rtf2Pdf.TextAt(cb, crossT, float.Parse(vertPos[i]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine - lpi, lWidth, 100, null, yBottomMargin); - } - } - } - else - #region OriginalHLS - { - int hIndx = preSuf_Fix.IndexOf(@"{\par}"); - while (preSuf_Fix != null && hIndx >= 0) - { - hIndx = preSuf_Fix.IndexOf(@"{\par}", hIndx + 1); - countLine++; - } - preSuf_Fix = (ii.FormatStepData.Suffix != null && ii.FormatStepData.Suffix != "") ? ii.FormatStepData.Suffix : null; - if (preSuf_Fix != null) countLine++; // account for a line of suffix (if no \par) - hIndx = preSuf_Fix.IndexOf(@"{\par}"); - while (preSuf_Fix != null && hIndx >= 0) - { - hIndx = preSuf_Fix.IndexOf(@"{\par}", hIndx + 1); - countLine++; - } - // get first and last vertpos for location of lines: - // for each line of text, draw the start & end box line: - countLine = (int)(this.Height / lpi) - countLine; - float yLocVertLine = yLocation - lpi / 2; - for (int i = 0; i < countLine; i++) - { - Rtf2Pdf.TextAt(cb, paraVertLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); - Rtf2Pdf.TextAt(cb, paraVertLine, float.Parse(vertPos[cntVertPos - 1]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yLocVertLine, lWidth, 100, null, yBottomMargin); - yLocVertLine -= lpi; - } - } - #endregion OriginalHLS - } - else - { - // This section of code draws the lines around the substeps (the actual table part) - Paragraph horzLine = new Paragraph(ii.ActiveFormat.PlantFormat.FormatData.BoxList[0].BXHorz, iSymblFont); - bool bottomOfTable = (ii.NextItem == null || ii.NextItemCount == 0) || - (MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].MyItemInfo.ItemID == ii.NextItem.ItemID); - // if bottom of table use different cross/beg/end chars than if in middle of table. - Paragraph leftLine = new Paragraph(bottomOfTable ? bx.BXLLC : bx.BXMLS, iSymblFont); - Paragraph rightLine = new Paragraph(bottomOfTable ? bx.BXLRC : bx.BXMRS, iSymblFont); - - // If this item is in the leftmost column in table, this is determined by looking at its parent, - // its parent must be a HLS, do the vertical lines since all cells have all vertical lines. - // Lines should be drawn from current to ybottommost. Also draw the bottom line. - if (ii.MyParent.IsHigh) - { - // first do the vertical bars. - float curY = yLocation; - while (curY > (yPageStart - this.YBottomMost + lpi)) - { - for (int i = 0; i < cntVertPos; i++) - Rtf2Pdf.TextAt(cb, paraVertLine, float.Parse(vertPos[i]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, curY + 3, lWidth, 100, null, yBottomMargin); - curY -= lpi; - } - // Now do the bottom line for this item. - Paragraph crossLine = new Paragraph(bottomOfTable ? bx.BXLMID : bx.BXMID, iSymblFont); - float yloc = yPageStart - this.YBottomMost + 18; - Rtf2Pdf.TextAt(cb, leftLine, float.Parse(vertPos[0]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yloc, lWidth, 100, null, yBottomMargin); - float hPos = float.Parse(vertPos[0]) + csize; - int doHorizCnt = 0; - while (doHorizCnt < cntVertPos - 1) - { - while (hPos < float.Parse(vertPos[doHorizCnt + 1])) - { - Rtf2Pdf.TextAt(cb, horzLine, hPos + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yloc, lWidth, 100, null, yBottomMargin); - hPos += csize; - } - - // put out middle piece, i.e. + (cross) lines or bottom line - hPos = float.Parse(vertPos[doHorizCnt + 1]); - if (doHorizCnt < cntVertPos - 2) // don't put out crossLine on last one. - Rtf2Pdf.TextAt(cb, crossLine, float.Parse(vertPos[doHorizCnt + 1]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yloc, lWidth, 100, null, yBottomMargin); - hPos += csize; - doHorizCnt++; - } - // put out the right side piece - Rtf2Pdf.TextAt(cb, rightLine, float.Parse(vertPos[cntVertPos - 1]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, yloc, lWidth, 100, null, yBottomMargin); - } - // Now handle middle parts of the table. For whatever sub level we're at, draw the cross character - // and the horizontal. This is case where the component number may have multiple descriptions,positions, etc. associated - // with it. - if (!ii.MyParent.IsHigh && ii.NextItem != null && ii.NextItemCount > 0) - { - // draw horizontally from this sublevel to the end. - int sublev = 0; - ItemInfo par = this.MyItemInfo; - while (!par.IsHigh) - { - sublev++; - par = par.MyParent; - } - sublev--; - float ylocs = yPageStart - this.YBottomMost + 15; - for (int i = sublev; i < cntVertPos - 1; i++) - { - float hPos = float.Parse(vertPos[i]) + csize; - Rtf2Pdf.TextAt(cb, leftLine, float.Parse(vertPos[i]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, ylocs, lWidth, 100, null, yBottomMargin); - while (hPos < float.Parse(vertPos[i + 1])) - { - // do the horizontal line - Rtf2Pdf.TextAt(cb, horzLine, hPos + (float)ii.MyDocStyle.Layout.LeftMargin - csize, ylocs, lWidth, 100, null, yBottomMargin); - hPos += csize; - } - } - // Do the last cross character - Rtf2Pdf.TextAt(cb, rightLine, float.Parse(vertPos[cntVertPos - 1]) + (float)ii.MyDocStyle.Layout.LeftMargin - csize, ylocs, lWidth, 100, null, yBottomMargin); - } - } - Rtf2Pdf.PdfDebug = savedebug; - } - private float DrawGrid(PdfContentByte cb, ref float yPageStart, float yTopMargin, float yBottomMargin, ref float yLocation) - { - //DebugText.WriteLine("{0},'{1}','{2}','<>'", MyItemInfo.ItemID, MyItemInfo.ShortPath, FormattedText); - if(DebugText.IsOpen)DebugText.WriteLine("{0},'{1}','{2}','<>',{3}", MyItemInfo.ItemID, MyItemInfo.ShortPath, MyItemInfo.MyContent.Text, XOffset); - //if (MyItemInfo.InList(11019,11024,111026)) // RHM20150507 Table Scrunch - // Console.WriteLine("here"); - float heightBefore = MyGrid.Height+4 * MyPageHelper.YMultiplier; - if (Rtf2Pdf.GetTableScrunchingStatus(TableScrunching.Phase1) && heightBefore > (yLocation - yBottomMargin)) - { - //MyGrid.TooBig = (MyItemInfo.MyDocStyle.Layout.FooterLength ?? 0) + SixLinesPerInch + MyGrid.Height - (yLocation - yBottomMargin); - MyGrid.TooBig = SixLinesPerInch + MyGrid.Height * MyPageHelper.YMultiplier - (yLocation - yBottomMargin); - float heightAfter = MyGrid.Height + 4 * MyPageHelper.YMultiplier; - MyPageHelper.TableAdjustment += (heightBefore - heightAfter); - if (heightAfter < (yLocation - yBottomMargin)) - { - _MyLog.ErrorFormat("<<< WARNING >>> Table is too big to fit on page, Vertical Padding adjusted to fit\r\n==>'Table Adjusted',{0},'{1}','{2}',{3},{4},{5}" - , MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath, heightBefore, MyGrid.Height, (yTopMargin - yBottomMargin)); - } - else - MyGrid.IsTooBig = true; - if (MyItemInfo.HasChangeBar && MyPageHelper.ChangeBarDefinition.MyChangeBarType != PrintChangeBar.Without) - { - foreach (vlnChangeBar vcb in MyPageHelper.MyChangeBars) - { - if (vcb.Height == heightBefore / MyPageHelper.YMultiplier - 4) - { - float heightDif = (heightBefore - heightAfter); - vcb.YChangeBarBottom += heightDif; - FixMessages(vcb, heightDif); - break; - } - } - } - } - MyPageHelper.BottomContent=yLocation-(MyGrid.Height + 4 * MyPageHelper.YMultiplier); - float retval = Rtf2Pdf.GridAt(cb, MyGrid, XOffset, yLocation, Width, 100, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless")); - if (MyGrid.Height > (yTopMargin - yBottomMargin)) - { - _MyLog.ErrorFormat("<<< ERROR >>> Table is too big to fit on page, expect pagination problems\r\n==>'Table Too Big',{0},'{1}','{2}',{3},{4},{5}" // RHM20150429 - Table Scrunch - , MyItemInfo.ItemID, MyItemInfo.MyDocVersion.MyFolder.Name, MyItemInfo.ShortPath, heightBefore, MyGrid.Height, (yTopMargin - yBottomMargin)); - } - return retval; - } - - private void FixMessages(vlnChangeBar vcb, float heightDif) - { - SortedDictionary msd = vcb.Messages; - vcb.Messages = new SortedDictionary(); - foreach (float key in msd.Keys) - { - vcb.Messages.Add(key+heightDif, msd[key]); - } - } - - private float DrawText(PdfContentByte cb, ref float yPageStart, float yTopMargin, float yBottomMargin, ref float yLocation) - { - if(DebugText.IsOpen)DebugText.WriteLine("{0},'{1}','{2}','<>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, FormattedText); - //Console.WriteLine("{0},{1},'{2}','<>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, IParagraph.Content); - float retval = yLocation; - if (MyItemInfo.IsRtfRaw) - { - retval = Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, DebugInfo + string.Format(",YLines = {0}", YSize / SixLinesPerInch), yBottomMargin); - return retval; - } - - // Calvert Alarms have a special case, center text if the next/previous is not the same type of caution or note. - // Calvert Alarms have a note1 that is a warning. if a regular note preceeded it, this regular note was not centered. - bool doAlign = false; - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert && (MyItemInfo.IsCaution || MyItemInfo.IsNote || MyItemInfo.IsNote1)) - { - bool diffAsPrev = MyItemInfo.MyPrevious == null || (MyItemInfo.MyPrevious != null && MyItemInfo.MyContent.Type != MyItemInfo.MyPrevious.MyContent.Type); - bool diffAsNext = MyItemInfo.NextItem == null || (MyItemInfo.NextItem != null && MyItemInfo.MyContent.Type != MyItemInfo.NextItem.MyContent.Type); - if (diffAsPrev && diffAsNext) doAlign = true; - } - // Check if only one line, i.e. "Height < (1.2F * IParagraph.Leading". The Leading can be for six or seven lines per inch, so the 1.2 - // multiplier accounts for both. - if (!MyItemInfo.IsStepSection && MyItemInfo.FormatStepData.CenterOneLineOnly && ((MyItemInfo.MyPrevious == null && MyItemInfo.NextItem == null) || MyItemInfo.FormatStepData.SeparateBox || doAlign) && Height < (1.2F * IParagraph.Leading)) - IParagraph.Alignment = Element.ALIGN_CENTER; - // if this step is centered, but not part of the checklist or valvelist format, use itextsharp to center it. - // if it was part of the checklist or valvelist, then the centering is based on the column definitions for the table and - // was calculated when the paragraph was made. - if (!MyItemInfo.IsStepSection && MyItemInfo.FormatStepData.StepPrintData.Justify == "Center" && !MyItemInfo.FormatStepData.StepLayoutData.AlignWithParentTab) - IParagraph.Alignment = Element.ALIGN_CENTER; - if (PrefixSpecialCharacter && IParagraph.Chunks.Count > 0) - { - Chunk chk = IParagraph.Chunks[0] as Chunk; - if (chk.Content == " ") - { - PrefixSpecialCharacter = false; - //Console.WriteLine("Special {0}", MyItemInfo.MyHLS.DisplayText); - IParagraph.Chunks.RemoveAt(0); - } - } - // if printing checklist header, adjust ypagestart & ylocation so that won't get forced pagination (pagination is already ok) - //Console.WriteLine("'Q1',{0},'{1}',{2},{3},{4},{5},{6}", MyItemInfo.ItemID, MyItemInfo.ShortPath, yTopMargin, yPageStart, yLocation, YTopMost, YOffset); - if (PrintHeader) - { - yPageStart = yTopMargin + YVeryTop; - yLocation = yPageStart - YOffset; // yLocation is physical location from bottom of page. - } - if (yLocation - Height < 24) - { - if (DebugPagination.IsOpen) - DebugPagination.WriteLine("Very Low {0},{1},{2},{3},{4},{5}", MyItemInfo.ShortPath, MyItemInfo.ItemID, yLocation, Height, yLocation - Height, yTopMargin - MyItemInfo.MyDocStyle.Layout.PageLength); - } - int profileDepth = ProfileTimer.Push(">>>> Rtf2Pdf.TextAt"); - // ooooooooo. oooooooooo. oooooooooooo ooooooooooooo o8o . o8o - // `888 `Y88. `888' `Y8b `888' `8 8' 888 `8 `"' .o8 `"' - // 888 .d88' 888 888 888 888 oooo d8b .oooo. ooo. .oo. .oooo.o oooo .o888oo oooo .ooooo. ooo. .oo. .oooo.o - // 888ooo88P' 888 888 888oooo8 888 `888""8P `P )88b `888P"Y88b d88( "8 `888 888 `888 d88' `88b `888P"Y88b d88( "8 - // 888 888 888 888 " 888 888 .oP"888 888 888 `"Y88b. 888 888 888 888 888 888 888 `"Y88b. - // 888 888 d88' 888 888 888 d8( 888 888 888 o. )88b 888 888 . 888 888 888 888 888 o. )88b - // o888o o888bood8P' o888o o888o d888b `Y888""8o o888o o888o 8""888P' o888o "888" o888o `Y8bod8P' o888o o888o 8""888P' - // - // Design Suggestion: - // During vlnParagraaph Constuctor Build an end point dictionary - // During toPdf check for end points before adding GoTos for Local - // Need to have a way to get to sections which do not have any output (header only) - // Need to have a way to identify procedures - // - if (IParagraph.Chunks.Count > 0 && MyPageHelper.MyPromsPrinter.SaveLinks) - { - Chunk chk1 = IParagraph.Chunks[0] as Chunk; - //Console.WriteLine("\"Desination\"\t{0}", MyItemInfo.ItemID); - if (MyItemInfo.MyContent.Text.ToUpper().Contains("LINK:TR")) - Console.WriteLine("Missing Transition {0}",MyItemInfo.ItemID); - chk1.SetLocalDestination(string.Format("ItemID={0}", MyItemInfo.ItemID)); // Destination - if (MyItemInfo.MyContent.ContentTransitionCount > 0) - { - TransitionInfo ti = MyItemInfo.MyContent.ContentTransitions[0]; - ItemInfo tiDefault = GetDefaultItemInfo(ti.MyItemToID); - if (ti.MyItemToID.MyProcedure.ItemID == MyItemInfo.MyProcedure.ItemID && - ! MyItemInfo.ActiveSection.DisplayNumber.ToUpper().StartsWith("FOLDOUT")) - { // Local Go To - if (ti.MyItemToID.MyContent.Type > 19999) - foreach (Chunk chk in IParagraph.Chunks) - { - //Console.WriteLine("\"LocalGoTo\"\t{0}", tiDefault.ItemID); - chk.SetLocalGoto(string.Format("ItemID={0}", tiDefault.ItemID)); - chk.SetBackground(Color.CYAN); - chk.SetBackground(new Color(System.Drawing.Color.LightCyan)); - } - } - else // Remote Go To - { - foreach (Chunk chk in IParagraph.Chunks) - { - //Console.WriteLine("\"RemoteGoTo\"\t{0}", tiDefault.ItemID); - chk.SetRemoteGoto(ti.MyItemToID.MyProcedure.DisplayNumber.Replace("/", "_") + ".pdf", string.Format("ItemID={0}", tiDefault.ItemID)); - chk.SetBackground(new Color(System.Drawing.Color.PeachPuff)); - } - } - } - if (MyItemInfo.MyContent.ContentRoUsageCount > 0) - { - RoUsageInfo ru = MyItemInfo.MyContent.ContentRoUsages[0]; - foreach (Chunk chk in IParagraph.Chunks) - { - if (ru.ROID.Substring(0, 4) != "FFFF") - { - chk.SetRemoteGoto("completeroreport.pdf", string.Format("ROID={0}", ru.ROID.Substring(0, 12).ToUpper())); - //Console.WriteLine("ROID={0},{1}", ru.ROID.Substring(0, 12).ToUpper(), chk.Content); - chk.SetBackground(new Color(System.Drawing.Color.LightGreen)); - } - } - } - StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config); - DVEnhancedDocuments dveds = MyItemInfo.MyDocVersion.DocVersionConfig.MyEnhancedDocuments; - foreach (EnhancedDocument ed in sc.MyEnhancedDocuments) - { - DVEnhancedDocument dved = dveds.GetByType(ed.Type); - AddLinkToEnhancedDocument(cb, yLocation, ed.ItemID, dved.PdfToken, dved.PdfX); - } - // MyPageHelper.BottomContent = yLocation - Height; - //if (MyItemInfo.InList(39048)) Console.WriteLine("Here"); - } - MyPageHelper.BottomContent = yLocation - (Height * MyPageHelper.YMultiplier); - retval = Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, DebugInfo + string.Format(",YLines = {0}", YSize / SixLinesPerInch), yBottomMargin); - ProfileTimer.Pop(profileDepth); - if (retval == 0) // problem occurred - paragraph was not able to be printed on page - { // pagination logic needs to be fixed. - // oooooooooooo ooooooooo. o8o . o8o - // `888' `8 `888 `Y88. `"' .o8 `"' - // 888 .ooooo. oooo d8b .ooooo. .ooooo. 888 .d88' .oooo. .oooooooo oooo ooo. .oo. .oooo. .o888oo oooo .ooooo. ooo. .oo. - // 888oooo8 d88' `88b `888""8P d88' `"Y8 d88' `88b 888ooo88P' `P )88b 888' `88b `888 `888P"Y88b `P )88b 888 `888 d88' `88b `888P"Y88b - // 888 " 888 888 888 888 888ooo888 888 .oP"888 888 888 888 888 888 .oP"888 888 888 888 888 888 888 - // 888 888 888 888 888 .o8 888 .o 888 d8( 888 `88bod8P' 888 888 888 d8( 888 888 . 888 888 888 888 888 - // o888o `Y8bod8P' d888b `Y8bod8P' `Y8bod8P' o888o `Y888""8o `8oooooo. o888o o888o o888o `Y888""8o "888" o888o `Y8bod8P' o888o o888o - // d" YD - // "Y88888P' - ForcePagination(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation, ref retval); - } - else - { - if (MyItemInfo.IsStepSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert && (MyItemInfo.ActiveSection as SectionInfo).HasInitials) - { - if (MyPageHelper.PrintInitials(cb,yLocation,(float) MyItemInfo.MyDocStyle.Layout.LeftMargin)) - { - //if(yLocation != yTopMargin) - // Console.WriteLine("'{0}',{1},'{2}',{3},{4},{5},{6}", MyItemInfo.MyProcedure.DisplayNumber, MyItemInfo.ItemID - // , MyItemInfo.DisplayNumber, yLocation,yTopMargin,MyItemInfo.HasCautionOrNote,MyPageHelper.CurrentPageNumber+1); - } - } - } - return retval; - } - private static void AddLinkToEnhancedDocument(PdfContentByte cb, float yLocation, int itemID, String token, int xLocation) - { - ItemInfo ii = ItemInfo.Get(itemID); - string prefix = ii.MyDocVersion.DocVersionConfig.Print_PDFFilePrefix ?? ""; - string suffix = ii.MyDocVersion.DocVersionConfig.Print_PDFFileSuffix ?? ""; - ColumnText ct = new ColumnText(cb); - ct.SetSimpleColumn(xLocation, yLocation - 12, xLocation + 30, 12 + yLocation); - iTextSharp.text.Font font = FontFactory.GetFont("Arial", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 12); - Chunk chk = new Chunk(token); - chk.SetRemoteGoto(prefix + ii.MyProcedure.DisplayNumber.Replace("/", "_") + suffix + ".pdf", string.Format("ItemID={0}", itemID)); - chk.SetBackground(new Color(System.Drawing.Color.LemonChiffon)); - ct.AddElement(chk); - cb.SetColorFill(Color.BLUE); - ct.Go(); - - //foreach (Chunk chk in IParagraph.Chunks) - //{ - // chk.SetRemoteGoto(ii.MyProcedure.DisplayNumber.Replace("/", "_") + ".pdf", string.Format("ItemID={0}",ii.ItemID)); - // chk.SetBackground(new Color(System.Drawing.Color.LemonChiffon)); - //} - } - private ItemInfo GetDefaultItemInfo(ItemInfo myItemInfo) - { - if (myItemInfo.IsProcedure &&myItemInfo.Sections != null) - { - SectionInfo siProcedureSteps = null; - foreach (SectionInfo si in myItemInfo.Sections) - { - if (si.IsDefaultSection) - { - if (si.Steps != null) return si.Steps[0]; - if (si.Sections != null) return si.Sections[0]; - return si; - } - if (si.DisplayText.Contains("Procedure Step")) - siProcedureSteps = si; - } - if (siProcedureSteps != null) - { - if (siProcedureSteps.Steps != null) return siProcedureSteps.Steps[0]; - if (siProcedureSteps.Sections != null) return siProcedureSteps.Sections[0]; - return siProcedureSteps; - } - } - if (myItemInfo.IsSection) - { - if (myItemInfo.Steps != null) return myItemInfo.Steps[0]; - if (myItemInfo.Sections != null) return myItemInfo.Sections[0]; - } - return myItemInfo; - } - private static bool _MissingInitials = false; - - public static bool MissingInitials - { - get { return vlnParagraph._MissingInitials; } - set { vlnParagraph._MissingInitials = value; } - } - public static void TextAt(PdfContentByte cb,VlnSvgPageHelper myPageHelper,PageItem pi,float yloc, float leftMargin) - { - System.Drawing.Color sysColor = PrintOverride.OverrideSvgColor(System.Drawing.Color.Black); - cb.SaveState(); - if (myPageHelper.PageListLayer != null) cb.BeginLayer(myPageHelper.PageListLayer); - ColumnText ct = new ColumnText(cb); - iTextSharp.text.Font font; - int fontStyle = 0; - bool underline = false; - if (pi == null) // The header for the signoffs is missing in the current section format. - // An Example can currently be found in Calvert OI-34 - { - if (!MissingInitials) // Only show this once. - { - _MyLog.WarnFormat("Initials Header Missing" + - "\r\nInitials header missing for section {0}" + - "\r\nfrom format [{1}], {2}, subformat {3}" + - "\r\nA default Arial font and a default location will be used." + - "\r\nPerhaps another section format should be used.", - myPageHelper.MySection.ShortPath, - myPageHelper.MySection.ActiveFormat.Name, - myPageHelper.MySection.ActiveFormat.Description, - myPageHelper.MySection.MyDocStyle.Name); - MissingInitials = true; - } - ct.SetSimpleColumn(450 + leftMargin, yloc + 6.9F, 550 + leftMargin, yloc - 50); - font = FontFactory.GetFont("Arial", BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 10F); - } - else - { - ct.SetSimpleColumn((float)pi.Col + leftMargin, yloc + 6.9F, (float)pi.Col + 100 + leftMargin, yloc - 50); - fontStyle = (pi.Font.WindowsFont.Bold ? iTextSharp.text.Font.BOLD : 0) + (pi.Font.WindowsFont.Italic ? iTextSharp.text.Font.ITALIC : 0); - font = FontFactory.GetFont(pi.Font.Family, BaseFont.IDENTITY_H, BaseFont.EMBEDDED,(float) pi.Font.Size,fontStyle); - underline = pi.Font.WindowsFont.Underline; - } - Chunk chk = new Chunk("INITIALS", font); - if(underline) - chk.SetUnderline(new iTextSharp.text.Color(sysColor), 0, 0.05F, 0, -.131F, PdfContentByte.LINE_CAP_ROUND); // Relative Based upon font size - Phrase ph = new Phrase(chk); - ct.AddElement(ph); - cb.SetColorFill(new iTextSharp.text.Color(sysColor)); - ct.Go(); - if (myPageHelper.PageListLayer != null) cb.EndLayer(); - cb.RestoreState(); - } - private bool _PrintHeader = false; - public bool PrintHeader - { - get { return _PrintHeader; } - set { _PrintHeader = value; } - } - private static List myAttributes = new List(); - private static void AddAttribute(string attr) - { - if (myAttributes.Contains(attr)) - return; - //Console.WriteLine("Attribute = \"{0}\"", attr); - myAttributes.Add(attr); - } - private void CheckAttributes(System.Collections.Hashtable attributes) - { - foreach (string attr in attributes.Keys) - { - AddAttribute(attr); - } - } - private string FormattedText - { - get - { - bool subscript = false; - //if (_MyItemInfo.ItemID == 467) - // Console.Write(""); - StringBuilder sb = new StringBuilder(); - //if (IParagraph.Chunks.Count > 1) - // Console.WriteLine("{0} Chunks", IParagraph.Chunks.Count); - foreach (Chunk chk in IParagraph.Chunks) - { - string prefix = ""; - string suffix = ""; - CheckAttributes(chk.Attributes); - if (chk.Font.BaseFont != null && chk.Font.BaseFont.PostscriptFontName.ToUpper().Contains("BOLD")) - { - prefix += "\xD5"; - suffix = "\xD6" + suffix; - } - if (chk.Attributes.ContainsKey("SUBSUPSCRIPT")) - { - float sup = (float)(chk.Attributes["SUBSUPSCRIPT"]); - if (sup > 0) - { - prefix += "\xA6"; - suffix = "\xD1" + suffix; - } - else if (sup < 0) - { - prefix += "\xD1"; - suffix = "\xA6" + suffix; - } - - } - if (chk.Attributes.ContainsKey("UNDERLINE")) - { - prefix += "\x16"; - suffix = "\x16" + suffix; ; - } - sb.Append(prefix + chk.Content + suffix); - } - string retval = sb.ToString(); - retval = retval.Replace("\xD1\xA6", "");// Remove Multiple Superscript commands in a row - retval = retval.Replace("\xA6\xD1", "");// Remove Multiple Superscript commands in a row - retval = retval.Replace("\xD6\xD5", ""); - retval = retval.Replace("\xD6\x16\xD5", "\x16"); - return retval; - } - } - //private bool _TextDebug = false; //true; this will turn on a writeline with debug in DrawText() - private float DrawFigure(PdfContentByte cb, float yBottomMargin, float yLocation, float yPageStart, float yTopMargin) - { - int profileDepth = ProfileTimer.Push("vlnParagraph.DrawFigure"); - float retval = yLocation; - if (ImageText != null) - { - if (ImageText == "figure") - { - ImageConfig ic = new ImageConfig(MyItemInfo.MyContent.MyImage); - // B2016-277: add a try catch in case of there being 'bad' data in the text field for an image/figure - try - { - byte[] idata = (ic != null && ic.Image_DataSize > 0) ? ROImageInfo.Decompress(MyItemInfo.MyContent.MyImage.Data, ic.Image_DataSize) : MyItemInfo.MyContent.MyImage.Data; - MemoryStream ms = new MemoryStream(idata); - System.Drawing.Image img = System.Drawing.Image.FromStream(ms); - Width = img.Width; - Height = img.Height; - if (ic != null && ic.Image_Height != 0) - { - Width = ic.Image_Width; - Height = ic.Image_Height; - } - iTextSharp.text.Image it_image = iTextSharp.text.Image.GetInstance(idata); - retval = Rtf2Pdf.FigureAt(cb, it_image, XOffset + MyItemInfo.FormatStepData.Font.CharsToTwips, yLocation, Width * MyPageHelper.YMultiplier, Height * MyPageHelper.YMultiplier, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless")); - } - catch - { - retval += SixLinesPerInch; - } - } - else - { - string[] vals = ImageText.Split("\n".ToCharArray()); - ProcedureInfo proc = MyItemInfo.MyProcedure; - DocVersionInfo dvi = proc.ActiveParent as DocVersionInfo; - ROFstInfo rofst = dvi.DocVersionAssociations[0].MyROFst; - ROImageInfo roImage = ROImageInfo.GetByROFstID_FileName(rofst.ROFstID, vals[0]); - if (roImage == null) roImage = rofst.GetROImageByFilename(vals[0], MyItemInfo);// need code to go and get an ROImaage if it exists - if (roImage != null) - { - ROImageConfig rc = new ROImageConfig(roImage); - int size = Convert.ToInt32(rc.Image_Size); - byte[] cnt = roImage.Content; - byte[] dcnt = ROImageInfo.Decompress(cnt, size); - iTextSharp.text.Image it_image = null; - try - { - it_image = iTextSharp.text.Image.GetInstance(dcnt); - } - catch - { - MemoryStream ms = new MemoryStream(dcnt); - System.Drawing.Bitmap bm = new System.Drawing.Bitmap(ms); - using (MemoryStream ms2 = new MemoryStream()) - { - bm.Save(ms2, System.Drawing.Imaging.ImageFormat.Png); - ms2.Seek(0, SeekOrigin.Begin); - byte[] newdcnt = new byte[ms2.Length]; - ms2.Read(newdcnt, 0, (int)ms2.Length); - try - { - it_image = iTextSharp.text.Image.GetInstance(newdcnt); - } - catch (Exception ex) - { - _MyLog.Error(string.Format("{0}", roImage.FileName), ex); - return yLocation; - } - } - } - StepConfig sc = new StepConfig(MyItemInfo as StepInfo); - if (sc != null && sc.Step_ImageWidth != 0) - { - Width = sc.Step_ImageWidth; - Height = sc.Step_ImageHeight; - } - retval = Rtf2Pdf.FigureAt(cb, it_image, XOffset + MyItemInfo.FormatStepData.Font.CharsToTwips, yLocation, Width * MyPageHelper.YMultiplier, Height * MyPageHelper.YMultiplier, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless")); - } - } - // The following code was added to fix B2016-219 (for VCS, the centerline drew through a figure). The 'top' value was taken from the code - // that draws the vlnBoxes (Caution/Note, etc) - // The adjustments, adjtop & adjbottom, were necessary to get the vertical centerline to meet up correctly with the top/bottom of the figure. These - // numbers were determined by trial and error. - - // only add gap if centered, i.e. in 2 column mode & table is centered - if (MyItemInfo.ColumnMode > 0 && (!MyItemInfo.FormatStepData.Type.Contains("AER") && !MyItemInfo.IsInRNO)) - { - float top = CalculateYOffset(yPageStart, yTopMargin) - (7 * MyPageHelper.YMultiplier); - float adjtop = 0; - float adjbottom = 0; - if (MyPageHelper.YMultiplier == 1) - adjtop = -3; - else - adjbottom = -1; - MyPageHelper.MyGaps.Add(new Gap(top + adjtop, top - Height - Rtf2Pdf.Offset.Y + adjbottom)); - } - } - ProfileTimer.Pop(profileDepth); - return retval; - } - private string DebugInfo - { - get - { - if (!Rtf2Pdf.PdfDebug) return "No Path"; - int profileDepth = ProfileTimer.Push(">>>> vlnParagraph.DebugInfo"); - string retval = string.Format("DebugID = {0}, ID={1} Type={2} TypeName='{3}' StepLevel={4} ShortPath={5} Width={6} Left={7} YOffset={8}", - DebugId, MyItemInfo.ItemID, MyItemInfo.FormatStepType, MyItemInfo.FormatStepData == null ? "NoStepData" : MyItemInfo.FormatStepData.Type, MyItemInfo.StepLevel, MyItemInfo.ShortPath, Width, XOffset, YOffset); - ProfileTimer.Pop(profileDepth); - return retval; - } - } - private void ResetDocStyleAndValues(ref float yTopMargin, ref float yBottomMargin) - { - float _PointsPerPage = 792; - // if this document style has another style that is for pages other than first, we need to - // reset the document style off of this section AND reset docstyle values used. - if ((MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Where & E_DocStyleUse.UseOnFirstPage) > 0) - { - ItemInfo ii = (ItemInfo)MyItemInfo.MyActiveSection; - int indx = (int)MyItemInfo.MyActiveSection.MyDocStyle.IndexOtherThanFirstPage; - foreach (DocStyle ds in ii.ActiveFormat.PlantFormat.DocStyles.DocStyleList) - { - if (ds.Index == indx) - { - MyItemInfo.MyActiveSection.MyDocStyle = ds; - MyPageHelper.MySection = MyItemInfo.MyActiveSection as SectionInfo; - MyPageHelper.MySection.MyDocStyle = ds; - MyPageHelper.ResetSvg(); - break; - } - } - MyPageHelper.DidFirstPageDocStyle = true; - if (DebugPagination.IsOpen) DebugPagination.WriteLine("ResetDocStyleAndValues"); - MyPageHelper.MySection = (SectionInfo)MyItemInfo.MyActiveSection; - yTopMargin = _PointsPerPage - (float)MyItemInfo.MyActiveSection.MyDocStyle.Layout.TopMargin; - yBottomMargin = Math.Max(0, yTopMargin - (float)MyItemInfo.MyActiveSection.MyDocStyle.Layout.PageLength); - } - else if (MyPageHelper.PrintedSectionPage > 0) - { - MyPageHelper.ResetSvg(); - if ((MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PrintSectOnFirst) == E_DocStructStyle.DSS_PrintSectOnFirst) - { - yTopMargin = _PointsPerPage - (float)MyItemInfo.MyActiveSection.MyDocStyle.Layout.TopMargin + MyPageHelper.PrintedSectionPage; - MyPageHelper.YTopMargin = yTopMargin; - yBottomMargin = Math.Max(0, _PointsPerPage - (float)MyItemInfo.MyActiveSection.MyDocStyle.Layout.TopMargin - (float)MyItemInfo.MyActiveSection.MyDocStyle.Layout.PageLength); - } - } - - } - private string GetSectCombinedTab(ItemInfo tmp) - { - ItemInfo itemInfo = tmp; - if (itemInfo.IsCautionOrNotePart) itemInfo = itemInfo.ActiveParent as ItemInfo; // if caution/note get to its associated step - itemInfo = itemInfo.ActiveParent as ItemInfo; // don't want this one in the combined tab, start at parent - if (!itemInfo.IsHigh && !itemInfo.IsSequential && !itemInfo.IsSection) itemInfo = itemInfo.ActiveParent as ItemInfo; - string prTab = ""; - string thisTab = itemInfo.MyTab.CleanText.Trim(); - if (!itemInfo.IsSection || itemInfo.IsSeparateSubsection) - { - ItemInfo mypar = itemInfo.MyParent; - while (mypar != null && !mypar.IsProcedure) - { - // The following check was added for BGE/OI34. Their APPENDIX sections had the subsections - // printing with incorrect tab in the SectionTitleContinued message. Before this - // fix the tabs were A.B Procedure (Continued) rather than B. Procedure (Continued). - // Unfortunately there was not enough time to make the 'if' statement based on config - // or format settings. - bool addTab = true; - if (mypar.IsSection && mypar.DisplayNumber.ToUpper().Contains("APPENDIX ")) - { - SectionConfig sch = mypar.MyConfig as SectionConfig; - addTab = (sch == null || sch.Section_PrintHdr == "Y");// && !mypar.MyDocStyle.CancelSectTitle; - } - if (addTab) - { - string pTab = mypar.MyTab.CleanText.Trim(); - if (pTab.Length > 0 && char.IsLetterOrDigit(pTab[0])) - { - pTab = pTab.TrimEnd(" .".ToCharArray()) + "."; - prTab = pTab + prTab; - } - else - { - // There' a bullet or some other graphics character. - // clear out the tab we are building so the we can build - // a continue tab up to this bullet or graphic character. - prTab = ""; - thisTab = ""; - } - } - mypar = (mypar.IsSection && !mypar.IsSeparateSubsection) ? null : mypar.MyParent; - } - } - return (prTab + thisTab.Trim()).TrimEnd(".".ToCharArray()); - } - private static bool DoSubs = true; // flag whether to print substeps (don't if doing continued checklist header) - protected float _ContinueHeight=0; - public virtual float ContinueHeight - { - get - { - int profileDepth = ProfileTimer.Push(">>>> vlnPrintObject.ContinueHeight"); - if (_ContinueHeight == 0 - && MyItemInfo.MyDocStyle.Continue.Top.Message != null - && MyItemInfo.MyDocStyle.Continue.Top.Message.Contains("%s") - && MyItemInfo.MyDocStyle.Continue.Top.Message.ToUpper().EndsWith(" (Continued)".ToUpper())) - { - string suffix = MyItemInfo.MyDocStyle.Continue.Top.Message.Replace("%sR","").Replace("%s",""); - _ContinueHeight = GetParagraphHeight(MyContentByte, IParagraph, suffix, Width); - } - ProfileTimer.Pop(profileDepth); - return _ContinueHeight; - } - set { _Height = value; } - } - public override float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin) - { - int profileDepth = ProfileTimer.Push(">>>> vlnParagraph.ToPdf"); - if (MyItemInfo.IsFootnote && Processed) - { - ProfileTimer.Pop(profileDepth); - return yPageStart; - } - if (MyItemInfo.IsInSupInfo) // if generating the pdf for supinfos (facing page) pdf, need a different cb to go to that file. - { - MyContentByte = cb; - MyPageHelper = null; - } - bool doThreeContinues = false; - // For BGE, the very first subsection's pagelist items were not correct - the section/meta section titles were - // at the wrong level. Reset the page helper's section. - if (MyItemInfo.IsStepSection) - { - if (MyItemInfo.IsSection && MyItemInfo.MyPrevious == null && MyItemInfo.MyParent.IsSection && !MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseWestinghouse) - { - // don't do the following for the WCN training format: - // if parent was continuous & this is separate, don't reset document style to subsection (next page) type - // this was putting incorrect pagelist item on parent section's page. This occurred in BGE/OI3 set/OI-7 procedure/10.0 Attachments. - if (!MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining && (MyParent.MyItemInfo as SectionInfo).IsSeparatePagination() || !(MyItemInfo as SectionInfo).IsSeparatePagination()) - { - MyPageHelper.MySection = MyItemInfo as SectionInfo; - MyPageHelper.ResetSvg(); - } - } - } - // For Calvert Alarms: A macro exists around the CONDITION/RESPONSE portion. If the page break occurs so that - // this 'table' moved to the following page AND there is an associated note/caution that is not on the next page, - // remove the macro so that the header macro doesn't print on the page with the note (without this, an extraneous - // header for the 'table'is printed. - if (PartsLeft.Count != 0 && (PartsLeft[0] is vlnMacro) && MyPageHelper.ParaBreaks.Count != 0 && MyPageHelper.ParaBreaks[0].MyItemInfo.MyPrevious == null) - if (!MyPageHelper.ParaBreaks[0].MyItemInfo.IsNote && !MyPageHelper.ParaBreaks[0].MyItemInfo.IsCaution) - { - // Only clear the header if it is the first child below - if (ChildrenBelow[0].MyItemInfo.ItemID == MyPageHelper.ParaBreaks[0].MyItemInfo.ItemID) - PartsLeft.Clear(); - //else - // _MyLog.WarnFormat("Would Have Cleared PageHeader '{0}','{1}'", MyItemInfo.MyProcedure.DisplayNumber, MyItemInfo.MyHLS.DisplayText); - } - if (IsWordDocPara) - { - SectionInfo si = SectionInfo.Get(MyItemInfo.ItemID); - //Changing this caused Header issues for FNP FNP-1-FRP-1.3 Attachment 3 (Word Sub-Sections) - //SectionInfo si1 = MyItemInfo.GetSectionInfo(); - //CompareSectionInfo(si, si1); - MyPromsPrinter.NewPage(true); - //_MyLog.InfoFormat("NewPage 9 {0}", cb.PdfWriter.CurrentPageNumber); - // Add Bookmark for Word Subsections - MyPageHelper.PageBookmarks.Add(si, ((si.DisplayNumber ?? "") == "" ? "" : si.DisplayNumber + " - ") + si.DisplayText, null); - MyPageHelper.MyPromsPrinter.CreateWordDocPdf(cb, si); - Processed = true; - { - ProfileTimer.Pop(profileDepth); - return yPageStart; - } - } - float yLocalypagestart = yPageStart; - // yPageStart is offset into roll; YTopMost is offset of topmost of this paragraph. - float yLocation = yPageStart - YTopMost; - - // If this document style has a pagelist item with a continue (some IP2BCK docstyles), clear - // out the variable that flags a continue message - MyPageHelper.OldTemplateContMsg = false; - - if(DebugText.IsOpen) DebugText.WriteLine("ToPdf1:{0},'{1}',{2},{3},{4},{5}", MyItemInfo.ItemID, MyItemInfo.ShortPath, XOffset, yLocation, yPageStart, YTopMost); - int profileDepth1 = ProfileTimer.Push(">>>> vlnParagraph.Paginate"); - int paginate = Paginate(yLocation, yTopMargin, yBottomMargin); - ProfileTimer.Pop(profileDepth1); - bool firstHighLevelStep = MyItemInfo.IsHigh && (MyItemInfo.MyPrevious == null); - bool doSectionTitleContinued = false; // will add " Continued" to the section title if format flag is set - DocStyle docstyle = null; - // If SAMG facing page print & doing first pass to generate page break list of supplemental info and - // there was a page break in the step section, but not an associated supinfo item, do the page break when the - // next supinfo item is found: - SectionInfo supInfoSect = MyItemInfo.MyActiveSection as SectionInfo; - if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks && MyPromsPrinter.NeedSupInfoBreak && MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) - { - supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID); - MyPromsPrinter.NeedSupInfoBreak = false; - } - switch (paginate) - { - // .oooooo. .oooo. - // d8P' `Y8b d8P'`Y8b - // 888 .oooo. .oooo.o .ooooo. 888 888 - // 888 `P )88b d88( "8 d88' `88b 888 888 - // 888 .oP"888 `"Y88b. 888ooo888 888 888 - // `88b ooo d8( 888 o. )88b 888 .o `88b d88' - // `Y8bood8P' `Y888""8o 8""888P' `Y8bod8P' `Y8bd8P' - case 0: // No page break - if (MyItemInfo.IsSection) - { - SectionInfo si = MyItemInfo as SectionInfo; - MyPageHelper.PageBookmarks.Add(MyItemInfo, ((si.DisplayNumber ?? "") == "" ? "" : si.DisplayNumber + " - ") + si.DisplayText, null); - DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); - } - // SupInfo has its own pagination and ylocation handling, reset ypagestart & ylocation if continuing on current page. - // The value used was saved when the previous SupInfo step was printed. - if (MyItemInfo.IsSupInfoPart) - { - yPageStart = _yPageStartForSupInfo - SixLinesPerInch; - yLocation = yPageStart - YTopMost; - } - // printing a procedure with section(s) that have supplemental information - determine facing page needed to be merged in: - if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && !MyItemInfo.IsSection && MyItemInfo.IsHigh && MyItemInfo.MyPrevious == null && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyActiveSection as SectionInfo).HasSupInfoSteps) - { - int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID); - if (sid != -1) - { - MyPromsPrinter.DoSupInfoPage(cb, "TEMP", MyPageHelper.TextLayer, MyPageHelper, sid, true); - } - else - { - MyPageHelper.OnBlankPage = true; - cb.PdfDocument.Add(new iTextSharp.text.Table(1)); - MyPromsPrinter.NewPage(); - } - } - if (MyItemInfo.IsHigh && MyItemInfo.MyPrevious != null && ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS)) - yPageStart -= SixLinesPerInch; - if (MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].CompressFirstPartOfStep) - MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch; - if(CompressFoldout) - MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch; - - ///else - /// MyPageHelper.YMultiplier = 1; - break; - // .oooooo. .o - // d8P' `Y8b o888 - //888 .oooo. .oooo.o .ooooo. 888 - //888 `P )88b d88( "8 d88' `88b 888 - //888 .oP"888 `"Y88b. 888ooo888 888 - //`88b ooo d8( 888 o. )88b 888 .o 888 - // `Y8bood8P' `Y888""8o 8""888P' `Y8bod8P' o888o - case 1: // Break on High Level Step - if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks) - { - // page break here, determine if there is caution/note above where the page break actually needs to go: - int aboveSupinfoId = ChildrenAboveHaveSupInfo(); - if (MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0 && aboveSupinfoId > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(aboveSupinfoId); - else if (MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID); - else MyPromsPrinter.NeedSupInfoBreak = true; - supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID); - } - YTopMost=OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); - docstyle = MyItemInfo.MyDocStyle; - if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0) MyPageHelper.NotesToFootNotesYoffset = CalculateYLocation(yLocation, yTopMargin); - bool doSectionContinue = !MyItemInfo.IsSection && ((docstyle.StructureStyle.Style & E_DocStructStyle.BottomSectionContinue) == E_DocStructStyle.BottomSectionContinue); - if (doSectionContinue) DoBottomContinueMsg(cb, yBottomMargin, yLocation, docstyle, false); - MyPromsPrinter.NewPage(); - //_MyLog.InfoFormat("NewPage 10 {0}", cb.PdfWriter.CurrentPageNumber); - if (MyItemInfo.IsSection && MyParent != null && MyParent.MyItemInfo.IsSection && (MyItemInfo as SectionInfo).IsSeparatePagination()) - { - RefreshDocStyle(); - yTopMargin = 792 - (float)MyItemInfo.MyActiveSection.MyDocStyle.Layout.TopMargin; - yBottomMargin = Math.Max(0, yTopMargin - (float)MyItemInfo.MyActiveSection.MyDocStyle.Layout.PageLength); - yPageStart = yTopMargin; - } - else if (MyItemInfo.IsSection || (MyItemInfo.IsHigh && MyItemInfo.MyPrevious != null)) //do not reset for 1st step - { - //Console.WriteLine("'b1',{0},'{1}',{2},{3},{4},{5},{6}", MyItemInfo.ItemID, MyItemInfo.ShortPath, yTopMargin, yPageStart, yLocation, YTopMost, YOffset); - ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin); - //Console.WriteLine("'a1',{0},'{1}',{2},{3},{4},{5},{6}", MyItemInfo.ItemID, MyItemInfo.ShortPath, yTopMargin, yPageStart, yLocation, YTopMost, YOffset); - } - DebugText.WriteLine("Paginate1"); - if (MyItemInfo.IsSection) - { - SectionInfo si = MyItemInfo as SectionInfo; - MyPageHelper.PageBookmarks.Add(MyItemInfo, ((si.DisplayNumber ?? "") == "" ? "" : si.DisplayNumber + " - ") + si.DisplayText, null); - - } - // Only do foldout page if not done for section break, i.e. check the there's a previous step. - if (MyItemInfo.MyPrevious != null && MyItemInfo.FoldoutIndex() > -1) - MyPromsPrinter.DoFoldoutPage(cb, "HLS", MyPageHelper.TextLayer, MyPageHelper, MyItemInfo.FoldoutIndex(), false); - else if (PromsPrinter.MyFoldoutReader.Count > 0 && MyPageHelper.MyPromsPrinter.InsertBlankPages) - { - // insert a blank page if this step section had a foldout associated and the checkbox - // on the print dialog, to add blank pages, is checked AND the page did NOT have a - // preceeding foldout. - if (MyItemInfo.FoldoutIndex() <= -1) - { - MyPageHelper.OnBlankPage = true; - cb.PdfDocument.Add(new iTextSharp.text.Table(1)); - MyPromsPrinter.NewPage(); - //_MyLog.InfoFormat("NewPage 10 blank {0}", cb.PdfWriter.CurrentPageNumber); - } - } - // If there is supplemental information to be printed on the facing page, then get the id that has supinfo - // so that it can be retrieved from the pdf for the supinfos for this section. If there is one, - // use DoSupInfoPage to put out the page, otherwise do a blank page. - if (MyPromsPrinter.SupInfoPrintType==E_SupInfoPrintType.Merge && !MyItemInfo.IsSection && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyActiveSection as SectionInfo).HasSupInfoSteps) - { - int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID); - if (sid != -1) - { - MyPromsPrinter.DoSupInfoPage(cb, "TEMP", MyPageHelper.TextLayer, MyPageHelper, sid, true); - } - else - { - MyPageHelper.OnBlankPage = true; - cb.PdfDocument.Add(new iTextSharp.text.Table(1)); - MyPromsPrinter.NewPage(); - } - } - if (MyItemInfo.MyDocStyle.LandscapePageList) - { - System.Drawing.Drawing2D.Matrix myMatrix = new System.Drawing.Drawing2D.Matrix(0, 1, -1, 0, cb.PdfDocument.PageSize.Height, 0); - cb.Transform(myMatrix); - } - yPageStart = yTopMargin + YTopMost; - DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); - SectionTopMessage(cb, yTopMargin, yLocation); // does wcntraining & suppinfo section title - if (MyPageHelper.CreatingSupInfoPage) yPageStart -= (2 * SixLinesPerInch); - if (doSectionContinue ) DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle , null); - // If "ContinueSectionHeader" (format flag) is true then print the section title with "(Continued)" appended to it - if (!MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader && (!MyItemInfo.IsSection || MyItemInfo.IsSeparateSubsection)) - { - SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig; - doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle; - } - - if (MyPageHelper.ParaBreaks.Count > 0 && MyPageHelper.ParaBreaks[0].CompressFirstPartOfStep) - MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch; - else - MyPageHelper.YMultiplier = 1; - break; - // .oooooo. .oooo. - // d8P' `Y8b .dP""Y88b - // 888 .oooo. .oooo.o .ooooo. ]8P' - // 888 `P )88b d88( "8 d88' `88b .d8P' - // 888 .oP"888 `"Y88b. 888ooo888 .dP' - // `88b ooo d8( 888 o. )88b 888 .o .oP .o - // `Y8bood8P' `Y888""8o 8""888P' `Y8bod8P' 8888888888 - case 2: // Break within a Step' - if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks) - { - if (MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID); - else MyPromsPrinter.NeedSupInfoBreak = true; - supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID); - } - YTopMost=OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); - docstyle = MyItemInfo.MyDocStyle; - bool doAlarmBox = false; - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) - { - { - // Recognize that the break occurred WITHIN the CONDITION/RESPONSE table. - // Otherwise, we get extraneous header/top of box lines in pdf. - if (MyPageHelper.AlarmYoffStart > 0) - { - // if the first step in box is what broke to next page, then - // don't print the box on this page, only print it on next page: - doAlarmBox = true; - if (MyItemInfo.MyPrevious == null && MyParent.HasCalvertMacro) - MyPageHelper.AlarmYoffStart = 0; - else if (MyPageHelper.AlarmYoffEnd == 0) - { - // doThreeContinues flags when continue messages are printed in the - // bottom of the CONDITION/RESPONSE table columns. - doThreeContinues = MyItemInfo.StepLevel > 1; - MyPageHelper.AlarmYoffEnd = CalculateYLocation(yLocation, yTopMargin); - } - else if (MyPageHelper.AlarmYoffEnd > 0) - doAlarmBox = false; - - } - } - } - if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0) MyPageHelper.NotesToFootNotesYoffset = CalculateYLocation(yLocation, yTopMargin); - DoBottomContinueMsg(cb, yBottomMargin, yLocation, docstyle, doThreeContinues); - MyPromsPrinter.NewPage(); - if (MyItemInfo.IsStep && ((MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)) - { - // check if parent (can be HLS, Caution or Note) has the UseOldTemplate. If so, - // flag that a continue message should be printed as part of a pagelist header (if pagelist - // has CM: page list item) - ItemInfo itm = MyItemInfo; - while (itm.IsStep && !itm.FormatStepData.UseOldTemplate) itm = itm.MyParent; - // don't put out continue if the page break item is the same as background step item (caution/note or hls) - if (itm.IsStep && itm.ItemID != MyItemInfo.ItemID) - { - MyPageHelper.OldTemplateContMsg = true; - MyPageHelper.ResetSvg(); - } - } - //_MyLog.InfoFormat("NewPage 11 {0}", cb.PdfWriter.CurrentPageNumber); - //Console.WriteLine("'b2',{0},'{1}',{2},{3},{4},{5},{6}", MyItemInfo.ItemID, MyItemInfo.ShortPath, yTopMargin, yPageStart, yLocation, YTopMost, YOffset); - ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin); - //Console.WriteLine("'a2',{0},'{1}',{2},{3},{4},{5},{6}", MyItemInfo.ItemID, MyItemInfo.ShortPath, yTopMargin, yPageStart, yLocation, YTopMost, YOffset); - - DebugText.WriteLine("Paginate2"); - if (MyItemInfo.MyHLS.FoldoutIndex() > -1) - MyPromsPrinter.DoFoldoutPage(cb, "Break within Step", MyPageHelper.TextLayer, MyPageHelper, MyItemInfo.MyHLS.FoldoutIndex(), false); // temporary foldout - else if (PromsPrinter.MyFoldoutReader.Count > 0 && MyPageHelper.MyPromsPrinter.InsertBlankPages) - { - MyPageHelper.OnBlankPage = true; - cb.PdfDocument.Add(new iTextSharp.text.Table(1)); - MyPromsPrinter.NewPage(); - _MyLog.InfoFormat("NewPage Break within step blank {0}", cb.PdfWriter.CurrentPageNumber); - } - if (!MyItemInfo.IsSection && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyActiveSection as SectionInfo).HasSupInfoSteps) - { - int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID); - if (sid != -1) - { - MyPromsPrinter.DoSupInfoPage(cb, "TEMP", MyPageHelper.TextLayer, MyPageHelper, sid, true); - } - else - { - MyPageHelper.OnBlankPage = true; - cb.PdfDocument.Add(new iTextSharp.text.Table(1)); - MyPromsPrinter.NewPage(); - } - } - // if there is a 'container vlnbox' around the HLS, flag that the drawn box must also break: - if (MyHighLevelParagraph != null && MyHighLevelParagraph.PartsContainer != null && MyHighLevelParagraph.PartsContainer.Count > 0 && - !((MyHighLevelParagraph.MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS)) - { - foreach (vlnPrintObject vpo in MyHighLevelParagraph.PartsContainer) - { - vlnBox vb = vpo as vlnBox; - if (vb != null) - { - vb.ContainsPageBreak = true; - PartsContainer.Add(vb); - } - } - } - - // If there is a box, adjust the yTopMost to include it. - float yTopMost = YTopMost; - if ((MyItemInfo.IsCautionPart || MyItemInfo.IsNotePart) && MyParent.PartsAbove.Count > 0) - yTopMost = MyParent.PartsAbove[0].YOffset; - yTopMost = Math.Min(yTopMost, YVeryTop); - yPageStart = yTopMargin + yTopMost;// -2 * SixLinesPerInch; - DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); - if (EmptyTopMostPart) yPageStart += SixLinesPerInch; - bool addExtraLines = false; - // If "ContinueSectionHeader" (format flag) is true then print the section title with "(Continued)" appended to it - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader) - { - // if this is calvert OI/STP, then also check that docstyle has a top continue message - // in the document style that includes 'Continued' - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) - { - string myMsg = MyItemInfo.MyDocStyle.Continue.Top.Message; - if (myMsg == null || myMsg == "") - { - // There is no message, but still need to check if there is a Section Title Continued message: - // This was added for BGE OI34 (if break was within step, no section title continue message was printed) - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader) - { - SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig; - doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle; - } - else - doSectionTitleContinued = false; - } - else - { - SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig; - doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle; - } - } - else - { - SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig; - doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle; - } - } - addExtraLines = SectionTopMessage(cb, yTopMargin, yLocation); // this does wcntraining top section continue message and supplemental info message - if (MyPageHelper.CreatingSupInfoPage) yPageStart -= (2 * SixLinesPerInch); - if (!addExtraLines && (!doSectionTitleContinued || !SectionShowTitles)) - addExtraLines = DoTopContinueMsg(cb, ref yPageStart, yTopMargin, docstyle, doThreeContinues && MyItemInfo.MyParent != null && MyItemInfo.MyParent.MyTab != null ? MyItemInfo.MyParent.MyTab.CleanText : null); - - if (CompressPartOfStep) - { - MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch; - CompressPartOfStep = false; - } - else - MyPageHelper.YMultiplier = 1; - - // For Calvert Alarms, if there was a page break and there is an box around the current - // step, need to add the header for the box, which is stored in a macro. Also set the - // 'AlarmYoffStart' value to where the vertical lines of the box start on this page. - if (doAlarmBox && MyItemInfo.StepLevel > 1) - { - float alrmY = CalculateYOffset(yPageStart, yTopMargin); - float macroY = addExtraLines ? YOffset - (6 * SixLinesPerInch) : YOffset - (4 * SixLinesPerInch); - PartsLeft.Add(new vlnMacro((float)docstyle.Layout.LeftMargin - 12, macroY, "H4")); - MyPageHelper.AlarmYoffStart = alrmY - SixLinesPerInch; - yPageStart -= (4 * SixLinesPerInch); - } - // For Calvert Alarms, if there is no box & this is top of page, if previous step - // had box (macro), adjust up page. The constructor (vlnParagraph), inserted these - // lines after the box so that the following text did not print right next to box. - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) - { - if (MyItemInfo.MyPrevious != null && MyItemInfo.MyPrevious.TemplateIndex > 0 && MyItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[MyItemInfo.MyPrevious.TemplateIndex].hmacro > 0) - yPageStart += (3 * SixLinesPerInch); - } - // Now check if this is a template type step & if so, add the HLS's prefix/suffix to it. - // Since the entire checklist HLS (checklist table header) is printed as part of the - // continue, create a new paragraph to handle pagination and printing. - if (MyItemInfo.MyHLS != null && MyItemInfo.MyHLS.FormatStepData.UseSmartTemplate) - { - DoSubs = false; - vlnParagraph smartPara = new vlnParagraph(MyParent.MyParent, cb, MyItemInfo.MyHLS, MyParent.XOffset, yPageStart, 0, 0, MyParent.MyItemInfo.ActiveFormat, null, " (Continued)", 0,false, MyPromsPrinter); - smartPara.PrintHeader = true; - float mytmpfloat = smartPara.ParagraphToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - yPageStart -= smartPara.Height; - DoSubs = true; - } - if (addExtraLines) yPageStart -= (2 * SixLinesPerInch); - if (MyItemInfo.IsRNOPart && MyItemInfo.FormatStepData.DoubleSpace && MyItemInfo.FormatStepData.SpaceDouble) yPageStart += SixLinesPerInch; - break; - // .oooooo. .oooo. - // d8P' `Y8b .dP""Y88b - // 888 .oooo. .oooo.o .ooooo. ]8P' - // 888 `P )88b d88( "8 d88' `88b <88b. - // 888 .oP"888 `"Y88b. 888ooo888 `88b. - // `88b ooo d8( 888 o. )88b 888 .o o. .88P - // `Y8bood8P' `Y888""8o 8""888P' `Y8bod8P' `8bd88P' - case 3: // Break on High Level Step (SevenLinesPerInch) - if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.DoPageBreaks) - { - if (MyItemInfo.SupInfos != null && MyItemInfo.SupInfos.Count > 0) supInfoSect.StepSectPageBreaksForSupInfo.Add(MyItemInfo.SupInfos[0].ItemID); - else MyPromsPrinter.NeedSupInfoBreak = true; - supInfoSect.StepSectPageBreaks.Add(MyItemInfo.ItemID); - } - if (!firstHighLevelStep) - { - YTopMost=OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); - if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0) MyPageHelper.NotesToFootNotesYoffset = CalculateYLocation(yLocation, yTopMargin); - MyPromsPrinter.NewPage(); // HLS (7 lpi) breakif (MyItemInfo.IsSection) - //_MyLog.InfoFormat("NewPage 12 {0}", cb.PdfWriter.CurrentPageNumber); - //Console.WriteLine("'b3',{0},'{1}',{2},{3},{4},{5},{6}", MyItemInfo.ItemID, MyItemInfo.ShortPath, yTopMargin, yPageStart, yLocation, YTopMost, YOffset); - ResetDocStyleAndValues(ref yTopMargin, ref yBottomMargin); - //Console.WriteLine("'a3',{0},'{1}',{2},{3},{4},{5},{6}", MyItemInfo.ItemID, MyItemInfo.ShortPath, yTopMargin, yPageStart, yLocation, YTopMost, YOffset); - DebugText.WriteLine("Paginate3"); - if (MyItemInfo.IsSection) - { - SectionInfo si = MyItemInfo as SectionInfo; - MyPageHelper.PageBookmarks.Add(MyItemInfo, ((si.DisplayNumber ?? "") == "" ? "" : si.DisplayNumber + " - ") + si.DisplayText, null); - } - if (MyItemInfo.FoldoutIndex() > -1) - MyPromsPrinter.DoFoldoutPage(cb, "HLS (7 lpi) break", MyPageHelper.TextLayer, MyPageHelper, MyItemInfo.FoldoutIndex(), false); - else if (PromsPrinter.MyFoldoutReader.Count > 0 && MyPageHelper.MyPromsPrinter.InsertBlankPages) - { - // insert a blank page if this step section had a foldout associated and the checkbox - // on the print dialog, to add blank pages, is checked - MyPageHelper.OnBlankPage = true; - cb.PdfDocument.Add(new iTextSharp.text.Table(1)); - MyPromsPrinter.NewPage(); - //_MyLog.InfoFormat("NewPage 12 lpi blank {0}", cb.PdfWriter.CurrentPageNumber); - } - // If there is supplemental information to be printed on the facing page, then get the id that has supinfo - // so that it can be retrieved from the pdf for the supinfos for this section. If there is one, - // use DoSupInfoPage to put out the page, otherwise do a blank page. - if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && !MyItemInfo.IsSection && !MyItemInfo.IsInSupInfo && (MyItemInfo.MyActiveSection as SectionInfo).HasSupInfoSteps) - { - int sid = GetIdThatHasSupInfoItems(MyItemInfo, MyItemInfo.ItemID); - if (sid != -1) - { - MyPromsPrinter.DoSupInfoPage(cb, "TEMP", MyPageHelper.TextLayer, MyPageHelper, sid, true); - } - else - { - MyPageHelper.OnBlankPage = true; - cb.PdfDocument.Add(new iTextSharp.text.Table(1)); - MyPromsPrinter.NewPage(); - } - } - if (MyItemInfo.MyDocStyle.LandscapePageList) - { - System.Drawing.Drawing2D.Matrix myMatrix = new System.Drawing.Drawing2D.Matrix(0, 1, -1, 0, cb.PdfDocument.PageSize.Height, 0); - cb.Transform(myMatrix); - } - - // If "ContinueSectionHeader" (format flag) is true then print the section title with "(Continued)" appended to it - if (!MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.ContinueSectionHeader) - { - SectionConfig sch = MyItemInfo.ActiveSection.MyConfig as SectionConfig; - doSectionTitleContinued = (sch == null || sch.Section_PrintHdr == "Y") && !MyItemInfo.MyDocStyle.CancelSectTitle; - } - } - // if printing the section title, we already have the y location (note that only do this for the - // first step in the section. - if (MyItemInfo.MyPrevious == null && MyItemInfo.MyParent != null && MyItemInfo.MyParent.IsStepSection && - ShowSectionTitles - && !MyItemInfo.MyDocStyle.CancelSectTitle - && !MyItemInfo.MyDocStyle.SpecialStepsFoldout) - yPageStart = yPageStart; - else - yPageStart = yTopMargin + YTopMost; - MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch; - DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); - break; - } - // If "doSectionTitleContinued" is true then print the section title with "(Continued)" appended to it - // format must have ContinueSectinHeader format flag set to true - if (doSectionTitleContinued) - { - vlnParagraph sectContPara; - string contMsg = MyItemInfo.MyActiveSection.MyDocStyle.Continue.SectionTitle.AppendToTitle; - // For Calvert, the xoffset will be the highest level sections xoffset (there are metasections, - // don't use their xoffset or the continue message is indented too much) - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) - { - float secContinueTabXoff = (float)MyItemInfo.MyDocStyle.Layout.LeftMargin; - float secContinueXoff = 0f; - float secContinueTabWidth = 0f; - vlnParagraph fndTopSect = this; - while (fndTopSect.MyParent != null) - { - fndTopSect = fndTopSect.MyParent; - } - if (fndTopSect != null && fndTopSect.MyTab != null) - { - secContinueTabXoff = fndTopSect.MyTab.XOffset; - secContinueTabWidth = fndTopSect.MyTab.Width; - secContinueXoff = fndTopSect.XOffset; - } - // get to the correct section for the message, i.e. if on a section, the message should be the parent - // section (not the activesection which is myself); if on a step, the message should be the active section - ItemInfo sectForCont = MyItemInfo.IsSection && MyItemInfo.MyParent.IsSection ? MyItemInfo.MyParent : MyItemInfo.ActiveSection; - sectContPara = new vlnParagraph(MyParent.MyParent, cb, sectForCont, MyParent.XOffset, 0, 0, 0, MyParent.MyItemInfo.ActiveFormat, null, (contMsg == null || contMsg == "") ? " (Continued)" : contMsg, 0, false,MyPromsPrinter); - if (sectContPara.PartsLeft.Count > 0) - { - vlnTab vt = sectContPara.MyTab; - string ctab = GetSectCombinedTab(MyItemInfo); - vt.Rtf = GetRtf(ctab, vt.MyFont); - float wd = vt.GetTextWidth(vt.MyFont, ctab); - vt.XOffset = secContinueTabXoff; - vt.Width = secContinueXoff - secContinueTabXoff; - sectContPara.XOffset = secContinueXoff; - if ((wd + 12) > secContinueXoff - secContinueTabXoff) // 12 is 2 characters - { - float dif = wd + 12 - (secContinueXoff - secContinueTabXoff); - vt.Width += dif; - sectContPara.XOffset += dif; - sectContPara.Width -= dif; - } - - } - float mytmpfloat = sectContPara.ParagraphToPdf(cb, yTopMargin, yTopMargin, yBottomMargin); - if (sectContPara.SectionContinuePrinted) - yPageStart -= sectContPara.Height + SixLinesPerInch; - else - Console.WriteLine("'No Header 1','{0}',{1},{2}",MyItemInfo.ShortPath,MyItemInfo.MyDocStyle.CancelSectTitle,MyItemInfo.MyDocStyle.SpecialStepsFoldout); - } - else - { - sectContPara = new vlnParagraph(MyParent.MyParent, cb, MyItemInfo.ActiveSection, MyParent.XOffset, 0, 0, 0, MyParent.MyItemInfo.ActiveFormat, null, (contMsg == null || contMsg == "") ? " (Continued)" : contMsg, 0, false, MyPromsPrinter); - float mytmpfloat = sectContPara.ParagraphToPdf(cb, yTopMargin, yTopMargin, yBottomMargin); - if (sectContPara.SectionContinuePrinted) - yPageStart -= sectContPara.Height + SixLinesPerInch; - else - Console.WriteLine("'No Header 1','{0}',{1},{2}", MyItemInfo.ShortPath, MyItemInfo.MyDocStyle.CancelSectTitle, MyItemInfo.MyDocStyle.SpecialStepsFoldout); - } - } - - // see if this hls has footnotes, add to the footnote datastructure for processing at end of page. - if (MyItemInfo.IsHigh && MyPageHelper.NotesToFootNotesHLS.ContainsKey(MyItemInfo.ItemID)) AddFootNote(cb); - - yPageStart = ChildrenAbove.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); - yPageStart = ChildrenLeft.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); - - // Handle the PageBreakOnStep flag for a HLS. This will put out the page break right before - // a HLS. One example of this use is for backgrounds (CALBCK). - // 'this' below is a highlevel step, and the only time that ParaBreaks[0] will == 'this' is - // when the PageBreakOnStep flag is true. - if (MyPageHelper.ParaBreaks != null && MyPageHelper.ParaBreaks.Count > 0 && - MyPageHelper.ParaBreaks[0] == this) - { - ShowPageBreak(1, CheckForCompression("PageBreakOnStep/Caution/Note HLS"), "Yes", YTop - YBottomMost, yTopMargin - yBottomMargin, yTopMargin - yBottomMargin, false); - YTopMost=OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); - MyPageHelper.BottomMessage = null; - MyPageHelper.TopMessage = null; - MyPromsPrinter.NewPage(); - if (CompressPartOfStep) - { - MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch; - CompressPartOfStep = false; - } - MyPageHelper.ParaBreaks.RemoveAt(0); - yPageStart = yTopMargin + YTop; - } - // The following sets the beginning/ending y location for the lines around the - // CONDITION/RESPONSE text for Calvert Alarm format - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) - { - int tindx = MyItemInfo.TemplateIndex; - if (tindx >= 0) - { - // save this position to start drawing the alarm box lines around substeps: - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.Templates[MyItemInfo.TemplateIndex].row > 0) - MyPageHelper.AlarmYoffStart = CalculateYOffset(yPageStart, yTopMargin) - SixLinesPerInch; - else if (MyPageHelper.AlarmYoffStart > 0 && MyPageHelper.AlarmYoffEnd == 0) - MyPageHelper.AlarmYoffEnd = CalculateYOffset(yPageStart, yTopMargin) + (2 * SixLinesPerInch); - } - } - int profileDepth2 = ProfileTimer.Push(">>>> vlnParagraph.ParagraphToPdf"); - yPageStart = ParagraphToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - ProfileTimer.Pop(profileDepth2); - // If the yPageStart changes by more than a small amount (pagination) in the RNO (right column), then update - // yPageStart for the AER (left column). - float yPageStartRNO = ChildrenRight.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); - if (yPageStartRNO - yPageStart > 24) // 24 is two lines - yPageStart = yPageStartRNO; - yPageStart = ChildrenBelow.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); - - if (MyItemInfo.IsHigh && MyItemInfo.NextItem == null) // last hls, add the 'end' message, if there is one - { - docstyle = MyItemInfo.MyDocStyle; - // if the EndForSingle format flag is set to false, then we do not print an End message if the section - // is a single column section. - //bool _skipEndMessage = MyPageHelper.MySection.SectionConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.One && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.EndForSingle; - SectionInfo si = MyItemInfo.MyActiveSection as SectionInfo; - bool _skipEndMessage = si.SectionConfig.Section_ColumnMode == SectionConfig.SectionColumnMode.One && !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.EndForSingle; - bool _lastSect = true; - if (si.MyActiveParent.IsSection) // is this meta/subsection. Only put end message out on last section - { - ItemInfo mysect = si as ItemInfo; - if (mysect.NextItem != null && !docstyle.End.EndMessageOnEachSubSection) _lastSect = false; - } - string myMsg = (docstyle.End == null) ? null : docstyle.End.FixedMessage; - if (myMsg != null && !_skipEndMessage && _lastSect) - { - // If the flag is 0 or 1, just put the end message out right below this vlnParagraph: - float msg_yLocation = CalculateYLocation(yPageStart - YBottomMost, yTopMargin); - //if (MyPageHelper.YMultiplier < 1) - // msg_yLocation += 4;// Robinson - if the page is compressed, we need this adjustment. - - // the following is for IP3 - it was commented out so that an update could be put on - // before this was tested. - // if end message has {par}, remove these but add a line for each. - //int parindx = myMsg.IndexOf("{par}"); - //bool foundpar = false; - //while (parindx > -1) - //{ - // foundpar = true; - // msg_yLocation += SixLinesPerInch; - // parindx = myMsg.IndexOf("{par}", parindx + 1); - //} - //if (foundpar) myMsg = myMsg.Replace("{par}", ""); - // use the 'flag' to position the message. - if (docstyle.End.Flag > 2) // >2 position at an absolute location defined by docstyle.End.Flag. - { - msg_yLocation = yTopMargin - (float)(docstyle.End.Flag * SixLinesPerInch); - } - float adjMsgY = 0; - if (docstyle.End.Flag < 0) // Adjust this many lines down the page. - { - adjMsgY = (float)(-docstyle.End.Flag * SixLinesPerInch); - if (msg_yLocation - adjMsgY > docstyle.Layout.FooterLength) msg_yLocation = msg_yLocation - adjMsgY; - } - if (myMsg.Contains("{Section Number}")) myMsg = myMsg.Replace("{Section Number}", MyItemInfo.ActiveSection.DisplayNumber); - //jcb code - //if (myMsg.Contains("%-8s")) - // myMsg = myMsg.Replace("%-8s", MyItemInfo.MyProcedure.DisplayNumber.PadRight(8)); - if (myMsg.Contains("%-12s")) - myMsg = myMsg.Replace("%-12s", MyItemInfo.MyProcedure.DisplayNumber.PadRight(12)); - float xpos = 0; - if (yTopMargin-docstyle.Layout.PageLength>=msg_yLocation && docstyle.End.Message != null && docstyle.End.Message != "" && docstyle.End.Flag<=2) _MyLog.WarnFormat("End Message LOW on page: {0}, {1}, {2}, Page {3}",msg_yLocation, MyItemInfo.ItemID, MyItemInfo.ShortPath, MyPageHelper.CurrentPageNumber+1); - if ((docstyle.End.Margin ?? 0) != 0) - { - xpos = (float)docstyle.Layout.LeftMargin + (float)docstyle.End.Margin; - MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, xpos, msg_yLocation, docstyle.End.Font); - } - else - { // Center the bottom message - float wtpm = (float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin; - xpos = XOffsetBox + (float)docstyle.Layout.LeftMargin + (wtpm - (myMsg.Length * MyItemInfo.FormatStepData.Font.CharsToTwips)) / 2; - xpos = Math.Max(xpos, XOffsetBox + (float)docstyle.Layout.LeftMargin); - MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, xpos, msg_yLocation, docstyle.End.Font); - MyPageHelper.MyGaps.Add(new Gap(msg_yLocation, msg_yLocation - MyPageHelper.BottomMessage.Height)); - yPageStart -= (MyPageHelper.BottomMessage.Height + adjMsgY); - } - } - } - if (yLocalypagestart != yPageStart) DebugText.WriteLine("ToPdf-yPagestartDiff:{0},{1},{2},{3}", MyPageHelper.MyPdfContentByte.PdfWriter.CurrentPageNumber, MyItemInfo.ItemID, yLocalypagestart, yPageStart); - - // if doing NotesToFootnotes (Calvert valve list format), get the bottom location so that - // footnotes will be printed after last text on page. This is used for the end of the section. - // Pages that broke within pagination logic above had footnote location set during pagination code. - if (MyPageHelper.NotesToFootNotes != null && MyPageHelper.NotesToFootNotes.Count > 0) - MyPageHelper.NotesToFootNotesYoffset = CalculateYLocation(yPageStart - YBottomMost, yTopMargin); - ProfileTimer.Pop(profileDepth); - return yPageStart; - } - - private int ChildrenAboveHaveSupInfo() - { - if (ChildrenAbove == null || ChildrenAbove.Count < 1) return -1; - foreach (vlnParagraph p in ChildrenAbove) - { - if (p.MyItemInfo.SupInfos != null && p.MyItemInfo.SupInfos.Count > 0) return p.MyItemInfo.SupInfos[0].ItemID; - } - return -1; - } - // Find the step that has supplemental information from this step down page until a preferred page break is found - // or a regular page break. - // It is used to determine whether there is a supinfo facing page or if there should be a blank page. - private int GetIdThatHasSupInfoItems(ItemInfo ii, int startid) - { - if (ii == null) return -1; - if (ii.SupInfos != null && ii.SupInfos.Count > 0) return ii.SupInfos[0].ItemID; - int id = GetSubThatHasSupInfoItems(ii, startid); - if (id != -1) return id; - ItemInfo sib = ii.NextItem; - while (sib != null) - { - SectionInfo supInfoSect = ii.MyActiveSection as SectionInfo; - if (supInfoSect.StepSectPageBreaks.Contains(sib.ItemID)) return -1; - if (sib.SupInfos != null && sib.SupInfos.Count > 0) return sib.SupInfos[0].ItemID; - id = GetSubThatHasSupInfoItems(sib, startid); - if (id != -1) return id; - sib = sib.NextItem; - } - return -1; - } - private int GetSubThatHasSupInfoItems(ItemInfo ii, int startid) - { - if (ii is StepInfo && ((ii as StepInfo).MyConfig as StepConfig).Step_PreferredPagebreak && ii.ItemID != startid) return -1; - if (ii.MyContent.ContentParts != null) - { - foreach (PartInfo pi in ii.MyContent.ContentParts) - { - if ((E_FromType)pi.FromType != E_FromType.SupInfo) - { - foreach (ItemInfo iic in pi.MyItems) - { - if (iic.SupInfos != null && iic.SupInfos.Count > 0) return iic.SupInfos[0].ItemID; - int id = GetSubThatHasSupInfoItems(iic, startid); - if (id != -1) return id; - } - } - } - } - return -1; - } - private float GetSectionTopMessageSize() - { - // B2016-134: Account for wcntraining section top continue if item has container - float retval = 0; - if (MyItemInfo.MyDocStyle.SectTop != null && MyItemInfo.MyDocStyle.SectTop.Message != null) - { - if (PartsContainer != null && PartsContainer.Count > 0) retval = SixLinesPerInch * 1; - } - return retval; - } - // For WCNTRN (Wolf Creek Training format): the following prints the section number (and continued, if - // section is continued from previous page) in the Responsibility column. - private bool SectionTopMessage(PdfContentByte cb, float yTopMargin, float yLocation) - { - if (MyPageHelper.CreatingSupInfoPage) - { - float scttopWidths = "Supplemental Information".Length * 6; - float ctrs = ((float)MyItemInfo.MyDocStyle.Layout.PageWidth - (float)MyItemInfo.MyDocStyle.Layout.LeftMargin) / 2; - float sctcntrXs = (float)MyItemInfo.MyDocStyle.Layout.LeftMargin + ctrs - (scttopWidths / 2); - VE_Font vf = MyItemInfo.MyDocStyle.Font; - E_Style sty = (E_Style)(vf.Style | E_Style.Underline); - vf = new VE_Font(vf.Family, (int)vf.Size, sty, (float)vf.CPI); - MyPageHelper.TopMessage = new vlnText(cb, this, "Supplemental Information", "Supplemental Information", sctcntrXs, yTopMargin + 0.1F, vf); - return true; - } - bool addextra = false; - if (MyItemInfo.MyDocStyle.SectTop != null && MyItemInfo.MyDocStyle.SectTop.Message != null) - { - float sectMsgY = 0; - if (PartsContainer == null || PartsContainer.Count==0) - sectMsgY = CalculateYLocation(YTop, yTopMargin); - else - { - // B2016-134: Account for section top continue if item has container, i.e. move section top continue message above the container - sectMsgY = CalculateYLocation(YTopMost-(SixLinesPerInch*3), yTopMargin); // 3 is # of lines: header, box, blank line moving up page - addextra = true; - } - VE_Font sctMsgFont = MyItemInfo.MyDocStyle.SectTop.Font; - string scttop = null; - if (!MyItemInfo.IsStepSection && MyItemInfo.MyDocStyle.SectTop.Message != null) - scttop = MyItemInfo.MyDocStyle.SectTop.Message.Replace("%s", (MyItemInfo.ActiveSection as SectionInfo).DisplayNumber); - else - scttop = (MyItemInfo as SectionInfo).DisplayNumber; - float scttopWidth = scttop.Length * 6; - float ctr = (float)MyItemInfo.MyDocStyle.SectTop.Margin; - float sctcntrX = (float)MyItemInfo.MyDocStyle.Layout.LeftMargin + ctr - (scttopWidth / 2); - vlnText mySectMsg = new vlnText(cb, this, scttop, scttop, sctcntrX, sectMsgY, sctMsgFont); - PartsLeft.Add(mySectMsg); - } - return addextra; - } - // Added to try to resolve a problem when printing FNP-1-FRP-I.3 Attachment 3 Table 1. - // May be needed to evaluate this problem in the future. - //private void CompareSectionInfo(SectionInfo si, SectionInfo si1) - //{ - // if (si.ItemID != si1.ItemID) - // Console.WriteLine("Different"); - // if (si.ActiveFormat.FullName != si1.ActiveFormat.FullName) - // Console.WriteLine("Different"); - // if (si.ActiveParent != si1.ActiveParent) - // Console.WriteLine("Different"); - // if (si.ActiveSection.ItemID != si1.ActiveSection.ItemID) - // Console.WriteLine("Different"); - // if (si.MyDocStyle.Name != si1.MyDocStyle.Name) - // Console.WriteLine("Different"); - //} - private void AddFootNote(PdfContentByte cb) - { - // for calvert valve lists footnotes, if there is footnote data, save it for vlnSvgPageHelper - // which puts the footnotes out when page is printed. - List myNotes = MyPageHelper.NotesToFootNotesHLS[MyItemInfo.ItemID]; - foreach (int myNote in myNotes) - { - ItemInfo inote = StepInfo.Get(myNote); - - // first check if this exact text is already in the foot note list. If it is - // in there, don't add it. - bool inlist = false; - if (MyPageHelper.NotesToFootNotes != null) - { - foreach (vlnParagraph vp in MyPageHelper.NotesToFootNotes) - { - if (vp.MyItemInfo.MyContent.Text == inote.MyContent.Text) - { - inlist = true; - break; - } - } - } - if (!inlist) - { - vlnParagraph vpFNote = new vlnParagraph(null, cb, inote, (float)MyItemInfo.MyDocStyle.Layout.LeftMargin, 0, 0, 0, MyItemInfo.ActiveFormat, null, null, 0, false, MyPromsPrinter); - vpFNote.Width = (float)MyItemInfo.MyDocStyle.Layout.PageWidth - (float)MyItemInfo.MyDocStyle.Layout.LeftMargin; - vpFNote.Height = 0; - vpFNote.XOffset = (float)MyItemInfo.MyDocStyle.Layout.LeftMargin; - if (MyPageHelper.NotesToFootNotes == null) MyPageHelper.NotesToFootNotes = new List(); - MyPageHelper.NotesToFootNotes.Add(vpFNote); - } - } - MyPageHelper.NotesToFootNotesHLS.Remove(MyItemInfo.ItemID); - } - private bool DoTopContinueMsg(PdfContentByte cb, ref float yPageStart, float yTopMargin, DocStyle docstyle, string subTab) - { - bool addExtraLine = false; - if ((bool)docstyle.Continue.Top.UseStepTabs) - { - // UseStepTabs is a format flag added for Comanche Peak to print out step tabs as - // a top comtinue message. This code will go up through parents putting out - // their tabs - at this y location, but at the tabs' x location - vlnParagraph myPar = this; - MyPageHelper.TopMessageRs = new List(); - while (!myPar.MyItemInfo.IsHigh) - { - myPar = myPar.MyParent; - foreach (vlnPrintObject vpo in myPar.PartsLeft) - { - if (vpo is vlnTab) - { - vlnTab vt = vpo as vlnTab; - string cltxt = vt.Text; - // Originally the Comache Peak customer did not want the '*'. As of 6/22/15, CP wants the asterisk in continue msg - ///cltxt = cltxt.Replace("*", " "); - // replace C# representation of unicode character "\u25CF" which is hex - // with the rtf representation @"\u9679?" - if (cltxt.Contains("\u25CF")) cltxt = cltxt.Replace("\u25CF", @"\u9679?"); // handle a bullet, if it isn't unicode yet - MyPageHelper.TopMessageRs.Add(new vlnText(cb, this, cltxt, cltxt, vt.XOffset, yTopMargin, vt.MyFont)); - } - else if (vpo is vlnText) // As of 6/22/15, CP wants the step designator in the continue message also. - { - vpo.YOffset = yTopMargin; - int nlcnt = 1; // number of lines to adjust the yoffset for the next step designator we are adding to TopMessageRs - string rtxt = ""; - int istr = 0; - int Rsidx = 0; - MyPageHelper.TopMessageRs.Add(vpo as vlnText); // this appends a previous step designator associated with this sub-step (there may be more than one and/or might have multiple lines) - // we are processing the step designator on the top continue message in reverse order - // we therefore need to adjust the y location of multiple step designors attached tothe top continue message - if (MyPageHelper.TopMessageRs.Count > 3) - { - Rsidx = MyPageHelper.TopMessageRs.Count - 1; - rtxt = MyPageHelper.TopMessageRs[Rsidx].Text; - // find the number of lines to shift existing TopMessageRs step designators down - istr = rtxt.IndexOf("\\line", 0); - while (istr != -1) - { - nlcnt++; - istr = rtxt.IndexOf("\\line", istr + 1); - } - // move the previous TopMessageRs step designators down - Rsidx -= 2; // index to the previous step desginator - while (Rsidx > 0) - { - MyPageHelper.TopMessageRs[Rsidx].YOffset -= (nlcnt * SixLinesPerInch); - Rsidx -= 2;// every other TopMessageRs is a step designator - } - } - // for Comanche Peak - if step breaks on a sub-step, and both the high level step and the sub-step have a step designator - // then since the high level step and its step designator are printed as part of the top continue message, - // move the step designator associated with the sub-step down so that it does not print on top of the - // ones in the top continue message. - if (this.PartsLeft.Count > 1) // was a step designator printed for the sub-step? - { - // count the number of lines in the step designator text in the top continue message - nlcnt = 0; // reset for the number of lines to push the sub-step's step designator down - Rsidx = MyPageHelper.TopMessageRs.Count - 1; // note that TopMessageRs[0] is a tab not a step designator - while (Rsidx > 0) - { - nlcnt++; - rtxt = MyPageHelper.TopMessageRs[Rsidx].Text; - istr = rtxt.IndexOf("\\line", 0); - while (istr != -1) - { - nlcnt++; - istr = rtxt.IndexOf("\\line", istr + 1); - } - Rsidx -= 2; // every other TopMessageRs is a step designator - } - if (nlcnt > 0) - { - for (int idx = 1; idx < this.PartsLeft.Count; idx++) - { - vlnPrintObject vpol = this.PartsLeft[idx]; - vpol.YOffset += (nlcnt * SixLinesPerInch); // move the existing step designator down - } - } - } - } - } - } - return false; - } - - string myMsg = docstyle.Continue.Top.Message; - MyPageHelper.TopMessageRs = new List(); - // bug fix B2106-099 - // when there are more than one Caution/Note off of a high level background step, - // the second, third, etc background Caution/Note pages begin printing two additional lines from the top of the page - // to fix, added a check to see the the item we are printing has the PageBrrakOnStep flag set, if it's set, - // then DON'T add two lines to the yPageStart (for the top conitnue message) - if (myMsg != null && myMsg != "" && !MyItemInfo.FormatStepData.PageBreakOnStep) - { - yPageStart -= 2 * SixLinesPerInch;// Allow two lines for top continue message - if (myMsg.IndexOf(@"%sR") > -1) - { - ItemInfo myAer = MyItemInfo.IsHigh ? MyItemInfo : MyItemInfo.MyParent; - if (MyItemInfo.IsInRNO) - { - // If this is an RNO part, find the parent that is not an RNO (the reason for this is - // that RNO parts are structured as parent/child not sibling relationships, for - // example, RNO part 1.2 is the child of 1.1 not sibling). Also, if this is a caution - // or note of the RNO part, do the same because it should not use the RNO part's tab. - // However, the RNO Part will have the combined tab using its parent because this is - // needed if any of its children, for example substeps, need the combined tab. - if (((MyItemInfo.IsNote || MyItemInfo.IsCaution) && MyItemInfo.MyParent.IsRNOPart) || MyItemInfo.IsRNOPart) - { - ItemInfo ip = MyItemInfo.MyParent; - while (ip.IsRNOPart) ip = ip.MyParent; - myMsg = myMsg.Replace(@"%sR", ip.CombinedTab); - } - - else - myMsg = myMsg.Replace(@"%sR", MyItemInfo.MyParent.CombinedTab); - float xor = MyTopRNO.MyTab.XOffset; - MyPageHelper.TopMessageRs.Add(new vlnText(cb, this, myMsg, myMsg, xor, yTopMargin + 0.1F, docstyle.Continue.Top.Font)); - // get aer message, go up parent until find aer and use its combined tab: - myAer = MyItemInfo; - while (myAer.IsInRNO) myAer = myAer.MyParent; - } - else if (!MyItemInfo.IsHigh && (MyItemInfo.IsNote || MyItemInfo.IsCaution)) - { - ItemInfo ip1 = MyItemInfo.MyParent; - if (!ip1.IsHigh) myAer = ip1.MyParent; - } - myMsg = docstyle.Continue.Top.Message.Replace(@"%sR", myAer.CombinedTab); - } - if (myMsg.IndexOf(@"%s") > -1) - { - if (MyItemInfo.MyParent.IsSection && (docstyle.StructureStyle.Style & E_DocStructStyle.BottomSectionContinue) == E_DocStructStyle.BottomSectionContinue) - myMsg = myMsg.Replace(@"%s", MyItemInfo.MyParent.MyTab.CleanText.Trim()); - else - myMsg = myMsg.Replace(@"%s", MyItemInfo.MyParent.CombinedTab); - } - if (myMsg.IndexOf(@"%3d") > -1) - myMsg = myMsg.Replace(@"%3d", MyItemInfo.MyHLS.Ordinal.ToString()); - if (myMsg.IndexOf(@"%2d") > -1) - myMsg = myMsg.Replace(@"%2d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim(" .".ToCharArray()).PadLeft(2)); - if (myMsg.IndexOf(@"%d") > -1) - myMsg = myMsg.Replace(@"%d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim(" .".ToCharArray())); - if (myMsg.IndexOf(@"%c") > -1) - myMsg = myMsg.Replace(@"%c", " "); - - // Top Continue message includes high level step text - // - was going to use for V.C. Summer but ended up not needing it - // - leaving it here for future use - jsj 10/7/2014 - // - //if ((docstyle.Continue.Top.HLS ?? 0) == 1) - //{ - // string hlsText = ""; - // ItemInfo parentStep = MyItemInfo; - // while (!parentStep.IsHigh && parentStep.MyParent != null && !parentStep.IsSection) parentStep = parentStep.MyParent; - // if (parentStep.IsHigh) hlsText = parentStep.FormattedDisplayText;// .DisplayText; - // myMsg = hlsText + myMsg; - //} - - // Calvert Alarms, step description have the alarm number as part of the top continue message - // Also, if the break is within the CONDITION/RESPONSE, there are continue messages in both columns at the top - // of the table, note that the continue messages WITHIN table are only printed when the - // steplevel is greater than 2 - this is from 16bit. - // NOTE THAT this code is not complete - the positioning & addition of step tab for within table are not working correctly - if ((docstyle.Continue.Top.HLS ?? 0) == 3) - { - MyPageHelper.TopMessageSub1s = new List(); - MyPageHelper.TopMessageSub2s = new List(); - - //string HLSTabTextForContMsg = MyHighLevelParagraph.MyItemInfo.MyTab.CleanText + " " + MyHighLevelParagraph.MyItemInfo.MyContent.Text; - //int len = (HLSTabTextForContMsg.Length - 10) * 6; - string tabText = @"\ul\b " + MyHighLevelParagraph.MyItemInfo.MyTab.CleanText.Trim() + @"\b0\ulnone"; - string stepText = @"\b " + MyHighLevelParagraph.MyItemInfo.MyContent.Text + @"\b0"; - //HLSTabTextForContMsg = @"\ul\b " + MyHighLevelParagraph.MyItemInfo.MyTab.CleanText.Trim() + @"\b0\ulnone \b " + MyHighLevelParagraph.MyItemInfo.MyContent.Text + @"\b0"; - vlnText vt1 = new vlnText(cb, this, tabText, tabText, MyHighLevelParagraph.MyTab.XOffset, yTopMargin + 0.1F, docstyle.Continue.Top.Font); - vt1.Width = MyHighLevelParagraph.MyTab.Width; - MyPageHelper.TopMessageRs.Add(vt1); - vlnText vt2 = new vlnText(cb, this, stepText, stepText, MyHighLevelParagraph.XOffset, yTopMargin + 0.1F, docstyle.Continue.Top.Font); - vt2.Width = MyHighLevelParagraph.Width; - MyPageHelper.TopMessageRs.Add(vt2); - - // the following code is used to print the top continue messages in the Calvert Alarm format - // CONDITION/RESPONSE table. Messages only get printed if the break is on a substep at steplevel > 2. - // see comments within code for what the tab contains, it varies depending on which side - // break occurred & how deep in the step the break occurred. - if (subTab != null && MyItemInfo.StepLevel > 2) { - bool incond = !MyItemInfo.IsInRNO; - float ybot = yTopMargin + (4 * SixLinesPerInch); - string concatrnoTab = ""; // constructed tab for Response side - string concataerTab = ""; // constructed tab for Condition side - float xoffTab = 0; // position for Response tab - float xoffMsg = 0; // position for Response message - vlnParagraph useAerParaForTab = null; // use this paragraph under Conditions for locating tab & message - if (incond) - { - // If break is in Condition side of table, use Condition tab of parent & no tab for Response side. - // Both sides have the message '(continued)'. - useAerParaForTab = MyParent; - concataerTab = MyParent.MyTab != null ? MyParent.MyTab.Text.TrimEnd() : ""; - xoffTab = 0; // no rno tab - xoffMsg = ToInt(MyItemInfo.ActiveFormat.MyStepSectionLayoutData.ColRTable, 1) + (float)MyItemInfo.MyDocStyle.Layout.LeftMargin + ((useAerParaForTab != null && useAerParaForTab.MyTab!=null) ? useAerParaForTab.MyTab.Width : 7.2f); - } - else - { - // break occurred in Response side. Use the tabs up to highest RNO concatenated together. - vlnParagraph useRnoParaForTab = MyParent; - vlnParagraph useParaForTab = MyParent; - while (useParaForTab.MyItemInfo.IsInRNO) - { - concatrnoTab = (useParaForTab.MyTab != null ? useParaForTab.MyTab.Text.TrimEnd() : "") + concatrnoTab.Trim(); - if (concatrnoTab.Length > 0 && concatrnoTab[0] > '\xff') concatrnoTab = ""; - useRnoParaForTab = useParaForTab; - useParaForTab = useParaForTab.MyParent; - } - xoffTab = useRnoParaForTab.MyTab.XOffset; - xoffMsg = useRnoParaForTab.XOffset; - - // aer message when rno broke. Need to concatenate up the Condition side also until - // hitting 1st non-sequential, i.e. moves out of Condition/Response table. - useAerParaForTab = useParaForTab; // useParaForTab is 1st found non-Response step, i.e. moved into Condition side of table - while (useParaForTab.MyItemInfo.IsSequential) - { - concataerTab = (useParaForTab.MyTab != null ? useParaForTab.MyTab.Text.TrimEnd() : "") + concataerTab.Trim(); - useAerParaForTab = useParaForTab; - useParaForTab = useParaForTab.MyParent; - } - } - // For RNO tab, add a vlntext for tab and one for continue message: - float xoff1 = xoffMsg; - if (!incond) - { - vlnText vtc = new vlnText(cb, this, concatrnoTab, concatrnoTab, xoffTab, ybot, docstyle.Continue.Bottom.Font); - MyPageHelper.TopMessageSub1s.Add(vtc); - Chunk chk = (vtc.IParagraph.Chunks[0]) as Chunk; - if (chk != null) - { - float xoff2 = xoffTab + chk.GetWidthPoint() + 6; - // If the "(continue)" is going to overlap the tab, then move the "Continue)" so that it doesn't overlap. - if (xoff2 > xoff1) xoff1 = xoff2; - } - } - MyPageHelper.TopMessageSub1s.Add(new vlnText(cb, this, myMsg, myMsg, xoff1, ybot, docstyle.Continue.Bottom.Font)); - - // for aer tab, add a vlntext for tab and one for continue message: - MyPageHelper.TopMessageSub2s.Add(new vlnText(cb, this, concataerTab, concataerTab, useAerParaForTab.MyTab.XOffset, ybot, docstyle.Continue.Bottom.Font)); - MyPageHelper.TopMessageSub2s.Add(new vlnText(cb, this, myMsg, myMsg, useAerParaForTab.XOffset, ybot, docstyle.Continue.Bottom.Font)); - addExtraLine = true; - } - } - if (!PageBreakOnStep) - MyPageHelper.TopMessage = new vlnText(cb, this, myMsg, myMsg, docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Top.Margin ?? 0, yTopMargin + 0.1F, docstyle.Continue.Top.Font);// MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font); - else - MyPageHelper.TopMessage = null; - } - return addExtraLine; - } - - private void DoBottomContinueMsg(PdfContentByte cb, float yBottomMargin, float yLocation, DocStyle docstyle, bool doThreeContinues) - { - string myMsg = docstyle.Continue.Bottom.Message; - - // a format flag exists that states to only put a BOTTOM message if it is a certain type (RNO) - // check for this.... - bool RNOContinueOnly = MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[40].ContinueOnly; - bool doBottom = !RNOContinueOnly || (MyItemInfo.IsInRNO && RNOContinueOnly); - if (doBottom && myMsg != null && myMsg != "") - { - myMsg = ReplaceStepBottomContinue(myMsg); - float msg_yLocation = 0; - if (myMsg.Contains("{par}")) - { - myMsg = myMsg.Replace("{par}", ""); - msg_yLocation = -SixLinesPerInch; - } - float yBtmMarginForMsg = yBottomMargin; - - // one of the format flags for FNP had an adjustment for printing the section title only - // on the first page of the section. Adjust the location of the bottom continue message - // if this adjustment was made (the current topmargin may not reflect the value within - // the document style) - if (MyPageHelper.PrintedSectionPage > 0) - { - if ((MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PrintSectOnFirst) == E_DocStructStyle.DSS_PrintSectOnFirst) - { - float localYTopMargin = 792 - (float)MyItemInfo.MyActiveSection.MyDocStyle.Layout.TopMargin; - yBtmMarginForMsg = Math.Max(0, localYTopMargin - (float)MyItemInfo.MyActiveSection.MyDocStyle.Layout.PageLength); - } - } - // include space for phone list when determining bottom continue message location - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList && MyPageHelper.PhoneListHeight != 0) - yBtmMarginForMsg += (MyPageHelper.PhoneListHeight - vlnPrintObject.SixLinesPerInch); - switch (docstyle.Continue.Bottom.Location) - { - case E_ContBottomLoc.EndOfText: // place continue string at end of text - // msg_yLocation accounts for extra lines in message from docstyle; and BottomContent is the actual - // location of the last line of text on page. - msg_yLocation = msg_yLocation + ((float)MyPageHelper.BottomContent - (SixLinesPerInch * MyPageHelper.YMultiplier)); - float tableSpaceAvailable = TableSpaceAvailable;// RHM20150525 - Table Scrunch - if (yBottomMargin + (docstyle.Layout.FooterLength ?? 0) > msg_yLocation) - { // Adjusted Continue Message Y Offset - //DebugPagination.WriteLine("====>> {0},'{1}'", msg_yLocation, MyItemInfo.ShortPath); - //msg_yLocation = (float) MyPageHelper.BottomContent - SixLinesPerInch; // Account for how low the lowest Item is on the page - float msg_yLocationOld =msg_yLocation= yBottomMargin + (docstyle.Layout.FooterLength ?? 0); - if (MyPageHelper.BottomContent != null) - msg_yLocation = Math.Min(yBottomMargin + (docstyle.Layout.FooterLength ?? 0), (float)MyPageHelper.BottomContent - SixLinesPerInch);// RHM20150525 - Table Scrunch - if (msg_yLocationOld != msg_yLocation) - _MyLog.WarnFormat("Continue Message Moved from {0} to {1} for {2}", msg_yLocationOld, msg_yLocation, this);// RHM20150525 - Table Scrunch - } - break; - case E_ContBottomLoc.BtwnTextAndBottom: // place continue string between end of text & bottom of page - msg_yLocation = msg_yLocation + yLocation - ((yLocation - yBottomMargin) / 2); // +SixLinesPerInch; // (need this for IP3) - msg_yLocation = Math.Max(msg_yLocation, yBottomMargin+SixLinesPerInch); - break; - case E_ContBottomLoc.BottomOfPage: // place continue message at bottom of page - //msg_yLocation = yBottomMargin + 2 * SixLinesPerInch + (float)docstyle.Layout.FooterLength; // 2 lines above bottom margin - msg_yLocation = msg_yLocation + yBtmMarginForMsg + (float)docstyle.Layout.FooterLength; - break; - case E_ContBottomLoc.BelowBottom1: - msg_yLocation = msg_yLocation + yBtmMarginForMsg; - break; - case E_ContBottomLoc.BottomWithFooter: // put bottom message AND if in CONDITION/RESPONSE table, in both columns. - msg_yLocation = msg_yLocation + yBtmMarginForMsg; - break; - case E_ContBottomLoc.EndOfText2: // Like EndOfText but limited within yBottomMargin - msg_yLocation = Math.Max(msg_yLocation + yLocation - SixLinesPerInch, yBottomMargin + SixLinesPerInch); - break; - case E_ContBottomLoc.BtwnTextAndBottom2: - // Like BtwnTextAndBottom but accounts for line spacing of step & is 1 line up on page (for BGE - Procedure Steps - 2 column) - float adj = (!MyItemInfo.IsSection && MyItemInfo.FormatStepData.StepLayoutData.EveryNLines == 1) ? SixLinesPerInch : 0; - msg_yLocation = msg_yLocation + yLocation - ((yLocation - yBottomMargin) / 2) + adj;// +SixLinesPerInch; - if (msg_yLocation < yBottomMargin) msg_yLocation = yBottomMargin; - break; - default: - _MyLog.WarnFormat("**** BOTTOM CONTINUE MESSAGE NOT CODED FOR LOCATION {0}*****", docstyle.Continue.Bottom.Location); - break; - } - if (!PageBreakOnStep) - { - float xoffB = 0; - // Added for Calvert Alarms: if 'doThreeContinues', continue message at bottom of page - // and a continue message at the bottom of each column. - if (doThreeContinues) - { - float ybot = yLocation; - xoffB = (float)docstyle.Layout.LeftMargin + docstyle.Continue.Bottom.Margin ?? 0; - MyPageHelper.BottomMessageA = new vlnText(cb, this, myMsg, myMsg, xoffB, ybot, docstyle.Continue.Bottom.Font); - xoffB = docstyle.Layout.LeftMargin + docstyle.Continue.Bottom.MarginR ?? 0; - MyPageHelper.BottomMessageR = new vlnText(cb, this, myMsg, myMsg, xoffB, ybot, docstyle.Continue.Bottom.Font); - MyPageHelper.AlarmYoffEnd -= SixLinesPerInch; - float tmp = (((float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin) / 2) - (myMsg.Length / 2 * 5); - xoffB = (float)docstyle.Layout.LeftMargin + tmp; - } - else if (docstyle.Continue.Bottom.Location == E_ContBottomLoc.BottomWithFooter) - { - float tmp = (((float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin) / 2) - (myMsg.Length / 2 * 5); - xoffB = (float)docstyle.Layout.LeftMargin + tmp; - } - else if (RNOContinueOnly) - { - // The following line was added for McGuire APs/AP/1/5500/12, Step 13 - //if (msg_yLocation < yBottomMargin + SixLinesPerInch) msg_yLocation = yBottomMargin + SixLinesPerInch; - float colR = float.Parse(MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColRTable.Split(",".ToCharArray())[MyItemInfo.ColumnMode]); - xoffB = colR + docstyle.Layout.LeftMargin + docstyle.Continue.Bottom.Margin ?? 0; - } - else if (MyItemInfo.IsInRNO && (docstyle.Continue.Bottom.MarginR ?? 0) > 0) - { - xoffB = (float)docstyle.Layout.LeftMargin + (float)docstyle.Continue.Bottom.MarginR; - MyPageHelper.BottomMessageR = new vlnText(cb, this, myMsg, myMsg, xoffB, msg_yLocation, docstyle.Continue.Bottom.Font); - xoffB = (float)docstyle.Layout.LeftMargin + (float)docstyle.Continue.Bottom.Margin; - - } - // FloatingContinueMessage format flag: - // if breaking at the AER put continue message in left column, - // if breaking RNO put continue message in Right column. - else if (MyItemInfo.IsInRNO && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.FloatingContinueMessage) - { - float colR = float.Parse(MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColRTable.Split(",".ToCharArray())[MyItemInfo.ColumnMode]); - xoffB = colR + docstyle.Layout.LeftMargin + docstyle.Continue.Bottom.Margin ?? 0; - } - else - xoffB = docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Bottom.Margin ?? 0; - //MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Bottom.Margin ?? 0, msg_yLocation, docstyle.Continue.Bottom.Font);// MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font); - MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, xoffB, msg_yLocation, docstyle.Continue.Bottom.Font); - } - } - if (PageBreakOnStep) MyPageHelper.BottomMessage = null; - } - - private void RefreshDocStyle() - { - MyItemInfo.ActiveSection = null; - MyItemInfo.MyDocStyle = null; - MyPageHelper.MySection = MyItemInfo as SectionInfo; - MyPageHelper.ResetSvg(); - MyPageHelper.PrintedSectionPage = 0; - } - - private string ReplaceStepBottomContinue(string myMsg) - { - string tb = null; - if (MyItemInfo.IsSection) - tb = MyItemInfo.MyTab.CleanText.Trim(); - else - tb = MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols; - // if the tab ends with .0, remove it if it was added because of the virtualdotinhls flag. - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.VirtualDotInHLSTab && tb.Contains(".0")) tb = tb.Replace(".0", ""); - if (myMsg.IndexOf(@"%d") > -1) - myMsg = myMsg.Replace(@"%d", tb.Trim()); - if (myMsg.IndexOf(@"%0d") > -1) - myMsg = myMsg.Replace(@"%0d", tb.Trim(" .".ToCharArray())); - if (myMsg.IndexOf(@"%2d") > -1) - myMsg = myMsg.Replace(@"%2d", tb.Trim(" .".ToCharArray()).PadLeft(2)); - if (myMsg.IndexOf(@"%3d") > -1) - myMsg = myMsg.Replace(@"%3d", MyItemInfo.MyHLS.Ordinal.ToString()); - return myMsg; - } - private vlnParagraph TopMostChild - { - get - { - if (ChildrenAbove.Count > 0) return ChildrenAbove[0].TopMostChild; - return this; - } - } - private bool EmptyTopMostPart - { - get - { - if (TopMostChild.PartsAbove.Count == 0) return false; - if (TopMostChild.PartsContainer != null && TopMostChild.PartsContainer.Count > 0) return false; // B2016-198: not 'EmptyTopMostPart' if there is a box. - foreach (vlnPrintObject po in TopMostChild.PartsAbove) - { - vlnHeader hd = po as vlnHeader; - if (hd == null) return false; - if (hd.Text != "") return false; - } - return true; - } - } - private float OutputOtherPageSteps(PdfContentByte cb, float YTopMost, float yPageStart, float yTopMargin, float yBottomMargin) - { - float retval = YTopMost; - // Find any items remaining in MyPageHelper.MyParagraphs that should be printed on this page. - vlnParagraphs process = new vlnParagraphs(null); - foreach (vlnParagraph vPara in MyPageHelper.MyParagraphs.Values) - { - if (!vPara.Processed && ((vPara.YOffset + vPara.Height) < YTopMost)) - if (this.MyItemInfo.ItemID != vPara.MyItemInfo.ItemID) // 20150701 Complicated RNO change - process.Add(vPara); - else // 20150701 Complicated RNO change - _MyLog.WarnFormat("Less Than: Step Could Have Fit {0}, {1}", MyItemInfo.ItemID, MyItemInfo.ShortPath); - else if (!vPara.Processed && ((vPara.YOffset + vPara.Height) == YTopMost)) - if (this.MyItemInfo.ItemID != vPara.MyItemInfo.ItemID) // RHM20150507 Table Scrunch - { - process.Add(vPara); - _MyLog.WarnFormat("New AerRno PageBreak Logic: Step Could Have Fit {0}, {1}", MyItemInfo.ItemID, MyItemInfo.ShortPath); - } - else // RHM20150507 Table Scrunch - _MyLog.WarnFormat("Equal: Step Could Have Fit {0}, {1}", MyItemInfo.ItemID, MyItemInfo.ShortPath); - else if (!vPara.Processed && ((vPara.YOffset) < YTopMost)) - retval = Math.Min(retval, vPara.YTopMost); - } - foreach (vlnParagraph vPara in process) - { - vPara.ParagraphToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - } - return retval; - } - private float _YVeryTop = -1; - public float YVeryTop - { - get - { - if (_YVeryTop == -1) - { - _YVeryTop = YTop; - _YVeryTop = VeryTop(PartsAbove, _YVeryTop); - _YVeryTop = VeryTop(PartsContainer, _YVeryTop); - } - return _YVeryTop; - } - } - - private float VeryTop(vlnPrintObjects parts, float yVeryTop) - { - if (parts != null) - foreach (vlnPrintObject part in parts) - if (part.YOffset < yVeryTop) - yVeryTop = part.YOffset; - return yVeryTop; - } - /// - /// This gets the height of the step with it's Caution's, Notes and potentially any First Substeps - /// - /// - private float GetFirstPieceSize() - { - vlnParagraph paraLast = GetFirstPieceLastPart(); - float retval = (paraLast.YBottom) - YTopMost; - //Console.WriteLine(MyItemInfo.DBSequence); - return retval; - } - public override float YBottom - { - get - { - float bottom = YOffset + Height; - if (PartsBelow != null) - { - foreach (vlnPrintObject part in PartsBelow) - { - float partBottom = part.YBottom; - bottom = Math.Max(partBottom, bottom); - } - } - return bottom; - } - } - public float YVeryBottom - { - get - { - float bottom = YOffset + Height; - if (ChildrenBelow != null) - foreach (vlnParagraph child in ChildrenBelow) - bottom = Math.Max(child.YVeryBottom, bottom); - if (ChildrenLeft != null) - foreach (vlnParagraph child in ChildrenLeft) - bottom = Math.Max(child.YVeryBottom, bottom); - if (ChildrenRight != null) - foreach (vlnParagraph child in ChildrenRight) - bottom = Math.Max(child.YVeryBottom, bottom); - if (PartsBelow != null) - foreach (vlnPrintObject part in PartsBelow) - bottom = Math.Max(part.YBottom, bottom); - return bottom; - } - } - public float YBottomText - { - get - { - return YOffset + Height; - } - } - private float _YBottomForBox = 0; - public float YBottomForBox - { - get { return _YBottomForBox; } - set { _YBottomForBox = value; } - } - private vlnParagraph GetFirstPieceLastPart() - { - vlnParagraph para = this; - if (!MyItemInfo.ActiveFormat.MyStepSectionLayoutData.PaginateOnFirstSubstep && ChildrenBelow != null && ChildrenBelow.Count > 0) - { - // If the substep has a separator (OR, AND) then return the last substep rather than the first. - string mySep = ChildrenBelow[0].MyItemInfo.FormatStepData.Sep ?? "{Null}"; - if (mySep != "{Null}" && mySep != "") - para = ChildrenBelow[ChildrenBelow.Count - 1].GetFirstPieceLastPart(); - else - { - // MNS Pagination - Mike Weiner Case 1a to keep step together with any non-sequential substeps (ANDs, EQ List) - bool keepEqListTogether = ChildrenBelow[0].MyItemInfo.ActiveFormat.MyStepSectionLayoutData.PutOnPageByItself; - if (keepEqListTogether && !ChildrenBelow[0].MyItemInfo.IsSequential && !this.MyItemInfo.IsHigh) // Extend to the last Item. - para = ChildrenBelow[ChildrenBelow.Count - 1].GetFirstPieceLastPart(); - else - para = ChildrenBelow[0].GetFirstPieceLastPart(); - } - } - if (ChildrenRight != null && ChildrenRight.Count > 0) - { - foreach (vlnParagraph paraRight in ChildrenRight) - { - vlnParagraph paraRightLast = paraRight.GetFirstPieceLastPart(); - if (paraRightLast.YBottom > para.YBottom) - para = paraRightLast; - } - } - return para; - } - /// - /// Find items from previous page (yLocation less than yTop) and remove them from the list. - /// yTop is the new starting location on the next page for this step. - /// - /// - /// - private void RemoveProcessedParagraphs(StepLevelList myList, float yTop) - { - // the two CleanUpLists are used to remove items from - // the original list because list items cannot be removed in a - // 'foreach'. - List CleanupListStepLevel = new List(); - foreach (int stepLevel in myList.Keys) - { - List CleanupListYLocation = new List(); - SortedList AdjustYLocation = new SortedList(); - foreach (float yLocation in myList[stepLevel].Keys) - { - if (-yLocation <= yTop) - CleanupListYLocation.Add(yLocation); - else - AdjustYLocation.Add(-yLocation, yLocation); // order in ascending order - } - foreach (float yLocation in CleanupListYLocation) - myList[stepLevel].Remove(yLocation); - foreach (float yLocation in AdjustYLocation.Keys) - { - vlnParagraph para = myList[stepLevel][-yLocation]; - myList[stepLevel].Remove(-yLocation); - // shift yLocation by yTop to work with items whose locations - // are defined from the top of the new page rather than - // from the beginning of the step. - // Note that yLocation is negative to have items in descending - // order so that adding yTop decrements their values. - if(!myList[stepLevel].ContainsKey(yTop - yLocation)) - myList[stepLevel].Add(yTop - yLocation, para); - } - if (myList[stepLevel].Count == 0) - CleanupListStepLevel.Add(stepLevel); - } - foreach (int stepLevel in CleanupListStepLevel) - myList.Remove(stepLevel); - } - /// - /// Builds a list of paragraphs by StepLevel and yLocation in descending order. - /// - /// - /// - private void BuildLocationList(float yTopMost, ParagraphLocations myLocations) - { - foreach (vlnParagraph child in ChildrenAbove) - child.BuildLocationList(yTopMost, myLocations); - foreach (vlnParagraph child in ChildrenLeft) - child.BuildLocationList(yTopMost, myLocations); - - // Add a list entry consisting of StepLevel, yoffset from the beginning of this step, paragraph itself - myLocations.Add(this, yTopMost); - - foreach (vlnParagraph child in ChildrenRight) - child.BuildLocationList(yTopMost, myLocations); - foreach (vlnParagraph child in ChildrenBelow) - child.BuildLocationList(yTopMost, myLocations); - } - private int COL_WID_ADJ = 6; // adjusts for incorrect use of WidSTable when breaking a line (it breaks 6 chars too short) - private bool IsTitleType(ItemInfo itm) - { - if (itm.FormatStepData != null && (itm.FormatStepData.Index == 42 || itm.FormatStepData.Index == 43)) return true; - return false; - } - private static VlnFlexGrid _MyFlexGrid = new VlnFlexGrid(1, 1); - public static VlnFlexGrid MyFlexGrid - { - get { return _MyFlexGrid; } - } - private pkParagraph _MyPlaceKeeper = null; - public pkParagraph MyPlaceKeeper - { - get { return _MyPlaceKeeper; } - set { _MyPlaceKeeper = value; } - } - private pkParagraph _MyContAct = null; - public pkParagraph MyContAct - { - get { return _MyContAct; } - set { _MyContAct = value; } - } - public static bool InList(int id, params int[] ids) - { - foreach (int listid in ids) - if (id == listid) return true; - return false; - } - private bool _PrefixSpecialCharacter = false; - public bool PrefixSpecialCharacter - { - get { return _PrefixSpecialCharacter; } - set { _PrefixSpecialCharacter = value; } - } - private string _Prefix; - public string Prefix - { - get { return _Prefix; } - set { _Prefix = value; } - } - private string _Suffix; - public string Suffix - { - get { return _Suffix; } - set { _Suffix = value; } - } - private float RoughSizeOfPage - { - get - { - return (float)(MyItemInfo.MyDocStyle.Layout.PageLength /*- MyItemInfo.MyDocStyle.Layout.TopMargin*/ - MyItemInfo.MyDocStyle.Layout.FooterLength); - } - } - private PromsPrinter _MyPromsPrinter; - public PromsPrinter MyPromsPrinter - { - get { return _MyPromsPrinter; } - set { _MyPromsPrinter = value; } - } - public static float _yPageStartForSupInfo = 0; - public vlnParagraph(vlnParagraph parent, PdfContentByte cb, ItemInfo itemInfo, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo, string prefix, string suffix, float yoffRightParent, bool loadChildren, PromsPrinter pp) - { - MyPromsPrinter = pp ?? parent.MyPromsPrinter; - int profileDepth = ProfileTimer.Push(">>>> vlnParagraph"); - Prefix = prefix; - Suffix = suffix; - MyItemInfo = itemInfo; - MyContentByte = cb; - if (itemInfo.IsFootnote && loadChildren) - { - // notestofootnoteshls is a list, a hls can have more than one note - if (MyPageHelper.NotesToFootNotesHLS.ContainsKey(itemInfo.MyHLS.ItemID)) - MyPageHelper.NotesToFootNotesHLS[itemInfo.MyHLS.ItemID].Add(itemInfo.ItemID); - else - { - List notesList = new List(); - notesList.Add(itemInfo.ItemID); - MyPageHelper.NotesToFootNotesHLS.Add(itemInfo.MyHLS.ItemID, notesList); - } - Processed = true; // don't want to print during normal ToPdf/ParagraphToPdf cycle - print in vlnsvgpagehelper - ProfileTimer.Pop(profileDepth); - return; - } - // do some 'setup' for Calvert Alarms: - if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) - { - // The CONDITION/RESPONSE portion of the alarm uses a macro to print the 'table' heading, - // i.e. the lines/boxes and text for CONDITION and RESPONSE. This does not have a tab, - // tabs are where the macros are usually stored, so flag this for future reference. - // The 2nd if is executed when the step is at the same y offset as the parent, i.e. DEVICE & SETPOINT text. - if (itemInfo.TemplateIndex > 0 && itemInfo.ActiveFormat.PlantFormat.FormatData.Templates[itemInfo.TemplateIndex].hmacro > 0) - HasCalvertMacro = true; - if (KeepOnParentLine(itemInfo)) yoff = parent.YOffset; - } - float yOffOrig = yoff; - // Save step text information to be used to create a PlaceKeeper (Calver Cliffs) - BuildPlacekeeper(parent, itemInfo); - - // Save step text information to be used to create a Continuous Action Summary - BuildContinuousActionSummary(parent, itemInfo); - if (itemInfo.ActiveFormat.MyStepSectionLayoutData.BoxLeftAdj != null) - _MyBoxLeftAdj = float.Parse(itemInfo.ActiveFormat.MyStepSectionLayoutData.BoxLeftAdj); - ShowSectionTitles = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles || itemInfo.MyDocStyle.ShowSectionTitles; - if (itemInfo.IsSection && itemInfo.ActiveSection.DisplayText.ToUpper().Contains("") && !itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.PrintNoTitle) ShowSectionTitles = false; - HasIndent = itemInfo.IsStep && itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.DontResetIndentOnNewline; - - int MetaLevel = 0; // if meta section, stores what level this section is. - float savCheckListBottomMost = 0; - //int[] problemIDs = { 889 }; - //List lProblemIDs = new List(problemIDs); - //if (lProblemIDs.Contains(itemInfo.ItemID)) - // Console.WriteLine("Found Item {0}", itemInfo.ItemID);formatInfochecko - MyParent = parent; - // The following code determines the last paragraph for an RNO - // MyTopRNO finds the Top paragraph for an RNO - if (itemInfo.IsInRNO) - { - if (rnoLevel <= maxRNO && itemInfo.IsRNOPart) // Not top level RNO - MyTopRNO = this; - else - MyTopRNO = MyParent.MyTopRNO; - if (MyTopRNO != null) MyTopRNO.LastRNO = this; - } - - if (!MyPageHelper.MyParagraphs.ContainsKey(itemInfo.ItemID) && !itemInfo.IsFootnote) MyPageHelper.MyParagraphs.Add(itemInfo.ItemID, this); - - // if this a continuous subsection, refresh the style. - // This was commented out to fix a Westinghouse print issue 3-21-2014, orignally put in for Farley - //if (itemInfo.IsStepSection && !(itemInfo as SectionInfo).IsSeparatePagination() && itemInfo.MyParent.IsSection) - // RefreshDocStyle(); - - XOffset = xoff; - if (!MyItemInfo.IsStep && !MyItemInfo.IsStepSection && MyItemInfo.MyContent.MyEntry != null) - { - IsWordDocPara = true; - // special case - this is a 'Word Doc' paragraph. The Processed flag is used to know - // that steps need put out on a page for the pagination logic, and since there are no steps - // we don't want to have to worry about putting this out for pagination logic. - Processed = true; - ProfileTimer.Pop(profileDepth); - return; - } - YTopMost = YOffset = yoff; - vlnTab mytab = null; - bool doSectTab = false; - // if this substep has a caution or note as its parent, then there may have been a special indent done on the - // substep... check the CautionOrNoteSubstepIndent value, this is the additional indent amount in number - // of characters. - if (itemInfo.MyParent.IsCaution || itemInfo.MyParent.IsNote) - { - // if this is a Note or Caution off of a Note or Caution (Catawba EG/1A/CSAM/SACGR1 step 1) - // then indent it the length of its tab - if (itemInfo.IsCaution || itemInfo.IsNote) - XOffset += (itemInfo.FormatStepData.TabData.IdentPrint.Length -1) * 6; - else - if (itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset != null) - XOffset = float.Parse(itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset); - else - XOffset += 72 * (itemInfo.FormatStepData.CautionOrNoteSubstepIndent == null ? 0 : (float)itemInfo.FormatStepData.CautionOrNoteSubstepIndent / (float)itemInfo.FormatStepData.Font.CPI); - } - - if (itemInfo.IsStep && itemInfo.MyHLS != null && itemInfo.MyHLS.FormatStepData.UseSmartTemplate && - itemInfo.FormatStepData.StepLayoutData.AlignWithParentTab - || (itemInfo.Steps != null && itemInfo.Steps.Count > 0 && itemInfo.Steps[0].FormatStepData.StepLayoutData.AlignWithParentTab)) - itemInfo.MyTab = null; - - float xMetaAdj = 0; - - if (itemInfo.IsFootnote) itemInfo.MyTab = null; - - if (itemInfo.IsSupInfoPart) XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - - //if (itemInfo.MyTab != null && itemInfo.MyTab.Text != null && itemInfo.MyTab.Text != "") - // bug fix - if the section does not have a section number, then we need to build an empty tab for the itemInfo - // so that we place the section title in the correct location. so we need to go into this IF code block - // even if itemInfo has a MyTab that is an empty string when itemInfo is a section - 2/11/2015 - if (itemInfo.MyTab != null && itemInfo.MyTab.Text != null && (itemInfo.MyTab.Text != "" || itemInfo.IsSection)) - { - float localXOffset = XOffset; - bool doprint = true; - if (itemInfo.IsSection) - { - MyItemInfo.ActiveSection = null; - MyItemInfo.MyDocStyle = null; - DocStyle ds = MyItemInfo.MyDocStyle; - - if (!ds.ComponentList && ShowSectionTitles - && !MyItemInfo.MyDocStyle.CancelSectTitle - && !MyItemInfo.MyDocStyle.SpecialStepsFoldout) // Don't ouput the Step Section title - { - SectionConfig sch = MyItemInfo.MyConfig as SectionConfig; - if (sch != null && sch.Section_PrintHdr != "Y") - { - doprint = false; - YTopMost = 0; - } - } - else - doprint = false; - } - // if printing the supplemental info facing page, don't put out the section title. ToPdf will put out 'Supplemental Information' title. - if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && MyPageHelper.CreatingSupInfoPage && itemInfo.IsSection) doprint = false; - if (doprint && itemInfo.IsSection && !itemInfo.MyDocStyle.CancelSectTitle && itemInfo.MyTab.Text.ToUpper() != "FOLDOUT") - { - doSectTab = true; - if (itemInfo.IsStepSection && formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Just.Contains("PSLeft")) - { - float offset = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - if (formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos != null) - { - ItemInfo iilvl = itemInfo; - while (!iilvl.IsProcedure) - { - // see if this metasection, walking up the tree, has its header printed, - // if so, indent for it. - SectionConfig sch1 = iilvl.MyConfig as SectionConfig; - if (sch1.Section_PrintHdr == "Y" || MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections) - MetaLevel++; - iilvl = iilvl.MyParent; - } - - if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) - { - if (MetaLevel == 1) - offset += (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos; - else - { - SectionConfig sc = itemInfo.MyParent.MyConfig as SectionConfig; - if (MyParent != null) - { - // if the parent is not printed, then adjust the xoffset based on - // the level of the metasection. Note that the 'if (MetaLevel==20) MetaLevel = 1' - // line of code was added so that the xoffsets between 16 & 32 bit are closer. - // This code was added to fix problems in BGE OI34, Appendix sections/subsection xoffsets. - if (sc != null && sc.Section_PrintHdr == "N") - { - if (MetaLevel == 2) MetaLevel = 1; - xMetaAdj = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[0].ColSByLevel; - for (int i = 0; i < MetaLevel; i++) - { - xMetaAdj += (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos - (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos; - xMetaAdj += (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[i].SecNumPositionAdj; - } - offset += xMetaAdj; - } - else - { - offset = (sc != null && sc.SubSection_AutoIndent == "Y") ? MyParent.XOffset - : (MyParent.MyTab != null) ? MyParent.MyTab.XOffset : XOffset; - } - } - } - } - else - { - - MetaLevel = MetaLevel <= 2 ? 1 : MetaLevel - 1; - if (MetaLevel == 1) - offset += (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos; - else - { - xMetaAdj = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[0].ColSByLevel; - for (int i = 0; i < MetaLevel; i++) - { - xMetaAdj += (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos - (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos; - xMetaAdj += (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[i].SecNumPositionAdj; - - } - offset += xMetaAdj; - itemInfo.MyTab.Text = itemInfo.MyTab.Text.TrimEnd(" ".ToCharArray()); - itemInfo.MyTab.CleanText = itemInfo.MyTab.CleanText.TrimEnd(" ".ToCharArray()); - if (((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_SameXOffSubsections) == E_DocStructStyle.DSS_SameXOffSubsections)) - offset += (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos; - } - } - } - localXOffset = offset; - } - } - if (!itemInfo.IsSection || doSectTab) - { - if (itemInfo.IsSupInfoPart) // get combined tab if on a supinfo facing page: - mytab = GetSupInfoTab(cb, itemInfo, yoff, mytab, doSectTab, localXOffset); - else if (itemInfo.MyTab.AltPrintTab != null) - mytab = new vlnTab(cb, this, itemInfo.MyTab.AltPrintTab, itemInfo.MyTab.AltPrintTab, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline); - else - mytab = new vlnTab(cb, this, itemInfo.MyTab.Text, itemInfo.MyTab.CleanText, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline); - PartsLeft.Add(mytab); - if (mytab.MyMacro != null) PartsLeft.Add(mytab.MyMacro); - } - } - else if (itemInfo.IsSupInfoPart) // if it was an empty tab - it may have been a caution/note - { - mytab = GetSupInfoTab(cb, itemInfo, yoff, mytab, doSectTab, XOffset); - PartsLeft.Add(mytab); - } - // if this is the High Level RNO step (MyTopRNO) and we are numbering the RNO, adjust the xoffset to start the tab - // at the x location rather than starting the text at the x location: - AdjustWidth(itemInfo, maxRNO, formatInfo, mytab); - bool adjustAgain = ((itemInfo.MyTab != null && itemInfo.MyTab.Position == 0) || (itemInfo.MyPrevious != null && itemInfo.MyPrevious.FormatStepData != null && itemInfo.MyPrevious.FormatStepData.TabData.IsTransition)) ? true : false; - if (!itemInfo.IsSection && itemInfo.FormatStepData.NumberHighLevel && itemInfo.IsRNOPart && (MyTopRNO == null || itemInfo.ItemID == MyTopRNO.MyItemInfo.ItemID)) - { - // adjust the x-offset of the RNO to include the tab. - if (itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthSameAsHighParent)// && !itemInfo.MyParent.IsHigh) - { - vlnParagraph hls = GetHighLevelParagraph(); - float RnoOffset1 = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO); - float offset = hls.Width + RnoOffset1 + hls.XOffset; - vlnTab tb = hls.MyTab; - //offset += tb.Width; - if (MyTopRNO == null) - Width -= (float)itemInfo.ActiveFormat.MyStepSectionLayoutData.SingleColumnRNOIndent; - offset -= Width; - float inc = offset - XOffset; - if (mytab != null) - mytab.XOffset += inc;// +(itemInfo.MyParent.IsHigh ? 6.8f : 0); - XOffset += inc; - adjustAgain = false; - } - else if (itemInfo.FormatStepData.AdjHighLevelTab != null && itemInfo.ColumnMode > 0) - // For Farley (only plant format to use AdjHighLevelTab), determine the xoffset based on - // where the right edge of the text is. Their RNO's are numbered with parent numbering - // so the calculations for determining the xoffset backs up from the right edge. - { - float rightTextEdge = this.MyHighLevelParagraph.XOffset + this.MyHighLevelParagraph.Width; - int colRx = int.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[itemInfo.ColumnMode]); - rightTextEdge += (colRx + (itemInfo.FormatStepData.AdjHighLevelTab ?? 0)); - float diff = rightTextEdge - (XOffset + Width); - if (mytab != null) mytab.XOffset += diff; - XOffset += diff; - adjustAgain = false; - } - else if(mytab != null) - { - float adjusttab = (itemInfo.MyParent.IsHigh) ? itemInfo.FormatStepData.AdjHighLevelTab ?? 0 : 0; - mytab.XOffset += (mytab.Width + adjusttab); - XOffset = mytab.XOffset + mytab.Width; - if (adjusttab != 0) Width += (mytab.Width); - } - } - if (adjustAgain) - { - AdjustXOffsetForTab(itemInfo, maxRNO, formatInfo, mytab, xMetaAdj); - // Used in Ginna's Attachment format. - // if the Note/Caution is off of a sub-step, then adjust the width so that the Caution/Note text box does not extend past the HLS text box - if (itemInfo.IsCautionOrNotePart && maxRNO == 0 && itemInfo.MyActiveSection.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.LimitCautionNoteWidthToHLS) - { - float wMax = MyHighLevelParagraph.Width + MyHighLevelParagraph.XOffset - XOffset; - if (wMax < Width && (Width + XOffset > MyItemInfo.MyDocStyle.Layout.PageWidth) ) Width = wMax; - } - } - - if (itemInfo.IsSection && MyParent == null && itemInfo.MyDocStyle.SupplementalInformation && MyPromsPrinter.SupInfoPrintType==E_SupInfoPrintType.Merge) - { - _SupInfoSection = new vlnParagraph(this, cb, itemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo, null, null, yoffRightParent, false, pp); - MyPromsPrinter.SupInfoPdfPageCount = -1; - } - // For Calvert Alarms: if within the CONDITION/RESPONSE table, indent by 1 character. - // Sequential substeps are ok because of the tab string, but items without a tab & other step - // types were writing over the CONDITION/RESPONSE vertical table line. This code uses - // 7.2 for the character size to match 16bit output. - if (itemInfo.IsStep && !itemInfo.IsSequential && !itemInfo.IsCaution && !itemInfo.IsNote && MyParent.HasCalvertMacro) - { - XOffset += 7.2f; - if (mytab != null) mytab.XOffset += 7.2f; - } - if ((itemInfo.IsCaution || (itemInfo.IsNote && !itemInfo.IsFootnote)) && (itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS) - { - if (itemInfo.IsInRNO) - { - XOffset = MyTopRNO.MyTab != null ? MyTopRNO.MyTab.XOffset : MyTopRNO.XOffset; - Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - XOffset - 10; - } - else - { - XOffset = MyHighLevelParagraph.MyTab.XOffset; - Width = MyHighLevelParagraph.MyTab.Width + MyHighLevelParagraph.Width - 6; // make width 1/2 char smaller so it doesn't touch line - } - } - if (UseTemplateWidthOrXOff(itemInfo)) - { - float txoff = GetWidthOrStartFromTemplate(itemInfo, itemInfo.ActiveFormat, false); - if (txoff > 0) XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + txoff; // GetWidthOrStartFromTemplate(itemInfo, itemInfo.ActiveFormat, false); - } - if (itemInfo.MyHeader != null && itemInfo.MyHeader.Text != null && !doSectTab) - yoff += SetHeader(this, cb, itemInfo, formatInfo); - else if(itemInfo.FormatStepData != null && itemInfo.FormatStepData.SeparateBox && itemInfo.FirstSibling.MyHeader != null && itemInfo.FirstSibling.MyHeader.Text != null) - yoff += SetHeader(this, cb, itemInfo.FirstSibling, formatInfo); - float yoffLeft = yoff; - if (ChildrenAbove != null) - ChildrenAbove.StepDesignator = null; //reset StepDesignator - if (DoSubs && itemInfo.Cautions != null && (!itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || itemInfo.Cautions[0].FormatStepData.Type != "Caution1") && !(itemInfo.IsCaution || itemInfo.IsNote)) - { - if (itemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format) - { - // For deviations, the Cautions are always in the same place. - // Fix for Catawba E-1 deviation for step 10. Has note/caution off of a paragraph instead of HLS - float xoffDev = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - if(loadChildren) yoffLeft = ChildrenLeft.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); - } - else - { - if (yoffRightParent > yoff && ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) != E_DocStructStyle.DoubleBoxHLS)) yoff = yoffRightParent; - if (loadChildren) yoff = ChildrenAbove.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); - } - } - if (DoSubs && itemInfo.Notes != null && !(itemInfo.IsCaution || itemInfo.IsNote)) - { - if (itemInfo.ActiveFormat.MyStepSectionLayoutData.Dev_Format) - { - // For deviations, the Cautions are always in the same place. - // Fix for Catawba E-1 deviation for step 10. Has note/caution off of a paragraph instead of HLS - float xoffDev = (float)itemInfo.MyDocStyle.Layout.LeftMargin + 6 + (float)(itemInfo.ActiveFormat.MyStepSectionLayoutData.WidT); - if (loadChildren) yoffLeft = Math.Max(yoffLeft, ChildrenLeft.Add(cb, itemInfo.Notes, xoffDev, yoff, yoff, rnoLevel, maxRNO, formatInfo)); - } - else - { - // Notes/Cautions span the page. If the right (RNO) column is below current yoff, use the - // yoff from this. Without this, an overlap of text between the note and the bottom of the - // RNO was occurring for FNP - Unit 2/AOP, AOP-4.0. - if (yoffRightParent > yoff && ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) != E_DocStructStyle.DoubleBoxHLS)) yoff = yoffRightParent; - if (loadChildren) - { - float yoffadj = 0; - if (itemInfo.IsTable && MyFlexGrid.BorderStyle == C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None && !MyFlexGrid.TopRowHasBorder()) - yoffadj = SixLinesPerInch; // adjust the yoffset if the note is off of a borderless table - yoff = ChildrenAbove.Add(cb, itemInfo.Notes, xoff, yoff + yoffadj, yoff + yoffadj, rnoLevel, maxRNO, formatInfo) - yoffadj; - } - } - } - if (itemInfo is StepInfo && ((itemInfo as StepInfo).MyConfig as StepConfig).Step_PreferredPagebreak) HasPrefPageBreak = true; - if (MyPromsPrinter.SupInfoPrintType == E_SupInfoPrintType.Merge && loadChildren && itemInfo.SupInfos != null) - { - SupInfoSection.ChildrenBelow.Add(cb, itemInfo.SupInfos, XOffset, 0, 0, rnoLevel, maxRNO, formatInfo); - } - - // Without the following, BGE had gaps in y-direction if the AER/RNO both had cautions/notes. - // The only time this needs done is if caution/notes are printed in separate columns in dual - // column mode (used the DoubleBoxHLS BGE flag for this - if another plant needs this, make it - // a more generic flag). - if (itemInfo.IsRNOPart && ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS) && - rnoLevel == maxRNO && ChildrenAbove.Count > 0 && MyParent.ChildrenAbove.Count > 0) - { - float yDeltaRno = yoff - yOffOrig; - float yDeltaAer = SixLinesPerInch + yOffOrig - MyParent.ChildrenAbove[0].YTopMost; - if (yDeltaRno > yDeltaAer) - { - foreach (vlnParagraph chlda in MyParent.ChildrenAbove) - { - chlda.AdjustYOffset(yDeltaAer - yDeltaRno); - } - foreach (vlnParagraph chld in ChildrenAbove) - chld.AdjustYOffset(yDeltaAer); - yoff -= yDeltaAer; - } - else - { - foreach (vlnParagraph chld in ChildrenAbove) - chld.AdjustYOffset(yDeltaRno); - yoff -= yDeltaRno; - } - } - // Comanche Peak uses CAUTION2 type to enter a Step Designator, which is placed to the left of the step number. - // The Step Designator information is saved during the processing of the Cautions (ChildrenAbove) - // defined in the vlnParagraphs class (of which ChildrenAbove is defined) - if (ChildrenAbove.StepDesignator != null) - { - string pref = ChildrenAbove.StepDesignator; - float colOvrd = (float)(ChildrenAbove.StepDesignatorColumn ?? 0); - float xPref = (colOvrd > 0) ? colOvrd : mytab.XOffset - (pref.Length * (72 / (float)_MyItemInfo.FormatStepData.Font.CPI)); - PartsLeft.Add(new vlnText(cb, this, pref, pref, xPref, yoff, ChildrenAbove.StepDesignatorFont)); - ChildrenAbove.StepDesignator = null; - ChildrenAbove.StepDesignatorColumn = null; - } - DoAnnotationPrintableText(cb, itemInfo, yoff); // Look in annotation type to see if annotation has text that should be printed (like a step designator) - - // if this is a hls with a box, adjust the starting y location for the hls. this is done here - // in case this hls had a boxed caution and/or note before it. Also, this code is here rather - // than in the vlnparagraphs.add code because the yoff in that code will position the box, but - // this code positions the hls (in y direction), without this, the hls starts on the box line. - int bxIndx = itemInfo.IsSection ? 0 : itemInfo.FormatStepData.StepLayoutData.STBoxindex ?? 0; - if (itemInfo.IsHigh && bxIndx > 0) - { - int boxLnAdjust = itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.DiffContActBox ? 1 : 2; - yoff += (boxLnAdjust * SixLinesPerInch); // this yoff is where the BOX starts (boxLnAdjust was added for WEP2) - } - - // If the format has that extra space should be put out before the step, then - // handle this by using the 'PartsAbove' structure. By using the parts above, the extra - // space above will be done regardless of where page breaks fall. - float addExtraSpace = 0; - if (MyItemInfo.FormatStepData != null && MyItemInfo.ActiveFormat.MyStepSectionLayoutData.CustomSpacing) - addExtraSpace = MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace ?? 0; - //if (MyItemInfo.MyParent != null && MyItemInfo.MyParent.FormatStepData != null && - // MyItemInfo.MyParent.FormatStepData.Type != "TitleWithTextRight") - // addExtraSpace = (MyItemInfo.FormatStepData == null) ? 0 : MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace ?? 0; - if (MyItemInfo.MyParent != null && MyItemInfo.MyParent.FormatStepData != null) - addExtraSpace = (MyItemInfo.MyParent.FormatStepData.Type == "TitleWithTextRight" || MyItemInfo.FormatStepData == null) ? 0 : MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace ?? 0; - // If a high level step, the 16bit code uses the value of the extra space - // from the high level step format regardless of what type of high level step it is: - // Added check for UseSTExtraRealValue, if set, we want to use what is set for the specific step type - // Added check for CustomSpacing (was also in 16-bit logic) - if (!MyItemInfo.ActiveFormat.MyStepSectionLayoutData.UseSTExtraRealValue && - !MyItemInfo.ActiveFormat.MyStepSectionLayoutData.CustomSpacing && - MyItemInfo.IsHigh) - addExtraSpace = MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[2].StepLayoutData.STExtraSpace ?? 0; - // If CustomSpacing flag is true - // then use the STExtraSpace from the step type called "Default" (index number 25) - //if (YOffset != 0 && MyItemInfo.IsSection && MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.CustomSpacing) - if (YOffset != 0 && MyItemInfo.IsSection && MyItemInfo.ActiveFormat.MyStepSectionLayoutData.CustomSpacing) - addExtraSpace = (float)MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[25].StepLayoutData.STExtraSpace; - if (YOffset != 0 && MyItemInfo.FormatStepData != null && - MyItemInfo.MyPrevious == null && MyItemInfo.FormatStepData.ThreeBlanksAbove && (!MyItemInfo.IsNote || MyItemInfo.MyParent.Cautions == null)) - addExtraSpace = 24; // already has one blank line above, added two more - //if (YOffset != 0 && MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace > 0) - // addExtraSpace = (float)MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace; - // if this plant has the AlwaysUseExtraLines and there are notes/cautions above the hls, don't add in the - // extra space: - if (itemInfo.IsHigh && (itemInfo.Cautions != null || itemInfo.Notes != null)) - { - if ((itemInfo.Cautions != null && itemInfo.Cautions[0].FormatStepData.AlwaysUseExtraLines) || (itemInfo.Notes != null && itemInfo.Notes[0].FormatStepData.AlwaysUseExtraLines)) - addExtraSpace = 0; - } - if (addExtraSpace > 0 && MyItemInfo.FormatStepData != null) - { - // We need to strip out the underline style from the font before putting out - // the extra line. - VE_Font vf=MyItemInfo.FormatStepData.Font; - E_Style sty = (E_Style)vf.Style; - if ((sty & E_Style.Underline) != 0) - sty ^= E_Style.Underline; - vf = new VE_Font(vf.Family, (int) vf.Size, sty,(float) vf.CPI); - this.PartsAbove.Add(new vlnText(cb, this, " ", " ", 72, yoff, vf)); - } - - yoff += addExtraSpace; - - YTop = yoff; - YOffset = yoff; - if (mytab != null && mytab.SeparateBullet) - { - string identB = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.IdentB; - vlnText myBullet = new vlnText(cb, this, identB, identB, XOffset - 12, YOffset, MyItemInfo.FormatStepData.TabData.Bullet.Font); - myBullet.Rtf = myBullet.Rtf.Replace("\u25CF", @"\f1\u9679?\f0 "); - PartsLeft.Add(myBullet); - } - if (itemInfo.MyTab != null && itemInfo.MyTab.AsteriskOffset != 0) - { - - // the '-24' in x-direction & '+4' in y-direction was used for the SHE format to get the continuous - // HLS's asterisk to match 16bit. The font size was set at 16 to make it match also: - VE_Font astFont = new VE_Font(MyItemInfo.FormatStepData.TabData.Font.Family, 16, E_Style.Bold, 10); - vlnText myAsterisk = new vlnText(cb, this, "*", "*", mytab.XOffset - 24, YOffset + 4, astFont); - PartsLeft.Add(myAsterisk); - } - if (itemInfo.IsRNOPart && rnoLevel > maxRNO) - { - // the DoubleSpace & SpaceDouble flags seem redundant. The 2nd line was added for foldout - // line spacing for IP2 foldouts (one example can be found in E-1) - if (!itemInfo.FormatStepData.SpaceDouble && itemInfo.MyParent.IsHigh) - { - // but it we are in single column mode, don't remove the blank line. (Wolf Creek Admin Instructions - wcn1) - if ((itemInfo.MyActiveSection as SectionInfo).SectionConfig.Section_ColumnMode != SectionConfig.SectionColumnMode.One) - yoff = YOffset = yoff - SixLinesPerInch; - } - else if (itemInfo.FormatStepData.NoSpaceMultipleRNOs) yoff = YOffset = yoff - SixLinesPerInch; - if (itemInfo.FormatStepData.DoubleSpace && itemInfo.FormatStepData.SpaceDouble) yoff = YOffset = yoff + SixLinesPerInch; - } - AddMacros(itemInfo, mytab); - if (mytab != null) - { - mytab.YOffset = yoff; - if (mytab.MyMacro != null) mytab.MyMacro.YOffset = yoff; - } - // For background formats, HLS's or Caution or any Notes have tab on line and then text - // on line below (with space in between) - if (itemInfo.IsBackgroundStep() && itemInfo.MyTab != null && itemInfo.MyTab.AltPrintTab != null && itemInfo.MyTab.AltPrintTab.Trim() != "") - yoff = YOffset = yoff + (2 * SixLinesPerInch); - CheckOff co = itemInfo.GetCheckOffStep(); - float yForCheckoff = yoff; //0; - default checkoff row is same as FIRST line of text - // if dropCheckoff is true, then the checkoff is place on the same of row as the LAST line of text - bool dropCheckoff = itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.DropCheckOff - || (co != null && co.DropCheckOff); - if (itemInfo.MyContent.MyGrid != null) - { - vlnCells.DefaultFont = itemInfo.FormatStepData.Font.WindowsFont;// Set the default text font based upon the format - int profileDepth1 = ProfileTimer.Push(">>>> Before vlnParagraph.Grid"); - //Use Static MyFlexGrid - BWD INST2 - FlexGrid Errors - MyFlexGrid.LoadGrid(itemInfo); - MyGrid = new vlnTable(MyFlexGrid, cb); - Height = MyGrid.Height; - Width = MyGrid.Width; - // Adjust the XOffset before determining if the table will overlap the RNO column RHM 20150529 - CalculateXOffsetGridOrFigure(itemInfo, maxRNO, formatInfo); - - yoff = AdjustLocIfLongerRNO(itemInfo, yoff, yoffRightParent); - // if the table does not have a border, only move down one line: - float yoffForBorder = 2 * SixLinesPerInch; - if (MyFlexGrid.BorderStyle == C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None && !MyFlexGrid.TopRowHasBorder()) - yoffForBorder -= SixLinesPerInch; - //yForCheckoff = yoff + Height - SixLinesPerInch; - if (dropCheckoff) - yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text - yoff += (Height + yoffForBorder); //(2 * SixLinesPerInch)); - yoff = (float)Math.Ceiling(yoff); - ProfileTimer.Pop(profileDepth1); - } - else if (itemInfo.IsRtfRaw) - { - CalculateXOffsetGridOrFigure(itemInfo, maxRNO, formatInfo); - YOffset = yoff; - yoff += Height * .6f; // .6 is used as a scale factor in RtfRawAt (rtf2pdf). Use it here too for moving down page after equation. - yoff = (float)Math.Ceiling(yoff); - yoff += AdjustForBlankLines(); - } - else if (itemInfo.IsFigure) // if a figure we've got to determine the size: - { - int profileDepth2 = ProfileTimer.Push(">>>> Before vlnParagraph.Figure"); - string erMsg = null; - if (itemInfo.MyContent.Text != null) // ro image - { - ProcedureInfo proc = itemInfo.MyProcedure; - DocVersionInfo dvi = proc.MyDocVersion; - ROFstInfo rofst = dvi.DocVersionAssociations[0].MyROFst; - //rofst.docVer = dvi; - ROFSTLookup lookup = rofst.GetROFSTLookup(dvi); - string linkInfoText = itemInfo.MyContent.Text.Replace(@"\v ", ""); - Match m = Regex.Match(linkInfoText, @"(.*)[#]Link:([A-Za-z]*):(.*)"); - string val = null; - if (m.Length > 0) // if m.lengh is zero, then no match was found - no RO was entered in the figure substep - { - if (m.Groups.Count < 4) - { - //erMsg = "RO was not found during data migration."; - // added newlines in the RO number (shown in figure substep type with figure RO) - // if we are here, then there is no RO link information, use this number to find the RO image to print - val = string.Format("{0}\n{1}\n{2}\n{3}", - linkInfoText.Substring(0, linkInfoText.Length - 16), - linkInfoText.Substring(linkInfoText.Length - 16, 8), - linkInfoText.Substring(linkInfoText.Length - 8, 4), - linkInfoText.Substring(linkInfoText.Length - 4, 4)); - val = val.Replace(@"\u8209?", "-").Replace(@"\u9586?", @"\"); // replace dash and backslash symbols with dash and backslash characters - } - else - { - string[] subs = m.Groups[3].Value.Split(" ".ToCharArray()); - val = lookup.GetRoValue(subs[1]); - if (val == null || val == "?") val = lookup.GetRoValue(subs[1].Substring(0, 12)); - if (val == "?") - { - erMsg = string.Format("Referenced Object does not exist."); - _MyLog.WarnFormat("\r\nMissing Referenced Object {0} in {1}", subs[1], itemInfo.ShortPath); - yoff += 2 * SixLinesPerInch; - } - } - } - GC.Collect(); // memory garbage collection (Regex memory bug) - if (val != null && val != "?") - { - string[] vals = val.Split("\n".ToCharArray()); - Width = Int32.Parse(vals[3], System.Globalization.NumberStyles.AllowHexSpecifier) * MyItemInfo.FormatStepData.Font.CharsToTwips; - int lines = Int32.Parse(vals[2], System.Globalization.NumberStyles.AllowHexSpecifier); - // Check that the Height of figure isn't too big to fit on the page, if it is - // set the Height to the printable part of page - Height of the HLS and an extra line - // for between HLS & figure. - float h1 = lines * SixLinesPerInch; - float h2 = RoughSizeOfPage - MyParent.Height - SixLinesPerInch; - Height = Math.Min(h1, h2); - if (h1 > h2) - { - Width *= (h2 / h1); - } - StepConfig sc = new StepConfig(MyItemInfo as StepInfo); - if (sc != null && sc.Step_ImageWidth != 0) - { - Width = sc.Step_ImageWidth; - Height = sc.Step_ImageHeight; - } - yoff = AdjustLocIfLongerRNO(itemInfo, yoff, yoffRightParent); - if (dropCheckoff) - yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text - bool noborder = MyItemInfo.FormatStepData.Type.ToUpper().Contains("BORDERLESS"); - yoff += (Height + ((noborder ? 1 : 2) * SixLinesPerInch)); // RHM 20120925 - Eliminate extra space after Figure } - try - { - ROImageInfo roImage = ROImageInfo.GetByROFstID_FileName(rofst.ROFstID, vals[0]); - if (roImage != null) - ImageText = val; - else - { - roImage = rofst.GetROImageByFilename(vals[0], MyItemInfo);// need code to go and get an ROImaage if it exists - if (roImage == null) - erMsg = string.Format("Image {0} does not exist.", vals[0]); - else - ImageText = val; - } - } - catch (Exception ex) - { - erMsg = string.Format("Image {0} does not exist, error = {1}.", vals[0], ex.Message); - } - } - if (erMsg != null) Rtf = GetRtf(erMsg, itemInfo.ActiveFormat.PlantFormat.FormatData.Font); - CalculateXOffsetGridOrFigure(itemInfo, maxRNO, formatInfo); - } - else - { - // figure - ImageText = "figure"; - } - if (ImageText == null && erMsg == null) - { - ImageText = "figure"; - ImageConfig ic = new ImageConfig(MyItemInfo.MyContent.MyImage); - // B2016-277: add a try catch in case of there being 'bad' data in the text field for an image/figure - try - { - byte[] idata = (ic != null && ic.Image_DataSize > 0) ? ROImageInfo.Decompress(MyItemInfo.MyContent.MyImage.Data, ic.Image_DataSize) : MyItemInfo.MyContent.MyImage.Data; - MemoryStream ms = new MemoryStream(idata); - System.Drawing.Image img = System.Drawing.Image.FromStream(ms); - Width = img.Width; - Height = img.Height; - if (ic != null && ic.Image_Height != 0) - { - Width = ic.Image_Width; - Height = ic.Image_Height; - } - yoff = AdjustLocIfLongerRNO(itemInfo, yoff, yoffRightParent); - bool noborder = MyItemInfo.FormatStepData.Type.ToUpper().Contains("BORDERLESS"); - yoff += (Height + ((noborder ? 2 : 3) * SixLinesPerInch)); - CalculateXOffsetGridOrFigure(itemInfo, maxRNO, formatInfo); - } - catch (Exception ex) - { - _MyLog.WarnFormat("Bad figure content data: item = {0}, {1}", MyItemInfo.ItemID, MyItemInfo.ShortPath); - } - } - ProfileTimer.Pop(profileDepth2); - } - else - { - // For Calvert Alarms, the 'CONDITION/RESPONSE' portion uses a macro to print - // the CONDITION and RESPONSE text with the lines around it. Add the macro here because - // there is no tab for the step & that's where the macro is usually stored: - if (HasCalvertMacro) PartsLeft.Add(new vlnMacro(xoff - 12f, yoff, "H4")); - - //if (itemInfo.IsSection) - // Rtf = GetRtf(itemInfo, prefix, " (Continued)"); - //else - // BuildRtf(); // not necessary, RTF is lazyloaded - if (itemInfo.IsStep && itemInfo.MyHLS != null && itemInfo.MyHLS.FormatStepData.UseSmartTemplate) - { - if (itemInfo.FormatStepData.StepLayoutData.AlignWithParentTab - || (itemInfo.Steps != null && itemInfo.Steps.Count > 0 && itemInfo.Steps[0].FormatStepData.StepLayoutData.AlignWithParentTab)) - { - int stplevl = TheStepLevel(itemInfo); - if (stplevl >= 0 && MyItemInfo.MyHLS.FormatStepData.VertPos[stplevl] > 0) - { - if (MyItemInfo.FormatStepData.StepPrintData.Justify == "Center") - { - string[] vertPos = MyItemInfo.MyHLS.FormatStepData.VertPos.Split(",".ToCharArray()); - float hloc = (float.Parse(vertPos[stplevl]) + ((float.Parse(vertPos[stplevl + 1]) - float.Parse(vertPos[stplevl])) / 2)); - Chunk chk = (Chunk)IParagraph.Chunks[0]; - hloc = hloc - (chk.GetWidthPoint() / 2); - XOffset = hloc + (float)itemInfo.MyDocStyle.Layout.LeftMargin; - } - else - XOffset = float.Parse(MyItemInfo.MyHLS.FormatStepData.VertPos.Split(",".ToCharArray())[stplevl]) + (float)itemInfo.MyDocStyle.Layout.LeftMargin; - } - } - } - if (itemInfo.IsTablePart) // Not for grid, this is for old-style tables. - { - Width = GetTableWidth(cb, IParagraph, MyItemInfo.MyDocStyle.Layout.PageWidth); - CalculateXOffsetGridOrFigure(itemInfo, maxRNO, formatInfo); - } - else - if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null && (itemInfo.IsHigh || (!itemInfo.IsHigh && itemInfo.MyContent.Type != itemInfo.MyParent.MyContent.Type))) XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); - - // point beach wpb subformats 20 & 22 were printing some text past right margin. Limit the width to the right margin, i.e. pagewid - if (itemInfo.ActiveFormat.MyStepSectionPrintData.LimitWidToPageWid) - { - float lim = (MyTab == null ? (XOffset - (float)itemInfo.MyDocStyle.Layout.LeftMargin) : MyTab.XOffset + MyTab.Width) + Width; - float docStyleLim = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin; - - if (lim > docStyleLim) - { - WidthNoLimit = Width; // Use this width to calculate childrens' width, without this, code was making children to narrow! - Width = docStyleLim - (MyTab == null ? (XOffset - (float)itemInfo.MyDocStyle.Layout.LeftMargin) : MyTab.XOffset + MyTab.Width); - } - } - if (itemInfo.IsSection && ShowSectionTitles - && !MyItemInfo.MyDocStyle.CancelSectTitle) - { - if (MyItemInfo.MyDocStyle.Layout.SectionMacro != null) - { - string macro = GetMacroName(MyItemInfo.MyDocStyle.Layout.SectionMacro); - PartsAbove.Add(new vlnMacro(xoff, yoff, macro)); - yoff += SixLinesPerInch; - YOffset = yoff; - } - } - - // if this step has a prefix but it's not checklist... do a partsleft for prefix - if (_MyItemInfo.IsStep && !_MyItemInfo.FormatStepData.UseSmartTemplate) - { - if (_MyItemInfo.FormatStepData.Prefix != null && _MyItemInfo.FormatStepData.Prefix != "") - { - string pref = _MyItemInfo.FormatStepData.Prefix.Replace("{Backspace}", ""); - float xPref = XOffset - (pref.Length * (72 / (float)_MyItemInfo.FormatStepData.Font.CPI)); - E_Style es = (E_Style)_MyItemInfo.FormatStepData.Font.Style & E_Style.Bold; - VE_Font tmpFont = new VE_Font(_MyItemInfo.FormatStepData.Font.Family, (int)_MyItemInfo.FormatStepData.Font.Size, es, (float)_MyItemInfo.FormatStepData.Font.CPI); - PartsLeft.Add(new vlnText(cb, this, pref, pref, xPref, yoff, tmpFont)); - } - } - // If checklists, the substeps are printed in a row, need to keep track of the 'longest' in - // y direction (bottommost) across the row. - if (itemInfo.IsStep && itemInfo.MyHLS != null && (itemInfo.MyHLS.FormatStepData.UseSmartTemplate || (itemInfo.MyHLS.FormatStepData.UseOldTemplate && itemInfo.MyDocStyle.ComponentList)) && (TheStepLevel(itemInfo) >= 0)) - savCheckListBottomMost = yoff + Height + (itemInfo.MyHLS.FormatStepData.UseSmartTemplate ? SixLinesPerInch : 0); - - // The following was added for BGE valve lists, this format (BGEVLV) used caution1 as - // a subheader within the valve list. To print correctly, a line needs to be added to - // where the bottom of this (subheader) is located and XOffset is set to the leftmargin. - if (itemInfo.IsStep && itemInfo.MyHLS != null && !itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && itemInfo.IsCaution1 && itemInfo.MyHLS.FormatStepData.UseOldTemplate && itemInfo.MyDocStyle.ComponentList) - { - savCheckListBottomMost += SixLinesPerInch; - yoff += Height; - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - } - - if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && itemInfo.IsCaution1) savCheckListBottomMost = yoff + Height; - // Get Y offset for regular steps, or if section title is output or if not within row (not last column of - // text) for wcn checklist, i.e. - if ((!itemInfo.IsStepSection && itemInfo.MyHLS != null && !itemInfo.MyHLS.FormatStepData.UseSmartTemplate) // regular step - || (ShowSectionTitles - && !MyItemInfo.MyDocStyle.CancelSectTitle - && !MyItemInfo.MyDocStyle.SpecialStepsFoldout) - // In Checklist: I don't have children or if I have children the first child doesn't alignwithparent. - || (!itemInfo.IsStepSection && itemInfo.MyHLS != null && itemInfo.MyHLS.FormatStepData.UseSmartTemplate - && ((itemInfo.Steps == null || itemInfo.Steps.Count == 0) - || !itemInfo.Steps[0].FormatStepData.StepLayoutData.AlignWithParentTab)) - || ((MyItemInfo.IsNote || MyItemInfo.IsCaution) && MyItemInfo.MyParent.IsSection)) // B2016-222 check if is a caution or note and parent is a section - { - bool doprint = !(MyPageHelper.DidHLSText && MyItemInfo.ItemID == MyPageHelper.HasHLSTextId); - if (MyItemInfo.IsSection) - { - SectionConfig sch = MyItemInfo.MyConfig as SectionConfig; - if (sch != null && sch.Section_PrintHdr != "Y") doprint = false; - } - if (doprint && !UseTemplateKeepOnCurLine(itemInfo)) - { - float tyoff = yoff; - if (itemInfo.Steps != null) - { - if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.Type == "TitleWithTextRight") - if (loadChildren) tyoff = ChildrenRight.Add(cb, itemInfo.Steps, XOffset + 72, yoff, yoff, rnoLevel, maxRNO, formatInfo); - } - yoff += Height; - yoff = Math.Max(yoff, tyoff); - yoff += AdjustForBlankLines(); - if (dropCheckoff) - yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text - } - } - } - if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) - { - // For Calvert Alarms, the row has formatting that makes this template item have a header & box - // (CONDITION/RESPONSE), header with box around it is defined in genmac whereas the lines around - // substeps are drawn in pagehelper. Adjust some yoffsets around this box. - // Need to: - // 1) move the text down a bit for top line (1.5f * SixLinesPerInch) - // 2) move the substep down 2 lines (2 * SixLinesPerInch) for bottom of box - // and space before substep - // 3) if the previous item had this condition, add space for the - // line below. - if (HasCalvertMacro) - { - YOffset += (1.5f * vlnPrintObject.SixLinesPerInch); - yoff += (2 * vlnPrintObject.SixLinesPerInch); - } - if (itemInfo.MyPrevious != null && itemInfo.MyPrevious.TemplateIndex > 0) - { - if (itemInfo.MyPrevious.ActiveFormat.PlantFormat.FormatData.Templates[itemInfo.MyPrevious.TemplateIndex].hmacro > 0) - { - YOffset += (3 * vlnPrintObject.SixLinesPerInch); - yoff += (3 * vlnPrintObject.SixLinesPerInch); - } - } - } - if (co != null) - { - // if this item's content is empty, and the flag is set to 'notonempty', don't print out the - // checkoff - this was added for shearon harris: - if (!(co.NotOnEmpty && itemInfo.MyContent.Text.Replace(@"\u160?", " ").TrimEnd() == "")) - { - float xloc_co = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - // if the format has 'SkipSpaces', look at the tab, and back up the macros to the number of - // spaces in the tab. - if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.SkipSpaces) - { - if (mytab != null) - xloc_co = mytab.XOffset; - else - xloc_co = XOffset; //there's no tab - put checkoff at step's xoff. Macro should back up from step's x. - } - else - { - if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation != 0) - xloc_co += (float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation; - else if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.RelXLocation != 0) - { - float relX = (float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.RelXLocation; - xloc_co = XOffset + (relX > 0 ? Width : 0) + relX; - } - } - // CheckOffXtraLines was introduced for the additional lines needed for the longer signoffs - // for VCBA (&WST1), for F2016-061. - float checkOffNumberOfLines = (co.CheckOffNumberOfLines ?? 0); - if (checkOffNumberOfLines > 0) - { - yForCheckoff += (2 * SixLinesPerInch); - PartsRight.Add(new vlnMacro(xloc_co, yForCheckoff/* + xtraCheckOffLines */, co.Macro)); - yoff += ((checkOffNumberOfLines *= SixLinesPerInch) + (2 * SixLinesPerInch)); - } - else - { - // if xtraCheckOffLines is a negative number, start the checkoff on the same line - // as text and adjust the y-offset after the checkoff by the amount of the absolute - // value of xtraCheckOffLines. - // if xtraCheckOffLines is a positive number, start the checkoff xtraCheckOffLines - 1 - // down from the text and adjust the y-offset after the checkoff by the amount - // of xtraCheckOffLines. - float xtraCheckOffLines = (co.CheckOffXtraLines ?? 0); - if (xtraCheckOffLines < 0) - { - xtraCheckOffLines = -xtraCheckOffLines; - xtraCheckOffLines *= SixLinesPerInch; - PartsRight.Add(new vlnMacro(xloc_co, yForCheckoff/* + xtraCheckOffLines */, co.Macro)); - yoff += xtraCheckOffLines; - } - else - { - xtraCheckOffLines *= SixLinesPerInch; - xtraCheckOffLines -= ((xtraCheckOffLines > 0) ? SixLinesPerInch : 0); - PartsRight.Add(new vlnMacro(xloc_co, yForCheckoff + xtraCheckOffLines, co.Macro)); - yoff += (xtraCheckOffLines != 0) ? xtraCheckOffLines + SixLinesPerInch : 0; - } - } - } - } - // for WCNTRN, do the responsibility: - if (formatInfo.PlantFormat.FormatData.PrintData.WCNTraining) DoResponsibility(cb, YOffset); - float yOffRight = yoff; - float RnoOffset = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO); - if (DoSubs && rnoLevel < maxRNO && itemInfo.RNOs != null) - { - if (loadChildren) yOffRight = ChildrenRight.Add(cb, itemInfo.RNOs, XOffset + RnoOffset, YTop, YTop, rnoLevel + 1, maxRNO, formatInfo); - if (ChildrenRight[0].ChildrenAbove.Count > 0) - { - float adj = ChildrenRight[0].YOffset - YOffset; - YOffset = ChildrenRight[0].YOffset; - yoff += adj; - if (MyTab != null) MyTab.YOffset = ChildrenRight[0].YOffset; - if (PartsRight.Count > 0) PartsRight[0].YOffset = ChildrenRight[0].YOffset; - if (ChildrenAbove.Count == 0) - YTopMost = ChildrenRight[0].ChildrenAbove[0].YOffset; - else - YTopMost = ChildrenAbove[0].YOffset; - } - } - // if this hls had a box drawn, add a line for substeps. - if (itemInfo.IsHigh && ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS)) yoff += vlnPrintObject.SixLinesPerInch; - - // Need code to determine if the table will overlap the Right Column if it does then - // use YOffRight rather than yoff - if (DoSubs && itemInfo.Tables != null) - { - bool aerTableOrFigure = itemInfo.Tables[0].FormatStepData.Type.Contains("AER"); - // get the first table & see if it is borderless. If borderless, 16bit code removed a - // line (yoffset) before printing it: - float yoffadj = 0; - if (itemInfo.Tables[0].IsTable) - { - MyFlexGrid.LoadGrid(itemInfo.Tables[0]); - if (MyFlexGrid.BorderStyle == C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None && !MyFlexGrid.TopRowHasBorder()) - yoffadj = -SixLinesPerInch; - } - - if (yOffRight < yoffRightParent) yOffRight = yoffRightParent; - // find the very bottom Yoffset (don't do this is in single column mode for cautions/notes: B2016-261) - vlnParagraph parentPar = parent; - if (!((MyItemInfo.IsCaution || MyItemInfo.IsNote) && itemInfo.RNOLevel == 0)) - { - while (parentPar != null && parentPar.MyItemInfo.IsStep) - { - float vb = parentPar.YVeryBottom; - if (yOffRight < vb) yOffRight = vb; - parentPar = parentPar.MyParent; - } - } - bool rightLonger = yOffRight > yoff; - if (!aerTableOrFigure && itemInfo.RNOLevel == 0) // Centered Table - { - if (loadChildren) - yoff = ChildrenBelow.Add(cb, itemInfo.Tables, XOffset, rightLonger ? yOffRight : yoff + yoffadj, yOffRight + yoffadj, rnoLevel, maxRNO, formatInfo); - } - else // AER or RNO Table - if (loadChildren) - yoff = ChildrenBelow.Add(cb, itemInfo.Tables, XOffset, yoff + yoffadj, yOffRight + yoffadj, rnoLevel, maxRNO, formatInfo); - } - yOffRight = Math.Max(yOffRight, yoffLeft); - // Look for the meta section case where the 'Editable' flag is set to 'N', which means that - // these steps should not be printed: - bool printsteps = true; - if (itemInfo.Steps != null && itemInfo.IsSection && itemInfo.Sections != null && itemInfo.Sections.Count > 0) - { - SectionConfig sc = itemInfo.MyConfig as SectionConfig; - if (sc != null && sc.SubSection_Edit != "Y") printsteps = false; - } - bool rnoBefore = false; - bool rnoAfter = false; - if (rnoLevel >= maxRNO && itemInfo.RNOs != null && - !itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.WolfCreekBackgroundFormat && - !itemInfo.RNOs[0].FormatStepData.InPageList) - { - if ((itemInfo.ActiveFormat.MyStepSectionPrintData.HLRNOStpSeparatorString ?? "") != "" || - (itemInfo.ActiveFormat.MyStepSectionPrintData.HLStpSeparatorString ?? "") != "") - rnoBefore = true; - else - rnoAfter = true; - } - if (rnoBefore) - { - if ((itemInfo.ActiveFormat.MyStepSectionPrintData.HLStpSeparatorString ?? "") != "") - { - string tmpSepStr = itemInfo.ActiveFormat.MyStepSectionPrintData.HLStpSeparatorString; - float tmpSepLen = itemInfo.ActiveFormat.MyStepSectionPrintData.HLStpSeparatorString.Length; - float xsep = MyHighLevelParagraph.PartsLeft.Count > 0 ? MyHighLevelParagraph.PartsLeft[0].XOffset : MyHighLevelParagraph.XOffset; - vlnRNOSeparator mySep = new vlnRNOSeparator(this, cb, tmpSepStr, xsep, yoff, itemInfo.ActiveFormat, false); - PartsBelow.Add(mySep); - yoff += mySep.Height;// +SixLinesPerInch; - } - if (loadChildren) yoff = ChildrenBelow.Add(cb, itemInfo.RNOs, MyTab.XOffset, yoff, yoff, rnoLevel + 1, maxRNO, formatInfo); - if ((itemInfo.ActiveFormat.MyStepSectionPrintData.HLRNOStpSeparatorString ?? "") != "") - { - string tmpSepStr = itemInfo.ActiveFormat.MyStepSectionPrintData.HLRNOStpSeparatorString; - float tmpSepLen = itemInfo.ActiveFormat.MyStepSectionPrintData.HLRNOStpSeparatorString.Length; - float xsep = MyHighLevelParagraph.PartsLeft.Count > 0 ? MyHighLevelParagraph.PartsLeft[0].XOffset : MyHighLevelParagraph.XOffset; - vlnRNOSeparator mySep = new vlnRNOSeparator(this, cb, tmpSepStr, xsep, yoff, itemInfo.ActiveFormat, false); - PartsBelow.Add(mySep); - yoff += mySep.Height;// +SixLinesPerInch; - } - } - // For Calvert Alarms, 'Caution1' was used to implement the Annunciator Window, i.e. is printed - // below the HLS and close to the right margin. - if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && itemInfo.Cautions != null && itemInfo.Cautions[0].FormatStepData.Type == "Caution1") - { - if (loadChildren) - yoff = ChildrenBelow.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); - savCheckListBottomMost = yoff; - } - if (DoSubs && itemInfo.Steps != null && printsteps) - { - if (itemInfo.FormatStepData == null || itemInfo.FormatStepData.Type != "TitleWithTextRight") - if (rnoBefore) - { - if (loadChildren) - yoff = ChildrenBelow.Add(cb, itemInfo.Steps, MyTab.XOffset, yoff, yOffRight, rnoLevel, maxRNO, formatInfo); - } - else - if (loadChildren) yoff = ChildrenBelow.Add(cb, itemInfo.Steps, XOffset, yoff, yOffRight, rnoLevel, maxRNO, formatInfo); - } - if (itemInfo.Sections != null) - if (loadChildren) - yoff = ChildrenBelow.Add(cb, itemInfo.Sections, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo, pp); - if (itemInfo.Procedures != null) - if (loadChildren) - yoff = ChildrenBelow.Add(cb, itemInfo.Procedures, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); - // Don't add the RNO to print if doing backgrounds. That piece of data is part of the pagelist item. - if (rnoAfter) - if (loadChildren) - yoff = ChildrenBelow.Add(cb, itemInfo.RNOs, XOffset, yoff, yoff, rnoLevel + 1, maxRNO, formatInfo); - yoff = Math.Max(yoff, yOffRight); - // TODO - use RNOSepAfterAER flag too: - string tmpRnoSepStr = formatInfo.MyStepSectionPrintData.RNOSepString; - float tmpRnoSepLen = formatInfo.MyStepSectionPrintData.RNOSepLineLength ?? 0; - if (rnoLevel < maxRNO && itemInfo.RNOs != null && (tmpRnoSepStr != null || tmpRnoSepLen != 0)) - { - vlnParagraph rno = ChildrenRight[0]; - vlnParagraph bottomChild = BottomChild; - float xsep = MyHighLevelParagraph.XOffset + RnoOffset; - - // ip3 has an rno separator and also has asterisk boxes around continous HLS. If - // the hls has RNOs off of it, then the rno separator line is outside of the box. If - // there are RNOs, but not off of HLS, then rno separator line is within the box (this is - // how 16bit proms did this). The following use of yadjSep and YBottomForBox handle that - float yadjSep = (MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex != null && MyItemInfo.MyHLS.FormatStepData.StepLayoutData.STBoxindex >= 0 && - MyItemInfo.MyHLS.RNOs != null && MyItemInfo.MyHLS.RNOs.Count > 0) ? 2 * SixLinesPerInch : 0; - vlnRNOSeparator myRnoSep = new vlnRNOSeparator(this, cb, tmpRnoSepStr, xsep, yoff+yadjSep, formatInfo, bottomChild == null ? true : bottomChild.MyItemInfo.HasChangeBar); - // TODO: May need to handle more than one RNO column for RNO Separator - if ((rno.LastRNO.MyItemInfo.HasChangeBar == false && bottomChild != null && bottomChild.MyItemInfo.HasChangeBar) - || (bottomChild != null && bottomChild.YBottom > rno.LastRNO.YBottomMost)) - bottomChild.PartsBelow.Add(myRnoSep); - else - rno.LastRNO.PartsBelow.Add(myRnoSep); - MyHighLevelParagraph.YBottomForBox = 0; - if (yadjSep > 0) - { - MyHighLevelParagraph.YBottomForBox = yoff; // if hlrno, box before sep - YBottomMostAdjust = SixLinesPerInch; // added for IP3 pagination, the RNO separator is outside asterisk box - } - yoff += (myRnoSep.Height + SixLinesPerInch); - } - // if in WCNTRN (Wolf Creek Training), need to consider the ysize of the Responsibility text when setting - // YBottomMost, i.e. if the Responsibilty has more height (y-direction) compared to the actual step text, - // need to move down on page the height of the responsibility. - if (formatInfo.PlantFormat.FormatData.PrintData.WCNTraining && MyItemInfo.IsHigh) - { - if (PartsLeft.Count > 0 && PartsLeft[0] is vlnText) - { - foreach (vlnText vt in PartsLeft) - yoff = Math.Max(yoff, vt.YOffset + vt.Height); - } - } - YBottomMost = yoff; - - if ((MyItemInfo.IsHigh || MyItemInfo.IsCaution1) && MyItemInfo.MyDocStyle.LandscapePageList && MyItemInfo.MyDocStyle.ComponentList) - { - // put out line after step (for BGEVLV format) - float macroY = YBottomMost-(0.25f * SixLinesPerInch); - PartsLeft.Add(new vlnMacro((float)MyItemInfo.MyDocStyle.Layout.LeftMargin, macroY, "B9")); - } - - // For Checklist, the substeps are in rows of data. The YBottomMost is the bottom most for - // the row. - if (savCheckListBottomMost != 0) YBottomMost = Math.Max(savCheckListBottomMost, YBottomMost); - if (XOffsetCenter != null) XOffset = (float)XOffsetCenter; - ProfileTimer.Pop(profileDepth); - } - - private vlnTab GetSupInfoTab(PdfContentByte cb, ItemInfo itemInfo, float yoff, vlnTab mytab, bool doSectTab, float localXOffset) - { - string strmytab = null; - if (itemInfo.MyParent.IsHigh) - strmytab = itemInfo.MyTab.CleanText; - else if (itemInfo.MyParent.IsCaution) - strmytab = "Caution"; - else if (itemInfo.MyParent.IsNote) - strmytab = "Note"; - else - strmytab = ItemInfo.GetCombinedTab(itemInfo.MyParent, itemInfo.MyParent.MyParent.CombinedTab); - strmytab = strmytab.Trim(); - mytab = new vlnTab(cb, this, strmytab, strmytab, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline); - return mytab; - } - private static VE_Font _AnnotationFont; - public static VE_Font AnnotationFont - { - get { return vlnParagraph._AnnotationFont; } - set { vlnParagraph._AnnotationFont = value; } - } - private void DoAnnotationPrintableText(PdfContentByte cb, ItemInfo itemInfo, float yoff) - { - // if this step has an Annotation and it has config data to define location, parse out '[xx]' and print it at the location - // this was added for VC Summer (unit 2 & 3) but is available for any data that has defined the location in the config (from the folder properties - // at the top node - annotationtype tab. - if (itemInfo.ItemAnnotationCount > 0) - { - foreach (AnnotationInfo ai in itemInfo.ItemAnnotations) - { - // get the annotation type from the annotation, and see if it has a print location: - AnnotationTypeInfo at = ai.MyAnnotationType; - AnnotationTypeConfig atc = new AnnotationTypeConfig(at.Config); - if (atc.PrintableText_XLocation != 0) - { - int st = ai.SearchText.IndexOf("["); - int end = ai.SearchText.IndexOf("]"); - if (st != -1 && end != -1 && end > st) - { - string pref = ai.SearchText.Substring(st+1, end - st - 1); // annotation - parse out [xx] - pref = Regex.Replace(pref,"{Up}",@"\u8593?", RegexOptions.IgnoreCase); - pref = Regex.Replace(pref,"{Down}",@"\u8595?", RegexOptions.IgnoreCase); - float xPref = atc.PrintableText_XLocation; - if(AnnotationFont==null) - AnnotationFont = new VE_Font(_MyItemInfo.FormatStepData.Font.Family,6,(E_Style)_MyItemInfo.FormatStepData.Font.Style,20F); - PartsLeft.Add(new vlnText(cb, this, pref, pref, xPref, yoff, AnnotationFont)); - break; - } - } - } - } - } - - private float AdjustLocIfLongerRNO(ItemInfo itemInfo, float yoff, float yoffRightParent) - { - if (!itemInfo.IsInRNO && yoffRightParent > yoff && itemInfo.FormatStepData.Type.Contains("AER")) - { - // is the width of this table going to cause the table to overlap the RNO - vlnParagraph parRno = FindParentRNO(); - float xMinRno = FindMinXOffsetRno(parRno); - if (XOffset + Width > xMinRno - 12) // 12 = 2 characters, so that tables don't almost touch & look like an overlap - { - if ((float)MyItemInfo.MyDocStyle.Layout.LeftMargin + Width > xMinRno) - { - yoff = yoffRightParent; - YOffset = yoff; - } - else - XOffset = (float)MyItemInfo.MyDocStyle.Layout.LeftMargin; - } - } - return yoff; - } - private float FindMinXOffsetRno(vlnParagraph parRno) - { - // Find the minimum xoffset in the rno column that overlaps in the y direction with - // the table that is currently being processed. This is necessary in order to fix the - // case where the AER table overlaps an RNO table (or tab/text) - float xcur = 0; - // YOffset/Height is for the current table, check it against the rno's yoffset & height - // if aer & rno are within y range of each other - if (YOffset <= (parRno.YOffset + parRno.Height) && (YOffset + Height) >= parRno.YOffset) - { - xcur = parRno.XOffset; - if (parRno.MyTab != null) xcur = parRno.MyTab.XOffset; - } - // recursively look at steps in the rno column to get the smallest xoffset which will - // then be used to compare to table's xoffset/width to see if there is an overlap - if (parRno.ChildrenBelow != null) - { - foreach (vlnParagraph vp in parRno.ChildrenBelow) - { - // yoffset is past where the table is, so don't consider it: - if (vp.YOffset > (YOffset + Height)) return xcur; - - float xchild = FindMinXOffsetRno(vp); - if (xchild > 0 && (xcur == 0 || xchild < xcur)) - xcur = xchild; - } - } - return xcur; - } - private void DoResponsibility(PdfContentByte cb, float yoff) // WCNTRN's text in 1st column (saved in config for HLS) - { - StepConfig sc2 = MyItemInfo.MyConfig as StepConfig; - if (sc2 != null) - { - string resp = sc2.Step_Responsibility; - - if (resp != null && resp != "") // lines are separated by "\r\n" - { - resp = DelimitResponse((int)MyItemInfo.MyDocStyle.SectTop.MaxLen, resp); - if (!resp.EndsWith("\r\n")) resp = resp + "\r\n"; // parsing needs this. - int indx = resp.IndexOf("\r\n"); - int stindx = 0; - float y = yoff; - while (indx > -1) - { - string subresp = resp.Substring(stindx, indx - stindx); - float respWidth = subresp.Length * 6; - float ctr = (float)MyItemInfo.MyDocStyle.SectTop.Margin; - float respcntrX = (float)MyItemInfo.MyDocStyle.Layout.LeftMargin + ctr - (respWidth / 2); - vlnText myResp = new vlnText(cb, this, subresp, subresp, respcntrX, y, MyItemInfo.FormatStepData.Font); - PartsLeft.Add(myResp); - y += SixLinesPerInch; - stindx = indx + 2; - indx = stindx < resp.Length ? resp.IndexOf("\r\n", stindx) : -1; - } - } - } - } - private string DelimitResponse(int maxLen, string responsStr) - { - // This code handles whether user enters \r\n to separate lines or not. The - // max width that a line can be in the Responsibility column is a format flag (passed in) - List results = new List(); - int width = 0; // keep track of current width of current 'line' while looking for space to break - int start = 0; // start of line (index into string 'text') - int lastspace = 0; // location of lastspace (index into string) - for (int indx = 0; indx < responsStr.Length; indx++) - { - if ((indx + 1) < responsStr.Length && responsStr.Substring(indx, 2) == "\r\n") - { - results.Add(responsStr.Substring(start, indx - start).Trim(" ".ToCharArray()) + "\r\n"); - start = indx + 2; - width = 0; - } - else - { - if (responsStr[indx] == ' ') lastspace = indx; - width++; - if (width > maxLen) - { - // what should be done if lastspace == 0 - // cannot find space char to split on, so break the word - bool spFound = true; - if (lastspace == 0) - { - lastspace = indx; - spFound = false; - } - results.Add(responsStr.Substring(start, lastspace - start).Trim(" ".ToCharArray()) + "\r\n"); - start = lastspace + (spFound?1:0); // increment start based on whether a space is found, i.e. if no space keep at 'indx' - // width either is equal to width of text after the last space, or is zero if at the maxlen of width: - width = (indx - lastspace - 1) > 0 ? indx - lastspace - 1 : 0; - lastspace = 0; - } - } - } - if (width > 0 || start < responsStr.Length) results.Add(responsStr.Substring(start).Trim(" ".ToCharArray())); - string retval = null; - foreach (string st in results) retval = retval + st; - return retval; - } - public override string Rtf - { - get - { - if(_Rtf == null)BuildRtf(); - return _Rtf; - } - set { _Rtf = value; } - } - private void BuildRtf() - { - int profileDepth = ProfileTimer.Push(">>>> BuildRtf"); - if (_Rtf == null) - { - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && MyItemInfo.IsCaution1 && - MyItemInfo.MyContent.Text.StartsWith(@"\u") && !MyItemInfo.MyContent.Text.StartsWith(@"\u160?")) - { - Rtf = GetRtf(MyItemInfo, " " + (Prefix ?? ""), Suffix); - PrefixSpecialCharacter = true; - } - else - { - Rtf = GetRtf(MyItemInfo, Prefix, Suffix); - } - // Need the following with some modifications for WCNCKL format: - if (Rtf.Contains("{Backspace}")) - { - XOffset -= 25; - Width += 24; - Rtf = Rtf.Replace("{Backspace}", ""); - } - } - Rtf = FixRTFToPrint(Rtf); - ProfileTimer.Pop(profileDepth); - } - private string FixRTFToPrint(string rtf) - { - // Only do this if the text contains symbols. - if (rtf.Contains("VESymbFix")) - { - System.Windows.Forms.RichTextBox rtb = new System.Windows.Forms.RichTextBox(); - rtb.Rtf = rtf.Replace(@"\\",""); // rename backslash character to avoid RTF confusion - //string showRTF = rtf; - bool changed = false; - // get the list of symbol replacements - FormatData fmtdata = (MyItemInfo.MyDocVersion != null) ? MyItemInfo.MyDocVersion.ActiveFormat.PlantFormat.FormatData : FormatInfo.PROMSBaseFormat.FormatData; - ReplaceSymbolCharList SymReplaceList = (fmtdata != null && fmtdata.SectData.ReplaceSymbolCharList != null) ? fmtdata.SectData.ReplaceSymbolCharList : null; - // Look at one character at a time - for (int i = 0; i < rtb.TextLength; i++) - { - rtb.Select(i, 1); - // If the character is a printable character set the font to the text font - //if (showRTF != null && rtb.SelectionFont.FontFamily.Name == "VESymbFix" && rtb.SelectedText.Length == 0) - //{ - // Console.WriteLine("{0}-{1}", i, showRTF); - // showRTF = null; - //} - //if (rtb.SelectionFont.FontFamily.Name == "VESymbFix" && rtb.SelectedText[0] > ' ' && rtb.SelectedText[0] <= '\xFF') - //if (rtb.SelectionFont.FontFamily.Name == "VESymbFix" && rtb.SelectedText.Length > 0 && rtb.SelectedText[0] > ' ' && rtb.SelectedText[0] <= '\xFF') - //{ - // //use bolding underline italics from local font - // System.Drawing.Font fnt = rtb.SelectionFont; - // rtb.SelectionFont = new System.Drawing.Font(DefaultFont, fnt.Style); - // changed = true; - //} - - //if (rtb.SelectionFont.FontFamily.Name == "VESymbFix" && rtb.SelectedText.Length > 0 && rtb.SelectedText[0] == '\u25a1') - //{ - // //use bolding underline italics from local font - // System.Drawing.Font fnt = rtb.SelectionFont; - // System.Drawing.Font fntw = new System.Drawing.Font(fnt.FontFamily.Name, 20, fnt.Style); // increase symbol char font size - // rtb.SelectionFont = fntw; - // changed = true; - //} - if (rtb.SelectionFont.FontFamily.Name == "VESymbFix" && rtb.SelectedText.Length > 0) - { - foreach (ReplaceChar rc in SymReplaceList) - { - if (rc.Unicode != null) - { - char rc_uchar = Convert.ToChar(Convert.ToInt32(rc.Unicode)); - if (rc_uchar == rtb.SelectedText[0]) - { - //use bolding underline italics from local font - System.Drawing.Font fnt = rtb.SelectionFont; - System.Drawing.Font fntw = new System.Drawing.Font((rc.Family != null)?rc.Family:fnt.FontFamily.Name, (rc.Size != null)?(float)rc.Size:fnt.Size, (rc.Style != null)?(System.Drawing.FontStyle)rc.Style:fnt.Style); - rtb.SelectionFont = fntw; - changed = true; - } - } - } - } - } - if (changed) return rtb.Rtf.Replace("",@"\\"); // put back the backslash character - } - return rtf; - } - - // for Calvert (BGE) alarms, some step text is kept on the same line as its parent. This - // is flagged by the -1 row in the template definition. - private bool KeepOnParentLine(ItemInfo itemInfo) - { - int tindx = itemInfo.TemplateIndex; - if (tindx < 0) return false; - if (itemInfo.ActiveFormat.PlantFormat.FormatData.Templates[tindx].row == -1) return true; - return false; - } - - private void AdjustYOffset(float yDelta) - { - YOffset -= yDelta; - foreach (vlnPrintObject vpo in PartsAbove) - vpo.YOffset -= yDelta; - foreach (vlnParagraph vp in ChildrenBelow) - vp.AdjustYOffset(yDelta); - } - - private void BuildPlacekeeper(vlnParagraph parent, ItemInfo itemInfo) - { - if (itemInfo is SectionInfo && (itemInfo as SectionInfo).SectionConfig.Section_Placekeeper.ToUpper() != "N") // if is a section type and the section is marked to create placekeeper - { - MyPlaceKeeper = new pkParagraph(this); - if (parent != null && parent.MyItemInfo.IsSection) - parent.MyPlaceKeeper = MyPlaceKeeper; - } - else if (parent != null && parent.MyPlaceKeeper != null && itemInfo is StepInfo)//InList(parent.MyItemInfo.ItemID, 513, 514, 519, 520, 525)) - { - StepConfig sc = itemInfo.MyConfig as StepConfig; - if (sc != null && sc.Step_Placekeeper.ToUpper() != "N") - { - if (itemInfo.IsCautionPart || itemInfo.IsNotePart) - MyPlaceKeeper = parent.MyPlaceKeeper.AddCautionsAndNotes(this); - else - MyPlaceKeeper = parent.MyPlaceKeeper.AddChild(this); - } - } - } - - private void BuildContinuousActionSummary(vlnParagraph parent, ItemInfo itemInfo) - { - if (itemInfo is SectionInfo) - { - MyContAct = new pkParagraph(this); - if (parent != null && parent.MyItemInfo.IsSection) - parent.MyContAct = MyContAct; - } - else if (itemInfo is StepInfo) - { - StepConfig sc = itemInfo.MyConfig as StepConfig; - if ((sc != null && sc.Step_CAS == "True") || ((sc == null || sc.Step_CAS == null) && itemInfo.IncludeOnContActSum)) - { - // save this step info for use on the Continuous Action Summary - vlnParagraph tparent = parent; - while (tparent != null && tparent.MyContAct == null) - tparent = tparent.MyParent; - if (parent.MyContAct != null) - { - if (itemInfo.IsCautionPart || itemInfo.IsNotePart) - MyContAct = parent.MyContAct.AddCautionsAndNotes(this); - else - MyContAct = parent.MyContAct.AddChild(this); - } - else - MyContAct = tparent.MyContAct.AddChild(this); - } - } - } - - private vlnParagraph FindParentRNO() - { - if (ChildrenRight != null && ChildrenRight.Count > 0) return ChildrenRight[0]; - return MyParent.FindParentRNO(); - } - - private string GetMacroName(string str) - { - int mindx = str.IndexOf(@"{!"); - string macro = str.Substring(mindx + 2, str.Length - 3); - return macro; - } - - private int TheStepLevel(ItemInfo itemInfo) - { - if (itemInfo.IsHigh) return -1; - int lev = 0; - ItemInfo ii = itemInfo; - while (!ii.MyParent.IsHigh) - { - lev++; - ii = ii.MyParent; - } - return lev; - } - - private string SectionHasCheckOffHeader(ItemInfo itemInfo, ref VE_Font font) - { - // If the passed in itemInfo is not a section, get it's parent section. This may be a subsection, so - // it will be found here, versus using 'MyActiveSection'. - while (!itemInfo.IsSection) - { - itemInfo = itemInfo.MyParent; - } - // See if this section has a checkoffheading index - this value, if set is stored in the config field. - // -1 flags no entries in the format's CheckOffHeaderList & 0 flags the first - // entry which is always '{NO HEADING}'. So only continue if it's greater than 0. - //SectionInfo si = SectionInfo.Get(itemInfo.ItemID); // sometimes the itemInfo isn't a section info - SectionInfo si = itemInfo.GetSectionInfo(); // sometimes the itemInfo isn't a section info - int sindx = si.CheckOffHeadingIndex(); - - // If there is a checkoff header for this section, see if this section has subsections. - // If this has a header but no subsections, put out the header. - // Else if this section has a header AND subsections, don't put it out... - // the subsection's checkoff header will be processed (or lack there of). - bool doCheckoffHeader = sindx > 0 && (itemInfo.Sections == null || itemInfo.Sections.Count == 0); - - // if doing it, then grab the string from the format.... CHECK if this works for subsection, it is - // getting ActiveSection which may return the top section, not subsections. - if (doCheckoffHeader && itemInfo.SectionCheckOffHeader != "") - { - font = itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList[sindx].Font; - return itemInfo.SectionCheckOffHeader; - } - return null; - } - - private void DoCheckOffHeader(PdfContentByte cb, ItemInfo itemInfo, float yLocation, float yTopMargin, float yPageStart) - { - // CheckOffHeaders are handled in two different ways: - // 1) Where the pagelist item puts them - this is at the 'top' of the page, when the current section on the - // page has a checkoff header defined. Support for this is here AND in the VlnSvgPageHelper pagelist code. - // 2) If a continuous section, and it doesn't start at 'top' of the page, then the checkoff header is - // printed on the same line as the continuous section. Support for this is here, the check off header is added - // to the 'PartRight' off of the section's VlnParagraph. - - // First see if there is any checkoff data in the format file and that there - // is a pagelist item for the checkoff header. - if (itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList.MaxIndex <= 0) return; - if (MyPageHelper.PageListCheckOffHeader == null) return; - - VE_Font font = null; - ItemInfo mySectionInfo = itemInfo.MyActiveSection; - ItemInfo mySubSectionInfo = itemInfo; - - // If the passed in itemInfo is not a section, get it's parent section. This may be a subsection, so - // it will be found here, versus using 'MyActiveSection' which is the topmost section. The passed in - // item may be a regular step, i.e. if a page break had occurred. - if (!itemInfo.IsSection) - { - while (!mySubSectionInfo.IsSection) - { - mySubSectionInfo = mySubSectionInfo.MyParent; - } - } - else - mySubSectionInfo = (mySectionInfo.Sections == null) ? null : mySectionInfo.Sections[0]; - - if (mySectionInfo == mySubSectionInfo) mySubSectionInfo = null; - - // The following duplicates the 16bit logic. The 16bit logic only put out a header if: - // there is no subsection and section has a header (from config); - // OR there is a subsection and the first subsection has a header. - // For locating the header in 16bit logic: - // If no subsections, output with section - // If subsections and continuous section, put out on same line as subsection. (done here) - // If subsections and starts at top of page, (on top of page, use pagelist code in VlnSvgPageHelper) - - // Get SectionInfos to access specific section config items... - //SectionInfo si = SectionInfo.Get(mySectionInfo.ItemID); - SectionInfo si = mySectionInfo.GetSectionInfo(); - int sindx = si.CheckOffHeadingIndex(); - //SectionInfo subi = mySubSectionInfo == null ? null : SectionInfo.Get(mySubSectionInfo.ItemID); - SectionInfo subi = mySubSectionInfo == null ? null : mySubSectionInfo.GetSectionInfo(); - int subindx = subi == null ? -1 : subi.CheckOffHeadingIndex(); - - // if there is no subsections & the main section doesn't use a header OR - // if there is a subsection, & it does not use a header... Return. - if ((subi == null && sindx < 1) || (subi != null && subindx < 1)) return; - - // figure out location now: - // if step, it uses pagelist logic to locate it (this is a page break condition). - // if continuous, put out with subsection if there is one, otherwise section. - // otherwise, use pagelist logic. - bool usePageListCOHdr = false; - - if (itemInfo.IsStep) - usePageListCOHdr = true; - else if (subi == null) //no subsection - { - if ((yPageStart - YOffset) == yTopMargin) usePageListCOHdr = true; - } - else - { - if (mySectionInfo == itemInfo && ((yPageStart - YOffset) == yTopMargin)) usePageListCOHdr = true; - if (!usePageListCOHdr && mySubSectionInfo != itemInfo) return; - } - - // grab the string from the format, depending on whether it should get it from the section or subsection. - string cohead = (mySubSectionInfo != null) ? mySubSectionInfo.SectionCheckOffHeader : mySectionInfo.SectionCheckOffHeader; - if (cohead == "" || cohead == null) return; - - // PageListCheckOffHeader is an svgtext - but really we only need the x/y location for this (pagelist support) - // The actual text is from the checkoff header selection in the section config. - if (cohead != MyPageHelper.PageListLastCheckOffHeader) - { - font = mySectionInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList[sindx].Font; - float chkOffY = CalculateYLocation(YTop, yTopMargin); - if (MyPageHelper.YMultiplier != 1) - { - chkOffY = -1 + yTopMargin - (yTopMargin - yLocation) * MyPageHelper.YMultiplier; - if (Rtf != null) - IParagraph.Leading = _SevenLinesPerInch; - } - if (!usePageListCOHdr) - { - vlnText myCOHead = new vlnText(cb, this, cohead, cohead, MyPageHelper.PageListCheckOffHeader.X.Value + (float)MyItemInfo.MyDocStyle.Layout.LeftMargin, chkOffY, font); - PartsRight.Add(myCOHead); - } - else - MyPageHelper.PageListTopCheckOffHeader = cohead; - MyPageHelper.PageListLastCheckOffHeader = cohead; - } - } - internal vlnParagraph BottomChild - { - get - { - float bottomChildYBottomText = YBottomText; - vlnParagraph bottomChild = this; - foreach (vlnParagraph child in ChildrenRight) - { - vlnParagraph grandChild = child.BottomChild; - if (grandChild != null && grandChild.YBottomText > bottomChildYBottomText) bottomChild = grandChild; - if (grandChild != null && grandChild.YBottomText == bottomChildYBottomText && grandChild.MyItemInfo.HasChangeBar) bottomChild = grandChild; - bottomChildYBottomText = bottomChild.YBottomText; - } - foreach (vlnParagraph child in ChildrenBelow) - { - vlnParagraph grandChild = child.BottomChild; - if (grandChild != null && grandChild.YBottomText > bottomChildYBottomText) bottomChild = grandChild; - if (grandChild != null && grandChild.YBottomText == bottomChildYBottomText && grandChild.MyItemInfo.HasChangeBar) bottomChild = grandChild; - bottomChildYBottomText = bottomChild.YBottomText; - } - return bottomChild; - } - } - private void CalculateXOffsetGridOrFigure(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo) - { - float scale = itemInfo.IsRtfRaw ? 0.6f : 1.0f; - bool aerTableOrFigure = itemInfo.FormatStepData.Type.Contains("AER"); - vlnParagraph hls1 = MyParent; - if (!formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) - while (hls1.MyParent != null && !hls1.MyItemInfo.IsHigh) hls1 = hls1.MyParent; - float colR = float.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[itemInfo.ColumnMode]); - float xLowerLimit = (aerTableOrFigure && hls1.PartsLeft != null && hls1.PartsLeft.Count > 0) ? hls1.PartsLeft[0].XOffset : hls1.XOffset; - float xUpperLimit = 0; - float pageWidth = ((float)itemInfo.MyActiveSection.MyDocStyle.Layout.PageWidth); - float leftMargin = ((float)itemInfo.MyActiveSection.MyDocStyle.Layout.LeftMargin); //* (float)MyItemInfo.FormatStepData.Font.CPI / 12; - if (itemInfo.IsInRNO) - // if in rno column, the upper limit is width of the page (right margin). Subtract off size of a character - xUpperLimit = pageWidth - (72 / (float)MyItemInfo.FormatStepData.Font.CPI); - else - // in the following calculation, the hls width (hls1.Width) == rno column width, so xUpperLimit is - // the around the right margin, i.e. 'hls xoffset' + 'location of rno (colR) * columnmode' + 'width of rno' - xUpperLimit = hls1.XOffset + hls1.Width + hls1.CheckOffWidth + colR * itemInfo.ColumnMode; - - // If a table is within the alarm section and its parent is a template item is single column - // adjust the xoffset so that the table is centered around center of page - bool ctrCalvertAlarmTbl = false; - if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) - ctrCalvertAlarmTbl = MyItemInfo.IsWithInSingleColumnTemplate(); - - float TableCenterPos = float.Parse(formatInfo.MyStepSectionLayoutData.TableCenterPos.Split(",".ToCharArray())[itemInfo.ColumnMode]); - if (ctrCalvertAlarmTbl || formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel) - XOffset = leftMargin + (pageWidth - leftMargin - (scale * Width)) / 2; - else - { - if (!aerTableOrFigure && itemInfo.RNOLevel == 0 && TableCenterPos != 0) // Only adjust TableCenterPos for Non-RNO Cenetered Tables - { - XOffset = TableCenterPos; - XOffset = XOffset - (this.Width / 2) + (float)itemInfo.MyDocStyle.Layout.LeftMargin; - } - else if (itemInfo.RNOLevel != 0) // RNO - XOffset = MyParent.XOffset + (MyParent.Width / 2) - ((scale * Width) / 2); - else if (aerTableOrFigure) - { - // if in the BGE alarm format and the hls is a Window (upper right corner when it prints), use the parent of the table - // to print in aer column (B2014-105) - if (MyItemInfo.IsInCalvertConditionResponse) - XOffset = hls1.XOffset + hls1.Width / 2 - Width / 2; - else - XOffset = MyHighLevelParagraph.XOffset + MyHighLevelParagraph.Width / 2 - Width / 2; - } - else // Centered Table or Figure - { - // Determine center of hls - XOffset = hls1.XOffset + hls1.Width / 2; - // Determine left edge of the table by subtracting 1/2 of its width. - XOffset -= Width / 2; - // Add in 1/2 of the width of all RNO columns - XOffset += (colR * itemInfo.ColumnMode) / 2; - - if (!aerTableOrFigure && !MyItemInfo.IsRtfRaw) - { - // 05/14/12 - 16bit code adjusts the center depending upon the CPI of the table font. - // Start with XOffset of table, then calculate the XOffset adjusted for the table font, - // based on the default CPI of 12. Adjust the XOffset by the difference of these - // two numbers. - XOffset -= (XOffset - (XOffset * (float)MyItemInfo.FormatStepData.Font.CPI / 12)); - } - XOffset -= 12; // This makes the 16bit & 32bit align very closely. - // if outside of the page margins then center within the page margins - float xOffset2 = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - float xWidth2 = (float)itemInfo.MyDocStyle.Layout.PageWidth; - if (XOffset + Width > xOffset2 + xWidth2) - XOffset = xOffset2 / 2 + xWidth2 / 2 - Width / 2; - - } - // 05/14/12 - The PosAdjust is a format flag from 16bit. For WCN2, it appears that this amount equals - // the amount of difference from a 10 CPI to a 12 CPI font. See comment above. - float posAdjust = (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); - if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null && - posAdjust > 0) - { - if (Width < hls1.Width - posAdjust) - XOffset += posAdjust; - else if (Width < hls1.Width) - XOffset = hls1.XOffset + hls1.Width - Width; // align with the right edge of hls text - } - } - if (itemInfo.MyDocStyle.Layout.CenterToStepThenPage) - { - if (Width > hls1.Width) - { - float XOffsetPage = leftMargin + ((pageWidth - leftMargin) - Width) / 2; - float fraction = (Width - hls1.Width) / ((pageWidth - leftMargin) - hls1.Width); - float XOffsetNew = (1 - fraction) * XOffset + fraction * XOffsetPage; - _MyLog.WarnFormat("***XOffsetAdjust-CenterToStepThenPage*** ItemID, XOffset, XOffsetPage, XOffsetNew ={0},{1},{2},{3}", itemInfo.ItemID, XOffset, XOffsetPage, XOffsetNew); - XOffset = XOffsetNew; - } - } - else - { - // if the XOffset < High Level Step Text's XOffset , then align with the High Level Step Text - if (XOffset < xLowerLimit && Width < (xUpperLimit - xLowerLimit)) - XOffset = xLowerLimit; - - // if the right margin exceeds the right edge of the rightmost RNO, then adjust right edge to match. - // In lines below, the 12 was used for Wolf Creek 2 column format, the pagewidth goes beyond the right border line so that - // the tables, figures & equations were beyond the border. -12 takes it enough so that if boxed, it won't print out of border - // We know this is not ideal. - if (MyItemInfo.IsRtfRaw && (XOffset + (scale * Width) > xUpperLimit-12)) - XOffset = xUpperLimit - (scale * Width) - 12; - if (!MyItemInfo.IsRtfRaw && XOffset + Width > xUpperLimit) - XOffset = xUpperLimit - Width; - // because of the above, if it pushes beyond the left margin, use the left margin. - if (XOffset < (float)itemInfo.MyDocStyle.Layout.LeftMargin) - XOffset = XOffsetBox = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - } - } - private float AdjustForBlankLines() - { - if (MyParent != null && MyParent.MyItemInfo.FormatStepData != null && MyParent.MyItemInfo.FormatStepData.Type == "TitleWithTextRight") return 0; - if (MyItemInfo.MyDocStyle.SpecialStepsFoldout) return 0; - if (MyItemInfo.FormatStepData != null && MyItemInfo.FormatStepData.Prefix != null && MyItemInfo.FormatStepData.Suffix != null && MyItemInfo.FormatStepData.UseSmartTemplate) return 0; - int everyNLines = MyItemInfo.FormatStepData == null ? 1 : MyItemInfo.FormatStepData.StepLayoutData.EveryNLines ?? 1; - if (everyNLines == -99) return 0; - if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || - (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert && MyItemInfo.IsStep && MyItemInfo.FormatStepData.StepLayoutData.STBoxindex != null)) - { - if ((MyItemInfo.IsCaution || MyItemInfo.IsNote || MyItemInfo.MyParent.IsCaution || MyItemInfo.MyParent.IsNote) && !MyItemInfo.FormatStepData.SpaceIn - && (MyItemInfo.Steps == null || MyItemInfo.Steps.Count == 0) - && (MyItemInfo.NextItem == null || MyItemInfo.MyContent.Type != MyItemInfo.NextItem.MyContent.Type)) return 0; - if (everyNLines == 99 && MyItemInfo.NextItem == null) - { - if (MyItemInfo.Steps != null && MyItemInfo.Steps.Count > 0 && MyItemInfo.Steps[0].MyContent.Type == MyItemInfo.MyContent.Type) return 0; - if (MyItemInfo.MyParent.NextItem != null && MyItemInfo.MyParent.NextItem.MyContent.Type == MyItemInfo.MyContent.Type) return 0; - } - } - // B2015-005: if there isn't a blank line after this step && it has children, see if there shouldn't be - // a blank line, i.e. if the first substep child's type is the same as this. - if (!MyItemInfo.IsHigh && everyNLines == 99 && MyItemInfo.NextItem == null && MyItemInfo.HasChildren) - { - ItemInfo chld = MyItemInfo.FirstChild(E_FromType.Step); - if (chld != null && chld.MyContent.Type == MyItemInfo.MyContent.Type) return 0; - } - if (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.NextItem == null) return SixLinesPerInch; - // Pagination issue to be used with yEndsWithBlankLine in Pagination code, but not checked in yet. - //if (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.NextItem == null) return SixLinesPerInch; - return 0; - } - private void AddMacros(ItemInfo itemInfo, vlnTab mytab) - { - float y = YOffset; - float x = mytab == null ? XOffset : mytab.XOffset + mytab.TabOffset; - List myMacros = itemInfo.MyMacros; - if (myMacros != null) - { - foreach (Macro myMacro in myMacros) - { - // if the format has the 'LocWithXOff' locate the macro along with the tab's offset. - // however, if the tab is more than 2 characters long, adjust so that it aligns with the - // last two characters, not the first 2. - string tabText = mytab == null ? null : mytab.Text.Trim(" .".ToCharArray()); - int tablen = (tabText == null) ? 0 : (tabText.Length <= 2) ? 0 : tabText.Length - 2; - if (myMacro.LocWithXOff ?? false) x = mytab == null ? XOffset : ((float)mytab.XOffset + (tablen * (float)mytab.MyFont.CharsToTwips)); - if (MyItemInfo.MyActiveSection.ColumnMode == 0 && myMacro.SingleColMacroDef != null && myMacro.SingleColMacroDef.Length > 0) - { - float macroXOffset = myMacro.MacroXOffSet ?? 0; - float widthAdj = myMacro.SingleColWidthAdjust ?? 0; // set as negative number in format - float rightTextEdge = (itemInfo.IsHigh)? XOffset + Width + mytab.XOffset:this.MyHighLevelParagraph.XOffset + this.MyHighLevelParagraph.Width; - x = (macroXOffset > 0) ? macroXOffset : rightTextEdge; - if (rightTextEdge > x) - Width += widthAdj; - PartsRight.Add(new vlnMacro(x, y, myMacro.SingleColMacroDef)); - } - else - PartsLeft.Add(new vlnMacro(x, y, myMacro.MacroDef)); - } - } - } - // HLP Change bar flags in format file: - // Locations: With Text, Outside Box, AER on Left RNO on Right, To The Left of Text - // Text: Date & Change ID, Revision Number, Change ID, None, Custom (use input data) - // Flag AERChgBarMsgRNOChgBarNoMsg and AERMsgRNONoMsg are NOT Used in 16-bit. - private string cbMess = null; - private vlnChangeBar DoChangeBar(PdfContentByte cb, ItemInfo itemInfo, VlnSvgPageHelper myPageHelper, float xoff, float yoff, int maxRNO, FormatInfo formatInfo) //, vlnChangeBar myCB) - { - // find column for the change bar based on format flags - this is code from 16-bit - // if AbsoluteFixedChangeColumn - // if FixedAERChangeColumn - // if col>ColsS+ColR+COL_WID+ADJ - // FixedChangeColumn - // else - // AERLeftChangeBarLocation() - // else - // FixedChangeColumn - // else - // ChangeBarLocation() - ChangeBarData cbd = formatInfo.PlantFormat.FormatData.ProcData.ChangeBarData; - float cols = formatInfo.MyStepSectionLayoutData.ColS ?? 0; - float colr = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO); - // FixedChangeColumn + - Column location for change bars - // 0 - Separate AER and RNO change bars to the right of the text - // -10 to -1 - Change bars on left (specify # of columns from the text) - // <-10 - AER change bars on the left and RNO change bars on the right. - // FixedAERChangeColumn overrides the -5 default setting in chgbar.c, value is converted to a negative by the code - - float col = (cbd.AbsoluteFixedChangeColumn) ? - ((cbd.FixedAERChangeColumn ?? 0) > 0) ? - (xoff > (cols + colr + COL_WID_ADJ)) ? - cbd.FixedChangeColumn ?? 0 : AERLeftChangeBarLocation(formatInfo) : - cbd.FixedChangeColumn ?? 0 : ChangeBarLocation(xoff, this, formatInfo, maxRNO); - string chgIdTxt = null; - if (itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds) - { - StepConfig sc = itemInfo.MyConfig as StepConfig; - chgIdTxt = sc == null ? null : sc.Step_ChangeID; - } - if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.ChgID) - cbMess = chgIdTxt!=null?chgIdTxt:itemInfo.MyContent.UserID; - else if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.DateChgID) - { - string fmtDate = itemInfo.MyContent.DTS.ToShortDateString(); - if (fmtDate.Length != 10) // need to add zeros - { - if (fmtDate.IndexOf("/") == 1) - fmtDate = "0" + fmtDate; - if (fmtDate.IndexOf("/", 3) == 1) - fmtDate = fmtDate.Substring(0, 3) + "0" + fmtDate.Substring(3, fmtDate.Length - 3); - } - cbMess = (chgIdTxt!=null?chgIdTxt:itemInfo.MyContent.UserID) + @"\n" + fmtDate; - } - else if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.RevNum) - { - - string lRev = myPageHelper.Rev; - // Now check the format flags to determine if/how the Rev string should be parsed. - if ((itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate && lRev.Contains("/")) - || (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.RevDateWithForwardSlash && lRev.Contains("\\"))) - { - int indx = lRev.IndexOf(itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.DoRevDate ? '/' : '\\'); - cbMess = lRev.Substring(0, indx > -1 ? indx : lRev.Length); - } - else - cbMess = lRev; - } - else if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.UserDef) - cbMess = myPageHelper.ChangeBarDefinition.MyChangeBarMessage; - - int msgAlign = Element.ALIGN_LEFT; - if (myPageHelper.ChangeBarDefinition.MyChangeBarLoc == PrintChangeBarLoc.LeftOfText || - (myPageHelper.ChangeBarDefinition.MyChangeBarLoc == PrintChangeBarLoc.AERleftRNOright && - !itemInfo.IsInRNO)) msgAlign = Element.ALIGN_RIGHT; - float coltotwips = col * itemInfo.FormatStepData.Font.CharsToTwips; - if (cbd.AbsoluteFixedChangeColumn) coltotwips = col * itemInfo.ActiveFormat.PlantFormat.FormatData.Font.CharsToTwips; - if (itemInfo.IsFigure) coltotwips = col * itemInfo.ActiveFormat.PlantFormat.FormatData.Font.CharsToTwips; - return new vlnChangeBar(cb, this, (float)itemInfo.MyDocStyle.Layout.LeftMargin + coltotwips, yoff, msgAlign, - myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.RevNum, - itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds); - } - - // changed this function to return a float instead of an int to correct a rounding error which cause change bars - // to inconsistantly position next to changed text. Bug B2015-033 - private float ChangeBarLocation(float c, vlnParagraph paragraph, FormatInfo formatInfo, int maxRNO) - { - int fixedChgCol = formatInfo.PlantFormat.FormatData.ProcData.ChangeBarData.FixedChangeColumn ?? 0; - float cols = formatInfo.MyStepSectionLayoutData.ColS ?? 0; - int colr = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO); - float tmpc = c; - Box bxCautNote = null; // used for notes and cautions in the Prairie Island Alarms format - if (MyItemInfo.IsCaution || MyItemInfo.IsNote) - { - // Temporary fix for change bars on Notes and Cautions where the FixedChgCol < -10 - tmpc = (float)formatInfo.MyStepSectionLayoutData.ColT + (float)formatInfo.MyStepSectionLayoutData.WidT; // end position of Caution / Note - int typ = (int)(MyItemInfo.MyContent.Type % 10000); - int? bxIndx = formatInfo.PlantFormat.FormatData.StepDataList[typ].StepLayoutData.STBoxindex; - if (bxIndx != null) - { - bxCautNote = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - if (bxCautNote != null) - tmpc = (float)bxCautNote.Start + (float)bxCautNote.End; // end position of a boxed Caution / Note - } - } - // if this is a caution or note, put the change bar to the right of the text: - //if ((paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote) && fixedChgCol < -10) return -fixedChgCol; - if ((fixedChgCol == 0))// && paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote) - //if ((fixedChgCol==0) || paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote) - { - float rightEdge = (paragraph.XOffset + paragraph.Width + 5); - rightEdge -= (float)paragraph.MyItemInfo.MyDocStyle.Layout.LeftMargin; - if (bxCautNote != null) - rightEdge = (float)bxCautNote.End + 10; // used for notes and cautions in the Prairie Island Alarms format - rightEdge = rightEdge / paragraph.MyItemInfo.FormatStepData.Font.CharsToTwips; - return rightEdge; - } - if (fixedChgCol < -10 || fixedChgCol >= 0) - return ((fixedChgCol > 0) ? fixedChgCol : - (fixedChgCol == 0) ? (int)c + 1 : - (tmpc > (cols + colr + COL_WID_ADJ)) ? -fixedChgCol : - //(c > (cols + colr + COL_WID_ADJ) || (MyItemInfo.IsCaution || MyItemInfo.IsNote)) ? -fixedChgCol : - AERLeftChangeBarLocation(formatInfo)); - else - return (fixedChgCol + (((c < cols + Width + colr) || TableTest() - || MyItemInfo.IsCaution || MyItemInfo.IsNote) ? 0 : cols + colr)); // || (GetColumnMode() == 0)) ? 0 : cols + colr)); - /* Change bars to left of text -- ColS+WidS+ColR is the end of RNO col*/ - } - /* - ** Centered tables whose width exceeds the end of the RNO column should - ** still have their change bars printed on the left. This procedure checks - ** to make sure the step is a table and that it is not an RNO. - */ - private bool TableTest() - { - return false; - //return ((s->Type == TABLE || s->Type == BORDERLESSTABLE) && - //!(strchr((char *)&s->dbseq[2],RNO_MARKER))); - } - private float GetBottomYoff(float bottomY) - { - foreach (vlnParagraph child in ChildrenBelow) - { - if (child.YOffset > bottomY) bottomY = child.YOffset; - bottomY = child.GetBottomYoff(bottomY); - } - return bottomY; - } - private int AERLeftChangeBarLocation(FormatInfo formatInfo) - { - // use -5 default unless it is format specified - int fixedAERChgCol = formatInfo.PlantFormat.FormatData.ProcData.ChangeBarData.FixedAERChangeColumn ?? 0; - return (fixedAERChgCol != 0) ? - (fixedAERChgCol > 100) ? - (fixedAERChgCol % 100) : -fixedAERChgCol : -5; - } - private StringBuilder _RtfSB = null; - public string GetRtf(ItemInfo itemInfo, string prefix, string suffix) - { - int profileDepth = ProfileTimer.Push(">>>> GetRtf"); - _RtfSB = new StringBuilder(); - DisplayText vlntxt = new DisplayText(itemInfo, E_EditPrintMode.Print, E_ViewMode.View, true, E_FieldToEdit.StepText, false, prefix, suffix,MyPageHelper.MyPromsPrinter.RemoveTrailingHardReturnsAndManualPageBreaks); - System.Drawing.Font myFont = vlntxt.TextFont.WindowsFont; - if (!itemInfo.IsTable && StepRTB.MyFontFamily != null) - myFont = new System.Drawing.Font(StepRTB.MyFontFamily, myFont.Size, myFont.Style); - - string stText = null; // if Calvert (BGE) Alarms, the text is included in the macro, so save text as a blank: - if (HasCalvertMacro) - { - stText = " "; - // turn underline off - myFont = new System.Drawing.Font(myFont.FontFamily, myFont.Size, System.Drawing.FontStyle.Regular); //myFont.Style. | FontStyle.Underline); - } - else - stText = vlntxt.StartText; - - if (itemInfo.IsHigh && itemInfo.MyDocStyle.UndSpecialStepsFoldout) - { - myFont = new System.Drawing.Font(myFont.FontFamily, myFont.Size, myFont.Style | System.Drawing.FontStyle.Underline); - stText = stText.Replace(@"\ulnone ", ""); - stText = stText.Replace(@"\ulnone", ""); - } - if (stText.Contains("{IND}")) stText = stText.Replace("{IND}", "\x5"); - if (itemInfo.IsSection && itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.SectionNumber.Level0Big && itemInfo.MyParent.IsProcedure) - myFont = new System.Drawing.Font(myFont.FontFamily, 14, myFont.Style | System.Drawing.FontStyle.Bold); - _RtfSB.Append(AddFontTable(myFont)); - _RtfSB.Append(stText); - if (_MyItemInfo.IsStep && !itemInfo.FormatStepData.UseSmartTemplate && _MyItemInfo.FormatStepData.Suffix != null && _MyItemInfo.FormatStepData.Suffix != "") - _RtfSB.Append(_MyItemInfo.FormatStepData.Suffix.Replace("{ulnone}", @"\ulnone ")); - _RtfSB.Append("}"); - string rtf = _RtfSB.ToString(); - UnderlineTerminateList utl = MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.UnderlineTerminateList; - if (utl != null && myFont.Underline) - { - foreach (UnderlineTerminate ut in utl) - { - MatchCollection mc = Regex.Matches(rtf, "(? 0) - { - Match m = mc[mc.Count - 1]; - rtf = rtf.Substring(0, m.Index) + @"\ulnone " + rtf.Substring(m.Index); - } - } - } - ProfileTimer.Pop(profileDepth); - return rtf; - } - private float _XOffsetBox = 0; - public float XOffsetBox - { - get { return _XOffsetBox; } - set { _XOffsetBox = value; } - } - private float _MyBoxLeftAdj = 0; - private float SetHeader(vlnParagraph para, PdfContentByte cb, ItemInfo itemInfo, FormatInfo formatInfo) - { - float xoff = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - // The '6' below is really converting from characters to Twips. But instead of considering the CPI, 16bit assumed - // it was 12 to center the header. That's where the 6 comes from. - float hdrWidth = (itemInfo.MyHeader.CleanText == null) ? 0 : itemInfo.MyHeader.CleanText.Length * 6; - int typ = ((int)itemInfo.MyContent.Type) % 10000; - int? bxIndx = formatInfo.PlantFormat.FormatData.StepDataList[typ].StepLayoutData.STBoxindex; - - if (itemInfo.MyHeader.Justify == System.Drawing.ContentAlignment.MiddleCenter) - { - if (bxIndx != null) - { - Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - if (bx.TabPos > 0) - xoff += (float)bx.TabPos; // xoff starts as left margin - else - xoff += (float)((bx.TxtStart + _MyBoxLeftAdj + XOffsetBox + (bx.TxtWidth / 2)) - (hdrWidth / 2)); // xoff starts as left margin - } - else if (formatInfo.MyStepSectionLayoutData.Separator.Location > 0) - xoff = XOffset + AdjustToCharPosition((float)((para.Width - hdrWidth) / formatInfo.MyStepSectionLayoutData.Separator.Location), itemInfo.MyHeader.MyFont.CPI); - else if (itemInfo.IsInRNO && itemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[40].NumberWithLevel) - xoff = XOffset + (para.Width / 2) - (hdrWidth / 2); - else if (itemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[40].NumberWithLevel) - xoff = XOffset + (para.Width / 2) - (hdrWidth / 2); - else - xoff = XOffset + (para.Width / 2) + (hdrWidth / 2); // XOffset has left margin included - } - else - xoff = XOffset; // XOffset has left margin included - // KEEP: This may be needed in the future to fix location of 'OR's when Separator location="0" - // the following code would place the 'OR' at the location of the tab rather than text. This - // is how 16bit was. However, a number of plants had been sent out with the xoffset at the xlocation - // of text (does not match 16bit) when this was found for BGE OI3/OI-1B/6.1.B.4. Previous releases - // went to CAT, MCG, FPL, NSP. - //{ - // if (this.MyTab != null) - // xoff = this.MyTab.XOffset; - // else - // xoff = XOffset; - //} - - vlnHeader myHeader = new vlnHeader(this, cb, itemInfo.MyHeader.Text, itemInfo.MyHeader.CleanText.TrimStart(" ".ToCharArray()), xoff + _MyBoxLeftAdj, YOffset, itemInfo.MyHeader.MyFont); - PartsAbove.Add(myHeader); - //return myHeader.Height + (!MyItemInfo.MyDocStyle.SpecialStepsFoldout || (MyItemInfo.MyDocStyle.ExtraLineHeader && (MyItemInfo.IsCaution || MyItemInfo.IsNote)) ? SixLinesPerInch : 0); - // Only use SpaceIn property for Cautions or Notes - bool bSpaceIn = (MyItemInfo.IsCaution || MyItemInfo.IsNote) ? MyItemInfo.FormatStepData.SpaceIn : true; - return myHeader.Height + (!MyItemInfo.MyDocStyle.SpecialStepsFoldout || (MyItemInfo.MyDocStyle.ExtraLineHeader && (MyItemInfo.IsCaution || MyItemInfo.IsNote)) ? bSpaceIn ? SixLinesPerInch : 0 : 0); - } - private float AdjustToCharPosition(float position, float? CPI) - { - int iPosition = (int)position; - int charsToTwips = (int)(72 / (CPI ?? 12)); - iPosition = (iPosition / charsToTwips) * charsToTwips; - position = (position / 7.2F) * 7.2F; - return (float)iPosition; - } - private bool _SectionPageBreak = false; - public bool SectionPageBreak - { - get { return _SectionPageBreak; } - set { _SectionPageBreak = value; } - } - private bool _Processed = false; - public bool Processed - { - get { return _Processed; } - set { _Processed = value; } - } - private vlnParagraph _LastRNO; - public vlnParagraph LastRNO - { - get { return _LastRNO; } - set { _LastRNO = value; } - } - private vlnParagraph _MyTopRNO; - public vlnParagraph MyTopRNO - { - get { return _MyTopRNO; } - set { _MyTopRNO = value; } - } - private static string _PathPrefix = ""; - public static string PathPrefix - { - get { return vlnParagraph._PathPrefix; } - set { vlnParagraph._PathPrefix = value; } - } - protected float _YBottomMost; // Bottom of the paragraph including the children - public float YBottomMost - { - get { return _YBottomMost; } - set { _YBottomMost = value; } - } - protected float _YBottomMostAdjust = 0; // the RNO separator is outside asterisk box, account for additional Y space - public float YBottomMostAdjust - { - get { return _YBottomMostAdjust; } - set { _YBottomMostAdjust = value; } - } - protected float _YTopMost; // Top of the paragraph including the children - public float YTopMost - { - get { return _YTopMost; } - set { _YTopMost = value; } - } - protected float _YTop; // Top of the paragraph including parts - public float YTop - { - get { return _YTop; } - set - { - vlnParagraph vp = this as vlnParagraph; - _YTop = value; - - } - } - public float SmartTemplateAdjust - { - // If we're in a smart template (WCNCKL checklists) then account for the bottom line in the - // table. - get { return (MyItemInfo.IsHigh && MyItemInfo.FormatStepData.UseSmartTemplate) ? SixLinesPerInch : 0; } - } - public float YSize // How big this paragraph is with all of its children - { - get - { - float ysize = SmartTemplateAdjust + _YBottomMost - _YTopMost; - if (MyItemInfo.IsHigh && ((MyItemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DoubleBoxHLS) == E_DocStructStyle.DoubleBoxHLS)) - ysize += SixLinesPerInch; - return ysize; - } - } - private ItemInfo _MyItemInfo; - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - set { _MyItemInfo = value; } - } - private vlnParagraph _MyHighLevelParagraph; - - public vlnParagraph MyHighLevelParagraph - { - get - { - if (_MyHighLevelParagraph == null) - { - _MyHighLevelParagraph = GetHighLevelParagraph(); - } - return _MyHighLevelParagraph; - } - } - private vlnParagraph GetHighLevelParagraph() - { - if (MyItemInfo.IsHigh) return this; - return MyParent.GetHighLevelParagraph(); - } - private vlnParagraph _SupInfoSection; - public vlnParagraph SupInfoSection - { - get - { - if (_SupInfoSection == null) - { - _SupInfoSection = GetSupInfoSectionParagraph(); - } - return _SupInfoSection; - } - } - private vlnParagraph GetSupInfoSectionParagraph() - { - if (MyItemInfo.IsSection) return this._SupInfoSection; - return MyParent.GetSupInfoSectionParagraph(); - } - // Tab, Separator, ChangeBar, Box, Circle, Checkoff - private vlnTab _MyTab; - public vlnTab MyTab - { - get - { - if (_MyTab == null) - { - foreach (vlnPrintObject po in PartsLeft) - { - if (po is vlnTab) - { - _MyTab = po as vlnTab; - break; - } - } - } - return _MyTab; - } - } - private vlnPrintObjects _PartsAbove; - public vlnPrintObjects PartsAbove - { - get - { - if (_PartsAbove == null) _PartsAbove = new vlnPrintObjects(); - return _PartsAbove; - } - } - private vlnPrintObjects _PartsBelow; - public vlnPrintObjects PartsBelow - { - get - { - if (_PartsBelow == null) _PartsBelow = new vlnPrintObjects(); - return _PartsBelow; - } - } - private vlnPrintObjects _PartsRight; - public vlnPrintObjects PartsRight - { - get - { - if (_PartsRight == null) _PartsRight = new vlnPrintObjects(); - return _PartsRight; - } - } - private vlnPrintObjects _PartsLeft; - public vlnPrintObjects PartsLeft - { - get - { - if (_PartsLeft == null) _PartsLeft = new vlnPrintObjects(); - return _PartsLeft; - } - } - private vlnPrintObjects _PartsContainer; - public vlnPrintObjects PartsContainer - { - get - { - if (_PartsContainer == null) _PartsContainer = new vlnPrintObjects(); - return _PartsContainer; - } - } - private vlnParagraphs _ChildrenAbove; - public vlnParagraphs ChildrenAbove - { - get - { - if (_ChildrenAbove == null) _ChildrenAbove = new vlnParagraphs(this); - return _ChildrenAbove; - } - } - private vlnParagraphs _ChildrenBelow; - public vlnParagraphs ChildrenBelow - { - get - { - if (_ChildrenBelow == null) _ChildrenBelow = new vlnParagraphs(this); - return _ChildrenBelow; - } - } - private vlnParagraphs _ChildrenRight; - public vlnParagraphs ChildrenRight - { - get - { - if (_ChildrenRight == null) _ChildrenRight = new vlnParagraphs(this); - return _ChildrenRight; - } - } - private vlnParagraphs _ChildrenLeft; - public vlnParagraphs ChildrenLeft - { - get - { - if (_ChildrenLeft == null) _ChildrenLeft = new vlnParagraphs(this); - return _ChildrenLeft; - } - } - private float? _XOffsetCenter = null; - - public float? XOffsetCenter - { - get { return _XOffsetCenter; } - set { _XOffsetCenter = value; } - } - - public bool IsEnhancedBackgroundFormat(ItemInfo itminfo) - { - return ((itminfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds); - } - - public void AdjustXOffsetForTab(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo, vlnTab myTab, float xMetaAdj) - { - if (itemInfo.IsSupInfoPart) - { - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + 54; // add in 3/4 inch (54) to allow for enough space for Note/Caution tab - if (myTab != null) - { - myTab.XOffset = XOffset - ((myTab == null) ? 0 : myTab.Width) - 12; - myTab.Width = 2.5f * myTab.Width; - } - return; - } - float tabWidth = (myTab == null) ? 0 : myTab.Width; - if (itemInfo.IsStepSection) - { - if (formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Just == "PSLeft") - { - int level = 0; - ItemInfo iilvl = itemInfo; - while (!iilvl.IsProcedure) - { - level++; - iilvl = iilvl.MyParent; - } - if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) - { - XOffset = (myTab == null ? 0 : myTab.XOffset) + ((float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos - (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos); - } - else - { - level = level <= 2 ? 1 : level - 1; - if (level == 1) - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (level * (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos); - else if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) - XOffset = (myTab == null ? 0 : myTab.XOffset) + ((float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos - (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos); - else - { - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[level].ColSByLevel; - XOffset += (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[level].SecTitlePositionAdj; - XOffset -= xMetaAdj; - } - } - } - else if (formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Just == "PSCenter") - { - float hdrWidth = itemInfo.MyContent.Text.Length * 6; - float ctr = (((float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin)) / 2; - XOffsetCenter = (float)itemInfo.MyDocStyle.Layout.LeftMargin + ctr - (hdrWidth / 2); - } - return; - } - int? bxIndx = itemInfo.FormatStepData.StepLayoutData.STBoxindex; - float? colOvrd = itemInfo.FormatStepData.ColOverride; - if (itemInfo.IsBackgroundStep()) - { - if (myTab != null) myTab.XOffset = XOffset; - XOffset += (itemInfo.FormatStepData.Font.CharsToTwips * 2); // indent 2 characters for background steps - Width -= (itemInfo.FormatStepData.Font.CharsToTwips * 2); // Adjust width by 2 characters - return; - } - else if (itemInfo.FormatStepData.UseOldTemplate && itemInfo.IsInTemplate() && - ((MyItemInfo.MyActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)) - { - if (myTab != null) myTab.XOffset = XOffset; - XOffset += myTab.Width; - return; - } - else if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.Type == "TitleWithTextBelow") - { - if ((colOvrd ?? 0) != 0) - XOffset = (float)colOvrd; - else - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - return; - } - else if (itemInfo.IsParagraph && - (((itemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) || - ((itemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations)) && - itemInfo.FormatStepData != null && PreviousIsTitleWithTextBelow(itemInfo)) - { - // This code was needed for fix for B2015-183 && - // IP2 backgrounds so that any 'paragraph's that were at the same - // level as the 'TitleWithTextBelow's would have same left margin (xoffset) as the 'TitleWithTextBelow'. - // an example of this can be found in IP2 Backgrounds, 2-E-0, Step Description Table, Step 22, PLANT-SPECIFIC INFORMATION. - // (NOTE that the IP2 exaxmple was no longer in the data when the work on B2015-183 was done) - if ((colOvrd ?? 0) != 0) - XOffset = (float)colOvrd; - else - { - //Adjuust Indent for Wolf Creek Background format flag - float indentBG1 = itemInfo.IsPartOfBackgroundStep() ? itemInfo.FormatStepData.Font.CharsToTwips * 2 : 0; - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + indentBG1; - Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin - indentBG1; - } - return; - } - else if (itemInfo.MyParent.FormatStepData != null && itemInfo.MyParent.FormatStepData.Type == "TitleWithTextBelow" && (!itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || (!itemInfo.IsCaution && !itemInfo.IsNote))) - { - float childindent = itemInfo.MyParent.FormatStepData.ChildIndent ?? 0; - if (myTab != null) - { - float delta = childindent + MyParent.XOffset - myTab.XOffset; - myTab.XOffset += delta; - XOffset += delta; - } - else - { - //Adjust Indent for Wolf Creek Background format flag - float indentBG2 = itemInfo.IsPartOfBackgroundStep() ? itemInfo.FormatStepData.Font.CharsToTwips * 2 : 0; - XOffset = childindent + MyParent.XOffset+ indentBG2;//(itemInfo.FormatStepData.Font.CharsToTwips * 2); - // B2016-164: Added the following 'if' so that the width is not recalculated if in the alarm format & the parent has a template - // B2016-168: The fix for 164 broke deviation document printing. The if statement was fixed for both: - if (!itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || !UseTemplateWidthOrXOff(itemInfo.MyParent)) - Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin - indentBG2; - } - return; - } - else if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.Type == "TitleWithTextRight") - { - if ((colOvrd ?? 0) != 0) - XOffset = (float)colOvrd; - else - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - return; - } - else if (itemInfo.MyParent.FormatStepData != null && itemInfo.MyParent.FormatStepData.Type == "TitleWithTextRight") - { - XOffset = MyParent.MyParent.XOffset; - // if the step text has a tab, then we need to position the tab to the XOffset and then ajust the text XOffset - // by the length of the tab. - fix for IP2 backgrounds (ex. 2-ECA-3.3, step 6) - if (myTab != null) - { - myTab.XOffset = XOffset; - XOffset += (myTab.Text.Length * myTab.MyFont.CharsToTwips);//myTab.Width - myTab.XOffset; - } - return; - } - if (itemInfo.IsHigh) - { - if (formatInfo.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm || - ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_SameXOffSubsections) == E_DocStructStyle.DSS_SameXOffSubsections)) - { - // the HLS in the template prints the tab/step on the right edge of page. Don't - // do the other calculations to relocate it. - if (itemInfo.FormatStepData.UseOldTemplate && itemInfo.IsInTemplate()) - { - MyTab.XOffset = XOffset - MyTab.Width; - return; - } - // the following code handles the xoffsets of tabs/HLS in the non-alarm sections for - // the Calvert Alarm format. - if (itemInfo.MyDocStyle.UseColSByLevel) - { - if (myTab != null) - { - myTab.Rtf = myTab.Rtf.Replace(myTab.Text, myTab.Text.TrimStart(" ".ToCharArray())); - myTab.XOffset = MyParent.XOffset; - XOffset = myTab.XOffset + MyTab.Width; - } - else - XOffset = MyParent.XOffset; // unnumbered hls - return; - } - } - float x = 0; - float xoff = 0; - if ((colOvrd ?? 0) != 0) - x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)colOvrd; - else - x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS; - - xoff = x - XOffset; - // ColSByLevel will specify the column in which the High Level Step starts with - // respect to the overall level calculation based on sections & meta-sections. - // Only a few of the single column formats use this: WCN1, CAL1, RGEBCK - if (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel - && !(itemInfo.MyDocStyle.SpecialStepsFoldout && itemInfo.MyDocStyle.UseColSByLevel)) - { - int indxLevel = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel(); - float colsbylevel = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.MaxIndex].ColSByLevel; - float seclvlindent = colsbylevel - (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS; - float adjCols = (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS + seclvlindent; - float xtabcol = adjCols - ((myTab == null || myTab.Text == null) ? 0 : (myTab.Text.Length * 7.2f)); - if (indxLevel > 1 && myTab != null) myTab.XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + xtabcol; - else if (myTab != null) myTab.XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + colsbylevel; - if (myTab != null) - { - myTab.Rtf = myTab.Rtf.Replace(myTab.Text, myTab.Text.TrimStart(" ".ToCharArray())); - if (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.LeftJustifyList != null && - formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.LeftJustifyList.Count > 0) - XOffset = myTab.XOffset + GetLeftJustify(formatInfo, indxLevel); - else - XOffset = myTab.XOffset + (myTab.Text.Length * (float)itemInfo.FormatStepData.Font.CPI) - colsbylevel; - } - } - else - { - XOffset += xoff; - // For Calvert, adjust from the left margin and current section's tab. This is used - // in BGEEOP (see EOP-0/Purpose ). However, it caused BGESTP's to print LossOfAC steps (unnumbered HLS) too - // far to the left. The ForceAlignNullTabWSectHead was introduced so that for that step type (LossOfAC) in STP/OI format, - // the SectData.SectionHeader.Pos was used rather than SectData.SectionNumber.Pos - if (myTab == null && !itemInfo.FormatStepData.ForceAlignNullTabWSectHead && itemInfo.FormatStepData.AlignNullTabWSectHead && itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos; - else if (myTab == null && itemInfo.FormatStepData.AlignNullTabWSectHead) - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos; - if (myTab != null) - { - if (itemInfo.MyDocStyle.AlignHLSTabWithSect || itemInfo.FormatStepData.AlignHLSTabWithSectOvride) - { - myTab.XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos; - XOffset = myTab.XOffset + myTab.Width; - } - else - { - myTab.XOffset += xoff; - if (myTab.MyMacro != null) myTab.MyMacro.XOffset += xoff; - } - } - else - { - if (itemInfo.MyDocStyle.AlignHLSTabWithSect) - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos; - } - } - } - else if (((colOvrd ?? 0) != 0) && (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.NullBox)) - { - float tabOffset = (myTab == null ? 0 : myTab.XOffset) - XOffset; - XOffset = (float)colOvrd; - if (myTab != null) myTab.XOffset = XOffset + tabOffset; - return; - } - else if (((colOvrd ?? 0) != 0) && (IsEnhancedBackgroundFormat(itemInfo) && (itemInfo.IsNote || itemInfo.IsCaution))) - { - float tabOffset = (myTab == null ? 0 : myTab.XOffset); - // Adjust the position of the Note/Caution text by the difference of the colOverride and the tab xoffset - XOffset += ((float)colOvrd - tabOffset); - if (myTab != null) myTab.XOffset = (float)colOvrd; // set the note/caution tab offset to the colOverride - return; - } - // put in for Point Beach (wep2) we don't want to do this if we are processing a boxed substep (cont. action substep) - else if (bxIndx != null && (itemInfo.IsCaution || itemInfo.IsNote || - !itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.ContActBoxOnSubSteps)) - { - Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - if (bx == null) - { - if ((colOvrd ?? 0) != 0) - { - // 16-bit code subtracted the left margin - //xoff = ((float)colOvrd - (float)itemInfo.MyDocStyle.Layout.LeftMargin) - XOffset; - //XOffset += xoff; - //if (myTab != null) myTab.XOffset += xoff; - //xoff = MyParent.XOffset - myTab.XOffset; - //XOffset += xoff; - float tabOffset = (myTab == null ? 0 : myTab.XOffset) - XOffset; - - XOffset = (float)colOvrd; - if (myTab != null) myTab.XOffset = XOffset + tabOffset; - return; - } - else - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + tabWidth + XOffsetBox; - } - else - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)bx.TxtStart + _MyBoxLeftAdj + tabWidth + XOffsetBox; - if (myTab != null) myTab.XOffset = XOffset - tabWidth; - } - else if (itemInfo.IsRNOPart && itemInfo.MyParent != null && itemInfo.MyParent.IsRNOPart && itemInfo.FormatStepData.NumberWithLevel) - { - // xoffset is same as parent RNO (this is a BGE format flag). Instead of RNO's being siblings, - // they had a parent/child relationship. So want the child to have same xoffset as parent, i.e. - // the same xoffset. - XOffset = MyParent.XOffset; - myTab.XOffset = MyParent.MyTab.XOffset; - return; - } - else if (itemInfo.IsRNOPart && (colOvrd > 0 || !((ItemInfo)itemInfo.ActiveParent).IsHigh) && itemInfo.FormatStepData.OffsetTab) - { - if (colOvrd > 0) - { - XOffset = (int)colOvrd; - if (!((ItemInfo)itemInfo.MyParent).IsHigh) - { - ItemInfo hls = itemInfo.MyHLS; - XOffset -= (itemInfo.MyTab.Offset - hls.MyTab.Offset); - } - } - // if this format has the centerline & numberwithlevel (special tabbing for rno) then - // position rno xoffset of the tab to be close to centerline & text indented from there (only BGE) - if (itemInfo.MyDocStyle.CenterLineX != null && itemInfo.FormatStepData.NumberWithLevel) - { - // if the tab is 3 char or smaller, make the indent amount for the rno text 4 characters. - // if bigger, make it the additional tab size. - int len = myTab.Text.Trim().Length; - int adj = len <= 3 ? 4 : (len - 3) + 4; - float rnoOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)itemInfo.MyDocStyle.CenterLineX + 5; - float tPtPerChar = itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TabPtsPerChar ?? 6; - XOffset = rnoOffset + tPtPerChar * adj; - Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - XOffset - 11; // 11 is about size of char, so don't touch right line. - if (myTab != null) myTab.XOffset = rnoOffset; - } - // if the step is within the rno and we're numbering the high level rno, we've got to account for the - // indenting (increased x offset) for the top level rno's tab, if there is no top level rno: - else if (itemInfo.FormatStepData.NumberHighLevel && (itemInfo.MyHLS.RNOs == null || itemInfo.MyHLS.RNOs.Count <= 0)) - { - // add in the size that an RNO off HLS would take. - tabWidth += itemInfo.MyTab.RNOTabWidthAdjust; - XOffset += tabWidth; - if (myTab != null) myTab.XOffset += tabWidth; - } - if (itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset != null) - { - MyTab.XOffset = float.Parse(itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset); - XOffset = MyTab.XOffset + tabWidth - MyTab.TabAlign; - } - } - else if (MyParent != null) - { - if (myTab == null && itemInfo.FormatStepData.AlignNullTabWSectHead && itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos; - else if (itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset != null) - { - if (MyTab != null) - { - MyTab.XOffset = float.Parse(itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset); - XOffset = MyTab.XOffset + tabWidth - MyTab.TabAlign; - if (myTab.MyMacro != null && myTab.MyMacro.XOffset != 0) myTab.MyMacro.XOffset += tabWidth - myTab.TabAlign; - } - } - else if (itemInfo.IsSequential && itemInfo.MyParent.IsHigh && ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.Align1StLevSubWHLS) == E_DocStructStyle.Align1StLevSubWHLS)) - { - XOffset = MyParent.XOffset; - if (myTab != null) myTab.XOffset = (MyParent.MyTab != null ? MyParent.MyTab.XOffset : XOffset); - } - else if (myTab != null && itemInfo.IsSequential && formatInfo.PlantFormat.FormatData.SectData.UseMetaSections && formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.LeftJustifyList.Count > 0) - { - int indxLevels = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel(); - float tableftadj = GetLeftJustify(formatInfo, indxLevels); - if (tableftadj != 0) - { - // the order of this is important. First adjust the tab's xoffset for the width of - // the tab. The offset of text needs to be adjusted by the 'leftjustify' format variable - // if it existed for this level. - myTab.XOffset += tabWidth; - if (tableftadj != 0 && myTab.Width < tableftadj) - tabWidth = myTab.Width = tableftadj; - XOffset += tabWidth; - myTab.Rtf = myTab.Rtf.Replace(myTab.Text, myTab.Text.TrimStart(" ".ToCharArray())); - Width = MyParent.Width - myTab.Width; - } - else // if no left justify, right align the tab - { - XOffset += tabWidth - (myTab == null ? 0 : myTab.TabAlign); - if (myTab != null) - { - myTab.XOffset += tabWidth - myTab.TabAlign; - if (myTab.MyMacro != null && myTab.MyMacro.XOffset != 0) myTab.MyMacro.XOffset += tabWidth - myTab.TabAlign; - } - } - } - - //else if ((itemInfo.FormatStepData.ColOverride ?? 0) > 0) - //{ - // XOffset = (float)itemInfo.FormatStepData.ColOverride; - // MyTab.XOffset = XOffset; - // return; - //} - else // if no left justify, right align the tab - { - // The following fixes F2016-033: Print the Verification Point at left margin. - if (itemInfo.ActiveFormat.Name.ToUpper().StartsWith("VCB") && (itemInfo.FormatStepData.ColOverride ?? 0) > 0) - { - XOffset = (float)itemInfo.FormatStepData.ColOverride; - } - else - { - XOffset += tabWidth - (myTab == null ? 0 : myTab.TabAlign); - if (myTab != null) - { - myTab.XOffset += tabWidth - myTab.TabAlign; - if (myTab.MyMacro != null && myTab.MyMacro.XOffset != 0) myTab.MyMacro.XOffset += tabWidth - myTab.TabAlign; - } - } - } - } - // if format had a tab adjustment for step type, use it. MyTab.Offset is only set for FNP formats - // to get the correct xoffset for their tabs/text. The issue is that they use very large tabs - // because levels of substeps include the parent tab. This code will only be run for FNP. - if (itemInfo.MyTab != null && itemInfo.MyTab.Offset != 0) - { - float xOffTabNew = (MyParent.MyTab != null ? MyParent.MyTab.XOffset : MyParent.XOffset) + itemInfo.MyTab.Offset; - xOffTabNew += MyParent.MyTab == null ? 0 : MyParent.MyTab.TabOffset; - float xIncrement = xOffTabNew - MyTab.XOffset; - myTab.XOffset += xIncrement; - XOffset += xIncrement; - Width -= xIncrement; - } - } - private bool PreviousIsTitleWithTextBelow(ItemInfo itemInfo) - { - while(itemInfo.MyPrevious != null) - { - if (itemInfo.MyPrevious.FormatStepData.Type == "TitleWithTextBelow") return true; - itemInfo=itemInfo.MyPrevious; - } - return false; - } - - private static float GetLeftJustify(FormatInfo formatInfo, int indxLevels) - { - LeftJustifyList jstlst = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.LeftJustifyList; - float tableftadj = 0; - foreach (LeftJustify lj in jstlst) - { - if (lj.Index == indxLevels) - { - tableftadj = lj.Size ?? 0; - break; - } - } - return tableftadj; - } - private float _CheckOffWidth = 0; - public float CheckOffWidth - { - get { return _CheckOffWidth; } - set { _CheckOffWidth = value; } - } - public void AdjustWidth(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo, vlnTab myTab) - { - int? bxIndx = itemInfo.IsStep ? itemInfo.FormatStepData.StepLayoutData.STBoxindex : null; - float? widOvrd = 0; - float xwid = 0; - if (itemInfo.IsStep && itemInfo.MyHLS != null && UseTemplateWidthOrXOff(itemInfo) && (xwid = GetWidthOrStartFromTemplate(itemInfo, formatInfo, true)) > 0) - widOvrd = xwid; - else - widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride == null ? null : - (float?)ToInt(itemInfo.FormatStepData.WidthOverride, maxRNO); - - // Calvert subheaders in valve lists - the text gets centered, so the width is the width - // of the page (also, don't do this for alarms, thus the !SpecialCaseCalvert Alarms, since - // alarms use Caution1 as the annunciator): - if (itemInfo.IsStep && itemInfo.MyHLS != null && !itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && - itemInfo.MyHLS.FormatStepData.UseOldTemplate && itemInfo.MyDocStyle.ComponentList && itemInfo.IsCaution1) - { - Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - (float)itemInfo.MyDocStyle.Layout.LeftMargin; - return; - } - - // Calvert Alarms had a case where the Title With Text Below (type 42) did not match - // any of the template items, but needed the width from the template. The previous step (of - // same type) was in the template. Check for this case. The issue can be found in - // Unit 1 Alarms/1c06/Alarm E-48/'General Information' section. - if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm && widOvrd == 0) - { - if (itemInfo.MyPrevious != null && itemInfo.MyPrevious.TemplateIndex > 1) widOvrd = GetWidthOrStartFromTemplate(itemInfo.MyPrevious, itemInfo.MyPrevious.ActiveFormat, true); - } - - // for IP2 backgrounds, set widths appropriately for template items: - if (itemInfo.IsStep && ((itemInfo.MyActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd)) - { - if (itemInfo.FormatStepData.Type.ToUpper() == "TITLEWITHTEXTBELOW") - { - Width = MyParent.Width; - return; - } - if (itemInfo.MyPrevious != null && itemInfo.MyPrevious.FormatStepData.Type == "TitleWithTextBelow") - { - Width = MyParent.MyParent.Width; - return; - } - if (widOvrd == 0 && itemInfo.MyParent.IsStep && - (itemInfo.MyParent.FormatStepData.Type.ToUpper() == "TITLEWITHTEXTBELOW" || - (((itemInfo.MyActiveSection.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd) && - itemInfo.FormatStepData != null && MyParent.MyItemInfo.MyPrevious != null && MyParent.MyItemInfo.MyPrevious.FormatStepData.Type == "TitleWithTextBelow"))) - { - Width = MyParent.MyParent.Width + (MyParent.MyParent.MyTab != null ? MyParent.MyParent.MyTab.Width : 0); - Width -= (MyTab != null ? MyTab.Width : 0); - return; - } - } - - //widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride; - // Don't adjust the RNO width if in single column mode: - if (itemInfo.IsRNOPart && itemInfo.MyParent.IsHigh && itemInfo.MyActiveSection.ColumnMode != 0 && itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthAlt != null) - { - string[] splitRNOWidthAlt = itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthAlt.Split(','); - float ovrd = (itemInfo.RNOLevel < splitRNOWidthAlt.Length) ? float.Parse(splitRNOWidthAlt[itemInfo.RNOLevel]) : 0; - if (ovrd > 0) - widOvrd = ovrd; // + 6; // Change bars on RNO column (signoff line) would not line up with 16-bit without this - NSP Alarms - } - if ((widOvrd ?? 0) != 0) - { - Width = (float)widOvrd; - // if there's a box, we may need to do an adjustment on the width, if the tab data was changed - // so don't return. - if (bxIndx == null) return; - } - float tabWidth = (myTab == null) ? 0 : myTab.Width; - if (itemInfo.IsHigh) - { - float CheckOffAdj = 0; - bool ChkOff = itemInfo.MyDocStyle.UseCheckOffs; - if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert || itemInfo.ActiveFormat.Name.ToUpper().StartsWith("VCB")) - { - SectionInfo si = itemInfo.ActiveSection.GetSectionInfo(); - ChkOff = si.HasInitials; // this determines if any steps within the section have checkoffs. - } - bool FmtHasAdj = false; - if (ChkOff) - { - if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffAdjustment != null) - { - FmtHasAdj = true; - CheckOffAdj = -(float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffAdjustment; - } - if (!itemInfo.ActiveFormat.Name.ToUpper().StartsWith("VCB")) // Don't do the following if in a vcb format (part of fix F2016-039) - { - if (!HasCheckOffHeading(itemInfo, formatInfo) && CheckOffAdj < 0) - CheckOffAdj += (float)(9 * 7.2); // 9 is the size of the SIGNOFF adjustment - else if (!FmtHasAdj && HasCheckOffHeading(itemInfo, formatInfo)) - // For Robinson, tried using font's CharsToTwips but it made it too narrow, so used hardcoded 6: - CheckOffAdj = -((float)9 * 6); - } - } - float adjwidth = CheckOffAdj; - CheckOffWidth = -CheckOffAdj; - adjwidth = AdjustMetaWidth(itemInfo, formatInfo, adjwidth, FmtHasAdj); - Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); - Width += _WidthAdjust; - Width += adjwidth; - - // if AlignHLSTabWithSect is set, we moved the starting x location of the HLS, and following steps - // to be under section header. Adjust the width accordingly, or the text may go out of the margin. - if (myTab == null && itemInfo.FormatStepData.AlignNullTabWSectHead && itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert) - Width = Width + (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos - (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos; - else if (myTab == null && itemInfo.FormatStepData.AlignNullTabWSectHead) - Width = Width + (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos; - else if (itemInfo.MyDocStyle.AlignHLSTabWithSect) - Width = Width - (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos; - } - else if (bxIndx != null) - { - Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - if (bx == null) - { - // NOT SURE IF WE NEED TO TEST FOR THE NULLBOX FORMAT FLAG, MAYBE "bx == null" IS THE SAME THING - //if (formatInfo.MyStepSectionLayoutData.NullBox) - if (widOvrd != 0) - Width = (float)widOvrd - tabWidth; - else - Width = (float)formatInfo.MyStepSectionLayoutData.WidT - tabWidth; - } - else - Width = _WidthAdjustBox + (float)bx.TxtWidth - tabWidth; // add 1 to get it to wrap like 16Bit - } - else if ((itemInfo.IsCaution || itemInfo.IsNote) && !itemInfo.FormatStepData.UseOldTemplate) - { - float mycolT = (float)formatInfo.MyStepSectionLayoutData.ColT; - if (formatInfo.MyStepSectionLayoutData.Dev_Format) - Width = (float)formatInfo.MyStepSectionLayoutData.WidT + 1; - else if (itemInfo.IsInRNO) - { - if (MyItemInfo.FormatStepData.CenterOneLineAdjust) - { - int rnoOff = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO); - XOffset = rnoOff + MyHighLevelParagraph.XOffset; - Width = MyParent.Width; - } - else - Width = (MyParent.XOffset + MyParent.Width) - (XOffset + mycolT); - } - else - { - // B2016-269: if caution/note & not boxed, with tab adjust width based on xoffset of tab - // so text doesn't print out of right border. - // B2017-027: Added a check for column mode - we only want to do this if in single column mode - if (!MyItemInfo.MyParent.IsHigh && MyTab != null && MyTab.YOffset == YOffset && MyItemInfo.MyActiveSection.ColumnMode == 0) - Width = MyHighLevelParagraph.Width - MyTab.Width - (MyTab.XOffset - MyHighLevelParagraph.XOffset) - 6; - else - Width = (float)formatInfo.MyStepSectionLayoutData.WidT - 6 - mycolT; - } - XOffset += mycolT; // adjust caution/note text position - if (PartsLeft != null && PartsLeft.Count > 0)// adjust tab position - { - if(myTab!=null && (itemInfo.IsNote || itemInfo.IsCaution)) - Width -= myTab.Width; - foreach (vlnPrintObject vpo in PartsLeft) - vpo.XOffset += mycolT; - } - } - else if (itemInfo.IsSection) - { - Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); - float adjwidths = 0; - adjwidths = AdjustMetaWidth(itemInfo, formatInfo, adjwidths, false); - Width += (adjwidths + _WidthAdjust); - } - else if (MyParent == null) - { - // 72 points / inch - 7 inches (about width of page) - Width = 72 * 7; - } - else if (itemInfo.IsRNOPart && itemInfo.MyActiveSection.ColumnMode != 0 && itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthAltAll != null) - { - // This code was added for AEP. Other code that adjusted RNO widths was only adjusting the RNO widths - // off of the HLS. AEP needed adjusting for all RNOs. - float ovrd = (float)itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthAltAll; - if (ovrd > 0) - Width = ovrd - tabWidth; - if (XOffset + Width > (float)itemInfo.MyDocStyle.Layout.PageWidth) - Width = (float)itemInfo.MyDocStyle.Layout.PageWidth - XOffset - 5; - } - else if (itemInfo.IsRNOPart && !((ItemInfo)itemInfo.ActiveParent).IsHigh) - { - if (itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthAdj != null && !((ItemInfo)itemInfo.ActiveParent).IsInRNO) - Width = MyParent.Width + float.Parse(itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthAdj); - else - Width = MyParent.Width; - } - else if (itemInfo.IsRtfRaw) // this needs to be before the check for 'IsTablePart' - the rtfraw may be a table part, but the size is defined by raw rtf - { - System.Drawing.Size sz = RtfRawItem.GetRtfRawSize(MyItemInfo.MyContent.Text); - Height = sz.Height; - Width = sz.Width; - Rtf = MyItemInfo.MyContent.Text; - } - else if (itemInfo.IsTablePart) - { - Width = 72 * 7; // TODO: Need to determine the Width of the Table based upon the contents - } - else if (itemInfo.MyParent.IsCaution || itemInfo.MyParent.IsNote) - { - if(itemInfo.ActiveFormat.MyStepSectionLayoutData.DevNoteOrCautionTabOffset != null) - Width = MyParent.MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign); - else - Width = MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign); - Width -= 72 * (itemInfo.FormatStepData.CautionOrNoteSubstepIndent == null ? 0 : (float)itemInfo.FormatStepData.CautionOrNoteSubstepIndent / (float)itemInfo.FormatStepData.Font.CPI); - } - else - { - float adjwidth = 0; - if (itemInfo.IsRNOPart && itemInfo.ActiveFormat.MyStepSectionLayoutData.RNOWidthSameAsHighParent && itemInfo.MyParent.IsHigh) - Width = adjwidth + MyParent.Width; - else if (itemInfo.MyTab != null && itemInfo.MyTab.Position != 0) - Width = adjwidth + MyParent.Width; - else if (MyParent.WidthNoLimit != 0) - Width = adjwidth + MyParent.WidthNoLimit - tabWidth + (myTab == null ? 0 : myTab.TabAlign); - else if ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_PageListSpBckgrnd) == E_DocStructStyle.DSS_PageListSpBckgrnd) - Width = adjwidth + MyParent.Width - (MyTab!=null?MyTab.Width:0); - else - Width = adjwidth + MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign); - } - if (itemInfo.IsSequential && itemInfo.MyParent.IsHigh && ((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.Align1StLevSubWHLS) == E_DocStructStyle.Align1StLevSubWHLS)) - Width += 10; // FIX THIS!!! - } - - private float AdjustMetaWidth(ItemInfo itemInfo, FormatInfo formatInfo, float adjwidth, bool coadj) - { - SectData sd = formatInfo.PlantFormat.FormatData.SectData; - if (((itemInfo.MyDocStyle.StructureStyle.Style & E_DocStructStyle.DSS_SameXOffSubsections) == E_DocStructStyle.DSS_SameXOffSubsections)) - { - // don't adjust the width if there already was an adjustment for checkoffs - for VCB only (F2016-039) - if (!(itemInfo.ActiveFormat.Name.ToUpper().StartsWith("VCB")&&coadj)) - adjwidth = MyTab != null ? -MyTab.Width : 0; - } - else if (sd.UseMetaSections) - { - if (sd.StepSectionData.StepSectionLayoutData.TieTabToLevel) - { - if (ShowSectionTitles - && !itemInfo.MyDocStyle.CancelSectTitle - && !(itemInfo.MyDocStyle.SpecialStepsFoldout && itemInfo.MyDocStyle.UseColSByLevel)) - { - int indxLevel = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel(); - adjwidth += formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.MaxIndex].WidSAdjByLevel ?? 0; ; - float colsbylevel = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.MaxIndex].ColSByLevel; - float seclvlindent = colsbylevel - (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS; - adjwidth -= seclvlindent; - if (itemInfo.IsStep) adjwidth -= AdjustForSectionLevelTab(); - if (itemInfo.IsSection && itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.WCNTraining) - adjwidth -= (float)((itemInfo.MyTab.CleanText.Trim().Length * 72) / itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.SectionHeader.Font.CPI); - } - } - else - { - if (formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.MaxIndex > 0) - adjwidth += (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[itemInfo.PrintLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.MaxIndex].ColSByLevel; - } - } - return adjwidth; - } - - // for Component Table, don't increment yoff unless last item in table that HAS data associated - // with it (there may be empty cells at end). - public bool UseTemplateKeepOnCurLine(ItemInfo itemInfo) - { - if (!itemInfo.IsStep || !itemInfo.MyDocStyle.ComponentList) return false; - if (!itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvert - && itemInfo.MyHLS.FormatStepData.UseOldTemplate) return true; - return false; - } - private bool UseTemplateWidthOrXOff(ItemInfo itemInfo) - { - if (!itemInfo.IsStep) return false; - if (itemInfo.MyHLS == null) return false; - if (itemInfo.MyHLS.FormatStepData.UseSmartTemplate || (itemInfo.MyDocStyle.ComponentList && itemInfo.MyHLS.FormatStepData.UseOldTemplate)) - { - ItemInfo useForTemplate = itemInfo.IsHigh ? itemInfo : itemInfo.MyParent; - int topIndx = useForTemplate.GetSmartTemplateTopLevelIndx(); - int tpIndx = -1; - if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) - { - if (itemInfo.IsCaution1) return false; - else tpIndx = useForTemplate.GetSmartTemplateIndex(topIndx, itemInfo.MyContent.Text); - } - else - tpIndx = useForTemplate.GetSmartTemplateIndex(topIndx, (int)useForTemplate.MyContent.Type); - if (tpIndx > -1) return true; - } - return false; - } - private float GetWidthOrStartFromTemplate(ItemInfo itemInfo, FormatInfo formatInfo, bool bGetWidth) - { - int topIndx = itemInfo.GetSmartTemplateTopLevelIndx(); - int tmplIndx = 0; - if (itemInfo.MyDocStyle.ComponentList && !itemInfo.IsHigh) - { - // The following was added so that the Calvert Alarms sequentials under the CONDITION/RESPONSE would be - // printed as 2 column (data within the template definition set the columns to 2) - if (itemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) - { - if (itemInfo.IsSequential && itemInfo.MyParent.TemplateIndex > 0) - { - if (bGetWidth && itemInfo.MyParent.ColumnMode == 1) // 2 columns - return (ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, itemInfo.ColumnMode) - MyTab.Width); - } - tmplIndx = itemInfo.TemplateIndex; - if (tmplIndx == -1) return 0; - } - else - { - // The ComponentTable format (FNP component table as one example), uses a template - // where the items in the template below the HLS are all paragraphs (the intermediate steps - // are TitleWithTextRight). Find the ordinal of in this list to get the index. Use the ordinal - // as an offset from the HLS's index into the template. - tmplIndx = itemInfo.MyParent.Ordinal + topIndx; - if (tmplIndx < 0 || tmplIndx > formatInfo.PlantFormat.FormatData.Templates.Count - 1) return 0; - } - } - else - { - tmplIndx = itemInfo.GetSmartTemplateIndex(topIndx, (int)itemInfo.MyContent.Type); - if (tmplIndx == -1) return 0; - } - // Calvert Alarms' template defines number of columns & their width. - if (bGetWidth && formatInfo.PlantFormat.FormatData.Templates[tmplIndx].width == 0) - { - int nocol = formatInfo.PlantFormat.FormatData.Templates[tmplIndx].nocolm == 0 ? 0 : formatInfo.PlantFormat.FormatData.Templates[tmplIndx].nocolm - 1; - return ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, nocol); - } - int ncol = bGetWidth ? formatInfo.PlantFormat.FormatData.Templates[tmplIndx].width : formatInfo.PlantFormat.FormatData.Templates[tmplIndx].start; - // now convert to the units for this format. The template width data is in number of columns. - return (ncol * itemInfo.FormatStepData.Font.CharsToTwips) + (bGetWidth ? 1 : 0); // + 1 is slight adjustment so column doesn't wrap - } - private float AdjustForSectionLevelTab() - { - string sectTab = MyItemInfo.ActiveSection.MyTab.CleanText.TrimEnd(); - if (sectTab.EndsWith(".0")) return 0; - string myTab = MyItemInfo.MyTab.CleanText; - // -1 below code, +1 for '.' and -2 for standard wid of tab - // standard wid of this tab is 2 (ex: '1.') - // so adjust width if longer than normal - return (float)(sectTab.Length - 1) * 72 / (float)MyItemInfo.FormatStepData.Font.CPI; - } - private bool HasCheckOffHeading(ItemInfo itemInfo, FormatInfo formatInfo) - { - if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList.MaxIndex != 0) - { - // does this section have a check off heading? - SectionConfig sc = itemInfo.MyActiveSection.MyConfig as SectionConfig; - if (sc != null && sc.Section_CheckoffHeaderSelection > 0) return true; - } - if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderInPagelist) return true; - return false; - } - // Currently not used. - // - //private bool UseCheckOffsDocStyle(int oldToNew, FormatInfo formatInfo) - //{ - // int bit, retval=0; - // int mask=1; - - // for(bit=0; bit < 32; bit++){ - // if ((oldToNew & mask) != 0 && ((int)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.UseCheckOffsIn & mask) !=0) retval = 1; - // mask <<= 1; - // } - // return retval > 0; - //} - } - - /// - /// First order by stepLevel, then within a stepLevel, order by descending yLocation on page. - /// Want to find maximum y value that fits on page, i.e. put the most on page that can - /// fit which is defined by the largest yLocation - /// - public class StepLevelList : SortedDictionary> - { - public StepLevelList() - : base() - { - } - public void Add(int stepLevel, float yLocation, vlnParagraph para) - { - if (stepLevel == 0) return; - if (!this.ContainsKey(stepLevel)) - this.Add(stepLevel, new SortedDictionary()); - // using a negative for yLocation so that its in descending order: - if (!this[stepLevel].ContainsKey(-yLocation)) - this[stepLevel].Add(-yLocation, para); - } - } - public class ParagraphLocations : List - { - public ParagraphLocations() - : base() - { - } - public void Add(vlnParagraph myParagraph, float yTopMost) - { - ParagraphLocation foundOverlap = FindOverlap(myParagraph); - if (foundOverlap == null) - { - this.Add(new ParagraphLocation(yTopMost, myParagraph)); - return; - } - ParagraphLocation doubleOverlap = FindOverlap(foundOverlap); - while (doubleOverlap != null) - { - doubleOverlap.Merge(foundOverlap); - this.Remove(foundOverlap); - foundOverlap = doubleOverlap; - doubleOverlap = FindOverlap(foundOverlap); - } - } - - private ParagraphLocation FindOverlap(vlnParagraph myParagraph) - { - foreach (ParagraphLocation paraLoc in this) - if (paraLoc.Overlap(myParagraph)) - return paraLoc; - return null; - } - private ParagraphLocation FindOverlap(ParagraphLocation myParaLoc) - { - foreach (ParagraphLocation paraLoc in this) - if (paraLoc != myParaLoc && paraLoc.Overlap(myParaLoc)) - return paraLoc; - return null; - } - internal StepLevelList BuildStepLevelList(bool KeepStepsOnPage) - { - StepLevelList myList = new StepLevelList(); - foreach (ParagraphLocation paraLoc in this) - { - int level = paraLoc.StepLevel; - if (KeepStepsOnPage && paraLoc.MyParagraph.MyItemInfo.MyContent.Type == 20001) - { - if (DontBreakHere(paraLoc)) - //if (paraLoc.MyParagraph.MyItemInfo.MyPrevious == null) // First substep - level = 0; - else - level = 1; - } - // For B2015-014, some migrated data for background documents had the TitleWithTextBelow with associated paragraphs - // as siblings rather than children. Pagination was sometimes putting the TitleWithTextBelow on one page and the - // paragraphs on next. The following code checks thse types, if in enhanced documents but not the Short Form Deviations. - if (paraLoc.MyParagraph.MyItemInfo.ActiveFormat != null - && ((paraLoc.MyParagraph.MyItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds) - || (((paraLoc.MyParagraph.MyItemInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations) - && paraLoc.MyParagraph.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.EnhancedShortFormDev)) - { - if (!paraLoc.MyParagraph.MyItemInfo.IsTitle && paraLoc.MyParagraph.MyItemInfo.MyPrevious != null && paraLoc.MyParagraph.MyItemInfo.MyPrevious.FormatStepData.Type == "TitleWithTextBelow") level = 0; - } - myList.Add(level, paraLoc.YTop, paraLoc.MyParagraph); - } - return myList; - } - private bool DontBreakHere(ParagraphLocation paraLoc) - { - if (paraLoc.MyParagraph.MyItemInfo.MyPrevious == null) // First substep - return true; - vlnParagraph myPara = paraLoc.MyParagraph; - while (!myPara.MyItemInfo.IsHigh) - { - if (myPara.MyItemInfo.IsCaution) return true; - if (myPara.MyItemInfo.IsNote) return true; - myPara = myPara.MyParent; - } - return false; - } - } - public class ParagraphLocation - { - public override string ToString() - { - return string.Format("{0} {1} - {2} - '{3}'", this.MyParagraph.MyItemInfo.ItemID, this.StepLevel, this.YTop, this.MyParagraph.MyItemInfo.ShortPath); - } - private float _YTop; - public float YTop - { - get { return _YTop; } - set { _YTop = value; } - } - private float _YBottom; - public float YBottom - { - get { return _YBottom; } - set { _YBottom = value; } - } - private int _StepLevel; - public int StepLevel - { - get { return _StepLevel; } - set { _StepLevel = value; } - } - private vlnParagraph _MyParagraph; - public vlnParagraph MyParagraph - { - get { return _MyParagraph; } - set { _MyParagraph = value; } - } - public ParagraphLocation(float yTopMost, vlnParagraph myParagraph) - { - MyParagraph = myParagraph; - YTop = myParagraph.YVeryTop - yTopMost; - YBottom = myParagraph.YBottom - yTopMost; - StepLevel = myParagraph.MyItemInfo.StepLevel; - } - public bool Overlap(vlnParagraph otherParagraph) - { - if (Between(otherParagraph.YTop, YTop, YBottom)) return true; - if (Between(otherParagraph.YBottom, YTop, YBottom)) return true; - if (Between(YTop, otherParagraph.YVeryTop, otherParagraph.YBottom)) return true; - if (Between(YBottom, otherParagraph.YVeryTop, otherParagraph.YBottom)) return true; - return false; - } - public static bool Between(float x, float lower, float higher) - { return x > lower && x < higher; } - public bool Overlap(ParagraphLocation otherParagraphLocation) - { - if (Between(otherParagraphLocation.YTop, YTop, YBottom)) return true; // The top is within the other - if (Between(otherParagraphLocation.YBottom, YTop, YBottom)) return true; // The bottom is within the other - if (Between(YTop, otherParagraphLocation.YTop, otherParagraphLocation.YBottom)) return true; // the other top is within this one - if (Between(YBottom, otherParagraphLocation.YTop, otherParagraphLocation.YBottom)) return true;// I believe this is unnecessary - return false; - } - public void Merge(vlnParagraph otherParagraph) - { - if (StepLevel < otherParagraph.MyItemInfo.StepLevel) MyParagraph = otherParagraph; - YTop = Math.Min(YTop, otherParagraph.YVeryTop); - YBottom = Math.Max(YBottom, otherParagraph.YBottom); - StepLevel = Math.Max(StepLevel, otherParagraph.MyItemInfo.StepLevel); - } - public void Merge(ParagraphLocation otherParagraphLocation) - { - if (StepLevel < otherParagraphLocation.StepLevel) MyParagraph = otherParagraphLocation.MyParagraph; - YTop = Math.Min(YTop, otherParagraphLocation.YTop); - YBottom = Math.Max(YBottom, otherParagraphLocation.YBottom); - StepLevel = Math.Max(StepLevel, otherParagraphLocation.StepLevel); - } - } -} diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs1.bak b/PROMS/Volian.Print.Library/vlnParagraph.cs1.bak deleted file mode 100644 index 888dbd35..00000000 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs1.bak +++ /dev/null @@ -1,1995 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Text.RegularExpressions; -using System.IO; -using iTextSharp.text.pdf; -using iTextSharp.text; -using Itenso.Rtf; -using Itenso.Rtf.Parser; -using Itenso.Rtf.Interpreter; -using Itenso.Rtf.Support; -using Volian.Controls.Library; -using VEPROMS.CSLA.Library; -using Volian.Base.Library; - -namespace Volian.Print.Library -{ - public partial class vlnParagraphs : List - { - private vlnParagraph _Parent; - public vlnParagraph Parent - { - get { return _Parent; } - set { _Parent = value; } - } - public vlnParagraphs(vlnParagraph parent) - { - _Parent = parent; - } - public float Add(PdfContentByte cb, ItemInfoList itemInfoList, float xoff, float yoff, float yoffRight, int rnoLevel, int maxRNO, FormatInfo formatInfo) - { - int? bxIndex = null; - vlnBox box = null; - float yTop = yoff; - foreach (ItemInfo childItemInfo in itemInfoList) - { - // if this is a caution/note and it has a caution/note substep, do it before this caution/note, so that - // it comes above it. - if (childItemInfo.Cautions != null && (childItemInfo.IsCaution || childItemInfo.IsNote)) - yoff = Add(cb, childItemInfo.Cautions, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo); - if (childItemInfo.Notes != null && (childItemInfo.IsCaution || childItemInfo.IsNote)) - yoff = Add(cb, childItemInfo.Notes, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo); - int? bxIndx = childItemInfo.FormatStepData==null?-1:childItemInfo.FormatStepData.StepLayoutData.STBoxindex; - if (bxIndx != -1 && (bxIndex != bxIndx || childItemInfo.FormatStepData.BoxIt)) - { - if (childItemInfo.FormatStepData.BoxIt) // this is a boxed HLS - { - box = new vlnBox(); - box.MyBox = new Box(); - box.DefBox = vlnBox.BoxThin; - StepSectionLayoutData ssld = formatInfo.MyStepSectionLayoutData; - int colR = int.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[childItemInfo.ColumnMode]); - int widS = vlnPrintObject.ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); - box.DefEnd = (float)(ssld.ColS + colR + widS + (60/4.8)); - box.YOffset = yoff - .75F * vlnPrintObject.SixLinesPerInch; - } - else if (bxIndex == null) // First boxed step - { - box = new vlnBox(); - box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - if (box.MyBox != null) - { - box.YOffset = yoff; - int ln = 1; // a format flag determines whether there is a space before the note/caution. - if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; - yoff += ln * vlnPrintObject.SixLinesPerInch; - } - } - else // Change Box Style - { - if (box != null) box.Height = yoff - box.YOffset; // new height, with children - box = new vlnBox(); - box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - box.YOffset = yoff; - int ln = 1; // a format flag determines whether there is a space before the note/caution. - if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; - yoff += ln * vlnPrintObject.SixLinesPerInch; - } - bxIndex = bxIndx; - } - if (childItemInfo is SectionInfo) formatInfo = (childItemInfo as SectionInfo).LocalFormat ?? formatInfo; - if (rnoLevel < maxRNO && childItemInfo.RNOs != null) yoff = Math.Max(yoff, yoffRight); - - - vlnParagraph para = new vlnParagraph(Parent, cb, childItemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo); - if (box != null && box.MyParent == null) - { - box.MyParent = para; - para.PartsContainer.Add(box); - } - Add(para); - // para.YBottomMost will have y for bottom of any substeps that are also enclosed in the box. - if (childItemInfo.IsStep && childItemInfo.MyHLS.FormatStepData.UseSmartTemplate && para.ChildrenBelow.Count>0 && para.ChildrenBelow[0].YBottomMost > para.YBottomMost) - yoff = para.ChildrenBelow[0].YBottomMost; - else - yoff = para.YBottomMost; - if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.BoxIt) - { - box.Height = yoff - box.YOffset - (1.1F * vlnPrintObject.SixLinesPerInch); - box = null; // if doing boxed steps, only do single sibling at a time. - } - } - if (box != null && box.MyBox != null) - { - box.Height = yoff - box.YOffset; // new height, with children - yoff += 2 * vlnPrintObject.SixLinesPerInch; - } - return yoff; - } - public float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin) - { - foreach (vlnParagraph child in this) - { - yPageStart = child.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - } - return yPageStart; - } - } - public partial class vlnParagraph : vlnPrintObject - { - private vlnTable _MyGrid; - public vlnTable MyGrid - { - get { return _MyGrid; } - set { _MyGrid = value; } - } - public float SectYPageStart = 0; - private bool _IsWordDocPara = false; - public bool IsWordDocPara - { - get { return _IsWordDocPara; } - set { _IsWordDocPara = value; } - } - public float ParagraphToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin) - { - if (Processed) return yPageStart; - //float localYPageStart = yPageStart; - Processed = true; - if (_PartsAbove != null && _PartsAbove.Count > 0) yPageStart = PartsAbove.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - if (MyItemInfo.IsHigh && MyItemInfo.MyDocStyle.SpecialStepsFoldout) yPageStart -= SixLinesPerInch; - float yLocation = CalculateYOffset(yPageStart, yTopMargin); - if (MyItemInfo.HasChangeBar && MyPageHelper.ChangeBarDefinition.MyChangeBarType != PrintChangeBar.Without) MyPageHelper.AddChangeBar(DoChangeBar(cb, MyItemInfo, MyPageHelper, XOffset, yLocation, MyPageHelper.MaxRNO, MyItemInfo.ActiveFormat), cbMess); - float retval = yLocation; - - if (MyItemInfo.IsFigure) - { - yLocation -= (SixLinesPerInch * MyPageHelper.YMultiplier); - if (ImageText != null) - retval = DrawFigure(cb, yBottomMargin, yLocation); - else - retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation); - - } - else if (!MyItemInfo.IsStepSection - || (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles - && !MyItemInfo.MyDocStyle.CancelSectTitle - && !MyItemInfo.MyDocStyle.SpecialStepsFoldout)) // Don't ouput the Step Section title - { - bool doprint = true; - // if this is a section, then check the section config for printable header too. - if (MyItemInfo.IsSection) - { - SectionConfig sch = MyItemInfo.MyConfig as SectionConfig; - if (!(MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles - && !MyItemInfo.MyDocStyle.CancelSectTitle - && !MyItemInfo.MyDocStyle.SpecialStepsFoldout) - && - ((sch != null && sch.Section_PrintHdr != "Y") || !MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections)) doprint = false; - } - if (MyItemInfo.MyContent.MyGrid != null) - retval = DrawGrid(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation); - else - if (doprint)retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation); - if (MyItemInfo.IsHigh) - { - MyPageHelper.PageBookmarks.Add(MyItemInfo, MyItemInfo.MyTab.CleanText + " " + MyItemInfo.DisplayText, - new PdfDestination(PdfDestination.FITBH, yLocation + YVeryTop - YTopMost + SixLinesPerInch)); - } - } - if (MyItemInfo.IsSection) - { - SectionConfig sc = MyItemInfo.MyConfig as SectionConfig; - if (sc != null && sc.Section_TOC == "Y") - { - string tocKey = string.Format("TOC{0}", MyItemInfo.ItemID); - if (MyPageHelper.MyTOCPageCounts.ContainsKey(tocKey)) - { - PageCount pc = MyPageHelper.MyTOCPageCounts[tocKey]; - pc.Total = MyPageHelper.CurrentPageNumber; - pc.DrawTemplates(); - } - } - } - //Height = yLocation - retval; - if (_PartsLeft != null && _PartsLeft.Count > 0) yPageStart = PartsLeft.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - if (_PartsRight != null && _PartsRight.Count > 0) yPageStart = PartsRight.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - if (_PartsBelow != null && _PartsBelow.Count > 0) yPageStart = PartsBelow.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - if (_PartsContainer != null && _PartsContainer.Count > 0) yPageStart = PartsContainer.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - - //if (localYPageStart != yPageStart) DebugText.WriteLine("ParToPdf-yPagestartDiff:{0},{1},{2}", MyItemInfo.ItemID, localYPageStart, yPageStart); - return yPageStart; - } - - private float DrawGrid(PdfContentByte cb, ref float yPageStart, float yTopMargin, float yBottomMargin, ref float yLocation) - { - //DebugText.WriteLine("{0},'{1}','{2}','<>'", MyItemInfo.ItemID, MyItemInfo.ShortPath, FormattedText); - DebugText.WriteLine("{0},'{1}','{2}','<>',{3}", MyItemInfo.ItemID, MyItemInfo.ShortPath,MyItemInfo.MyContent.Text,XOffset); - float retval = Rtf2Pdf.GridAt(cb, MyGrid, XOffset, yLocation, Width, 100, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless")); - return retval; - } - - private float DrawText(PdfContentByte cb, ref float yPageStart, float yTopMargin, float yBottomMargin, ref float yLocation) - { - DebugText.WriteLine("{0},'{1}','{2}','<>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, FormattedText); - //Console.WriteLine("{0},{1},'{2}','<>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, IParagraph.Content); - float retval = yLocation; - // Check if only one line, i.e. "Height < (1.2F * IParagraph.Leading". The Leading can be for six or seven lines per inch, so the 1.2 - // multiplier accounts for both. - if (!MyItemInfo.IsStepSection && MyItemInfo.FormatStepData.CenterOneLineOnly && MyItemInfo.MyPrevious == null && MyItemInfo.NextItem == null && Height < (1.2F * IParagraph.Leading)) - IParagraph.Alignment = Element.ALIGN_CENTER; - if (!MyItemInfo.IsStepSection && MyItemInfo.FormatStepData.StepPrintData.Justify == "Center") - IParagraph.Alignment = Element.ALIGN_CENTER; - retval = Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, DebugInfo, yBottomMargin); - if (retval == 0) // problem occurred - paragraph was not able to be printed on page - { // pagination logic needs to be fixed. - ForcePagination(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation, ref retval); - } - return retval; - } - private static List myAttributes =new List(); - private static void AddAttribute(string attr) - { - if (myAttributes.Contains(attr)) - return; - //Console.WriteLine("Attribute = \"{0}\"", attr); - myAttributes.Add(attr); - } - private void CheckAttributes(System.Collections.Hashtable attributes) - { - foreach (string attr in attributes.Keys) - { - AddAttribute(attr); - } - } - private string FormattedText - { - get - { - bool subscript = false; - //if (_MyItemInfo.ItemID == 467) - // Console.Write(""); - StringBuilder sb = new StringBuilder(); - //if (IParagraph.Chunks.Count > 1) - // Console.WriteLine("{0} Chunks", IParagraph.Chunks.Count); - foreach (Chunk chk in IParagraph.Chunks) - { - string prefix = ""; - string suffix = ""; - CheckAttributes(chk.Attributes); - if (chk.Font.BaseFont != null && chk.Font.BaseFont.PostscriptFontName.ToUpper().Contains("BOLD")) - { - prefix += "\xD5"; - suffix = "\xD6" + suffix; - } - if (chk.Attributes.ContainsKey("SUBSUPSCRIPT")) - { - float sup = (float)(chk.Attributes["SUBSUPSCRIPT"]); - if (sup > 0) - { - prefix += "\xA6"; - suffix = "\xD1" + suffix; - } - else if (sup < 0) - { - prefix += "\xD1"; - suffix = "\xA6" + suffix; - } - - } - if (chk.Attributes.ContainsKey("UNDERLINE")) - { - prefix += "\x16"; - suffix = "\x16" + suffix; ; - } - sb.Append(prefix + chk.Content + suffix); - } - string retval = sb.ToString(); - retval = retval.Replace("\xD1\xA6", "");// Remove Multiple Superscript commands in a row - retval = retval.Replace("\xA6\xD1", "");// Remove Multiple Superscript commands in a row - retval = retval.Replace("\xD6\xD5", ""); - retval = retval.Replace("\xD6\x16\xD5", "\x16"); - return retval; - } - } - //private bool _TextDebug = false; //true; this will turn on a writeline with debug in DrawText() - private float DrawFigure(PdfContentByte cb, float yBottomMargin, float yLocation) - { - float retval = yLocation; - if (ImageText != null) - { - string[] vals = ImageText.Split("\n".ToCharArray()); - ProcedureInfo proc = MyItemInfo.MyProcedure; - DocVersionInfo dvi = proc.ActiveParent as DocVersionInfo; - ROFstInfo rofst = dvi.DocVersionAssociations[0].MyROFst; - ROImageInfo roImage = ROImageInfo.GetByROFstID_FileName(rofst.ROFstID, vals[0]); - if (roImage != null) - { - iTextSharp.text.Image it_image = iTextSharp.text.Image.GetInstance(roImage.Content); - retval = Rtf2Pdf.FigureAt(cb, it_image, XOffset + MyItemInfo.FormatStepData.Font.CharsToTwips, yLocation, Width * MyPageHelper.YMultiplier, Height * MyPageHelper.YMultiplier, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless")); - } - } - return retval; - } - private string DebugInfo - { - get - { - return string.Format("DebugID = {0}, ID={1} Type={2} TypeName='{3}' StepLevel={4} DBSequence={5}", DebugId, MyItemInfo.ItemID, MyItemInfo.FormatStepType, MyItemInfo.FormatStepData==null?"NoStepData":MyItemInfo.FormatStepData.Type, MyItemInfo.StepLevel, MyItemInfo.DBSequence); - } - } - public override float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin) - { - if (IsWordDocPara) - { - PdfReader tmp = null; - string tmpstr = null; - SectionInfo si = SectionInfo.Get(MyItemInfo.ItemID); - cb.PdfDocument.NewPage(); - MyPageHelper.MyPromsPrinter.CreateWordDocPdf(cb, si, ref tmp, ref tmpstr); - Processed = true; - return yPageStart; - } - float yLocalypagestart = yPageStart; - // yPageStart is offset into roll; YTopMost is offset of topmost of this paragraph. - float yLocation = yPageStart - YTopMost; - DebugText.WriteLine("ToPdf1:{0},'{1}',{2},{3},{4},{5}", MyItemInfo.ItemID, MyItemInfo.ShortSearchPath, XOffset, yLocation, yPageStart, YTopMost); - int paginate = Paginate(yLocation, yTopMargin, yBottomMargin); - bool firstHighLevelStep = MyItemInfo.IsHigh && (MyItemInfo.MyPrevious == null); - switch (paginate) - { - case 0: // No page break - if (MyItemInfo.IsSection) - { - SectionInfo si = MyItemInfo as SectionInfo; - MyPageHelper.PageBookmarks.Add(MyItemInfo, ((si.DisplayNumber ?? "") == "" ? "" : si.DisplayNumber + " - ") + si.DisplayText, null); - DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); - } - break; - case 1: // Break on High Level Step - OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); - cb.PdfDocument.NewPage(); - DebugText.WriteLine("Paginate1"); - if (MyItemInfo.IsSection) - { - SectionInfo si = MyItemInfo as SectionInfo; - MyPageHelper.PageBookmarks.Add(MyItemInfo, ((si.DisplayNumber ?? "") == "" ? "" : si.DisplayNumber + " - ") + si.DisplayText, null); - } - // Only do foldout page if not done for section break, i.e. check the there's a previous step. - if (MyItemInfo.MyPrevious != null && (MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Style ?? 0 & E_DocStructStyle.UseSectionFoldout) != 0) - PromsPrinter.DoFoldoutPage(cb, "HLS", MyPageHelper.TextLayer, MyPageHelper); - - yPageStart = yTopMargin + YTopMost; - DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); - MyPageHelper.YMultiplier = 1; - break; - case 2: // Break within a Step - OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); - DocStyle docstyle = MyItemInfo.MyDocStyle; - string myMsg = docstyle.Continue.Bottom.Message; - if (myMsg != null && myMsg != "") - { - if (myMsg.IndexOf(@"%d") > -1) - myMsg = myMsg.Replace(@"%d", MyItemInfo.MyHLS.MyTab.CleanText.Trim()); - if (myMsg.IndexOf(@"%2d") > -1) - myMsg = myMsg.Replace(@"%2d", MyItemInfo.MyHLS.MyTab.CleanText.Trim(" .".ToCharArray()).PadLeft(2)); - float msg_yLocation = 0; - if (myMsg.Contains("{par}")) - { - myMsg = myMsg.Replace("{par}", ""); - msg_yLocation = -SixLinesPerInch; - } - switch (docstyle.Continue.Bottom.Location) - { - case E_ContBottomLoc.EndOfText: // place continue string at end of text - case E_ContBottomLoc.BtwnTextAndBottom: // place continue string between end of text & bottom of page - Console.WriteLine("Not done yet"); - break; - case E_ContBottomLoc.BottomOfPage: // place continue message at bottom of page - //msg_yLocation = yBottomMargin + 2 * SixLinesPerInch + (float)docstyle.Layout.FooterLength; // 2 lines above bottom margin - msg_yLocation = msg_yLocation + yBottomMargin + (float)docstyle.Layout.FooterLength; - break; - default: - Console.WriteLine("**** BOTTOM CONTINUE MESSAGE NOT CODED*****"); - break; - } - MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Bottom.Margin ?? 0, msg_yLocation, docstyle.Continue.Bottom.Font);// MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font); - } - cb.PdfDocument.NewPage(); - DebugText.WriteLine("Paginate2"); - if ((MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Style ?? 0 & E_DocStructStyle.UseSectionFoldout) != 0) - PromsPrinter.DoFoldoutPage(cb, "Break within Step", MyPageHelper.TextLayer, MyPageHelper); // temporary foldout - - // If there is a box, adjust the yTopMost to include it. - float yTopMost = YTopMost; - //if (YVeryTop < yTopMost) Console.WriteLine("{0},{1},{2}", MyItemInfo.DBSequence, yTopMost, YVeryTop); - yTopMost = Math.Min(yTopMost,YVeryTop); - yPageStart = yTopMargin + yTopMost;// -2 * SixLinesPerInch; - DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); - if (EmptyTopMostPart) yPageStart += SixLinesPerInch; - myMsg = docstyle.Continue.Top.Message; - if (myMsg != null && myMsg != "") - { - yPageStart -= 2 * SixLinesPerInch;// Allow two lines for top continue message - if (myMsg.IndexOf(@"%d") > -1) - myMsg = myMsg.Replace(@"%d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim(" .".ToCharArray())); - MyPageHelper.TopMessage = new vlnText(cb, this, myMsg, myMsg, docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Top.Margin ?? 0, yTopMargin + 0.1F, docstyle.Continue.Top.Font);// MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font); - } - MyPageHelper.YMultiplier = 1; - break; - case 3: // Break on High Level Step (SevenLinesPerInch) - if (!firstHighLevelStep) - { - OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); - cb.PdfDocument.NewPage(); // HLS (7 lpi) breakif (MyItemInfo.IsSection) - DebugText.WriteLine("Paginate3"); - if (MyItemInfo.IsSection) - { - SectionInfo si = MyItemInfo as SectionInfo; - MyPageHelper.PageBookmarks.Add(MyItemInfo, ((si.DisplayNumber ?? "") == "" ? "" : si.DisplayNumber + " - ") + si.DisplayText, null); - } - if ((MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Style ?? 0 & E_DocStructStyle.UseSectionFoldout) != 0) - PromsPrinter.DoFoldoutPage(cb, "HLS (7 lpi) break", MyPageHelper.TextLayer, MyPageHelper); - } - if (MyItemInfo.MyParent != null && MyItemInfo.MyParent.IsStepSection && - MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles - && !MyItemInfo.MyDocStyle.CancelSectTitle - && !MyItemInfo.MyDocStyle.SpecialStepsFoldout) - yPageStart = yPageStart; // if printing the section title, we already have the y location - else - yPageStart = yTopMargin + YTopMost; - MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch; - DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); - break; - } - yPageStart = ChildrenAbove.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - yPageStart = ChildrenLeft.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - - // If this is a high level step, the format may have specified that the step should be printed with - // extra space between it and the previous step. The 16bit code uses the value of the extra space - // from the high level step format regardless of what type of high level step it is. Also, if there - // is caution or note above it, this space is not added: - yPageStart -= ((!MyItemInfo.IsHigh || ChildrenAbove == null) ? 0 : MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[2].StepLayoutData.STExtraSpace ?? 0); - yPageStart = ParagraphToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - yPageStart = ChildrenRight.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - yPageStart = ChildrenBelow.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - - if (MyItemInfo.IsHigh && MyItemInfo.NextItem == null) // last hls, add the 'end' message, if there is one - { - DocStyle docstyle = MyItemInfo.MyDocStyle; - string myMsg = (docstyle.End == null) ? null : docstyle.End.Message; - if (myMsg != null) - { - // If the flag is 0 or 1, just put the end message out right below this vlnParagraph: - float msg_yLocation = CalculateYLocation(yPageStart - YBottomMost, yTopMargin); - - // use the 'flag' to position the message. - if (docstyle.End.Flag > 2) // >2 position at an absolute location defined by docstyle.End.Flag. - { - msg_yLocation = yTopMargin - (float)(docstyle.End.Flag * SixLinesPerInch); - } - - if (myMsg.Contains("{Section Number}")) myMsg = myMsg.Replace("{Section Number}", MyItemInfo.ActiveSection.DisplayNumber); - - // center the message. - float wtpm = (float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin; - float centerpos = XOffsetBox + (float)docstyle.Layout.LeftMargin + (wtpm - (myMsg.Length * MyItemInfo.FormatStepData.Font.CharsToTwips)) / 2; - MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, centerpos, msg_yLocation, docstyle.End.Font); - } - } - if (yLocalypagestart != yPageStart) DebugText.WriteLine("ToPdf-yPagestartDiff:{0},{1},{2}", MyItemInfo.ItemID, yLocalypagestart, yPageStart); - return yPageStart; - } - private vlnParagraph TopMostChild - { - get - { - if (ChildrenAbove.Count>0) return ChildrenAbove[0].TopMostChild; - return this; - } - } - private bool EmptyTopMostPart - { - get - { - if (TopMostChild.PartsAbove.Count == 0) return false; - foreach (vlnPrintObject po in TopMostChild.PartsAbove) - { - vlnHeader hd = po as vlnHeader; - if (hd == null) return false; - if (hd.Text != "") return false; - } - return true; - } - } - private void OutputOtherPageSteps(PdfContentByte cb, float YTopMost, float yPageStart, float yTopMargin, float yBottomMargin) - { - // Find any items remaining in MyPageHelper.MyParagraphs that should be printed on this page. - vlnParagraphs process = new vlnParagraphs(null); - foreach (vlnParagraph vPara in MyPageHelper.MyParagraphs.Values) - { - //if (!vPara.Processed && ((vPara.YOffset + vPara.Height) < YTopMost)) - if (!vPara.Processed && ((vPara.YOffset) < YTopMost)) - process.Add(vPara); - } - foreach (vlnParagraph vPara in process) - { - vPara.ParagraphToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - } - } - private float _YVeryTop = -1; - public float YVeryTop - { - get - { - if (_YVeryTop == -1) - { - _YVeryTop = YTop; - _YVeryTop = VeryTop(PartsAbove,_YVeryTop); - _YVeryTop = VeryTop(PartsContainer,_YVeryTop); - } - return _YVeryTop; - } - } - - private float VeryTop(vlnPrintObjects parts, float yVeryTop) - { - if (parts != null) - foreach (vlnPrintObject part in parts) - if (part.YOffset < yVeryTop) - yVeryTop = part.YOffset; - return yVeryTop; - } - /// - /// This gets the height of the step with it's Caution's, Notes and potentially any First Substeps - /// - /// - private float GetFirstPieceSize() - { - vlnParagraph paraLast = GetFirstPieceLastPart(); - float retval = (paraLast.YBottom) - YTopMost; - //Console.WriteLine(MyItemInfo.DBSequence); - return retval; - } - public override float YBottom - { - get - { - float bottom = YOffset + Height; - if (PartsBelow != null) - { - foreach (vlnPrintObject part in PartsBelow) - { - float partBottom = part.YBottom; - bottom = Math.Max(partBottom, bottom); - } - } - return bottom; - } - } - public float YBottomText - { - get - { - return YOffset + Height; - } - } - private vlnParagraph GetFirstPieceLastPart() - { - vlnParagraph para = this; - if (!MyItemInfo.ActiveFormat.MyStepSectionLayoutData.PaginateOnFirstSubstep && ChildrenBelow != null && ChildrenBelow.Count > 0) - { - para = ChildrenBelow[0].GetFirstPieceLastPart(); - } - if (ChildrenRight != null && ChildrenRight.Count > 0) - { - foreach(vlnParagraph paraRight in ChildrenRight) - { - vlnParagraph paraRightLast = paraRight.GetFirstPieceLastPart(); - if (paraRightLast.YBottom > para.YBottom) - para = paraRightLast; - } - } - return para; - } - /// - /// Find items from previous page (yLocation less than yTop) and remove them from the list. - /// yTop is the new starting location on the next page for this step. - /// - /// - /// - private void RemoveProcessedParagraphs(StepLevelList myList, float yTop) - { - // the two CleanUpLists are used to remove items from - // the original list because list items cannot be removed in a - // 'foreach'. - List CleanupListStepLevel = new List(); - foreach(int stepLevel in myList.Keys) - { - List CleanupListYLocation = new List(); - SortedList AdjustYLocation = new SortedList(); - foreach (float yLocation in myList[stepLevel].Keys) - { - if (-yLocation <= yTop) - CleanupListYLocation.Add(yLocation); - else - AdjustYLocation.Add(-yLocation, yLocation); // order in ascending order - } - foreach (float yLocation in CleanupListYLocation) - myList[stepLevel].Remove(yLocation); - foreach (float yLocation in AdjustYLocation.Keys) - { - vlnParagraph para = myList[stepLevel][-yLocation]; - myList[stepLevel].Remove(-yLocation); - // shift yLocation by yTop to work with items whose locations - // are defined from the top of the new page rather than - // from the beginning of the step. - // Note that yLocation is negative to have items in descending - // order so that adding yTop decrements their values. - myList[stepLevel].Add(yTop-yLocation, para); - } - if (myList[stepLevel].Count == 0) - CleanupListStepLevel.Add(stepLevel); - } - foreach (int stepLevel in CleanupListStepLevel) - myList.Remove(stepLevel); - } - /// - /// Builds a list of paragraphs by StepLevel and yLocation in descending order. - /// - /// - /// - private void BuildLocationList(float yTopMost, ParagraphLocations myLocations) - { - foreach (vlnParagraph child in ChildrenAbove) - child.BuildLocationList(yTopMost, myLocations); - foreach (vlnParagraph child in ChildrenLeft) - child.BuildLocationList(yTopMost, myLocations); - - // Add a list entry consisting of StepLevel, yoffset from the beginning of this step, paragraph itself - myLocations.Add(this, yTopMost); - - foreach (vlnParagraph child in ChildrenRight) - child.BuildLocationList(yTopMost, myLocations); - foreach (vlnParagraph child in ChildrenBelow) - child.BuildLocationList(yTopMost, myLocations); - } - private int COL_WID_ADJ = 6; // adjusts for incorrect use of WidSTable when breaking a line (it breaks 6 chars too short) - public vlnParagraph(vlnParagraph parent, PdfContentByte cb, ItemInfo itemInfo, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo) - { - float savCheckListBottomMost = 0; - //int[] problemIDs = { 889 }; - //List lProblemIDs = new List(problemIDs); - //if (lProblemIDs.Contains(itemInfo.ItemID)) - // Console.WriteLine("Found Item {0}", itemInfo.ItemID);formatInfochecko - MyParent = parent; - // The following code determines the last paragraph for an RNO - // MyTopRNO finds the Top paragraph for an RNO - if (itemInfo.IsInRNO) - { - if (rnoLevel <= maxRNO && itemInfo.IsRNOPart) // Not top level RNO - MyTopRNO = this; - else - MyTopRNO = MyParent.MyTopRNO; - if(MyTopRNO != null) MyTopRNO.LastRNO = this; - } - MyContentByte = cb; - MyPageHelper.MyParagraphs.Add(itemInfo.ItemID, this); - MyItemInfo = itemInfo; - XOffset = xoff; - if (!MyItemInfo.IsStep && !MyItemInfo.IsStepSection) - { - IsWordDocPara = true; - // special case - this is a 'Word Doc' paragraph. The Processed flag is used to know - // that steps need put out on a page for the pagination logic, and since there are no steps - // we don't want to have to worry about putting this out for pagination logic. - Processed = true; - return; - } - // Set any position adjustment (defined in the format on a per type basis) - yoff += (MyItemInfo.FormatStepData == null) ? 0 : MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace ?? 0; - YTopMost = YOffset = yoff; - vlnTab mytab = null; - bool doSectTab = false; - // if this substep has a caution or note as its parent, then there may have been a special indent done on the - // substep... check the CautionOrNoteSubstepIndent value, this is the additional indent amount in number - // of characters. - if (itemInfo.MyParent.IsCaution || itemInfo.MyParent.IsNote) - XOffset += 72 * (itemInfo.FormatStepData.CautionOrNoteSubstepIndent == null ? 0 : (float)itemInfo.FormatStepData.CautionOrNoteSubstepIndent / (float)itemInfo.FormatStepData.Font.CPI); - - if (itemInfo.IsStep && itemInfo.MyHLS.FormatStepData.UseSmartTemplate && - itemInfo.FormatStepData.StepLayoutData.AlignWithParentTab - || (itemInfo.Steps != null && itemInfo.Steps.Count > 0 && itemInfo.Steps[0].FormatStepData.StepLayoutData.AlignWithParentTab)) - itemInfo.MyTab = null; - if (itemInfo.MyTab != null && itemInfo.MyTab.Text != null && itemInfo.MyTab.Text != "") - { - float localXOffset = XOffset; - bool doprint = true; - if (itemInfo.IsSection) - { - SectionConfig sch = MyItemInfo.MyConfig as SectionConfig; - if (!(MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles - && !MyItemInfo.MyDocStyle.CancelSectTitle - && !MyItemInfo.MyDocStyle.SpecialStepsFoldout) - && - ((sch != null && sch.Section_PrintHdr != "Y") || !MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections)) doprint = false; - } - if (doprint && itemInfo.IsSection && !itemInfo.MyDocStyle.CancelSectTitle && itemInfo.MyTab.Text.ToUpper() != "FOLDOUT") - { - doSectTab = true; - if (itemInfo.IsStepSection && formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Just == "PSLeft") - { - float offset = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - if (formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos != null) - { - // determine level of metasections. This level will be used to calculate the - // indent. DO I NEED THIS HERE???? - int level = 0; - ItemInfo iilvl = itemInfo; - while (!iilvl.IsProcedure) - { - level++; - iilvl = iilvl.MyParent; - } - level = level <= 2 ? 1 : level - 1; - if (level == 1) - offset += (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos; - else - offset += (level-1) * ((float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos-(float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos); - } - localXOffset = offset; - } - } - if (!itemInfo.IsSection || doSectTab) - { - mytab = new vlnTab(cb, this, itemInfo.MyTab.Text, itemInfo.MyTab.CleanText, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline); - PartsLeft.Add(mytab); - if (mytab.MyMacro != null) PartsLeft.Add(mytab.MyMacro); - } - } - AdjustWidth(itemInfo, maxRNO, formatInfo, mytab); - AdjustXOffsetForTab(itemInfo, maxRNO, formatInfo, mytab); - if (itemInfo.Cautions != null && !(itemInfo.IsCaution || itemInfo.IsNote)) - yoff = ChildrenAbove.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); - if (itemInfo.Notes != null && !(itemInfo.IsCaution || itemInfo.IsNote)) - yoff = ChildrenAbove.Add(cb, itemInfo.Notes, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); - YTop = yoff; - if (itemInfo.MyHeader != null && itemInfo.MyHeader.Text != null && !doSectTab) - yoff += SetHeader(this, cb, itemInfo, formatInfo); - YOffset = yoff; - if (mytab != null && mytab.SeparateBullet) - { - string identB = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.IdentB; - vlnText myBullet = new vlnText(cb, this, identB, identB, XOffset - 12, YOffset, MyItemInfo.FormatStepData.TabData.Bullet.Font); - myBullet.Rtf = myBullet.Rtf.Replace("\u25CF", @"\f1\u9679?\f0 "); - PartsLeft.Add(myBullet); - } - if (itemInfo.IsRNOPart) - { - // there may be other places that double space, but this supports it for RNOs (the DoubleRNOspace flag) - if (rnoLevel > maxRNO && itemInfo.FormatStepData.DoubleSpace) yoff = YOffset = yoff + SixLinesPerInch; - } - AddMacros(itemInfo, mytab); - if (mytab != null) - { - mytab.YOffset = yoff; - if (mytab.MyMacro != null) mytab.MyMacro.YOffset = yoff; - } - float yForCheckoff = yoff; //0; - default checkoff row is same as FIRST line of text - // if dropCheckoff is true, then the checkoff is place on the same of row as the LAST line of text - bool dropCheckoff = itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.DropCheckOff; - if (itemInfo.MyContent.MyGrid != null) - { - VlnFlexGrid myFlexGrid = new VlnFlexGrid(1,1); - myFlexGrid.LoadGrid(itemInfo); - MyGrid = new vlnTable(myFlexGrid, cb); - Height = MyGrid.Height; - Width = MyGrid.Width; - //yForCheckoff = yoff + Height - SixLinesPerInch; - if (dropCheckoff) - yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text - yoff += (Height + (2 * SixLinesPerInch)); - CalculateXOffset(itemInfo, maxRNO, formatInfo); - } - else if (itemInfo.IsFigure) // if a figure we've got to determine the size: - { - string erMsg = null; - if (itemInfo.MyContent.Text != null) - { - ProcedureInfo proc = itemInfo.MyProcedure; -// DocVersionInfo dvi = proc.ActiveParent as DocVersionInfo; - DocVersionInfo dvi = proc.MyDocVersion; - ROFstInfo rofst = dvi.DocVersionAssociations[0].MyROFst; - rofst.docVer = dvi; - ROFSTLookup lookup = rofst.ROFSTLookup; - string linkInfoText = itemInfo.MyContent.Text.Replace(@"\v ", ""); - if (linkInfoText.Contains("?")) - erMsg = "RO was not found during data migration."; - else - { - Match m = Regex.Match(linkInfoText, @"(.*)[#]Link:([A-Za-z]*):(.*)"); - string[] subs = m.Groups[3].Value.Split(" ".ToCharArray()); - string roid = subs[1]; - string val = lookup.GetRoValue(subs[1]); - if (val == null) val = lookup.GetRoValue(subs[1].Substring(0, 12)); - if (val != null) - { - string[] vals = val.Split("\n".ToCharArray()); - Width = Int32.Parse(vals[3], System.Globalization.NumberStyles.AllowHexSpecifier) * MyItemInfo.FormatStepData.Font.CharsToTwips; - int lines = Int32.Parse(vals[2], System.Globalization.NumberStyles.AllowHexSpecifier); - Height = lines * SixLinesPerInch; - //yForCheckoff = yoff + Height - SixLinesPerInch; - if (dropCheckoff) - yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text - yoff += (Height + (2 * SixLinesPerInch)); - - try - { - ROImageInfo roImage = ROImageInfo.GetByROFstID_FileName(rofst.ROFstID, vals[0]); - if (roImage != null) - ImageText = val; - else - erMsg = string.Format("Image {0} does not exist.", vals[0]); - } - - catch (Exception ex) - { - erMsg = string.Format("Image {0} does not exist, error = {1}.", vals[0], ex.Message); - } - } - } - if (erMsg != null) Rtf = GetRtf(erMsg, itemInfo.ActiveFormat.PlantFormat.FormatData.Font); - CalculateXOffset(itemInfo, maxRNO, formatInfo); - } - } - else - { - Rtf = GetRtf(itemInfo); - // Need the following with some modifications for WCNCKL format: - if (Rtf.Contains("{Backspace}")) - { - XOffset -= 22; - Width += 24; - Rtf = Rtf.Replace("{Backspace}", ""); - } - if (itemInfo.IsStep && itemInfo.MyHLS.FormatStepData.UseSmartTemplate) - { - if (itemInfo.FormatStepData.StepLayoutData.AlignWithParentTab - || (itemInfo.Steps != null && itemInfo.Steps.Count > 0 && itemInfo.Steps[0].FormatStepData.StepLayoutData.AlignWithParentTab)) - { - int stplevl = TheStepLevel(itemInfo); - if (stplevl >= 0 && MyItemInfo.MyHLS.FormatStepData.VertPos[stplevl] > 0) - XOffset = float.Parse(MyItemInfo.MyHLS.FormatStepData.VertPos.Split(",".ToCharArray())[stplevl]) + (float)itemInfo.MyDocStyle.Layout.LeftMargin; - } - } - if (itemInfo.IsTablePart) // Not for grid, this is for old-style tables. - { - Width = GetTableWidth(cb, IParagraph, MyItemInfo.MyDocStyle.Layout.PageWidth); - CalculateXOffset(itemInfo, maxRNO, formatInfo); - } - else - if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null) XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); - - bool printMetaHdr = false; - if (itemInfo.Steps != null && itemInfo.IsSection && itemInfo.Sections != null && itemInfo.Sections.Count > 0) - { - SectionConfig sc = itemInfo.MyConfig as SectionConfig; - if ((sc != null && sc.Section_PrintHdr == "Y") && itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections) printMetaHdr = true; - } - - // If WCN checklists, the substeps are printed in a row, need to keep track of the 'longest' in - // y direction (bottommost) across the row. - if (itemInfo.IsStep && itemInfo.MyHLS.FormatStepData.UseSmartTemplate && (TheStepLevel(itemInfo)>0)) - { - // do I need to get max of savCheckListBottomMost & (yoff+Height+SixLinesPerInch) - savCheckListBottomMost = yoff + Height + SixLinesPerInch; - } - // Get Y offset for regular steps, or if section title is output or if not within row (not last column of - // text) for wcn checklist, i.e. . - if ((!itemInfo.IsStepSection && !itemInfo.MyHLS.FormatStepData.UseSmartTemplate) - || printMetaHdr || - (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles - && !MyItemInfo.MyDocStyle.CancelSectTitle - && !MyItemInfo.MyDocStyle.SpecialStepsFoldout) - // In WCN Checklist: I don't have children or if I have children the first child doesn't alignwithparent. - || (!itemInfo.IsStepSection && itemInfo.MyHLS.FormatStepData.UseSmartTemplate - && ((itemInfo.Steps == null || itemInfo.Steps.Count == 0) - || !itemInfo.Steps[0].FormatStepData.StepLayoutData.AlignWithParentTab))) - { - yoff += Height; - yoff += AdjustForBlankLines(); - if (dropCheckoff) - yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text - } - } - CheckOff co = itemInfo.GetCheckOffStep(); - if (co != null) - { - //float xloc_co = (float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation + (float)itemInfo.MyDocStyle.Layout.LeftMargin; - float xloc_co = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation != null) - xloc_co += (float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation; - PartsRight.Add(new vlnMacro(xloc_co, yForCheckoff, co.Macro)); - } - float yOffRight = yoff; - float RnoOffset = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO); - if (rnoLevel < maxRNO && itemInfo.RNOs != null) yOffRight = ChildrenRight.Add(cb, itemInfo.RNOs, XOffset + RnoOffset, YTop, YTop, rnoLevel + 1, maxRNO, formatInfo); - // Need code to determine if the table will overlap the Right Column if it does then - // use YOffRight rather than yoff - if (itemInfo.Tables != null) - { - bool aerTableOrFigure = itemInfo.FormatStepData.Type.Contains("AER"); - if(!aerTableOrFigure && itemInfo.RNOLevel == 0) // Centered Table - yoff = ChildrenBelow.Add(cb, itemInfo.Tables, XOffset, yOffRight, yOffRight, rnoLevel, maxRNO, formatInfo); - else // AER or RNO Table - yoff = ChildrenBelow.Add(cb, itemInfo.Tables, XOffset, yoff, yOffRight, rnoLevel, maxRNO, formatInfo); - } - - // Look for the meta section case where the 'Editable' flag is set to 'N', which means that - // these steps should not be printed: - bool printsteps = true; - if (itemInfo.Steps != null && itemInfo.IsSection && itemInfo.Sections!=null && itemInfo.Sections.Count>0) - { - SectionConfig sc = itemInfo.MyConfig as SectionConfig; - if (sc != null && sc.SubSection_Edit != "Y") printsteps = false; - } - - if (itemInfo.Steps != null && printsteps) yoff = ChildrenBelow.Add(cb, itemInfo.Steps, XOffset, yoff, yOffRight, rnoLevel, maxRNO, formatInfo); - if (itemInfo.Sections != null) yoff = ChildrenBelow.Add(cb, itemInfo.Sections, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); - if (itemInfo.Procedures != null) yoff = ChildrenBelow.Add(cb, itemInfo.Procedures, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); - if (rnoLevel >= maxRNO && itemInfo.RNOs != null) yoff = ChildrenBelow.Add(cb, itemInfo.RNOs, XOffset, yoff, yoff, rnoLevel + 1, maxRNO, formatInfo); - yoff = Math.Max(yoff, yOffRight); - // TODO - use RNOSepAfterAER flag too: - string tmpRnoSepStr = formatInfo.MyStepSectionPrintData.RNOSepString; - if (rnoLevel < maxRNO && itemInfo.RNOs != null && tmpRnoSepStr != null) - { - vlnParagraph rno = ChildrenRight[0]; - vlnParagraph bottomChild = BottomChild; - float xsep = MyHighLevelParagraph.XOffset + RnoOffset; - vlnRNOSeparator myRnoSep = new vlnRNOSeparator(this, cb, tmpRnoSepStr, xsep, yoff, formatInfo, bottomChild==null?true:bottomChild.MyItemInfo.HasChangeBar); - // TODO: May need to handle more than one RNO column for RNO Separator - if (rno.LastRNO.MyItemInfo.HasChangeBar == false && bottomChild != null && bottomChild.MyItemInfo.HasChangeBar) - bottomChild.PartsBelow.Add(myRnoSep); - else - rno.LastRNO.PartsBelow.Add(myRnoSep); - yoff += myRnoSep.Height + SixLinesPerInch; - } - YBottomMost = yoff; - - // For WCN Checklist, the substeps are in rows of data. The YBottomMost is the bottom most for - // the row. - if (savCheckListBottomMost != 0 && savCheckListBottomMost>YBottomMost) YBottomMost = savCheckListBottomMost; - } - - private int TheStepLevel(ItemInfo itemInfo) - { - if (itemInfo.IsHigh) return -1; - int lev = 0; - ItemInfo ii = itemInfo; - while (!ii.MyParent.IsHigh) - { - lev++; - ii = ii.MyParent; - } - return lev; - } - - private string SectionHasCheckOffHeader(ItemInfo itemInfo, ref VE_Font font) - { - // If the passed in itemInfo is not a section, get it's parent section. This may be a subsection, so - // it will be found here, versus using 'MyActiveSection'. - while (!itemInfo.IsSection) - { - itemInfo = itemInfo.MyParent; - } - // See if this section has a checkoffheading index - this value, if set is stored in the config field. - // -1 flags no entries in the format's CheckOffHeaderList & 0 flags the first - // entry which is always '{NO HEADING}'. So only continue if it's greater than 0. - SectionInfo si = SectionInfo.Get(itemInfo.ItemID); // sometimes the itemInfo isn't a section info - int sindx = si.CheckOffHeadingIndex(); - - // If there is a checkoff header for this section, see if this section has subsections. - // If this has a header but no subsections, put out the header. - // Else if this section has a header AND subsections, don't put it out... - // the subsection's checkoff header will be processed (or lack there of). - bool doCheckoffHeader = sindx > 0 && (itemInfo.Sections == null || itemInfo.Sections.Count == 0); - - // if doing it, then grab the string from the format.... CHECK if this works for subsection, it is - // getting ActiveSection which may return the top section, not subsections. - if (doCheckoffHeader && itemInfo.SectionCheckOffHeader != "") - { - font = itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList[sindx].Font; - return itemInfo.SectionCheckOffHeader; - } - return null; - } - - private void DoCheckOffHeader(PdfContentByte cb, ItemInfo itemInfo, float yLocation, float yTopMargin, float yPageStart) - { - // CheckOffHeaders are handled in two different ways: - // 1) Where the pagelist item puts them - this is at the 'top' of the page, when the current section on the - // page has a checkoff header defined. Support for this is here AND in the VlnSvgPageHelper pagelist code. - // 2) If a continuous section, and it doesn't start at 'top' of the page, then the checkoff header is - // printed on the same line as the continuous section. Support for this is here, the check off header is added - // to the 'PartRight' off of the section's VlnParagraph. - - // First see if there is any checkoff data in the format file and that there - // is a pagelist item for the checkoff header. - if (itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList.Count <= 0) return; - if (MyPageHelper.PageListCheckOffHeader == null) return; - - VE_Font font = null; - ItemInfo mySectionInfo = itemInfo.MyActiveSection; - ItemInfo mySubSectionInfo = itemInfo; - - // If the passed in itemInfo is not a section, get it's parent section. This may be a subsection, so - // it will be found here, versus using 'MyActiveSection' which is the topmost section. The passed in - // item may be a regular step, i.e. if a page break had occurred. - if (!itemInfo.IsSection) - { - while (!mySubSectionInfo.IsSection) - { - mySubSectionInfo = mySubSectionInfo.MyParent; - } - } - else - mySubSectionInfo = (mySectionInfo.Sections == null)?null:mySectionInfo.Sections[0]; - - if (mySectionInfo == mySubSectionInfo) mySubSectionInfo = null; - - // The following duplicates the 16bit logic. The 16bit logic only put out a header if: - // there is no subsection and section has a header (from config); - // OR there is a subsection and the first subsection has a header. - // For locating the header in 16bit logic: - // If no subsections, output with section - // If subsections and continuous section, put out on same line as subsection. (done here) - // If subsections and starts at top of page, (on top of page, use pagelist code in VlnSvgPageHelper) - - // Get SectionInfos to access specific section config items... - SectionInfo si = SectionInfo.Get(mySectionInfo.ItemID); - int sindx = si.CheckOffHeadingIndex(); - SectionInfo subi = mySubSectionInfo == null ? null : SectionInfo.Get(mySubSectionInfo.ItemID); - int subindx = subi==null?-1:subi.CheckOffHeadingIndex(); - - // if there is no subsections & the main section doesn't use a header OR - // if there is a subsection, & it does not use a header... Return. - if ((subi==null&&sindx < 1) || (subi!=null&&subindx<1)) return; - - // figure out location now: - // if step, it uses pagelist logic to locate it (this is a page break condition). - // if continuous, put out with subsection if there is one, otherwise section. - // otherwise, use pagelist logic. - bool usePageListCOHdr = false; - - if (itemInfo.IsStep) - usePageListCOHdr = true; - else if (subi == null) //no subsection - { - if ((yPageStart - YOffset) == yTopMargin) usePageListCOHdr = true; - } - else - { - if (mySectionInfo == itemInfo && ((yPageStart - YOffset) == yTopMargin)) usePageListCOHdr = true; - if (!usePageListCOHdr && mySubSectionInfo != itemInfo) return; - } - - // grab the string from the format, depending on whether it should get it from the section or subsection. - string cohead = (mySubSectionInfo!=null)?mySubSectionInfo.SectionCheckOffHeader:mySectionInfo.SectionCheckOffHeader; - if (cohead == "" || cohead == null) return; - - // PageListCheckOffHeader is an svgtext - but really we only need the x/y location for this (pagelist support) - // The actual text is from the checkoff header selection in the section config. - if (cohead != MyPageHelper.PageListLastCheckOffHeader) - { - font = mySectionInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList[sindx].Font; - float chkOffY = CalculateYLocation(YTopMost, yTopMargin); - if (MyPageHelper.YMultiplier != 1) - { - chkOffY = -1 + yTopMargin - (yTopMargin - yLocation) * MyPageHelper.YMultiplier; - if (Rtf != null) - IParagraph.Leading = _SevenLinesPerInch; - } - if (!usePageListCOHdr) - { - vlnText myCOHead = new vlnText(cb, this, cohead, cohead, MyPageHelper.PageListCheckOffHeader.X.Value + (float)MyItemInfo.MyDocStyle.Layout.LeftMargin, chkOffY, font); - PartsRight.Add(myCOHead); - } - else - MyPageHelper.PageListTopCheckOffHeader = cohead; - MyPageHelper.PageListLastCheckOffHeader = cohead; - } - } - internal vlnParagraph BottomChild - { - get - { - float bottomChildYBottomText = YBottomText; - vlnParagraph bottomChild = this; - foreach (vlnParagraph child in ChildrenRight) - { - vlnParagraph grandChild = child.BottomChild; - if (grandChild != null && grandChild.YBottomText > bottomChildYBottomText) bottomChild = grandChild; - if (grandChild != null && grandChild.YBottomText == bottomChildYBottomText && grandChild.MyItemInfo.HasChangeBar) bottomChild = grandChild; - bottomChildYBottomText = bottomChild.YBottomText; - } - foreach (vlnParagraph child in ChildrenBelow) - { - vlnParagraph grandChild = child.BottomChild; - if (grandChild != null && grandChild.YBottomText > bottomChildYBottomText) bottomChild = grandChild; - if (grandChild != null && grandChild.YBottomText == bottomChildYBottomText && grandChild.MyItemInfo.HasChangeBar) bottomChild = grandChild; - bottomChildYBottomText = bottomChild.YBottomText; - } - return bottomChild; - } - } - private void CalculateXOffset(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo) - { - bool aerTableOrFigure = itemInfo.FormatStepData.Type.Contains("AER"); - vlnParagraph hls1 = MyParent; - while (hls1.MyParent != null && !hls1.MyItemInfo.IsHigh) hls1 = hls1.MyParent; - float colR = float.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[itemInfo.ColumnMode]); - float xLowerLimit = hls1.XOffset; - float xUpperLimit = hls1.XOffset + hls1.Width + colR * itemInfo.ColumnMode; - float TableCenterPos = float.Parse(formatInfo.MyStepSectionLayoutData.TableCenterPos.Split(",".ToCharArray())[itemInfo.ColumnMode]); - if (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel) - { - float pageWidth = ((float)itemInfo.MyActiveSection.MyDocStyle.Layout.PageWidth); //* (float)MyItemInfo.FormatStepData.Font.CPI / 12; - float leftMargin = ((float)itemInfo.MyActiveSection.MyDocStyle.Layout.LeftMargin); //* (float)MyItemInfo.FormatStepData.Font.CPI / 12; - XOffset = leftMargin + (pageWidth - leftMargin - Width) / 2; - } - else - { - // Determine center of hls - XOffset = hls1.XOffset + hls1.Width / 2; - // Determine left edge of the table by subtracting 1/2 of its width. - XOffset -= Width / 2; - if (aerTableOrFigure || itemInfo.RNOLevel != 0) // AER or RNO - XOffset = MyParent.XOffset + MyParent.Width / 2 - Width / 2; - else if (TableCenterPos != 0) - XOffset = TableCenterPos; - else // Centered Table or Figure - { - // Add in 1/2 of the width of all RNO columns - XOffset += (colR * itemInfo.ColumnMode) / 2; - if (!aerTableOrFigure) - { - // 05/14/12 - 16bit code adjusts the center depending upon the CPI of the table font. - // Start with XOffset of table, then calculate the XOffset adjusted for the table font, - // based on the default CPI of 12. Adjust the XOffset by the difference of these - // two numbers. - XOffset -= (XOffset - (XOffset * (float)MyItemInfo.FormatStepData.Font.CPI / 12)); - } - XOffset -= 12; // This makes the 16bit & 32bit align very closely. - } - // 05/14/12 - The PosAdjust is a format flag from 16bit. For WCN2, it appears that this amount equals - // the amount of difference from a 10 CPI to a 12 CPI font. See comment above. - if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null) - XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); - } - - - // if the XOffset < High Level Step Text's XOffset, then align with the High Level Step Text - if (XOffset < xLowerLimit && Width < (xUpperLimit - xLowerLimit)) - XOffset = xLowerLimit; - - // if the right margin exceeds the right edge of the rightmost RNO, then adjust right edge to match. - if (XOffset + Width > xUpperLimit) - XOffset = xUpperLimit - Width; - - // because of the above, if it pushes beyond the left margin, use the left margin. - if (XOffset < (float)itemInfo.MyDocStyle.Layout.LeftMargin) - XOffset = XOffsetBox = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - } - private float AdjustForBlankLines() - { - if (MyItemInfo.MyDocStyle.SpecialStepsFoldout) return 0; - int everyNLines = MyItemInfo.FormatStepData == null ? 1 : MyItemInfo.FormatStepData.StepLayoutData.EveryNLines ?? 1; - if (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.NextItem == null) return SixLinesPerInch; - return 0; - } - private void AddMacros(ItemInfo itemInfo, vlnTab mytab) - { - float y = YOffset; - float x = mytab == null ? XOffset : mytab.XOffset + mytab.TabOffset; - List myMacros = itemInfo.MyMacros; - if (myMacros != null) - { - foreach (Macro myMacro in myMacros) - { - PartsLeft.Add(new vlnMacro(x, y, myMacro.MacroDef)); - } - } - } - // HLP Change bar flags in format file: - // Locations: With Text, Outside Box, AER on Left RNO on Right, To The Left of Text - // Text: Date & Change ID, Revision Number, Change ID, None, Custom (use input data) - // Flag AERChgBarMsgRNOChgBarNoMsg and AERMsgRNONoMsg are NOT Used in 16-bit. - private string cbMess = null; - private vlnChangeBar DoChangeBar(PdfContentByte cb, ItemInfo itemInfo, VlnSvgPageHelper myPageHelper, float xoff, float yoff, int maxRNO, FormatInfo formatInfo) //, vlnChangeBar myCB) - { - // find column for the change bar based on format flags - this is code from 16-bit - // if AbsoluteFixedChangeColumn - // if FixedAERChangeColumn - // if col>ColsS+ColR+COL_WID+ADJ - // FixedChangeColumn - // else - // AERLeftChangeBarLocation() - // else - // FixedChangeColumn - // else - // ChangeBarLocation() - ChangeBarData cbd = formatInfo.PlantFormat.FormatData.ProcData.ChangeBarData; - float cols = formatInfo.MyStepSectionLayoutData.ColS ?? 0; - float colr = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO); -// FixedChangeColumn + - Column location for change bars - // 0 - Separate AER and RNO change bars to the right of the text - // -10 to -1 - Change bars on left (specify # of columns from the text) - // <-10 - AER change bars on the left and RNO change bars on the right. -// FixedAERChangeColumn overrides the -5 default setting in chgbar.c, value is converted to a negative by the code - - float col = (cbd.AbsoluteFixedChangeColumn) ? - ((cbd.FixedAERChangeColumn ?? 0) > 0) ? - (xoff > (cols + colr + COL_WID_ADJ)) ? - cbd.FixedChangeColumn ?? 0 : AERLeftChangeBarLocation(formatInfo) : - cbd.FixedChangeColumn ?? 0 : ChangeBarLocation(xoff, this, formatInfo, maxRNO); - - if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.ChgID) - cbMess = itemInfo.MyContent.UserID; - else if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.DateChgID) - { - string fmtDate = itemInfo.MyContent.DTS.ToShortDateString(); - if (fmtDate.Length != 10) // need to add zeros - { - if (fmtDate.IndexOf("/") == 1) - fmtDate = "0" + fmtDate; - if (fmtDate.IndexOf("/", 3) == 1) - fmtDate = fmtDate.Substring(0, 3) + "0" + fmtDate.Substring(3, fmtDate.Length - 3); - } - cbMess = itemInfo.MyContent.UserID + @"\n" + fmtDate; - } - else if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.RevNum) - cbMess = myPageHelper.Rev; - else if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.UserDef) - cbMess = myPageHelper.ChangeBarDefinition.MyChangeBarMessage; - - int msgAlign = Element.ALIGN_LEFT; - if (myPageHelper.ChangeBarDefinition.MyChangeBarLoc == PrintChangeBarLoc.LeftOfText || - (myPageHelper.ChangeBarDefinition.MyChangeBarLoc == PrintChangeBarLoc.AERleftRNOright && - !itemInfo.IsInRNO)) msgAlign = Element.ALIGN_RIGHT; - return new vlnChangeBar(cb, this, (float)itemInfo.MyDocStyle.Layout.LeftMargin + (col * itemInfo.FormatStepData.Font.CharsToTwips), yoff, msgAlign); - } - - private int ChangeBarLocation(float c, vlnParagraph paragraph, FormatInfo formatInfo, int maxRNO) - { - int fixedChgCol = formatInfo.PlantFormat.FormatData.ProcData.ChangeBarData.FixedChangeColumn ?? 0; - float cols = formatInfo.MyStepSectionLayoutData.ColS ?? 0; - int colr = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO); - float tmpc = c; - if (MyItemInfo.IsCaution || MyItemInfo.IsNote) - { - // Temporary fix for change bars on Notes and Cautions where the FixedChgCol < -10 - tmpc = (float)formatInfo.MyStepSectionLayoutData.ColT + (float)formatInfo.MyStepSectionLayoutData.WidT; // end position of Caution / Note - int typ = (int)(MyItemInfo.MyContent.Type % 10000); - int? bxIndx = formatInfo.PlantFormat.FormatData.StepDataList[typ].StepLayoutData.STBoxindex; - if (bxIndx != null) - { - Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - if (bx != null) - tmpc = (float)bx.Start + (float)bx.End; // end position of a boxed Caution / Note - } - } - // if this is a caution or note, put the change bar to the right of the text: - //if ((paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote) && fixedChgCol < -10) return -fixedChgCol; - if ((fixedChgCol == 0))// && paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote) - //if ((fixedChgCol==0) || paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote) - { - float rightEdge = (paragraph.XOffset + paragraph.Width + 5); - rightEdge-=(float)paragraph.MyItemInfo.MyDocStyle.Layout.LeftMargin; - rightEdge = rightEdge/paragraph.MyItemInfo.FormatStepData.Font.CharsToTwips; - return (int)rightEdge; - } - if (fixedChgCol < -10 || fixedChgCol >= 0) - return ((fixedChgCol > 0) ? fixedChgCol : - (fixedChgCol == 0) ? (int)c + 1 : - (tmpc > (cols + colr + COL_WID_ADJ)) ? -fixedChgCol : - //(c > (cols + colr + COL_WID_ADJ) || (MyItemInfo.IsCaution || MyItemInfo.IsNote)) ? -fixedChgCol : - AERLeftChangeBarLocation(formatInfo)); - else - return (int)(fixedChgCol + (((c < cols + Width + colr) || TableTest() - || MyItemInfo.IsCaution || MyItemInfo.IsNote) ? 0 : cols + colr)); // || (GetColumnMode() == 0)) ? 0 : cols + colr)); - /* Change bars to left of text -- ColS+WidS+ColR is the end of RNO col*/ - } - /* - ** Centered tables whose width exceeds the end of the RNO column should - ** still have their change bars printed on the left. This procedure checks - ** to make sure the step is a table and that it is not an RNO. - */ - private bool TableTest() - { - return false; - //return ((s->Type == TABLE || s->Type == BORDERLESSTABLE) && - //!(strchr((char *)&s->dbseq[2],RNO_MARKER))); - } - private float GetBottomYoff(float bottomY) - { - foreach (vlnParagraph child in ChildrenBelow) - { - if (child.YOffset > bottomY) bottomY = child.YOffset; - bottomY = child.GetBottomYoff(bottomY); - } - return bottomY; - } - private int AERLeftChangeBarLocation(FormatInfo formatInfo) - { - // use -5 default unless it is format specified - int fixedAERChgCol = formatInfo.PlantFormat.FormatData.ProcData.ChangeBarData.FixedAERChangeColumn ?? 0; - return (fixedAERChgCol != 0) ? - (fixedAERChgCol > 100) ? - (fixedAERChgCol % 100) : -fixedAERChgCol : -5; - } - private StringBuilder _RtfSB = null; - - // return rtf and use for tab and other text - public string GetRtf(ItemInfo itemInfo) - { - _RtfSB = new StringBuilder(); - DisplayText vlntxt = new DisplayText(itemInfo, E_EditPrintMode.Print, E_ViewMode.View, true, E_FieldToEdit.StepText, false); - System.Drawing.Font myFont = vlntxt.TextFont.WindowsFont; - if (!itemInfo.IsTable && StepRTB.MyFontFamily != null) - myFont = new System.Drawing.Font(StepRTB.MyFontFamily, myFont.Size, myFont.Style); - if (itemInfo.IsHigh && itemInfo.MyDocStyle.UndSpecialStepsFoldout) myFont = new System.Drawing.Font(myFont.FontFamily, myFont.Size, myFont.Style | FontStyle.Underline); - _RtfSB.Append(AddFontTable(myFont)); - _RtfSB.Append(vlntxt.StartText); - _RtfSB.Append("}"); - return _RtfSB.ToString(); - } - private float _XOffsetBox = 0; - public float XOffsetBox - { - get { return _XOffsetBox; } - set { _XOffsetBox = value; } - } - private float SetHeader(vlnParagraph para, PdfContentByte cb, ItemInfo itemInfo, FormatInfo formatInfo) - { - float xoff = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - // The '6' below is really converting from characters to Twips. But instead of considering the CPI, 16bit assumed - // it was 12 to center the header. That's where the 6 comes from. - float hdrWidth = (itemInfo.MyHeader.CleanText == null) ? 0 : itemInfo.MyHeader.CleanText.Length * 6; - int typ = ((int)itemInfo.MyContent.Type) % 10000; - int? bxIndx = formatInfo.PlantFormat.FormatData.StepDataList[typ].StepLayoutData.STBoxindex; - - if (itemInfo.MyHeader.Justify == System.Drawing.ContentAlignment.MiddleCenter) - { - if (bxIndx != null) - { - Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - if (bx.TabPos > 0) - xoff += (float)bx.TabPos; // xoff starts as left margin - else - xoff += (float)((bx.TxtStart + XOffsetBox + (bx.TxtWidth / 2)) - (hdrWidth / 2)); // xoff starts as left margin - } - else if (formatInfo.MyStepSectionLayoutData.Separator.Location > 0) - xoff = XOffset + AdjustToCharPosition((float)((para.Width - hdrWidth) / formatInfo.MyStepSectionLayoutData.Separator.Location), itemInfo.MyHeader.MyFont.CPI); - else - xoff = XOffset + (para.Width / 2) + (hdrWidth / 2); // XOffset has left margin included - } - else - xoff = XOffset; // XOffset has left margin included - vlnHeader myHeader = new vlnHeader(this, cb, itemInfo.MyHeader.Text, itemInfo.MyHeader.CleanText.TrimStart(" ".ToCharArray()), xoff, YOffset, itemInfo.MyHeader.MyFont); - PartsAbove.Add(myHeader); - return myHeader.Height + (!MyItemInfo.MyDocStyle.SpecialStepsFoldout ? SixLinesPerInch : 0); - } - private float AdjustToCharPosition(float position, float? CPI) - { - int iPosition = (int)position; - int charsToTwips = (int)(72 / (CPI ?? 12)); - iPosition = (iPosition / charsToTwips) * charsToTwips; - position = (position / 7.2F) * 7.2F; - return (float)iPosition; - } - private bool _SectionPageBreak = false; - public bool SectionPageBreak - { - get { return _SectionPageBreak; } - set { _SectionPageBreak = value; } - } - private bool _Processed = false; - public bool Processed - { - get { return _Processed; } - set { _Processed = value; } - } - private vlnParagraph _LastRNO; - public vlnParagraph LastRNO - { - get { return _LastRNO; } - set { _LastRNO = value; } - } - private vlnParagraph _MyTopRNO; - public vlnParagraph MyTopRNO - { - get { return _MyTopRNO; } - set { _MyTopRNO = value; } - } - private static string _Prefix = ""; - public static string Prefix - { - get { return vlnParagraph._Prefix; } - set { vlnParagraph._Prefix = value; } - } - protected float _YBottomMost; // Bottom of the paragraph including the children - public float YBottomMost - { - get { return _YBottomMost; } - set { _YBottomMost = value; } - } - protected float _YTopMost; // Top of the paragraph including the children - public float YTopMost - { - get { return _YTopMost; } - set { _YTopMost = value; } - } - protected float _YTop; // Top of the paragraph including parts - public float YTop - { - get { return _YTop; } - set - { - vlnParagraph vp = this as vlnParagraph; - _YTop = value; - - } - } - public float YSize // How big this paragraph is with all of its children - { - get { return _YBottomMost - _YTopMost; } - } - private ItemInfo _MyItemInfo; - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - set { _MyItemInfo = value; } - } - private vlnParagraph _MyHighLevelParagraph; - - public vlnParagraph MyHighLevelParagraph - { - get - { - if (_MyHighLevelParagraph == null) - { - _MyHighLevelParagraph = GetHighLevelParagraph(); - } - return _MyHighLevelParagraph; - } - } - private vlnParagraph GetHighLevelParagraph() - { - if (MyItemInfo.IsHigh) return this; - return MyParent.GetHighLevelParagraph(); - } - // Tab, Separator, ChangeBar, Box, Circle, Checkoff - private vlnPrintObjects _PartsAbove; - public vlnPrintObjects PartsAbove - { - get - { - if (_PartsAbove == null) _PartsAbove = new vlnPrintObjects(); - return _PartsAbove; - } - } - private vlnPrintObjects _PartsBelow; - public vlnPrintObjects PartsBelow - { - get - { - if (_PartsBelow == null) _PartsBelow = new vlnPrintObjects(); - return _PartsBelow; - } - } - private vlnPrintObjects _PartsRight; - public vlnPrintObjects PartsRight - { - get - { - if (_PartsRight == null) _PartsRight = new vlnPrintObjects(); - return _PartsRight; - } - } - private vlnPrintObjects _PartsLeft; - public vlnPrintObjects PartsLeft - { - get - { - if (_PartsLeft == null) _PartsLeft = new vlnPrintObjects(); - return _PartsLeft; - } - } - private vlnPrintObjects _PartsContainer; - public vlnPrintObjects PartsContainer - { - get - { - if (_PartsContainer == null) _PartsContainer = new vlnPrintObjects(); - return _PartsContainer; - } - } - private vlnParagraphs _ChildrenAbove; - public vlnParagraphs ChildrenAbove - { - get - { - if (_ChildrenAbove == null) _ChildrenAbove = new vlnParagraphs(this); - return _ChildrenAbove; - } - } - private vlnParagraphs _ChildrenBelow; - public vlnParagraphs ChildrenBelow - { - get - { - if (_ChildrenBelow == null) _ChildrenBelow = new vlnParagraphs(this); - return _ChildrenBelow; - } - } - private vlnParagraphs _ChildrenRight; - public vlnParagraphs ChildrenRight - { - get - { - if (_ChildrenRight == null) _ChildrenRight = new vlnParagraphs(this); - return _ChildrenRight; - } - } - private vlnParagraphs _ChildrenLeft; - public vlnParagraphs ChildrenLeft - { - get - { - if (_ChildrenLeft == null) _ChildrenLeft = new vlnParagraphs(this); - return _ChildrenLeft; - } - } - public void AdjustXOffsetForTab(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo, vlnTab myTab) - { - float tabWidth = (myTab == null) ? 0 : myTab.Width; - if (itemInfo.IsStepSection) - { - if (formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Just == "PSLeft") - { - int level = 0; - ItemInfo iilvl = itemInfo; - while (!iilvl.IsProcedure) - { - level++; - iilvl = iilvl.MyParent; - } - level = level <= 2 ? 1 : level - 1; - if (level==1) - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (level * (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos); - else - XOffset = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[level].ColSByLevel; - } - return; - } - int typ = ((int)itemInfo.MyContent.Type) % 10000; - int? bxIndx = formatInfo.PlantFormat.FormatData.StepDataList[typ].StepLayoutData.STBoxindex; - float? colOvrd = formatInfo.PlantFormat.FormatData.StepDataList[typ].ColOverride; - if (bxIndx != null) - { - Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - if (bx == null) - { - if ((colOvrd??0)!=0) - { - // 16-bit code subtracted the left margin - //xoff = ((float)colOvrd - (float)itemInfo.MyDocStyle.Layout.LeftMargin) - XOffset; - //XOffset += xoff; - //if (myTab != null) myTab.XOffset += xoff; - //xoff = MyParent.XOffset - myTab.XOffset; - //XOffset += xoff; - float tabOffset = (myTab == null?0: myTab.XOffset) - XOffset; - - XOffset = (float)colOvrd; - if (myTab != null) myTab.XOffset = XOffset + tabOffset; - return; - } - else - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + tabWidth + XOffsetBox; - } - else - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)bx.TxtStart + tabWidth + XOffsetBox; - if (myTab != null) myTab.XOffset = XOffset - tabWidth; - } - else if (itemInfo.IsHigh) - { - float x = 0; - float xoff = 0; - if ((colOvrd??0)!=0) - x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)colOvrd; - else - x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS; - - xoff = x - XOffset; - // ColSByLevel will specify the column in which the High Level Step starts with - // respect to the overall level calculation based on sections & meta-sections. - // Only a few of the single column formats use this: WCN1, CAL1, RGEBCK - if (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel - && !(itemInfo.MyDocStyle.SpecialStepsFoldout && itemInfo.MyDocStyle.UseColSByLevel)) - { - int indxLevel = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel(); - float colsbylevel = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel; - float seclvlindent = colsbylevel - (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS; - x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS + seclvlindent; - xoff = x - XOffset; - if (myTab != null) myTab.XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + colsbylevel; - LeftJustifyList jstlst = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.LeftJustifyList; - if (jstlst.Count > 0) - { - float leftJustifyTabSize = jstlst[indxLevel % jstlst.Count].Size ?? 0; - XOffset = myTab.XOffset + leftJustifyTabSize; - } - else - XOffset = myTab.XOffset + (myTab.Text.Length * (float)itemInfo.FormatStepData.Font.CPI) - colsbylevel; - } - else - { - XOffset += xoff; - if (myTab != null) - { - myTab.XOffset += xoff; - if (myTab.MyMacro != null) myTab.MyMacro.XOffset += xoff; - } - } - } - else if (itemInfo.IsRNOPart && !((ItemInfo)itemInfo.ActiveParent).IsHigh) - { - // don't adjust for rno - } - else if (MyParent != null) - { - if (myTab != null && itemInfo.IsSequential && formatInfo.PlantFormat.FormatData.SectData.UseMetaSections && formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.LeftJustifyList.Count > 0) - { - int indxLevels = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel(); // kbr -1; - LeftJustifyList jstlst = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.LeftJustifyList; - float tableftadj = 0; - foreach (LeftJustify lj in jstlst) - { - if (lj.Index == indxLevels) - { - tableftadj = lj.Size ?? 0; - break; - } - } - // the order of this is important. First adjust the tab's xoffset for the width of - // the tab. The offset of text needs to be adjusted by the 'leftjustify' format variable - // if it existed for this level. - myTab.XOffset += tabWidth; - if (tableftadj != 0 && myTab.Width0) - widOvrd = xwid; - else - widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride; - if ((widOvrd??0) != 0) - { - Width = (float)widOvrd; - // if there's a box, we may need to do an adjustment on the width, if the tab data was changed - // so don't return. - if (bxIndx == null) return; - } - float tabWidth = (myTab == null) ? 0 : myTab.Width; - if (bxIndx != null) - { - Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - if (bx == null) - { - // NOT SURE IF WE NEED TO TEST FOR THE NULLBOX FORMAT FLAG, MAYBE "bx == null" IS THE SAME THING - //if (formatInfo.MyStepSectionLayoutData.NullBox) - Width = (float)formatInfo.MyStepSectionLayoutData.WidT - tabWidth; - } - else - Width = _WidthAdjustBox + (float)bx.TxtWidth - tabWidth; // add 1 to get it to wrap like 16Bit - } - else if (itemInfo.IsHigh) - { - float CheckOffAdj = 0; - if (itemInfo.MyDocStyle.UseCheckOffs) - { - if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffAdjustment != null) - CheckOffAdj = -(float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffAdjustment; - if (!HasCheckOffHeading(itemInfo, formatInfo) && CheckOffAdj < 0) - CheckOffAdj += (float)(9 * 7.2); // 9 is the size of the SIGNOFF adjustment - } - float adjwidth = CheckOffAdj; - SectData sd = formatInfo.PlantFormat.FormatData.SectData; - if (sd.UseMetaSections) - { - if (sd.StepSectionData.StepSectionLayoutData.TieTabToLevel) - { - if (itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles - && !itemInfo.MyDocStyle.CancelSectTitle - && !(itemInfo.MyDocStyle.SpecialStepsFoldout && itemInfo.MyDocStyle.UseColSByLevel)) - { - int indxLevel = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel(); - adjwidth += formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].WidSAdjByLevel ?? 0; ; - float colsbylevel = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel; - float seclvlindent = colsbylevel - (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS; - adjwidth -= seclvlindent; - adjwidth -= AdjustForSectionLevelTab(); - } - } - else - { - if (formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count > 0) - adjwidth += (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[itemInfo.PrintLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel; - } - } - - Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); - Width += _WidthAdjust; - Width += adjwidth; - } - else if (itemInfo.IsCaution || itemInfo.IsNote) - { - float mycolT = (float)formatInfo.MyStepSectionLayoutData.ColT; - Width = (float)formatInfo.MyStepSectionLayoutData.WidT - 6 - mycolT; - XOffset += mycolT; // adjust caution/note text position - if (PartsLeft != null)// adjust tab position - foreach(vlnPrintObject vpo in PartsLeft) - vpo.XOffset += mycolT; - } - else if (itemInfo.IsSection) - { - Width = _WidthAdjust + ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); - } - else if (MyParent == null) - { - // 72 points / inch - 7 inches (about width of page) - Width = 72 * 7; - } - else if (itemInfo.IsRNOPart && !((ItemInfo)itemInfo.ActiveParent).IsHigh) - { - Width = MyParent.Width; - } - else if (itemInfo.IsTablePart) - { - Width = 72 * 7; // TODO: Need to determine the Width of the Table based upon the contents - } - else if (itemInfo.MyParent.IsCaution || itemInfo.MyParent.IsNote) - { - Width = MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign); - Width -= 72 * (itemInfo.FormatStepData.CautionOrNoteSubstepIndent == null ? 0 : (float)itemInfo.FormatStepData.CautionOrNoteSubstepIndent / (float)itemInfo.FormatStepData.Font.CPI); - } - else - { - float adjwidth = 0; - Width = adjwidth + MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign); - } - } - private float GetWidthFromTemplate(ItemInfo itemInfo, FormatInfo formatInfo) - { - float rtnwid = 0; - int tpIndx = GetSmartTemplateIndex(itemInfo, itemInfo.MyContent.Type, formatInfo); - if (tpIndx != -1) - { - int ncol = formatInfo.PlantFormat.FormatData.Templates[tpIndx].width; - // now convert to the units for this format. The template width data is in number of columns. - rtnwid = ncol * itemInfo.FormatStepData.Font.CharsToTwips; - } - return rtnwid; - } - private int GetSmartTemplateIndex(ItemInfo itemInfo, int? type, FormatInfo formatInfo) - { - int indx = 0; - // find the starting template in the list for the high level step type: - int highType = (int)itemInfo.MyHLS.MyContent.Type-20001; - while (indx < formatInfo.PlantFormat.FormatData.Templates.Count) - { - // level of 0 starts a new group. - if (formatInfo.PlantFormat.FormatData.Templates[indx].level == 0) - { - indx++; - // now see if we're on the high level step type, if so, look under this one - // for the step type that we're on. If found return the index of it. - if (formatInfo.PlantFormat.FormatData.Templates[indx].type == highType) - { - indx++; - while (indx < formatInfo.PlantFormat.FormatData.Templates.Count && formatInfo.PlantFormat.FormatData.Templates[indx].level != 0) - { - if (formatInfo.PlantFormat.FormatData.Templates[indx].type == type - 20001) - return indx; - indx++; - } - } - } - else - indx++; - } - return -1; // didn't find this step type in the template width override list. - } - - private float AdjustForSectionLevelTab() - { - string sectTab = MyItemInfo.ActiveSection.MyTab.CleanText.TrimEnd(); - if (sectTab.EndsWith(".0")) return 0; - string myTab = MyItemInfo.MyTab.CleanText; - // -1 below code, +1 for '.' and -2 for standard wid of tab - // standard wid of this tab is 2 (ex: '1.') - // so adjust width if longer than normal - return (float)(sectTab.Length - 1) * 72/(float)MyItemInfo.FormatStepData.Font.CPI; - } - private bool HasCheckOffHeading(ItemInfo itemInfo, FormatInfo formatInfo) - { - if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList.Count != 0) - { - // does this section have a check off heading? - SectionConfig sc = itemInfo.MyActiveSection.MyConfig as SectionConfig; - if (sc != null && sc.Section_CheckoffHeaderSelection > 0) return true; - } - return false; - } - private bool UseCheckOffsDocStyle(int oldToNew, FormatInfo formatInfo) - { - int bit, retval=0; - int mask=1; - - for(bit=0; bit < 32; bit++){ - if ((oldToNew & mask) != 0 && ((int)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.UseCheckOffsIn & mask) !=0) retval = 1; - mask <<= 1; - } - return retval > 0; - } - } - - /// - /// First order by stepLevel, then within a stepLevel, order by descending yLocation on page. - /// Want to find maximum y value that fits on page, i.e. put the most on page that can - /// fit which is defined by the largest yLocation - /// - public class StepLevelList : SortedDictionary> - { - public StepLevelList() : base() - { - } - public void Add(int stepLevel, float yLocation, vlnParagraph para) - { - if (stepLevel == 0) return; - if (!this.ContainsKey(stepLevel)) - this.Add(stepLevel, new SortedDictionary()); - // using a negative for yLocation so that its in descending order: - if (!this[stepLevel].ContainsKey(-yLocation)) - this[stepLevel].Add(-yLocation, para); - } - } - public class ParagraphLocations : List - { - public ParagraphLocations() - : base() - { - } - public void Add(vlnParagraph myParagraph, float yTopMost) - { - ParagraphLocation foundOverlap = FindOverlap(myParagraph); - if (foundOverlap == null) - { - this.Add(new ParagraphLocation(yTopMost,myParagraph)); - return; - } - ParagraphLocation doubleOverlap = FindOverlap(foundOverlap); - while (doubleOverlap != null) - { - doubleOverlap.Merge(foundOverlap); - this.Remove(foundOverlap); - foundOverlap = doubleOverlap; - doubleOverlap = FindOverlap(foundOverlap); - } - } - - private ParagraphLocation FindOverlap(vlnParagraph myParagraph) - { - foreach (ParagraphLocation paraLoc in this) - if (paraLoc.Overlap(myParagraph)) - return paraLoc; - return null; - } - private ParagraphLocation FindOverlap(ParagraphLocation myParaLoc) - { - foreach (ParagraphLocation paraLoc in this) - if (paraLoc != myParaLoc && paraLoc.Overlap(myParaLoc)) - return paraLoc; - return null; - } - internal StepLevelList BuildStepLevelList() - { - StepLevelList myList = new StepLevelList(); - foreach (ParagraphLocation paraLoc in this) - myList.Add(paraLoc.StepLevel, paraLoc.YTop, paraLoc.MyParagraph); - return myList; - } - } - public class ParagraphLocation - { - private float _YTop; - public float YTop - { - get { return _YTop; } - set { _YTop = value; } - } - private float _YBottom; - public float YBottom - { - get { return _YBottom; } - set { _YBottom = value; } - } - private int _StepLevel; - public int StepLevel - { - get { return _StepLevel; } - set { _StepLevel = value; } - } - private vlnParagraph _MyParagraph; - public vlnParagraph MyParagraph - { - get { return _MyParagraph; } - set { _MyParagraph = value; } - } - public ParagraphLocation(float yTopMost,vlnParagraph myParagraph) - { - MyParagraph =myParagraph; - YTop = myParagraph.YVeryTop - yTopMost; - YBottom = myParagraph.YBottom - yTopMost; - StepLevel = myParagraph.MyItemInfo.StepLevel; - } - public bool Overlap(vlnParagraph otherParagraph) - { - if (Between(otherParagraph.YTop, YTop, YBottom)) return true; - if (Between(otherParagraph.YBottom, YTop, YBottom)) return true; - if(Between(YTop,otherParagraph.YVeryTop,otherParagraph.YBottom)) return true; - if(Between(YBottom,otherParagraph.YVeryTop,otherParagraph.YBottom)) return true; - return false; - } - public static bool Between(float x, float lower, float higher) - { return x >= lower && x <= higher; } - public bool Overlap(ParagraphLocation otherParagraphLocation) - { - if (Between(otherParagraphLocation.YTop, YTop, YBottom)) return true; // The top is within the other - if (Between(otherParagraphLocation.YBottom, YTop, YBottom)) return true; // The bottom is within the other - if(Between(YTop,otherParagraphLocation.YTop,otherParagraphLocation.YBottom)) return true; // the other top is within this one - if(Between(YBottom,otherParagraphLocation.YTop,otherParagraphLocation.YBottom)) return true;// I believe this is unnecessary - return false; - } - public void Merge(vlnParagraph otherParagraph) - { - if (StepLevel < otherParagraph.MyItemInfo.StepLevel) MyParagraph = otherParagraph; - YTop = Math.Min(YTop, otherParagraph.YVeryTop); - YBottom = Math.Max(YBottom, otherParagraph.YBottom); - StepLevel = Math.Max(StepLevel, otherParagraph.MyItemInfo.StepLevel); - } - public void Merge(ParagraphLocation otherParagraphLocation) - { - if (StepLevel < otherParagraphLocation.StepLevel) MyParagraph = otherParagraphLocation.MyParagraph; - YTop = Math.Min(YTop, otherParagraphLocation.YTop); - YBottom = Math.Max(YBottom, otherParagraphLocation.YBottom); - StepLevel = Math.Max(StepLevel, otherParagraphLocation.StepLevel); - } - } -} diff --git a/PROMS/Volian.Print.Library/vlnParagraph.cs2.bak b/PROMS/Volian.Print.Library/vlnParagraph.cs2.bak deleted file mode 100644 index b6b64607..00000000 --- a/PROMS/Volian.Print.Library/vlnParagraph.cs2.bak +++ /dev/null @@ -1,2009 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Text.RegularExpressions; -using System.IO; -using iTextSharp.text.pdf; -using iTextSharp.text; -using Itenso.Rtf; -using Itenso.Rtf.Parser; -using Itenso.Rtf.Interpreter; -using Itenso.Rtf.Support; -using Volian.Controls.Library; -using VEPROMS.CSLA.Library; -using Volian.Base.Library; - -namespace Volian.Print.Library -{ - public partial class vlnParagraphs : List - { - private vlnParagraph _Parent; - public vlnParagraph Parent - { - get { return _Parent; } - set { _Parent = value; } - } - public vlnParagraphs(vlnParagraph parent) - { - _Parent = parent; - } - public float Add(PdfContentByte cb, ItemInfoList itemInfoList, float xoff, float yoff, float yoffRight, int rnoLevel, int maxRNO, FormatInfo formatInfo) - { - int? bxIndex = null; - vlnBox box = null; - float yTop = yoff; - foreach (ItemInfo childItemInfo in itemInfoList) - { - // if this is a caution/note and it has a caution/note substep, do it before this caution/note, so that - // it comes above it. - if (childItemInfo.Cautions != null && (childItemInfo.IsCaution || childItemInfo.IsNote)) - yoff = Add(cb, childItemInfo.Cautions, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo); - if (childItemInfo.Notes != null && (childItemInfo.IsCaution || childItemInfo.IsNote)) - yoff = Add(cb, childItemInfo.Notes, xoff, yoff, yoffRight, rnoLevel, maxRNO, formatInfo); - int? bxIndx = childItemInfo.FormatStepData==null?-1:childItemInfo.FormatStepData.StepLayoutData.STBoxindex; - if (bxIndx != -1 && (bxIndex != bxIndx || childItemInfo.FormatStepData.BoxIt)) - { - if (childItemInfo.FormatStepData.BoxIt) // this is a boxed HLS - { - box = new vlnBox(); - box.MyBox = new Box(); - box.DefBox = vlnBox.BoxThin; - StepSectionLayoutData ssld = formatInfo.MyStepSectionLayoutData; - int colR = int.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[childItemInfo.ColumnMode]); - int widS = vlnPrintObject.ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); - box.DefEnd = (float)(ssld.ColS + colR + widS + (60/4.8)); - box.YOffset = yoff - .75F * vlnPrintObject.SixLinesPerInch; - } - else if (bxIndex == null) // First boxed step - { - box = new vlnBox(); - box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - if (box.MyBox != null) - { - box.YOffset = yoff; - int ln = 1; // a format flag determines whether there is a space before the note/caution. - if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; - yoff += ln * vlnPrintObject.SixLinesPerInch; - } - } - else // Change Box Style - { - if (box != null) box.Height = yoff - box.YOffset; // new height, with children - box = new vlnBox(); - box.MyBox = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - box.YOffset = yoff; - int ln = 1; // a format flag determines whether there is a space before the note/caution. - if (childItemInfo.FormatStepData.OneLineBeforeTab) ln++; - yoff += ln * vlnPrintObject.SixLinesPerInch; - } - bxIndex = bxIndx; - } - if (childItemInfo is SectionInfo) formatInfo = (childItemInfo as SectionInfo).LocalFormat ?? formatInfo; - if (rnoLevel < maxRNO && childItemInfo.RNOs != null) yoff = Math.Max(yoff, yoffRight); - - - vlnParagraph para = new vlnParagraph(Parent, cb, childItemInfo, xoff, yoff, rnoLevel, maxRNO, formatInfo); - if (box != null && box.MyParent == null) - { - box.MyParent = para; - para.PartsContainer.Add(box); - } - Add(para); - // para.YBottomMost will have y for bottom of any substeps that are also enclosed in the box. - if (childItemInfo.IsStep && childItemInfo.MyHLS.FormatStepData.UseSmartTemplate && para.ChildrenBelow.Count>0 && para.ChildrenBelow[0].YBottomMost > para.YBottomMost) - yoff = para.ChildrenBelow[0].YBottomMost; - else - yoff = para.YBottomMost; - if (childItemInfo.FormatStepData != null && childItemInfo.FormatStepData.BoxIt) - { - box.Height = yoff - box.YOffset - (1.1F * vlnPrintObject.SixLinesPerInch); - box = null; // if doing boxed steps, only do single sibling at a time. - } - } - if (box != null && box.MyBox != null) - { - box.Height = yoff - box.YOffset; // new height, with children - yoff += 2 * vlnPrintObject.SixLinesPerInch; - } - return yoff; - } - public float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin) - { - foreach (vlnParagraph child in this) - { - yPageStart = child.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - } - return yPageStart; - } - } - public partial class vlnParagraph : vlnPrintObject - { - private vlnTable _MyGrid; - public vlnTable MyGrid - { - get { return _MyGrid; } - set { _MyGrid = value; } - } - public float SectYPageStart = 0; - private bool _IsWordDocPara = false; - public bool IsWordDocPara - { - get { return _IsWordDocPara; } - set { _IsWordDocPara = value; } - } - public float ParagraphToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin) - { - if (Processed) return yPageStart; - //float localYPageStart = yPageStart; - Processed = true; - if (_PartsAbove != null && _PartsAbove.Count > 0) yPageStart = PartsAbove.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - if (MyItemInfo.IsHigh && MyItemInfo.MyDocStyle.SpecialStepsFoldout) yPageStart -= SixLinesPerInch; - float yLocation = CalculateYOffset(yPageStart, yTopMargin); - if (MyItemInfo.HasChangeBar && MyPageHelper.ChangeBarDefinition.MyChangeBarType != PrintChangeBar.Without) MyPageHelper.AddChangeBar(DoChangeBar(cb, MyItemInfo, MyPageHelper, XOffset, yLocation, MyPageHelper.MaxRNO, MyItemInfo.ActiveFormat), cbMess); - float retval = yLocation; - - if (MyItemInfo.IsFigure) - { - yLocation -= (SixLinesPerInch * MyPageHelper.YMultiplier); - if (ImageText != null) - retval = DrawFigure(cb, yBottomMargin, yLocation); - else - retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation); - - } - else if (!MyItemInfo.IsStepSection - || (MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles - && !MyItemInfo.MyDocStyle.CancelSectTitle - && !MyItemInfo.MyDocStyle.SpecialStepsFoldout)) // Don't ouput the Step Section title - { - bool doprint = true; - // if this is a section, then check the section config for printable header too. - if (MyItemInfo.IsSection) - { - SectionConfig sch = MyItemInfo.MyConfig as SectionConfig; - if (!(MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles - && !MyItemInfo.MyDocStyle.CancelSectTitle - && !MyItemInfo.MyDocStyle.SpecialStepsFoldout) - && - ((sch != null && sch.Section_PrintHdr != "Y") || !MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections)) doprint = false; - } - if (MyItemInfo.MyContent.MyGrid != null) - retval = DrawGrid(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation); - else - if (doprint)retval = DrawText(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation); - if (MyItemInfo.IsHigh) - { - MyPageHelper.PageBookmarks.Add(MyItemInfo, MyItemInfo.MyTab.CleanText + " " + MyItemInfo.DisplayText, - new PdfDestination(PdfDestination.FITBH, yLocation + YVeryTop - YTopMost + SixLinesPerInch)); - } - } - if (MyItemInfo.IsSection) - { - SectionConfig sc = MyItemInfo.MyConfig as SectionConfig; - if (sc != null && sc.Section_TOC == "Y") - { - string tocKey = string.Format("TOC{0}", MyItemInfo.ItemID); - if (MyPageHelper.MyTOCPageCounts.ContainsKey(tocKey)) - { - PageCount pc = MyPageHelper.MyTOCPageCounts[tocKey]; - pc.Total = MyPageHelper.CurrentPageNumber; - pc.DrawTemplates(); - } - } - } - //Height = yLocation - retval; - if (_PartsLeft != null && _PartsLeft.Count > 0) yPageStart = PartsLeft.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - if (_PartsRight != null && _PartsRight.Count > 0) yPageStart = PartsRight.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - if (_PartsBelow != null && _PartsBelow.Count > 0) yPageStart = PartsBelow.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - if (_PartsContainer != null && _PartsContainer.Count > 0) yPageStart = PartsContainer.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - - //if (localYPageStart != yPageStart) DebugText.WriteLine("ParToPdf-yPagestartDiff:{0},{1},{2}", MyItemInfo.ItemID, localYPageStart, yPageStart); - return yPageStart; - } - - private float DrawGrid(PdfContentByte cb, ref float yPageStart, float yTopMargin, float yBottomMargin, ref float yLocation) - { - //DebugText.WriteLine("{0},'{1}','{2}','<>'", MyItemInfo.ItemID, MyItemInfo.ShortPath, FormattedText); - DebugText.WriteLine("{0},'{1}','{2}','<>',{3}", MyItemInfo.ItemID, MyItemInfo.ShortPath,MyItemInfo.MyContent.Text,XOffset); - float retval = Rtf2Pdf.GridAt(cb, MyGrid, XOffset, yLocation, Width, 100, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless")); - return retval; - } - - private float DrawText(PdfContentByte cb, ref float yPageStart, float yTopMargin, float yBottomMargin, ref float yLocation) - { - DebugText.WriteLine("{0},'{1}','{2}','<>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, FormattedText); - //Console.WriteLine("{0},{1},'{2}','<>'", MyItemInfo.ItemID, MyItemInfo.DBSequence, IParagraph.Content); - float retval = yLocation; - // Check if only one line, i.e. "Height < (1.2F * IParagraph.Leading". The Leading can be for six or seven lines per inch, so the 1.2 - // multiplier accounts for both. - if (!MyItemInfo.IsStepSection && MyItemInfo.FormatStepData.CenterOneLineOnly && MyItemInfo.MyPrevious == null && MyItemInfo.NextItem == null && Height < (1.2F * IParagraph.Leading)) - IParagraph.Alignment = Element.ALIGN_CENTER; - if (!MyItemInfo.IsStepSection && MyItemInfo.FormatStepData.StepPrintData.Justify == "Center") - IParagraph.Alignment = Element.ALIGN_CENTER; - retval = Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, DebugInfo, yBottomMargin); - if (retval == 0) // problem occurred - paragraph was not able to be printed on page - { // pagination logic needs to be fixed. - ForcePagination(cb, ref yPageStart, yTopMargin, yBottomMargin, ref yLocation, ref retval); - } - return retval; - } - private static List myAttributes =new List(); - private static void AddAttribute(string attr) - { - if (myAttributes.Contains(attr)) - return; - //Console.WriteLine("Attribute = \"{0}\"", attr); - myAttributes.Add(attr); - } - private void CheckAttributes(System.Collections.Hashtable attributes) - { - foreach (string attr in attributes.Keys) - { - AddAttribute(attr); - } - } - private string FormattedText - { - get - { - bool subscript = false; - //if (_MyItemInfo.ItemID == 467) - // Console.Write(""); - StringBuilder sb = new StringBuilder(); - //if (IParagraph.Chunks.Count > 1) - // Console.WriteLine("{0} Chunks", IParagraph.Chunks.Count); - foreach (Chunk chk in IParagraph.Chunks) - { - string prefix = ""; - string suffix = ""; - CheckAttributes(chk.Attributes); - if (chk.Font.BaseFont != null && chk.Font.BaseFont.PostscriptFontName.ToUpper().Contains("BOLD")) - { - prefix += "\xD5"; - suffix = "\xD6" + suffix; - } - if (chk.Attributes.ContainsKey("SUBSUPSCRIPT")) - { - float sup = (float)(chk.Attributes["SUBSUPSCRIPT"]); - if (sup > 0) - { - prefix += "\xA6"; - suffix = "\xD1" + suffix; - } - else if (sup < 0) - { - prefix += "\xD1"; - suffix = "\xA6" + suffix; - } - - } - if (chk.Attributes.ContainsKey("UNDERLINE")) - { - prefix += "\x16"; - suffix = "\x16" + suffix; ; - } - sb.Append(prefix + chk.Content + suffix); - } - string retval = sb.ToString(); - retval = retval.Replace("\xD1\xA6", "");// Remove Multiple Superscript commands in a row - retval = retval.Replace("\xA6\xD1", "");// Remove Multiple Superscript commands in a row - retval = retval.Replace("\xD6\xD5", ""); - retval = retval.Replace("\xD6\x16\xD5", "\x16"); - return retval; - } - } - //private bool _TextDebug = false; //true; this will turn on a writeline with debug in DrawText() - private float DrawFigure(PdfContentByte cb, float yBottomMargin, float yLocation) - { - float retval = yLocation; - if (ImageText != null) - { - string[] vals = ImageText.Split("\n".ToCharArray()); - ProcedureInfo proc = MyItemInfo.MyProcedure; - DocVersionInfo dvi = proc.ActiveParent as DocVersionInfo; - ROFstInfo rofst = dvi.DocVersionAssociations[0].MyROFst; - ROImageInfo roImage = ROImageInfo.GetByROFstID_FileName(rofst.ROFstID, vals[0]); - if (roImage != null) - { - iTextSharp.text.Image it_image = iTextSharp.text.Image.GetInstance(roImage.Content); - retval = Rtf2Pdf.FigureAt(cb, it_image, XOffset + MyItemInfo.FormatStepData.Font.CharsToTwips, yLocation, Width * MyPageHelper.YMultiplier, Height * MyPageHelper.YMultiplier, DebugInfo, yBottomMargin, !MyItemInfo.FormatStepData.Type.Contains("Borderless")); - } - } - return retval; - } - private string DebugInfo - { - get - { - return string.Format("DebugID = {0}, ID={1} Type={2} TypeName='{3}' StepLevel={4} DBSequence={5}", DebugId, MyItemInfo.ItemID, MyItemInfo.FormatStepType, MyItemInfo.FormatStepData==null?"NoStepData":MyItemInfo.FormatStepData.Type, MyItemInfo.StepLevel, MyItemInfo.DBSequence); - } - } - public override float ToPdf(PdfContentByte cb, float yPageStart, float yTopMargin, float yBottomMargin) - { - if (IsWordDocPara) - { - PdfReader tmp = null; - string tmpstr = null; - SectionInfo si = SectionInfo.Get(MyItemInfo.ItemID); - cb.PdfDocument.NewPage(); - MyPageHelper.MyPromsPrinter.CreateWordDocPdf(cb, si, ref tmp, ref tmpstr); - Processed = true; - return yPageStart; - } - float yLocalypagestart = yPageStart; - // yPageStart is offset into roll; YTopMost is offset of topmost of this paragraph. - float yLocation = yPageStart - YTopMost; - DebugText.WriteLine("ToPdf1:{0},'{1}',{2},{3},{4},{5}", MyItemInfo.ItemID, MyItemInfo.ShortSearchPath, XOffset, yLocation, yPageStart, YTopMost); - int paginate = Paginate(yLocation, yTopMargin, yBottomMargin); - bool firstHighLevelStep = MyItemInfo.IsHigh && (MyItemInfo.MyPrevious == null); - switch (paginate) - { - case 0: // No page break - if (MyItemInfo.IsSection) - { - SectionInfo si = MyItemInfo as SectionInfo; - MyPageHelper.PageBookmarks.Add(MyItemInfo, ((si.DisplayNumber ?? "") == "" ? "" : si.DisplayNumber + " - ") + si.DisplayText, null); - DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); - } - break; - case 1: // Break on High Level Step - OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); - cb.PdfDocument.NewPage(); - DebugText.WriteLine("Paginate1"); - if (MyItemInfo.IsSection) - { - SectionInfo si = MyItemInfo as SectionInfo; - MyPageHelper.PageBookmarks.Add(MyItemInfo, ((si.DisplayNumber ?? "") == "" ? "" : si.DisplayNumber + " - ") + si.DisplayText, null); - } - // Only do foldout page if not done for section break, i.e. check the there's a previous step. - if (MyItemInfo.MyPrevious != null && (MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Style ?? 0 & E_DocStructStyle.UseSectionFoldout) != 0) - PromsPrinter.DoFoldoutPage(cb, "HLS", MyPageHelper.TextLayer, MyPageHelper); - - yPageStart = yTopMargin + YTopMost; - DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); - MyPageHelper.YMultiplier = 1; - break; - case 2: // Break within a Step - OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); - DocStyle docstyle = MyItemInfo.MyDocStyle; - string myMsg = docstyle.Continue.Bottom.Message; - if (myMsg != null && myMsg != "") - { - if (myMsg.IndexOf(@"%d") > -1) - myMsg = myMsg.Replace(@"%d", MyItemInfo.MyHLS.MyTab.CleanText.Trim()); - if (myMsg.IndexOf(@"%2d") > -1) - myMsg = myMsg.Replace(@"%2d", MyItemInfo.MyHLS.MyTab.CleanText.Trim(" .".ToCharArray()).PadLeft(2)); - float msg_yLocation = 0; - if (myMsg.Contains("{par}")) - { - myMsg = myMsg.Replace("{par}", ""); - msg_yLocation = -SixLinesPerInch; - } - switch (docstyle.Continue.Bottom.Location) - { - case E_ContBottomLoc.EndOfText: // place continue string at end of text - case E_ContBottomLoc.BtwnTextAndBottom: // place continue string between end of text & bottom of page - Console.WriteLine("Not done yet"); - break; - case E_ContBottomLoc.BottomOfPage: // place continue message at bottom of page - //msg_yLocation = yBottomMargin + 2 * SixLinesPerInch + (float)docstyle.Layout.FooterLength; // 2 lines above bottom margin - msg_yLocation = msg_yLocation + yBottomMargin + (float)docstyle.Layout.FooterLength; - break; - default: - Console.WriteLine("**** BOTTOM CONTINUE MESSAGE NOT CODED*****"); - break; - } - MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Bottom.Margin ?? 0, msg_yLocation, docstyle.Continue.Bottom.Font);// MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font); - } - cb.PdfDocument.NewPage(); - DebugText.WriteLine("Paginate2"); - if ((MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Style ?? 0 & E_DocStructStyle.UseSectionFoldout) != 0) - PromsPrinter.DoFoldoutPage(cb, "Break within Step", MyPageHelper.TextLayer, MyPageHelper); // temporary foldout - - // If there is a box, adjust the yTopMost to include it. - float yTopMost = YTopMost; - //if (YVeryTop < yTopMost) Console.WriteLine("{0},{1},{2}", MyItemInfo.DBSequence, yTopMost, YVeryTop); - yTopMost = Math.Min(yTopMost,YVeryTop); - yPageStart = yTopMargin + yTopMost;// -2 * SixLinesPerInch; - DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); - if (EmptyTopMostPart) yPageStart += SixLinesPerInch; - myMsg = docstyle.Continue.Top.Message; - if (myMsg != null && myMsg != "") - { - yPageStart -= 2 * SixLinesPerInch;// Allow two lines for top continue message - if (myMsg.IndexOf(@"%d") > -1) - myMsg = myMsg.Replace(@"%d", MyItemInfo.MyHLS.MyTab.CleanTextNoSymbols.Trim(" .".ToCharArray())); - MyPageHelper.TopMessage = new vlnText(cb, this, myMsg, myMsg, docstyle.Layout.LeftMargin + XOffsetBox + docstyle.Continue.Top.Margin ?? 0, yTopMargin + 0.1F, docstyle.Continue.Top.Font);// MyItemInfo.ActiveFormat.PlantFormat.FormatData.Font); - } - MyPageHelper.YMultiplier = 1; - break; - case 3: // Break on High Level Step (SevenLinesPerInch) - if (!firstHighLevelStep) - { - OutputOtherPageSteps(cb, YTopMost, yPageStart, yTopMargin, yBottomMargin); - cb.PdfDocument.NewPage(); // HLS (7 lpi) breakif (MyItemInfo.IsSection) - DebugText.WriteLine("Paginate3"); - if (MyItemInfo.IsSection) - { - SectionInfo si = MyItemInfo as SectionInfo; - MyPageHelper.PageBookmarks.Add(MyItemInfo, ((si.DisplayNumber ?? "") == "" ? "" : si.DisplayNumber + " - ") + si.DisplayText, null); - } - if ((MyItemInfo.ActiveSection.MyDocStyle.StructureStyle.Style ?? 0 & E_DocStructStyle.UseSectionFoldout) != 0) - PromsPrinter.DoFoldoutPage(cb, "HLS (7 lpi) break", MyPageHelper.TextLayer, MyPageHelper); - } - if (MyItemInfo.MyParent != null && MyItemInfo.MyParent.IsStepSection && - MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles - && !MyItemInfo.MyDocStyle.CancelSectTitle - && !MyItemInfo.MyDocStyle.SpecialStepsFoldout) - yPageStart = yPageStart; // if printing the section title, we already have the y location - else - yPageStart = yTopMargin + YTopMost; - MyPageHelper.YMultiplier = _SevenLinesPerInch / SixLinesPerInch; - DoCheckOffHeader(cb, MyItemInfo, yLocation, yTopMargin, yPageStart); - break; - } - yPageStart = ChildrenAbove.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - yPageStart = ChildrenLeft.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - yPageStart = ParagraphToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - yPageStart = ChildrenRight.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - yPageStart = ChildrenBelow.ToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - - if (MyItemInfo.IsHigh && MyItemInfo.NextItem == null) // last hls, add the 'end' message, if there is one - { - DocStyle docstyle = MyItemInfo.MyDocStyle; - string myMsg = (docstyle.End == null) ? null : docstyle.End.Message; - if (myMsg != null) - { - // If the flag is 0 or 1, just put the end message out right below this vlnParagraph: - float msg_yLocation = CalculateYLocation(yPageStart - YBottomMost, yTopMargin); - - // use the 'flag' to position the message. - if (docstyle.End.Flag > 2) // >2 position at an absolute location defined by docstyle.End.Flag. - { - msg_yLocation = yTopMargin - (float)(docstyle.End.Flag * SixLinesPerInch); - } - - if (myMsg.Contains("{Section Number}")) myMsg = myMsg.Replace("{Section Number}", MyItemInfo.ActiveSection.DisplayNumber); - - // center the message. - float wtpm = (float)docstyle.Layout.PageWidth - (float)docstyle.Layout.LeftMargin; - float centerpos = XOffsetBox + (float)docstyle.Layout.LeftMargin + (wtpm - (myMsg.Length * MyItemInfo.FormatStepData.Font.CharsToTwips)) / 2; - MyPageHelper.BottomMessage = new vlnText(cb, this, myMsg, myMsg, centerpos, msg_yLocation, docstyle.End.Font); - } - } - if (yLocalypagestart != yPageStart) DebugText.WriteLine("ToPdf-yPagestartDiff:{0},{1},{2}", MyItemInfo.ItemID, yLocalypagestart, yPageStart); - return yPageStart; - } - private vlnParagraph TopMostChild - { - get - { - if (ChildrenAbove.Count>0) return ChildrenAbove[0].TopMostChild; - return this; - } - } - private bool EmptyTopMostPart - { - get - { - if (TopMostChild.PartsAbove.Count == 0) return false; - foreach (vlnPrintObject po in TopMostChild.PartsAbove) - { - vlnHeader hd = po as vlnHeader; - if (hd == null) return false; - if (hd.Text != "") return false; - } - return true; - } - } - private void OutputOtherPageSteps(PdfContentByte cb, float YTopMost, float yPageStart, float yTopMargin, float yBottomMargin) - { - // Find any items remaining in MyPageHelper.MyParagraphs that should be printed on this page. - vlnParagraphs process = new vlnParagraphs(null); - foreach (vlnParagraph vPara in MyPageHelper.MyParagraphs.Values) - { - //if (!vPara.Processed && ((vPara.YOffset + vPara.Height) < YTopMost)) - if (!vPara.Processed && ((vPara.YOffset) < YTopMost)) - process.Add(vPara); - } - foreach (vlnParagraph vPara in process) - { - vPara.ParagraphToPdf(cb, yPageStart, yTopMargin, yBottomMargin); - } - } - private float _YVeryTop = -1; - public float YVeryTop - { - get - { - if (_YVeryTop == -1) - { - _YVeryTop = YTop; - _YVeryTop = VeryTop(PartsAbove,_YVeryTop); - _YVeryTop = VeryTop(PartsContainer,_YVeryTop); - } - return _YVeryTop; - } - } - - private float VeryTop(vlnPrintObjects parts, float yVeryTop) - { - if (parts != null) - foreach (vlnPrintObject part in parts) - if (part.YOffset < yVeryTop) - yVeryTop = part.YOffset; - return yVeryTop; - } - /// - /// This gets the height of the step with it's Caution's, Notes and potentially any First Substeps - /// - /// - private float GetFirstPieceSize() - { - vlnParagraph paraLast = GetFirstPieceLastPart(); - float retval = (paraLast.YBottom) - YTopMost; - //Console.WriteLine(MyItemInfo.DBSequence); - return retval; - } - public override float YBottom - { - get - { - float bottom = YOffset + Height; - if (PartsBelow != null) - { - foreach (vlnPrintObject part in PartsBelow) - { - float partBottom = part.YBottom; - bottom = Math.Max(partBottom, bottom); - } - } - return bottom; - } - } - public float YBottomText - { - get - { - return YOffset + Height; - } - } - private vlnParagraph GetFirstPieceLastPart() - { - vlnParagraph para = this; - if (!MyItemInfo.ActiveFormat.MyStepSectionLayoutData.PaginateOnFirstSubstep && ChildrenBelow != null && ChildrenBelow.Count > 0) - { - para = ChildrenBelow[0].GetFirstPieceLastPart(); - } - if (ChildrenRight != null && ChildrenRight.Count > 0) - { - foreach(vlnParagraph paraRight in ChildrenRight) - { - vlnParagraph paraRightLast = paraRight.GetFirstPieceLastPart(); - if (paraRightLast.YBottom > para.YBottom) - para = paraRightLast; - } - } - return para; - } - /// - /// Find items from previous page (yLocation less than yTop) and remove them from the list. - /// yTop is the new starting location on the next page for this step. - /// - /// - /// - private void RemoveProcessedParagraphs(StepLevelList myList, float yTop) - { - // the two CleanUpLists are used to remove items from - // the original list because list items cannot be removed in a - // 'foreach'. - List CleanupListStepLevel = new List(); - foreach(int stepLevel in myList.Keys) - { - List CleanupListYLocation = new List(); - SortedList AdjustYLocation = new SortedList(); - foreach (float yLocation in myList[stepLevel].Keys) - { - if (-yLocation <= yTop) - CleanupListYLocation.Add(yLocation); - else - AdjustYLocation.Add(-yLocation, yLocation); // order in ascending order - } - foreach (float yLocation in CleanupListYLocation) - myList[stepLevel].Remove(yLocation); - foreach (float yLocation in AdjustYLocation.Keys) - { - vlnParagraph para = myList[stepLevel][-yLocation]; - myList[stepLevel].Remove(-yLocation); - // shift yLocation by yTop to work with items whose locations - // are defined from the top of the new page rather than - // from the beginning of the step. - // Note that yLocation is negative to have items in descending - // order so that adding yTop decrements their values. - myList[stepLevel].Add(yTop-yLocation, para); - } - if (myList[stepLevel].Count == 0) - CleanupListStepLevel.Add(stepLevel); - } - foreach (int stepLevel in CleanupListStepLevel) - myList.Remove(stepLevel); - } - /// - /// Builds a list of paragraphs by StepLevel and yLocation in descending order. - /// - /// - /// - private void BuildLocationList(float yTopMost, ParagraphLocations myLocations) - { - foreach (vlnParagraph child in ChildrenAbove) - child.BuildLocationList(yTopMost, myLocations); - foreach (vlnParagraph child in ChildrenLeft) - child.BuildLocationList(yTopMost, myLocations); - - // Add a list entry consisting of StepLevel, yoffset from the beginning of this step, paragraph itself - myLocations.Add(this, yTopMost); - - foreach (vlnParagraph child in ChildrenRight) - child.BuildLocationList(yTopMost, myLocations); - foreach (vlnParagraph child in ChildrenBelow) - child.BuildLocationList(yTopMost, myLocations); - } - private int COL_WID_ADJ = 6; // adjusts for incorrect use of WidSTable when breaking a line (it breaks 6 chars too short) - public vlnParagraph(vlnParagraph parent, PdfContentByte cb, ItemInfo itemInfo, float xoff, float yoff, int rnoLevel, int maxRNO, FormatInfo formatInfo) - { - float savCheckListBottomMost = 0; - //int[] problemIDs = { 889 }; - //List lProblemIDs = new List(problemIDs); - //if (lProblemIDs.Contains(itemInfo.ItemID)) - // Console.WriteLine("Found Item {0}", itemInfo.ItemID);formatInfochecko - MyParent = parent; - // The following code determines the last paragraph for an RNO - // MyTopRNO finds the Top paragraph for an RNO - if (itemInfo.IsInRNO) - { - if (rnoLevel <= maxRNO && itemInfo.IsRNOPart) // Not top level RNO - MyTopRNO = this; - else - MyTopRNO = MyParent.MyTopRNO; - if(MyTopRNO != null) MyTopRNO.LastRNO = this; - } - MyContentByte = cb; - MyPageHelper.MyParagraphs.Add(itemInfo.ItemID, this); - MyItemInfo = itemInfo; - XOffset = xoff; - if (!MyItemInfo.IsStep && !MyItemInfo.IsStepSection) - { - IsWordDocPara = true; - // special case - this is a 'Word Doc' paragraph. The Processed flag is used to know - // that steps need put out on a page for the pagination logic, and since there are no steps - // we don't want to have to worry about putting this out for pagination logic. - Processed = true; - return; - } - YTopMost = YOffset = yoff; - vlnTab mytab = null; - bool doSectTab = false; - // if this substep has a caution or note as its parent, then there may have been a special indent done on the - // substep... check the CautionOrNoteSubstepIndent value, this is the additional indent amount in number - // of characters. - if (itemInfo.MyParent.IsCaution || itemInfo.MyParent.IsNote) - XOffset += 72 * (itemInfo.FormatStepData.CautionOrNoteSubstepIndent == null ? 0 : (float)itemInfo.FormatStepData.CautionOrNoteSubstepIndent / (float)itemInfo.FormatStepData.Font.CPI); - - if (itemInfo.IsStep && itemInfo.MyHLS.FormatStepData.UseSmartTemplate && - itemInfo.FormatStepData.StepLayoutData.AlignWithParentTab - || (itemInfo.Steps != null && itemInfo.Steps.Count > 0 && itemInfo.Steps[0].FormatStepData.StepLayoutData.AlignWithParentTab)) - itemInfo.MyTab = null; - if (itemInfo.MyTab != null && itemInfo.MyTab.Text != null && itemInfo.MyTab.Text != "") - { - float localXOffset = XOffset; - bool doprint = true; - if (itemInfo.IsSection) - { - SectionConfig sch = MyItemInfo.MyConfig as SectionConfig; - if (!(MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles - && !MyItemInfo.MyDocStyle.CancelSectTitle - && !MyItemInfo.MyDocStyle.SpecialStepsFoldout) - && - ((sch != null && sch.Section_PrintHdr != "Y") || !MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections)) doprint = false; - } - if (doprint && itemInfo.IsSection && !itemInfo.MyDocStyle.CancelSectTitle && itemInfo.MyTab.Text.ToUpper() != "FOLDOUT") - { - doSectTab = true; - if (itemInfo.IsStepSection && formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Just == "PSLeft") - { - float offset = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - if (formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos != null) - { - // determine level of metasections. This level will be used to calculate the - // indent. DO I NEED THIS HERE???? - int level = 0; - ItemInfo iilvl = itemInfo; - while (!iilvl.IsProcedure) - { - level++; - iilvl = iilvl.MyParent; - } - level = level <= 2 ? 1 : level - 1; - if (level == 1) - offset += (float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos; - else - offset += (level-1) * ((float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos-(float)formatInfo.PlantFormat.FormatData.SectData.SectionNumber.Pos); - } - localXOffset = offset; - } - } - if (!itemInfo.IsSection || doSectTab) - { - mytab = new vlnTab(cb, this, itemInfo.MyTab.Text, itemInfo.MyTab.CleanText, localXOffset, yoff, itemInfo.MyTab.MyFont, doSectTab, StepRTB.MySymbolFontName, itemInfo.MyTab.RemovedStyleUnderline); - PartsLeft.Add(mytab); - if (mytab.MyMacro != null) PartsLeft.Add(mytab.MyMacro); - } - } - AdjustWidth(itemInfo, maxRNO, formatInfo, mytab); - AdjustXOffsetForTab(itemInfo, maxRNO, formatInfo, mytab); - if (itemInfo.MyHeader != null && itemInfo.MyHeader.Text != null && !doSectTab) - yoff += SetHeader(this, cb, itemInfo, formatInfo); - if (itemInfo.Cautions != null && !(itemInfo.IsCaution || itemInfo.IsNote)) - yoff = ChildrenAbove.Add(cb, itemInfo.Cautions, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); - if (itemInfo.Notes != null && !(itemInfo.IsCaution || itemInfo.IsNote)) - yoff = ChildrenAbove.Add(cb, itemInfo.Notes, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); - - // If the format has that extra space should be put out before the step, then - // handle this by using the 'PartsAbove' structure. By using the parts above, the extra - // space above will be done regardless of where page breaks fall. - float addExtraSpace = (MyItemInfo.FormatStepData == null) ? 0 : MyItemInfo.FormatStepData.StepLayoutData.STExtraSpace ?? 0; - // If a high level step, the 16bit code uses the value of the extra space - // from the high level step format regardless of what type of high level step it is: - if (MyItemInfo.IsHigh) - addExtraSpace = MyItemInfo.ActiveFormat.PlantFormat.FormatData.StepDataList[2].StepLayoutData.STExtraSpace ?? 0; - if (addExtraSpace > 0) this.PartsAbove.Add(new vlnText(cb, this, " ", " ", 0, yoff, MyItemInfo.FormatStepData.Font)); - yoff += addExtraSpace; - - YTop = yoff; - YOffset = yoff; - if (mytab != null && mytab.SeparateBullet) - { - string identB = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.IdentB; - vlnText myBullet = new vlnText(cb, this, identB, identB, XOffset - 12, YOffset, MyItemInfo.FormatStepData.TabData.Bullet.Font); - myBullet.Rtf = myBullet.Rtf.Replace("\u25CF", @"\f1\u9679?\f0 "); - PartsLeft.Add(myBullet); - } - if (itemInfo.IsRNOPart) - { - // there may be other places that double space, but this supports it for RNOs (the DoubleRNOspace flag) - if (rnoLevel > maxRNO && itemInfo.FormatStepData.DoubleSpace) yoff = YOffset = yoff + SixLinesPerInch; - } - AddMacros(itemInfo, mytab); - if (mytab != null) - { - mytab.YOffset = yoff; - if (mytab.MyMacro != null) mytab.MyMacro.YOffset = yoff; - } - float yForCheckoff = yoff; //0; - default checkoff row is same as FIRST line of text - // if dropCheckoff is true, then the checkoff is place on the same of row as the LAST line of text - bool dropCheckoff = itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.DropCheckOff; - if (itemInfo.MyContent.MyGrid != null) - { - VlnFlexGrid myFlexGrid = new VlnFlexGrid(1,1); - myFlexGrid.LoadGrid(itemInfo); - MyGrid = new vlnTable(myFlexGrid, cb); - Height = MyGrid.Height; - Width = MyGrid.Width; - //yForCheckoff = yoff + Height - SixLinesPerInch; - if (dropCheckoff) - yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text - yoff += (Height + (2 * SixLinesPerInch)); - CalculateXOffset(itemInfo, maxRNO, formatInfo); - } - else if (itemInfo.IsFigure) // if a figure we've got to determine the size: - { - string erMsg = null; - if (itemInfo.MyContent.Text != null) - { - ProcedureInfo proc = itemInfo.MyProcedure; -// DocVersionInfo dvi = proc.ActiveParent as DocVersionInfo; - DocVersionInfo dvi = proc.MyDocVersion; - ROFstInfo rofst = dvi.DocVersionAssociations[0].MyROFst; - rofst.docVer = dvi; - ROFSTLookup lookup = rofst.ROFSTLookup; - string linkInfoText = itemInfo.MyContent.Text.Replace(@"\v ", ""); - if (linkInfoText.Contains("?")) - erMsg = "RO was not found during data migration."; - else - { - Match m = Regex.Match(linkInfoText, @"(.*)[#]Link:([A-Za-z]*):(.*)"); - string[] subs = m.Groups[3].Value.Split(" ".ToCharArray()); - string roid = subs[1]; - string val = lookup.GetRoValue(subs[1]); - if (val == null) val = lookup.GetRoValue(subs[1].Substring(0, 12)); - if (val != null) - { - string[] vals = val.Split("\n".ToCharArray()); - Width = Int32.Parse(vals[3], System.Globalization.NumberStyles.AllowHexSpecifier) * MyItemInfo.FormatStepData.Font.CharsToTwips; - int lines = Int32.Parse(vals[2], System.Globalization.NumberStyles.AllowHexSpecifier); - Height = lines * SixLinesPerInch; - //yForCheckoff = yoff + Height - SixLinesPerInch; - if (dropCheckoff) - yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text - yoff += (Height + (2 * SixLinesPerInch)); - - try - { - ROImageInfo roImage = ROImageInfo.GetByROFstID_FileName(rofst.ROFstID, vals[0]); - if (roImage != null) - ImageText = val; - else - erMsg = string.Format("Image {0} does not exist.", vals[0]); - } - - catch (Exception ex) - { - erMsg = string.Format("Image {0} does not exist, error = {1}.", vals[0], ex.Message); - } - } - } - if (erMsg != null) Rtf = GetRtf(erMsg, itemInfo.ActiveFormat.PlantFormat.FormatData.Font); - CalculateXOffset(itemInfo, maxRNO, formatInfo); - } - } - else - { - Rtf = GetRtf(itemInfo); - // Need the following with some modifications for WCNCKL format: - if (Rtf.Contains("{Backspace}")) - { - XOffset -= 22; - Width += 24; - Rtf = Rtf.Replace("{Backspace}", ""); - } - if (itemInfo.IsStep && itemInfo.MyHLS.FormatStepData.UseSmartTemplate) - { - if (itemInfo.FormatStepData.StepLayoutData.AlignWithParentTab - || (itemInfo.Steps != null && itemInfo.Steps.Count > 0 && itemInfo.Steps[0].FormatStepData.StepLayoutData.AlignWithParentTab)) - { - int stplevl = TheStepLevel(itemInfo); - if (stplevl >= 0 && MyItemInfo.MyHLS.FormatStepData.VertPos[stplevl] > 0) - XOffset = float.Parse(MyItemInfo.MyHLS.FormatStepData.VertPos.Split(",".ToCharArray())[stplevl]) + (float)itemInfo.MyDocStyle.Layout.LeftMargin; - } - } - if (itemInfo.IsTablePart) // Not for grid, this is for old-style tables. - { - Width = GetTableWidth(cb, IParagraph, MyItemInfo.MyDocStyle.Layout.PageWidth); - CalculateXOffset(itemInfo, maxRNO, formatInfo); - } - else - if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null) XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); - - bool printMetaHdr = false; - if (itemInfo.Steps != null && itemInfo.IsSection && itemInfo.Sections != null && itemInfo.Sections.Count > 0) - { - SectionConfig sc = itemInfo.MyConfig as SectionConfig; - if ((sc != null && sc.Section_PrintHdr == "Y") && itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections) printMetaHdr = true; - } - - // If WCN checklists, the substeps are printed in a row, need to keep track of the 'longest' in - // y direction (bottommost) across the row. - if (itemInfo.IsStep && itemInfo.MyHLS.FormatStepData.UseSmartTemplate && (TheStepLevel(itemInfo)>0)) - { - // do I need to get max of savCheckListBottomMost & (yoff+Height+SixLinesPerInch) - savCheckListBottomMost = yoff + Height + SixLinesPerInch; - } - // Get Y offset for regular steps, or if section title is output or if not within row (not last column of - // text) for wcn checklist, i.e. . - if ((!itemInfo.IsStepSection && !itemInfo.MyHLS.FormatStepData.UseSmartTemplate) - || printMetaHdr || - (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles - && !MyItemInfo.MyDocStyle.CancelSectTitle - && !MyItemInfo.MyDocStyle.SpecialStepsFoldout) - // In WCN Checklist: I don't have children or if I have children the first child doesn't alignwithparent. - || (!itemInfo.IsStepSection && itemInfo.MyHLS.FormatStepData.UseSmartTemplate - && ((itemInfo.Steps == null || itemInfo.Steps.Count == 0) - || !itemInfo.Steps[0].FormatStepData.StepLayoutData.AlignWithParentTab))) - { - yoff += Height; - yoff += AdjustForBlankLines(); - if (dropCheckoff) - yForCheckoff += Height - SixLinesPerInch; // place checkoff on last row of text - } - } - CheckOff co = itemInfo.GetCheckOffStep(); - if (co != null) - { - //float xloc_co = (float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation + (float)itemInfo.MyDocStyle.Layout.LeftMargin; - float xloc_co = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation != null) - xloc_co += (float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.XLocation; - PartsRight.Add(new vlnMacro(xloc_co, yForCheckoff, co.Macro)); - } - float yOffRight = yoff; - float RnoOffset = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO); - if (rnoLevel < maxRNO && itemInfo.RNOs != null) yOffRight = ChildrenRight.Add(cb, itemInfo.RNOs, XOffset + RnoOffset, YTop, YTop, rnoLevel + 1, maxRNO, formatInfo); - // Need code to determine if the table will overlap the Right Column if it does then - // use YOffRight rather than yoff - if (itemInfo.Tables != null) - { - bool aerTableOrFigure = itemInfo.FormatStepData.Type.Contains("AER"); - // get the first table & see if it is borderless. If borderless, 16bit code removed a - // line (yoffset) before printing it: - float yoffadj = 0; - if (itemInfo.Tables[0].IsTable) - { - VlnFlexGrid fg = new VlnFlexGrid(1, 1); - fg.LoadGrid(itemInfo.Tables[0]); - if (fg.BorderStyle == C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.None) yoffadj = -SixLinesPerInch; - } - - if(!aerTableOrFigure && itemInfo.RNOLevel == 0) // Centered Table - yoff = ChildrenBelow.Add(cb, itemInfo.Tables, XOffset, yOffRight, yOffRight, rnoLevel, maxRNO, formatInfo); - else // AER or RNO Table - yoff = ChildrenBelow.Add(cb, itemInfo.Tables, XOffset, yoff, yOffRight, rnoLevel, maxRNO, formatInfo); - } - - // Look for the meta section case where the 'Editable' flag is set to 'N', which means that - // these steps should not be printed: - bool printsteps = true; - if (itemInfo.Steps != null && itemInfo.IsSection && itemInfo.Sections!=null && itemInfo.Sections.Count>0) - { - SectionConfig sc = itemInfo.MyConfig as SectionConfig; - if (sc != null && sc.SubSection_Edit != "Y") printsteps = false; - } - - if (itemInfo.Steps != null && printsteps) yoff = ChildrenBelow.Add(cb, itemInfo.Steps, XOffset, yoff, yOffRight, rnoLevel, maxRNO, formatInfo); - if (itemInfo.Sections != null) yoff = ChildrenBelow.Add(cb, itemInfo.Sections, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); - if (itemInfo.Procedures != null) yoff = ChildrenBelow.Add(cb, itemInfo.Procedures, xoff, yoff, yoff, rnoLevel, maxRNO, formatInfo); - if (rnoLevel >= maxRNO && itemInfo.RNOs != null) yoff = ChildrenBelow.Add(cb, itemInfo.RNOs, XOffset, yoff, yoff, rnoLevel + 1, maxRNO, formatInfo); - yoff = Math.Max(yoff, yOffRight); - // TODO - use RNOSepAfterAER flag too: - string tmpRnoSepStr = formatInfo.MyStepSectionPrintData.RNOSepString; - if (rnoLevel < maxRNO && itemInfo.RNOs != null && tmpRnoSepStr != null) - { - vlnParagraph rno = ChildrenRight[0]; - vlnParagraph bottomChild = BottomChild; - float xsep = MyHighLevelParagraph.XOffset + RnoOffset; - vlnRNOSeparator myRnoSep = new vlnRNOSeparator(this, cb, tmpRnoSepStr, xsep, yoff, formatInfo, bottomChild==null?true:bottomChild.MyItemInfo.HasChangeBar); - // TODO: May need to handle more than one RNO column for RNO Separator - if (rno.LastRNO.MyItemInfo.HasChangeBar == false && bottomChild != null && bottomChild.MyItemInfo.HasChangeBar) - bottomChild.PartsBelow.Add(myRnoSep); - else - rno.LastRNO.PartsBelow.Add(myRnoSep); - yoff += myRnoSep.Height + SixLinesPerInch; - } - YBottomMost = yoff; - - // For WCN Checklist, the substeps are in rows of data. The YBottomMost is the bottom most for - // the row. - if (savCheckListBottomMost != 0 && savCheckListBottomMost>YBottomMost) YBottomMost = savCheckListBottomMost; - } - - private int TheStepLevel(ItemInfo itemInfo) - { - if (itemInfo.IsHigh) return -1; - int lev = 0; - ItemInfo ii = itemInfo; - while (!ii.MyParent.IsHigh) - { - lev++; - ii = ii.MyParent; - } - return lev; - } - - private string SectionHasCheckOffHeader(ItemInfo itemInfo, ref VE_Font font) - { - // If the passed in itemInfo is not a section, get it's parent section. This may be a subsection, so - // it will be found here, versus using 'MyActiveSection'. - while (!itemInfo.IsSection) - { - itemInfo = itemInfo.MyParent; - } - // See if this section has a checkoffheading index - this value, if set is stored in the config field. - // -1 flags no entries in the format's CheckOffHeaderList & 0 flags the first - // entry which is always '{NO HEADING}'. So only continue if it's greater than 0. - SectionInfo si = SectionInfo.Get(itemInfo.ItemID); // sometimes the itemInfo isn't a section info - int sindx = si.CheckOffHeadingIndex(); - - // If there is a checkoff header for this section, see if this section has subsections. - // If this has a header but no subsections, put out the header. - // Else if this section has a header AND subsections, don't put it out... - // the subsection's checkoff header will be processed (or lack there of). - bool doCheckoffHeader = sindx > 0 && (itemInfo.Sections == null || itemInfo.Sections.Count == 0); - - // if doing it, then grab the string from the format.... CHECK if this works for subsection, it is - // getting ActiveSection which may return the top section, not subsections. - if (doCheckoffHeader && itemInfo.SectionCheckOffHeader != "") - { - font = itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList[sindx].Font; - return itemInfo.SectionCheckOffHeader; - } - return null; - } - - private void DoCheckOffHeader(PdfContentByte cb, ItemInfo itemInfo, float yLocation, float yTopMargin, float yPageStart) - { - // CheckOffHeaders are handled in two different ways: - // 1) Where the pagelist item puts them - this is at the 'top' of the page, when the current section on the - // page has a checkoff header defined. Support for this is here AND in the VlnSvgPageHelper pagelist code. - // 2) If a continuous section, and it doesn't start at 'top' of the page, then the checkoff header is - // printed on the same line as the continuous section. Support for this is here, the check off header is added - // to the 'PartRight' off of the section's VlnParagraph. - - // First see if there is any checkoff data in the format file and that there - // is a pagelist item for the checkoff header. - if (itemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffList.Count <= 0) return; - if (MyPageHelper.PageListCheckOffHeader == null) return; - - VE_Font font = null; - ItemInfo mySectionInfo = itemInfo.MyActiveSection; - ItemInfo mySubSectionInfo = itemInfo; - - // If the passed in itemInfo is not a section, get it's parent section. This may be a subsection, so - // it will be found here, versus using 'MyActiveSection' which is the topmost section. The passed in - // item may be a regular step, i.e. if a page break had occurred. - if (!itemInfo.IsSection) - { - while (!mySubSectionInfo.IsSection) - { - mySubSectionInfo = mySubSectionInfo.MyParent; - } - } - else - mySubSectionInfo = (mySectionInfo.Sections == null)?null:mySectionInfo.Sections[0]; - - if (mySectionInfo == mySubSectionInfo) mySubSectionInfo = null; - - // The following duplicates the 16bit logic. The 16bit logic only put out a header if: - // there is no subsection and section has a header (from config); - // OR there is a subsection and the first subsection has a header. - // For locating the header in 16bit logic: - // If no subsections, output with section - // If subsections and continuous section, put out on same line as subsection. (done here) - // If subsections and starts at top of page, (on top of page, use pagelist code in VlnSvgPageHelper) - - // Get SectionInfos to access specific section config items... - SectionInfo si = SectionInfo.Get(mySectionInfo.ItemID); - int sindx = si.CheckOffHeadingIndex(); - SectionInfo subi = mySubSectionInfo == null ? null : SectionInfo.Get(mySubSectionInfo.ItemID); - int subindx = subi==null?-1:subi.CheckOffHeadingIndex(); - - // if there is no subsections & the main section doesn't use a header OR - // if there is a subsection, & it does not use a header... Return. - if ((subi==null&&sindx < 1) || (subi!=null&&subindx<1)) return; - - // figure out location now: - // if step, it uses pagelist logic to locate it (this is a page break condition). - // if continuous, put out with subsection if there is one, otherwise section. - // otherwise, use pagelist logic. - bool usePageListCOHdr = false; - - if (itemInfo.IsStep) - usePageListCOHdr = true; - else if (subi == null) //no subsection - { - if ((yPageStart - YOffset) == yTopMargin) usePageListCOHdr = true; - } - else - { - if (mySectionInfo == itemInfo && ((yPageStart - YOffset) == yTopMargin)) usePageListCOHdr = true; - if (!usePageListCOHdr && mySubSectionInfo != itemInfo) return; - } - - // grab the string from the format, depending on whether it should get it from the section or subsection. - string cohead = (mySubSectionInfo!=null)?mySubSectionInfo.SectionCheckOffHeader:mySectionInfo.SectionCheckOffHeader; - if (cohead == "" || cohead == null) return; - - // PageListCheckOffHeader is an svgtext - but really we only need the x/y location for this (pagelist support) - // The actual text is from the checkoff header selection in the section config. - if (cohead != MyPageHelper.PageListLastCheckOffHeader) - { - font = mySectionInfo.ActiveFormat.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList[sindx].Font; - float chkOffY = CalculateYLocation(YTopMost, yTopMargin); - if (MyPageHelper.YMultiplier != 1) - { - chkOffY = -1 + yTopMargin - (yTopMargin - yLocation) * MyPageHelper.YMultiplier; - if (Rtf != null) - IParagraph.Leading = _SevenLinesPerInch; - } - if (!usePageListCOHdr) - { - vlnText myCOHead = new vlnText(cb, this, cohead, cohead, MyPageHelper.PageListCheckOffHeader.X.Value + (float)MyItemInfo.MyDocStyle.Layout.LeftMargin, chkOffY, font); - PartsRight.Add(myCOHead); - } - else - MyPageHelper.PageListTopCheckOffHeader = cohead; - MyPageHelper.PageListLastCheckOffHeader = cohead; - } - } - internal vlnParagraph BottomChild - { - get - { - float bottomChildYBottomText = YBottomText; - vlnParagraph bottomChild = this; - foreach (vlnParagraph child in ChildrenRight) - { - vlnParagraph grandChild = child.BottomChild; - if (grandChild != null && grandChild.YBottomText > bottomChildYBottomText) bottomChild = grandChild; - if (grandChild != null && grandChild.YBottomText == bottomChildYBottomText && grandChild.MyItemInfo.HasChangeBar) bottomChild = grandChild; - bottomChildYBottomText = bottomChild.YBottomText; - } - foreach (vlnParagraph child in ChildrenBelow) - { - vlnParagraph grandChild = child.BottomChild; - if (grandChild != null && grandChild.YBottomText > bottomChildYBottomText) bottomChild = grandChild; - if (grandChild != null && grandChild.YBottomText == bottomChildYBottomText && grandChild.MyItemInfo.HasChangeBar) bottomChild = grandChild; - bottomChildYBottomText = bottomChild.YBottomText; - } - return bottomChild; - } - } - private void CalculateXOffset(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo) - { - bool aerTableOrFigure = itemInfo.FormatStepData.Type.Contains("AER"); - vlnParagraph hls1 = MyParent; - while (hls1.MyParent != null && !hls1.MyItemInfo.IsHigh) hls1 = hls1.MyParent; - float colR = float.Parse(formatInfo.MyStepSectionLayoutData.ColRTable.Split(",".ToCharArray())[itemInfo.ColumnMode]); - float xLowerLimit = hls1.XOffset; - float xUpperLimit = hls1.XOffset + hls1.Width + colR * itemInfo.ColumnMode; - float TableCenterPos = float.Parse(formatInfo.MyStepSectionLayoutData.TableCenterPos.Split(",".ToCharArray())[itemInfo.ColumnMode]); - if (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel) - { - float pageWidth = ((float)itemInfo.MyActiveSection.MyDocStyle.Layout.PageWidth); //* (float)MyItemInfo.FormatStepData.Font.CPI / 12; - float leftMargin = ((float)itemInfo.MyActiveSection.MyDocStyle.Layout.LeftMargin); //* (float)MyItemInfo.FormatStepData.Font.CPI / 12; - XOffset = leftMargin + (pageWidth - leftMargin - Width) / 2; - } - else - { - // Determine center of hls - XOffset = hls1.XOffset + hls1.Width / 2; - // Determine left edge of the table by subtracting 1/2 of its width. - XOffset -= Width / 2; - if (aerTableOrFigure || itemInfo.RNOLevel != 0) // AER or RNO - XOffset = MyParent.XOffset + MyParent.Width / 2 - Width / 2; - else if (TableCenterPos != 0) - XOffset = TableCenterPos; - else // Centered Table or Figure - { - // Add in 1/2 of the width of all RNO columns - XOffset += (colR * itemInfo.ColumnMode) / 2; - if (!aerTableOrFigure) - { - // 05/14/12 - 16bit code adjusts the center depending upon the CPI of the table font. - // Start with XOffset of table, then calculate the XOffset adjusted for the table font, - // based on the default CPI of 12. Adjust the XOffset by the difference of these - // two numbers. - XOffset -= (XOffset - (XOffset * (float)MyItemInfo.FormatStepData.Font.CPI / 12)); - } - XOffset -= 12; // This makes the 16bit & 32bit align very closely. - } - // 05/14/12 - The PosAdjust is a format flag from 16bit. For WCN2, it appears that this amount equals - // the amount of difference from a 10 CPI to a 12 CPI font. See comment above. - if (itemInfo.FormatStepData != null && itemInfo.FormatStepData.StepPrintData != null) - XOffset += (float)(itemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); - } - - - // if the XOffset < High Level Step Text's XOffset, then align with the High Level Step Text - if (XOffset < xLowerLimit && Width < (xUpperLimit - xLowerLimit)) - XOffset = xLowerLimit; - - // if the right margin exceeds the right edge of the rightmost RNO, then adjust right edge to match. - if (XOffset + Width > xUpperLimit) - XOffset = xUpperLimit - Width; - - // because of the above, if it pushes beyond the left margin, use the left margin. - if (XOffset < (float)itemInfo.MyDocStyle.Layout.LeftMargin) - XOffset = XOffsetBox = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - } - private float AdjustForBlankLines() - { - if (MyItemInfo.MyDocStyle.SpecialStepsFoldout) return 0; - int everyNLines = MyItemInfo.FormatStepData == null ? 1 : MyItemInfo.FormatStepData.StepLayoutData.EveryNLines ?? 1; - if (MyItemInfo.Ordinal % everyNLines == 0 || MyItemInfo.NextItem == null) return SixLinesPerInch; - return 0; - } - private void AddMacros(ItemInfo itemInfo, vlnTab mytab) - { - float y = YOffset; - float x = mytab == null ? XOffset : mytab.XOffset + mytab.TabOffset; - List myMacros = itemInfo.MyMacros; - if (myMacros != null) - { - foreach (Macro myMacro in myMacros) - { - PartsLeft.Add(new vlnMacro(x, y, myMacro.MacroDef)); - } - } - } - // HLP Change bar flags in format file: - // Locations: With Text, Outside Box, AER on Left RNO on Right, To The Left of Text - // Text: Date & Change ID, Revision Number, Change ID, None, Custom (use input data) - // Flag AERChgBarMsgRNOChgBarNoMsg and AERMsgRNONoMsg are NOT Used in 16-bit. - private string cbMess = null; - private vlnChangeBar DoChangeBar(PdfContentByte cb, ItemInfo itemInfo, VlnSvgPageHelper myPageHelper, float xoff, float yoff, int maxRNO, FormatInfo formatInfo) //, vlnChangeBar myCB) - { - // find column for the change bar based on format flags - this is code from 16-bit - // if AbsoluteFixedChangeColumn - // if FixedAERChangeColumn - // if col>ColsS+ColR+COL_WID+ADJ - // FixedChangeColumn - // else - // AERLeftChangeBarLocation() - // else - // FixedChangeColumn - // else - // ChangeBarLocation() - ChangeBarData cbd = formatInfo.PlantFormat.FormatData.ProcData.ChangeBarData; - float cols = formatInfo.MyStepSectionLayoutData.ColS ?? 0; - float colr = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO); -// FixedChangeColumn + - Column location for change bars - // 0 - Separate AER and RNO change bars to the right of the text - // -10 to -1 - Change bars on left (specify # of columns from the text) - // <-10 - AER change bars on the left and RNO change bars on the right. -// FixedAERChangeColumn overrides the -5 default setting in chgbar.c, value is converted to a negative by the code - - float col = (cbd.AbsoluteFixedChangeColumn) ? - ((cbd.FixedAERChangeColumn ?? 0) > 0) ? - (xoff > (cols + colr + COL_WID_ADJ)) ? - cbd.FixedChangeColumn ?? 0 : AERLeftChangeBarLocation(formatInfo) : - cbd.FixedChangeColumn ?? 0 : ChangeBarLocation(xoff, this, formatInfo, maxRNO); - - if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.ChgID) - cbMess = itemInfo.MyContent.UserID; - else if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.DateChgID) - { - string fmtDate = itemInfo.MyContent.DTS.ToShortDateString(); - if (fmtDate.Length != 10) // need to add zeros - { - if (fmtDate.IndexOf("/") == 1) - fmtDate = "0" + fmtDate; - if (fmtDate.IndexOf("/", 3) == 1) - fmtDate = fmtDate.Substring(0, 3) + "0" + fmtDate.Substring(3, fmtDate.Length - 3); - } - cbMess = itemInfo.MyContent.UserID + @"\n" + fmtDate; - } - else if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.RevNum) - cbMess = myPageHelper.Rev; - else if (myPageHelper.ChangeBarDefinition.MyChangeBarText == PrintChangeBarText.UserDef) - cbMess = myPageHelper.ChangeBarDefinition.MyChangeBarMessage; - - int msgAlign = Element.ALIGN_LEFT; - if (myPageHelper.ChangeBarDefinition.MyChangeBarLoc == PrintChangeBarLoc.LeftOfText || - (myPageHelper.ChangeBarDefinition.MyChangeBarLoc == PrintChangeBarLoc.AERleftRNOright && - !itemInfo.IsInRNO)) msgAlign = Element.ALIGN_RIGHT; - return new vlnChangeBar(cb, this, (float)itemInfo.MyDocStyle.Layout.LeftMargin + (col * itemInfo.FormatStepData.Font.CharsToTwips), yoff, msgAlign); - } - - private int ChangeBarLocation(float c, vlnParagraph paragraph, FormatInfo formatInfo, int maxRNO) - { - int fixedChgCol = formatInfo.PlantFormat.FormatData.ProcData.ChangeBarData.FixedChangeColumn ?? 0; - float cols = formatInfo.MyStepSectionLayoutData.ColS ?? 0; - int colr = ToInt(formatInfo.MyStepSectionLayoutData.ColRTable, maxRNO); - float tmpc = c; - if (MyItemInfo.IsCaution || MyItemInfo.IsNote) - { - // Temporary fix for change bars on Notes and Cautions where the FixedChgCol < -10 - tmpc = (float)formatInfo.MyStepSectionLayoutData.ColT + (float)formatInfo.MyStepSectionLayoutData.WidT; // end position of Caution / Note - int typ = (int)(MyItemInfo.MyContent.Type % 10000); - int? bxIndx = formatInfo.PlantFormat.FormatData.StepDataList[typ].StepLayoutData.STBoxindex; - if (bxIndx != null) - { - Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - if (bx != null) - tmpc = (float)bx.Start + (float)bx.End; // end position of a boxed Caution / Note - } - } - // if this is a caution or note, put the change bar to the right of the text: - //if ((paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote) && fixedChgCol < -10) return -fixedChgCol; - if ((fixedChgCol == 0))// && paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote) - //if ((fixedChgCol==0) || paragraph.MyItemInfo.IsCaution || paragraph.MyItemInfo.IsNote) - { - float rightEdge = (paragraph.XOffset + paragraph.Width + 5); - rightEdge-=(float)paragraph.MyItemInfo.MyDocStyle.Layout.LeftMargin; - rightEdge = rightEdge/paragraph.MyItemInfo.FormatStepData.Font.CharsToTwips; - return (int)rightEdge; - } - if (fixedChgCol < -10 || fixedChgCol >= 0) - return ((fixedChgCol > 0) ? fixedChgCol : - (fixedChgCol == 0) ? (int)c + 1 : - (tmpc > (cols + colr + COL_WID_ADJ)) ? -fixedChgCol : - //(c > (cols + colr + COL_WID_ADJ) || (MyItemInfo.IsCaution || MyItemInfo.IsNote)) ? -fixedChgCol : - AERLeftChangeBarLocation(formatInfo)); - else - return (int)(fixedChgCol + (((c < cols + Width + colr) || TableTest() - || MyItemInfo.IsCaution || MyItemInfo.IsNote) ? 0 : cols + colr)); // || (GetColumnMode() == 0)) ? 0 : cols + colr)); - /* Change bars to left of text -- ColS+WidS+ColR is the end of RNO col*/ - } - /* - ** Centered tables whose width exceeds the end of the RNO column should - ** still have their change bars printed on the left. This procedure checks - ** to make sure the step is a table and that it is not an RNO. - */ - private bool TableTest() - { - return false; - //return ((s->Type == TABLE || s->Type == BORDERLESSTABLE) && - //!(strchr((char *)&s->dbseq[2],RNO_MARKER))); - } - private float GetBottomYoff(float bottomY) - { - foreach (vlnParagraph child in ChildrenBelow) - { - if (child.YOffset > bottomY) bottomY = child.YOffset; - bottomY = child.GetBottomYoff(bottomY); - } - return bottomY; - } - private int AERLeftChangeBarLocation(FormatInfo formatInfo) - { - // use -5 default unless it is format specified - int fixedAERChgCol = formatInfo.PlantFormat.FormatData.ProcData.ChangeBarData.FixedAERChangeColumn ?? 0; - return (fixedAERChgCol != 0) ? - (fixedAERChgCol > 100) ? - (fixedAERChgCol % 100) : -fixedAERChgCol : -5; - } - private StringBuilder _RtfSB = null; - - // return rtf and use for tab and other text - public string GetRtf(ItemInfo itemInfo) - { - _RtfSB = new StringBuilder(); - DisplayText vlntxt = new DisplayText(itemInfo, E_EditPrintMode.Print, E_ViewMode.View, true, E_FieldToEdit.StepText, false); - System.Drawing.Font myFont = vlntxt.TextFont.WindowsFont; - if (!itemInfo.IsTable && StepRTB.MyFontFamily != null) - myFont = new System.Drawing.Font(StepRTB.MyFontFamily, myFont.Size, myFont.Style); - if (itemInfo.IsHigh && itemInfo.MyDocStyle.UndSpecialStepsFoldout) myFont = new System.Drawing.Font(myFont.FontFamily, myFont.Size, myFont.Style | FontStyle.Underline); - _RtfSB.Append(AddFontTable(myFont)); - _RtfSB.Append(vlntxt.StartText); - _RtfSB.Append("}"); - return _RtfSB.ToString(); - } - private float _XOffsetBox = 0; - public float XOffsetBox - { - get { return _XOffsetBox; } - set { _XOffsetBox = value; } - } - private float SetHeader(vlnParagraph para, PdfContentByte cb, ItemInfo itemInfo, FormatInfo formatInfo) - { - float xoff = (float)itemInfo.MyDocStyle.Layout.LeftMargin; - // The '6' below is really converting from characters to Twips. But instead of considering the CPI, 16bit assumed - // it was 12 to center the header. That's where the 6 comes from. - float hdrWidth = (itemInfo.MyHeader.CleanText == null) ? 0 : itemInfo.MyHeader.CleanText.Length * 6; - int typ = ((int)itemInfo.MyContent.Type) % 10000; - int? bxIndx = formatInfo.PlantFormat.FormatData.StepDataList[typ].StepLayoutData.STBoxindex; - - if (itemInfo.MyHeader.Justify == System.Drawing.ContentAlignment.MiddleCenter) - { - if (bxIndx != null) - { - Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - if (bx.TabPos > 0) - xoff += (float)bx.TabPos; // xoff starts as left margin - else - xoff += (float)((bx.TxtStart + XOffsetBox + (bx.TxtWidth / 2)) - (hdrWidth / 2)); // xoff starts as left margin - } - else if (formatInfo.MyStepSectionLayoutData.Separator.Location > 0) - xoff = XOffset + AdjustToCharPosition((float)((para.Width - hdrWidth) / formatInfo.MyStepSectionLayoutData.Separator.Location), itemInfo.MyHeader.MyFont.CPI); - else - xoff = XOffset + (para.Width / 2) + (hdrWidth / 2); // XOffset has left margin included - } - else - xoff = XOffset; // XOffset has left margin included - vlnHeader myHeader = new vlnHeader(this, cb, itemInfo.MyHeader.Text, itemInfo.MyHeader.CleanText.TrimStart(" ".ToCharArray()), xoff, YOffset, itemInfo.MyHeader.MyFont); - PartsAbove.Add(myHeader); - return myHeader.Height + (!MyItemInfo.MyDocStyle.SpecialStepsFoldout ? SixLinesPerInch : 0); - } - private float AdjustToCharPosition(float position, float? CPI) - { - int iPosition = (int)position; - int charsToTwips = (int)(72 / (CPI ?? 12)); - iPosition = (iPosition / charsToTwips) * charsToTwips; - position = (position / 7.2F) * 7.2F; - return (float)iPosition; - } - private bool _SectionPageBreak = false; - public bool SectionPageBreak - { - get { return _SectionPageBreak; } - set { _SectionPageBreak = value; } - } - private bool _Processed = false; - public bool Processed - { - get { return _Processed; } - set { _Processed = value; } - } - private vlnParagraph _LastRNO; - public vlnParagraph LastRNO - { - get { return _LastRNO; } - set { _LastRNO = value; } - } - private vlnParagraph _MyTopRNO; - public vlnParagraph MyTopRNO - { - get { return _MyTopRNO; } - set { _MyTopRNO = value; } - } - private static string _Prefix = ""; - public static string Prefix - { - get { return vlnParagraph._Prefix; } - set { vlnParagraph._Prefix = value; } - } - protected float _YBottomMost; // Bottom of the paragraph including the children - public float YBottomMost - { - get { return _YBottomMost; } - set { _YBottomMost = value; } - } - protected float _YTopMost; // Top of the paragraph including the children - public float YTopMost - { - get { return _YTopMost; } - set { _YTopMost = value; } - } - protected float _YTop; // Top of the paragraph including parts - public float YTop - { - get { return _YTop; } - set - { - vlnParagraph vp = this as vlnParagraph; - _YTop = value; - - } - } - public float YSize // How big this paragraph is with all of its children - { - get { return _YBottomMost - _YTopMost; } - } - private ItemInfo _MyItemInfo; - public ItemInfo MyItemInfo - { - get { return _MyItemInfo; } - set { _MyItemInfo = value; } - } - private vlnParagraph _MyHighLevelParagraph; - - public vlnParagraph MyHighLevelParagraph - { - get - { - if (_MyHighLevelParagraph == null) - { - _MyHighLevelParagraph = GetHighLevelParagraph(); - } - return _MyHighLevelParagraph; - } - } - private vlnParagraph GetHighLevelParagraph() - { - if (MyItemInfo.IsHigh) return this; - return MyParent.GetHighLevelParagraph(); - } - // Tab, Separator, ChangeBar, Box, Circle, Checkoff - private vlnPrintObjects _PartsAbove; - public vlnPrintObjects PartsAbove - { - get - { - if (_PartsAbove == null) _PartsAbove = new vlnPrintObjects(); - return _PartsAbove; - } - } - private vlnPrintObjects _PartsBelow; - public vlnPrintObjects PartsBelow - { - get - { - if (_PartsBelow == null) _PartsBelow = new vlnPrintObjects(); - return _PartsBelow; - } - } - private vlnPrintObjects _PartsRight; - public vlnPrintObjects PartsRight - { - get - { - if (_PartsRight == null) _PartsRight = new vlnPrintObjects(); - return _PartsRight; - } - } - private vlnPrintObjects _PartsLeft; - public vlnPrintObjects PartsLeft - { - get - { - if (_PartsLeft == null) _PartsLeft = new vlnPrintObjects(); - return _PartsLeft; - } - } - private vlnPrintObjects _PartsContainer; - public vlnPrintObjects PartsContainer - { - get - { - if (_PartsContainer == null) _PartsContainer = new vlnPrintObjects(); - return _PartsContainer; - } - } - private vlnParagraphs _ChildrenAbove; - public vlnParagraphs ChildrenAbove - { - get - { - if (_ChildrenAbove == null) _ChildrenAbove = new vlnParagraphs(this); - return _ChildrenAbove; - } - } - private vlnParagraphs _ChildrenBelow; - public vlnParagraphs ChildrenBelow - { - get - { - if (_ChildrenBelow == null) _ChildrenBelow = new vlnParagraphs(this); - return _ChildrenBelow; - } - } - private vlnParagraphs _ChildrenRight; - public vlnParagraphs ChildrenRight - { - get - { - if (_ChildrenRight == null) _ChildrenRight = new vlnParagraphs(this); - return _ChildrenRight; - } - } - private vlnParagraphs _ChildrenLeft; - public vlnParagraphs ChildrenLeft - { - get - { - if (_ChildrenLeft == null) _ChildrenLeft = new vlnParagraphs(this); - return _ChildrenLeft; - } - } - public void AdjustXOffsetForTab(ItemInfo itemInfo, int maxRNO, FormatInfo formatInfo, vlnTab myTab) - { - float tabWidth = (myTab == null) ? 0 : myTab.Width; - if (itemInfo.IsStepSection) - { - if (formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Just == "PSLeft") - { - int level = 0; - ItemInfo iilvl = itemInfo; - while (!iilvl.IsProcedure) - { - level++; - iilvl = iilvl.MyParent; - } - level = level <= 2 ? 1 : level - 1; - if (level==1) - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (level * (float)formatInfo.PlantFormat.FormatData.SectData.SectionHeader.Pos); - else - XOffset = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[level].ColSByLevel; - } - return; - } - int typ = ((int)itemInfo.MyContent.Type) % 10000; - int? bxIndx = formatInfo.PlantFormat.FormatData.StepDataList[typ].StepLayoutData.STBoxindex; - float? colOvrd = formatInfo.PlantFormat.FormatData.StepDataList[typ].ColOverride; - if (bxIndx != null) - { - Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - if (bx == null) - { - if ((colOvrd??0)!=0) - { - // 16-bit code subtracted the left margin - //xoff = ((float)colOvrd - (float)itemInfo.MyDocStyle.Layout.LeftMargin) - XOffset; - //XOffset += xoff; - //if (myTab != null) myTab.XOffset += xoff; - //xoff = MyParent.XOffset - myTab.XOffset; - //XOffset += xoff; - float tabOffset = (myTab == null?0: myTab.XOffset) - XOffset; - - XOffset = (float)colOvrd; - if (myTab != null) myTab.XOffset = XOffset + tabOffset; - return; - } - else - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + tabWidth + XOffsetBox; - } - else - XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)bx.TxtStart + tabWidth + XOffsetBox; - if (myTab != null) myTab.XOffset = XOffset - tabWidth; - } - else if (itemInfo.IsHigh) - { - float x = 0; - float xoff = 0; - if ((colOvrd??0)!=0) - x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)colOvrd; - else - x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS; - - xoff = x - XOffset; - // ColSByLevel will specify the column in which the High Level Step starts with - // respect to the overall level calculation based on sections & meta-sections. - // Only a few of the single column formats use this: WCN1, CAL1, RGEBCK - if (formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TieTabToLevel - && !(itemInfo.MyDocStyle.SpecialStepsFoldout && itemInfo.MyDocStyle.UseColSByLevel)) - { - int indxLevel = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel(); - float colsbylevel = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel; - float seclvlindent = colsbylevel - (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS; - x = (float)itemInfo.MyDocStyle.Layout.LeftMargin + (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS + seclvlindent; - xoff = x - XOffset; - if (myTab != null) myTab.XOffset = (float)itemInfo.MyDocStyle.Layout.LeftMargin + colsbylevel; - LeftJustifyList jstlst = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.LeftJustifyList; - if (jstlst.Count > 0) - { - float leftJustifyTabSize = jstlst[indxLevel % jstlst.Count].Size ?? 0; - XOffset = myTab.XOffset + leftJustifyTabSize; - } - else - XOffset = myTab.XOffset + (myTab.Text.Length * (float)itemInfo.FormatStepData.Font.CPI) - colsbylevel; - } - else - { - XOffset += xoff; - if (myTab != null) - { - myTab.XOffset += xoff; - if (myTab.MyMacro != null) myTab.MyMacro.XOffset += xoff; - } - } - } - else if (itemInfo.IsRNOPart && !((ItemInfo)itemInfo.ActiveParent).IsHigh) - { - // don't adjust for rno - } - else if (MyParent != null) - { - if (myTab != null && itemInfo.IsSequential && formatInfo.PlantFormat.FormatData.SectData.UseMetaSections && formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.LeftJustifyList.Count > 0) - { - int indxLevels = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel(); // kbr -1; - LeftJustifyList jstlst = formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionPrintData.LeftJustifyList; - float tableftadj = 0; - foreach (LeftJustify lj in jstlst) - { - if (lj.Index == indxLevels) - { - tableftadj = lj.Size ?? 0; - break; - } - } - // the order of this is important. First adjust the tab's xoffset for the width of - // the tab. The offset of text needs to be adjusted by the 'leftjustify' format variable - // if it existed for this level. - myTab.XOffset += tabWidth; - if (tableftadj != 0 && myTab.Width0) - widOvrd = xwid; - else - widOvrd = itemInfo.FormatStepData == null ? null : itemInfo.FormatStepData.WidthOverride; - if ((widOvrd??0) != 0) - { - Width = (float)widOvrd; - // if there's a box, we may need to do an adjustment on the width, if the tab data was changed - // so don't return. - if (bxIndx == null) return; - } - float tabWidth = (myTab == null) ? 0 : myTab.Width; - if (bxIndx != null) - { - Box bx = formatInfo.PlantFormat.FormatData.BoxList[(int)bxIndx]; - if (bx == null) - { - // NOT SURE IF WE NEED TO TEST FOR THE NULLBOX FORMAT FLAG, MAYBE "bx == null" IS THE SAME THING - //if (formatInfo.MyStepSectionLayoutData.NullBox) - Width = (float)formatInfo.MyStepSectionLayoutData.WidT - tabWidth; - } - else - Width = _WidthAdjustBox + (float)bx.TxtWidth - tabWidth; // add 1 to get it to wrap like 16Bit - } - else if (itemInfo.IsHigh) - { - float CheckOffAdj = 0; - if (itemInfo.MyDocStyle.UseCheckOffs) - { - if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffAdjustment != null) - CheckOffAdj = -(float)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffAdjustment; - if (!HasCheckOffHeading(itemInfo, formatInfo) && CheckOffAdj < 0) - CheckOffAdj += (float)(9 * 7.2); // 9 is the size of the SIGNOFF adjustment - } - float adjwidth = CheckOffAdj; - SectData sd = formatInfo.PlantFormat.FormatData.SectData; - if (sd.UseMetaSections) - { - if (sd.StepSectionData.StepSectionLayoutData.TieTabToLevel) - { - if (itemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ShowSectionTitles - && !itemInfo.MyDocStyle.CancelSectTitle - && !(itemInfo.MyDocStyle.SpecialStepsFoldout && itemInfo.MyDocStyle.UseColSByLevel)) - { - int indxLevel = itemInfo.PrintLevel + itemInfo.CurrentSectionLevel(); - adjwidth += formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].WidSAdjByLevel ?? 0; ; - float colsbylevel = (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[indxLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel; - float seclvlindent = colsbylevel - (float)formatInfo.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.ColS; - adjwidth -= seclvlindent; - adjwidth -= AdjustForSectionLevelTab(); - } - } - else - { - if (formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count > 0) - adjwidth += (float)formatInfo.PlantFormat.FormatData.SectData.MetaSectionList[itemInfo.PrintLevel % formatInfo.PlantFormat.FormatData.SectData.MetaSectionList.Count].ColSByLevel; - } - } - - Width = ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); - Width += _WidthAdjust; - Width += adjwidth; - } - else if (itemInfo.IsCaution || itemInfo.IsNote) - { - float mycolT = (float)formatInfo.MyStepSectionLayoutData.ColT; - Width = (float)formatInfo.MyStepSectionLayoutData.WidT - 6 - mycolT; - XOffset += mycolT; // adjust caution/note text position - if (PartsLeft != null)// adjust tab position - foreach(vlnPrintObject vpo in PartsLeft) - vpo.XOffset += mycolT; - } - else if (itemInfo.IsSection) - { - Width = _WidthAdjust + ToInt(formatInfo.MyStepSectionLayoutData.WidSTablePrint, maxRNO); - } - else if (MyParent == null) - { - // 72 points / inch - 7 inches (about width of page) - Width = 72 * 7; - } - else if (itemInfo.IsRNOPart && !((ItemInfo)itemInfo.ActiveParent).IsHigh) - { - Width = MyParent.Width; - } - else if (itemInfo.IsTablePart) - { - Width = 72 * 7; // TODO: Need to determine the Width of the Table based upon the contents - } - else if (itemInfo.MyParent.IsCaution || itemInfo.MyParent.IsNote) - { - Width = MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign); - Width -= 72 * (itemInfo.FormatStepData.CautionOrNoteSubstepIndent == null ? 0 : (float)itemInfo.FormatStepData.CautionOrNoteSubstepIndent / (float)itemInfo.FormatStepData.Font.CPI); - } - else - { - float adjwidth = 0; - Width = adjwidth + MyParent.Width - tabWidth + (myTab == null ? 0 : myTab.TabAlign); - } - } - private float GetWidthFromTemplate(ItemInfo itemInfo, FormatInfo formatInfo) - { - float rtnwid = 0; - int tpIndx = GetSmartTemplateIndex(itemInfo, itemInfo.MyContent.Type, formatInfo); - if (tpIndx != -1) - { - int ncol = formatInfo.PlantFormat.FormatData.Templates[tpIndx].width; - // now convert to the units for this format. The template width data is in number of columns. - rtnwid = ncol * itemInfo.FormatStepData.Font.CharsToTwips; - } - return rtnwid; - } - private int GetSmartTemplateIndex(ItemInfo itemInfo, int? type, FormatInfo formatInfo) - { - int indx = 0; - // find the starting template in the list for the high level step type: - int highType = (int)itemInfo.MyHLS.MyContent.Type-20001; - while (indx < formatInfo.PlantFormat.FormatData.Templates.Count) - { - // level of 0 starts a new group. - if (formatInfo.PlantFormat.FormatData.Templates[indx].level == 0) - { - indx++; - // now see if we're on the high level step type, if so, look under this one - // for the step type that we're on. If found return the index of it. - if (formatInfo.PlantFormat.FormatData.Templates[indx].type == highType) - { - indx++; - while (indx < formatInfo.PlantFormat.FormatData.Templates.Count && formatInfo.PlantFormat.FormatData.Templates[indx].level != 0) - { - if (formatInfo.PlantFormat.FormatData.Templates[indx].type == type - 20001) - return indx; - indx++; - } - } - } - else - indx++; - } - return -1; // didn't find this step type in the template width override list. - } - - private float AdjustForSectionLevelTab() - { - string sectTab = MyItemInfo.ActiveSection.MyTab.CleanText.TrimEnd(); - if (sectTab.EndsWith(".0")) return 0; - string myTab = MyItemInfo.MyTab.CleanText; - // -1 below code, +1 for '.' and -2 for standard wid of tab - // standard wid of this tab is 2 (ex: '1.') - // so adjust width if longer than normal - return (float)(sectTab.Length - 1) * 72/(float)MyItemInfo.FormatStepData.Font.CPI; - } - private bool HasCheckOffHeading(ItemInfo itemInfo, FormatInfo formatInfo) - { - if (formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.CheckOffHeaderList.Count != 0) - { - // does this section have a check off heading? - SectionConfig sc = itemInfo.MyActiveSection.MyConfig as SectionConfig; - if (sc != null && sc.Section_CheckoffHeaderSelection > 0) return true; - } - return false; - } - private bool UseCheckOffsDocStyle(int oldToNew, FormatInfo formatInfo) - { - int bit, retval=0; - int mask=1; - - for(bit=0; bit < 32; bit++){ - if ((oldToNew & mask) != 0 && ((int)formatInfo.PlantFormat.FormatData.ProcData.CheckOffData.UseCheckOffsIn & mask) !=0) retval = 1; - mask <<= 1; - } - return retval > 0; - } - } - - /// - /// First order by stepLevel, then within a stepLevel, order by descending yLocation on page. - /// Want to find maximum y value that fits on page, i.e. put the most on page that can - /// fit which is defined by the largest yLocation - /// - public class StepLevelList : SortedDictionary> - { - public StepLevelList() : base() - { - } - public void Add(int stepLevel, float yLocation, vlnParagraph para) - { - if (stepLevel == 0) return; - if (!this.ContainsKey(stepLevel)) - this.Add(stepLevel, new SortedDictionary()); - // using a negative for yLocation so that its in descending order: - if (!this[stepLevel].ContainsKey(-yLocation)) - this[stepLevel].Add(-yLocation, para); - } - } - public class ParagraphLocations : List - { - public ParagraphLocations() - : base() - { - } - public void Add(vlnParagraph myParagraph, float yTopMost) - { - ParagraphLocation foundOverlap = FindOverlap(myParagraph); - if (foundOverlap == null) - { - this.Add(new ParagraphLocation(yTopMost,myParagraph)); - return; - } - ParagraphLocation doubleOverlap = FindOverlap(foundOverlap); - while (doubleOverlap != null) - { - doubleOverlap.Merge(foundOverlap); - this.Remove(foundOverlap); - foundOverlap = doubleOverlap; - doubleOverlap = FindOverlap(foundOverlap); - } - } - - private ParagraphLocation FindOverlap(vlnParagraph myParagraph) - { - foreach (ParagraphLocation paraLoc in this) - if (paraLoc.Overlap(myParagraph)) - return paraLoc; - return null; - } - private ParagraphLocation FindOverlap(ParagraphLocation myParaLoc) - { - foreach (ParagraphLocation paraLoc in this) - if (paraLoc != myParaLoc && paraLoc.Overlap(myParaLoc)) - return paraLoc; - return null; - } - internal StepLevelList BuildStepLevelList() - { - StepLevelList myList = new StepLevelList(); - foreach (ParagraphLocation paraLoc in this) - myList.Add(paraLoc.StepLevel, paraLoc.YTop, paraLoc.MyParagraph); - return myList; - } - } - public class ParagraphLocation - { - private float _YTop; - public float YTop - { - get { return _YTop; } - set { _YTop = value; } - } - private float _YBottom; - public float YBottom - { - get { return _YBottom; } - set { _YBottom = value; } - } - private int _StepLevel; - public int StepLevel - { - get { return _StepLevel; } - set { _StepLevel = value; } - } - private vlnParagraph _MyParagraph; - public vlnParagraph MyParagraph - { - get { return _MyParagraph; } - set { _MyParagraph = value; } - } - public ParagraphLocation(float yTopMost,vlnParagraph myParagraph) - { - MyParagraph =myParagraph; - YTop = myParagraph.YVeryTop - yTopMost; - YBottom = myParagraph.YBottom - yTopMost; - StepLevel = myParagraph.MyItemInfo.StepLevel; - } - public bool Overlap(vlnParagraph otherParagraph) - { - if (Between(otherParagraph.YTop, YTop, YBottom)) return true; - if (Between(otherParagraph.YBottom, YTop, YBottom)) return true; - if(Between(YTop,otherParagraph.YVeryTop,otherParagraph.YBottom)) return true; - if(Between(YBottom,otherParagraph.YVeryTop,otherParagraph.YBottom)) return true; - return false; - } - public static bool Between(float x, float lower, float higher) - { return x >= lower && x <= higher; } - public bool Overlap(ParagraphLocation otherParagraphLocation) - { - if (Between(otherParagraphLocation.YTop, YTop, YBottom)) return true; // The top is within the other - if (Between(otherParagraphLocation.YBottom, YTop, YBottom)) return true; // The bottom is within the other - if(Between(YTop,otherParagraphLocation.YTop,otherParagraphLocation.YBottom)) return true; // the other top is within this one - if(Between(YBottom,otherParagraphLocation.YTop,otherParagraphLocation.YBottom)) return true;// I believe this is unnecessary - return false; - } - public void Merge(vlnParagraph otherParagraph) - { - if (StepLevel < otherParagraph.MyItemInfo.StepLevel) MyParagraph = otherParagraph; - YTop = Math.Min(YTop, otherParagraph.YVeryTop); - YBottom = Math.Max(YBottom, otherParagraph.YBottom); - StepLevel = Math.Max(StepLevel, otherParagraph.MyItemInfo.StepLevel); - } - public void Merge(ParagraphLocation otherParagraphLocation) - { - if (StepLevel < otherParagraphLocation.StepLevel) MyParagraph = otherParagraphLocation.MyParagraph; - YTop = Math.Min(YTop, otherParagraphLocation.YTop); - YBottom = Math.Max(YBottom, otherParagraphLocation.YBottom); - StepLevel = Math.Max(StepLevel, otherParagraphLocation.StepLevel); - } - } -} diff --git a/PROMS/Volian.Print.Library/vlnPrintObject.cs.org b/PROMS/Volian.Print.Library/vlnPrintObject.cs.org deleted file mode 100644 index 5d0384d3..00000000 --- a/PROMS/Volian.Print.Library/vlnPrintObject.cs.org +++ /dev/null @@ -1,404 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using iTextSharp.text.pdf; -using iTextSharp.text; -using Itenso.Rtf; -using Itenso.Rtf.Parser; -using Itenso.Rtf.Interpreter; -using Itenso.Rtf.Support; -using Volian.Controls.Library; -using VEPROMS.CSLA.Library; - -namespace Volian.Print.Library -{ - public abstract partial class vlnPrintObject - { - // Used for debugging: - private static int _UniqueDebugId = 0; - public static int UniqueDebugId - { - get { return _UniqueDebugId++; } - set { _UniqueDebugId = value; } - } - private int _DebugId = UniqueDebugId; - public int DebugId - { - get { return _DebugId; } - set { _DebugId = value; } - } - - protected static float _WidthAdjust = 1; // 1 Point - adjusted to match 16-bit line wrapping. For editting it's 3. - protected static float _WidthAdjustBox = 6; - private static float _SixLinesPerInch = 12; // twips - public static float SixLinesPerInch - { - get { return vlnPrintObject._SixLinesPerInch; } - set { vlnPrintObject._SixLinesPerInch = value; } - } - protected static float _SevenLinesPerInch = 10.1F;//72F / 7F; - - protected float _XOffset; - public float XOffset - { - get { return _XOffset; } - set {_XOffset = value; } - } - protected float _YOffset; - public float YOffset - { - get { return _YOffset; } - set { _YOffset = value; } - } - - protected vlnParagraph _MyParent; - public vlnParagraph MyParent - { - get { return _MyParent; } - set - { - _MyParent = value; - if (_MyParent != null) - { - - } - } - } - private string _ImageText; // ro definition, value part of #Link in case of image/figure - public string ImageText - { - get { return _ImageText; } - set { _ImageText = value; } - } - private string _Rtf; // may become iTextSharp paragraph - public string Rtf - { - get { return _Rtf; } - set { _Rtf = value; } - } - iTextSharp.text.Paragraph _IParagraph; - public iTextSharp.text.Paragraph IParagraph - { - get - { - if (_IParagraph == null) - { - _IParagraph = RtfToParagraph(Rtf); - } - return _IParagraph; - } - set { _IParagraph = value; } - } - private float _Width; - public float Width - { - get { return _Width; } - set { _Width = value; } - } - protected float _Height; - public float Height - { - get - { - if (_Height == 0) - _Height = GetParagraphHeight(MyContentByte, IParagraph, Width); - return _Height; - } - set { _Height = value; } - } - public float GetParagraphHeight(PdfContentByte cb, Paragraph iParagraph, float width) - { - return GetParagraphHeight(cb, iParagraph, width, true); - } - public float GetParagraphHeight(PdfContentByte cb, Paragraph iParagraph, float width, bool throwException) - { - VlnSvgPageHelper ph = null; - if(cb != null) ph = cb.PdfWriter.PageEvent as VlnSvgPageHelper; - float heightAll = GetHeight(cb, iParagraph, width, throwException); - if (ph != null && ph.MyPromsPrinter.DebugOutput && !MyPageHelper.Back32BitPROMS) - { - vlnParagraph myParagraph = this as vlnParagraph; - if (myParagraph != null) - { - //if (myParagraph.MyItemInfo.FormatStepData != null && myParagraph.MyItemInfo.FormatStepData.Font.Family == "Prestige Elite Tall") - if (!myParagraph.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.WrapSameAsEdit) - { - Chunk chk = RemoveLastCharacter(iParagraph); - float heightAllButOne = GetHeight(cb, iParagraph, width, throwException); - if (heightAll != heightAllButOne) - return heightAllButOne; - if (chk != null) - RestoreLastCharacter(iParagraph, chk); - } - } - } - return heightAll; - } - private static void RestoreLastCharacter(Paragraph iParagraph, Chunk chk) - { - iParagraph.RemoveAt(iParagraph.Count - 1); - iParagraph.Add(chk); - } - private static Chunk RemoveLastCharacter(Paragraph iParagraph) - { - if (iParagraph.Count == 0) - return null; - object obj = iParagraph[iParagraph.Count-1]; - Chunk chk = obj as Chunk; - if (chk == null) - return null; - string s = chk.Content; - if (s.Length > 1 || iParagraph.Count > 1) // don't remove last character if it's the only one - { - iParagraph.RemoveAt(iParagraph.Count - 1); - if (s.Length > 0) - { - if (s == "\xA0") // If this is a space at the end put it back - { - iParagraph.Add(chk); - return null; - } - else - { - s = s.Substring(0, s.Length - 1); - iParagraph.Add(new Chunk(s, chk.Font)); - } - } - } - return chk; - } - private static float GetHeight(PdfContentByte cb, Paragraph iParagraph, float width, bool throwException) - { - ColumnText myColumnText = new ColumnText(cb); - myColumnText.SetSimpleColumn(0, 792F, width, 0); // Bottom margin - myColumnText.AddElement(iParagraph); - //myColumnText.UseAscender = true;// Adjusts to the top of the text box. - int status = myColumnText.Go(true); // Check to see if it will fit on the page. - if (ColumnText.HasMoreText(status) && throwException) - //throw (new Exception("Paragraph longer than a page")); - Console.WriteLine("Paragraph longer than a page"); - return 792F - myColumnText.YLine; // This gives the height of the Paragraph - } - public float GetTableWidth(PdfContentByte cb, Paragraph iParagraph, float? maxWidth) - { - int iWidth = (int)(maxWidth ?? 72 * 8.5F); - float h = GetParagraphHeight(cb, iParagraph, iWidth); - int iWidthMax = iWidth; // maximum width in Characters - int iDelta = iWidth / 2; - iWidth = iWidth / 2; - while (iDelta > 0) - { - float h2 = GetParagraphHeight(cb, iParagraph, iWidth,false); - iDelta = iDelta / 2; - if (h2 == h) iWidthMax = iWidth; - iWidth += (h2>h ? 1: -1) * iDelta; - } - return (float) iWidthMax; - } - private PdfContentByte _MyContentByte; - public PdfContentByte MyContentByte - { - get { return _MyContentByte; } - set { _MyContentByte = value; } - } - private VlnSvgPageHelper _MyPageHelper; - public VlnSvgPageHelper MyPageHelper - { - get - { - if(_MyPageHelper == null) - _MyPageHelper = MyContentByte.PdfWriter.PageEvent as VlnSvgPageHelper; - return _MyPageHelper; - } - set { _MyPageHelper = value; } - } - public vlnPrintObject() - { - } - /// - /// No conversion necessary: twips -> twips - /// - /// - /// - public static int ToInt(int value) - { - return value; - } - /// - /// No conversion necessary: int? twips -> int twips - /// - /// - /// - public static int ToInt(int? value) - { - return ToInt((int)value); - } - /// - /// No conversion necessary: string twips -> int twips - /// - /// - /// - public static int ToInt(string value) - { - return ToInt((int)Convert.ToSingle(value)); - } - /// - /// No conversion necessary: value from a list in a string, twips -> int twips - /// - /// - /// - public static int ToInt(string value, int i) - { - string s = (value.Contains(",")) ? value.Split(",".ToCharArray())[i] : value; - return ToInt(s); - } - public static string GetRtf(string text, VE_Font vFont) - { - StringBuilder rtfSB = new StringBuilder(); - //DisplayText vlntxt = new DisplayText(text.TrimStart(" ".ToCharArray()), vFont, false); - DisplayText vlntxt = new DisplayText(text, vFont, false); - //rtfSB.Append(AddFontTable(vlntxt.TextFont.WindowsFont)); - rtfSB.Append(AddFontTable(vFont.WindowsFont)); - rtfSB.Append(vlntxt.StartText); - rtfSB.Append("}"); - return rtfSB.ToString(); - } - public static string AddFontTable(System.Drawing.Font font) - { - StringBuilder rtfSB = new StringBuilder(); - StringBuilder sbbeg = new StringBuilder(); - StringBuilder sbend = new StringBuilder(); - if (font.Bold) - { - sbbeg.Append(@"\b"); - sbend.Append(@"\b0"); - } - if (font.Underline) - { - sbbeg.Append(@"\ul"); - sbend.Insert(0, @"\ulnone"); - } - if (font.Italic) - { - sbbeg.Append(@"\i"); - sbend.Insert(0, @"\i0"); - } - rtfSB.Append(@"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset2 " + font.FontFamily.Name + @";}"); //}\f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}}"; - if (!FontIsFixed(font)) - rtfSB.Append(@"{\f1\fnil\fcharset0 Arial Unicode MS;}}{\colortbl ;\red255\green0\blue0;}"); - else - rtfSB.Append(@"{\f1\fnil\fcharset0 VESymbFix;}}{\colortbl ;\red255\green0\blue0;}"); - rtfSB.Append("\r\n"); - // use styles to construct rtf commands to insert into next line (where \b, etc is) - rtfSB.Append(@"\viewkind4\uc1\pard\sl-240\slmult0" + sbbeg.ToString() + @"\fs" + Convert.ToInt32(font.SizeInPoints * 2).ToString() + @" "); // \f0\fs" + this.Font.SizeInPoints * 2 + @" " + myDisplayTextElement.Text + @"}"; - return rtfSB.ToString(); - } - private static bool FontIsFixed(System.Drawing.Font font) - { - iTextSharp.text.Font iFont = Volian.Svg.Library.VolianPdf.GetFont(font); - float fW = iFont.BaseFont.GetWidthPointKerned("W", 12); - float fE = iFont.BaseFont.GetWidthPointKerned("!", 12); - return fW == fE; - } - public static iTextSharp.text.Paragraph RtfToParagraph(string rtf) - { - IRtfDocument rtfDoc = RtfInterpreterTool.BuildDoc(rtf); - Rtf2iTextSharp rtf2IText = new Rtf2iTextSharp(rtfDoc); - iTextSharp.text.Paragraph para = rtf2IText.Convert(); - para.SetLeading(_SixLinesPerInch, 0); - if (rtf.Contains("\x05")) - { - // if there is a hanging indent, the iTextSharp paragraph properties must be set - // to print the indent. Replace the indent 'token' with a non-used symbol, this will - // create a chunk with that symbol. Then loop through all of the chunks until we find - // this symbol, adding up the widths to that point. This width is the value that - // needs to be used to set the indent. - // Notes: - // A hard return will reset the chkW (indent width) back to zero. - // We jump out of the processing loop after the first indent token is found and ignor any other ones - IRtfDocument rtfDoc2 = RtfInterpreterTool.BuildDoc(rtf.Replace("\x05", @"\f1 \u9999? \f0 ")); - Rtf2iTextSharp rtf2IText2 = new Rtf2iTextSharp(rtfDoc2); - iTextSharp.text.Paragraph para2 = rtf2IText2.Convert(); - float chkW = 0; - foreach (Chunk chk in para2.Chunks) - { - if (chk.Content[0] == 9999) break; - if (chk.Content.Contains("\n")) chkW = 0; //hard return - reset chkW (indent start) - chkW += chk.GetWidthPoint(); - } - para.IndentationLeft = chkW; - para.FirstLineIndent = -chkW; - } - return para; - } - public abstract float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin); - protected float CalculateYOffset(float yPageStart, float yTopMargin) - { - float yLocation = yPageStart - YOffset; - if (MyPageHelper.YMultiplier != 1) - { - yLocation = -1 + yTopMargin - (yTopMargin - yLocation) * MyPageHelper.YMultiplier; - if (Rtf != null) - IParagraph.Leading = _SevenLinesPerInch; - } - return yLocation; - } - protected float CalculateYLocation(float yLocation, float yTopMargin) - { - if (MyPageHelper.YMultiplier != 1) - yLocation = -1 + yTopMargin - (yTopMargin - yLocation) * MyPageHelper.YMultiplier; - return yLocation; - } - public void DebugPdf(PdfContentByte cb, float left, float top) - { - VlnSvgPageHelper _MyPageHelper = cb.PdfWriter.PageEvent as VlnSvgPageHelper; - PdfLayer debugLayer = _MyPageHelper == null ? null : _MyPageHelper.DebugLayer; - if (debugLayer == null) return; - cb.SaveState(); - cb.BeginLayer(debugLayer); - ColumnText ct = new ColumnText(cb); - ct.SetSimpleColumn(left, top, left+50, top - 50); - iTextSharp.text.Font font = FontFactory.GetFont("Arial", 2); - Chunk chk = new Chunk(DebugId.ToString(), font); - Phrase ph = new Phrase(chk); - ct.AddElement(ph); - cb.SetColorFill(new iTextSharp.text.Color(PrintOverride.OverrideDebugColor(System.Drawing.Color.Gray))); - ct.Go(); - cb.EndLayer(); - cb.RestoreState(); - } - public virtual float YBottom - { get { return YOffset + Height;} } - } - public partial class vlnPrintObjects : List - { - public float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin) - { - foreach (vlnPrintObject part in this) - { - yPageStart = part.ToPdf(cb, yPageStart, ref yTopMargin, ref yBottomMargin); - } - return yPageStart; - } - } - - public enum PartLocation : int - { - None = 0, // Non-printable - Below = 1, // RNO Separator - Above = 2, // Tab Headers, Separator? - Right = 3, // Change Bars - Left = 4, // Tabs, Checkoffs? (maybe part of tab) - Container = 5 // Box - }; - public enum ChildLocation : int - { - None = 0, - Below = 1, - Above = 2, - Right = 3, // RNO - Left = 4 - } - -} diff --git a/PROMS/Volian.Print.Library/vlnTab.cs.bak b/PROMS/Volian.Print.Library/vlnTab.cs.bak deleted file mode 100644 index a59ade88..00000000 --- a/PROMS/Volian.Print.Library/vlnTab.cs.bak +++ /dev/null @@ -1,282 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using iTextSharp.text.pdf; -using iTextSharp.text; -using VEPROMS.CSLA.Library; - -namespace Volian.Print.Library -{ - public partial class vlnTab : vlnText - { - /// - /// Used to Align Tabs for numeric tabs that can go to 2 digits - /// - private float? _TabAlign; - public float TabAlign // Offset to Last printable character - { - get - { - if (_TabAlign == null) - { - _TabAlign = 0; - if (Text != null) - { - while (_TabAlign < Text.Length && Text[(int)_TabAlign] == ' ') - _TabAlign++; - if (_TabAlign < Text.Length) - { - if ("0123456789".Contains(Text[(int)_TabAlign].ToString())) - { - while ("0123456789".Contains(Text[(int)_TabAlign].ToString())) - _TabAlign++; - _TabAlign--; - } - } - else - _TabAlign = 0; - } - } - return (float)_TabAlign * MyFont.CharsToTwips; - } - } - private float? _TabOffset; - public float TabOffset // Offset to first printable character - { - get - { - if (_TabOffset == null) - { - _TabOffset = 0; - if (Text != null) - { - while (_TabOffset= Text.Length) _TabOffset = 0; - return (float)_TabOffset * MyFont.CharsToTwips; - } - } - private vlnMacro _MyMacro; - public vlnMacro MyMacro - { - get { return _MyMacro; } - set { _MyMacro = value; } - } - - private string symblsStr = "\u25CF\u0394"; // string of possible symbol character in a tab - // add symbol characters as needed - // "\u25CF" - solid bullet - // \x0394 - delta - - private System.Drawing.FontStyle GetSysFontStyle(VE_Font f) - { - if (f.Style == E_Style.Italics) - return System.Drawing.FontStyle.Italic; - return FontStyle.Regular; - } - private float GetTextWidth(VE_Font vefont, string txt, string symblFontName) - { - System.Drawing.Font font = new System.Drawing.Font(vefont.Family, (float)vefont.Size, GetSysFontStyle(vefont)); - System.Drawing.Font symbFont = new System.Drawing.Font(symblFontName, (float)vefont.Size); - iTextSharp.text.Font iFont = Volian.Svg.Library.VolianPdf.GetFont(font); - iTextSharp.text.Font iSymblFont = Volian.Svg.Library.VolianPdf.GetFont(symbFont); - float w = 0; - foreach (char c in txt) - { - int idx = symblsStr.IndexOf(c); - if (idx >= 0) // symbol character - use symbol font to find its width - w += iSymblFont.BaseFont.GetWidthPointKerned(symblsStr[idx].ToString(), (float)vefont.Size); - else - w += iFont.BaseFont.GetWidthPointKerned(c.ToString(), (float)vefont.Size); - } - //float w = iFont.BaseFont.GetWidthPointKerned(Text.Replace("\u25CF","@"), (float)vefont.Size); - return w; - } - bool _ScriptCaution = false; - - public bool ScriptCaution - { - get { return _ScriptCaution; } - set { _ScriptCaution = value; } - } - bool _SeparateBullet = false; - - public bool SeparateBullet - { - get { return _SeparateBullet; } - set { _SeparateBullet = value; } - } - public vlnTab(PdfContentByte cb, vlnParagraph myparent, string origTab, string cleanTab, float xoffset, float yoffset, VE_Font vFont, bool doSectTab, string symblFontName, bool removedUnderline) - { - ScriptCaution = (origTab.Contains("Caution") && vFont.Family == "VolianScript"); - MyContentByte = cb; - MyParent = myparent; - YOffset = yoffset; - Text = cleanTab; - MyFont = vFont; - float CCCs = GetTextWidth(MyFont, "CCCCCCCCCC", symblFontName); - float IIIs = GetTextWidth(MyFont, "iiiiiiiiii", symblFontName); - string origTab1 = origTab; - if (ScriptCaution) - { - Text = origTab.Replace("Caution ", "\uF043\uF061\uF069\uF06E\uF06F\uF074\uF075\uF020\uF020"); - Width = 90; - } - else if ((myparent.MyItemInfo.FormatStepData != null) && (myparent.MyItemInfo.FormatStepData.TabData.IdentWidth ?? 0) > 0) - //if ((myparent.MyItemInfo.FormatStepData != null) && (myparent.MyItemInfo.FormatStepData.TabData.IdentWidth ?? 0) > 0) - Width = (float)myparent.MyItemInfo.FormatStepData.TabData.IdentWidth; - else if (CCCs != IIIs) - { - float tPtPerChar = myparent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TabPtsPerChar ?? 6; - Width = tPtPerChar * origTab.Length; - // Check the following, it may be needed for FPL: - //origTab1 = origTab1.TrimStart(" ".ToCharArray()); - // 6 = number of points per character. 4 characters between end of tab and beginning of text - // origTab1.Trim... is number of non-space characters of the tab string. - //Width = 6 * (4 + origTab1.Trim(" ".ToCharArray()).Length); - } - else - Width = GetTextWidth(MyFont, (Text != null ? Text : origTab), symblFontName); //MyFont.CharsToTwips * (Text != null ? Text.Length : origTab.Length); - if ((myparent.MyItemInfo.FormatStepData != null) && myparent.MyItemInfo.FormatStepData.TabData.Bullet.Separate) - if (myparent.MyItemInfo.MyPrevious != null || myparent.MyItemInfo.NextItem != null) - SeparateBullet = true; - if (origTab.Contains(@"{!")) - { - int mindx = origTab.IndexOf(@"{!"); - int meindx = origTab.IndexOf(@"}", mindx); - string macro = origTab.Substring(mindx, meindx - mindx + 1); - // Width for placement of macro should be position in the string where the macro was located. - float lwidth = MyFont.CharsToTwips * (origTab.Length - meindx - 1); - MyMacro = new vlnMacro(xoffset - lwidth, yoffset, macro.Substring(2, macro.Length - 3)); - xoffset += myparent.MyItemInfo.FormatStepData.TabData.MacroTabAdjust ?? 0; - origTab = origTab.Replace(macro, ""); - cleanTab = origTab; - if (CCCs != IIIs) - { - float? tPtPerChar1 = myparent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TabPtsPerChar; - if (tPtPerChar1!=null) - Width = (float)tPtPerChar1 * origTab.Length; - else - { - origTab = origTab + " "; - origTab = origTab.TrimStart(" ".ToCharArray()); - if (mindx > 2) // ouch! - Width = 6f * (origTab.Length - 1); // FPL (macro is after {numeric}) FPL is good with genmac output! - else - Width = 3 + (6f * origTab.Length); // NSP (macro is before {numeric}) - } - } - else - Width = GetTextWidth(MyFont, (cleanTab != null ? cleanTab : origTab), symblFontName);//MyFont.CharsToTwips * (cleanTab != null ? cleanTab.Length : origTab.Length); - } - else - { - origTab = origTab1; - } - - // if this tab was underlined, we may need to add partial underlining back in, if it was - // removed when the bullet was added. This handles the case where the bullet was appended - // to the tab, for example "NOTE: o". - if (removedUnderline) - { - int sep = origTab.IndexOfAny(". ".ToCharArray()); - origTab = @"\ul " + origTab.Substring(0, sep-1) + @"\ulnone" + origTab.Substring(sep-1); - } - // if this tab is underlined, the underlining should not underline the ':'. Check for "NOTE:" - // or "CAUTION:", i.e. only underline up to ':' - if (myparent.MyItemInfo.IsStep && ((myparent.MyItemInfo.FormatStepData.AlwaysTab || myparent.MyItemInfo.MyPrevious == null) - && ((vFont.Style & E_Style.Underline) > 0) && (origTab.ToUpper().Contains("NOTE:") || - origTab.ToUpper().Contains("CAUTION:")))) - { - FontStyle style = FontStyle.Regular; - if ((vFont.Style & E_Style.Bold) > 0) style |= FontStyle.Bold; - if ((vFont.Style & E_Style.Italics) > 0) style |= FontStyle.Italic; - vFont.WindowsFont = new System.Drawing.Font(vFont.Family, (float)vFont.Size, style); - int indxC = origTab.IndexOf(":"); - origTab = @"\ul " + origTab.Substring(0, indxC) + @"\ulnone" + origTab.Substring(indxC); - } - Rtf = GetRtf(origTab, vFont); - Rtf = Rtf.Replace("\u0394", @"\f1\u916?\f0 "); // delta 0x0394 - if (ScriptCaution) - { - Rtf = GetRtf("\u25CFCaution ", vFont); - Rtf = Rtf.Replace("\u25CF", @"\f1\fs20 \u9679?\f0\par\f0\fs64 "); // bullet 25CF // jsj- force bullet size (is different than tab text) - if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.MyPrevious != null) - Rtf = Rtf.Replace("Caution ", @"\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?"); - else - { - if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.NextItem == null) - Rtf = Rtf.Replace(@"\u9679?", ""); - Rtf = Rtf.Replace("Caution ", @"\u61507?\u61537?\u61557?\u61556?\u61545?\u61551?\u61550?\u61472?\u61472?"); - } - } - else - { - if (SeparateBullet) - Rtf = Rtf.Replace("\u25CF", ""); - else - Rtf = Rtf.Replace("\u25CF", @"\f1\u9679?\f0 "); // bullet 25CF // jsj- add space after \f0 - //Rtf = Rtf.Replace("\u25CF", @"\f1\fs18\b0\i0 \u9679?\f0 "); // bullet 25CF // jsj- add space after \f0 - if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.MyPrevious != null) - { - //if (scriptCaution) - // Rtf = Rtf.Replace("CAUTION ", @"\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?"); - Rtf = Rtf.Replace("Caution:", " "); - Rtf = Rtf.Replace("Note:", " "); - Rtf = Rtf.Replace("CAUTION:", " "); - Rtf = Rtf.Replace("NOTE:", " "); - Rtf = Rtf.Replace("Caution", " "); - Rtf = Rtf.Replace("Note", " "); - Rtf = Rtf.Replace("CAUTION", " "); - Rtf = Rtf.Replace("NOTE", " "); - } - } - //if (ScriptCaution && Rtf.Contains("Caution")) - //{ - // // NSP script caution - // iTextSharp.text.Font myfont = pdf.GetFont(vFont.Family, 28, 0, iTextSharp.text.Color.BLACK); - // if (!myfont.BaseFont.CharExists(0x43)) // Capital 'C' exists as text - // { - // //VE_Font vf = new VE_Font("VolianScript", 28, E_Style.Italics, 12); - // // Capital 'C' exists as Symbol - // Rtf = Rtf.Replace("Caution ", @"\u61507?\u61537?\u61557?\u61556?\u61545?\u61551?\u61550?\u61472?\u61472?"); - // } - - //} - - - // do positioning based on whether format has locations for section 'header'. If it's not centered, treat - // it's location more like a 'tab'. - if (doSectTab) - { - XOffset = xoffset; - // the width was just a little small, so it was wrapping - but only if there were no spaces at end - // so use this condition to do minimal impact (WCN1 format, for section tabs with three places, i.e. 6.1.2 - if (!cleanTab.EndsWith(" "))Width += .1f; - } - else - { - //if (MyFont.Family == "Arial" && MyFont.Size == 14) - //{ - // System.Drawing.Font font = new System.Drawing.Font("Arial", 14); - // iTextSharp.text.Font iFont = Volian.Svg.Library.VolianPdf.GetFont(font); - // float w = iFont.BaseFont.GetWidthPointKerned(Text, 14); - // Width = w; - //} - XOffset = xoffset - Width; - } - - } - public override float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin) - { - if (MyParent.MyItemInfo.FormatStepData != null && MyParent.MyItemInfo.FormatStepData.StepPrintData != null) - XOffset += (float)(MyParent.MyItemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); - float yLocation = CalculateYOffset(yPageStart, yTopMargin); - Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, "", yBottomMargin); - return yPageStart; - } - } -} diff --git a/PROMS/Volian.Print.Library/vlnTab.cs.org b/PROMS/Volian.Print.Library/vlnTab.cs.org deleted file mode 100644 index 8390bced..00000000 --- a/PROMS/Volian.Print.Library/vlnTab.cs.org +++ /dev/null @@ -1,323 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using iTextSharp.text.pdf; -using iTextSharp.text; -using VEPROMS.CSLA.Library; - -namespace Volian.Print.Library -{ - public partial class vlnTab : vlnText - { - /// - /// Used to Align Tabs for numeric tabs that can go to 2 digits - /// - private float? _TabAlign; - public float TabAlign // Offset to Last printable character - { - get - { - if (_TabAlign == null) - { - _TabAlign = 0; - if (Text != null) - { - while (_TabAlign < Text.Length && Text[(int)_TabAlign] == ' ') - _TabAlign++; - if (_TabAlign < Text.Length) - { - if ("0123456789".Contains(Text[(int)_TabAlign].ToString())) - { - while ("0123456789".Contains(Text[(int)_TabAlign].ToString())) - _TabAlign++; - _TabAlign--; - } - } - else - _TabAlign = 0; - } - } - return (float)_TabAlign * MyFont.CharsToTwips; - } - } - private float? _TabOffset; - public float TabOffset // Offset to first printable character - { - get - { - if (_TabOffset == null) - { - _TabOffset = 0; - if (Text != null) - { - while (_TabOffset= Text.Length) _TabOffset = 0; - return (float)_TabOffset * MyFont.CharsToTwips; - } - } - private vlnMacro _MyMacro; - public vlnMacro MyMacro - { - get { return _MyMacro; } - set { _MyMacro = value; } - } - - private string symblsStr = "\u25CF\u0394"; // string of possible symbol character in a tab - // add symbol characters as needed - // "\u25CF" - solid bullet - // \x0394 - delta - - private System.Drawing.FontStyle GetSysFontStyle(VE_Font f) - { - if (f.Style == E_Style.Italics) - return System.Drawing.FontStyle.Italic; - return FontStyle.Regular; - } - private float GetTextWidth(VE_Font vefont, string txt, string symblFontName) - { - System.Drawing.Font font = new System.Drawing.Font(vefont.Family, (float)vefont.Size, GetSysFontStyle(vefont)); - System.Drawing.Font symbFont = new System.Drawing.Font(symblFontName, (float)vefont.Size); - iTextSharp.text.Font iFont = Volian.Svg.Library.VolianPdf.GetFont(font); - iTextSharp.text.Font iSymblFont = Volian.Svg.Library.VolianPdf.GetFont(symbFont); - float w = 0; - foreach (char c in txt) - { - int idx = symblsStr.IndexOf(c); - if (idx >= 0) // symbol character - use symbol font to find its width - w += iSymblFont.BaseFont.GetWidthPointKerned(symblsStr[idx].ToString(), (float)vefont.Size); - else - w += iFont.BaseFont.GetWidthPointKerned(c.ToString(), (float)vefont.Size); - } - //float w = iFont.BaseFont.GetWidthPointKerned(Text.Replace("\u25CF","@"), (float)vefont.Size); - return w; - } - bool _ScriptCaution = false; - - public bool ScriptCaution - { - get { return _ScriptCaution; } - set { _ScriptCaution = value; } - } - bool _SeparateBullet = false; - - public bool SeparateBullet - { - get { return _SeparateBullet; } - set { _SeparateBullet = value; } - } - public vlnTab(PdfContentByte cb, vlnParagraph myparent, string origTab, string cleanTab, float xoffset, float yoffset, VE_Font vFont, bool doSectTab, string symblFontName, bool removedUnderline) - { - bool alignAsIfBulleted = false; - ScriptCaution = (origTab.Contains("Caution") && vFont.Family == "VolianScript"); - MyContentByte = cb; - MyParent = myparent; - YOffset = yoffset; - Text = cleanTab; - MyFont = vFont; - float CCCs = GetTextWidth(MyFont, "CCCCCCCCCC", symblFontName); - float IIIs = GetTextWidth(MyFont, "iiiiiiiiii", symblFontName); - string origTab1 = origTab; - if (ScriptCaution) - { - Text = origTab.Replace("Caution ", "\uF043\uF061\uF069\uF06E\uF06F\uF074\uF075\uF020\uF020"); - Width = 90; - } - else if ((myparent.MyItemInfo.FormatStepData != null) && (myparent.MyItemInfo.FormatStepData.TabData.IdentWidth ?? 0) > 0) - //if ((myparent.MyItemInfo.FormatStepData != null) && (myparent.MyItemInfo.FormatStepData.TabData.IdentWidth ?? 0) > 0) - Width = (float)myparent.MyItemInfo.FormatStepData.TabData.IdentWidth; - else if (CCCs != IIIs) - { - float tPtPerChar = myparent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TabPtsPerChar ?? 6; - Width = tPtPerChar * origTab.Length; - // Check the following, it may be needed for FPL: - //origTab1 = origTab1.TrimStart(" ".ToCharArray()); - // 6 = number of points per character. 4 characters between end of tab and beginning of text - // origTab1.Trim... is number of non-space characters of the tab string. - //Width = 6 * (4 + origTab1.Trim(" ".ToCharArray()).Length); - } - else - Width = GetTextWidth(MyFont, (Text != null ? Text : origTab), symblFontName); //MyFont.CharsToTwips * (Text != null ? Text.Length : origTab.Length); - - // Pairie Island (NSP) Caution and Note tabs use a larger font - // When using a bullet, we need to use the font size of the Caution/Note text instead of the tab. - // To do this we set the TabData.Bullet.Separate to true (currently - 4/26/2013 - only NSP uses this). - // Because of the different font sizes, when the Caution/Note did have have a bullet, the positioning - // was off by the lenght of IdentB (the bullet string), thus the "alignAsIfBulleted" bool - if ((myparent.MyItemInfo.FormatStepData != null) && myparent.MyItemInfo.FormatStepData.TabData.Bullet.Separate) - if (myparent.MyItemInfo.MyPrevious != null || myparent.MyItemInfo.NextItem != null) - SeparateBullet = true; - else - alignAsIfBulleted = true; - - if (origTab.Contains(@"{!")) - { - int mindx = origTab.IndexOf(@"{!"); - int meindx = origTab.IndexOf(@"}", mindx); - string macro = origTab.Substring(mindx, meindx - mindx + 1); - // Width for placement of macro should be position in the string where the macro was located. - float lwidth = MyFont.CharsToTwips * (origTab.Length - meindx - 1); - MyMacro = new vlnMacro(xoffset - lwidth, yoffset, macro.Substring(2, macro.Length - 3)); - xoffset += myparent.MyItemInfo.FormatStepData.TabData.MacroTabAdjust ?? 0; - origTab = origTab.Replace(macro, ""); - cleanTab = origTab; - if (CCCs != IIIs) - { - float? tPtPerChar1 = myparent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TabPtsPerChar; - if (tPtPerChar1!=null) - Width = (float)tPtPerChar1 * origTab.Length; - else - { - origTab = origTab + " "; - origTab = origTab.TrimStart(" ".ToCharArray()); - if (mindx > 2) // ouch! - Width = 6f * (origTab.Length - 1); // FPL (macro is after {numeric}) FPL is good with genmac output! - else - Width = 3 + (6f * origTab.Length); // NSP (macro is before {numeric}) - } - } - else - Width = GetTextWidth(MyFont, (cleanTab != null ? cleanTab : origTab), symblFontName);//MyFont.CharsToTwips * (cleanTab != null ? cleanTab.Length : origTab.Length); - } - else - { - origTab = origTab1; - } - - // if this tab was underlined, we may need to add partial underlining back in, if it was - // removed when the bullet was added. This handles the case where the bullet was appended - // to the tab, for example "NOTE: o". - if (removedUnderline) - { - int sep = origTab.IndexOfAny(". ".ToCharArray()); - //origTab = @"\ul " + origTab.Substring(0, sep-1) + @"\ulnone" + origTab.Substring(sep-1); - origTab = @"\ul " + origTab.Substring(0, sep) + @"\ulnone" + origTab.Substring(sep); - } - - UnderlineTerminateList utl = myparent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.UnderlineTerminateList; - - // if this tab is underlined, the underlining should not underline the ':'. Check for "NOTE:" - // or "CAUTION:", i.e. only underline up to ':' - if (myparent.MyItemInfo.IsStep && ((myparent.MyItemInfo.FormatStepData.AlwaysTab || myparent.MyItemInfo.MyPrevious == null) - && ((vFont.Style & E_Style.Underline) > 0) && (origTab.ToUpper().Contains("NOTE:") || - origTab.ToUpper().Contains("CAUTION:")))) - { - FontStyle style = FontStyle.Regular; - if ((vFont.Style & E_Style.Bold) > 0) style |= FontStyle.Bold; - if ((vFont.Style & E_Style.Italics) > 0) style |= FontStyle.Italic; - vFont.WindowsFont = new System.Drawing.Font(vFont.Family, (float)vFont.Size, style); - int indxC = origTab.IndexOf(":"); - origTab = @"\ul " + origTab.Substring(0, indxC) + @"\ulnone" + origTab.Substring(indxC); - } - else if (utl != null && utl.Count > 0 && ((vFont.Style & E_Style.Underline) > 0)) - { - foreach (UnderlineTerminate ut in utl) - { - if (origTab.Contains(ut.Text)) - { - FontStyle style = FontStyle.Regular; - if ((vFont.Style & E_Style.Bold) > 0) style |= FontStyle.Bold; - if ((vFont.Style & E_Style.Italics) > 0) style |= FontStyle.Italic; - vFont.WindowsFont = new System.Drawing.Font(vFont.Family, (float)vFont.Size, style); - int indxC = origTab.IndexOf(ut.Text); - origTab = @"\ul " + origTab.Substring(0, indxC) + @"\ulnone " + origTab.Substring(indxC); - break; - } - } - } - if (SeparateBullet) - Rtf = GetRtf(origTab, myparent.MyItemInfo.FormatStepData.TabData.Bullet.Font); - else - Rtf = GetRtf(origTab, vFont); - Rtf = Rtf.Replace("\u0394", @"\f1\u916?\f0 "); // delta 0x0394 - if (ScriptCaution) - { - Rtf = GetRtf("\u25CFCaution ", vFont); - Rtf = Rtf.Replace("\u25CF", @"\f1\fs20 \u9679?\f0\par\f0\fs64 "); // bullet 25CF // jsj- force bullet size (is different than tab text) - if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.MyPrevious != null) - Rtf = Rtf.Replace("Caution ", @"\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?"); - else - { - if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.NextItem == null) - Rtf = Rtf.Replace(@"\u9679?", ""); - Rtf = Rtf.Replace("Caution ", @"\u61507?\u61537?\u61557?\u61556?\u61545?\u61551?\u61550?\u61472?\u61472?"); - } - } - else - { - if (SeparateBullet) - Rtf = Rtf.Replace("\u25CF", ""); - else - Rtf = Rtf.Replace("\u25CF", @"\f1\u9679?\f0 "); // bullet 25CF // jsj- add space after \f0 - //Rtf = Rtf.Replace("\u25CF", @"\f1\fs18\b0\i0 \u9679?\f0 "); // bullet 25CF // jsj- add space after \f0 - if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.MyPrevious != null) - { - //if (scriptCaution) - // Rtf = Rtf.Replace("CAUTION ", @"\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?"); - Rtf = Rtf.Replace("Caution:", " "); - Rtf = Rtf.Replace("Note:", " "); - Rtf = Rtf.Replace("CAUTION:", " "); - Rtf = Rtf.Replace("NOTE:", " "); - Rtf = Rtf.Replace("Caution", " "); - Rtf = Rtf.Replace("Note", " "); - Rtf = Rtf.Replace("CAUTION", " "); - Rtf = Rtf.Replace("NOTE", " "); - } - } - //if (ScriptCaution && Rtf.Contains("Caution")) - //{ - // // NSP script caution - // iTextSharp.text.Font myfont = pdf.GetFont(vFont.Family, 28, 0, iTextSharp.text.Color.BLACK); - // if (!myfont.BaseFont.CharExists(0x43)) // Capital 'C' exists as text - // { - // //VE_Font vf = new VE_Font("VolianScript", 28, E_Style.Italics, 12); - // // Capital 'C' exists as Symbol - // Rtf = Rtf.Replace("Caution ", @"\u61507?\u61537?\u61557?\u61556?\u61545?\u61551?\u61550?\u61472?\u61472?"); - // } - - //} - - - // do positioning based on whether format has locations for section 'header'. If it's not centered, treat - // it's location more like a 'tab'. - if (doSectTab) - { - XOffset = xoffset; - // the width was just a little small, so it was wrapping - but only if there were no spaces at end - // so use this condition to do minimal impact (WCN1 format, for section tabs with three places, i.e. 6.1.2 - if (!cleanTab.EndsWith(" "))Width += .1f; - } - else - { - // if using a proportional font and the tab font/size is different than the text font/size - if (CCCs != IIIs && - (MyFont.Family != myparent.MyItemInfo.FormatStepData.Font.Family || - MyFont.Size != myparent.MyItemInfo.FormatStepData.Font.Size)) - { - // This is needed for Prairie Island (NSP) Caution/Note tabs to consistantly position - // them at the same horizontal (column) position on the page - string txt = Text; - if (alignAsIfBulleted) - txt += myparent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB; - System.Drawing.Font font = new System.Drawing.Font(MyFont.Family,(float)MyFont.Size); - iTextSharp.text.Font iFont = Volian.Svg.Library.VolianPdf.GetFont(font); - float w = iFont.BaseFont.GetWidthPointKerned(txt, (float)MyFont.Size); - Width = w; - } - XOffset = xoffset - Width; - } - - } - public override float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin) - { - if (MyParent.MyItemInfo.FormatStepData != null && MyParent.MyItemInfo.FormatStepData.StepPrintData != null) - XOffset += (float)(MyParent.MyItemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); - float yLocation = CalculateYOffset(yPageStart, yTopMargin); - Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, "", yBottomMargin); - return yPageStart; - } - } -} diff --git a/PROMS/Volian.Print.Library/vlnTabMcG.cs b/PROMS/Volian.Print.Library/vlnTabMcG.cs deleted file mode 100644 index 0ff2ff1d..00000000 --- a/PROMS/Volian.Print.Library/vlnTabMcG.cs +++ /dev/null @@ -1,323 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using iTextSharp.text.pdf; -using iTextSharp.text; -using VEPROMS.CSLA.Library; - -namespace Volian.Print.Library -{ - public partial class vlnTab : vlnText - { - /// - /// Used to Align Tabs for numeric tabs that can go to 2 digits - /// - private float? _TabAlign; - public float TabAlign // Offset to Last printable character - { - get - { - if (_TabAlign == null) - { - _TabAlign = 0; - if (Text != null) - { - while (_TabAlign < Text.Length && Text[(int)_TabAlign] == ' ') - _TabAlign++; - if (_TabAlign < Text.Length) - { - if ("0123456789".Contains(Text[(int)_TabAlign].ToString())) - { - while ("0123456789".Contains(Text[(int)_TabAlign].ToString())) - _TabAlign++; - _TabAlign--; - } - } - else - _TabAlign = 0; - } - } - return (float)_TabAlign * MyFont.CharsToTwips; - } - } - private float? _TabOffset; - public float TabOffset // Offset to first printable character - { - get - { - if (_TabOffset == null) - { - _TabOffset = 0; - if (Text != null) - { - while (_TabOffset= Text.Length) _TabOffset = 0; - return (float)_TabOffset * MyFont.CharsToTwips; - } - } - private vlnMacro _MyMacro; - public vlnMacro MyMacro - { - get { return _MyMacro; } - set { _MyMacro = value; } - } - - private string symblsStr = "\u25CF\u0394"; // string of possible symbol character in a tab - // add symbol characters as needed - // "\u25CF" - solid bullet - // \x0394 - delta - - private System.Drawing.FontStyle GetSysFontStyle(VE_Font f) - { - if (f.Style == E_Style.Italics) - return System.Drawing.FontStyle.Italic; - return FontStyle.Regular; - } - private float GetTextWidth(VE_Font vefont, string txt, string symblFontName) - { - System.Drawing.Font font = new System.Drawing.Font(vefont.Family, (float)vefont.Size, GetSysFontStyle(vefont)); - System.Drawing.Font symbFont = new System.Drawing.Font(symblFontName, (float)vefont.Size); - iTextSharp.text.Font iFont = Volian.Svg.Library.VolianPdf.GetFont(font); - iTextSharp.text.Font iSymblFont = Volian.Svg.Library.VolianPdf.GetFont(symbFont); - float w = 0; - foreach (char c in txt) - { - int idx = symblsStr.IndexOf(c); - if (idx >= 0) // symbol character - use symbol font to find its width - w += iSymblFont.BaseFont.GetWidthPointKerned(symblsStr[idx].ToString(), (float)vefont.Size); - else - w += iFont.BaseFont.GetWidthPointKerned(c.ToString(), (float)vefont.Size); - } - //float w = iFont.BaseFont.GetWidthPointKerned(Text.Replace("\u25CF","@"), (float)vefont.Size); - return w; - } - bool _ScriptCaution = false; - - public bool ScriptCaution - { - get { return _ScriptCaution; } - set { _ScriptCaution = value; } - } - bool _SeparateBullet = false; - - public bool SeparateBullet - { - get { return _SeparateBullet; } - set { _SeparateBullet = value; } - } - public vlnTab(PdfContentByte cb, vlnParagraph myparent, string origTab, string cleanTab, float xoffset, float yoffset, VE_Font vFont, bool doSectTab, string symblFontName, bool removedUnderline) - { - bool alignAsIfBulleted = false; - ScriptCaution = (origTab.Contains("Caution") && vFont.Family == "VolianScript"); - MyContentByte = cb; - MyParent = myparent; - YOffset = yoffset; - Text = cleanTab; - MyFont = vFont; - float CCCs = GetTextWidth(MyFont, "CCCCCCCCCC", symblFontName); - float IIIs = GetTextWidth(MyFont, "iiiiiiiiii", symblFontName); - string origTab1 = origTab; - if (ScriptCaution) - { - Text = origTab.Replace("Caution ", "\uF043\uF061\uF069\uF06E\uF06F\uF074\uF075\uF020\uF020"); - Width = 90; - } - else if ((myparent.MyItemInfo.FormatStepData != null) && (myparent.MyItemInfo.FormatStepData.TabData.IdentWidth ?? 0) > 0) - //if ((myparent.MyItemInfo.FormatStepData != null) && (myparent.MyItemInfo.FormatStepData.TabData.IdentWidth ?? 0) > 0) - Width = (float)myparent.MyItemInfo.FormatStepData.TabData.IdentWidth; - else if (CCCs != IIIs) - { - float tPtPerChar = myparent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TabPtsPerChar ?? 6; - Width = tPtPerChar * origTab.Length; - // Check the following, it may be needed for FPL: - //origTab1 = origTab1.TrimStart(" ".ToCharArray()); - // 6 = number of points per character. 4 characters between end of tab and beginning of text - // origTab1.Trim... is number of non-space characters of the tab string. - //Width = 6 * (4 + origTab1.Trim(" ".ToCharArray()).Length); - } - else - Width = GetTextWidth(MyFont, (Text != null ? Text : origTab), symblFontName); //MyFont.CharsToTwips * (Text != null ? Text.Length : origTab.Length); - - // Pairie Island (NSP) Caution and Note tabs use a larger font - // When using a bullet, we need to use the font size of the Caution/Note text instead of the tab. - // To do this we set the TabData.Bullet.Separate to true (currently - 4/26/2013 - only NSP uses this). - // Because of the different font sizes, when the Caution/Note did have have a bullet, the positioning - // was off by the lenght of IdentB (the bullet string), thus the "alignAsIfBulleted" bool - if ((myparent.MyItemInfo.FormatStepData != null) && myparent.MyItemInfo.FormatStepData.TabData.Bullet.Separate) - if (myparent.MyItemInfo.MyPrevious != null || myparent.MyItemInfo.NextItem != null) - SeparateBullet = true; - else - alignAsIfBulleted = true; - - if (origTab.Contains(@"{!")) - { - int mindx = origTab.IndexOf(@"{!"); - int meindx = origTab.IndexOf(@"}", mindx); - string macro = origTab.Substring(mindx, meindx - mindx + 1); - // Width for placement of macro should be position in the string where the macro was located. - float lwidth = MyFont.CharsToTwips * (origTab.Length - meindx - 1); - MyMacro = new vlnMacro(xoffset - lwidth, yoffset, macro.Substring(2, macro.Length - 3)); - xoffset += myparent.MyItemInfo.FormatStepData.TabData.MacroTabAdjust ?? 0; - origTab = origTab.Replace(macro, ""); - cleanTab = origTab; - if (CCCs != IIIs) - { - float? tPtPerChar1 = myparent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData.TabPtsPerChar; - if (tPtPerChar1!=null) - Width = (float)tPtPerChar1 * origTab.Length; - else - { - origTab = origTab + " "; - origTab = origTab.TrimStart(" ".ToCharArray()); - if (mindx > 2) // ouch! - Width = 6f * (origTab.Length - 1); // FPL (macro is after {numeric}) FPL is good with genmac output! - else - Width = 3 + (6f * origTab.Length); // NSP (macro is before {numeric}) - } - } - else - Width = GetTextWidth(MyFont, (cleanTab != null ? cleanTab : origTab), symblFontName);//MyFont.CharsToTwips * (cleanTab != null ? cleanTab.Length : origTab.Length); - } - else - { - origTab = origTab1; - } - - // if this tab was underlined, we may need to add partial underlining back in, if it was - // removed when the bullet was added. This handles the case where the bullet was appended - // to the tab, for example "NOTE: o". - if (myparent.MyItemInfo.ItemID==124256) Console.WriteLine("here"); - if (removedUnderline) - { - int sep = origTab.IndexOfAny(". ".ToCharArray()); - // if last character before the sep is not a ':', then add one to separator because - // this was cutting the last character off (if there was no ':'. - //if (origTab[sep - 1] != ':') sep++; - origTab = @"\ul " + origTab.Substring(0, sep-1) + @"\ulnone" + origTab.Substring(sep-1); - } - - UnderlineTerminateList utl = myparent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.UnderlineTerminateList; - - // if this tab is underlined, the underlining should not underline the ':'. Check for "NOTE:" - // or "CAUTION:", i.e. only underline up to ':' - if (myparent.MyItemInfo.IsStep && ((myparent.MyItemInfo.FormatStepData.AlwaysTab || myparent.MyItemInfo.MyPrevious == null) - && ((vFont.Style & E_Style.Underline) == E_Style.Underline) && (origTab.ToUpper().Contains("NOTE:") || - origTab.ToUpper().Contains("CAUTION:")))) - { - FontStyle style = FontStyle.Regular; - if ((vFont.Style & E_Style.Bold) > 0) style |= FontStyle.Bold; - if ((vFont.Style & E_Style.Italics) > 0) style |= FontStyle.Italic; - vFont.WindowsFont = new System.Drawing.Font(vFont.Family, (float)vFont.Size, style); - int indxC = origTab.IndexOf(":"); - origTab = @"\ul " + origTab.Substring(0, indxC) + @"\ulnone" + origTab.Substring(indxC); - } - else if (utl != null && ((vFont.Style & E_Style.Underline) > 0)) - { - foreach (UnderlineTerminate ut in utl) - { - if (origTab.Contains(ut.Text)) - { - FontStyle style = FontStyle.Regular; - if ((vFont.Style & E_Style.Bold) > 0) style |= FontStyle.Bold; - if ((vFont.Style & E_Style.Italics) > 0) style |= FontStyle.Italic; - vFont.WindowsFont = new System.Drawing.Font(vFont.Family, (float)vFont.Size, style); - int indxC = origTab.IndexOf(ut.Text); - origTab = @"\ul " + origTab.Substring(0, indxC) + @"\ulnone " + origTab.Substring(indxC); - break; - } - } - } - Rtf = GetRtf(origTab, vFont); - Rtf = Rtf.Replace("\u0394", @"\f1\u916?\f0 "); // delta 0x0394 - if (ScriptCaution) - { - Rtf = GetRtf("\u25CFCaution ", vFont); - Rtf = Rtf.Replace("\u25CF", @"\f1\fs20 \u9679?\f0\par\f0\fs64 "); // bullet 25CF // jsj- force bullet size (is different than tab text) - if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.MyPrevious != null) - Rtf = Rtf.Replace("Caution ", @"\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?"); - else - { - if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.NextItem == null) - Rtf = Rtf.Replace(@"\u9679?", ""); - Rtf = Rtf.Replace("Caution ", @"\u61507?\u61537?\u61557?\u61556?\u61545?\u61551?\u61550?\u61472?\u61472?"); - } - } - else - { - if (SeparateBullet) - Rtf = Rtf.Replace("\u25CF", ""); - else - Rtf = Rtf.Replace("\u25CF", @"\f1\u9679?\f0 "); // bullet 25CF // jsj- add space after \f0 - //Rtf = Rtf.Replace("\u25CF", @"\f1\fs18\b0\i0 \u9679?\f0 "); // bullet 25CF // jsj- add space after \f0 - if (myparent.MyItemInfo.FormatStepData != null && !myparent.MyItemInfo.FormatStepData.AlwaysTab && myparent.MyItemInfo.MyPrevious != null) - { - //if (scriptCaution) - // Rtf = Rtf.Replace("CAUTION ", @"\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?\u61472?"); - Rtf = Rtf.Replace("Caution:", " "); - Rtf = Rtf.Replace("Note:", " "); - Rtf = Rtf.Replace("CAUTION:", " "); - Rtf = Rtf.Replace("NOTE:", " "); - Rtf = Rtf.Replace("Caution", " "); - Rtf = Rtf.Replace("Note", " "); - Rtf = Rtf.Replace("CAUTION", " "); - Rtf = Rtf.Replace("NOTE", " "); - } - } - //if (ScriptCaution && Rtf.Contains("Caution")) - //{ - // // NSP script caution - // iTextSharp.text.Font myfont = pdf.GetFont(vFont.Family, 28, 0, iTextSharp.text.Color.BLACK); - // if (!myfont.BaseFont.CharExists(0x43)) // Capital 'C' exists as text - // { - // //VE_Font vf = new VE_Font("VolianScript", 28, E_Style.Italics, 12); - // // Capital 'C' exists as Symbol - // Rtf = Rtf.Replace("Caution ", @"\u61507?\u61537?\u61557?\u61556?\u61545?\u61551?\u61550?\u61472?\u61472?"); - // } - - //} - - - // do positioning based on whether format has locations for section 'header'. If it's not centered, treat - // it's location more like a 'tab'. - if (doSectTab) - { - XOffset = xoffset; - // the width was just a little small, so it was wrapping - but only if there were no spaces at end - // so use this condition to do minimal impact (WCN1 format, for section tabs with three places, i.e. 6.1.2 - if (!cleanTab.EndsWith(" "))Width += .1f; - } - else - { - // if using a proportional font and the tab font/size is different than the text font/size - if (CCCs != IIIs && - (MyFont.Family != myparent.MyItemInfo.FormatStepData.Font.Family || - MyFont.Size != myparent.MyItemInfo.FormatStepData.Font.Size)) - { - // This is needed for Prairie Island (NSP) Caution/Note tabs to consistantly position - // them at the same horizontal (column) position on the page - string txt = Text; - if (alignAsIfBulleted) - txt += myparent.MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.IdentB; - System.Drawing.Font font = new System.Drawing.Font(MyFont.Family,(float)MyFont.Size); - iTextSharp.text.Font iFont = Volian.Svg.Library.VolianPdf.GetFont(font); - float w = iFont.BaseFont.GetWidthPointKerned(txt, (float)MyFont.Size); - Width = w; - } - XOffset = xoffset - Width; - } - - } - public override float ToPdf(PdfContentByte cb, float yPageStart, ref float yTopMargin, ref float yBottomMargin) - { - if (MyParent.MyItemInfo.FormatStepData != null && MyParent.MyItemInfo.FormatStepData.StepPrintData != null) - XOffset += (float)(MyParent.MyItemInfo.FormatStepData.StepPrintData.PosAdjust ?? 0); - float yLocation = CalculateYOffset(yPageStart, yTopMargin); - Rtf2Pdf.TextAt(cb, IParagraph, XOffset, yLocation, Width, 100, "", yBottomMargin); - return yPageStart; - } - } -} diff --git a/PROMS/Volian.Svg.Library/DisplayText.cs b/PROMS/Volian.Svg.Library/DisplayText.cs deleted file mode 100644 index 751e3ce7..00000000 --- a/PROMS/Volian.Svg.Library/DisplayText.cs +++ /dev/null @@ -1,644 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -//using System.Windows.Forms; -using System.Text.RegularExpressions; -using System.Drawing; - -namespace Volian.Svg.Library -{ - //public class DisplayText - //{ - // #region Properties - // // list of 'pieces of text' for this item. Pieces include symbols, ros, - // // transitions & plain text. - // private List _DisplayTextElementList; - // public List DisplayTextElementList - // { - // get { return _DisplayTextElementList; } - // set { _DisplayTextElementList = value; } - // } - // // dictionary for the font table for this item. Note that this may - // // go away (it is not really used). - // private Dictionary _dicRtfFontTable; - // public Dictionary dicRtfFontTable - // { - // get { return _dicRtfFontTable; } - // set { _dicRtfFontTable = value; } - // } - // public string OriginalText; // compare for save to see if change. - // #endregion - // #region Constructors - // private Font TextFont; - - // /// - // /// DisplayText constructor: - // /// Creates a DisplayText object that converts the database text into a list of - // /// displayTextElement elements. - // /// Arguments are: - // /// ItemInfo itemInfo - the item whose text will be resolved - // /// E_EditPrintMode ep_mode - edit or print. - // /// E_ViewMode vw_mode - view or edit. - // /// - // public DisplayText(string text) - // { - // DisplayTextElementList = new List(); - // OriginalText = text; - // TextFont = new Font("Prestige Elite Tall",12); - // //TextFont = GetItemFont(); - - // // if in print mode or view mode, do replace words. Only if in edit mode are replace - // // words left as is. - // //_MyFormat = itemInfo.ActiveFormat; - // //if (epMode == E_EditPrintMode.Print || vwMode == E_ViewMode.View) text = DoReplaceWords(text); - - // // as a precaution, convert any \~ to \u160?. This is for Hard spaces.. see the commentary in the - // // save portion of this code for an explanation. - // text = text.Replace(@"\~", @"\u160?"); - // text = text.Replace(@"\'99", @"\u8482?"); - - // // replace the dash/hyphen or whatever you want to call it, with a hard hyphen. The 16-bit program - // // treated the dash/hyphen as such. Translate back on any data saves. - // text = text.Replace(@"-", @"\u8209?"); - // // Replace the backslash with a backslash symbol. Translate back on data saves. - // text = text.Replace(@"\\", @"\u9586?"); // unicode hex 2572 - // // displayTextElement List items are created for anything that is handled differently in RTB, i.e. - // // symbols, ros, trans, text. - // int startIndex = 0; - // int index = -1; - // while ((index = FindTokenChar(text, startIndex)) > -1) - // { - // // Do any 'plain' text that preceeds the token. - // if (index > startIndex) DoTextElement(text, startIndex, index); - - // // Now do any other types - // if (text[index] == '\x15') - // index = DoRO(text, index); - // else if (text[index] == '\x252C' || text[index] == '\x2566') - // index = DoTran(text, index); - // else - // index = DoSymbol(text, startIndex, index); - // startIndex = index; // +1; - // if (startIndex >= text.Length) break; - // } - // // Add any remaining text. - // if (startIndex < text.Length) DoTextElement(text, startIndex, index); - // } - // #endregion - // #region SaveData - // //public bool Save(string rtf) - // //{ - // // try - // // { - // // List origList = GetLinkList(DisplayTextElementList); - // // // massage string to store in DisplayTextElementList... - // // RtfToDisplayTextElements(rtf); - // // // take the list & convert to data in the format to save to the database. - // // StringBuilder sret = new StringBuilder(); - // // foreach (displayTextElement vte in DisplayTextElementList) - // // { - // // if (vte.Type == E_TextElementType.Text || vte.Type == E_TextElementType.Symbol) - // // sret.Append(vte.Text); - // // else if (vte.Type == E_TextElementType.ReferencedObject) - // // sret.Append(ToData_RO((displayLinkElement)vte)); - // // else if (vte.Type == E_TextElementType.Transition || vte.Type == E_TextElementType.TransitionRange) - // // sret.Append(ToData_Trans((displayLinkElement)vte)); - // // } - // // string modtext = sret.ToString(); - // // if (modtext != OriginalText) - // // { - // // Item itm = _MyItemInfo.Get(); - // // // check for different text, i.e. text from this itm doesn't match - // // // original text. - // // if (OriginalText != itm.MyContent.Text) - // // { - // // Console.WriteLine("Save Failed because text changed outside of this edit session."); - // // return false; - // // } - // // // Compare ro/transition lists and delete or add any to the item for any ros/transitions that have been - // // // added/deleted or modified. - // // ProcessRoTranChanges(itm, origList); - // // itm.MyContent.Text = modtext; - // // itm.Save(); - // // OriginalText = modtext; - // // } - // // else - // // return true; // no text changed, but did not fail so return true. - // // } - // // catch (Exception ex) - // // { - // // Console.WriteLine("Save Failed with error: {0}", ex.Message); - // // return false; - // // } - // // return true; - // //} - // private List GetLinkList(List locDisplayTextElementList) - // { - // List retList = new List(); - // foreach (displayTextElement vte in locDisplayTextElementList) - // { - // if (vte.Type == E_TextElementType.ReferencedObject || vte.Type == E_TextElementType.TransitionRange || vte.Type == E_TextElementType.Transition) - // { - // displayLinkElement tmp = (displayLinkElement)vte; - // displayLinkElement copy_vte = new displayLinkElement(); - // copy_vte.Type = tmp.Type; - // copy_vte.Link = tmp.Link; - // copy_vte.Text = tmp.Text; - // retList.Add(copy_vte); - // } - // } - // return retList; - // } - // private void RtfToDisplayTextElements(string rtf) - // { - // // For hardspaces, the windows richtextbox does some 'quirky' things: - // // A unicode representation of \u160? is sent INTO the rtb. Coming out, - // // that \u160? was translated to a \~ (by the underlying windows rtb). - // // Note that if the \~ is sent to the rtb, it is treated as a regular space, - // // i.e. no longer a hardspace, and actually is converted to a regular space. - // // SO, on the way out, convert any \~ to \u160? - // string noExtraRtfStr = rtf.Replace(@"\~", @"\u160?"); - - - // // GetFontTable returns a non-negative number font number in the - // // font table for the unicode font, if it is used (otherwise -1) - // //int unicodeFont = GetFontTable(rtb.Rtf); - - // // strip off all rtf commands... - // noExtraRtfStr = StripRtfCommands(noExtraRtfStr); - // //Console.WriteLine("StripRtf: {0}", noExtraRtfStr); - - // // Also, set back the hard dash to a regular dash... Do this after the removal - // // of other rtf commands though since the \u8209 was surrounded by font commands - // // that, without there removal first, was also removing the dash. Have it with - // // a space & without because if it is at the end, there will be no space (leave - // // it to rtf processing to make it more complicated) - // noExtraRtfStr = noExtraRtfStr.Replace(@"\u8209? ", @"-"); - // noExtraRtfStr = noExtraRtfStr.Replace(@"\u8209?", @"-"); - - // // change back the backslahs symbol to a regular backslash - // noExtraRtfStr = noExtraRtfStr.Replace(@"\u9586?", @"\\"); - - // DisplayTextElementList.Clear(); - // int startIndex = 0; - // int index = -1; - // while ((index = FindRtfChar(noExtraRtfStr, startIndex)) > -1) - // { - // int fndindx = -1; - // // Do any 'plain' text that preceeds the token. - // if (index > startIndex) - // index = SaveTextElement(noExtraRtfStr, startIndex, index); - // if ((fndindx = noExtraRtfStr.IndexOf(@"\protect", index)) == index) - // index = SaveLink(noExtraRtfStr, index); - // else - // index = SaveSymbolTE(noExtraRtfStr, index); - // startIndex = index + 1; - // if (startIndex >= noExtraRtfStr.Length) break; - // } - // // Add any remaining text. - // if (startIndex < noExtraRtfStr.Length) DoTextElement(noExtraRtfStr, startIndex, index); - // //Console.WriteLine(noExtraRtfStr); - // } - // private int SaveTextElement(string data, int startIndex, int index) - // { - // displayTextElement vte = new displayTextElement(); - // vte.Type = E_TextElementType.Text; - // int len = (index == -1) ? data.Length - startIndex : index - startIndex; - // vte.Text = data.Substring(startIndex, len); - // DisplayTextElementList.Add(vte); - // return index; - // } - // private int SaveSymbolTE(string data, int startIndex) - // { - // displayLinkElement vte = new displayLinkElement(); - // vte.Type = E_TextElementType.Symbol; - // // symbols are just the unicode/rtf command, no font associated with it - // // by the time it gets here... A symbol can be represented by \'xy or \uxyz? - // // if the \'xy is used the length of the symbol number will always be two, - // // otherwise find the index of the '?' to find the end. - // int endindx = -1; - // if (data[startIndex + 1] == '\'') endindx = startIndex + 3; - // else endindx = data.IndexOf("?", startIndex); - // if (endindx == -1) return startIndex; // not found - error - // vte.Text = data.Substring(startIndex, endindx - startIndex + 1); - // DisplayTextElementList.Add(vte); - // if (endindx + 1 < data.Length && data[endindx + 1] != ' ') return endindx; - // return endindx + 1; // add one to get past the space that was added after a symbol (to end the font cmd) - // } - // private int SaveLink(string data, int stIndex) - // { - // ////displayLinkElement vte = new displayLinkElement(); - // //// find the end of the link text, i.e. either the ending \v0 or \protect0. The win32 rtf box can - // //// put these in either order, take the lowest index. - // //int startIndex = stIndex + @"\protect ".Length; - // //int indx_v0 = data.IndexOf(@"\v0", startIndex); - // //int indx_protect0 = data.IndexOf(@"\protect0", startIndex); - // //int indx = indx_v0 < indx_protect0 ? indx_v0 : indx_protect0; - // //LinkText lt = new LinkText(data.Substring(startIndex, indx - startIndex)); - // //displayLinkElement vte = new displayLinkElement(); - // //vte.Type = (E_TextElementType)lt.MyParsedLinkType; - // //vte.Text = lt.MyValue; - // //vte.Link = lt.MyLink; - // //DisplayTextElementList.Add(vte); - // //return (indx_v0 < indx_protect0 ? indx_protect0 + 1 : indx_v0 + 1); - // ////if (lt.MyParsedLinkType == ParsedLinkType.ReferencedObject) return - // ////// first find if ReferencedObject or trans, the ReferencedObject has a #R. - // ////int istart = data.IndexOf("#Link:", startIndex); - // ////if (data[istart + 6] == 'R') return SaveROTE(data, startIndex); - // ////else if (data.Substring(istart+6,11) == "TransitionR") - // //// return SaveTranTE(data, startIndex, E_TextElementType.TRANS_Range); - // ////return SaveTranTE(data, startIndex, E_TextElementType.TRANS_Single); - // return 0; - // } - // //private int SaveTranTE(string data, int startIndex, E_TextElementType type) - // //{ - // // displayLinkElement vte = new displayLinkElement(); - - // // vte.Type = type; - // // // \protect {transition text} \v #Link:Transition(Range): 1 2 3\protect0\v0 - // // // where 1 2 3 are transition type and ids - // // int indx = data.IndexOf("\\v #Link:Transition", startIndex); - // // // use '9' to get past \\protect - // // vte.Text = data.Substring(startIndex + 9, indx - startIndex - 9); - // // // the link is the text between the #Link... and the next '\\'. - // // int iend = data.IndexOf("\\", indx+1); - // // int bindx = data.IndexOf("#", indx); - // // vte.Link = data.Substring(bindx, iend - bindx); - // // DisplayTextElementList.Add(vte); - // // // unfortunately, the rtf box may add the \protect0 \v0 in either order - // // // and with or without one or more spaces between then. The number of text - // // // characters = 11 for \protect0\v0 - find the number of spaces between them - // // // if any? - // // int nsp = 0; - // // for (int c = iend; c < iend + 11; c++) if (data[c] == ' ') nsp++; - // // return iend + 11 + nsp; - // //} - // //private int SaveROTE(string data, int startIndex) - // //{ - // // displayLinkElement vte = new displayLinkElement(); - // // vte.Type = E_TextElementType.ReferencedObject; - // // // \protect {rovalue} \v #Link:ReferencedObject (RoUsageId) {ROID}\protect0\v0 - // // int indx = data.IndexOf("\\v #Link:ReferencedObject", startIndex); - // // // use '9' to get past \\protect - // // vte.Text = data.Substring(startIndex + 9, indx - startIndex - 9); - // // // the link is the text between the #Link... and the next '\\'. - // // int iend = data.IndexOf("\\", indx); - // // int bindx = data.IndexOf("#", indx); - // // vte.Link = data.Substring(bindx, iend - bindx); - // // DisplayTextElementList.Add(vte); - // // // unfortunately, the rtf box may add the \protect0 \v0 in either order - // // // and with or without one or more spaces between then. The number of text - // // // characters = 11 for \protect0\v0 - find the number of spaces between them - // // // if any? - // // int nsp = 0; - // // for (int c = iend; c < iend + 11; c++) if (data[c] == ' ') nsp++; - // // return iend + 11 + nsp; - // //} - // private int FindRtfChar(string text, int startIndex) - // { - // int prindx = text.IndexOf("\\protect", startIndex); - // int symindx1 = text.IndexOf("\\'", startIndex); - // int symindx2 = text.IndexOf("\\u", startIndex); - // if (symindx2 > -1) - // { - // if (text[symindx2 + 2] == 'l') symindx2 = -1; // don't process underlines - // } - // if (prindx == -1 && symindx1 == -1 && symindx2 == -1) return -1; - // if (prindx == -1) prindx = text.Length + 1; - // if (symindx1 == -1) symindx1 = text.Length + 1; - // if (symindx2 == -1) symindx2 = text.Length + 1; - - // // Which token has smallest number, to determine which item is next - // // in the string. If it is a symbol - see if it has a font specifier - // // first. - // int symindx = symindx1 < symindx2 ? symindx1 : symindx2; - // int smallest = (prindx < symindx ? prindx : symindx); - // return smallest; - // } - // private int GetFontTable(string rtf) - // { - // dicRtfFontTable = new Dictionary(); - // // return unicode (symbol) font number, if it exists, to expedite finding - // // the font for symbols. - // int unicodeFont = -1; - // int bindx = rtf.IndexOf(@"{\fonttbl"); - // if (bindx < -1) return -1; - // int eindx = rtf.IndexOf("}}", bindx); - // // get font table string and then do regular expressions to get font number - // // with font name. - // string tbl = rtf.Substring(bindx + 9, eindx - bindx - 8); - // tbl = tbl.Replace("{", "<"); - // tbl = tbl.Replace("}", ">"); - // string pat = @"(?:<\\f)([0-9]+)(?:[\S]+ )([\w ]+)"; - // StringBuilder sb = new StringBuilder(); - // foreach (Match m in Regex.Matches(tbl, pat)) - // { - // int num = Convert.ToInt32(m.Result("${1}")); - // string nam = m.Result("${2}"); - // dicRtfFontTable.Add(num, nam); - // if ((unicodeFont == -1) && (nam == "Arial Unicode MS")) unicodeFont = num; - // } - // return unicodeFont; - // } - // public static string ReplaceRTFClause(Match m) - // { - // switch (m.Value[1]) - // { - // case 'u': - // if (Regex.IsMatch(m.Value, @"\\u[0-9]+")) - // return m.Value; // Special Charcaters - // if (Regex.IsMatch(m.Value, @"\\ulnone")) - // return m.Value; - // if (Regex.IsMatch(m.Value, @"\\ul.*")) - // return m.Value; // Underline - // if (Regex.IsMatch(m.Value, @"^\\up[0-9] ?$")) - // return m.Value; // shift up (superscript) - // break; - // case 'd': - // if (Regex.IsMatch(m.Value, @"^\\dn[0-9] ?$")) - // return m.Value; // shift down (subscript) - // break; - // case '\'': // Special Character - // return m.Value; - // case 'b': // Bold - // return m.Value; - // case 'i': // Italics - // return m.Value; - // case 'v': // save link hidden info - // if (m.Value == @"\v") return m.Value; // part of link - // if (Regex.IsMatch(m.Value, @"\\v0")) - // return m.Value; // hidden info off - // break; - // case 'p': - // if (m.Value == @"\par") return "\r\n"; - // if (m.Value == @"\protect") - // return m.Value; - // if (m.Value == @"\protect0") - // return m.Value; - // break; - // } - // return "";//Strip All - // } - // public static string StripRtfCommands(string rtf) - // { - // string retval = Regex.Replace(rtf, @"[\r\n]", "", RegexOptions.Singleline); // Strip Carriage Returns and Newlines - // retval = Regex.Replace(retval, @"^\{(.*)\}$", "$1", RegexOptions.Singleline); // Strip Opening and Closing Braces - // retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - // retval = Regex.Replace(retval, @"\{[^{]*?\}", "", RegexOptions.Singleline); // Strip Clauses - remove anything from curly braces - // retval = Regex.Replace(retval, @"\\[^ \\?]+", new MatchEvaluator(ReplaceRTFClause)); // take backslash xyz and evaluates them - // // remove a space if there is one as the first character.. - // if (retval[0] == ' ') retval = retval.Remove(0, 1); - // // remove \r\n at end of string - this was added with the \par at the end of string by the rtf box - // if (retval.Substring(retval.Length - 2, 2) == "\r\n") retval = retval.Remove(retval.Length - 2, 2); - - // return retval; - // } - // private string ToData_RO(displayLinkElement vte) - // { - // // get past the #Link:ReferencedObject part of the link. - // return String.Format("\x15ReferencedObjectv RO\\v0 {0}\\v #{1}\\v0", vte.Text, vte.Link.Substring(23, vte.Link.Length - 23)); - // } - // private string ToData_Trans(displayLinkElement vte) - // { - // char trchar = vte.Type == E_TextElementType.Transition ? '\x252C' : '\x2566'; - // // depending on type, get past the #Link:Transition: or #Link:TransitionRange: part - // // of text. - // int indx = vte.Type == E_TextElementType.Transition ? 18 : 23; - // return String.Format("{0}\\v TRAN\\v0 {1}\\v {2}\\v0", trchar, vte.Text, vte.Link.Substring(indx, vte.Link.Length - indx)); - // } - // #endregion - // //#region StyleData - // //private VE_Font GetItemFont() - // //{ - // // VE_Font font = null; - // // FormatInfo format = _MyItemInfo.ActiveFormat; - // // int type = (int)_MyItemInfo.MyContent.Type; - // // switch (type / 10000) - // // { - // // case 0: // procedure - // // font = format.PlantFormat.FormatData.Font; - // // break; - // // case 1: // section - // // font = format.PlantFormat.FormatData.SectData.SectionHeader.Font; - // // break; - // // case 2: // step types - // // int typindx = type - 20000; // what to do for other types rather than steps - // // font = format.PlantFormat.FormatData.StepDataList[typindx].Font; - // // break; - // // } - // // TextFont = font; - // // return font; - // //} - // //#endregion - // #region DoListElements - // private int FindTokenChar(string txt, int startIndex) - // { - // // tokens are ro, transitions and possible symbol - // char[] tok = { '\x15', '\x252C', '\x2566', '\\' }; - // bool done = false; - // // If there is only an rtf token from the indexed position on, don't return the - // // IndexOfAny index value, because it will by one character past the '\' and throw - // // of the return value of where in the string the text should be saved. For example - // // for the string '\b text \v somevalue \v0\b0', the first time through the while - // // loop has the index at the '\b' char of the b0. - // //int savstartIndex = startIndex; - // while (!done) - // { - // int indx = txt.IndexOfAny(tok, startIndex); - // if (indx < 0) return indx; - // if (txt[indx] != '\\') return indx; - // // see if symbol (but not underline) or another rtf command: has a 'u' - // // followed by a non-underline or single quote, and if so, return it. - // // Otherwise, get next index, must have been a slash or other rtf command. - // if (((txt[indx + 1] == 'u' && txt[indx + 2] != 'l')) || (txt[indx + 1] == '\'')) return indx; - // startIndex = indx + 1; - // } - // return -1; - // } - // private int DoTextElement(string text, int startIndex, int index) - // { - // displayTextElement vte = new displayTextElement(); - // vte.Type = E_TextElementType.Text; - // int len = (index == -1) ? text.Length - startIndex : index - startIndex; - // vte.Text = text.Substring(startIndex, len); - // DisplayTextElementList.Add(vte); - // return index + 1; - // } - // private string CreateLink(E_TextElementType type, string linktxt) - // { - // string retlink = ""; - // if (type == E_TextElementType.ReferencedObject) - // retlink = "#Link:ReferencedObject:" + linktxt; - // else if (type == E_TextElementType.Transition) - // retlink = "#Link:Transition:" + linktxt; - // else - // retlink = "#Link:TransitionRange:" + linktxt; - - // return retlink; - // } - // private int DoRO(string text, int index) - // { - // displayLinkElement vte = new displayLinkElement(); - // vte.Type = E_TextElementType.ReferencedObject; - // int iend = text.IndexOf(@"\v", index); - - // vte.Text = text.Substring(index + 1, iend - index - 1); - // int istart = text.IndexOf("#", index); - // iend = text.IndexOf(@"\v0", istart); - // vte.Link = text.Substring(istart, iend - istart); - // DisplayTextElementList.Add(vte); - // return iend + 3; - // } - // //private string FixTransition(string link, string text) - // //{ - // // int transitionID = Convert.ToInt32(link.Split(" ".ToCharArray())[1]); - // // // Find the transition - // // foreach (TransitionInfo ti in _MyItemInfo.MyContent.ContentTransitions) - // // { - // // if (ti.TransitionID == transitionID) - // // { - // // //string path = ti.PathTo.Replace(" Section PROCEDURE STEPS ", ", "); - // // //path = path.Replace(" Section PROCEDURE STEPS", ""); - // // string path = ti.ResolvePathTo(_MyFormat, _MyItemInfo, ItemInfo.Get(ti.ToID), ti.RangeID == 0 ? null : ItemInfo.Get(ti.RangeID)); - // // return path; - // // } - // // } - // // return text; - // //} - // private int DoTran(string text, int index) - // { - // //displayLinkElement vte = new displayLinkElement(); - // //if (text[index] == '\x252C') vte.Type = E_TextElementType.Transition; - // //else vte.Type = E_TextElementType.TransitionRange; // '\x2566'\ - // //int iend = text.IndexOf(@"\v", index); - // //vte.Text = text.Substring(index + 1, iend - index - 1); - // //int istart = text.IndexOf("#", index); - // //iend = text.IndexOf(@"\v0", istart); - // //vte.Link = text.Substring(istart, iend - istart); - // //vte.Text = FixTransition(vte.Link, vte.Text); // TODO: Transition text resolution? - // //DisplayTextElementList.Add(vte); - // //return iend + 3; - // return 0; - // } - // private int DoSymbol(string text, int startIndex, int index) - // { - // displayTextElement vte = new displayTextElement(); - // vte.Type = E_TextElementType.Symbol; - // // symbols are the unicode/rtf command. A symbol can be represented by \'xy or - // // in the text from the database \uxyz?. If the \'xy is used the length of the - // // symbol number will always be two, otherwise find the index of the '?' to - // // find the end. - // int endindx = -1; - // if (text[index + 1] == '\'') endindx = index + 3; - // else endindx = text.IndexOf("?", index); - // vte.Text = text.Substring(index, endindx - index + 1); - // DisplayTextElementList.Add(vte); - // // return the position just past the symbol. - // return endindx + 1; - // } - // #endregion - // #region ReplaceWords - // //private ReplaceStr _rs; - // //private string ReplaceIt(Match m) - // //{ - // // string s = m.ToString(); - // // string t = s.Replace(_rs.ReplaceWord, _rs.ReplaceWith); - // // return m.ToString().Replace(_rs.ReplaceWord, _rs.ReplaceWith); - // //} - // //private string DoReplaceWords(string Text) - // //{ - // // ReplaceStrList rsl = _MyFormat.PlantFormat.FormatData.SectData.ReplaceStrList; - // // foreach (ReplaceStr rs in rsl) - // // { - // // if (_MyItemInfo.MyContent.Type < 20000) return Text; // for now only replace in steps. - // // bool replaceit = false; - - // // // note that the order of this check is important. Check in this order... - // // // background here - // // if (_MyItemInfo.IsHigh && (rs.Flag & E_ReplaceFlags.High) > 0) replaceit = true; - // // else if ((_MyItemInfo.IsTable || _MyItemInfo.IsFigure) && (rs.Flag & E_ReplaceFlags.Table) > 0) replaceit = true; - // // else if (_MyItemInfo.IsInRNO && (rs.Flag & E_ReplaceFlags.RNO) > 0) replaceit = true; - // // else if (_MyItemInfo.IsCaution && (rs.Flag & E_ReplaceFlags.Caution) > 0) replaceit = true; - // // else if (_MyItemInfo.IsNote && (rs.Flag & E_ReplaceFlags.Note) > 0) replaceit = true; - // // else if (_MyItemInfo.IsInFirstLevelSubStep && (rs.Flag & E_ReplaceFlags.Substep) > 0) replaceit = true; - // // else if (_MyItemInfo.IsAccPages & (rs.Flag & E_ReplaceFlags.Attach) > 0) replaceit = true; - - // // if (replaceit) - // // { - // // // CASEINSENS: Do ReplaceWords for all words that match, regardless of case, and replace - // // // with the ReplaceWith string as is - // // if ((rs.Flag & E_ReplaceFlags.CaseInsens) > 0) - // // { - // // string res = ""; - // // string fortest = Text.ToUpper(); - // // string pat = @"(?<=\W|^)" + rs.ReplaceWord.ToUpper() + @"(?=\W|$)"; - // // int cpindx = 0; - // // foreach (Match m in Regex.Matches(fortest, pat)) - // // { - // // res += Text.Substring(cpindx, m.Index - cpindx); - // // cpindx += (m.Index - cpindx); - // // res += rs.ReplaceWith; - // // cpindx += rs.ReplaceWord.Length; - // // } - // // if (cpindx < Text.Length) res += Text.Substring(cpindx, Text.Length - cpindx); - // // Text = res; - // // } - // // // CASEINSENSALL: Do ReplaceWords for all words that match the ReplaceWord, regardless of case - // // else if ((rs.Flag & E_ReplaceFlags.CaseInsensAll) > 0) - // // { - // // // not in hlp - // // } - // // // CASEINSENSFIRST: Do ReplaceWords for all words that exactly match the ReplaceWord, - // // // except the case where the first character may be different - // // else if ((rs.Flag & E_ReplaceFlags.CaseInsensFirst) > 0) - // // { - // // // not in hlp - // // } - // // else - // // { - // // string pat = @"(?<=\W|^)" + rs.ReplaceWord + @"(?=\W|$)"; - // // Text = Regex.Replace(Text, pat, rs.ReplaceWith); - // // } - - // // } - // // } - // // return Text; - // //} - // #endregion - //} - //#region displayTextElementClass - //public enum E_TextElementType : uint - //{ - // Text = 0, - // Transition = 1, - // TransitionRange = 2, - // ReferencedObject = 3, - // Symbol = 4 - //}; - //public class displayTextElement - //{ - // private E_TextElementType _Type; - // public E_TextElementType Type - // { - // get { return _Type; } - // set { _Type = value; } - // } - // private string _Text; - // public string Text - // { - // get { return _Text; } - // set { _Text = value; } - // } - //} - //public class displayLinkElement : displayTextElement - //{ - // private string _Link; - // public string Link - // { - // get { return _Link; } - // set { _Link = value; } - // } - //} - //#endregion - -} \ No newline at end of file diff --git a/PROMS/Volian.Svg.Library/SvgRtf.cs b/PROMS/Volian.Svg.Library/SvgRtf.cs deleted file mode 100644 index 2feb4966..00000000 --- a/PROMS/Volian.Svg.Library/SvgRtf.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.Xml.Serialization; -using System.ComponentModel; - -namespace Volian.Svg.Library -{ - // planned to be done early on but became a problem. -} diff --git a/PROMS/Volian.Svg.Library/Volian.Svg.Library.sln b/PROMS/Volian.Svg.Library/Volian.Svg.Library.sln deleted file mode 100644 index 5ab6e57d..00000000 --- a/PROMS/Volian.Svg.Library/Volian.Svg.Library.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volian.Svg.Library", "Volian.Svg.Library.csproj", "{293911B5-C602-483F-A97F-F962EEFB3CAE}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {293911B5-C602-483F-A97F-F962EEFB3CAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {293911B5-C602-483F-A97F-F962EEFB3CAE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {293911B5-C602-483F-A97F-F962EEFB3CAE}.Debug|x86.ActiveCfg = Debug|x86 - {293911B5-C602-483F-A97F-F962EEFB3CAE}.Debug|x86.Build.0 = Debug|x86 - {293911B5-C602-483F-A97F-F962EEFB3CAE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {293911B5-C602-483F-A97F-F962EEFB3CAE}.Release|Any CPU.Build.0 = Release|Any CPU - {293911B5-C602-483F-A97F-F962EEFB3CAE}.Release|x86.ActiveCfg = Release|x86 - {293911B5-C602-483F-A97F-F962EEFB3CAE}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/PROMS/Volian.Svg.Library/iTextSharp.cs.bak b/PROMS/Volian.Svg.Library/iTextSharp.cs.bak deleted file mode 100644 index 157539a2..00000000 --- a/PROMS/Volian.Svg.Library/iTextSharp.cs.bak +++ /dev/null @@ -1,1168 +0,0 @@ -using System; -using System.Collections; -using System.Text; -using System.Collections.Generic; -using System.Xml.Serialization; -using iTextSharp.text; -using iTextSharp.text.pdf; -using iTextSharp.text.factories; -using Itenso.Rtf; -using Itenso.Rtf.Parser; -using Itenso.Rtf.Interpreter; -using Itenso.Rtf.Support; -using Microsoft.Win32; -using System.Text.RegularExpressions; -using System.Xml; -using System.IO; - -namespace Volian.Svg.Library -{ - public static class VolianPdf - { - public static int PageCount(string fileName) - { - PdfReader pdfr = new PdfReader(fileName); - int retval = pdfr.NumberOfPages; - pdfr.Close(); - return retval; - } - public static void RegisterFont(string fontName) - { - if (!iTextSharp.text.FontFactory.IsRegistered(fontName)) - { - //foreach (string name in FontKey.GetValueNames()) - //{ - // if (name.StartsWith(fontName)) - // { - // string fontFile = (string)FontKey.GetValue(name); - // iTextSharp.text.FontFactory.Register(fontFile.Contains("\\") ? fontFile : FontFolder + "\\" + fontFile); - // } - //} - iTextSharp.text.FontFactory.RegisterDirectories(); - } - } - private static RegistryKey _FontKey = Registry.LocalMachine.OpenSubKey("Software").OpenSubKey("Microsoft").OpenSubKey("Windows NT").OpenSubKey("CurrentVersion").OpenSubKey("Fonts"); - public static RegistryKey FontKey - { get { return _FontKey; } } - private static string _FontFolder = (String)Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Microsoft").OpenSubKey("Windows").OpenSubKey("CurrentVersion").OpenSubKey("Explorer").OpenSubKey("Shell Folders").GetValue("Fonts"); - public static string FontFolder - { get { return _FontFolder; } } - public static iTextSharp.text.Font GetFont(string fontName, int size, int style) - { - RegisterFont(fontName); - return iTextSharp.text.FontFactory.GetFont(fontName, BaseFont.IDENTITY_H, BaseFont.EMBEDDED, size / 2, style); - } - public static iTextSharp.text.Font GetFont(System.Drawing.Font font) // fontName, int size, int style) - { - RegisterFont(font.Name); - int style = (font.Bold ? iTextSharp.text.Font.BOLD : 0) + (font.Italic ? iTextSharp.text.Font.ITALIC : 0); - return iTextSharp.text.FontFactory.GetFont(font.Name, BaseFont.IDENTITY_H, BaseFont.EMBEDDED, font.Size, style); - } - } - internal static class SvgITextLibrary - { - public static void StrokeAndFill(PdfContentByte cb, bool stroke, bool fill) - { - switch ((stroke ? 1 : 0) + (fill ? 2 : 0)) - { - case 0: // No Stroke or Fill - break; - case 1: // Stroke - cb.Stroke(); - break; - case 2: // Fill - cb.Fill(); - break; - case 3: // Stroke and Fill - cb.FillStroke(); - break; - } - } - } - public abstract partial class SvgPart - { - public abstract void Draw(PdfContentByte cb, SvgScale scale, Svg mySvg, SvgPartInheritance myParent); - public abstract void Draw(PdfTemplate tmp, SvgScale scale, Svg mySvg, SvgPartInheritance myParent); - } - public partial class SvgPartInheritance : SvgPart - { - public override void Draw(PdfContentByte cb, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - } - public override void Draw(PdfTemplate tmp, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - } - } - // TODO: Pages - // TODO: Page Background - public delegate string SvgProcessTextEvent(object sender, SvgProcessTextArgs args); - public class SvgProcessTextArgs - { - private string _MyText; - public string MyText - { - get { return _MyText; } - } - private SvgText _MySvgText; - public SvgText MySvgText - { - get { return _MySvgText; } - set { _MySvgText = value; } - } - private SvgScale _MySvgScale; - public SvgScale MySvgScale - { - get { return _MySvgScale; } - set { _MySvgScale = value; } - } - public SvgProcessTextArgs(string myText, SvgText mySvgText, SvgScale mySvgScale) - { - _MyText = myText; - _MySvgText = mySvgText; - _MySvgScale = mySvgScale; - } - } - public partial class Svg : SvgGroup - { - public void DrawMacro(string macroDef, float x, float y, PdfContentByte cb) - { - _MyContentByte = cb; - SvgMeasurement X = new SvgMeasurement(x, E_MeasurementUnits.PT); - SvgMeasurement Y = new SvgMeasurement(Height.GetSizeInPoints(72) - y, E_MeasurementUnits.PT); - if (!this.LookUp.ContainsKey(macroDef)) return; // AEP - DU1 (missing C22 macro for AEP) - SvgGroup macro = this[macroDef] as SvgGroup; - macro.SvgParts.Draw(cb, MyScale.AdjustOrigin(X, Y), this,this); - } - public event SvgProcessTextEvent ProcessText; - internal string OnProcessText(string myText, SvgText mySvgText, SvgScale scale) - { - if (ProcessText != null) - return ProcessText(this, new SvgProcessTextArgs(myText, mySvgText, scale)); - return myText; - } - private Dictionary _Templates; - public PdfTemplate GetTemplate(string name, PdfContentByte cb) - { - if (!_Templates.ContainsKey(name)) - { - PdfTemplate tmp = cb.CreateTemplate(100, 100); - _Templates.Add(name, tmp); - } - return _Templates[name]; - } - public static void FixBoundingBox(PdfTemplate tmp, float xll, float yll, float xul, float yul) - { - float left = tmp.BoundingBox.Left; - float bottom = tmp.BoundingBox.Bottom; - float right = tmp.BoundingBox.Right; - float top = tmp.BoundingBox.Top; - left = (xll < xul ? (xll < left ? xll : left) : (xul < left ? xul : left)); - right = (xll > xul ? (xll > right ? xll : right) : (xul > right ? xul : right)); - bottom = (yll < yul ? (yll < bottom ? yll : bottom) : (yul < bottom ? yul : bottom)); - top = (yll > yul ? (yll > top ? yll : top) : (yul > top ? yul : top)); - tmp.BoundingBox = new iTextSharp.text.Rectangle(xll, yll, xul, yul); - } - private PdfContentByte _MyContentByte; - [XmlIgnore] - public PdfContentByte MyContentByte - { - get { return _MyContentByte; } - set { _MyContentByte = value; } - } - private float _LeftMargin = 0; - public float LeftMargin - { - get { return _LeftMargin; } - set { _LeftMargin = value; } - } - private float _TopMargin = 0; - public float TopMargin - { - get { return _TopMargin; } - set { _TopMargin = value; } - } - private SvgScale _MyScale; - public SvgScale MyScale - { - get - { - if (_MyScale == null) - { - _MyScale = new SvgScale(72, new System.Drawing.RectangleF(0, 0, _MyContentByte.PdfWriter.PageSize.Width, _MyContentByte.PdfWriter.PageSize.Height), _Width, _Height, _ViewBox); - _MyScale.XLowerLimit -= _LeftMargin; - _MyScale.YLowerLimit -= _TopMargin; - } - return _MyScale; - } - } - public void Draw(PdfContentByte cb) - { - //myPdf.Clear(); - _MyContentByte = cb; - _Templates = new Dictionary(); - //RegisterFonts(); - SvgParts.Draw(cb, MyScale, this, this); //72 - Points - } - public static iTextSharp.text.Font GetFont(string fontName) - { - RegisterFont(fontName); - return FontFactory.GetFont(fontName); - } - public static iTextSharp.text.Font GetFont(string fontName, float size, int style, System.Drawing.Color color) - { - RegisterFont(fontName); - return FontFactory.GetFont(fontName, size, style, new iTextSharp.text.Color(color)); - } - public static void RegisterFont(string fontName) - { - if (!FontFactory.IsRegistered(fontName)) - { - foreach (string name in FontKey.GetValueNames()) - { - if (name.StartsWith(fontName)) - { - string fontFile = (string) FontKey.GetValue(name); - FontFactory.Register(fontFile.Contains("\\") ? fontFile : FontFolder + "\\" + fontFile); - } - } - } - } - private static RegistryKey _FontKey = Registry.LocalMachine.OpenSubKey("Software").OpenSubKey("Microsoft").OpenSubKey("Windows NT").OpenSubKey("CurrentVersion").OpenSubKey("Fonts"); - public static RegistryKey FontKey - { get { return _FontKey; } } - private static string _FontFolder = (String)Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Microsoft").OpenSubKey("Windows").OpenSubKey("CurrentVersion").OpenSubKey("Explorer").OpenSubKey("Shell Folders").GetValue("Fonts"); - public static string FontFolder - { get { return _FontFolder; } } - private static int _StackTraceSkip = 1; - private static DateTime _LastTime = DateTime.Now; - private static DateTime _StartTime = DateTime.Now; - public static void ResetWhen() - { - _StartTime = _LastTime = DateTime.Now; - } - public static void WhenAndWhere() - { - DateTime thisTime = DateTime.Now; - System.Diagnostics.StackFrame sf = new System.Diagnostics.StackFrame(_StackTraceSkip, true); - Console.WriteLine("{0:000000},{1:000000},'{2}',{3},'{4}'", TimeSpan.FromTicks(thisTime.Ticks - _StartTime.Ticks).TotalMilliseconds, - TimeSpan.FromTicks(thisTime.Ticks - _LastTime.Ticks).TotalMilliseconds, sf.GetMethod().Name, sf.GetFileLineNumber() - ,sf.GetFileName()); - _LastTime = thisTime; - } - } - public partial class SvgArc : SvgShapePart - { - public override void Draw(PdfContentByte cb, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - cb.SaveState(); - SetupInheritance(myParent.MyInheritedSettings); - if (FillColor != System.Drawing.Color.Transparent) - cb.SetColorFill(new Color(FillColor)); - if (OutlineWidth.Value != 0F && OutlineColor != System.Drawing.Color.Empty) - { - cb.SetLineWidth(scale.M(OutlineWidth)); - cb.SetColorStroke(new Color(OutlineColor)); - } - cb.Ellipse(scale.X(CX - Radius), scale.Y(cb, CY - Radius), scale.M(Radius * 2), scale.M(Radius * 2)); - SvgITextLibrary.StrokeAndFill(cb, (OutlineWidth.Value != 0F && OutlineColor != System.Drawing.Color.Empty), (FillColor != System.Drawing.Color.Transparent)); - cb.RestoreState(); - } - public override void Draw(PdfTemplate tmp, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - tmp.SaveState(); - SetupInheritance(myParent.MyInheritedSettings); - if (FillColor != System.Drawing.Color.Transparent) - tmp.SetColorFill(new Color(FillColor)); - if (OutlineWidth.Value != 0F && OutlineColor != System.Drawing.Color.Empty) - { - tmp.SetLineWidth(scale.M(OutlineWidth)); - tmp.SetColorStroke(new Color(OutlineColor)); - } - tmp.Ellipse(scale.X(CX - Radius), scale.Y(CY - Radius), scale.M(Radius * 2), scale.M(Radius * 2)); - SvgITextLibrary.StrokeAndFill(tmp, (OutlineWidth.Value != 0F && OutlineColor != System.Drawing.Color.Empty), (FillColor != System.Drawing.Color.Transparent)); - tmp.RestoreState(); - } - } - public partial class SvgCircle : SvgShapePart - { - public override void Draw(PdfContentByte cb, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - SetupInheritance(myParent.MyInheritedSettings); - cb.SaveState(); - bool fill = FillColor != System.Drawing.Color.Transparent; - bool stroke = OutlineWidth.Value != 0F && OutlineColor != System.Drawing.Color.Empty; - if (fill) - cb.SetColorFill(new Color(FillColor)); - if (stroke) - { - cb.SetLineWidth(scale.M(OutlineWidth)); - cb.SetColorStroke(new Color(OutlineColor)); - } - float x1 = scale.X(CX - Radius); - float y1 = scale.Y(cb, CY - Radius); - float x2 = scale.X(CX + Radius); - float y2 = scale.Y(cb, CY + Radius); - cb.Ellipse(x1, y1, x2, y2); - SvgITextLibrary.StrokeAndFill(cb, stroke, fill); - cb.RestoreState(); - } - public override void Draw(PdfTemplate tmp, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - SetupInheritance(myParent.MyInheritedSettings); - tmp.SaveState(); - bool fill = FillColor != System.Drawing.Color.Transparent; - bool stroke = OutlineWidth.Value != 0F && OutlineColor != System.Drawing.Color.Empty; - if (fill) - tmp.SetColorFill(new Color(FillColor)); - if (stroke) - { - tmp.SetLineWidth(scale.M(OutlineWidth)); - tmp.SetColorStroke(new Color(OutlineColor)); - } - tmp.Ellipse(scale.X(CX - Radius), scale.Y(CY - Radius), scale.X(CX + Radius), scale.Y(CY + Radius)); - SvgITextLibrary.StrokeAndFill(tmp, stroke, fill); - tmp.RestoreState(); - Svg.FixBoundingBox(tmp, scale.X(CX - Radius), scale.Y(CY - Radius), scale.X(CX + Radius), scale.Y(CY + Radius)); - } - } - public partial class SvgDefine : SvgGroup - { - public override void Draw(PdfContentByte cb, SvgScale myScale, Svg mySvg, SvgPartInheritance myParent) - { - // TODO: Could I try creating a template - // Don't draw - // SvgParts.Draw(cb, myScale, mySvg, myParent); - PdfTemplate tmp = null; - if (ID != "") tmp = mySvg.GetTemplate(ID, cb); // the size will be adjusted as items are added. - SvgParts.Draw(tmp, myScale, mySvg, myParent); - } - public override void Draw(PdfTemplate tmp, SvgScale myScale, Svg mySvg, SvgPartInheritance myParent) - { - // TODO: Could I try creating a template - // Don't draw - // SvgParts.Draw(cb, myScale, mySvg, myParent); - //PdfTemplate tmp2 = mySvg.GetTemplate(ID); // the size will be adjusted as items are added. - //SvgParts.Draw(tmp2, myScale, mySvg, myParent); - } - } - public partial class SvgUse : SvgPartInheritance - { - private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - public override void Draw(PdfContentByte cb, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - // TODO: Could I use the template - SetupInheritance(myParent.MyInheritedSettings); - if (mySvg.LookUp.ContainsKey(_UseID)) - mySvg[_UseID].Draw(cb, scale.AdjustOrigin(X, Y), mySvg, this); - else - { - _MyLog.WarnFormat("Missing Macro '{0}'", _UseID); - } - //cb.AddTemplate(mySvg.GetTemplate(_UseID.Substring(1),cb), scale.X(X), scale.Y(cb, Y)); - } - public override void Draw(PdfTemplate tmp, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - // TODO: Could I use the template - SetupInheritance(myParent.MyInheritedSettings); - //mySvg[_UseID.Substring(1)].Draw(tmp, scale.AdjustOrigin(X, Y), mySvg, this); - mySvg[_UseID].Draw(tmp, scale.AdjustOrigin(X, Y), mySvg, this); - } - } - public partial class SvgEllipse : SvgShapePart - { - public override void Draw(PdfContentByte cb, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - SetupInheritance(myParent.MyInheritedSettings); - cb.SaveState(); - bool fill = FillColor != System.Drawing.Color.Transparent; - bool stroke = OutlineWidth.Value != 0F && OutlineColor != System.Drawing.Color.Empty; - if (fill) - cb.SetColorFill(new Color(FillColor)); - if (stroke) - { - cb.SetLineWidth(scale.M(OutlineWidth)); - cb.SetColorStroke(new Color(OutlineColor)); - } - cb.Ellipse(scale.X(CX - RX), scale.Y(cb, CY - RY), scale.X(CX + RX), scale.Y(cb, CY + RY)); - SvgITextLibrary.StrokeAndFill(cb, stroke, fill); - cb.RestoreState(); - } - public override void Draw(PdfTemplate tmp, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - SetupInheritance(myParent.MyInheritedSettings); - tmp.SaveState(); - bool fill = FillColor != System.Drawing.Color.Transparent; - bool stroke = OutlineWidth.Value != 0F && OutlineColor != System.Drawing.Color.Empty; - if (fill) - tmp.SetColorFill(new Color(FillColor)); - if (stroke) - { - tmp.SetLineWidth(scale.M(OutlineWidth)); - tmp.SetColorStroke(new Color(OutlineColor)); - } - tmp.Ellipse(scale.X(CX - RX), scale.Y(CY - RY), scale.X(CX + RX), scale.Y(CY + RY)); - SvgITextLibrary.StrokeAndFill(tmp, stroke, fill); - tmp.RestoreState(); - } - } - public partial class SvgGroup : SvgPartInheritance - { - public override void Draw(PdfContentByte cb, SvgScale myScale, Svg mySvg, SvgPartInheritance myParent) - { - SetupInheritance(myParent.MyInheritedSettings); - _SvgParts.Draw(cb, myScale, mySvg, this); - } - public override void Draw(PdfTemplate tmp, SvgScale myScale, Svg mySvg, SvgPartInheritance myParent) - { - SetupInheritance(myParent.MyInheritedSettings); - if (ID != "") tmp = mySvg.GetTemplate(ID, mySvg.MyContentByte); // the size will be adjusted as items are added. - SvgParts.Draw(tmp, myScale, mySvg, this); - } - } - public partial class SvgImage : SvgPart - { - public override void Draw(PdfContentByte cb, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - SetupInheritance(myParent.MyInheritedSettings); - cb.SaveState(); - iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(ImagePath); - if (Height.Value != 0) - img.ScaleAbsoluteHeight(scale.M(Height)); - if (Width.Value != 0) - img.ScaleAbsoluteWidth(scale.M(Width)); - img.SetAbsolutePosition(scale.X(X), scale.Y(cb, Y) - scale.M(img.ScaledHeight)); - // The next three lines set the image opacity for testing - //PdfGState gState = new PdfGState(); - //gState.FillOpacity = .2f; - //cb.SetGState(gState); - cb.AddImage(img); - cb.RestoreState(); - } - public override void Draw(PdfTemplate tmp, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - SetupInheritance(myParent.MyInheritedSettings); - tmp.SaveState(); - iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(ImagePath); - img.ScaleAbsolute(scale.M(Width), scale.M(Height)); - img.SetAbsolutePosition(scale.X(X), scale.Y(Y) - scale.M(img.ScaledHeight)); - tmp.AddImage(img); - tmp.RestoreState(); - } - } - public partial class SvgLine : SvgLinePart - { - public override void Draw(PdfContentByte cb, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - SetupInheritance(myParent.MyInheritedSettings); - cb.SaveState(); - bool stroke = LineColor != System.Drawing.Color.Empty; - if (stroke) - { - cb.SetLineWidth(LineWidth.Value); - cb.SetColorStroke(new Color(LineColor)); - } - cb.SetLineCap(PdfContentByte.LINE_CAP_ROUND); - if (myParent is SvgGroup && (myParent as SvgGroup).Description.ToUpper() == "ABSOLUTE") - { - cb.MoveTo(scale.AbsX(X1), scale.AbsY(cb, Y1)); - cb.LineTo(scale.AbsX(X2), scale.AbsY(cb, Y2)); - } - else - { - cb.MoveTo(scale.X(X1), scale.Y(cb, Y1)); - cb.LineTo(scale.X(X2), scale.Y(cb, Y2)); - } - cb.Stroke(); - cb.RestoreState(); - } - public override void Draw(PdfTemplate tmp, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - SetupInheritance(myParent.MyInheritedSettings); - tmp.SaveState(); - bool stroke = LineColor != System.Drawing.Color.Empty; - if (stroke) - { - tmp.SetLineWidth(scale.M(LineWidth)); - tmp.SetColorStroke(new Color(LineColor)); - } - tmp.MoveTo(scale.X(X1), scale.Y(Y1)); - tmp.LineTo(scale.X(X2), scale.Y(Y2)); - tmp.Stroke(); - tmp.RestoreState(); - Svg.FixBoundingBox(tmp, scale.X(X1), scale.Y(Y1), scale.X(X2), scale.Y(Y2)); - } - } - public partial class SvgParts : CollectionBase - { - public void Draw(PdfContentByte cb, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - foreach (SvgPart svgPart in List) - svgPart.Draw(cb, scale, mySvg, myParent); - } - public void Draw(PdfTemplate tmp, SvgScale myScale, Svg mySvg, SvgPartInheritance myParent) - { - foreach (SvgPart svgPart in List) - svgPart.Draw(tmp, myScale, mySvg, myParent); - } - } - public partial class SvgRectangle : SvgShapePart - { - public override void Draw(PdfContentByte cb, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - SetupInheritance(myParent.MyInheritedSettings); - cb.SaveState(); - bool fill = FillColor != System.Drawing.Color.Transparent; - bool stroke = OutlineWidth.Value != 0F && OutlineColor != System.Drawing.Color.Empty; - if (fill) - cb.SetColorFill(new Color(FillColor)); - if (stroke) - { - cb.SetLineWidth(scale.M(OutlineWidth)); - cb.SetColorStroke(new Color(OutlineColor)); - } - if (myParent is SvgGroup && (myParent as SvgGroup).Description.ToUpper() == "ABSOLUTE") - cb.RoundRectangle(scale.AbsX(X), scale.AbsY(cb, Y), scale.M(Width), -scale.M(Height), .005F); - else - cb.RoundRectangle(scale.X(X), scale.Y(cb, Y), scale.M(Width), -scale.M(Height), .005F); - SvgITextLibrary.StrokeAndFill(cb, stroke, fill); - cb.RestoreState(); - } - public override void Draw(PdfTemplate tmp, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - SetupInheritance(myParent.MyInheritedSettings); - if (ID != "") tmp = mySvg.GetTemplate(ID, mySvg.MyContentByte); // the size will be adjusted as items are added. - tmp.SaveState(); - bool fill = FillColor != System.Drawing.Color.Transparent; - bool stroke = OutlineWidth.Value != 0F && OutlineColor != System.Drawing.Color.Empty; - if (fill) - tmp.SetColorFill(new Color(FillColor)); - if (stroke) - { - tmp.SetLineWidth(scale.M(OutlineWidth)); - tmp.SetColorStroke(new Color(OutlineColor)); - } - tmp.Rectangle(scale.X(X), scale.Y(Y), scale.M(Width), -scale.M(Height)); - SvgITextLibrary.StrokeAndFill(tmp, stroke, fill); - Svg.FixBoundingBox(tmp, scale.X(X), scale.Y(Y), scale.X(X) + scale.M(Width), scale.Y(Y) - scale.M(Height)); - tmp.RestoreState(); - } - } - public partial class SvgText : SvgShapePart - { - private static string ReplaceSpecialCharacter(Match m) - { - int i = int.Parse(m.ToString().Substring(2, m.ToString().Length - 3)); - char c = (char)i; - return c.ToString(); - } - private static string ReplaceHexCharacter(Match m) - { - int i = int.Parse(m.ToString().Substring(2, 2), System.Globalization.NumberStyles.HexNumber); - char c = (char)i; - return c.ToString(); - } - public int Align - { - get - { - switch (Justify) - { - case SvgJustify.Left: - return Element.ALIGN_LEFT; - break; - case SvgJustify.Center: - return Element.ALIGN_CENTER; - break; - case SvgJustify.Right: - return Element.ALIGN_RIGHT; - break; - } - return Element.ALIGN_LEFT; - } - } - // Draw's using PdfContentByte are for drawing PageList items. - public override void Draw(PdfContentByte cb, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - string text = mySvg.OnProcessText(Text, this, scale); - if (text == string.Empty) return; - SetupInheritance(myParent.MyInheritedSettings); - float yScale = (myParent is SvgGroup && (myParent as SvgGroup).Description.ToUpper() == "ABSOLUTE") ? scale.AbsY(cb, Y): scale.Y(cb, Y); - cb.SaveState(); - bool fill = FillColor != System.Drawing.Color.Transparent; - bool stroke = OutlineWidth.Value != 0F && OutlineColor != System.Drawing.Color.Empty; - - // Strip out inline commands that are overridden by the fontStyle - if (Font.Bold) text = StripCommands(text, @"\\b0", @"\\b"); - if (Font.Italic) text = StripCommands(text, @"\\i0", @"\\i"); - if (Font.Underline) text = StripCommands(text, @"\\ulnone", @"\\ul0", @"\\ul"); - - float fontSize = scale.M(new SvgMeasurement(Font.SizeInPoints, E_MeasurementUnits.PT)); - int fontStyle = (Font.Bold ? iTextSharp.text.Font.BOLD : 0) + (Font.Italic ? iTextSharp.text.Font.ITALIC : 0); - VolianPdf.RegisterFont(Font.Name); - //if (iTextSharp.text.FontFactory.IsRegistered(Font.Name) == false) - //{ - // //iTextSharp.text.FontFactory.RegisterDirectories(); - //} - iTextSharp.text.Font font = FontFactory.GetFont(Font.Name, BaseFont.IDENTITY_H, true, fontSize, fontStyle, new Color(FillColor)); - - Phrase ph = BuildPhrase(text, fontSize, fontStyle, font); - ColumnText ct = new ColumnText(cb); - float x = (myParent is SvgGroup && (myParent as SvgGroup).Description.ToUpper() == "ABSOLUTE") ? scale.AbsX(X): scale.X(X); - float w = 0; // chk.GetWidthPoint(); - foreach (Chunk chk in ph.Chunks) - w += chk.GetWidthPoint(); - switch (Justify) - { - //case SvgJustify.Left: - // x = x; - // break; - case SvgJustify.Center: - x-=w/2; - break; - case SvgJustify.Right: - x-=w; - break; - } - float y = yScale; - float xRight = x + w; - float Offset = 0; - if (Font.Underline) - { - foreach (Chunk chk in ph.Chunks) - chk.SetUnderline(new Color(FillColor), 0, 0.047F, 0, -.1373F, PdfContentByte.LINE_CAP_ROUND); - } - // The following line was changed so that a 6.5 size font would print, i.e. the 2 was changed to a 3 to make the - // 6.5 size work. - ct.SetSimpleColumn(x, y + ph.Leading + Offset, xRight + 1F, y + ph.Leading + Offset - 3 * font.Size);//2 * font.Size); - ct.AddElement(ph); - cb.SaveState(); - cb.SetColorFill(new Color(FillColor)); - ct.Go(); - cb.RestoreState(); - } - - private Phrase BuildPhrase(string text, float fontSize, int fontStyle, iTextSharp.text.Font font) - { - //if (text == "Caution") - //{ - // if (iTextSharp.text.FontFactory.IsRegistered("VolianScript")) - // Console.WriteLine("Is Registered"); - // Console.WriteLine("stop"); - //} - bool fontUnderline = false; - float fontTextRise = 0; - - text = Regex.Replace(text, @"\\u[0-9]+[?]", new MatchEvaluator(ReplaceSpecialCharacter)); - text = Regex.Replace(text, @"\\'[0-9a-fA-F][0-9a-fA-F]", new MatchEvaluator(ReplaceHexCharacter)); - text += " "; - Phrase ph = new Phrase(); - while (text.Length > 0) - { - string next = ""; - Match m = Regex.Match(text, @"\\[^ ]*?[ $]"); - if (m.Success) - { - // text is portion of text and next is remaining portion to process next - next = text.Substring(m.Index + m.Length); - text = text.Substring(0, m.Index); - } - else - if (text[text.Length - 1] == ' ') text = text.Substring(0, text.Length - 1); - - foreach (Chunk chk in BuildPartialPhrase(text, fontSize, fontStyle, font).Chunks) - { - if (fontUnderline) chk.SetUnderline(font.Color, 0, 0.05F, 0, -.131F, PdfContentByte.LINE_CAP_ROUND); - if (fontTextRise != 0) chk.SetTextRise(fontTextRise * chk.Font.Size); - ph.Add(chk); - } - if (m.Success) - { - // bold, underline, italics, subscript, superscript - if (m.Value.Contains(@"\ulnone") || m.Value.Contains(@"\ul0")) // off - fontUnderline = false; - else if (m.Value.Contains(@"\ul")) - fontUnderline = true; - if (m.Value.Contains(@"\up0") || m.Value.Contains(@"\dn0")) fontTextRise = 0; - else if (m.Value.Contains(@"\up")) fontTextRise = .25F; - else if (m.Value.Contains(@"\dn")) fontTextRise = -.25F; - if (m.Value.Contains(@"\b0")) - { - fontStyle ^= iTextSharp.text.Font.BOLD; - font = FontFactory.GetFont(font.Familyname, BaseFont.IDENTITY_H, true, fontSize, fontStyle, new Color(FillColor)); - } - else if (m.Value.Contains(@"\b")) - { - fontStyle |= iTextSharp.text.Font.BOLD; - font = FontFactory.GetFont(font.Familyname, BaseFont.IDENTITY_H, true, fontSize, fontStyle, new Color(FillColor)); - } - if (m.Value.Contains(@"\i0")) - { - fontStyle ^= iTextSharp.text.Font.ITALIC; - font = FontFactory.GetFont(font.Familyname, BaseFont.IDENTITY_H, true, fontSize, fontStyle, new Color(FillColor)); - } - else if (m.Value.Contains(@"\i")) - { - fontStyle |= iTextSharp.text.Font.ITALIC; - font = FontFactory.GetFont(font.Familyname, BaseFont.IDENTITY_H, true, fontSize, fontStyle, new Color(FillColor)); - } - } - text = next; - } - return ph; - } - - private Phrase BuildPartialPhrase(string text, float fontSize, int fontStyle, iTextSharp.text.Font font) - { - iTextSharp.text.pdf.FontSelector fs = new FontSelector(); - fs.AddFont(font); - if (font.BaseFont != null && font.BaseFont.GetWidthPoint("m", 12) == font.BaseFont.GetWidthPoint(".", 12)) - { - VolianPdf.RegisterFont("VESymbFix"); - fs.AddFont(FontFactory.GetFont("VESymbFix", BaseFont.IDENTITY_H, true, fontSize, fontStyle, new Color(FillColor))); - } - else - { - VolianPdf.RegisterFont("Arial Unicode MS"); - fs.AddFont(FontFactory.GetFont("Arial Unicode MS", BaseFont.IDENTITY_H, true, fontSize, fontStyle, new Color(FillColor))); - } - - Phrase ph = fs.Process(text); - return ph; - } - - private string StripCommands(string text, params string [] rtfCommands) - { - foreach (string rtfCommand in rtfCommands) - { - // remove rtf command preceeded by another rtf command with previous - // rtf ending with a space, i.e. "\ulnone\b0 " removing the "b0", leaves " " - // * - as many as there are, ? - minimum number that results in a match - text = Regex.Replace(text, @"(\\[^ ]*?)" + rtfCommand + " ", "$1 "); - // remove rtf command follwed by a space - text = Regex.Replace(text, rtfCommand + " ", ""); - // remove just the rtf command - text = Regex.Replace(text, rtfCommand, ""); - } - return text; - } - // Draw's using PdfTemplate are for drawing SVG (16-bit genmac). - public override void Draw(PdfTemplate tmp, SvgScale scale, Svg mySvg, SvgPartInheritance myParent) - { - string text = mySvg.OnProcessText(Text, this, scale); - if (text == string.Empty) return; - SetupInheritance(myParent.MyInheritedSettings); - float yScale = -scale.Y(Y); - tmp.SaveState(); - bool fill = FillColor != System.Drawing.Color.Transparent; - bool stroke = OutlineWidth.Value != 0F && OutlineColor != System.Drawing.Color.Empty; - tmp.BeginText(); - if (fill) - tmp.SetColorFill(new Color(FillColor)); - if (stroke) - { - tmp.SetLineWidth(scale.M(OutlineWidth)); - tmp.SetColorStroke(new Color(OutlineColor)); - } - iTextSharp.text.Font font = Svg.GetFont(Font.Name); - BaseFont baseFont = font.BaseFont; - tmp.MoveText(scale.X(X), yScale); - tmp.SetFontAndSize(baseFont, scale.M(new SvgMeasurement(Font.SizeInPoints, E_MeasurementUnits.PT))); - switch ((stroke ? 1 : 0) + (fill ? 2 : 0)) - { - case 0: // No Stroke or Fill - tmp.SetTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_INVISIBLE); - break; - case 1: // Stroke - tmp.SetTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_STROKE); - break; - case 2: // Fill - tmp.SetTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL); - break; - case 3: // Stroke and Fill - tmp.SetTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE); - break; - } - tmp.ShowTextKerned(text); - tmp.EndText(); - tmp.RestoreState(); - } - } - public class SvgPageTotal - { - public SvgPageTotal(System.Drawing.Font myFont, PdfContentByte cb) - { - _MyFont = myFont; - _MyTemplate = cb.CreateTemplate(100, 100); - _MyTemplate.BoundingBox= new Rectangle(-20, -20, 100, 100); - } - private int _PageCount=1; - private System.Drawing.Font _MyFont; - private PdfTemplate _MyTemplate; - public PdfTemplate MyTemplate - { - get { return _MyTemplate; } - } - public void Draw() - { - // Output Page Count - _MyTemplate.BeginText(); - iTextSharp.text.Font font = Svg.GetFont(_MyFont.Name); - BaseFont baseFont = font.BaseFont; - _MyTemplate.SetFontAndSize(baseFont,_MyFont.Size); - _MyTemplate.SetTextMatrix(0, 0); - _MyTemplate.ShowText(_PageCount.ToString()); - _MyTemplate.EndText(); - } - } - public class SvgPageHelper : PdfPageEventHelper - { - private List _AllowedWatermarks = new List(); - public List AllowedWatermarks - { - get { return _AllowedWatermarks; } - set { _AllowedWatermarks = value; } - } - private Svg _MySvg; - public Svg MySvg - { - get { return _MySvg; } - set { _MySvg = value; } - } - private PdfLayer _PageListLayer; - public PdfLayer PageListLayer - { - get { return _PageListLayer; } - set { _PageListLayer = value; } - } - private PdfLayer _WatermarkLayer; - public PdfLayer WatermarkLayer - { - get { return _WatermarkLayer; } - set { _WatermarkLayer = value; } - } - private string _Watermark=string.Empty; - public string Watermark - { - get { return _Watermark; } - set { _Watermark = value; } - } - private bool _DoZoomOMatic = false; - public bool DoZoomOMatic - { - get { return _DoZoomOMatic; } - set { _DoZoomOMatic = value; } - } - private int _CurrentPageNumber = 0; - public int CurrentPageNumber - { - get { return _CurrentPageNumber; } - set { _CurrentPageNumber = value; } - } - private bool _OnFoldoutPage = false; - public bool OnFoldoutPage - { - get { return _OnFoldoutPage; } - set { _OnFoldoutPage = value; } - } - private bool _CreatingFoldoutPage = false; - public bool CreatingFoldoutPage - { - get { return _CreatingFoldoutPage; } - set { _CreatingFoldoutPage = value; } - } - public SvgPageHelper(Svg mySvg) - { - _MySvg = mySvg; - } - public SvgPageHelper() - { - } - private int _BGPageOffset = 0; - public int BackgroundPageOffset - { - get { return _BGPageOffset; } - set { _BGPageOffset = value; } - } - protected virtual string ReplacePageListToken(Match match) - { - return string.Empty; - } - - public override void OnOpenDocument(PdfWriter writer, Document document) - { - //base.OnOpenDocument(writer, document); - //tmpTotal = writer.DirectContent.CreateTemplate(100, 100); - //tmpTotal.BoundingBox = new Rectangle(-20, -20, 100, 100); - //PdfContentByte cb = writer.DirectContent; - } - public override void OnEndPage(PdfWriter writer, Document document) - { - if (!OnFoldoutPage) - { - base.OnEndPage(writer, document); - if (!CreatingFoldoutPage) - { - DrawBackground(writer.DirectContentUnder); - DrawPageList(writer.DirectContent); - DrawWatermark(writer.DirectContentUnder); - if (DoZoomOMatic) DrawZoomOMatic(writer.DirectContent); - } - CurrentPageNumber++; - } - else - { - if (!CreatingFoldoutPage) - { - DrawBackground(writer.DirectContentUnder); - DrawPageList(writer.DirectContent); - DrawWatermark(writer.DirectContentUnder); - if (DoZoomOMatic) DrawZoomOMatic(writer.DirectContent); - CurrentPageNumber++; - } - } - } - private PdfReader _BackgroundReader = null; - public PdfReader BackgroundReader - { - get - { - if (_BackgroundReader == null && _BackgroundFile != null && File.Exists(_BackgroundFile)) - _BackgroundReader = new PdfReader(_BackgroundFile); - return _BackgroundReader; - } - } - private string _BackgroundFile = null; - public string BackgroundFile - { - get { return _BackgroundFile; } - set { _BackgroundFile = value; } - } - private PdfLayer _BackgroundLayer = null; - public PdfLayer BackgroundLayer - { - get { return _BackgroundLayer; } - set { _BackgroundLayer = value; } - } - private System.Drawing.PointF _BackgroundOffset = new System.Drawing.PointF(0, 0); - public System.Drawing.PointF BackgroundOffset - { - get { return _BackgroundOffset; } - set { _BackgroundOffset = value; } - } - public int BackgroundPageCount - { - get { return BackgroundReader == null ? 0 : BackgroundReader.NumberOfPages; } - } - private PdfImportedPage GetBackgroundPage(PdfContentByte cb) - { - if (BackgroundReader == null) return null; - int page = cb.PdfWriter.CurrentPageNumber + BackgroundPageOffset; - if (page < 1 || page > BackgroundPageCount) return null; - return cb.PdfWriter.GetImportedPage(BackgroundReader, page); - } - private void DrawBackground(PdfContentByte cb) - { - PdfImportedPage backgroundPage = GetBackgroundPage(cb); - if (backgroundPage == null) return; - if(BackgroundLayer != null) cb.BeginLayer(BackgroundLayer); - iTextSharp.text.Image image = iTextSharp.text.Image.GetInstance(backgroundPage); - image.SetAbsolutePosition(BackgroundOffset.X,BackgroundOffset.Y); - cb.AddImage(image); - if (BackgroundLayer != null) cb.EndLayer(); - } - private void DrawZoomOMatic(PdfContentByte cb) - { - cb.SaveState(); - ZoomOMatic(cb, 36); - cb.RestoreState(); - } - private bool _AllowAllWatermarks = false; - public bool AllowAllWatermarks - { - get { return _AllowAllWatermarks; } - set { _AllowAllWatermarks = value; } - } - private void DrawWatermark(PdfContentByte cb) - { - if (Watermark == null || Watermark.ToLower().Contains("none") || Watermark == "") return; - if (!AllowAllWatermarks && !AllowedWatermarks.Contains(Watermark)) return; - cb.SaveState(); - if (_WatermarkLayer != null) cb.BeginLayer(_WatermarkLayer); - SvgWatermark myWatermark = new SvgWatermark(cb, Watermark, System.Drawing.Color.Blue, .15F); - myWatermark.SetSquareDotPattern(.7F); - myWatermark.Draw(); - if (_WatermarkLayer != null) cb.EndLayer(); - cb.RestoreState(); - } - private void DrawPageList(PdfContentByte cb) - { - if (_MySvg != null) - { - cb.SaveState(); - if (_PageListLayer != null) cb.BeginLayer(_PageListLayer); - // Do anything needed to finish off the page - _MySvg.Draw(cb); - if (_PageListLayer != null) cb.EndLayer(); - cb.RestoreState(); - } - } - private void ZoomOMatic(PdfContentByte cb, float size) - { - for (float xx = 0; xx < cb.PdfDocument.PageSize.Width; xx += size) - { - for (float yy = 0; yy < cb.PdfDocument.PageSize.Height; yy += size) - { - PdfDestination dest = new PdfDestination(PdfDestination.FITR, xx - 1.5F * size, yy - 1.5F * size, xx + 1.5F * size, yy + 1.5F * size); - cb.SetAction(PdfAction.GotoLocalPage(cb.PdfWriter.CurrentPageNumber, dest, cb.PdfWriter), xx - size, yy - size, xx + size, yy + size); - } - } - } - public override void OnStartPage(PdfWriter writer, Document document) - { - //base.OnStartPage(writer, document); - } - public override void OnCloseDocument(PdfWriter writer, Document document) - { - // Build Templates for Page Count - } - } - public class SvgWatermark - { - private PdfContentByte _ContentByte; - private string _Text; - private Color _Color; - private PdfPatternPainter _PatternPainter; - private BaseFont _Basefont; - private float _Fontsize; - private float _XOffset; - private float _YOffset; - private float _TextAngle; - private float _Opacity; - public SvgWatermark(PdfContentByte contentByte, string text, System.Drawing.Color color, float opacity) - { - _ContentByte = contentByte; - _Text = text; - float radius = .5F; - float space = 3; - _Color = new Color(color); - _Opacity = opacity; - SetDotPattern(radius, space); - SetTextLayout(); - } - private void SetTextLayout() - { - Rectangle pageSize = _ContentByte.PdfWriter.PageSize; // Get page size - _Basefont = BaseFont.CreateFont(BaseFont.HELVETICA_BOLD, Encoding.ASCII.EncodingName, false); - float hgtA = _Basefont.GetAscentPoint(_Text, 12); - //float hgtD = basefont.GetDescentPoint(text,20); - float wid = _Basefont.GetWidthPointKerned(_Text, 12); - //Console.WriteLine("{0} {1} {2}",hgtA,hgtD,wid); - float rho = wid / hgtA; - float x2 = (rho * pageSize.Height - pageSize.Width) / (rho * rho - 1); - float y1 = x2 * rho; - float y2 = pageSize.Height - y1; - float x1 = pageSize.Width - x2; - _XOffset = x2 + x1 / 2; - _YOffset = y1 / 2; - _TextAngle = CalcAngle(y1, x1); - _Fontsize = (float)(10 * Math.Sqrt(x2 * x2 + y2 * y2) / hgtA); - } - public void SetDotPattern(float radius, float space) - { - _PatternPainter = _ContentByte.CreatePattern(radius * 2, radius * 2, radius * 2 + space, radius * 2 + space); - PdfGState gState = new PdfGState(); - gState.FillOpacity = _Opacity; - _PatternPainter.SetGState(gState); - _PatternPainter.SetColorFill(_Color); - _PatternPainter.Circle(radius, radius, radius); - _PatternPainter.Fill(); - } - public void SetSquareDotPattern(float radius) - { - _PatternPainter = _ContentByte.CreatePattern(radius * 4, radius * 2, radius * 4, radius * 2); - PdfGState gState = new PdfGState(); - gState.FillOpacity = .5f * _Opacity; - _PatternPainter.SetGState(gState); - _PatternPainter.SetColorFill(_Color); - _PatternPainter.Rectangle(0, 0, radius, radius); - _PatternPainter.Rectangle(radius * 2, radius, radius, radius); - _PatternPainter.Fill(); - } - public void SetHashPattern(float thickness, float size) - { - _PatternPainter = _ContentByte.CreatePattern(size, size, size, size); - PdfGState gState = new PdfGState(); - gState.FillOpacity = _Opacity; - gState.StrokeOpacity = _Opacity; - _PatternPainter.SetGState(gState); - _PatternPainter.SetLineWidth(.01F); - _PatternPainter.SetColorStroke(_Color); // Set color - _PatternPainter.MoveTo(0, 0); - _PatternPainter.LineTo(size, size); - _PatternPainter.MoveTo(size, 0); - _PatternPainter.LineTo(0, size); - _PatternPainter.Stroke(); - } - public void SetTextPattern(float fontSize, float space) - { - float hgtA = _Basefont.GetAscentPoint(_Text, fontSize) + _Basefont.GetDescentPoint(_Text, fontSize); - float wid = _Basefont.GetWidthPointKerned(_Text, fontSize); - _PatternPainter = _ContentByte.CreatePattern(wid, hgtA, wid + space, hgtA + space); - _PatternPainter.SetFontAndSize(_Basefont, fontSize); - _PatternPainter.BoundingBox = new Rectangle(-20, -20, 100, 100); - _PatternPainter.BeginText(); - PdfGState gs1 = new PdfGState(); - gs1.FillOpacity = _Opacity; - _PatternPainter.SetGState(gs1); - _PatternPainter.SetColorFill(_Color); // Set color - _PatternPainter.ShowText(_Text); - _PatternPainter.EndText(); - } - public void SetTextPattern2(float fontSize) - { - BaseFont _Basefont2 = BaseFont.CreateFont(BaseFont.HELVETICA, Encoding.ASCII.EncodingName, false); - float hgtA = _Basefont2.GetAscentPoint(_Text, fontSize); - float wid = _Basefont2.GetWidthPointKerned(_Text, fontSize); - _PatternPainter = _ContentByte.CreatePattern(wid * 2, hgtA * 2, wid * 2, hgtA * 2); - _PatternPainter.SetFontAndSize(_Basefont2, fontSize); - _PatternPainter.BoundingBox = new Rectangle(-20, -20, 100, 100); - _PatternPainter.BeginText(); - PdfGState gs1 = new PdfGState(); - gs1.FillOpacity = _Opacity; - _PatternPainter.SetGState(gs1); - _PatternPainter.SetColorFill(_Color); // Set color - _PatternPainter.ShowText(_Text); - _PatternPainter.ShowTextAligned(PdfContentByte.ALIGN_LEFT, _Text, wid, hgtA, 0); - _PatternPainter.EndText(); - } - public void Draw() - { - _ContentByte.SaveState(); - _ContentByte.BeginText(); - _ContentByte.SetPatternFill(_PatternPainter); - _ContentByte.SetTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE); - _ContentByte.SetLineWidth(.5F); - _ContentByte.SetFontAndSize(_Basefont, _Fontsize);// Set font and size - _ContentByte.SetColorStroke(_Color); - PdfGState gs2 = new PdfGState(); - gs2.StrokeOpacity = _Opacity; - _ContentByte.SetGState(gs2); - _ContentByte.ShowTextAlignedKerned(PdfContentByte.ALIGN_CENTER, _Text, _XOffset, _YOffset, _TextAngle);// Draw the text - _ContentByte.EndText(); - _ContentByte.FillStroke(); // Controlled by TextRenderMode above - _ContentByte.RestoreState(); - } - private float CalcAngle(float opposite, float adjacent) - { - return (float)(Math.Atan2(opposite, adjacent) * (180 / Math.PI)); - } - - } - public enum SvgWatermarkFill - { - Dots = 1, - Text1 = 2, - Text2 = 3, - Hash = 4 - } -} \ No newline at end of file diff --git a/PROMS/Volian.Utils.Library/CvtFont/CvtFont.cs b/PROMS/Volian.Utils.Library/CvtFont/CvtFont.cs deleted file mode 100644 index 5525ef81..00000000 --- a/PROMS/Volian.Utils.Library/CvtFont/CvtFont.cs +++ /dev/null @@ -1,346 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Xml; - -namespace CvtFont -{ - // - - public static class CvtFont - { - public const int ELITE = 0; - public const int PICA = 1; - public const int LN_PRN = 2; - public const int CONDENSE = 3; - public const int SANSERIF = 4; - public const int PICA12 = 5; - public const int PROPORTIONAL = 6; - public const int PROPT12 = 7; - public const int HVLPT18 = 8; - public const int HVLPT25 = 9; - public const int SPECIALCHARS = 10; - public const int PT14 = 11; - public const int SANSERIF14 = 12; - public const int SANSERIF17 = 13; - public const int HVLPT12 = 14; - public const int NARRATOR = 15; - public const int MEDUPUNIVERS = 16; - public const int LGUPMED16 = 17; - /* Old name for PROPT10: public const int PT12BOLD=18 */ - public const int PROPT10 = 18; - public const int LG1275HP4SI = 19; - public const int HVLPT10 = 20; - public const int HVLPT8 = 21; - public const int HVLPT14 = 22; - public const int SANSERIF25 = 23; - public const int EYECHART = 24; - public const int TIMES11 = 25; - public const int SANSCOND = 26; - - private static string [] OldNames = { - "Elite", - "Pica", - "LnPrn", - "Condense", - "SanSerif", - "Pica12", - "Proportional", - "Propt12", - "HvlPt18", - "HvlPt25", - "SpecialChars", - "Pt14", - "SanSerif14", - "SanSerif17", - "HvlPt12", - "Narrator", - "MedUpUnivers",/* this font is not used */ - "LgUpMed16", - "Propt10", - "Lg1275Hp4Si", - "HvlPt10", - "HvlPt8", - "HvlPt14", - "SanSerif25", - "EyeChart", - "Times11", - "SansCond", - "BigScript" - }; - private static string[] NewXML = { - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "" - }; - private static string[] NewFamily = { - "Prestige Elite Tall", - "Courier New", - "Times New Roman", - "Times New Roman", - "Letter Gothic", - "Courier New", - "Arial", - "Arial", - "Times New Roman", - "Times New Roman", - "VolianDraw XXXXXX", - "Letter Gothic", - "Arial", - "Arial", - "Times New Roman", - "Gothic Ultra", - "NA", - "Letter Gothic Tall", - "Arial", - "Letter Gothic Tall", - "Times New Roman", - "Times New Roman", - "Times New Roman", - "Arial", - "Gothic Ultra", - "Times New Roman", - "Letter Gothic", - "VolianScript" - }; - private static int[] NewSize = { - 10, - 12, - 7, - 7, - 10, - 12, - 18, - 11, - 18, - 25, - 12, - 12, - 14, - 17, - 12, - 12, - 0, - 7, - 10, /* PROPT10 - NSP & TUEC - change from 0 to 10 */ - //10, - 10, - 8, - 14, - 25, - 14, - 11, - 7, - 32 - }; - /* The following array is not used for the migration. It is here to capture the - * values. Note that their was a difference in values in 16-bit for some of the fonts, - * as compared to the CPIS below. These fonts are PICA12, PROPT10 (PT12BOLD), HVLPT10, - * HVLPT8, HVLPT14. This was causing an incorrect results on placement of some of pagelist - * items in 16bit. What this means is that some of the 32bit will not compare identically - * with 16bit output. - */ - private static float[] PrintPitch = { - 12, //ELITE - 10, //PICA - 16.66F, //LN_PRN - 16.67F, //CONDENSE - 12, //SANSERIF - 12, //PICA12 - 10, //PROPORTIONAL - 10, //PROPT12 - 12, //HVLPT18 - 12, //HVLPT25 - 10, //SPECIALCHARS - 10, //PT14 - 12, //SANSERIF14 - 12, //SANSERIF17 - 12, //HVLPT12 - 10, //NARRATOR - 16.67F, //MEDUPUNIVERS - 16.67F, //LGUPMED16 - 10, //PROPT10 - 12, //LG1275HP4SI - 12, //HVLPT10 - 12, //HVLPT8 - 12, //HVLPT14 - 12, //SANSERIF25 - 8.11F, //EYECHART - 12, //TIMES11 - 16.67F, //SANSCOND - 8 //VOLIANSCRIPT?? - }; - private static float[] CPIS = { - 12, // ELITE - 10, // PICA - 16.66F, // LN_PRN - 16.665F, // CONDENSE - 12, // SANSERIF - 10, // PICA12 - 10, // PROPORTIONAL - 10, // PROPT12 - 12, // HVLPT18 - 12, // HVLPT25 - 10, // SPECIALCHARS - 10, // PT14 - 12, // SANSERIF14 - 12, // SANSERIF17 - 12, // HVLPT12 - 10, // NARRATOR - 16.67F, // MEDUPUNIVERS - medium upright univers fonts (HP3 internal) - 16.67F, // LGUPMED16 - Letter Gothic Upright Medium 16.67 - 12, // PT12BOLD - 12.50F, // LG1275HP4SI - 10, // HVLPT10 - 8, // HVLPT8 - 14, // HVLP14 - 12, // SANSERIF25 - 8, // EYECHART - 12, // TIMES11 - 16.665F // SANSCOND - }; - private static float[] CPISBadPICA12 = { - 12, // ELITE - 10, // PICA - 16.66F, // LN_PRN - 16.665F, // CONDENSE - 12, // SANSERIF - 12, // PICA12 - 10, // PROPORTIONAL - 10, // PROPT12 - 12, // HVLPT18 - 12, // HVLPT25 - 10, // SPECIALCHARS - 10, // PT14 - 12, // SANSERIF14 - 12, // SANSERIF17 - 12, // HVLPT12 - 10, // NARRATOR - 16.67F, // MEDUPUNIVERS - medium upright univers fonts (HP3 internal) - 16.67F, // LGUPMED16 - Letter Gothic Upright Medium 16.67 - 12, // PT12BOLD - 12.50F, // LG1275HP4SI - 10, // HVLPT10 - 8, // HVLPT8 - 14, // HVLP14 - 12, // SANSERIF25 - 8, // EYECHART - 12, // TIMES11 - 16.665F // SANSCOND - }; - private static Dictionary OldToNewStrings=null; - public static string ConvertToString(string oldstr) - { - if (OldToNewStrings == null) InitializeDictionary(); - return OldToNewStrings[oldstr]; - } - - public static string ConvertToFamily(string oldstr) - { - int i = 0; - foreach (string str in OldNames) - { - if (str == oldstr) return NewFamily[i]; - i++; - } - return null; - } - public static int ConvertToSize(string oldstr) - { - int i = 0; - foreach (string str in OldNames) - { - if (str == oldstr) return NewSize[i]; - i++; - } - return -1; - } - //public static float GetNewSize(uint i) - //{ - // return ConvertToNewSize[i&63]; - //} - - private static bool FontIsPropt(uint fontFace) - { - int f = (int)fontFace & 63; - switch (f) - { - case PROPORTIONAL: - case PROPT12: - case PROPT10: - case HVLPT12: - case HVLPT10: - case HVLPT8: - case HVLPT14: - case HVLPT18: - case HVLPT25: - case SANSERIF14: - case SANSERIF17: - case SANSERIF25: - case TIMES11: - return true; - default: - return false; - } - } - public static float GetCPIs(uint i) - { - if (FontIsPropt(i)) return 12; - uint j = i & 63; - if (j > CPIS.Length - 1) - return CPIS[0]; - return CPIS[j]; - } - public static float GetCPISBadPICA12(uint i) - { - if (FontIsPropt(i)) return 12; - uint j = i & 63; - if (j > CPISBadPICA12.Length - 1) - return CPISBadPICA12[0]; - return CPISBadPICA12[j]; - } - public static float GetPrintPitch(uint i) - { - if (FontIsPropt(i)) return 12; - return PrintPitch[i & 63]; - } - //public static XmlElement ConvertToXML(string oldstr) - //{ - // if (OldToNewStrings == null) InitializeDictionary(); - // XmlElement xml = new XmlElement(); - // xml.InnerXml = OldToNewStrings[oldstr]; - // return xml; - //} - private static void InitializeDictionary() - { - int i = 0; - foreach (string str in OldNames) - OldToNewStrings.Add(str, NewXML[i]); - } - } -} diff --git a/PROMS/Volian.Utils.Library/CvtFont/CvtFont.csproj b/PROMS/Volian.Utils.Library/CvtFont/CvtFont.csproj deleted file mode 100644 index 2957de8b..00000000 --- a/PROMS/Volian.Utils.Library/CvtFont/CvtFont.csproj +++ /dev/null @@ -1,52 +0,0 @@ - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {652EB5F6-18DD-4F22-9C0B-62EB46613C4D} - Library - Properties - CvtFont - CvtFont - SAK - SAK - SAK - SAK - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - x86 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/Volian.Utils.Library/CvtFont/Properties/AssemblyInfo.cs b/PROMS/Volian.Utils.Library/CvtFont/Properties/AssemblyInfo.cs deleted file mode 100644 index 06df2886..00000000 --- a/PROMS/Volian.Utils.Library/CvtFont/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CvtFont")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Volian Enterprises, Inc.")] -[assembly: AssemblyProduct("CvtFont")] -[assembly: AssemblyCopyright("Copyright © Volian Enterprises, Inc. 2006")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d2266793-0f12-4f71-bbd4-0a1617554b27")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PROMS/Volian.Utils.Library/Volian.Utils.Library.sln b/PROMS/Volian.Utils.Library/Volian.Utils.Library.sln deleted file mode 100644 index c5470378..00000000 --- a/PROMS/Volian.Utils.Library/Volian.Utils.Library.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volian.Utils.Library", "Volian.Utils.Library.csproj", "{62314B9C-DA84-4037-8B68-AA18C1F641F5}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {62314B9C-DA84-4037-8B68-AA18C1F641F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {62314B9C-DA84-4037-8B68-AA18C1F641F5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {62314B9C-DA84-4037-8B68-AA18C1F641F5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {62314B9C-DA84-4037-8B68-AA18C1F641F5}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/PROMS/Volian.Utils.Library/vlnControl.xml b/PROMS/Volian.Utils.Library/vlnControl.xml deleted file mode 100644 index 9c97842a..00000000 --- a/PROMS/Volian.Utils.Library/vlnControl.xml +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/Volian.Utils.Library/vlnControl.xml.org b/PROMS/Volian.Utils.Library/vlnControl.xml.org deleted file mode 100644 index 44fc9861..00000000 --- a/PROMS/Volian.Utils.Library/vlnControl.xml.org +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/PROMS/XYPlots/XYPlots.sln b/PROMS/XYPlots/XYPlots.sln deleted file mode 100644 index efd5460d..00000000 --- a/PROMS/XYPlots/XYPlots.sln +++ /dev/null @@ -1,34 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XYPlots", "XYPlots.csproj", "{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test XYPlots", "Test XYPlots\Test XYPlots.csproj", "{2BB292F1-507C-492F-AE66-CBEA54632B59}" -EndProject -Global - GlobalSection(SourceCodeControl) = preSolution - SccNumberOfProjects = 3 - SccLocalPath0 = . - SccProjectUniqueName1 = Test\u0020XYPlots\\Test\u0020XYPlots.csproj - SccLocalPath1 = . - SccProjectFilePathRelativizedFromConnection1 = Test\u0020XYPlots\\ - SccProjectUniqueName2 = XYPlots.csproj - SccLocalPath2 = . - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {04E168D0-9CC7-43D9-A9F1-93E481EA86A3}.Release|Any CPU.Build.0 = Release|Any CPU - {2BB292F1-507C-492F-AE66-CBEA54632B59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2BB292F1-507C-492F-AE66-CBEA54632B59}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2BB292F1-507C-492F-AE66-CBEA54632B59}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2BB292F1-507C-492F-AE66-CBEA54632B59}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal